Landau.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00013 #ifndef _Landau_H_
00014 #define _Landau_H_
00015 
00016 #include "FunctionBase.h"
00017 
00018 #include <cmath>
00019 
00020 namespace hippodraw {
00021 
00047 class MDL_HIPPOPLOT_API Landau : public FunctionBase
00048 {
00049 private:
00050 
00052   enum { peak, 
00053          norm, 
00054          sigma 
00055   };
00056 
00057 protected:
00058 
00060   virtual void initialize ();
00061 
00062 public:
00063 
00065   Landau ();
00066 
00068   Landau ( double peak, double counts, double sigma );
00069 
00070   virtual FunctionBase * clone () const;
00071 
00073   virtual double operator () ( double x ) const;
00074 
00075   virtual void initialParameters ( const FunctionHelper * helper );
00076 
00077 protected:
00078 
00079   virtual double derivByParm ( int i, double x ) const;
00080 
00081 private:
00082 
00084   inline double calcY ( double x ) const 
00085   {
00086     return ( x - m_parms[peak] ) / m_parms[sigma];
00087   }
00088 
00092   inline double calcZ ( double x ) const
00093   {
00094     double y = calcY ( x );
00095 
00096         return -0.5 * ( 1.0 - std::exp ( -y ) );
00097   }
00098 
00101   double derivByNorm ( double x ) const;
00102 
00105   double derivByPeak ( double x ) const;
00106 
00109   double derivBySigma ( double x ) const;
00110 
00111 };
00112 
00113 } // namespace hippodraw
00114 
00115 #endif // _Landau_H_

Generated for HippoDraw Class Library by doxygen