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