CMS 3D CMS Logo

GammaFunctionGenerator.h
Go to the documentation of this file.
1 #ifndef GammaFunctionGenerator_H
2 #define GammaFunctionGenerator_H
3 
10 // FAMOS headers
12 
13 // CLHEP
14 #include "CLHEP/GenericFunctions/IncompleteGamma.hh"
15 
16 //STL
17 #include <vector>
18 
20 
22 public:
25 
27  virtual ~GammaFunctionGenerator();
28 
31  double shoot(RandomEngineAndDistribution const*) const;
32 
34  void setParameters(double a, double b, double xm);
35 
36 private:
38  double gammaFrac(RandomEngineAndDistribution const*) const;
40  double gammaInt(RandomEngineAndDistribution const*) const;
41 
42 private:
43  // The integer numerical functions
44  std::vector<GammaNumericalGenerator> theGammas;
45 
46  // The gamma distribution core coefficients
47  std::vector<double> coreCoeff;
48 
49  // The gamma distribution core proba
50  double coreProba;
51 
52  // possibility to store different limits
53  std::vector<double> approxLimit;
54 
55  // boundaries
56  double xmin;
57  double xmax;
58 
59  // closest lower integer
60  unsigned na;
61  // alpha-na
62  double frac;
63  // alpha function parameters
64  double alpha, beta;
65  // Incomlete Gamma = Int(0,x)[t^(alpha-1)exp(-t)dt]/Gamma(alpha);
66  Genfun::IncompleteGamma myIncompleteGamma;
67 
68  // some useful integrals
69  std::vector<double> integralToApproxLimit;
70 
71  // if xmin>xmax
72  bool badRange;
73 };
74 #endif
std::vector< GammaNumericalGenerator > theGammas
double gammaFrac(RandomEngineAndDistribution const *) const
values 0<a<1.
GammaFunctionGenerator()
Constructor.
std::vector< double > approxLimit
double gammaInt(RandomEngineAndDistribution const *) const
integer values
std::vector< double > coreCoeff
Genfun::IncompleteGamma myIncompleteGamma
void setParameters(double a, double b, double xm)
The parameters must be set before shooting.
double b
Definition: hdecay.h:120
double shoot(RandomEngineAndDistribution const *) const
double a
Definition: hdecay.h:121
virtual ~GammaFunctionGenerator()
Destructor.
std::vector< double > integralToApproxLimit