CLHEP
2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
BetaDistribution.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id:
3
4
#include "CLHEP/GenericFunctions/BetaDistribution.hh"
5
#include <assert.h>
6
#include <cmath>
7
#include <iostream>
8
using namespace
std;
9
10
namespace
Genfun
{
11
FUNCTION_OBJECT_IMP
(BetaDistribution)
12
13
14
BetaDistribution
::
BetaDistribution
():
15
_alpha("a", 1.0, 0.0, 100),
16
_beta ("beta", 1.0, 0.0, 100)
17
{}
18
19
BetaDistribution::BetaDistribution
(
const
BetaDistribution
& right):
20
AbsFunction
( right ),
21
_alpha(right._alpha),
22
_beta (right._beta)
23
{
24
}
25
26
BetaDistribution::~BetaDistribution
() {
27
}
28
29
double
BetaDistribution::operator()
(
double
x)
const
{
30
double
a = _alpha.
getValue
(),b=_beta.
getValue
();
31
return
pow(x,a-1)*pow((1-x),b-1)*
32
exp(_logGamma(a+b)-_logGamma(a)-_logGamma(b));
33
34
}
35
36
Parameter
&
BetaDistribution::alpha
() {
37
return
_alpha;
38
}
39
40
41
Parameter
&
BetaDistribution::beta
() {
42
return
_beta;
43
}
44
45
46
47
}
// namespace Genfun
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition:
AbsFunction.hh:149
Genfun::AbsFunction
Definition:
AbsFunction.hh:48
Genfun::BetaDistribution
Definition:
BetaDistribution.hh:21
Genfun::BetaDistribution::operator()
virtual double operator()(double argument) const override
Definition:
BetaDistribution.cc:29
Genfun::BetaDistribution::beta
Parameter & beta()
Definition:
BetaDistribution.cc:41
Genfun::BetaDistribution::BetaDistribution
BetaDistribution()
Definition:
BetaDistribution.cc:14
Genfun::BetaDistribution::~BetaDistribution
virtual ~BetaDistribution()
Definition:
BetaDistribution.cc:26
Genfun::BetaDistribution::alpha
Parameter & alpha()
Definition:
BetaDistribution.cc:36
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
BetaDistribution.cc
Generated by
1.9.6