AliPhysics  63e47e1 (63e47e1)
AliHFInvMassMultiTrialFit.h
Go to the documentation of this file.
1 #ifndef ALIHFINVMASSMULTITRIALFIT_H
2 #define ALIHFINVMASSMULTITRIALFIT_H
3 /* Copyright(c) 2008-2019, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 #include <TNamed.h>
7 #include <TString.h>
8 #include <TPad.h>
9 #include <set>
10 #include <vector>
11 
12 class TNtuple;
13 class AliHFInvMassFitter;
14 
16 
18 
19  public:
22 
23  void ConfigureRebinSteps(Int_t nSteps, Int_t* values){
24  if(fRebinSteps) delete [] fRebinSteps;
25  fNumOfRebinSteps=nSteps;
27  for(Int_t ib=0; ib<fNumOfRebinSteps; ib++) fRebinSteps[ib]=values[ib];
28  }
29 
32  }
33 
34  void ConfigureLowLimFitSteps(Int_t nSteps, Double_t* values){
35  if(fLowLimFitSteps) delete [] fLowLimFitSteps;
36  fNumOfLowLimFitSteps=nSteps;
38  for(Int_t ib=0; ib<fNumOfLowLimFitSteps; ib++) fLowLimFitSteps[ib]=values[ib];
39  }
40 
41  void ConfigureUpLimFitSteps(Int_t nSteps, Double_t* values){
42  if(fUpLimFitSteps) delete [] fUpLimFitSteps;
43  fNumOfUpLimFitSteps=nSteps;
45  for(Int_t ib=0; ib<fNumOfUpLimFitSteps; ib++) fUpLimFitSteps[ib]=values[ib];
46  }
47 
48  void ConfigurenSigmaBinCSteps(Int_t nSteps, Double_t* values){
49  if(fnSigmaBinCSteps) delete [] fnSigmaBinCSteps;
50  fNumOfnSigmaBinCSteps=nSteps;
52  for(Int_t ib=0; ib<fNumOfnSigmaBinCSteps; ib++) fnSigmaBinCSteps[ib]=values[ib];
53  }
54 
56  min = fMinYieldGlob;
57  max = fMaxYieldGlob;
58  }
61 
65 
66  void SetSuffixForHistoNames(const Char_t* name){
67  fSuffix=name;
68  }
71 
72 
81 
82  void SetUse2GausSignal(Bool_t opt=kTRUE, Double_t fixsig=-1., Double_t fixfrac=-1.){
84  fFixSecondGausSig=fixsig;
85  fFixSecondGausFrac=fixfrac;
86  }
87  void SetUse2GausSigmaRatioSignal(Bool_t opt=kTRUE, Double_t fixrat=-1., Double_t fixfrac=-1.){
89  fFixSecondGausSigRat=fixrat;
90  fFixSecondGausFrac=fixfrac;
91  }
92 
99 
101 
103 
104  Bool_t DoMultiTrials(TH1D* hInvMassHisto, TPad* thePad=0x0);
105  void SaveToRoot(TString fileName, TString option="recreate") const;
106  void DrawHistos(TCanvas* cry) const;
107  void SetTemplatesForReflections(const TH1F *hTemplRefl, const TH1F *hTemplSig);
108 
109  void SetFixRefoS(Float_t refloS){fFixRefloS=refloS;}
110 
112  fUseSecondPeak=kTRUE;
115  }
116 
117  void AddInvMassFitSaveAsFormat(std::string format) { fInvMassFitSaveAsFormats.insert(format); }
119 
120 
124 
125  private:
126 
128  Bool_t DoFitWithPol3Bkg(TH1F* histoToFit, Double_t hmin, Double_t hmax,
129  Int_t theCase);
130 
133 
134  std::set<std::string> fInvMassFitSaveAsFormats;
136  Int_t* fRebinSteps; //[fNumOfRebinSteps] values of rebin
139  Double_t* fLowLimFitSteps; //[fNumOfLowLimFitSteps] values of low limits for fit
141  Double_t* fUpLimFitSteps; //[fNumOfUpLimFitSteps] values of up limits for fit
143  Double_t* fnSigmaBinCSteps; //[fNumOfnSigmaBinCSteps] values of nsigma for bin count
144  Double_t fnSigmaForBkgEval; //value of sigma in which to extract bkg value
145 
170 
176 
178 
180 
189 
194 
201  TH1F** fHistoBkgTrial;
203 
208 
209  TH1F *fhTemplRefl;
210  TH1F *fhTemplSign;
213  TNtuple* fNtupleBinCount;
214 
217 
218  std::vector<AliHFInvMassFitter*> fMassFitters;
219 
221  ClassDef(AliHFInvMassMultiTrialFit,4);
222 };
224 
225 #endif
226 
Bool_t fUsePol4Bkg
switch for pol3 background
void SetUseFixSigFixMean(Bool_t opt=kTRUE)
Int_t * fRebinSteps
number of rebin steps
Bool_t fDrawIndividualFits
switch for saving bkg values in nsigma
TH1F ** fHistoChi2Trial
histo with gauss mean from subsamples of trials
TH1F * fHistoBkgInBinEdgesTrialAll
histo with bkg from all trials
Bool_t fUsePowLawTimesExpoBkg
switch for power law background
double Double_t
Definition: External.C:58
Bool_t fUseFixSigFixMean
switch for FixSigFreeMean
Definition: External.C:236
void SetUse2GausSignal(Bool_t opt=kTRUE, Double_t fixsig=-1., Double_t fixfrac=-1.)
void GetGlobalMinMaxYield(Double_t &min, Double_t &max)
Double_t fSigmaSecondPeak
position of the 2nd peak
void SetSigmaMCVariation(Double_t var=0.15)
TString fileName
Float_t fFixRefloS
template of signal contribution
TString format
file names tag, basically the trigger and calorimeter combination
Double_t fSigmaMCVariation
sigma of D meson peak from MC
Double_t mass
TH1F ** fHistoRawYieldDist
histo with bin counts from all trials
TH2F ** fHistoRawYieldTrialBinC1
histo with bin counts from subsamples of trials
TH1F ** fHistoBkgInBinEdgesTrial
histo with bkg from subsamples of trials
void SetUseLinBackground(Bool_t opt=kTRUE)
Double_t * fnSigmaBinCSteps
number of steps on the bin counting
char Char_t
Definition: External.C:18
TH1F * fHistoBkgTrialAll
histo with chi2 from all trials
Bool_t fUse2GausSignal
switch for power law background
AliHFInvMassFitter class for the fit of invariant mass distribution of charm hadrons.
void SetUseFreeS(Bool_t opt=kTRUE)
void ConfigureLowLimFitSteps(Int_t nSteps, Double_t *values)
std::vector< AliHFInvMassFitter * > fMassFitters
maximum yield
TH1F * fHistoChi2TrialAll
histo with gauss mean from all trials
void AddInvMassFitSaveAsFormat(std::string format)
void SetUseExpoBackground(Bool_t opt=kTRUE)
void ConfigureUpLimFitSteps(Int_t nSteps, Double_t *values)
TH1F ** fHistoSignifTrial
histo with chi2 from subsamples of trials
Double_t fMaxYieldGlob
minimum yield
Bool_t fUseFixSigFreeMean
switch for FixedMeanFreeS
TH1F ** fHistoRawYieldDistBinC0
histo with bkg in mass bin edges from subsamples of trials
Bool_t fUsePol3Bkg
switch for pol2 background
Double_t fFixSecondGausSigRat
value to fix 2nd gaus area
AliHFInvMassMultiTrialFit & operator=(const AliHFInvMassMultiTrialFit &source)
Bool_t fUseFixSigUpFreeMean
value to fix ratio os sigmas
TH1F * fHistoMeanTrialAll
histo with gauss sigma from all trials
Double_t fMassD
relative variation of the sigma
void SetUseFixedMeanFreeS(Bool_t opt=kTRUE)
void SetUsePol2Background(Bool_t opt=kTRUE)
Bool_t fFixSigmaSecondPeak
flag to fix the position of the 2nd peak
TH1F * fHistoRawYieldDistBinC0All
histo with bkg in mass bin edges from all trials
TH1F * fHistoSignifTrialAll
histo with chi2 from all trials
Bool_t fUseSecondPeak
switch for FixSigFixMean
Bool_t fFixMassSecondPeak
width of the 2nd peak
int Int_t
Definition: External.C:63
TH1F ** fHistoRawYieldTrial
histo with yield from subsamples of trials
void SetTemplatesForReflections(const TH1F *hTemplRefl, const TH1F *hTemplSig)
Int_t fNumOfLowLimFitSteps
number of steps in the first bin for rebin
float Float_t
Definition: External.C:68
TH1F * fHistoRawYieldDistBinC1All
histo with bin counts from all trials
Bool_t DoFitWithPol3Bkg(TH1F *histoToFit, Double_t hmin, Double_t hmax, Int_t theCase)
TH1F * fHistoRawYieldTrialAll
histo with yield from all trials
Double_t * fUpLimFitSteps
number of steps on the max. mass for fit
Double_t fMassSecondPeak
switch off/on second peak (for D+->KKpi in Ds)
Bool_t DoMultiTrials(TH1D *hInvMassHisto, TPad *thePad=0x0)
Definition: External.C:212
Double_t fFixSecondGausFrac
value to fix 2nd gaus sigma
TH1F ** fHistoRawYieldDistBinC1
histo with bin counts from subsamples of trials
void ConfigureRebinSteps(Int_t nSteps, Int_t *values)
TH1F * fHistoSigmaTrialAll
histo with yield from all trials
void SaveToRoot(TString fileName, TString option="recreate") const
TH1F * fhTemplRefl
histo with bin counts from subsamples of trials
TH1F * fHistoRawYieldDistAll
flag for drawing fits
Double_t nsigma
TH2F ** fHistoRawYieldTrialBinC0
histo with bin counts from subsamples of trials
TH1F ** fHistoSigmaTrial
histo with yield from subsamples of trials
void SetSaveBkgValue(Bool_t opt=kTRUE, Double_t nsigma=3)
Bool_t fUsePowLawBkg
switch for pol5 background
Bool_t fUseFreeS
switch for FixSigDownFreeMean
void SetUseFixSigFreeMean(Bool_t opt=kTRUE)
void IncludeSecondGausPeak(Double_t mass, Bool_t fixm, Double_t width, Bool_t fixw)
Int_t fFitOption
name to characterize analysis case
void SetUseFixSigUpFreeMean(Bool_t opt=kTRUE)
Bool_t fUsePol5Bkg
switch for pol4 background
Bool_t fSaveBkgVal
flag to fix the width of the 2nd peak
void SetUsePol5Background(Bool_t opt=kTRUE)
Bool_t fUse2GausSigmaRatioSignal
swicth for 2 gaus line shape for S
Bool_t fUseFixedMeanFreeS
switch for FreeSigma
Double_t fFixSecondGausSig
swicth for 2 gaus line shape for S
TH1F * fhTemplSign
template of reflection contribution
Bool_t fUseLinBkg
switch for exponential background
Bool_t fUseFixSigDownFreeMean
switch for FixSigUpFreeMean
void SetSuffixForHistoNames(const Char_t *name)
Bool_t fUseExpoBkg
LL or chi2 fit.
Int_t fNumOfRebinSteps
saves the invariant mass fit canvases in the file formats listed in this vector (if empty...
void SetUsePol3Background(Bool_t opt=kTRUE)
Bool_t fUsePol2Bkg
switch for linear background
Double_t * fLowLimFitSteps
number of steps on the min. mass for fit
void DrawHistos(TCanvas *cry) const
void SetUse2GausSigmaRatioSignal(Bool_t opt=kTRUE, Double_t fixrat=-1., Double_t fixfrac=-1.)
void SetUseFixSigDownFreeMean(Bool_t opt=kTRUE)
TH1F ** fHistoMeanTrial
histo with gauss sigma from subsamples of trials
void SetUsePowerLawTimesExpoBackground(Bool_t opt=kTRUE)
bool Bool_t
Definition: External.C:53
std::set< std::string > fInvMassFitSaveAsFormats
void ConfigurenSigmaBinCSteps(Int_t nSteps, Double_t *values)
TH1F ** fHistoBkgTrial
histo with chi2 from subsamples of trials
TH2F * fHistoRawYieldTrialBinC0All
histo with bin counts from all trials
void SetDrawIndividualFits(Bool_t opt=kTRUE)
void SetUsePol4Background(Bool_t opt=kTRUE)
TH2F * fHistoRawYieldTrialBinC1All
histo with bin counts from all trials
void SetUsePowerLawBackground(Bool_t opt=kTRUE)