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 
00078   virtual bool hasDerivatives () const;
00079 
00080 protected:
00081 
00082   //  virtual double derivByParm ( int i, double x ) const;
00083 
00084 private:
00085 
00087   inline double calcY ( double x ) const 
00088   {
00089     return ( x - m_parms[peak] ) / m_parms[sigma];
00090   }
00091 
00095   inline double calcZ ( double x ) const
00096   {
00097     double y = calcY ( x );
00098 
00099         return -0.5 * ( 1.0 - std::exp ( -y ) );
00100   }
00101 
00104   double derivByNorm ( double x ) const;
00105 
00108   double derivByPeak ( double x ) const;
00109 
00112   double derivBySigma ( double x ) const;
00113 
00114 };
00115 
00116 } // namespace hippodraw
00117 
00118 #endif // _Landau_H_

Generated for HippoDraw Class Library by doxygen