CMS 3D CMS Logo

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