MINT2
GaussFct.cpp
Go to the documentation of this file.
1 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2 // status: Mon 9 Feb 2009 19:17:57 GMT
3 #include "Mint/GaussFct.h"
4 
6 #include <cmath>
7 
8 using namespace MINT;
9 
10 double GaussFct::x() const{
11  return _x;}
12 
13 double GaussFct::height() const{
14  return _height;}
15 
16 double GaussFct::mean() const{
17  return _mean;}
18 
19 double GaussFct::sigma() const{
20  return _sigma;}
21 
22 
23 void GaussFct::set_x(double x_in) {
24  _x = x_in;}
25 
26 void GaussFct::set_height(double h) {
27  _height=h;}
28 
29 void GaussFct::set_mean(double m) {
30  _mean = m;}
31 
32 void GaussFct::set_sigma(double s) {
33  _sigma = s;}
34 
35 double GaussFct::getVal() const{
36  double dxs = (x()-mean())/sigma();
37  return height() * exp(-0.5*dxs*dxs);
38 }
39 
40 double GaussFct::getIntegral() const{
41 
42  return height()*_sqrt2pi*sigma();
43 
44 }
45 
46 GaussFct::GaussFct(double x_in, double h, double m, double s)
47  : _x(x_in)
48  , _height(h)
49  , _mean(m)
50  , _sigma(s)
51  , _sqrt2pi(sqrt(twopi)){
52 
53 }
54 
56  : _x(0)
57  , _height(1./sqrt(twopi))
58  , _mean(0)
59  , _sigma(1)
60  , _sqrt2pi(sqrt(twopi)){
61 
62 }
63 //
void set_mean(double m)
Definition: GaussFct.cpp:29
void set_height(double h)
Definition: GaussFct.cpp:26
double getIntegral() const
Definition: GaussFct.cpp:40
static const double s
double height() const
Definition: GaussFct.cpp:13
double mean() const
Definition: GaussFct.cpp:16
double x() const
Definition: GaussFct.cpp:10
double _height
Definition: GaussFct.h:11
double sigma() const
Definition: GaussFct.cpp:19
void set_x(double x_in)
Definition: GaussFct.cpp:23
void set_sigma(double s)
Definition: GaussFct.cpp:32
static const double m
double getVal() const
Definition: GaussFct.cpp:35
double _sqrt2pi
Definition: GaussFct.h:13
double _sigma
Definition: GaussFct.h:12
static const double twopi
double _x
Definition: GaussFct.h:10
double _mean
Definition: GaussFct.h:12