// created : June 10th, 2003 // by : Gero Flucke // last update: $Date: 2004/11/24 09:01:26 $ // by : $Author: flucke $ #ifndef __GFMULTIDMFITTER_H #define __GFMULTIDMFITTER_H #include "TObject.h" #include "TArrayD.h" class DstarDmFitter; class TH1; class TH2; class GFHistArray; class GFMultiDmFitter : public TObject { public: GFMultiDmFitter(); virtual ~GFMultiDmFitter(); TH1* Fit(TH2* hist2D, TH1* histRef = NULL, TH2* histWc2D = NULL, TH1* histWcRef = NULL); TH1* Fit(TH2* hist2D, TH2* histWc2D) {return this->Fit(hist2D, NULL, histWc2D, NULL);} // TH1* Fit(GFHistArray* hists1D, TH1* histAll = NULL); TArrayD FitAll(TH1* hist, TH1* histWc = NULL); Int_t SetFitModeAll(Int_t mode) {const Int_t tmp = fFitModeAll; fFitModeAll = mode; return tmp;} Int_t SetFitModeBins(Int_t mode) {const Int_t tmp = fFitModeBins; fFitModeBins = mode; return tmp;} Int_t SetFitOrNotFlag(Int_t flag) {const Int_t tmp = fFitOrNotFlag; fFitOrNotFlag = flag; return tmp;} //0: fit, 1: subtract backgr, 2: count SR, 3: all deltaM 4: cf. FitSingle void SetMergeNBins(UInt_t mergeN) {fMergeNBins = mergeN;}// number of bins to be merged void SetStartUsqr(Float_t val) {fStartUsqr = val;} // < 0 indicates: do not use (default) void SetSmartMode(Bool_t s); void SetStartDmSignal(Double_t start) {fStartDmSignal = start;} void SetEndDmSignal(Double_t end) {fEndDmSignal = end;} Int_t GetFitModeAll() const {return fFitModeAll;} Int_t GetFitModeBins() const {return fFitModeBins;} Int_t GetFitOrNotFlag() const {return fFitOrNotFlag;} UInt_t GetMergeNBins() const {return fMergeNBins;} DstarDmFitter* GetDstarDmFitter() {return fFitter;} Double_t GetStartDmSignal() const {return fStartDmSignal;} Double_t GetEndDmSignal() const { return fEndDmSignal;} GFHistArray* GetHists1D() {return fHists1D;} GFHistArray* GetHists1DWc() {return fHists1DWc;} TH1* GetHistSignalBack() {return fHistSignalBack;} TArrayD CountSignal(TH1* hist, TH1* hWc, Bool_t subtractBack) const; TArrayD FitSingle(TH1* hist, TH1* hWc) const; protected: void Init(); DstarDmFitter* fFitter; Int_t fFitModeAll; Int_t fFitModeBins; Int_t fFitOrNotFlag; //0: fit, 1: subtract backgr, 2: count SR, 3: all deltaM 4: subtract the fit to scaled background, 5: subtract background function integral from counted signal UInt_t fMergeNBins; // number of bins to be merged together before fitting Double_t fOldParams[5]; // storage of parameters of reference fit Float_t fStartUsqr; Double_t fStartDmSignal; Double_t fEndDmSignal; Double_t fStartDmBackgr; Double_t fEndDmBackgr; GFHistArray* fHists1D; GFHistArray* fHists1DWc; TH1* fHistSignalBack; ClassDef(GFMultiDmFitter,0) // }; #endif