CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
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#include <iostream>
8
9using namespace std;
10
11namespace Genfun {
12FUNCTION_OBJECT_IMP(GammaDistribution)
13
14
16 _alpha("a", 2.0, 1.0, 100),
17 _beta ("beta", 0.0, 0, 100)
18{}
19
21AbsFunction(right),
22_alpha(right._alpha),
23_beta (right._beta)
24{
25}
26
28}
29
30double GammaDistribution::operator() (double x) const {
31 return std::pow(x,_alpha.getValue()-1)*
32 exp(-x/_beta.getValue())/std::pow(_beta.getValue(),(_alpha.getValue()))/
33 exp(_logGamma(_alpha.getValue()));
34
35}
36
38 return _alpha;
39}
40
41
43 return _beta;
44}
45
46
47
48} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Definition: AbsFunction.hh:149
virtual double operator()(double argument) const override
virtual double getValue() const
Definition: Parameter.cc:29
Definition: Abs.hh:14