Line data Source code
1 : //--------------------------------------------------------------------------
2 : //
3 : // Copyright Information: See EvtGen/COPYRIGHT
4 : //
5 : // Environment:
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.
9 : //
10 : // Module: EvtItgAbsFunction.hh
11 : //
12 : // Description:
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).
16 : //
17 : // Modification history:
18 : //
19 : // Jane Tinslay March 21, 2001 Module adapted for use in
20 : // EvtGen
21 : //
22 : //------------------------------------------------------------------------
23 : #include "EvtGenBase/EvtPatches.hh"
24 :
25 : #include "EvtGenModels/EvtItgAbsFunction.hh"
26 :
27 : //-------------
28 : // C Headers --
29 : //-------------
30 : extern "C" {
31 : }
32 : #include "assert.h"
33 : #include "EvtGenBase/EvtReport.hh"
34 : using std::endl;
35 :
36 : EvtItgAbsFunction::EvtItgAbsFunction(double lowerRange, double upperRange):
37 0 : _upperRange(upperRange),
38 0 : _lowerRange(lowerRange){}
39 :
40 : EvtItgAbsFunction::~EvtItgAbsFunction( )
41 0 : {}
42 :
43 :
44 : double
45 : EvtItgAbsFunction::value( double x) const{
46 0 : if (x >= _lowerRange && x <= _upperRange) return myFunction(x);
47 0 : report(Severity::Error,"EvtGen") << "Error in EvtItgAbsFunction::value. Given co-ordinate " << x
48 0 : << " is outside of allowed range [" << _lowerRange << ", "
49 0 : << _upperRange << "]. Returning 0.0" << endl;
50 0 : return 0.0; // Never get here
51 0 : }
52 :
53 : double
54 : EvtItgAbsFunction::operator()(double x) const{
55 0 : return myFunction(x);
56 : }
|