Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RooBinIntegrator Class Reference

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.
 
- Public Member Functions inherited from RooAbsIntegrator
 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 RooAbsFuncintegrand () 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
 
- Protected Attributes inherited from RooAbsIntegrator
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>

Inheritance diagram for RooBinIntegrator:
[legend]

Constructor & Destructor Documentation

◆ RooBinIntegrator() [1/3]

RooBinIntegrator::RooBinIntegrator ( const RooAbsFunc & function,
int numBins = 100 )

Construct integrator on given function binding binding.

Definition at line 69 of file RooBinIntegrator.cxx.

◆ RooBinIntegrator() [2/3]

RooBinIntegrator::RooBinIntegrator ( const RooAbsFunc & function,
const RooNumIntConfig & config )

Construct integrator on given function binding binding.

Definition at line 106 of file RooBinIntegrator.cxx.

◆ RooBinIntegrator() [3/3]

RooBinIntegrator::RooBinIntegrator ( const RooBinIntegrator & )
protected

Member Function Documentation

◆ checkLimits()

bool RooBinIntegrator::checkLimits ( ) const
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.

◆ integral()

double RooBinIntegrator::integral ( const double * yvec = nullptr)
overridevirtual

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.

◆ recursive_integration()

void RooBinIntegrator::recursive_integration ( const UInt_t d,
const double delta,
ROOT::Math::KahanSum< double > & sum )
protected

It performs recursively for loops to calculate N-dimensional integration.

Parameters
dthe current recursivity depth (dimension currently being for-looped)
deltathe (d-1)-dimensional bin width/area/volume/hypervolume...
sumthe resulting integral where to accumulate the integral, passed by reference

Definition at line 179 of file RooBinIntegrator.cxx.

◆ registerIntegrator()

void RooBinIntegrator::registerIntegrator ( RooNumIntFactory & fact)
staticprotected

Register RooBinIntegrator, is parameters and capabilities with RooNumIntFactory.

Definition at line 46 of file RooBinIntegrator.cxx.

◆ setLimits() [1/3]

virtual bool RooAbsIntegrator::setLimits ( double * ,
double *  )
inlinevirtual

Reimplemented from RooAbsIntegrator.

Definition at line 54 of file RooAbsIntegrator.h.

◆ setLimits() [2/3]

bool RooBinIntegrator::setLimits ( double * xmin,
double * xmax )
overridevirtual

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.

◆ setLimits() [3/3]

bool RooAbsIntegrator::setLimits ( double xmin,
double xmax )
virtual

Interface to set limits on integration.

Reimplemented from RooAbsIntegrator.

Definition at line 55 of file RooAbsIntegrator.cxx.

◆ setUseIntegrandLimits()

bool RooBinIntegrator::setUseIntegrandLimits ( bool flag)
inlineoverridevirtual

Interface function that allows to defer limit definition to integrand definition.

Reimplemented from RooAbsIntegrator.

Definition at line 36 of file RooBinIntegrator.h.

Friends And Related Symbol Documentation

◆ RooNumIntFactory

friend class RooNumIntFactory
friend

Definition at line 43 of file RooBinIntegrator.h.

Member Data Documentation

◆ _binb

std::vector<std::vector<double> > RooBinIntegrator::_binb
protected

! list of bin boundaries

Definition at line 50 of file RooBinIntegrator.h.

◆ _numBins

Int_t RooBinIntegrator::_numBins = 0
mutableprotected

! Size of integration range

Definition at line 51 of file RooBinIntegrator.h.

◆ _useIntegrandLimits

bool RooBinIntegrator::_useIntegrandLimits = false
protected

If true limits of function binding are used.

Definition at line 53 of file RooBinIntegrator.h.

◆ _x

std::vector<double> RooBinIntegrator::_x
protected

! do not persist, store here N-dimensional evaluation point when integrating

Definition at line 57 of file RooBinIntegrator.h.

◆ _xmax

std::vector<double> RooBinIntegrator::_xmax
mutableprotected

! Upper integration bound

Definition at line 49 of file RooBinIntegrator.h.

◆ _xmin

std::vector<double> RooBinIntegrator::_xmin
mutableprotected

! Lower integration bound

Definition at line 48 of file RooBinIntegrator.h.

  • roofit/roofitcore/src/RooBinIntegrator.h
  • roofit/roofitcore/src/RooBinIntegrator.cxx