]>
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 | ||
cc7ee8f9 | 16 | #include "TChain.h" |
17 | #include "TList.h" | |
18 | #include "TFile.h" | |
19 | #include "TTree.h" | |
20 | #include "TH1D.h" | |
21 | #include "TH2D.h" | |
22 | #include "TH3D.h" | |
23 | #include "THnSparse.h" | |
24 | #include "TCanvas.h" | |
f35407ff | 25 | #include "TRandom.h" |
cc7ee8f9 | 26 | |
9cabc5db | 27 | #include <TROOT.h> |
28 | #include <TChain.h> | |
29 | #include <TFile.h> | |
30 | #include <TList.h> | |
31 | #include <TMath.h> | |
32 | #include <TTree.h> | |
33 | #include <TH1F.h> | |
34 | #include <TH2F.h> | |
35 | #include <TH3F.h> | |
36 | #include <TProfile.h> | |
37 | #include <TH1D.h> | |
38 | #include <TH2D.h> | |
39 | #include <TH3D.h> | |
9cabc5db | 40 | #include "AliAnalysisManager.h" |
41 | ||
42 | #include "AliAODHandler.h" | |
43 | #include "AliAODInputHandler.h" | |
9cabc5db | 44 | #include "AliInputEventHandler.h" |
45 | #include "AliLog.h" | |
46 | #include "AliESDEvent.h" | |
47 | #include "AliESDInputHandler.h" | |
48 | #include "AliMultiplicity.h" | |
49 | #include "AliCentrality.h" | |
50 | #include "AliAnalysisTaskDptDptCorrelations.h" | |
1cb2a06e | 51 | |
cc7ee8f9 | 52 | #include "AliPID.h" |
53 | #include "AliPIDResponse.h" | |
54 | ||
55 | #include "AliESDVertex.h" | |
56 | #include "AliESDEvent.h" | |
57 | #include "AliESDInputHandler.h" | |
58 | #include "AliAODEvent.h" | |
59 | #include "AliAODTrack.h" | |
60 | #include "AliAODInputHandler.h" | |
61 | #include "AliESD.h" | |
62 | #include "AliESDEvent.h" | |
63 | #include "AliAODEvent.h" | |
64 | #include "AliStack.h" | |
65 | #include "AliESDtrackCuts.h" | |
66 | #include "AliAODMCHeader.h" | |
67 | ||
68 | ||
69 | #include "AliGenHijingEventHeader.h" | |
70 | #include "AliGenEventHeader.h" | |
71 | #include "AliPID.h" | |
72 | #include "AliAODPid.h" | |
73 | #include "AliPIDResponse.h" | |
74 | #include "AliAODpidUtil.h" | |
75 | #include "AliPIDCombined.h" | |
76 | ||
77 | ||
2781d660 | 78 | |
9cabc5db | 79 | ClassImp(AliAnalysisTaskDptDptCorrelations) |
80 | ||
81 | AliAnalysisTaskDptDptCorrelations::AliAnalysisTaskDptDptCorrelations() | |
82 | : AliAnalysisTaskSE(), | |
83 | fAODEvent(0), | |
84 | fESDEvent(0), //! ESD Event | |
85 | fInputHandler(0), | |
cc7ee8f9 | 86 | fPIDResponse(0x0), |
9cabc5db | 87 | _outputHistoList(0), |
88 | _twoPi ( 2.0 * 3.1415927), | |
89 | _eventCount ( 0), | |
90 | _debugLevel ( 0), | |
91 | _singlesOnly ( 0), | |
92 | _useWeights ( 0), | |
93 | _sameFilter ( false), | |
94 | _rejectPileup ( 1), | |
95 | _rejectPairConversion ( 0), | |
96 | _vertexZMin ( -10), | |
97 | _vertexZMax ( 10), | |
98 | _vertexXYMin ( -10), | |
99 | _vertexXYMax ( 10), | |
100 | _centralityMethod ( 4), | |
101 | _centralityMin ( 0.), | |
102 | _centralityMax ( 0.), | |
103 | _requestedCharge_1 ( 1), | |
104 | _requestedCharge_2 ( -1), | |
105 | _dcaZMin ( -3), | |
106 | _dcaZMax ( 3.), | |
49f44fbe | 107 | _dcaXYMin ( -2.4), |
108 | _dcaXYMax ( 2.4), | |
9cabc5db | 109 | _dedxMin ( 0), |
110 | _dedxMax ( 100000), | |
8e9400c2 | 111 | _nClusterMin ( 80), |
4ebeb50b | 112 | _trackFilterBit (0), |
974257a9 | 113 | fNSigmaCut (3.), |
70de3ddf | 114 | _tpcnclus ( 50), |
115 | _chi2ndf (5.), | |
9cabc5db | 116 | _field ( 1.), |
117 | _nTracks ( 0 ), | |
118 | _mult0 ( 0 ), | |
119 | _mult1 ( 0 ), | |
120 | _mult2 ( 0 ), | |
121 | _mult3 ( 0 ), | |
122 | _mult4 ( 0 ), | |
b8ab2bb9 | 123 | _mult4a ( 0 ), |
9cabc5db | 124 | _mult5 ( 0 ), |
125 | _mult6 ( 0 ), | |
f35407ff | 126 | arraySize ( 2500), |
9cabc5db | 127 | _id_1(0), |
128 | _charge_1(0), | |
129 | _iEtaPhi_1(0), | |
130 | _iPt_1(0), | |
131 | _pt_1(0), | |
132 | _px_1(0), | |
133 | _py_1(0), | |
134 | _pz_1(0), | |
135 | _correction_1(0), | |
136 | _dedx_1(0), | |
137 | _id_2(0), | |
138 | _charge_2(0), | |
139 | _iEtaPhi_2(0), | |
140 | _iPt_2(0), | |
141 | _pt_2(0), | |
142 | _px_2(0), | |
143 | _py_2(0), | |
144 | _pz_2(0), | |
145 | _correction_2(0), | |
146 | _dedx_2(0), | |
147 | _correctionWeight_1(0), | |
148 | _correctionWeight_2(0), | |
149 | _nBins_M0(500), _min_M0(0), _max_M0(10000), _width_M0(20), | |
150 | _nBins_M1(500), _min_M1(0), _max_M1(10000), _width_M1(20), | |
151 | _nBins_M2(500), _min_M2(0), _max_M2(10000), _width_M2(20), | |
152 | _nBins_M3(500), _min_M3(0), _max_M3(10000), _width_M3(20), | |
153 | _nBins_M4(100), _min_M4(0), _max_M4(1), _width_M4(0.01), | |
154 | _nBins_M5(100), _min_M5(0), _max_M5(1), _width_M5(0.01), | |
155 | _nBins_M6(100), _min_M6(0), _max_M6(1), _width_M6(0.01), | |
156 | _nBins_vertexZ(40), _min_vertexZ(-10), _max_vertexZ(10), _width_vertexZ(0.5), | |
157 | ||
158 | _nBins_pt_1(18), _min_pt_1(0.2), _max_pt_1(2.0), _width_pt_1(0.1), | |
159 | _nBins_phi_1(72), _min_phi_1(0), _max_phi_1(2.*3.1415927),_width_phi_1(2.*3.1415927/72.), | |
5d603bbf | 160 | _nBins_eta_1(0), _min_eta_1(0), _max_eta_1(0), _width_eta_1(0.1), |
9cabc5db | 161 | |
162 | _nBins_etaPhi_1(0), | |
163 | _nBins_etaPhiPt_1(0), | |
164 | _nBins_zEtaPhiPt_1(0), | |
165 | ||
166 | _nBins_pt_2(18), _min_pt_2(0.2), _max_pt_2(2.0), _width_pt_2(0.1), | |
167 | _nBins_phi_2(72), _min_phi_2(0), _max_phi_2(2.*3.1415927),_width_phi_2(2.*3.1415927/72), | |
5d603bbf | 168 | _nBins_eta_2(0), _min_eta_2(0), _max_eta_2(0), _width_eta_2(0.1), |
9cabc5db | 169 | |
170 | _nBins_etaPhi_2(0), | |
171 | _nBins_etaPhiPt_2(0), | |
172 | _nBins_zEtaPhiPt_2(0), | |
173 | _nBins_etaPhi_12(0), | |
174 | __n1_1(0), | |
175 | __n1_2(0), | |
176 | __n2_12(0), | |
177 | __s1pt_1(0), | |
178 | __s1pt_2(0), | |
179 | __s2ptpt_12(0), | |
180 | __s2NPt_12(0), | |
181 | __s2PtN_12(0), | |
182 | __n1Nw_1(0), | |
183 | __n1Nw_2(0), | |
184 | __n2Nw_12(0), | |
185 | __s1ptNw_1(0), | |
186 | __s1ptNw_2(0), | |
187 | __s2ptptNw_12(0), | |
188 | __s2NPtNw_12(0), | |
189 | __s2PtNNw_12(0), | |
190 | __n1_1_vsPt(0), | |
191 | __n1_1_vsEtaPhi(0), | |
192 | __s1pt_1_vsEtaPhi(0), | |
193 | __n1_1_vsZEtaPhiPt(0), | |
194 | __n1_2_vsPt(0), | |
195 | __n1_2_vsEtaPhi(0), | |
196 | __s1pt_2_vsEtaPhi(0), | |
197 | __n1_2_vsZEtaPhiPt(0), | |
198 | __n2_12_vsPtPt(0), | |
199 | __n2_12_vsEtaPhi(0), | |
200 | __s2ptpt_12_vsEtaPhi(0), | |
201 | __s2PtN_12_vsEtaPhi(0), | |
202 | __s2NPt_12_vsEtaPhi(0), | |
203 | _weight_1 ( 0 ), | |
204 | _weight_2 ( 0 ), | |
205 | _eventAccounting ( 0), | |
206 | _m0 ( 0), | |
207 | _m1 ( 0), | |
208 | _m2 ( 0), | |
209 | _m3 ( 0), | |
210 | _m4 ( 0), | |
211 | _m5 ( 0), | |
212 | _m6 ( 0), | |
405d1b01 | 213 | _vertexZ ( 0), |
d9e7b37f | 214 | |
405d1b01 | 215 | _Ncluster1 ( 0), |
216 | _Ncluster2 ( 0), | |
217 | _etadis ( 0), | |
218 | _phidis ( 0), | |
219 | _dcaz ( 0), | |
220 | _dcaxy ( 0), | |
9cabc5db | 221 | _n1_1_vsPt ( 0), |
222 | _n1_1_vsEtaVsPhi ( 0), | |
223 | _s1pt_1_vsEtaVsPhi ( 0), | |
224 | _n1_1_vsZVsEtaVsPhiVsPt ( 0), | |
5d603bbf | 225 | _n1_1_vsM ( 0), |
9cabc5db | 226 | _s1pt_1_vsM ( 0), |
5d603bbf | 227 | _n1Nw_1_vsM ( 0), |
9cabc5db | 228 | _s1ptNw_1_vsM ( 0), |
229 | _dedxVsP_1 ( 0), | |
230 | _corrDedxVsP_1 ( 0), | |
231 | _betaVsP_1 ( 0), | |
232 | _n1_2_vsPt ( 0), | |
233 | _n1_2_vsEtaVsPhi ( 0), | |
234 | _s1pt_2_vsEtaVsPhi ( 0), | |
235 | _n1_2_vsZVsEtaVsPhiVsPt ( 0), | |
236 | _n1_2_vsM ( 0), | |
237 | _s1pt_2_vsM ( 0), | |
238 | _n1Nw_2_vsM ( 0), | |
239 | _s1ptNw_2_vsM ( 0), | |
240 | _dedxVsP_2 ( 0), | |
241 | _corrDedxVsP_2 ( 0), | |
242 | _betaVsP_2 ( 0), | |
243 | _n2_12_vsEtaPhi ( 0), | |
244 | _n2_12_vsPtVsPt ( 0), | |
245 | _s2PtPt_12_vsEtaPhi( 0), | |
246 | _s2PtN_12_vsEtaPhi ( 0), | |
247 | _s2NPt_12_vsEtaPhi ( 0), | |
248 | _n2_12_vsM ( 0), | |
249 | _s2PtPt_12_vsM ( 0), | |
250 | _s2PtN_12_vsM ( 0), | |
251 | _s2NPt_12_vsM ( 0), | |
252 | _n2Nw_12_vsM ( 0), | |
253 | _s2PtPtNw_12_vsM ( 0), | |
254 | _s2PtNNw_12_vsM ( 0), | |
255 | _s2NPtNw_12_vsM ( 0), | |
256 | _invMass ( 0), | |
257 | _invMassElec ( 0), | |
258 | n1Name("NA"), | |
259 | n1NwName("NA"), | |
260 | n2Name("NA"), | |
261 | n2NwName("NA"), | |
262 | n3Name("NA"), | |
263 | n1n1Name("NA"), | |
264 | n1n1n1Name("NA"), | |
265 | n2n1Name("NA"), | |
266 | r1Name("NA"), | |
267 | r2Name("NA"), | |
268 | r3Name("NA"), | |
269 | r2r1Name("NA"), | |
270 | c2Name("NA"), | |
271 | c3Name("NA"), | |
272 | d3Name("NA"), | |
273 | p3Name("NA"), | |
274 | cName("NA"), | |
275 | ||
276 | intR2Name("NA"), | |
277 | binCorrName("NA"), | |
278 | intBinCorrName("NA"), | |
279 | ||
280 | countsName("NA"), | |
281 | part_1_Name("NA"), | |
282 | part_2_Name("NA"), | |
283 | part_3_Name("NA"), | |
284 | pair_12_Name("NA"), | |
285 | pair_13_Name("NA"), | |
286 | pair_23_Name("NA"), | |
287 | tripletName("NA"), | |
288 | ||
289 | avg("NA"), | |
290 | avgName("NA"), | |
291 | sumName("NA"), | |
292 | s1ptName("NA"), | |
293 | s1ptNwName("NA"), | |
294 | s1DptName("NA"), | |
295 | ||
296 | s2PtPtName("NA"), | |
297 | s2NPtName("NA"), | |
298 | s2PtNName("NA"), | |
299 | s2DptDptName("NA"), | |
300 | ||
301 | s2PtPtNwName("NA"), | |
302 | s2NPtNwName("NA"), | |
303 | s2PtNNwName("NA"), | |
304 | ||
305 | ptName("NA"), | |
306 | ptptName("NA"), | |
307 | pt1pt1Name("NA"), | |
308 | DptName("NA"), | |
309 | DptDptName("NA"), | |
310 | RDptDptName("NA"), | |
311 | nPtName("NA"), | |
312 | ptNName("NA"), | |
313 | seanName("NA"), | |
314 | ||
315 | _title_counts("NA"), | |
316 | ||
317 | _title_m0("NA"), | |
318 | _title_m1("NA"), | |
319 | _title_m2("NA"), | |
320 | _title_m3("NA"), | |
321 | _title_m4("NA"), | |
322 | _title_m5("NA"), | |
323 | _title_m6("NA"), | |
324 | ||
325 | _title_eta_1("NA"), | |
326 | _title_phi_1("NA"), | |
327 | _title_pt_1("NA"), | |
328 | _title_etaPhi_1("NA"), | |
329 | _title_n_1("NA"), | |
330 | _title_SumPt_1("NA"), | |
331 | _title_AvgPt_1("NA"), | |
332 | _title_AvgN_1("NA"), | |
333 | _title_AvgSumPt_1("NA"), | |
334 | ||
335 | _title_eta_2("NA"), | |
336 | _title_phi_2("NA"), | |
337 | _title_pt_2("NA"), | |
338 | _title_etaPhi_2("NA"), | |
339 | _title_n_2("NA"), | |
340 | _title_SumPt_2("NA"), | |
341 | _title_AvgPt_2("NA"), | |
342 | _title_AvgN_2("NA"), | |
343 | _title_AvgSumPt_2("NA"), | |
344 | ||
345 | _title_etaPhi_12("NA"), | |
346 | ||
347 | _title_AvgN2_12("NA"), | |
348 | _title_AvgSumPtPt_12("NA"), | |
349 | _title_AvgSumPtN_12("NA"), | |
350 | _title_AvgNSumPt_12("NA"), | |
351 | ||
352 | vsZ("NA"), | |
353 | vsM("NA"), | |
354 | vsPt("NA"), | |
355 | vsPhi("NA"), | |
356 | vsEta("NA"), | |
357 | vsEtaPhi("NA"), | |
358 | vsPtVsPt("NA") | |
359 | { | |
360 | printf("Default constructor called \n"); | |
361 | ||
362 | printf("passed \n "); | |
363 | ||
364 | } | |
365 | ||
366 | AliAnalysisTaskDptDptCorrelations::AliAnalysisTaskDptDptCorrelations(const TString & name) | |
367 | : AliAnalysisTaskSE(name), | |
368 | fAODEvent(0), | |
369 | fESDEvent(0), | |
370 | fInputHandler(0), | |
cc7ee8f9 | 371 | fPIDResponse(0), |
9cabc5db | 372 | _outputHistoList(0), |
373 | _twoPi ( 2.0 * 3.1415927), | |
374 | _eventCount ( 0), | |
375 | _debugLevel ( 0), | |
376 | _singlesOnly ( 0), | |
377 | _useWeights ( 0), | |
378 | _sameFilter ( false), | |
379 | _rejectPileup ( 1), | |
380 | _rejectPairConversion ( 0), | |
381 | _vertexZMin ( -10.), | |
382 | _vertexZMax ( 10.), | |
383 | _vertexXYMin ( -10.), | |
384 | _vertexXYMax ( 10.), | |
385 | _centralityMethod ( 4), | |
386 | _centralityMin ( 0.), | |
387 | _centralityMax ( 1.), | |
388 | _requestedCharge_1 ( 1), | |
389 | _requestedCharge_2 ( -1), | |
390 | _dcaZMin ( -3), | |
391 | _dcaZMax ( 3.), | |
49f44fbe | 392 | _dcaXYMin ( -2.4), |
393 | _dcaXYMax ( 2.4), | |
9cabc5db | 394 | _dedxMin ( 0), |
395 | _dedxMax ( 100000), | |
8e9400c2 | 396 | _nClusterMin ( 80), |
4ebeb50b | 397 | _trackFilterBit ( 0), |
974257a9 | 398 | fNSigmaCut ( 3.), |
d0b37020 | 399 | _tpcnclus ( 50), |
400 | _chi2ndf (5.), | |
9cabc5db | 401 | _field ( 1.), |
402 | _nTracks ( 0 ), | |
403 | _mult0 ( 0 ), | |
404 | _mult1 ( 0 ), | |
405 | _mult2 ( 0 ), | |
406 | _mult3 ( 0 ), | |
407 | _mult4 ( 0 ), | |
b8ab2bb9 | 408 | _mult4a ( 0 ), |
9cabc5db | 409 | _mult5 ( 0 ), |
410 | _mult6 ( 0 ), | |
f35407ff | 411 | arraySize ( 2500), |
9cabc5db | 412 | _id_1(0), |
413 | _charge_1(0), | |
414 | _iEtaPhi_1(0), | |
415 | _iPt_1(0), | |
416 | _pt_1(0), | |
417 | _px_1(0), | |
418 | _py_1(0), | |
419 | _pz_1(0), | |
420 | _correction_1(0), | |
421 | _dedx_1(0), | |
422 | _id_2(0), | |
423 | _charge_2(0), | |
424 | _iEtaPhi_2(0), | |
425 | _iPt_2(0), | |
426 | _pt_2(0), | |
427 | _px_2(0), | |
428 | _py_2(0), | |
429 | _pz_2(0), | |
430 | _correction_2(0), | |
431 | _dedx_2(0), | |
432 | _correctionWeight_1(0), | |
433 | _correctionWeight_2(0), | |
434 | _nBins_M0(500), _min_M0(0), _max_M0(10000), _width_M0(20), | |
435 | _nBins_M1(500), _min_M1(0), _max_M1(10000), _width_M1(20), | |
436 | _nBins_M2(500), _min_M2(0), _max_M2(10000), _width_M2(20), | |
437 | _nBins_M3(500), _min_M3(0), _max_M3(10000), _width_M3(20), | |
438 | _nBins_M4(100), _min_M4(0), _max_M4(1), _width_M4(0.01), | |
439 | _nBins_M5(100), _min_M5(0), _max_M5(1), _width_M5(0.01), | |
440 | _nBins_M6(100), _min_M6(0), _max_M6(1), _width_M6(0.01), | |
441 | _nBins_vertexZ(40), _min_vertexZ(-10), _max_vertexZ(10), _width_vertexZ(0.5), | |
442 | ||
443 | _nBins_pt_1(18), _min_pt_1(0.2), _max_pt_1(2.0), _width_pt_1(0.1), | |
444 | _nBins_phi_1(72), _min_phi_1(0), _max_phi_1(2.*3.1415927),_width_phi_1(2.*3.1415927/72.), | |
5d603bbf | 445 | _nBins_eta_1(0), _min_eta_1(0), _max_eta_1(0), _width_eta_1(0.1), |
9cabc5db | 446 | |
447 | _nBins_etaPhi_1(0), | |
448 | _nBins_etaPhiPt_1(0), | |
449 | _nBins_zEtaPhiPt_1(0), | |
450 | ||
451 | _nBins_pt_2(18), _min_pt_2(0.2), _max_pt_2(2.0), _width_pt_2(0.1), | |
452 | _nBins_phi_2(72), _min_phi_2(0), _max_phi_2(2.*3.1415927),_width_phi_2(2.*3.1415927/72), | |
5d603bbf | 453 | _nBins_eta_2(0), _min_eta_2(0), _max_eta_2(0), _width_eta_2(0.1), |
9cabc5db | 454 | |
455 | _nBins_etaPhi_2(0), | |
456 | _nBins_etaPhiPt_2(0), | |
457 | _nBins_zEtaPhiPt_2(0), | |
458 | _nBins_etaPhi_12(0), | |
459 | __n1_1(0), | |
460 | __n1_2(0), | |
461 | __n2_12(0), | |
462 | __s1pt_1(0), | |
463 | __s1pt_2(0), | |
464 | __s2ptpt_12(0), | |
465 | __s2NPt_12(0), | |
466 | __s2PtN_12(0), | |
467 | __n1Nw_1(0), | |
468 | __n1Nw_2(0), | |
469 | __n2Nw_12(0), | |
470 | __s1ptNw_1(0), | |
471 | __s1ptNw_2(0), | |
472 | __s2ptptNw_12(0), | |
473 | __s2NPtNw_12(0), | |
474 | __s2PtNNw_12(0), | |
475 | __n1_1_vsPt(0), | |
476 | __n1_1_vsEtaPhi(0), | |
477 | __s1pt_1_vsEtaPhi(0), | |
478 | __n1_1_vsZEtaPhiPt(0), | |
479 | __n1_2_vsPt(0), | |
480 | __n1_2_vsEtaPhi(0), | |
481 | __s1pt_2_vsEtaPhi(0), | |
482 | __n1_2_vsZEtaPhiPt(0), | |
483 | __n2_12_vsPtPt(0), | |
484 | __n2_12_vsEtaPhi(0), | |
485 | __s2ptpt_12_vsEtaPhi(0), | |
486 | __s2PtN_12_vsEtaPhi(0), | |
487 | __s2NPt_12_vsEtaPhi(0), | |
488 | _weight_1 ( 0 ), | |
489 | _weight_2 ( 0 ), | |
490 | _eventAccounting ( 0), | |
491 | _m0 ( 0), | |
492 | _m1 ( 0), | |
493 | _m2 ( 0), | |
494 | _m3 ( 0), | |
495 | _m4 ( 0), | |
496 | _m5 ( 0), | |
497 | _m6 ( 0), | |
405d1b01 | 498 | _vertexZ ( 0), |
499 | _Ncluster1 ( 0), | |
500 | _Ncluster2 ( 0), | |
d9e7b37f | 501 | _etadis ( 0), |
502 | _phidis ( 0), | |
405d1b01 | 503 | |
d9e7b37f | 504 | _dcaz ( 0), |
505 | _dcaxy ( 0), | |
9cabc5db | 506 | _n1_1_vsPt ( 0), |
507 | _n1_1_vsEtaVsPhi ( 0), | |
508 | _s1pt_1_vsEtaVsPhi ( 0), | |
509 | _n1_1_vsZVsEtaVsPhiVsPt ( 0), | |
5d603bbf | 510 | _n1_1_vsM ( 0), |
9cabc5db | 511 | _s1pt_1_vsM ( 0), |
5d603bbf | 512 | _n1Nw_1_vsM ( 0), |
9cabc5db | 513 | _s1ptNw_1_vsM ( 0), |
514 | _dedxVsP_1 ( 0), | |
515 | _corrDedxVsP_1 ( 0), | |
516 | _betaVsP_1 ( 0), | |
517 | _n1_2_vsPt ( 0), | |
518 | _n1_2_vsEtaVsPhi ( 0), | |
519 | _s1pt_2_vsEtaVsPhi ( 0), | |
520 | _n1_2_vsZVsEtaVsPhiVsPt ( 0), | |
521 | _n1_2_vsM ( 0), | |
522 | _s1pt_2_vsM ( 0), | |
523 | _n1Nw_2_vsM ( 0), | |
524 | _s1ptNw_2_vsM ( 0), | |
525 | _dedxVsP_2 ( 0), | |
526 | _corrDedxVsP_2 ( 0), | |
527 | _betaVsP_2 ( 0), | |
528 | _n2_12_vsEtaPhi ( 0), | |
529 | _n2_12_vsPtVsPt ( 0), | |
530 | _s2PtPt_12_vsEtaPhi( 0), | |
531 | _s2PtN_12_vsEtaPhi ( 0), | |
532 | _s2NPt_12_vsEtaPhi ( 0), | |
533 | _n2_12_vsM ( 0), | |
534 | _s2PtPt_12_vsM ( 0), | |
535 | _s2PtN_12_vsM ( 0), | |
536 | _s2NPt_12_vsM ( 0), | |
537 | _n2Nw_12_vsM ( 0), | |
538 | _s2PtPtNw_12_vsM ( 0), | |
539 | _s2PtNNw_12_vsM ( 0), | |
540 | _s2NPtNw_12_vsM ( 0), | |
541 | _invMass ( 0), | |
542 | _invMassElec ( 0), | |
543 | n1Name("NA"), | |
544 | n1NwName("NA"), | |
545 | n2Name("NA"), | |
546 | n2NwName("NA"), | |
547 | n3Name("NA"), | |
548 | n1n1Name("NA"), | |
549 | n1n1n1Name("NA"), | |
550 | n2n1Name("NA"), | |
551 | r1Name("NA"), | |
552 | r2Name("NA"), | |
553 | r3Name("NA"), | |
554 | r2r1Name("NA"), | |
555 | c2Name("NA"), | |
556 | c3Name("NA"), | |
557 | d3Name("NA"), | |
558 | p3Name("NA"), | |
559 | cName("NA"), | |
560 | ||
561 | intR2Name("NA"), | |
562 | binCorrName("NA"), | |
563 | intBinCorrName("NA"), | |
564 | ||
565 | countsName("NA"), | |
566 | part_1_Name("NA"), | |
567 | part_2_Name("NA"), | |
568 | part_3_Name("NA"), | |
569 | pair_12_Name("NA"), | |
570 | pair_13_Name("NA"), | |
571 | pair_23_Name("NA"), | |
572 | tripletName("NA"), | |
573 | ||
574 | avg("NA"), | |
575 | avgName("NA"), | |
576 | sumName("NA"), | |
577 | s1ptName("NA"), | |
578 | s1ptNwName("NA"), | |
579 | s1DptName("NA"), | |
580 | ||
581 | s2PtPtName("NA"), | |
582 | s2NPtName("NA"), | |
583 | s2PtNName("NA"), | |
584 | s2DptDptName("NA"), | |
585 | ||
586 | s2PtPtNwName("NA"), | |
587 | s2NPtNwName("NA"), | |
588 | s2PtNNwName("NA"), | |
589 | ||
590 | ptName("NA"), | |
591 | ptptName("NA"), | |
592 | pt1pt1Name("NA"), | |
593 | DptName("NA"), | |
594 | DptDptName("NA"), | |
595 | RDptDptName("NA"), | |
596 | nPtName("NA"), | |
597 | ptNName("NA"), | |
598 | seanName("NA"), | |
599 | ||
600 | _title_counts("NA"), | |
601 | ||
602 | _title_m0("NA"), | |
603 | _title_m1("NA"), | |
604 | _title_m2("NA"), | |
605 | _title_m3("NA"), | |
606 | _title_m4("NA"), | |
607 | _title_m5("NA"), | |
608 | _title_m6("NA"), | |
609 | ||
610 | _title_eta_1("NA"), | |
611 | _title_phi_1("NA"), | |
612 | _title_pt_1("NA"), | |
613 | _title_etaPhi_1("NA"), | |
614 | _title_n_1("NA"), | |
615 | _title_SumPt_1("NA"), | |
616 | _title_AvgPt_1("NA"), | |
617 | _title_AvgN_1("NA"), | |
618 | _title_AvgSumPt_1("NA"), | |
619 | ||
620 | _title_eta_2("NA"), | |
621 | _title_phi_2("NA"), | |
622 | _title_pt_2("NA"), | |
623 | _title_etaPhi_2("NA"), | |
624 | _title_n_2("NA"), | |
625 | _title_SumPt_2("NA"), | |
626 | _title_AvgPt_2("NA"), | |
627 | _title_AvgN_2("NA"), | |
628 | _title_AvgSumPt_2("NA"), | |
629 | ||
630 | _title_etaPhi_12("NA"), | |
631 | ||
632 | _title_AvgN2_12("NA"), | |
633 | _title_AvgSumPtPt_12("NA"), | |
634 | _title_AvgSumPtN_12("NA"), | |
635 | _title_AvgNSumPt_12("NA"), | |
636 | ||
637 | vsZ("NA"), | |
638 | vsM("NA"), | |
639 | vsPt("NA"), | |
640 | vsPhi("NA"), | |
641 | vsEta("NA"), | |
642 | vsEtaPhi("NA"), | |
643 | vsPtVsPt("NA") | |
644 | { | |
645 | printf("2nd constructor called "); | |
646 | ||
647 | DefineOutput(0, TList::Class()); | |
648 | ||
649 | printf("passed "); | |
650 | ||
651 | } | |
652 | ||
653 | AliAnalysisTaskDptDptCorrelations::~AliAnalysisTaskDptDptCorrelations() | |
654 | { | |
5d603bbf | 655 | |
9cabc5db | 656 | } |
657 | ||
658 | void AliAnalysisTaskDptDptCorrelations::UserCreateOutputObjects() | |
659 | { | |
9cabc5db | 660 | OpenFile(0); |
661 | _outputHistoList = new TList(); | |
662 | _outputHistoList->SetOwner(); | |
663 | ||
9cabc5db | 664 | _nBins_M0 = 500; _min_M0 = 0.; _max_M0 = 5000.; _width_M0 = (_max_M0-_min_M0)/_nBins_M0; |
665 | _nBins_M1 = 500; _min_M1 = 0.; _max_M1 = 5000.; _width_M1 = (_max_M1-_min_M1)/_nBins_M1; | |
666 | _nBins_M2 = 500; _min_M2 = 0.; _max_M2 = 5000.; _width_M2 = (_max_M2-_min_M2)/_nBins_M2; | |
667 | _nBins_M3 = 500; _min_M3 = 0.; _max_M3 = 5000.; _width_M3 = (_max_M3-_min_M3)/_nBins_M3; | |
668 | _nBins_M4 = 100; _min_M4 = 0.; _max_M4 = 100.; _width_M4 = (_max_M4-_min_M4)/_nBins_M4; | |
669 | _nBins_M5 = 100; _min_M5 = 0.; _max_M5 = 100.; _width_M5 = (_max_M5-_min_M5)/_nBins_M5; | |
670 | _nBins_M6 = 100; _min_M6 = 0.; _max_M6 = 100.; _width_M6 = (_max_M6-_min_M6)/_nBins_M6; | |
671 | ||
672 | _min_vertexZ = _vertexZMin; | |
673 | _max_vertexZ = _vertexZMax; | |
674 | _width_vertexZ = 0.5; | |
675 | _nBins_vertexZ = int(0.5+ (_max_vertexZ - _min_vertexZ)/_width_vertexZ); | |
676 | _nBins_pt_1 = int(0.5+ (_max_pt_1 -_min_pt_1 )/_width_pt_1); | |
677 | _nBins_eta_1 = int(0.5+ (_max_eta_1-_min_eta_1)/_width_eta_1); | |
678 | _width_phi_1 = (_max_phi_1 - _min_phi_1) /_nBins_phi_1; | |
679 | _nBins_etaPhi_1 = _nBins_phi_1 * _nBins_eta_1; | |
680 | _nBins_etaPhiPt_1 = _nBins_etaPhi_1 * _nBins_pt_1; | |
681 | _nBins_zEtaPhiPt_1 = _nBins_vertexZ * _nBins_etaPhiPt_1; | |
682 | ||
683 | _nBins_pt_2 = int(0.5+ (_max_pt_2 -_min_pt_2 )/_width_pt_2); | |
684 | _nBins_eta_2 = int(0.5+ (_max_eta_2-_min_eta_2)/_width_eta_2); | |
685 | _width_phi_2 = (_max_phi_2 - _min_phi_2) /_nBins_phi_2; | |
686 | _nBins_etaPhi_2 = _nBins_phi_2 * _nBins_eta_2; | |
687 | _nBins_etaPhiPt_2 = _nBins_etaPhi_2 * _nBins_pt_2; | |
688 | _nBins_zEtaPhiPt_2 = _nBins_vertexZ * _nBins_etaPhiPt_2; | |
689 | _nBins_etaPhi_12 = _nBins_etaPhi_1 * _nBins_etaPhi_2; | |
5d603bbf | 690 | |
9cabc5db | 691 | _id_1 = new int[arraySize]; |
692 | _charge_1 = new int[arraySize]; | |
9cabc5db | 693 | _iEtaPhi_1 = new int[arraySize]; |
694 | _iPt_1 = new int[arraySize]; | |
695 | _pt_1 = new float[arraySize]; | |
696 | _px_1 = new float[arraySize]; | |
697 | _py_1 = new float[arraySize]; | |
698 | _pz_1 = new float[arraySize]; | |
9cabc5db | 699 | _correction_1 = new float[arraySize]; |
f31c2938 | 700 | _dedx_1 = new float[arraySize]; |
9cabc5db | 701 | __n1_1_vsPt = getDoubleArray(_nBins_pt_1, 0.); |
702 | __n1_1_vsEtaPhi = getDoubleArray(_nBins_etaPhi_1, 0.); | |
703 | __s1pt_1_vsEtaPhi = getDoubleArray(_nBins_etaPhi_1, 0.); | |
704 | __n1_1_vsZEtaPhiPt = getFloatArray(_nBins_zEtaPhiPt_1, 0.); | |
705 | ||
5d603bbf | 706 | |
9cabc5db | 707 | if (_requestedCharge_2!=_requestedCharge_1) |
708 | { | |
5d603bbf | 709 | _sameFilter = 0; |
9cabc5db | 710 | //particle 2 |
711 | _id_2 = new int[arraySize]; | |
712 | _charge_2 = new int[arraySize]; | |
9cabc5db | 713 | _iEtaPhi_2 = new int[arraySize]; |
714 | _iPt_2 = new int[arraySize]; | |
715 | _pt_2 = new float[arraySize]; | |
716 | _px_2 = new float[arraySize]; | |
717 | _py_2 = new float[arraySize]; | |
718 | _pz_2 = new float[arraySize]; | |
9cabc5db | 719 | _correction_2 = new float[arraySize]; |
f31c2938 | 720 | _dedx_2 = new float[arraySize]; |
9cabc5db | 721 | __n1_2_vsPt = getDoubleArray(_nBins_pt_2, 0.); |
722 | __n1_2_vsEtaPhi = getDoubleArray(_nBins_etaPhi_2, 0.); | |
723 | __s1pt_2_vsEtaPhi = getDoubleArray(_nBins_etaPhi_2, 0.); | |
724 | __n1_2_vsZEtaPhiPt = getFloatArray(_nBins_zEtaPhiPt_2, 0.); | |
725 | ||
726 | } | |
727 | ||
728 | __n2_12_vsPtPt = getDoubleArray(_nBins_pt_1*_nBins_pt_2,0.); | |
729 | __n2_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
730 | __s2ptpt_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
731 | __s2PtN_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
732 | __s2NPt_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.); | |
733 | ||
734 | // Setup all the labels needed. | |
735 | ||
736 | part_1_Name = "_1"; | |
737 | part_2_Name = "_2"; | |
738 | pair_12_Name = "_12"; | |
739 | ||
740 | n1Name = "n1"; | |
741 | n2Name = "n2"; | |
742 | n1NwName = "n1Nw"; | |
743 | n2NwName = "n2Nw"; | |
744 | r1Name = "r1"; | |
745 | r2Name = "r2"; | |
746 | r3Name = "r3"; | |
747 | r2r1Name = "r2r1"; | |
748 | c2Name = "c2"; | |
749 | c3Name = "c3"; | |
750 | d3Name = "d3"; | |
751 | p3Name = "p3"; | |
752 | cName = "sean"; | |
753 | ||
754 | intR2Name = "intR2"; | |
755 | binCorrName = "binCorr"; | |
756 | intBinCorrName = "intBinCorr"; | |
757 | ||
758 | avgName = "avg"; | |
759 | sumName = "sum"; | |
760 | s1ptName = "sumPt"; | |
761 | s1ptNwName = "sumPtNw"; | |
762 | s1DptName = "sumDpt"; | |
763 | s2PtPtName = "sumPtPt"; | |
764 | s2PtPtNwName = "sumPtPtNw"; | |
765 | s2DptDptName = "sumDptDpt"; | |
766 | s2NPtName = "sumNPt"; | |
767 | s2NPtNwName = "sumNPtNw"; | |
768 | s2PtNName = "sumPtN"; | |
769 | s2NPtNwName = "sumNPtNw"; | |
770 | s2PtNNwName = "sumPtNNw"; | |
771 | ptName = "avgPt"; | |
772 | ptptName = "avgPtPt"; | |
773 | pt1pt1Name = "avgPtavgPt"; | |
774 | DptName = "avgDpt"; | |
775 | DptDptName = "avgDptDpt"; | |
776 | RDptDptName = "relDptDpt"; // ratio of avgDptDpt by avgPt*avgPt | |
777 | nPtName = "avgNpt"; | |
778 | ptNName = "avgPtN"; | |
779 | seanName = "seanC"; | |
780 | ||
781 | _title_counts = "yield"; | |
782 | ||
783 | _title_m0 = "M_{0}"; | |
784 | _title_m1 = "M_{1}"; | |
785 | _title_m2 = "M_{2}"; | |
786 | _title_m3 = "M_{3}"; | |
787 | _title_m4 = "V0Centrality"; | |
788 | _title_m5 = "TrkCentrality"; | |
789 | _title_m6 = "SpdCentrality"; | |
790 | ||
791 | _title_eta_1 = "#eta_{1}"; | |
792 | _title_phi_1 = "#varphi_{1} (radian)"; | |
793 | _title_etaPhi_1 = "#eta_{1}#times#varphi_{1}"; | |
794 | _title_pt_1 = "p_{t,1} (GeV/c)"; | |
795 | _title_n_1 = "n_{1}"; | |
796 | _title_SumPt_1 = "#Sigma p_{t,1} (GeV/c)"; | |
797 | _title_AvgPt_1 = "#LT p_{t,1} #GT (GeV/c)"; | |
798 | _title_AvgN_1 = "#LT n_{1} #GT"; | |
799 | _title_AvgSumPt_1 = "#LT #Sigma p_{t,1} #GT (GeV/c)"; | |
800 | ||
801 | _title_eta_2 = "#eta_{2}"; | |
802 | _title_phi_2 = "#varphi_{2} (radian)"; | |
803 | _title_etaPhi_2 = "#eta_{2}#times#varphi_{2}"; | |
804 | _title_pt_2 = "p_{t,2} (GeV/c)"; | |
805 | _title_n_2 = "n_{2}"; | |
806 | _title_SumPt_2 = "#Sigma p_{t,1} (GeV/c)"; | |
807 | _title_AvgPt_2 = "#LT p_{t,2} #GT (GeV/c)"; | |
808 | _title_AvgN_2 = "#LT n_{2} #GT"; | |
809 | _title_AvgSumPt_2 = "#LT #Sigma p_{t,2} #GT (GeV/c)"; | |
810 | ||
811 | _title_etaPhi_12 = "#eta_{1}#times#varphi_{1}#times#eta_{2}#times#varphi_{2}"; | |
812 | ||
813 | _title_AvgN2_12 = "#LT n_{2} #GT";; | |
814 | _title_AvgSumPtPt_12 = "#LT #Sigma p_{t,1}p_{t,2} #GT";; | |
815 | _title_AvgSumPtN_12 = "#LT #Sigma p_{t,1}N #GT";; | |
816 | _title_AvgNSumPt_12 = "#LT N#Sigma p_{t,2} #GT";; | |
817 | ||
818 | ||
819 | vsZ = "_vsZ"; | |
820 | vsM = "_vsM"; | |
821 | vsPt = "_vsPt"; | |
822 | vsPhi = "_vsPhi"; | |
823 | vsEta = "_vsEta"; | |
824 | vsEtaPhi = "_vsEtaPhi"; | |
825 | vsPtVsPt = "_vsPtVsPt"; | |
826 | ||
827 | ||
828 | if (_useWeights) | |
829 | { | |
830 | int iZ, iEtaPhi, iPt; | |
831 | int iZ1,iEtaPhi1,iPt1; | |
832 | int a, b; | |
833 | if (_weight_1) | |
834 | { | |
835 | _correctionWeight_1 = new float[_nBins_vertexZ*_nBins_etaPhi_1*_nBins_pt_1]; | |
836 | a = _nBins_pt_1; | |
837 | b = _nBins_etaPhi_1*_nBins_pt_1; | |
838 | for (iZ=0,iZ1=1; iZ<_nBins_vertexZ; iZ++, iZ1++) | |
839 | { | |
840 | for (iEtaPhi=0,iEtaPhi1=1; iEtaPhi<_nBins_etaPhi_1; iEtaPhi++, iEtaPhi1++) | |
841 | { | |
842 | for (iPt=0,iPt1=1; iPt<_nBins_pt_1; iPt++, iPt1++) | |
843 | { | |
844 | _correctionWeight_1[iZ*b+iEtaPhi*a+iPt] = _weight_1->GetBinContent(iZ1,iEtaPhi1,iPt1); | |
845 | } | |
846 | } | |
847 | } | |
848 | } // _weight_1 | |
849 | else | |
850 | { | |
851 | AliError("AliAnalysisTaskDptDptCorrelations:: _weight_1 is a null pointer."); | |
852 | return; | |
853 | } | |
854 | if (!_sameFilter) | |
855 | { | |
856 | if (_weight_2) | |
857 | { | |
858 | _correctionWeight_2 = new float[_nBins_vertexZ*_nBins_etaPhi_2*_nBins_pt_2]; | |
859 | a = _nBins_pt_2; | |
860 | b = _nBins_etaPhi_2*_nBins_pt_2; | |
861 | for (iZ=0,iZ1=1; iZ<_nBins_vertexZ; iZ++, iZ1++) | |
862 | { | |
863 | for (iEtaPhi=0,iEtaPhi1=1; iEtaPhi<_nBins_etaPhi_2; iEtaPhi++, iEtaPhi1++) | |
864 | { | |
865 | for (iPt=0,iPt1=1; iPt<_nBins_pt_2; iPt++, iPt1++) | |
866 | { | |
867 | _correctionWeight_2[iZ*b+iEtaPhi*a+iPt] = _weight_2->GetBinContent(iZ1,iEtaPhi1,iPt1); | |
868 | } | |
869 | } | |
870 | } | |
871 | } // _weight_2 | |
872 | else | |
873 | { | |
874 | AliError("AliAnalysisTaskDptDptCorrelations:: _weight_1 is a null pointer."); | |
875 | return; | |
876 | } | |
877 | } | |
878 | } | |
879 | ||
880 | createHistograms(); | |
881 | PostData(0,_outputHistoList); | |
882 | ||
23496d49 | 883 | //cout<< "AliAnalysisTaskDptDptCorrelations::CreateOutputObjects() DONE " << endl; |
9cabc5db | 884 | |
885 | } | |
886 | ||
887 | void AliAnalysisTaskDptDptCorrelations::createHistograms() | |
888 | { | |
889 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Event Histos"); | |
890 | TString name; | |
891 | ||
892 | name = "eventAccounting"; | |
893 | ||
5d603bbf | 894 | _eventAccounting = createHisto1D(name,name,10, -0.5, 9.5, "event Code", _title_counts); |
239bac74 | 895 | |
896 | name = "m0"; _m0 = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m0, _title_counts); | |
897 | name = "m1"; _m1 = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m1, _title_counts); | |
898 | name = "m2"; _m2 = createHisto1D(name,name,_nBins_M2, _min_M2, _max_M2, _title_m2, _title_counts); | |
899 | name = "m3"; _m3 = createHisto1D(name,name,_nBins_M3, _min_M3, _max_M3, _title_m3, _title_counts); | |
900 | name = "m4"; _m4 = createHisto1D(name,name,_nBins_M4, _min_M4, _max_M4, _title_m4, _title_counts); | |
901 | name = "m5"; _m5 = createHisto1D(name,name,_nBins_M5, _min_M5, _max_M5, _title_m5, _title_counts); | |
902 | name = "m6"; _m6 = createHisto1D(name,name,_nBins_M6, _min_M6, _max_M6, _title_m6, _title_counts); | |
4358ff80 | 903 | name = "zV"; _vertexZ = createHisto1D(name,name,100, -10, 10, "z-Vertex (cm)", _title_counts); |
239bac74 | 904 | |
49f44fbe | 905 | |
ee39f9f4 | 906 | name = "Eta"; _etadis = createHisto1F(name,name, 200, -1.0, 1.0, "#eta","counts"); |
d9e7b37f | 907 | name = "Phi"; _phidis = createHisto1F(name,name, 360, 0.0, 6.4, "#phi","counts"); |
908 | name = "DCAz"; _dcaz = createHisto1F(name,name, 500, -5.0, 5.0, "dcaZ","counts"); | |
909 | name = "DCAxy"; _dcaxy = createHisto1F(name,name, 500, -5.0, 5.0, "dcaXY","counts"); | |
5d603bbf | 910 | |
3b8de8f4 | 911 | // name = "Nclus1"; _Ncluster1 = createHisto1F(name,name, 200, 0, 200, "Ncluster1","counts"); |
5d603bbf | 912 | //name = "Nclus2"; _Ncluster2 = createHisto1F(name,name, 200, 0, 200, "Ncluster2","counts"); |
d9e7b37f | 913 | |
239bac74 | 914 | if (_singlesOnly) |
9cabc5db | 915 | { |
239bac74 | 916 | 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); |
917 | 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); | |
239bac74 | 918 | |
919 | 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); | |
920 | 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); | |
239bac74 | 921 | |
922 | } | |
923 | else | |
924 | { | |
925 | 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); | |
926 | 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); | |
927 | name = n1Name+part_1_Name+vsM; _n1_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
928 | name = s1ptName+part_1_Name+vsM; _s1pt_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
929 | name = n1NwName+part_1_Name+vsM; _n1Nw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
930 | name = s1ptNwName+part_1_Name+vsM; _s1ptNw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
931 | ||
932 | 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); | |
933 | 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); | |
934 | name = n1Name+part_2_Name + vsM; _n1_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_2); | |
935 | name = s1ptName+part_2_Name + vsM; _s1pt_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_2); | |
936 | name = n1NwName+part_2_Name+vsM; _n1Nw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1); | |
937 | name = s1ptNwName+part_2_Name+vsM; _s1ptNw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1); | |
938 | ||
939 | 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); | |
940 | 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); | |
941 | 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); | |
942 | 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); | |
943 | 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 | 944 | |
239bac74 | 945 | name = n2Name+pair_12_Name + vsM; _n2_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12); |
946 | name = s2PtPtName+pair_12_Name + vsM; _s2PtPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12); | |
947 | name = s2PtNName+pair_12_Name + vsM; _s2PtN_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12); | |
948 | name = s2NPtName+pair_12_Name + vsM; _s2NPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12); | |
9cabc5db | 949 | |
239bac74 | 950 | name = n2NwName+pair_12_Name + vsM; _n2Nw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12); |
951 | name = s2PtPtNwName+pair_12_Name + vsM; _s2PtPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12); | |
952 | name = s2PtNNwName+pair_12_Name + vsM; _s2PtNNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12); | |
953 | name = s2NPtNwName+pair_12_Name + vsM; _s2NPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12); | |
9cabc5db | 954 | |
9fe7543b | 955 | name = "mInv"; _invMass = createHisto1F(name,name, 50, 0.41, 0.55, "M_{inv}","counts"); |
239bac74 | 956 | name = "mInvElec"; _invMassElec = createHisto1F(name,name, 500, 0., 1.000, "M_{inv}","counts"); |
9cabc5db | 957 | } |
958 | ||
959 | AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() All Done"); | |
960 | } | |
961 | //-----------------------// | |
962 | ||
963 | void AliAnalysisTaskDptDptCorrelations::finalizeHistograms() | |
964 | { | |
965 | ||
966 | AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() starting"); | |
967 | AliInfo(Form("CorrelationAnalyzers::finalizeHistograms() _eventCount : %d",int(_eventCount))); | |
239bac74 | 968 | if (_singlesOnly) |
9cabc5db | 969 | { |
239bac74 | 970 | if (_sameFilter) |
971 | { | |
972 | fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
973 | fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
974 | fillHistoWithArray(_n1_2_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
975 | fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
976 | } | |
977 | else | |
978 | { | |
979 | fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1); | |
980 | fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1); | |
981 | fillHistoWithArray(_n1_2_vsPt, __n1_2_vsPt, _nBins_pt_2); | |
982 | fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_2_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_2, _nBins_pt_2); | |
983 | } | |
9cabc5db | 984 | } |
985 | else | |
986 | { | |
239bac74 | 987 | if (_sameFilter) |
988 | { | |
989 | fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
990 | fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
991 | fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
992 | fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
993 | } | |
994 | else | |
995 | { | |
996 | fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
997 | fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1); | |
998 | fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2); | |
999 | fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2); | |
1000 | } | |
9cabc5db | 1001 | fillHistoWithArray(_n2_12_vsEtaPhi, __n2_12_vsEtaPhi, _nBins_etaPhi_12); |
1002 | fillHistoWithArray(_s2PtPt_12_vsEtaPhi, __s2ptpt_12_vsEtaPhi, _nBins_etaPhi_12); | |
1003 | fillHistoWithArray(_s2PtN_12_vsEtaPhi, __s2PtN_12_vsEtaPhi, _nBins_etaPhi_12); | |
1004 | fillHistoWithArray(_s2NPt_12_vsEtaPhi, __s2NPt_12_vsEtaPhi, _nBins_etaPhi_12); | |
239bac74 | 1005 | fillHistoWithArray(_n2_12_vsPtVsPt, __n2_12_vsPtPt, _nBins_pt_1, _nBins_pt_2); |
1006 | ||
1007 | } | |
9cabc5db | 1008 | AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() Done "); |
1009 | } | |
1010 | //--------------// | |
1011 | ||
1012 | ||
ba6301d5 | 1013 | void AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/) |
9cabc5db | 1014 | { |
1015 | ||
1016 | int k1,k2; | |
1017 | int iPhi, iEta, iEtaPhi, iPt, charge; | |
f31c2938 | 1018 | float q, phi, pt, eta, corr, corrPt, px, py, pz, dedx; |
9cabc5db | 1019 | int ij; |
1020 | int id_1, q_1, iEtaPhi_1, iPt_1; | |
f31c2938 | 1021 | float pt_1, px_1, py_1, pz_1, corr_1, dedx_1; |
9cabc5db | 1022 | int id_2, q_2, iEtaPhi_2, iPt_2; |
f31c2938 | 1023 | float pt_2, px_2, py_2, pz_2, corr_2, dedx_2; |
9cabc5db | 1024 | float ptpt; |
1025 | int iVertex, iVertexP1, iVertexP2; | |
1026 | int iZEtaPhiPt; | |
4358ff80 | 1027 | float massElecSq = 1.94797849000000016e-02; |
2781d660 | 1028 | //double b[2]; |
1029 | //double bCov[3]; | |
9cabc5db | 1030 | const AliAODVertex* vertex; |
b6091c1d | 1031 | //int nClus; |
9cabc5db | 1032 | bool bitOK; |
2781d660 | 1033 | |
cc7ee8f9 | 1034 | AliAnalysisManager* manager = AliAnalysisManager::GetAnalysisManager(); |
1035 | if (!manager) { | |
cc7ee8f9 | 1036 | return; |
1037 | } | |
cc7ee8f9 | 1038 | AliAODInputHandler* inputHandler = dynamic_cast<AliAODInputHandler*> (manager->GetInputEventHandler()); |
1039 | if (!inputHandler) { | |
cc7ee8f9 | 1040 | return; |
1041 | } | |
2781d660 | 1042 | |
cc7ee8f9 | 1043 | fAODEvent = dynamic_cast<AliAODEvent*>(InputEvent()); |
5d603bbf | 1044 | //AliAODEvent* fAODEvent = dynamic_cast<AliAODEvent*>(InputEvent()); |
2781d660 | 1045 | |
cc7ee8f9 | 1046 | if (!fAODEvent) |
1047 | { | |
cc7ee8f9 | 1048 | return; |
1049 | } | |
1050 | fPIDResponse =inputHandler->GetPIDResponse(); | |
1051 | if (!fPIDResponse){ | |
1052 | AliFatal("This Task needs the PID response attached to the inputHandler"); | |
1053 | return; | |
1054 | } | |
2781d660 | 1055 | |
9cabc5db | 1056 | // count all events looked at here |
1057 | _eventCount++; | |
2781d660 | 1058 | |
2e00326e | 1059 | if (_eventAccounting) |
1060 | { | |
1061 | _eventAccounting->Fill(0);// count all calls to this function | |
1062 | } | |
239bac74 | 1063 | else |
1064 | { | |
2781d660 | 1065 | |
1066 | return; | |
239bac74 | 1067 | } |
9cabc5db | 1068 | |
9cabc5db | 1069 | _eventAccounting->Fill(1);// count all calls to this function with a valid pointer |
9cabc5db | 1070 | //reset single particle counters |
1071 | k1 = k2 = 0; | |
1072 | __n1_1 = __n1_2 = __s1pt_1 = __s1pt_2 = __n1Nw_1 = __n1Nw_2 = __s1ptNw_1 = __s1ptNw_2 = 0; | |
1073 | ||
1074 | float v0Centr = -999.; | |
b8ab2bb9 | 1075 | float v0ACentr = -999.; |
9cabc5db | 1076 | float trkCentr = -999.; |
1077 | float spdCentr = -999.; | |
1078 | ||
1079 | float vertexX = -999; | |
1080 | float vertexY = -999; | |
1081 | float vertexZ = -999; | |
0a268a8e | 1082 | //float vertexXY = -999; |
e72a23ac | 1083 | //float dcaZ = -999; |
1084 | //float dcaXY = -999; | |
9cabc5db | 1085 | float centrality = -999; |
2781d660 | 1086 | |
9cabc5db | 1087 | if(fAODEvent) |
1088 | { | |
2781d660 | 1089 | //Centrality |
0a918d8d | 1090 | AliCentrality* centralityObject = ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP(); |
2781d660 | 1091 | if (centralityObject) |
1092 | { | |
1093 | //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 6" << endl; | |
1094 | ||
1095 | v0Centr = centralityObject->GetCentralityPercentile("V0M"); | |
1096 | v0ACentr = centralityObject->GetCentralityPercentile("V0A"); | |
1097 | trkCentr = centralityObject->GetCentralityPercentile("TRK"); | |
1098 | spdCentr = centralityObject->GetCentralityPercentile("CL1"); | |
1099 | ||
1100 | } | |
9cabc5db | 1101 | |
2781d660 | 1102 | _nTracks =fAODEvent->GetNumberOfTracks();//NEW Test |
9cabc5db | 1103 | |
2781d660 | 1104 | _mult3 = _nTracks; |
1105 | _mult4 = v0Centr; | |
1106 | _mult4a = v0ACentr; | |
1107 | _mult5 = trkCentr; | |
1108 | _mult6 = spdCentr; | |
1109 | _field = fAODEvent->GetMagneticField(); | |
1110 | ||
1111 | //_centralityMethod | |
1112 | switch (_centralityMethod) | |
1113 | { | |
1114 | case 0: centrality = _mult0; break; | |
1115 | case 1: centrality = _mult1; break; | |
1116 | case 2: centrality = _mult2; break; | |
1117 | case 3: centrality = _mult3; break; | |
1118 | case 4: centrality = _mult4; break; | |
1119 | case 5: centrality = _mult5; break; | |
1120 | case 6: centrality = _mult6; break; | |
1121 | case 7: centrality = _mult4a; break; | |
1122 | } | |
1123 | ||
1124 | ||
b6091c1d | 1125 | if ( centrality < _centralityMin || |
1126 | centrality > _centralityMax || | |
1127 | fabs(v0Centr-trkCentr)>5.0) //only for PbPb centrality | |
2781d660 | 1128 | { |
1129 | return; | |
1130 | } | |
1131 | _eventAccounting->Fill(2);// count all events with right centrality | |
1132 | ||
1133 | // filter on z and xy vertex | |
0a268a8e | 1134 | vertex = (AliAODVertex*) fAODEvent->GetPrimaryVertex(); |
1135 | // Double_t V[2]; | |
1136 | //vertex->GetXYZ(V); | |
1137 | ||
1138 | if(vertex) | |
2781d660 | 1139 | { |
0a268a8e | 1140 | Double32_t fCov[6]; |
1141 | vertex->GetCovarianceMatrix(fCov); | |
1142 | if(vertex->GetNContributors() > 0) | |
1143 | { | |
1144 | if(fCov[5] != 0) | |
1145 | { | |
1146 | vertexX = vertex->GetX(); | |
1147 | vertexY = vertex->GetY(); | |
1148 | vertexZ = vertex->GetZ(); | |
1149 | ||
1150 | if(TMath::Abs(vertexZ) > 10) | |
1151 | { | |
1152 | return; | |
1153 | } // Z-Vertex Cut | |
1154 | } | |
1155 | } | |
2781d660 | 1156 | } |
2781d660 | 1157 | |
3b8de8f4 | 1158 | //_vertexZ->Fill(vertexZ); |
2781d660 | 1159 | |
1160 | iVertex = int((vertexZ-_min_vertexZ)/_width_vertexZ); | |
1161 | iVertexP1 = iVertex*_nBins_etaPhiPt_1; | |
1162 | iVertexP2 = iVertex*_nBins_etaPhiPt_2; | |
1163 | if (iVertex<0 || iVertex>=_nBins_vertexZ) | |
1164 | { | |
1165 | AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) iVertex<0 || iVertex>=_nBins_vertexZ "); | |
1166 | return; | |
1167 | } | |
1168 | _eventAccounting->Fill(3);// count all calls to this function with a valid pointer | |
1169 | //====================== | |
1170 | ||
1171 | //********************************************************* | |
aa395c2c | 1172 | TExMap *trackMap = new TExMap();//Mapping matrix---- |
c4ccbacd | 1173 | |
94694b54 | 1174 | //1st loop track for Global tracks |
e72a23ac | 1175 | for(Int_t i = 0; i < _nTracks; i++) |
2781d660 | 1176 | { |
1177 | AliAODTrack* aodTrack = dynamic_cast<AliAODTrack *>(fAODEvent->GetTrack(i)); | |
1178 | if(!aodTrack) { | |
1179 | AliError(Form("ERROR: Could not retrieve AODtrack %d",i)); | |
1180 | continue; | |
1181 | } | |
1182 | Int_t gID = aodTrack->GetID(); | |
1183 | if (aodTrack->TestFilterBit(1)) trackMap->Add(gID, i);//Global tracks | |
e72a23ac | 1184 | } |
2781d660 | 1185 | |
e72a23ac | 1186 | AliAODTrack* newAodTrack; |
2781d660 | 1187 | |
1188 | //Track Loop starts here | |
1189 | for (int iTrack=0; iTrack< _nTracks; iTrack++) | |
1190 | { | |
1191 | AliAODTrack* t = dynamic_cast<AliAODTrack *>(fAODEvent->GetTrack(iTrack)); | |
1192 | if (!t) { | |
1193 | AliError(Form("Could not receive track %d", iTrack)); | |
1194 | continue; | |
1195 | } | |
aa395c2c | 1196 | |
2781d660 | 1197 | bitOK = t->TestFilterBit(_trackFilterBit); |
0a268a8e | 1198 | if (!bitOK) continue; //128bit or 272bit |
aa395c2c | 1199 | |
e72a23ac | 1200 | Int_t gID = t->GetID(); |
f15c1f69 | 1201 | newAodTrack = gID >= 0 ?t : dynamic_cast<AliAODTrack*>(fAODEvent->GetTrack(trackMap->GetValue(-1-gID))); |
1202 | if(!newAodTrack) AliFatal("Not a standard AOD?"); | |
1203 | ||
2781d660 | 1204 | q = t->Charge(); |
1205 | charge = int(q); | |
1206 | phi = t->Phi(); | |
1207 | pt = t->Pt(); | |
1208 | px = t->Px(); | |
1209 | py = t->Py(); | |
1210 | pz = t->Pz(); | |
1211 | eta = t->Eta(); | |
f31c2938 | 1212 | dedx = t->GetTPCsignal(); |
e72a23ac | 1213 | //dcaXY = t->DCA(); |
1214 | //dcaZ = t->ZAtDCA(); | |
3b8de8f4 | 1215 | //nClus = t->GetTPCNcls(); |
ac274a71 | 1216 | |
3b8de8f4 | 1217 | //if ( nClus<_nClusterMin ) continue; |
ac274a71 | 1218 | |
3b8de8f4 | 1219 | //_Ncluster1->Fill(nClus); |
ac274a71 | 1220 | |
c91234cc | 1221 | /* |
f31c2938 | 1222 | //cuts on more than 0 shared cluster (suggested by Michael) |
ac274a71 | 1223 | if(t->GetTPCnclsS() > 0){ |
1224 | continue; | |
c91234cc | 1225 | }*/ |
ac274a71 | 1226 | |
94694b54 | 1227 | //for Global tracks |
aa395c2c | 1228 | Double_t nsigmaelectron = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kElectron)); |
2781d660 | 1229 | Double_t nsigmapion = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kPion)); |
1230 | Double_t nsigmakaon = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kKaon)); | |
e72a23ac | 1231 | Double_t nsigmaproton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kProton)); |
2781d660 | 1232 | |
1233 | //nsigma cut to reject electron | |
1234 | ||
1235 | if(nsigmaelectron < fNSigmaCut | |
1236 | && nsigmapion > fNSigmaCut | |
1237 | && nsigmakaon > fNSigmaCut | |
1238 | && nsigmaproton > fNSigmaCut ) continue; | |
1239 | ||
aa395c2c | 1240 | |
2781d660 | 1241 | if(charge == 0) continue; |
2781d660 | 1242 | // Kinematics cuts used |
0a268a8e | 1243 | if( pt < _min_pt_1 || pt > _max_pt_1) continue; |
1244 | if( eta < _min_eta_1 || eta > _max_eta_1) continue; | |
49f44fbe | 1245 | |
aa395c2c | 1246 | /* Double_t pos[3]; |
0a268a8e | 1247 | newAodTrack->GetXYZ(pos); |
1248 | ||
1249 | Double_t DCAX = pos[0] - vertexX; | |
1250 | Double_t DCAY = pos[1] - vertexY; | |
1251 | Double_t DCAZ = pos[2] - vertexZ; | |
ab6b1a67 | 1252 | |
1253 | Double_t DCAXY = TMath::Sqrt((DCAX*DCAX) + (DCAY*DCAY)); | |
1254 | ||
0a268a8e | 1255 | if (DCAZ < _dcaZMin || |
1256 | DCAZ > _dcaZMax || | |
e72a23ac | 1257 | DCAXY > _dcaXYMax ) continue; |
aa395c2c | 1258 | */ |
94694b54 | 1259 | |
f35407ff | 1260 | //------- Eff. test---------- //just for checking |
aa395c2c | 1261 | //Double_t yy = (1 - 0.7)/1.8; |
1262 | //Double_t zz = (pt - 0.2); | |
1263 | //Double_t effValue = 0.7 + yy*zz; | |
1264 | //Double_t R = gRandom->Rndm(); | |
1265 | //if(R > effValue) continue; | |
f35407ff | 1266 | //--------------------------- |
1267 | ||
2781d660 | 1268 | //==== QA =========================== |
c4ccbacd | 1269 | //_dcaz->Fill(DCAZ); |
1270 | //_dcaxy->Fill(DCAXY); | |
3b8de8f4 | 1271 | //_etadis->Fill(eta); |
c4ccbacd | 1272 | //_phidis->Fill(phi); |
2781d660 | 1273 | //=================================== |
1274 | //************************************************* | |
1275 | ||
1276 | //Particle 1 | |
f31c2938 | 1277 | if (_requestedCharge_1 == charge && dedx >= _dedxMin && dedx < _dedxMax) |
cc7ee8f9 | 1278 | { |
2781d660 | 1279 | iPhi = int( phi/_width_phi_1); |
1280 | ||
1281 | if (iPhi<0 || iPhi>=_nBins_phi_1 ) | |
1282 | { | |
1283 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze() iPhi<0 || iPhi>=_nBins_phi_1"); | |
1284 | return; | |
1285 | } | |
1286 | ||
1287 | iEta = int((eta-_min_eta_1)/_width_eta_1); | |
1288 | if (iEta<0 || iEta>=_nBins_eta_1) | |
1289 | { | |
1290 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iEta: %d", iEta)); | |
1291 | continue; | |
1292 | } | |
1293 | iPt = int((pt -_min_pt_1 )/_width_pt_1 ); | |
1294 | if (iPt<0 || iPt >=_nBins_pt_1) | |
1295 | { | |
1296 | AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iPt: %d",iPt)); | |
1297 | continue; | |
1298 | } | |
1299 | iEtaPhi = iEta*_nBins_phi_1+iPhi; | |
1300 | iZEtaPhiPt = iVertexP1 + iEtaPhi*_nBins_pt_1 + iPt; | |
1301 | ||
1302 | if (_correctionWeight_1) | |
1303 | corr = _correctionWeight_1[iZEtaPhiPt]; | |
1304 | else | |
1305 | corr = 1; | |
1306 | if (iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1) | |
1307 | { | |
1308 | AliWarning("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1"); | |
1309 | continue; | |
1310 | } | |
1311 | ||
1312 | ||
1313 | if (_singlesOnly) | |
1314 | { | |
1315 | ||
1316 | __n1_1_vsPt[iPt] += corr; //cout << "step 15" << endl; | |
1317 | __n1_1_vsZEtaPhiPt[iZEtaPhiPt] += corr; //cout << "step 12" << endl; | |
1318 | ||
1319 | } | |
1320 | else | |
1321 | { | |
1322 | corrPt = corr*pt; | |
1323 | _id_1[k1] = iTrack; | |
1324 | _charge_1[k1] = charge; | |
1325 | _iEtaPhi_1[k1] = iEtaPhi; | |
1326 | _iPt_1[k1] = iPt; | |
1327 | _pt_1[k1] = pt; | |
1328 | _px_1[k1] = px; | |
1329 | _py_1[k1] = py; | |
1330 | _pz_1[k1] = pz; | |
1331 | _correction_1[k1] = corr; | |
1332 | __n1_1 += corr; | |
1333 | __n1_1_vsEtaPhi[iEtaPhi] += corr; | |
1334 | __s1pt_1 += corrPt; | |
1335 | __s1pt_1_vsEtaPhi[iEtaPhi] += corrPt; | |
1336 | __n1Nw_1 += 1; | |
1337 | __s1ptNw_1 += pt; | |
1338 | ++k1; | |
1339 | if (k1>=arraySize) | |
1340 | { | |
1341 | AliError(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) k1 >=arraySize; arraySize: %d",arraySize)); | |
1342 | return; | |
1343 | } | |
1344 | } | |
1345 | } | |
49f44fbe | 1346 | |
f31c2938 | 1347 | if (!_sameFilter && _requestedCharge_2 == charge && |
1348 | dedx >= _dedxMin && dedx < _dedxMax) | |
aa395c2c | 1349 | |
2781d660 | 1350 | { |
1351 | ||
1352 | iPhi = int( phi/_width_phi_2); | |
1353 | ||
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 | ||
1382 | if (_correctionWeight_2) | |
1383 | corr = _correctionWeight_2[iZEtaPhiPt]; | |
1384 | else | |
1385 | corr = 1; | |
1386 | ||
1387 | if (_singlesOnly) | |
1388 | { | |
1389 | __n1_2_vsPt[iPt] += corr; //cout << "step 15" << endl; | |
1390 | __n1_2_vsZEtaPhiPt[iZEtaPhiPt] += corr; //cout << "step 12" << endl; | |
1391 | } | |
1392 | else | |
1393 | { | |
1394 | corrPt = corr*pt; | |
1395 | _id_2[k2] = iTrack; //cout << "step 1" << endl; | |
1396 | _charge_2[k2] = charge; //cout << "step 2" << endl; | |
1397 | _iEtaPhi_2[k2] = iEtaPhi; //cout << "step 3" << endl; | |
1398 | _iPt_2[k2] = iPt; //cout << "step 4" << endl; | |
1399 | _pt_2[k2] = pt; //cout << "step 5" << endl; | |
1400 | _px_2[k2] = px; //cout << "step 6" << endl; | |
1401 | _py_2[k2] = py; //cout << "step 7" << endl; | |
1402 | _pz_2[k2] = pz; //cout << "step 8" << endl; | |
1403 | _correction_2[k2] = corr; //cout << "step 9" << endl; | |
1404 | __n1_2 += corr; //cout << "step 10" << endl; | |
1405 | __s1pt_2 += corrPt; //cout << "step 13" << endl; | |
1406 | __n1Nw_2 += 1; | |
1407 | __n1_2_vsEtaPhi[iEtaPhi] += corr; //cout << "step 11" << endl; | |
1408 | __s1pt_2_vsEtaPhi[iEtaPhi] += corrPt; //cout << "step 14" << endl; | |
1409 | __s1ptNw_2 += pt; | |
1410 | ++k2; | |
1411 | if (k2>=arraySize) | |
1412 | { | |
1413 | AliWarning(Form("-W- k2 >=arraySize; arraySize: %d",arraySize)); | |
1414 | return; | |
1415 | } | |
1416 | } | |
1417 | ||
1418 | //cout << "done with track" << endl; | |
1419 | } //iTrack | |
1420 | } //aod | |
9cabc5db | 1421 | } |
2781d660 | 1422 | |
9cabc5db | 1423 | |
1424 | //cout << "Filling histograms now" << endl; | |
1425 | _m0->Fill(_mult0); | |
1426 | _m1->Fill(_mult1); | |
1427 | _m2->Fill(_mult2); | |
1428 | _m3->Fill(_mult3); | |
1429 | _m4->Fill(_mult4); | |
1430 | _m5->Fill(_mult5); | |
1431 | _m6->Fill(_mult6); | |
5d603bbf | 1432 | //_vertexZ->Fill(vertexZ); |
b8ab2bb9 | 1433 | |
239bac74 | 1434 | if (_singlesOnly) |
9cabc5db | 1435 | { |
2781d660 | 1436 | // nothing to do here. |
9cabc5db | 1437 | } |
1438 | else | |
1439 | { | |
2781d660 | 1440 | if (_sameFilter) |
1441 | { | |
239bac74 | 1442 | _n1_1_vsM->Fill(centrality, __n1_1); |
1443 | _s1pt_1_vsM->Fill(centrality, __s1pt_1); | |
1444 | _n1Nw_1_vsM->Fill(centrality, __n1Nw_1); | |
1445 | _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1); | |
1446 | _n1_2_vsM->Fill(centrality, __n1_1); | |
1447 | _s1pt_2_vsM->Fill(centrality, __s1pt_1); | |
1448 | _n1Nw_2_vsM->Fill(centrality, __n1Nw_1); | |
1449 | _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_1); | |
1450 | // reset pair counters | |
1451 | __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0; | |
1452 | __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0; | |
1453 | if (_field>0) | |
9cabc5db | 1454 | { |
2781d660 | 1455 | for (int i1=0; i1<k1; i1++) |
1456 | { | |
1457 | ////cout << " i1:" << i1 << endl; | |
1458 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1459 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1460 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1461 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1462 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1463 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
f31c2938 | 1464 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; |
2781d660 | 1465 | //1 and 2 |
1466 | for (int i2=i1+1; i2<k1; i2++) | |
1467 | { | |
1468 | ////cout << " i2:" << i2 << endl; | |
1469 | id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl; | |
1470 | if (id_1!=id_2) | |
1471 | { | |
1472 | q_2 = _charge_1[i2]; ////cout << " q_1:" << q_1 << endl; | |
1473 | iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1474 | iPt_2 = _iPt_1[i2]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1475 | corr_2 = _correction_1[i2]; ////cout << " corr_1:" << corr_1 << endl; | |
1476 | pt_2 = _pt_1[i2]; ////cout << " pt_1:" << pt_1 << endl; | |
f31c2938 | 1477 | dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl; |
2781d660 | 1478 | corr = corr_1*corr_2; |
1479 | 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)) | |
1480 | { | |
1481 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
1482 | } | |
1483 | else // swap particles | |
1484 | { | |
1485 | ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl; | |
1486 | } | |
1487 | ||
1488 | __n2_12 += corr; | |
1489 | __n2_12_vsEtaPhi[ij] += corr; | |
1490 | ptpt = pt_1*pt_2; | |
1491 | __s2ptpt_12 += corr*ptpt; | |
1492 | __s2PtN_12 += corr*pt_1; | |
1493 | __s2NPt_12 += corr*pt_2; | |
1494 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1495 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1496 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
1497 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1498 | ||
1499 | __n2Nw_12 += 1; | |
1500 | __s2ptptNw_12 += ptpt; | |
1501 | __s2PtNNw_12 += pt_1; | |
1502 | __s2NPtNw_12 += pt_2; | |
1503 | ||
1504 | } | |
1505 | } //i2 | |
1506 | } //i1 | |
239bac74 | 1507 | } |
1508 | else // field<0 | |
1509 | { | |
2781d660 | 1510 | for (int i1=0; i1<k1; i1++) |
1511 | { | |
1512 | ////cout << " i1:" << i1 << endl; | |
1513 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1514 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1515 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1516 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1517 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1518 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
f31c2938 | 1519 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; |
2781d660 | 1520 | //1 and 2 |
1521 | for (int i2=i1+1; i2<k1; i2++) | |
1522 | { | |
1523 | ////cout << " i2:" << i2 << endl; | |
1524 | id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl; | |
1525 | if (id_1!=id_2) | |
1526 | { | |
1527 | q_2 = _charge_1[i2]; ////cout << " q_2:" << q_2 << endl; | |
1528 | iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl; | |
1529 | iPt_2 = _iPt_1[i2]; ////cout << " iPt_2:" << iPt_2 << endl; | |
1530 | corr_2 = _correction_1[i2]; ////cout << " corr_2:" << corr_2 << endl; | |
1531 | pt_2 = _pt_1[i2]; ////cout << " pt_2:" << pt_2 << endl; | |
f31c2938 | 1532 | dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl; |
2781d660 | 1533 | corr = corr_1*corr_2; |
1534 | 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)) | |
1535 | { | |
1536 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
1537 | } | |
1538 | else // swap particles | |
1539 | { | |
1540 | ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl; | |
1541 | } | |
1542 | ||
1543 | __n2_12 += corr; | |
1544 | __n2_12_vsEtaPhi[ij] += corr; | |
1545 | ptpt = pt_1*pt_2; | |
1546 | __s2ptpt_12 += corr*ptpt; | |
1547 | __s2PtN_12 += corr*pt_1; | |
1548 | __s2NPt_12 += corr*pt_2; | |
1549 | __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt; | |
1550 | __s2PtN_12_vsEtaPhi[ij] += corr*pt_1; | |
1551 | __s2NPt_12_vsEtaPhi[ij] += corr*pt_2; | |
1552 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1553 | ||
1554 | __n2Nw_12 += 1; | |
1555 | __s2ptptNw_12 += ptpt; | |
1556 | __s2PtNNw_12 += pt_1; | |
1557 | __s2NPtNw_12 += pt_2; | |
1558 | ||
1559 | } | |
1560 | } //i2 | |
1561 | } //i1 | |
239bac74 | 1562 | } |
2781d660 | 1563 | } |
1564 | else // filter 1 and 2 are different -- must do all particle pairs... | |
1565 | { | |
1566 | _n1_1_vsM->Fill(centrality, __n1_1); | |
1567 | _s1pt_1_vsM->Fill(centrality, __s1pt_1); | |
1568 | _n1Nw_1_vsM->Fill(centrality, __n1Nw_1); | |
1569 | _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1); | |
1570 | _n1_2_vsM->Fill(centrality, __n1_2); | |
1571 | _s1pt_2_vsM->Fill(centrality, __s1pt_2); | |
1572 | _n1Nw_2_vsM->Fill(centrality, __n1Nw_2); | |
1573 | _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_2); | |
1574 | // reset pair counters | |
1575 | __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0; | |
1576 | __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0; | |
1577 | for (int i1=0; i1<k1; i1++) | |
1578 | { | |
1579 | ////cout << " i1:" << i1 << endl; | |
1580 | id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl; | |
1581 | q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl; | |
1582 | iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl; | |
1583 | iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl; | |
1584 | corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl; | |
1585 | pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl; | |
1586 | px_1 = _px_1[i1]; ////cout << " px_1:" << px_1 << endl; | |
1587 | py_1 = _py_1[i1]; ////cout << " py_1:" << py_1 << endl; | |
1588 | pz_1 = _pz_1[i1]; ////cout << " pz_1:" << pz_1 << endl; | |
f31c2938 | 1589 | dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl; |
2781d660 | 1590 | |
1591 | //1 and 2 | |
1592 | for (int i2=0; i2<k2; i2++) | |
1593 | { | |
1594 | ////cout << " i2:" << i2 << endl; | |
1595 | id_2 = _id_2[i2]; ////cout << " id_2:" << id_2 << endl; | |
1596 | if (id_1!=id_2) // exclude auto correlation | |
1597 | { | |
1598 | q_2 = _charge_2[i2]; ////cout << " q_2:" << q_2 << endl; | |
1599 | iEtaPhi_2 = _iEtaPhi_2[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl; | |
1600 | iPt_2 = _iPt_2[i2]; ////cout << " iPt_2:" << iPt_2 << endl; | |
1601 | corr_2 = _correction_2[i2]; ////cout << " corr_2:" << corr_2 << endl; | |
1602 | pt_2 = _pt_2[i2]; ////cout << " pt_2:" << pt_2 << endl; | |
1603 | px_2 = _px_2[i2]; ////cout << " px_2:" << px_2 << endl; | |
1604 | py_2 = _py_2[i2]; ////cout << " py_2:" << py_2 << endl; | |
1605 | pz_2 = _pz_2[i2]; ////cout << " pz_2:" << pz_2 << endl; | |
f31c2938 | 1606 | dedx_2 = _dedx_2[i2]; ////cout << " dedx_2:" << dedx_2 << endl; |
2781d660 | 1607 | |
1608 | ||
1609 | if (_rejectPairConversion) | |
1610 | { | |
1611 | float e1Sq = massElecSq + pt_1*pt_1 + pz_1*pz_1; | |
1612 | float e2Sq = massElecSq + pt_2*pt_2 + pz_2*pz_2; | |
1613 | float mInvSq = 2*(massElecSq + sqrt(e1Sq*e2Sq) - px_1*px_2 - py_1*py_2 - pz_1*pz_2 ); | |
1614 | float mInv = sqrt(mInvSq); | |
1615 | _invMass->Fill(mInv); | |
f31c2938 | 1616 | if (mInv<0.51) |
1617 | { | |
1618 | if (dedx_1>75. && dedx_2>75.) | |
1619 | { | |
1620 | //_invMassElec->Fill(mInv); | |
1621 | if (mInv<0.05) continue; | |
1622 | } | |
1623 | } | |
2781d660 | 1624 | } |
1625 | ||
1626 | corr = corr_1*corr_2; | |
1627 | ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl; | |
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; | |
1637 | __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr; | |
1638 | __n2Nw_12 += 1; | |
1639 | __s2ptptNw_12 += ptpt; | |
1640 | __s2PtNNw_12 += pt_1; | |
1641 | __s2NPtNw_12 += pt_2; | |
1642 | ||
1643 | } | |
1644 | } //i2 | |
1645 | } //i1 | |
1646 | } | |
1647 | ||
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); | |
1652 | ||
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 | |
4e5b8cae | 1661 | AliInfo("AliAnalysisTaskDptDptCorrelations::UserExec() -----------------Event Done "); |
9cabc5db | 1662 | PostData(0,_outputHistoList); |
1663 | ||
1664 | } | |
1665 | ||
1666 | void AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() | |
1667 | { | |
4e5b8cae | 1668 | AliInfo("AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Starting."); |
8c006fc6 | 1669 | Printf("= 0 ===================================================================="); |
9cabc5db | 1670 | finalizeHistograms(); |
4e5b8cae | 1671 | AliInfo("= 1 ===================================================================="); |
9cabc5db | 1672 | PostData(0,_outputHistoList); |
4e5b8cae | 1673 | AliInfo("= 2 ===================================================================="); |
1674 | AliInfo("AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Done."); | |
9cabc5db | 1675 | } |
1676 | ||
ba6301d5 | 1677 | void AliAnalysisTaskDptDptCorrelations::Terminate(Option_t* /*option*/) |
9cabc5db | 1678 | { |
4e5b8cae | 1679 | AliInfo("AliAnalysisTaskDptDptCorrelations::Terminate() Starting/Done."); |
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 | |
4e5b8cae | 1997 | AliInfo("addToList(TH1 *h) _outputHistoList is null!!!!! Should abort ship"); |
9cabc5db | 1998 | |
1999 | } | |
2000 | ||
2001 | ||
2002 |