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")) acceptance = fAcceptanceCorrectionFull;
200 if(type.Contains("EMCAL")) acceptance = fAcceptanceCorrectionEMCAL;
201 if(type.Contains("PHOS")) acceptance = fAcceptanceCorrectionPHOS;
203 if(type.Contains("High")){//high bound
204 if(totEt) neutral = fNotHadronicCorrectionHigh;
205 else{neutral = fNeutralCorrectionHigh;}
206 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;}
207 else{ptcorr = ffpTcutCorrectionITSHigh;}
208 cout<<"Setting correction factor to "<<correction<<endl;
211 if(type.Contains("Low")){//high bound
212 if(totEt) neutral = fNotHadronicCorrectionLow;
213 else{neutral = fNeutralCorrectionLow;}
214 if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;}
215 else{ptcorr = ffpTcutCorrectionITSLow;}
216 cout<<"Setting correction factor to "<<correction<<endl;
220 if(totEt) neutral = fNotHadronicCorrection;
221 else{neutral = fNeutralCorrection;}
222 if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;}
223 else{ptcorr = fpTcutCorrectionITS;}
225 correction = acceptance*neutral*ptcorr;
226 cout<<"Setting correction factor for ";
227 if(totEt) cout<<"total et";
228 else{cout<<"hadronic et";}
229 cout<<" with the pt cut off "<<ptcut<<" for "<<type<<" acceptance to "<<correction<<endl;
230 //cout<<" Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl;
234 Float_t AliAnalysisHadEtCorrections::GetSystematicErrorBound(Float_t et,Bool_t isLowBound, Bool_t isHadronic, Bool_t isTPC) const{
235 //we calculate factors for each value and then multiply them to get the overall bounds
236 //neutral corrections, pt cut, pid, efficiency, background
240 float efficiency = 1.0;
241 float background = 1.0;
242 if(isLowBound){//is lower bound
243 if(isHadronic) neutral= fNeutralCorrectionLow/fNeutralCorrection;
244 else{neutral = fNotHadronicCorrectionLow/fNotHadronicCorrection;}
245 if(isTPC) ptcut = ffpTcutCorrectionTPCLow/fpTcutCorrectionTPC;
246 else{ptcut = ffpTcutCorrectionITSLow/fpTcutCorrectionITS;}
247 pid = fNotIDConstTPCLow/fNotIDConstTPC;
248 efficiency = fEfficiencyErrorLow;
249 background = fBackgroundErrorLow;
251 else{//is higher bound
252 if(isHadronic) neutral= fNeutralCorrectionHigh/fNeutralCorrection;
253 else{neutral= fNotHadronicCorrectionHigh/fNotHadronicCorrection;}
254 if(isTPC) ptcut = ffpTcutCorrectionTPCHigh/fpTcutCorrectionTPC;
255 else{ptcut = ffpTcutCorrectionITSHigh/fpTcutCorrectionITS;}
256 pid = fNotIDConstTPCHigh/fNotIDConstTPC;
257 efficiency = fEfficiencyErrorHigh;
258 background = fBackgroundErrorHigh;
260 //cout<<"neutral "<<neutral<<" ptcut "<<ptcut<<" pid "<<pid<<" efficiency "<<efficiency<<" background "<<background<<" overall "<<neutral*ptcut*pid*efficiency*background<<endl;
261 return neutral*ptcut*pid*efficiency*background*et;
263 // AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) {
265 // fEtaCut=g->fEtaCut;
266 // fAcceptanceCorrectionFull=g->fAcceptanceCorrectionFull;
267 // fAcceptanceCorrectionEMCAL=g->fAcceptanceCorrectionEMCAL;
268 // fAcceptanceCorrectionPHOS=g->fAcceptanceCorrectionPHOS;
269 // fNeutralCorrection=g->fNeutralCorrection;
270 // fNotHadronicCorrection=g->fNotHadronicCorrection;
271 // fpTcutCorrectionTPC=g->fpTcutCorrectionTPC;
272 // fpTcutCorrectionITS=g->fpTcutCorrectionITS;
273 // fNeutralCorrectionLow=g->fNeutralCorrectionLow;
274 // fNotHadronicCorrectionLow=g->fNotHadronicCorrectionLow;
275 // ffpTcutCorrectionTPCLow=g->ffpTcutCorrectionTPCLow;
276 // ffpTcutCorrectionITSLow=g->ffpTcutCorrectionITSLow;
277 // fNeutralCorrectionHigh=g->fNeutralCorrectionHigh;
278 // fNotHadronicCorrectionHigh=g->fNotHadronicCorrectionHigh;
279 // ffpTcutCorrectionTPCHigh=g->ffpTcutCorrectionTPCHigh;
280 // ffpTcutCorrectionITSHigh=g->ffpTcutCorrectionITSHigh;
282 // fnotIDTPC = g->fnotIDTPC;
283 // fnotIDITS = g->fnotIDITS;
284 // fnotIDNoID = g->fnotIDNoID;
285 // fEfficiencyPionTPC = g->fEfficiencyPionTPC;
286 // fEfficiencyKaonTPC = g->fEfficiencyKaonTPC;
287 // fEfficiencyProtonTPC = g->fEfficiencyProtonTPC;
288 // fEfficiencyHadronTPC = g->fEfficiencyHadronTPC;
289 // fEfficiencyPionITS = g->fEfficiencyPionITS;
290 // fEfficiencyKaonITS = g->fEfficiencyKaonITS;
291 // fEfficiencyProtonITS = g->fEfficiencyProtonITS;
292 // fEfficiencyHadronITS = g->fEfficiencyHadronITS;
293 // fBackgroundTPC = g->fBackgroundTPC;
294 // fBackgroundITS = g->fBackgroundITS;
296 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionTPC(const int cb){//Get centrality dependent efficiency
297 if(cb==-1){return fEfficiencyPionTPC;}
298 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));}
300 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonTPC(const int cb){//Get centrality dependent efficiency
301 if(cb==-1){return fEfficiencyKaonTPC;}
302 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));}
304 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonTPC(const int cb){//Get centrality dependent efficiency
305 if(cb==-1){return fEfficiencyProtonTPC;}
306 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));}
308 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronTPC(const int cb){//Get centrality dependent efficiency
309 if(cb==-1){return fEfficiencyHadronTPC;}
310 else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));}
312 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionITS(const int cb){//Get centrality dependent efficiency
313 if(cb==-1){return fEfficiencyPionITS;}
314 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));}
316 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonITS(const int cb){//Get centrality dependent efficiency
317 if(cb==-1){return fEfficiencyKaonITS;}
318 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));}
320 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonITS(const int cb){//Get centrality dependent efficiency
321 if(cb==-1){return fEfficiencyProtonITS;}
322 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));}
324 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronITS(const int cb){//Get centrality dependent efficiency
325 if(cb==-1){return fEfficiencyHadronITS;}
326 else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));}
328 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the TPC
331 if(!fEfficiencyPionTPC){cerr<<"No histogram fEfficiencyPionTPC!"<<endl; return -1.0;}
332 eff = fEfficiencyPionTPC->GetBinContent(fEfficiencyPionTPC->FindBin(pT));
333 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
336 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
337 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionTPC%i",cb)<<endl; return -1.0;}
338 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
339 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
343 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the TPC
346 if(!fEfficiencyKaonTPC){cerr<<"No histogram fEfficiencyKaonTPC!"<<endl; return -1.0;}
347 eff = fEfficiencyKaonTPC->GetBinContent(fEfficiencyKaonTPC->FindBin(pT));
348 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
351 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
352 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonTPC%i",cb)<<endl; return -1.0;}
353 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
354 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
358 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the TPC
361 if(!fEfficiencyProtonTPC){cerr<<"No histogram fEfficiencyProtonTPC!"<<endl; return -1.0;}
362 eff = fEfficiencyProtonTPC->GetBinContent(fEfficiencyProtonTPC->FindBin(pT));
363 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
366 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
367 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonTPC%i",cb)<<endl; return -1.0;}
368 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
369 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
373 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the TPC
376 if(!fEfficiencyHadronTPC){cerr<<"No histogram fEfficiencyHadronTPC!"<<endl; return -1.0;}
377 eff = fEfficiencyHadronTPC->GetBinContent(fEfficiencyHadronTPC->FindBin(pT));
378 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
381 TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
382 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronTPC%i",cb)<<endl; return -1.0;}
383 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
384 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
388 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the ITS
391 if(!fEfficiencyPionITS){cerr<<"No histogram fEfficiencyPionITS!"<<endl; return -1.0;}
392 eff = fEfficiencyPionITS->GetBinContent(fEfficiencyPionITS->FindBin(pT));
393 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
396 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
397 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionITS%i",cb)<<endl; return -1.0;}
398 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
399 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
403 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the ITS
406 if(!fEfficiencyKaonITS){cerr<<"No histogram fEfficiencyKaonITS!"<<endl; return -1.0;}
407 eff = fEfficiencyKaonITS->GetBinContent(fEfficiencyKaonITS->FindBin(pT));
408 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
411 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
412 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonITS%i",cb)<<endl; return -1.0;}
413 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
414 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
418 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the ITS
421 if(!fEfficiencyProtonITS){cerr<<"No histogram fEfficiencyProtonITS!"<<endl; return -1.0;}
422 eff = fEfficiencyProtonITS->GetBinContent(fEfficiencyProtonITS->FindBin(pT));
423 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
426 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
427 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonITS%i",cb)<<endl; return -1.0;}
428 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
429 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
433 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the ITS
436 if(!fEfficiencyHadronITS){cerr<<"No histogram fEfficiencyHadronITS!"<<endl; return -1.0;}
437 eff = fEfficiencyHadronITS->GetBinContent(fEfficiencyHadronITS->FindBin(pT));
438 if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;}
441 TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
442 if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronITS%i",cb)<<endl; return -1.0;}
443 eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
444 if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;}
448 void AliAnalysisHadEtCorrections::SetEfficiencyPionTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
450 //first check to see if the histogram exists already
451 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
453 fEfficiencyTPC->Remove(old);
456 //then if the new histogram exists, add it to the array
457 histo->SetName(Form("fEfficiencyPionTPC%i",cb));
458 fEfficiencyTPC->Add(histo);
460 else{cerr<<"Histogram does not exist!"<<endl;}
462 void AliAnalysisHadEtCorrections::SetEfficiencyKaonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
464 //first check to see if the histogram exists already
465 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
467 fEfficiencyTPC->Remove(old);
470 //then if the new histogram exists, add it to the array
471 histo->SetName(Form("fEfficiencyKaonTPC%i",cb));
472 fEfficiencyTPC->Add(histo);
474 else{cerr<<"Histogram does not exist!"<<endl;}
476 void AliAnalysisHadEtCorrections::SetEfficiencyProtonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
478 //first check to see if the histogram exists already
479 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
481 fEfficiencyTPC->Remove(old);
484 //then if the new histogram exists, add it to the array
485 histo->SetName(Form("fEfficiencyProtonTPC%i",cb));
486 fEfficiencyTPC->Add(histo);
488 else{cerr<<"Histogram does not exist!"<<endl;}
490 void AliAnalysisHadEtCorrections::SetEfficiencyHadronTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
492 //first check to see if the histogram exists already
493 TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
495 fEfficiencyTPC->Remove(old);
498 //then if the new histogram exists, add it to the array
499 histo->SetName(Form("fEfficiencyHadronTPC%i",cb));
500 fEfficiencyTPC->Add(histo);
502 else{cerr<<"Histogram does not exist!"<<endl;}
504 void AliAnalysisHadEtCorrections::SetEfficiencyPionITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
506 //first check to see if the histogram exists already
507 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
509 fEfficiencyITS->Remove(old);
512 //then if the new histogram exists, add it to the array
513 histo->SetName(Form("fEfficiencyPionITS%i",cb));
514 fEfficiencyITS->Add(histo);
516 else{cerr<<"Histogram does not exist!"<<endl;}
518 void AliAnalysisHadEtCorrections::SetEfficiencyKaonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
520 //first check to see if the histogram exists already
521 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
523 fEfficiencyITS->Remove(old);
526 //then if the new histogram exists, add it to the array
527 histo->SetName(Form("fEfficiencyKaonITS%i",cb));
528 fEfficiencyITS->Add(histo);
530 else{cerr<<"Histogram does not exist!"<<endl;}
532 void AliAnalysisHadEtCorrections::SetEfficiencyProtonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
534 //first check to see if the histogram exists already
535 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
537 fEfficiencyITS->Remove(old);
540 //then if the new histogram exists, add it to the array
541 histo->SetName(Form("fEfficiencyProtonITS%i",cb));
542 fEfficiencyITS->Add(histo);
544 else{cerr<<"Histogram does not exist!"<<endl;}
546 void AliAnalysisHadEtCorrections::SetEfficiencyHadronITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
548 //first check to see if the histogram exists already
549 TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
551 fEfficiencyITS->Remove(old);
554 //then if the new histogram exists, add it to the array
555 histo->SetName(Form("fEfficiencyHadronITS%i",cb));
556 fEfficiencyITS->Add(histo);
558 else{cerr<<"Histogram does not exist!"<<endl;}
562 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionTPC(const float pT){//get correction for unidentified particles in the TPC
563 Float_t val = fnotIDTPC->GetBinContent(fnotIDTPC->FindBin(pT));
564 if(val>0.0) return 1.0/(val);
567 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionITS(const float pT){//Get correction for unidentified particles in the ITS
568 Float_t val = fnotIDITS->GetBinContent(fnotIDITS->FindBin(pT));
569 if(val>0.0) return 1.0/(val);
572 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionNoPID(const float pT){//Get correction for particles in the case that there is no particle identification
573 Float_t val = fnotIDNoID->GetBinContent(fnotIDNoID->FindBin(pT));
574 if(val>0.0) return 1.0/(val);
577 Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionTPC(const float pT){//Get background correction for TPC tracks
578 return (1.0-fBackgroundTPC->GetBinContent(fBackgroundTPC->FindBin(pT)));
580 Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionITS(const float pT){//Get background correction for ITS tracks
581 return (1.0-fBackgroundITS->GetBinContent(fBackgroundITS->FindBin(pT)));
583 void AliAnalysisHadEtCorrections::Report(){//Gives a report on the status of all corrections
584 //This is primarily for cross checking that the results we get from the macro that fills this class, GetCorrections.C, are sane
585 cout<<"======================================================================="<<endl;
586 cout<<" Report from "<<GetName()<<endl;
587 cout<<"======================================================================="<<endl;
588 cout<<fProductionDescription<<" created from "<<fProduction<<endl;
589 cout<<"This for determination of EThad from ";
590 if(fIsData) cout<<"data of ";
591 else{cout<<"simulation of ";}
594 cout<<"p+p collisions at 900 GeV"<<endl;
597 cout<<"p+p collisions at 7 TeV"<<endl;
600 cout<<"p+p collisions at 2.76 TeV"<<endl;
603 cout<<"Pb+Pb collisions at 2.76 TeV"<<endl;
606 cout<<"an undetermined collision system and energy"<<endl;
608 cout<<"This is initialized for the ";
609 if(fIsEMCal) cout<<"EMCal";
611 cout<<" acceptance"<<endl<<endl;
613 cout<<"The acceptance correction for the full "<<fAcceptanceCorrectionFull<<endl;
614 cout<<" EMCal "<<fAcceptanceCorrectionEMCAL<<endl;
615 cout<<" PHOS "<<fAcceptanceCorrectionPHOS<<endl<<endl;
617 cout<<Form("The neutral energy correction is %2.4f [%2.4f,%2.4f]",fNeutralCorrection,fNeutralCorrectionLow,fNeutralCorrectionHigh)<<endl;
618 cout<<Form(" total %2.4f [%2.4f,%2.4f]",fNotHadronicCorrection,fNotHadronicCorrectionLow,fNotHadronicCorrectionHigh)<<endl<<endl;
620 cout<<Form("The pT cut correction for 100 MeV is %2.4f [%2.4f,%2.4f]",fpTcutCorrectionITS,ffpTcutCorrectionITSLow,ffpTcutCorrectionITSHigh)<<endl;
621 cout<<Form(" 150 MeV %2.4f [%2.4f,%2.4f]",fpTcutCorrectionTPC,ffpTcutCorrectionTPCLow,ffpTcutCorrectionTPCHigh)<<endl<<endl;
623 cout<<Form("The correction for unidentified ITS tracks is %2.4f [%2.4f,%2.4f]",fNotIDConstITS,fNotIDConstITSLow,fNotIDConstITSHigh)<<endl;
624 cout<<Form(" TPC tracks %2.4f [%2.4f,%2.4f]",fNotIDConstTPC,fNotIDConstTPCLow,fNotIDConstTPCHigh)<<endl<<endl;
626 cout<<"Background correction histogram for ITS tracks is";
627 if(!fBackgroundITS)cout<<" not set"<<endl;
628 else{cout<<" set and has "<<fBackgroundITS->GetEntries()<<" entries"<<endl;}
630 if(!fBackgroundTPC)cout<<" not set"<<endl;
631 else{cout<<" set and has "<<fBackgroundTPC->GetEntries()<<" entries"<<endl;}
635 cout<<"Efficiency histogram for ITS tracks for hadrons is";
636 if(!fEfficiencyHadronITS)cout<<" not set"<<endl;
637 else{cout<<" set and has "<<fEfficiencyHadronITS->GetEntries()<<" entries"<<endl;}
638 cout<<" TPC hadrons ";
639 if(!fEfficiencyHadronTPC)cout<<" not set"<<endl;
640 else{cout<<" set and has "<<fEfficiencyHadronTPC->GetEntries()<<" entries"<<endl;}
642 if(!fEfficiencyPionITS)cout<<" not set"<<endl;
643 else{cout<<" set and has "<<fEfficiencyPionITS->GetEntries()<<" entries"<<endl;}
645 if(!fEfficiencyPionTPC)cout<<" not set"<<endl;
646 else{cout<<" set and has "<<fEfficiencyPionTPC->GetEntries()<<" entries"<<endl;}
648 if(!fEfficiencyKaonITS)cout<<" not set"<<endl;
649 else{cout<<" set and has "<<fEfficiencyKaonITS->GetEntries()<<" entries"<<endl;}
651 if(!fEfficiencyKaonTPC)cout<<" not set"<<endl;
652 else{cout<<" set and has "<<fEfficiencyKaonTPC->GetEntries()<<" entries"<<endl;}
653 cout<<" ITS protons ";
654 if(!fEfficiencyProtonITS)cout<<" not set"<<endl;
655 else{cout<<" set and has "<<fEfficiencyProtonITS->GetEntries()<<" entries"<<endl;}
656 cout<<" TPC protons ";
657 if(!fEfficiencyProtonTPC)cout<<" not set"<<endl;
658 else{cout<<" set and has "<<fEfficiencyProtonTPC->GetEntries()<<" entries"<<endl;}
661 if(fDataSet==20100){//if Pb+Pb
662 cout<<"Efficiency histogram for TPC tracks for hadrons is set for centrality bins ";
663 for(int i = 0;i<=21;i++){
664 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",i));
665 if(histo) cout<<i<<" ";
669 for(int i = 0;i<=21;i++){
670 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",i));
671 if(histo) cout<<i<<" ";
675 for(int i = 0;i<=21;i++){
676 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",i));
677 if(histo) cout<<i<<" ";
681 for(int i = 0;i<=21;i++){
682 TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",i));
683 if(histo) cout<<i<<" ";
686 cout<<" ITS hadrons ";
687 for(int i = 0;i<=21;i++){
688 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",i));
689 if(histo) cout<<i<<" ";
693 for(int i = 0;i<=21;i++){
694 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",i));
695 if(histo) cout<<i<<" ";
699 for(int i = 0;i<=21;i++){
700 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",i));
701 if(histo) cout<<i<<" ";
705 for(int i = 0;i<=21;i++){
706 TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",i));
707 if(histo) cout<<i<<" ";
712 int nEntries = fEfficiencyTPC->GetEntries();
713 int nbadhistograms = 0;
714 for(int i=0;i<nEntries;i++){
715 TH1D *histo = (TH1D*) fEfficiencyTPC->At(i);
717 cout<<"Warning: Histogram in fEfficiencyTPC at "<<i<<" is NULL!"<<endl;
721 if(histo->GetEntries()<=1e-2){
722 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyTPC is empty!"<<endl;
727 cout<<nbadhistograms<<" bad histograms in fEfficiencyTPC"<<endl;
729 nEntries = fEfficiencyITS->GetEntries();
731 for(int i=0;i<nEntries;i++){
732 TH1D *histo = (TH1D*) fEfficiencyITS->At(i);
734 cout<<"Warning: Histogram in fEfficiencyITS at "<<i<<" is NULL!"<<endl;
738 if(histo->GetEntries()<=1e-2){
739 cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyITS is empty!"<<endl;
744 cout<<nbadhistograms<<" bad histograms in fEfficiencyITS"<<endl;
751 cout<<"======================================================================="<<endl;
752 cout<<"======================================================================="<<endl;