o First Version of TRDnSigma implementation (Xianguo) o still requires some catching...
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisHadEtCorrections.h
CommitLineData
cf6522d1 1//Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili
020abff0 2//University of Tennessee at Knoxville
cf6522d1 3// This is a container class for the correction factors for the hadronic
4// component of transverse energy
5// It is filled by the output of AliAnalysisTaskHadEt from spinning over Monte
6// Carlo data (using AliAnalysisHadEtMonteCarlo)
7// It is used by AliAnalysisTaskHadEt while spinning over reconstructed data
8// (using AliAnalysisHadEtReconstructed)
020abff0 9//Please see https://twiki.cern.ch/twiki/bin/view/ALICE/ETCaloAnalysis
10#ifndef ALIANALYSISHADETCORRECTIONS_H
11#define ALIANALYSISHADETCORRECTIONS_H
12
020abff0 13#include "TString.h"
45e5a6ec 14#include "TNamed.h"
cf6522d1 15class Rtypes;
45e5a6ec 16class TH1D;
cf6522d1 17class TNamed;
226c54bf 18class TObjArray;
020abff0 19
20class AliAnalysisHadEtCorrections : public TNamed
21{
22public:
23
24 AliAnalysisHadEtCorrections();
25 virtual ~AliAnalysisHadEtCorrections();
45e5a6ec 26 virtual void Init();
27
020abff0 28
29 Float_t GetEtaCut() const {return fEtaCut;}
30 Float_t GetAcceptanceCorrectionFull() const {return fAcceptanceCorrectionFull;}
31 Float_t GetAcceptanceCorrectionEMCAL() const {return fAcceptanceCorrectionEMCAL;}
32 Float_t GetAcceptanceCorrectionPHOS() const {return fAcceptanceCorrectionPHOS;}
33 Float_t GetNeutralCorrection() const {return fNeutralCorrection;}
34 Float_t GetNotHadronicCorrection() const {return fNotHadronicCorrection;}
35 Float_t GetpTCutCorrectionTPC() const {return fpTcutCorrectionTPC;}
36 Float_t GetpTCutCorrectionITS() const {return fpTcutCorrectionITS;}
0e866ddc 37 Float_t GetNotIDConstCorrectionTPC() const {return fNotIDConstTPC;}
38 Float_t GetNotIDConstCorrectionITS() const {return fNotIDConstITS;}
39 Float_t GetNotIDConstCorrectionTPCNoID() const {return fNotIDConstTPCNoID;}
40 Float_t GetNotIDConstCorrectionITSNoID() const {return fNotIDConstITSNoID;}
020abff0 41 Float_t GetNeutralCorrectionLowBound() const {return fNeutralCorrectionLow;}
42 Float_t GetNotHadronicCorrectionLowBound() const {return fNotHadronicCorrectionLow;}
43 Float_t GetpTCutCorrectionTPCLowBound() const {return ffpTcutCorrectionTPCLow;}
44 Float_t GetpTCutCorrectionITSLowBound() const {return ffpTcutCorrectionITSLow;}
45 Float_t GetNeutralCorrectionHighBound() const {return fNeutralCorrectionHigh;}
46 Float_t GetNotHadronicCorrectionHighBound() const {return fNotHadronicCorrectionHigh;}
47 Float_t GetpTCutCorrectionTPCHighBound() const {return ffpTcutCorrectionTPCHigh;}
48 Float_t GetpTCutCorrectionITSHighBound() const {return ffpTcutCorrectionITSHigh;}
0e866ddc 49 Float_t GetNotIDConstCorrectionTPCLowBound() const {return fNotIDConstTPCLow;}
50 Float_t GetNotIDConstCorrectionITSLowBound() const {return fNotIDConstITSLow;}
51 Float_t GetNotIDConstCorrectionTPCNoIDLowBound() const {return fNotIDConstTPCNoIDLow;}
52 Float_t GetNotIDConstCorrectionITSNoIDLowBound() const {return fNotIDConstITSNoIDLow;}
825704b5 53 Float_t GetNotIDConstCorrectionTPCHighBound() const {return fNotIDConstTPCHigh;}
54 Float_t GetNotIDConstCorrectionITSHighBound() const {return fNotIDConstITSHigh;}
55 Float_t GetNotIDConstCorrectionTPCNoIDHighBound() const {return fNotIDConstTPCNoIDHigh;}
56 Float_t GetNotIDConstCorrectionITSNoIDHighBound() const {return fNotIDConstITSNoIDHigh;}
020abff0 57 TH1D *GetNotIDCorrectionTPC() const {return fnotIDTPC;}
58 TH1D *GetNotIDCorrectionITS() const {return fnotIDITS;}
59 TH1D *GetNotIDCorrectionNoPID() const {return fnotIDNoID;}
45f9be5c 60 TH1D *GetEfficiencyPionTPC(const int cb = -1);// const {return fEfficiencyPionTPC;}
61 TH1D *GetEfficiencyKaonTPC(const int cb = -1);// const {return fEfficiencyKaonTPC;}
62 TH1D *GetEfficiencyProtonTPC(const int cb = -1);// const {return fEfficiencyProtonTPC;}
63 TH1D *GetEfficiencyHadronTPC(const int cb = -1);// const {return fEfficiencyHadronTPC;}
64 TH1D *GetEfficiencyPionITS(const int cb = -1);// const {return fEfficiencyPionITS;}
65 TH1D *GetEfficiencyKaonITS(const int cb = -1);// const {return fEfficiencyKaonITS;}
66 TH1D *GetEfficiencyProtonITS(const int cb = -1);// const {return fEfficiencyProtonITS;}
67 TH1D *GetEfficiencyHadronITS(const int cb = -1);// const {return fEfficiencyHadronITS;}
020abff0 68 TH1D *GetBackgroundCorrectionTPC() const {return fBackgroundTPC;}
69 TH1D *GetBackgroundCorrectionITS() const {return fBackgroundITS;}
70
71 //This is stored as the inverse of the correction
0e866ddc 72 Float_t GetNotIDCorrectionTPC(const float pT);//{return 1.0/(fnotIDTPC->GetBinContent(fnotIDTPC->FindBin(pT)));}
73 Float_t GetNotIDCorrectionITS(const float pT);//{return 1.0/(fnotIDITS->GetBinContent(fnotIDITS->FindBin(pT)));}
74 Float_t GetNotIDCorrectionNoPID(const float pT);//{return 1.0/(fnotIDNoID->GetBinContent(fnotIDNoID->FindBin(pT)));}
020abff0 75 //As is this...
226c54bf 76 Float_t GetTPCEfficiencyCorrectionPion(const float pT, const int cb = -1);
77 Float_t GetTPCEfficiencyCorrectionKaon(const float pT, const int cb = -1);
78 Float_t GetTPCEfficiencyCorrectionProton(const float pT, const int cb = -1);
79 Float_t GetTPCEfficiencyCorrectionHadron(const float pT, const int cb = -1);
80 Float_t GetITSEfficiencyCorrectionPion(const float pT, const int cb = -1);
81 Float_t GetITSEfficiencyCorrectionKaon(const float pT, const int cb = -1);
82 Float_t GetITSEfficiencyCorrectionProton(const float pT, const int cb = -1);
83 Float_t GetITSEfficiencyCorrectionHadron(const float pT, const int cb = -1);
020abff0 84 //...and these guys are too
45e5a6ec 85 Float_t GetBackgroundCorrectionTPC(const float pT);//{return (1.0-fBackgroundTPC->GetBinContent(fBackgroundTPC->FindBin(pT)));}
86 Float_t GetBackgroundCorrectionITS(const float pT);//{return (1.0-fBackgroundITS->GetBinContent(fBackgroundITS->FindBin(pT)));}
57ea58bf 87 Float_t GetEfficiencyErrorLowBound() const {return fEfficiencyErrorLow;}
88 Float_t GetEfficiencyErrorHighBound() const {return fEfficiencyErrorHigh;}
89 Float_t GetBackgroundErrorLowBound() const {return fBackgroundErrorLow;}
90 Float_t GetBackgroundErrorHighBound() const {return fBackgroundErrorHigh;}
020abff0 91
92
cf6522d1 93 void SetEtaCut(const Float_t val){fEtaCut=val;}
94 void SetAcceptanceCorrectionFull(const Float_t val){fAcceptanceCorrectionFull=val;}
95 void SetAcceptanceCorrectionEMCAL(const Float_t val){fAcceptanceCorrectionEMCAL=val;}
96 void SetAcceptanceCorrectionPHOS(const Float_t val){fAcceptanceCorrectionPHOS=val;}
97 void SetNeutralCorrection(const Float_t val){fNeutralCorrection=val;}
98 void SetNotHadronicCorrection(const Float_t val){fNotHadronicCorrection=val;}
99 void SetpTCutCorrectionTPC(const Float_t val){fpTcutCorrectionTPC=val;}
100 void SetpTCutCorrectionITS(const Float_t val){fpTcutCorrectionITS=val;}
0e866ddc 101 void SetNotIDConstCorrectionTPC(const Float_t val){fNotIDConstTPC=val;}
102 void SetNotIDConstCorrectionITS(const Float_t val){fNotIDConstITS=val;}
103 void SetNotIDConstCorrectionTPCNoID(const Float_t val){fNotIDConstTPCNoID=val;}
104 void SetNotIDConstCorrectionITSNoID(const Float_t val){fNotIDConstITSNoID=val;}
cf6522d1 105 void SetNeutralCorrectionLowBound(const Float_t val){fNeutralCorrectionLow=val;}
106 void SetNotHadronicCorrectionLowBound(const Float_t val){fNotHadronicCorrectionLow=val;}
107 void SetpTCutCorrectionTPCLowBound(const Float_t val){ffpTcutCorrectionTPCLow=val;}
108 void SetpTCutCorrectionITSLowBound(const Float_t val){ffpTcutCorrectionITSLow=val;}
109 void SetNeutralCorrectionHighBound(const Float_t val){fNeutralCorrectionHigh=val;}
110 void SetNotHadronicCorrectionHighBound(const Float_t val){fNotHadronicCorrectionHigh=val;}
111 void SetpTCutCorrectionTPCHighBound(const Float_t val){ffpTcutCorrectionTPCHigh=val;}
112 void SetpTCutCorrectionITSHighBound(const Float_t val){ffpTcutCorrectionITSHigh=val;}
0e866ddc 113 void SetNotIDConstCorrectionTPCLowBound(const Float_t val){fNotIDConstTPCLow=val;}
114 void SetNotIDConstCorrectionITSLowBound(const Float_t val){fNotIDConstITSLow=val;}
115 void SetNotIDConstCorrectionTPCNoIDLowBound(const Float_t val){fNotIDConstTPCNoIDLow=val;}
116 void SetNotIDConstCorrectionITSNoIDLowBound(const Float_t val){fNotIDConstITSNoIDLow=val;}
117 void SetNotIDConstCorrectionTPCHighBound(const Float_t val){fNotIDConstTPCHigh=val;}
118 void SetNotIDConstCorrectionITSHighBound(const Float_t val){fNotIDConstITSHigh=val;}
119 void SetNotIDConstCorrectionTPCNoIDHighBound(const Float_t val){fNotIDConstTPCNoIDHigh=val;}
120 void SetNotIDConstCorrectionITSNoIDHighBound(const Float_t val){fNotIDConstITSNoIDHigh=val;}
cf6522d1 121 void SetNotIDCorrectionTPC(const TH1D *histo){fnotIDTPC=(TH1D*) histo;}
122 void SetNotIDCorrectionITS(const TH1D *histo){fnotIDITS=(TH1D*) histo;}
123 void SetNotIDCorrectionNoPID(const TH1D *histo){fnotIDNoID=(TH1D*) histo;}
124 void SetEfficiencyPionTPC(const TH1D *histo){fEfficiencyPionTPC=(TH1D*) histo;}
125 void SetEfficiencyKaonTPC(const TH1D *histo){fEfficiencyKaonTPC=(TH1D*) histo;}
126 void SetEfficiencyProtonTPC(const TH1D *histo){fEfficiencyProtonTPC=(TH1D*) histo;}
127 void SetEfficiencyHadronTPC(const TH1D *histo){fEfficiencyHadronTPC=(TH1D*) histo;}
128 void SetEfficiencyPionITS(const TH1D *histo){fEfficiencyPionITS=(TH1D*) histo;}
129 void SetEfficiencyKaonITS(const TH1D *histo){fEfficiencyKaonITS=(TH1D*) histo;}
130 void SetEfficiencyProtonITS(const TH1D *histo){fEfficiencyProtonITS=(TH1D*) histo;}
131 void SetEfficiencyHadronITS(const TH1D *histo){fEfficiencyHadronITS=(TH1D*) histo;}
226c54bf 132 void SetEfficiencyPionTPC(TH1D *histo, const int cb);
133 void SetEfficiencyKaonTPC(TH1D *histo, const int cb);
134 void SetEfficiencyProtonTPC(TH1D *histo, const int cb);
135 void SetEfficiencyHadronTPC(TH1D *histo, const int cb);
136 void SetEfficiencyPionITS(TH1D *histo, const int cb);
137 void SetEfficiencyKaonITS(TH1D *histo, const int cb);
138 void SetEfficiencyProtonITS(TH1D *histo, const int cb);
139 void SetEfficiencyHadronITS(TH1D *histo, const int cb);
cf6522d1 140 void SetBackgroundCorrectionTPC(const TH1D *histo){fBackgroundTPC=(TH1D*) histo;}
141 void SetBackgroundCorrectionITS(const TH1D *histo){fBackgroundITS=(TH1D*) histo;}
45f9be5c 142 void SetEfficiencyErrorLowBound(const Float_t val){fEfficiencyErrorLow=val;}
143 void SetEfficiencyErrorHighBound(const Float_t val){fEfficiencyErrorHigh=val;}
144 void SetBackgroundErrorLowBound(const Float_t val){fBackgroundErrorLow=val;}
145 void SetBackgroundErrorHighBound(const Float_t val){fBackgroundErrorHigh=val;}
226c54bf 146 void IsEMCal(Bool_t val){fIsEMCal=val;}
147 void IsData(Bool_t val){fIsData=val;}
148 void SetDataSet(Int_t val){fDataSet=val;}
149 void SetProduction(char *prod){fProduction = prod;}
150 void SetProductionDescription(char *prod){fProductionDescription = prod;}
151 void Report();//Gives a report on the status of all of the corrections
020abff0 152
3ce6b879 153 //Returns the factor one needs to multiply by to get the corrected et for all constant (not pt dependent) factors
464aa50c 154 Float_t GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const;
d263b18f 155 Float_t GetSystematicErrorBound(Float_t et,Bool_t isLowBound, Bool_t isHadronic, Bool_t isTPC) const;
a112459a 156 void GetTotalEt(Float_t hadEt, Float_t hadEtErr, Bool_t isTPC, Float_t rawEmEt, Float_t rawEmEtError, Float_t scale, Float_t energyScaleError, Float_t minEt, Float_t minEtError, Float_t nonLinError, Float_t neutronCorr, Float_t neutronError, Float_t hadronCorr, Float_t hadronError, Float_t kaonCorr, Float_t kaonError, Float_t secondaryCorr, Float_t secondaryError, Float_t &totEt, Float_t &totEtError, Float_t &totEtStatError);
157 void SetSpectraCalcErrorCorrelation(Float_t val){fSpectraCalcErrorCorrelation = val;}
020abff0 158
159 AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g) ; // cpy ctor
160 //AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) ;//cpy assignment
161
162protected:
163
164 Float_t fEtaCut;//the eta cut used for this analysis
165 Float_t fAcceptanceCorrectionFull;//the acceptance correction for full azimuthal acceptance
166 Float_t fAcceptanceCorrectionEMCAL;//the acceptance correction for the EMCal azimuthal acceptance
167 Float_t fAcceptanceCorrectionPHOS;//the acceptance correction for the PHOS azimuthal acceptance
168 //Systematic errors - low value, mean value, high value
169 Float_t fNeutralCorrection;//the correction for the fraction of energy from neutral particles (for using both the calorimeters and the tracking detectors)
170 Float_t fNotHadronicCorrection;//the correction for the fraction of energy which is not measured by the tracking detectors
171 Float_t fpTcutCorrectionTPC;//the correction for the momentum cut for the tpc (150 MeV/c)
172 Float_t fpTcutCorrectionITS;//the correction for the momentum cut for the ITS (100 MeV/c)
0e866ddc 173 Float_t fNotIDConstTPC;//the correction for the constant correction for unidentified particles with the TPC momentum cut
174 Float_t fNotIDConstITS;//the correction for the constant correction for unidentified particles with the ITS momentum cut
175 Float_t fNotIDConstTPCNoID;//the correction for the constant correction for unidentified particles with the TPC momentum cut if no PID was done
176 Float_t fNotIDConstITSNoID;//the correction for the constant correction for unidentified particles with the ITS momentum cut if no PID was done
020abff0 177 Float_t fNeutralCorrectionLow;//the low bound on the neutral energy fraction correction
178 Float_t fNotHadronicCorrectionLow;//the low bound on the hadronic energy fraction correction
179 Float_t ffpTcutCorrectionTPCLow;//the low bound on the TPC momentum cut correction
180 Float_t ffpTcutCorrectionITSLow;//the low bound on the ITS momentum cut correction
181 Float_t fNeutralCorrectionHigh;//the high bound on the neutral energy correcton
182 Float_t fNotHadronicCorrectionHigh;//the high bound on the hadronic energy correction
183 Float_t ffpTcutCorrectionTPCHigh;//the high bound on the TPC momentum cut correction
184 Float_t ffpTcutCorrectionITSHigh;//the high bound on the ITS momentum cut correction
0e866ddc 185 Float_t fNotIDConstTPCLow;//the correction for the constant correction for unidentified particles with the TPC momentum cut
186 Float_t fNotIDConstITSLow;//the correction for the constant correction for unidentified particles with the ITS momentum cut
187 Float_t fNotIDConstTPCNoIDLow;//the correction for the constant correction for unidentified particles with the TPC momentum cut if no PID was done
188 Float_t fNotIDConstITSNoIDLow;//the correction for the constant correction for unidentified particles with the ITS momentum cut if no PID was done
189 Float_t fNotIDConstTPCHigh;//the correction for the constant correction for unidentified particles with the TPC momentum cut
190 Float_t fNotIDConstITSHigh;//the correction for the constant correction for unidentified particles with the ITS momentum cut
191 Float_t fNotIDConstTPCNoIDHigh;//the correction for the constant correction for unidentified particles with the TPC momentum cut if no PID was done
192 Float_t fNotIDConstITSNoIDHigh;//the correction for the constant correction for unidentified particles with the ITS momentum cut if no PID was done
020abff0 193
464aa50c 194 //Histograms with the pT dependent fCorrections
020abff0 195 TH1D *fnotIDTPC;//correction for unidentified tracks in the TPC
196 TH1D *fnotIDITS;//correction for unidentified tracks in the ITS
197 TH1D *fnotIDNoID;//correction for unidentified tracks assuming no ID
198 TH1D *fEfficiencyPionTPC;//efficiency correction for pions in the TPC
199 TH1D *fEfficiencyKaonTPC;//efficiency correction for kaons in the TPC
200 TH1D *fEfficiencyProtonTPC;//efficiency correction for protons in the TPC
201 TH1D *fEfficiencyHadronTPC;//efficiency correction for unidentified hadrons in the TPC
202 TH1D *fEfficiencyPionITS;//efficiency correction for pions in the ITS
203 TH1D *fEfficiencyKaonITS;//efficiency correction for kaons in the ITS
204 TH1D *fEfficiencyProtonITS;//efficiency correction for protons in the ITS
205 TH1D *fEfficiencyHadronITS;//efficiency correction for unidentified hadrons in the ITS
226c54bf 206 TObjArray *fEfficiencyTPC;//TList containing efficiencies for ITS standalone tracks for different centrality bins
207 TObjArray *fEfficiencyITS;//TList containing efficiencies for ITS standalone tracks for different centrality bins
45f9be5c 208 Float_t fEfficiencyErrorLow;//Relative error on efficiency, lower bound
209 Float_t fEfficiencyErrorHigh;//Relative error on efficiency, upper bound
210 Float_t fBackgroundErrorLow;//Relative error on efficiency, lower bound
211 Float_t fBackgroundErrorHigh;//Relative error on efficiency, upper bound
020abff0 212 TH1D *fBackgroundTPC;//background correction for the TPC
213 TH1D *fBackgroundITS;//background correction for the ITS
226c54bf 214 Bool_t fIsEMCal;//boolean to keep track of whether this is for EMCal or PHOS acceptance
215 Bool_t fIsData;//boolean to keep track of whether this is for data or simulation acceptance
216 Int_t fDataSet;//integer to keep track of data set
217 TString fProduction;//Short version name of production
218 TString fProductionDescription;//Long description of production
a112459a 219 Float_t fSpectraCalcErrorCorrelation;//Correlation between systematic errors calculated from spectra, as a fraction
020abff0 220
221
222private:
223 //Declare it private to avoid compilation warning
224 AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) ;//cpy assignment
225 AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections & g) ; // cpy ctor
226
227 ClassDef(AliAnalysisHadEtCorrections, 1);
228};
229
230#endif // ALIANALYSISHADETCORRECTIONS_H