Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 // $Id: IncompleteGamma.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
0003 //---------------------IncompleteGamma--------------------------------------//
0004 //                                                                          //
0005 // Class IncompleteGamma, the incomplete Gamma function                     //
0006 // Joe Boudreau, October 2000                                               //
0007 //                                                                          //
0008 //--------------------------------------------------------------------------//
0009 #ifndef IncompleteGamma_h
0010 #define IncompleteGamma_h 1
0011 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0012 #include "CLHEP/GenericFunctions/Parameter.hh"
0013 #include "CLHEP/GenericFunctions/LogGamma.hh"
0014 namespace Genfun {
0015 
0016   /**
0017    * @author
0018    * @ingroup genfun
0019    */
0020   class IncompleteGamma : public AbsFunction  {
0021     
0022     FUNCTION_OBJECT_DEF(IncompleteGamma)
0023       
0024       public:
0025     
0026     // Constructor
0027     IncompleteGamma();
0028     
0029     // Copy constructor
0030     IncompleteGamma(const IncompleteGamma &right);
0031     
0032     // Destructor
0033     virtual ~IncompleteGamma();
0034     
0035     // Retreive function value
0036     virtual double operator ()(double argument) const override;
0037     virtual double operator ()(const Argument & arg) const override {return operator() (arg[0]);}
0038     
0039     // Get the paramter a
0040     Parameter & a(); 
0041     
0042   private:
0043     
0044     // It is illegal to assign an adjustable constant
0045     const IncompleteGamma & operator=(const IncompleteGamma &right);
0046     
0047     // Here is the parameter of the Incomplete Gamma Function
0048     Parameter _a;
0049 
0050     // Compute via series representation:
0051     double  _gamser(double a, double x, double logGamma) const;
0052     
0053     // Compute via continued fraction representation:
0054     double  _gammcf(double a, double x, double logGamma) const;
0055 
0056     // This function has a LogGamma Function;
0057     LogGamma _logGamma;
0058 
0059     static const int          ITMAX;
0060     static const double       EPS;
0061     static const double       FPMIN;
0062     
0063   };
0064 } // namespace Genfun
0065 #endif