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
GammaFunctionGenerator::na
unsigned na
Definition: GammaFunctionGenerator.h:60
GammaFunctionGenerator::setParameters
void setParameters(double a, double b, double xm)
The parameters must be set before shooting.
Definition: GammaFunctionGenerator.cc:93
GammaFunctionGenerator::beta
double beta
Definition: GammaFunctionGenerator.h:64
GammaFunctionGenerator
Definition: GammaFunctionGenerator.h:21
GammaFunctionGenerator::shoot
double shoot(RandomEngineAndDistribution const *) const
Definition: GammaFunctionGenerator.cc:30
GammaFunctionGenerator::alpha
double alpha
Definition: GammaFunctionGenerator.h:64
GammaFunctionGenerator::~GammaFunctionGenerator
virtual ~GammaFunctionGenerator()
Destructor.
Definition: GammaFunctionGenerator.cc:28
GammaFunctionGenerator::coreProba
double coreProba
Definition: GammaFunctionGenerator.h:50
GammaFunctionGenerator::integralToApproxLimit
std::vector< double > integralToApproxLimit
Definition: GammaFunctionGenerator.h:69
b
double b
Definition: hdecay.h:118
GammaFunctionGenerator::badRange
bool badRange
Definition: GammaFunctionGenerator.h:72
a
double a
Definition: hdecay.h:119
GammaFunctionGenerator::GammaFunctionGenerator
GammaFunctionGenerator()
Constructor.
Definition: GammaFunctionGenerator.cc:5
GammaFunctionGenerator::xmax
double xmax
Definition: GammaFunctionGenerator.h:57
GammaFunctionGenerator::theGammas
std::vector< GammaNumericalGenerator > theGammas
Definition: GammaFunctionGenerator.h:44
GammaFunctionGenerator::xmin
double xmin
Definition: GammaFunctionGenerator.h:56
GammaFunctionGenerator::gammaFrac
double gammaFrac(RandomEngineAndDistribution const *) const
values 0<a<1.
Definition: GammaFunctionGenerator.cc:51
GammaNumericalGenerator.h
GammaFunctionGenerator::approxLimit
std::vector< double > approxLimit
Definition: GammaFunctionGenerator.h:53
GammaFunctionGenerator::myIncompleteGamma
Genfun::IncompleteGamma myIncompleteGamma
Definition: GammaFunctionGenerator.h:66
GammaFunctionGenerator::gammaInt
double gammaInt(RandomEngineAndDistribution const *) const
integer values
Definition: GammaFunctionGenerator.cc:73
GammaFunctionGenerator::frac
double frac
Definition: GammaFunctionGenerator.h:62
GammaFunctionGenerator::coreCoeff
std::vector< double > coreCoeff
Definition: GammaFunctionGenerator.h:47
RandomEngineAndDistribution
Definition: RandomEngineAndDistribution.h:18