CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
funct::Gaussian Struct Reference

#include <Gaussian.h>

Public Member Functions

 Gaussian (const Parameter &m, const Parameter &s)
 
 Gaussian (double m, double s)
 
 Gaussian (std::shared_ptr< double > m, std::shared_ptr< double > s)
 
double operator() (double x) const
 

Public Attributes

std::shared_ptr< double > mean
 
std::shared_ptr< double > sigma
 

Detailed Description

Definition at line 11 of file Gaussian.h.

Constructor & Destructor Documentation

◆ Gaussian() [1/3]

funct::Gaussian::Gaussian ( const Parameter m,
const Parameter s 
)
inline

Definition at line 12 of file Gaussian.h.

12 : mean(m.ptr()), sigma(s.ptr()) {}

◆ Gaussian() [2/3]

funct::Gaussian::Gaussian ( std::shared_ptr< double >  m,
std::shared_ptr< double >  s 
)
inline

Definition at line 13 of file Gaussian.h.

13 : mean(m), sigma(s) {}

◆ Gaussian() [3/3]

funct::Gaussian::Gaussian ( double  m,
double  s 
)
inline

Definition at line 14 of file Gaussian.h.

14 : mean(new double(m)), sigma(new double(s)) {}

Member Function Documentation

◆ operator()()

double funct::Gaussian::operator() ( double  x) const
inline

Definition at line 15 of file Gaussian.h.

15  {
16  double z = (x - *mean) / *sigma;
17  if (fabs(z) > 8)
18  return 0;
19  return oneOverSqrtTwoPi / *sigma * exp(-z * z / 2);
20  }

References funct::exp(), mean, funct::oneOverSqrtTwoPi, and sigma.

Member Data Documentation

◆ mean

std::shared_ptr<double> funct::Gaussian::mean

Definition at line 21 of file Gaussian.h.

Referenced by operator()().

◆ sigma

std::shared_ptr<double> funct::Gaussian::sigma

Definition at line 21 of file Gaussian.h.

Referenced by operator()().

DDAxes::x
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDAxes::z
funct::m
m
Definition: Factorize.h:50
funct::Gaussian::mean
std::shared_ptr< double > mean
Definition: Gaussian.h:21
funct::Gaussian::sigma
std::shared_ptr< double > sigma
Definition: Gaussian.h:21
funct::oneOverSqrtTwoPi
const double oneOverSqrtTwoPi
Definition: Gaussian.h:9
funct::exp
Exp< T >::type exp(const T &t)
Definition: Exp.h:22