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

#include <PtRelFcn.hh>

+ Inheritance diagram for Genfun::PtRelFcn:

Public Member Functions

 PtRelFcn ()
 
 PtRelFcn (const PtRelFcn &right)
 
virtual ~PtRelFcn ()
 
virtual double operator() (double argument) const override
 
virtual double operator() (const Argument &a) const override
 
ParameterP0 ()
 
const ParameterP0 () const
 
ParameterP1 ()
 
const ParameterP1 () const
 
ParameterP2 ()
 
const ParameterP2 () const
 
ParameterP3 ()
 
const ParameterP3 () const
 
ParameterP4 ()
 
const ParameterP4 () const
 
ParameterP5 ()
 
const ParameterP5 () 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 27 of file PtRelFcn.hh.

Constructor & Destructor Documentation

◆ PtRelFcn() [1/2]

Genfun::PtRelFcn::PtRelFcn ( )

Definition at line 20 of file PtRelFcn.cc.

20 :
21 _p0("P0", 0, 0, 1),
22 _p1("P1", 0, 0, 2),
23 _p2("P2", 1, 0, 10),
24 _p3("P3", 0, 0, 10),
25 _p4("P4", 1.0, 0.1, 5.0),
26 _p5("P5", 0.0, 0, 50)
27{}

◆ PtRelFcn() [2/2]

Genfun::PtRelFcn::PtRelFcn ( const PtRelFcn right)

Definition at line 32 of file PtRelFcn.cc.

32 :
33AbsFunction(right),
34_p0(right._p0),
35_p1(right._p1),
36_p2(right._p2),
37_p3(right._p3),
38_p4(right._p4),
39_p5(right._p5)
40{
41}

◆ ~PtRelFcn()

Genfun::PtRelFcn::~PtRelFcn ( )
virtual

Definition at line 29 of file PtRelFcn.cc.

29 {
30}

Member Function Documentation

◆ operator()() [1/2]

virtual double Genfun::PtRelFcn::operator() ( const Argument a) const
inlineoverridevirtual

Implements Genfun::AbsFunction.

Definition at line 44 of file PtRelFcn.hh.

44{return operator() (a[0]);}
virtual double operator()(double argument) const override
Definition: PtRelFcn.cc:43

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 43 of file PtRelFcn.cc.

43 {
44
45 double p0 = _p0.getValue();
46 double p1 = _p1.getValue();
47 double p2 = _p2.getValue();
48 double p3 = _p3.getValue();
49 double p4 = _p4.getValue();
50 double p5 = _p5.getValue();
51
52 //assert ((p0>=0.0) && (p0<=1.0));
53 if (p0<0.0) p0=FLT_MIN;
54 if (p0>1.0) p0=1.0-FLT_MIN;
55
56 if (x<=0.0) return 1.0E-10;
57
58 double n = (1+p1)/p3;
59 double a = (1/p3)*std::pow(p2,-n);
60
61 double norm = 1.0/(a*exp(_logGamma(n)));
62 static const double s2 = sqrt(2.0);
63 double retVal=
64 norm*p0*std::pow(x,p1)*exp(-p2*std::pow(x,p3)) +
65 (2.0/(1+_erf(p5/p4/s2))*(1.0-p0)/(sqrt(2*M_PI)*p4))*exp(-(x-p5)*(x-p5)/(2.0*p4*p4));
66
67 //if (!std::isfinite(retVal)) return 1.0E-10;
68
69 return std::max(retVal,1.0E-10);
70}
virtual double getValue() const
Definition: Parameter.cc:29
double norm(const HepGenMatrix &m)
Definition: GenMatrix.cc:54

Referenced by operator()().

◆ P0() [1/2]

Parameter & Genfun::PtRelFcn::P0 ( )

Definition at line 72 of file PtRelFcn.cc.

72 {
73 return _p0;
74}

◆ P0() [2/2]

const Parameter & Genfun::PtRelFcn::P0 ( ) const

Definition at line 76 of file PtRelFcn.cc.

76 {
77 return _p0;
78}

◆ P1() [1/2]

Parameter & Genfun::PtRelFcn::P1 ( )

Definition at line 80 of file PtRelFcn.cc.

80 {
81 return _p1;
82}

◆ P1() [2/2]

const Parameter & Genfun::PtRelFcn::P1 ( ) const

Definition at line 84 of file PtRelFcn.cc.

84 {
85 return _p1;
86}

◆ P2() [1/2]

Parameter & Genfun::PtRelFcn::P2 ( )

Definition at line 88 of file PtRelFcn.cc.

88 {
89 return _p2;
90}

◆ P2() [2/2]

const Parameter & Genfun::PtRelFcn::P2 ( ) const

Definition at line 92 of file PtRelFcn.cc.

92 {
93 return _p2;
94}

◆ P3() [1/2]

Parameter & Genfun::PtRelFcn::P3 ( )

Definition at line 96 of file PtRelFcn.cc.

96 {
97 return _p3;
98}

◆ P3() [2/2]

const Parameter & Genfun::PtRelFcn::P3 ( ) const

Definition at line 100 of file PtRelFcn.cc.

100 {
101 return _p3;
102}

◆ P4() [1/2]

Parameter & Genfun::PtRelFcn::P4 ( )

Definition at line 104 of file PtRelFcn.cc.

104 {
105 return _p4;
106}

◆ P4() [2/2]

const Parameter & Genfun::PtRelFcn::P4 ( ) const

Definition at line 108 of file PtRelFcn.cc.

108 {
109 return _p4;
110}

◆ P5() [1/2]

Parameter & Genfun::PtRelFcn::P5 ( )

Definition at line 112 of file PtRelFcn.cc.

112 {
113 return _p5;
114}

◆ P5() [2/2]

const Parameter & Genfun::PtRelFcn::P5 ( ) const

Definition at line 116 of file PtRelFcn.cc.

116 {
117 return _p5;
118}

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