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