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 {
23  public:
24 
27 
29  virtual ~GammaFunctionGenerator();
30 
33  double shoot(RandomEngineAndDistribution const*) const;
34 
36  void setParameters(double a,double b, double xm);
37 
38  private:
40  double gammaFrac(RandomEngineAndDistribution const*) const;
42  double gammaInt(RandomEngineAndDistribution const*) const;
43 
44  private:
45 
46  // The integer numerical functions
47  std::vector<GammaNumericalGenerator> theGammas;
48 
49  // The gamma distribution core coefficients
50  std::vector<double> coreCoeff;
51 
52  // The gamma distribution core proba
53  double coreProba;
54 
55  // possibility to store different limits
56  std::vector<double> approxLimit;
57 
58  // boundaries
59  double xmin;
60  double xmax;
61 
62  // closest lower integer
63  unsigned na;
64  // alpha-na
65  double frac;
66  // alpha function parameters
67  double alpha,beta;
68  // Incomlete Gamma = Int(0,x)[t^(alpha-1)exp(-t)dt]/Gamma(alpha);
69  Genfun::IncompleteGamma myIncompleteGamma;
70 
71  // some useful integrals
72  std::vector<double> integralToApproxLimit;
73 
74  // if xmin>xmax
75  bool badRange;
76 };
77 #endif
double gammaInt(RandomEngineAndDistribution const *) const
integer values
std::vector< GammaNumericalGenerator > theGammas
double gammaFrac(RandomEngineAndDistribution const *) const
values 0<a<1.
GammaFunctionGenerator()
Constructor.
std::vector< double > approxLimit
std::vector< double > coreCoeff
Genfun::IncompleteGamma myIncompleteGamma
void setParameters(double a, double b, double xm)
The parameters must be set before shooting.
double shoot(RandomEngineAndDistribution const *) const
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
virtual ~GammaFunctionGenerator()
Destructor.
std::vector< double > integralToApproxLimit