1 //--------------------------------------------------------------------------
4 // Copyright Information: See EvtGen/COPYRIGHT
7 // This software is part of the EvtGen package developed jointly
8 // for the BaBar and CLEO collaborations. If you use all or part
9 // of it, please give an appropriate acknowledgement.
11 // Module: EvtItgAbsIntegrator.hh
14 // Abstraction of a generic integrator (Stolen and modified from
15 // the BaBar IntegrationUtils package - author: Phil Strother).
17 // Modification history:
19 // Jane Tinslay March 21, 2001 Module adapted for use in
22 //------------------------------------------------------------------------
24 #ifndef EVTITGABSINTEGRATOR_HH
25 #define EVTITGABSINTEGRATOR_HH
28 #include "EvtGenModels/EvtItgAbsFunction.hh"
30 class EvtItgAbsIntegrator {
34 EvtItgAbsIntegrator(const EvtItgAbsFunction &);
36 virtual ~EvtItgAbsIntegrator( );
38 double evaluate(double lower, double upper) const;
40 double normalisation() const;
44 double trapezoid(double lower, double higher, int n,
45 double &result) const;
47 virtual double evaluateIt(double lower, double higher) const=0;
49 double myFunction(double x) const {return _myFunction(x);}
53 const EvtItgAbsFunction &_myFunction;
55 void boundsCheck(double &, double &) const;
57 // Note: if your class needs a copy constructor or an assignment operator,
58 // make one of the following public and implement it.
59 EvtItgAbsIntegrator();
60 EvtItgAbsIntegrator( const EvtItgAbsIntegrator& ); // Copy Constructor
61 EvtItgAbsIntegrator& operator= ( const EvtItgAbsIntegrator& ); // Assignment op
65 #endif // EVTITGABSINTEGRATOR_HH