CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 (std::shared_ptr< double > m, std::shared_ptr< double > s)
 
 Gaussian (double m, 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

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()) {}
std::shared_ptr< double > sigma
Definition: Gaussian.h:21
std::shared_ptr< double > mean
Definition: Gaussian.h:21
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) {}
std::shared_ptr< double > sigma
Definition: Gaussian.h:21
std::shared_ptr< double > mean
Definition: Gaussian.h:21
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)) {}
std::shared_ptr< double > sigma
Definition: Gaussian.h:21
std::shared_ptr< double > mean
Definition: Gaussian.h:21

Member Function Documentation

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

Definition at line 15 of file Gaussian.h.

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

15  {
16  double z = (x - *mean) / *sigma;
17  if (fabs(z) > 8)
18  return 0;
19  return oneOverSqrtTwoPi / *sigma * exp(-z * z / 2);
20  }
const double oneOverSqrtTwoPi
Definition: Gaussian.h:9
std::shared_ptr< double > sigma
Definition: Gaussian.h:21
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
std::shared_ptr< double > mean
Definition: Gaussian.h:21

Member Data Documentation

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

Definition at line 21 of file Gaussian.h.

Referenced by operator()().

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

Definition at line 21 of file Gaussian.h.

Referenced by operator()().