CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Genfun::BivariateGaussian Class Reference

#include <BivariateGaussian.hh>

+ Inheritance diagram for Genfun::BivariateGaussian:

Public Member Functions

 BivariateGaussian ()
 
 BivariateGaussian (const BivariateGaussian &right)
 
virtual ~BivariateGaussian ()
 
virtual double operator() (double argument) const override
 
virtual double operator() (const Argument &a) const override
 
virtual unsigned int dimensionality () const override
 
Parametermean0 ()
 
const Parametermean0 () const
 
Parametermean1 ()
 
const Parametermean1 () const
 
Parametersigma0 ()
 
const Parametersigma0 () const
 
Parametersigma1 ()
 
const Parametersigma1 () const
 
Parametercorr01 ()
 
const Parametercorr01 () const
 
- Public Member Functions inherited from Genfun::AbsFunction
 AbsFunction ()
 
 AbsFunction (const AbsFunction &right)
 
virtual ~AbsFunction ()
 
virtual unsigned int dimensionality () const
 
virtual double operator() (double argument) const =0
 
virtual double operator() (const Argument &argument) const =0
 
virtual AbsFunctionclone () const =0
 
virtual FunctionComposition operator() (const AbsFunction &f) const
 
virtual ParameterComposition operator() (const AbsParameter &p) const
 
Derivative derivative (const Variable &v) const
 
Derivative prime () const
 
virtual bool hasAnalyticDerivative () const
 
virtual Derivative partial (unsigned int) const
 

Detailed Description

Author

Definition at line 20 of file BivariateGaussian.hh.

Constructor & Destructor Documentation

◆ BivariateGaussian() [1/2]

Genfun::BivariateGaussian::BivariateGaussian ( )

Definition at line 18 of file BivariateGaussian.cc.

18 :
19 _mean0("Mean0", 0.0,-10,10),
20 _mean1("Mean1", 0.0,-10,10),
21 _sigma0("Sigma0",1.0,0, 10),
22 _sigma1("Sigma1",1.0,0, 10),
23 _corr01("Corr01", 0.0, -1.0, 1.0)
24{}

◆ BivariateGaussian() [2/2]

Genfun::BivariateGaussian::BivariateGaussian ( const BivariateGaussian right)

Definition at line 29 of file BivariateGaussian.cc.

29 :
30 AbsFunction(right),
31 _mean0(right._mean0),
32 _mean1(right._mean1),
33 _sigma0(right._sigma0),
34 _sigma1(right._sigma1),
35 _corr01(right._corr01)
36{
37}

◆ ~BivariateGaussian()

Genfun::BivariateGaussian::~BivariateGaussian ( )
virtual

Definition at line 26 of file BivariateGaussian.cc.

26 {
27}

Member Function Documentation

◆ corr01() [1/2]

Parameter & Genfun::BivariateGaussian::corr01 ( )

Definition at line 95 of file BivariateGaussian.cc.

95 {
96 return _corr01;
97}

◆ corr01() [2/2]

const Parameter & Genfun::BivariateGaussian::corr01 ( ) const

Definition at line 99 of file BivariateGaussian.cc.

99 {
100 return _corr01;
101}

◆ dimensionality()

unsigned int Genfun::BivariateGaussian::dimensionality ( ) const
overridevirtual

Reimplemented from Genfun::AbsFunction.

Definition at line 104 of file BivariateGaussian.cc.

104 {
105 return 2;
106}

◆ mean0() [1/2]

Parameter & Genfun::BivariateGaussian::mean0 ( )

Definition at line 61 of file BivariateGaussian.cc.

61 {
62 return _mean0;
63}

◆ mean0() [2/2]

const Parameter & Genfun::BivariateGaussian::mean0 ( ) const

Definition at line 69 of file BivariateGaussian.cc.

69 {
70 return _mean0;
71}

◆ mean1() [1/2]

Parameter & Genfun::BivariateGaussian::mean1 ( )

Definition at line 77 of file BivariateGaussian.cc.

77 {
78 return _mean1;
79}

◆ mean1() [2/2]

const Parameter & Genfun::BivariateGaussian::mean1 ( ) const

Definition at line 85 of file BivariateGaussian.cc.

85 {
86 return _mean1;
87}

◆ operator()() [1/2]

double Genfun::BivariateGaussian::operator() ( const Argument a) const
overridevirtual

Implements Genfun::AbsFunction.

Definition at line 39 of file BivariateGaussian.cc.

39 {
40 assert (a.dimension()==2);
41 double x = a[0];
42 double y = a[1];
43
44 double x0 = _mean0.getValue();
45 double y0 = _mean1.getValue();
46 double dx = x-x0;
47 double dy = y-y0;
48
49 double sx = _sigma0.getValue();
50 double sy = _sigma1.getValue();
51
52 double sxs = sx*sx;
53 double sys = sy*sy;
54 double rho = _corr01.getValue();
55 double dt = (1.0+rho)*(1.0-rho);
56
57 return (1.0/(2*M_PI*sx*sy*sqrt(dt))) *
58 exp(-1.0/(2.0*dt)*(dx*dx/sxs+dy*dy/sys-2.0*rho*dx*dy/sx/sy));
59}
virtual double getValue() const
Definition: Parameter.cc:29

◆ operator()() [2/2]

double Genfun::BivariateGaussian::operator() ( double  argument) const
overridevirtual

Implements Genfun::AbsFunction.

Definition at line 108 of file BivariateGaussian.cc.

109{
110 std::cerr
111 << "Warning. bivariate Gaussian called with scalar argument"
112 << std::endl;
113 assert(0);
114 return 0;
115}

◆ sigma0() [1/2]

Parameter & Genfun::BivariateGaussian::sigma0 ( )

Definition at line 65 of file BivariateGaussian.cc.

65 {
66 return _sigma0;
67}

◆ sigma0() [2/2]

const Parameter & Genfun::BivariateGaussian::sigma0 ( ) const

Definition at line 73 of file BivariateGaussian.cc.

73 {
74 return _sigma0;
75}

◆ sigma1() [1/2]

Parameter & Genfun::BivariateGaussian::sigma1 ( )

Definition at line 81 of file BivariateGaussian.cc.

81 {
82 return _sigma1;
83}

◆ sigma1() [2/2]

const Parameter & Genfun::BivariateGaussian::sigma1 ( ) const

Definition at line 89 of file BivariateGaussian.cc.

89 {
90 return _sigma1;
91}

The documentation for this class was generated from the following files: