Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
FastSimulation
Utilities
interface
GammaNumericalGenerator.h
Go to the documentation of this file.
1
#ifndef GammaNumericalGenerator_H
2
#define GammaNumericalGenerator_H
3
#include "
FastSimulation/Utilities/interface/BaseNumericalRandomGenerator.h
"
4
5
#include <cmath>
10
class
RandomEngine
;
11
12
class
GammaNumericalGenerator
:
public
BaseNumericalRandomGenerator
13
{
14
public
:
15
17
GammaNumericalGenerator
(
const
RandomEngine
* engine,
18
double
a
=0,
double
b
=0,
double
x1=0,
double
x2=0) :
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
}
28
30
virtual
~GammaNumericalGenerator
() {}
31
33
double
gamma
()
const
{
return
generate
(); }
34
35
double
gamma_exp
()
const
{
return
generateExp
();}
36
37
double
gamma_lin
()
const
{
return
generateLin
();}
38
40
virtual
double
function
(
double
x
) {
return
ersatzt
(
x
); }
41
42
inline
bool
isValid
()
const
{
return
valid
;}
43
44
private
:
45
47
double
ersatzt
(
double
x
) {
48
double
bt=
b_
*
x
;
49
return
b_
*
pow
(bt,
a_
-1)*
exp
(-bt);
50
}
51
52
// gamma distribution parameters
53
double
a_
,
b_
;
54
bool
valid
;
55
};
56
57
#endif
BaseNumericalRandomGenerator.h
GammaNumericalGenerator
Definition:
GammaNumericalGenerator.h:12
create_public_lumi_plots.exp
tuple exp
Definition:
create_public_lumi_plots.py:1104
GammaNumericalGenerator::isValid
bool isValid() const
Definition:
GammaNumericalGenerator.h:42
RandomEngine
Definition:
RandomEngine.h:18
funct::false
false
Definition:
Factorize.h:34
GammaNumericalGenerator::b_
double b_
Definition:
GammaNumericalGenerator.h:53
GammaNumericalGenerator::gamma
double gamma() const
Random generator.
Definition:
GammaNumericalGenerator.h:33
GammaNumericalGenerator::gamma_lin
double gamma_lin() const
Definition:
GammaNumericalGenerator.h:37
GammaNumericalGenerator::~GammaNumericalGenerator
virtual ~GammaNumericalGenerator()
Default destructor.
Definition:
GammaNumericalGenerator.h:30
BaseNumericalRandomGenerator::initialize
void initialize()
The initialization (numerical integarion, inversion)
Definition:
BaseNumericalRandomGenerator.cc:18
GammaNumericalGenerator::a_
double a_
Definition:
GammaNumericalGenerator.h:53
GammaNumericalGenerator::GammaNumericalGenerator
GammaNumericalGenerator(const RandomEngine *engine, double a=0, double b=0, double x1=0, double x2=0)
Constructor : initialization of the Random Generator.
Definition:
GammaNumericalGenerator.h:17
BaseNumericalRandomGenerator
Definition:
BaseNumericalRandomGenerator.h:27
BaseNumericalRandomGenerator::generateLin
double generateLin() const
Definition:
BaseNumericalRandomGenerator.cc:113
BaseNumericalRandomGenerator::generate
double generate() const
The random generation according to function()
Definition:
BaseNumericalRandomGenerator.cc:84
BaseNumericalRandomGenerator::generateExp
double generateExp() const
Definition:
BaseNumericalRandomGenerator.cc:95
b
double b
Definition:
hdecay.h:120
GammaNumericalGenerator::valid
bool valid
Definition:
GammaNumericalGenerator.h:54
a
double a
Definition:
hdecay.h:121
GammaNumericalGenerator::gamma_exp
double gamma_exp() const
Definition:
GammaNumericalGenerator.h:35
x
Definition:
DDAxes.h:10
GammaNumericalGenerator::ersatzt
double ersatzt(double x)
Gamma Function.
Definition:
GammaNumericalGenerator.h:47
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition:
Power.h:40
Generated for CMSSW Reference Manual by
1.8.5