AliPhysics  d219d63 (d219d63)
AliHFPtSpectrum.h
Go to the documentation of this file.
1 #ifndef ALIHFPTSPECTRUM_H
2 #define ALIHFPTSPECTRUM_H
3 
4 /* Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 /* $Id$ */
8 
9 //***********************************************************************
27 //***********************************************************************
28 
29 #include "TNamed.h"
30 #include "TMath.h"
31 
32 #include "AliLog.h"
33 
34 class TH1;
35 class TH2;
36 class TNtuple;
37 class TGraphAsymmErrors;
38 
39 
40 class AliHFPtSpectrum: public TNamed
41 {
42 
43  public:
44 
46  AliHFPtSpectrum(const char* name="AliHFPtSpectrum", const char* title="HF feed down correction class", Int_t option=1);
48  AliHFPtSpectrum(const AliHFPtSpectrum &rhs);
52  virtual ~AliHFPtSpectrum();
53 
58  void SetMCptSpectra(TH1D *hDirect, TH1D *hFeedDown);
60  void SetFeedDownMCptSpectra(TH1D *hFeedDown);
62  void SetMCptDistributionsBounds(TH1D *hDirectMax, TH1D *hDirectMin, TH1D *hFeedDownMax, TH1D *hFeedDownMin);
64  void SetFeedDownMCptDistributionsBounds(TH1D *hFeedDownMax, TH1D *hFeedDownMin);
66  void SetDirectAccEffCorrection(TH1D *hDirectEff);
68  void SetAccEffCorrection(TH1D *hDirectEff, TH1D *hFeedDownEff);
70  void SetReconstructedSpectrum(TH1D *hRec);
78  if (flag) { fParticleAntiParticle = 2; AliInfo(" Setting for particle + anti-particle yields"); }
79  else { fParticleAntiParticle = 1; AliInfo(" Setting for only (anti)particle yields, not the sum of both"); }
80  }
83  void SetfIsStatUncEff(Bool_t flag){ fIsStatUncEff = flag; }
87  void SetLuminosity(Double_t luminosity, Double_t unc){
88  fLuminosity[0]=luminosity; fLuminosity[1]=unc;
89  }
91  void SetTriggerEfficiency(Double_t efficiency, Double_t unc){
92  fTrigEfficiency[0]=efficiency; fTrigEfficiency[1]=unc;
93  }
95  void SetAccEffPercentageUncertainty(Double_t globalEffUnc, Double_t globalBCEffRatioUnc){
96  fGlobalEfficiencyUncertainties[0] = globalEffUnc;
97  fGlobalEfficiencyUncertainties[1] = globalBCEffRatioUnc;
98  }
102  }
104  if(fSystematics) { delete fSystematics; fSystematics=NULL; }
105  fSystematics = syst;
106  }
108  void SetNormalization(Double_t normalization){
109  fLuminosity[0]=normalization;
110  }
112  fLuminosity[0]=nevents/sigma;
113  fNevts = nevents;
114  }
116  fLuminosity[0] = nevents/sigma;
117  fLuminosity[1] = fLuminosity[0] * TMath::Sqrt( (1/nevents) + (sigmaunc/sigma)*(sigmaunc/sigma) );
118  fNevts = nevents;
119  }
120  //
122  void SetTabParameter(Double_t tabvalue, Double_t uncertainty){
123  fTab[0] = tabvalue;
124  fTab[1] = uncertainty;
125  }
127  fCollisionType=ct;
128  }
129 
141  TH1D * GetDirectAccEffCorrection() const { return (fhDirectEffpt ? (TH1D*)fhDirectEffpt : NULL); }
150  TH1D * GetHistoFeedDownCorrectionFc() const { return (fhFc ? (TH1D*)fhFc : NULL); }
155  TH2D * GetHistoFeedDownCorrectionFcVsEloss() const { return (fhFcRcb ? (TH2D*)fhFcRcb : NULL); }
187  TNtuple * GetNtupleCrossSectionVsEloss() { return (fnSigma ? (TNtuple*)fnSigma : NULL); }
196 
197 
202  void ComputeHFPtSpectrum(Double_t deltaY=1.0, Double_t branchingRatioC=1.0, Double_t branchingRatioBintoFinalDecay=1.0);
203 
206 // void ComputeSystUncertainties(AliHFSystErr *systematics, Bool_t combineFeedDown);
207  void ComputeSystUncertainties(Bool_t combineFeedDown);
210  void DrawSpectrum(TGraphAsymmErrors *gPrediction);
211 
215  void EstimateAndSetDirectEfficiencyRecoBin(TH1D *hSimu, TH1D *hReco);
217 
221  TH1D * ReweightHisto(TH1D *hToReweight, TH1D *hReference);
223  TH1D * ReweightRecHisto(TH1D *hRecToReweight, TH1D *hMCToReweight, TH1D *hMCReference);
225  Int_t FindTH2YBin(TH2D *histo, Float_t yvalue);
226 
227 
228  protected:
229 
231  Bool_t Initialize();
232 
242  void CalculateFeedDownCorrectedSpectrumNb(Double_t deltaY, Double_t branchingRatioBintoFinalDecay);
245 
249  TH1D * RebinTheoreticalSpectra(TH1D *hTheory, const char *name);
251  TH1D * EstimateEfficiencyRecoBin(TH1D *hSimu, TH1D *hReco, const char *name);
253  void ResetStatUncEff();
254 
255 
268  //
270  //
278  //
280 
281  //
283  //
305  //
306  TNtuple *fnSigma;
307  TNtuple *fnHypothesis;
309  //
316 
318  Double_t *fPtBinLimits; //[fnPtBins+1] limits of the pt intervals
319  Double_t *fPtBinWidths; //[fnPtBins] width of the pt intervals
320 
321  //
326 
328  ClassDef(AliHFPtSpectrum,7);
329 };
331 
332 #endif
TH2D * fhSigmaCorrRcb
Corrected cross-section (syst. unc. from data only)
TGraphAsymmErrors * fgYieldCorr
Corrected yield (stat unc. only) vs the Ratio(c/b eloss)
void SetMCptDistributionsBounds(TH1D *hDirectMax, TH1D *hDirectMin, TH1D *hFeedDownMax, TH1D *hFeedDownMin)
Set the theoretical direct & feeddown pt spectrum upper and lower bounds.
TH1D * fhStatUncEffbFD
Uncertainty on the feed-down correction due to the prompt efficiency statistical uncertainty.
TH1D * fhStatUncEffcFD
Uncertainty on the cross-section due to the feed-down efficiency statistical uncertainty.
void CalculateFeedDownCorrectedSpectrumFc()
Correct the yield for feed-down correction via fc-method.
void SetSystematicUncertainty(AliHFSystErr *syst)
double Double_t
Definition: External.C:58
void SetFeedDownCalculationOption(Int_t option)
Set the calculation option flag for feed-down correction: 0=none, 1=fc , 2=Nb.
TGraphAsymmErrors * fgYieldCorrExtreme
Corrected yield as TGraphAsymmErrors (syst but feed-down)
TH1D * GetDirectTheoreticalLowerLimitSpectrum() const
const char * title
Definition: MakeQAPdf.C:27
void DrawSpectrum(TGraphAsymmErrors *gPrediction)
Drawing the corrected spectrum comparing to theoretical prediction.
Double_t * fPtBinWidths
Bool_t IsElossHypothesisCalculated()
Return whether the Ratio(c/b eloss) hypothesis has been considered.
Int_t fNevts
all reconstructed D Systematic uncertainties
TGraphAsymmErrors * fgYieldCorrConservative
Extreme corrected yield as TGraphAsymmErrors (syst from feed-down)
void CalculateFeedDownCorrectionFc()
Compute the feed-down correction via fc-method.
Double_t CalculateEfficiencyPtDepedentUncertainty(Double_t pt, Bool_t useOnlyCutVar)
Calculate the efficiency pt-dependent uncertainty.
TGraphAsymmErrors * GetFeedDownCorrectionFcExtreme() const
Return the TGraphAsymmErrors of the feed-down correction (extreme systematics)
TGraphAsymmErrors * GetFeedDownCorrectedSpectrumConservative() const
Return the TGraphAsymmErrors of the yield after feed-down correction (feed-down conservative systemat...
TNtuple * fnHypothesis
Ntuple of the calculation vs the Ratio(c/b eloss)
TH1D * GetHistoFeedDownCorrectionFc() const
Return the histogram of the feed-down correction.
void SetDirectAccEffCorrection(TH1D *hDirectEff)
Set the acceptance and efficiency corrections for direct.
TH1D * GetHistoLowerLimitCrossSectionFromYieldSpectrum() const
TGraphAsymmErrors * GetFeedDownCorrectionFcConservative() const
Return the TGraphAsymmErrors of the feed-down correction (conservative systematics) ...
void EstimateAndSetDirectEfficiencyRecoBin(TH1D *hSimu, TH1D *hReco)
TH1D * GetHistoUpperLimitFeedDownCorrectedSpectrum() const
Return the histogram of the yield after feed-down correction bounds.
TH1D * fhDirectMCptMin
Input MC maximum c–>D spectra.
TH1D * fhYieldCorrMax
Corrected yield (stat unc. only)
void EstimateAndSetFeedDownEfficiencyRecoBin(TH1D *hSimu, TH1D *hReco)
TH1D * GetFeedDownTheoreticalLowerLimitSpectrum() const
TH1D * fhSigmaCorrMin
Maximum corrected cross-section.
TH1D * GetHistoUpperLimitCrossSectionFromYieldSpectrum() const
Return the equivalent invariant cross-section histogram bounds.
TGraphAsymmErrors * GetCrossSectionFromYieldSpectrumConservative() const
Return the equivalent invariant cross-section TGraphAsymmErrors (feed-down conservative systematics) ...
TH2D * fhYieldCorrRcb
Minimum corrected yield.
TH1D * GetHistoLowerLimitFeedDownCorrectedSpectrum() const
void CalculateFeedDownCorrectedSpectrumNb(Double_t deltaY, Double_t branchingRatioBintoFinalDecay)
Correct the yield for feed-down correction via Nb-method.
void SetFeedDownMCptDistributionsBounds(TH1D *hFeedDownMax, TH1D *hFeedDownMin)
Set the theoretical feeddown pt spectrum upper and lower bounds.
TH1D * GetFeedDownStatEffUncOnSigma() const
Bool_t fPbPbElossHypothesis
flag: asymmetric uncertainties are (1) or not (0) considered
void SetTriggerEfficiency(Double_t efficiency, Double_t unc)
Set the trigger efficiency and its uncertainty.
Bool_t fAsymUncertainties
feed-down correction flag: 0=none, 1=fc, 2=Nb
AliHFSystErr * fSystematics
Tab parameter and its uncertainty.
TH1D * GetDirectAccEffCorrection() const
Return the acceptance and efficiency corrections (rebinned if needed)
Double_t * sigma
TH1D * GetHistoUpperLimitFeedDownCorrectionFc() const
Return the histograms of the feed-down correction bounds.
void SetComputeAsymmetricUncertainties(Bool_t flag)
Set if the calculation has to consider asymmetric uncertaInt_ties or not.
TH1D * ReweightRecHisto(TH1D *hRecToReweight, TH1D *hMCToReweight, TH1D *hMCReference)
to reweight the reco-histos: hRecToReweight is reweighted as hReference/hMCToReweight ...
TH1D * fhDirectMCptMax
Input MC b–>D spectra.
int Int_t
Definition: External.C:63
void SetNormalization(Int_t nevents, Double_t sigma)
Int_t fnPtBins
flag : when the analysis is done for In/Out of plane, divide the B-prediction by two ...
TH2D * fhFcRcb
Minimum fc histo.
TH1D * fhFeedDownEffpt
c–>D Acceptance and efficiency correction
float Float_t
Definition: External.C:68
TH2D * GetHistoFeedDownCorrectedSpectrumVsEloss() const
Return the histogram of the yield after feed-down correction vs the Ratio(c/b eloss) ...
TH1D * fhDirectEffpt
Input MC minimum b–>D spectra.
TH1D * GetDirectTheoreticalSpectrum() const
void ResetStatUncEff()
Reset stat unc on the efficiencies.
Bool_t Initialize()
Initialization.
TGraphAsymmErrors * GetFeedDownCorrectedSpectrumExtreme() const
Return the TGraphAsymmErrors of the yield after feed-down correction (feed-down extreme systematics) ...
TNtuple * GetNtupleCrossSectionVsEloss()
Return the ntuple of the calculation vs the Ratio(c/b eloss)
TH1D * fhFeedDownMCptMin
Input MC maximum b–>D spectra.
void SetAccEffPercentageUncertainty(Double_t globalEffUnc, Double_t globalBCEffRatioUnc)
Set global acceptance x efficiency correction uncertainty (in percentages)
Definition: External.C:228
Definition: External.C:212
TH1D * GetFeedDownAccEffCorrection() const
TH1D * GetHistoFeedDownCorrectedSpectrum() const
Return the histogram of the yield after feed-down correction.
TGraphAsymmErrors * fgFcExtreme
Correction histo fc vs the Ratio(c/b eloss)
TH1D * fhSigmaCorrDataSyst
Minimum corrected cross-section.
TNtuple * fnSigma
Conservative corrected cross-section as TGraphAsymmErrors (syst from feed-down)
TGraphAsymmErrors * GetCrossSectionFromYieldSpectrum() const
Return the equivalent invariant cross-section TGraphAsymmErrors (systematics but feed-down) ...
TH1D * GetDirectTheoreticalUpperLimitSpectrum() const
Int_t fFeedDownOption
0=pp, 1=Pb-Pb, 2=p-Pb
void SetfIsStatUncEff(Bool_t flag)
void SetUsePtDependentEffUncertainty(Bool_t flag)
Setter to switch on the pt dependent efficiency correction uncertainty (feed-down calculation) ...
void SetNormalization(Double_t normalization)
Set the normalization factors.
TH1D * GetHistoCrossSectionDataSystematics() const
Return the cross section systematics from data systematics.
TGraphAsymmErrors * GetCrossSectionFromYieldSpectrumExtreme() const
Return the equivalent invariant cross-section TGraphAsymmErrors (feed-down extreme systematics) ...
void SetNormalization(Int_t nevents, Double_t sigma, Double_t sigmaunc)
TH1D * fhFeedDownMCpt
Input MC c–>D spectra.
void SetReconstructedSpectrum(TH1D *hRec)
Set the reconstructed spectrum.
TGraphAsymmErrors * fgSigmaCorrConservative
Extreme corrected cross-section as TGraphAsymmErrors (syst from feed-down)
TH1D * GetHistoLowerLimitFeedDownCorrectionFc() const
TH1D * fhFcMin
Maximum fc histo.
Int_t FindTH2YBin(TH2D *histo, Float_t yvalue)
Functionality to find the y-axis bin of a TH2 for a given y-value.
TH1D * fhFeedDownMCptMax
Input MC minimum c–>D spectra.
void SetReconstructedSpectrumSystematics(TGraphAsymmErrors *gRec)
Bool_t fGlobalEfficiencyPtDependent
uncertainties on the efficiency [0]=c, b, [1]=b/c
TH1D * fhSigmaCorr
Conservative corrected yield as TGraphAsymmErrors (syst from feed-down)
Double_t fTab[2]
use a pt-dependent efficiency uncertainty (Nb method unc.)
TGraphAsymmErrors * fgSigmaCorr
Corrected cross-section (stat unc. only) vs the Ratio(c/b eloss)
AliHFPtSpectrum & operator=(const AliHFPtSpectrum &source)
Assignment operator.
void ComputeSystUncertainties(Bool_t combineFeedDown)
TH1D * fhYieldCorrMin
Maximum corrected yield.
Int_t fCollisionType
Ntuple of the calculation vs the Ratio(c/b eloss)
void CalculateCorrectedSpectrumNoFeedDown()
TH1D * fhYieldCorr
Extreme correction as TGraphAsymmErrors.
void SetFeedDownMCptSpectra(TH1D *hFeedDown)
Set the theoretical feeddown pt spectrum.
virtual ~AliHFPtSpectrum()
Destructor.
TH1D * RebinTheoreticalSpectra(TH1D *hTheory, const char *name)
Function to rebin the theoretical spectra in the data-reconstructed spectra binning.
TH1D * GetDirectStatEffUncOnSigma() const
TGraphAsymmErrors * fgRECSystematics
all reconstructed D
TH1D * GetHistoCrossSectionFromYieldSpectrum() const
Return the equivalent invariant cross-section histogram.
Bool_t CheckHistosConsistency(TH1D *h1, TH1D *h2)
Check histograms consistency function.
void SetComputeElossHypothesis(Bool_t flag)
Set if the calculation has to consider Ratio(c/b eloss) hypothesis.
TH1D * fhStatUncEffbSigma
Uncertainty on the cross-section due to the prompt efficiency statistical uncertainty.
Definition: External.C:220
void ComputeHFPtSpectrum(Double_t deltaY=1.0, Double_t branchingRatioC=1.0, Double_t branchingRatioBintoFinalDecay=1.0)
TGraphAsymmErrors * fgSigmaCorrExtreme
Corrected cross-section as TGraphAsymmErrors (syst but feed-down)
void SetCollisionType(Int_t ct)
Double_t fTrigEfficiency[2]
analyzed luminosity & uncertainty
void SetAccEffCorrection(TH1D *hDirectEff, TH1D *hFeedDownEff)
Set the acceptance and efficiency corrections for direct & feeddown.
TH1D * fhRECpt
b–>D Acceptance and efficiency correction
TH1D * GetFeedDownTheoreticalSpectrum() const
Int_t nevents[nsamples]
TH1D * ReweightHisto(TH1D *hToReweight, TH1D *hReference)
TH1D * fhFcMax
Correction histo fc = 1 / ( 1 + (eff_b/eff_c)*(N_b/N_c) )
Double_t fGlobalEfficiencyUncertainties[2]
trigger efficiency & uncertainty
void SetIsEventPlaneAnalysis(Bool_t flag)
TH1D * GetFeedDownTheoreticalUpperLimitSpectrum() const
bool Bool_t
Definition: External.C:53
TGraphAsymmErrors * fgFcConservative
Extreme correction as TGraphAsymmErrors.
Int_t fParticleAntiParticle
flag : consider (1) or not (0) the stat unc on the efficiencies
AliHFPtSpectrum(const char *name="AliHFPtSpectrum", const char *title="HF feed down correction class", Int_t option=1)
Constructor.
void SetIsParticlePlusAntiParticleYield(Bool_t flag)
Set if the yield is for particle plus anti-particle or not.
TGraphAsymmErrors * GetFeedDownCorrectedSpectrum() const
Return the TGraphAsymmErrors of the yield after feed-down correction (systematics but feed-down) ...
TH1D * EstimateEfficiencyRecoBin(TH1D *hSimu, TH1D *hReco, const char *name)
Function to estimate the efficiency in the data-reconstructed spectra binning.
Double_t fLuminosity[2]
nb of analyzed events
void SetMCptSpectra(TH1D *hDirect, TH1D *hFeedDown)
TH1D * fhFc
Systematic uncertainy on the raw yields.
TH2D * GetHistoCrossSectionFromYieldSpectrumVsEloss() const
TH2D * GetHistoFeedDownCorrectionFcVsEloss() const
Return the histogram of the feed-down correction times the Ratio(c/b eloss)
Double_t * fPtBinLimits
number of pt bins
Definition: External.C:196
Bool_t fIsStatUncEff
flag: whether to do estimates vs Ratio(c/b eloss) hypothesis
void SetLuminosity(Double_t luminosity, Double_t unc)
Set the luminosity and its uncertainty.
TH1D * fhSigmaCorrMax
Corrected cross-section (stat unc. only)
TH1D * GetFeedDownStatEffUncOnFc() const
Bool_t fIsEventPlane
1: only one sign, 2: yield is for particle+anti-particle
TH1D * GetDirectStatEffUncOnFc() const
Histograms to keep track of the influence of the efficiencies statistical uncertainty on the feed-dow...
void SetTabParameter(Double_t tabvalue, Double_t uncertainty)
Set the Tab parameter and its uncertainty.