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

#include <TrivariateGaussian.hh>

+ Inheritance diagram for Genfun::TrivariateGaussian:

Public Member Functions

 TrivariateGaussian ()
 
 TrivariateGaussian (const TrivariateGaussian &right)
 
virtual ~TrivariateGaussian ()
 
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
 
Parametermean2 ()
 
const Parametermean2 () const
 
Parametersigma0 ()
 
const Parametersigma0 () const
 
Parametersigma1 ()
 
const Parametersigma1 () const
 
Parametersigma2 ()
 
const Parametersigma2 () const
 
Parametercorr01 ()
 
const Parametercorr01 () const
 
Parametercorr02 ()
 
const Parametercorr02 () const
 
Parametercorr12 ()
 
const Parametercorr12 () 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 TrivariateGaussian.hh.

Constructor & Destructor Documentation

◆ TrivariateGaussian() [1/2]

Genfun::TrivariateGaussian::TrivariateGaussian ( )

Definition at line 20 of file TrivariateGaussian.cc.

20 :
21 _mean0("Mean0", 0.0,-10,10),
22 _mean1("Mean1", 0.0,-10,10),
23 _mean2("Mean2", 0.0,-10,10),
24 _sigma0("Sigma0",1.0,0, 10),
25 _sigma1("Sigma1",1.0,0, 10),
26 _sigma2("Sigma2",1.0,0, 10),
27 _corr01("Corr01", 0.0, -1.0, 1.0),
28 _corr02("Corr02", 0.0, -1.0, 1.0),
29 _corr12("Corr12", 0.0, -1.0, 1.0)
30{}

◆ TrivariateGaussian() [2/2]

Genfun::TrivariateGaussian::TrivariateGaussian ( const TrivariateGaussian right)

Definition at line 35 of file TrivariateGaussian.cc.

35 :
36 AbsFunction(right),
37 _mean0(right._mean0),
38 _mean1(right._mean1),
39 _mean2(right._mean2),
40 _sigma0(right._sigma0),
41 _sigma1(right._sigma1),
42 _sigma2(right._sigma2),
43 _corr01(right._corr01),
44 _corr02(right._corr02),
45 _corr12(right._corr12)
46{
47}

◆ ~TrivariateGaussian()

Genfun::TrivariateGaussian::~TrivariateGaussian ( )
virtual

Definition at line 32 of file TrivariateGaussian.cc.

32 {
33}

Member Function Documentation

◆ corr01() [1/2]

Parameter & Genfun::TrivariateGaussian::corr01 ( )

Definition at line 142 of file TrivariateGaussian.cc.

142 {
143 return _corr01;
144}

◆ corr01() [2/2]

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

Definition at line 146 of file TrivariateGaussian.cc.

146 {
147 return _corr01;
148}

◆ corr02() [1/2]

Parameter & Genfun::TrivariateGaussian::corr02 ( )

Definition at line 150 of file TrivariateGaussian.cc.

150 {
151 return _corr02;
152}

◆ corr02() [2/2]

const Parameter & Genfun::TrivariateGaussian::corr02 ( ) const

Definition at line 154 of file TrivariateGaussian.cc.

154 {
155 return _corr02;
156}

◆ corr12() [1/2]

Parameter & Genfun::TrivariateGaussian::corr12 ( )

Definition at line 158 of file TrivariateGaussian.cc.

158 {
159 return _corr12;
160}

◆ corr12() [2/2]

const Parameter & Genfun::TrivariateGaussian::corr12 ( ) const

Definition at line 162 of file TrivariateGaussian.cc.

162 {
163 return _corr12;
164}

◆ dimensionality()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 167 of file TrivariateGaussian.cc.

167 {
168 return 3;
169}

◆ mean0() [1/2]

Parameter & Genfun::TrivariateGaussian::mean0 ( )

Definition at line 91 of file TrivariateGaussian.cc.

91 {
92 return _mean0;
93}

◆ mean0() [2/2]

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

Definition at line 99 of file TrivariateGaussian.cc.

99 {
100 return _mean0;
101}

◆ mean1() [1/2]

Parameter & Genfun::TrivariateGaussian::mean1 ( )

Definition at line 107 of file TrivariateGaussian.cc.

107 {
108 return _mean1;
109}

◆ mean1() [2/2]

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

Definition at line 115 of file TrivariateGaussian.cc.

115 {
116 return _mean1;
117}

◆ mean2() [1/2]

Parameter & Genfun::TrivariateGaussian::mean2 ( )

Definition at line 123 of file TrivariateGaussian.cc.

123 {
124 return _mean2;
125}

◆ mean2() [2/2]

const Parameter & Genfun::TrivariateGaussian::mean2 ( ) const

Definition at line 132 of file TrivariateGaussian.cc.

132 {
133 return _mean2;
134}

◆ operator()() [1/2]

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

Implements Genfun::AbsFunction.

Definition at line 50 of file TrivariateGaussian.cc.

50 {
51 assert (a.dimension()==3);
52 double x = a[0];
53 double y = a[1];
54 double z = a[2];
55
56
57 double x0 = _mean0.getValue();
58 double y0 = _mean1.getValue();
59 double z0 = _mean2.getValue();
60
61 double dx = x-x0;
62 double dy = y-y0;
63 double dz = z-z0;
64
65 double sx = _sigma0.getValue();
66 double sy = _sigma1.getValue();
67 double sz = _sigma2.getValue();
68
69
70 double sxs = sx*sx;
71 double sys = sy*sy;
72 double szs = sz*sz;
73
74
75 double rho1 = _corr01.getValue();
76 double rho2 = _corr12.getValue();
77 double rho3 = _corr02.getValue();
78
79 double dt = (1.0+rho1*rho2*rho3-rho1*rho1-rho2*rho2-rho3*rho3);
80 double tmp1 ,tmp2;
81
82 tmp1= 1.0/((2*M_PI)*sqrt(2*M_PI)*sx*sy*sz*sqrt(dt));
83 tmp2= exp(-0.5/dt*(dx*dx*(1.0-rho2*rho2)/sxs+dy*dy*(1.0-rho3*rho3)/sys+dz*dz*(1.0-rho1*rho1)/szs+2.0*dx*dy*(rho2*rho3-rho1)/sx/sy+2.0*dy*dz*(rho1*rho3-rho2)/sy/sz+2.0*dx*dz*(rho1*rho2-rho3)/sx/sz));
84
85
86 return tmp1*tmp2;
87
88
89}
virtual double getValue() const
Definition: Parameter.cc:29

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 171 of file TrivariateGaussian.cc.

172{
173 std::cerr
174 << "Warning. trivariate Gaussian called with scalar argument"
175 << std::endl;
176 assert(0);
177 return 0;
178}

◆ sigma0() [1/2]

Parameter & Genfun::TrivariateGaussian::sigma0 ( )

Definition at line 95 of file TrivariateGaussian.cc.

95 {
96 return _sigma0;
97}

◆ sigma0() [2/2]

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

Definition at line 103 of file TrivariateGaussian.cc.

103 {
104 return _sigma0;
105}

◆ sigma1() [1/2]

Parameter & Genfun::TrivariateGaussian::sigma1 ( )

Definition at line 111 of file TrivariateGaussian.cc.

111 {
112 return _sigma1;
113}

◆ sigma1() [2/2]

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

Definition at line 119 of file TrivariateGaussian.cc.

119 {
120 return _sigma1;
121}

◆ sigma2() [1/2]

Parameter & Genfun::TrivariateGaussian::sigma2 ( )

Definition at line 128 of file TrivariateGaussian.cc.

128 {
129 return _sigma2;
130}

◆ sigma2() [2/2]

const Parameter & Genfun::TrivariateGaussian::sigma2 ( ) const

Definition at line 136 of file TrivariateGaussian.cc.

136 {
137 return _sigma2;
138}

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