Logo ROOT   6.10/09
Reference Guide
GaussFunction.h
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #ifndef MN_GaussFunction_H_
11 #define MN_GaussFunction_H_
12 
13 #define _USE_MATH_DEFINES
14 #include <math.h>
15 
16 namespace ROOT {
17 
18  namespace Minuit2 {
19 
20 
22 
23 public:
24 
25  GaussFunction(double mean, double sig, double constant) :
26  fMean(mean), fSigma(sig), fConstant(constant) {}
27 
29 
30  double m() const {return fMean;}
31  double s() const {return fSigma;}
32  double c() const {return fConstant;}
33 
34  double operator()(double x) const {
35 
36  return c()*exp(-0.5*(x-m())*(x-m())/(s()*s()))/(sqrt(2.*M_PI)*s());
37  }
38 
39 private:
40 
41  double fMean;
42  double fSigma;
43  double fConstant;
44 };
45 
46  } // namespace Minuit2
47 
48 } // namespace ROOT
49 
50 #endif // MN_GaussFunction_H_
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
double sqrt(double)
Double_t x[n]
Definition: legend1.C:17
GaussFunction(double mean, double sig, double constant)
Definition: GaussFunction.h:25
double operator()(double x) const
Definition: GaussFunction.h:34
#define M_PI
Definition: Rotated.cxx:105
double exp(double)