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>
8using namespace std;
9
10namespace Genfun {
11FUNCTION_OBJECT_IMP(BetaDistribution)
12
13
15 _alpha("a", 1.0, 0.0, 100),
16 _beta ("beta", 1.0, 0.0, 100)
17{}
18
20AbsFunction( right ),
21_alpha(right._alpha),
22_beta (right._beta)
23{
24}
25
27}
28
29double 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
37 return _alpha;
38}
39
40
42 return _beta;
43}
44
45
46
47} // 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