00001 #ifndef GammaFunctionGenerator_H 00002 #define GammaFunctionGenerator_H 00003 00010 // FAMOS headers 00011 #include "FastSimulation/Utilities/interface/GammaNumericalGenerator.h" 00012 00013 // CLHEP 00014 #include "CLHEP/GenericFunctions/IncompleteGamma.hh" 00015 00016 //STL 00017 #include <vector> 00018 00019 class RandomEngine; 00020 00021 class GammaFunctionGenerator 00022 { 00023 public: 00024 00026 GammaFunctionGenerator(const RandomEngine* engine); 00027 00029 virtual ~GammaFunctionGenerator(); 00030 00033 double shoot() const; 00034 00036 void setParameters(double a,double b, double xm); 00037 00038 private: 00040 double gammaFrac() const; 00042 double gammaInt() const; 00043 00044 00045 00046 private: 00047 00048 // The integer numerical functions 00049 std::vector<GammaNumericalGenerator> theGammas; 00050 00051 // The gamma distribution core coefficients 00052 std::vector<double> coreCoeff; 00053 00054 // The gamma distribution core proba 00055 double coreProba; 00056 00057 // possibility to store different limits 00058 std::vector<double> approxLimit; 00059 00060 // boundaries 00061 double xmin; 00062 double xmax; 00063 00064 // closest lower integer 00065 unsigned na; 00066 // alpha-na 00067 double frac; 00068 // alpha function parameters 00069 double alpha,beta; 00070 // Incomlete Gamma = Int(0,x)[t^(alpha-1)exp(-t)dt]/Gamma(alpha); 00071 Genfun::IncompleteGamma myIncompleteGamma; 00072 00073 // some useful integrals 00074 std::vector<double> integralToApproxLimit; 00075 00076 // if xmin>xmax 00077 bool badRange; 00078 00079 const RandomEngine* random; 00080 00081 }; 00082 #endif