1 //Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili
2 //University of Tennessee at Knoxville
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)
9 //Please see https://twiki.cern.ch/twiki/bin/view/ALICE/ETCaloAnalysis
10 #include "AliAnalysisHadEtCorrections.h"
14 #include "TObjArray.h"
20 ClassImp(AliAnalysisHadEtCorrections);
23 AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections() : TNamed(),
25 ,fAcceptanceCorrectionFull(0)
26 ,fAcceptanceCorrectionEMCAL(0)
27 ,fAcceptanceCorrectionPHOS(0)
28 ,fNeutralCorrection(0)
29 ,fNotHadronicCorrection(0)
30 ,fpTcutCorrectionTPC(0)
31 ,fpTcutCorrectionITS(0)
34 ,fNotIDConstTPCNoID(0)
35 ,fNotIDConstITSNoID(0)
36 ,fNeutralCorrectionLow(0)
37 ,fNotHadronicCorrectionLow(0)
38 ,ffpTcutCorrectionTPCLow(0)
39 ,ffpTcutCorrectionITSLow(0)
40 ,fNeutralCorrectionHigh(0)
41 ,fNotHadronicCorrectionHigh(0)
42 ,ffpTcutCorrectionTPCHigh(0)
43 ,ffpTcutCorrectionITSHigh(0)
46 ,fNotIDConstTPCNoIDLow(0)
47 ,fNotIDConstITSNoIDLow(0)
48 ,fNotIDConstTPCHigh(0)
49 ,fNotIDConstITSHigh(0)
50 ,fNotIDConstTPCNoIDHigh(0)
51 ,fNotIDConstITSNoIDHigh(0)
55 ,fEfficiencyPionTPC(0)
56 ,fEfficiencyKaonTPC(0)
57 ,fEfficiencyProtonTPC(0)
58 ,fEfficiencyHadronTPC(0)
59 ,fEfficiencyPionITS(0)
60 ,fEfficiencyKaonITS(0)
61 ,fEfficiencyProtonITS(0)
62 ,fEfficiencyHadronITS(0)
65 ,fEfficiencyErrorLow(0)
66 ,fEfficiencyErrorHigh(0)
67 ,fBackgroundErrorLow(0)
68 ,fBackgroundErrorHigh(0)
74 ,fProduction("ProductionName")
75 ,fProductionDescription("Long production description")
76 {//default constructor
79 void AliAnalysisHadEtCorrections::Init()
80 { //This seems to solve a compiler error
81 cout<<"Creating new AliAnalysisHadEtCorrections"<<endl;
82 fEfficiencyTPC = new TObjArray();
83 fEfficiencyITS = new TObjArray();
86 AliAnalysisHadEtCorrections::~AliAnalysisHadEtCorrections()
92 fEfficiencyPionTPC->Clear();
93 fEfficiencyKaonTPC->Clear();
94 fEfficiencyProtonTPC->Clear();
95 fEfficiencyHadronTPC->Clear();
96 fEfficiencyPionITS->Clear();
97 fEfficiencyKaonITS->Clear();
98 fEfficiencyProtonITS->Clear();
99 fEfficiencyHadronITS->Clear();
100 fBackgroundTPC->Clear();
101 fBackgroundITS->Clear();
105 delete fEfficiencyPionTPC;
106 delete fEfficiencyKaonTPC;
107 delete fEfficiencyProtonTPC;
108 delete fEfficiencyHadronTPC;
109 delete fEfficiencyPionITS;
110 delete fEfficiencyKaonITS;
111 delete fEfficiencyProtonITS;
112 delete fEfficiencyHadronITS;
113 delete fEfficiencyTPC;
114 delete fEfficiencyITS;
115 delete fBackgroundTPC;
116 delete fBackgroundITS;
118 AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g): TNamed(),
120 ,fAcceptanceCorrectionFull(g->fAcceptanceCorrectionFull)
121 ,fAcceptanceCorrectionEMCAL(g->fAcceptanceCorrectionEMCAL)
122 ,fAcceptanceCorrectionPHOS(g->fAcceptanceCorrectionPHOS)
123 ,fNeutralCorrection(g->fNeutralCorrection)
124 ,fNotHadronicCorrection(g->fNotHadronicCorrection)
125 ,fpTcutCorrectionTPC(g->fpTcutCorrectionTPC)
126 ,fpTcutCorrectionITS(g->fpTcutCorrectionITS)
127 ,fNotIDConstTPC(g->fNotIDConstTPC)
128 ,fNotIDConstITS(g->fNotIDConstITS)
129 ,fNotIDConstTPCNoID(g->fNotIDConstTPCNoID)
130 ,fNotIDConstITSNoID(g->fNotIDConstITSNoID)
131 ,fNeutralCorrectionLow(g->fNeutralCorrectionLow)
132 ,fNotHadronicCorrectionLow(g->fNotHadronicCorrectionLow)
133 ,ffpTcutCorrectionTPCLow(g->ffpTcutCorrectionTPCLow)
134 ,ffpTcutCorrectionITSLow(g->ffpTcutCorrectionITSLow)
135 ,fNeutralCorrectionHigh(g->fNeutralCorrectionHigh)
136 ,fNotHadronicCorrectionHigh(g->fNotHadronicCorrectionHigh)
137 ,ffpTcutCorrectionTPCHigh(g->ffpTcutCorrectionTPCHigh)
138 ,ffpTcutCorrectionITSHigh(g->ffpTcutCorrectionITSHigh)
139 ,fNotIDConstTPCLow(g->fNotIDConstTPCLow)
140 ,fNotIDConstITSLow(g->fNotIDConstITSLow)
141 ,fNotIDConstTPCNoIDLow(g->fNotIDConstTPCNoIDLow)
142 ,fNotIDConstITSNoIDLow(g->fNotIDConstITSNoIDLow)
143 ,fNotIDConstTPCHigh(g->fNotIDConstTPCHigh)
144 ,fNotIDConstITSHigh(g->fNotIDConstITSHigh)
145 ,fNotIDConstTPCNoIDHigh(g->fNotIDConstTPCNoIDHigh)
146 ,fNotIDConstITSNoIDHigh(g->fNotIDConstITSNoIDHigh)
150 ,fEfficiencyPionTPC(0)
151 ,fEfficiencyKaonTPC(0)
152 ,fEfficiencyProtonTPC(0)
153 ,fEfficiencyHadronTPC(0)
154 ,fEfficiencyPionITS(0)
155 ,fEfficiencyKaonITS(0)
156 ,fEfficiencyProtonITS(0)
157 ,fEfficiencyHadronITS(0)
160 ,fEfficiencyErrorLow(g->fEfficiencyErrorLow)
161 ,fEfficiencyErrorHigh(g->fEfficiencyErrorHigh)
162 ,fBackgroundErrorLow(g->fBackgroundErrorLow)
163 ,fBackgroundErrorHigh(g->fBackgroundErrorHigh)
166 ,fIsEMCal(g->fIsEMCal)
168 ,fDataSet(g->fDataSet)
169 ,fProduction(g->fProduction)
170 ,fProductionDescription(g->fProductionDescription)
172 //SetName(g->GetName());
173 fnotIDTPC = new TH1D(*(g->fnotIDTPC));
174 fnotIDITS = new TH1D(*(g->fnotIDITS));
175 fnotIDNoID = new TH1D(*(g->fnotIDNoID));
176 fEfficiencyPionTPC = new TH1D(*(g->fEfficiencyPionTPC));
177 fEfficiencyKaonTPC = new TH1D(*(g->fEfficiencyKaonTPC));
178 fEfficiencyProtonTPC = new TH1D(*(g->fEfficiencyProtonTPC));
179 fEfficiencyHadronTPC = new TH1D(*(g->fEfficiencyHadronTPC));
180 fEfficiencyPionITS = new TH1D(*(g->fEfficiencyPionITS));
181 fEfficiencyKaonITS = new TH1D(*(g->fEfficiencyKaonITS));
182 fEfficiencyProtonITS = new TH1D(*(g->fEfficiencyProtonITS));
183 fEfficiencyHadronITS = new TH1D(*(g->fEfficiencyHadronITS));
184 fEfficiencyTPC = new TObjArray(*(g->fEfficiencyTPC));
185 fEfficiencyITS = new TObjArray(*(g->fEfficiencyITS));
186 fBackgroundTPC = new TH1D(*(g->fBackgroundTPC));
187 fBackgroundITS = new TH1D(*(g->fBackgroundITS));
191 Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const {//Get the correction values that are not pt dependent
192 Float_t acceptance = 0.0;
193 Float_t neutral = 0.0;
194 Float_t ptcorr = 0.0;
195 float correction = 0.0;
197 //TString *type = new TString(mytype);
199 if(type.Contains("Full") || type.Contains("PiKP")) acceptance = fAcceptanceCorrectionFull;
200 if(type.Contains("EMCAL")) acceptance = fAcceptanceCorrectionEMCAL;
201 if(type.Contains("PHOS")) acceptance = fAcceptanceCorrectionPHOS;
203 if(type.Contains("PiKP")){
204 if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;}
205 else{ptcorr = fpTcutCorrectionITS;}
206 if(type.Contains("High")){
207 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;}
208 else{ptcorr = ffpTcutCorrectionITSHigh;}
210 if(type.Contains("Low")){
211 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;}
212 else{ptcorr = ffpTcutCorrectionITSLow;}
216 if(type.Contains("High")){//high bound
217 if(totEt) neutral = fNotHadronicCorrectionHigh;
218 else{neutral = fNeutralCorrectionHigh;}
219 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;}
220 else{ptcorr = ffpTcutCorrectionITSHigh;}
221 cout<<"Setting correction factor to "<<correction<<endl;
224 if(type.Contains("Low")){//high bound
225 if(totEt) neutral = fNotHadronicCorrectionLow;
226 else{neutral = fNeutralCorrectionLow;}
227 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;}
228 else{ptcorr = ffpTcutCorrectionITSLow;}
229 cout<<"Setting correction factor to "<<correction<<endl;
233 if(totEt) neutral = fNotHadronicCorrection;
234 else{neutral = fNeutralCorrection;}
235 if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;}
236 else{ptcorr = fpTcutCorrectionITS;}
238 correction = acceptance*neutral*ptcorr;
239 cout<<"Setting correction factor for ";
240 if(totEt) cout<<"total et";
241 else{cout<<"hadronic et";}
242 cout<<" with the pt cut off "<<ptcut<<" for "<<type<<" acceptance to "<<correction<<endl;
243 //cout<<" Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl;
247 Float_t AliAnalysisHadEtCorrections::GetSystematicErrorBound(Float_t et,Bool_t isLowBound, Bool_t isHadronic, Bool_t isTPC) const{
248 //we calculate factors for each value and then multiply them to get the overall bounds
249 //neutral corrections, pt cut, pid, efficiency, background
253 float efficiency = 1.0;
254 float background = 1.0;
255 if(isLowBound){//is lower bound
256 if(isHadronic) neutral= fNeutralCorrectionLow/fNeutralCorrection;
257 else{neutral = fNotHadronicCorrectionLow/fNotHadronicCorrection;}
258 if(isTPC) ptcut = ffpTcutCorrectionTPCLow/fpTcutCorrectionTPC;
259 else{ptcut = ffpTcutCorrectionITSLow/fpTcutCorrectionITS;}
260 pid = fNotIDConstTPCLow/fNotIDConstTPC;
261 efficiency = fEfficiencyErrorLow;
262 background = fBackgroundErrorLow;
264 else{//is higher bound
265 if(isHadronic) neutral= fNeutralCorrectionHigh/fNeutralCorrection;
266 else{neutral= fNotHadronicCorrectionHigh/fNotHadronicCorrection;}
267 if(isTPC) ptcut = ffpTcutCorrectionTPCHigh/fpTcutCorrectionTPC;
268 else{ptcut = ffpTcutCorrectionITSHigh/fpTcutCorrectionITS;}
269 pid = fNotIDConstTPCHigh/fNotIDConstTPC;
270 efficiency = fEfficiencyErrorHigh;
271 background = fBackgroundErrorHigh;
273 //cout<<"neutral "<<neutral<<" ptcut "<<ptcut<<" pid "<<pid<<" efficiency "<<efficiency<<" background "<<background<<" overall "<<neutral*ptcut*pid*efficiency*background<<endl;
274 return neutral*ptcut*pid*efficiency*background*et;
276 // AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) {
278 // fEtaCut=g->fEtaCut;
279 // fAcceptanceCorrectionFull=g->fAcceptanceCorrectionFull;
280 // fAcceptanceCorrectionEMCAL=g->fAcceptanceCorrectionEMCAL;
281 // fAcceptanceCorrectionPHOS=g->fAcceptanceCorrectionPHOS;
282 // fNeutralCorrection=g->fNeutralCorrection;
283 // fNotHadronicCorrection=g->fNotHadronicCorrection;
284 // fpTcutCorrectionTPC=g->fpTcutCorrectionTPC;
285 // fpTcutCorrectionITS=g->fpTcutCorrectionITS;
286 // fNeutralCorrectionLow=g->fNeutralCorrectionLow;
287 // fNotHadronicCorrectionLow=g->fNotHadronicCorrectionLow;
288 // ffpTcutCorrectionTPCLow=g->ffpTcutCorrectionTPCLow;
289 // ffpTcutCorrectionITSLow=g->ffpTcutCorrectionITSLow;
290 // fNeutralCorrectionHigh=g->fNeutralCorrectionHigh;
291 // fNotHadronicCorrectionHigh=g->fNotHadronicCorrectionHigh;
292 // ffpTcutCorrectionTPCHigh=g->ffpTcutCorrectionTPCHigh;
293 // ffpTcutCorrectionITSHigh=g->ffpTcutCorrectionITSHigh;
295 // fnotIDTPC = g->fnotIDTPC;
296 // fnotIDITS = g->fnotIDITS;
297 // fnotIDNoID = g->fnotIDNoID;
298 // fEfficiencyPionTPC = g->fEfficiencyPionTPC;
299 // fEfficiencyKaonTPC = g->fEfficiencyKaonTPC;
300 // fEfficiencyProtonTPC = g->fEfficiencyProtonTPC;
301 // fEfficiencyHadronTPC = g->fEfficiencyHadronTPC;
302 // fEfficiencyPionITS = g->fEfficiencyPionITS;
303 // fEfficiencyKaonITS = g->fEfficiencyKaonITS;
304 // fEfficiencyProtonITS = g->fEfficiencyProtonITS;
305 // fEfficiencyHadronITS = g->fEfficiencyHadronITS;
306 // fBackgroundTPC = g->fBackgroundTPC;
307 // fBackgroundITS = g->fBackgroundITS;
309 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionTPC(const int cb){//Get centrality dependent efficiency
310 if(cb==-1){return fEfficiencyPionTPC;}
311 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));}
313 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonTPC(const int cb){//Get centrality dependent efficiency
314 if(cb==-1){return fEfficiencyKaonTPC;}
315 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));}
317 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonTPC(const int cb){//Get centrality dependent efficiency
318 if(cb==-1){return fEfficiencyProtonTPC;}
319 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));}
321 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronTPC(const int cb){//Get centrality dependent efficiency
322 if(cb==-1){return fEfficiencyHadronTPC;}
323 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));}
325 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionITS(const int cb){//Get centrality dependent efficiency
326 if(cb==-1){return fEfficiencyPionITS;}
327 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));}
329 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonITS(const int cb){//Get centrality dependent efficiency
330 if(cb==-1){return fEfficiencyKaonITS;}
331 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));}
333 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonITS(const int cb){//Get centrality dependent efficiency
334 if(cb==-1){return fEfficiencyProtonITS;}
335 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));}
337 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronITS(const int cb){//Get centrality dependent efficiency
338 if(cb==-1){return fEfficiencyHadronITS;}
339 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));}
341 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the TPC
344 if(!fEfficiencyPionTPC){cerr<<"No histogram fEfficiencyPionTPC!"<<endl; return -1.0;}
345 eff = fEfficiencyPionTPC->GetBinContent(fEfficiencyPionTPC->FindBin(pT));
346 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
349 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
350 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionTPC%i",cb)<<endl; return -1.0;}
351 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
352 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
356 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the TPC
359 if(!fEfficiencyKaonTPC){cerr<<"No histogram fEfficiencyKaonTPC!"<<endl; return -1.0;}
360 eff = fEfficiencyKaonTPC->GetBinContent(fEfficiencyKaonTPC->FindBin(pT));
361 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
364 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
365 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonTPC%i",cb)<<endl; return -1.0;}
366 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
367 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
371 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the TPC
374 if(!fEfficiencyProtonTPC){cerr<<"No histogram fEfficiencyProtonTPC!"<<endl; return -1.0;}
375 eff = fEfficiencyProtonTPC->GetBinContent(fEfficiencyProtonTPC->FindBin(pT));
376 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
379 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
380 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonTPC%i",cb)<<endl; return -1.0;}
381 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
382 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
386 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the TPC
389 if(!fEfficiencyHadronTPC){cerr<<"No histogram fEfficiencyHadronTPC!"<<endl; return -1.0;}
390 eff = fEfficiencyHadronTPC->GetBinContent(fEfficiencyHadronTPC->FindBin(pT));
391 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
394 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
395 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronTPC%i",cb)<<endl; return -1.0;}
396 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
397 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
401 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the ITS
404 if(!fEfficiencyPionITS){cerr<<"No histogram fEfficiencyPionITS!"<<endl; return -1.0;}
405 eff = fEfficiencyPionITS->GetBinContent(fEfficiencyPionITS->FindBin(pT));
406 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
409 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
410 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionITS%i",cb)<<endl; return -1.0;}
411 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
412 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
416 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the ITS
419 if(!fEfficiencyKaonITS){cerr<<"No histogram fEfficiencyKaonITS!"<<endl; return -1.0;}
420 eff = fEfficiencyKaonITS->GetBinContent(fEfficiencyKaonITS->FindBin(pT));
421 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
424 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
425 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonITS%i",cb)<<endl; return -1.0;}
426 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
427 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
431 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the ITS
434 if(!fEfficiencyProtonITS){cerr<<"No histogram fEfficiencyProtonITS!"<<endl; return -1.0;}
435 eff = fEfficiencyProtonITS->GetBinContent(fEfficiencyProtonITS->FindBin(pT));
436 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
439 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
440 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonITS%i",cb)<<endl; return -1.0;}
441 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
442 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
446 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the ITS
449 if(!fEfficiencyHadronITS){cerr<<"No histogram fEfficiencyHadronITS!"<<endl; return -1.0;}
450 eff = fEfficiencyHadronITS->GetBinContent(fEfficiencyHadronITS->FindBin(pT));
451 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
454 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
455 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronITS%i",cb)<<endl; return -1.0;}
456 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
457 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
461 void AliAnalysisHadEtCorrections::SetEfficiencyPionTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
463 //first check to see if the histogram exists already
464 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
466 fEfficiencyTPC->Remove(old);
469 //then if the new histogram exists, add it to the array
470 histo->SetName(Form("fEfficiencyPionTPC%i",cb));
471 fEfficiencyTPC->Add(histo);
473 else{cerr<<"Histogram does not exist!"<<endl;}
475 void AliAnalysisHadEtCorrections::SetEfficiencyKaonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
477 //first check to see if the histogram exists already
478 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
480 fEfficiencyTPC->Remove(old);
483 //then if the new histogram exists, add it to the array
484 histo->SetName(Form("fEfficiencyKaonTPC%i",cb));
485 fEfficiencyTPC->Add(histo);
487 else{cerr<<"Histogram does not exist!"<<endl;}
489 void AliAnalysisHadEtCorrections::SetEfficiencyProtonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
491 //first check to see if the histogram exists already
492 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
494 fEfficiencyTPC->Remove(old);
497 //then if the new histogram exists, add it to the array
498 histo->SetName(Form("fEfficiencyProtonTPC%i",cb));
499 fEfficiencyTPC->Add(histo);
501 else{cerr<<"Histogram does not exist!"<<endl;}
503 void AliAnalysisHadEtCorrections::SetEfficiencyHadronTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
505 //first check to see if the histogram exists already
506 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
508 fEfficiencyTPC->Remove(old);
511 //then if the new histogram exists, add it to the array
512 histo->SetName(Form("fEfficiencyHadronTPC%i",cb));
513 fEfficiencyTPC->Add(histo);
515 else{cerr<<"Histogram does not exist!"<<endl;}
517 void AliAnalysisHadEtCorrections::SetEfficiencyPionITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
519 //first check to see if the histogram exists already
520 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
522 fEfficiencyITS->Remove(old);
525 //then if the new histogram exists, add it to the array
526 histo->SetName(Form("fEfficiencyPionITS%i",cb));
527 fEfficiencyITS->Add(histo);
529 else{cerr<<"Histogram does not exist!"<<endl;}
531 void AliAnalysisHadEtCorrections::SetEfficiencyKaonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
533 //first check to see if the histogram exists already
534 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
536 fEfficiencyITS->Remove(old);
539 //then if the new histogram exists, add it to the array
540 histo->SetName(Form("fEfficiencyKaonITS%i",cb));
541 fEfficiencyITS->Add(histo);
543 else{cerr<<"Histogram does not exist!"<<endl;}
545 void AliAnalysisHadEtCorrections::SetEfficiencyProtonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
547 //first check to see if the histogram exists already
548 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
550 fEfficiencyITS->Remove(old);
553 //then if the new histogram exists, add it to the array
554 histo->SetName(Form("fEfficiencyProtonITS%i",cb));
555 fEfficiencyITS->Add(histo);
557 else{cerr<<"Histogram does not exist!"<<endl;}
559 void AliAnalysisHadEtCorrections::SetEfficiencyHadronITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
561 //first check to see if the histogram exists already
562 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
564 fEfficiencyITS->Remove(old);
567 //then if the new histogram exists, add it to the array
568 histo->SetName(Form("fEfficiencyHadronITS%i",cb));
569 fEfficiencyITS->Add(histo);
571 else{cerr<<"Histogram does not exist!"<<endl;}
575 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionTPC(const float pT){//get correction for unidentified particles in the TPC
576 Float_t val = fnotIDTPC->GetBinContent(fnotIDTPC->FindBin(pT));
577 if(val>0.0) return 1.0/(val);
580 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionITS(const float pT){//Get correction for unidentified particles in the ITS
581 Float_t val = fnotIDITS->GetBinContent(fnotIDITS->FindBin(pT));
582 if(val>0.0) return 1.0/(val);
585 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionNoPID(const float pT){//Get correction for particles in the case that there is no particle identification
586 Float_t val = fnotIDNoID->GetBinContent(fnotIDNoID->FindBin(pT));
587 if(val>0.0) return 1.0/(val);
590 Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionTPC(const float pT){//Get background correction for TPC tracks
591 return (1.0-fBackgroundTPC->GetBinContent(fBackgroundTPC->FindBin(pT)));
593 Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionITS(const float pT){//Get background correction for ITS tracks
594 return (1.0-fBackgroundITS->GetBinContent(fBackgroundITS->FindBin(pT)));
596 void AliAnalysisHadEtCorrections::Report(){//Gives a report on the status of all corrections
597 //This is primarily for cross checking that the results we get from the macro that fills this class, GetCorrections.C, are sane
598 cout<<"======================================================================="<<endl;
599 cout<<" Report from "<<GetName()<<endl;
600 cout<<"======================================================================="<<endl;
601 cout<<fProductionDescription<<" created from "<<fProduction<<endl;
602 cout<<"This for determination of EThad from ";
603 if(fIsData) cout<<"data of ";
604 else{cout<<"simulation of ";}
607 cout<<"p+p collisions at 900 GeV"<<endl;
610 cout<<"p+p collisions at 7 TeV"<<endl;
613 cout<<"p+p collisions at 2.76 TeV"<<endl;
616 cout<<"Pb+Pb collisions at 2.76 TeV"<<endl;
619 cout<<"an undetermined collision system and energy"<<endl;
621 cout<<"This is initialized for the ";
622 if(fIsEMCal) cout<<"EMCal";
624 cout<<" acceptance"<<endl<<endl;
626 cout<<"The acceptance correction for the full "<<fAcceptanceCorrectionFull<<endl;
627 cout<<" EMCal "<<fAcceptanceCorrectionEMCAL<<endl;
628 cout<<" PHOS "<<fAcceptanceCorrectionPHOS<<endl<<endl;
630 cout<<Form("The neutral energy correction is %2.4f [%2.4f,%2.4f]",fNeutralCorrection,fNeutralCorrectionLow,fNeutralCorrectionHigh)<<endl;
631 cout<<Form(" total %2.4f [%2.4f,%2.4f]",fNotHadronicCorrection,fNotHadronicCorrectionLow,fNotHadronicCorrectionHigh)<<endl<<endl;
633 cout<<Form("The pT cut correction for 100 MeV is %2.4f [%2.4f,%2.4f]",fpTcutCorrectionITS,ffpTcutCorrectionITSLow,ffpTcutCorrectionITSHigh)<<endl;
634 cout<<Form(" 150 MeV %2.4f [%2.4f,%2.4f]",fpTcutCorrectionTPC,ffpTcutCorrectionTPCLow,ffpTcutCorrectionTPCHigh)<<endl<<endl;
636 cout<<Form("The correction for unidentified ITS tracks is %2.4f [%2.4f,%2.4f]",fNotIDConstITS,fNotIDConstITSLow,fNotIDConstITSHigh)<<endl;
637 cout<<Form(" TPC tracks %2.4f [%2.4f,%2.4f]",fNotIDConstTPC,fNotIDConstTPCLow,fNotIDConstTPCHigh)<<endl<<endl;
639 cout<<"Background correction histogram for ITS tracks is";
640 if(!fBackgroundITS)cout<<" not set"<<endl;
641 else{cout<<" set and has "<<fBackgroundITS->GetEntries()<<" entries"<<endl;}
643 if(!fBackgroundTPC)cout<<" not set"<<endl;
644 else{cout<<" set and has "<<fBackgroundTPC->GetEntries()<<" entries"<<endl;}
648 cout<<"Efficiency histogram for ITS tracks for hadrons is";
649 if(!fEfficiencyHadronITS)cout<<" not set"<<endl;
650 else{cout<<" set and has "<<fEfficiencyHadronITS->GetEntries()<<" entries"<<endl;}
651 cout<<" TPC hadrons ";
652 if(!fEfficiencyHadronTPC)cout<<" not set"<<endl;
653 else{cout<<" set and has "<<fEfficiencyHadronTPC->GetEntries()<<" entries"<<endl;}
655 if(!fEfficiencyPionITS)cout<<" not set"<<endl;
656 else{cout<<" set and has "<<fEfficiencyPionITS->GetEntries()<<" entries"<<endl;}
658 if(!fEfficiencyPionTPC)cout<<" not set"<<endl;
659 else{cout<<" set and has "<<fEfficiencyPionTPC->GetEntries()<<" entries"<<endl;}
661 if(!fEfficiencyKaonITS)cout<<" not set"<<endl;
662 else{cout<<" set and has "<<fEfficiencyKaonITS->GetEntries()<<" entries"<<endl;}
664 if(!fEfficiencyKaonTPC)cout<<" not set"<<endl;
665 else{cout<<" set and has "<<fEfficiencyKaonTPC->GetEntries()<<" entries"<<endl;}
666 cout<<" ITS protons ";
667 if(!fEfficiencyProtonITS)cout<<" not set"<<endl;
668 else{cout<<" set and has "<<fEfficiencyProtonITS->GetEntries()<<" entries"<<endl;}
669 cout<<" TPC protons ";
670 if(!fEfficiencyProtonTPC)cout<<" not set"<<endl;
671 else{cout<<" set and has "<<fEfficiencyProtonTPC->GetEntries()<<" entries"<<endl;}
674 if(fDataSet==20100){//if Pb+Pb
675 cout<<"Efficiency histogram for TPC tracks for hadrons is set for centrality bins ";
676 for(int i = 0;i<=21;i++){
677 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",i));
678 if(histo) cout<<i<<" ";
682 for(int i = 0;i<=21;i++){
683 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",i));
684 if(histo) cout<<i<<" ";
688 for(int i = 0;i<=21;i++){
689 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",i));
690 if(histo) cout<<i<<" ";
694 for(int i = 0;i<=21;i++){
695 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",i));
696 if(histo) cout<<i<<" ";
699 cout<<" ITS hadrons ";
700 for(int i = 0;i<=21;i++){
701 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",i));
702 if(histo) cout<<i<<" ";
706 for(int i = 0;i<=21;i++){
707 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",i));
708 if(histo) cout<<i<<" ";
712 for(int i = 0;i<=21;i++){
713 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",i));
714 if(histo) cout<<i<<" ";
718 for(int i = 0;i<=21;i++){
719 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",i));
720 if(histo) cout<<i<<" ";
725 int nEntries = fEfficiencyTPC->GetEntries();
726 int nbadhistograms = 0;
727 for(int i=0;i<nEntries;i++){
728 TH1D *histo = (TH1D*) fEfficiencyTPC->At(i);
730 cout<<"Warning: Histogram in fEfficiencyTPC at "<<i<<" is NULL!"<<endl;
734 if(histo->GetEntries()<=1e-2){
735 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyTPC is empty!"<<endl;
740 cout<<nbadhistograms<<" bad histograms in fEfficiencyTPC"<<endl;
742 nEntries = fEfficiencyITS->GetEntries();
744 for(int i=0;i<nEntries;i++){
745 TH1D *histo = (TH1D*) fEfficiencyITS->At(i);
747 cout<<"Warning: Histogram in fEfficiencyITS at "<<i<<" is NULL!"<<endl;
751 if(histo->GetEntries()<=1e-2){
752 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyITS is empty!"<<endl;
757 cout<<nbadhistograms<<" bad histograms in fEfficiencyITS"<<endl;
764 cout<<"======================================================================="<<endl;
765 cout<<"======================================================================="<<endl;