]>
Commit | Line | Data |
---|---|---|
9cabc5db | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id:$ */ | |
17 | ||
18 | #include <TROOT.h> | |
19 | #include <TChain.h> | |
20 | #include <TFile.h> | |
21 | #include <TList.h> | |
22 | #include <TMath.h> | |
23 | #include <TTree.h> | |
24 | #include <TH1F.h> | |
25 | #include <TH2F.h> | |
26 | #include <TH3F.h> | |
27 | #include <TProfile.h> | |
28 | #include <TH1D.h> | |
29 | #include <TH2D.h> | |
30 | #include <TH3D.h> | |
31 | #include <TRandom.h> | |
32 | #include "AliAnalysisManager.h" | |
33 | ||
34 | #include "AliAODHandler.h" | |
35 | #include "AliAODInputHandler.h" | |
36 | //#include "AliAODMCParticle.h" | |
37 | #include "AliInputEventHandler.h" | |
38 | #include "AliLog.h" | |
39 | #include "AliESDEvent.h" | |
40 | #include "AliESDInputHandler.h" | |
41 | #include "AliMultiplicity.h" | |
42 | #include "AliCentrality.h" | |
43 | #include "AliAnalysisTaskDptDptCorrelations.h" | |
44 | ||
45 | ClassImp(AliAnalysisTaskDptDptCorrelations) | |
46 | ||
47 | AliAnalysisTaskDptDptCorrelations::AliAnalysisTaskDptDptCorrelations() | |
48 | : AliAnalysisTaskSE(), | |
49 | fAODEvent(0), | |
50 | fESDEvent(0), //! ESD Event | |
51 | fInputHandler(0), | |
52 | _outputHistoList(0), | |
53 | _twoPi ( 2.0 * 3.1415927), | |
54 | _eventCount ( 0), | |
55 | _debugLevel ( 0), | |
56 | _singlesOnly ( 0), | |
57 | _useWeights ( 0), | |
58 | _sameFilter ( false), | |
59 | _rejectPileup ( 1), | |
60 | _rejectPairConversion ( 0), | |
61 | _vertexZMin ( -10), | |
62 | _vertexZMax ( 10), | |
63 | _vertexXYMin ( -10), | |
64 | _vertexXYMax ( 10), | |
65 | _centralityMethod ( 4), | |
66 | _centralityMin ( 0.), | |
67 | _centralityMax ( 0.), | |
68 | _requestedCharge_1 ( 1), | |
69 | _requestedCharge_2 ( -1), | |
70 | _dcaZMin ( -3), | |
71 | _dcaZMax ( 3.), | |
49f44fbe | 72 | _dcaXYMin ( -2.4), |
73 | _dcaXYMax ( 2.4), | |
9cabc5db | 74 | _dedxMin ( 0), |
75 | _dedxMax ( 100000), | |
76 | _nClusterMin ( 70), | |
77 | _trackFilterBit ( 128), | |
78 | _field ( 1.), | |
79 | _nTracks ( 0 ), | |
80 | _mult0 ( 0 ), | |
81 | _mult1 ( 0 ), | |
82 | _mult2 ( 0 ), | |
83 | _mult3 ( 0 ), | |
84 | _mult4 ( 0 ), | |
85 | _mult5 ( 0 ), | |
86 | _mult6 ( 0 ), | |
87 | arraySize ( 2000), | |
88 | _id_1(0), | |
89 | _charge_1(0), | |
90 | _iEtaPhi_1(0), | |
91 | _iPt_1(0), | |
92 | _pt_1(0), | |
93 | _px_1(0), | |
94 | _py_1(0), | |
95 | _pz_1(0), | |
96 | _correction_1(0), | |
97 | _dedx_1(0), | |
98 | _id_2(0), | |
99 | _charge_2(0), | |
100 | _iEtaPhi_2(0), | |
101 | _iPt_2(0), | |
102 | _pt_2(0), | |
103 | _px_2(0), | |
104 | _py_2(0), | |
105 | _pz_2(0), | |
106 | _correction_2(0), | |
107 | _dedx_2(0), | |
108 | _correctionWeight_1(0), | |
109 | _correctionWeight_2(0), | |
110 | _nBins_M0(500), _min_M0(0), _max_M0(10000), _width_M0(20), | |
111 | _nBins_M1(500), _min_M1(0), _max_M1(10000), _width_M1(20), | |
112 | _nBins_M2(500), _min_M2(0), _max_M2(10000), _width_M2(20), | |
113 | _nBins_M3(500), _min_M3(0), _max_M3(10000), _width_M3(20), | |
114 | _nBins_M4(100), _min_M4(0), _max_M4(1), _width_M4(0.01), | |
115 | _nBins_M5(100), _min_M5(0), _max_M5(1), _width_M5(0.01), | |
116 | _nBins_M6(100), _min_M6(0), _max_M6(1), _width_M6(0.01), | |
117 | _nBins_vertexZ(40), _min_vertexZ(-10), _max_vertexZ(10), _width_vertexZ(0.5), | |
118 | ||
119 | _nBins_pt_1(18), _min_pt_1(0.2), _max_pt_1(2.0), _width_pt_1(0.1), | |
120 | _nBins_phi_1(72), _min_phi_1(0), _max_phi_1(2.*3.1415927),_width_phi_1(2.*3.1415927/72.), | |
121 | _nBins_eta_1(20), _min_eta_1(-1), _max_eta_1(1), _width_eta_1(0.1), | |
122 | ||
123 | _nBins_etaPhi_1(0), | |
124 | _nBins_etaPhiPt_1(0), | |
125 | _nBins_zEtaPhiPt_1(0), | |
126 | ||
127 | _nBins_pt_2(18), _min_pt_2(0.2), _max_pt_2(2.0), _width_pt_2(0.1), | |
128 | _nBins_phi_2(72), _min_phi_2(0), _max_phi_2(2.*3.1415927),_width_phi_2(2.*3.1415927/72), | |
129 | _nBins_eta_2(20), _min_eta_2(-1), _max_eta_2(1), _width_eta_2(0.1), | |
130 | ||
131 | _nBins_etaPhi_2(0), | |
132 | _nBins_etaPhiPt_2(0), | |
133 | _nBins_zEtaPhiPt_2(0), | |
134 | _nBins_etaPhi_12(0), | |
135 | __n1_1(0), | |
136 | __n1_2(0), | |
137 | __n2_12(0), | |
138 | __s1pt_1(0), | |
139 | __s1pt_2(0), | |
140 | __s2ptpt_12(0), | |
141 | __s2NPt_12(0), | |
142 | __s2PtN_12(0), | |
143 | __n1Nw_1(0), | |
144 | __n1Nw_2(0), | |
145 | __n2Nw_12(0), | |
146 | __s1ptNw_1(0), | |
147 | __s1ptNw_2(0), | |
148 | __s2ptptNw_12(0), | |
149 | __s2NPtNw_12(0), | |
150 | __s2PtNNw_12(0), | |
151 | __n1_1_vsPt(0), | |
152 | __n1_1_vsEtaPhi(0), | |
153 | __s1pt_1_vsEtaPhi(0), | |
154 | __n1_1_vsZEtaPhiPt(0), | |
155 | __n1_2_vsPt(0), | |
156 | __n1_2_vsEtaPhi(0), | |
157 | __s1pt_2_vsEtaPhi(0), | |
158 | __n1_2_vsZEtaPhiPt(0), | |
159 | __n2_12_vsPtPt(0), | |
160 | __n2_12_vsEtaPhi(0), | |
161 | __s2ptpt_12_vsEtaPhi(0), | |
162 | __s2PtN_12_vsEtaPhi(0), | |
163 | __s2NPt_12_vsEtaPhi(0), | |
164 | _weight_1 ( 0 ), | |
165 | _weight_2 ( 0 ), | |
166 | _eventAccounting ( 0), | |
167 | _m0 ( 0), | |
168 | _m1 ( 0), | |
169 | _m2 ( 0), | |
170 | _m3 ( 0), | |
171 | _m4 ( 0), | |
172 | _m5 ( 0), | |
173 | _m6 ( 0), | |
49f44fbe | 174 | |
175 | _etadis ( 0), | |
176 | _phidis ( 0), | |
177 | _dcaz ( 0), | |
178 | _dcaxy ( 0), | |
179 | ||
9cabc5db | 180 | _vertexZ ( 0), |
181 | _n1_1_vsPt ( 0), | |
182 | _n1_1_vsEtaVsPhi ( 0), | |
183 | _s1pt_1_vsEtaVsPhi ( 0), | |
184 | _n1_1_vsZVsEtaVsPhiVsPt ( 0), | |
185 | _n1_1_vsM ( 0), // w/ weight | |
186 | _s1pt_1_vsM ( 0), | |
187 | _n1Nw_1_vsM ( 0), // w/o weight | |
188 | _s1ptNw_1_vsM ( 0), | |
189 | _dedxVsP_1 ( 0), | |
190 | _corrDedxVsP_1 ( 0), | |
191 | _betaVsP_1 ( 0), | |
192 | _n1_2_vsPt ( 0), | |
193 | _n1_2_vsEtaVsPhi ( 0), | |
194 | _s1pt_2_vsEtaVsPhi ( 0), | |
195 | _n1_2_vsZVsEtaVsPhiVsPt ( 0), | |
196 | _n1_2_vsM ( 0), | |
197 | _s1pt_2_vsM ( 0), | |
198 | _n1Nw_2_vsM ( 0), | |
199 | _s1ptNw_2_vsM ( 0), | |
200 | _dedxVsP_2 ( 0), | |
201 | _corrDedxVsP_2 ( 0), | |
202 | _betaVsP_2 ( 0), | |
203 | _n2_12_vsEtaPhi ( 0), | |
204 | _n2_12_vsPtVsPt ( 0), | |
205 | _s2PtPt_12_vsEtaPhi( 0), | |
206 | _s2PtN_12_vsEtaPhi ( 0), | |
207 | _s2NPt_12_vsEtaPhi ( 0), | |
208 | _n2_12_vsM ( 0), | |
209 | _s2PtPt_12_vsM ( 0), | |
210 | _s2PtN_12_vsM ( 0), | |
211 | _s2NPt_12_vsM ( 0), | |
212 | _n2Nw_12_vsM ( 0), | |
213 | _s2PtPtNw_12_vsM ( 0), | |
214 | _s2PtNNw_12_vsM ( 0), | |
215 | _s2NPtNw_12_vsM ( 0), | |
216 | _invMass ( 0), | |
217 | _invMassElec ( 0), | |
218 | n1Name("NA"), | |
219 | n1NwName("NA"), | |
220 | n2Name("NA"), | |
221 | n2NwName("NA"), | |
222 | n3Name("NA"), | |
223 | n1n1Name("NA"), | |
224 | n1n1n1Name("NA"), | |
225 | n2n1Name("NA"), | |
226 | r1Name("NA"), | |
227 | r2Name("NA"), | |
228 | r3Name("NA"), | |
229 | r2r1Name("NA"), | |
230 | c2Name("NA"), | |
231 | c3Name("NA"), | |
232 | d3Name("NA"), | |
233 | p3Name("NA"), | |
234 | cName("NA"), | |
235 | ||
236 | intR2Name("NA"), | |
237 | binCorrName("NA"), | |
238 | intBinCorrName("NA"), | |
239 | ||
240 | countsName("NA"), | |
241 | part_1_Name("NA"), | |
242 | part_2_Name("NA"), | |
243 | part_3_Name("NA"), | |
244 | pair_12_Name("NA"), | |
245 | pair_13_Name("NA"), | |
246 | pair_23_Name("NA"), | |
247 | tripletName("NA"), | |
248 | ||
249 | avg("NA"), | |
250 | avgName("NA"), | |
251 | sumName("NA"), | |
252 | s1ptName("NA"), | |
253 | s1ptNwName("NA"), | |
254 | s1DptName("NA"), | |
255 | ||
256 | s2PtPtName("NA"), | |
257 | s2NPtName("NA"), | |
258 | s2PtNName("NA"), | |
259 | s2DptDptName("NA"), | |
260 | ||
261 | s2PtPtNwName("NA"), | |
262 | s2NPtNwName("NA"), | |
263 | s2PtNNwName("NA"), | |
264 | ||
265 | ptName("NA"), | |
266 | ptptName("NA"), | |
267 | pt1pt1Name("NA"), | |
268 | DptName("NA"), | |
269 | DptDptName("NA"), | |
270 | RDptDptName("NA"), | |
271 | nPtName("NA"), | |
272 | ptNName("NA"), | |
273 | seanName("NA"), | |
274 | ||
275 | _title_counts("NA"), | |
276 | ||
277 | _title_m0("NA"), | |
278 | _title_m1("NA"), | |
279 | _title_m2("NA"), | |
280 | _title_m3("NA"), | |
281 | _title_m4("NA"), | |
282 | _title_m5("NA"), | |
283 | _title_m6("NA"), | |
284 | ||
285 | _title_eta_1("NA"), | |
286 | _title_phi_1("NA"), | |
287 | _title_pt_1("NA"), | |
288 | _title_etaPhi_1("NA"), | |
289 | _title_n_1("NA"), | |
290 | _title_SumPt_1("NA"), | |
291 | _title_AvgPt_1("NA"), | |
292 | _title_AvgN_1("NA"), | |
293 | _title_AvgSumPt_1("NA"), | |
294 | ||
295 | _title_eta_2("NA"), | |
296 | _title_phi_2("NA"), | |
297 | _title_pt_2("NA"), | |
298 | _title_etaPhi_2("NA"), | |
299 | _title_n_2("NA"), | |
300 | _title_SumPt_2("NA"), | |
301 | _title_AvgPt_2("NA"), | |
302 | _title_AvgN_2("NA"), | |
303 | _title_AvgSumPt_2("NA"), | |
304 | ||
305 | _title_etaPhi_12("NA"), | |
306 | ||
307 | _title_AvgN2_12("NA"), | |
308 | _title_AvgSumPtPt_12("NA"), | |
309 | _title_AvgSumPtN_12("NA"), | |
310 | _title_AvgNSumPt_12("NA"), | |
311 | ||
312 | vsZ("NA"), | |
313 | vsM("NA"), | |
314 | vsPt("NA"), | |
315 | vsPhi("NA"), | |
316 | vsEta("NA"), | |
317 | vsEtaPhi("NA"), | |
318 | vsPtVsPt("NA") | |
319 | { | |
320 | printf("Default constructor called \n"); | |
321 | ||
322 | printf("passed \n "); | |
323 | ||
324 | } | |
325 | ||
326 | AliAnalysisTaskDptDptCorrelations::AliAnalysisTaskDptDptCorrelations(const TString & name) | |
327 | : AliAnalysisTaskSE(name), | |
328 | fAODEvent(0), | |
329 | fESDEvent(0), | |
330 | fInputHandler(0), | |
331 | _outputHistoList(0), | |
332 | _twoPi ( 2.0 * 3.1415927), | |
333 | _eventCount ( 0), | |
334 | _debugLevel ( 0), | |
335 | _singlesOnly ( 0), | |
336 | _useWeights ( 0), | |
337 | _sameFilter ( false), | |
338 | _rejectPileup ( 1), | |
339 | _rejectPairConversion ( 0), | |
340 | _vertexZMin ( -10.), | |
341 | _vertexZMax ( 10.), | |
342 | _vertexXYMin ( -10.), | |
343 | _vertexXYMax ( 10.), | |
344 | _centralityMethod ( 4), | |
345 | _centralityMin ( 0.), | |
346 | _centralityMax ( 1.), | |
347 | _requestedCharge_1 ( 1), | |
348 | _requestedCharge_2 ( -1), | |
349 | _dcaZMin ( -3), | |
350 | _dcaZMax ( 3.), | |
49f44fbe | 351 | _dcaXYMin ( -2.4), |
352 | _dcaXYMax ( 2.4), | |
9cabc5db | 353 | _dedxMin ( 0), |
354 | _dedxMax ( 100000), | |
355 | _nClusterMin ( 70), | |
356 | _trackFilterBit ( 128), | |
357 | _field ( 1.), | |
358 | _nTracks ( 0 ), | |
359 | _mult0 ( 0 ), | |
360 | _mult1 ( 0 ), | |
361 | _mult2 ( 0 ), | |
362 | _mult3 ( 0 ), | |
363 | _mult4 ( 0 ), | |
364 | _mult5 ( 0 ), | |
365 | _mult6 ( 0 ), | |
366 | arraySize ( 2000), | |
367 | _id_1(0), | |
368 | _charge_1(0), | |
369 | _iEtaPhi_1(0), | |
370 | _iPt_1(0), | |
371 | _pt_1(0), | |
372 | _px_1(0), | |
373 | _py_1(0), | |
374 | _pz_1(0), | |
375 | _correction_1(0), | |
376 | _dedx_1(0), | |
377 | _id_2(0), | |
378 | _charge_2(0), | |
379 | _iEtaPhi_2(0), | |
380 | _iPt_2(0), | |
381 | _pt_2(0), | |
382 | _px_2(0), | |
383 | _py_2(0), | |
384 | _pz_2(0), | |
385 | _correction_2(0), | |
386 | _dedx_2(0), | |
387 | _correctionWeight_1(0), | |
388 | _correctionWeight_2(0), | |
389 | _nBins_M0(500), _min_M0(0), _max_M0(10000), _width_M0(20), | |
390 | _nBins_M1(500), _min_M1(0), _max_M1(10000), _width_M1(20), | |
391 | _nBins_M2(500), _min_M2(0), _max_M2(10000), _width_M2(20), | |
392 | _nBins_M3(500), _min_M3(0), _max_M3(10000), _width_M3(20), | |
393 | _nBins_M4(100), _min_M4(0), _max_M4(1), _width_M4(0.01), | |
394 | _nBins_M5(100), _min_M5(0), _max_M5(1), _width_M5(0.01), | |
395 | _nBins_M6(100), _min_M6(0), _max_M6(1), _width_M6(0.01), | |
396 | _nBins_vertexZ(40), _min_vertexZ(-10), _max_vertexZ(10), _width_vertexZ(0.5), | |
397 | ||
398 | _nBins_pt_1(18), _min_pt_1(0.2), _max_pt_1(2.0), _width_pt_1(0.1), | |
399 | _nBins_phi_1(72), _min_phi_1(0), _max_phi_1(2.*3.1415927),_width_phi_1(2.*3.1415927/72.), | |
400 | _nBins_eta_1(20), _min_eta_1(-1), _max_eta_1(1), _width_eta_1(0.1), | |
401 | ||
402 | _nBins_etaPhi_1(0), | |
403 | _nBins_etaPhiPt_1(0), | |
404 | _nBins_zEtaPhiPt_1(0), | |
405 | ||
406 | _nBins_pt_2(18), _min_pt_2(0.2), _max_pt_2(2.0), _width_pt_2(0.1), | |
407 | _nBins_phi_2(72), _min_phi_2(0), _max_phi_2(2.*3.1415927),_width_phi_2(2.*3.1415927/72), | |
408 | _nBins_eta_2(20), _min_eta_2(-1), _max_eta_2(1), _width_eta_2(0.1), | |
409 | ||
410 | _nBins_etaPhi_2(0), | |
411 | _nBins_etaPhiPt_2(0), | |
412 | _nBins_zEtaPhiPt_2(0), | |
413 | _nBins_etaPhi_12(0), | |
414 | __n1_1(0), | |
415 | __n1_2(0), | |
416 | __n2_12(0), | |
417 | __s1pt_1(0), | |
418 | __s1pt_2(0), | |
419 | __s2ptpt_12(0), | |
420 | __s2NPt_12(0), | |
421 | __s2PtN_12(0), | |
422 | __n1Nw_1(0), | |
423 | __n1Nw_2(0), | |
424 | __n2Nw_12(0), | |
425 | __s1ptNw_1(0), | |
426 | __s1ptNw_2(0), | |
427 | __s2ptptNw_12(0), | |
428 | __s2NPtNw_12(0), | |
429 | __s2PtNNw_12(0), | |
430 | __n1_1_vsPt(0), | |
431 | __n1_1_vsEtaPhi(0), | |
432 | __s1pt_1_vsEtaPhi(0), | |
433 | __n1_1_vsZEtaPhiPt(0), | |
434 | __n1_2_vsPt(0), | |
435 | __n1_2_vsEtaPhi(0), | |
436 | __s1pt_2_vsEtaPhi(0), | |
437 | __n1_2_vsZEtaPhiPt(0), | |
438 | __n2_12_vsPtPt(0), | |
439 | __n2_12_vsEtaPhi(0), | |
440 | __s2ptpt_12_vsEtaPhi(0), | |
441 | __s2PtN_12_vsEtaPhi(0), | |
442 | __s2NPt_12_vsEtaPhi(0), | |
443 | _weight_1 ( 0 ), | |
444 | _weight_2 ( 0 ), | |
445 | _eventAccounting ( 0), | |
446 | _m0 ( 0), | |
447 | _m1 ( 0), | |
448 | _m2 ( 0), | |
449 | _m3 ( 0), | |
450 | _m4 ( 0), | |
451 | _m5 ( 0), | |
452 | _m6 ( 0), | |
49f44fbe | 453 | _etadis ( 0), |
454 | _phidis ( 0), | |
455 | _dcaz ( 0), | |
456 | _dcaxy ( 0), | |
9cabc5db | 457 | _vertexZ ( 0), |
458 | _n1_1_vsPt ( 0), | |
459 | _n1_1_vsEtaVsPhi ( 0), | |
460 | _s1pt_1_vsEtaVsPhi ( 0), | |
461 | _n1_1_vsZVsEtaVsPhiVsPt ( 0), | |
462 | _n1_1_vsM ( 0), // w/ weight | |
463 | _s1pt_1_vsM ( 0), | |
464 | _n1Nw_1_vsM ( 0), // w/o weight | |
465 | _s1ptNw_1_vsM ( 0), | |
466 | _dedxVsP_1 ( 0), | |
467 | _corrDedxVsP_1 ( 0), | |
468 | _betaVsP_1 ( 0), | |
469 | _n1_2_vsPt ( 0), | |
470 | _n1_2_vsEtaVsPhi ( 0), | |
471 | _s1pt_2_vsEtaVsPhi ( 0), | |
472 | _n1_2_vsZVsEtaVsPhiVsPt ( 0), | |
473 | _n1_2_vsM ( 0), | |
474 | _s1pt_2_vsM ( 0), | |
475 | _n1Nw_2_vsM ( 0), | |
476 | _s1ptNw_2_vsM ( 0), | |
477 | _dedxVsP_2 ( 0), | |
478 | _corrDedxVsP_2 ( 0), | |
479 | _betaVsP_2 ( 0), | |
480 | _n2_12_vsEtaPhi ( 0), | |
481 | _n2_12_vsPtVsPt ( 0), | |
482 | _s2PtPt_12_vsEtaPhi( 0), | |
483 | _s2PtN_12_vsEtaPhi ( 0), | |
484 | _s2NPt_12_vsEtaPhi ( 0), | |
485 | _n2_12_vsM ( 0), | |
486 | _s2PtPt_12_vsM ( 0), | |
487 | _s2PtN_12_vsM ( 0), | |
488 | _s2NPt_12_vsM ( 0), | |
489 | _n2Nw_12_vsM ( 0), | |
490 | _s2PtPtNw_12_vsM ( 0), | |
491 | _s2PtNNw_12_vsM ( 0), | |
492 | _s2NPtNw_12_vsM ( 0), | |
493 | _invMass ( 0), | |
494 | _invMassElec ( 0), | |
495 | n1Name("NA"), | |
496 | n1NwName("NA"), | |
497 | n2Name("NA"), | |
498 | n2NwName("NA"), | |
499 | n3Name("NA"), | |
500 | n1n1Name("NA"), | |
501 | n1n1n1Name("NA"), | |
502 | n2n1Name("NA"), | |
503 | r1Name("NA"), | |
504 | r2Name("NA"), | |
505 | r3Name("NA"), | |
506 | r2r1Name("NA"), | |
507 | c2Name("NA"), | |
508 | c3Name("NA"), | |
509 | d3Name("NA"), | |
510 | p3Name("NA"), | |
511 | cName("NA"), | |
512 | ||
513 | intR2Name("NA"), | |
514 | binCorrName("NA"), | |
515 | intBinCorrName("NA"), | |
516 | ||
517 | countsName("NA"), | |
518 | part_1_Name("NA"), | |
519 | part_2_Name("NA"), | |
520 | part_3_Name("NA"), | |
521 | pair_12_Name("NA"), | |
522 | pair_13_Name("NA"), | |
523 | pair_23_Name("NA"), | |
524 | tripletName("NA"), | |
525 | ||
526 | avg("NA"), | |
527 | avgName("NA"), | |
528 | sumName("NA"), | |
529 | s1ptName("NA"), | |
530 | s1ptNwName("NA"), | |
531 | s1DptName("NA"), | |
532 | ||
533 | s2PtPtName("NA"), | |
534 | s2NPtName("NA"), | |
535 | s2PtNName("NA"), | |
536 | s2DptDptName("NA"), | |
537 | ||
538 | s2PtPtNwName("NA"), | |
539 | s2NPtNwName("NA"), | |
540 | s2PtNNwName("NA"), | |
541 | ||
542 | ptName("NA"), | |
543 | ptptName("NA"), | |
544 | pt1pt1Name("NA"), | |
545 | DptName("NA"), | |
546 | DptDptName("NA"), | |
547 | RDptDptName("NA"), | |
548 | nPtName("NA"), | |
549 | ptNName("NA"), | |
550 | seanName("NA"), | |
551 | ||
552 | _title_counts("NA"), | |
553 | ||
554 | _title_m0("NA"), | |
555 | _title_m1("NA"), | |
556 | _title_m2("NA"), | |
557 | _title_m3("NA"), | |
558 | _title_m4("NA"), | |
559 | _title_m5("NA"), | |
560 | _title_m6("NA"), | |
561 | ||
562 | _title_eta_1("NA"), | |
563 | _title_phi_1("NA"), | |
564 | _title_pt_1("NA"), | |
565 | _title_etaPhi_1("NA"), | |
566 | _title_n_1("NA"), | |
567 | _title_SumPt_1("NA"), | |
568 | _title_AvgPt_1("NA"), | |
569 | _title_AvgN_1("NA"), | |
570 | _title_AvgSumPt_1("NA"), | |
571 | ||
572 | _title_eta_2("NA"), | |
573 | _title_phi_2("NA"), | |
574 | _title_pt_2("NA"), | |
575 | _title_etaPhi_2("NA"), | |
576 | _title_n_2("NA"), | |
577 | _title_SumPt_2("NA"), | |
578 | _title_AvgPt_2("NA"), | |
579 | _title_AvgN_2("NA"), | |
580 | _title_AvgSumPt_2("NA"), | |
581 | ||
582 | _title_etaPhi_12("NA"), | |
583 | ||
584 | _title_AvgN2_12("NA"), | |
585 | _title_AvgSumPtPt_12("NA"), | |
586 | _title_AvgSumPtN_12("NA"), | |
587 | _title_AvgNSumPt_12("NA"), | |
588 | ||
589 | vsZ("NA"), | |
590 | vsM("NA"), | |
591 | vsPt("NA"), | |
592 | vsPhi("NA"), | |
593 | vsEta("NA"), | |
594 | vsEtaPhi("NA"), | |
595 | vsPtVsPt("NA") | |
596 | { | |
597 | printf("2nd constructor called "); | |
598 | ||
599 | DefineOutput(0, TList::Class()); | |
600 | ||
601 | printf("passed "); | |
602 | ||
603 | } | |
604 | ||
605 | AliAnalysisTaskDptDptCorrelations::~AliAnalysisTaskDptDptCorrelations() | |
606 | { | |
607 | /* | |
608 | delete _id_1; | |
609 | delete _charge_1; | |
610 | delete _iEtaPhi_1; | |
611 | delete _iPt_1; | |
612 | delete _pt_1; | |
613 | delete _px_1; | |
614 | delete _py_1; | |
615 | delete _pz_1; | |
616 | delete _correction_1; | |
617 | delete _dedx_1; | |
618 | delete __n1_1_vsPt; | |
619 | delete __n1_1_vsEtaPhi; | |
620 | delete __s1pt_1_vsEtaPhi; | |
621 | delete __n1_1_vsZEtaPhiPt; | |
622 | if (_correctionWeight_1) delete _correctionWeight_1; | |
623 | ||
624 | if (!_sameFilter) | |
625 | { | |
626 | delete _id_2; | |
627 | delete _charge_2; | |
628 | delete _iEtaPhi_2; | |
629 | delete _iPt_2; | |
630 | delete _pt_2; | |
631 | delete _px_2; | |
632 | delete _py_2; | |
633 | delete _pz_2; | |
634 | delete _correction_2; | |
635 | delete _dedx_2; | |
636 | delete __n1_2_vsPt; | |
637 | delete __n1_2_vsEtaPhi; | |
638 | delete __s1pt_2_vsEtaPhi; | |
639 | delete __n1_2_vsZEtaPhiPt; | |
640 | if (_correctionWeight_2) delete _correctionWeight_2; | |
641 | } | |
642 | ||
643 | if (!_singlesOnly) | |
644 | { | |
645 | delete __n2_12_vsPtPt; | |
646 | delete __n2_12_vsEtaPhi; | |
647 | delete __s2ptpt_12_vsEtaPhi; | |
648 | delete __s2PtN_12_vsEtaPhi; | |
649 | delete __s2NPt_12_vsEtaPhi; | |
650 | } | |
651 | */ | |
652 | } | |
653 | ||
654 | void AliAnalysisTaskDptDptCorrelations::UserCreateOutputObjects() | |
655 | { | |
656 | cout<< "AliAnalysisTaskDptDptCorrelations::CreateOutputObjects() Starting " << endl; | |
657 | OpenFile(0); | |
658 | _outputHistoList = new TList(); | |
659 | _outputHistoList->SetOwner(); | |
660 | ||
661 | //if (_useWeights) DefineInput(2, TList::Class()); | |
662 | ||
663 | //Setup the parameters of the histograms | |
664 | _nBins_M0 = 500; _min_M0 = 0.; _max_M0 = 5000.; _width_M0 = (_max_M0-_min_M0)/_nBins_M0; | |
665 | _nBins_M1 = 500; _min_M1 = 0.; _max_M1 = 5000.; _width_M1 = (_max_M1-_min_M1)/_nBins_M1; | |
666 | _nBins_M2 = 500; _min_M2 = 0.; _max_M2 = 5000.; _width_M2 = (_max_M2-_min_M2)/_nBins_M2; | |
667 | _nBins_M3 = 500; _min_M3 = 0.; _max_M3 = 5000.; _width_M3 = (_max_M3-_min_M3)/_nBins_M3; | |
668 | _nBins_M4 = 100; _min_M4 = 0.; _max_M4 = 100.; _width_M4 = (_max_M4-_min_M4)/_nBins_M4; | |
669 | _nBins_M5 = 100; _min_M5 = 0.; _max_M5 = 100.; _width_M5 = (_max_M5-_min_M5)/_nBins_M5; | |
670 | _nBins_M6 = 100; _min_M6 = 0.; _max_M6 = 100.; _width_M6 = (_max_M6-_min_M6)/_nBins_M6; | |
671 | ||
672 | _min_vertexZ = _vertexZMin; | |
673 | _max_vertexZ = _vertexZMax; | |
674 | _width_vertexZ = 0.5; | |
675 | _nBins_vertexZ = int(0.5+ (_max_vertexZ - _min_vertexZ)/_width_vertexZ); | |
676 | _nBins_pt_1 = int(0.5+ (_max_pt_1 -_min_pt_1 )/_width_pt_1); | |
677 | _nBins_eta_1 = int(0.5+ (_max_eta_1-_min_eta_1)/_width_eta_1); | |
678 | _width_phi_1 = (_max_phi_1 - _min_phi_1) /_nBins_phi_1; | |
679 | _nBins_etaPhi_1 = _nBins_phi_1 * _nBins_eta_1; | |
680 | _nBins_etaPhiPt_1 = _nBins_etaPhi_1 * _nBins_pt_1; | |
681 | _nBins_zEtaPhiPt_1 = _nBins_vertexZ * _nBins_etaPhiPt_1; | |
682 | ||
683 | _nBins_pt_2 = int(0.5+ (_max_pt_2 -_min_pt_2 )/_width_pt_2); | |
684 | _nBins_eta_2 = int(0.5+ (_max_eta_2-_min_eta_2)/_width_eta_2); | |
685 | _width_phi_2 = (_max_phi_2 - _min_phi_2) /_nBins_phi_2; | |
686 | _nBins_etaPhi_2 = _nBins_phi_2 * _nBins_eta_2; | |
687 | _nBins_etaPhiPt_2 = _nBins_etaPhi_2 * _nBins_pt_2; | |
688 | _nBins_zEtaPhiPt_2 = _nBins_vertexZ * _nBins_etaPhiPt_2; | |
689 | _nBins_etaPhi_12 = _nBins_etaPhi_1 * _nBins_etaPhi_2; | |
690 | ||
691 | //setup the work arrays | |
692 | ||
693 | _id_1 = new int[arraySize]; | |
694 | _charge_1 = new int[arraySize]; | |
695 | //_iPhi_1 = new int[arraySize]; | |
696 | //_iEta_1 = new int[arraySize]; | |
697 | _iEtaPhi_1 = new int[arraySize]; | |
698 | _iPt_1 = new int[arraySize]; | |
699 | _pt_1 = new float[arraySize]; | |
700 | _px_1 = new float[arraySize]; | |
701 | _py_1 = new float[arraySize]; | |
702 | _pz_1 = new float[arraySize]; | |
703 | //_phi_1 = new float[arraySize]; | |
704 | //_eta_1 = new float[arraySize]; | |
705 | _correction_1 = new float[arraySize]; | |
706 | _dedx_1 = new float[arraySize]; | |
707 | ||
708 | __n1_1_vsPt = getDoubleArray(_nBins_pt_1, 0.); | |
709 | __n1_1_vsEtaPhi = getDoubleArray(_nBins_etaPhi_1, 0.); | |
710 | __s1pt_1_vsEtaPhi = getDoubleArray(_nBins_etaPhi_1, 0.); | |
711 | __n1_1_vsZEtaPhiPt = getFloatArray(_nBins_zEtaPhiPt_1, 0.); | |
712 | ||
713 | cout << "==========================================================================================" << endl; | |
714 | cout << "=============== Booking for particle 1 done." << endl; | |
715 | cout << "_requestedCharge_1: " << _requestedCharge_1 << endl; | |
716 | cout << "_requestedCharge_2: " << _requestedCharge_2 << endl; | |
717 | ||
718 | if (_requestedCharge_2!=_requestedCharge_1) | |
719 | { | |
720 | cout << " creating arrays for particle 2 with size: " << arraySize << endl; | |
721 | _sameFilter = 0; | |
722 | //particle 2 | |
723 | _id_2 = new int[arraySize]; | |
724 | _charge_2 = new int[arraySize]; | |
725 | //_iPhi_2 = new int[arraySize]; | |
726 | //_iEta_2 = new int[arraySize]; | |
727 | _iEtaPhi_2 = new int[arraySize]; | |
728 | _iPt_2 = new int[arraySize]; | |
729 | _pt_2 = new float[arraySize]; | |
730 | _px_2 = new float[arraySize]; | |
731 | _py_2 = new float[arraySize]; | |
732 | _pz_2 = new float[arraySize]; | |
733 | //_phi_2 = new float[arraySize]; | |
734 | //_eta_2 = new float[arraySize]; | |
735 | _correction_2 = new float[arraySize]; | |
736 | _dedx_2 = new float[arraySize]; | |
737 | ||
738 | __n1_2_vsPt = getDoubleArray(_nBins_pt_2, 0.); | |
739 | __n1_2_vsEtaPhi = getDoubleArray(_nBins_etaPhi_2, 0.); | |
740 | __s1pt_2_vsEtaPhi = getDoubleArray(_nBins_etaPhi_2, 0.); | |
741 | __n1_2_vsZEtaPhiPt = getFloatArray(_nBins_zEtaPhiPt_2, 0.); | |
742 | ||
743 | } | |
744 | ||
745 | __n2_12_vsPtPt = getDoubleArray(_nBins_pt_1*_nBins_pt_2,0.); | |
746 | __n2_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
747 | __s2ptpt_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
748 | __s2PtN_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
749 | __s2NPt_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
750 | ||
751 | // Setup all the labels needed. | |
752 | ||
753 | part_1_Name = "_1"; | |
754 | part_2_Name = "_2"; | |
755 | pair_12_Name = "_12"; | |
756 | ||
757 | n1Name = "n1"; | |
758 | n2Name = "n2"; | |
759 | n1NwName = "n1Nw"; | |
760 | n2NwName = "n2Nw"; | |
761 | r1Name = "r1"; | |
762 | r2Name = "r2"; | |
763 | r3Name = "r3"; | |
764 | r2r1Name = "r2r1"; | |
765 | c2Name = "c2"; | |
766 | c3Name = "c3"; | |
767 | d3Name = "d3"; | |
768 | p3Name = "p3"; | |
769 | cName = "sean"; | |
770 | ||
771 | intR2Name = "intR2"; | |
772 | binCorrName = "binCorr"; | |
773 | intBinCorrName = "intBinCorr"; | |
774 | ||
775 | avgName = "avg"; | |
776 | sumName = "sum"; | |
777 | s1ptName = "sumPt"; | |
778 | s1ptNwName = "sumPtNw"; | |
779 | s1DptName = "sumDpt"; | |
780 | s2PtPtName = "sumPtPt"; | |
781 | s2PtPtNwName = "sumPtPtNw"; | |
782 | s2DptDptName = "sumDptDpt"; | |
783 | s2NPtName = "sumNPt"; | |
784 | s2NPtNwName = "sumNPtNw"; | |
785 | s2PtNName = "sumPtN"; | |
786 | s2NPtNwName = "sumNPtNw"; | |
787 | s2PtNNwName = "sumPtNNw"; | |
788 | ptName = "avgPt"; | |
789 | ptptName = "avgPtPt"; | |
790 | pt1pt1Name = "avgPtavgPt"; | |
791 | DptName = "avgDpt"; | |
792 | DptDptName = "avgDptDpt"; | |
793 | RDptDptName = "relDptDpt"; // ratio of avgDptDpt by avgPt*avgPt | |
794 | nPtName = "avgNpt"; | |
795 | ptNName = "avgPtN"; | |
796 | seanName = "seanC"; | |
797 | ||
798 | _title_counts = "yield"; | |
799 | ||
800 | _title_m0 = "M_{0}"; | |
801 | _title_m1 = "M_{1}"; | |
802 | _title_m2 = "M_{2}"; | |
803 | _title_m3 = "M_{3}"; | |
804 | _title_m4 = "V0Centrality"; | |
805 | _title_m5 = "TrkCentrality"; | |
806 | _title_m6 = "SpdCentrality"; | |
807 | ||
808 | _title_eta_1 = "#eta_{1}"; | |
809 | _title_phi_1 = "#varphi_{1} (radian)"; | |
810 | _title_etaPhi_1 = "#eta_{1}#times#varphi_{1}"; | |
811 | _title_pt_1 = "p_{t,1} (GeV/c)"; | |
812 | _title_n_1 = "n_{1}"; | |
813 | _title_SumPt_1 = "#Sigma p_{t,1} (GeV/c)"; | |
814 | _title_AvgPt_1 = "#LT p_{t,1} #GT (GeV/c)"; | |
815 | _title_AvgN_1 = "#LT n_{1} #GT"; | |
816 | _title_AvgSumPt_1 = "#LT #Sigma p_{t,1} #GT (GeV/c)"; | |
817 | ||
818 | _title_eta_2 = "#eta_{2}"; | |
819 | _title_phi_2 = "#varphi_{2} (radian)"; | |
820 | _title_etaPhi_2 = "#eta_{2}#times#varphi_{2}"; | |
821 | _title_pt_2 = "p_{t,2} (GeV/c)"; | |
822 | _title_n_2 = "n_{2}"; | |
823 | _title_SumPt_2 = "#Sigma p_{t,1} (GeV/c)"; | |
824 | _title_AvgPt_2 = "#LT p_{t,2} #GT (GeV/c)"; | |
825 | _title_AvgN_2 = "#LT n_{2} #GT"; | |
826 | _title_AvgSumPt_2 = "#LT #Sigma p_{t,2} #GT (GeV/c)"; | |
827 | ||
828 | _title_etaPhi_12 = "#eta_{1}#times#varphi_{1}#times#eta_{2}#times#varphi_{2}"; | |
829 | ||
830 | _title_AvgN2_12 = "#LT n_{2} #GT";; | |
831 | _title_AvgSumPtPt_12 = "#LT #Sigma p_{t,1}p_{t,2} #GT";; | |
832 | _title_AvgSumPtN_12 = "#LT #Sigma p_{t,1}N #GT";; | |
833 | _title_AvgNSumPt_12 = "#LT N#Sigma p_{t,2} #GT";; | |
834 | ||
835 | ||
836 | vsZ = "_vsZ"; | |
837 | vsM = "_vsM"; | |
838 | vsPt = "_vsPt"; | |
839 | vsPhi = "_vsPhi"; | |
840 | vsEta = "_vsEta"; | |
841 | vsEtaPhi = "_vsEtaPhi"; | |
842 | vsPtVsPt = "_vsPtVsPt"; | |
843 | ||
844 | ||
845 | if (_useWeights) | |
846 | { | |
847 | int iZ, iEtaPhi, iPt; | |
848 | int iZ1,iEtaPhi1,iPt1; | |
849 | int a, b; | |
850 | if (_weight_1) | |
851 | { | |
852 | _correctionWeight_1 = new float[_nBins_vertexZ*_nBins_etaPhi_1*_nBins_pt_1]; | |
853 | a = _nBins_pt_1; | |
854 | b = _nBins_etaPhi_1*_nBins_pt_1; | |
855 | for (iZ=0,iZ1=1; iZ<_nBins_vertexZ; iZ++, iZ1++) | |
856 | { | |
857 | for (iEtaPhi=0,iEtaPhi1=1; iEtaPhi<_nBins_etaPhi_1; iEtaPhi++, iEtaPhi1++) | |
858 | { | |
859 | for (iPt=0,iPt1=1; iPt<_nBins_pt_1; iPt++, iPt1++) | |
860 | { | |
861 | _correctionWeight_1[iZ*b+iEtaPhi*a+iPt] = _weight_1->GetBinContent(iZ1,iEtaPhi1,iPt1); | |
862 | } | |
863 | } | |
864 | } | |
865 | } // _weight_1 | |
866 | else | |
867 | { | |
868 | AliError("AliAnalysisTaskDptDptCorrelations:: _weight_1 is a null pointer."); | |
869 | return; | |
870 | } | |
871 | if (!_sameFilter) | |
872 | { | |
873 | if (_weight_2) | |
874 | { | |
875 | _correctionWeight_2 = new float[_nBins_vertexZ*_nBins_etaPhi_2*_nBins_pt_2]; | |
876 | a = _nBins_pt_2; | |
877 | b = _nBins_etaPhi_2*_nBins_pt_2; | |
878 | for (iZ=0,iZ1=1; iZ<_nBins_vertexZ; iZ++, iZ1++) | |
879 | { | |
880 | for (iEtaPhi=0,iEtaPhi1=1; iEtaPhi<_nBins_etaPhi_2; iEtaPhi++, iEtaPhi1++) | |
881 | { | |
882 | for (iPt=0,iPt1=1; iPt<_nBins_pt_2; iPt++, iPt1++) | |
883 | { | |
884 | _correctionWeight_2[iZ*b+iEtaPhi*a+iPt] = _weight_2->GetBinContent(iZ1,iEtaPhi1,iPt1); | |
885 | } | |
886 | } | |
887 | } | |
888 | } // _weight_2 | |
889 | else | |
890 | { | |
891 | AliError("AliAnalysisTaskDptDptCorrelations:: _weight_1 is a null pointer."); | |
892 | return; | |
893 | } | |
894 | } | |
895 | } | |
896 | ||
897 | createHistograms(); | |
898 | PostData(0,_outputHistoList); | |
899 | ||
900 | cout<< "AliAnalysisTaskDptDptCorrelations::CreateOutputObjects() DONE " << endl; | |
901 | ||
902 | } | |
903 | ||
904 | void AliAnalysisTaskDptDptCorrelations::createHistograms() | |
905 | { | |
906 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Event Histos"); | |
907 | TString name; | |
908 | ||
909 | name = "eventAccounting"; | |
910 | ||
911 | // bin index : what it is... | |
912 | // 0 : number of event submitted | |
913 | // 1 : number accepted by centrality cut | |
914 | // 2 : number accepted by centrality cut and z cut | |
915 | // 3 : total number of particles that satisfied filter 1 | |
916 | // 4 : total number of particles that satisfied filter 2 | |
239bac74 | 917 | _eventAccounting = createHisto1D(name,name,10, -0.5, 9.5, "event Code", _title_counts); |
918 | ||
919 | name = "m0"; _m0 = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m0, _title_counts); | |
920 | name = "m1"; _m1 = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m1, _title_counts); | |
921 | name = "m2"; _m2 = createHisto1D(name,name,_nBins_M2, _min_M2, _max_M2, _title_m2, _title_counts); | |
922 | name = "m3"; _m3 = createHisto1D(name,name,_nBins_M3, _min_M3, _max_M3, _title_m3, _title_counts); | |
923 | name = "m4"; _m4 = createHisto1D(name,name,_nBins_M4, _min_M4, _max_M4, _title_m4, _title_counts); | |
924 | name = "m5"; _m5 = createHisto1D(name,name,_nBins_M5, _min_M5, _max_M5, _title_m5, _title_counts); | |
925 | name = "m6"; _m6 = createHisto1D(name,name,_nBins_M6, _min_M6, _max_M6, _title_m6, _title_counts); | |
926 | name = "zV"; _vertexZ = createHisto1D(name,name,_nBins_vertexZ, _min_vertexZ, _max_vertexZ, "z-Vertex (cm)", _title_counts); | |
927 | ||
49f44fbe | 928 | |
929 | name = "Eta"; _etadis = createHisto1F(name,name, 200, -1.1, 1.1, "#eta","counts"); | |
930 | name = "Phi"; _phidis = createHisto1F(name,name, 360, 0.0, 6.4, "#phi","counts"); | |
931 | name = "DCAz"; _dcaz = createHisto1F(name,name, 500, -5.0, 5.0, "dcaZ","counts"); | |
932 | name = "DCAxy"; _dcaxy = createHisto1F(name,name, 500, -5.0, 5.0, "dcaXY","counts"); | |
933 | ||
934 | ||
239bac74 | 935 | if (_singlesOnly) |
9cabc5db | 936 | { |
239bac74 | 937 | name = n1Name+part_1_Name+vsPt; _n1_1_vsPt = createHisto1F(name,name, _nBins_pt_1, _min_pt_1, _max_pt_1, _title_pt_1, _title_AvgN_1); |
938 | name = n1Name+part_1_Name+vsZ+vsEtaPhi+vsPt; _n1_1_vsZVsEtaVsPhiVsPt = createHisto3F(name,name, _nBins_vertexZ,_min_vertexZ,_max_vertexZ, _nBins_etaPhi_1, 0., double(_nBins_etaPhi_1), _nBins_pt_1, _min_pt_1, _max_pt_1, "zVertex", _title_etaPhi_1, _title_pt_1); | |
939 | //name = "dedxVsP_1"; _dedxVsP_1 = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
940 | //name = "corrDedxVsP_1"; _corrDedxVsP_1 = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
941 | //name = "betaVsP_1"; _betaVsP_1 = createHisto2F(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts"); | |
942 | ||
943 | name = n1Name+part_2_Name+vsPt; _n1_2_vsPt = createHisto1F(name,name, _nBins_pt_2, _min_pt_2, _max_pt_2, _title_pt_2, _title_AvgN_2); | |
944 | name = n1Name+part_2_Name+vsZ+vsEtaPhi+vsPt; _n1_2_vsZVsEtaVsPhiVsPt = createHisto3F(name,name, _nBins_vertexZ,_min_vertexZ,_max_vertexZ, _nBins_etaPhi_2, 0., double(_nBins_etaPhi_2), _nBins_pt_2, _min_pt_2, _max_pt_2, "zVertex", _title_etaPhi_2, _title_pt_2); | |
945 | //name = "dedxVsP_2"; _dedxVsP_2 = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
946 | //name = "corrDedxVsP_2"; _corrDedxVsP_2 = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
947 | //name = "betaVsP_2"; _betaVsP_2 = createHisto2F(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts"); | |
948 | ||
949 | } | |
950 | else | |
951 | { | |
952 | name = n1Name+part_1_Name+vsEtaPhi; _n1_1_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_1, _min_eta_1, _max_eta_1, _nBins_phi_1, _min_phi_1, _max_phi_1, _title_eta_1, _title_phi_1, _title_AvgN_1); | |
953 | name = s1ptName+part_1_Name+vsEtaPhi; _s1pt_1_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_1, _min_eta_1, _max_eta_1, _nBins_phi_1, _min_phi_1, _max_phi_1, _title_eta_1, _title_phi_1, _title_AvgSumPt_1); | |
954 | name = n1Name+part_1_Name+vsM; _n1_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
955 | name = s1ptName+part_1_Name+vsM; _s1pt_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
956 | name = n1NwName+part_1_Name+vsM; _n1Nw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
957 | name = s1ptNwName+part_1_Name+vsM; _s1ptNw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
958 | ||
959 | name = n1Name+part_2_Name+vsEtaPhi; _n1_2_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_2, _min_eta_2, _max_eta_2, _nBins_phi_2, _min_phi_2, _max_phi_2, _title_eta_2, _title_phi_2, _title_AvgN_2); | |
960 | name = s1ptName+part_2_Name+vsEtaPhi; _s1pt_2_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_2, _min_eta_2, _max_eta_2, _nBins_phi_2, _min_phi_2, _max_phi_2, _title_eta_2, _title_phi_2, _title_AvgSumPt_2); | |
961 | name = n1Name+part_2_Name + vsM; _n1_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_2); | |
962 | name = s1ptName+part_2_Name + vsM; _s1pt_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_2); | |
963 | name = n1NwName+part_2_Name+vsM; _n1Nw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
964 | name = s1ptNwName+part_2_Name+vsM; _s1ptNw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
965 | ||
966 | name = n2Name+pair_12_Name+vsEtaPhi; _n2_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgN2_12); | |
967 | name = s2PtPtName+pair_12_Name + vsEtaPhi;_s2PtPt_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgSumPtPt_12); | |
968 | name = s2PtNName+pair_12_Name + vsEtaPhi; _s2PtN_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgSumPtN_12); | |
969 | name = s2NPtName+pair_12_Name + vsEtaPhi; _s2NPt_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgNSumPt_12); | |
970 | name = n2Name+pair_12_Name+vsPtVsPt; _n2_12_vsPtVsPt = createHisto2F(name,name, _nBins_pt_1, _min_pt_1, _max_pt_1, _nBins_pt_2, _min_pt_2, _max_pt_2, _title_pt_1, _title_pt_2, _title_AvgN2_12); | |
9cabc5db | 971 | |
239bac74 | 972 | name = n2Name+pair_12_Name + vsM; _n2_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12); |
973 | name = s2PtPtName+pair_12_Name + vsM; _s2PtPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12); | |
974 | name = s2PtNName+pair_12_Name + vsM; _s2PtN_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12); | |
975 | name = s2NPtName+pair_12_Name + vsM; _s2NPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12); | |
9cabc5db | 976 | |
239bac74 | 977 | name = n2NwName+pair_12_Name + vsM; _n2Nw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12); |
978 | name = s2PtPtNwName+pair_12_Name + vsM; _s2PtPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12); | |
979 | name = s2PtNNwName+pair_12_Name + vsM; _s2PtNNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12); | |
980 | name = s2NPtNwName+pair_12_Name + vsM; _s2NPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12); | |
9cabc5db | 981 | |
239bac74 | 982 | name = "mInv"; _invMass = createHisto1F(name,name, 500, 0., 1.000, "M_{inv}","counts"); |
983 | name = "mInvElec"; _invMassElec = createHisto1F(name,name, 500, 0., 1.000, "M_{inv}","counts"); | |
9cabc5db | 984 | } |
985 | ||
986 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() All Done"); | |
987 | } | |
988 | //-----------------------// | |
989 | ||
990 | void AliAnalysisTaskDptDptCorrelations::finalizeHistograms() | |
991 | { | |
992 | ||
993 | AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() starting"); | |
994 | AliInfo(Form("CorrelationAnalyzers::finalizeHistograms() _eventCount : %d",int(_eventCount))); | |
239bac74 | 995 | if (_singlesOnly) |
9cabc5db | 996 | { |
239bac74 | 997 | if (_sameFilter) |
998 | { | |
999 | fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
1000 | fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
1001 | fillHistoWithArray(_n1_2_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
1002 | fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
1003 | } | |
1004 | else | |
1005 | { | |
1006 | fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
1007 | fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
1008 | fillHistoWithArray(_n1_2_vsPt, __n1_2_vsPt, _nBins_pt_2); | |
1009 | fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_2_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_2, _nBins_pt_2); | |
1010 | } | |
9cabc5db | 1011 | } |
1012 | else | |
1013 | { | |
239bac74 | 1014 | if (_sameFilter) |
1015 | { | |
1016 | fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
1017 | fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
1018 | fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
1019 | fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
1020 | } | |
1021 | else | |
1022 | { | |
1023 | fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
1024 | fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
1025 | fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2); | |
1026 | fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2); | |
1027 | } | |
9cabc5db | 1028 | fillHistoWithArray(_n2_12_vsEtaPhi, __n2_12_vsEtaPhi, _nBins_etaPhi_12); |
1029 | fillHistoWithArray(_s2PtPt_12_vsEtaPhi, __s2ptpt_12_vsEtaPhi, _nBins_etaPhi_12); | |
1030 | fillHistoWithArray(_s2PtN_12_vsEtaPhi, __s2PtN_12_vsEtaPhi, _nBins_etaPhi_12); | |
1031 | fillHistoWithArray(_s2NPt_12_vsEtaPhi, __s2NPt_12_vsEtaPhi, _nBins_etaPhi_12); | |
239bac74 | 1032 | fillHistoWithArray(_n2_12_vsPtVsPt, __n2_12_vsPtPt, _nBins_pt_1, _nBins_pt_2); |
1033 | ||
1034 | } | |
9cabc5db | 1035 | AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() Done "); |
1036 | } | |
1037 | //--------------// | |
1038 | ||
1039 | ||
ba6301d5 | 1040 | void AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/) |
9cabc5db | 1041 | { |
1042 | ||
1043 | int k1,k2; | |
1044 | int iPhi, iEta, iEtaPhi, iPt, charge; | |
239bac74 | 1045 | float q, p, phi, pt, eta, corr, corrPt, dedx, px, py, pz; |
9cabc5db | 1046 | int ij; |
1047 | int id_1, q_1, iEtaPhi_1, iPt_1; | |
1048 | float pt_1, px_1, py_1, pz_1, corr_1, dedx_1; | |
1049 | int id_2, q_2, iEtaPhi_2, iPt_2; | |
1050 | float pt_2, px_2, py_2, pz_2, corr_2, dedx_2; | |
1051 | float ptpt; | |
1052 | int iVertex, iVertexP1, iVertexP2; | |
1053 | int iZEtaPhiPt; | |
1054 | float massElecSq = 2.5e-7; | |
1055 | double b[2]; | |
1056 | double bCov[3]; | |
1057 | const AliAODVertex* vertex; | |
1058 | int nClus; | |
1059 | bool bitOK; | |
ba6301d5 | 1060 | |
9cabc5db | 1061 | // count all events looked at here |
1062 | _eventCount++; | |
2e00326e | 1063 | |
2e00326e | 1064 | // A. Adare - Fix from above to avoid coverity complaint about null dereference |
1065 | if (_eventAccounting) | |
1066 | { | |
1067 | _eventAccounting->Fill(0);// count all calls to this function | |
1068 | } | |
239bac74 | 1069 | else |
1070 | { | |
2e00326e | 1071 | cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - !_eventAccounting" << endl; |
1072 | cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - Skip this task" << endl; | |
1073 | return; | |
239bac74 | 1074 | } |
2e00326e | 1075 | |
9cabc5db | 1076 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 1" << endl; |
1077 | ||
1078 | //Get pointer to current event | |
239bac74 | 1079 | //fESDEvent = dynamic_cast<AliESDEvent*> (InputEvent()); |
9cabc5db | 1080 | fAODEvent = dynamic_cast<AliAODEvent*> (InputEvent()); |
1081 | ||
239bac74 | 1082 | // if(!fAODEvent && !fESDEvent) |
1083 | if(!fAODEvent) | |
9cabc5db | 1084 | { |
239bac74 | 1085 | AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) !fAODEvent"); |
9cabc5db | 1086 | return; |
1087 | } | |
1088 | ||
1089 | _eventAccounting->Fill(1);// count all calls to this function with a valid pointer | |
9cabc5db | 1090 | //reset single particle counters |
1091 | k1 = k2 = 0; | |
1092 | __n1_1 = __n1_2 = __s1pt_1 = __s1pt_2 = __n1Nw_1 = __n1Nw_2 = __s1ptNw_1 = __s1ptNw_2 = 0; | |
1093 | ||
1094 | float v0Centr = -999.; | |
1095 | float trkCentr = -999.; | |
1096 | float spdCentr = -999.; | |
1097 | ||
1098 | float vertexX = -999; | |
1099 | float vertexY = -999; | |
1100 | float vertexZ = -999; | |
1101 | float vertexXY = -999; | |
1102 | //float dcaX = -999; | |
1103 | //float dcaY = -999; | |
1104 | float dcaZ = -999; | |
1105 | float dcaXY = -999; | |
1106 | float centrality = -999; | |
1107 | ||
9cabc5db | 1108 | if(fAODEvent) |
1109 | { | |
1110 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 5" << endl; | |
1111 | ||
1112 | //Centrality | |
1113 | AliCentrality* centralityObject = fAODEvent->GetHeader()->GetCentralityP(); | |
1114 | if (centralityObject) | |
1115 | { | |
1116 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 6" << endl; | |
1117 | ||
1118 | v0Centr = centralityObject->GetCentralityPercentile("V0M"); | |
1119 | trkCentr = centralityObject->GetCentralityPercentile("TRK"); | |
1120 | spdCentr = centralityObject->GetCentralityPercentile("CL1"); | |
1121 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 7" << endl; | |
1122 | ||
1123 | } | |
1124 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 8" << endl; | |
1125 | ||
1126 | _nTracks = fAODEvent->GetNTracks(); | |
239bac74 | 1127 | //_mult0 = 0; |
1128 | //_mult1 = 0; | |
1129 | //_mult2 = 0; | |
9cabc5db | 1130 | _mult3 = _nTracks; |
1131 | _mult4 = v0Centr; | |
1132 | _mult5 = trkCentr; | |
1133 | _mult6 = spdCentr; | |
1134 | _field = fAODEvent->GetMagneticField(); | |
1135 | ||
1136 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - _field:" << _field << endl; | |
1137 | ||
1138 | //_centralityMethod | |
1139 | switch (_centralityMethod) | |
1140 | { | |
1141 | case 0: centrality = _mult0; break; | |
1142 | case 1: centrality = _mult1; break; | |
1143 | case 2: centrality = _mult2; break; | |
1144 | case 3: centrality = _mult3; break; | |
1145 | case 4: centrality = _mult4; break; | |
1146 | case 5: centrality = _mult5; break; | |
1147 | case 6: centrality = _mult6; break; | |
1148 | } | |
1149 | ||
1150 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 10" << endl; | |
1151 | ||
1152 | //filter on centrality | |
7e9200f4 | 1153 | // require the v0 and trk centralities to agree within 5%. |
1154 | ||
1155 | //if ((Float_t(GetTPCMult(fAOD)) > (-40.3+1.22*GetGlobalMult(fAOD))) && (Float_t(GetTPCMult(fAOD)) < (32.1+1.59*GetGlobalMult(fAOD)))) {//3 sigma | |
1156 | ||
1157 | ||
1158 | if ( centrality < _centralityMin || | |
1159 | centrality > _centralityMax || | |
1160 | fabs(v0Centr-trkCentr)>5.0) | |
9cabc5db | 1161 | { |
1162 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 11" << endl; | |
1163 | ||
1164 | // we dont analyze this event here... | |
1165 | return; | |
1166 | } | |
1167 | _eventAccounting->Fill(2);// count all events with right centrality | |
1168 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 12" << endl; | |
1169 | ||
1170 | // filter on z and xy vertex | |
1171 | vertex = (AliAODVertex*) fAODEvent->GetPrimaryVertexSPD(); | |
1172 | if (!vertex || vertex->GetNContributors()<1) | |
1173 | { | |
1174 | vertexZ = -999; | |
1175 | vertexXY = -999; | |
1176 | cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - No valid vertex object or poor vertex" << endl; | |
1177 | } | |
1178 | else | |
1179 | { | |
1180 | vertexX = vertex->GetX(); | |
1181 | vertexY = vertex->GetY(); | |
1182 | vertexZ = vertex->GetZ(); | |
1183 | vertexXY = sqrt(vertexX*vertexX+vertexY*vertexY); | |
1184 | } | |
9cabc5db | 1185 | if (!vertex || |
1186 | vertexZ < _vertexZMin || | |
1187 | vertexZ > _vertexZMax || | |
1188 | vertexXY < _vertexXYMin || | |
1189 | vertexXY > _vertexXYMax) | |
1190 | return; | |
1191 | ||
9cabc5db | 1192 | iVertex = int((vertexZ-_min_vertexZ)/_width_vertexZ); |
1193 | iVertexP1 = iVertex*_nBins_etaPhiPt_1; | |
1194 | iVertexP2 = iVertex*_nBins_etaPhiPt_2; | |
1195 | if (iVertex<0 || iVertex>=_nBins_vertexZ) | |
1196 | { | |
1197 | AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) iVertex<0 || iVertex>=_nBins_vertexZ "); | |
1198 | return; | |
1199 | } | |
1200 | _eventAccounting->Fill(3);// count all calls to this function with a valid pointer | |
9cabc5db | 1201 | |
1202 | // loop over all particles for singles | |
1203 | //debug() << "_nTracks:"<< _nTracks << endl; | |
1204 | for (int iTrack=0; iTrack< _nTracks; iTrack++) | |
1205 | { | |
1206 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 16 iTrack:" << iTrack << endl; | |
1207 | ||
1208 | AliAODTrack * t = (AliAODTrack *) fAODEvent->GetTrack(iTrack); | |
1209 | if (!t) | |
1210 | { | |
1211 | AliError(Form("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) No track ofr iTrack=%d", iTrack)); | |
1212 | continue; | |
1213 | } | |
1214 | ||
1215 | q = t->Charge(); | |
1216 | charge = int(q); | |
1217 | phi = t->Phi(); | |
1218 | p = t->P(); | |
1219 | pt = t->Pt(); | |
1220 | px = t->Px(); | |
1221 | py = t->Py(); | |
1222 | pz = t->Pz(); | |
1223 | eta = t->Eta(); | |
1224 | dedx = t->GetTPCsignal(); | |
1225 | nClus = t->GetTPCNcls(); | |
1226 | bitOK = t->TestFilterBit(_trackFilterBit); | |
1227 | ||
1228 | //cout << "_trackFilterBit:" << _trackFilterBit << " Track returns:" << bitOK << endl; | |
1229 | //cout << " q:" << q << " _requestedCharge_1:" << _requestedCharge_1 << endl; | |
1230 | //cout << " pt:" << pt << " _min_pt_1:" << _min_pt_1 << " _max_pt_1:" << _max_pt_1<< endl; | |
1231 | //cout << " phi:" << phi << endl; | |
1232 | //cout << " eta:" << eta << " _min_eta_1:" << _min_eta_1 << " _max_eta_1:" << _max_eta_1<< endl; | |
1233 | //cout << " dedx:" << dedx << " _dedxMin:" << _dedxMin << " _dedxMax:" << _dedxMax << endl; | |
1234 | //cout << "nclus:" << nClus<< " _nClusterMin:" << _nClusterMin << endl; | |
239bac74 | 1235 | |
1236 | //common cuts first | |
1237 | ||
1238 | if (!bitOK || dedx<_dedxMin || dedx>_dedxMax || nClus<_nClusterMin) continue; | |
1239 | //Particle 1 | |
1240 | if (_requestedCharge_1 == charge && | |
9cabc5db | 1241 | pt >= _min_pt_1 && |
1242 | pt < _max_pt_1 && | |
1243 | eta >= _min_eta_1 && | |
239bac74 | 1244 | eta < _max_eta_1) |
9cabc5db | 1245 | { |
49f44fbe | 1246 | |
1247 | /* | |
9cabc5db | 1248 | if (t->PropagateToDCA(vertex, _field, 100., b, bCov) ) |
1249 | { | |
1250 | dcaXY = b[0]; | |
1251 | dcaZ = b[1]; | |
1252 | } | |
1253 | else | |
1254 | { | |
1255 | dcaXY = -999999; | |
1256 | dcaZ = -999999; | |
1257 | } | |
49f44fbe | 1258 | */ |
1259 | ||
1260 | dcaXY = t->DCA(); //new change Prabhat | |
1261 | dcaZ = t->ZAtDCA(); //new change Prabhat | |
1262 | ||
1263 | // skip track if DCA too large | |
1264 | if (dcaZ < _dcaZMin || | |
1265 | dcaZ > _dcaZMax || | |
1266 | dcaXY < _dcaXYMin || | |
1267 | dcaXY > _dcaXYMax) | |
1268 | continue; //track does not have a valid DCA | |
1269 | ||
1270 | ||
1271 | //if (dcaZ > _dcaZMax) continue; | |
1272 | //cout <<"Prabhat=============="<<" "<<_dcaZMax<<" "<<dcaZ<<endl; | |
1273 | _etadis->Fill(eta); //prabhat QA | |
1274 | _phidis->Fill(phi); | |
1275 | _dcaz->Fill(dcaZ); //Prabhat QA | |
1276 | _dcaxy->Fill(dcaXY); | |
9cabc5db | 1277 | |
1fe5f536 | 1278 | |
9cabc5db | 1279 | iPhi = int( phi/_width_phi_1); |
49f44fbe | 1280 | |
9cabc5db | 1281 | if (iPhi<0 || iPhi>=_nBins_phi_1 ) |
1282 | { | |
1283 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze() iPhi<0 || iPhi>=_nBins_phi_1"); | |
1284 | return; | |
1285 | } | |
1286 | ||
1287 | iEta = int((eta-_min_eta_1)/_width_eta_1); | |
1288 | if (iEta<0 || iEta>=_nBins_eta_1) | |
1289 | { | |
1290 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iEta: %d", iEta)); | |
1291 | continue; | |
1292 | } | |
1293 | iPt = int((pt -_min_pt_1 )/_width_pt_1 ); | |
1294 | if (iPt<0 || iPt >=_nBins_pt_1) | |
1295 | { | |
1296 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iPt: %d",iPt)); | |
1297 | continue; | |
1298 | } | |
1299 | iEtaPhi = iEta*_nBins_phi_1+iPhi; | |
1300 | iZEtaPhiPt = iVertexP1 + iEtaPhi*_nBins_pt_1 + iPt; | |
1301 | ||
1302 | if (_correctionWeight_1) | |
1303 | corr = _correctionWeight_1[iZEtaPhiPt]; | |
1304 | else | |
1305 | corr = 1; | |
1306 | if (iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1) | |
1307 | { | |
1308 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1"); | |
1309 | continue; | |
1310 | } | |
49f44fbe | 1311 | |
9cabc5db | 1312 | |
239bac74 | 1313 | if (_singlesOnly) |
9cabc5db | 1314 | { |
49f44fbe | 1315 | |
239bac74 | 1316 | __n1_1_vsPt[iPt] += corr; //cout << "step 15" << endl; |
1317 | __n1_1_vsZEtaPhiPt[iZEtaPhiPt] += corr; //cout << "step 12" << endl; | |
1318 | ||
1319 | } | |
1320 | else | |
1321 | { | |
1322 | corrPt = corr*pt; | |
1323 | _id_1[k1] = iTrack; | |
1324 | _charge_1[k1] = charge; | |
1325 | _iEtaPhi_1[k1] = iEtaPhi; | |
1326 | _iPt_1[k1] = iPt; | |
1327 | _pt_1[k1] = pt; | |
1328 | _px_1[k1] = px; | |
1329 | _py_1[k1] = py; | |
1330 | _pz_1[k1] = pz; | |
1331 | _correction_1[k1] = corr; | |
1332 | __n1_1 += corr; | |
1333 | __n1_1_vsEtaPhi[iEtaPhi] += corr; | |
1334 | __s1pt_1 += corrPt; | |
1335 | __s1pt_1_vsEtaPhi[iEtaPhi] += corrPt; | |
1336 | __n1Nw_1 += 1; | |
1337 | __s1ptNw_1 += pt; | |
1338 | ++k1; | |
1339 | if (k1>=arraySize) | |
1340 | { | |
1341 | AliError(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) k1 >=arraySize; arraySize: %d",arraySize)); | |
1342 | return; | |
1343 | } | |
9cabc5db | 1344 | } |
1345 | } | |
1346 | ||
1347 | if (!_sameFilter && | |
9cabc5db | 1348 | _requestedCharge_2 == charge && |
1349 | pt >= _min_pt_2 && | |
1350 | pt < _max_pt_2 && | |
1351 | eta >= _min_eta_2 && | |
239bac74 | 1352 | eta < _max_eta_2) |
9cabc5db | 1353 | { |
49f44fbe | 1354 | /* |
1355 | if (t->PropagateToDCA(vertex, _field, 100., b, bCov) ) | |
1356 | { | |
1357 | dcaXY = b[0]; | |
1358 | dcaZ = b[1]; | |
1359 | } | |
1360 | else | |
1361 | { | |
1362 | dcaXY = -999999; | |
1363 | dcaZ = -999999; | |
1364 | } | |
1365 | */ | |
1366 | ||
1367 | dcaXY = t->DCA(); //new change Prabhat | |
1368 | dcaZ = t->ZAtDCA(); //new change Prabhat | |
1369 | //if (dcaZ > _dcaZMax) continue; | |
1370 | //cout <<"Prabhat=============="<<" "<<_dcaZMax<<" "<<dcaZ<<endl; | |
1fe5f536 | 1371 | |
49f44fbe | 1372 | |
1373 | if (dcaZ < _dcaZMin || | |
1374 | dcaZ > _dcaZMax || | |
1375 | dcaXY < _dcaXYMin || | |
1376 | dcaXY > _dcaXYMax) | |
1377 | continue; //track does not have a valid DCA | |
1378 | ||
1379 | ||
1380 | iPhi = int( phi/_width_phi_2); | |
1381 | ||
9cabc5db | 1382 | if (iPhi<0 || iPhi>=_nBins_phi_2 ) |
1383 | { | |
1384 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze() iPhi<0 || iPhi>=_nBins_phi_1"); | |
1385 | return; | |
1386 | } | |
1387 | ||
1388 | iEta = int((eta-_min_eta_2)/_width_eta_2); | |
1389 | if (iEta<0 || iEta>=_nBins_eta_2) | |
1390 | { | |
1391 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iEta: %d", iEta)); | |
1392 | continue; | |
1393 | } | |
1394 | iPt = int((pt -_min_pt_2 )/_width_pt_2 ); | |
1395 | if (iPt<0 || iPt >=_nBins_pt_2) | |
1396 | { | |
1397 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iPt: %d",iPt)); | |
1398 | continue; | |
1399 | } | |
1400 | ||
1401 | iEtaPhi = iEta*_nBins_phi_2+iPhi; | |
1402 | iZEtaPhiPt = iVertexP2 + iEtaPhi*_nBins_pt_2 + iPt; | |
1403 | if (iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_2) | |
1404 | { | |
1405 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_2"); | |
1406 | continue; | |
1407 | } | |
49f44fbe | 1408 | |
1409 | ||
9cabc5db | 1410 | if (_correctionWeight_2) |
1411 | corr = _correctionWeight_2[iZEtaPhiPt]; | |
1412 | else | |
1413 | corr = 1; | |
49f44fbe | 1414 | //dpt = pt - (charge>0) ? _avgPt_vsEtaPhi_2p[iEtaPhi] : _avgPt_vsEtaPhi_2m[iEtaPhi]; |
1415 | ||
239bac74 | 1416 | if (_singlesOnly) |
9cabc5db | 1417 | { |
49f44fbe | 1418 | //_dedxVsP_2->Fill(p*q,dedx); |
1419 | __n1_2_vsPt[iPt] += corr; //cout << "step 15" << endl; | |
1420 | __n1_2_vsZEtaPhiPt[iZEtaPhiPt] += corr; //cout << "step 12" << endl; | |
239bac74 | 1421 | } |
1422 | else | |
1423 | { | |
1424 | corrPt = corr*pt; | |
1425 | _id_2[k2] = iTrack; //cout << "step 1" << endl; | |
1426 | _charge_2[k2] = charge; //cout << "step 2" << endl; | |
1427 | _iEtaPhi_2[k2] = iEtaPhi; //cout << "step 3" << endl; | |
1428 | _iPt_2[k2] = iPt; //cout << "step 4" << endl; | |
1429 | _pt_2[k2] = pt; //cout << "step 5" << endl; | |
1430 | _px_2[k2] = px; //cout << "step 6" << endl; | |
1431 | _py_2[k2] = py; //cout << "step 7" << endl; | |
1432 | _pz_2[k2] = pz; //cout << "step 8" << endl; | |
1433 | _correction_2[k2] = corr; //cout << "step 9" << endl; | |
1434 | __n1_2 += corr; //cout << "step 10" << endl; | |
1435 | __s1pt_2 += corrPt; //cout << "step 13" << endl; | |
1436 | __n1Nw_2 += 1; | |
1437 | __n1_2_vsEtaPhi[iEtaPhi] += corr; //cout << "step 11" << endl; | |
1438 | __s1pt_2_vsEtaPhi[iEtaPhi] += corrPt; //cout << "step 14" << endl; | |
1439 | __s1ptNw_2 += pt; | |
1440 | ++k2; | |
1441 | if (k2>=arraySize) | |
1442 | { | |
1443 | AliWarning(Form("-W- k2 >=arraySize; arraySize: %d",arraySize)); | |
1444 | return; | |
1445 | } | |
9cabc5db | 1446 | } |
9cabc5db | 1447 | |
1448 | //cout << "done with track" << endl; | |
1449 | } //iTrack | |
239bac74 | 1450 | } //aod |
9cabc5db | 1451 | } |
239bac74 | 1452 | |
9cabc5db | 1453 | |
1454 | //cout << "Filling histograms now" << endl; | |
1455 | _m0->Fill(_mult0); | |
1456 | _m1->Fill(_mult1); | |
1457 | _m2->Fill(_mult2); | |
1458 | _m3->Fill(_mult3); | |
1459 | _m4->Fill(_mult4); | |
1460 | _m5->Fill(_mult5); | |
1461 | _m6->Fill(_mult6); | |
1462 | _vertexZ->Fill(vertexZ); | |
239bac74 | 1463 | |
1464 | if (_singlesOnly) | |
9cabc5db | 1465 | { |
239bac74 | 1466 | // nothing to do here. |
9cabc5db | 1467 | } |
1468 | else | |
1469 | { | |
239bac74 | 1470 | if (_sameFilter) |
9cabc5db | 1471 | { |
239bac74 | 1472 | _n1_1_vsM->Fill(centrality, __n1_1); |
1473 | _s1pt_1_vsM->Fill(centrality, __s1pt_1); | |
1474 | _n1Nw_1_vsM->Fill(centrality, __n1Nw_1); | |
1475 | _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1); | |
1476 | _n1_2_vsM->Fill(centrality, __n1_1); | |
1477 | _s1pt_2_vsM->Fill(centrality, __s1pt_1); | |
1478 | _n1Nw_2_vsM->Fill(centrality, __n1Nw_1); | |
1479 | _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_1); | |
1480 | // reset pair counters | |
1481 | __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0; | |
1482 | __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0; | |
1483 | if (_field>0) | |
9cabc5db | 1484 | { |
239bac74 | 1485 | for (int i1=0; i1<k1; i1++) |
1486 | { | |
1487 | ////cout << " i1:" << i1 << endl; | |
1488 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1489 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1490 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1491 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1492 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1493 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
1494 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; | |
1495 | //1 and 2 | |
1496 | for (int i2=i1+1; i2<k1; i2++) | |
1497 | { | |
1498 | ////cout << " i2:" << i2 << endl; | |
1499 | id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl; | |
1500 | if (id_1!=id_2) | |
9cabc5db | 1501 | { |
239bac74 | 1502 | q_2 = _charge_1[i2]; ////cout << " q_1:" << q_1 << endl; |
1503 | iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1504 | iPt_2 = _iPt_1[i2]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1505 | corr_2 = _correction_1[i2]; ////cout << " corr_1:" << corr_1 << endl; | |
1506 | pt_2 = _pt_1[i2]; ////cout << " pt_1:" << pt_1 << endl; | |
1507 | dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl; | |
1508 | corr = corr_1*corr_2; | |
1509 | if (q_2>q_1 || (q_1>0 && q_2>0 && pt_2<=pt_1) || (q_1<0 && q_2<0 && pt_2>=pt_1)) | |
1510 | { | |
1511 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
1512 | } | |
1513 | else // swap particles | |
1514 | { | |
1515 | ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl; | |
1516 | } | |
1517 | ||
1518 | __n2_12 += corr; | |
1519 | __n2_12_vsEtaPhi[ij] += corr; | |
1520 | ptpt = pt_1*pt_2; | |
1521 | __s2ptpt_12 += corr*ptpt; | |
1522 | __s2PtN_12 += corr*pt_1; | |
1523 | __s2NPt_12 += corr*pt_2; | |
1524 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1525 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1526 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
1527 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1528 | ||
1529 | __n2Nw_12 += 1; | |
1530 | __s2ptptNw_12 += ptpt; | |
1531 | __s2PtNNw_12 += pt_1; | |
1532 | __s2NPtNw_12 += pt_2; | |
1533 | ||
9cabc5db | 1534 | } |
239bac74 | 1535 | } //i2 |
1536 | } //i1 | |
1537 | } | |
1538 | else // field<0 | |
1539 | { | |
1540 | for (int i1=0; i1<k1; i1++) | |
1541 | { | |
1542 | ////cout << " i1:" << i1 << endl; | |
1543 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1544 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1545 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1546 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1547 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1548 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
1549 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; | |
1550 | //1 and 2 | |
1551 | for (int i2=i1+1; i2<k1; i2++) | |
1552 | { | |
1553 | ////cout << " i2:" << i2 << endl; | |
1554 | id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl; | |
1555 | if (id_1!=id_2) | |
9cabc5db | 1556 | { |
239bac74 | 1557 | q_2 = _charge_1[i2]; ////cout << " q_2:" << q_2 << endl; |
1558 | iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl; | |
1559 | iPt_2 = _iPt_1[i2]; ////cout << " iPt_2:" << iPt_2 << endl; | |
1560 | corr_2 = _correction_1[i2]; ////cout << " corr_2:" << corr_2 << endl; | |
1561 | pt_2 = _pt_1[i2]; ////cout << " pt_2:" << pt_2 << endl; | |
1562 | dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl; | |
1563 | corr = corr_1*corr_2; | |
1564 | if ( q_2<q_1 || (q_1>0 && q_2>0 && pt_2>=pt_1) || (q_1<0 && q_2<0 && pt_2<=pt_1)) | |
1565 | { | |
1566 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
1567 | } | |
1568 | else // swap particles | |
1569 | { | |
1570 | ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl; | |
1571 | } | |
1572 | ||
1573 | __n2_12 += corr; | |
1574 | __n2_12_vsEtaPhi[ij] += corr; | |
1575 | ptpt = pt_1*pt_2; | |
1576 | __s2ptpt_12 += corr*ptpt; | |
1577 | __s2PtN_12 += corr*pt_1; | |
1578 | __s2NPt_12 += corr*pt_2; | |
1579 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1580 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1581 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
1582 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1583 | ||
1584 | __n2Nw_12 += 1; | |
1585 | __s2ptptNw_12 += ptpt; | |
1586 | __s2PtNNw_12 += pt_1; | |
1587 | __s2NPtNw_12 += pt_2; | |
1588 | ||
9cabc5db | 1589 | } |
239bac74 | 1590 | } //i2 |
1591 | } //i1 | |
1592 | } | |
9cabc5db | 1593 | } |
239bac74 | 1594 | else // filter 1 and 2 are different -- must do all particle pairs... |
9cabc5db | 1595 | { |
239bac74 | 1596 | _n1_1_vsM->Fill(centrality, __n1_1); |
1597 | _s1pt_1_vsM->Fill(centrality, __s1pt_1); | |
1598 | _n1Nw_1_vsM->Fill(centrality, __n1Nw_1); | |
1599 | _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1); | |
1600 | _n1_2_vsM->Fill(centrality, __n1_2); | |
1601 | _s1pt_2_vsM->Fill(centrality, __s1pt_2); | |
1602 | _n1Nw_2_vsM->Fill(centrality, __n1Nw_2); | |
1603 | _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_2); | |
1604 | // reset pair counters | |
1605 | __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0; | |
1606 | __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0; | |
9cabc5db | 1607 | for (int i1=0; i1<k1; i1++) |
1608 | { | |
1609 | ////cout << " i1:" << i1 << endl; | |
1610 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1611 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1612 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1613 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1614 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1615 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
239bac74 | 1616 | px_1 = _px_1[i1]; ////cout << " px_1:" << px_1 << endl; |
1617 | py_1 = _py_1[i1]; ////cout << " py_1:" << py_1 << endl; | |
1618 | pz_1 = _pz_1[i1]; ////cout << " pz_1:" << pz_1 << endl; | |
1619 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; | |
1620 | ||
1621 | //1 and 2 | |
1622 | for (int i2=0; i2<k2; i2++) | |
9cabc5db | 1623 | { |
1624 | ////cout << " i2:" << i2 << endl; | |
239bac74 | 1625 | id_2 = _id_2[i2]; ////cout << " id_2:" << id_2 << endl; |
1626 | if (id_1!=id_2) // exclude auto correlation | |
9cabc5db | 1627 | { |
239bac74 | 1628 | q_2 = _charge_2[i2]; ////cout << " q_2:" << q_2 << endl; |
1629 | iEtaPhi_2 = _iEtaPhi_2[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl; | |
1630 | iPt_2 = _iPt_2[i2]; ////cout << " iPt_2:" << iPt_2 << endl; | |
1631 | corr_2 = _correction_2[i2]; ////cout << " corr_2:" << corr_2 << endl; | |
1632 | pt_2 = _pt_2[i2]; ////cout << " pt_2:" << pt_2 << endl; | |
1633 | px_2 = _px_2[i2]; ////cout << " px_2:" << px_2 << endl; | |
1634 | py_2 = _py_2[i2]; ////cout << " py_2:" << py_2 << endl; | |
1635 | pz_2 = _pz_2[i2]; ////cout << " pz_2:" << pz_2 << endl; | |
1636 | dedx_2 = _dedx_2[i2]; ////cout << " dedx_2:" << dedx_2 << endl; | |
1637 | if (_rejectPairConversion) | |
9cabc5db | 1638 | { |
239bac74 | 1639 | float e1Sq = massElecSq + pt_1*pt_1 + pz_1*pz_1; |
1640 | float e2Sq = massElecSq + pt_2*pt_2 + pz_2*pz_2; | |
1641 | float mInvSq = 2*(massElecSq + sqrt(e1Sq*e2Sq) - px_1*px_2 - py_1*py_2 - pz_1*pz_2 ); | |
1642 | float mInv = sqrt(mInvSq); | |
1643 | _invMass->Fill(mInv); | |
1644 | if (mInv<0.5) | |
1645 | { | |
1646 | if (dedx_1>75. && dedx_2>75.) | |
1647 | { | |
1648 | _invMassElec->Fill(mInv); | |
1649 | if (mInv<0.05) continue; | |
1650 | } | |
1651 | } | |
9cabc5db | 1652 | } |
239bac74 | 1653 | corr = corr_1*corr_2; |
1654 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
9cabc5db | 1655 | __n2_12 += corr; |
1656 | __n2_12_vsEtaPhi[ij] += corr; | |
1657 | ptpt = pt_1*pt_2; | |
1658 | __s2ptpt_12 += corr*ptpt; | |
1659 | __s2PtN_12 += corr*pt_1; | |
1660 | __s2NPt_12 += corr*pt_2; | |
1661 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1662 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1663 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
239bac74 | 1664 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; |
9cabc5db | 1665 | __n2Nw_12 += 1; |
1666 | __s2ptptNw_12 += ptpt; | |
1667 | __s2PtNNw_12 += pt_1; | |
1668 | __s2NPtNw_12 += pt_2; | |
1669 | ||
1670 | } | |
1671 | } //i2 | |
239bac74 | 1672 | } //i1 |
9cabc5db | 1673 | } |
1674 | ||
239bac74 | 1675 | _n2_12_vsM->Fill(centrality, __n2_12); |
1676 | _s2PtPt_12_vsM->Fill(centrality, __s2ptpt_12); | |
1677 | _s2PtN_12_vsM->Fill(centrality, __s2NPt_12); | |
1678 | _s2NPt_12_vsM->Fill(centrality, __s2PtN_12); | |
9cabc5db | 1679 | |
239bac74 | 1680 | _n2Nw_12_vsM->Fill(centrality, __n2Nw_12); |
1681 | _s2PtPtNw_12_vsM->Fill(centrality, __s2ptptNw_12); | |
1682 | _s2PtNNw_12_vsM->Fill(centrality, __s2NPtNw_12); | |
1683 | _s2NPtNw_12_vsM->Fill(centrality, __s2PtNNw_12); | |
1684 | ||
9cabc5db | 1685 | } |
9cabc5db | 1686 | |
9cabc5db | 1687 | |
7e9200f4 | 1688 | cout << "AliAnalysisTaskDptDptCorrelations::UserExec() -----------------Event Done " << endl; |
9cabc5db | 1689 | PostData(0,_outputHistoList); |
1690 | ||
1691 | } | |
1692 | ||
1693 | void AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() | |
1694 | { | |
ba6301d5 | 1695 | cout << "AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Starting." << endl; |
7e9200f4 | 1696 | cout << "= 0 ====================================================================" << endl; |
9cabc5db | 1697 | finalizeHistograms(); |
7e9200f4 | 1698 | cout << "= 1 ====================================================================" << endl; |
9cabc5db | 1699 | PostData(0,_outputHistoList); |
7e9200f4 | 1700 | cout << "= 2 ====================================================================" << endl; |
ba6301d5 | 1701 | cout << "AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Done." << endl; |
9cabc5db | 1702 | } |
1703 | ||
ba6301d5 | 1704 | void AliAnalysisTaskDptDptCorrelations::Terminate(Option_t* /*option*/) |
9cabc5db | 1705 | { |
7e9200f4 | 1706 | cout << "AliAnalysisTaskDptDptCorrelations::Terminate() Starting/Done." << endl; |
9cabc5db | 1707 | } |
1708 | ||
1709 | ||
1710 | //Tools | |
1711 | //=================================================================================================== | |
1712 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH1 * h, float * array, int size) | |
1713 | { | |
1714 | int i, i1; | |
1715 | float v1, ev1, v2, ev2, sum, esum; | |
1716 | for (i=0, i1=1; i<size; ++i,++i1) | |
1717 | { | |
1718 | v1 = array[i]; ev1 = sqrt(v1); | |
1719 | v2 = h->GetBinContent(i1); | |
1720 | ev2 = h->GetBinError(i1); | |
1721 | sum = v1 + v2; | |
1722 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1723 | h->SetBinContent(i1,sum); | |
1724 | h->SetBinError(i1,esum); | |
1725 | } | |
1726 | } | |
1727 | ||
1728 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH2 * h, float * array, int size1, int size2) | |
1729 | { | |
1730 | int i, i1; | |
1731 | int j, j1; | |
1732 | float v1, ev1, v2, ev2, sum, esum; | |
1733 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1734 | { | |
1735 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1736 | { | |
1737 | v1 = array[i*size2+j]; ev1 = sqrt(v1); | |
1738 | v2 = h->GetBinContent(i1,j1); | |
1739 | ev2 = h->GetBinError(i1,j1); | |
1740 | sum = v1 + v2; | |
1741 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1742 | h->SetBinContent(i1,j1,sum); | |
1743 | h->SetBinError(i1,j1,esum); | |
1744 | } | |
1745 | } | |
1746 | } | |
1747 | ||
1748 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH3 * h, float * array, int size1, int size2, int size3) | |
1749 | { | |
1750 | int i, i1; | |
1751 | int j, j1; | |
1752 | int k, k1; | |
1753 | float v1, ev1, v2, ev2, sum, esum; | |
1754 | int size23 = size2*size3; | |
1755 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1756 | { | |
1757 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1758 | { | |
1759 | for (k=0, k1=1; k<size3; ++k,++k1) | |
1760 | { | |
1761 | v1 = array[i*size23+j*size3+k]; ev1 = sqrt(v1); | |
1762 | v2 = h->GetBinContent(i1,j1,k1); | |
1763 | ev2 = h->GetBinError(i1,j1,k1); | |
1764 | sum = v1 + v2; | |
1765 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1766 | h->SetBinContent(i1,j1,k1,sum); | |
1767 | h->SetBinError(i1,j1,k1,esum); | |
1768 | } | |
1769 | } | |
1770 | } | |
1771 | } | |
1772 | ||
1773 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH1 * h, double * array, int size) | |
1774 | { | |
1775 | int i, i1; | |
1776 | double v1, ev1, v2, ev2, sum, esum; | |
1777 | for (i=0, i1=1; i<size; ++i,++i1) | |
1778 | { | |
1779 | v1 = array[i]; ev1 = sqrt(v1); | |
1780 | v2 = h->GetBinContent(i1); | |
1781 | ev2 = h->GetBinError(i1); | |
1782 | sum = v1 + v2; | |
1783 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1784 | h->SetBinContent(i1,sum); | |
1785 | h->SetBinError(i1,esum); | |
1786 | } | |
1787 | } | |
1788 | ||
1789 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH2 * h, double * array, int size1, int size2) | |
1790 | { | |
1791 | int i, i1; | |
1792 | int j, j1; | |
1793 | double v1, ev1, v2, ev2, sum, esum; | |
1794 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1795 | { | |
1796 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1797 | { | |
1798 | v1 = array[i*size2+j]; ev1 = sqrt(v1); | |
1799 | v2 = h->GetBinContent(i1,j1); | |
1800 | ev2 = h->GetBinError(i1,j1); | |
1801 | sum = v1 + v2; | |
1802 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1803 | h->SetBinContent(i1,j1,sum); | |
1804 | h->SetBinError(i1,j1,esum); | |
1805 | } | |
1806 | } | |
1807 | } | |
1808 | ||
1809 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH3 * h, double * array, int size1, int size2, int size3) | |
1810 | { | |
1811 | int i, i1; | |
1812 | int j, j1; | |
1813 | int k, k1; | |
1814 | double v1, ev1, v2, ev2, sum, esum; | |
1815 | int size23 = size2*size3; | |
1816 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1817 | { | |
1818 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1819 | { | |
1820 | for (k=0, k1=1; k<size3; ++k,++k1) | |
1821 | { | |
1822 | v1 = array[i*size23+j*size3+k]; ev1 = sqrt(v1); | |
1823 | v2 = h->GetBinContent(i1,j1,k1); | |
1824 | ev2 = h->GetBinError(i1,j1,k1); | |
1825 | sum = v1 + v2; | |
1826 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1827 | h->SetBinContent(i1,j1,k1,sum); | |
1828 | h->SetBinError(i1,j1,k1,esum); | |
1829 | } | |
1830 | } | |
1831 | } | |
1832 | } | |
1833 | ||
1834 | //________________________________________________________________________ | |
1835 | double * AliAnalysisTaskDptDptCorrelations::getDoubleArray(int size, double v) | |
1836 | { | |
1837 | /// Allocate an array of type double with n values | |
1838 | /// Initialize the array to the given value | |
1839 | double * array = new double [size]; | |
1840 | for (int i=0;i<size;++i) array[i]=v; | |
1841 | return array; | |
1842 | } | |
1843 | ||
1844 | //________________________________________________________________________ | |
1845 | float * AliAnalysisTaskDptDptCorrelations::getFloatArray(int size, float v) | |
1846 | { | |
1847 | /// Allocate an array of type float with n values | |
1848 | /// Initialize the array to the given value | |
1849 | float * array = new float [size]; | |
1850 | for (int i=0;i<size;++i) array[i]=v; | |
1851 | return array; | |
1852 | } | |
1853 | ||
1854 | ||
1855 | //________________________________________________________________________ | |
239bac74 | 1856 | TH1D * AliAnalysisTaskDptDptCorrelations::createHisto1D(const TString & name, const TString & title, |
9cabc5db | 1857 | int n, double xMin, double xMax, |
1858 | const TString & xTitle, const TString & yTitle) | |
1859 | { | |
1860 | //CreateHisto new 1D historgram | |
1861 | AliInfo(Form("createHisto 1D histo %s nBins: %d xMin: %f xMax: %f",name.Data(),n,xMin,xMax)); | |
1862 | TH1D * h = new TH1D(name,title,n,xMin,xMax); | |
1863 | h->GetXaxis()->SetTitle(xTitle); | |
1864 | h->GetYaxis()->SetTitle(yTitle); | |
1865 | addToList(h); | |
1866 | return h; | |
1867 | } | |
1868 | ||
1869 | ||
1870 | //________________________________________________________________________ | |
239bac74 | 1871 | TH1D * AliAnalysisTaskDptDptCorrelations::createHisto1D(const TString & name, const TString & title, |
9cabc5db | 1872 | int n, double * bins, |
1873 | const TString & xTitle, const TString & yTitle) | |
1874 | { | |
1875 | AliInfo(Form("createHisto 1D histo %s with %d non uniform nBins",name.Data(),n)); | |
1876 | TH1D * h = new TH1D(name,title,n,bins); | |
1877 | h->GetXaxis()->SetTitle(xTitle); | |
1878 | h->GetYaxis()->SetTitle(yTitle); | |
1879 | addToList(h); | |
1880 | return h; | |
1881 | } | |
1882 | ||
1883 | ||
1884 | //________________________________________________________________________ | |
239bac74 | 1885 | TH2D * AliAnalysisTaskDptDptCorrelations::createHisto2D(const TString & name, const TString & title, |
9cabc5db | 1886 | int nx, double xMin, double xMax, int ny, double yMin, double yMax, |
1887 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1888 | { | |
1889 | AliInfo(Form("createHisto 2D histo %s nx: %d xMin: %f10.4 xMax: %f10.4 ny: %d yMin: %f10.4 yMax: %f10.4",name.Data(),nx,xMin,xMax,ny,yMin,yMax)); | |
1890 | TH2D * h = new TH2D(name,title,nx,xMin,xMax,ny,yMin,yMax); | |
1891 | h->GetXaxis()->SetTitle(xTitle); | |
1892 | h->GetYaxis()->SetTitle(yTitle); | |
1893 | h->GetZaxis()->SetTitle(zTitle); | |
1894 | addToList(h); | |
1895 | return h; | |
1896 | } | |
1897 | ||
1898 | //________________________________________________________________________ | |
239bac74 | 1899 | TH2D * AliAnalysisTaskDptDptCorrelations::createHisto2D(const TString & name, const TString & title, |
9cabc5db | 1900 | int nx, double* xbins, int ny, double yMin, double yMax, |
1901 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1902 | { | |
1903 | AliInfo(Form("createHisto 2D histo %s with %d non uniform nBins",name.Data(),nx)); | |
1904 | TH2D * h; | |
1905 | h = new TH2D(name,title,nx,xbins,ny,yMin,yMax); | |
1906 | h->GetXaxis()->SetTitle(xTitle); | |
1907 | h->GetYaxis()->SetTitle(yTitle); | |
1908 | h->GetZaxis()->SetTitle(zTitle); | |
1909 | addToList(h); | |
1910 | return h; | |
1911 | } | |
1912 | ||
239bac74 | 1913 | //// F ///// |
1914 | //________________________________________________________________________ | |
1915 | TH1F * AliAnalysisTaskDptDptCorrelations::createHisto1F(const TString & name, const TString & title, | |
1916 | int n, double xMin, double xMax, | |
1917 | const TString & xTitle, const TString & yTitle) | |
1918 | { | |
1919 | //CreateHisto new 1D historgram | |
1920 | AliInfo(Form("createHisto 1D histo %s nBins: %d xMin: %f xMax: %f",name.Data(),n,xMin,xMax)); | |
1921 | TH1F * h = new TH1F(name,title,n,xMin,xMax); | |
1922 | h->GetXaxis()->SetTitle(xTitle); | |
1923 | h->GetYaxis()->SetTitle(yTitle); | |
1924 | addToList(h); | |
1925 | return h; | |
1926 | } | |
1927 | ||
1928 | ||
1929 | //________________________________________________________________________ | |
1930 | TH1F * AliAnalysisTaskDptDptCorrelations::createHisto1F(const TString & name, const TString & title, | |
1931 | int n, double * bins, | |
1932 | const TString & xTitle, const TString & yTitle) | |
1933 | { | |
1934 | AliInfo(Form("createHisto 1D histo %s with %d non uniform nBins",name.Data(),n)); | |
1935 | TH1F * h = new TH1F(name,title,n,bins); | |
1936 | h->GetXaxis()->SetTitle(xTitle); | |
1937 | h->GetYaxis()->SetTitle(yTitle); | |
1938 | addToList(h); | |
1939 | return h; | |
1940 | } | |
1941 | ||
1942 | ||
1943 | //________________________________________________________________________ | |
1944 | TH2F * AliAnalysisTaskDptDptCorrelations::createHisto2F(const TString & name, const TString & title, | |
1945 | int nx, double xMin, double xMax, int ny, double yMin, double yMax, | |
1946 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1947 | { | |
1948 | AliInfo(Form("createHisto 2D histo %s nx: %d xMin: %f10.4 xMax: %f10.4 ny: %d yMin: %f10.4 yMax: %f10.4",name.Data(),nx,xMin,xMax,ny,yMin,yMax)); | |
1949 | TH2F * h = new TH2F(name,title,nx,xMin,xMax,ny,yMin,yMax); | |
1950 | h->GetXaxis()->SetTitle(xTitle); | |
1951 | h->GetYaxis()->SetTitle(yTitle); | |
1952 | h->GetZaxis()->SetTitle(zTitle); | |
1953 | addToList(h); | |
1954 | return h; | |
1955 | } | |
1956 | ||
1957 | //________________________________________________________________________ | |
1958 | TH2F * AliAnalysisTaskDptDptCorrelations::createHisto2F(const TString & name, const TString & title, | |
1959 | int nx, double* xbins, int ny, double yMin, double yMax, | |
1960 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1961 | { | |
1962 | AliInfo(Form("createHisto 2D histo %s with %d non uniform nBins",name.Data(),nx)); | |
1963 | TH2F * h; | |
1964 | h = new TH2F(name,title,nx,xbins,ny,yMin,yMax); | |
1965 | h->GetXaxis()->SetTitle(xTitle); | |
1966 | h->GetYaxis()->SetTitle(yTitle); | |
1967 | h->GetZaxis()->SetTitle(zTitle); | |
1968 | addToList(h); | |
1969 | return h; | |
1970 | } | |
1971 | ||
9cabc5db | 1972 | |
1973 | //________________________________________________________________________ | |
239bac74 | 1974 | TH3F * AliAnalysisTaskDptDptCorrelations::createHisto3F(const TString & name, const TString & title, |
9cabc5db | 1975 | int nx, double xMin, double xMax, |
1976 | int ny, double yMin, double yMax, | |
1977 | int nz, double zMin, double zMax, | |
1978 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1979 | { | |
1980 | AliInfo(Form("createHisto 2D histo %s nx: %d xMin: %f10.4 xMax: %f10.4 ny: %d yMin: %f10.4 yMax: %f10.4 nz: %d zMin: %f10.4 zMax: %f10.4",name.Data(),nx,xMin,xMax,ny,yMin,yMax,nz,zMin,zMax)); | |
1981 | TH3F * h = new TH3F(name,title,nx,xMin,xMax,ny,yMin,yMax,nz,zMin,zMax); | |
1982 | h->GetXaxis()->SetTitle(xTitle); | |
1983 | h->GetYaxis()->SetTitle(yTitle); | |
1984 | h->GetZaxis()->SetTitle(zTitle); | |
1985 | addToList(h); | |
1986 | return h; | |
1987 | } | |
1988 | ||
1989 | ||
1990 | //________________________________________________________________________ | |
1991 | TProfile * AliAnalysisTaskDptDptCorrelations::createProfile(const TString & name, const TString & description, | |
1992 | int nx,double xMin,double xMax, | |
1993 | const TString & xTitle, const TString & yTitle) | |
1994 | { | |
1995 | AliInfo(Form("createHisto 1D profile %s nBins: %d xMin: %f10.4 xMax: %f10.4",name.Data(),nx,xMin,xMax)); | |
1996 | TProfile * h = new TProfile(name,description,nx,xMin,xMax); | |
1997 | h->GetXaxis()->SetTitle(xTitle); | |
1998 | h->GetYaxis()->SetTitle(yTitle); | |
1999 | addToList(h); | |
2000 | return h; | |
2001 | } | |
2002 | ||
2003 | //________________________________________________________________________ | |
2004 | TProfile * AliAnalysisTaskDptDptCorrelations::createProfile(const TString & name,const TString & description, | |
2005 | int nx, double* bins, | |
2006 | const TString & xTitle, const TString & yTitle) | |
2007 | { | |
2008 | AliInfo(Form("createHisto 1D profile %s with %d non uniform bins",name.Data(),nx)); | |
2009 | TProfile * h = new TProfile(name,description,nx,bins); | |
2010 | h->GetXaxis()->SetTitle(xTitle); | |
2011 | h->GetYaxis()->SetTitle(yTitle); | |
2012 | addToList(h); | |
2013 | return h; | |
2014 | } | |
2015 | ||
2016 | ||
2017 | void AliAnalysisTaskDptDptCorrelations::addToList(TH1 *h) | |
2018 | { | |
2019 | if (_outputHistoList) | |
2020 | { | |
2021 | _outputHistoList->Add(h); | |
2022 | } | |
2023 | else | |
2024 | cout << "addToList(TH1 *h) _outputHistoList is null!!!!! Shoudl abort ship" << endl; | |
2025 | ||
2026 | } | |
2027 | ||
2028 | ||
2029 |