BOSS 8.0.0
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 29 of file EvtItgAbsIntegrator.hh.

Constructor & Destructor Documentation

◆ EvtItgAbsIntegrator()

EvtItgAbsIntegrator::EvtItgAbsIntegrator ( const EvtItgAbsFunction & theFunction)

Definition at line 37 of file EvtItgAbsIntegrator.cc.

38 : _myFunction( theFunction ) {}

Referenced by EvtItgSimpsonIntegrator::EvtItgSimpsonIntegrator().

◆ ~EvtItgAbsIntegrator()

EvtItgAbsIntegrator::~EvtItgAbsIntegrator ( )
virtual

Definition at line 40 of file EvtItgAbsIntegrator.cc.

40{}

Member Function Documentation

◆ evaluate()

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

Definition at line 46 of file EvtItgAbsIntegrator.cc.

46 {
47
48 double newLower( lower ), newUpper( upper );
49
50 boundsCheck( newLower, newUpper );
51
52 return evaluateIt( newLower, newUpper );
53}
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 45 of file EvtItgAbsIntegrator.hh.

45{ return _myFunction( x ); }
Double_t x[10]

◆ normalisation()

double EvtItgAbsIntegrator::normalisation ( ) const

Definition at line 42 of file EvtItgAbsIntegrator.cc.

42 {
43 return evaluateIt( _myFunction.lowerRange(), _myFunction.upperRange() );
44}

Referenced by EvtBtoXsgammaKagan::computeHadronicMass().

◆ trapezoid()

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

Definition at line 55 of file EvtItgAbsIntegrator.cc.

56 {
57
58 if ( n == 1 )
59 return 0.5 * ( higher - lower ) * ( _myFunction( lower ) + _myFunction( higher ) );
60
61 int it, j;
62
63 for ( it = 1, j = 1; j < n - 1; j++ ) it <<= 1;
64
65 double itDouble( it );
66
67 double sum( 0.0 );
68
69 double deltaX( ( higher - lower ) / itDouble );
70
71 double x( lower + 0.5 * deltaX );
72
73 for ( j = 1; j <= it; j++ )
74 {
75 sum += _myFunction( x );
76 x += deltaX;
77 }
78
79 result = 0.5 * ( result + ( higher - lower ) * sum / itDouble );
80
81 return result;
82}
const Int_t n

Referenced by EvtItgSimpsonIntegrator::evaluateIt().


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