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
9
using namespace
std;
10
11
namespace
Genfun
{
12
FUNCTION_OBJECT_IMP
(GammaDistribution)
13
14
15
GammaDistribution
::
GammaDistribution
():
16
_alpha("a", 2.0, 1.0, 100),
17
_beta ("beta", 0.0, 0, 100)
18
{}
19
20
GammaDistribution::GammaDistribution
(
const
GammaDistribution
& right):
21
AbsFunction
(right),
22
_alpha(right._alpha),
23
_beta (right._beta)
24
{
25
}
26
27
GammaDistribution::~GammaDistribution
() {
28
}
29
30
double
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
37
Parameter
&
GammaDistribution::alpha
() {
38
return
_alpha;
39
}
40
41
42
Parameter
&
GammaDistribution::beta
() {
43
return
_beta;
44
}
45
46
47
48
}
// namespace Genfun
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition:
AbsFunction.hh:149
Genfun::AbsFunction
Definition:
AbsFunction.hh:48
Genfun::GammaDistribution
Definition:
GammaDistribution.hh:21
Genfun::GammaDistribution::GammaDistribution
GammaDistribution()
Definition:
GammaDistribution.cc:15
Genfun::GammaDistribution::alpha
Parameter & alpha()
Definition:
GammaDistribution.cc:37
Genfun::GammaDistribution::beta
Parameter & beta()
Definition:
GammaDistribution.cc:42
Genfun::GammaDistribution::operator()
virtual double operator()(double argument) const override
Definition:
GammaDistribution.cc:30
Genfun::GammaDistribution::~GammaDistribution
virtual ~GammaDistribution()
Definition:
GammaDistribution.cc:27
Genfun::Parameter
Definition:
Parameter.hh:35
Genfun::Parameter::getValue
virtual double getValue() const
Definition:
Parameter.cc:29
Genfun
Definition:
Abs.hh:14
CLHEP-CLHEP_2_4_6_4
GenericFunctions
src
GammaDistribution.cc
Generated by
1.9.6