]>
Commit | Line | Data |
---|---|---|
70c54bac | 1 | //////////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoCorrFctnDEtaDPhiCorrections - A correlation function that analyzes // | |
4 | // two particle correlations with respect to the azimuthal angle (phi) // | |
5 | // and pseudorapidity (eta) difference // | |
6 | // // | |
7 | // Authors: Adam Kisiel Adam.Kisiel@cern.ch // | |
8 | // // | |
9 | //////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #include "AliFemtoCorrFctnDEtaDPhiCorrections.h" | |
12 | #include "AliFemtoModelHiddenInfo.h" | |
13 | //#include "AliFemtoHisto.hh" | |
14 | #include <cstdio> | |
15 | #include <TMath.h> | |
eef80284 | 16 | #include "THn.h" |
70c54bac | 17 | |
18 | #ifdef __ROOT__ | |
19 | ClassImp(AliFemtoCorrFctnDEtaDPhiCorrections) | |
20 | #endif | |
21 | ||
22 | #define PIH 1.57079632679489656 | |
23 | #define PIT 6.28318530717958623 | |
24 | ||
2ddcfd01 | 25 | |
26 | ||
27 | ||
70c54bac | 28 | //____________________________ |
29 | AliFemtoCorrFctnDEtaDPhiCorrections::AliFemtoCorrFctnDEtaDPhiCorrections(char* title, const int& aPhiBins=20, const int& aEtaBins=20): | |
30 | AliFemtoCorrFctn(), | |
31 | fDPhiDEtaNumerator(0), | |
32 | fDPhiDEtaDenominator(0), | |
33 | fDPhiNumerator(0), | |
34 | fDPhiDenominator(0), | |
35 | fDCosNumerator(0), | |
36 | fDCosDenominator(0), | |
37 | fDoPtAnalysis(0), | |
38 | fDPhiPtNumerator(0), | |
39 | fDPhiPtDenominator(0), | |
40 | fDCosPtNumerator(0), | |
41 | fDCosPtDenominator(0), | |
42 | fPhi(0), | |
43 | fEta(0), | |
44 | fYtYtNumerator(0), | |
45 | fYtYtDenominator(0), | |
46 | fIfCorrectionHist(kNone), | |
47 | fIfCorrection(0), | |
48 | fPtCorrectionsNum(0), | |
49 | fPtCorrectionsDen(0), | |
50 | fEtaCorrectionsNum(0), | |
51 | fEtaCorrectionsDen(0), | |
52 | fCorrFactorTab(0), | |
53 | fpTab(0), | |
54 | fPartType(kNoCorrection), | |
55 | fphiL(0), | |
eef80284 | 56 | fphiT(0), |
57 | ifileCorrTab(0), | |
58 | fdoPtCorr(0), | |
59 | fdoEtaCorr(0), | |
60 | fdoPhiCorr(0), | |
61 | fdoZVertCorr(0), | |
62 | fpartType1(0), | |
63 | fpartType2(0), | |
64 | fhntReco1(0), | |
65 | fhntReco2(0), | |
66 | fh1Reco1(0), | |
67 | fh1Reco2(0), | |
68 | fh2Reco1(0), | |
69 | fh2Reco2(0), | |
70 | fh3Reco1(0), | |
71 | fh3Reco2(0), | |
72 | fhCont1(0), | |
a0179664 | 73 | fhCont2(0), |
74 | fCorr1D(kFALSE) | |
70c54bac | 75 | { |
76 | ||
77 | fphiL = (-(int)(aPhiBins/4)+0.5)*2.*TMath::Pi()/aPhiBins; | |
78 | fphiT = 2*TMath::Pi()+(-(int)(aPhiBins/4)+0.5)*2.*TMath::Pi()/aPhiBins; | |
79 | ||
80 | // set up numerator | |
81 | char tTitNumD[101] = "NumDPhiDEta"; | |
82 | strncat(tTitNumD,title, 100); | |
83 | fDPhiDEtaNumerator = new TH2D(tTitNumD,title,aPhiBins,fphiL,fphiT,aEtaBins,-2.0,2.0); | |
84 | // set up denominator | |
85 | char tTitDenD[101] = "DenDPhiDEta"; | |
86 | strncat(tTitDenD,title, 100); | |
87 | fDPhiDEtaDenominator = new TH2D(tTitDenD,title,aPhiBins,fphiL,fphiT,aEtaBins,-2.0,2.0); | |
88 | ||
89 | // set up numerator | |
90 | char tTitNumDPhi[101] = "NumDPhi"; | |
91 | strncat(tTitNumDPhi,title, 100); | |
92 | fDPhiNumerator = new TH1D(tTitNumDPhi,title,aPhiBins*2,fphiL, fphiT); | |
93 | // set up denominator | |
94 | char tTitDenDPhi[101] = "DenDPhi"; | |
95 | strncat(tTitDenDPhi,title, 100); | |
96 | fDPhiDenominator = new TH1D(tTitDenDPhi,title,aPhiBins*2,fphiL, fphiT); | |
97 | ||
98 | // set up numerator | |
99 | char tTitNumDCos[101] = "NumDCos"; | |
100 | strncat(tTitNumDCos,title, 100); | |
101 | fDCosNumerator = new TH1D(tTitNumDCos,title,aPhiBins*2,-1.0,1.0); | |
102 | // set up denominator | |
103 | char tTitDenDCos[101] = "DenDCos"; | |
104 | strncat(tTitDenDCos,title, 100); | |
105 | fDCosDenominator = new TH1D(tTitDenDCos,title,aPhiBins*2,-1.0,1.0); | |
106 | ||
107 | char tTitPhi[101] = "Phi"; | |
108 | strncat(tTitPhi,title, 100); | |
109 | fPhi = new TH1D(tTitPhi,title,90,-TMath::Pi(),TMath::Pi()); | |
110 | ||
111 | char tTitEta[101] = "Eta"; | |
112 | strncat(tTitEta,title, 100); | |
113 | fEta = new TH1D(tTitEta,title,90,-1.2,1.2); | |
114 | ||
115 | // set up numerator | |
116 | char tTitYtNum[101] = "NumYtYt"; | |
117 | strncat(tTitYtNum,title, 100); | |
118 | fYtYtNumerator = new TH2D(tTitYtNum,title,aPhiBins,1,5,aEtaBins,1,5); | |
119 | // set up denominator | |
120 | char tTitYtYtDen[101] = "DenYtYt"; | |
121 | strncat(tTitYtYtDen,title, 100); | |
122 | fYtYtDenominator = new TH2D(tTitYtYtDen,title,aPhiBins,1,5,aEtaBins,1,5); | |
123 | ||
124 | ||
125 | char tTitPtCorrectionsNum[101] = "NumpT1pT2EtaPhi"; | |
126 | strncat(tTitPtCorrectionsNum,title, 100); | |
127 | char tTitPtCorrectionsDen[101] = "DenpT1pT2EtaPhi"; | |
128 | strncat(tTitPtCorrectionsDen,title, 100); | |
129 | ||
130 | Int_t nbins[4] = {20,20,aPhiBins,aEtaBins}; | |
131 | Double_t xmin[4] = {0,0,-0.5*TMath::Pi(),-2.0}; | |
132 | Double_t xmax[4] = {4,4,1.5*TMath::Pi(),2.0}; | |
133 | ||
134 | ||
135 | fPtCorrectionsNum = new THnSparseF(tTitPtCorrectionsNum,title,4,nbins,xmin,xmax); | |
136 | fPtCorrectionsDen = new THnSparseF(tTitPtCorrectionsDen,title,4,nbins,xmin,xmax); | |
137 | ||
138 | char tTitEtaCorrectionsNum[101] = "NumEta1Eta2EtaPhi"; | |
139 | strncat(tTitEtaCorrectionsNum,title, 100); | |
140 | char tTitEtaCorrectionsDen[101] = "DenEta1Eta2EtaPhi"; | |
141 | strncat(tTitEtaCorrectionsDen,title, 100); | |
142 | ||
143 | Double_t xmineta[4] = {-1,1,-0.5*TMath::Pi(),-2.0}; | |
144 | Double_t xmaxeta[4] = {-1,1,1.5*TMath::Pi(),2.0}; | |
145 | ||
146 | fEtaCorrectionsNum = new THnSparseF(tTitEtaCorrectionsNum,title,4,nbins,xmineta,xmaxeta); | |
147 | fEtaCorrectionsDen = new THnSparseF(tTitEtaCorrectionsDen,title,4,nbins,xmineta,xmaxeta); | |
148 | ||
149 | // THnSparse(const char* name, const char* title, Int_t dim, | |
150 | // const Int_t* nbins, const Double_t* xmin, const Double_t* xmax, | |
151 | // Int_t chunksize); | |
152 | ||
153 | // to enable error bar calculation... | |
154 | fDPhiDEtaNumerator->Sumw2(); | |
155 | fDPhiDEtaDenominator->Sumw2(); | |
156 | fDPhiNumerator->Sumw2(); | |
157 | fDPhiDenominator->Sumw2(); | |
158 | fDCosNumerator->Sumw2(); | |
159 | fDCosDenominator->Sumw2(); | |
160 | fPhi->Sumw2(); | |
161 | fEta->Sumw2(); | |
162 | fYtYtNumerator->Sumw2(); | |
163 | fYtYtDenominator->Sumw2(); | |
164 | fPtCorrectionsNum->Sumw2(); | |
165 | fPtCorrectionsDen->Sumw2(); | |
166 | ||
167 | ||
168 | ||
169 | } | |
170 | ||
171 | //____________________________ | |
172 | AliFemtoCorrFctnDEtaDPhiCorrections::AliFemtoCorrFctnDEtaDPhiCorrections(const AliFemtoCorrFctnDEtaDPhiCorrections& aCorrFctn) : | |
173 | AliFemtoCorrFctn(), | |
174 | fDPhiDEtaNumerator(0), | |
175 | fDPhiDEtaDenominator(0), | |
176 | fDPhiNumerator(0), | |
177 | fDPhiDenominator(0), | |
178 | fDCosNumerator(0), | |
179 | fDCosDenominator(0), | |
180 | fDoPtAnalysis(0), | |
181 | fDPhiPtNumerator(0), | |
182 | fDPhiPtDenominator(0), | |
183 | fDCosPtNumerator(0), | |
184 | fDCosPtDenominator(0), | |
185 | fPhi(0), | |
186 | fEta(0), | |
187 | fYtYtNumerator(0), | |
188 | fYtYtDenominator(0), | |
189 | fIfCorrectionHist(kNone), | |
190 | fIfCorrection(0), | |
191 | fPtCorrectionsNum(0), | |
192 | fPtCorrectionsDen(0), | |
193 | fEtaCorrectionsNum(0), | |
194 | fEtaCorrectionsDen(0), | |
195 | fCorrFactorTab(0), | |
196 | fpTab(0), | |
197 | fPartType(kNoCorrection), | |
198 | fphiL(0), | |
eef80284 | 199 | fphiT(0), |
200 | ifileCorrTab(0), | |
201 | fdoPtCorr(0), | |
202 | fdoEtaCorr(0), | |
203 | fdoPhiCorr(0), | |
204 | fdoZVertCorr(0), | |
205 | fpartType1(0), | |
206 | fpartType2(0), | |
207 | fhntReco1(0), | |
208 | fhntReco2(0), | |
209 | fh1Reco1(0), | |
210 | fh1Reco2(0), | |
211 | fh2Reco1(0), | |
212 | fh2Reco2(0), | |
213 | fh3Reco1(0), | |
214 | fh3Reco2(0), | |
215 | fhCont1(0), | |
a0179664 | 216 | fhCont2(0), |
217 | fCorr1D(kFALSE) | |
70c54bac | 218 | { |
219 | // copy constructor | |
220 | if (aCorrFctn.fDPhiDEtaNumerator) | |
221 | fDPhiDEtaNumerator = new TH2D(*aCorrFctn.fDPhiDEtaNumerator); | |
222 | else | |
223 | fDPhiDEtaNumerator = 0; | |
224 | if (aCorrFctn.fDPhiDEtaDenominator) | |
225 | fDPhiDEtaDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
226 | else | |
227 | fDPhiDEtaDenominator = 0; | |
228 | ||
229 | if (aCorrFctn.fDPhiNumerator) | |
230 | fDPhiNumerator = new TH1D(*aCorrFctn.fDPhiNumerator); | |
231 | else | |
232 | fDPhiNumerator = 0; | |
233 | if (aCorrFctn.fDPhiDenominator) | |
234 | fDPhiDenominator = new TH1D(*aCorrFctn.fDPhiDenominator); | |
235 | else | |
236 | fDPhiDenominator = 0; | |
237 | ||
238 | if (aCorrFctn.fDCosNumerator) | |
239 | fDCosNumerator = new TH1D(*aCorrFctn.fDCosNumerator); | |
240 | else | |
241 | fDCosNumerator = 0; | |
242 | if (aCorrFctn.fDCosDenominator) | |
243 | fDCosDenominator = new TH1D(*aCorrFctn.fDCosDenominator); | |
244 | else | |
245 | fDCosDenominator = 0; | |
246 | ||
247 | if (aCorrFctn.fDPhiPtNumerator) | |
248 | fDPhiPtNumerator = new TH2D(*aCorrFctn.fDPhiPtNumerator); | |
249 | else | |
250 | fDPhiPtNumerator = 0; | |
251 | if (aCorrFctn.fDPhiPtDenominator) | |
252 | fDPhiPtDenominator = new TH2D(*aCorrFctn.fDPhiPtDenominator); | |
253 | else | |
254 | fDPhiPtDenominator = 0; | |
255 | ||
256 | if (aCorrFctn.fDCosPtNumerator) | |
257 | fDCosPtNumerator = new TH2D(*aCorrFctn.fDCosPtNumerator); | |
258 | else | |
259 | fDCosPtNumerator = 0; | |
260 | if (aCorrFctn.fDCosPtDenominator) | |
261 | fDCosPtDenominator = new TH2D(*aCorrFctn.fDCosPtDenominator); | |
262 | else | |
263 | fDCosPtDenominator = 0; | |
264 | if (aCorrFctn.fPhi) | |
265 | fPhi = new TH1D(*aCorrFctn.fPhi); | |
266 | else | |
267 | fPhi = 0; | |
268 | if (aCorrFctn.fEta) | |
269 | fEta = new TH1D(*aCorrFctn.fEta); | |
270 | else | |
271 | fEta = 0; | |
272 | ||
273 | if (aCorrFctn.fYtYtNumerator) | |
274 | fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
275 | else | |
276 | fYtYtNumerator = 0; | |
277 | ||
278 | if (aCorrFctn.fYtYtDenominator) | |
279 | fYtYtDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
280 | else | |
281 | fYtYtDenominator = 0; | |
282 | ||
283 | fphiL = aCorrFctn.fphiL; | |
284 | fphiT = aCorrFctn.fphiT; | |
285 | ||
286 | fPartType = aCorrFctn.fPartType; | |
287 | ||
288 | // if (aCorrFctn.fPtCorrectionsNum) | |
289 | // fPtCorrectionsNum = new THnSparseF(*aCorrFctn.fPtCorrectionsNum); | |
290 | // else | |
291 | // fPtCorrectionsNum = 0; | |
292 | ||
293 | // if (aCorrFctn.fPtCorrectionsDen) | |
294 | // fPtCorrectionsDen = new THnSparseF(*aCorrFctn.fPtCorrectionsDen); | |
295 | // else | |
296 | // fPtCorrectionsDen = 0; | |
297 | ||
298 | ||
299 | ||
300 | } | |
301 | //____________________________ | |
302 | AliFemtoCorrFctnDEtaDPhiCorrections::~AliFemtoCorrFctnDEtaDPhiCorrections(){ | |
303 | // destructor | |
304 | delete fDPhiDEtaNumerator; | |
305 | delete fDPhiDEtaDenominator; | |
306 | delete fDPhiNumerator; | |
307 | delete fDPhiDenominator; | |
308 | delete fDCosNumerator; | |
309 | delete fDCosDenominator; | |
310 | if (fDoPtAnalysis) { | |
311 | delete fDPhiPtNumerator; | |
312 | delete fDPhiPtDenominator; | |
313 | delete fDCosPtNumerator; | |
314 | delete fDCosPtDenominator; | |
315 | } | |
316 | delete fPhi; | |
317 | delete fEta; | |
318 | ||
319 | delete fYtYtNumerator; | |
320 | delete fYtYtDenominator; | |
321 | ||
322 | delete fPtCorrectionsNum; | |
323 | delete fPtCorrectionsDen; | |
324 | delete fEtaCorrectionsNum; | |
325 | delete fEtaCorrectionsDen; | |
eef80284 | 326 | |
327 | ||
328 | delete fhntReco1; | |
329 | delete fhntReco2; | |
330 | delete fh1Reco1; | |
331 | delete fh1Reco2; | |
332 | delete fh2Reco1; | |
333 | delete fh2Reco2; | |
334 | delete fh3Reco1; | |
335 | delete fh3Reco2; | |
336 | delete fhCont1; | |
337 | delete fhCont2; | |
70c54bac | 338 | } |
339 | //_________________________ | |
340 | AliFemtoCorrFctnDEtaDPhiCorrections& AliFemtoCorrFctnDEtaDPhiCorrections::operator=(const AliFemtoCorrFctnDEtaDPhiCorrections& aCorrFctn) | |
341 | { | |
342 | // assignment operator | |
343 | if (this == &aCorrFctn) | |
344 | return *this; | |
345 | ||
346 | if (aCorrFctn.fDPhiDEtaNumerator) | |
347 | fDPhiDEtaNumerator = new TH2D(*aCorrFctn.fDPhiDEtaNumerator); | |
348 | else | |
349 | fDPhiDEtaNumerator = 0; | |
350 | if (aCorrFctn.fDPhiDEtaDenominator) | |
351 | fDPhiDEtaDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
352 | else | |
353 | fDPhiDEtaDenominator = 0; | |
354 | ||
355 | if (aCorrFctn.fDPhiNumerator) | |
356 | fDPhiNumerator = new TH1D(*aCorrFctn.fDPhiNumerator); | |
357 | else | |
358 | fDPhiNumerator = 0; | |
359 | if (aCorrFctn.fDPhiDenominator) | |
360 | fDPhiDenominator = new TH1D(*aCorrFctn.fDPhiDenominator); | |
361 | else | |
362 | fDPhiDenominator = 0; | |
363 | ||
364 | if (aCorrFctn.fDCosNumerator) | |
365 | fDCosNumerator = new TH1D(*aCorrFctn.fDCosNumerator); | |
366 | else | |
367 | fDCosNumerator = 0; | |
368 | if (aCorrFctn.fDCosDenominator) | |
369 | fDCosDenominator = new TH1D(*aCorrFctn.fDCosDenominator); | |
370 | else | |
371 | fDCosDenominator = 0; | |
372 | ||
373 | if (aCorrFctn.fDPhiPtNumerator) | |
374 | fDPhiPtNumerator = new TH2D(*aCorrFctn.fDPhiPtNumerator); | |
375 | else | |
376 | fDPhiPtNumerator = 0; | |
377 | if (aCorrFctn.fDPhiPtDenominator) | |
378 | fDPhiPtDenominator = new TH2D(*aCorrFctn.fDPhiPtDenominator); | |
379 | else | |
380 | fDPhiPtDenominator = 0; | |
381 | ||
382 | if (aCorrFctn.fDCosPtNumerator) | |
383 | fDCosPtNumerator = new TH2D(*aCorrFctn.fDCosPtNumerator); | |
384 | else | |
385 | fDCosPtNumerator = 0; | |
386 | if (aCorrFctn.fDCosPtDenominator) | |
387 | fDCosPtDenominator = new TH2D(*aCorrFctn.fDCosPtDenominator); | |
388 | else | |
389 | fDCosPtDenominator = 0; | |
390 | if (aCorrFctn.fPhi) | |
391 | fPhi = new TH1D(*aCorrFctn.fPhi); | |
392 | else | |
393 | fPhi = 0; | |
394 | if (aCorrFctn.fEta) | |
395 | fEta = new TH1D(*aCorrFctn.fEta); | |
396 | else | |
397 | fEta = 0; | |
398 | ||
399 | if (aCorrFctn.fYtYtNumerator) | |
400 | fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
401 | else | |
402 | fYtYtNumerator = 0; | |
403 | ||
404 | if (aCorrFctn.fYtYtDenominator) | |
405 | fYtYtDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
406 | else | |
407 | fYtYtDenominator = 0; | |
408 | ||
409 | fIfCorrectionHist = kNone; | |
410 | fIfCorrection = 0; | |
411 | ||
412 | fphiL = aCorrFctn.fphiL; | |
413 | fphiT = aCorrFctn.fphiT; | |
414 | ||
415 | fPartType = aCorrFctn.fPartType; | |
416 | ||
417 | // if (aCorrFctn.fPtCorrectionsNum) | |
418 | // fPtCorrectionsNum = new THnSparseF(*aCorrFctn.fPtCorrectionsNum); | |
419 | // else | |
420 | // fPtCorrectionsNum = 0; | |
421 | ||
422 | // if (aCorrFctn.fPtCorrectionsDen) | |
423 | // fPtCorrectionsDen = new THnSparseF(*aCorrFctn.fPtCorrectionsDen); | |
424 | // else | |
425 | // fPtCorrectionsDen = 0; | |
426 | ||
427 | ||
428 | ||
429 | return *this; | |
430 | } | |
431 | //_________________________ | |
432 | void AliFemtoCorrFctnDEtaDPhiCorrections::Finish(){ | |
433 | // here is where we should normalize, fit, etc... | |
434 | // we should NOT Draw() the histos (as I had done it below), | |
435 | // since we want to insulate ourselves from root at this level | |
436 | // of the code. Do it instead at root command line with browser. | |
437 | // mShareNumerator->Draw(); | |
438 | //mShareDenominator->Draw(); | |
439 | //mRatio->Draw(); | |
440 | ||
441 | } | |
442 | ||
443 | //____________________________ | |
444 | AliFemtoString AliFemtoCorrFctnDEtaDPhiCorrections::Report(){ | |
445 | // create report | |
446 | string stemp = "TPC Ncls Correlation Function Report:\n"; | |
447 | char ctemp[100]; | |
448 | snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fDPhiDEtaNumerator->GetEntries()); | |
449 | stemp += ctemp; | |
450 | snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fDPhiDEtaDenominator->GetEntries()); | |
451 | stemp += ctemp; | |
452 | // stemp += mCoulombWeight->Report(); | |
453 | AliFemtoString returnThis = stemp; | |
454 | return returnThis; | |
455 | } | |
456 | //____________________________ | |
457 | void AliFemtoCorrFctnDEtaDPhiCorrections::AddRealPair( AliFemtoPair* pair){ | |
458 | // add real (effect) pair | |
459 | if (fPairCut) | |
460 | if (!fPairCut->Pass(pair)) return; | |
461 | ||
462 | /*double phi1 = pair->Track1()->Track()->P().Phi(); | |
463 | double phi2 = pair->Track2()->Track()->P().Phi(); | |
464 | double eta1 = pair->Track1()->Track()->P().PseudoRapidity(); | |
465 | double eta2 = pair->Track2()->Track()->P().PseudoRapidity();*/ | |
466 | ||
467 | double phi1 = pair->Track1()->FourMomentum().Phi(); | |
468 | double phi2 = pair->Track2()->FourMomentum().Phi(); | |
469 | double eta1 = pair->Track1()->FourMomentum().PseudoRapidity(); | |
470 | double eta2 = pair->Track2()->FourMomentum().PseudoRapidity(); | |
471 | ||
472 | double dphi = phi1 - phi2; | |
473 | while (dphi<fphiL) dphi+=PIT; | |
474 | while (dphi>fphiT) dphi-=PIT; | |
475 | ||
476 | double deta = eta1 - eta2; | |
477 | ||
478 | double px1 = pair->Track1()->Track()->P().x(); | |
479 | double py1 = pair->Track1()->Track()->P().y(); | |
480 | //double pz1 = pair->Track1()->Track()->P().z(); | |
481 | ||
482 | double px2 = pair->Track2()->Track()->P().x(); | |
483 | double py2 = pair->Track2()->Track()->P().y(); | |
484 | //double pz2 = pair->Track2()->Track()->P().z(); | |
485 | ||
486 | double pt1 = TMath::Hypot(px1, py1); | |
487 | double pt2 = TMath::Hypot(px2, py2); | |
488 | ||
eef80284 | 489 | double vert1[3]; |
490 | pair->Track1()->Track()->GetPrimaryVertex(vert1); | |
491 | double vert2[3]; | |
492 | pair->Track2()->Track()->GetPrimaryVertex(vert2); | |
493 | ||
70c54bac | 494 | double corrweight; |
eef80284 | 495 | //if (fIfCorrection) corrweight = CalculateCorrectionWeight(pt1, pt2); |
a0179664 | 496 | if (fIfCorrection) |
497 | { | |
498 | corrweight = CalculateCorrectionWeight(pt1, pt2, eta1, eta2, phi1, phi2, vert1[2], vert2[2]); | |
499 | } | |
500 | else if(fCorr1D) | |
501 | { | |
502 | corrweight = CalculateCorrectionWeight(pt1, pt2); | |
503 | } | |
70c54bac | 504 | /* double ptmin = pt1>pt2 ? pt2 : pt1; |
505 | ||
506 | double cosphi = (px1*px2 + py1*py2 + pz1*pz2)/ | |
507 | sqrt((px1*px1 + py1*py1 + pz1*pz1)*(px2*px2 + py2*py2 + pz2*pz2)); | |
508 | */ | |
a0179664 | 509 | if (fIfCorrection || fCorr1D) |
70c54bac | 510 | fDPhiDEtaNumerator->Fill(dphi, deta, corrweight); |
511 | else | |
512 | fDPhiDEtaNumerator->Fill(dphi, deta); | |
513 | ||
514 | fDPhiNumerator->Fill(dphi); | |
515 | // fDCosNumerator->Fill(cosphi); | |
516 | ||
517 | if (fDoPtAnalysis) { | |
518 | // fDPhiPtNumerator->Fill(dphi, ptmin); | |
519 | // fDCosPtNumerator->Fill(cosphi, ptmin); | |
520 | } | |
521 | ||
522 | fPhi->Fill(phi1); | |
523 | fEta->Fill(eta1); | |
524 | ||
525 | double PionMass = 0.13956995; | |
526 | double yt1 = TMath::Log(sqrt(1+(pt1/PionMass)*(pt1/PionMass))+(pt1/PionMass)); | |
527 | double yt2 = TMath::Log(sqrt(1+(pt2/PionMass)*(pt2/PionMass))+(pt2/PionMass)); | |
528 | fYtYtNumerator->Fill(yt1,yt2); | |
529 | ||
530 | if(fIfCorrectionHist) | |
531 | { | |
532 | if(fIfCorrectionHist == kPt){ | |
533 | Double_t val[] = {pt1,pt2,dphi,deta}; | |
534 | fPtCorrectionsNum->Fill(val); | |
535 | } | |
536 | if(fIfCorrectionHist == kEta){ | |
537 | Double_t val[] = {eta1,eta2,dphi,deta}; | |
538 | fEtaCorrectionsNum->Fill(val); | |
539 | } | |
540 | ||
541 | } | |
542 | ||
543 | } | |
544 | //____________________________ | |
545 | void AliFemtoCorrFctnDEtaDPhiCorrections::AddMixedPair( AliFemtoPair* pair){ | |
546 | // add mixed (background) pair | |
547 | if (fPairCut) | |
548 | if (!fPairCut->Pass(pair)) return; | |
549 | ||
550 | /*double phi1 = pair->Track1()->Track()->P().Phi(); | |
551 | double phi2 = pair->Track2()->Track()->P().Phi(); | |
552 | double eta1 = pair->Track1()->Track()->P().PseudoRapidity(); | |
553 | double eta2 = pair->Track2()->Track()->P().PseudoRapidity();*/ | |
554 | ||
555 | double phi1 = pair->Track1()->FourMomentum().Phi(); | |
556 | double phi2 = pair->Track2()->FourMomentum().Phi(); | |
557 | double eta1 = pair->Track1()->FourMomentum().PseudoRapidity(); | |
558 | double eta2 = pair->Track2()->FourMomentum().PseudoRapidity(); | |
559 | ||
560 | double dphi = phi1 - phi2; | |
561 | while (dphi<fphiL) dphi+=PIT; | |
562 | while (dphi>fphiT) dphi-=PIT; | |
563 | ||
564 | double deta = eta1 - eta2; | |
565 | ||
566 | double px1 = pair->Track1()->Track()->P().x(); | |
567 | double py1 = pair->Track1()->Track()->P().y(); | |
568 | //double pz1 = pair->Track1()->Track()->P().z(); | |
569 | ||
570 | double px2 = pair->Track2()->Track()->P().x(); | |
571 | double py2 = pair->Track2()->Track()->P().y(); | |
572 | //double pz2 = pair->Track2()->Track()->P().z(); | |
573 | ||
574 | double pt1 = TMath::Hypot(px1, py1); | |
575 | double pt2 = TMath::Hypot(px2, py2); | |
576 | // double ptmin = pt1>pt2 ? pt2 : pt1; | |
577 | ||
578 | // double cosphi = (px1*px2 + py1*py2 + pz1*pz2)/ | |
579 | // sqrt((px1*px1 + py1*py1 + pz1*pz1)*(px2*px2 + py2*py2 + pz2*pz2)); | |
580 | ||
581 | ||
eef80284 | 582 | double vert1[3]; |
583 | pair->Track1()->Track()->GetPrimaryVertex(vert1); | |
584 | double vert2[3]; | |
585 | pair->Track2()->Track()->GetPrimaryVertex(vert2); | |
586 | ||
70c54bac | 587 | double corrweight=-999; |
eef80284 | 588 | //if (fIfCorrection) corrweight = CalculateCorrectionWeight(pt1, pt2); |
a0179664 | 589 | if (fIfCorrection) |
590 | { | |
591 | corrweight = CalculateCorrectionWeight(pt1, pt2, eta1, eta2, phi1, phi2, vert1[2], vert2[2]); | |
592 | } | |
593 | else if(fCorr1D) | |
594 | { | |
595 | corrweight = CalculateCorrectionWeight(pt1, pt2); | |
596 | } | |
eef80284 | 597 | |
70c54bac | 598 | |
a0179664 | 599 | if(fIfCorrection || fCorr1D) |
70c54bac | 600 | fDPhiDEtaDenominator->Fill(dphi, deta, corrweight); |
601 | else | |
602 | fDPhiDEtaDenominator->Fill(dphi, deta); | |
603 | ||
604 | fDPhiDenominator->Fill(dphi); | |
605 | // fDCosDenominator->Fill(cosphi); | |
606 | ||
607 | //if (fDoPtAnalysis) { | |
608 | // fDPhiPtDenominator->Fill(dphi, ptmin); | |
609 | // fDCosPtDenominator->Fill(cosphi, ptmin); | |
610 | //} | |
611 | ||
612 | double PionMass = 0.13956995; | |
613 | double yt1 = TMath::Log(sqrt(1+(pt1/PionMass)*(pt1/PionMass))+(pt1/PionMass)); | |
614 | double yt2 = TMath::Log(sqrt(1+(pt2/PionMass)*(pt2/PionMass))+(pt2/PionMass)); | |
615 | fYtYtDenominator->Fill(yt1,yt2); | |
616 | ||
617 | if(fIfCorrectionHist) | |
618 | { | |
619 | if(fIfCorrectionHist == kPt){ | |
620 | Double_t val[] = {pt1,pt2,dphi,deta}; | |
621 | fPtCorrectionsDen->Fill(val); | |
622 | } | |
623 | if(fIfCorrectionHist == kEta){ | |
624 | Double_t val[] = {eta1,eta2,dphi,deta}; | |
625 | fEtaCorrectionsDen->Fill(val); | |
626 | } | |
627 | } | |
628 | ||
629 | } | |
630 | ||
631 | ||
632 | void AliFemtoCorrFctnDEtaDPhiCorrections::WriteHistos() | |
633 | { | |
634 | // Write out result histograms | |
635 | fDPhiDEtaNumerator->Write(); | |
636 | fDPhiDEtaDenominator->Write(); | |
637 | /*fDPhiNumerator->Write(); | |
638 | fDPhiDenominator->Write(); | |
639 | fDCosNumerator->Write(); | |
640 | fDCosDenominator->Write(); | |
641 | if (fDoPtAnalysis) { | |
642 | fDPhiPtNumerator->Write(); | |
643 | fDPhiPtDenominator->Write(); | |
644 | fDCosPtNumerator->Write(); | |
645 | fDCosPtDenominator->Write(); | |
646 | }*/ | |
647 | fPhi->Write(); | |
648 | fEta->Write(); | |
649 | ||
650 | if(fIfCorrectionHist){ | |
651 | if(fIfCorrectionHist==kPt){ | |
652 | fPtCorrectionsNum->Write(); | |
653 | fPtCorrectionsDen->Write();} | |
654 | if(fIfCorrectionHist==kEta){ | |
655 | fEtaCorrectionsNum->Write(); | |
656 | fEtaCorrectionsDen->Write();} | |
657 | } | |
658 | } | |
659 | ||
660 | TList* AliFemtoCorrFctnDEtaDPhiCorrections::GetOutputList() | |
661 | { | |
662 | // Prepare the list of objects to be written to the output | |
663 | TList *tOutputList = new TList(); | |
664 | ||
665 | tOutputList->Add(fDPhiDEtaNumerator); | |
666 | tOutputList->Add(fDPhiDEtaDenominator); | |
667 | /*tOutputList->Add(fDPhiNumerator); | |
668 | tOutputList->Add(fDPhiDenominator); | |
669 | tOutputList->Add(fDCosNumerator); | |
670 | tOutputList->Add(fDCosDenominator); | |
671 | if (fDoPtAnalysis) { | |
672 | tOutputList->Add(fDPhiPtNumerator); | |
673 | tOutputList->Add(fDPhiPtDenominator); | |
674 | tOutputList->Add(fDCosPtNumerator); | |
675 | tOutputList->Add(fDCosPtDenominator); | |
676 | }*/ | |
677 | tOutputList->Add(fPhi); | |
678 | tOutputList->Add(fEta); | |
679 | tOutputList->Add(fYtYtNumerator); | |
680 | tOutputList->Add(fYtYtDenominator); | |
681 | ||
682 | if(fIfCorrectionHist){ | |
683 | if(fIfCorrection==kPt){ | |
684 | tOutputList->Add(fPtCorrectionsNum); | |
685 | tOutputList->Add(fPtCorrectionsDen); | |
686 | } | |
687 | if(fIfCorrectionHist==kEta){ | |
688 | tOutputList->Add(fEtaCorrectionsNum); | |
689 | tOutputList->Add(fEtaCorrectionsDen); | |
690 | } | |
691 | } | |
692 | return tOutputList; | |
693 | ||
694 | } | |
695 | ||
696 | void AliFemtoCorrFctnDEtaDPhiCorrections::SetDoPtAnalysis(int do2d) | |
697 | { | |
698 | fDoPtAnalysis = do2d; | |
699 | ||
700 | int aPhiBins = fDPhiDEtaNumerator->GetNbinsX(); | |
701 | const char *title = fDPhiDEtaNumerator->GetTitle(); | |
702 | ||
703 | // set up numerator | |
704 | char tTitNumDPhiPt[101] = "NumDPhiPt"; | |
705 | strncat(tTitNumDPhiPt,title, 100); | |
706 | fDPhiPtNumerator = new TH2D(tTitNumDPhiPt,title,aPhiBins*2,-0.5*TMath::Pi(),3./2.*TMath::Pi(), 30, 0.0, 3.0); | |
707 | // set up denominator | |
708 | char tTitDenDPhiPt[101] = "DenDPhiPt"; | |
709 | strncat(tTitDenDPhiPt,title, 100); | |
710 | fDPhiPtDenominator = new TH2D(tTitDenDPhiPt,title,aPhiBins*2,-0.5*TMath::Pi(),3./2.*TMath::Pi(), 30, 0.0, 3.0); | |
711 | ||
712 | // set up numerator | |
713 | char tTitNumDCosPt[101] = "NumDCosPt"; | |
714 | strncat(tTitNumDCosPt,title, 100); | |
715 | fDCosPtNumerator = new TH2D(tTitNumDCosPt,title,aPhiBins*2,-1.0,1.0, 30, 0.0, 3.0); | |
716 | // set up denominator | |
717 | char tTitDenDCosPt[101] = "DenDCosPt"; | |
718 | strncat(tTitDenDCosPt,title, 100); | |
719 | fDCosPtDenominator = new TH2D(tTitDenDCosPt,title,aPhiBins*2,-1.0,1.0, 30, 0.0, 3.0); | |
720 | ||
721 | fDPhiPtNumerator->Sumw2(); | |
722 | fDPhiPtDenominator->Sumw2(); | |
723 | fDCosPtNumerator->Sumw2(); | |
724 | fDCosPtDenominator->Sumw2(); | |
725 | ||
726 | } | |
727 | ||
a0179664 | 728 | |
70c54bac | 729 | |
730 | void AliFemtoCorrFctnDEtaDPhiCorrections::SetDoCorrectionsHist(CorrectionType doCorr) | |
731 | { | |
732 | fIfCorrectionHist = doCorr; | |
733 | } | |
734 | ||
eef80284 | 735 | |
736 | ||
737 | void AliFemtoCorrFctnDEtaDPhiCorrections::LoadCorrectionTabFromROOTFile(const char *file, ParticleType partType1, ParticleType partType2, bool doPtCorr, bool doEtaCorr, bool doPhiCorr, bool doZVertCorr) | |
70c54bac | 738 | { |
739 | ||
a0179664 | 740 | fIfCorrection = kTRUE; |
741 | ||
eef80284 | 742 | ifileCorrTab = TFile::Open(file); |
743 | fdoPtCorr = doPtCorr; | |
744 | fdoEtaCorr = doEtaCorr; | |
745 | fdoPhiCorr = doPhiCorr; | |
746 | fdoZVertCorr = doZVertCorr; | |
747 | fpartType1 = partType1; | |
748 | fpartType2 = partType2; | |
749 | ||
750 | char type1[10]; | |
751 | char type2[10]; | |
752 | ||
753 | ||
754 | if(fpartType1==kPion) strcpy(type1,"Pion"); | |
755 | else if(fpartType1==kKaon) strcpy(type1,"Kaon"); | |
756 | else if (fpartType1==kProton)strcpy(type1,"Proton"); | |
757 | else if (fpartType1==kAll) strcpy(type1,"All"); | |
758 | else strcpy(type1,""); | |
759 | ||
760 | if(fpartType2==kPion) strcpy(type2,"Pion"); | |
761 | else if(fpartType2==kKaon) strcpy(type2,"Kaon"); | |
762 | else if (fpartType2==kProton) strcpy(type2,"Proton"); | |
763 | else if (fpartType2==kAll) strcpy(type2,"All"); | |
764 | else strcpy(type1,""); | |
765 | ||
766 | ||
767 | ||
768 | fhntReco1 = (THnT<float>*)(ifileCorrTab->Get(Form("fCorrectionMapData%s",type1)))->Clone(); | |
769 | fhntReco2 = (THnT<float>*)(ifileCorrTab->Get(Form("fCorrectionMapData%s",type2)))->Clone(); | |
770 | fhCont1 = (TH1D*)(ifileCorrTab->Get(Form("SecondariesContamination%s",type1)))->Clone(); | |
771 | fhCont2 = (TH1D*)(ifileCorrTab->Get(Form("SecondariesContamination%s",type2)))->Clone(); | |
70c54bac | 772 | |
eef80284 | 773 | double fhntReco1_nbins = fhntReco1->GetNbins(); |
774 | double fhntReco2_nbins = fhntReco2->GetNbins(); | |
775 | ||
776 | int boolSum = fdoPtCorr+fdoEtaCorr+fdoPhiCorr+fdoZVertCorr; | |
777 | /*if(boolSum == 0) | |
778 | { | |
779 | return 1; | |
780 | }*/ | |
781 | if(boolSum == 1) | |
70c54bac | 782 | { |
eef80284 | 783 | |
784 | if(fdoPtCorr == 1) | |
70c54bac | 785 | { |
eef80284 | 786 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(0))->Clone(); |
787 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(0))->Clone(); | |
788 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
789 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
790 | ||
70c54bac | 791 | } |
eef80284 | 792 | |
793 | else if(fdoEtaCorr == 1) | |
794 | { | |
795 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(1))->Clone(); | |
796 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(1))->Clone(); | |
797 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
798 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
799 | } | |
800 | ||
801 | else if(fdoPhiCorr == 1) | |
802 | { | |
803 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(2))->Clone(); | |
804 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(2))->Clone(); | |
805 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
806 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
807 | } | |
808 | ||
809 | else if(fdoZVertCorr == 1) | |
810 | { | |
811 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(3))->Clone(); | |
812 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(3))->Clone(); | |
813 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
814 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
815 | } | |
816 | ||
70c54bac | 817 | } |
eef80284 | 818 | |
819 | else if(boolSum == 2) | |
70c54bac | 820 | { |
eef80284 | 821 | if(fdoPtCorr == 1 && fdoEtaCorr == 1) |
822 | { | |
823 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(0,1))->Clone(); | |
824 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(0,1))->Clone(); | |
825 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); | |
826 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
827 | } | |
828 | ||
829 | if(fdoPtCorr == 1 && fdoPhiCorr == 1) | |
830 | { | |
831 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(0,2))->Clone(); | |
832 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(0,2))->Clone(); | |
833 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); | |
834 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
835 | } | |
836 | ||
837 | else if(fdoPtCorr == 1 && fdoZVertCorr == 1) | |
838 | { | |
839 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(0,3))->Clone(); | |
840 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(0,3))->Clone(); | |
841 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); | |
842 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
843 | } | |
844 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1) | |
845 | { | |
846 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(1,2))->Clone(); | |
847 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(1,2))->Clone(); | |
848 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); | |
849 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
850 | } | |
851 | else if(fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
852 | { | |
853 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(1,3))->Clone(); | |
854 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(1,3))->Clone(); | |
855 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); | |
856 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
857 | } | |
858 | else if(fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
859 | { | |
860 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(2,3))->Clone(); | |
861 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(2,3))->Clone(); | |
862 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); | |
863 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
864 | } | |
70c54bac | 865 | } |
70c54bac | 866 | |
eef80284 | 867 | |
868 | else if(boolSum == 3) | |
70c54bac | 869 | { |
eef80284 | 870 | if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoPhiCorr == 1) |
70c54bac | 871 | { |
eef80284 | 872 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,1,2))->Clone(); |
873 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,1,2))->Clone(); | |
874 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
875 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
876 | } | |
877 | ||
878 | else if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
879 | { | |
880 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,1,3))->Clone(); | |
881 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,1,3))->Clone(); | |
882 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
883 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
884 | } | |
885 | ||
886 | else if(fdoPtCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
887 | { | |
888 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,2,3))->Clone(); | |
889 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,2,3))->Clone(); | |
890 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
891 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
892 | } | |
893 | ||
894 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
895 | { | |
896 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(1,2,3))->Clone(); | |
897 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(1,2,3))->Clone(); | |
898 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
899 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
70c54bac | 900 | } |
901 | } | |
eef80284 | 902 | |
903 | /*else if(boolSum == 4) | |
70c54bac | 904 | { |
eef80284 | 905 | }*/ |
906 | ||
907 | ifileCorrTab->Close(); | |
908 | ||
909 | } | |
910 | ||
911 | void AliFemtoCorrFctnDEtaDPhiCorrections::LoadCorrectionTabFromROOTFile1D(const char *file, ParticleType partType1, ParticleType partType2) | |
912 | { | |
a0179664 | 913 | fCorr1D = kTRUE; |
914 | ||
eef80284 | 915 | ifileCorrTab = TFile::Open(file); |
916 | ||
917 | fpartType1 = partType1; | |
918 | fpartType2 = partType2; | |
919 | ||
920 | ||
921 | char type1[10]; | |
922 | char type2[10]; | |
923 | ||
924 | ||
925 | if(fpartType1==kPion) strcpy(type1,"Pion"); | |
926 | else if(fpartType1==kKaon) strcpy(type1,"Kaon"); | |
927 | else if (fpartType1==kProton)strcpy(type1,"Proton"); | |
928 | else if (fpartType1==kAll) strcpy(type1,"All"); | |
929 | else strcpy(type1,""); | |
930 | ||
931 | if(fpartType2==kPion) strcpy(type2,"Pion"); | |
932 | else if(fpartType2==kKaon) strcpy(type2,"Kaon"); | |
933 | else if (fpartType2==kProton) strcpy(type2,"Proton"); | |
934 | else if (fpartType2==kAll) strcpy(type2,"All"); | |
935 | else strcpy(type1,""); | |
936 | ||
937 | fhCont1 = (TH1D*)(ifileCorrTab->Get(Form("CorrectionFactorPtEffandCont%s",type1)))->Clone(); | |
938 | fhCont2 = (TH1D*)(ifileCorrTab->Get(Form("CorrectionFactorPtEffandCont%s",type2)))->Clone(); | |
939 | ||
940 | ifileCorrTab->Close(); | |
941 | ||
70c54bac | 942 | } |
943 | ||
2ddcfd01 | 944 | void AliFemtoCorrFctnDEtaDPhiCorrections::SetCorrectionTab(ParticleType partType) |
945 | { | |
946 | ||
947 | double pttab[] = {0, 0.025, 0.05, 0.075, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.325, 0.35, 0.375, 0.4, 0.425, 0.45, 0.475, 0.5, 0.525, 0.55, 0.575, 0.6, 0.625, 0.65, 0.675, 0.7, 0.725, 0.75, 0.775, 0.8, 0.825, 0.85, 0.875, 0.9, 0.925, 0.95, 0.975, 1, 1.025, 1.05, 1.075, 1.1, 1.125, 1.15, 1.175, 1.2, 1.225, 1.25, 1.275, 1.3, 1.325, 1.35, 1.375, 1.4, 1.425, 1.45, 1.475, 1.5, 1.525, 1.55, 1.575, 1.6, 1.625, 1.65, 1.675, 1.7, 1.725, 1.75, 1.775, 1.8, 1.825, 1.85, 1.875, 1.9, 1.925, 1.95, 1.975, 2, 2.025, 2.05, 2.075, 2.1, 2.125, 2.15, 2.175, 2.2, 2.225, 2.25, 2.275, 2.3, 2.325, 2.35, 2.375, 2.4, 2.425, 2.45, 2.475, 2.5, 2.525, 2.55, 2.575, 2.6, 2.625, 2.65, 2.675, 2.7, 2.725, 2.75, 2.775, 2.8, 2.825, 2.85, 2.875, 2.9, 2.925, 2.95, 2.975, 3, 3.025, 3.05, 3.075, 3.1, 3.125, 3.15, 3.175, 3.2, 3.225, 3.25, 3.275, 3.3, 3.325, 3.35, 3.375, 3.4, 3.425, 3.45, 3.475, 3.5, 3.525, 3.55, 3.575, 3.6, 3.625, 3.65, 3.675, 3.7, 3.725, 3.75, 3.775, 3.8, 3.825, 3.85, 3.875, 3.9, 3.925, 3.95, 3.975, 4, 4.025, 4.05, 4.075, 4.1, 4.125, 4.15, 4.175, 4.2, 4.225, 4.25, 4.275, 4.3, 4.325, 4.35, 4.375, 4.4, 4.425, 4.45, 4.475, 4.5, 4.525, 4.55, 4.575, 4.6, 4.625, 4.65, 4.675, 4.7, 4.725, 4.75}; | |
948 | ||
949 | double pioncorrtab[] = {0, 0, 0, 0, 0, 0, 0, 1.40089, 1.40089, 1.29482, 1.29482, 1.25595, 1.22529, 1.22529, 1.23099, 1.32027, 1.32027, 1.44774, 1.44774, 1.74645, 1.8619, 1.8619, 1.82089, 1.78506, 1.78506, 1.75918, 1.75918, 1.74951, 1.74614, 1.74614, 1.74006, 1.73229, 1.73229, 1.72844, 1.72844, 1.72306, 1.71906, 1.71906, 1.71375, 1.71301, 1.71301, 1.70381, 1.70381, 1.69975, 1.69242, 1.69242, 1.69013, 1.67698, 1.67698, 1.6772, 1.6772, 1.67118, 1.66607, 1.66607, 1.66131, 1.67228, 1.67228, 1.66834, 1.66834, 1.66031, 1.6588, 1.6588, 1.6555, 1.64923, 1.64923, 1.6467, 1.6467, 1.63894, 1.63682, 1.63682, 1.6297, 1.62904, 1.62904, 1.63007, 1.63007, 1.62832, 1.62557, 1.62557, 1.62687, 1.62928, 1.62928, 1.62767, 1.62767, 1.62767, 1.62767, 1.62767, 1.62767, 1.63415, 1.63415, 1.63415, 1.63415, 1.63415, 1.63415, 1.63415, 1.64141, 1.64141, 1.64141, 1.64141, 1.64141, 1.64141, 1.65191, 1.65191, 1.65191, 1.65191, 1.65191, 1.65191, 1.65191, 1.66838, 1.66838, 1.66838, 1.66838, 1.66838, 1.66838, 1.6839, 1.6839, 1.6839, 1.6839, 1.6839, 1.6839, 1.69601, 1.69601, 1.69601, 1.69601, 1.69601, 1.69601, 1.69601, 1.70062, 1.70062, 1.70062, 1.70062, 1.70062, 1.70062, 1.68668, 1.68668, 1.68668, 1.68668, 1.68668, 1.68668, 1.68668, 1.68182, 1.68182, 1.68182, 1.68182, 1.68182, 1.68182, 1.681, 1.681, 1.681, 1.681, 1.681, 1.681, 1.67749, 1.67749, 1.67749, 1.67749, 1.67749, 1.67749, 1.67749, 1.66558, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.64419}; | |
950 | ||
951 | double protoncorrtab[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 357.585, 357.585, 8.66944, 2.10995, 2.10995, 1.50443, 1.73168, 1.73168, 2.3605, 2.3605, 4.7726, 4.40359, 4.40359, 3.0307, 2.49649, 2.49649, 2.2231, 2.2231, 2.11247, 2.05862, 2.05862, 2.00703, 1.9623, 1.9623, 1.93393, 1.93393, 1.9101, 1.89334, 1.89334, 1.87734, 1.86342, 1.86342, 1.85075, 1.85075, 1.83985, 1.83684, 1.83684, 1.82915, 1.81832, 1.81832, 1.81215, 1.81215, 1.7998, 1.79524, 1.79524, 1.78568, 1.79989, 1.79989, 1.7973, 1.7973, 1.79591, 1.78468, 1.78468, 1.78037, 1.77394, 1.77394, 1.77198, 1.77198, 1.76736, 1.76875, 1.76875, 1.76221, 1.75729, 1.75729, 1.75397, 1.75397, 1.75229, 1.74918, 1.74918, 1.75064, 1.75643, 1.75643, 1.75765, 1.75765, 1.75765, 1.75765, 1.75765, 1.75765, 1.76345, 1.76345, 1.76345, 1.76345, 1.76345, 1.76345, 1.76345, 1.76901, 1.76901, 1.76901, 1.76901, 1.76901, 1.76901, 1.78291, 1.78291, 1.78291, 1.78291, 1.78291, 1.78291, 1.78291, 1.80009, 1.80009, 1.80009, 1.80009, 1.80009, 1.80009, 1.81064, 1.81064, 1.81064, 1.81064, 1.81064, 1.81064, 1.81765, 1.81765, 1.81765, 1.81765, 1.81765, 1.81765, 1.81765, 1.79549, 1.79549, 1.79549, 1.79549, 1.79549, 1.79549, 1.80455, 1.80455, 1.80455, 1.80455, 1.80455, 1.80455, 1.80455, 1.78912, 1.78912, 1.78912, 1.78912, 1.78912, 1.78912, 1.78501, 1.78501, 1.78501, 1.78501, 1.78501, 1.78501, 1.79512, 1.79512, 1.79512, 1.79512, 1.79512, 1.79512, 1.79512, 1.77138, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152}; | |
952 | ||
953 | double kaoncorrtab[] = {0, 0, 0, 0, 0, 0, 0, 8.43268, 8.43268, 3.30657, 3.30657, 2.5102, 2.16256, 2.16256, 2.03757, 2.27166, 2.27166, 2.70432, 2.70432, 4.06234, 4.69199, 4.69199, 4.13074, 3.75139, 3.75139, 3.48381, 3.48381, 3.29762, 3.15261, 3.15261, 3.03022, 2.91874, 2.91874, 2.82421, 2.82421, 2.7388, 2.65961, 2.65961, 2.58426, 2.5174, 2.5174, 2.45378, 2.45378, 2.39687, 2.34699, 2.34699, 2.30247, 2.25299, 2.25299, 2.22443, 2.22443, 2.18303, 2.16012, 2.16012, 2.13083, 2.12806, 2.12806, 2.11376, 2.11376, 2.09566, 2.07526, 2.07526, 2.05378, 2.03252, 2.03252, 2.02466, 2.02466, 2.00531, 1.98945, 1.98945, 1.97877, 1.97226, 1.97226, 1.95475, 1.95475, 1.94838, 1.9314, 1.9314, 1.92571, 1.96346, 1.96346, 1.92849, 1.92849, 1.92849, 1.92849, 1.92849, 1.92849, 1.90949, 1.90949, 1.90949, 1.90949, 1.90949, 1.90949, 1.90949, 1.88743, 1.88743, 1.88743, 1.88743, 1.88743, 1.88743, 1.87486, 1.87486, 1.87486, 1.87486, 1.87486, 1.87486, 1.87486, 1.87785, 1.87785, 1.87785, 1.87785, 1.87785, 1.87785, 1.8757, 1.8757, 1.8757, 1.8757, 1.8757, 1.8757, 1.87948, 1.87948, 1.87948, 1.87948, 1.87948, 1.87948, 1.87948, 1.86148, 1.86148, 1.86148, 1.86148, 1.86148, 1.86148, 1.84329, 1.84329, 1.84329, 1.84329, 1.84329, 1.84329, 1.84329, 1.83105, 1.83105, 1.83105, 1.83105, 1.83105, 1.83105, 1.81955, 1.81955, 1.81955, 1.81955, 1.81955, 1.81955, 1.79944, 1.79944, 1.79944, 1.79944, 1.79944, 1.79944, 1.79944, 1.79345, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.74958}; | |
954 | ||
955 | double allcorrtab[] = {0, 0, 0, 0, 0, 0, 0, 1.46883, 1.46883, 1.3528, 1.3528, 1.30939, 1.26936, 1.26936, 1.23645, 1.21359, 1.21359, 1.19759, 1.19759, 1.18565, 1.17772, 1.17772, 1.17203, 1.16739, 1.16739, 1.16398, 1.16398, 1.16201, 1.16065, 1.16065, 1.16012, 1.16009, 1.16009, 1.16044, 1.16044, 1.16104, 1.16139, 1.16139, 1.16134, 1.16278, 1.16278, 1.1631, 1.1631, 1.16227, 1.16152, 1.16152, 1.16066, 1.15984, 1.15984, 1.15932, 1.15932, 1.15912, 1.15818, 1.15818, 1.15877, 1.16754, 1.16754, 1.17075, 1.17075, 1.17047, 1.16995, 1.16995, 1.16885, 1.16845, 1.16845, 1.16824, 1.16824, 1.16771, 1.16704, 1.16704, 1.16681, 1.16723, 1.16723, 1.16819, 1.16819, 1.16811, 1.16974, 1.16974, 1.17217, 1.16759, 1.16759, 1.17376, 1.17376, 1.17376, 1.17376, 1.17376, 1.17376, 1.18247, 1.18247, 1.18247, 1.18247, 1.18247, 1.18247, 1.18247, 1.18916, 1.18916, 1.18916, 1.18916, 1.18916, 1.18916, 1.19649, 1.19649, 1.19649, 1.19649, 1.19649, 1.19649, 1.19649, 1.20315, 1.20315, 1.20315, 1.20315, 1.20315, 1.20315, 1.20984, 1.20984, 1.20984, 1.20984, 1.20984, 1.20984, 1.21236, 1.21236, 1.21236, 1.21236, 1.21236, 1.21236, 1.21236, 1.21272, 1.21272, 1.21272, 1.21272, 1.21272, 1.21272, 1.21416, 1.21416, 1.21416, 1.21416, 1.21416, 1.21416, 1.21416, 1.21308, 1.21308, 1.21308, 1.21308, 1.21308, 1.21308, 1.21332, 1.21332, 1.21332, 1.21332, 1.21332, 1.21332, 1.21204, 1.21204, 1.21204, 1.21204, 1.21204, 1.21204, 1.21204, 1.21006, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2066}; | |
956 | ||
957 | fpTab = new double[190]; | |
958 | for(int i=0;i<190;i++) | |
959 | fpTab[i]=pttab[i]; | |
960 | ||
961 | if(partType==kPion) | |
962 | { | |
963 | fCorrFactorTab = new double[190]; | |
964 | for(int i=0;i<190;i++) | |
965 | fCorrFactorTab[i] = pioncorrtab[i]; | |
966 | } | |
967 | else if(partType==kKaon) | |
968 | { | |
969 | fCorrFactorTab = new double[190]; | |
970 | for(int i=0;i<190;i++) | |
971 | fCorrFactorTab[i] = kaoncorrtab[i]; | |
972 | } | |
973 | else if(partType==kProton) | |
974 | { | |
975 | fCorrFactorTab = new double[190]; | |
976 | for(int i=0;i<190;i++) | |
977 | fCorrFactorTab[i] = protoncorrtab[i]; | |
978 | } | |
979 | else if(partType==kAll) | |
980 | { | |
981 | fCorrFactorTab = new double[190]; | |
982 | for(int i=0;i<190;i++) | |
983 | fCorrFactorTab[i] = allcorrtab[i]; | |
984 | } | |
985 | } | |
70c54bac | 986 | |
987 | double AliFemtoCorrFctnDEtaDPhiCorrections::CalculateCorrectionWeight(double pT1, double pT2) | |
eef80284 | 988 | { |
989 | double w1=0., w2=0.; | |
990 | if(pT1 > fhCont1->GetXaxis()->GetXmin() && pT1 < fhCont1->GetXaxis()->GetXmax() && pT2 > fhCont2->GetXaxis()->GetXmin() && pT2 < fhCont2->GetXaxis()->GetXmax()) | |
991 | { | |
992 | w1 = fhCont1->GetBinContent(fhCont1->FindFixBin(pT1)); | |
993 | w2 = fhCont2->GetBinContent(fhCont2->FindFixBin(pT2)); | |
994 | ||
995 | return w1*w2; | |
996 | } | |
997 | else | |
998 | return 0; | |
999 | } | |
1000 | ||
1001 | ||
1002 | double AliFemtoCorrFctnDEtaDPhiCorrections::CalculateCorrectionWeight(double pT1, double pT2, double eta1, double eta2, double phi1, double phi2, double zvert1, double zvert2) | |
70c54bac | 1003 | { |
1004 | ||
1005 | double w1=0., w2=0.; | |
eef80284 | 1006 | double eps1=0., eps2=0; |
1007 | double cont1=0., cont2=0; //w=(1-cont)/eps | |
3a50c5c6 | 1008 | phi1 += TMath::Pi(); |
1009 | phi2 += TMath::Pi(); | |
eef80284 | 1010 | |
1011 | if(pT1 > fhCont1->GetXaxis()->GetXmin() && pT1 < fhCont1->GetXaxis()->GetXmax() && pT2 > fhCont2->GetXaxis()->GetXmin() && pT2 < fhCont2->GetXaxis()->GetXmax()) | |
1012 | { | |
1013 | cont1 = fhCont1->GetBinContent(fhCont1->FindFixBin(pT1)); | |
1014 | cont2 = fhCont1->GetBinContent(fhCont2->FindFixBin(pT2)); | |
1015 | } | |
70c54bac | 1016 | else |
eef80284 | 1017 | return 0; |
1018 | ||
1019 | int boolSum = fdoPtCorr+fdoEtaCorr+fdoPhiCorr+fdoZVertCorr; | |
1020 | if(boolSum == 0) | |
1021 | { | |
1022 | return 1; | |
1023 | } | |
1024 | else if(boolSum == 1) | |
1025 | { | |
1026 | ||
1027 | if(fdoPtCorr == 1) | |
1028 | { | |
1029 | if(pT1 > fh1Reco1->GetXaxis()->GetXmin() && pT1 < fh1Reco1->GetXaxis()->GetXmax() && pT2 > fh1Reco2->GetXaxis()->GetXmin() && pT2 < fh1Reco2->GetXaxis()->GetXmax()) | |
1030 | { | |
1031 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(pT1)); | |
1032 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(pT2)); | |
1033 | ||
1034 | w1 = (1-cont1)/eps1; | |
1035 | w2 = (1-cont2)/eps2; | |
1036 | ||
1037 | return w1*w2; | |
1038 | } | |
1039 | else | |
1040 | return 0; | |
1041 | } | |
1042 | ||
1043 | else if(fdoEtaCorr == 1) | |
1044 | { | |
1045 | if(eta1 > fh1Reco1->GetXaxis()->GetXmin() && eta1 < fh1Reco1->GetXaxis()->GetXmax() && eta2 > fh1Reco2->GetXaxis()->GetXmin() && eta2 < fh1Reco2->GetXaxis()->GetXmax()) | |
1046 | { | |
1047 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(eta1)); | |
1048 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(eta2)); | |
1049 | ||
1050 | w1 = (1-cont1)/eps1; | |
1051 | w2 = (1-cont2)/eps2; | |
1052 | ||
1053 | return w1*w2; | |
1054 | } | |
1055 | else | |
1056 | return 0; | |
1057 | } | |
1058 | ||
1059 | else if(fdoPhiCorr == 1) | |
1060 | { | |
1061 | if(phi1 > fh1Reco1->GetXaxis()->GetXmin() && phi1 < fh1Reco1->GetXaxis()->GetXmax() && phi2 > fh1Reco2->GetXaxis()->GetXmin() && phi2 < fh1Reco2->GetXaxis()->GetXmax()) | |
1062 | { | |
1063 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(phi1)); | |
1064 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(phi2)); | |
1065 | ||
1066 | w1 = (1-cont1)/eps1; | |
1067 | w2 = (1-cont2)/eps2; | |
1068 | ||
1069 | return w1*w2; | |
1070 | } | |
1071 | else | |
1072 | return 0; | |
1073 | ||
1074 | } | |
1075 | ||
1076 | else if(fdoZVertCorr == 1) | |
1077 | { | |
1078 | if(zvert1 > fh1Reco1->GetXaxis()->GetXmin() && zvert1 < fh1Reco1->GetXaxis()->GetXmax() && zvert2 > fh1Reco2->GetXaxis()->GetXmin() && zvert2 < fh1Reco2->GetXaxis()->GetXmax()) | |
1079 | { | |
1080 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(zvert1)); | |
1081 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(zvert2)); | |
1082 | ||
1083 | w1 = (1-cont1)/eps1; | |
1084 | w2 = (1-cont2)/eps2; | |
1085 | ||
1086 | return w1*w2; | |
1087 | } | |
1088 | else | |
1089 | return 0; | |
1090 | } | |
1091 | ||
1092 | } | |
1093 | ||
1094 | else if(boolSum == 2) | |
1095 | { | |
1096 | if(fdoPtCorr == 1 && fdoEtaCorr == 1) | |
1097 | { | |
1098 | if(pT1 > fh2Reco1->GetXaxis()->GetXmin() && pT1 < fh2Reco1->GetXaxis()->GetXmax() && pT2 > fh2Reco2->GetXaxis()->GetXmin() && pT2 < fh2Reco2->GetXaxis()->GetXmax() && eta1 > fh2Reco1->GetYaxis()->GetXmin() && eta1 < fh2Reco1->GetYaxis()->GetXmax() && eta2 > fh2Reco2->GetXaxis()->GetXmin() && eta2 < fh2Reco2->GetXaxis()->GetXmax()) | |
1099 | { | |
1100 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(eta1)); | |
1101 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(eta2)); | |
1102 | ||
1103 | w1 = (1-cont1)/eps1; | |
1104 | w2 = (1-cont2)/eps2; | |
1105 | ||
1106 | return w1*w2; | |
1107 | } | |
1108 | else | |
1109 | return 0; | |
1110 | ||
1111 | } | |
1112 | ||
1113 | if(fdoPtCorr == 1 && fdoPhiCorr == 1) | |
1114 | { | |
1115 | ||
1116 | if(pT1 > fh2Reco1->GetXaxis()->GetXmin() && pT1 < fh2Reco1->GetXaxis()->GetXmax() && pT2 > fh2Reco2->GetXaxis()->GetXmin() && pT2 < fh2Reco2->GetXaxis()->GetXmax() && phi1 > fh2Reco1->GetYaxis()->GetXmin() && phi1 < fh2Reco1->GetYaxis()->GetXmax() && phi2 > fh2Reco2->GetXaxis()->GetXmin() && phi2 < fh2Reco2->GetXaxis()->GetXmax()) | |
1117 | { | |
1118 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(phi1)); | |
1119 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(phi2)); | |
1120 | ||
1121 | w1 = (1-cont1)/eps1; | |
1122 | w2 = (1-cont2)/eps2; | |
1123 | ||
1124 | return w1*w2; | |
1125 | } | |
1126 | else | |
1127 | return 0; | |
1128 | ||
1129 | } | |
1130 | ||
1131 | else if(fdoPtCorr == 1 && fdoZVertCorr == 1) | |
1132 | { | |
1133 | ||
1134 | if(pT1 > fh2Reco1->GetXaxis()->GetXmin() && pT1 < fh2Reco1->GetXaxis()->GetXmax() && pT2 > fh2Reco2->GetXaxis()->GetXmin() && pT2 < fh2Reco2->GetXaxis()->GetXmax() && zvert1 > fh2Reco1->GetYaxis()->GetXmin() && zvert1 < fh2Reco1->GetYaxis()->GetXmax() && zvert2 > fh2Reco2->GetXaxis()->GetXmin() && zvert2 < fh2Reco2->GetXaxis()->GetXmax()) | |
1135 | { | |
1136 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(zvert1)); | |
1137 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(zvert2)); | |
1138 | ||
1139 | w1 = (1-cont1)/eps1; | |
1140 | w2 = (1-cont2)/eps2; | |
1141 | ||
1142 | return w1*w2; | |
1143 | } | |
1144 | else | |
1145 | return 0; | |
1146 | } | |
1147 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1) | |
1148 | { | |
1149 | ||
1150 | if(eta1 > fh2Reco1->GetXaxis()->GetXmin() && eta1 < fh2Reco1->GetXaxis()->GetXmax() && eta2 > fh2Reco2->GetXaxis()->GetXmin() && eta2 < fh2Reco2->GetXaxis()->GetXmax() && phi1 > fh2Reco1->GetYaxis()->GetXmin() && phi1 < fh2Reco1->GetYaxis()->GetXmax() && phi2 > fh2Reco2->GetXaxis()->GetXmin() && phi2 < fh2Reco2->GetXaxis()->GetXmax()) | |
1151 | { | |
1152 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(eta1),fh2Reco1->GetYaxis()->FindFixBin(phi1)); | |
1153 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(eta2),fh2Reco2->GetYaxis()->FindFixBin(phi2)); | |
1154 | ||
1155 | w1 = (1-cont1)/eps1; | |
1156 | w2 = (1-cont2)/eps2; | |
1157 | ||
1158 | return w1*w2; | |
1159 | } | |
1160 | else | |
1161 | return 0; | |
1162 | ||
1163 | ||
1164 | } | |
1165 | else if(fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
1166 | { | |
1167 | ||
1168 | if(eta1 > fh2Reco1->GetXaxis()->GetXmin() && eta1 < fh2Reco1->GetXaxis()->GetXmax() && eta2 > fh2Reco2->GetXaxis()->GetXmin() && eta2 < fh2Reco2->GetXaxis()->GetXmax() && zvert1 > fh2Reco1->GetYaxis()->GetXmin() && zvert1 < fh2Reco1->GetYaxis()->GetXmax() && zvert2 > fh2Reco2->GetXaxis()->GetXmin() && zvert2 < fh2Reco2->GetXaxis()->GetXmax()) | |
1169 | { | |
1170 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(eta1),fh2Reco1->GetYaxis()->FindFixBin(zvert1)); | |
1171 | eps1 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(eta2),fh2Reco2->GetYaxis()->FindFixBin(zvert2)); | |
1172 | ||
1173 | ||
1174 | w1 = (1-cont1)/eps1; | |
1175 | w2 = (1-cont2)/eps2; | |
1176 | ||
1177 | return w1*w2; | |
1178 | } | |
1179 | else | |
1180 | return 0; | |
1181 | ||
1182 | } | |
1183 | else if(fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
1184 | { | |
1185 | ||
1186 | if(phi1 > fh2Reco1->GetXaxis()->GetXmin() && phi1 < fh2Reco1->GetXaxis()->GetXmax() && phi2 > fh2Reco2->GetXaxis()->GetXmin() && phi2 < fh2Reco2->GetXaxis()->GetXmax() && zvert1 > fh2Reco1->GetYaxis()->GetXmin() && zvert1 < fh2Reco1->GetYaxis()->GetXmax() && zvert2 > fh2Reco2->GetYaxis()->GetXmin() && zvert2 < fh2Reco2->GetYaxis()->GetXmax()) | |
1187 | { | |
1188 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(phi1),fh2Reco1->GetYaxis()->FindFixBin(zvert1)); | |
1189 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(phi2),fh2Reco2->GetYaxis()->FindFixBin(zvert2)); | |
1190 | ||
1191 | w1 = (1-cont1)/eps1; | |
1192 | w2 = (1-cont2)/eps2; | |
1193 | ||
1194 | return w1*w2; | |
1195 | } | |
1196 | else | |
1197 | return 0; | |
1198 | ||
1199 | } | |
1200 | } | |
1201 | ||
1202 | ||
1203 | else if(boolSum == 3) | |
1204 | { | |
1205 | if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoPhiCorr == 1) | |
1206 | { | |
1207 | if(pT1 >fh3Reco1->GetXaxis()->GetXmin() && pT1 <fh3Reco1->GetXaxis()->GetXmax() && | |
1208 | pT2 > fh3Reco2->GetXaxis()->GetXmin() && pT2 <fh3Reco2->GetXaxis()->GetXmax() && | |
1209 | eta1 > fh3Reco1->GetYaxis()->GetXmin() && eta1 <fh3Reco1->GetYaxis()->GetXmax() && | |
1210 | eta2 > fh3Reco2->GetYaxis()->GetXmin() && eta2 <fh3Reco2->GetYaxis()->GetXmax() && | |
1211 | phi1 > fh3Reco1->GetZaxis()->GetXmin() && phi1 < fh3Reco1->GetZaxis()->GetXmax() && | |
1212 | phi2 > fh3Reco2->GetZaxis()->GetXmin() && phi2 < fh3Reco2->GetZaxis()->GetXmax()) | |
1213 | { | |
1214 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(eta1),fh3Reco1->GetZaxis()->FindFixBin(phi1)); | |
1215 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(eta2),fh3Reco2->GetZaxis()->FindFixBin(phi2)); | |
1216 | ||
1217 | w1 = (1-cont1)/eps1; | |
1218 | w2 = (1-cont2)/eps2; | |
1219 | ||
1220 | return w1*w2; | |
1221 | } | |
1222 | else | |
1223 | return 0; | |
1224 | ||
1225 | ||
1226 | } | |
1227 | ||
1228 | else if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
1229 | { | |
1230 | ||
1231 | if(pT1 >fh3Reco1->GetXaxis()->GetXmin() && pT1 <fh3Reco1->GetXaxis()->GetXmax() && pT2 > fh3Reco2->GetXaxis()->GetXmin() && pT2 <fh3Reco2->GetXaxis()->GetXmax() && eta1 > fh3Reco1->GetYaxis()->GetXmin() && eta1 <fh3Reco1->GetYaxis()->GetXmax() && eta2 > fh3Reco2->GetYaxis()->GetXmin() && eta2 <fh3Reco2->GetYaxis()->GetXmax() && zvert1 > fh3Reco1->GetZaxis()->GetXmin() && zvert1 < fh3Reco1->GetZaxis()->GetXmax() && zvert2 > fh3Reco2->GetZaxis()->GetXmin() && zvert2 < fh3Reco2->GetZaxis()->GetXmax()) | |
1232 | { | |
1233 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(eta1),fh3Reco1->GetZaxis()->FindFixBin(zvert1)); | |
1234 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(eta2),fh3Reco2->GetZaxis()->FindFixBin(zvert2)); | |
1235 | ||
1236 | w1 = (1-cont1)/eps1; | |
1237 | w2 = (1-cont2)/eps2; | |
1238 | ||
1239 | return w1*w2; | |
1240 | } | |
1241 | else | |
1242 | return 0; | |
1243 | } | |
1244 | ||
1245 | else if(fdoPtCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
1246 | { | |
1247 | ||
1248 | if(pT1 >fh3Reco1->GetXaxis()->GetXmin() && pT1 <fh3Reco1->GetXaxis()->GetXmax() && pT2 > fh3Reco2->GetXaxis()->GetXmin() && pT2 <fh3Reco2->GetXaxis()->GetXmax() && phi1 > fh3Reco1->GetYaxis()->GetXmin() && phi1 <fh3Reco1->GetYaxis()->GetXmax() && phi2 > fh3Reco2->GetYaxis()->GetXmin() && phi2 <fh3Reco2->GetYaxis()->GetXmax() && zvert1 > fh3Reco1->GetZaxis()->GetXmin() && zvert1 < fh3Reco1->GetZaxis()->GetXmax() && zvert2 > fh3Reco2->GetZaxis()->GetXmin() && zvert2 < fh3Reco2->GetZaxis()->GetXmax()) | |
1249 | { | |
1250 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(phi1),fh3Reco1->GetZaxis()->FindFixBin(zvert1)); | |
1251 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(phi2),fh3Reco2->GetZaxis()->FindFixBin(zvert2)); | |
1252 | ||
1253 | w1 = (1-cont1)/eps1; | |
1254 | w2 = (1-cont2)/eps2; | |
1255 | ||
1256 | return w1*w2; | |
1257 | } | |
1258 | else | |
1259 | return 0; | |
1260 | ||
1261 | } | |
1262 | ||
1263 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
1264 | { | |
1265 | ||
1266 | if(eta1 >fh3Reco1->GetXaxis()->GetXmin() && eta1 <fh3Reco1->GetXaxis()->GetXmax() && eta2 > fh3Reco2->GetXaxis()->GetXmin() && eta2 <fh3Reco2->GetXaxis()->GetXmax() && phi1 > fh3Reco1->GetYaxis()->GetXmin() && phi1 <fh3Reco1->GetYaxis()->GetXmax() && phi2 > fh3Reco2->GetYaxis()->GetXmin() && phi2 <fh3Reco2->GetYaxis()->GetXmax() && zvert1 > fh3Reco1->GetZaxis()->GetXmin() && zvert1 < fh3Reco1->GetZaxis()->GetXmax() && zvert2 > fh3Reco2->GetZaxis()->GetXmin() && zvert2 < fh3Reco2->GetZaxis()->GetXmax()) | |
1267 | { | |
1268 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(eta1),fh3Reco1->GetYaxis()->FindFixBin(phi1),fh3Reco1->GetZaxis()->FindFixBin(zvert1)); | |
1269 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(eta2),fh3Reco2->GetYaxis()->FindFixBin(phi2),fh3Reco2->GetZaxis()->FindFixBin(zvert2)); | |
1270 | ||
1271 | w1 = (1-cont1)/eps1; | |
1272 | w2 = (1-cont2)/eps2; | |
1273 | ||
1274 | return w1*w2; | |
1275 | } | |
1276 | else | |
1277 | return 0; | |
1278 | ||
1279 | } | |
1280 | } | |
1281 | ||
1282 | else if(boolSum == 4) | |
1283 | { | |
1284 | ||
1285 | if(pT1 > fhntReco1->GetAxis(0)->GetXmin() && pT1 < fhntReco1->GetAxis(0)->GetXmax() && pT2 > fhntReco2->GetAxis(0)->GetXmin() && pT2 < fhntReco2->GetAxis(0)->GetXmax() && eta1 > fhntReco1->GetAxis(1)->GetXmin() && eta1 <fhntReco1->GetAxis(1)->GetXmax() && eta2 > fhntReco2->GetAxis(1)->GetXmin() && eta2 < fhntReco2->GetAxis(1)->GetXmax() && phi1 > fhntReco1->GetAxis(2)->GetXmin() && phi2 < fhntReco2->GetAxis(2)->GetXmax() && phi2 > fhntReco2->GetAxis(2)->GetXmin() && phi2 < fhntReco2->GetAxis(2)->GetXmax() && zvert1 > fhntReco1->GetAxis(3)->GetXmin() && zvert1 < fhntReco1->GetAxis(3)->GetXmax() && zvert2 > fhntReco2->GetAxis(3)->GetXmin() && zvert2 < fhntReco2->GetAxis(3)->GetXmax()) | |
1286 | { | |
1287 | ||
1288 | int tab1[] = {fhntReco1->GetAxis(0)->FindFixBin(pT1),fhntReco1->GetAxis(1)->FindFixBin(eta1),fhntReco1->GetAxis(2)->FindFixBin(phi1),fhntReco1->GetAxis(3)->FindFixBin(zvert1)}; | |
1289 | int tab2[] = {fhntReco2->GetAxis(0)->FindFixBin(pT2),fhntReco2->GetAxis(1)->FindFixBin(eta2),fhntReco2->GetAxis(2)->FindFixBin(phi2),fhntReco2->GetAxis(3)->FindFixBin(zvert2)}; | |
1290 | ||
1291 | eps1 = fhntReco1->GetBinContent(tab1); | |
1292 | eps2 = fhntReco2->GetBinContent(tab2); | |
1293 | ||
1294 | w1 = (1-cont1)/eps1; | |
1295 | w2 = (1-cont2)/eps2; | |
1296 | ||
1297 | return w1*w2; | |
1298 | ||
1299 | } | |
1300 | else | |
1301 | return 0; | |
1302 | ||
1303 | } | |
1304 | ||
1305 | return 0; | |
1306 | ||
70c54bac | 1307 | } |