ANALYSIS/TFndFitter.h

00001 // @(#)fROOT/ANALYSYS:$Name:  $:$Id: TFndFitter.h,v 1.9 2007/09/05 09:32:04 Diego_Faso Exp $
00002 // Author: Diego Faso <mailto:faso@to.infn.it>, 11/05/07
00003 
00004 #ifndef FROOT_TFndFitter
00005 #define FROOT_TFndFitter
00006 
00008 //                                                  //
00009 //                    TFndFitter                    //
00010 //                                                  //
00011 //  This class provides a general-purposes          //
00012 //  fit-environment, based on the FIN_AN namespace  //
00013 //                                                  //
00015 
00016 
00017 #include "TObject.h"
00018 
00019 #include "FIN_AN.h"
00020 using namespace FIN_AN;
00021 
00022 class TFndFitter : public TObject{
00023 
00024  protected:
00025   TH1F      *fCurHist; // not deleted by this class
00026   TSpectrum *fCurSpec; // not deleted by this class
00027 
00028   Double_t fResolutionFactor; // must be >= 1 (1 means 3sigma)
00029 
00030 
00031  public:
00032   TFndFitter();
00033   ~TFndFitter();
00034   
00035   void SetCurrentHistogram(TH1F *ref) { fCurHist = ref; }
00036   void SetCurrentSpectrum(TSpectrum *ref) { fCurSpec = ref; }
00037   void SetResolutionFactor(const Double_t &res) { fResolutionFactor = res; }
00038   
00039   // ---
00040   TH1F      *GetCurrentHistogram() { return fCurHist; }
00041   TSpectrum *GetCurrentSpectrum()  { return fCurSpec; }
00042   Double_t GetResolutionFactor() { return fResolutionFactor; }
00043 
00044   // --- Simple gaussian with "yield" as parameter
00045   Int_t FitAllPeaks_GausYield(Double_t sigma_start,Double_t sigma_maxerr); 
00046   Int_t FitSinglePeak_GausYield(Int_t peak_num,Double_t sigma_init,Double_t sigma_maxerr);
00047   void PrintFittedPeaks_GausYield();
00048   TF1 *LocateFittedPeak_GausYield(Double_t low_lim,Double_t high_lim);
00049 
00050   ClassDef(TFndFitter,0) // general-purposes fit-environment for FINUDA
00051 };
00052 
00053 #endif // FROOT_TFndFitter
00054 

Generated on Tue Oct 16 15:40:46 2007 by  doxygen 1.5.2