CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GammaNumericalGenerator Class Reference

#include <GammaNumericalGenerator.h>

Inheritance diagram for GammaNumericalGenerator:
BaseNumericalRandomGenerator

Public Member Functions

virtual double function (double x)
 The probability density function implementation. More...
 
double gamma () const
 Random generator. More...
 
double gamma_exp () const
 
double gamma_lin () const
 
 GammaNumericalGenerator (const RandomEngine *engine, double a=0, double b=0, double x1=0, double x2=0)
 Constructor : initialization of the Random Generator. More...
 
bool isValid () const
 
virtual ~GammaNumericalGenerator ()
 Default destructor. More...
 
- Public Member Functions inherited from BaseNumericalRandomGenerator
 BaseNumericalRandomGenerator (const RandomEngine *engine, double xmin=0., double xmax=1., int n=1000, int iter=6)
 
double generate () const
 The random generation according to function() More...
 
double generateExp () const
 
double generateLin () const
 
void initialize ()
 The initialization (numerical integarion, inversion) More...
 
bool setSubInterval (double x1, double x2)
 To shoot in a given interval. More...
 
virtual ~BaseNumericalRandomGenerator ()
 Default destructor. More...
 

Private Member Functions

double ersatzt (double x)
 Gamma Function. More...
 

Private Attributes

double a_
 
double b_
 
bool valid
 

Additional Inherited Members

- Protected Attributes inherited from BaseNumericalRandomGenerator
double deltar
 
std::vector< double > f
 
int iter
 
int n
 
const RandomEnginerandom
 
double rmin
 
std::vector< double > sampling
 
double xmax
 
double xmin
 

Detailed Description

Definition at line 12 of file GammaNumericalGenerator.h.

Constructor & Destructor Documentation

GammaNumericalGenerator::GammaNumericalGenerator ( const RandomEngine engine,
double  a = 0,
double  b = 0,
double  x1 = 0,
double  x2 = 0 
)
inline

Constructor : initialization of the Random Generator.

Definition at line 17 of file GammaNumericalGenerator.h.

References a, b, BaseNumericalRandomGenerator::initialize(), and valid.

18  :
19  BaseNumericalRandomGenerator(engine,x1,x2,1000),
20  a_(a),b_(b),valid(false) {
21 
22  if(a>0&&b>0)
23  {
24  valid=true;
25  initialize();
26  }
27  }
void initialize()
The initialization (numerical integarion, inversion)
BaseNumericalRandomGenerator(const RandomEngine *engine, double xmin=0., double xmax=1., int n=1000, int iter=6)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
virtual GammaNumericalGenerator::~GammaNumericalGenerator ( )
inlinevirtual

Default destructor.

Definition at line 30 of file GammaNumericalGenerator.h.

30 {}

Member Function Documentation

double GammaNumericalGenerator::ersatzt ( double  x)
inlineprivate

Gamma Function.

Definition at line 47 of file GammaNumericalGenerator.h.

References a_, b_, create_public_lumi_plots::exp, funct::pow(), and x.

Referenced by function().

47  {
48  double bt=b_*x;
49  return b_*pow(bt,a_-1)*exp(-bt);
50  }
Definition: DDAxes.h:10
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
virtual double GammaNumericalGenerator::function ( double  x)
inlinevirtual

The probability density function implementation.

Implements BaseNumericalRandomGenerator.

Definition at line 40 of file GammaNumericalGenerator.h.

References ersatzt(), and x.

40 { return ersatzt(x); }
Definition: DDAxes.h:10
double ersatzt(double x)
Gamma Function.
double GammaNumericalGenerator::gamma ( ) const
inline

Random generator.

Definition at line 33 of file GammaNumericalGenerator.h.

References BaseNumericalRandomGenerator::generate().

33 { return generate(); }
double generate() const
The random generation according to function()
double GammaNumericalGenerator::gamma_exp ( ) const
inline
double GammaNumericalGenerator::gamma_lin ( ) const
inline
bool GammaNumericalGenerator::isValid ( void  ) const
inline

Definition at line 42 of file GammaNumericalGenerator.h.

References valid.

Member Data Documentation

double GammaNumericalGenerator::a_
private

Definition at line 53 of file GammaNumericalGenerator.h.

Referenced by ersatzt().

double GammaNumericalGenerator::b_
private

Definition at line 53 of file GammaNumericalGenerator.h.

Referenced by ersatzt().

bool GammaNumericalGenerator::valid
private

Definition at line 54 of file GammaNumericalGenerator.h.

Referenced by GammaNumericalGenerator(), and isValid().