]>
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 | |
907 | _eventAccounting = createHisto(name,name,10, -0.5, 9.5, "event Code", _title_counts); | |
908 | ||
909 | name = "m0"; _m0 = createHisto(name,name,_nBins_M1, _min_M1, _max_M1, _title_m0, _title_counts); | |
910 | name = "m1"; _m1 = createHisto(name,name,_nBins_M1, _min_M1, _max_M1, _title_m1, _title_counts); | |
911 | name = "m2"; _m2 = createHisto(name,name,_nBins_M2, _min_M2, _max_M2, _title_m2, _title_counts); | |
912 | name = "m3"; _m3 = createHisto(name,name,_nBins_M3, _min_M3, _max_M3, _title_m3, _title_counts); | |
913 | name = "m4"; _m4 = createHisto(name,name,_nBins_M4, _min_M4, _max_M4, _title_m4, _title_counts); | |
914 | name = "m5"; _m5 = createHisto(name,name,_nBins_M5, _min_M5, _max_M5, _title_m5, _title_counts); | |
915 | name = "m6"; _m6 = createHisto(name,name,_nBins_M6, _min_M6, _max_M6, _title_m6, _title_counts); | |
916 | name = "zV"; _vertexZ = createHisto(name,name,_nBins_vertexZ, _min_vertexZ, _max_vertexZ, "z-Vertex (cm)", _title_counts); | |
917 | ||
918 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Part 1 Histos"); | |
919 | ||
920 | name = n1Name+part_1_Name+vsPt; _n1_1_vsPt = createHisto(name,name, _nBins_pt_1, _min_pt_1, _max_pt_1, _title_pt_1, _title_AvgN_1); | |
921 | name = n1Name+part_1_Name+vsEtaPhi; _n1_1_vsEtaVsPhi = createHisto(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); | |
922 | name = s1ptName+part_1_Name+vsEtaPhi; _s1pt_1_vsEtaVsPhi = createHisto(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); | |
923 | name = n1Name+part_1_Name+vsZ+vsEtaPhi+vsPt; _n1_1_vsZVsEtaVsPhiVsPt = createHisto(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); | |
924 | name = n1Name+part_1_Name+vsM; _n1_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
925 | name = s1ptName+part_1_Name+vsM; _s1pt_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
926 | name = n1NwName+part_1_Name+vsM; _n1Nw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
927 | name = s1ptNwName+part_1_Name+vsM; _s1ptNw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
928 | name = "dedxVsP_1"; _dedxVsP_1 = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
929 | name = "corrDedxVsP_1"; _corrDedxVsP_1 = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
930 | name = "betaVsP_1"; _betaVsP_1 = createHisto(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts"); | |
931 | ||
932 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Part 2 Histos"); | |
933 | ||
934 | name = n1Name+part_2_Name+vsPt; _n1_2_vsPt = createHisto(name,name, _nBins_pt_2, _min_pt_2, _max_pt_2, _title_pt_2, _title_AvgN_2); | |
935 | name = n1Name+part_2_Name+vsEtaPhi; _n1_2_vsEtaVsPhi = createHisto(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); | |
936 | name = s1ptName+part_2_Name+vsEtaPhi; _s1pt_2_vsEtaVsPhi = createHisto(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); | |
937 | name = n1Name+part_2_Name+vsZ+vsEtaPhi+vsPt; _n1_2_vsZVsEtaVsPhiVsPt = createHisto(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); | |
938 | name = n1Name+part_2_Name + vsM; _n1_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_2); | |
939 | name = s1ptName+part_2_Name + vsM; _s1pt_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_2); | |
940 | name = n1NwName+part_2_Name+vsM; _n1Nw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
941 | name = s1ptNwName+part_2_Name+vsM; _s1ptNw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
942 | name = "dedxVsP_2"; _dedxVsP_2 = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
943 | name = "corrDedxVsP_2"; _corrDedxVsP_2 = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts"); | |
944 | name = "betaVsP_2"; _betaVsP_2 = createHisto(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts"); | |
945 | ||
946 | if (!_singlesOnly) | |
947 | { | |
948 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Pair Histos"); | |
949 | ||
950 | name = n2Name+pair_12_Name+vsEtaPhi; _n2_12_vsEtaPhi = createHisto(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgN2_12); | |
951 | name = n2Name+pair_12_Name+vsPtVsPt; _n2_12_vsPtVsPt = createHisto(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); | |
952 | name = s2PtPtName+pair_12_Name + vsEtaPhi; _s2PtPt_12_vsEtaPhi = createHisto(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgSumPtPt_12); | |
953 | name = s2PtNName+pair_12_Name + vsEtaPhi; _s2PtN_12_vsEtaPhi = createHisto(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgSumPtN_12); | |
954 | name = s2NPtName+pair_12_Name + vsEtaPhi; _s2NPt_12_vsEtaPhi = createHisto(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgNSumPt_12); | |
955 | ||
956 | name = n2Name+pair_12_Name + vsM; _n2_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12); | |
957 | name = s2PtPtName+pair_12_Name + vsM; _s2PtPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12); | |
958 | name = s2PtNName+pair_12_Name + vsM; _s2PtN_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12); | |
959 | name = s2NPtName+pair_12_Name + vsM; _s2NPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12); | |
960 | ||
961 | name = n2NwName+pair_12_Name + vsM; _n2Nw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12); | |
962 | name = s2PtPtNwName+pair_12_Name + vsM; _s2PtPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12); | |
963 | name = s2PtNNwName+pair_12_Name + vsM; _s2PtNNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12); | |
964 | name = s2NPtNwName+pair_12_Name + vsM; _s2NPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12); | |
965 | ||
966 | name = "mInv"; _invMass = createHisto(name,name, 500, 0., 1.000, "M_{inv}","counts"); | |
967 | name = "mInvElec"; _invMassElec = createHisto(name,name, 500, 0., 1.000, "M_{inv}","counts"); | |
968 | } | |
969 | ||
970 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() All Done"); | |
971 | } | |
972 | //-----------------------// | |
973 | ||
974 | void AliAnalysisTaskDptDptCorrelations::finalizeHistograms() | |
975 | { | |
976 | ||
977 | AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() starting"); | |
978 | AliInfo(Form("CorrelationAnalyzers::finalizeHistograms() _eventCount : %d",int(_eventCount))); | |
979 | if (_sameFilter) | |
980 | { | |
981 | fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
982 | fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
983 | fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
984 | fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
985 | ||
986 | fillHistoWithArray(_n1_2_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
987 | fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
988 | fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
989 | fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
990 | } | |
991 | else | |
992 | { | |
993 | fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
994 | fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
995 | fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
996 | fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
997 | ||
998 | fillHistoWithArray(_n1_2_vsPt, __n1_2_vsPt, _nBins_pt_2); | |
999 | fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2); | |
1000 | fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2); | |
1001 | fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_2_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_2, _nBins_pt_2); | |
1002 | } | |
1003 | if (!_singlesOnly) | |
1004 | { | |
1005 | fillHistoWithArray(_n2_12_vsEtaPhi, __n2_12_vsEtaPhi, _nBins_etaPhi_12); | |
1006 | fillHistoWithArray(_s2PtPt_12_vsEtaPhi, __s2ptpt_12_vsEtaPhi, _nBins_etaPhi_12); | |
1007 | fillHistoWithArray(_s2PtN_12_vsEtaPhi, __s2PtN_12_vsEtaPhi, _nBins_etaPhi_12); | |
1008 | fillHistoWithArray(_s2NPt_12_vsEtaPhi, __s2NPt_12_vsEtaPhi, _nBins_etaPhi_12); | |
1009 | fillHistoWithArray(_n2_12_vsPtVsPt, __n2_12_vsPtPt, _nBins_pt_1, _nBins_pt_2); | |
1010 | } | |
1011 | ||
1012 | AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() Done "); | |
1013 | } | |
1014 | //--------------// | |
1015 | ||
1016 | ||
ba6301d5 | 1017 | void AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/) |
9cabc5db | 1018 | { |
1019 | ||
1020 | int k1,k2; | |
1021 | int iPhi, iEta, iEtaPhi, iPt, charge; | |
1022 | float q, p, phi, pt, eta, corr, dedx, px, py, pz; | |
1023 | int ij; | |
1024 | int id_1, q_1, iEtaPhi_1, iPt_1; | |
1025 | float pt_1, px_1, py_1, pz_1, corr_1, dedx_1; | |
1026 | int id_2, q_2, iEtaPhi_2, iPt_2; | |
1027 | float pt_2, px_2, py_2, pz_2, corr_2, dedx_2; | |
1028 | float ptpt; | |
1029 | int iVertex, iVertexP1, iVertexP2; | |
1030 | int iZEtaPhiPt; | |
1031 | float massElecSq = 2.5e-7; | |
1032 | double b[2]; | |
1033 | double bCov[3]; | |
1034 | const AliAODVertex* vertex; | |
1035 | int nClus; | |
1036 | bool bitOK; | |
ba6301d5 | 1037 | |
9cabc5db | 1038 | // count all events looked at here |
1039 | _eventCount++; | |
1040 | if (!_eventAccounting) | |
ba6301d5 | 1041 | { |
9cabc5db | 1042 | cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - !_eventAccounting" << endl; |
ba6301d5 | 1043 | cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - Skip this task" << endl; |
1044 | return; | |
1045 | } | |
9cabc5db | 1046 | _eventAccounting->Fill(0);// count all calls to this function |
1047 | ||
1048 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 1" << endl; | |
1049 | ||
1050 | //Get pointer to current event | |
1051 | fESDEvent = dynamic_cast<AliESDEvent*> (InputEvent()); | |
1052 | fAODEvent = dynamic_cast<AliAODEvent*> (InputEvent()); | |
1053 | ||
1054 | ////cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 2" << endl; | |
1055 | ||
1056 | if(!fAODEvent && !fESDEvent) | |
1057 | { | |
1058 | AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) !fAODEvent && !fESDEvent ");; | |
1059 | return; | |
1060 | } | |
1061 | ||
1062 | _eventAccounting->Fill(1);// count all calls to this function with a valid pointer | |
1063 | ||
1064 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 3" << endl; | |
1065 | ||
1066 | //reset single particle counters | |
1067 | k1 = k2 = 0; | |
1068 | __n1_1 = __n1_2 = __s1pt_1 = __s1pt_2 = __n1Nw_1 = __n1Nw_2 = __s1ptNw_1 = __s1ptNw_2 = 0; | |
1069 | ||
1070 | float v0Centr = -999.; | |
1071 | float trkCentr = -999.; | |
1072 | float spdCentr = -999.; | |
1073 | ||
1074 | float vertexX = -999; | |
1075 | float vertexY = -999; | |
1076 | float vertexZ = -999; | |
1077 | float vertexXY = -999; | |
1078 | //float dcaX = -999; | |
1079 | //float dcaY = -999; | |
1080 | float dcaZ = -999; | |
1081 | float dcaXY = -999; | |
1082 | float centrality = -999; | |
1083 | ||
1084 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 4" << endl; | |
1085 | ||
1086 | if(fAODEvent) | |
1087 | { | |
1088 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 5" << endl; | |
1089 | ||
1090 | //Centrality | |
1091 | AliCentrality* centralityObject = fAODEvent->GetHeader()->GetCentralityP(); | |
1092 | if (centralityObject) | |
1093 | { | |
1094 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 6" << endl; | |
1095 | ||
1096 | v0Centr = centralityObject->GetCentralityPercentile("V0M"); | |
1097 | trkCentr = centralityObject->GetCentralityPercentile("TRK"); | |
1098 | spdCentr = centralityObject->GetCentralityPercentile("CL1"); | |
1099 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 7" << endl; | |
1100 | ||
1101 | } | |
1102 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 8" << endl; | |
1103 | ||
1104 | _nTracks = fAODEvent->GetNTracks(); | |
1105 | _mult0 = 0; | |
1106 | _mult1 = 0; | |
1107 | _mult2 = 0; | |
1108 | _mult3 = _nTracks; | |
1109 | _mult4 = v0Centr; | |
1110 | _mult5 = trkCentr; | |
1111 | _mult6 = spdCentr; | |
1112 | _field = fAODEvent->GetMagneticField(); | |
1113 | ||
1114 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - _field:" << _field << endl; | |
1115 | ||
1116 | //_centralityMethod | |
1117 | switch (_centralityMethod) | |
1118 | { | |
1119 | case 0: centrality = _mult0; break; | |
1120 | case 1: centrality = _mult1; break; | |
1121 | case 2: centrality = _mult2; break; | |
1122 | case 3: centrality = _mult3; break; | |
1123 | case 4: centrality = _mult4; break; | |
1124 | case 5: centrality = _mult5; break; | |
1125 | case 6: centrality = _mult6; break; | |
1126 | } | |
1127 | ||
1128 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 10" << endl; | |
1129 | ||
1130 | //filter on centrality | |
1131 | if ( centrality < _centralityMin || | |
1132 | centrality > _centralityMax) | |
1133 | { | |
1134 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 11" << endl; | |
1135 | ||
1136 | // we dont analyze this event here... | |
1137 | return; | |
1138 | } | |
1139 | _eventAccounting->Fill(2);// count all events with right centrality | |
1140 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 12" << endl; | |
1141 | ||
1142 | // filter on z and xy vertex | |
1143 | vertex = (AliAODVertex*) fAODEvent->GetPrimaryVertexSPD(); | |
1144 | if (!vertex || vertex->GetNContributors()<1) | |
1145 | { | |
1146 | vertexZ = -999; | |
1147 | vertexXY = -999; | |
1148 | cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - No valid vertex object or poor vertex" << endl; | |
1149 | } | |
1150 | else | |
1151 | { | |
1152 | vertexX = vertex->GetX(); | |
1153 | vertexY = vertex->GetY(); | |
1154 | vertexZ = vertex->GetZ(); | |
1155 | vertexXY = sqrt(vertexX*vertexX+vertexY*vertexY); | |
1156 | } | |
1157 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 13" << endl; | |
1158 | ||
1159 | //cout << "vertexZ : " << vertexZ << endl; | |
1160 | //cout << "vertexXY: " << vertexXY << endl; | |
1161 | //cout << "_vertexZMin: " << _vertexZMin << endl; | |
1162 | //cout << "_vertexZMax: " << _vertexZMax << endl; | |
1163 | //cout << "_vertexXYMin: " << _vertexXYMin << endl; | |
1164 | //cout << "_vertexXYMax: " << _vertexXYMax << endl; | |
1165 | ||
1166 | if (!vertex || | |
1167 | vertexZ < _vertexZMin || | |
1168 | vertexZ > _vertexZMax || | |
1169 | vertexXY < _vertexXYMin || | |
1170 | vertexXY > _vertexXYMax) | |
1171 | return; | |
1172 | ||
1173 | ||
1174 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 14" << endl; | |
1175 | ||
1176 | iVertex = int((vertexZ-_min_vertexZ)/_width_vertexZ); | |
1177 | iVertexP1 = iVertex*_nBins_etaPhiPt_1; | |
1178 | iVertexP2 = iVertex*_nBins_etaPhiPt_2; | |
1179 | if (iVertex<0 || iVertex>=_nBins_vertexZ) | |
1180 | { | |
1181 | AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) iVertex<0 || iVertex>=_nBins_vertexZ "); | |
1182 | return; | |
1183 | } | |
1184 | _eventAccounting->Fill(3);// count all calls to this function with a valid pointer | |
1185 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 15" << endl; | |
1186 | ||
1187 | ||
1188 | // loop over all particles for singles | |
1189 | //debug() << "_nTracks:"<< _nTracks << endl; | |
1190 | for (int iTrack=0; iTrack< _nTracks; iTrack++) | |
1191 | { | |
1192 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 16 iTrack:" << iTrack << endl; | |
1193 | ||
1194 | AliAODTrack * t = (AliAODTrack *) fAODEvent->GetTrack(iTrack); | |
1195 | if (!t) | |
1196 | { | |
1197 | AliError(Form("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) No track ofr iTrack=%d", iTrack)); | |
1198 | continue; | |
1199 | } | |
1200 | ||
1201 | q = t->Charge(); | |
1202 | charge = int(q); | |
1203 | phi = t->Phi(); | |
1204 | p = t->P(); | |
1205 | pt = t->Pt(); | |
1206 | px = t->Px(); | |
1207 | py = t->Py(); | |
1208 | pz = t->Pz(); | |
1209 | eta = t->Eta(); | |
1210 | dedx = t->GetTPCsignal(); | |
1211 | nClus = t->GetTPCNcls(); | |
1212 | bitOK = t->TestFilterBit(_trackFilterBit); | |
1213 | ||
1214 | //cout << "_trackFilterBit:" << _trackFilterBit << " Track returns:" << bitOK << endl; | |
1215 | //cout << " q:" << q << " _requestedCharge_1:" << _requestedCharge_1 << endl; | |
1216 | //cout << " pt:" << pt << " _min_pt_1:" << _min_pt_1 << " _max_pt_1:" << _max_pt_1<< endl; | |
1217 | //cout << " phi:" << phi << endl; | |
1218 | //cout << " eta:" << eta << " _min_eta_1:" << _min_eta_1 << " _max_eta_1:" << _max_eta_1<< endl; | |
1219 | //cout << " dedx:" << dedx << " _dedxMin:" << _dedxMin << " _dedxMax:" << _dedxMax << endl; | |
1220 | //cout << "nclus:" << nClus<< " _nClusterMin:" << _nClusterMin << endl; | |
1221 | if (bitOK && | |
1222 | _requestedCharge_1 == charge && | |
1223 | pt >= _min_pt_1 && | |
1224 | pt < _max_pt_1 && | |
1225 | eta >= _min_eta_1 && | |
1226 | eta < _max_eta_1 && | |
1227 | dedx >= _dedxMin && | |
1228 | dedx < _dedxMax && | |
1229 | nClus >= _nClusterMin) | |
1230 | { | |
1231 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - check vertex for 1:" << endl; | |
1232 | // Get the dca information | |
1233 | if (t->PropagateToDCA(vertex, _field, 100., b, bCov) ) | |
1234 | { | |
1235 | dcaXY = b[0]; | |
1236 | dcaZ = b[1]; | |
1237 | } | |
1238 | else | |
1239 | { | |
1240 | dcaXY = -999999; | |
1241 | dcaZ = -999999; | |
1242 | } | |
1243 | //cout << "1 dcaZ:" << dcaZ << " _dcaZMin:" << _dcaZMin << " _dcaZMax:" << _dcaZMax << endl; | |
1244 | //cout << "1 dcaXY:" << dcaXY << " _dcaXYMin:" << _dcaXYMin << " _dcaXYMax:" << _dcaXYMax << endl; | |
1245 | ||
1246 | // skip track if DCA too large | |
1247 | if (dcaZ >= _dcaZMin && | |
1248 | dcaZ < _dcaZMax && | |
1249 | dcaXY >= _dcaXYMin && | |
1250 | dcaXY < _dcaXYMax) | |
1251 | continue; //track does not have a valid DCA | |
1252 | //cout << "keep track:" << endl; | |
1253 | ||
1254 | iPhi = int( phi/_width_phi_1); | |
1255 | ////cout << " AliAnalysisTaskDptDptCorrelations::analyze(Event * event) -1- iTrack:" << iTrack<< endl<< "pt:" << pt << " phi:" << phi << " eta:" << eta << endl; | |
1256 | if (iPhi<0 || iPhi>=_nBins_phi_1 ) | |
1257 | { | |
1258 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze() iPhi<0 || iPhi>=_nBins_phi_1"); | |
1259 | return; | |
1260 | } | |
1261 | ||
1262 | iEta = int((eta-_min_eta_1)/_width_eta_1); | |
1263 | if (iEta<0 || iEta>=_nBins_eta_1) | |
1264 | { | |
1265 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iEta: %d", iEta)); | |
1266 | continue; | |
1267 | } | |
1268 | iPt = int((pt -_min_pt_1 )/_width_pt_1 ); | |
1269 | if (iPt<0 || iPt >=_nBins_pt_1) | |
1270 | { | |
1271 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iPt: %d",iPt)); | |
1272 | continue; | |
1273 | } | |
1274 | iEtaPhi = iEta*_nBins_phi_1+iPhi; | |
1275 | iZEtaPhiPt = iVertexP1 + iEtaPhi*_nBins_pt_1 + iPt; | |
1276 | ||
1277 | if (_correctionWeight_1) | |
1278 | corr = _correctionWeight_1[iZEtaPhiPt]; | |
1279 | else | |
1280 | corr = 1; | |
1281 | if (iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1) | |
1282 | { | |
1283 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1"); | |
1284 | continue; | |
1285 | } | |
1286 | //cout << "all good; process track:" << endl; | |
1287 | ||
1288 | _id_1[k1] = iTrack; | |
1289 | _charge_1[k1] = charge; | |
1290 | _iEtaPhi_1[k1] = iEtaPhi; | |
1291 | _iPt_1[k1] = iPt; | |
1292 | _pt_1[k1] = pt; | |
1293 | _px_1[k1] = px; | |
1294 | _py_1[k1] = py; | |
1295 | _pz_1[k1] = pz; | |
1296 | _correction_1[k1] = corr; | |
1297 | __n1_1 += corr; | |
1298 | __n1_1_vsEtaPhi[iEtaPhi] += corr; | |
1299 | __n1_1_vsZEtaPhiPt[iZEtaPhiPt] += corr; | |
1300 | __s1pt_1 += corr*pt; | |
1301 | __s1pt_1_vsEtaPhi[iEtaPhi] += corr*pt; | |
1302 | __n1_1_vsPt[iPt] += corr; | |
1303 | __n1Nw_1 += 1; | |
1304 | __s1ptNw_1 += pt; | |
1305 | ||
1306 | //_betaVsP_1->Fill(p*q,_trackFilter_1->getBeta() ); | |
1307 | _dedxVsP_1->Fill(p*q,dedx); | |
1308 | //_corrDedxVsP_1->Fill(p*q,_trackFilter_1->getCorrectedDedx() ); | |
1309 | ||
1310 | ||
1311 | ++k1; | |
1312 | if (k1>=arraySize) | |
1313 | { | |
1314 | AliError(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) k1 >=arraySize; arraySize: %d",arraySize)); | |
1315 | return; | |
1316 | } | |
1317 | } | |
1318 | ||
1319 | if (!_sameFilter && | |
1320 | bitOK && | |
1321 | _requestedCharge_2 == charge && | |
1322 | pt >= _min_pt_2 && | |
1323 | pt < _max_pt_2 && | |
1324 | eta >= _min_eta_2 && | |
1325 | eta < _max_eta_2 && | |
1326 | dedx >= _dedxMin && | |
1327 | dedx < _dedxMax && | |
1328 | nClus >= _nClusterMin) | |
1329 | { | |
1330 | // Get the dca information | |
1331 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - check vertex for 2:" << endl; | |
1332 | if (t->PropagateToDCA(vertex, _field, 100., b, bCov) ) | |
1333 | { | |
1334 | dcaXY = b[0]; | |
1335 | dcaZ = b[1]; | |
1336 | } | |
1337 | else | |
1338 | { | |
1339 | dcaXY = -999999; | |
1340 | dcaZ = -999999; | |
1341 | } | |
1342 | //cout << "2 dcaZ:" << dcaZ << " _dcaZMin:" << _dcaZMin << " _dcaZMax:" << _dcaZMax << endl; | |
1343 | //cout << "2 dcaXY:" << dcaXY << " _dcaXYMin:" << _dcaXYMin << " _dcaXYMax:" << _dcaXYMax << endl; | |
1344 | // skip track if DCA too large | |
1345 | if (dcaZ >= _dcaZMin && | |
1346 | dcaZ < _dcaZMax && | |
1347 | dcaXY >= _dcaXYMin && | |
1348 | dcaXY < _dcaXYMax) | |
1349 | continue; //track does not have a valid DCA | |
1350 | ||
1351 | iPhi = int( phi/_width_phi_2); | |
1352 | //cout << " AliAnalysisTaskDptDptCorrelations::analyze(Event * event) -1- iTrack:" << iTrack << endl | |
1353 | //<< "pt:" << pt << " phi:" << phi << " eta:" << eta << endl; | |
1354 | if (iPhi<0 || iPhi>=_nBins_phi_2 ) | |
1355 | { | |
1356 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze() iPhi<0 || iPhi>=_nBins_phi_1"); | |
1357 | return; | |
1358 | } | |
1359 | ||
1360 | iEta = int((eta-_min_eta_2)/_width_eta_2); | |
1361 | if (iEta<0 || iEta>=_nBins_eta_2) | |
1362 | { | |
1363 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iEta: %d", iEta)); | |
1364 | continue; | |
1365 | } | |
1366 | iPt = int((pt -_min_pt_2 )/_width_pt_2 ); | |
1367 | if (iPt<0 || iPt >=_nBins_pt_2) | |
1368 | { | |
1369 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iPt: %d",iPt)); | |
1370 | continue; | |
1371 | } | |
1372 | ||
1373 | iEtaPhi = iEta*_nBins_phi_2+iPhi; | |
1374 | iZEtaPhiPt = iVertexP2 + iEtaPhi*_nBins_pt_2 + iPt; | |
1375 | if (iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_2) | |
1376 | { | |
1377 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_2"); | |
1378 | continue; | |
1379 | } | |
1380 | ||
1381 | //cout << " iEtaPhi:" << iEtaPhi << " _nBins_etaPhi_1: "<< _nBins_etaPhi_1<< " _nBins_etaPhi_2: "<< _nBins_etaPhi_2<< endl; | |
1382 | //if (_useEbyECorrections) corr = (charge>0) ? _correction_2p[iEtaPhi] : _correction_2m[iEtaPhi]; else | |
1383 | //cout << "_correctionWeight_2:" << _correctionWeight_2 << endl; | |
1384 | if (_correctionWeight_2) | |
1385 | corr = _correctionWeight_2[iZEtaPhiPt]; | |
1386 | else | |
1387 | corr = 1; | |
1388 | //dpt = pt - (charge>0) ? _avgPt_vsEtaPhi_2p[iEtaPhi] : _avgPt_vsEtaPhi_2m[iEtaPhi]; | |
1389 | ||
1390 | //cout << " k2:" << k2 << endl; | |
1391 | //cout << "iZEtaPhiPt: " << iZEtaPhiPt << endl; | |
1392 | //cout << "iEtaPhi:" << iEtaPhi << endl; | |
1393 | _id_2[k2] = iTrack; | |
1394 | //cout << "step 1" << endl; | |
1395 | _charge_2[k2] = charge; | |
1396 | //cout << "step 2" << endl; | |
1397 | _iEtaPhi_2[k2] = iEtaPhi; | |
1398 | //cout << "step 3" << endl; | |
1399 | _iPt_2[k2] = iPt; | |
1400 | //cout << "step 4" << endl; | |
1401 | _pt_2[k2] = pt; | |
1402 | //cout << "step 5" << endl; | |
1403 | _px_2[k2] = px; | |
1404 | //cout << "step 6" << endl; | |
1405 | _py_2[k2] = py; | |
1406 | //cout << "step 7" << endl; | |
1407 | _pz_2[k2] = pz; | |
1408 | //cout << "step 8" << endl; | |
1409 | _correction_2[k2] = corr; | |
1410 | //cout << "step 9" << endl; | |
1411 | __n1_2 += corr; | |
1412 | //cout << "step 10" << endl; | |
1413 | __n1_2_vsEtaPhi[iEtaPhi] += corr; | |
1414 | //cout << "step 11" << endl; | |
1415 | __n1_2_vsZEtaPhiPt[iZEtaPhiPt] += corr; | |
1416 | //cout << "step 12" << endl; | |
1417 | __s1pt_2 += corr*pt; | |
1418 | //cout << "step 13" << endl; | |
1419 | __s1pt_2_vsEtaPhi[iEtaPhi] += corr*pt; | |
1420 | //cout << "step 14" << endl; | |
1421 | __n1_2_vsPt[iPt] += corr; | |
1422 | //cout << "step 15" << endl; | |
1423 | ||
1424 | __n1Nw_2 += 1; | |
1425 | __s1ptNw_2 += pt; | |
1426 | ||
1427 | //cout << " data stored:" << endl; | |
1428 | ||
1429 | //_betaVsP_2->Fill(p*q,_trackFilter_2->getBeta() ); | |
1430 | if (!_dedxVsP_2) { | |
1431 | //cout << "_dedxVsP_2 does not exist...." << endl; | |
1432 | continue; | |
1433 | } | |
1434 | //cout << " fill histo _dedxVsP_2" << endl; | |
1435 | ||
1436 | _dedxVsP_2->Fill(p*q,dedx); | |
1437 | //_corrDedxVsP_2->Fill(p*q,_trackFilter_2->getCorrectedDedx() ); | |
1438 | ++k2; | |
1439 | //cout << " k2 incremented:" << endl; | |
1440 | if (k2>=arraySize) | |
1441 | { | |
1442 | AliWarning(Form("-W- k2 >=arraySize; arraySize: %d",arraySize)); | |
1443 | return; | |
1444 | } | |
1445 | } | |
1446 | ||
1447 | //cout << "done with track" << endl; | |
1448 | } //iTrack | |
1449 | ||
1450 | } //aod | |
1451 | ||
1452 | ||
1453 | else if (fESDEvent) | |
1454 | { | |
1455 | //AliCentrality* centrality = esdEvent->GetCentrality(); | |
1456 | //Float_t centV0 = centrality->GetCentralityPercentile("V0M"); | |
1457 | //Float_t centTrk = centrality->GetCentralityPercentile("TRK"); | |
1458 | //Float_t centSPD = centrality->GetCentralityPercentile("CL1"); | |
1459 | } | |
1460 | ||
1461 | //cout << "Filling histograms now" << endl; | |
1462 | _m0->Fill(_mult0); | |
1463 | _m1->Fill(_mult1); | |
1464 | _m2->Fill(_mult2); | |
1465 | _m3->Fill(_mult3); | |
1466 | _m4->Fill(_mult4); | |
1467 | _m5->Fill(_mult5); | |
1468 | _m6->Fill(_mult6); | |
1469 | _vertexZ->Fill(vertexZ); | |
1470 | _n1_1_vsM->Fill(_mult4, __n1_1); | |
1471 | _s1pt_1_vsM->Fill(_mult4, __s1pt_1); | |
1472 | _n1Nw_1_vsM->Fill(_mult4, __n1Nw_1); | |
1473 | _s1ptNw_1_vsM->Fill(_mult4, __s1ptNw_1); | |
1474 | if (_sameFilter) | |
1475 | { | |
1476 | _n1_2_vsM->Fill(_mult4, __n1_1); | |
1477 | _s1pt_2_vsM->Fill(_mult4, __s1pt_1); | |
1478 | _n1Nw_2_vsM->Fill(_mult4, __n1Nw_1); | |
1479 | _s1ptNw_2_vsM->Fill(_mult4,__s1ptNw_1); | |
1480 | } | |
1481 | else | |
1482 | { | |
1483 | _n1_2_vsM->Fill(_mult4, __n1_2); | |
1484 | _s1pt_2_vsM->Fill(_mult4, __s1pt_2); | |
1485 | _n1Nw_2_vsM->Fill(_mult4, __n1Nw_2); | |
1486 | _s1ptNw_2_vsM->Fill(_mult4, __s1ptNw_2); | |
1487 | } | |
1488 | ||
1489 | //if singels only selected, do not fill pair histograms. | |
1490 | if (_singlesOnly) return; | |
1491 | ||
1492 | // reset pair counters | |
1493 | __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0; | |
1494 | __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0; | |
1495 | ||
1496 | //info() <<" singles done" << endl; | |
1497 | if (_sameFilter) // filter 1 and 2 are the same -- only do pairs i<j | |
1498 | { | |
1499 | if (_field>0) | |
1500 | { | |
1501 | for (int i1=0; i1<k1; i1++) | |
1502 | { | |
1503 | ////cout << " i1:" << i1 << endl; | |
1504 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1505 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1506 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1507 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1508 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1509 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
1510 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; | |
1511 | //1 and 2 | |
1512 | for (int i2=i1+1; i2<k1; i2++) | |
1513 | { | |
1514 | ////cout << " i2:" << i2 << endl; | |
1515 | id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl; | |
1516 | if (id_1!=id_2) | |
1517 | { | |
1518 | q_2 = _charge_1[i2]; ////cout << " q_1:" << q_1 << endl; | |
1519 | iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1520 | iPt_2 = _iPt_1[i2]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1521 | corr_2 = _correction_1[i2]; ////cout << " corr_1:" << corr_1 << endl; | |
1522 | pt_2 = _pt_1[i2]; ////cout << " pt_1:" << pt_1 << endl; | |
1523 | dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl; | |
1524 | corr = corr_1*corr_2; | |
1525 | 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)) | |
1526 | { | |
1527 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
1528 | } | |
1529 | else // swap particles | |
1530 | { | |
1531 | ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl; | |
1532 | } | |
1533 | ||
1534 | __n2_12 += corr; | |
1535 | __n2_12_vsEtaPhi[ij] += corr; | |
1536 | ptpt = pt_1*pt_2; | |
1537 | __s2ptpt_12 += corr*ptpt; | |
1538 | __s2PtN_12 += corr*pt_1; | |
1539 | __s2NPt_12 += corr*pt_2; | |
1540 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1541 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1542 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
1543 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1544 | ||
1545 | __n2Nw_12 += 1; | |
1546 | __s2ptptNw_12 += ptpt; | |
1547 | __s2PtNNw_12 += pt_1; | |
1548 | __s2NPtNw_12 += pt_2; | |
1549 | ||
1550 | } | |
1551 | } //i2 | |
1552 | } //i1 | |
1553 | } | |
1554 | else // field<0 | |
1555 | { | |
1556 | for (int i1=0; i1<k1; i1++) | |
1557 | { | |
1558 | ////cout << " i1:" << i1 << endl; | |
1559 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1560 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1561 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1562 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1563 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1564 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
1565 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; | |
1566 | //1 and 2 | |
1567 | for (int i2=i1+1; i2<k1; i2++) | |
1568 | { | |
1569 | ////cout << " i2:" << i2 << endl; | |
1570 | id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl; | |
1571 | if (id_1!=id_2) | |
1572 | { | |
1573 | q_2 = _charge_1[i2]; ////cout << " q_2:" << q_2 << endl; | |
1574 | iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl; | |
1575 | iPt_2 = _iPt_1[i2]; ////cout << " iPt_2:" << iPt_2 << endl; | |
1576 | corr_2 = _correction_1[i2]; ////cout << " corr_2:" << corr_2 << endl; | |
1577 | pt_2 = _pt_1[i2]; ////cout << " pt_2:" << pt_2 << endl; | |
1578 | dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl; | |
1579 | corr = corr_1*corr_2; | |
1580 | 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)) | |
1581 | { | |
1582 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
1583 | } | |
1584 | else // swap particles | |
1585 | { | |
1586 | ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl; | |
1587 | } | |
1588 | ||
1589 | __n2_12 += corr; | |
1590 | __n2_12_vsEtaPhi[ij] += corr; | |
1591 | ptpt = pt_1*pt_2; | |
1592 | __s2ptpt_12 += corr*ptpt; | |
1593 | __s2PtN_12 += corr*pt_1; | |
1594 | __s2NPt_12 += corr*pt_2; | |
1595 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1596 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1597 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
1598 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1599 | ||
1600 | __n2Nw_12 += 1; | |
1601 | __s2ptptNw_12 += ptpt; | |
1602 | __s2PtNNw_12 += pt_1; | |
1603 | __s2NPtNw_12 += pt_2; | |
1604 | ||
1605 | } | |
1606 | } //i2 | |
1607 | } //i1 | |
1608 | } | |
1609 | ||
1610 | ||
1611 | } | |
1612 | else // filter 1 and 2 are different -- must do all particle pairs... | |
1613 | { | |
1614 | for (int i1=0; i1<k1; i1++) | |
1615 | { | |
1616 | ////cout << " i1:" << i1 << endl; | |
1617 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1618 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1619 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1620 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1621 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1622 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
1623 | px_1 = _px_1[i1]; ////cout << " px_1:" << px_1 << endl; | |
1624 | py_1 = _py_1[i1]; ////cout << " py_1:" << py_1 << endl; | |
1625 | pz_1 = _pz_1[i1]; ////cout << " pz_1:" << pz_1 << endl; | |
1626 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; | |
1627 | ||
1628 | //1 and 2 | |
1629 | for (int i2=0; i2<k2; i2++) | |
1630 | { | |
1631 | ////cout << " i2:" << i2 << endl; | |
1632 | id_2 = _id_2[i2]; ////cout << " id_2:" << id_2 << endl; | |
1633 | if (id_1!=id_2) // exclude auto correlation | |
1634 | { | |
1635 | q_2 = _charge_2[i2]; ////cout << " q_2:" << q_2 << endl; | |
1636 | iEtaPhi_2 = _iEtaPhi_2[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl; | |
1637 | iPt_2 = _iPt_2[i2]; ////cout << " iPt_2:" << iPt_2 << endl; | |
1638 | corr_2 = _correction_2[i2]; ////cout << " corr_2:" << corr_2 << endl; | |
1639 | pt_2 = _pt_2[i2]; ////cout << " pt_2:" << pt_2 << endl; | |
1640 | px_2 = _px_2[i2]; ////cout << " px_2:" << px_2 << endl; | |
1641 | py_2 = _py_2[i2]; ////cout << " py_2:" << py_2 << endl; | |
1642 | pz_2 = _pz_2[i2]; ////cout << " pz_2:" << pz_2 << endl; | |
1643 | dedx_2 = _dedx_2[i2]; ////cout << " dedx_2:" << dedx_2 << endl; | |
1644 | if (_rejectPairConversion) | |
1645 | { | |
1646 | float e1Sq = massElecSq + pt_1*pt_1 + pz_1*pz_1; | |
1647 | float e2Sq = massElecSq + pt_2*pt_2 + pz_2*pz_2; | |
1648 | float mInvSq = 2*(massElecSq + sqrt(e1Sq*e2Sq) - px_1*px_2 - py_1*py_2 - pz_1*pz_2 ); | |
1649 | float mInv = sqrt(mInvSq); | |
1650 | _invMass->Fill(mInv); | |
1651 | if (mInv<0.5) | |
1652 | { | |
1653 | if (dedx_1>75. && dedx_2>75.) | |
1654 | { | |
1655 | _invMassElec->Fill(mInv); | |
1656 | if (mInv<0.05) continue; | |
1657 | } | |
1658 | } | |
1659 | } | |
1660 | corr = corr_1*corr_2; | |
1661 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
1662 | __n2_12 += corr; | |
1663 | __n2_12_vsEtaPhi[ij] += corr; | |
1664 | ptpt = pt_1*pt_2; | |
1665 | __s2ptpt_12 += corr*ptpt; | |
1666 | __s2PtN_12 += corr*pt_1; | |
1667 | __s2NPt_12 += corr*pt_2; | |
1668 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1669 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1670 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
1671 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1672 | __n2Nw_12 += 1; | |
1673 | __s2ptptNw_12 += ptpt; | |
1674 | __s2PtNNw_12 += pt_1; | |
1675 | __s2NPtNw_12 += pt_2; | |
1676 | ||
1677 | } | |
1678 | } //i2 | |
1679 | } //i1 | |
1680 | } | |
1681 | ////cout << "_mult4:"<< _mult4 << " __s2ptpt_12:" << __s2ptpt_12 << " __s2PtN_12:" << __s2PtN_12 << endl; | |
1682 | _n2_12_vsM->Fill(_mult4, __n2_12); | |
1683 | _s2PtPt_12_vsM->Fill(_mult4, __s2ptpt_12); | |
1684 | _s2PtN_12_vsM->Fill(_mult4, __s2NPt_12); | |
1685 | _s2NPt_12_vsM->Fill(_mult4, __s2PtN_12); | |
1686 | ||
1687 | _n2Nw_12_vsM->Fill(_mult4, __n2Nw_12); | |
1688 | _s2PtPtNw_12_vsM->Fill(_mult4, __s2ptptNw_12); | |
1689 | _s2PtNNw_12_vsM->Fill(_mult4, __s2NPtNw_12); | |
1690 | _s2NPtNw_12_vsM->Fill(_mult4, __s2PtNNw_12); | |
1691 | ||
1692 | ////cout << "Event Done " << endl; | |
1693 | PostData(0,_outputHistoList); | |
1694 | ||
1695 | } | |
1696 | ||
1697 | void AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() | |
1698 | { | |
ba6301d5 | 1699 | cout << "AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Starting." << endl; |
9cabc5db | 1700 | finalizeHistograms(); |
1701 | PostData(0,_outputHistoList); | |
ba6301d5 | 1702 | cout << "AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Done." << endl; |
9cabc5db | 1703 | } |
1704 | ||
ba6301d5 | 1705 | void AliAnalysisTaskDptDptCorrelations::Terminate(Option_t* /*option*/) |
9cabc5db | 1706 | { |
ba6301d5 | 1707 | // no ops |
9cabc5db | 1708 | } |
1709 | ||
1710 | ||
1711 | //Tools | |
1712 | //=================================================================================================== | |
1713 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH1 * h, float * array, int size) | |
1714 | { | |
1715 | int i, i1; | |
1716 | float v1, ev1, v2, ev2, sum, esum; | |
1717 | for (i=0, i1=1; i<size; ++i,++i1) | |
1718 | { | |
1719 | v1 = array[i]; ev1 = sqrt(v1); | |
1720 | v2 = h->GetBinContent(i1); | |
1721 | ev2 = h->GetBinError(i1); | |
1722 | sum = v1 + v2; | |
1723 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1724 | h->SetBinContent(i1,sum); | |
1725 | h->SetBinError(i1,esum); | |
1726 | } | |
1727 | } | |
1728 | ||
1729 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH2 * h, float * array, int size1, int size2) | |
1730 | { | |
1731 | int i, i1; | |
1732 | int j, j1; | |
1733 | float v1, ev1, v2, ev2, sum, esum; | |
1734 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1735 | { | |
1736 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1737 | { | |
1738 | v1 = array[i*size2+j]; ev1 = sqrt(v1); | |
1739 | v2 = h->GetBinContent(i1,j1); | |
1740 | ev2 = h->GetBinError(i1,j1); | |
1741 | sum = v1 + v2; | |
1742 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1743 | h->SetBinContent(i1,j1,sum); | |
1744 | h->SetBinError(i1,j1,esum); | |
1745 | } | |
1746 | } | |
1747 | } | |
1748 | ||
1749 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH3 * h, float * array, int size1, int size2, int size3) | |
1750 | { | |
1751 | int i, i1; | |
1752 | int j, j1; | |
1753 | int k, k1; | |
1754 | float v1, ev1, v2, ev2, sum, esum; | |
1755 | int size23 = size2*size3; | |
1756 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1757 | { | |
1758 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1759 | { | |
1760 | for (k=0, k1=1; k<size3; ++k,++k1) | |
1761 | { | |
1762 | v1 = array[i*size23+j*size3+k]; ev1 = sqrt(v1); | |
1763 | v2 = h->GetBinContent(i1,j1,k1); | |
1764 | ev2 = h->GetBinError(i1,j1,k1); | |
1765 | sum = v1 + v2; | |
1766 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1767 | h->SetBinContent(i1,j1,k1,sum); | |
1768 | h->SetBinError(i1,j1,k1,esum); | |
1769 | } | |
1770 | } | |
1771 | } | |
1772 | } | |
1773 | ||
1774 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH1 * h, double * array, int size) | |
1775 | { | |
1776 | int i, i1; | |
1777 | double v1, ev1, v2, ev2, sum, esum; | |
1778 | for (i=0, i1=1; i<size; ++i,++i1) | |
1779 | { | |
1780 | v1 = array[i]; ev1 = sqrt(v1); | |
1781 | v2 = h->GetBinContent(i1); | |
1782 | ev2 = h->GetBinError(i1); | |
1783 | sum = v1 + v2; | |
1784 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1785 | h->SetBinContent(i1,sum); | |
1786 | h->SetBinError(i1,esum); | |
1787 | } | |
1788 | } | |
1789 | ||
1790 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH2 * h, double * array, int size1, int size2) | |
1791 | { | |
1792 | int i, i1; | |
1793 | int j, j1; | |
1794 | double v1, ev1, v2, ev2, sum, esum; | |
1795 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1796 | { | |
1797 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1798 | { | |
1799 | v1 = array[i*size2+j]; ev1 = sqrt(v1); | |
1800 | v2 = h->GetBinContent(i1,j1); | |
1801 | ev2 = h->GetBinError(i1,j1); | |
1802 | sum = v1 + v2; | |
1803 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1804 | h->SetBinContent(i1,j1,sum); | |
1805 | h->SetBinError(i1,j1,esum); | |
1806 | } | |
1807 | } | |
1808 | } | |
1809 | ||
1810 | void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH3 * h, double * array, int size1, int size2, int size3) | |
1811 | { | |
1812 | int i, i1; | |
1813 | int j, j1; | |
1814 | int k, k1; | |
1815 | double v1, ev1, v2, ev2, sum, esum; | |
1816 | int size23 = size2*size3; | |
1817 | for (i=0, i1=1; i<size1; ++i,++i1) | |
1818 | { | |
1819 | for (j=0, j1=1; j<size2; ++j,++j1) | |
1820 | { | |
1821 | for (k=0, k1=1; k<size3; ++k,++k1) | |
1822 | { | |
1823 | v1 = array[i*size23+j*size3+k]; ev1 = sqrt(v1); | |
1824 | v2 = h->GetBinContent(i1,j1,k1); | |
1825 | ev2 = h->GetBinError(i1,j1,k1); | |
1826 | sum = v1 + v2; | |
1827 | esum = sqrt(ev1*ev1+ev2*ev2); | |
1828 | h->SetBinContent(i1,j1,k1,sum); | |
1829 | h->SetBinError(i1,j1,k1,esum); | |
1830 | } | |
1831 | } | |
1832 | } | |
1833 | } | |
1834 | ||
1835 | //________________________________________________________________________ | |
1836 | double * AliAnalysisTaskDptDptCorrelations::getDoubleArray(int size, double v) | |
1837 | { | |
1838 | /// Allocate an array of type double with n values | |
1839 | /// Initialize the array to the given value | |
1840 | double * array = new double [size]; | |
1841 | for (int i=0;i<size;++i) array[i]=v; | |
1842 | return array; | |
1843 | } | |
1844 | ||
1845 | //________________________________________________________________________ | |
1846 | float * AliAnalysisTaskDptDptCorrelations::getFloatArray(int size, float v) | |
1847 | { | |
1848 | /// Allocate an array of type float with n values | |
1849 | /// Initialize the array to the given value | |
1850 | float * array = new float [size]; | |
1851 | for (int i=0;i<size;++i) array[i]=v; | |
1852 | return array; | |
1853 | } | |
1854 | ||
1855 | ||
1856 | //________________________________________________________________________ | |
1857 | TH1D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString & name, const TString & title, | |
1858 | int n, double xMin, double xMax, | |
1859 | const TString & xTitle, const TString & yTitle) | |
1860 | { | |
1861 | //CreateHisto new 1D historgram | |
1862 | AliInfo(Form("createHisto 1D histo %s nBins: %d xMin: %f xMax: %f",name.Data(),n,xMin,xMax)); | |
1863 | TH1D * h = new TH1D(name,title,n,xMin,xMax); | |
1864 | h->GetXaxis()->SetTitle(xTitle); | |
1865 | h->GetYaxis()->SetTitle(yTitle); | |
1866 | addToList(h); | |
1867 | return h; | |
1868 | } | |
1869 | ||
1870 | ||
1871 | //________________________________________________________________________ | |
1872 | TH1D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString & name, const TString & title, | |
1873 | int n, double * bins, | |
1874 | const TString & xTitle, const TString & yTitle) | |
1875 | { | |
1876 | AliInfo(Form("createHisto 1D histo %s with %d non uniform nBins",name.Data(),n)); | |
1877 | TH1D * h = new TH1D(name,title,n,bins); | |
1878 | h->GetXaxis()->SetTitle(xTitle); | |
1879 | h->GetYaxis()->SetTitle(yTitle); | |
1880 | addToList(h); | |
1881 | return h; | |
1882 | } | |
1883 | ||
1884 | ||
1885 | //________________________________________________________________________ | |
1886 | TH2D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString & name, const TString & title, | |
1887 | int nx, double xMin, double xMax, int ny, double yMin, double yMax, | |
1888 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1889 | { | |
1890 | 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)); | |
1891 | TH2D * h = new TH2D(name,title,nx,xMin,xMax,ny,yMin,yMax); | |
1892 | h->GetXaxis()->SetTitle(xTitle); | |
1893 | h->GetYaxis()->SetTitle(yTitle); | |
1894 | h->GetZaxis()->SetTitle(zTitle); | |
1895 | addToList(h); | |
1896 | return h; | |
1897 | } | |
1898 | ||
1899 | //________________________________________________________________________ | |
1900 | TH2D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString & name, const TString & title, | |
1901 | int nx, double* xbins, int ny, double yMin, double yMax, | |
1902 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1903 | { | |
1904 | AliInfo(Form("createHisto 2D histo %s with %d non uniform nBins",name.Data(),nx)); | |
1905 | TH2D * h; | |
1906 | h = new TH2D(name,title,nx,xbins,ny,yMin,yMax); | |
1907 | h->GetXaxis()->SetTitle(xTitle); | |
1908 | h->GetYaxis()->SetTitle(yTitle); | |
1909 | h->GetZaxis()->SetTitle(zTitle); | |
1910 | addToList(h); | |
1911 | return h; | |
1912 | } | |
1913 | ||
1914 | ||
1915 | //________________________________________________________________________ | |
1916 | TH3F * AliAnalysisTaskDptDptCorrelations::createHisto(const TString & name, const TString & title, | |
1917 | int nx, double xMin, double xMax, | |
1918 | int ny, double yMin, double yMax, | |
1919 | int nz, double zMin, double zMax, | |
1920 | const TString & xTitle, const TString & yTitle, const TString & zTitle) | |
1921 | { | |
1922 | 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)); | |
1923 | TH3F * h = new TH3F(name,title,nx,xMin,xMax,ny,yMin,yMax,nz,zMin,zMax); | |
1924 | h->GetXaxis()->SetTitle(xTitle); | |
1925 | h->GetYaxis()->SetTitle(yTitle); | |
1926 | h->GetZaxis()->SetTitle(zTitle); | |
1927 | addToList(h); | |
1928 | return h; | |
1929 | } | |
1930 | ||
1931 | ||
1932 | //________________________________________________________________________ | |
1933 | TProfile * AliAnalysisTaskDptDptCorrelations::createProfile(const TString & name, const TString & description, | |
1934 | int nx,double xMin,double xMax, | |
1935 | const TString & xTitle, const TString & yTitle) | |
1936 | { | |
1937 | AliInfo(Form("createHisto 1D profile %s nBins: %d xMin: %f10.4 xMax: %f10.4",name.Data(),nx,xMin,xMax)); | |
1938 | TProfile * h = new TProfile(name,description,nx,xMin,xMax); | |
1939 | h->GetXaxis()->SetTitle(xTitle); | |
1940 | h->GetYaxis()->SetTitle(yTitle); | |
1941 | addToList(h); | |
1942 | return h; | |
1943 | } | |
1944 | ||
1945 | //________________________________________________________________________ | |
1946 | TProfile * AliAnalysisTaskDptDptCorrelations::createProfile(const TString & name,const TString & description, | |
1947 | int nx, double* bins, | |
1948 | const TString & xTitle, const TString & yTitle) | |
1949 | { | |
1950 | AliInfo(Form("createHisto 1D profile %s with %d non uniform bins",name.Data(),nx)); | |
1951 | TProfile * h = new TProfile(name,description,nx,bins); | |
1952 | h->GetXaxis()->SetTitle(xTitle); | |
1953 | h->GetYaxis()->SetTitle(yTitle); | |
1954 | addToList(h); | |
1955 | return h; | |
1956 | } | |
1957 | ||
1958 | ||
1959 | void AliAnalysisTaskDptDptCorrelations::addToList(TH1 *h) | |
1960 | { | |
1961 | if (_outputHistoList) | |
1962 | { | |
1963 | _outputHistoList->Add(h); | |
1964 | } | |
1965 | else | |
1966 | cout << "addToList(TH1 *h) _outputHistoList is null!!!!! Shoudl abort ship" << endl; | |
1967 | ||
1968 | } | |
1969 | ||
1970 | ||
1971 |