StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EvtItgAbsIntegrator.hh
1 //--------------------------------------------------------------------------
2 //
3 //
4 // Copyright Information: See EvtGen/COPYRIGHT
5 //
6 // Environment:
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.
10 //
11 // Module: EvtItgAbsIntegrator.hh
12 //
13 // Description:
14 // Abstraction of a generic integrator (Stolen and modified from
15 // the BaBar IntegrationUtils package - author: Phil Strother).
16 //
17 // Modification history:
18 //
19 // Jane Tinslay March 21, 2001 Module adapted for use in
20 // EvtGen
21 //
22 //------------------------------------------------------------------------
23 
24 #ifndef EVTITGABSINTEGRATOR_HH
25 #define EVTITGABSINTEGRATOR_HH
26 
27 
28 #include "EvtGenModels/EvtItgAbsFunction.hh"
29 
31 
32 public:
33 
35 
36  virtual ~EvtItgAbsIntegrator( );
37 
38  double evaluate(double lower, double upper) const;
39 
40  double normalisation() const;
41 
42 protected:
43 
44  double trapezoid(double lower, double higher, int n,
45  double &result) const;
46 
47  virtual double evaluateIt(double lower, double higher) const=0;
48 
49  double myFunction(double x) const {return _myFunction(x);}
50 
51 private:
52 
53  const EvtItgAbsFunction &_myFunction;
54 
55  void boundsCheck(double &, double &) const;
56 
57  // Note: if your class needs a copy constructor or an assignment operator,
58  // make one of the following public and implement it.
60  EvtItgAbsIntegrator( const EvtItgAbsIntegrator& ); // Copy Constructor
61  EvtItgAbsIntegrator& operator= ( const EvtItgAbsIntegrator& ); // Assignment op
62 
63 };
64 
65 #endif // EVTITGABSINTEGRATOR_HH