BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtItgAbsIntegrator Class Referenceabstract

#include <EvtItgAbsIntegrator.hh>

+ Inheritance diagram for EvtItgAbsIntegrator:

Public Member Functions

 EvtItgAbsIntegrator (const EvtItgAbsFunction &)
 
virtual ~EvtItgAbsIntegrator ()
 
double evaluate (double lower, double upper) const
 
double normalisation () const
 

Protected Member Functions

double trapezoid (double lower, double higher, int n, double &result) const
 
virtual double evaluateIt (double lower, double higher) const =0
 
double myFunction (double x) const
 

Detailed Description

Definition at line 30 of file EvtItgAbsIntegrator.hh.

Constructor & Destructor Documentation

◆ EvtItgAbsIntegrator()

EvtItgAbsIntegrator::EvtItgAbsIntegrator ( const EvtItgAbsFunction theFunction)

Definition at line 39 of file EvtItgAbsIntegrator.cc.

39 :
40 _myFunction(theFunction)
41{}

Referenced by EvtItgAbsIntegrator().

◆ ~EvtItgAbsIntegrator()

EvtItgAbsIntegrator::~EvtItgAbsIntegrator ( )
virtual

Definition at line 43 of file EvtItgAbsIntegrator.cc.

44{}

Member Function Documentation

◆ evaluate()

double EvtItgAbsIntegrator::evaluate ( double  lower,
double  upper 
) const

Definition at line 52 of file EvtItgAbsIntegrator.cc.

52 {
53
54 double newLower(lower), newUpper(upper);
55
56 boundsCheck(newLower, newUpper);
57
58 return evaluateIt(newLower, newUpper);
59}
virtual double evaluateIt(double lower, double higher) const =0

Referenced by EvtBtoXsgammaKagan::computeHadronicMass(), and EvtBtoXsgammaRootFinder::GetGaussIntegFcnRoot().

◆ evaluateIt()

virtual double EvtItgAbsIntegrator::evaluateIt ( double  lower,
double  higher 
) const
protectedpure virtual

Implemented in EvtItgSimpsonIntegrator.

Referenced by evaluate(), and normalisation().

◆ myFunction()

double EvtItgAbsIntegrator::myFunction ( double  x) const
inlineprotected

Definition at line 49 of file EvtItgAbsIntegrator.hh.

49{return _myFunction(x);}

◆ normalisation()

double EvtItgAbsIntegrator::normalisation ( ) const

Definition at line 47 of file EvtItgAbsIntegrator.cc.

47 {
48 return evaluateIt(_myFunction.lowerRange(), _myFunction.upperRange());
49}
double lowerRange() const
double upperRange() const

Referenced by EvtBtoXsgammaKagan::computeHadronicMass().

◆ trapezoid()

double EvtItgAbsIntegrator::trapezoid ( double  lower,
double  higher,
int  n,
double &  result 
) const
protected

Definition at line 62 of file EvtItgAbsIntegrator.cc.

62 {
63
64 if (n==1) return 0.5*(higher-lower)*(_myFunction(lower) + _myFunction(higher));
65
66 int it, j;
67
68 for (it=1, j=1;j<n-1;j++) it <<=1;
69
70 double itDouble(it);
71
72 double sum(0.0);
73
74 double deltaX((higher - lower)/itDouble);
75
76 double x(lower + 0.5* deltaX);
77
78 for (j=1;j<=it;j++){
79 sum+=_myFunction(x);
80 x+=deltaX;
81 }
82
83 result = 0.5*(result+(higher - lower)*sum/itDouble);
84
85 return result;
86}
const Int_t n
Double_t x[10]

Referenced by EvtItgSimpsonIntegrator::evaluateIt().


The documentation for this class was generated from the following files: