1 //--------------------------------------------------------------------------
3 // Copyright Information: See EvtGen/COPYRIGHT
6 // This software is part of the EvtGen package developed jointly
7 // for the BaBar and CLEO collaborations. If you use all or part
8 // of it, please give an appropriate acknowledgement.
10 // Module: EvtItgAbsFunction.hh
13 // Abstraction of a generic function for use in integration methods elsewhere
14 // in this package. (Stolen and modified from the BaBar IntegrationUtils package
15 // - author: Phil Strother).
17 // Modification history:
19 // Jane Tinslay March 21, 2001 Module adapted for use in
22 //------------------------------------------------------------------------
23 #include "EvtGenBase/EvtPatches.hh"
25 #include "EvtGenModels/EvtItgAbsFunction.hh"
33 #include "EvtGenBase/EvtReport.hh"
36 EvtItgAbsFunction::EvtItgAbsFunction(double lowerRange, double upperRange):
37 _upperRange(upperRange),
38 _lowerRange(lowerRange){}
40 EvtItgAbsFunction::~EvtItgAbsFunction( )
45 EvtItgAbsFunction::value( double x) const{
46 if (x >= _lowerRange && x <= _upperRange) return myFunction(x);
47 report(ERROR,"EvtGen") << "Error in EvtItgAbsFunction::value. Given co-ordinate " << x
48 << " is outside of allowed range [" << _lowerRange << ", "
49 << _upperRange << "]. Returning 0.0" << endl;
50 return 0.0; // Never get here
54 EvtItgAbsFunction::operator()(double x) const{