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)
65 ,fEfficiencyErrorLow(0)
66 ,fEfficiencyErrorHigh(0)
67 ,fBackgroundErrorLow(0)
68 ,fBackgroundErrorHigh(0)
74 ,fProduction("ProductionName")
75 ,fProductionDescription("Long production description")
76 {//default constructor
77 //This seems to solve a compiler error
78 cout<<"Creating new AliAnalysisHadEtCorrections"<<endl;
79 fEfficiencyTPC = new TObjArray();
80 fEfficiencyITS = new TObjArray();
83 AliAnalysisHadEtCorrections::~AliAnalysisHadEtCorrections()
89 fEfficiencyPionTPC->Clear();
90 fEfficiencyKaonTPC->Clear();
91 fEfficiencyProtonTPC->Clear();
92 fEfficiencyHadronTPC->Clear();
93 fEfficiencyPionITS->Clear();
94 fEfficiencyKaonITS->Clear();
95 fEfficiencyProtonITS->Clear();
96 fEfficiencyHadronITS->Clear();
97 fBackgroundTPC->Clear();
98 fBackgroundITS->Clear();
102 delete fEfficiencyPionTPC;
103 delete fEfficiencyKaonTPC;
104 delete fEfficiencyProtonTPC;
105 delete fEfficiencyHadronTPC;
106 delete fEfficiencyPionITS;
107 delete fEfficiencyKaonITS;
108 delete fEfficiencyProtonITS;
109 delete fEfficiencyHadronITS;
110 delete fEfficiencyTPC;
111 delete fEfficiencyITS;
112 delete fBackgroundTPC;
113 delete fBackgroundITS;
115 AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g): TNamed(),
117 ,fAcceptanceCorrectionFull(g->fAcceptanceCorrectionFull)
118 ,fAcceptanceCorrectionEMCAL(g->fAcceptanceCorrectionEMCAL)
119 ,fAcceptanceCorrectionPHOS(g->fAcceptanceCorrectionPHOS)
120 ,fNeutralCorrection(g->fNeutralCorrection)
121 ,fNotHadronicCorrection(g->fNotHadronicCorrection)
122 ,fpTcutCorrectionTPC(g->fpTcutCorrectionTPC)
123 ,fpTcutCorrectionITS(g->fpTcutCorrectionITS)
124 ,fNotIDConstTPC(g->fNotIDConstTPC)
125 ,fNotIDConstITS(g->fNotIDConstITS)
126 ,fNotIDConstTPCNoID(g->fNotIDConstTPCNoID)
127 ,fNotIDConstITSNoID(g->fNotIDConstITSNoID)
128 ,fNeutralCorrectionLow(g->fNeutralCorrectionLow)
129 ,fNotHadronicCorrectionLow(g->fNotHadronicCorrectionLow)
130 ,ffpTcutCorrectionTPCLow(g->ffpTcutCorrectionTPCLow)
131 ,ffpTcutCorrectionITSLow(g->ffpTcutCorrectionITSLow)
132 ,fNeutralCorrectionHigh(g->fNeutralCorrectionHigh)
133 ,fNotHadronicCorrectionHigh(g->fNotHadronicCorrectionHigh)
134 ,ffpTcutCorrectionTPCHigh(g->ffpTcutCorrectionTPCHigh)
135 ,ffpTcutCorrectionITSHigh(g->ffpTcutCorrectionITSHigh)
136 ,fNotIDConstTPCLow(g->fNotIDConstTPCLow)
137 ,fNotIDConstITSLow(g->fNotIDConstITSLow)
138 ,fNotIDConstTPCNoIDLow(g->fNotIDConstTPCNoIDLow)
139 ,fNotIDConstITSNoIDLow(g->fNotIDConstITSNoIDLow)
140 ,fNotIDConstTPCHigh(g->fNotIDConstTPCHigh)
141 ,fNotIDConstITSHigh(g->fNotIDConstITSHigh)
142 ,fNotIDConstTPCNoIDHigh(g->fNotIDConstTPCNoIDHigh)
143 ,fNotIDConstITSNoIDHigh(g->fNotIDConstITSNoIDHigh)
147 ,fEfficiencyPionTPC(0)
148 ,fEfficiencyKaonTPC(0)
149 ,fEfficiencyProtonTPC(0)
150 ,fEfficiencyHadronTPC(0)
151 ,fEfficiencyPionITS(0)
152 ,fEfficiencyKaonITS(0)
153 ,fEfficiencyProtonITS(0)
154 ,fEfficiencyHadronITS(0)
157 ,fEfficiencyErrorLow(g->fEfficiencyErrorLow)
158 ,fEfficiencyErrorHigh(g->fEfficiencyErrorHigh)
159 ,fBackgroundErrorLow(g->fBackgroundErrorLow)
160 ,fBackgroundErrorHigh(g->fBackgroundErrorHigh)
163 ,fIsEMCal(g->fIsEMCal)
165 ,fDataSet(g->fDataSet)
166 ,fProduction(g->fProduction)
167 ,fProductionDescription(g->fProductionDescription)
169 //SetName(g->GetName());
170 fnotIDTPC = new TH1D(*(g->fnotIDTPC));
171 fnotIDITS = new TH1D(*(g->fnotIDITS));
172 fnotIDNoID = new TH1D(*(g->fnotIDNoID));
173 fEfficiencyPionTPC = new TH1D(*(g->fEfficiencyPionTPC));
174 fEfficiencyKaonTPC = new TH1D(*(g->fEfficiencyKaonTPC));
175 fEfficiencyProtonTPC = new TH1D(*(g->fEfficiencyProtonTPC));
176 fEfficiencyHadronTPC = new TH1D(*(g->fEfficiencyHadronTPC));
177 fEfficiencyPionITS = new TH1D(*(g->fEfficiencyPionITS));
178 fEfficiencyKaonITS = new TH1D(*(g->fEfficiencyKaonITS));
179 fEfficiencyProtonITS = new TH1D(*(g->fEfficiencyProtonITS));
180 fEfficiencyHadronITS = new TH1D(*(g->fEfficiencyHadronITS));
181 fEfficiencyTPC = new TObjArray(*(g->fEfficiencyTPC));
182 fEfficiencyITS = new TObjArray(*(g->fEfficiencyITS));
183 fBackgroundTPC = new TH1D(*(g->fBackgroundTPC));
184 fBackgroundITS = new TH1D(*(g->fBackgroundITS));
188 Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const {//Get the correction values that are not pt dependent
189 Float_t acceptance = 0.0;
190 Float_t neutral = 0.0;
191 Float_t ptcorr = 0.0;
192 float correction = 0.0;
194 //TString *type = new TString(mytype);
196 if(type.Contains("Full")) acceptance = fAcceptanceCorrectionFull;
197 if(type.Contains("EMCAL")) acceptance = fAcceptanceCorrectionEMCAL;
198 if(type.Contains("PHOS")) acceptance = fAcceptanceCorrectionPHOS;
200 if(type.Contains("High")){//high bound
201 if(totEt) neutral = fNotHadronicCorrectionHigh;
202 else{neutral = fNeutralCorrectionHigh;}
203 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;}
204 else{ptcorr = ffpTcutCorrectionITSHigh;}
205 cout<<"Setting correction factor to "<<correction<<endl;
208 if(type.Contains("Low")){//high bound
209 if(totEt) neutral = fNotHadronicCorrectionLow;
210 else{neutral = fNeutralCorrectionLow;}
211 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;}
212 else{ptcorr = ffpTcutCorrectionITSLow;}
213 cout<<"Setting correction factor to "<<correction<<endl;
217 if(totEt) neutral = fNotHadronicCorrection;
218 else{neutral = fNeutralCorrection;}
219 if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;}
220 else{ptcorr = fpTcutCorrectionITS;}
222 correction = acceptance*neutral*ptcorr;
223 cout<<"Setting correction factor for ";
224 if(totEt) cout<<"total et";
225 else{cout<<"hadronic et";}
226 cout<<" with the pt cut off "<<ptcut<<" for "<<type<<" acceptance to "<<correction<<endl;
227 //cout<<" Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl;
231 Float_t AliAnalysisHadEtCorrections::GetSystematicErrorBound(Float_t et,Bool_t isLowBound, Bool_t isHadronic, Bool_t isTPC){
232 //we calculate factors for each value and then multiply them to get the overall bounds
233 //neutral corrections, pt cut, pid, efficiency, background
237 float efficiency = 1.0;
238 float background = 1.0;
239 if(isLowBound){//is lower bound
240 if(isHadronic) neutral= fNeutralCorrectionLow/fNeutralCorrection;
241 else{neutral = fNotHadronicCorrectionLow/fNotHadronicCorrection;}
242 if(isTPC) ptcut = ffpTcutCorrectionTPCLow/fpTcutCorrectionTPC;
243 else{ptcut = ffpTcutCorrectionITSLow/fpTcutCorrectionITS;}
244 pid = fNotIDConstTPCLow/fNotIDConstTPC;
245 efficiency = fEfficiencyErrorLow;
246 background = fBackgroundErrorLow;
248 else{//is higher bound
249 if(isHadronic) neutral= fNeutralCorrectionHigh/fNeutralCorrection;
250 else{neutral= fNotHadronicCorrectionHigh/fNotHadronicCorrection;}
251 if(isTPC) ptcut = ffpTcutCorrectionTPCHigh/fpTcutCorrectionTPC;
252 else{ptcut = ffpTcutCorrectionITSHigh/fpTcutCorrectionITS;}
253 pid = fNotIDConstTPCHigh/fNotIDConstTPC;
254 efficiency = fEfficiencyErrorHigh;
255 background = fBackgroundErrorHigh;
257 //cout<<"neutral "<<neutral<<" ptcut "<<ptcut<<" pid "<<pid<<" efficiency "<<efficiency<<" background "<<background<<" overall "<<neutral*ptcut*pid*efficiency*background<<endl;
258 return neutral*ptcut*pid*efficiency*background*et;
260 // AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) {
262 // fEtaCut=g->fEtaCut;
263 // fAcceptanceCorrectionFull=g->fAcceptanceCorrectionFull;
264 // fAcceptanceCorrectionEMCAL=g->fAcceptanceCorrectionEMCAL;
265 // fAcceptanceCorrectionPHOS=g->fAcceptanceCorrectionPHOS;
266 // fNeutralCorrection=g->fNeutralCorrection;
267 // fNotHadronicCorrection=g->fNotHadronicCorrection;
268 // fpTcutCorrectionTPC=g->fpTcutCorrectionTPC;
269 // fpTcutCorrectionITS=g->fpTcutCorrectionITS;
270 // fNeutralCorrectionLow=g->fNeutralCorrectionLow;
271 // fNotHadronicCorrectionLow=g->fNotHadronicCorrectionLow;
272 // ffpTcutCorrectionTPCLow=g->ffpTcutCorrectionTPCLow;
273 // ffpTcutCorrectionITSLow=g->ffpTcutCorrectionITSLow;
274 // fNeutralCorrectionHigh=g->fNeutralCorrectionHigh;
275 // fNotHadronicCorrectionHigh=g->fNotHadronicCorrectionHigh;
276 // ffpTcutCorrectionTPCHigh=g->ffpTcutCorrectionTPCHigh;
277 // ffpTcutCorrectionITSHigh=g->ffpTcutCorrectionITSHigh;
279 // fnotIDTPC = g->fnotIDTPC;
280 // fnotIDITS = g->fnotIDITS;
281 // fnotIDNoID = g->fnotIDNoID;
282 // fEfficiencyPionTPC = g->fEfficiencyPionTPC;
283 // fEfficiencyKaonTPC = g->fEfficiencyKaonTPC;
284 // fEfficiencyProtonTPC = g->fEfficiencyProtonTPC;
285 // fEfficiencyHadronTPC = g->fEfficiencyHadronTPC;
286 // fEfficiencyPionITS = g->fEfficiencyPionITS;
287 // fEfficiencyKaonITS = g->fEfficiencyKaonITS;
288 // fEfficiencyProtonITS = g->fEfficiencyProtonITS;
289 // fEfficiencyHadronITS = g->fEfficiencyHadronITS;
290 // fBackgroundTPC = g->fBackgroundTPC;
291 // fBackgroundITS = g->fBackgroundITS;
293 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionTPC(const int cb){//Get centrality dependent efficiency
294 if(cb==-1){return fEfficiencyPionTPC;}
295 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));}
297 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonTPC(const int cb){//Get centrality dependent efficiency
298 if(cb==-1){return fEfficiencyKaonTPC;}
299 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));}
301 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonTPC(const int cb){//Get centrality dependent efficiency
302 if(cb==-1){return fEfficiencyProtonTPC;}
303 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));}
305 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronTPC(const int cb){//Get centrality dependent efficiency
306 if(cb==-1){return fEfficiencyHadronTPC;}
307 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));}
309 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionITS(const int cb){//Get centrality dependent efficiency
310 if(cb==-1){return fEfficiencyPionITS;}
311 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));}
313 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonITS(const int cb){//Get centrality dependent efficiency
314 if(cb==-1){return fEfficiencyKaonITS;}
315 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));}
317 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonITS(const int cb){//Get centrality dependent efficiency
318 if(cb==-1){return fEfficiencyProtonITS;}
319 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));}
321 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronITS(const int cb){//Get centrality dependent efficiency
322 if(cb==-1){return fEfficiencyHadronITS;}
323 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));}
325 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the TPC
328 if(!fEfficiencyPionTPC){cerr<<"No histogram fEfficiencyPionTPC!"<<endl; return -1.0;}
329 eff = fEfficiencyPionTPC->GetBinContent(fEfficiencyPionTPC->FindBin(pT));
330 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
333 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
334 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionTPC%i",cb)<<endl; return -1.0;}
335 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
336 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
340 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the TPC
343 if(!fEfficiencyKaonTPC){cerr<<"No histogram fEfficiencyKaonTPC!"<<endl; return -1.0;}
344 eff = fEfficiencyKaonTPC->GetBinContent(fEfficiencyKaonTPC->FindBin(pT));
345 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
348 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
349 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonTPC%i",cb)<<endl; return -1.0;}
350 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
351 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
355 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the TPC
358 if(!fEfficiencyProtonTPC){cerr<<"No histogram fEfficiencyProtonTPC!"<<endl; return -1.0;}
359 eff = fEfficiencyProtonTPC->GetBinContent(fEfficiencyProtonTPC->FindBin(pT));
360 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
363 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
364 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonTPC%i",cb)<<endl; return -1.0;}
365 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
366 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
370 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the TPC
373 if(!fEfficiencyHadronTPC){cerr<<"No histogram fEfficiencyHadronTPC!"<<endl; return -1.0;}
374 eff = fEfficiencyHadronTPC->GetBinContent(fEfficiencyHadronTPC->FindBin(pT));
375 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
378 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
379 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronTPC%i",cb)<<endl; return -1.0;}
380 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
381 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
385 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the ITS
388 if(!fEfficiencyPionITS){cerr<<"No histogram fEfficiencyPionITS!"<<endl; return -1.0;}
389 eff = fEfficiencyPionITS->GetBinContent(fEfficiencyPionITS->FindBin(pT));
390 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
393 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
394 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionITS%i",cb)<<endl; return -1.0;}
395 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
396 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
400 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the ITS
403 if(!fEfficiencyKaonITS){cerr<<"No histogram fEfficiencyKaonITS!"<<endl; return -1.0;}
404 eff = fEfficiencyKaonITS->GetBinContent(fEfficiencyKaonITS->FindBin(pT));
405 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
408 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
409 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonITS%i",cb)<<endl; return -1.0;}
410 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
411 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
415 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the ITS
418 if(!fEfficiencyProtonITS){cerr<<"No histogram fEfficiencyProtonITS!"<<endl; return -1.0;}
419 eff = fEfficiencyProtonITS->GetBinContent(fEfficiencyProtonITS->FindBin(pT));
420 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
423 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
424 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonITS%i",cb)<<endl; return -1.0;}
425 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
426 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
430 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the ITS
433 if(!fEfficiencyHadronITS){cerr<<"No histogram fEfficiencyHadronITS!"<<endl; return -1.0;}
434 eff = fEfficiencyHadronITS->GetBinContent(fEfficiencyHadronITS->FindBin(pT));
435 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
438 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
439 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronITS%i",cb)<<endl; return -1.0;}
440 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
441 if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;}
445 void AliAnalysisHadEtCorrections::SetEfficiencyPionTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
447 //first check to see if the histogram exists already
448 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
450 fEfficiencyTPC->Remove(old);
453 //then if the new histogram exists, add it to the array
454 histo->SetName(Form("fEfficiencyPionTPC%i",cb));
455 fEfficiencyTPC->Add(histo);
457 else{cerr<<"Histogram does not exist!"<<endl;}
459 void AliAnalysisHadEtCorrections::SetEfficiencyKaonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
461 //first check to see if the histogram exists already
462 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
464 fEfficiencyTPC->Remove(old);
467 //then if the new histogram exists, add it to the array
468 histo->SetName(Form("fEfficiencyKaonTPC%i",cb));
469 fEfficiencyTPC->Add(histo);
471 else{cerr<<"Histogram does not exist!"<<endl;}
473 void AliAnalysisHadEtCorrections::SetEfficiencyProtonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
475 //first check to see if the histogram exists already
476 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
478 fEfficiencyTPC->Remove(old);
481 //then if the new histogram exists, add it to the array
482 histo->SetName(Form("fEfficiencyProtonTPC%i",cb));
483 fEfficiencyTPC->Add(histo);
485 else{cerr<<"Histogram does not exist!"<<endl;}
487 void AliAnalysisHadEtCorrections::SetEfficiencyHadronTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
489 //first check to see if the histogram exists already
490 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
492 fEfficiencyTPC->Remove(old);
495 //then if the new histogram exists, add it to the array
496 histo->SetName(Form("fEfficiencyHadronTPC%i",cb));
497 fEfficiencyTPC->Add(histo);
499 else{cerr<<"Histogram does not exist!"<<endl;}
501 void AliAnalysisHadEtCorrections::SetEfficiencyPionITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
503 //first check to see if the histogram exists already
504 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
506 fEfficiencyITS->Remove(old);
509 //then if the new histogram exists, add it to the array
510 histo->SetName(Form("fEfficiencyPionITS%i",cb));
511 fEfficiencyITS->Add(histo);
513 else{cerr<<"Histogram does not exist!"<<endl;}
515 void AliAnalysisHadEtCorrections::SetEfficiencyKaonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
517 //first check to see if the histogram exists already
518 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
520 fEfficiencyITS->Remove(old);
523 //then if the new histogram exists, add it to the array
524 histo->SetName(Form("fEfficiencyKaonITS%i",cb));
525 fEfficiencyITS->Add(histo);
527 else{cerr<<"Histogram does not exist!"<<endl;}
529 void AliAnalysisHadEtCorrections::SetEfficiencyProtonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
531 //first check to see if the histogram exists already
532 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
534 fEfficiencyITS->Remove(old);
537 //then if the new histogram exists, add it to the array
538 histo->SetName(Form("fEfficiencyProtonITS%i",cb));
539 fEfficiencyITS->Add(histo);
541 else{cerr<<"Histogram does not exist!"<<endl;}
543 void AliAnalysisHadEtCorrections::SetEfficiencyHadronITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
545 //first check to see if the histogram exists already
546 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
548 fEfficiencyITS->Remove(old);
551 //then if the new histogram exists, add it to the array
552 histo->SetName(Form("fEfficiencyHadronITS%i",cb));
553 fEfficiencyITS->Add(histo);
555 else{cerr<<"Histogram does not exist!"<<endl;}
559 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionTPC(const float pT){//get correction for unidentified particles in the TPC
560 Float_t val = fnotIDTPC->GetBinContent(fnotIDTPC->FindBin(pT));
561 if(val>0.0) return 1.0/(val);
564 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionITS(const float pT){//Get correction for unidentified particles in the ITS
565 Float_t val = fnotIDITS->GetBinContent(fnotIDITS->FindBin(pT));
566 if(val>0.0) return 1.0/(val);
569 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionNoPID(const float pT){//Get correction for particles in the case that there is no particle identification
570 Float_t val = fnotIDNoID->GetBinContent(fnotIDNoID->FindBin(pT));
571 if(val>0.0) return 1.0/(val);
574 void AliAnalysisHadEtCorrections::Report(){//Gives a report on the status of all corrections
575 //This is primarily for cross checking that the results we get from the macro that fills this class, GetCorrections.C, are sane
576 cout<<"======================================================================="<<endl;
577 cout<<" Report from "<<GetName()<<endl;
578 cout<<"======================================================================="<<endl;
579 cout<<fProductionDescription<<" created from "<<fProduction<<endl;
580 cout<<"This for determination of EThad from ";
581 if(fIsData) cout<<"data of ";
582 else{cout<<"simulation of ";}
585 cout<<"p+p collisions at 900 GeV"<<endl;
588 cout<<"p+p collisions at 7 TeV"<<endl;
591 cout<<"Pb+Pb collisions at 2.76 TeV"<<endl;
594 cout<<"an undetermined collision system and energy"<<endl;
596 cout<<"This is initialized for the ";
597 if(fIsEMCal) cout<<"EMCal";
599 cout<<" acceptance"<<endl<<endl;
601 cout<<"The acceptance correction for the full "<<fAcceptanceCorrectionFull<<endl;
602 cout<<" EMCal "<<fAcceptanceCorrectionEMCAL<<endl;
603 cout<<" PHOS "<<fAcceptanceCorrectionPHOS<<endl<<endl;
605 cout<<Form("The neutral energy correction is %2.4f [%2.4f,%2.4f]",fNeutralCorrection,fNeutralCorrectionLow,fNeutralCorrectionHigh)<<endl;
606 cout<<Form(" total %2.4f [%2.4f,%2.4f]",fNotHadronicCorrection,fNotHadronicCorrectionLow,fNotHadronicCorrectionHigh)<<endl<<endl;
608 cout<<Form("The pT cut correction for 100 MeV is %2.4f [%2.4f,%2.4f]",fpTcutCorrectionITS,ffpTcutCorrectionITSLow,ffpTcutCorrectionITSHigh)<<endl;
609 cout<<Form(" 150 MeV %2.4f [%2.4f,%2.4f]",fpTcutCorrectionTPC,ffpTcutCorrectionTPCLow,ffpTcutCorrectionTPCHigh)<<endl<<endl;
611 cout<<Form("The correction for unidentified ITS tracks is %2.4f [%2.4f,%2.4f]",fNotIDConstITS,fNotIDConstITSLow,fNotIDConstITSHigh)<<endl;
612 cout<<Form(" TPC tracks %2.4f [%2.4f,%2.4f]",fNotIDConstTPC,fNotIDConstTPCLow,fNotIDConstTPCHigh)<<endl<<endl;
614 cout<<"Background correction histogram for ITS tracks is";
615 if(!fBackgroundITS)cout<<" not set"<<endl;
616 else{cout<<" set and has "<<fBackgroundITS->GetEntries()<<" entries"<<endl;}
618 if(!fBackgroundTPC)cout<<" not set"<<endl;
619 else{cout<<" set and has "<<fBackgroundTPC->GetEntries()<<" entries"<<endl;}
623 cout<<"Efficiency histogram for ITS tracks for hadrons is";
624 if(!fEfficiencyHadronITS)cout<<" not set"<<endl;
625 else{cout<<" set and has "<<fEfficiencyHadronITS->GetEntries()<<" entries"<<endl;}
626 cout<<" TPC hadrons ";
627 if(!fEfficiencyHadronTPC)cout<<" not set"<<endl;
628 else{cout<<" set and has "<<fEfficiencyHadronTPC->GetEntries()<<" entries"<<endl;}
630 if(!fEfficiencyPionITS)cout<<" not set"<<endl;
631 else{cout<<" set and has "<<fEfficiencyPionITS->GetEntries()<<" entries"<<endl;}
633 if(!fEfficiencyPionTPC)cout<<" not set"<<endl;
634 else{cout<<" set and has "<<fEfficiencyPionTPC->GetEntries()<<" entries"<<endl;}
636 if(!fEfficiencyKaonITS)cout<<" not set"<<endl;
637 else{cout<<" set and has "<<fEfficiencyKaonITS->GetEntries()<<" entries"<<endl;}
639 if(!fEfficiencyKaonTPC)cout<<" not set"<<endl;
640 else{cout<<" set and has "<<fEfficiencyKaonTPC->GetEntries()<<" entries"<<endl;}
641 cout<<" ITS protons ";
642 if(!fEfficiencyProtonITS)cout<<" not set"<<endl;
643 else{cout<<" set and has "<<fEfficiencyProtonITS->GetEntries()<<" entries"<<endl;}
644 cout<<" TPC protons ";
645 if(!fEfficiencyProtonTPC)cout<<" not set"<<endl;
646 else{cout<<" set and has "<<fEfficiencyProtonTPC->GetEntries()<<" entries"<<endl;}
649 if(fDataSet==20100){//if Pb+Pb
650 cout<<"Efficiency histogram for TPC tracks for hadrons is set for centrality bins ";
651 for(int i = 0;i<=21;i++){
652 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",i));
653 if(histo) cout<<i<<" ";
657 for(int i = 0;i<=21;i++){
658 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",i));
659 if(histo) cout<<i<<" ";
663 for(int i = 0;i<=21;i++){
664 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",i));
665 if(histo) cout<<i<<" ";
669 for(int i = 0;i<=21;i++){
670 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",i));
671 if(histo) cout<<i<<" ";
674 cout<<" ITS hadrons ";
675 for(int i = 0;i<=21;i++){
676 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",i));
677 if(histo) cout<<i<<" ";
681 for(int i = 0;i<=21;i++){
682 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",i));
683 if(histo) cout<<i<<" ";
687 for(int i = 0;i<=21;i++){
688 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",i));
689 if(histo) cout<<i<<" ";
693 for(int i = 0;i<=21;i++){
694 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",i));
695 if(histo) cout<<i<<" ";
700 int nEntries = fEfficiencyTPC->GetEntries();
701 int nbadhistograms = 0;
702 for(int i=0;i<nEntries;i++){
703 TH1D *histo = (TH1D*) fEfficiencyTPC->At(i);
705 cout<<"Warning: Histogram in fEfficiencyTPC at "<<i<<" is NULL!"<<endl;
709 if(histo->GetEntries()<=1e-2){
710 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyTPC is empty!"<<endl;
715 cout<<nbadhistograms<<" bad histograms in fEfficiencyTPC"<<endl;
717 nEntries = fEfficiencyITS->GetEntries();
719 for(int i=0;i<nEntries;i++){
720 TH1D *histo = (TH1D*) fEfficiencyITS->At(i);
722 cout<<"Warning: Histogram in fEfficiencyITS at "<<i<<" is NULL!"<<endl;
726 if(histo->GetEntries()<=1e-2){
727 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyITS is empty!"<<endl;
732 cout<<nbadhistograms<<" bad histograms in fEfficiencyITS"<<endl;
739 cout<<"======================================================================="<<endl;
740 cout<<"======================================================================="<<endl;