evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtItgAbsFunction.hh
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
21 #ifndef EVTITGABSFUNCTION_HH
22 #define EVTITGABSFUNCTION_HH
23 
24 //-------------
25 // C Headers --
26 //-------------
27 extern "C" {
28 }
29 
30 // Description:
31 // Abstraction of a generic function for use in integration methods elsewhere
32 // in this package. (Stolen and modified from the BaBar IntegrationUtils package
33 // - author: Phil Strother).
34 
36  public:
37  // Constructors
38 
39  EvtItgAbsFunction( double lowerRange, double upperRange );
40 
41  // Destructor
42  virtual ~EvtItgAbsFunction() = default;
43 
44  virtual double value( double x ) const;
45 
46  virtual double operator()( double x ) const;
47 
48  // Selectors (const)
49 
50  inline double upperRange() const { return _upperRange; }
51  inline double lowerRange() const { return _lowerRange; }
52  inline void getRange( double& lower, double& upper ) const
53  {
54  lower = _lowerRange;
55  upper = _upperRange;
56  }
57  virtual void setCoeff( int, int, double ) = 0;
58  virtual double getCoeff( int, int ) = 0;
59 
60  protected:
61  virtual double myFunction( double x ) const = 0;
62  void setRange( double x1, double x2 )
63  {
64  _lowerRange = x1;
65  _upperRange = x2;
66  };
67 
68  private:
69  double _upperRange;
70  double _lowerRange;
71 };
72 
73 #endif // EVTITGABSFUNCTION_HH
void setRange(double x1, double x2)
virtual double myFunction(double x) const =0
double lowerRange() const
virtual void setCoeff(int, int, double)=0
EvtItgAbsFunction(double lowerRange, double upperRange)
double upperRange() const
virtual double value(double x) const
virtual double getCoeff(int, int)=0
void getRange(double &lower, double &upper) const
virtual ~EvtItgAbsFunction()=default
virtual double operator()(double x) const