PulseFit.hh

Go to the documentation of this file.
00001 
00008 #ifndef PULSEFIT_h
00009 #define PULSEFIT_h
00010 
00011 #include "TMath.h"
00012 #include "TObject.h"
00013 
00014 class TF1;
00015 
00021 class PulseFit{
00022   static const int nparams = 9;  
00023 public:
00025   PulseFit();
00027   virtual ~PulseFit();
00029   TF1* GetTF1(); 
00031   void StoreParams(TF1* func);
00033   void Clear();
00034   //fit info:
00035   bool fit_done;     
00036   int fit_result;    
00037   double chi2;       
00038   int ndf;           
00039   int start_index;   
00040   int end_index;     
00041   double range_low;  
00042   double range_high; 
00043   //fit parameters:
00044   double amplitude;  
00045   double c1;         
00046   double tau1;       
00047   double tau2;       
00048   double sigma;      
00049   double decay;      
00050   double baseline;   
00051   double t0;         
00052   double rc;         
00053   
00055   Double_t operator()(Double_t* x, Double_t* par);
00056   
00057   //helper functions
00058   
00059   Double_t common_func1 (double t, double t_0, double sig, double tau)
00060   {
00061     return (1 + TMath::Erf((-sig*sig + (t-t_0)*tau)/(TMath::Sqrt(2)*sig*tau)));
00062   }
00063   
00064   Double_t common_func2 (double t, double t_0, double sig, double tau)
00065   {
00066     return TMath::Exp((sig*sig - 2*(t-t_0)*tau)/(2*tau*tau));
00067   }
00068 
00069   Double_t common_func3 (double t, double t_0, double sig, double tau_a, double tau_b)
00070   {
00071     return common_func2(t, t_0, sig, tau_a)*common_func1(t, t_0, sig, tau_a)/(tau_b - tau_a);
00072   }
00073   ClassDef(PulseFit,1)
00074 };
00075 
00076 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 20 Jun 2014 for daqman by  doxygen 1.6.1