00001 #ifndef HistogramFitFCN_h__ 00002 #define HistogramFitFCN_h__ 00003 00004 #include "Minuit2/FCNBase.h" 00005 #include "TH1D.h" 00006 00007 #include <vector> 00008 00009 class HistogramFitFCN : public ROOT::Minuit2::FCNBase { 00010 00011 public: 00012 HistogramFitFCN(const TH1D* = NULL,const TH1D* = NULL); 00013 ~HistogramFitFCN(); 00014 00015 void SetTemplateHist(const TH1D*,double ped=-1); 00016 void SetPulseHist(const TH1D*); 00017 00018 void SetRefineFactor(int refine_factor) {fRefineFactor = refine_factor;} 00019 void SetTimeOffset(double time_offset); 00020 00021 00029 double operator() (const std::vector<double>& par) const; 00030 00032 double Up() const; 00033 00034 int GetNDoF() { return fNDoF; } 00035 00036 private: 00039 mutable int fNDoF; 00040 00042 double fTimeOffset; 00043 double fTemplatePedestal; 00044 00045 int fRefineFactor; 00046 00047 const TH1D* fTemplateHist; // The template 00048 const TH1D* fPulseHist; // The histogram to fit 00049 00050 }; 00051 00052 #endif