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"
15 #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)
70 ,fProduction("ProductionName")
71 ,fProductionDescription("Long production description")
72 {//default constructor
73 //This seems to solve a compiler error
74 cout<<"Creating new AliAnalysisHadEtCorrections"<<endl;
75 fEfficiencyTPC = new TObjArray();
76 fEfficiencyITS = new TObjArray();
79 AliAnalysisHadEtCorrections::~AliAnalysisHadEtCorrections()
85 fEfficiencyPionTPC->Clear();
86 fEfficiencyKaonTPC->Clear();
87 fEfficiencyProtonTPC->Clear();
88 fEfficiencyHadronTPC->Clear();
89 fEfficiencyPionITS->Clear();
90 fEfficiencyKaonITS->Clear();
91 fEfficiencyProtonITS->Clear();
92 fEfficiencyHadronITS->Clear();
93 fBackgroundTPC->Clear();
94 fBackgroundITS->Clear();
98 delete fEfficiencyPionTPC;
99 delete fEfficiencyKaonTPC;
100 delete fEfficiencyProtonTPC;
101 delete fEfficiencyHadronTPC;
102 delete fEfficiencyPionITS;
103 delete fEfficiencyKaonITS;
104 delete fEfficiencyProtonITS;
105 delete fEfficiencyHadronITS;
106 delete fEfficiencyTPC;
107 delete fEfficiencyITS;
108 delete fBackgroundTPC;
109 delete fBackgroundITS;
111 AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g): TNamed(),
113 ,fAcceptanceCorrectionFull(g->fAcceptanceCorrectionFull)
114 ,fAcceptanceCorrectionEMCAL(g->fAcceptanceCorrectionEMCAL)
115 ,fAcceptanceCorrectionPHOS(g->fAcceptanceCorrectionPHOS)
116 ,fNeutralCorrection(g->fNeutralCorrection)
117 ,fNotHadronicCorrection(g->fNotHadronicCorrection)
118 ,fpTcutCorrectionTPC(g->fpTcutCorrectionTPC)
119 ,fpTcutCorrectionITS(g->fpTcutCorrectionITS)
120 ,fNotIDConstTPC(g->fNotIDConstTPC)
121 ,fNotIDConstITS(g->fNotIDConstITS)
122 ,fNotIDConstTPCNoID(g->fNotIDConstTPCNoID)
123 ,fNotIDConstITSNoID(g->fNotIDConstITSNoID)
124 ,fNeutralCorrectionLow(g->fNeutralCorrectionLow)
125 ,fNotHadronicCorrectionLow(g->fNotHadronicCorrectionLow)
126 ,ffpTcutCorrectionTPCLow(g->ffpTcutCorrectionTPCLow)
127 ,ffpTcutCorrectionITSLow(g->ffpTcutCorrectionITSLow)
128 ,fNeutralCorrectionHigh(g->fNeutralCorrectionHigh)
129 ,fNotHadronicCorrectionHigh(g->fNotHadronicCorrectionHigh)
130 ,ffpTcutCorrectionTPCHigh(g->ffpTcutCorrectionTPCHigh)
131 ,ffpTcutCorrectionITSHigh(g->ffpTcutCorrectionITSHigh)
132 ,fNotIDConstTPCLow(g->fNotIDConstTPCLow)
133 ,fNotIDConstITSLow(g->fNotIDConstITSLow)
134 ,fNotIDConstTPCNoIDLow(g->fNotIDConstTPCNoIDLow)
135 ,fNotIDConstITSNoIDLow(g->fNotIDConstITSNoIDLow)
136 ,fNotIDConstTPCHigh(g->fNotIDConstTPCHigh)
137 ,fNotIDConstITSHigh(g->fNotIDConstITSHigh)
138 ,fNotIDConstTPCNoIDHigh(g->fNotIDConstTPCNoIDHigh)
139 ,fNotIDConstITSNoIDHigh(g->fNotIDConstITSNoIDHigh)
143 ,fEfficiencyPionTPC(0)
144 ,fEfficiencyKaonTPC(0)
145 ,fEfficiencyProtonTPC(0)
146 ,fEfficiencyHadronTPC(0)
147 ,fEfficiencyPionITS(0)
148 ,fEfficiencyKaonITS(0)
149 ,fEfficiencyProtonITS(0)
150 ,fEfficiencyHadronITS(0)
155 ,fIsEMCal(g->fIsEMCal)
157 ,fDataSet(g->fDataSet)
158 ,fProduction(g->fProduction)
159 ,fProductionDescription(g->fProductionDescription)
161 //SetName(g->GetName());
162 fnotIDTPC = new TH1D(*(g->fnotIDTPC));
163 fnotIDITS = new TH1D(*(g->fnotIDITS));
164 fnotIDNoID = new TH1D(*(g->fnotIDNoID));
165 fEfficiencyPionTPC = new TH1D(*(g->fEfficiencyPionTPC));
166 fEfficiencyKaonTPC = new TH1D(*(g->fEfficiencyKaonTPC));
167 fEfficiencyProtonTPC = new TH1D(*(g->fEfficiencyProtonTPC));
168 fEfficiencyHadronTPC = new TH1D(*(g->fEfficiencyHadronTPC));
169 fEfficiencyPionITS = new TH1D(*(g->fEfficiencyPionITS));
170 fEfficiencyKaonITS = new TH1D(*(g->fEfficiencyKaonITS));
171 fEfficiencyProtonITS = new TH1D(*(g->fEfficiencyProtonITS));
172 fEfficiencyHadronITS = new TH1D(*(g->fEfficiencyHadronITS));
173 fEfficiencyTPC = new TObjArray(*(g->fEfficiencyTPC));
174 fEfficiencyITS = new TObjArray(*(g->fEfficiencyITS));
175 fBackgroundTPC = new TH1D(*(g->fBackgroundTPC));
176 fBackgroundITS = new TH1D(*(g->fBackgroundITS));
180 Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const {//Get the correction values that are not pt dependent
181 Float_t acceptance = 0.0;
182 Float_t neutral = 0.0;
183 Float_t ptcorr = 0.0;
184 float correction = 0.0;
186 //TString *type = new TString(mytype);
188 if(type.Contains("Full")) acceptance = fAcceptanceCorrectionFull;
189 if(type.Contains("EMCAL")) acceptance = fAcceptanceCorrectionEMCAL;
190 if(type.Contains("PHOS")) acceptance = fAcceptanceCorrectionPHOS;
192 if(type.Contains("High")){//high bound
193 if(totEt) neutral = fNotHadronicCorrectionHigh;
194 else{neutral = fNeutralCorrectionHigh;}
195 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;}
196 else{ptcorr = ffpTcutCorrectionITSHigh;}
197 cout<<"Setting correction factor to "<<correction<<endl;
200 if(type.Contains("Low")){//high bound
201 if(totEt) neutral = fNotHadronicCorrectionLow;
202 else{neutral = fNeutralCorrectionLow;}
203 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;}
204 else{ptcorr = ffpTcutCorrectionITSLow;}
205 cout<<"Setting correction factor to "<<correction<<endl;
209 if(totEt) neutral = fNotHadronicCorrection;
210 else{neutral = fNeutralCorrection;}
211 if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;}
212 else{ptcorr = fpTcutCorrectionITS;}
214 correction = acceptance*neutral*ptcorr;
215 cout<<"Setting correction factor for ";
216 if(totEt) cout<<"total et";
217 else{cout<<"hadronic et";}
218 cout<<" with the pt cut off "<<ptcut<<" for "<<type<<" acceptance to "<<correction<<endl;
219 //cout<<"Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl;
223 // AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) {
225 // fEtaCut=g->fEtaCut;
226 // fAcceptanceCorrectionFull=g->fAcceptanceCorrectionFull;
227 // fAcceptanceCorrectionEMCAL=g->fAcceptanceCorrectionEMCAL;
228 // fAcceptanceCorrectionPHOS=g->fAcceptanceCorrectionPHOS;
229 // fNeutralCorrection=g->fNeutralCorrection;
230 // fNotHadronicCorrection=g->fNotHadronicCorrection;
231 // fpTcutCorrectionTPC=g->fpTcutCorrectionTPC;
232 // fpTcutCorrectionITS=g->fpTcutCorrectionITS;
233 // fNeutralCorrectionLow=g->fNeutralCorrectionLow;
234 // fNotHadronicCorrectionLow=g->fNotHadronicCorrectionLow;
235 // ffpTcutCorrectionTPCLow=g->ffpTcutCorrectionTPCLow;
236 // ffpTcutCorrectionITSLow=g->ffpTcutCorrectionITSLow;
237 // fNeutralCorrectionHigh=g->fNeutralCorrectionHigh;
238 // fNotHadronicCorrectionHigh=g->fNotHadronicCorrectionHigh;
239 // ffpTcutCorrectionTPCHigh=g->ffpTcutCorrectionTPCHigh;
240 // ffpTcutCorrectionITSHigh=g->ffpTcutCorrectionITSHigh;
242 // fnotIDTPC = g->fnotIDTPC;
243 // fnotIDITS = g->fnotIDITS;
244 // fnotIDNoID = g->fnotIDNoID;
245 // fEfficiencyPionTPC = g->fEfficiencyPionTPC;
246 // fEfficiencyKaonTPC = g->fEfficiencyKaonTPC;
247 // fEfficiencyProtonTPC = g->fEfficiencyProtonTPC;
248 // fEfficiencyHadronTPC = g->fEfficiencyHadronTPC;
249 // fEfficiencyPionITS = g->fEfficiencyPionITS;
250 // fEfficiencyKaonITS = g->fEfficiencyKaonITS;
251 // fEfficiencyProtonITS = g->fEfficiencyProtonITS;
252 // fEfficiencyHadronITS = g->fEfficiencyHadronITS;
253 // fBackgroundTPC = g->fBackgroundTPC;
254 // fBackgroundITS = g->fBackgroundITS;
256 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the TPC
259 if(!fEfficiencyPionTPC){cerr<<"No histogram fEfficiencyPionTPC!"<<endl; return -1.0;}
260 eff = fEfficiencyPionTPC->GetBinContent(fEfficiencyPionTPC->FindBin(pT));
261 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
264 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
265 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionTPC%i",cb)<<endl; return -1.0;}
266 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
267 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
271 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the TPC
274 if(!fEfficiencyKaonTPC){cerr<<"No histogram fEfficiencyKaonTPC!"<<endl; return -1.0;}
275 eff = fEfficiencyKaonTPC->GetBinContent(fEfficiencyKaonTPC->FindBin(pT));
276 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
279 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
280 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonTPC%i",cb)<<endl; return -1.0;}
281 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
282 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
286 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the TPC
289 if(!fEfficiencyProtonTPC){cerr<<"No histogram fEfficiencyProtonTPC!"<<endl; return -1.0;}
290 eff = fEfficiencyProtonTPC->GetBinContent(fEfficiencyProtonTPC->FindBin(pT));
291 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
294 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
295 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonTPC%i",cb)<<endl; return -1.0;}
296 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
297 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
301 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the TPC
304 if(!fEfficiencyHadronTPC){cerr<<"No histogram fEfficiencyHadronTPC!"<<endl; return -1.0;}
305 eff = fEfficiencyHadronTPC->GetBinContent(fEfficiencyHadronTPC->FindBin(pT));
306 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
309 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
310 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronTPC%i",cb)<<endl; return -1.0;}
311 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
312 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
316 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the ITS
319 if(!fEfficiencyPionITS){cerr<<"No histogram fEfficiencyPionITS!"<<endl; return -1.0;}
320 eff = fEfficiencyPionITS->GetBinContent(fEfficiencyPionITS->FindBin(pT));
321 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
324 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
325 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionITS%i",cb)<<endl; return -1.0;}
326 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
327 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
331 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the ITS
334 if(!fEfficiencyKaonITS){cerr<<"No histogram fEfficiencyKaonITS!"<<endl; return -1.0;}
335 eff = fEfficiencyKaonITS->GetBinContent(fEfficiencyKaonITS->FindBin(pT));
336 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
339 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
340 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonITS%i",cb)<<endl; return -1.0;}
341 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
342 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
346 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the ITS
349 if(!fEfficiencyProtonITS){cerr<<"No histogram fEfficiencyProtonITS!"<<endl; return -1.0;}
350 eff = fEfficiencyProtonITS->GetBinContent(fEfficiencyProtonITS->FindBin(pT));
351 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
354 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
355 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonITS%i",cb)<<endl; return -1.0;}
356 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
357 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
361 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the ITS
364 if(!fEfficiencyHadronITS){cerr<<"No histogram fEfficiencyHadronITS!"<<endl; return -1.0;}
365 eff = fEfficiencyHadronITS->GetBinContent(fEfficiencyHadronITS->FindBin(pT));
366 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
369 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
370 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronITS%i",cb)<<endl; return -1.0;}
371 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
372 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
376 void AliAnalysisHadEtCorrections::SetEfficiencyPionTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
378 //first check to see if the histogram exists already
379 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
381 fEfficiencyTPC->Remove(old);
384 //then if the new histogram exists, add it to the array
385 histo->SetName(Form("fEfficiencyPionTPC%i",cb));
386 fEfficiencyTPC->Add(histo);
388 else{cerr<<"Histogram does not exist!"<<endl;}
390 void AliAnalysisHadEtCorrections::SetEfficiencyKaonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
392 //first check to see if the histogram exists already
393 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
395 fEfficiencyTPC->Remove(old);
398 //then if the new histogram exists, add it to the array
399 histo->SetName(Form("fEfficiencyKaonTPC%i",cb));
400 fEfficiencyTPC->Add(histo);
402 else{cerr<<"Histogram does not exist!"<<endl;}
404 void AliAnalysisHadEtCorrections::SetEfficiencyProtonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
406 //first check to see if the histogram exists already
407 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
409 fEfficiencyTPC->Remove(old);
412 //then if the new histogram exists, add it to the array
413 histo->SetName(Form("fEfficiencyProtonTPC%i",cb));
414 fEfficiencyTPC->Add(histo);
416 else{cerr<<"Histogram does not exist!"<<endl;}
418 void AliAnalysisHadEtCorrections::SetEfficiencyHadronTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
420 //first check to see if the histogram exists already
421 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
423 fEfficiencyTPC->Remove(old);
426 //then if the new histogram exists, add it to the array
427 histo->SetName(Form("fEfficiencyHadronTPC%i",cb));
428 fEfficiencyTPC->Add(histo);
430 else{cerr<<"Histogram does not exist!"<<endl;}
432 void AliAnalysisHadEtCorrections::SetEfficiencyPionITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
434 //first check to see if the histogram exists already
435 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
437 fEfficiencyITS->Remove(old);
440 //then if the new histogram exists, add it to the array
441 histo->SetName(Form("fEfficiencyPionITS%i",cb));
442 fEfficiencyITS->Add(histo);
444 else{cerr<<"Histogram does not exist!"<<endl;}
446 void AliAnalysisHadEtCorrections::SetEfficiencyKaonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
448 //first check to see if the histogram exists already
449 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
451 fEfficiencyITS->Remove(old);
454 //then if the new histogram exists, add it to the array
455 histo->SetName(Form("fEfficiencyKaonITS%i",cb));
456 fEfficiencyITS->Add(histo);
458 else{cerr<<"Histogram does not exist!"<<endl;}
460 void AliAnalysisHadEtCorrections::SetEfficiencyProtonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
462 //first check to see if the histogram exists already
463 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
465 fEfficiencyITS->Remove(old);
468 //then if the new histogram exists, add it to the array
469 histo->SetName(Form("fEfficiencyProtonITS%i",cb));
470 fEfficiencyITS->Add(histo);
472 else{cerr<<"Histogram does not exist!"<<endl;}
474 void AliAnalysisHadEtCorrections::SetEfficiencyHadronITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
476 //first check to see if the histogram exists already
477 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
479 fEfficiencyITS->Remove(old);
482 //then if the new histogram exists, add it to the array
483 histo->SetName(Form("fEfficiencyHadronITS%i",cb));
484 fEfficiencyITS->Add(histo);
486 else{cerr<<"Histogram does not exist!"<<endl;}
490 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionTPC(const float pT){//get correction for unidentified particles in the TPC
491 Float_t val = fnotIDTPC->GetBinContent(fnotIDTPC->FindBin(pT));
492 if(val>0.0) return 1.0/(val);
495 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionITS(const float pT){//Get correction for unidentified particles in the ITS
496 Float_t val = fnotIDITS->GetBinContent(fnotIDITS->FindBin(pT));
497 if(val>0.0) return 1.0/(val);
500 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionNoPID(const float pT){//Get correction for particles in the case that there is no particle identification
501 Float_t val = fnotIDNoID->GetBinContent(fnotIDNoID->FindBin(pT));
502 if(val>0.0) return 1.0/(val);
505 void AliAnalysisHadEtCorrections::Report(){//Gives a report on the status of all corrections
506 //This is primarily for cross checking that the results we get from the macro that fills this class, GetCorrections.C, are sane
507 cout<<"======================================================================="<<endl;
508 cout<<" Report from "<<GetName()<<endl;
509 cout<<"======================================================================="<<endl;
510 cout<<fProductionDescription<<" created from "<<fProduction<<endl;
511 cout<<"This for determination of EThad from ";
512 if(fIsData) cout<<"data of ";
513 else{cout<<"simulation of ";}
516 cout<<"p+p collisions at 900 GeV"<<endl;
519 cout<<"p+p collisions at 7 TeV"<<endl;
522 cout<<"Pb+Pb collisions at 2.76 TeV"<<endl;
525 cout<<"an undetermined collision system and energy"<<endl;
527 cout<<"This is initialized for the ";
528 if(fIsEMCal) cout<<"EMCal";
530 cout<<" acceptance"<<endl<<endl;
532 cout<<"The acceptance correction for the full "<<fAcceptanceCorrectionFull<<endl;
533 cout<<" EMCal "<<fAcceptanceCorrectionEMCAL<<endl;
534 cout<<" PHOS "<<fAcceptanceCorrectionPHOS<<endl<<endl;
536 cout<<Form("The neutral energy correction is %2.4f [%2.4f,%2.4f]",fNeutralCorrection,fNeutralCorrectionLow,fNeutralCorrectionHigh)<<endl;
537 cout<<Form(" total %2.4f [%2.4f,%2.4f]",fNotHadronicCorrection,fNotHadronicCorrectionLow,fNotHadronicCorrectionHigh)<<endl<<endl;
539 cout<<Form("The pT cut correction for 100 MeV is %2.4f [%2.4f,%2.4f]",fpTcutCorrectionITS,ffpTcutCorrectionITSLow,ffpTcutCorrectionITSHigh)<<endl;
540 cout<<Form(" 150 MeV %2.4f [%2.4f,%2.4f]",fpTcutCorrectionTPC,ffpTcutCorrectionTPCLow,ffpTcutCorrectionTPCHigh)<<endl<<endl;
542 cout<<Form("The correction for unidentified ITS tracks is %2.4f [%2.4f,%2.4f]",fNotIDConstITS,fNotIDConstITSLow,fNotIDConstITSHigh)<<endl;
543 cout<<Form(" TPC tracks %2.4f [%2.4f,%2.4f]",fNotIDConstTPC,fNotIDConstTPCLow,fNotIDConstTPCHigh)<<endl<<endl;
545 cout<<"Background correction histogram for ITS tracks is";
546 if(!fBackgroundITS)cout<<" not set"<<endl;
547 else{cout<<" set and has "<<fBackgroundITS->GetEntries()<<" entries"<<endl;}
549 if(!fBackgroundTPC)cout<<" not set"<<endl;
550 else{cout<<" set and has "<<fBackgroundTPC->GetEntries()<<" entries"<<endl;}
554 cout<<"Efficiency histogram for ITS tracks for hadrons is";
555 if(!fEfficiencyHadronITS)cout<<" not set"<<endl;
556 else{cout<<" set and has "<<fEfficiencyHadronITS->GetEntries()<<" entries"<<endl;}
557 cout<<" TPC hadrons ";
558 if(!fEfficiencyHadronTPC)cout<<" not set"<<endl;
559 else{cout<<" set and has "<<fEfficiencyHadronTPC->GetEntries()<<" entries"<<endl;}
561 if(!fEfficiencyPionITS)cout<<" not set"<<endl;
562 else{cout<<" set and has "<<fEfficiencyPionITS->GetEntries()<<" entries"<<endl;}
564 if(!fEfficiencyPionTPC)cout<<" not set"<<endl;
565 else{cout<<" set and has "<<fEfficiencyPionTPC->GetEntries()<<" entries"<<endl;}
567 if(!fEfficiencyKaonITS)cout<<" not set"<<endl;
568 else{cout<<" set and has "<<fEfficiencyKaonITS->GetEntries()<<" entries"<<endl;}
570 if(!fEfficiencyKaonTPC)cout<<" not set"<<endl;
571 else{cout<<" set and has "<<fEfficiencyKaonTPC->GetEntries()<<" entries"<<endl;}
572 cout<<" ITS protons ";
573 if(!fEfficiencyProtonITS)cout<<" not set"<<endl;
574 else{cout<<" set and has "<<fEfficiencyProtonITS->GetEntries()<<" entries"<<endl;}
575 cout<<" TPC protons ";
576 if(!fEfficiencyProtonTPC)cout<<" not set"<<endl;
577 else{cout<<" set and has "<<fEfficiencyProtonTPC->GetEntries()<<" entries"<<endl;}
580 if(fDataSet==20100){//if Pb+Pb
581 cout<<"Efficiency histogram for TPC tracks for hadrons is set for centrality bins ";
582 for(int i = 0;i<=20;i++){
583 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",i));
584 if(histo) cout<<i<<" ";
588 for(int i = 0;i<=20;i++){
589 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",i));
590 if(histo) cout<<i<<" ";
594 for(int i = 0;i<=20;i++){
595 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",i));
596 if(histo) cout<<i<<" ";
600 for(int i = 0;i<=20;i++){
601 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",i));
602 if(histo) cout<<i<<" ";
605 cout<<" ITS hadrons ";
606 for(int i = 0;i<=20;i++){
607 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",i));
608 if(histo) cout<<i<<" ";
612 for(int i = 0;i<=20;i++){
613 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",i));
614 if(histo) cout<<i<<" ";
618 for(int i = 0;i<=20;i++){
619 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",i));
620 if(histo) cout<<i<<" ";
624 for(int i = 0;i<=20;i++){
625 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",i));
626 if(histo) cout<<i<<" ";
631 int nEntries = fEfficiencyTPC->GetEntries();
632 int nbadhistograms = 0;
633 for(int i=0;i<nEntries;i++){
634 TH1D *histo = (TH1D*) fEfficiencyTPC->At(i);
636 cout<<"Warning: Histogram in fEfficiencyTPC at "<<i<<" is NULL!"<<endl;
640 if(histo->GetEntries()<=1e-2){
641 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyTPC is empty!"<<endl;
646 cout<<nbadhistograms<<" bad histograms in fEfficiencyTPC"<<endl;
648 nEntries = fEfficiencyITS->GetEntries();
650 for(int i=0;i<nEntries;i++){
651 TH1D *histo = (TH1D*) fEfficiencyITS->At(i);
653 cout<<"Warning: Histogram in fEfficiencyITS at "<<i<<" is NULL!"<<endl;
657 if(histo->GetEntries()<=1e-2){
658 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyITS is empty!"<<endl;
663 cout<<nbadhistograms<<" bad histograms in fEfficiencyITS"<<endl;
670 cout<<"======================================================================="<<endl;
671 cout<<"======================================================================="<<endl;