BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtItgSimpsonIntegrator Class Reference

#include <EvtItgSimpsonIntegrator.hh>

+ Inheritance diagram for EvtItgSimpsonIntegrator:

Public Member Functions

 EvtItgSimpsonIntegrator (const EvtItgAbsFunction &, double precision=1.0e-5, int maxLoop=20)
 
virtual ~EvtItgSimpsonIntegrator ()
 
 EvtItgSimpsonIntegrator (const EvtItgAbsFunction &, double precision=1.0e-5, int maxLoop=20)
 
virtual ~EvtItgSimpsonIntegrator ()
 
- Public Member Functions inherited from EvtItgAbsIntegrator
 EvtItgAbsIntegrator (const EvtItgAbsFunction &)
 
virtual ~EvtItgAbsIntegrator ()
 
double evaluate (double lower, double upper) const
 
double normalisation () const
 
 EvtItgAbsIntegrator (const EvtItgAbsFunction &)
 
virtual ~EvtItgAbsIntegrator ()
 
double evaluate (double lower, double upper) const
 
double normalisation () const
 

Protected Member Functions

virtual double evaluateIt (double, double) const
 
virtual double evaluateIt (double, double) const
 
- Protected Member Functions inherited from EvtItgAbsIntegrator
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
 
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

Constructor & Destructor Documentation

◆ EvtItgSimpsonIntegrator() [1/2]

EvtItgSimpsonIntegrator::EvtItgSimpsonIntegrator ( const EvtItgAbsFunction theFunction,
double  precision = 1.0e-5,
int  maxLoop = 20 
)

◆ ~EvtItgSimpsonIntegrator() [1/2]

EvtItgSimpsonIntegrator::~EvtItgSimpsonIntegrator ( )
virtual

◆ EvtItgSimpsonIntegrator() [2/2]

EvtItgSimpsonIntegrator::EvtItgSimpsonIntegrator ( const EvtItgAbsFunction ,
double  precision = 1.0e-5,
int  maxLoop = 20 
)

◆ ~EvtItgSimpsonIntegrator() [2/2]

virtual EvtItgSimpsonIntegrator::~EvtItgSimpsonIntegrator ( )
virtual

Member Function Documentation

◆ evaluateIt() [1/2]

double EvtItgSimpsonIntegrator::evaluateIt ( double  lower,
double  higher 
) const
protectedvirtual

Implements EvtItgAbsIntegrator.

Definition at line 64 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtItgSimpsonIntegrator.cc.

64 {
65
66 // report(INFO,"EvtGen")<<"in evaluate"<<endl;
67 int j;
68 double result(0.0);
69 double s, st, ost(0.0);
70 for (j=1;j<4;j++) {
71 st = trapezoid(lower, higher, j, result);
72 s = (4.0 * st - ost)/3.0;
73 ost=st;
74 }
75
76 double olds(s);
77 st = trapezoid(lower, higher, j, result);
78 s = (4.0 * st - ost)/3.0;
79
80 if (fabs(s - olds) < _precision*fabs(olds) || (s==0.0 && olds==0.0)) return s;
81
82 ost=st;
83
84 for (j=5;j<_maxLoop;j++){
85
86 st = trapezoid(lower, higher, j, result);
87 s = (4.0 * st - ost)/3.0;
88
89 if (fabs(s - olds) < _precision*fabs(olds) || (s==0.0 && olds==0.0)) return s;
90 olds=s;
91 ost=st;
92 }
93
94 report(ERROR,"EvtGen") << "Severe error in EvtItgSimpsonIntegrator. Failed to converge after loop with 2**"
95 << _maxLoop << " calls to the integrand in." << endl;
96
97 return 0.0;
98
99}
XmlRpcServer s
Definition: HelloServer.cpp:11
ostream & report(Severity severity, const char *facility)
double trapezoid(double lower, double higher, int n, double &result) const

◆ evaluateIt() [2/2]

virtual double EvtItgSimpsonIntegrator::evaluateIt ( double  ,
double   
) const
protectedvirtual

Implements EvtItgAbsIntegrator.


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