Computes the integral over a binned distribution by summing the bin contents of all bins.
Definition at line 24 of file RooBinIntegrator.h.
Public Member Functions | |
RooBinIntegrator (const RooAbsFunc &function, const RooNumIntConfig &config) | |
Construct integrator on given function binding binding. | |
RooBinIntegrator (const RooAbsFunc &function, int numBins=100) | |
Construct integrator on given function binding binding. | |
bool | checkLimits () const override |
Check that our integration range is finite and otherwise return false. | |
double | integral (const double *yvec=nullptr) override |
Calculate numeric integral at given set of function binding parameters, for any number of dimensions. | |
virtual bool | setLimits (double *, double *) |
bool | setLimits (double *xmin, double *xmax) override |
Change our integration limits. | |
virtual bool | setLimits (double xmin, double xmax) |
Interface to set limits on integration. | |
bool | setUseIntegrandLimits (bool flag) override |
Interface function that allows to defer limit definition to integrand definition. | |
![]() | |
RooAbsIntegrator () | |
RooAbsIntegrator (const RooAbsFunc &function, bool printEvalCounter=false) | |
Copy constructor. | |
virtual | ~RooAbsIntegrator ()=default |
double | calculate (const double *yvec=nullptr) |
Calculate integral value with given array of parameter values. | |
const RooAbsFunc * | integrand () const |
Return integrand function binding. | |
double | integrand (const double x[]) const |
Return value of integrand at given observable values. | |
bool | isValid () const |
Is integrator in valid state. | |
bool | printEvalCounter () const |
void | setPrintEvalCounter (bool value) |
Protected Member Functions | |
RooBinIntegrator (const RooBinIntegrator &) | |
void | recursive_integration (const UInt_t d, const double delta, ROOT::Math::KahanSum< double > &sum) |
It performs recursively for loops to calculate N-dimensional integration. | |
Static Protected Member Functions | |
static void | registerIntegrator (RooNumIntFactory &fact) |
Register RooBinIntegrator, is parameters and capabilities with RooNumIntFactory. | |
Protected Attributes | |
std::vector< std::vector< double > > | _binb |
! list of bin boundaries | |
Int_t | _numBins = 0 |
! Size of integration range | |
bool | _useIntegrandLimits = false |
If true limits of function binding are used. | |
std::vector< double > | _x |
! do not persist, store here N-dimensional evaluation point when integrating | |
std::vector< double > | _xmax |
! Upper integration bound | |
std::vector< double > | _xmin |
! Lower integration bound | |
![]() | |
const RooAbsFunc * | _function = nullptr |
Pointer to function binding of integrand. | |
bool | _printEvalCounter = false |
If true print number of function evaluation required for integration. | |
bool | _valid = false |
Is integrator in valid state? | |
Friends | |
class | RooNumIntFactory |
#include </github/home/ROOT-CI/src/roofit/roofitcore/src/RooBinIntegrator.h>
RooBinIntegrator::RooBinIntegrator | ( | const RooAbsFunc & | function, |
int | numBins = 100 ) |
Construct integrator on given function binding binding.
Definition at line 69 of file RooBinIntegrator.cxx.
RooBinIntegrator::RooBinIntegrator | ( | const RooAbsFunc & | function, |
const RooNumIntConfig & | config ) |
Construct integrator on given function binding binding.
Definition at line 106 of file RooBinIntegrator.cxx.
|
protected |
|
overridevirtual |
Check that our integration range is finite and otherwise return false.
Update the limits from the integrand if requested.
Reimplemented from RooAbsIntegrator.
Definition at line 133 of file RooBinIntegrator.cxx.
Calculate numeric integral at given set of function binding parameters, for any number of dimensions.
Implements RooAbsIntegrator.
Definition at line 161 of file RooBinIntegrator.cxx.
|
protected |
It performs recursively for loops to calculate N-dimensional integration.
d | the current recursivity depth (dimension currently being for-looped) |
delta | the (d-1)-dimensional bin width/area/volume/hypervolume... |
sum | the resulting integral where to accumulate the integral, passed by reference |
Definition at line 179 of file RooBinIntegrator.cxx.
|
staticprotected |
Register RooBinIntegrator, is parameters and capabilities with RooNumIntFactory.
Definition at line 46 of file RooBinIntegrator.cxx.
Reimplemented from RooAbsIntegrator.
Definition at line 54 of file RooAbsIntegrator.h.
Change our integration limits.
Return true if the new limits are ok, or otherwise false. Always returns false and does nothing if this object was constructed to always use our integrand's limits.
Reimplemented from RooAbsIntegrator.
Definition at line 117 of file RooBinIntegrator.cxx.
Interface to set limits on integration.
Reimplemented from RooAbsIntegrator.
Definition at line 55 of file RooAbsIntegrator.cxx.
Interface function that allows to defer limit definition to integrand definition.
Reimplemented from RooAbsIntegrator.
Definition at line 36 of file RooBinIntegrator.h.
|
friend |
Definition at line 43 of file RooBinIntegrator.h.
|
protected |
! list of bin boundaries
Definition at line 50 of file RooBinIntegrator.h.
|
mutableprotected |
! Size of integration range
Definition at line 51 of file RooBinIntegrator.h.
If true limits of function binding are used.
Definition at line 53 of file RooBinIntegrator.h.
|
protected |
! do not persist, store here N-dimensional evaluation point when integrating
Definition at line 57 of file RooBinIntegrator.h.
|
mutableprotected |
! Upper integration bound
Definition at line 49 of file RooBinIntegrator.h.
|
mutableprotected |
! Lower integration bound
Definition at line 48 of file RooBinIntegrator.h.