AliPhysics  00cf6f7 (00cf6f7)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Go to the documentation of this file.
4 #include <TNamed.h>
6 class TF1;
7 class TH1F;
9 class AliHFInvMassFitter : public TNamed {
10  public:
12  enum ETypeOfBkg{ kExpo=0, kLin=1, kPol2=2, kNoBk=3, kPow=4, kPowEx=5};
13  enum ETypeOfSgn{ kGaus=0, k2Gaus=1 };
15  AliHFInvMassFitter(const TH1F* histoToFit, Double_t minvalue, Double_t maxvalue, Int_t fittypeb=kExpo, Int_t fittypes=kGaus);
18  void SetRangeFit(Double_t minvalue, Double_t maxvalue){
19  fMinMass=minvalue; fMaxMass=maxvalue;
20  }
25  void SetFitOption(TString opt){fFitOption=opt.Data();};
30  fFixedMean=kTRUE;
31  }
34  fFixedSigma=kTRUE;
35  }
37  fFixedRawYield=yield;
38  }
40  fSecondPeak=kTRUE; fSecMass=mass; fSecWidth=width;
41  fFixSecMass=fixm; fFixSecWidth=fixw;
42  }
43  Double_t GetRawYield()const {return fRawYield;}
45  Double_t GetMean() const {return fMass;}
47  Double_t GetSigma()const {return fSigmaSgn;}
51  TF1* GetMassFunc(){return fFuncTot;}
53  if(fFuncTot) return fFuncTot->GetChisquare();
54  else return -1;
55  }
57  if(fFuncTot) return fFuncTot->GetChisquare()/fFuncTot->GetNDF();
58  else return -1;
59  }
61  if(fFuncTot) return fFuncTot->GetProb();
62  else return -1;
63  }
70  virtual void Signal(Double_t nOfSigma,Double_t &signal,Double_t &errsignal) const;
71  virtual void Signal(Double_t min,Double_t max,Double_t &signal,Double_t &errsignal) const;
72  void Background(Double_t nOfSigma, Double_t &background,Double_t &errbackground) const;
73  void Background(Double_t min, Double_t max, Double_t &background,Double_t &errbackground) const;
74  void DrawHere(TVirtualPad* c);
75  void Significance(Double_t nOfSigma, Double_t &significance,Double_t &errsignificance) const;
76  void Significance(Double_t min, Double_t max, Double_t &significance,Double_t &errsignificance) const;
78  private:
82  void SetNumberOfParams();
84  TF1* CreateBackgroundFitFunction(TString fname, Double_t integral);
85  TF1* CreateSignalFitFunction(TString fname, Double_t integral);
86  TF1* CreateSecondPeakFunction(TString fname, Double_t integral);
87  TF1* CreateTotalFitFunction(TString fname);
89  void DrawFit();
91  TH1F* fHistoInvMass;
109  TF1* fSigFunc;
110  TF1* fBkgFuncSb;
111  TF1* fBkgFunc;
112  TF1* fBkgFuncRef;
118  TF1* fSecFunc;
119  TF1* fFuncTot;
122  ClassDef(AliHFInvMassFitter,1);
123 };
126 #endif
Int_t fTypeOfFit4Sgn
background fit func
Double_t GetMeanUncertainty() const
Double_t fSigmaSgnErr
signal gaussian sigma
Bool_t fFixSecWidth
flag to fix the position of the 2nd peak
Double_t GetChiSquare() const
Double_t GetFitProbability() const
double Double_t
Definition: External.C:58
Double_t fRawYield
L, LW or Chi2.
void IncludeSecondGausPeak(Double_t mass, Bool_t fixm, Double_t width, Bool_t fixw)
Bool_t fOnlySideBands
fit parameters in background fit function
virtual void Signal(Double_t nOfSigma, Double_t &signal, Double_t &errsignal) const
Double_t FitFunction4SecPeak(Double_t *x, Double_t *par)
Double_t fMass
signal fit func
TF1 * CreateTotalFitFunction(TString fname)
Double_t mass
Double_t fRawYieldErr
signal gaussian integral
void SetFitOption(TString opt)
TCanvas * c
Definition: TestFitELoss.C:172
TF1 * CreateSecondPeakFunction(TString fname, Double_t integral)
Double_t fFixedRawYield
switch for fix Sigma of gaussian
Double_t GetSigma() const
Double_t FitFunction4Bkg(Double_t *x, Double_t *par)
Double_t fSigmaSgn
unc on signal gaussian mean value
Double_t fSecMass
swicth off/on second peak (for D+->KKpi in Ds)
void SetFixGaussianSigma(Double_t sigma)
Bool_t fFixSecMass
width of the 2nd peak
TF1 * fSecFunc
flag to fix the width of the 2nd peak
Double_t * sigma
TF1 * fBkgFuncRef
background fit function (1st step)
void SetFixGaussianMean(Double_t mean)
int Int_t
Definition: External.C:63
Double_t fSecWidth
position of the 2nd peak
Int_t fNSigPars
initialization for wa yield
Double_t GetMean() const
TString fFitOption
kTRUE = only side bands considered
TF1 * CreateSignalFitFunction(TString fname, Double_t integral)
Bool_t fFixedMean
unc on signal gaussian sigma
Double_t GetReducedChiSquare() const
void SetFixSignalYield(Double_t yield)
Int_t fTypeOfFit4Bkg
upper mass limit
TF1 * fBkgFunc
background fit function (1st step)
Double_t fMassErr
signal gaussian mean value
Double_t fMinMass
histogram to fit
TF1 * fFuncTot
fit function for second peak
Double_t FitFunction4Mass(Double_t *x, Double_t *par)
Double_t GetSigmaUncertainty() const
void Significance(Double_t nOfSigma, Double_t &significance, Double_t &errsignificance) const
Bool_t MassFitter(Bool_t draw=kTRUE)
Bool_t draw[nPtBins]
Double_t fMaxMass
lower mass limit
TF1 * CreateBackgroundFitFunction(TString fname, Double_t integral)
Double_t GetRawYieldError() const
void Background(Double_t nOfSigma, Double_t &background, Double_t &errbackground) const
void SetInitialGaussianSigma(Double_t sigma)
void SetInitialGaussianMean(Double_t mean)
void SetRangeFit(Double_t minvalue, Double_t maxvalue)
Double_t FitFunction4Sgn(Double_t *x, Double_t *par)
void SetUseLikelihoodWithWeightsFit()
bool Bool_t
Definition: External.C:53
Double_t CheckForSignal(Double_t mean, Double_t sigma)
TF1 * fSigFunc
err on signal gaussian integral
TF1 * fBkgFuncSb
Signal fit function.
TF1 * GetBackgroundFullRangeFunc()
Bool_t fSecondPeak
background fit function (2nd step)
AliHFInvMassFitter & operator=(const AliHFInvMassFitter &source)
void DrawHere(TVirtualPad *c)
Int_t fNBkgPars
fit parameters in signal fit function
Double_t GetRawYield() const
Bool_t fFixedSigma
switch for fix mean of gaussian