69 for (
int j = 1;
j <
n - 1;
j++) {
77 for (
int j = 1;
j <= it;
j++) {
103 const int nInt = 1 << (
n - 2);
108 for (
int j = 0;
j <
nInt; ++
j) {
119std::pair<double, double>
extrapolate(
int n,
double const *
h,
double const *s,
double *
c,
double *
d)
125 double dif = std::abs(
xa[1]);
126 for (
int i = 1; i <=
nPoints; i++) {
127 double dift = std::abs(
xa[i]);
138 for (
int i = 1; i <=
nPoints -
m; i++) {
140 double hp =
xa[i +
m];
141 double w =
c[i + 1] -
d[i];
144 throw std::runtime_error(
"RooRombergIntegrator::extrapolate: internal error");
163 std::span<double>
hArr, std::span<double>
sArr)
171 std::array<double, nPoints + 1>
cArr = {};
172 std::array<double, nPoints + 1>
dArr = {};
183 for (
int jj = 0;
jj <=
j;
jj++) {
246 extrap.defineType(
"None", 0);
247 extrap.defineType(
"Wynn-Epsilon", 1);
248 extrap.setLabel(
"Wynn-Epsilon");
254 std::string
name =
"RooIntegrator1D";
257 return std::make_unique<RooRombergIntegrator>(function, config, 1,
false);
269 return std::make_unique<RooRombergIntegrator>(function, config, 2,
false);
271 std::string
name2d =
"RooIntegrator2D";
281 return std::make_unique<RooRombergIntegrator>(function, config, 1,
true);
292 return std::make_unique<RooRombergIntegrator>(function, config, 2,
true);
300 "RooSegmentedIntegrator1D");
323 _useIntegrandLimits(
false),
343 _epsAbs(config.epsAbs()),
344 _epsRel(config.epsRel())
360 oocoutE(
nullptr, Integration) <<
"RooRombergIntegrator::ctor() ERROR: fixSteps>maxSteps, fixSteps set to maxSteps"
376 _useIntegrandLimits(
false),
378 _epsAbs(config.epsAbs()),
379 _epsRel(config.epsRel())
411 oocoutE(
nullptr, Integration) <<
"RooRombergIntegrator::initialize: cannot integrate invalid function"
433 oocoutE(
nullptr, Integration) <<
"RooRombergIntegrator::setLimits: cannot override integrand's limits"
454 const_cast<std::vector<double> &
>(
_xmin).resize(
_nDim);
455 const_cast<std::vector<double> &
>(
_xmax).resize(
_nDim);
466 oocoutE(
nullptr, Integration) <<
"RooRombergIntegrator::checkLimits: bad range with min > max (_xmin[" <<
iDim
467 <<
"] = " <<
xmin <<
" _xmax[" <<
iDim <<
"] = " <<
xmax <<
")" << std::endl;
531 auto func = [&](
double x) {
544 <<
" over range (" <<
xmin <<
"," <<
xmax <<
") did not converge after "
547 ooccoutW(
nullptr, Integration) <<
" [" <<
j <<
"] h = " <<
hArr[
j] <<
" , s = " <<
sArr[
j] << std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
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
UInt_t getDimension() const
virtual const char * getName() const
Name of function binding.
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
bool isValid() const
Is integrator in valid state.
const RooAbsFunc * _function
Pointer to function binding of integrand.
const RooAbsFunc * integrand() const
Return integrand function binding.
bool _valid
Is integrator in valid state?
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
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.
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
Factory to instantiate numeric integrators from a given function binding and a given configuration.
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Variable that can be changed from the outside.
std::vector< double > _xmin
! Lower integration bounds
std::vector< double > _wksp
! Integrator workspace
RooRombergIntegrator(const RooAbsFunc &function, SummationRule rule=Trapezoid, int maxSteps=0, double eps=0)
Construct integrator on given function binding, using specified summation rule, maximum number of ste...
bool _useIntegrandLimits
If true limits of function binding are used.
static void registerIntegrator(RooNumIntFactory &fact)
Register integrator plugins, their parameters and capabilities with RooNumIntFactory.
double _epsRel
Relative convergence tolerance.
bool checkLimits() const override
Check that our integration range is finite and otherwise return false.
bool initialize()
Initialize the integrator.
double integral(const double *yvec=nullptr) override
bool _doExtrap
Apply conversion step?
int _nSeg
Number of segments.
std::vector< double > _xmax
! Upper integration bounds
bool setLimits(double *xmin, double *xmax) override
Change our integration limits.
int _fixSteps
Fixed number of steps.
double _epsAbs
Absolute convergence tolerance.
int _maxSteps
Maximum number of steps.
int _minStepsZero
Minimum number of steps to declare convergence to zero.
std::pair< double, int > integrate1d(std::function< double(double)> func, bool doTrapezoid, int maxSteps, int minStepsZero, int fixSteps, double epsAbs, double epsRel, bool doExtrap, double xmin, double xmax, std::span< double > hArr, std::span< double > sArr)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
static uint64_t sum(uint64_t i)