]>
Commit | Line | Data |
---|---|---|
cf6522d1 | 1 | //Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili |
020abff0 | 2 | //University of Tennessee at Knoxville |
cf6522d1 | 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) | |
020abff0 | 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" | |
cf6522d1 | 14 | #include "TNamed.h" |
020abff0 | 15 | |
16 | using namespace std; | |
17 | ||
18 | ClassImp(AliAnalysisHadEtCorrections); | |
19 | ||
20 | ||
21 | AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections() : TNamed(), | |
22 | fEtaCut(0) | |
23 | ,fAcceptanceCorrectionFull(0) | |
24 | ,fAcceptanceCorrectionEMCAL(0) | |
25 | ,fAcceptanceCorrectionPHOS(0) | |
26 | ,fNeutralCorrection(0) | |
27 | ,fNotHadronicCorrection(0) | |
28 | ,fpTcutCorrectionTPC(0) | |
29 | ,fpTcutCorrectionITS(0) | |
30 | ,fNeutralCorrectionLow(0) | |
31 | ,fNotHadronicCorrectionLow(0) | |
32 | ,ffpTcutCorrectionTPCLow(0) | |
33 | ,ffpTcutCorrectionITSLow(0) | |
34 | ,fNeutralCorrectionHigh(0) | |
35 | ,fNotHadronicCorrectionHigh(0) | |
36 | ,ffpTcutCorrectionTPCHigh(0) | |
37 | ,ffpTcutCorrectionITSHigh(0) | |
38 | ,fnotIDTPC(0) | |
39 | ,fnotIDITS(0) | |
40 | ,fnotIDNoID(0) | |
41 | ,fEfficiencyPionTPC(0) | |
42 | ,fEfficiencyKaonTPC(0) | |
43 | ,fEfficiencyProtonTPC(0) | |
44 | ,fEfficiencyHadronTPC(0) | |
45 | ,fEfficiencyPionITS(0) | |
46 | ,fEfficiencyKaonITS(0) | |
47 | ,fEfficiencyProtonITS(0) | |
48 | ,fEfficiencyHadronITS(0) | |
49 | ,fBackgroundTPC(0) | |
50 | ,fBackgroundITS(0) | |
51 | {//default constructor | |
52 | //This seems to solve a compiler error | |
53 | cout<<"Creating new AliAnalysisHadEtCorrections"<<endl; | |
54 | ||
55 | } | |
56 | AliAnalysisHadEtCorrections::~AliAnalysisHadEtCorrections() | |
57 | {//destructor | |
58 | //Clear(); | |
951efd81 | 59 | fnotIDTPC->Clear(); |
60 | fnotIDITS->Clear(); | |
61 | fnotIDNoID->Clear(); | |
62 | fEfficiencyPionTPC->Clear(); | |
63 | fEfficiencyKaonTPC->Clear(); | |
64 | fEfficiencyProtonTPC->Clear(); | |
65 | fEfficiencyHadronTPC->Clear(); | |
66 | fEfficiencyPionITS->Clear(); | |
67 | fEfficiencyKaonITS->Clear(); | |
68 | fEfficiencyProtonITS->Clear(); | |
69 | fEfficiencyHadronITS->Clear(); | |
70 | fBackgroundTPC->Clear(); | |
71 | fBackgroundITS->Clear(); | |
020abff0 | 72 | delete fnotIDTPC; |
73 | delete fnotIDITS; | |
74 | delete fnotIDNoID; | |
75 | delete fEfficiencyPionTPC; | |
76 | delete fEfficiencyKaonTPC; | |
77 | delete fEfficiencyProtonTPC; | |
78 | delete fEfficiencyHadronTPC; | |
79 | delete fEfficiencyPionITS; | |
80 | delete fEfficiencyKaonITS; | |
81 | delete fEfficiencyProtonITS; | |
82 | delete fEfficiencyHadronITS; | |
83 | delete fBackgroundTPC; | |
84 | delete fBackgroundITS; | |
020abff0 | 85 | } |
86 | AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g): TNamed(), | |
87 | fEtaCut(g->fEtaCut) | |
88 | ,fAcceptanceCorrectionFull(g->fAcceptanceCorrectionFull) | |
89 | ,fAcceptanceCorrectionEMCAL(g->fAcceptanceCorrectionEMCAL) | |
90 | ,fAcceptanceCorrectionPHOS(g->fAcceptanceCorrectionPHOS) | |
91 | ,fNeutralCorrection(g->fNeutralCorrection) | |
92 | ,fNotHadronicCorrection(g->fNotHadronicCorrection) | |
93 | ,fpTcutCorrectionTPC(g->fpTcutCorrectionTPC) | |
94 | ,fpTcutCorrectionITS(g->fpTcutCorrectionITS) | |
95 | ,fNeutralCorrectionLow(g->fNeutralCorrectionLow) | |
96 | ,fNotHadronicCorrectionLow(g->fNotHadronicCorrectionLow) | |
97 | ,ffpTcutCorrectionTPCLow(g->ffpTcutCorrectionTPCLow) | |
98 | ,ffpTcutCorrectionITSLow(g->ffpTcutCorrectionITSLow) | |
99 | ,fNeutralCorrectionHigh(g->fNeutralCorrectionHigh) | |
100 | ,fNotHadronicCorrectionHigh(g->fNotHadronicCorrectionHigh) | |
101 | ,ffpTcutCorrectionTPCHigh(g->ffpTcutCorrectionTPCHigh) | |
102 | ,ffpTcutCorrectionITSHigh(g->ffpTcutCorrectionITSHigh) | |
103 | ,fnotIDTPC(0) | |
104 | ,fnotIDITS(0) | |
105 | ,fnotIDNoID(0) | |
106 | ,fEfficiencyPionTPC(0) | |
107 | ,fEfficiencyKaonTPC(0) | |
108 | ,fEfficiencyProtonTPC(0) | |
109 | ,fEfficiencyHadronTPC(0) | |
110 | ,fEfficiencyPionITS(0) | |
111 | ,fEfficiencyKaonITS(0) | |
112 | ,fEfficiencyProtonITS(0) | |
113 | ,fEfficiencyHadronITS(0) | |
114 | ,fBackgroundTPC(0) | |
115 | ,fBackgroundITS(0) | |
116 | {//copy constructor | |
117 | //SetName(g->GetName()); | |
118 | fnotIDTPC = new TH1D(*(g->fnotIDTPC)); | |
119 | fnotIDITS = new TH1D(*(g->fnotIDITS)); | |
120 | fnotIDNoID = new TH1D(*(g->fnotIDNoID)); | |
121 | fEfficiencyPionTPC = new TH1D(*(g->fEfficiencyPionTPC)); | |
122 | fEfficiencyKaonTPC = new TH1D(*(g->fEfficiencyKaonTPC)); | |
123 | fEfficiencyProtonTPC = new TH1D(*(g->fEfficiencyProtonTPC)); | |
124 | fEfficiencyHadronTPC = new TH1D(*(g->fEfficiencyHadronTPC)); | |
125 | fEfficiencyPionITS = new TH1D(*(g->fEfficiencyPionITS)); | |
126 | fEfficiencyKaonITS = new TH1D(*(g->fEfficiencyKaonITS)); | |
127 | fEfficiencyProtonITS = new TH1D(*(g->fEfficiencyProtonITS)); | |
128 | fEfficiencyHadronITS = new TH1D(*(g->fEfficiencyHadronITS)); | |
129 | fBackgroundTPC = new TH1D(*(g->fBackgroundTPC)); | |
130 | fBackgroundITS = new TH1D(*(g->fBackgroundITS)); | |
131 | } | |
132 | ||
3ce6b879 | 133 | |
464aa50c | 134 | Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const {//Get the correction values that are not pt dependent |
3ce6b879 | 135 | Float_t acceptance = 0.0; |
136 | Float_t neutral = 0.0; | |
137 | Float_t ptcorr = 0.0; | |
138 | float correction = 0.0; | |
139 | ||
140 | //TString *type = new TString(mytype); | |
141 | ||
142 | if(type.Contains("Full")) acceptance = fAcceptanceCorrectionFull; | |
143 | if(type.Contains("EMCAL")) acceptance = fAcceptanceCorrectionEMCAL; | |
144 | if(type.Contains("PHOS")) acceptance = fAcceptanceCorrectionPHOS; | |
145 | ||
146 | if(type.Contains("High")){//high bound | |
147 | if(totEt) neutral = fNotHadronicCorrectionHigh; | |
148 | else{neutral = fNeutralCorrectionHigh;} | |
149 | if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;} | |
150 | else{ptcorr = ffpTcutCorrectionITSHigh;} | |
151 | cout<<"Setting correction factor to "<<correction<<endl; | |
152 | return correction; | |
153 | } | |
154 | if(type.Contains("Low")){//high bound | |
155 | if(totEt) neutral = fNotHadronicCorrectionLow; | |
156 | else{neutral = fNeutralCorrectionLow;} | |
157 | if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;} | |
158 | else{ptcorr = ffpTcutCorrectionITSLow;} | |
159 | cout<<"Setting correction factor to "<<correction<<endl; | |
160 | return correction; | |
161 | } | |
162 | ||
163 | if(totEt) neutral = fNotHadronicCorrection; | |
164 | else{neutral = fNeutralCorrection;} | |
165 | if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;} | |
166 | else{ptcorr = fpTcutCorrectionITS;} | |
167 | ||
168 | correction = acceptance*neutral*ptcorr; | |
169 | cout<<"Setting correction factor for "; | |
170 | if(totEt) cout<<"total et"; | |
171 | else{cout<<"hadronic et";} | |
172 | cout<<" with the pt cut off "<<ptcut<<" for "<<type<<" acceptance to "<<correction<<endl; | |
173 | //cout<<"Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl; | |
174 | return correction; | |
175 | ||
176 | } | |
020abff0 | 177 | // AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) { |
178 | ||
179 | // fEtaCut=g->fEtaCut; | |
180 | // fAcceptanceCorrectionFull=g->fAcceptanceCorrectionFull; | |
181 | // fAcceptanceCorrectionEMCAL=g->fAcceptanceCorrectionEMCAL; | |
182 | // fAcceptanceCorrectionPHOS=g->fAcceptanceCorrectionPHOS; | |
183 | // fNeutralCorrection=g->fNeutralCorrection; | |
184 | // fNotHadronicCorrection=g->fNotHadronicCorrection; | |
185 | // fpTcutCorrectionTPC=g->fpTcutCorrectionTPC; | |
186 | // fpTcutCorrectionITS=g->fpTcutCorrectionITS; | |
187 | // fNeutralCorrectionLow=g->fNeutralCorrectionLow; | |
188 | // fNotHadronicCorrectionLow=g->fNotHadronicCorrectionLow; | |
189 | // ffpTcutCorrectionTPCLow=g->ffpTcutCorrectionTPCLow; | |
190 | // ffpTcutCorrectionITSLow=g->ffpTcutCorrectionITSLow; | |
191 | // fNeutralCorrectionHigh=g->fNeutralCorrectionHigh; | |
192 | // fNotHadronicCorrectionHigh=g->fNotHadronicCorrectionHigh; | |
193 | // ffpTcutCorrectionTPCHigh=g->ffpTcutCorrectionTPCHigh; | |
194 | // ffpTcutCorrectionITSHigh=g->ffpTcutCorrectionITSHigh; | |
195 | ||
196 | // fnotIDTPC = g->fnotIDTPC; | |
197 | // fnotIDITS = g->fnotIDITS; | |
198 | // fnotIDNoID = g->fnotIDNoID; | |
199 | // fEfficiencyPionTPC = g->fEfficiencyPionTPC; | |
200 | // fEfficiencyKaonTPC = g->fEfficiencyKaonTPC; | |
201 | // fEfficiencyProtonTPC = g->fEfficiencyProtonTPC; | |
202 | // fEfficiencyHadronTPC = g->fEfficiencyHadronTPC; | |
203 | // fEfficiencyPionITS = g->fEfficiencyPionITS; | |
204 | // fEfficiencyKaonITS = g->fEfficiencyKaonITS; | |
205 | // fEfficiencyProtonITS = g->fEfficiencyProtonITS; | |
206 | // fEfficiencyHadronITS = g->fEfficiencyHadronITS; | |
207 | // fBackgroundTPC = g->fBackgroundTPC; | |
208 | // fBackgroundITS = g->fBackgroundITS; | |
209 | // } | |
464aa50c | 210 | Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionPion(const float pT){//Get the efficiency for reconstructing a pion in the TPC |
a02dfa56 | 211 | if(!fEfficiencyPionTPC){cerr<<"No histogram fEfficiencyPionTPC!"<<endl; return -1.0;} |
212 | float eff = fEfficiencyPionTPC->GetBinContent(fEfficiencyPionTPC->FindBin(pT)); | |
213 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
214 | return 1.0/eff; | |
215 | } | |
464aa50c | 216 | Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionKaon(const float pT){//Get the efficiency for reconstructing a kaon in the TPC |
a02dfa56 | 217 | if(!fEfficiencyKaonTPC){cerr<<"No histogram fEfficiencyKaonTPC!"<<endl; return -1.0;} |
218 | float eff = fEfficiencyKaonTPC->GetBinContent(fEfficiencyKaonTPC->FindBin(pT)); | |
219 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
220 | return 1.0/eff; | |
221 | } | |
464aa50c | 222 | Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionProton(const float pT){//Get the efficiency for reconstructing a proton in the TPC |
a02dfa56 | 223 | if(!fEfficiencyProtonTPC){cerr<<"No histogram fEfficiencyProtonTPC!"<<endl; return -1.0;} |
224 | float eff = fEfficiencyProtonTPC->GetBinContent(fEfficiencyProtonTPC->FindBin(pT)); | |
225 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
226 | return 1.0/eff; | |
227 | } | |
464aa50c | 228 | Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionHadron(const float pT){//Get the efficiency for reconstructing a hadron in the TPC |
a02dfa56 | 229 | if(!fEfficiencyHadronTPC){cerr<<"No histogram fEfficiencyHadronTPC!"<<endl; return -1.0;} |
230 | float eff = fEfficiencyHadronTPC->GetBinContent(fEfficiencyHadronTPC->FindBin(pT)); | |
231 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
232 | return 1.0/eff; | |
233 | } | |
464aa50c | 234 | Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionPion(const float pT){//Get the efficiency for reconstructing a pion in the ITS |
a02dfa56 | 235 | if(!fEfficiencyPionITS){cerr<<"No histogram fEfficiencyPionITS!"<<endl; return -1.0;} |
236 | float eff = fEfficiencyPionITS->GetBinContent(fEfficiencyPionITS->FindBin(pT)); | |
237 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
238 | return 1.0/eff; | |
239 | } | |
464aa50c | 240 | Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionKaon(const float pT){//Get the efficiency for reconstructing a kaon in the ITS |
a02dfa56 | 241 | if(!fEfficiencyKaonITS){cerr<<"No histogram fEfficiencyKaonITS!"<<endl; return -1.0;} |
242 | float eff = fEfficiencyKaonITS->GetBinContent(fEfficiencyKaonITS->FindBin(pT)); | |
243 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
244 | return 1.0/eff; | |
245 | } | |
464aa50c | 246 | Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionProton(const float pT){//Get the efficiency for reconstructing a proton in the ITS |
a02dfa56 | 247 | if(!fEfficiencyProtonITS){cerr<<"No histogram fEfficiencyProtonITS!"<<endl; return -1.0;} |
248 | float eff = fEfficiencyProtonITS->GetBinContent(fEfficiencyProtonITS->FindBin(pT)); | |
249 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
250 | return 1.0/eff; | |
251 | } | |
464aa50c | 252 | Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionHadron(const float pT){//Get the efficiency for reconstructing a hadron in the ITS |
a02dfa56 | 253 | if(!fEfficiencyHadronITS){cerr<<"No histogram fEfficiencyHadronITS!"<<endl; return -1.0;} |
254 | float eff = fEfficiencyHadronITS->GetBinContent(fEfficiencyHadronITS->FindBin(pT)); | |
255 | if(eff<=0.0){cerr<<"Efficiency is zero!"<<endl; return 0.0;} | |
256 | return 1.0/eff; | |
257 | } |