Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooGaussKronrodIntegrator1D Class Reference

Implements the Gauss-Kronrod integration algorithm.

An Gaussian quadrature method for numerical integration in which error is estimation based on evaluation at special points known as "Kronrod points." By suitably picking these points, abscissas from previous iterations can be reused as part of the new set of points, whereas usual Gaussian quadrature would require recomputation of all abscissas at each iteration.

This class automatically handles (-inf,+inf) integrals by dividing the integration in three regions (-inf,-1), (-1,1), (1,inf) and calculating the 1st and 3rd term using a x -> 1/x coordinate transformation

This class embeds the Gauss-Kronrod integrator from the GNU Scientific Library version 1.5 and applies the 10-, 21-, 43- and 87-point rule in succession until the required target precision is reached

Definition at line 24 of file RooGaussKronrodIntegrator1D.h.

Public Member Functions

 RooGaussKronrodIntegrator1D (const RooAbsFunc &function, const RooNumIntConfig &config)
 Construct integral on 'function' using given configuration object.
 
 RooGaussKronrodIntegrator1D (const RooAbsFunc &function, double xmin, double xmax, const RooNumIntConfig &config)
 Construct integral on 'function' using given configuration object in the given range.
 
bool checkLimits () const override
 Check that our integration range is finite and otherwise return false.
 
double integral (const double *yvec=nullptr) override
 Calculate and return integral.
 
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

bool initialize ()
 Perform one-time initialization of integrator.
 
doublexvec (double &xx)
 

Static Protected Member Functions

static void registerIntegrator (RooNumIntFactory &fact)
 Register RooGaussKronrodIntegrator1D, its parameters and capabilities with RooNumIntConfig.
 

Protected Attributes

double _epsAbs
 do not persist
 
double _epsRel
 
bool _useIntegrandLimits
 
std::vector< double_x
 
double _xmax
 Lower integration bound.
 
double _xmin
 
- 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

double RooGaussKronrodIntegrator1D_GSL_GlueFunction (double x, void *data)
 
class RooNumIntFactory
 

#include </home/sftnight/build/workspace/root-makedoc-master/rootspi/rdoc/src/master/roofit/roofitmore/src/RooGaussKronrodIntegrator1D.h>

Inheritance diagram for RooGaussKronrodIntegrator1D:
[legend]

Constructor & Destructor Documentation

◆ RooGaussKronrodIntegrator1D() [1/2]

RooGaussKronrodIntegrator1D::RooGaussKronrodIntegrator1D ( const RooAbsFunc function,
const RooNumIntConfig config 
)

Construct integral on 'function' using given configuration object.

The integration range is taken from the definition in the function binding

Definition at line 111 of file RooGaussKronrodIntegrator1D.cxx.

◆ RooGaussKronrodIntegrator1D() [2/2]

RooGaussKronrodIntegrator1D::RooGaussKronrodIntegrator1D ( const RooAbsFunc function,
double  xmin,
double  xmax,
const RooNumIntConfig config 
)

Construct integral on 'function' using given configuration object in the given range.

Definition at line 123 of file RooGaussKronrodIntegrator1D.cxx.

Member Function Documentation

◆ checkLimits()

bool RooGaussKronrodIntegrator1D::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 171 of file RooGaussKronrodIntegrator1D.cxx.

◆ initialize()

bool RooGaussKronrodIntegrator1D::initialize ( )
protected

Perform one-time initialization of integrator.

Definition at line 139 of file RooGaussKronrodIntegrator1D.cxx.

◆ integral()

double RooGaussKronrodIntegrator1D::integral ( const double yvec = nullptr)
overridevirtual

Calculate and return integral.

Implements RooAbsIntegrator.

Definition at line 194 of file RooGaussKronrodIntegrator1D.cxx.

◆ registerIntegrator()

void RooGaussKronrodIntegrator1D::registerIntegrator ( RooNumIntFactory fact)
staticprotected

Register RooGaussKronrodIntegrator1D, its parameters and capabilities with RooNumIntConfig.

Definition at line 90 of file RooGaussKronrodIntegrator1D.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 RooGaussKronrodIntegrator1D::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 154 of file RooGaussKronrodIntegrator1D.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 RooGaussKronrodIntegrator1D::setUseIntegrandLimits ( bool  flag)
inlineoverridevirtual

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

Reimplemented from RooAbsIntegrator.

Definition at line 34 of file RooGaussKronrodIntegrator1D.h.

◆ xvec()

double * RooGaussKronrodIntegrator1D::xvec ( double xx)
inlineprotected

Definition at line 50 of file RooGaussKronrodIntegrator1D.h.

Friends And Related Symbol Documentation

◆ RooGaussKronrodIntegrator1D_GSL_GlueFunction

double RooGaussKronrodIntegrator1D_GSL_GlueFunction ( double  x,
void *  data 
)
friend

Definition at line 183 of file RooGaussKronrodIntegrator1D.cxx.

◆ RooNumIntFactory

friend class RooNumIntFactory
friend

Definition at line 41 of file RooGaussKronrodIntegrator1D.h.

Member Data Documentation

◆ _epsAbs

double RooGaussKronrodIntegrator1D::_epsAbs
protected

do not persist

Definition at line 57 of file RooGaussKronrodIntegrator1D.h.

◆ _epsRel

double RooGaussKronrodIntegrator1D::_epsRel
protected

Definition at line 58 of file RooGaussKronrodIntegrator1D.h.

◆ _useIntegrandLimits

bool RooGaussKronrodIntegrator1D::_useIntegrandLimits
protected

Definition at line 48 of file RooGaussKronrodIntegrator1D.h.

◆ _x

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

Definition at line 55 of file RooGaussKronrodIntegrator1D.h.

◆ _xmax

double RooGaussKronrodIntegrator1D::_xmax
mutableprotected

Lower integration bound.

Definition at line 61 of file RooGaussKronrodIntegrator1D.h.

◆ _xmin

double RooGaussKronrodIntegrator1D::_xmin
mutableprotected

Definition at line 60 of file RooGaussKronrodIntegrator1D.h.

  • roofit/roofitmore/src/RooGaussKronrodIntegrator1D.h
  • roofit/roofitmore/src/RooGaussKronrodIntegrator1D.cxx