Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
functions
Landau.h
Go to the documentation of this file.
1
/* -*- mode: c++ -*- */
2
13
#ifndef _Landau_H_
14
#define _Landau_H_
15
16
#include "
FunctionBase.h
"
17
18
#include <cmath>
19
20
namespace
hippodraw {
21
47
class
MDL_HIPPOPLOT_API
Landau
:
public
FunctionBase
48
{
49
private
:
50
52
enum
{
peak
,
53
norm
,
54
sigma
55
};
56
57
protected
:
58
60
virtual
void
initialize ();
61
62
public
:
63
65
Landau
();
66
68
Landau
(
double
peak,
double
counts,
double
sigma );
69
70
virtual
FunctionBase
*
clone
()
const
;
71
73
virtual
double
operator () (
double
x )
const
;
74
75
virtual
void
initialParameters (
const
FunctionHelper
* helper );
76
78
virtual
bool
hasDerivatives ()
const
;
79
80
protected
:
81
82
// virtual double derivByParm ( int i, double x ) const;
83
84
private
:
85
87
inline
double
calcY (
double
x )
const
88
{
89
return
( x - m_parms[peak] ) / m_parms[sigma];
90
}
91
95
inline
double
calcZ (
double
x )
const
96
{
97
double
y = calcY ( x );
98
99
return
-0.5 * ( 1.0 - std::exp ( -y ) );
100
}
101
104
double
derivByNorm (
double
x )
const
;
105
108
double
derivByPeak (
double
x )
const
;
109
112
double
derivBySigma (
double
x )
const
;
113
114
};
115
116
}
// namespace hippodraw
117
118
#endif // _Landau_H_
Generated for HippoDraw Class Library by