40 _myFunction(theFunction)
54 double newLower(lower), newUpper(upper);
56 boundsCheck(newLower, newUpper);
64 if (n==1)
return 0.5*(higher-lower)*(_myFunction(lower) + _myFunction(higher));
68 for (it=1, j=1;j<n-1;j++) it <<=1;
74 double deltaX((higher - lower)/itDouble);
76 double x(lower + 0.5* deltaX);
83 result = 0.5*(result+(higher - lower)*sum/itDouble);
89EvtItgAbsIntegrator::boundsCheck(
double &lower,
double &upper)
const{
92 report(
WARNING,
"EvtGen") <<
"Warning in EvtItgAbsIntegrator::evaluate. Lower bound " << lower <<
" of integral "
93 <<
" is less than lower bound " << _myFunction.
lowerRange()
94 <<
" of function. No contribution from this range will be counted." << endl;
99 report(
WARNING,
"EvtGen") <<
"Warning in EvtItgAbsIntegrator::evaluate. Upper bound " << upper <<
" of integral "
100 <<
" is greater than upper bound " << _myFunction.
upperRange()
101 <<
" of function. No contribution from this range will be counted." << endl;
ostream & report(Severity severity, const char *facility)
double lowerRange() const
double upperRange() const
double trapezoid(double lower, double higher, int n, double &result) const
virtual ~EvtItgAbsIntegrator()
virtual double evaluateIt(double lower, double higher) const =0
EvtItgAbsIntegrator(const EvtItgAbsFunction &)
double evaluate(double lower, double upper) const
double normalisation() const