Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:35

0001 // -*- C++ -*-
0002 // $Id: 
0003 //---------------------GammaDistribution------------------------------------//
0004 //                                                                          //
0005 // Class Gamma, x^a * e(-x/b) / (b^(a+1) Gamma(Alpha+1));                   //
0006 // Joe Boudreau, Jan 2007                                                   //
0007 //                                                                          //
0008 //--------------------------------------------------------------------------//
0009 #ifndef GammaDistribution_h
0010 #define GammaDistribution_h 1
0011 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0012 #include "CLHEP/GenericFunctions/Parameter.hh"
0013 #include "CLHEP/GenericFunctions/LogGamma.hh"
0014 #define _GAMMADISTRIBUTION_REVISED_ 1
0015 namespace Genfun {
0016 
0017   /**
0018    * @author
0019    * @ingroup genfun
0020    */
0021   class GammaDistribution : public AbsFunction  {
0022     
0023     FUNCTION_OBJECT_DEF(GammaDistribution)
0024       
0025       public:
0026     
0027     // Constructor
0028     GammaDistribution();
0029     
0030     // Copy constructor
0031     GammaDistribution(const GammaDistribution &right);
0032     
0033     // Destructor
0034     virtual ~GammaDistribution();
0035     
0036     // Retreive function value
0037     virtual double operator ()(double argument) const override;
0038     virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0039     
0040     // Get the paramter alpha
0041     Parameter & alpha(); 
0042 
0043     // Get the paramter alpha
0044     Parameter & beta(); 
0045     
0046   private:
0047     
0048     // It is illegal to assign an adjustable constant
0049     const GammaDistribution & operator=(const GammaDistribution &right);
0050     
0051     // Here are the two parameters alpha and beta:
0052 
0053     Parameter _alpha;
0054     Parameter _beta;
0055 
0056 
0057     // This function has a LogGamma Function;
0058     LogGamma _logGamma;
0059 
0060     
0061   };
0062 } // namespace Genfun
0063 #endif