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