MINT2
src
Mint
Utils
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
5
#include "
Mint/CLHEPPhysicalConstants.h
"
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
55
GaussFct::GaussFct
()
56
: _x(0)
57
, _height(1./sqrt(
twopi
))
58
, _mean(0)
59
, _sigma(1)
60
, _sqrt2pi(sqrt(
twopi
)){
61
62
}
63
//
MINT::GaussFct::set_mean
void set_mean(double m)
Definition:
GaussFct.cpp:29
MINT::GaussFct::GaussFct
GaussFct()
Definition:
GaussFct.cpp:55
MINT::GaussFct::set_height
void set_height(double h)
Definition:
GaussFct.cpp:26
MINT::GaussFct::getIntegral
double getIntegral() const
Definition:
GaussFct.cpp:40
s
static const double s
Definition:
CLHEPSystemOfUnits.h:126
MINT::GaussFct::height
double height() const
Definition:
GaussFct.cpp:13
CLHEPPhysicalConstants.h
MINT::GaussFct::mean
double mean() const
Definition:
GaussFct.cpp:16
MINT::GaussFct::x
double x() const
Definition:
GaussFct.cpp:10
MINT::GaussFct::_height
double _height
Definition:
GaussFct.h:11
MINT::GaussFct::sigma
double sigma() const
Definition:
GaussFct.cpp:19
MINT::GaussFct::set_x
void set_x(double x_in)
Definition:
GaussFct.cpp:23
GaussFct.h
MINT::GaussFct::set_sigma
void set_sigma(double s)
Definition:
GaussFct.cpp:32
m
static const double m
Definition:
CLHEPSystemOfUnits.h:86
MINT::GaussFct::getVal
double getVal() const
Definition:
GaussFct.cpp:35
MINT::GaussFct::_sqrt2pi
double _sqrt2pi
Definition:
GaussFct.h:13
MINT::GaussFct::_sigma
double _sigma
Definition:
GaussFct.h:12
twopi
static const double twopi
Definition:
CLHEPPhysicalConstants.h:45
MINT
Definition:
BasicComplex.h:7
MINT::GaussFct::_x
double _x
Definition:
GaussFct.h:10
MINT::GaussFct::_mean
double _mean
Definition:
GaussFct.h:12
Generated by
1.8.15