1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
23 #include "THnSparse.h"
40 #include "AliAnalysisManager.h"
42 #include "AliAODHandler.h"
43 #include "AliAODInputHandler.h"
44 #include "AliInputEventHandler.h"
46 #include "AliESDEvent.h"
47 #include "AliESDInputHandler.h"
48 #include "AliMultiplicity.h"
49 #include "AliCentrality.h"
50 #include "AliAnalysisTaskDptDptCorrelations.h"
53 #include "AliPIDResponse.h"
55 #include "AliESDVertex.h"
56 #include "AliESDEvent.h"
57 #include "AliESDInputHandler.h"
58 #include "AliAODEvent.h"
59 #include "AliAODTrack.h"
60 #include "AliAODInputHandler.h"
62 #include "AliESDEvent.h"
63 #include "AliAODEvent.h"
65 #include "AliESDtrackCuts.h"
66 #include "AliAODMCHeader.h"
69 #include "AliGenHijingEventHeader.h"
70 #include "AliGenEventHeader.h"
72 #include "AliAODPid.h"
73 #include "AliPIDResponse.h"
74 #include "AliAODpidUtil.h"
75 #include "AliPIDCombined.h"
79 ClassImp(AliAnalysisTaskDptDptCorrelations)
81 AliAnalysisTaskDptDptCorrelations::AliAnalysisTaskDptDptCorrelations()
82 : AliAnalysisTaskSE(),
84 fESDEvent(0), //! ESD Event
88 _twoPi ( 2.0 * 3.1415927),
95 _rejectPairConversion ( 0),
100 _centralityMethod ( 4),
101 _centralityMin ( 0.),
102 _centralityMax ( 0.),
103 _requestedCharge_1 ( 1),
104 _requestedCharge_2 ( -1),
147 _correctionWeight_1(0),
148 _correctionWeight_2(0),
149 _nBins_M0(500), _min_M0(0), _max_M0(10000), _width_M0(20),
150 _nBins_M1(500), _min_M1(0), _max_M1(10000), _width_M1(20),
151 _nBins_M2(500), _min_M2(0), _max_M2(10000), _width_M2(20),
152 _nBins_M3(500), _min_M3(0), _max_M3(10000), _width_M3(20),
153 _nBins_M4(100), _min_M4(0), _max_M4(1), _width_M4(0.01),
154 _nBins_M5(100), _min_M5(0), _max_M5(1), _width_M5(0.01),
155 _nBins_M6(100), _min_M6(0), _max_M6(1), _width_M6(0.01),
156 _nBins_vertexZ(40), _min_vertexZ(-10), _max_vertexZ(10), _width_vertexZ(0.5),
158 _nBins_pt_1(18), _min_pt_1(0.2), _max_pt_1(2.0), _width_pt_1(0.1),
159 _nBins_phi_1(72), _min_phi_1(0), _max_phi_1(2.*3.1415927),_width_phi_1(2.*3.1415927/72.),
160 _nBins_eta_1(0), _min_eta_1(0), _max_eta_1(0), _width_eta_1(0.1),
163 _nBins_etaPhiPt_1(0),
164 _nBins_zEtaPhiPt_1(0),
166 _nBins_pt_2(18), _min_pt_2(0.2), _max_pt_2(2.0), _width_pt_2(0.1),
167 _nBins_phi_2(72), _min_phi_2(0), _max_phi_2(2.*3.1415927),_width_phi_2(2.*3.1415927/72),
168 _nBins_eta_2(0), _min_eta_2(0), _max_eta_2(0), _width_eta_2(0.1),
171 _nBins_etaPhiPt_2(0),
172 _nBins_zEtaPhiPt_2(0),
192 __s1pt_1_vsEtaPhi(0),
193 __n1_1_vsZEtaPhiPt(0),
196 __s1pt_2_vsEtaPhi(0),
197 __n1_2_vsZEtaPhiPt(0),
200 __s2ptpt_12_vsEtaPhi(0),
201 __s2PtN_12_vsEtaPhi(0),
202 __s2NPt_12_vsEtaPhi(0),
205 _eventAccounting ( 0),
222 _n1_1_vsEtaVsPhi ( 0),
223 _s1pt_1_vsEtaVsPhi ( 0),
224 _n1_1_vsZVsEtaVsPhiVsPt ( 0),
233 _n1_2_vsEtaVsPhi ( 0),
234 _s1pt_2_vsEtaVsPhi ( 0),
235 _n1_2_vsZVsEtaVsPhiVsPt ( 0),
243 _n2_12_vsEtaPhi ( 0),
244 _n2_12_vsPtVsPt ( 0),
245 _s2PtPt_12_vsEtaPhi( 0),
246 _s2PtN_12_vsEtaPhi ( 0),
247 _s2NPt_12_vsEtaPhi ( 0),
253 _s2PtPtNw_12_vsM ( 0),
254 _s2PtNNw_12_vsM ( 0),
255 _s2NPtNw_12_vsM ( 0),
278 intBinCorrName("NA"),
328 _title_etaPhi_1("NA"),
330 _title_SumPt_1("NA"),
331 _title_AvgPt_1("NA"),
333 _title_AvgSumPt_1("NA"),
338 _title_etaPhi_2("NA"),
340 _title_SumPt_2("NA"),
341 _title_AvgPt_2("NA"),
343 _title_AvgSumPt_2("NA"),
345 _title_etaPhi_12("NA"),
347 _title_AvgN2_12("NA"),
348 _title_AvgSumPtPt_12("NA"),
349 _title_AvgSumPtN_12("NA"),
350 _title_AvgNSumPt_12("NA"),
360 printf("Default constructor called \n");
362 printf("passed \n ");
366 AliAnalysisTaskDptDptCorrelations::AliAnalysisTaskDptDptCorrelations(const TString & name)
367 : AliAnalysisTaskSE(name),
373 _twoPi ( 2.0 * 3.1415927),
378 _sameFilter ( false),
380 _rejectPairConversion ( 0),
383 _vertexXYMin ( -10.),
385 _centralityMethod ( 4),
386 _centralityMin ( 0.),
387 _centralityMax ( 1.),
388 _requestedCharge_1 ( 1),
389 _requestedCharge_2 ( -1),
397 _trackFilterBit ( 0),
432 _correctionWeight_1(0),
433 _correctionWeight_2(0),
434 _nBins_M0(500), _min_M0(0), _max_M0(10000), _width_M0(20),
435 _nBins_M1(500), _min_M1(0), _max_M1(10000), _width_M1(20),
436 _nBins_M2(500), _min_M2(0), _max_M2(10000), _width_M2(20),
437 _nBins_M3(500), _min_M3(0), _max_M3(10000), _width_M3(20),
438 _nBins_M4(100), _min_M4(0), _max_M4(1), _width_M4(0.01),
439 _nBins_M5(100), _min_M5(0), _max_M5(1), _width_M5(0.01),
440 _nBins_M6(100), _min_M6(0), _max_M6(1), _width_M6(0.01),
441 _nBins_vertexZ(40), _min_vertexZ(-10), _max_vertexZ(10), _width_vertexZ(0.5),
443 _nBins_pt_1(18), _min_pt_1(0.2), _max_pt_1(2.0), _width_pt_1(0.1),
444 _nBins_phi_1(72), _min_phi_1(0), _max_phi_1(2.*3.1415927),_width_phi_1(2.*3.1415927/72.),
445 _nBins_eta_1(0), _min_eta_1(0), _max_eta_1(0), _width_eta_1(0.1),
448 _nBins_etaPhiPt_1(0),
449 _nBins_zEtaPhiPt_1(0),
451 _nBins_pt_2(18), _min_pt_2(0.2), _max_pt_2(2.0), _width_pt_2(0.1),
452 _nBins_phi_2(72), _min_phi_2(0), _max_phi_2(2.*3.1415927),_width_phi_2(2.*3.1415927/72),
453 _nBins_eta_2(0), _min_eta_2(0), _max_eta_2(0), _width_eta_2(0.1),
456 _nBins_etaPhiPt_2(0),
457 _nBins_zEtaPhiPt_2(0),
477 __s1pt_1_vsEtaPhi(0),
478 __n1_1_vsZEtaPhiPt(0),
481 __s1pt_2_vsEtaPhi(0),
482 __n1_2_vsZEtaPhiPt(0),
485 __s2ptpt_12_vsEtaPhi(0),
486 __s2PtN_12_vsEtaPhi(0),
487 __s2NPt_12_vsEtaPhi(0),
490 _eventAccounting ( 0),
507 _n1_1_vsEtaVsPhi ( 0),
508 _s1pt_1_vsEtaVsPhi ( 0),
509 _n1_1_vsZVsEtaVsPhiVsPt ( 0),
518 _n1_2_vsEtaVsPhi ( 0),
519 _s1pt_2_vsEtaVsPhi ( 0),
520 _n1_2_vsZVsEtaVsPhiVsPt ( 0),
528 _n2_12_vsEtaPhi ( 0),
529 _n2_12_vsPtVsPt ( 0),
530 _s2PtPt_12_vsEtaPhi( 0),
531 _s2PtN_12_vsEtaPhi ( 0),
532 _s2NPt_12_vsEtaPhi ( 0),
538 _s2PtPtNw_12_vsM ( 0),
539 _s2PtNNw_12_vsM ( 0),
540 _s2NPtNw_12_vsM ( 0),
563 intBinCorrName("NA"),
613 _title_etaPhi_1("NA"),
615 _title_SumPt_1("NA"),
616 _title_AvgPt_1("NA"),
618 _title_AvgSumPt_1("NA"),
623 _title_etaPhi_2("NA"),
625 _title_SumPt_2("NA"),
626 _title_AvgPt_2("NA"),
628 _title_AvgSumPt_2("NA"),
630 _title_etaPhi_12("NA"),
632 _title_AvgN2_12("NA"),
633 _title_AvgSumPtPt_12("NA"),
634 _title_AvgSumPtN_12("NA"),
635 _title_AvgNSumPt_12("NA"),
645 printf("2nd constructor called ");
647 DefineOutput(0, TList::Class());
653 AliAnalysisTaskDptDptCorrelations::~AliAnalysisTaskDptDptCorrelations()
658 void AliAnalysisTaskDptDptCorrelations::UserCreateOutputObjects()
661 _outputHistoList = new TList();
662 _outputHistoList->SetOwner();
664 _nBins_M0 = 500; _min_M0 = 0.; _max_M0 = 5000.; _width_M0 = (_max_M0-_min_M0)/_nBins_M0;
665 _nBins_M1 = 500; _min_M1 = 0.; _max_M1 = 5000.; _width_M1 = (_max_M1-_min_M1)/_nBins_M1;
666 _nBins_M2 = 500; _min_M2 = 0.; _max_M2 = 5000.; _width_M2 = (_max_M2-_min_M2)/_nBins_M2;
667 _nBins_M3 = 500; _min_M3 = 0.; _max_M3 = 5000.; _width_M3 = (_max_M3-_min_M3)/_nBins_M3;
668 _nBins_M4 = 100; _min_M4 = 0.; _max_M4 = 100.; _width_M4 = (_max_M4-_min_M4)/_nBins_M4;
669 _nBins_M5 = 100; _min_M5 = 0.; _max_M5 = 100.; _width_M5 = (_max_M5-_min_M5)/_nBins_M5;
670 _nBins_M6 = 100; _min_M6 = 0.; _max_M6 = 100.; _width_M6 = (_max_M6-_min_M6)/_nBins_M6;
672 _min_vertexZ = _vertexZMin;
673 _max_vertexZ = _vertexZMax;
674 _width_vertexZ = 0.5;
675 _nBins_vertexZ = int(0.5+ (_max_vertexZ - _min_vertexZ)/_width_vertexZ);
676 _nBins_pt_1 = int(0.5+ (_max_pt_1 -_min_pt_1 )/_width_pt_1);
677 _nBins_eta_1 = int(0.5+ (_max_eta_1-_min_eta_1)/_width_eta_1);
678 _width_phi_1 = (_max_phi_1 - _min_phi_1) /_nBins_phi_1;
679 _nBins_etaPhi_1 = _nBins_phi_1 * _nBins_eta_1;
680 _nBins_etaPhiPt_1 = _nBins_etaPhi_1 * _nBins_pt_1;
681 _nBins_zEtaPhiPt_1 = _nBins_vertexZ * _nBins_etaPhiPt_1;
683 _nBins_pt_2 = int(0.5+ (_max_pt_2 -_min_pt_2 )/_width_pt_2);
684 _nBins_eta_2 = int(0.5+ (_max_eta_2-_min_eta_2)/_width_eta_2);
685 _width_phi_2 = (_max_phi_2 - _min_phi_2) /_nBins_phi_2;
686 _nBins_etaPhi_2 = _nBins_phi_2 * _nBins_eta_2;
687 _nBins_etaPhiPt_2 = _nBins_etaPhi_2 * _nBins_pt_2;
688 _nBins_zEtaPhiPt_2 = _nBins_vertexZ * _nBins_etaPhiPt_2;
689 _nBins_etaPhi_12 = _nBins_etaPhi_1 * _nBins_etaPhi_2;
691 _id_1 = new int[arraySize];
692 _charge_1 = new int[arraySize];
693 _iEtaPhi_1 = new int[arraySize];
694 _iPt_1 = new int[arraySize];
695 _pt_1 = new float[arraySize];
696 _px_1 = new float[arraySize];
697 _py_1 = new float[arraySize];
698 _pz_1 = new float[arraySize];
699 _correction_1 = new float[arraySize];
700 _dedx_1 = new float[arraySize];
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.);
707 if (_requestedCharge_2!=_requestedCharge_1)
711 _id_2 = new int[arraySize];
712 _charge_2 = new int[arraySize];
713 _iEtaPhi_2 = new int[arraySize];
714 _iPt_2 = new int[arraySize];
715 _pt_2 = new float[arraySize];
716 _px_2 = new float[arraySize];
717 _py_2 = new float[arraySize];
718 _pz_2 = new float[arraySize];
719 _correction_2 = new float[arraySize];
720 _dedx_2 = new float[arraySize];
721 __n1_2_vsPt = getDoubleArray(_nBins_pt_2, 0.);
722 __n1_2_vsEtaPhi = getDoubleArray(_nBins_etaPhi_2, 0.);
723 __s1pt_2_vsEtaPhi = getDoubleArray(_nBins_etaPhi_2, 0.);
724 __n1_2_vsZEtaPhiPt = getFloatArray(_nBins_zEtaPhiPt_2, 0.);
728 __n2_12_vsPtPt = getDoubleArray(_nBins_pt_1*_nBins_pt_2,0.);
729 __n2_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.);
730 __s2ptpt_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.);
731 __s2PtN_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.);
732 __s2NPt_12_vsEtaPhi = getFloatArray(_nBins_etaPhi_12, 0.);
734 // Setup all the labels needed.
738 pair_12_Name = "_12";
755 binCorrName = "binCorr";
756 intBinCorrName = "intBinCorr";
761 s1ptNwName = "sumPtNw";
762 s1DptName = "sumDpt";
763 s2PtPtName = "sumPtPt";
764 s2PtPtNwName = "sumPtPtNw";
765 s2DptDptName = "sumDptDpt";
766 s2NPtName = "sumNPt";
767 s2NPtNwName = "sumNPtNw";
768 s2PtNName = "sumPtN";
769 s2NPtNwName = "sumNPtNw";
770 s2PtNNwName = "sumPtNNw";
772 ptptName = "avgPtPt";
773 pt1pt1Name = "avgPtavgPt";
775 DptDptName = "avgDptDpt";
776 RDptDptName = "relDptDpt"; // ratio of avgDptDpt by avgPt*avgPt
781 _title_counts = "yield";
787 _title_m4 = "V0Centrality";
788 _title_m5 = "TrkCentrality";
789 _title_m6 = "SpdCentrality";
791 _title_eta_1 = "#eta_{1}";
792 _title_phi_1 = "#varphi_{1} (radian)";
793 _title_etaPhi_1 = "#eta_{1}#times#varphi_{1}";
794 _title_pt_1 = "p_{t,1} (GeV/c)";
795 _title_n_1 = "n_{1}";
796 _title_SumPt_1 = "#Sigma p_{t,1} (GeV/c)";
797 _title_AvgPt_1 = "#LT p_{t,1} #GT (GeV/c)";
798 _title_AvgN_1 = "#LT n_{1} #GT";
799 _title_AvgSumPt_1 = "#LT #Sigma p_{t,1} #GT (GeV/c)";
801 _title_eta_2 = "#eta_{2}";
802 _title_phi_2 = "#varphi_{2} (radian)";
803 _title_etaPhi_2 = "#eta_{2}#times#varphi_{2}";
804 _title_pt_2 = "p_{t,2} (GeV/c)";
805 _title_n_2 = "n_{2}";
806 _title_SumPt_2 = "#Sigma p_{t,1} (GeV/c)";
807 _title_AvgPt_2 = "#LT p_{t,2} #GT (GeV/c)";
808 _title_AvgN_2 = "#LT n_{2} #GT";
809 _title_AvgSumPt_2 = "#LT #Sigma p_{t,2} #GT (GeV/c)";
811 _title_etaPhi_12 = "#eta_{1}#times#varphi_{1}#times#eta_{2}#times#varphi_{2}";
813 _title_AvgN2_12 = "#LT n_{2} #GT";;
814 _title_AvgSumPtPt_12 = "#LT #Sigma p_{t,1}p_{t,2} #GT";;
815 _title_AvgSumPtN_12 = "#LT #Sigma p_{t,1}N #GT";;
816 _title_AvgNSumPt_12 = "#LT N#Sigma p_{t,2} #GT";;
824 vsEtaPhi = "_vsEtaPhi";
825 vsPtVsPt = "_vsPtVsPt";
830 int iZ, iEtaPhi, iPt;
831 int iZ1,iEtaPhi1,iPt1;
835 _correctionWeight_1 = new float[_nBins_vertexZ*_nBins_etaPhi_1*_nBins_pt_1];
837 b = _nBins_etaPhi_1*_nBins_pt_1;
838 for (iZ=0,iZ1=1; iZ<_nBins_vertexZ; iZ++, iZ1++)
840 for (iEtaPhi=0,iEtaPhi1=1; iEtaPhi<_nBins_etaPhi_1; iEtaPhi++, iEtaPhi1++)
842 for (iPt=0,iPt1=1; iPt<_nBins_pt_1; iPt++, iPt1++)
844 _correctionWeight_1[iZ*b+iEtaPhi*a+iPt] = _weight_1->GetBinContent(iZ1,iEtaPhi1,iPt1);
851 AliError("AliAnalysisTaskDptDptCorrelations:: _weight_1 is a null pointer.");
858 _correctionWeight_2 = new float[_nBins_vertexZ*_nBins_etaPhi_2*_nBins_pt_2];
860 b = _nBins_etaPhi_2*_nBins_pt_2;
861 for (iZ=0,iZ1=1; iZ<_nBins_vertexZ; iZ++, iZ1++)
863 for (iEtaPhi=0,iEtaPhi1=1; iEtaPhi<_nBins_etaPhi_2; iEtaPhi++, iEtaPhi1++)
865 for (iPt=0,iPt1=1; iPt<_nBins_pt_2; iPt++, iPt1++)
867 _correctionWeight_2[iZ*b+iEtaPhi*a+iPt] = _weight_2->GetBinContent(iZ1,iEtaPhi1,iPt1);
874 AliError("AliAnalysisTaskDptDptCorrelations:: _weight_1 is a null pointer.");
881 PostData(0,_outputHistoList);
883 //cout<< "AliAnalysisTaskDptDptCorrelations::CreateOutputObjects() DONE " << endl;
887 void AliAnalysisTaskDptDptCorrelations::createHistograms()
889 AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Event Histos");
892 name = "eventAccounting";
894 _eventAccounting = createHisto1D(name,name,10, -0.5, 9.5, "event Code", _title_counts);
896 name = "m0"; _m0 = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m0, _title_counts);
897 name = "m1"; _m1 = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m1, _title_counts);
898 name = "m2"; _m2 = createHisto1D(name,name,_nBins_M2, _min_M2, _max_M2, _title_m2, _title_counts);
899 name = "m3"; _m3 = createHisto1D(name,name,_nBins_M3, _min_M3, _max_M3, _title_m3, _title_counts);
900 name = "m4"; _m4 = createHisto1D(name,name,_nBins_M4, _min_M4, _max_M4, _title_m4, _title_counts);
901 name = "m5"; _m5 = createHisto1D(name,name,_nBins_M5, _min_M5, _max_M5, _title_m5, _title_counts);
902 name = "m6"; _m6 = createHisto1D(name,name,_nBins_M6, _min_M6, _max_M6, _title_m6, _title_counts);
903 name = "zV"; _vertexZ = createHisto1D(name,name,100, -10, 10, "z-Vertex (cm)", _title_counts);
906 name = "Eta"; _etadis = createHisto1F(name,name, 200, -1.0, 1.0, "#eta","counts");
907 name = "Phi"; _phidis = createHisto1F(name,name, 360, 0.0, 6.4, "#phi","counts");
908 name = "DCAz"; _dcaz = createHisto1F(name,name, 500, -5.0, 5.0, "dcaZ","counts");
909 name = "DCAxy"; _dcaxy = createHisto1F(name,name, 500, -5.0, 5.0, "dcaXY","counts");
911 name = "Nclus1"; _Ncluster1 = createHisto1F(name,name, 200, 0, 200, "Ncluster1","counts");
912 //name = "Nclus2"; _Ncluster2 = createHisto1F(name,name, 200, 0, 200, "Ncluster2","counts");
916 name = n1Name+part_1_Name+vsPt; _n1_1_vsPt = createHisto1F(name,name, _nBins_pt_1, _min_pt_1, _max_pt_1, _title_pt_1, _title_AvgN_1);
917 name = n1Name+part_1_Name+vsZ+vsEtaPhi+vsPt; _n1_1_vsZVsEtaVsPhiVsPt = createHisto3F(name,name, _nBins_vertexZ,_min_vertexZ,_max_vertexZ, _nBins_etaPhi_1, 0., double(_nBins_etaPhi_1), _nBins_pt_1, _min_pt_1, _max_pt_1, "zVertex", _title_etaPhi_1, _title_pt_1);
919 name = n1Name+part_2_Name+vsPt; _n1_2_vsPt = createHisto1F(name,name, _nBins_pt_2, _min_pt_2, _max_pt_2, _title_pt_2, _title_AvgN_2);
920 name = n1Name+part_2_Name+vsZ+vsEtaPhi+vsPt; _n1_2_vsZVsEtaVsPhiVsPt = createHisto3F(name,name, _nBins_vertexZ,_min_vertexZ,_max_vertexZ, _nBins_etaPhi_2, 0., double(_nBins_etaPhi_2), _nBins_pt_2, _min_pt_2, _max_pt_2, "zVertex", _title_etaPhi_2, _title_pt_2);
925 name = n1Name+part_1_Name+vsEtaPhi; _n1_1_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_1, _min_eta_1, _max_eta_1, _nBins_phi_1, _min_phi_1, _max_phi_1, _title_eta_1, _title_phi_1, _title_AvgN_1);
926 name = s1ptName+part_1_Name+vsEtaPhi; _s1pt_1_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_1, _min_eta_1, _max_eta_1, _nBins_phi_1, _min_phi_1, _max_phi_1, _title_eta_1, _title_phi_1, _title_AvgSumPt_1);
927 name = n1Name+part_1_Name+vsM; _n1_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
928 name = s1ptName+part_1_Name+vsM; _s1pt_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
929 name = n1NwName+part_1_Name+vsM; _n1Nw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
930 name = s1ptNwName+part_1_Name+vsM; _s1ptNw_1_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
932 name = n1Name+part_2_Name+vsEtaPhi; _n1_2_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_2, _min_eta_2, _max_eta_2, _nBins_phi_2, _min_phi_2, _max_phi_2, _title_eta_2, _title_phi_2, _title_AvgN_2);
933 name = s1ptName+part_2_Name+vsEtaPhi; _s1pt_2_vsEtaVsPhi = createHisto2F(name,name, _nBins_eta_2, _min_eta_2, _max_eta_2, _nBins_phi_2, _min_phi_2, _max_phi_2, _title_eta_2, _title_phi_2, _title_AvgSumPt_2);
934 name = n1Name+part_2_Name + vsM; _n1_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_2);
935 name = s1ptName+part_2_Name + vsM; _s1pt_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_2);
936 name = n1NwName+part_2_Name+vsM; _n1Nw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
937 name = s1ptNwName+part_2_Name+vsM; _s1ptNw_2_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
939 name = n2Name+pair_12_Name+vsEtaPhi; _n2_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgN2_12);
940 name = s2PtPtName+pair_12_Name + vsEtaPhi;_s2PtPt_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgSumPtPt_12);
941 name = s2PtNName+pair_12_Name + vsEtaPhi; _s2PtN_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgSumPtN_12);
942 name = s2NPtName+pair_12_Name + vsEtaPhi; _s2NPt_12_vsEtaPhi = createHisto1F(name,name, _nBins_etaPhi_12, 0., double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgNSumPt_12);
943 name = n2Name+pair_12_Name+vsPtVsPt; _n2_12_vsPtVsPt = createHisto2F(name,name, _nBins_pt_1, _min_pt_1, _max_pt_1, _nBins_pt_2, _min_pt_2, _max_pt_2, _title_pt_1, _title_pt_2, _title_AvgN2_12);
945 name = n2Name+pair_12_Name + vsM; _n2_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12);
946 name = s2PtPtName+pair_12_Name + vsM; _s2PtPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12);
947 name = s2PtNName+pair_12_Name + vsM; _s2PtN_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12);
948 name = s2NPtName+pair_12_Name + vsM; _s2NPt_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12);
950 name = n2NwName+pair_12_Name + vsM; _n2Nw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12);
951 name = s2PtPtNwName+pair_12_Name + vsM; _s2PtPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12);
952 name = s2PtNNwName+pair_12_Name + vsM; _s2PtNNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12);
953 name = s2NPtNwName+pair_12_Name + vsM; _s2NPtNw_12_vsM = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12);
955 name = "mInv"; _invMass = createHisto1F(name,name, 50, 0.41, 0.55, "M_{inv}","counts");
956 name = "mInvElec"; _invMassElec = createHisto1F(name,name, 500, 0., 1.000, "M_{inv}","counts");
959 AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() All Done");
961 //-----------------------//
963 void AliAnalysisTaskDptDptCorrelations::finalizeHistograms()
966 AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() starting");
967 AliInfo(Form("CorrelationAnalyzers::finalizeHistograms() _eventCount : %d",int(_eventCount)));
972 fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1);
973 fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
974 fillHistoWithArray(_n1_2_vsPt, __n1_1_vsPt, _nBins_pt_1);
975 fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
979 fillHistoWithArray(_n1_1_vsPt, __n1_1_vsPt, _nBins_pt_1);
980 fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
981 fillHistoWithArray(_n1_2_vsPt, __n1_2_vsPt, _nBins_pt_2);
982 fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_2_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_2, _nBins_pt_2);
989 fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1);
990 fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1);
991 fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1);
992 fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1);
996 fillHistoWithArray(_n1_1_vsEtaVsPhi, __n1_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1);
997 fillHistoWithArray(_s1pt_1_vsEtaVsPhi, __s1pt_1_vsEtaPhi, _nBins_eta_1, _nBins_phi_1);
998 fillHistoWithArray(_n1_2_vsEtaVsPhi, __n1_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2);
999 fillHistoWithArray(_s1pt_2_vsEtaVsPhi, __s1pt_2_vsEtaPhi, _nBins_eta_2, _nBins_phi_2);
1001 fillHistoWithArray(_n2_12_vsEtaPhi, __n2_12_vsEtaPhi, _nBins_etaPhi_12);
1002 fillHistoWithArray(_s2PtPt_12_vsEtaPhi, __s2ptpt_12_vsEtaPhi, _nBins_etaPhi_12);
1003 fillHistoWithArray(_s2PtN_12_vsEtaPhi, __s2PtN_12_vsEtaPhi, _nBins_etaPhi_12);
1004 fillHistoWithArray(_s2NPt_12_vsEtaPhi, __s2NPt_12_vsEtaPhi, _nBins_etaPhi_12);
1005 fillHistoWithArray(_n2_12_vsPtVsPt, __n2_12_vsPtPt, _nBins_pt_1, _nBins_pt_2);
1008 AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() Done ");
1013 void AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
1017 int iPhi, iEta, iEtaPhi, iPt, charge;
1018 float q, phi, pt, eta, corr, corrPt, px, py, pz, dedx;
1020 int id_1, q_1, iEtaPhi_1, iPt_1;
1021 float pt_1, px_1, py_1, pz_1, corr_1, dedx_1;
1022 int id_2, q_2, iEtaPhi_2, iPt_2;
1023 float pt_2, px_2, py_2, pz_2, corr_2, dedx_2;
1025 int iVertex, iVertexP1, iVertexP2;
1027 float massElecSq = 1.94797849000000016e-02;
1030 const AliAODVertex* vertex;
1034 AliAnalysisManager* manager = AliAnalysisManager::GetAnalysisManager();
1038 AliAODInputHandler* inputHandler = dynamic_cast<AliAODInputHandler*> (manager->GetInputEventHandler());
1039 if (!inputHandler) {
1043 fAODEvent = dynamic_cast<AliAODEvent*>(InputEvent());
1044 //AliAODEvent* fAODEvent = dynamic_cast<AliAODEvent*>(InputEvent());
1050 fPIDResponse =inputHandler->GetPIDResponse();
1052 AliFatal("This Task needs the PID response attached to the inputHandler");
1056 // count all events looked at here
1059 if (_eventAccounting)
1061 _eventAccounting->Fill(0);// count all calls to this function
1069 _eventAccounting->Fill(1);// count all calls to this function with a valid pointer
1070 //reset single particle counters
1072 __n1_1 = __n1_2 = __s1pt_1 = __s1pt_2 = __n1Nw_1 = __n1Nw_2 = __s1ptNw_1 = __s1ptNw_2 = 0;
1074 float v0Centr = -999.;
1075 float v0ACentr = -999.;
1076 float trkCentr = -999.;
1077 float spdCentr = -999.;
1079 float vertexX = -999;
1080 float vertexY = -999;
1081 float vertexZ = -999;
1082 //float vertexXY = -999;
1083 //float dcaZ = -999;
1084 //float dcaXY = -999;
1085 float centrality = -999;
1090 AliCentrality* centralityObject = fAODEvent->GetHeader()->GetCentralityP();
1091 if (centralityObject)
1093 //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 6" << endl;
1095 v0Centr = centralityObject->GetCentralityPercentile("V0M");
1096 v0ACentr = centralityObject->GetCentralityPercentile("V0A");
1097 trkCentr = centralityObject->GetCentralityPercentile("TRK");
1098 spdCentr = centralityObject->GetCentralityPercentile("CL1");
1102 _nTracks =fAODEvent->GetNumberOfTracks();//NEW Test
1109 _field = fAODEvent->GetMagneticField();
1112 switch (_centralityMethod)
1114 case 0: centrality = _mult0; break;
1115 case 1: centrality = _mult1; break;
1116 case 2: centrality = _mult2; break;
1117 case 3: centrality = _mult3; break;
1118 case 4: centrality = _mult4; break;
1119 case 5: centrality = _mult5; break;
1120 case 6: centrality = _mult6; break;
1121 case 7: centrality = _mult4a; break;
1125 if ( centrality < _centralityMin || centrality > _centralityMax )
1129 _eventAccounting->Fill(2);// count all events with right centrality
1131 // filter on z and xy vertex
1132 vertex = (AliAODVertex*) fAODEvent->GetPrimaryVertex();
1134 //vertex->GetXYZ(V);
1139 vertex->GetCovarianceMatrix(fCov);
1140 if(vertex->GetNContributors() > 0)
1144 vertexX = vertex->GetX();
1145 vertexY = vertex->GetY();
1146 vertexZ = vertex->GetZ();
1148 if(TMath::Abs(vertexZ) > 10)
1156 _vertexZ->Fill(vertexZ);
1158 iVertex = int((vertexZ-_min_vertexZ)/_width_vertexZ);
1159 iVertexP1 = iVertex*_nBins_etaPhiPt_1;
1160 iVertexP2 = iVertex*_nBins_etaPhiPt_2;
1161 if (iVertex<0 || iVertex>=_nBins_vertexZ)
1163 AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) iVertex<0 || iVertex>=_nBins_vertexZ ");
1166 _eventAccounting->Fill(3);// count all calls to this function with a valid pointer
1167 //======================
1169 //*********************************************************
1170 TExMap *trackMap = new TExMap();//Mapping matrix----
1172 //1st loop track for Global tracks
1173 for(Int_t i = 0; i < _nTracks; i++)
1175 AliAODTrack* aodTrack = dynamic_cast<AliAODTrack *>(fAODEvent->GetTrack(i));
1177 AliError(Form("ERROR: Could not retrieve AODtrack %d",i));
1180 Int_t gID = aodTrack->GetID();
1181 if (aodTrack->TestFilterBit(1)) trackMap->Add(gID, i);//Global tracks
1184 AliAODTrack* newAodTrack;
1186 //Track Loop starts here
1187 for (int iTrack=0; iTrack< _nTracks; iTrack++)
1189 AliAODTrack* t = dynamic_cast<AliAODTrack *>(fAODEvent->GetTrack(iTrack));
1191 AliError(Form("Could not receive track %d", iTrack));
1195 bitOK = t->TestFilterBit(_trackFilterBit);
1196 if (!bitOK) continue; //128bit or 272bit
1198 Int_t gID = t->GetID();
1199 newAodTrack = gID >= 0 ?t : fAODEvent->GetTrack(trackMap->GetValue(-1-gID));
1209 dedx = t->GetTPCsignal();
1211 //dcaZ = t->ZAtDCA();
1212 nClus = t->GetTPCNcls();
1214 if ( nClus<_nClusterMin ) continue;
1216 _Ncluster1->Fill(nClus);
1219 //cuts on more than 0 shared cluster (suggested by Michael)
1220 if(t->GetTPCnclsS() > 0){
1225 Double_t nsigmaelectron = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kElectron));
1226 Double_t nsigmapion = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kPion));
1227 Double_t nsigmakaon = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kKaon));
1228 Double_t nsigmaproton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,(AliPID::EParticleType)AliPID::kProton));
1230 //nsigma cut to reject electron
1232 if(nsigmaelectron < fNSigmaCut
1233 && nsigmapion > fNSigmaCut
1234 && nsigmakaon > fNSigmaCut
1235 && nsigmaproton > fNSigmaCut ) continue;
1238 if(charge == 0) continue;
1239 // Kinematics cuts used
1240 if( pt < _min_pt_1 || pt > _max_pt_1) continue;
1241 if( eta < _min_eta_1 || eta > _max_eta_1) continue;
1244 newAodTrack->GetXYZ(pos);
1246 Double_t DCAX = pos[0] - vertexX;
1247 Double_t DCAY = pos[1] - vertexY;
1248 Double_t DCAZ = pos[2] - vertexZ;
1250 Double_t DCAXY = TMath::Sqrt((DCAX*DCAX) + (DCAY*DCAY));
1252 if (DCAZ < _dcaZMin ||
1254 DCAXY > _dcaXYMax ) continue;
1257 //------- Eff. test---------- //just for checking
1258 //Double_t yy = (1 - 0.7)/1.8;
1259 //Double_t zz = (pt - 0.2);
1260 //Double_t effValue = 0.7 + yy*zz;
1261 //Double_t R = gRandom->Rndm();
1262 //if(R > effValue) continue;
1263 //---------------------------
1265 //==== QA ===========================
1266 //_dcaz->Fill(DCAZ);
1267 //_dcaxy->Fill(DCAXY);
1269 //_phidis->Fill(phi);
1270 //===================================
1271 //*************************************************
1274 if (_requestedCharge_1 == charge && dedx >= _dedxMin && dedx < _dedxMax)
1276 iPhi = int( phi/_width_phi_1);
1278 if (iPhi<0 || iPhi>=_nBins_phi_1 )
1280 AliWarning("AliAnalysisTaskDptDptCorrelations::analyze() iPhi<0 || iPhi>=_nBins_phi_1");
1284 iEta = int((eta-_min_eta_1)/_width_eta_1);
1285 if (iEta<0 || iEta>=_nBins_eta_1)
1287 AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iEta: %d", iEta));
1290 iPt = int((pt -_min_pt_1 )/_width_pt_1 );
1291 if (iPt<0 || iPt >=_nBins_pt_1)
1293 AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iPt: %d",iPt));
1296 iEtaPhi = iEta*_nBins_phi_1+iPhi;
1297 iZEtaPhiPt = iVertexP1 + iEtaPhi*_nBins_pt_1 + iPt;
1299 if (_correctionWeight_1)
1300 corr = _correctionWeight_1[iZEtaPhiPt];
1303 if (iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1)
1305 AliWarning("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_1");
1313 __n1_1_vsPt[iPt] += corr; //cout << "step 15" << endl;
1314 __n1_1_vsZEtaPhiPt[iZEtaPhiPt] += corr; //cout << "step 12" << endl;
1321 _charge_1[k1] = charge;
1322 _iEtaPhi_1[k1] = iEtaPhi;
1328 _correction_1[k1] = corr;
1330 __n1_1_vsEtaPhi[iEtaPhi] += corr;
1332 __s1pt_1_vsEtaPhi[iEtaPhi] += corrPt;
1338 AliError(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) k1 >=arraySize; arraySize: %d",arraySize));
1344 if (!_sameFilter && _requestedCharge_2 == charge &&
1345 dedx >= _dedxMin && dedx < _dedxMax)
1349 iPhi = int( phi/_width_phi_2);
1351 if (iPhi<0 || iPhi>=_nBins_phi_2 )
1353 AliWarning("AliAnalysisTaskDptDptCorrelations::analyze() iPhi<0 || iPhi>=_nBins_phi_1");
1357 iEta = int((eta-_min_eta_2)/_width_eta_2);
1358 if (iEta<0 || iEta>=_nBins_eta_2)
1360 AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iEta: %d", iEta));
1363 iPt = int((pt -_min_pt_2 )/_width_pt_2 );
1364 if (iPt<0 || iPt >=_nBins_pt_2)
1366 AliWarning(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) Mismatched iPt: %d",iPt));
1370 iEtaPhi = iEta*_nBins_phi_2+iPhi;
1371 iZEtaPhiPt = iVertexP2 + iEtaPhi*_nBins_pt_2 + iPt;
1372 if (iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_2)
1374 AliWarning("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) iZEtaPhiPt<0 || iZEtaPhiPt>=_nBins_zEtaPhiPt_2");
1379 if (_correctionWeight_2)
1380 corr = _correctionWeight_2[iZEtaPhiPt];
1386 __n1_2_vsPt[iPt] += corr; //cout << "step 15" << endl;
1387 __n1_2_vsZEtaPhiPt[iZEtaPhiPt] += corr; //cout << "step 12" << endl;
1392 _id_2[k2] = iTrack; //cout << "step 1" << endl;
1393 _charge_2[k2] = charge; //cout << "step 2" << endl;
1394 _iEtaPhi_2[k2] = iEtaPhi; //cout << "step 3" << endl;
1395 _iPt_2[k2] = iPt; //cout << "step 4" << endl;
1396 _pt_2[k2] = pt; //cout << "step 5" << endl;
1397 _px_2[k2] = px; //cout << "step 6" << endl;
1398 _py_2[k2] = py; //cout << "step 7" << endl;
1399 _pz_2[k2] = pz; //cout << "step 8" << endl;
1400 _correction_2[k2] = corr; //cout << "step 9" << endl;
1401 __n1_2 += corr; //cout << "step 10" << endl;
1402 __s1pt_2 += corrPt; //cout << "step 13" << endl;
1404 __n1_2_vsEtaPhi[iEtaPhi] += corr; //cout << "step 11" << endl;
1405 __s1pt_2_vsEtaPhi[iEtaPhi] += corrPt; //cout << "step 14" << endl;
1410 AliWarning(Form("-W- k2 >=arraySize; arraySize: %d",arraySize));
1415 //cout << "done with track" << endl;
1421 //cout << "Filling histograms now" << endl;
1429 //_vertexZ->Fill(vertexZ);
1433 // nothing to do here.
1439 _n1_1_vsM->Fill(centrality, __n1_1);
1440 _s1pt_1_vsM->Fill(centrality, __s1pt_1);
1441 _n1Nw_1_vsM->Fill(centrality, __n1Nw_1);
1442 _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1);
1443 _n1_2_vsM->Fill(centrality, __n1_1);
1444 _s1pt_2_vsM->Fill(centrality, __s1pt_1);
1445 _n1Nw_2_vsM->Fill(centrality, __n1Nw_1);
1446 _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_1);
1447 // reset pair counters
1448 __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0;
1449 __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0;
1452 for (int i1=0; i1<k1; i1++)
1454 ////cout << " i1:" << i1 << endl;
1455 id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl;
1456 q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl;
1457 iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
1458 iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl;
1459 corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl;
1460 pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl;
1461 dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl;
1463 for (int i2=i1+1; i2<k1; i2++)
1465 ////cout << " i2:" << i2 << endl;
1466 id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl;
1469 q_2 = _charge_1[i2]; ////cout << " q_1:" << q_1 << endl;
1470 iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
1471 iPt_2 = _iPt_1[i2]; ////cout << " iPt_1:" << iPt_1 << endl;
1472 corr_2 = _correction_1[i2]; ////cout << " corr_1:" << corr_1 << endl;
1473 pt_2 = _pt_1[i2]; ////cout << " pt_1:" << pt_1 << endl;
1474 dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl;
1475 corr = corr_1*corr_2;
1476 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))
1478 ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl;
1480 else // swap particles
1482 ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl;
1486 __n2_12_vsEtaPhi[ij] += corr;
1488 __s2ptpt_12 += corr*ptpt;
1489 __s2PtN_12 += corr*pt_1;
1490 __s2NPt_12 += corr*pt_2;
1491 __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
1492 __s2PtN_12_vsEtaPhi[ij] += corr*pt_1;
1493 __s2NPt_12_vsEtaPhi[ij] += corr*pt_2;
1494 __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
1497 __s2ptptNw_12 += ptpt;
1498 __s2PtNNw_12 += pt_1;
1499 __s2NPtNw_12 += pt_2;
1507 for (int i1=0; i1<k1; i1++)
1509 ////cout << " i1:" << i1 << endl;
1510 id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl;
1511 q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl;
1512 iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
1513 iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl;
1514 corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl;
1515 pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl;
1516 dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl;
1518 for (int i2=i1+1; i2<k1; i2++)
1520 ////cout << " i2:" << i2 << endl;
1521 id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl;
1524 q_2 = _charge_1[i2]; ////cout << " q_2:" << q_2 << endl;
1525 iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl;
1526 iPt_2 = _iPt_1[i2]; ////cout << " iPt_2:" << iPt_2 << endl;
1527 corr_2 = _correction_1[i2]; ////cout << " corr_2:" << corr_2 << endl;
1528 pt_2 = _pt_1[i2]; ////cout << " pt_2:" << pt_2 << endl;
1529 dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl;
1530 corr = corr_1*corr_2;
1531 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))
1533 ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl;
1535 else // swap particles
1537 ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl;
1541 __n2_12_vsEtaPhi[ij] += corr;
1543 __s2ptpt_12 += corr*ptpt;
1544 __s2PtN_12 += corr*pt_1;
1545 __s2NPt_12 += corr*pt_2;
1546 __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
1547 __s2PtN_12_vsEtaPhi[ij] += corr*pt_1;
1548 __s2NPt_12_vsEtaPhi[ij] += corr*pt_2;
1549 __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
1552 __s2ptptNw_12 += ptpt;
1553 __s2PtNNw_12 += pt_1;
1554 __s2NPtNw_12 += pt_2;
1561 else // filter 1 and 2 are different -- must do all particle pairs...
1563 _n1_1_vsM->Fill(centrality, __n1_1);
1564 _s1pt_1_vsM->Fill(centrality, __s1pt_1);
1565 _n1Nw_1_vsM->Fill(centrality, __n1Nw_1);
1566 _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1);
1567 _n1_2_vsM->Fill(centrality, __n1_2);
1568 _s1pt_2_vsM->Fill(centrality, __s1pt_2);
1569 _n1Nw_2_vsM->Fill(centrality, __n1Nw_2);
1570 _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_2);
1571 // reset pair counters
1572 __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0;
1573 __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0;
1574 for (int i1=0; i1<k1; i1++)
1576 ////cout << " i1:" << i1 << endl;
1577 id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl;
1578 q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl;
1579 iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
1580 iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl;
1581 corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl;
1582 pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl;
1583 px_1 = _px_1[i1]; ////cout << " px_1:" << px_1 << endl;
1584 py_1 = _py_1[i1]; ////cout << " py_1:" << py_1 << endl;
1585 pz_1 = _pz_1[i1]; ////cout << " pz_1:" << pz_1 << endl;
1586 dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl;
1589 for (int i2=0; i2<k2; i2++)
1591 ////cout << " i2:" << i2 << endl;
1592 id_2 = _id_2[i2]; ////cout << " id_2:" << id_2 << endl;
1593 if (id_1!=id_2) // exclude auto correlation
1595 q_2 = _charge_2[i2]; ////cout << " q_2:" << q_2 << endl;
1596 iEtaPhi_2 = _iEtaPhi_2[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl;
1597 iPt_2 = _iPt_2[i2]; ////cout << " iPt_2:" << iPt_2 << endl;
1598 corr_2 = _correction_2[i2]; ////cout << " corr_2:" << corr_2 << endl;
1599 pt_2 = _pt_2[i2]; ////cout << " pt_2:" << pt_2 << endl;
1600 px_2 = _px_2[i2]; ////cout << " px_2:" << px_2 << endl;
1601 py_2 = _py_2[i2]; ////cout << " py_2:" << py_2 << endl;
1602 pz_2 = _pz_2[i2]; ////cout << " pz_2:" << pz_2 << endl;
1603 dedx_2 = _dedx_2[i2]; ////cout << " dedx_2:" << dedx_2 << endl;
1606 if (_rejectPairConversion)
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);
1615 if (dedx_1>75. && dedx_2>75.)
1617 //_invMassElec->Fill(mInv);
1618 if (mInv<0.05) continue;
1623 corr = corr_1*corr_2;
1624 ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl;
1626 __n2_12_vsEtaPhi[ij] += corr;
1628 __s2ptpt_12 += corr*ptpt;
1629 __s2PtN_12 += corr*pt_1;
1630 __s2NPt_12 += corr*pt_2;
1631 __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
1632 __s2PtN_12_vsEtaPhi[ij] += corr*pt_1;
1633 __s2NPt_12_vsEtaPhi[ij] += corr*pt_2;
1634 __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
1636 __s2ptptNw_12 += ptpt;
1637 __s2PtNNw_12 += pt_1;
1638 __s2NPtNw_12 += pt_2;
1645 _n2_12_vsM->Fill(centrality, __n2_12);
1646 _s2PtPt_12_vsM->Fill(centrality, __s2ptpt_12);
1647 _s2PtN_12_vsM->Fill(centrality, __s2NPt_12);
1648 _s2NPt_12_vsM->Fill(centrality, __s2PtN_12);
1650 _n2Nw_12_vsM->Fill(centrality, __n2Nw_12);
1651 _s2PtPtNw_12_vsM->Fill(centrality, __s2ptptNw_12);
1652 _s2PtNNw_12_vsM->Fill(centrality, __s2NPtNw_12);
1653 _s2NPtNw_12_vsM->Fill(centrality, __s2PtNNw_12);
1658 AliInfo("AliAnalysisTaskDptDptCorrelations::UserExec() -----------------Event Done ");
1659 PostData(0,_outputHistoList);
1663 void AliAnalysisTaskDptDptCorrelations::FinishTaskOutput()
1665 AliInfo("AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Starting.");
1666 Printf("= 0 ====================================================================");
1667 finalizeHistograms();
1668 AliInfo("= 1 ====================================================================");
1669 PostData(0,_outputHistoList);
1670 AliInfo("= 2 ====================================================================");
1671 AliInfo("AliAnalysisTaskDptDptCorrelations::FinishTaskOutput() Done.");
1674 void AliAnalysisTaskDptDptCorrelations::Terminate(Option_t* /*option*/)
1676 AliInfo("AliAnalysisTaskDptDptCorrelations::Terminate() Starting/Done.");
1681 //===================================================================================================
1682 void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH1 * h, float * array, int size)
1685 float v1, ev1, v2, ev2, sum, esum;
1686 for (i=0, i1=1; i<size; ++i,++i1)
1688 v1 = array[i]; ev1 = sqrt(v1);
1689 v2 = h->GetBinContent(i1);
1690 ev2 = h->GetBinError(i1);
1692 esum = sqrt(ev1*ev1+ev2*ev2);
1693 h->SetBinContent(i1,sum);
1694 h->SetBinError(i1,esum);
1698 void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH2 * h, float * array, int size1, int size2)
1702 float v1, ev1, v2, ev2, sum, esum;
1703 for (i=0, i1=1; i<size1; ++i,++i1)
1705 for (j=0, j1=1; j<size2; ++j,++j1)
1707 v1 = array[i*size2+j]; ev1 = sqrt(v1);
1708 v2 = h->GetBinContent(i1,j1);
1709 ev2 = h->GetBinError(i1,j1);
1711 esum = sqrt(ev1*ev1+ev2*ev2);
1712 h->SetBinContent(i1,j1,sum);
1713 h->SetBinError(i1,j1,esum);
1718 void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH3 * h, float * array, int size1, int size2, int size3)
1723 float v1, ev1, v2, ev2, sum, esum;
1724 int size23 = size2*size3;
1725 for (i=0, i1=1; i<size1; ++i,++i1)
1727 for (j=0, j1=1; j<size2; ++j,++j1)
1729 for (k=0, k1=1; k<size3; ++k,++k1)
1731 v1 = array[i*size23+j*size3+k]; ev1 = sqrt(v1);
1732 v2 = h->GetBinContent(i1,j1,k1);
1733 ev2 = h->GetBinError(i1,j1,k1);
1735 esum = sqrt(ev1*ev1+ev2*ev2);
1736 h->SetBinContent(i1,j1,k1,sum);
1737 h->SetBinError(i1,j1,k1,esum);
1743 void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH1 * h, double * array, int size)
1746 double v1, ev1, v2, ev2, sum, esum;
1747 for (i=0, i1=1; i<size; ++i,++i1)
1749 v1 = array[i]; ev1 = sqrt(v1);
1750 v2 = h->GetBinContent(i1);
1751 ev2 = h->GetBinError(i1);
1753 esum = sqrt(ev1*ev1+ev2*ev2);
1754 h->SetBinContent(i1,sum);
1755 h->SetBinError(i1,esum);
1759 void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH2 * h, double * array, int size1, int size2)
1763 double v1, ev1, v2, ev2, sum, esum;
1764 for (i=0, i1=1; i<size1; ++i,++i1)
1766 for (j=0, j1=1; j<size2; ++j,++j1)
1768 v1 = array[i*size2+j]; ev1 = sqrt(v1);
1769 v2 = h->GetBinContent(i1,j1);
1770 ev2 = h->GetBinError(i1,j1);
1772 esum = sqrt(ev1*ev1+ev2*ev2);
1773 h->SetBinContent(i1,j1,sum);
1774 h->SetBinError(i1,j1,esum);
1779 void AliAnalysisTaskDptDptCorrelations::fillHistoWithArray(TH3 * h, double * array, int size1, int size2, int size3)
1784 double v1, ev1, v2, ev2, sum, esum;
1785 int size23 = size2*size3;
1786 for (i=0, i1=1; i<size1; ++i,++i1)
1788 for (j=0, j1=1; j<size2; ++j,++j1)
1790 for (k=0, k1=1; k<size3; ++k,++k1)
1792 v1 = array[i*size23+j*size3+k]; ev1 = sqrt(v1);
1793 v2 = h->GetBinContent(i1,j1,k1);
1794 ev2 = h->GetBinError(i1,j1,k1);
1796 esum = sqrt(ev1*ev1+ev2*ev2);
1797 h->SetBinContent(i1,j1,k1,sum);
1798 h->SetBinError(i1,j1,k1,esum);
1804 //________________________________________________________________________
1805 double * AliAnalysisTaskDptDptCorrelations::getDoubleArray(int size, double v)
1807 /// Allocate an array of type double with n values
1808 /// Initialize the array to the given value
1809 double * array = new double [size];
1810 for (int i=0;i<size;++i) array[i]=v;
1814 //________________________________________________________________________
1815 float * AliAnalysisTaskDptDptCorrelations::getFloatArray(int size, float v)
1817 /// Allocate an array of type float with n values
1818 /// Initialize the array to the given value
1819 float * array = new float [size];
1820 for (int i=0;i<size;++i) array[i]=v;
1825 //________________________________________________________________________
1826 TH1D * AliAnalysisTaskDptDptCorrelations::createHisto1D(const TString & name, const TString & title,
1827 int n, double xMin, double xMax,
1828 const TString & xTitle, const TString & yTitle)
1830 //CreateHisto new 1D historgram
1831 AliInfo(Form("createHisto 1D histo %s nBins: %d xMin: %f xMax: %f",name.Data(),n,xMin,xMax));
1832 TH1D * h = new TH1D(name,title,n,xMin,xMax);
1833 h->GetXaxis()->SetTitle(xTitle);
1834 h->GetYaxis()->SetTitle(yTitle);
1840 //________________________________________________________________________
1841 TH1D * AliAnalysisTaskDptDptCorrelations::createHisto1D(const TString & name, const TString & title,
1842 int n, double * bins,
1843 const TString & xTitle, const TString & yTitle)
1845 AliInfo(Form("createHisto 1D histo %s with %d non uniform nBins",name.Data(),n));
1846 TH1D * h = new TH1D(name,title,n,bins);
1847 h->GetXaxis()->SetTitle(xTitle);
1848 h->GetYaxis()->SetTitle(yTitle);
1854 //________________________________________________________________________
1855 TH2D * AliAnalysisTaskDptDptCorrelations::createHisto2D(const TString & name, const TString & title,
1856 int nx, double xMin, double xMax, int ny, double yMin, double yMax,
1857 const TString & xTitle, const TString & yTitle, const TString & zTitle)
1859 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));
1860 TH2D * h = new TH2D(name,title,nx,xMin,xMax,ny,yMin,yMax);
1861 h->GetXaxis()->SetTitle(xTitle);
1862 h->GetYaxis()->SetTitle(yTitle);
1863 h->GetZaxis()->SetTitle(zTitle);
1868 //________________________________________________________________________
1869 TH2D * AliAnalysisTaskDptDptCorrelations::createHisto2D(const TString & name, const TString & title,
1870 int nx, double* xbins, int ny, double yMin, double yMax,
1871 const TString & xTitle, const TString & yTitle, const TString & zTitle)
1873 AliInfo(Form("createHisto 2D histo %s with %d non uniform nBins",name.Data(),nx));
1875 h = new TH2D(name,title,nx,xbins,ny,yMin,yMax);
1876 h->GetXaxis()->SetTitle(xTitle);
1877 h->GetYaxis()->SetTitle(yTitle);
1878 h->GetZaxis()->SetTitle(zTitle);
1884 //________________________________________________________________________
1885 TH1F * AliAnalysisTaskDptDptCorrelations::createHisto1F(const TString & name, const TString & title,
1886 int n, double xMin, double xMax,
1887 const TString & xTitle, const TString & yTitle)
1889 //CreateHisto new 1D historgram
1890 AliInfo(Form("createHisto 1D histo %s nBins: %d xMin: %f xMax: %f",name.Data(),n,xMin,xMax));
1891 TH1F * h = new TH1F(name,title,n,xMin,xMax);
1892 h->GetXaxis()->SetTitle(xTitle);
1893 h->GetYaxis()->SetTitle(yTitle);
1899 //________________________________________________________________________
1900 TH1F * AliAnalysisTaskDptDptCorrelations::createHisto1F(const TString & name, const TString & title,
1901 int n, double * bins,
1902 const TString & xTitle, const TString & yTitle)
1904 AliInfo(Form("createHisto 1D histo %s with %d non uniform nBins",name.Data(),n));
1905 TH1F * h = new TH1F(name,title,n,bins);
1906 h->GetXaxis()->SetTitle(xTitle);
1907 h->GetYaxis()->SetTitle(yTitle);
1913 //________________________________________________________________________
1914 TH2F * AliAnalysisTaskDptDptCorrelations::createHisto2F(const TString & name, const TString & title,
1915 int nx, double xMin, double xMax, int ny, double yMin, double yMax,
1916 const TString & xTitle, const TString & yTitle, const TString & zTitle)
1918 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));
1919 TH2F * h = new TH2F(name,title,nx,xMin,xMax,ny,yMin,yMax);
1920 h->GetXaxis()->SetTitle(xTitle);
1921 h->GetYaxis()->SetTitle(yTitle);
1922 h->GetZaxis()->SetTitle(zTitle);
1927 //________________________________________________________________________
1928 TH2F * AliAnalysisTaskDptDptCorrelations::createHisto2F(const TString & name, const TString & title,
1929 int nx, double* xbins, int ny, double yMin, double yMax,
1930 const TString & xTitle, const TString & yTitle, const TString & zTitle)
1932 AliInfo(Form("createHisto 2D histo %s with %d non uniform nBins",name.Data(),nx));
1934 h = new TH2F(name,title,nx,xbins,ny,yMin,yMax);
1935 h->GetXaxis()->SetTitle(xTitle);
1936 h->GetYaxis()->SetTitle(yTitle);
1937 h->GetZaxis()->SetTitle(zTitle);
1943 //________________________________________________________________________
1944 TH3F * AliAnalysisTaskDptDptCorrelations::createHisto3F(const TString & name, const TString & title,
1945 int nx, double xMin, double xMax,
1946 int ny, double yMin, double yMax,
1947 int nz, double zMin, double zMax,
1948 const TString & xTitle, const TString & yTitle, const TString & zTitle)
1950 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));
1951 TH3F * h = new TH3F(name,title,nx,xMin,xMax,ny,yMin,yMax,nz,zMin,zMax);
1952 h->GetXaxis()->SetTitle(xTitle);
1953 h->GetYaxis()->SetTitle(yTitle);
1954 h->GetZaxis()->SetTitle(zTitle);
1960 //________________________________________________________________________
1961 TProfile * AliAnalysisTaskDptDptCorrelations::createProfile(const TString & name, const TString & description,
1962 int nx,double xMin,double xMax,
1963 const TString & xTitle, const TString & yTitle)
1965 AliInfo(Form("createHisto 1D profile %s nBins: %d xMin: %f10.4 xMax: %f10.4",name.Data(),nx,xMin,xMax));
1966 TProfile * h = new TProfile(name,description,nx,xMin,xMax);
1967 h->GetXaxis()->SetTitle(xTitle);
1968 h->GetYaxis()->SetTitle(yTitle);
1973 //________________________________________________________________________
1974 TProfile * AliAnalysisTaskDptDptCorrelations::createProfile(const TString & name,const TString & description,
1975 int nx, double* bins,
1976 const TString & xTitle, const TString & yTitle)
1978 AliInfo(Form("createHisto 1D profile %s with %d non uniform bins",name.Data(),nx));
1979 TProfile * h = new TProfile(name,description,nx,bins);
1980 h->GetXaxis()->SetTitle(xTitle);
1981 h->GetYaxis()->SetTitle(yTitle);
1987 void AliAnalysisTaskDptDptCorrelations::addToList(TH1 *h)
1989 if (_outputHistoList)
1991 _outputHistoList->Add(h);
1994 AliInfo("addToList(TH1 *h) _outputHistoList is null!!!!! Should abort ship");