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 
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_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
The function represents the Landau distribution.
Definition: Landau.h:47
double calcY(double x) const
compute the reduced variable:
Definition: Landau.h:87
Index to the normalization parameter.
Definition: Landau.h:53
double calcZ(double x) const
Compute the helper variable for derivation: .
Definition: Landau.h:95
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
Index to the peak parameter.
Definition: Landau.h:52
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
An abstract base class to help FunctionBase objects perform some operations.
hippodraw::FunctionBase class interface

Generated for HippoDraw Class Library by doxygen