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

#include <Gaussian.hh>

+ Inheritance diagram for Genfun::Gaussian:

Public Member Functions

 Gaussian ()
 
 Gaussian (const Gaussian &right)
 
virtual ~Gaussian ()
 
virtual double operator() (double argument) const override
 
virtual double operator() (const Argument &a) const override
 
Parametermean ()
 
const Parametermean () const
 
Parametersigma ()
 
const Parametersigma () const
 
Derivative partial (unsigned int) const override
 
virtual bool hasAnalyticDerivative () const override
 
- 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 Gaussian.hh.

Constructor & Destructor Documentation

◆ Gaussian() [1/2]

Genfun::Gaussian::Gaussian ( )

Definition at line 19 of file Gaussian.cc.

19 :
20 _mean("Mean", 0.0,-10,10),
21 _sigma("Sigma",1.0,0, 10)
22{}

◆ Gaussian() [2/2]

Genfun::Gaussian::Gaussian ( const Gaussian right)

Definition at line 27 of file Gaussian.cc.

27 :
28AbsFunction(right),
29_mean(right._mean),
30_sigma(right._sigma)
31{
32}

◆ ~Gaussian()

Genfun::Gaussian::~Gaussian ( )
virtual

Definition at line 24 of file Gaussian.cc.

24 {
25}

Member Function Documentation

◆ hasAnalyticDerivative()

virtual bool Genfun::Gaussian::hasAnalyticDerivative ( ) const
inlineoverridevirtual

Reimplemented from Genfun::AbsFunction.

Definition at line 51 of file Gaussian.hh.

51{return true;}

◆ mean() [1/2]

Parameter & Genfun::Gaussian::mean ( )

Definition at line 41 of file Gaussian.cc.

41 {
42 return _mean;
43}

◆ mean() [2/2]

const Parameter & Genfun::Gaussian::mean ( ) const

Definition at line 49 of file Gaussian.cc.

49 {
50 return _mean;
51}

◆ operator()() [1/2]

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

Implements Genfun::AbsFunction.

Definition at line 37 of file Gaussian.hh.

37{return operator() (a[0]);}
virtual double operator()(double argument) const override
Definition: Gaussian.cc:34

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 34 of file Gaussian.cc.

34 {
35 double s = _sigma.getValue();
36 double x0 = _mean.getValue();
37 return (1.0/(sqrt(2*M_PI)*s))*
38 exp(-(x-x0)*(x-x0)/(2.0*s*s));
39}
virtual double getValue() const
Definition: Parameter.cc:29

Referenced by operator()().

◆ partial()

Derivative Genfun::Gaussian::partial ( unsigned int  index) const
overridevirtual

Reimplemented from Genfun::AbsFunction.

Definition at line 68 of file Gaussian.cc.

68 {
69 assert(index==0);
70 Variable x;
71 const AbsFunction & fPrime = (*this)*(_mean-x)/_sigma/_sigma;
72 return Derivative(&fPrime);
73}
FunctionNoop Derivative
Definition: AbsFunction.hh:42

◆ sigma() [1/2]

Parameter & Genfun::Gaussian::sigma ( )

Definition at line 45 of file Gaussian.cc.

45 {
46 return _sigma;
47}

Referenced by Genfun::Erf::partial().

◆ sigma() [2/2]

const Parameter & Genfun::Gaussian::sigma ( ) const

Definition at line 53 of file Gaussian.cc.

53 {
54 return _sigma;
55}

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