]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/totEt/AliAnalysisHadEtCorrections.cxx
Operating mode changes: Regular/Light/SuperLight Cascade output storage for Pb-Pb
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisHadEtCorrections.cxx
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"
11 #include "TMath.h"
12 #include <iostream>
13 #include "Rtypes.h"
14 #include "TObjArray.h"
15 #include "AliLog.h"
16 #include "TH1D.h"
17
18 using namespace std;
19
20 ClassImp(AliAnalysisHadEtCorrections);
21
22
23 AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections() : TNamed(),
24                                                              fEtaCut(0)
25                                                            ,fAcceptanceCorrectionFull(0)
26                                                            ,fAcceptanceCorrectionEMCAL(0)
27                                                            ,fAcceptanceCorrectionPHOS(0)
28                                                            ,fNeutralCorrection(0)
29                                                            ,fNotHadronicCorrection(0)
30                                                            ,fpTcutCorrectionTPC(0)
31                                                            ,fpTcutCorrectionITS(0)
32                                                            ,fNotIDConstTPC(0)
33                                                            ,fNotIDConstITS(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)
44                                                            ,fNotIDConstTPCLow(0)
45                                                            ,fNotIDConstITSLow(0)
46                                                            ,fNotIDConstTPCNoIDLow(0)
47                                                            ,fNotIDConstITSNoIDLow(0)
48                                                            ,fNotIDConstTPCHigh(0)
49                                                            ,fNotIDConstITSHigh(0)
50                                                            ,fNotIDConstTPCNoIDHigh(0)
51                                                            ,fNotIDConstITSNoIDHigh(0)
52                                                            ,fnotIDTPC(0)
53                                                            ,fnotIDITS(0)
54                                                            ,fnotIDNoID(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)
63                                                            ,fEfficiencyTPC(0)
64                                                            ,fEfficiencyITS(0)
65                                                            ,fEfficiencyErrorLow(0)
66                                                            ,fEfficiencyErrorHigh(0)
67                                                            ,fBackgroundErrorLow(0)
68                                                            ,fBackgroundErrorHigh(0)
69                                                            ,fBackgroundTPC(0)
70                                                            ,fBackgroundITS(0)
71                                                            ,fIsEMCal(kTRUE)
72                                                            ,fIsData(kFALSE)
73                                                            ,fDataSet(2009)
74                                                            ,fProduction("ProductionName")
75                                                            ,fProductionDescription("Long production description")
76                                                            ,fSpectraCalcErrorCorrelation(1)
77 {//default constructor
78   Init();
79 }
80 void AliAnalysisHadEtCorrections::Init() 
81 {  //This seems to solve a compiler error
82    cout<<"Creating new AliAnalysisHadEtCorrections"<<endl;
83    fEfficiencyTPC = new TObjArray();
84    fEfficiencyITS = new TObjArray();
85 }
86
87 AliAnalysisHadEtCorrections::~AliAnalysisHadEtCorrections()
88 {//destructor
89   //Clear();
90     fnotIDTPC->Clear();
91     fnotIDITS->Clear();
92     fnotIDNoID->Clear();
93     fEfficiencyPionTPC->Clear();
94     fEfficiencyKaonTPC->Clear();
95     fEfficiencyProtonTPC->Clear();
96     fEfficiencyHadronTPC->Clear();
97     fEfficiencyPionITS->Clear();
98     fEfficiencyKaonITS->Clear();
99     fEfficiencyProtonITS->Clear();
100     fEfficiencyHadronITS->Clear();
101     fBackgroundTPC->Clear();
102     fBackgroundITS->Clear();
103     delete fnotIDTPC;
104     delete fnotIDITS;
105     delete fnotIDNoID;
106     delete fEfficiencyPionTPC;
107     delete fEfficiencyKaonTPC;
108     delete fEfficiencyProtonTPC;
109     delete fEfficiencyHadronTPC;
110     delete fEfficiencyPionITS;
111     delete fEfficiencyKaonITS;
112     delete fEfficiencyProtonITS;
113     delete fEfficiencyHadronITS;
114     delete fEfficiencyTPC;
115     delete fEfficiencyITS;
116     delete fBackgroundTPC;
117     delete fBackgroundITS;
118 }
119 AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g): TNamed(),
120                                                                                                 fEtaCut(g->fEtaCut)
121                                                                                               ,fAcceptanceCorrectionFull(g->fAcceptanceCorrectionFull)
122                                                                                               ,fAcceptanceCorrectionEMCAL(g->fAcceptanceCorrectionEMCAL)
123                                                                                               ,fAcceptanceCorrectionPHOS(g->fAcceptanceCorrectionPHOS)
124                                                                                               ,fNeutralCorrection(g->fNeutralCorrection)
125                                                                                               ,fNotHadronicCorrection(g->fNotHadronicCorrection)
126                                                                                               ,fpTcutCorrectionTPC(g->fpTcutCorrectionTPC)
127                                                                                               ,fpTcutCorrectionITS(g->fpTcutCorrectionITS)
128                                                                                               ,fNotIDConstTPC(g->fNotIDConstTPC)
129                                                                                               ,fNotIDConstITS(g->fNotIDConstITS)
130                                                                                               ,fNotIDConstTPCNoID(g->fNotIDConstTPCNoID)
131                                                                                               ,fNotIDConstITSNoID(g->fNotIDConstITSNoID)
132                                                                                               ,fNeutralCorrectionLow(g->fNeutralCorrectionLow)
133                                                                                               ,fNotHadronicCorrectionLow(g->fNotHadronicCorrectionLow)
134                                                                                               ,ffpTcutCorrectionTPCLow(g->ffpTcutCorrectionTPCLow)
135                                                                                               ,ffpTcutCorrectionITSLow(g->ffpTcutCorrectionITSLow)
136                                                                                               ,fNeutralCorrectionHigh(g->fNeutralCorrectionHigh)
137                                                                                               ,fNotHadronicCorrectionHigh(g->fNotHadronicCorrectionHigh)
138                                                                                               ,ffpTcutCorrectionTPCHigh(g->ffpTcutCorrectionTPCHigh)
139                                                                                               ,ffpTcutCorrectionITSHigh(g->ffpTcutCorrectionITSHigh)
140                                                                                               ,fNotIDConstTPCLow(g->fNotIDConstTPCLow)
141                                                                                               ,fNotIDConstITSLow(g->fNotIDConstITSLow)
142                                                                                               ,fNotIDConstTPCNoIDLow(g->fNotIDConstTPCNoIDLow)
143                                                                                               ,fNotIDConstITSNoIDLow(g->fNotIDConstITSNoIDLow)
144                                                                                               ,fNotIDConstTPCHigh(g->fNotIDConstTPCHigh)
145                                                                                               ,fNotIDConstITSHigh(g->fNotIDConstITSHigh)
146                                                                                               ,fNotIDConstTPCNoIDHigh(g->fNotIDConstTPCNoIDHigh)
147                                                                                               ,fNotIDConstITSNoIDHigh(g->fNotIDConstITSNoIDHigh)
148                                                                                               ,fnotIDTPC(0)
149                                                                                               ,fnotIDITS(0)
150                                                                                               ,fnotIDNoID(0)
151                                                                                               ,fEfficiencyPionTPC(0)
152                                                                                               ,fEfficiencyKaonTPC(0)
153                                                                                               ,fEfficiencyProtonTPC(0)
154                                                                                               ,fEfficiencyHadronTPC(0)
155                                                                                               ,fEfficiencyPionITS(0)
156                                                                                               ,fEfficiencyKaonITS(0)
157                                                                                               ,fEfficiencyProtonITS(0)
158                                                                                               ,fEfficiencyHadronITS(0)
159                                                                                               ,fEfficiencyTPC(0)
160                                                                                               ,fEfficiencyITS(0)
161                                                                                               ,fEfficiencyErrorLow(g->fEfficiencyErrorLow)
162                                                                                               ,fEfficiencyErrorHigh(g->fEfficiencyErrorHigh)
163                                                                                               ,fBackgroundErrorLow(g->fBackgroundErrorLow)
164                                                                                               ,fBackgroundErrorHigh(g->fBackgroundErrorHigh)
165                                                                                               ,fBackgroundTPC(0)
166                                                                                               ,fBackgroundITS(0)
167                                                                                               ,fIsEMCal(g->fIsEMCal)
168                                                                                               ,fIsData(g->fIsData)
169                                                                                               ,fDataSet(g->fDataSet)
170                                                                                               ,fProduction(g->fProduction)
171                                                                                               ,fProductionDescription(g->fProductionDescription)
172                                                                                               ,fSpectraCalcErrorCorrelation(g->fSpectraCalcErrorCorrelation)
173 {//copy constructor
174   //SetName(g->GetName());
175   fnotIDTPC = new TH1D(*(g->fnotIDTPC));
176   fnotIDITS = new TH1D(*(g->fnotIDITS));
177   fnotIDNoID = new TH1D(*(g->fnotIDNoID));
178   fEfficiencyPionTPC = new TH1D(*(g->fEfficiencyPionTPC));
179   fEfficiencyKaonTPC = new TH1D(*(g->fEfficiencyKaonTPC));
180   fEfficiencyProtonTPC = new TH1D(*(g->fEfficiencyProtonTPC));
181   fEfficiencyHadronTPC = new TH1D(*(g->fEfficiencyHadronTPC));
182   fEfficiencyPionITS = new TH1D(*(g->fEfficiencyPionITS));
183   fEfficiencyKaonITS = new TH1D(*(g->fEfficiencyKaonITS));
184   fEfficiencyProtonITS = new TH1D(*(g->fEfficiencyProtonITS));
185   fEfficiencyHadronITS = new TH1D(*(g->fEfficiencyHadronITS));
186   fEfficiencyTPC = new TObjArray(*(g->fEfficiencyTPC));
187   fEfficiencyITS = new TObjArray(*(g->fEfficiencyITS));
188   fBackgroundTPC = new TH1D(*(g->fBackgroundTPC));
189   fBackgroundITS = new TH1D(*(g->fBackgroundITS));
190 }
191
192
193 Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const {//Get the correction values that are not pt dependent
194   Float_t acceptance = 0.0;
195   Float_t neutral = 0.0;
196   Float_t ptcorr = 0.0;
197   float correction = 0.0;
198
199   //TString *type = new TString(mytype);
200
201   if(type.Contains("Full") || type.Contains("PiKP")) acceptance = fAcceptanceCorrectionFull;
202   if(type.Contains("EMCAL")) acceptance = fAcceptanceCorrectionEMCAL;
203   if(type.Contains("PHOS")) acceptance = fAcceptanceCorrectionPHOS;
204
205   if(totEt) neutral = fNotHadronicCorrection;
206   else{neutral = fNeutralCorrection;}
207   if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;}
208   else{ptcorr = fpTcutCorrectionITS;}
209
210   if(type.Contains("PiKP")){
211     if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;}
212     else{ptcorr = fpTcutCorrectionITS;}
213     if(type.Contains("High")){
214       if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;}
215       else{ptcorr = ffpTcutCorrectionITSHigh;}
216     }
217     if(type.Contains("Low")){
218       if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;}
219       else{ptcorr = ffpTcutCorrectionITSLow;}
220     }
221     neutral = 1.0;
222   }
223
224   if(type.Contains("High")){//high bound
225     if(totEt) neutral = fNotHadronicCorrectionHigh;
226     else{neutral = fNeutralCorrectionHigh;}
227     if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;}
228     else{ptcorr = ffpTcutCorrectionITSHigh;}
229     cout<<"Setting correction factor to "<<correction<<endl;
230     return correction;
231   }
232   if(type.Contains("Low")){//high bound
233     if(totEt) neutral = fNotHadronicCorrectionLow;
234     else{neutral = fNeutralCorrectionLow;}
235     if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;}
236     else{ptcorr = ffpTcutCorrectionITSLow;}
237     cout<<"Setting correction factor to "<<correction<<endl;
238     return correction;
239   }
240   
241   
242   correction = acceptance*neutral*ptcorr;
243   cout<<"correction "<<correction<<" = "<<acceptance<<"*"<<neutral<<"*"<<ptcorr<<endl;
244   cout<<"Setting correction factor for ";
245   if(totEt) cout<<"total et";
246   else{cout<<"hadronic et";}
247   cout<<" with the pt cut off "<<ptcut<<" for "<<type<<" acceptance to "<<correction<<endl;
248   //cout<<" Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl;
249   return correction;
250
251 }
252 void AliAnalysisHadEtCorrections::GetTotalEt(Float_t hadEt,Float_t hadEtErr, Bool_t isTPC, Float_t rawEmEt, Float_t rawEmEtError, Float_t scale, Float_t energyScaleError, Float_t minEt, Float_t minEtError, Float_t nonLinError, Float_t neutronCorr, Float_t neutronError, Float_t hadronCorr, Float_t hadronError, Float_t kaonCorr, Float_t kaonError, Float_t secondaryCorr, Float_t secondaryError,Float_t &totEt, Float_t &totEtError, Float_t &totEtStatError){
253   Float_t neutralFracErr = (fNeutralCorrection - fNeutralCorrectionLow)/fNeutralCorrection;
254   Float_t ptcutFracErr = (ffpTcutCorrectionTPCHigh-fpTcutCorrectionTPC)/fpTcutCorrectionTPC;
255   if(!isTPC) ptcutFracErr = (ffpTcutCorrectionITSHigh-fpTcutCorrectionITS)/fpTcutCorrectionITS;
256   Float_t pidFracErr = (fNotIDConstTPCHigh-fNotIDConstTPC)/fNotIDConstTPC;
257   if(!isTPC) pidFracErr = (fNotIDConstITSHigh-fNotIDConstITS)/fNotIDConstITS;
258   Float_t efficiencyFracErr = (fEfficiencyErrorHigh-fEfficiencyErrorLow)/2.0;
259   Float_t backgroundFracErr = (fBackgroundErrorHigh-fBackgroundErrorLow)/2.0;
260   //Float_t fracerr = TMath::Sqrt(neutralFracErr*neutralFracErr+ptcutFracErr*ptcutFracErr+pidFracErr*pidFracErr+efficiencyFracErr*efficiencyFracErr+backgroundFracErr*backgroundFracErr);
261   Float_t emEt = 0;
262   if(minEt>0){
263     emEt = scale*(rawEmEt-hadronCorr-kaonCorr-neutronCorr-secondaryCorr)/minEt;
264     totEtStatError = TMath::Sqrt(hadEtErr*hadEtErr+TMath::Power(scale*rawEmEtError/minEt,2));
265   }
266   totEt = emEt+hadEt;
267   //first add variance due to had et
268   Float_t variance = (neutralFracErr*neutralFracErr+ptcutFracErr*ptcutFracErr+pidFracErr*pidFracErr+backgroundFracErr*backgroundFracErr)*hadEt*hadEt;
269   //then add variance due to em et
270   variance += (energyScaleError*energyScaleError+minEtError/minEt*minEtError/minEt+nonLinError*nonLinError)*emEt*emEt+scale/minEt*(neutronError*neutronError+hadronError*hadronError+kaonError*kaonError+secondaryError*secondaryError);
271   //add efficiency errors separately - these are basically 100% correlated between Em ET and had Et
272   variance +=efficiencyFracErr*efficiencyFracErr*totEt*totEt;
273   //correlated errors
274 //   variance +=fSpectraCalcErrorCorrelation*neutralFracErr*hadEt*(pidFracErr*hadEt+backgroundFracErr*hadEt+scale*kaonError/minEt);
275 //   variance +=fSpectraCalcErrorCorrelation*pidFracErr*hadEt*(backgroundFracErr*hadEt+scale*kaonError/minEt+neutralFracErr*hadEt) ;
276 //   variance +=fSpectraCalcErrorCorrelation*backgroundFracErr*hadEt*(pidFracErr*hadEt+scale*kaonError/minEt+neutralFracErr*hadEt);
277 //   variance +=fSpectraCalcErrorCorrelation*scale*kaonError/minEt*(pidFracErr*hadEt+backgroundFracErr*hadEt+neutralFracErr*hadEt);
278   variance +=fSpectraCalcErrorCorrelation*neutralFracErr*hadEt*(backgroundFracErr*hadEt+scale*kaonError/minEt);
279   variance +=fSpectraCalcErrorCorrelation*backgroundFracErr*hadEt*(scale*kaonError/minEt+neutralFracErr*hadEt);
280   variance +=fSpectraCalcErrorCorrelation*scale*kaonError/minEt*(backgroundFracErr*hadEt+neutralFracErr*hadEt);
281   // cout<<"Correlated error neutral "<<neutralFracErr*hadEt<<" pid "<<pidFracErr*hadEt<<" bkgd "<<backgroundFracErr*hadEt<<" kaon "<<scale*kaonError/minEt<<endl;
282   totEtError = TMath::Sqrt(variance);
283   //cout<<"totEt "<<totEt<<endl;
284
285
286 }
287 Float_t AliAnalysisHadEtCorrections::GetSystematicErrorBound(Float_t et,Bool_t isLowBound, Bool_t isHadronic, Bool_t isTPC) const{
288   //we calculate factors for each value and then multiply them to get the overall bounds
289   //neutral corrections, pt cut, pid, efficiency, background
290
291 //   Float_t neutral = fNeutralCorrection;
292 //   if(!isHadronic) neutral = fNotHadronicCorrection;
293 //   Float_t ptcut = fpTcutCorrectionTPC;
294 //   if(!isTPC) ptcut = fpTcutCorrectionITS;
295 //   Float_t pid = fNotIDConstTPC;
296 //   Float_t efficiency = (fEfficiencyErrorHigh+fEfficiencyErrorLow)/2.0;
297 //   Float_t background = fBackground;
298
299   Float_t neutralFracErr = (fNeutralCorrection - fNeutralCorrectionLow)/fNeutralCorrection;
300   if(!isHadronic){
301     neutralFracErr = (fNotHadronicCorrection - fNotHadronicCorrectionLow)/fNotHadronicCorrection;
302   }
303   Float_t ptcutFracErr = (ffpTcutCorrectionTPCHigh-fpTcutCorrectionTPC)/fpTcutCorrectionTPC;
304   if(!isTPC){
305     ptcutFracErr = (ffpTcutCorrectionTPCHigh-fpTcutCorrectionTPC)/fpTcutCorrectionTPC;
306   }
307   Float_t pidFracErr = (fNotIDConstTPCHigh-fNotIDConstTPC)/fNotIDConstTPC;
308   Float_t efficiencyFracErr = (fEfficiencyErrorHigh-fEfficiencyErrorLow)/2.0;
309   Float_t backgroundFracErr = (fBackgroundErrorHigh-fBackgroundErrorLow)/2.0;
310   //Float_t fracerr = TMath::Sqrt(neutralFracErr*neutralFracErr+ptcutFracErr*ptcutFracErr+pidFracErr*pidFracErr+efficiencyFracErr*efficiencyFracErr+backgroundFracErr*backgroundFracErr+fSpectraCalcErrorCorrelation*(neutralFracErr*pidFracErr+neutralFracErr*backgroundFracErr+backgroundFracErr*pidFracErr));
311   Float_t fracerr = TMath::Sqrt(neutralFracErr*neutralFracErr+ptcutFracErr*ptcutFracErr+pidFracErr*pidFracErr+efficiencyFracErr*efficiencyFracErr+backgroundFracErr*backgroundFracErr+fSpectraCalcErrorCorrelation*(neutralFracErr*backgroundFracErr));
312   //cout<<"fracerrs neutral "<<neutralFracErr<<" ptcut "<<ptcutFracErr<<" pid "<<pidFracErr<<" efficiency "<<efficiencyFracErr<<" bkgd "<<backgroundFracErr<<" total fracerr "<<fracerr<<endl;
313   if(isLowBound){
314     return et*(1.0-fracerr);
315   }
316   else{
317     return et*(1.0+fracerr);
318   }
319
320 //   Float_t neutral = 1.0;
321 //   Float_t ptcut = 1.0;
322 //   Float_t pid = 1.0;
323 //   Float_t efficiency = 1.0;
324 //   Float_t background = 1.0;
325 //   if(isLowBound){//is lower bound
326 //     if(isHadronic) neutral= fNeutralCorrectionLow/fNeutralCorrection;
327 //     else{neutral = fNotHadronicCorrectionLow/fNotHadronicCorrection;}
328 //     if(isTPC) ptcut = ffpTcutCorrectionTPCLow/fpTcutCorrectionTPC;
329 //     else{ptcut = ffpTcutCorrectionITSLow/fpTcutCorrectionITS;}
330 //     pid = fNotIDConstTPCLow/fNotIDConstTPC;
331 //     efficiency = fEfficiencyErrorLow;
332 //     background = fBackgroundErrorLow;
333 //   }
334 //   else{//is higher bound
335 //     if(isHadronic) neutral= fNeutralCorrectionHigh/fNeutralCorrection;
336 //     else{neutral= fNotHadronicCorrectionHigh/fNotHadronicCorrection;}
337 //     if(isTPC) ptcut = ffpTcutCorrectionTPCHigh/fpTcutCorrectionTPC;
338 //     else{ptcut = ffpTcutCorrectionITSHigh/fpTcutCorrectionITS;}
339 //     pid = fNotIDConstTPCHigh/fNotIDConstTPC;
340 //     efficiency = fEfficiencyErrorHigh;
341 //     background = fBackgroundErrorHigh;
342 //   }
343 //   //cout<<"neutral "<<neutral<<" ptcut "<<ptcut<<" pid "<<pid<<" efficiency "<<efficiency<<" background "<<background<<" overall "<<neutral*ptcut*pid*efficiency*background<<endl;
344 //   return neutral*ptcut*pid*efficiency*background*et;
345 }
346 // AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) {
347
348 //   fEtaCut=g->fEtaCut;
349 //   fAcceptanceCorrectionFull=g->fAcceptanceCorrectionFull;
350 //   fAcceptanceCorrectionEMCAL=g->fAcceptanceCorrectionEMCAL;
351 //   fAcceptanceCorrectionPHOS=g->fAcceptanceCorrectionPHOS;
352 //   fNeutralCorrection=g->fNeutralCorrection;
353 //   fNotHadronicCorrection=g->fNotHadronicCorrection;
354 //   fpTcutCorrectionTPC=g->fpTcutCorrectionTPC;
355 //   fpTcutCorrectionITS=g->fpTcutCorrectionITS;
356 //   fNeutralCorrectionLow=g->fNeutralCorrectionLow;
357 //   fNotHadronicCorrectionLow=g->fNotHadronicCorrectionLow;
358 //   ffpTcutCorrectionTPCLow=g->ffpTcutCorrectionTPCLow;
359 //   ffpTcutCorrectionITSLow=g->ffpTcutCorrectionITSLow;
360 //   fNeutralCorrectionHigh=g->fNeutralCorrectionHigh;
361 //   fNotHadronicCorrectionHigh=g->fNotHadronicCorrectionHigh;
362 //   ffpTcutCorrectionTPCHigh=g->ffpTcutCorrectionTPCHigh;
363 //   ffpTcutCorrectionITSHigh=g->ffpTcutCorrectionITSHigh;
364
365 //   fnotIDTPC = g->fnotIDTPC;
366 //   fnotIDITS = g->fnotIDITS;
367 //   fnotIDNoID = g->fnotIDNoID;
368 //   fEfficiencyPionTPC = g->fEfficiencyPionTPC;
369 //   fEfficiencyKaonTPC = g->fEfficiencyKaonTPC;
370 //   fEfficiencyProtonTPC = g->fEfficiencyProtonTPC;
371 //   fEfficiencyHadronTPC = g->fEfficiencyHadronTPC;
372 //   fEfficiencyPionITS = g->fEfficiencyPionITS;
373 //   fEfficiencyKaonITS = g->fEfficiencyKaonITS;
374 //   fEfficiencyProtonITS = g->fEfficiencyProtonITS;
375 //   fEfficiencyHadronITS = g->fEfficiencyHadronITS;
376 //   fBackgroundTPC = g->fBackgroundTPC;
377 //   fBackgroundITS = g->fBackgroundITS;
378 // }
379 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionTPC(const int cb){//Get centrality dependent efficiency
380   if(cb==-1){return fEfficiencyPionTPC;}
381   else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));}
382 }
383 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonTPC(const int cb){//Get centrality dependent efficiency
384   if(cb==-1){return fEfficiencyKaonTPC;}
385   else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));}
386 }
387 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonTPC(const int cb){//Get centrality dependent efficiency
388   if(cb==-1){return fEfficiencyProtonTPC;}
389   else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));}
390 }
391 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronTPC(const int cb){//Get centrality dependent efficiency
392   if(cb==-1){return fEfficiencyHadronTPC;}
393   else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));}
394 }
395 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionITS(const int cb){//Get centrality dependent efficiency
396   if(cb==-1){return fEfficiencyPionITS;}
397   else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));}
398 }
399 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonITS(const int cb){//Get centrality dependent efficiency
400   if(cb==-1){return fEfficiencyKaonITS;}
401   else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));}
402 }
403 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonITS(const int cb){//Get centrality dependent efficiency
404   if(cb==-1){return fEfficiencyProtonITS;}
405   else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));}
406 }//Proton
407 TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronITS(const int cb){//Get centrality dependent efficiency
408   if(cb==-1){return fEfficiencyHadronITS;}
409   else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));}
410 }
411 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the TPC
412   float eff = -1.0;
413   if(cb ==-1){//pp
414     if(!fEfficiencyPionTPC){cerr<<"No histogram fEfficiencyPionTPC!"<<endl; return -1.0;}
415     eff = fEfficiencyPionTPC->GetBinContent(fEfficiencyPionTPC->FindBin(pT));
416     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
417   }
418   else{
419     TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
420     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionTPC%i",cb)<<endl; return -1.0;}
421     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
422     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
423   }
424   return 1.0/eff;
425 }
426 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the TPC
427   float eff = -1.0;
428   if(cb ==-1){//pp
429     if(!fEfficiencyKaonTPC){cerr<<"No histogram fEfficiencyKaonTPC!"<<endl; return -1.0;}
430     eff = fEfficiencyKaonTPC->GetBinContent(fEfficiencyKaonTPC->FindBin(pT));
431     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
432   }
433   else{
434     TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
435     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonTPC%i",cb)<<endl; return -1.0;}
436     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
437     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
438   }
439   return 1.0/eff;
440 }
441 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the TPC
442   float eff = -1.0;
443   if(cb ==-1){//pp
444     if(!fEfficiencyProtonTPC){cerr<<"No histogram fEfficiencyProtonTPC!"<<endl; return -1.0;}
445     eff = fEfficiencyProtonTPC->GetBinContent(fEfficiencyProtonTPC->FindBin(pT));
446     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
447   }
448   else{
449     TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
450     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonTPC%i",cb)<<endl; return -1.0;}
451     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
452     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
453   }
454   return 1.0/eff;
455 }
456 Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the TPC
457   float eff = -1.0;
458   if(cb ==-1){//pp
459     if(!fEfficiencyHadronTPC){cerr<<"No histogram fEfficiencyHadronTPC!"<<endl; return -1.0;}
460     eff = fEfficiencyHadronTPC->GetBinContent(fEfficiencyHadronTPC->FindBin(pT));
461     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
462   }
463   else{
464     TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
465     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronTPC%i",cb)<<endl; return -1.0;}
466     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
467     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
468   }
469   return 1.0/eff;
470 }
471 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the ITS
472   float eff = -1.0;
473   if(cb ==-1){//pp
474     if(!fEfficiencyPionITS){cerr<<"No histogram fEfficiencyPionITS!"<<endl; return -1.0;}
475     eff = fEfficiencyPionITS->GetBinContent(fEfficiencyPionITS->FindBin(pT));
476     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
477   }
478   else{
479     TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
480     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyPionITS%i",cb)<<endl; return -1.0;}
481     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
482     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
483   }
484   return 1.0/eff;
485 }
486 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the ITS
487   float eff = -1.0;
488   if(cb ==-1){//pp
489     if(!fEfficiencyKaonITS){cerr<<"No histogram fEfficiencyKaonITS!"<<endl; return -1.0;}
490     eff = fEfficiencyKaonITS->GetBinContent(fEfficiencyKaonITS->FindBin(pT));
491     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
492   }
493   else{
494     TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
495     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyKaonITS%i",cb)<<endl; return -1.0;}
496     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
497     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
498   }
499   return 1.0/eff;
500 }
501 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the ITS
502   float eff = -1.0;
503   if(cb ==-1){//pp
504     if(!fEfficiencyProtonITS){cerr<<"No histogram fEfficiencyProtonITS!"<<endl; return -1.0;}
505     eff = fEfficiencyProtonITS->GetBinContent(fEfficiencyProtonITS->FindBin(pT));
506     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
507   }
508   else{
509     TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
510     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyProtonITS%i",cb)<<endl; return -1.0;}
511     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
512     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
513   }
514   return 1.0/eff;
515 }
516 Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the ITS
517   float eff = -1.0;
518   if(cb ==-1){//pp
519     if(!fEfficiencyHadronITS){cerr<<"No histogram fEfficiencyHadronITS!"<<endl; return -1.0;}
520     eff = fEfficiencyHadronITS->GetBinContent(fEfficiencyHadronITS->FindBin(pT));
521     if(eff<=0.0){AliInfo("Efficiency is zero!");  return 0.0;}
522   }
523   else{
524     TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
525     if(!fEfficiency){cerr<<"No histogram "<<Form("fEfficiencyHadronITS%i",cb)<<endl; return -1.0;}
526     eff = fEfficiency->GetBinContent(fEfficiency->FindBin(pT));
527     if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb));  return 0.0;}
528   }
529   return 1.0/eff;
530 }
531 void AliAnalysisHadEtCorrections::SetEfficiencyPionTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
532   if(histo){
533     //first check to see if the histogram exists already
534     TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));
535     if(old){
536       fEfficiencyTPC->Remove(old);
537       delete old;
538     }
539     //then if the new histogram exists, add it to the array
540     histo->SetName(Form("fEfficiencyPionTPC%i",cb));
541     fEfficiencyTPC->Add(histo);
542   }
543   else{cerr<<"Histogram does not exist!"<<endl;}
544 }
545 void AliAnalysisHadEtCorrections::SetEfficiencyKaonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
546   if(histo){
547     //first check to see if the histogram exists already
548     TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));
549     if(old){
550       fEfficiencyTPC->Remove(old);
551       delete old;
552     }
553     //then if the new histogram exists, add it to the array
554     histo->SetName(Form("fEfficiencyKaonTPC%i",cb));
555     fEfficiencyTPC->Add(histo);
556   }
557   else{cerr<<"Histogram does not exist!"<<endl;}
558 }//Kaon
559 void AliAnalysisHadEtCorrections::SetEfficiencyProtonTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
560   if(histo){
561     //first check to see if the histogram exists already
562     TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));
563     if(old){
564       fEfficiencyTPC->Remove(old);
565       delete old;
566     }
567     //then if the new histogram exists, add it to the array
568     histo->SetName(Form("fEfficiencyProtonTPC%i",cb));
569     fEfficiencyTPC->Add(histo);
570   }
571   else{cerr<<"Histogram does not exist!"<<endl;}
572 }//Proton
573 void AliAnalysisHadEtCorrections::SetEfficiencyHadronTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
574   if(histo){
575     //first check to see if the histogram exists already
576     TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));
577     if(old){
578       fEfficiencyTPC->Remove(old);
579       delete old;
580     }
581     //then if the new histogram exists, add it to the array
582     histo->SetName(Form("fEfficiencyHadronTPC%i",cb));
583     fEfficiencyTPC->Add(histo);
584   }
585   else{cerr<<"Histogram does not exist!"<<endl;}
586 }
587 void AliAnalysisHadEtCorrections::SetEfficiencyPionITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
588   if(histo){
589     //first check to see if the histogram exists already
590     TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));
591     if(old){
592       fEfficiencyITS->Remove(old);
593       delete old;
594     }
595     //then if the new histogram exists, add it to the array
596     histo->SetName(Form("fEfficiencyPionITS%i",cb));
597     fEfficiencyITS->Add(histo);
598   }
599   else{cerr<<"Histogram does not exist!"<<endl;}
600 }
601 void AliAnalysisHadEtCorrections::SetEfficiencyKaonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
602   if(histo){
603     //first check to see if the histogram exists already
604     TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));
605     if(old){
606       fEfficiencyITS->Remove(old);
607       delete old;
608     }
609     //then if the new histogram exists, add it to the array
610     histo->SetName(Form("fEfficiencyKaonITS%i",cb));
611     fEfficiencyITS->Add(histo);
612   }
613   else{cerr<<"Histogram does not exist!"<<endl;}
614 }//Kaon
615 void AliAnalysisHadEtCorrections::SetEfficiencyProtonITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
616   if(histo){
617     //first check to see if the histogram exists already
618     TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));
619     if(old){
620       fEfficiencyITS->Remove(old);
621       delete old;
622     }
623     //then if the new histogram exists, add it to the array
624     histo->SetName(Form("fEfficiencyProtonITS%i",cb));
625     fEfficiencyITS->Add(histo);
626   }
627   else{cerr<<"Histogram does not exist!"<<endl;}
628 }//Proton
629 void AliAnalysisHadEtCorrections::SetEfficiencyHadronITS(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb
630   if(histo){
631     //first check to see if the histogram exists already
632     TH1D *old = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));
633     if(old){
634       fEfficiencyITS->Remove(old);
635       delete old;
636     }
637     //then if the new histogram exists, add it to the array
638     histo->SetName(Form("fEfficiencyHadronITS%i",cb));
639     fEfficiencyITS->Add(histo);
640   }
641   else{cerr<<"Histogram does not exist!"<<endl;}
642 }
643
644
645 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionTPC(const float pT){//get correction for unidentified particles in the TPC
646   Float_t val = fnotIDTPC->GetBinContent(fnotIDTPC->FindBin(pT));
647   if(val>0.0) return 1.0/(val);
648   else{return 0.0;}
649 }
650 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionITS(const float pT){//Get correction for unidentified particles in the ITS
651   Float_t val = fnotIDITS->GetBinContent(fnotIDITS->FindBin(pT));
652   if(val>0.0) return 1.0/(val);
653   else{return 0.0;}
654 }
655 Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionNoPID(const float pT){//Get correction for particles in the case that there is no particle identification
656   Float_t val = fnotIDNoID->GetBinContent(fnotIDNoID->FindBin(pT));
657   if(val>0.0) return 1.0/(val);
658   else{return 0.0;}
659 }
660 Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionTPC(const float pT){//Get background correction for TPC tracks
661   return (1.0-fBackgroundTPC->GetBinContent(fBackgroundTPC->FindBin(pT)));
662 }
663 Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionITS(const float pT){//Get background correction for ITS tracks
664   return (1.0-fBackgroundITS->GetBinContent(fBackgroundITS->FindBin(pT)));
665 }
666 void AliAnalysisHadEtCorrections::Report(){//Gives a report on the status of all corrections
667   //This is primarily for cross checking that the results we get from the macro that fills this class, GetCorrections.C, are sane
668   cout<<"======================================================================="<<endl;
669   cout<<"                   Report from "<<GetName()<<endl;
670   cout<<"======================================================================="<<endl;
671   cout<<fProductionDescription<<" created from "<<fProduction<<endl;
672   cout<<"This for determination of EThad from ";
673   if(fIsData) cout<<"data of ";
674   else{cout<<"simulation of ";}
675   switch(fDataSet){
676   case 2009:
677     cout<<"p+p collisions at 900 GeV"<<endl;
678     break;
679   case 2010:
680     cout<<"p+p collisions at 7 TeV"<<endl;
681     break;
682   case 2012:
683     cout<<"p+p collisions at 8 TeV"<<endl;
684     break;
685   case 2013:
686     cout<<"p+Pb collisions at 5 TeV"<<endl;
687     break;
688   case 20111:
689     cout<<"p+p collisions at 2.76 TeV"<<endl;
690     break;
691   case 20100:
692     cout<<"Pb+Pb collisions at 2.76 TeV"<<endl;
693     break;
694   default:
695     cout<<"an undetermined collision system and energy"<<endl;
696   }
697   cout<<"This is initialized for the ";
698   if(fIsEMCal) cout<<"EMCal";
699   else{cout<<"PHOS";}
700   cout<<" acceptance"<<endl<<endl;
701
702   cout<<"The acceptance correction for the full  "<<fAcceptanceCorrectionFull<<endl;
703   cout<<"                                  EMCal "<<fAcceptanceCorrectionEMCAL<<endl;
704   cout<<"                                  PHOS  "<<fAcceptanceCorrectionPHOS<<endl<<endl;
705
706   cout<<Form("The neutral energy correction is %2.4f [%2.4f,%2.4f]",fNeutralCorrection,fNeutralCorrectionLow,fNeutralCorrectionHigh)<<endl;
707   cout<<Form("    total                        %2.4f [%2.4f,%2.4f]",fNotHadronicCorrection,fNotHadronicCorrectionLow,fNotHadronicCorrectionHigh)<<endl<<endl;
708
709   cout<<Form("The pT cut correction for 100 MeV is %2.4f [%2.4f,%2.4f]",fpTcutCorrectionITS,ffpTcutCorrectionITSLow,ffpTcutCorrectionITSHigh)<<endl;
710   cout<<Form("                          150 MeV    %2.4f [%2.4f,%2.4f]",fpTcutCorrectionTPC,ffpTcutCorrectionTPCLow,ffpTcutCorrectionTPCHigh)<<endl<<endl;
711
712   cout<<Form("The correction for unidentified ITS tracks is %2.4f [%2.4f,%2.4f]",fNotIDConstITS,fNotIDConstITSLow,fNotIDConstITSHigh)<<endl;
713   cout<<Form("                                TPC tracks    %2.4f [%2.4f,%2.4f]",fNotIDConstTPC,fNotIDConstTPCLow,fNotIDConstTPCHigh)<<endl<<endl;
714
715   cout<<"Background correction histogram for ITS tracks is";
716   if(!fBackgroundITS)cout<<" not set"<<endl;
717   else{cout<<" set and has "<<fBackgroundITS->GetEntries()<<" entries"<<endl;}
718   cout<<"                                    TPC          ";
719   if(!fBackgroundTPC)cout<<" not set"<<endl;
720   else{cout<<" set and has "<<fBackgroundTPC->GetEntries()<<" entries"<<endl;}
721   cout<<endl;
722
723
724   cout<<"Efficiency histogram for ITS tracks for hadrons is";
725   if(!fEfficiencyHadronITS)cout<<" not set"<<endl;
726   else{cout<<" set and has "<<fEfficiencyHadronITS->GetEntries()<<" entries"<<endl;}
727   cout<<"                         TPC            hadrons   ";
728   if(!fEfficiencyHadronTPC)cout<<" not set"<<endl;
729   else{cout<<" set and has "<<fEfficiencyHadronTPC->GetEntries()<<" entries"<<endl;}
730   cout<<"                         ITS            pions     ";
731   if(!fEfficiencyPionITS)cout<<" not set"<<endl;
732   else{cout<<" set and has "<<fEfficiencyPionITS->GetEntries()<<" entries"<<endl;}
733   cout<<"                         TPC            pions     ";
734   if(!fEfficiencyPionTPC)cout<<" not set"<<endl;
735   else{cout<<" set and has "<<fEfficiencyPionTPC->GetEntries()<<" entries"<<endl;}
736   cout<<"                         ITS            kaons     ";
737   if(!fEfficiencyKaonITS)cout<<" not set"<<endl;
738   else{cout<<" set and has "<<fEfficiencyKaonITS->GetEntries()<<" entries"<<endl;}
739   cout<<"                         TPC            kaons     ";
740   if(!fEfficiencyKaonTPC)cout<<" not set"<<endl;
741   else{cout<<" set and has "<<fEfficiencyKaonTPC->GetEntries()<<" entries"<<endl;}
742   cout<<"                         ITS            protons   ";
743   if(!fEfficiencyProtonITS)cout<<" not set"<<endl;
744   else{cout<<" set and has "<<fEfficiencyProtonITS->GetEntries()<<" entries"<<endl;}
745   cout<<"                         TPC            protons   ";
746   if(!fEfficiencyProtonTPC)cout<<" not set"<<endl;
747   else{cout<<" set and has "<<fEfficiencyProtonTPC->GetEntries()<<" entries"<<endl;}
748   cout<<endl;
749
750   if(fDataSet==20100){//if Pb+Pb
751     cout<<"Efficiency histogram for TPC tracks for hadrons is set for centrality bins ";
752     for(int i = 0;i<=21;i++){
753       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",i));
754       if(histo) cout<<i<<" ";
755     }
756     cout<<endl;
757     cout<<"                                        pions                              ";
758     for(int i = 0;i<=21;i++){
759       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",i));
760       if(histo) cout<<i<<" ";
761     }
762     cout<<endl;
763     cout<<"                                        kaons                              ";
764     for(int i = 0;i<=21;i++){
765       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",i));
766       if(histo) cout<<i<<" ";
767     }
768     cout<<endl;
769     cout<<"                                        protons                            ";
770     for(int i = 0;i<=21;i++){
771       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",i));
772       if(histo) cout<<i<<" ";
773     }
774     cout<<endl;
775     cout<<"                         ITS            hadrons                            ";
776     for(int i = 0;i<=21;i++){
777       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",i));
778       if(histo) cout<<i<<" ";
779     }
780     cout<<endl;
781     cout<<"                                        pions                              ";
782     for(int i = 0;i<=21;i++){
783       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",i));
784       if(histo) cout<<i<<" ";
785     }
786     cout<<endl;
787     cout<<"                                        kaons                              ";
788     for(int i = 0;i<=21;i++){
789       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",i));
790       if(histo) cout<<i<<" ";
791     }
792     cout<<endl;
793     cout<<"                                        protons                            ";
794     for(int i = 0;i<=21;i++){
795       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",i));
796       if(histo) cout<<i<<" ";
797     }
798     cout<<endl;
799
800
801     int nEntries = fEfficiencyTPC->GetEntries();
802     int nbadhistograms = 0;
803     for(int i=0;i<nEntries;i++){
804       TH1D *histo = (TH1D*) fEfficiencyTPC->At(i);
805       if(!histo){
806         cout<<"Warning:  Histogram in fEfficiencyTPC at "<<i<<" is NULL!"<<endl;
807         nbadhistograms++;
808       }
809       else{
810         if(histo->GetEntries()<=1e-2){
811           cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyTPC is empty!"<<endl;
812           nbadhistograms++;
813         }
814       }
815     }
816     cout<<nbadhistograms<<" bad histograms in fEfficiencyTPC"<<endl;
817
818     nEntries = fEfficiencyITS->GetEntries();
819     nbadhistograms = 0;
820     for(int i=0;i<nEntries;i++){
821       TH1D *histo = (TH1D*) fEfficiencyITS->At(i);
822       if(!histo){
823         cout<<"Warning:  Histogram in fEfficiencyITS at "<<i<<" is NULL!"<<endl;
824         nbadhistograms++;
825       }
826       else{
827         if(histo->GetEntries()<=1e-2){
828           cout<<"Warning: Histogram "<<histo->GetName()<<" in fEfficiencyITS is empty!"<<endl;
829           nbadhistograms++;
830         }
831       }
832     }
833     cout<<nbadhistograms<<" bad histograms in fEfficiencyITS"<<endl;
834
835
836   }
837
838
839   cout<<endl;
840   cout<<"======================================================================="<<endl;
841   cout<<"======================================================================="<<endl;
842 }
843