CMS 3D CMS Logo

Public Member Functions | Public Attributes

funct::Gaussian Struct Reference

#include <Gaussian.h>

List of all members.

Public Member Functions

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

Public Attributes

boost::shared_ptr< double > mean
boost::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.

                                                       : 
      mean(m.ptr()), sigma(s.ptr()) { }
funct::Gaussian::Gaussian ( boost::shared_ptr< double >  m,
boost::shared_ptr< double >  s 
) [inline]

Definition at line 14 of file Gaussian.h.

                                                                  : 
      mean(m), sigma(s) { }
funct::Gaussian::Gaussian ( double  m,
double  s 
) [inline]

Definition at line 16 of file Gaussian.h.

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

Member Function Documentation

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

Definition at line 18 of file Gaussian.h.

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

                                      {
      double z = (x - *mean)/ *sigma;
      if(fabs(z)>8) return 0;
      return oneOverSqrtTwoPi/ *sigma * exp(-z*z/2);
    }

Member Data Documentation

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

Definition at line 23 of file Gaussian.h.

Referenced by operator()().

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

Definition at line 23 of file Gaussian.h.

Referenced by operator()().