]>
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), | |
41fa2a11 | 37 | fDoFullAnalysis(kFALSE), |
70c54bac | 38 | fPhi(0), |
39 | fEta(0), | |
40 | fYtYtNumerator(0), | |
41 | fYtYtDenominator(0), | |
70c54bac | 42 | fIfCorrection(0), |
43 | fPtCorrectionsNum(0), | |
44 | fPtCorrectionsDen(0), | |
45 | fEtaCorrectionsNum(0), | |
46 | fEtaCorrectionsDen(0), | |
47 | fCorrFactorTab(0), | |
48 | fpTab(0), | |
49 | fPartType(kNoCorrection), | |
50 | fphiL(0), | |
eef80284 | 51 | fphiT(0), |
52 | ifileCorrTab(0), | |
53 | fdoPtCorr(0), | |
54 | fdoEtaCorr(0), | |
55 | fdoPhiCorr(0), | |
56 | fdoZVertCorr(0), | |
57 | fpartType1(0), | |
58 | fpartType2(0), | |
59 | fhntReco1(0), | |
60 | fhntReco2(0), | |
61 | fh1Reco1(0), | |
62 | fh1Reco2(0), | |
63 | fh2Reco1(0), | |
64 | fh2Reco2(0), | |
65 | fh3Reco1(0), | |
66 | fh3Reco2(0), | |
67 | fhCont1(0), | |
a0179664 | 68 | fhCont2(0), |
69 | fCorr1D(kFALSE) | |
70c54bac | 70 | { |
71 | ||
72 | fphiL = (-(int)(aPhiBins/4)+0.5)*2.*TMath::Pi()/aPhiBins; | |
73 | fphiT = 2*TMath::Pi()+(-(int)(aPhiBins/4)+0.5)*2.*TMath::Pi()/aPhiBins; | |
74 | ||
75 | // set up numerator | |
76 | char tTitNumD[101] = "NumDPhiDEta"; | |
77 | strncat(tTitNumD,title, 100); | |
78 | fDPhiDEtaNumerator = new TH2D(tTitNumD,title,aPhiBins,fphiL,fphiT,aEtaBins,-2.0,2.0); | |
79 | // set up denominator | |
80 | char tTitDenD[101] = "DenDPhiDEta"; | |
81 | strncat(tTitDenD,title, 100); | |
82 | fDPhiDEtaDenominator = new TH2D(tTitDenD,title,aPhiBins,fphiL,fphiT,aEtaBins,-2.0,2.0); | |
83 | ||
70c54bac | 84 | char tTitPhi[101] = "Phi"; |
85 | strncat(tTitPhi,title, 100); | |
86 | fPhi = new TH1D(tTitPhi,title,90,-TMath::Pi(),TMath::Pi()); | |
87 | ||
88 | char tTitEta[101] = "Eta"; | |
89 | strncat(tTitEta,title, 100); | |
90 | fEta = new TH1D(tTitEta,title,90,-1.2,1.2); | |
91 | ||
70c54bac | 92 | |
70c54bac | 93 | fDPhiDEtaNumerator->Sumw2(); |
94 | fDPhiDEtaDenominator->Sumw2(); | |
70c54bac | 95 | fPhi->Sumw2(); |
96 | fEta->Sumw2(); | |
41fa2a11 | 97 | |
98 | ||
99 | ||
100 | // to enable error bar calculation... | |
101 | ||
70c54bac | 102 | |
103 | ||
104 | ||
105 | } | |
106 | ||
107 | //____________________________ | |
108 | AliFemtoCorrFctnDEtaDPhiCorrections::AliFemtoCorrFctnDEtaDPhiCorrections(const AliFemtoCorrFctnDEtaDPhiCorrections& aCorrFctn) : | |
109 | AliFemtoCorrFctn(), | |
110 | fDPhiDEtaNumerator(0), | |
111 | fDPhiDEtaDenominator(0), | |
112 | fDPhiNumerator(0), | |
113 | fDPhiDenominator(0), | |
114 | fDCosNumerator(0), | |
115 | fDCosDenominator(0), | |
41fa2a11 | 116 | fDoFullAnalysis(kFALSE), |
70c54bac | 117 | fPhi(0), |
118 | fEta(0), | |
119 | fYtYtNumerator(0), | |
120 | fYtYtDenominator(0), | |
70c54bac | 121 | fIfCorrection(0), |
122 | fPtCorrectionsNum(0), | |
123 | fPtCorrectionsDen(0), | |
124 | fEtaCorrectionsNum(0), | |
125 | fEtaCorrectionsDen(0), | |
126 | fCorrFactorTab(0), | |
127 | fpTab(0), | |
128 | fPartType(kNoCorrection), | |
129 | fphiL(0), | |
eef80284 | 130 | fphiT(0), |
131 | ifileCorrTab(0), | |
132 | fdoPtCorr(0), | |
133 | fdoEtaCorr(0), | |
134 | fdoPhiCorr(0), | |
135 | fdoZVertCorr(0), | |
136 | fpartType1(0), | |
137 | fpartType2(0), | |
138 | fhntReco1(0), | |
139 | fhntReco2(0), | |
140 | fh1Reco1(0), | |
141 | fh1Reco2(0), | |
142 | fh2Reco1(0), | |
143 | fh2Reco2(0), | |
144 | fh3Reco1(0), | |
145 | fh3Reco2(0), | |
146 | fhCont1(0), | |
a0179664 | 147 | fhCont2(0), |
148 | fCorr1D(kFALSE) | |
70c54bac | 149 | { |
150 | // copy constructor | |
151 | if (aCorrFctn.fDPhiDEtaNumerator) | |
152 | fDPhiDEtaNumerator = new TH2D(*aCorrFctn.fDPhiDEtaNumerator); | |
153 | else | |
154 | fDPhiDEtaNumerator = 0; | |
155 | if (aCorrFctn.fDPhiDEtaDenominator) | |
156 | fDPhiDEtaDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
157 | else | |
158 | fDPhiDEtaDenominator = 0; | |
159 | ||
160 | if (aCorrFctn.fDPhiNumerator) | |
161 | fDPhiNumerator = new TH1D(*aCorrFctn.fDPhiNumerator); | |
162 | else | |
163 | fDPhiNumerator = 0; | |
164 | if (aCorrFctn.fDPhiDenominator) | |
165 | fDPhiDenominator = new TH1D(*aCorrFctn.fDPhiDenominator); | |
166 | else | |
167 | fDPhiDenominator = 0; | |
168 | ||
169 | if (aCorrFctn.fDCosNumerator) | |
170 | fDCosNumerator = new TH1D(*aCorrFctn.fDCosNumerator); | |
171 | else | |
172 | fDCosNumerator = 0; | |
173 | if (aCorrFctn.fDCosDenominator) | |
174 | fDCosDenominator = new TH1D(*aCorrFctn.fDCosDenominator); | |
175 | else | |
176 | fDCosDenominator = 0; | |
177 | ||
70c54bac | 178 | if (aCorrFctn.fPhi) |
179 | fPhi = new TH1D(*aCorrFctn.fPhi); | |
180 | else | |
181 | fPhi = 0; | |
182 | if (aCorrFctn.fEta) | |
183 | fEta = new TH1D(*aCorrFctn.fEta); | |
184 | else | |
185 | fEta = 0; | |
186 | ||
187 | if (aCorrFctn.fYtYtNumerator) | |
188 | fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
189 | else | |
190 | fYtYtNumerator = 0; | |
191 | ||
192 | if (aCorrFctn.fYtYtDenominator) | |
193 | fYtYtDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
194 | else | |
195 | fYtYtDenominator = 0; | |
196 | ||
197 | fphiL = aCorrFctn.fphiL; | |
198 | fphiT = aCorrFctn.fphiT; | |
199 | ||
200 | fPartType = aCorrFctn.fPartType; | |
201 | ||
202 | // if (aCorrFctn.fPtCorrectionsNum) | |
203 | // fPtCorrectionsNum = new THnSparseF(*aCorrFctn.fPtCorrectionsNum); | |
204 | // else | |
205 | // fPtCorrectionsNum = 0; | |
206 | ||
207 | // if (aCorrFctn.fPtCorrectionsDen) | |
208 | // fPtCorrectionsDen = new THnSparseF(*aCorrFctn.fPtCorrectionsDen); | |
209 | // else | |
210 | // fPtCorrectionsDen = 0; | |
211 | ||
212 | ||
213 | ||
214 | } | |
215 | //____________________________ | |
216 | AliFemtoCorrFctnDEtaDPhiCorrections::~AliFemtoCorrFctnDEtaDPhiCorrections(){ | |
217 | // destructor | |
218 | delete fDPhiDEtaNumerator; | |
219 | delete fDPhiDEtaDenominator; | |
70c54bac | 220 | delete fPhi; |
221 | delete fEta; | |
222 | ||
41fa2a11 | 223 | if (fDoFullAnalysis) { |
224 | delete fDPhiNumerator; | |
225 | delete fDPhiDenominator; | |
226 | delete fDCosNumerator; | |
227 | delete fDCosDenominator; | |
228 | ||
229 | delete fYtYtNumerator; | |
230 | delete fYtYtDenominator; | |
231 | ||
232 | delete fPtCorrectionsNum; | |
233 | delete fPtCorrectionsDen; | |
234 | delete fEtaCorrectionsNum; | |
235 | delete fEtaCorrectionsDen; | |
236 | } | |
237 | ||
238 | //corrctions | |
239 | if(fhntReco1){ | |
240 | delete fhntReco1; | |
241 | delete fhntReco2; | |
242 | delete fhCont1; | |
243 | delete fhCont2; | |
244 | } | |
245 | if(fh1Reco1) delete fh1Reco1; | |
246 | if(fh1Reco2) delete fh1Reco2; | |
247 | if(fh2Reco1) delete fh2Reco1; | |
248 | if(fh2Reco2) delete fh2Reco2; | |
249 | if(fh3Reco1) delete fh3Reco1; | |
250 | if(fh3Reco2) delete fh3Reco2; | |
251 | ||
70c54bac | 252 | } |
253 | //_________________________ | |
254 | AliFemtoCorrFctnDEtaDPhiCorrections& AliFemtoCorrFctnDEtaDPhiCorrections::operator=(const AliFemtoCorrFctnDEtaDPhiCorrections& aCorrFctn) | |
255 | { | |
256 | // assignment operator | |
257 | if (this == &aCorrFctn) | |
258 | return *this; | |
259 | ||
260 | if (aCorrFctn.fDPhiDEtaNumerator) | |
261 | fDPhiDEtaNumerator = new TH2D(*aCorrFctn.fDPhiDEtaNumerator); | |
262 | else | |
263 | fDPhiDEtaNumerator = 0; | |
264 | if (aCorrFctn.fDPhiDEtaDenominator) | |
265 | fDPhiDEtaDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
266 | else | |
267 | fDPhiDEtaDenominator = 0; | |
268 | ||
269 | if (aCorrFctn.fDPhiNumerator) | |
270 | fDPhiNumerator = new TH1D(*aCorrFctn.fDPhiNumerator); | |
271 | else | |
272 | fDPhiNumerator = 0; | |
273 | if (aCorrFctn.fDPhiDenominator) | |
274 | fDPhiDenominator = new TH1D(*aCorrFctn.fDPhiDenominator); | |
275 | else | |
276 | fDPhiDenominator = 0; | |
277 | ||
278 | if (aCorrFctn.fDCosNumerator) | |
279 | fDCosNumerator = new TH1D(*aCorrFctn.fDCosNumerator); | |
280 | else | |
281 | fDCosNumerator = 0; | |
282 | if (aCorrFctn.fDCosDenominator) | |
283 | fDCosDenominator = new TH1D(*aCorrFctn.fDCosDenominator); | |
284 | else | |
285 | fDCosDenominator = 0; | |
286 | ||
70c54bac | 287 | if (aCorrFctn.fPhi) |
288 | fPhi = new TH1D(*aCorrFctn.fPhi); | |
289 | else | |
290 | fPhi = 0; | |
291 | if (aCorrFctn.fEta) | |
292 | fEta = new TH1D(*aCorrFctn.fEta); | |
293 | else | |
294 | fEta = 0; | |
295 | ||
296 | if (aCorrFctn.fYtYtNumerator) | |
297 | fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
298 | else | |
299 | fYtYtNumerator = 0; | |
300 | ||
301 | if (aCorrFctn.fYtYtDenominator) | |
302 | fYtYtDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator); | |
303 | else | |
304 | fYtYtDenominator = 0; | |
70c54bac | 305 | |
306 | fphiL = aCorrFctn.fphiL; | |
307 | fphiT = aCorrFctn.fphiT; | |
308 | ||
309 | fPartType = aCorrFctn.fPartType; | |
310 | ||
311 | // if (aCorrFctn.fPtCorrectionsNum) | |
312 | // fPtCorrectionsNum = new THnSparseF(*aCorrFctn.fPtCorrectionsNum); | |
313 | // else | |
314 | // fPtCorrectionsNum = 0; | |
315 | ||
316 | // if (aCorrFctn.fPtCorrectionsDen) | |
317 | // fPtCorrectionsDen = new THnSparseF(*aCorrFctn.fPtCorrectionsDen); | |
318 | // else | |
319 | // fPtCorrectionsDen = 0; | |
320 | ||
321 | ||
322 | ||
323 | return *this; | |
324 | } | |
325 | //_________________________ | |
326 | void AliFemtoCorrFctnDEtaDPhiCorrections::Finish(){ | |
327 | // here is where we should normalize, fit, etc... | |
328 | // we should NOT Draw() the histos (as I had done it below), | |
329 | // since we want to insulate ourselves from root at this level | |
330 | // of the code. Do it instead at root command line with browser. | |
331 | // mShareNumerator->Draw(); | |
332 | //mShareDenominator->Draw(); | |
333 | //mRatio->Draw(); | |
334 | ||
335 | } | |
336 | ||
337 | //____________________________ | |
338 | AliFemtoString AliFemtoCorrFctnDEtaDPhiCorrections::Report(){ | |
339 | // create report | |
340 | string stemp = "TPC Ncls Correlation Function Report:\n"; | |
341 | char ctemp[100]; | |
342 | snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fDPhiDEtaNumerator->GetEntries()); | |
343 | stemp += ctemp; | |
344 | snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fDPhiDEtaDenominator->GetEntries()); | |
345 | stemp += ctemp; | |
346 | // stemp += mCoulombWeight->Report(); | |
347 | AliFemtoString returnThis = stemp; | |
348 | return returnThis; | |
349 | } | |
350 | //____________________________ | |
351 | void AliFemtoCorrFctnDEtaDPhiCorrections::AddRealPair( AliFemtoPair* pair){ | |
352 | // add real (effect) pair | |
353 | if (fPairCut) | |
354 | if (!fPairCut->Pass(pair)) return; | |
355 | ||
356 | /*double phi1 = pair->Track1()->Track()->P().Phi(); | |
41fa2a11 | 357 | double phi2 = pair->Track2()->Track()->P().Phi(); |
358 | double eta1 = pair->Track1()->Track()->P().PseudoRapidity(); | |
359 | double eta2 = pair->Track2()->Track()->P().PseudoRapidity();*/ | |
70c54bac | 360 | |
361 | double phi1 = pair->Track1()->FourMomentum().Phi(); | |
362 | double phi2 = pair->Track2()->FourMomentum().Phi(); | |
363 | double eta1 = pair->Track1()->FourMomentum().PseudoRapidity(); | |
364 | double eta2 = pair->Track2()->FourMomentum().PseudoRapidity(); | |
365 | ||
366 | double dphi = phi1 - phi2; | |
367 | while (dphi<fphiL) dphi+=PIT; | |
368 | while (dphi>fphiT) dphi-=PIT; | |
369 | ||
370 | double deta = eta1 - eta2; | |
371 | ||
41fa2a11 | 372 | double px1 = pair->Track1()->Track()->P().x(); |
373 | double py1 = pair->Track1()->Track()->P().y(); | |
374 | //double pz1 = pair->Track1()->Track()->P().z(); | |
70c54bac | 375 | |
41fa2a11 | 376 | double px2 = pair->Track2()->Track()->P().x(); |
377 | double py2 = pair->Track2()->Track()->P().y(); | |
378 | //double pz2 = pair->Track2()->Track()->P().z(); | |
70c54bac | 379 | |
41fa2a11 | 380 | double pt1 = TMath::Hypot(px1, py1); |
381 | double pt2 = TMath::Hypot(px2, py2); | |
70c54bac | 382 | |
41fa2a11 | 383 | double vert1[3]; |
384 | pair->Track1()->Track()->GetPrimaryVertex(vert1); | |
385 | double vert2[3]; | |
386 | pair->Track2()->Track()->GetPrimaryVertex(vert2); | |
eef80284 | 387 | |
41fa2a11 | 388 | double corrweight=0; |
389 | //if (fIfCorrection) corrweight = CalculateCorrectionWeight(pt1, pt2); | |
a0179664 | 390 | if (fIfCorrection) |
391 | { | |
392 | corrweight = CalculateCorrectionWeight(pt1, pt2, eta1, eta2, phi1, phi2, vert1[2], vert2[2]); | |
393 | } | |
394 | else if(fCorr1D) | |
395 | { | |
396 | corrweight = CalculateCorrectionWeight(pt1, pt2); | |
397 | } | |
41fa2a11 | 398 | /* double ptmin = pt1>pt2 ? pt2 : pt1; |
70c54bac | 399 | |
41fa2a11 | 400 | double cosphi = (px1*px2 + py1*py2 + pz1*pz2)/ |
401 | sqrt((px1*px1 + py1*py1 + pz1*pz1)*(px2*px2 + py2*py2 + pz2*pz2)); | |
402 | */ | |
403 | if (fIfCorrection || fCorr1D) | |
404 | fDPhiDEtaNumerator->Fill(dphi, deta, corrweight); | |
405 | else | |
406 | fDPhiDEtaNumerator->Fill(dphi, deta); | |
407 | ||
408 | ||
409 | if (fDoFullAnalysis) { | |
410 | //fDPhiPtNumerator->Fill(dphi, ptmin); | |
411 | //fDCosPtNumerator->Fill(cosphi, ptmin); | |
70c54bac | 412 | |
41fa2a11 | 413 | fDPhiNumerator->Fill(dphi); |
414 | //fDCosNumerator->Fill(cosphi); | |
415 | double PionMass = 0.13956995; | |
416 | double yt1 = TMath::Log(sqrt(1+(pt1/PionMass)*(pt1/PionMass))+(pt1/PionMass)); | |
417 | double yt2 = TMath::Log(sqrt(1+(pt2/PionMass)*(pt2/PionMass))+(pt2/PionMass)); | |
418 | fYtYtNumerator->Fill(yt1,yt2); | |
70c54bac | 419 | |
70c54bac | 420 | } |
421 | ||
422 | fPhi->Fill(phi1); | |
423 | fEta->Fill(eta1); | |
424 | ||
70c54bac | 425 | |
426 | } | |
427 | //____________________________ | |
428 | void AliFemtoCorrFctnDEtaDPhiCorrections::AddMixedPair( AliFemtoPair* pair){ | |
429 | // add mixed (background) pair | |
430 | if (fPairCut) | |
431 | if (!fPairCut->Pass(pair)) return; | |
432 | ||
433 | /*double phi1 = pair->Track1()->Track()->P().Phi(); | |
41fa2a11 | 434 | double phi2 = pair->Track2()->Track()->P().Phi(); |
435 | double eta1 = pair->Track1()->Track()->P().PseudoRapidity(); | |
436 | double eta2 = pair->Track2()->Track()->P().PseudoRapidity();*/ | |
70c54bac | 437 | |
438 | double phi1 = pair->Track1()->FourMomentum().Phi(); | |
439 | double phi2 = pair->Track2()->FourMomentum().Phi(); | |
440 | double eta1 = pair->Track1()->FourMomentum().PseudoRapidity(); | |
441 | double eta2 = pair->Track2()->FourMomentum().PseudoRapidity(); | |
442 | ||
443 | double dphi = phi1 - phi2; | |
444 | while (dphi<fphiL) dphi+=PIT; | |
445 | while (dphi>fphiT) dphi-=PIT; | |
446 | ||
447 | double deta = eta1 - eta2; | |
448 | ||
41fa2a11 | 449 | double px1 = pair->Track1()->Track()->P().x(); |
450 | double py1 = pair->Track1()->Track()->P().y(); | |
451 | //double pz1 = pair->Track1()->Track()->P().z(); | |
70c54bac | 452 | |
41fa2a11 | 453 | double px2 = pair->Track2()->Track()->P().x(); |
454 | double py2 = pair->Track2()->Track()->P().y(); | |
455 | //double pz2 = pair->Track2()->Track()->P().z(); | |
70c54bac | 456 | |
41fa2a11 | 457 | double pt1 = TMath::Hypot(px1, py1); |
458 | double pt2 = TMath::Hypot(px2, py2); | |
459 | // double ptmin = pt1>pt2 ? pt2 : pt1; | |
70c54bac | 460 | |
41fa2a11 | 461 | // double cosphi = (px1*px2 + py1*py2 + pz1*pz2)/ |
462 | // sqrt((px1*px1 + py1*py1 + pz1*pz1)*(px2*px2 + py2*py2 + pz2*pz2)); | |
70c54bac | 463 | |
464 | ||
eef80284 | 465 | double vert1[3]; |
41fa2a11 | 466 | pair->Track1()->Track()->GetPrimaryVertex(vert1); |
467 | double vert2[3]; | |
468 | pair->Track2()->Track()->GetPrimaryVertex(vert2); | |
eef80284 | 469 | |
41fa2a11 | 470 | double corrweight=-999; |
471 | //if (fIfCorrection) corrweight = CalculateCorrectionWeight(pt1, pt2); | |
a0179664 | 472 | if (fIfCorrection) |
473 | { | |
474 | corrweight = CalculateCorrectionWeight(pt1, pt2, eta1, eta2, phi1, phi2, vert1[2], vert2[2]); | |
475 | } | |
476 | else if(fCorr1D) | |
477 | { | |
478 | corrweight = CalculateCorrectionWeight(pt1, pt2); | |
479 | } | |
eef80284 | 480 | |
70c54bac | 481 | |
41fa2a11 | 482 | if(fIfCorrection || fCorr1D) |
483 | fDPhiDEtaDenominator->Fill(dphi, deta, corrweight); | |
484 | else | |
485 | fDPhiDEtaDenominator->Fill(dphi, deta); | |
70c54bac | 486 | |
41fa2a11 | 487 | if (fDoFullAnalysis) { |
488 | //fDPhiPtDenominator->Fill(dphi, ptmin); | |
489 | //fDCosPtDenominator->Fill(cosphi, ptmin); | |
490 | fDPhiDenominator->Fill(dphi); | |
70c54bac | 491 | |
41fa2a11 | 492 | double PionMass = 0.13956995; |
70c54bac | 493 | double yt1 = TMath::Log(sqrt(1+(pt1/PionMass)*(pt1/PionMass))+(pt1/PionMass)); |
494 | double yt2 = TMath::Log(sqrt(1+(pt2/PionMass)*(pt2/PionMass))+(pt2/PionMass)); | |
495 | fYtYtDenominator->Fill(yt1,yt2); | |
496 | ||
41fa2a11 | 497 | } |
70c54bac | 498 | } |
499 | ||
500 | ||
501 | void AliFemtoCorrFctnDEtaDPhiCorrections::WriteHistos() | |
502 | { | |
503 | // Write out result histograms | |
504 | fDPhiDEtaNumerator->Write(); | |
505 | fDPhiDEtaDenominator->Write(); | |
506 | /*fDPhiNumerator->Write(); | |
507 | fDPhiDenominator->Write(); | |
508 | fDCosNumerator->Write(); | |
509 | fDCosDenominator->Write(); | |
41fa2a11 | 510 | if (fDoFullAnalysis) { |
70c54bac | 511 | fDPhiPtNumerator->Write(); |
512 | fDPhiPtDenominator->Write(); | |
513 | fDCosPtNumerator->Write(); | |
514 | fDCosPtDenominator->Write(); | |
515 | }*/ | |
516 | fPhi->Write(); | |
517 | fEta->Write(); | |
518 | ||
70c54bac | 519 | } |
520 | ||
521 | TList* AliFemtoCorrFctnDEtaDPhiCorrections::GetOutputList() | |
522 | { | |
523 | // Prepare the list of objects to be written to the output | |
524 | TList *tOutputList = new TList(); | |
525 | ||
526 | tOutputList->Add(fDPhiDEtaNumerator); | |
527 | tOutputList->Add(fDPhiDEtaDenominator); | |
70c54bac | 528 | tOutputList->Add(fPhi); |
529 | tOutputList->Add(fEta); | |
41fa2a11 | 530 | |
531 | if (fDoFullAnalysis) { | |
532 | // tOutputList->Add(fDPhiPtNumerator); | |
533 | // tOutputList->Add(fDPhiPtDenominator); | |
534 | //tOutputList->Add(fDCosPtNumerator); | |
535 | //tOutputList->Add(fDCosPtDenominator); | |
536 | tOutputList->Add(fDPhiNumerator); | |
537 | tOutputList->Add(fDPhiDenominator); | |
538 | tOutputList->Add(fDCosNumerator); | |
539 | tOutputList->Add(fDCosDenominator); | |
540 | ||
541 | tOutputList->Add(fYtYtNumerator); | |
542 | tOutputList->Add(fYtYtDenominator); | |
70c54bac | 543 | } |
70c54bac | 544 | |
70c54bac | 545 | |
70c54bac | 546 | |
70c54bac | 547 | |
41fa2a11 | 548 | return tOutputList; |
70c54bac | 549 | |
550 | } | |
551 | ||
41fa2a11 | 552 | void AliFemtoCorrFctnDEtaDPhiCorrections::SetDoFullAnalysis(Bool_t do2d) |
553 | { | |
554 | fDoFullAnalysis = do2d; | |
555 | ||
556 | if(fDoFullAnalysis) | |
557 | { | |
558 | ||
559 | int aPhiBins = fDPhiDEtaNumerator->GetNbinsX(); | |
560 | int aEtaBins = fDPhiDEtaNumerator->GetNbinsY(); | |
561 | const char *title = fDPhiDEtaNumerator->GetTitle(); | |
562 | ||
563 | // set up numerator | |
564 | char tTitNumDPhi[101] = "NumDPhi"; | |
565 | strncat(tTitNumDPhi,title, 100); | |
566 | fDPhiNumerator = new TH1D(tTitNumDPhi,title,aPhiBins*2,fphiL, fphiT); | |
567 | // set up denominator | |
568 | char tTitDenDPhi[101] = "DenDPhi"; | |
569 | strncat(tTitDenDPhi,title, 100); | |
570 | fDPhiDenominator = new TH1D(tTitDenDPhi,title,aPhiBins*2,fphiL, fphiT); | |
571 | ||
572 | // set up numerator | |
573 | char tTitNumDCos[101] = "NumDCos"; | |
574 | strncat(tTitNumDCos,title, 100); | |
575 | fDCosNumerator = new TH1D(tTitNumDCos,title,aPhiBins*2,-1.0,1.0); | |
576 | // set up denominator | |
577 | char tTitDenDCos[101] = "DenDCos"; | |
578 | strncat(tTitDenDCos,title, 100); | |
579 | fDCosDenominator = new TH1D(tTitDenDCos,title,aPhiBins*2,-1.0,1.0); | |
580 | ||
581 | // set up numerator | |
582 | char tTitYtNum[101] = "NumYtYt"; | |
583 | strncat(tTitYtNum,title, 100); | |
584 | fYtYtNumerator = new TH2D(tTitYtNum,title,aPhiBins,1,5,aEtaBins,1,5); | |
585 | // set up denominator | |
586 | char tTitYtYtDen[101] = "DenYtYt"; | |
587 | strncat(tTitYtYtDen,title, 100); | |
588 | fYtYtDenominator = new TH2D(tTitYtYtDen,title,aPhiBins,1,5,aEtaBins,1,5); | |
589 | ||
590 | ||
591 | char tTitPtCorrectionsNum[101] = "NumpT1pT2EtaPhi"; | |
592 | strncat(tTitPtCorrectionsNum,title, 100); | |
593 | char tTitPtCorrectionsDen[101] = "DenpT1pT2EtaPhi"; | |
594 | strncat(tTitPtCorrectionsDen,title, 100); | |
595 | ||
596 | Int_t nbins[4] = {20,20,aPhiBins,aEtaBins}; | |
597 | Double_t xmin[4] = {0,0,-0.5*TMath::Pi(),-2.0}; | |
598 | Double_t xmax[4] = {4,4,1.5*TMath::Pi(),2.0}; | |
599 | ||
600 | fPtCorrectionsNum = new THnSparseF(tTitPtCorrectionsNum,title,4,nbins,xmin,xmax); | |
601 | fPtCorrectionsDen = new THnSparseF(tTitPtCorrectionsDen,title,4,nbins,xmin,xmax); | |
602 | ||
603 | char tTitEtaCorrectionsNum[101] = "NumEta1Eta2EtaPhi"; | |
604 | strncat(tTitEtaCorrectionsNum,title, 100); | |
605 | char tTitEtaCorrectionsDen[101] = "DenEta1Eta2EtaPhi"; | |
606 | strncat(tTitEtaCorrectionsDen,title, 100); | |
607 | ||
608 | Double_t xmineta[4] = {-1,1,-0.5*TMath::Pi(),-2.0}; | |
609 | Double_t xmaxeta[4] = {-1,1,1.5*TMath::Pi(),2.0}; | |
610 | ||
611 | fEtaCorrectionsNum = new THnSparseF(tTitEtaCorrectionsNum,title,4,nbins,xmineta,xmaxeta); | |
612 | fEtaCorrectionsDen = new THnSparseF(tTitEtaCorrectionsDen,title,4,nbins,xmineta,xmaxeta); | |
613 | // THnSparse(const char* name, const char* title, Int_t dim, | |
614 | // const Int_t* nbins, const Double_t* xmin, const Double_t* xmax, | |
615 | // Int_t chunksize); | |
616 | ||
617 | // to enable error bar calculation... | |
618 | fDPhiNumerator->Sumw2(); | |
619 | fDPhiDenominator->Sumw2(); | |
620 | fDCosNumerator->Sumw2(); | |
621 | fDCosDenominator->Sumw2(); | |
622 | fYtYtNumerator->Sumw2(); | |
623 | fYtYtDenominator->Sumw2(); | |
624 | fPtCorrectionsNum->Sumw2(); | |
625 | fPtCorrectionsDen->Sumw2(); | |
626 | } | |
a0179664 | 627 | |
70c54bac | 628 | |
70c54bac | 629 | } |
630 | ||
eef80284 | 631 | |
632 | ||
633 | void AliFemtoCorrFctnDEtaDPhiCorrections::LoadCorrectionTabFromROOTFile(const char *file, ParticleType partType1, ParticleType partType2, bool doPtCorr, bool doEtaCorr, bool doPhiCorr, bool doZVertCorr) | |
70c54bac | 634 | { |
a0179664 | 635 | fIfCorrection = kTRUE; |
636 | ||
eef80284 | 637 | ifileCorrTab = TFile::Open(file); |
638 | fdoPtCorr = doPtCorr; | |
639 | fdoEtaCorr = doEtaCorr; | |
640 | fdoPhiCorr = doPhiCorr; | |
641 | fdoZVertCorr = doZVertCorr; | |
642 | fpartType1 = partType1; | |
643 | fpartType2 = partType2; | |
644 | ||
645 | char type1[10]; | |
646 | char type2[10]; | |
647 | ||
648 | ||
649 | if(fpartType1==kPion) strcpy(type1,"Pion"); | |
650 | else if(fpartType1==kKaon) strcpy(type1,"Kaon"); | |
651 | else if (fpartType1==kProton)strcpy(type1,"Proton"); | |
652 | else if (fpartType1==kAll) strcpy(type1,"All"); | |
653 | else strcpy(type1,""); | |
654 | ||
655 | if(fpartType2==kPion) strcpy(type2,"Pion"); | |
656 | else if(fpartType2==kKaon) strcpy(type2,"Kaon"); | |
657 | else if (fpartType2==kProton) strcpy(type2,"Proton"); | |
658 | else if (fpartType2==kAll) strcpy(type2,"All"); | |
659 | else strcpy(type1,""); | |
660 | ||
661 | ||
662 | ||
663 | fhntReco1 = (THnT<float>*)(ifileCorrTab->Get(Form("fCorrectionMapData%s",type1)))->Clone(); | |
664 | fhntReco2 = (THnT<float>*)(ifileCorrTab->Get(Form("fCorrectionMapData%s",type2)))->Clone(); | |
665 | fhCont1 = (TH1D*)(ifileCorrTab->Get(Form("SecondariesContamination%s",type1)))->Clone(); | |
666 | fhCont2 = (TH1D*)(ifileCorrTab->Get(Form("SecondariesContamination%s",type2)))->Clone(); | |
70c54bac | 667 | |
eef80284 | 668 | double fhntReco1_nbins = fhntReco1->GetNbins(); |
669 | double fhntReco2_nbins = fhntReco2->GetNbins(); | |
670 | ||
671 | int boolSum = fdoPtCorr+fdoEtaCorr+fdoPhiCorr+fdoZVertCorr; | |
672 | /*if(boolSum == 0) | |
673 | { | |
674 | return 1; | |
675 | }*/ | |
676 | if(boolSum == 1) | |
70c54bac | 677 | { |
eef80284 | 678 | |
679 | if(fdoPtCorr == 1) | |
70c54bac | 680 | { |
eef80284 | 681 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(0))->Clone(); |
682 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(0))->Clone(); | |
683 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
684 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
685 | ||
70c54bac | 686 | } |
eef80284 | 687 | |
688 | else if(fdoEtaCorr == 1) | |
689 | { | |
690 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(1))->Clone(); | |
691 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(1))->Clone(); | |
692 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
693 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
694 | } | |
695 | ||
696 | else if(fdoPhiCorr == 1) | |
697 | { | |
698 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(2))->Clone(); | |
699 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(2))->Clone(); | |
700 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
701 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
702 | } | |
703 | ||
704 | else if(fdoZVertCorr == 1) | |
705 | { | |
706 | fh1Reco1 = (TH1F*)(fhntReco1->Projection(3))->Clone(); | |
707 | fh1Reco2 = (TH1F*)(fhntReco2->Projection(3))->Clone(); | |
708 | fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX()); | |
709 | fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX()); | |
710 | } | |
711 | ||
70c54bac | 712 | } |
eef80284 | 713 | |
714 | else if(boolSum == 2) | |
70c54bac | 715 | { |
eef80284 | 716 | if(fdoPtCorr == 1 && fdoEtaCorr == 1) |
717 | { | |
9ee51cbc | 718 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(1,0))->Clone(); |
719 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(1,0))->Clone(); | |
eef80284 | 720 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); |
721 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
722 | } | |
723 | ||
9ee51cbc | 724 | else if(fdoPtCorr == 1 && fdoPhiCorr == 1) |
eef80284 | 725 | { |
9ee51cbc | 726 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(2,0))->Clone(); |
727 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(2,0))->Clone(); | |
eef80284 | 728 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); |
729 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
730 | } | |
731 | ||
732 | else if(fdoPtCorr == 1 && fdoZVertCorr == 1) | |
733 | { | |
9ee51cbc | 734 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(3,0))->Clone(); |
735 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(3,0))->Clone(); | |
eef80284 | 736 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); |
737 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
738 | } | |
739 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1) | |
740 | { | |
9ee51cbc | 741 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(2,1))->Clone(); |
742 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(2,1))->Clone(); | |
eef80284 | 743 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); |
744 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
745 | } | |
746 | else if(fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
747 | { | |
9ee51cbc | 748 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(3,1))->Clone(); |
749 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(3,1))->Clone(); | |
eef80284 | 750 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); |
751 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
752 | } | |
753 | else if(fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
754 | { | |
9ee51cbc | 755 | fh2Reco1 = (TH2F*)(fhntReco1->Projection(3,2))->Clone(); |
756 | fh2Reco2 = (TH2F*)(fhntReco2->Projection(3,2))->Clone(); | |
eef80284 | 757 | fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY()); |
758 | fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY()); | |
759 | } | |
70c54bac | 760 | } |
70c54bac | 761 | |
eef80284 | 762 | |
763 | else if(boolSum == 3) | |
70c54bac | 764 | { |
eef80284 | 765 | if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoPhiCorr == 1) |
70c54bac | 766 | { |
eef80284 | 767 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,1,2))->Clone(); |
768 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,1,2))->Clone(); | |
769 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
770 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
9ee51cbc | 771 | |
eef80284 | 772 | } |
773 | ||
774 | else if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
775 | { | |
776 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,1,3))->Clone(); | |
777 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,1,3))->Clone(); | |
778 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
779 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
780 | } | |
781 | ||
782 | else if(fdoPtCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
783 | { | |
784 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,2,3))->Clone(); | |
785 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,2,3))->Clone(); | |
786 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
787 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
788 | } | |
789 | ||
790 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
791 | { | |
792 | fh3Reco1 = (TH3F*)(fhntReco1->Projection(1,2,3))->Clone(); | |
793 | fh3Reco2 = (TH3F*)(fhntReco2->Projection(1,2,3))->Clone(); | |
794 | fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ()); | |
795 | fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ()); | |
70c54bac | 796 | } |
797 | } | |
eef80284 | 798 | |
799 | /*else if(boolSum == 4) | |
70c54bac | 800 | { |
eef80284 | 801 | }*/ |
802 | ||
803 | ifileCorrTab->Close(); | |
804 | ||
805 | } | |
806 | ||
807 | void AliFemtoCorrFctnDEtaDPhiCorrections::LoadCorrectionTabFromROOTFile1D(const char *file, ParticleType partType1, ParticleType partType2) | |
808 | { | |
a0179664 | 809 | fCorr1D = kTRUE; |
810 | ||
eef80284 | 811 | ifileCorrTab = TFile::Open(file); |
812 | ||
813 | fpartType1 = partType1; | |
814 | fpartType2 = partType2; | |
815 | ||
816 | ||
817 | char type1[10]; | |
818 | char type2[10]; | |
819 | ||
820 | ||
821 | if(fpartType1==kPion) strcpy(type1,"Pion"); | |
822 | else if(fpartType1==kKaon) strcpy(type1,"Kaon"); | |
823 | else if (fpartType1==kProton)strcpy(type1,"Proton"); | |
824 | else if (fpartType1==kAll) strcpy(type1,"All"); | |
825 | else strcpy(type1,""); | |
826 | ||
827 | if(fpartType2==kPion) strcpy(type2,"Pion"); | |
828 | else if(fpartType2==kKaon) strcpy(type2,"Kaon"); | |
829 | else if (fpartType2==kProton) strcpy(type2,"Proton"); | |
830 | else if (fpartType2==kAll) strcpy(type2,"All"); | |
831 | else strcpy(type1,""); | |
832 | ||
833 | fhCont1 = (TH1D*)(ifileCorrTab->Get(Form("CorrectionFactorPtEffandCont%s",type1)))->Clone(); | |
834 | fhCont2 = (TH1D*)(ifileCorrTab->Get(Form("CorrectionFactorPtEffandCont%s",type2)))->Clone(); | |
835 | ||
836 | ifileCorrTab->Close(); | |
837 | ||
70c54bac | 838 | } |
839 | ||
2ddcfd01 | 840 | void AliFemtoCorrFctnDEtaDPhiCorrections::SetCorrectionTab(ParticleType partType) |
841 | { | |
842 | ||
843 | 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}; | |
844 | ||
845 | 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}; | |
846 | ||
847 | 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}; | |
848 | ||
849 | 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}; | |
850 | ||
851 | 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}; | |
852 | ||
853 | fpTab = new double[190]; | |
854 | for(int i=0;i<190;i++) | |
855 | fpTab[i]=pttab[i]; | |
856 | ||
857 | if(partType==kPion) | |
858 | { | |
859 | fCorrFactorTab = new double[190]; | |
860 | for(int i=0;i<190;i++) | |
861 | fCorrFactorTab[i] = pioncorrtab[i]; | |
862 | } | |
863 | else if(partType==kKaon) | |
864 | { | |
865 | fCorrFactorTab = new double[190]; | |
866 | for(int i=0;i<190;i++) | |
867 | fCorrFactorTab[i] = kaoncorrtab[i]; | |
868 | } | |
869 | else if(partType==kProton) | |
870 | { | |
871 | fCorrFactorTab = new double[190]; | |
872 | for(int i=0;i<190;i++) | |
873 | fCorrFactorTab[i] = protoncorrtab[i]; | |
874 | } | |
875 | else if(partType==kAll) | |
876 | { | |
877 | fCorrFactorTab = new double[190]; | |
878 | for(int i=0;i<190;i++) | |
879 | fCorrFactorTab[i] = allcorrtab[i]; | |
880 | } | |
881 | } | |
70c54bac | 882 | |
883 | double AliFemtoCorrFctnDEtaDPhiCorrections::CalculateCorrectionWeight(double pT1, double pT2) | |
eef80284 | 884 | { |
885 | double w1=0., w2=0.; | |
886 | if(pT1 > fhCont1->GetXaxis()->GetXmin() && pT1 < fhCont1->GetXaxis()->GetXmax() && pT2 > fhCont2->GetXaxis()->GetXmin() && pT2 < fhCont2->GetXaxis()->GetXmax()) | |
887 | { | |
888 | w1 = fhCont1->GetBinContent(fhCont1->FindFixBin(pT1)); | |
889 | w2 = fhCont2->GetBinContent(fhCont2->FindFixBin(pT2)); | |
890 | ||
891 | return w1*w2; | |
892 | } | |
893 | else | |
894 | return 0; | |
895 | } | |
896 | ||
897 | ||
898 | double AliFemtoCorrFctnDEtaDPhiCorrections::CalculateCorrectionWeight(double pT1, double pT2, double eta1, double eta2, double phi1, double phi2, double zvert1, double zvert2) | |
70c54bac | 899 | { |
900 | ||
901 | double w1=0., w2=0.; | |
eef80284 | 902 | double eps1=0., eps2=0; |
903 | double cont1=0., cont2=0; //w=(1-cont)/eps | |
3a50c5c6 | 904 | phi1 += TMath::Pi(); |
905 | phi2 += TMath::Pi(); | |
eef80284 | 906 | |
907 | if(pT1 > fhCont1->GetXaxis()->GetXmin() && pT1 < fhCont1->GetXaxis()->GetXmax() && pT2 > fhCont2->GetXaxis()->GetXmin() && pT2 < fhCont2->GetXaxis()->GetXmax()) | |
908 | { | |
909 | cont1 = fhCont1->GetBinContent(fhCont1->FindFixBin(pT1)); | |
910 | cont2 = fhCont1->GetBinContent(fhCont2->FindFixBin(pT2)); | |
911 | } | |
70c54bac | 912 | else |
eef80284 | 913 | return 0; |
914 | ||
915 | int boolSum = fdoPtCorr+fdoEtaCorr+fdoPhiCorr+fdoZVertCorr; | |
916 | if(boolSum == 0) | |
917 | { | |
918 | return 1; | |
919 | } | |
920 | else if(boolSum == 1) | |
921 | { | |
922 | ||
923 | if(fdoPtCorr == 1) | |
924 | { | |
925 | if(pT1 > fh1Reco1->GetXaxis()->GetXmin() && pT1 < fh1Reco1->GetXaxis()->GetXmax() && pT2 > fh1Reco2->GetXaxis()->GetXmin() && pT2 < fh1Reco2->GetXaxis()->GetXmax()) | |
926 | { | |
927 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(pT1)); | |
928 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(pT2)); | |
929 | ||
930 | w1 = (1-cont1)/eps1; | |
931 | w2 = (1-cont2)/eps2; | |
eef80284 | 932 | return w1*w2; |
933 | } | |
934 | else | |
935 | return 0; | |
936 | } | |
937 | ||
938 | else if(fdoEtaCorr == 1) | |
939 | { | |
940 | if(eta1 > fh1Reco1->GetXaxis()->GetXmin() && eta1 < fh1Reco1->GetXaxis()->GetXmax() && eta2 > fh1Reco2->GetXaxis()->GetXmin() && eta2 < fh1Reco2->GetXaxis()->GetXmax()) | |
941 | { | |
942 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(eta1)); | |
943 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(eta2)); | |
944 | ||
945 | w1 = (1-cont1)/eps1; | |
946 | w2 = (1-cont2)/eps2; | |
947 | ||
948 | return w1*w2; | |
949 | } | |
950 | else | |
951 | return 0; | |
952 | } | |
953 | ||
954 | else if(fdoPhiCorr == 1) | |
955 | { | |
956 | if(phi1 > fh1Reco1->GetXaxis()->GetXmin() && phi1 < fh1Reco1->GetXaxis()->GetXmax() && phi2 > fh1Reco2->GetXaxis()->GetXmin() && phi2 < fh1Reco2->GetXaxis()->GetXmax()) | |
957 | { | |
958 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(phi1)); | |
959 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(phi2)); | |
960 | ||
961 | w1 = (1-cont1)/eps1; | |
962 | w2 = (1-cont2)/eps2; | |
963 | ||
964 | return w1*w2; | |
965 | } | |
966 | else | |
967 | return 0; | |
968 | ||
969 | } | |
970 | ||
971 | else if(fdoZVertCorr == 1) | |
972 | { | |
973 | if(zvert1 > fh1Reco1->GetXaxis()->GetXmin() && zvert1 < fh1Reco1->GetXaxis()->GetXmax() && zvert2 > fh1Reco2->GetXaxis()->GetXmin() && zvert2 < fh1Reco2->GetXaxis()->GetXmax()) | |
974 | { | |
975 | eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(zvert1)); | |
976 | eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(zvert2)); | |
977 | ||
978 | w1 = (1-cont1)/eps1; | |
979 | w2 = (1-cont2)/eps2; | |
980 | ||
981 | return w1*w2; | |
982 | } | |
983 | else | |
984 | return 0; | |
985 | } | |
986 | ||
987 | } | |
988 | ||
989 | else if(boolSum == 2) | |
990 | { | |
991 | if(fdoPtCorr == 1 && fdoEtaCorr == 1) | |
992 | { | |
9ee51cbc | 993 | 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->GetYaxis()->GetXmin() && eta2 < fh2Reco2->GetYaxis()->GetXmax()) |
eef80284 | 994 | { |
995 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(eta1)); | |
996 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(eta2)); | |
997 | ||
9ee51cbc | 998 | w1 = (1-cont1)/eps1; |
eef80284 | 999 | w2 = (1-cont2)/eps2; |
1000 | ||
1001 | return w1*w2; | |
1002 | } | |
1003 | else | |
1004 | return 0; | |
1005 | ||
1006 | } | |
1007 | ||
1008 | if(fdoPtCorr == 1 && fdoPhiCorr == 1) | |
1009 | { | |
1010 | ||
9ee51cbc | 1011 | 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->GetYaxis()->GetXmin() && phi2 < fh2Reco2->GetYaxis()->GetXmax()) |
eef80284 | 1012 | { |
1013 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(phi1)); | |
1014 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(phi2)); | |
1015 | ||
1016 | w1 = (1-cont1)/eps1; | |
1017 | w2 = (1-cont2)/eps2; | |
1018 | ||
1019 | return w1*w2; | |
1020 | } | |
1021 | else | |
1022 | return 0; | |
1023 | ||
1024 | } | |
1025 | ||
1026 | else if(fdoPtCorr == 1 && fdoZVertCorr == 1) | |
1027 | { | |
1028 | ||
9ee51cbc | 1029 | 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->GetYaxis()->GetXmin() && zvert2 < fh2Reco2->GetYaxis()->GetXmax()) |
eef80284 | 1030 | { |
1031 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(zvert1)); | |
1032 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(zvert2)); | |
1033 | ||
1034 | w1 = (1-cont1)/eps1; | |
1035 | w2 = (1-cont2)/eps2; | |
1036 | ||
1037 | return w1*w2; | |
1038 | } | |
1039 | else | |
1040 | return 0; | |
1041 | } | |
1042 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1) | |
1043 | { | |
1044 | ||
9ee51cbc | 1045 | 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->GetYaxis()->GetXmin() && phi2 < fh2Reco2->GetYaxis()->GetXmax()) |
eef80284 | 1046 | { |
1047 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(eta1),fh2Reco1->GetYaxis()->FindFixBin(phi1)); | |
1048 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(eta2),fh2Reco2->GetYaxis()->FindFixBin(phi2)); | |
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 | } | |
1060 | else if(fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
1061 | { | |
1062 | ||
1063 | 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()) | |
1064 | { | |
1065 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(eta1),fh2Reco1->GetYaxis()->FindFixBin(zvert1)); | |
1066 | eps1 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(eta2),fh2Reco2->GetYaxis()->FindFixBin(zvert2)); | |
1067 | ||
1068 | ||
1069 | w1 = (1-cont1)/eps1; | |
1070 | w2 = (1-cont2)/eps2; | |
1071 | ||
1072 | return w1*w2; | |
1073 | } | |
1074 | else | |
1075 | return 0; | |
1076 | ||
1077 | } | |
1078 | else if(fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
1079 | { | |
1080 | ||
1081 | 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()) | |
1082 | { | |
1083 | eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(phi1),fh2Reco1->GetYaxis()->FindFixBin(zvert1)); | |
1084 | eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(phi2),fh2Reco2->GetYaxis()->FindFixBin(zvert2)); | |
1085 | ||
1086 | w1 = (1-cont1)/eps1; | |
1087 | w2 = (1-cont2)/eps2; | |
1088 | ||
1089 | return w1*w2; | |
1090 | } | |
1091 | else | |
1092 | return 0; | |
1093 | ||
1094 | } | |
1095 | } | |
1096 | ||
1097 | ||
1098 | else if(boolSum == 3) | |
1099 | { | |
1100 | if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoPhiCorr == 1) | |
1101 | { | |
1102 | if(pT1 >fh3Reco1->GetXaxis()->GetXmin() && pT1 <fh3Reco1->GetXaxis()->GetXmax() && | |
1103 | pT2 > fh3Reco2->GetXaxis()->GetXmin() && pT2 <fh3Reco2->GetXaxis()->GetXmax() && | |
1104 | eta1 > fh3Reco1->GetYaxis()->GetXmin() && eta1 <fh3Reco1->GetYaxis()->GetXmax() && | |
1105 | eta2 > fh3Reco2->GetYaxis()->GetXmin() && eta2 <fh3Reco2->GetYaxis()->GetXmax() && | |
1106 | phi1 > fh3Reco1->GetZaxis()->GetXmin() && phi1 < fh3Reco1->GetZaxis()->GetXmax() && | |
1107 | phi2 > fh3Reco2->GetZaxis()->GetXmin() && phi2 < fh3Reco2->GetZaxis()->GetXmax()) | |
1108 | { | |
1109 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(eta1),fh3Reco1->GetZaxis()->FindFixBin(phi1)); | |
1110 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(eta2),fh3Reco2->GetZaxis()->FindFixBin(phi2)); | |
1111 | ||
1112 | w1 = (1-cont1)/eps1; | |
1113 | w2 = (1-cont2)/eps2; | |
1114 | ||
1115 | return w1*w2; | |
1116 | } | |
1117 | else | |
1118 | return 0; | |
1119 | ||
1120 | ||
1121 | } | |
1122 | ||
1123 | else if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoZVertCorr == 1) | |
1124 | { | |
1125 | ||
1126 | 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()) | |
1127 | { | |
1128 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(eta1),fh3Reco1->GetZaxis()->FindFixBin(zvert1)); | |
1129 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(eta2),fh3Reco2->GetZaxis()->FindFixBin(zvert2)); | |
1130 | ||
1131 | w1 = (1-cont1)/eps1; | |
1132 | w2 = (1-cont2)/eps2; | |
1133 | ||
1134 | return w1*w2; | |
1135 | } | |
1136 | else | |
1137 | return 0; | |
1138 | } | |
1139 | ||
1140 | else if(fdoPtCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
1141 | { | |
1142 | ||
1143 | 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()) | |
1144 | { | |
1145 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(phi1),fh3Reco1->GetZaxis()->FindFixBin(zvert1)); | |
1146 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(phi2),fh3Reco2->GetZaxis()->FindFixBin(zvert2)); | |
1147 | ||
1148 | w1 = (1-cont1)/eps1; | |
1149 | w2 = (1-cont2)/eps2; | |
1150 | ||
1151 | return w1*w2; | |
1152 | } | |
1153 | else | |
1154 | return 0; | |
1155 | ||
1156 | } | |
1157 | ||
1158 | else if(fdoEtaCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1) | |
1159 | { | |
1160 | ||
1161 | 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()) | |
1162 | { | |
1163 | eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(eta1),fh3Reco1->GetYaxis()->FindFixBin(phi1),fh3Reco1->GetZaxis()->FindFixBin(zvert1)); | |
1164 | eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(eta2),fh3Reco2->GetYaxis()->FindFixBin(phi2),fh3Reco2->GetZaxis()->FindFixBin(zvert2)); | |
1165 | ||
1166 | w1 = (1-cont1)/eps1; | |
1167 | w2 = (1-cont2)/eps2; | |
1168 | ||
1169 | return w1*w2; | |
1170 | } | |
1171 | else | |
1172 | return 0; | |
1173 | ||
1174 | } | |
1175 | } | |
1176 | ||
1177 | else if(boolSum == 4) | |
1178 | { | |
1179 | ||
1180 | 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()) | |
1181 | { | |
1182 | ||
1183 | int tab1[] = {fhntReco1->GetAxis(0)->FindFixBin(pT1),fhntReco1->GetAxis(1)->FindFixBin(eta1),fhntReco1->GetAxis(2)->FindFixBin(phi1),fhntReco1->GetAxis(3)->FindFixBin(zvert1)}; | |
1184 | int tab2[] = {fhntReco2->GetAxis(0)->FindFixBin(pT2),fhntReco2->GetAxis(1)->FindFixBin(eta2),fhntReco2->GetAxis(2)->FindFixBin(phi2),fhntReco2->GetAxis(3)->FindFixBin(zvert2)}; | |
1185 | ||
1186 | eps1 = fhntReco1->GetBinContent(tab1); | |
1187 | eps2 = fhntReco2->GetBinContent(tab2); | |
1188 | ||
1189 | w1 = (1-cont1)/eps1; | |
1190 | w2 = (1-cont2)/eps2; | |
eef80284 | 1191 | return w1*w2; |
1192 | ||
1193 | } | |
1194 | else | |
1195 | return 0; | |
1196 | ||
1197 | } | |
1198 | ||
1199 | return 0; | |
1200 | ||
70c54bac | 1201 | } |