41using std::endl, std::string;
50 RooRealVar maxEval2D(
"maxEval2D",
"Max number of function evaluations for 2-dim integrals",100000) ;
51 RooRealVar maxEval3D(
"maxEval3D",
"Max number of function evaluations for 3-dim integrals",1000000) ;
52 RooRealVar maxEvalND(
"maxEvalND",
"Max number of function evaluations for >3-dim integrals",10000000) ;
53 RooRealVar maxWarn(
"maxWarn",
"Max number of warnings on precision not reached that is printed",5) ;
56 return std::make_unique<RooAdaptiveIntegratorND>(function, config);
59 fact.
registerPlugin(
"RooAdaptiveIntegratorND", creator, {maxEval2D,maxEval3D,maxEvalND,maxWarn},
75 _nWarn(static_cast<
Int_t>(config.getConfigSection(
"RooAdaptiveIntegratorND").getRealValue(
"maxWarn")))
78 _rooFunctor = std::make_unique<RooFunctor>(function);
81 switch (
_func->NDim()) {
82 case 1:
throw string(
Form(
"RooAdaptiveIntegratorND::ctor ERROR dimension of function must be at least 2")) ;
108 oocoutW(
nullptr, NumIntegration) <<
"RooAdaptiveIntegratorND::dtor(" <<
_intName
109 <<
") WARNING: Number of suppressed warningings about integral evaluations where target precision was not reached is " <<
_nError-
_nWarn << std::endl;
146 oocoutE(
nullptr,Integration) <<
"RooAdaptiveIntegratorND::setLimits: cannot override integrand's limits" << endl;
169 oocoutW(
nullptr, NumIntegration) <<
"RooAdaptiveIntegratorND::integral(" <<
integrand()->
getName() <<
") WARNING: target rel. precision not reached due to nEval limit of "
174 <<
") Further warnings on target precision are suppressed conform specification in integrator specification" << endl ;
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Class for adaptive quadrature integration in multi-dimensions using rectangular regions.
int Status() const override
return status of integration
double Integral(const double *xmin, const double *xmax) override
evaluate the integral with the previously given function between xmin[] and xmax[]
void SetFunction(const IMultiGenFunction &f) override
set the integration function (must implement multi-dim function interface: IBaseFunctionMultiDim)
double RelError() const
return relative error
double getRealValue(const char *name, double defVal=0.0, bool verbose=false) const
Get value of a RooAbsReal stored in set with given name.
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
virtual double getMaxLimit(UInt_t dimension) const =0
virtual double getMinLimit(UInt_t dimension) const =0
virtual const char * getName() const
Name of function binding.
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
const RooAbsFunc * integrand() const
Return integrand function binding.
Int_t _nmax
Max number of divisions.
bool checkLimits() const override
Check that our integration range is finite and otherwise return false.
bool _useIntegrandLimits
If true limits of function binding are used.
double integral(const double *yvec=nullptr) override
Evaluate integral at given function binding parameter values.
std::unique_ptr< RooFunctor > _rooFunctor
! RooFunctor binding
bool setLimits(double *xmin, double *xmax) override
Change our integration limits.
RooAdaptiveIntegratorND(const RooAbsFunc &function, const RooNumIntConfig &config)
Constructor of integral on given function binding and with given configuration.
std::vector< double > _xmin
Lower bound in each dimension.
double _epsRel
Relative precision.
double _epsAbs
Absolute precision.
TString _intName
Integrand name.
~RooAdaptiveIntegratorND() override
Destructor.
static void registerIntegrator(RooNumIntFactory &fact)
Register RooAdaptiveIntegratorND, its parameters, dependencies and capabilities with RooNumIntFactory...
Int_t _nError
Number of error occurrences.
std::unique_ptr< ROOT::Math::IMultiGenFunction > _func
! ROOT::Math multi-parameter function binding
ROOT::Math::AdaptiveIntegratorMultiDim * _integrator
std::vector< double > _xmax
Upper bound in each dimension.
Int_t _nWarn
Max number of warnings to be issued ;.
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
Factory to instantiate numeric integrators from a given function binding and a given configuration.
bool registerPlugin(std::string const &name, Creator const &creator, const RooArgSet &defConfig, bool canIntegrate1D, bool canIntegrate2D, bool canIntegrateND, bool canIntegrateOpenEnded, const char *depName="")
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
Variable that can be changed from the outside.