CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
GammaDistribution.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id:
3
4
#include "
CLHEP/GenericFunctions/GammaDistribution.hh
"
5
#include <assert.h>
6
#include <cmath>
7
using namespace
std;
8
9
namespace
Genfun {
10
FUNCTION_OBJECT_IMP
(GammaDistribution)
11
12
13
GammaDistribution
::
GammaDistribution
():
14
_alpha("
a
", 2.0, 1.0, 100),
15
_beta ("beta", 0.0, 0, 100)
16
{}
17
18
GammaDistribution::GammaDistribution(
const
GammaDistribution
& right):
19
_alpha(right._alpha),
20
_beta (right._beta)
21
{
22
}
23
24
GammaDistribution::~GammaDistribution
() {
25
}
26
27
double
GammaDistribution::operator()
(
double
x)
const
{
28
return
pow(x,_alpha.
getValue
()-1)*
29
exp(-x/_beta.
getValue
())/pow(_beta.
getValue
(),(_alpha.
getValue
()))/
30
exp(_logGamma(_alpha.
getValue
()));
31
32
}
33
34
Parameter
&
GammaDistribution::alpha
() {
35
return
_alpha;
36
}
37
38
39
Parameter
&
GammaDistribution::beta
() {
40
return
_beta;
41
}
42
43
44
45
}
// namespace Genfun
Generated on Sun Jun 17 2012 08:08:26 for CLHEP by
1.8.1.1