updates from Claude
authoraadare <aadare@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 19:19:35 +0000 (19:19 +0000)
committeraadare <aadare@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 19:19:35 +0000 (19:19 +0000)
PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptCorrelations.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptCorrelations.h

index 8187438..c70532d 100644 (file)
@@ -904,67 +904,66 @@ void  AliAnalysisTaskDptDptCorrelations::createHistograms()
   //         2 :  number accepted by centrality cut and z cut
   //         3 :  total number of particles that satisfied filter 1
   //         4 :  total number of particles that satisfied filter 2
-  _eventAccounting      = createHisto(name,name,10, -0.5, 9.5, "event Code", _title_counts);
-  
-  name = "m0"; _m0      = createHisto(name,name,_nBins_M1, _min_M1, _max_M1, _title_m0, _title_counts);
-  name = "m1"; _m1      = createHisto(name,name,_nBins_M1, _min_M1, _max_M1, _title_m1, _title_counts);
-  name = "m2"; _m2      = createHisto(name,name,_nBins_M2, _min_M2, _max_M2, _title_m2, _title_counts);
-  name = "m3"; _m3      = createHisto(name,name,_nBins_M3, _min_M3, _max_M3, _title_m3, _title_counts);
-  name = "m4"; _m4      = createHisto(name,name,_nBins_M4, _min_M4, _max_M4, _title_m4, _title_counts);
-  name = "m5"; _m5      = createHisto(name,name,_nBins_M5, _min_M5, _max_M5, _title_m5, _title_counts);
-  name = "m6"; _m6      = createHisto(name,name,_nBins_M6, _min_M6, _max_M6, _title_m6, _title_counts);
-  name = "zV"; _vertexZ = createHisto(name,name,_nBins_vertexZ, _min_vertexZ, _max_vertexZ, "z-Vertex (cm)", _title_counts);
-  
-  AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Part 1 Histos");
-  
-  name = n1Name+part_1_Name+vsPt;              _n1_1_vsPt              = createHisto(name,name, _nBins_pt_1,  _min_pt_1,  _max_pt_1,   _title_pt_1,  _title_AvgN_1);
-  name = n1Name+part_1_Name+vsEtaPhi;          _n1_1_vsEtaVsPhi        = createHisto(name,name, _nBins_eta_1, _min_eta_1, _max_eta_1,  _nBins_phi_1, _min_phi_1, _max_phi_1,  _title_eta_1,  _title_phi_1,  _title_AvgN_1);
-  name = s1ptName+part_1_Name+vsEtaPhi;        _s1pt_1_vsEtaVsPhi      = createHisto(name,name, _nBins_eta_1, _min_eta_1, _max_eta_1,  _nBins_phi_1, _min_phi_1, _max_phi_1,  _title_eta_1,  _title_phi_1,  _title_AvgSumPt_1);
-  name = n1Name+part_1_Name+vsZ+vsEtaPhi+vsPt; _n1_1_vsZVsEtaVsPhiVsPt = createHisto(name,name, _nBins_vertexZ,_min_vertexZ,_max_vertexZ, _nBins_etaPhi_1, 0., double(_nBins_etaPhi_1), _nBins_pt_1, _min_pt_1, _max_pt_1, "zVertex", _title_etaPhi_1,  _title_pt_1);
-  name = n1Name+part_1_Name+vsM;               _n1_1_vsM               = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
-  name = s1ptName+part_1_Name+vsM;             _s1pt_1_vsM             = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
-  name = n1NwName+part_1_Name+vsM;             _n1Nw_1_vsM             = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
-  name = s1ptNwName+part_1_Name+vsM;           _s1ptNw_1_vsM           = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
-  name = "dedxVsP_1";                          _dedxVsP_1              = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
-  name = "corrDedxVsP_1";                      _corrDedxVsP_1          = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
-  name = "betaVsP_1";                          _betaVsP_1              = createHisto(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts");
-  
-  AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Part 2 Histos");
-  
-  name = n1Name+part_2_Name+vsPt;              _n1_2_vsPt              = createHisto(name,name, _nBins_pt_2,  _min_pt_2,  _max_pt_2,   _title_pt_2,  _title_AvgN_2);
-  name = n1Name+part_2_Name+vsEtaPhi;          _n1_2_vsEtaVsPhi        = createHisto(name,name, _nBins_eta_2, _min_eta_2, _max_eta_2,  _nBins_phi_2, _min_phi_2, _max_phi_2,  _title_eta_2,  _title_phi_2,  _title_AvgN_2);
-  name = s1ptName+part_2_Name+vsEtaPhi;        _s1pt_2_vsEtaVsPhi      = createHisto(name,name, _nBins_eta_2, _min_eta_2, _max_eta_2,  _nBins_phi_2, _min_phi_2, _max_phi_2,  _title_eta_2,  _title_phi_2,  _title_AvgSumPt_2);
-  name = n1Name+part_2_Name+vsZ+vsEtaPhi+vsPt; _n1_2_vsZVsEtaVsPhiVsPt = createHisto(name,name, _nBins_vertexZ,_min_vertexZ,_max_vertexZ, _nBins_etaPhi_2, 0., double(_nBins_etaPhi_2), _nBins_pt_2, _min_pt_2, _max_pt_2, "zVertex", _title_etaPhi_2,  _title_pt_2);
-  name = n1Name+part_2_Name + vsM;             _n1_2_vsM               = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_2);
-  name = s1ptName+part_2_Name + vsM;           _s1pt_2_vsM             = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_2);
-  name = n1NwName+part_2_Name+vsM;             _n1Nw_2_vsM             = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
-  name = s1ptNwName+part_2_Name+vsM;           _s1ptNw_2_vsM           = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
-  name = "dedxVsP_2";                          _dedxVsP_2              = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
-  name = "corrDedxVsP_2";                      _corrDedxVsP_2          = createHisto(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
-  name = "betaVsP_2";                          _betaVsP_2              = createHisto(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts");
-  
-  if (!_singlesOnly)
+  _eventAccounting      = createHisto1D(name,name,10, -0.5, 9.5, "event Code", _title_counts);
+  
+  name = "m0"; _m0      = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m0, _title_counts);
+  name = "m1"; _m1      = createHisto1D(name,name,_nBins_M1, _min_M1, _max_M1, _title_m1, _title_counts);
+  name = "m2"; _m2      = createHisto1D(name,name,_nBins_M2, _min_M2, _max_M2, _title_m2, _title_counts);
+  name = "m3"; _m3      = createHisto1D(name,name,_nBins_M3, _min_M3, _max_M3, _title_m3, _title_counts);
+  name = "m4"; _m4      = createHisto1D(name,name,_nBins_M4, _min_M4, _max_M4, _title_m4, _title_counts);
+  name = "m5"; _m5      = createHisto1D(name,name,_nBins_M5, _min_M5, _max_M5, _title_m5, _title_counts);
+  name = "m6"; _m6      = createHisto1D(name,name,_nBins_M6, _min_M6, _max_M6, _title_m6, _title_counts);
+  name = "zV"; _vertexZ = createHisto1D(name,name,_nBins_vertexZ, _min_vertexZ, _max_vertexZ, "z-Vertex (cm)", _title_counts);
+  
+  if (_singlesOnly)
     {
-    AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() Creating Pair Histos");
-    
-    name = n2Name+pair_12_Name+vsEtaPhi;       _n2_12_vsEtaPhi     = createHisto(name,name, _nBins_etaPhi_12, 0.,        double(_nBins_etaPhi_12), _title_etaPhi_12, _title_AvgN2_12);        
-    name = n2Name+pair_12_Name+vsPtVsPt;       _n2_12_vsPtVsPt     = createHisto(name,name, _nBins_pt_1, _min_pt_1, _max_pt_1, _nBins_pt_2, _min_pt_2, _max_pt_2, _title_pt_1, _title_pt_2, _title_AvgN2_12);        
-    name = s2PtPtName+pair_12_Name + vsEtaPhi; _s2PtPt_12_vsEtaPhi = createHisto(name,name, _nBins_etaPhi_12, 0.,        double(_nBins_etaPhi_12), _title_etaPhi_12,  _title_AvgSumPtPt_12);    
-    name = s2PtNName+pair_12_Name + vsEtaPhi;  _s2PtN_12_vsEtaPhi  = createHisto(name,name, _nBins_etaPhi_12, 0.,        double(_nBins_etaPhi_12), _title_etaPhi_12,  _title_AvgSumPtN_12);    
-    name = s2NPtName+pair_12_Name + vsEtaPhi;  _s2NPt_12_vsEtaPhi  = createHisto(name,name, _nBins_etaPhi_12, 0.,        double(_nBins_etaPhi_12), _title_etaPhi_12,  _title_AvgNSumPt_12);    
+    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);
+    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);
+    //name = "dedxVsP_1";                          _dedxVsP_1              = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
+    //name = "corrDedxVsP_1";                      _corrDedxVsP_1          = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
+    //name = "betaVsP_1";                          _betaVsP_1              = createHisto2F(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts");
+
+    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);
+    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);
+    //name = "dedxVsP_2";                          _dedxVsP_2              = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
+    //name = "corrDedxVsP_2";                      _corrDedxVsP_2          = createHisto2F(name,name,400,-2.,2.,120,0.,120.,"p (GeV/c)", "dedx", "counts");
+    //name = "betaVsP_2";                          _betaVsP_2              = createHisto2F(name,name,400,-2.,2.,120,0.5,1.1,"p (GeV/c)", "beta", "counts");
+
+    }
+  else
+    {
+    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);
+    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);
+    name = n1Name+part_1_Name+vsM;            _n1_1_vsM             = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
+    name = s1ptName+part_1_Name+vsM;          _s1pt_1_vsM           = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
+    name = n1NwName+part_1_Name+vsM;          _n1Nw_1_vsM           = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
+    name = s1ptNwName+part_1_Name+vsM;        _s1ptNw_1_vsM         = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
+
+    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);
+    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);
+    name = n1Name+part_2_Name + vsM;          _n1_2_vsM             = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_2);
+    name = s1ptName+part_2_Name + vsM;        _s1pt_2_vsM           = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_2);
+    name = n1NwName+part_2_Name+vsM;          _n1Nw_2_vsM           = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN_1);
+    name = s1ptNwName+part_2_Name+vsM;        _s1ptNw_2_vsM         = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPt_1);
+
+    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);        
+    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);    
+    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);    
+    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);    
+    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);        
     
-    name = n2Name+pair_12_Name + vsM;         _n2_12_vsM         = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12);        
-    name = s2PtPtName+pair_12_Name + vsM;     _s2PtPt_12_vsM     = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12);    
-    name = s2PtNName+pair_12_Name + vsM;      _s2PtN_12_vsM      = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12);       
-    name = s2NPtName+pair_12_Name + vsM;      _s2NPt_12_vsM      = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12);     
+    name = n2Name+pair_12_Name + vsM;         _n2_12_vsM            = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12);        
+    name = s2PtPtName+pair_12_Name + vsM;     _s2PtPt_12_vsM        = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12);    
+    name = s2PtNName+pair_12_Name + vsM;      _s2PtN_12_vsM         = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12);       
+    name = s2NPtName+pair_12_Name + vsM;      _s2NPt_12_vsM         = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12);     
     
-    name = n2NwName+pair_12_Name + vsM;         _n2Nw_12_vsM         = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12);        
-    name = s2PtPtNwName+pair_12_Name + vsM;     _s2PtPtNw_12_vsM     = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12);    
-    name = s2PtNNwName+pair_12_Name + vsM;      _s2PtNNw_12_vsM      = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12);       
-    name = s2NPtNwName+pair_12_Name + vsM;      _s2NPtNw_12_vsM      = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12);     
+    name = n2NwName+pair_12_Name + vsM;       _n2Nw_12_vsM          = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgN2_12);        
+    name = s2PtPtNwName+pair_12_Name + vsM;   _s2PtPtNw_12_vsM      = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtPt_12);    
+    name = s2PtNNwName+pair_12_Name + vsM;    _s2PtNNw_12_vsM       = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgSumPtN_12);       
+    name = s2NPtNwName+pair_12_Name + vsM;    _s2NPtNw_12_vsM       = createProfile(name,name, _nBins_M4, _min_M4, _max_M4, _title_m4, _title_AvgNSumPt_12);     
     
-    name = "mInv"; _invMass = createHisto(name,name, 500, 0., 1.000, "M_{inv}","counts"); 
-    name = "mInvElec"; _invMassElec = createHisto(name,name, 500, 0., 1.000, "M_{inv}","counts"); 
+    name = "mInv";     _invMass     = createHisto1F(name,name, 500, 0., 1.000, "M_{inv}","counts"); 
+    name = "mInvElec"; _invMassElec = createHisto1F(name,name, 500, 0., 1.000, "M_{inv}","counts"); 
     }
   
   AliInfo(" AliAnalysisTaskDptDptCorrelations::createHistoHistograms() All Done"); 
@@ -976,39 +975,46 @@ void  AliAnalysisTaskDptDptCorrelations::finalizeHistograms()
   
   AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms() starting");
   AliInfo(Form("CorrelationAnalyzers::finalizeHistograms()   _eventCount : %d",int(_eventCount)));
-  if (_sameFilter)
+  if (_singlesOnly)
     {
-    fillHistoWithArray(_n1_1_vsPt,              __n1_1_vsPt,        _nBins_pt_1);
-    fillHistoWithArray(_n1_1_vsEtaVsPhi,        __n1_1_vsEtaPhi,    _nBins_eta_1,   _nBins_phi_1);
-    fillHistoWithArray(_s1pt_1_vsEtaVsPhi,      __s1pt_1_vsEtaPhi,  _nBins_eta_1,   _nBins_phi_1);
-    fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
-    
-    fillHistoWithArray(_n1_2_vsPt,              __n1_1_vsPt,        _nBins_pt_1);
-    fillHistoWithArray(_n1_2_vsEtaVsPhi,        __n1_1_vsEtaPhi,    _nBins_eta_1,   _nBins_phi_1);
-    fillHistoWithArray(_s1pt_2_vsEtaVsPhi,      __s1pt_1_vsEtaPhi,  _nBins_eta_1,   _nBins_phi_1);
-    fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
+    if (_sameFilter)
+      {
+      fillHistoWithArray(_n1_1_vsPt,              __n1_1_vsPt,        _nBins_pt_1);
+      fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
+      fillHistoWithArray(_n1_2_vsPt,              __n1_1_vsPt,        _nBins_pt_1);
+      fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
+      }
+    else
+      {
+      fillHistoWithArray(_n1_1_vsPt,              __n1_1_vsPt,        _nBins_pt_1);
+      fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
+      fillHistoWithArray(_n1_2_vsPt,              __n1_2_vsPt,        _nBins_pt_2);
+      fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_2_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_2, _nBins_pt_2);
+      }
     }
   else
     {
-    fillHistoWithArray(_n1_1_vsPt,              __n1_1_vsPt,        _nBins_pt_1);
-    fillHistoWithArray(_n1_1_vsEtaVsPhi,        __n1_1_vsEtaPhi,    _nBins_eta_1,   _nBins_phi_1);
-    fillHistoWithArray(_s1pt_1_vsEtaVsPhi,      __s1pt_1_vsEtaPhi,  _nBins_eta_1,   _nBins_phi_1);
-    fillHistoWithArray(_n1_1_vsZVsEtaVsPhiVsPt, __n1_1_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_1, _nBins_pt_1);
-    
-    fillHistoWithArray(_n1_2_vsPt,              __n1_2_vsPt,        _nBins_pt_2);
-    fillHistoWithArray(_n1_2_vsEtaVsPhi,        __n1_2_vsEtaPhi,    _nBins_eta_2,   _nBins_phi_2);
-    fillHistoWithArray(_s1pt_2_vsEtaVsPhi,      __s1pt_2_vsEtaPhi,  _nBins_eta_2,   _nBins_phi_2);
-    fillHistoWithArray(_n1_2_vsZVsEtaVsPhiVsPt, __n1_2_vsZEtaPhiPt, _nBins_vertexZ, _nBins_etaPhi_2, _nBins_pt_2);
-    }
-  if (!_singlesOnly)
-    {
+    if (_sameFilter)
+      {
+      fillHistoWithArray(_n1_1_vsEtaVsPhi,        __n1_1_vsEtaPhi,    _nBins_eta_1,   _nBins_phi_1);
+      fillHistoWithArray(_s1pt_1_vsEtaVsPhi,      __s1pt_1_vsEtaPhi,  _nBins_eta_1,   _nBins_phi_1);
+      fillHistoWithArray(_n1_2_vsEtaVsPhi,        __n1_1_vsEtaPhi,    _nBins_eta_1,   _nBins_phi_1);
+      fillHistoWithArray(_s1pt_2_vsEtaVsPhi,      __s1pt_1_vsEtaPhi,  _nBins_eta_1,   _nBins_phi_1);
+      }
+    else
+      {
+      fillHistoWithArray(_n1_1_vsEtaVsPhi,        __n1_1_vsEtaPhi,    _nBins_eta_1,   _nBins_phi_1);
+      fillHistoWithArray(_s1pt_1_vsEtaVsPhi,      __s1pt_1_vsEtaPhi,  _nBins_eta_1,   _nBins_phi_1);
+      fillHistoWithArray(_n1_2_vsEtaVsPhi,        __n1_2_vsEtaPhi,    _nBins_eta_2,   _nBins_phi_2);
+      fillHistoWithArray(_s1pt_2_vsEtaVsPhi,      __s1pt_2_vsEtaPhi,  _nBins_eta_2,   _nBins_phi_2);
+      }
     fillHistoWithArray(_n2_12_vsEtaPhi,     __n2_12_vsEtaPhi,     _nBins_etaPhi_12);
     fillHistoWithArray(_s2PtPt_12_vsEtaPhi, __s2ptpt_12_vsEtaPhi, _nBins_etaPhi_12);
     fillHistoWithArray(_s2PtN_12_vsEtaPhi,  __s2PtN_12_vsEtaPhi,  _nBins_etaPhi_12);
     fillHistoWithArray(_s2NPt_12_vsEtaPhi,  __s2NPt_12_vsEtaPhi,  _nBins_etaPhi_12);
-    fillHistoWithArray(_n2_12_vsPtVsPt,     __n2_12_vsPtPt,  _nBins_pt_1, _nBins_pt_2);
-    }
-  
+    fillHistoWithArray(_n2_12_vsPtVsPt,     __n2_12_vsPtPt,       _nBins_pt_1,    _nBins_pt_2);
+
+    }  
   AliInfo("AliAnalysisTaskDptDptCorrelations::finalizeHistograms()  Done ");
 }
 //--------------//
@@ -1019,7 +1025,7 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
   
   int    k1,k2;
   int    iPhi, iEta, iEtaPhi, iPt, charge;
-  float  q, p, phi, pt, eta, corr, dedx, px, py, pz;
+  float  q, p, phi, pt, eta, corr, corrPt, dedx, px, py, pz;
   int    ij;
   int    id_1, q_1, iEtaPhi_1, iPt_1;
   float  pt_1, px_1, py_1, pz_1, corr_1, dedx_1;
@@ -1038,45 +1044,32 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
   // count all events looked at here
   _eventCount++;
 
-  /*
-  if (!_eventAccounting)
-  {
-    cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - !_eventAccounting" << endl;
-    cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - Skip this task" << endl;
-    return;
-  }
-  _eventAccounting->Fill(0);// count all calls to this function
-  */
-
   // A. Adare - Fix from above to avoid coverity complaint about null dereference 
   if (_eventAccounting)
     {
       _eventAccounting->Fill(0);// count all calls to this function
     }
-  else {
+  else 
+    {
     cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - !_eventAccounting" << endl;
     cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - Skip this task" << endl;
     return;
-  }
+    }
     
   //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 1" << endl;
   
   //Get pointer to current event
-  fESDEvent = dynamic_cast<AliESDEvent*> (InputEvent());
+  //fESDEvent = dynamic_cast<AliESDEvent*> (InputEvent());
   fAODEvent = dynamic_cast<AliAODEvent*> (InputEvent());
   
-  ////cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 2" << endl;
-  
-  if(!fAODEvent && !fESDEvent)
+  //  if(!fAODEvent && !fESDEvent)
+  if(!fAODEvent)
     {
-    AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) !fAODEvent && !fESDEvent ");;
+    AliError("AliAnalysisTaskDptDptCorrelations::Exec(Option_t *option) !fAODEvent");
     return;
     }
   
   _eventAccounting->Fill(1);// count all calls to this function with a valid pointer
-  
-  //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 3" << endl;
-  
   //reset single particle counters
   k1 = k2 = 0;
   __n1_1 = __n1_2 = __s1pt_1 = __s1pt_2 = __n1Nw_1 = __n1Nw_2 = __s1ptNw_1 = __s1ptNw_2 = 0;
@@ -1095,8 +1088,6 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
   float dcaXY    = -999;
   float centrality = -999;
   
-  //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 4" << endl;
-  
   if(fAODEvent)
     {
     //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 5" << endl;
@@ -1116,9 +1107,9 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
     //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 8" << endl;
     
     _nTracks  = fAODEvent->GetNTracks();
-    _mult0    = 0;
-    _mult1    = 0;
-    _mult2    = 0;
+    //_mult0    = 0;
+    //_mult1    = 0;
+    //_mult2    = 0;
     _mult3    = _nTracks; 
     _mult4    = v0Centr;
     _mult5    = trkCentr;
@@ -1142,8 +1133,7 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
     //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 10" << endl;
     
     //filter on centrality
-    if ( centrality < _centralityMin ||
-        centrality > _centralityMax)
+    if ( centrality < _centralityMin ||  centrality > _centralityMax)
       {
       //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 11" << endl;
       
@@ -1168,15 +1158,6 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
         vertexZ = vertex->GetZ();
         vertexXY = sqrt(vertexX*vertexX+vertexY*vertexY);
       }
-    //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 13" << endl;
-    
-    //cout << "vertexZ : " << vertexZ  << endl;
-    //cout << "vertexXY: " << vertexXY << endl;
-    //cout << "_vertexZMin: " << _vertexZMin << endl;
-    //cout << "_vertexZMax: " << _vertexZMax << endl;
-    //cout << "_vertexXYMin: " << _vertexXYMin << endl;
-    //cout << "_vertexXYMax: " << _vertexXYMax << endl;
-    
     if (!vertex ||
         vertexZ  < _vertexZMin  || 
         vertexZ  > _vertexZMax  ||
@@ -1184,9 +1165,6 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
         vertexXY > _vertexXYMax)
       return;
     
-    
-    //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 14" << endl;
-    
     iVertex = int((vertexZ-_min_vertexZ)/_width_vertexZ);
     iVertexP1 = iVertex*_nBins_etaPhiPt_1;
     iVertexP2 = iVertex*_nBins_etaPhiPt_2;
@@ -1196,8 +1174,6 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
       return;
       }
     _eventAccounting->Fill(3);// count all calls to this function with a valid pointer
-    //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 15" << endl;
-    
     
     // loop over all particles for singles
     //debug() << "_nTracks:"<< _nTracks << endl;
@@ -1232,15 +1208,16 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
       //cout << "  eta:" << eta  << " _min_eta_1:" << _min_eta_1 << " _max_eta_1:" << _max_eta_1<< endl;
       //cout << " dedx:" << dedx << " _dedxMin:" << _dedxMin << " _dedxMax:" << _dedxMax << endl;
       //cout << "nclus:" << nClus<< " _nClusterMin:" << _nClusterMin << endl;
-      if (bitOK &&
-          _requestedCharge_1 == charge &&
+      
+      //common cuts first
+      
+      if (!bitOK || dedx<_dedxMin || dedx>_dedxMax || nClus<_nClusterMin) continue;
+      //Particle 1
+      if (_requestedCharge_1 == charge &&
           pt       >=  _min_pt_1 && 
           pt       <   _max_pt_1 && 
           eta      >=  _min_eta_1 && 
-          eta      <   _max_eta_1 && 
-          dedx     >=  _dedxMin &&
-          dedx     <   _dedxMax &&
-          nClus    >=  _nClusterMin) 
+          eta      <   _max_eta_1) 
         {
         //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - check vertex  for 1:" << endl;
         // Get the dca information
@@ -1299,47 +1276,48 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
           }
         //cout << "all good; process track:" << endl;
 
-        _id_1[k1]                   = iTrack;     
-        _charge_1[k1]               = charge;
-        _iEtaPhi_1[k1]              = iEtaPhi; 
-        _iPt_1[k1]                  = iPt;   
-        _pt_1[k1]                   = pt;   
-        _px_1[k1]                   = px;   
-        _py_1[k1]                   = py;   
-        _pz_1[k1]                   = pz;   
-        _correction_1[k1]           = corr; 
-        __n1_1                      += corr;
-        __n1_1_vsEtaPhi[iEtaPhi]    += corr; 
-        __n1_1_vsZEtaPhiPt[iZEtaPhiPt] += corr;
-        __s1pt_1                    += corr*pt;
-        __s1pt_1_vsEtaPhi[iEtaPhi]  += corr*pt;
-        __n1_1_vsPt[iPt]            += corr;
-        __n1Nw_1                    += 1;
-        __s1ptNw_1                  += pt;
-        
-        //_betaVsP_1->Fill(p*q,_trackFilter_1->getBeta() );
-        _dedxVsP_1->Fill(p*q,dedx);
-        //_corrDedxVsP_1->Fill(p*q,_trackFilter_1->getCorrectedDedx() );
-        
-        
-        ++k1;
-        if (k1>=arraySize)
+        if (_singlesOnly)
           {
-          AliError(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) k1 >=arraySize; arraySize: %d",arraySize));
-          return;
+          //_betaVsP_1->Fill(p*q,_trackFilter_1->getBeta() );
+          //_dedxVsP_1->Fill(p*q,dedx);
+          //_corrDedxVsP_1->Fill(p*q,_trackFilter_1->getCorrectedDedx() );
+          __n1_1_vsPt[iPt]               += corr;          //cout << "step 15" << endl;
+          __n1_1_vsZEtaPhiPt[iZEtaPhiPt] += corr;       //cout << "step 12" << endl;
+   
+          }
+        else
+          {
+          corrPt                      = corr*pt;
+          _id_1[k1]                   = iTrack;     
+          _charge_1[k1]               = charge;
+          _iEtaPhi_1[k1]              = iEtaPhi; 
+          _iPt_1[k1]                  = iPt;   
+          _pt_1[k1]                   = pt;   
+          _px_1[k1]                   = px;   
+          _py_1[k1]                   = py;   
+          _pz_1[k1]                   = pz;   
+          _correction_1[k1]           = corr; 
+          __n1_1                      += corr;
+          __n1_1_vsEtaPhi[iEtaPhi]    += corr; 
+          __s1pt_1                    += corrPt;
+          __s1pt_1_vsEtaPhi[iEtaPhi]  += corrPt;
+          __n1Nw_1                    += 1;
+          __s1ptNw_1                  += pt;
+          ++k1;
+          if (k1>=arraySize)
+            {
+            AliError(Form("AliAnalysisTaskDptDptCorrelations::analyze(AliceEvent * event) k1 >=arraySize; arraySize: %d",arraySize));
+            return;
+            }
           }
         }
       
       if (!_sameFilter &&
-          bitOK && 
           _requestedCharge_2 == charge &&
           pt       >=  _min_pt_2 && 
           pt       <   _max_pt_2 && 
           eta      >=  _min_eta_2 && 
-          eta      <   _max_eta_2 && 
-          dedx     >=  _dedxMin &&
-          dedx     <   _dedxMax &&
-          nClus    >=  _nClusterMin)  
+          eta      <   _max_eta_2)  
         {
         // Get the dca information
         //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - check vertex for 2:" << endl;
@@ -1401,76 +1379,43 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
           corr = 1;
         //dpt = pt - (charge>0) ? _avgPt_vsEtaPhi_2p[iEtaPhi] : _avgPt_vsEtaPhi_2m[iEtaPhi];       
 
-        //cout << " k2:" << k2 << endl;
-        //cout << "iZEtaPhiPt: " << iZEtaPhiPt << endl;
-        //cout << "iEtaPhi:" << iEtaPhi << endl;
-        _id_2[k2]                   = iTrack;     
-        //cout << "step 1" << endl;
-        _charge_2[k2]               = charge;
-        //cout << "step 2" << endl;
-        _iEtaPhi_2[k2]              = iEtaPhi; 
-        //cout << "step 3" << endl;
-        _iPt_2[k2]                  = iPt;   
-        //cout << "step 4" << endl;
-        _pt_2[k2]                   = pt;   
-        //cout << "step 5" << endl;
-        _px_2[k2]                   = px;   
-        //cout << "step 6" << endl;
-        _py_2[k2]                   = py;   
-        //cout << "step 7" << endl;
-        _pz_2[k2]                   = pz;   
-        //cout << "step 8" << endl;
-        _correction_2[k2]           = corr; 
-        //cout << "step 9" << endl;
-        __n1_2                      += corr;
-        //cout << "step 10" << endl;
-        __n1_2_vsEtaPhi[iEtaPhi]    += corr; 
-        //cout << "step 11" << endl;
-        __n1_2_vsZEtaPhiPt[iZEtaPhiPt] += corr;
-        //cout << "step 12" << endl;
-        __s1pt_2                    += corr*pt;
-        //cout << "step 13" << endl;
-        __s1pt_2_vsEtaPhi[iEtaPhi]  += corr*pt;
-        //cout << "step 14" << endl;
-        __n1_2_vsPt[iPt]            += corr;
-        //cout << "step 15" << endl;
-        
-        __n1Nw_2                    += 1;
-        __s1ptNw_2                  += pt;
-
-        //cout << " data stored:" << endl;
-
-        //_betaVsP_2->Fill(p*q,_trackFilter_2->getBeta() );
-        if (!_dedxVsP_2) {
-          //cout << "_dedxVsP_2 does not exist...." << endl;
-          continue;
-        }
-        //cout << " fill histo _dedxVsP_2" << endl;
-
-        _dedxVsP_2->Fill(p*q,dedx);
-        //_corrDedxVsP_2->Fill(p*q,_trackFilter_2->getCorrectedDedx() );
-        ++k2;
-        //cout << " k2 incremented:" << endl;
-        if (k2>=arraySize)
+        if (_singlesOnly)
           {
-          AliWarning(Form("-W- k2 >=arraySize; arraySize: %d",arraySize)); 
-          return;
+          //_dedxVsP_2->Fill(p*q,dedx);
+          __n1_2_vsPt[iPt]               += corr;          //cout << "step 15" << endl;
+          __n1_2_vsZEtaPhiPt[iZEtaPhiPt] += corr;       //cout << "step 12" << endl;
+          }
+        else
+          {
+          corrPt                      = corr*pt;
+          _id_2[k2]                   = iTrack;         //cout << "step 1" << endl;
+          _charge_2[k2]               = charge;         //cout << "step 2" << endl;
+          _iEtaPhi_2[k2]              = iEtaPhi;        //cout << "step 3" << endl;
+          _iPt_2[k2]                  = iPt;            //cout << "step 4" << endl;
+          _pt_2[k2]                   = pt;             //cout << "step 5" << endl;
+          _px_2[k2]                   = px;             //cout << "step 6" << endl;
+          _py_2[k2]                   = py;             //cout << "step 7" << endl;
+          _pz_2[k2]                   = pz;             //cout << "step 8" << endl;
+          _correction_2[k2]           = corr;           //cout << "step 9" << endl;
+          __n1_2                      += corr;          //cout << "step 10" << endl;
+          __s1pt_2                    += corrPt;        //cout << "step 13" << endl;
+          __n1Nw_2                    += 1;
+          __n1_2_vsEtaPhi[iEtaPhi]    += corr;          //cout << "step 11" << endl;
+          __s1pt_2_vsEtaPhi[iEtaPhi]  += corrPt;        //cout << "step 14" << endl;
+          __s1ptNw_2                  += pt;
+          ++k2;
+          if (k2>=arraySize)
+            {
+            AliWarning(Form("-W- k2 >=arraySize; arraySize: %d",arraySize)); 
+            return;
+            }
           }
-        }
       
       //cout << "done with track" << endl;
       } //iTrack
-    
-    } //aod
-  
-  
-  else if (fESDEvent)
-    {
-    //AliCentrality* centrality = esdEvent->GetCentrality();
-    //Float_t centV0 = centrality->GetCentralityPercentile("V0M");
-    //Float_t centTrk = centrality->GetCentralityPercentile("TRK");
-    //Float_t centSPD = centrality->GetCentralityPercentile("CL1");
+    } //aod 
     }
+
   
   //cout << "Filling histograms now" << endl;
   _m0->Fill(_mult0);
@@ -1481,92 +1426,150 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
   _m5->Fill(_mult5);
   _m6->Fill(_mult6);
   _vertexZ->Fill(vertexZ);
-  _n1_1_vsM->Fill(_mult4,      __n1_1);
-  _s1pt_1_vsM->Fill(_mult4,    __s1pt_1);
-  _n1Nw_1_vsM->Fill(_mult4,    __n1Nw_1);
-  _s1ptNw_1_vsM->Fill(_mult4,  __s1ptNw_1);
-  if (_sameFilter)
+      
+  if (_singlesOnly)
     {
-    _n1_2_vsM->Fill(_mult4,    __n1_1);
-    _s1pt_2_vsM->Fill(_mult4,  __s1pt_1);
-    _n1Nw_2_vsM->Fill(_mult4,  __n1Nw_1);
-    _s1ptNw_2_vsM->Fill(_mult4,__s1ptNw_1);
+    // nothing to do here.
     }
   else
     {
-    _n1_2_vsM->Fill(_mult4,      __n1_2);
-    _s1pt_2_vsM->Fill(_mult4,    __s1pt_2);
-    _n1Nw_2_vsM->Fill(_mult4,    __n1Nw_2);
-    _s1ptNw_2_vsM->Fill(_mult4,  __s1ptNw_2);
-    }
-  
-  //if singels only selected, do not fill pair histograms.
-  if (_singlesOnly) return;
-  
-  // reset pair counters
-  __n2_12   = __s2ptpt_12   = __s2NPt_12    = __s2PtN_12    = 0;
-  __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12  = __s2PtNNw_12  = 0;
-  
-  //info() <<" singles done" << endl;
-  if (_sameFilter) // filter 1 and 2 are the same -- only do pairs i<j
-    {
-    if (_field>0)
+    if (_sameFilter)
       {
-      for (int i1=0; i1<k1; i1++)
+      _n1_1_vsM->Fill(centrality,      __n1_1);
+      _s1pt_1_vsM->Fill(centrality,    __s1pt_1);
+      _n1Nw_1_vsM->Fill(centrality,    __n1Nw_1);
+      _s1ptNw_1_vsM->Fill(centrality,  __s1ptNw_1);
+      _n1_2_vsM->Fill(centrality,      __n1_1);
+      _s1pt_2_vsM->Fill(centrality,    __s1pt_1);
+      _n1Nw_2_vsM->Fill(centrality,    __n1Nw_1);
+      _s1ptNw_2_vsM->Fill(centrality,  __s1ptNw_1);
+      // reset pair counters
+      __n2_12   = __s2ptpt_12   = __s2NPt_12    = __s2PtN_12    = 0;
+      __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12  = __s2PtNNw_12  = 0;
+      if (_field>0)
         {
-        ////cout << "         i1:" << i1 << endl;
-        id_1      = _id_1[i1];           ////cout << "       id_1:" << id_1 << endl;
-        q_1       = _charge_1[i1];       ////cout << "        q_1:" << q_1 << endl;
-        iEtaPhi_1 = _iEtaPhi_1[i1];      ////cout << "  iEtaPhi_1:" << iEtaPhi_1 << endl;
-        iPt_1     = _iPt_1[i1];          ////cout << "      iPt_1:" << iPt_1 << endl;
-        corr_1    = _correction_1[i1];   ////cout << "     corr_1:" << corr_1 << endl;
-        pt_1      = _pt_1[i1];           ////cout << "       pt_1:" << pt_1 << endl;
-        dedx_1    = _dedx_1[i1];         ////cout << "     dedx_1:" << dedx_1 << endl;
-                                         //1 and 2
-        for (int i2=i1+1; i2<k1; i2++)
-          {        
-            ////cout << "         i2:" << i2 << endl;
-            id_2      = _id_1[i2];              ////cout << "       id_2:" << id_2 << endl;
-            if (id_1!=id_2)
-              {
-              q_2       = _charge_1[i2];     ////cout << "        q_1:" << q_1 << endl;
-              iEtaPhi_2 = _iEtaPhi_1[i2];    ////cout << "  iEtaPhi_1:" << iEtaPhi_1 << endl;
-              iPt_2     = _iPt_1[i2];        ////cout << "      iPt_1:" << iPt_1 << endl;
-              corr_2    = _correction_1[i2]; ////cout << "     corr_1:" << corr_1 << endl;
-              pt_2      = _pt_1[i2];         ////cout << "       pt_1:" << pt_1 << endl;
-              dedx_2    = _dedx_1[i2];       ////cout << "     dedx_2:" << dedx_2 << endl;
-              corr      = corr_1*corr_2;
-              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))
+        for (int i1=0; i1<k1; i1++)
+          {
+          ////cout << "         i1:" << i1 << endl;
+          id_1      = _id_1[i1];           ////cout << "       id_1:" << id_1 << endl;
+          q_1       = _charge_1[i1];       ////cout << "        q_1:" << q_1 << endl;
+          iEtaPhi_1 = _iEtaPhi_1[i1];      ////cout << "  iEtaPhi_1:" << iEtaPhi_1 << endl;
+          iPt_1     = _iPt_1[i1];          ////cout << "      iPt_1:" << iPt_1 << endl;
+          corr_1    = _correction_1[i1];   ////cout << "     corr_1:" << corr_1 << endl;
+          pt_1      = _pt_1[i1];           ////cout << "       pt_1:" << pt_1 << endl;
+          dedx_1    = _dedx_1[i1];         ////cout << "     dedx_1:" << dedx_1 << endl;
+                                           //1 and 2
+          for (int i2=i1+1; i2<k1; i2++)
+            {        
+              ////cout << "         i2:" << i2 << endl;
+              id_2      = _id_1[i2];              ////cout << "       id_2:" << id_2 << endl;
+              if (id_1!=id_2)
                 {
-                ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2;   ////cout << " ij:" << ij<< endl;
+                q_2       = _charge_1[i2];     ////cout << "        q_1:" << q_1 << endl;
+                iEtaPhi_2 = _iEtaPhi_1[i2];    ////cout << "  iEtaPhi_1:" << iEtaPhi_1 << endl;
+                iPt_2     = _iPt_1[i2];        ////cout << "      iPt_1:" << iPt_1 << endl;
+                corr_2    = _correction_1[i2]; ////cout << "     corr_1:" << corr_1 << endl;
+                pt_2      = _pt_1[i2];         ////cout << "       pt_1:" << pt_1 << endl;
+                dedx_2    = _dedx_1[i2];       ////cout << "     dedx_2:" << dedx_2 << endl;
+                corr      = corr_1*corr_2;
+                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))
+                  {
+                  ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2;   ////cout << " ij:" << ij<< endl;
+                  }
+                else // swap particles
+                  {
+                  ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1;   ////cout << " ij:" << ij<< endl;
+                  }
+                
+                __n2_12                  += corr;
+                __n2_12_vsEtaPhi[ij]     += corr;
+                ptpt                     = pt_1*pt_2;
+                __s2ptpt_12              += corr*ptpt;
+                __s2PtN_12               += corr*pt_1;
+                __s2NPt_12               += corr*pt_2;
+                __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
+                __s2PtN_12_vsEtaPhi[ij]  += corr*pt_1;
+                __s2NPt_12_vsEtaPhi[ij]  += corr*pt_2;
+                __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
+                
+                __n2Nw_12                  += 1;
+                __s2ptptNw_12              += ptpt;
+                __s2PtNNw_12               += pt_1;
+                __s2NPtNw_12               += pt_2;
+                
                 }
-              else // swap particles
+            } //i2       
+          } //i1       
+        }
+      else // field<0
+        {
+        for (int i1=0; i1<k1; i1++)
+          {
+          ////cout << "         i1:" << i1 << endl;
+          id_1      = _id_1[i1];           ////cout << "       id_1:" << id_1 << endl;
+          q_1       = _charge_1[i1];       ////cout << "        q_1:" << q_1 << endl;
+          iEtaPhi_1 = _iEtaPhi_1[i1];      ////cout << "  iEtaPhi_1:" << iEtaPhi_1 << endl;
+          iPt_1     = _iPt_1[i1];          ////cout << "      iPt_1:" << iPt_1 << endl;
+          corr_1    = _correction_1[i1];   ////cout << "     corr_1:" << corr_1 << endl;
+          pt_1      = _pt_1[i1];           ////cout << "       pt_1:" << pt_1 << endl;
+          dedx_1    = _dedx_1[i1];         ////cout << "     dedx_1:" << dedx_1 << endl;
+                                           //1 and 2
+          for (int i2=i1+1; i2<k1; i2++)
+            {        
+              ////cout << "         i2:" << i2 << endl;
+              id_2      = _id_1[i2];              ////cout << "       id_2:" << id_2 << endl;
+              if (id_1!=id_2)
                 {
-                ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1;   ////cout << " ij:" << ij<< endl;
+                q_2       = _charge_1[i2];     ////cout << "        q_2:" << q_2 << endl;
+                iEtaPhi_2 = _iEtaPhi_1[i2];    ////cout << "  iEtaPhi_2:" << iEtaPhi_2 << endl;
+                iPt_2     = _iPt_1[i2];        ////cout << "      iPt_2:" << iPt_2 << endl;
+                corr_2    = _correction_1[i2]; ////cout << "     corr_2:" << corr_2 << endl;
+                pt_2      = _pt_1[i2];         ////cout << "       pt_2:" << pt_2 << endl;
+                dedx_2    = _dedx_1[i2];       ////cout << "     dedx_2:" << dedx_2 << endl;
+                corr      = corr_1*corr_2;
+                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))
+                  {
+                  ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2;   ////cout << " ij:" << ij<< endl;
+                  }
+                else // swap particles
+                  {
+                  ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1;   ////cout << " ij:" << ij<< endl;
+                  }
+                
+                __n2_12                  += corr;
+                __n2_12_vsEtaPhi[ij]     += corr;
+                ptpt                     = pt_1*pt_2;
+                __s2ptpt_12              += corr*ptpt;
+                __s2PtN_12               += corr*pt_1;
+                __s2NPt_12               += corr*pt_2;
+                __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
+                __s2PtN_12_vsEtaPhi[ij]  += corr*pt_1;
+                __s2NPt_12_vsEtaPhi[ij]  += corr*pt_2;
+                __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
+                
+                __n2Nw_12                  += 1;
+                __s2ptptNw_12              += ptpt;
+                __s2PtNNw_12               += pt_1;
+                __s2NPtNw_12               += pt_2;
+                
                 }
-              
-              __n2_12                  += corr;
-              __n2_12_vsEtaPhi[ij]     += corr;
-              ptpt                     = pt_1*pt_2;
-              __s2ptpt_12              += corr*ptpt;
-              __s2PtN_12               += corr*pt_1;
-              __s2NPt_12               += corr*pt_2;
-              __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
-              __s2PtN_12_vsEtaPhi[ij]  += corr*pt_1;
-              __s2NPt_12_vsEtaPhi[ij]  += corr*pt_2;
-              __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
-              
-              __n2Nw_12                  += 1;
-              __s2ptptNw_12              += ptpt;
-              __s2PtNNw_12               += pt_1;
-              __s2NPtNw_12               += pt_2;
-              
-              }
-          } //i2       
-        } //i1       
+            } //i2       
+          } //i1  
+        }
       }
-    else // field<0
+    else  // filter 1 and 2 are different -- must do all particle pairs...
       {
+      _n1_1_vsM->Fill(centrality,      __n1_1);
+      _s1pt_1_vsM->Fill(centrality,    __s1pt_1);
+      _n1Nw_1_vsM->Fill(centrality,    __n1Nw_1);
+      _s1ptNw_1_vsM->Fill(centrality,  __s1ptNw_1);
+      _n1_2_vsM->Fill(centrality,      __n1_2);
+      _s1pt_2_vsM->Fill(centrality,    __s1pt_2);
+      _n1Nw_2_vsM->Fill(centrality,    __n1Nw_2);
+      _s1ptNw_2_vsM->Fill(centrality,  __s1ptNw_2);
+      // reset pair counters
+      __n2_12   = __s2ptpt_12   = __s2NPt_12    = __s2PtN_12    = 0;
+      __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12  = __s2PtNNw_12  = 0;
       for (int i1=0; i1<k1; i1++)
         {
         ////cout << "         i1:" << i1 << endl;
@@ -1576,30 +1579,45 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
         iPt_1     = _iPt_1[i1];          ////cout << "      iPt_1:" << iPt_1 << endl;
         corr_1    = _correction_1[i1];   ////cout << "     corr_1:" << corr_1 << endl;
         pt_1      = _pt_1[i1];           ////cout << "       pt_1:" << pt_1 << endl;
-        dedx_1    = _dedx_1[i1];         ////cout << "     dedx_1:" << dedx_1 << endl;
-                                         //1 and 2
-        for (int i2=i1+1; i2<k1; i2++)
+        px_1      = _px_1[i1];          ////cout << "      px_1:" << px_1 << endl;
+        py_1      = _py_1[i1];          ////cout << "      py_1:" << py_1 << endl;
+        pz_1      = _pz_1[i1];          ////cout << "      pz_1:" << pz_1 << endl;
+        dedx_1    = _dedx_1[i1];        ////cout << "     dedx_1:" << dedx_1 << endl;
+        
+        //1 and 2
+        for (int i2=0; i2<k2; i2++)
           {        
             ////cout << "         i2:" << i2 << endl;
-            id_2      = _id_1[i2];              ////cout << "       id_2:" << id_2 << endl;
-            if (id_1!=id_2)
+            id_2   = _id_2[i2];              ////cout << "       id_2:" << id_2 << endl;
+            if (id_1!=id_2)  // exclude auto correlation
               {
-              q_2       = _charge_1[i2];     ////cout << "        q_2:" << q_2 << endl;
-              iEtaPhi_2 = _iEtaPhi_1[i2];    ////cout << "  iEtaPhi_2:" << iEtaPhi_2 << endl;
-              iPt_2     = _iPt_1[i2];        ////cout << "      iPt_2:" << iPt_2 << endl;
-              corr_2    = _correction_1[i2]; ////cout << "     corr_2:" << corr_2 << endl;
-              pt_2      = _pt_1[i2];         ////cout << "       pt_2:" << pt_2 << endl;
-              dedx_2    = _dedx_1[i2];       ////cout << "     dedx_2:" << dedx_2 << endl;
-              corr      = corr_1*corr_2;
-              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))
-                {
-                ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2;   ////cout << " ij:" << ij<< endl;
-                }
-              else // swap particles
+              q_2       = _charge_2[i2];     ////cout << "        q_2:" << q_2 << endl;
+              iEtaPhi_2 = _iEtaPhi_2[i2];    ////cout << "  iEtaPhi_2:" << iEtaPhi_2 << endl;
+              iPt_2     = _iPt_2[i2];        ////cout << "      iPt_2:" << iPt_2 << endl;
+              corr_2    = _correction_2[i2]; ////cout << "     corr_2:" << corr_2 << endl;
+              pt_2      = _pt_2[i2];         ////cout << "       pt_2:" << pt_2 << endl;
+              px_2      = _px_2[i2];          ////cout << "      px_2:" << px_2 << endl;
+              py_2      = _py_2[i2];          ////cout << "      py_2:" << py_2 << endl;
+              pz_2      = _pz_2[i2];          ////cout << "      pz_2:" << pz_2 << endl;
+              dedx_2    = _dedx_2[i2];        ////cout << "     dedx_2:" << dedx_2 << endl;
+              if (_rejectPairConversion)
                 {
-                ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1;   ////cout << " ij:" << ij<< endl;
+                float e1Sq = massElecSq + pt_1*pt_1 + pz_1*pz_1;
+                float e2Sq = massElecSq + pt_2*pt_2 + pz_2*pz_2;
+                float mInvSq = 2*(massElecSq + sqrt(e1Sq*e2Sq) - px_1*px_2 - py_1*py_2 - pz_1*pz_2 );
+                float mInv = sqrt(mInvSq);
+                _invMass->Fill(mInv);
+                if (mInv<0.5)
+                  {
+                  if (dedx_1>75. && dedx_2>75.)
+                    {
+                    _invMassElec->Fill(mInv);
+                    if (mInv<0.05) continue;
+                    }
+                  }
                 }
-              
+              corr      = corr_1*corr_2;
+              ij        = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2;   ////cout << " ij:" << ij<< endl;
               __n2_12                  += corr;
               __n2_12_vsEtaPhi[ij]     += corr;
               ptpt                     = pt_1*pt_2;
@@ -1609,8 +1627,7 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
               __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
               __s2PtN_12_vsEtaPhi[ij]  += corr*pt_1;
               __s2NPt_12_vsEtaPhi[ij]  += corr*pt_2;
-              __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
-              
+              __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;         
               __n2Nw_12                  += 1;
               __s2ptptNw_12              += ptpt;
               __s2PtNNw_12               += pt_1;
@@ -1618,90 +1635,21 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
               
               }
           } //i2       
-        } //i1  
+        } //i1         
       }
     
+    _n2_12_vsM->Fill(centrality,     __n2_12);
+    _s2PtPt_12_vsM->Fill(centrality, __s2ptpt_12); 
+    _s2PtN_12_vsM->Fill(centrality,  __s2NPt_12);
+    _s2NPt_12_vsM->Fill(centrality,  __s2PtN_12);
     
+    _n2Nw_12_vsM->Fill(centrality,     __n2Nw_12);
+    _s2PtPtNw_12_vsM->Fill(centrality, __s2ptptNw_12); 
+    _s2PtNNw_12_vsM->Fill(centrality,  __s2NPtNw_12);
+    _s2NPtNw_12_vsM->Fill(centrality,  __s2PtNNw_12);
+
     }
-  else // filter 1 and 2 are different -- must do all particle pairs...
-    {
-    for (int i1=0; i1<k1; i1++)
-      {
-      ////cout << "         i1:" << i1 << endl;
-      id_1      = _id_1[i1];           ////cout << "       id_1:" << id_1 << endl;
-      q_1       = _charge_1[i1];       ////cout << "        q_1:" << q_1 << endl;
-      iEtaPhi_1 = _iEtaPhi_1[i1];      ////cout << "  iEtaPhi_1:" << iEtaPhi_1 << endl;
-      iPt_1     = _iPt_1[i1];          ////cout << "      iPt_1:" << iPt_1 << endl;
-      corr_1    = _correction_1[i1];   ////cout << "     corr_1:" << corr_1 << endl;
-      pt_1      = _pt_1[i1];           ////cout << "       pt_1:" << pt_1 << endl;
-      px_1      = _px_1[i1];          ////cout << "      px_1:" << px_1 << endl;
-      py_1      = _py_1[i1];          ////cout << "      py_1:" << py_1 << endl;
-      pz_1      = _pz_1[i1];          ////cout << "      pz_1:" << pz_1 << endl;
-      dedx_1    = _dedx_1[i1];        ////cout << "     dedx_1:" << dedx_1 << endl;
-      
-      //1 and 2
-      for (int i2=0; i2<k2; i2++)
-        {        
-          ////cout << "         i2:" << i2 << endl;
-          id_2   = _id_2[i2];              ////cout << "       id_2:" << id_2 << endl;
-          if (id_1!=id_2)  // exclude auto correlation
-            {
-            q_2       = _charge_2[i2];     ////cout << "        q_2:" << q_2 << endl;
-            iEtaPhi_2 = _iEtaPhi_2[i2];    ////cout << "  iEtaPhi_2:" << iEtaPhi_2 << endl;
-            iPt_2     = _iPt_2[i2];        ////cout << "      iPt_2:" << iPt_2 << endl;
-            corr_2    = _correction_2[i2]; ////cout << "     corr_2:" << corr_2 << endl;
-            pt_2      = _pt_2[i2];         ////cout << "       pt_2:" << pt_2 << endl;
-            px_2      = _px_2[i2];          ////cout << "      px_2:" << px_2 << endl;
-            py_2      = _py_2[i2];          ////cout << "      py_2:" << py_2 << endl;
-            pz_2      = _pz_2[i2];          ////cout << "      pz_2:" << pz_2 << endl;
-            dedx_2    = _dedx_2[i2];        ////cout << "     dedx_2:" << dedx_2 << endl;
-            if (_rejectPairConversion)
-              {
-              float e1Sq = massElecSq + pt_1*pt_1 + pz_1*pz_1;
-              float e2Sq = massElecSq + pt_2*pt_2 + pz_2*pz_2;
-              float mInvSq = 2*(massElecSq + sqrt(e1Sq*e2Sq) - px_1*px_2 - py_1*py_2 - pz_1*pz_2 );
-              float mInv = sqrt(mInvSq);
-              _invMass->Fill(mInv);
-              if (mInv<0.5)
-                {
-                if (dedx_1>75. && dedx_2>75.)
-                  {
-                  _invMassElec->Fill(mInv);
-                  if (mInv<0.05) continue;
-                  }
-                }
-              }
-            corr      = corr_1*corr_2;
-            ij        = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2;   ////cout << " ij:" << ij<< endl;
-            __n2_12                  += corr;
-            __n2_12_vsEtaPhi[ij]     += corr;
-            ptpt                     = pt_1*pt_2;
-            __s2ptpt_12              += corr*ptpt;
-            __s2PtN_12               += corr*pt_1;
-            __s2NPt_12               += corr*pt_2;
-            __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
-            __s2PtN_12_vsEtaPhi[ij]  += corr*pt_1;
-            __s2NPt_12_vsEtaPhi[ij]  += corr*pt_2;
-            __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;         
-            __n2Nw_12                  += 1;
-            __s2ptptNw_12              += ptpt;
-            __s2PtNNw_12               += pt_1;
-            __s2NPtNw_12               += pt_2;
-            
-            }
-        } //i2       
-      } //i1  
-    }
-  ////cout << "_mult4:"<< _mult4 << " __s2ptpt_12:" << __s2ptpt_12 << " __s2PtN_12:" << __s2PtN_12 << endl;
-  _n2_12_vsM->Fill(_mult4,     __n2_12);
-  _s2PtPt_12_vsM->Fill(_mult4, __s2ptpt_12); 
-  _s2PtN_12_vsM->Fill(_mult4,  __s2NPt_12);
-  _s2NPt_12_vsM->Fill(_mult4,  __s2PtN_12);
   
-  _n2Nw_12_vsM->Fill(_mult4,     __n2Nw_12);
-  _s2PtPtNw_12_vsM->Fill(_mult4, __s2ptptNw_12); 
-  _s2PtNNw_12_vsM->Fill(_mult4,  __s2NPtNw_12);
-  _s2NPtNw_12_vsM->Fill(_mult4,  __s2PtNNw_12);
   
   ////cout << "Event Done " << endl;
   PostData(0,_outputHistoList);
@@ -1868,7 +1816,7 @@ float *  AliAnalysisTaskDptDptCorrelations::getFloatArray(int size, float v)
 
 
 //________________________________________________________________________
-TH1D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, const TString &  title, 
+TH1D * AliAnalysisTaskDptDptCorrelations::createHisto1D(const TString &  name, const TString &  title, 
                                                       int n, double xMin, double xMax, 
                                                       const TString &  xTitle, const TString &  yTitle)
 {
@@ -1883,7 +1831,7 @@ TH1D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, con
 
 
 //________________________________________________________________________
-TH1D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, const TString &  title, 
+TH1D * AliAnalysisTaskDptDptCorrelations::createHisto1D(const TString &  name, const TString &  title, 
                                                       int n, double * bins, 
                                                       const TString &  xTitle, const TString &  yTitle)
 {
@@ -1897,7 +1845,7 @@ TH1D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, con
 
 
 //________________________________________________________________________
-TH2D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, const TString &  title, 
+TH2D * AliAnalysisTaskDptDptCorrelations::createHisto2D(const TString &  name, const TString &  title, 
                                                       int nx, double xMin, double xMax, int ny, double yMin, double yMax, 
                                                       const TString &  xTitle, const TString &  yTitle, const TString &  zTitle)
 {
@@ -1911,7 +1859,7 @@ TH2D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, con
 }
 
 //________________________________________________________________________
-TH2D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, const TString &  title, 
+TH2D * AliAnalysisTaskDptDptCorrelations::createHisto2D(const TString &  name, const TString &  title, 
                                                       int nx, double* xbins, int ny, double yMin, double yMax, 
                                                       const TString &  xTitle, const TString &  yTitle, const TString &  zTitle)
 {
@@ -1925,9 +1873,68 @@ TH2D * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, con
   return h;
 }
 
+//// F /////
+//________________________________________________________________________
+TH1F * AliAnalysisTaskDptDptCorrelations::createHisto1F(const TString &  name, const TString &  title, 
+                                                        int n, double xMin, double xMax, 
+                                                        const TString &  xTitle, const TString &  yTitle)
+{
+  //CreateHisto new 1D historgram
+  AliInfo(Form("createHisto 1D histo %s   nBins: %d  xMin: %f   xMax: %f",name.Data(),n,xMin,xMax));
+  TH1F * h = new TH1F(name,title,n,xMin,xMax);
+  h->GetXaxis()->SetTitle(xTitle);
+  h->GetYaxis()->SetTitle(yTitle);
+  addToList(h);
+  return h;
+}
+
+
+//________________________________________________________________________
+TH1F * AliAnalysisTaskDptDptCorrelations::createHisto1F(const TString &  name, const TString &  title, 
+                                                        int n, double * bins, 
+                                                        const TString &  xTitle, const TString &  yTitle)
+{
+  AliInfo(Form("createHisto 1D histo %s   with %d non uniform nBins",name.Data(),n));
+  TH1F * h = new TH1F(name,title,n,bins);
+  h->GetXaxis()->SetTitle(xTitle);
+  h->GetYaxis()->SetTitle(yTitle);
+  addToList(h);
+  return h;
+}
+
+
+//________________________________________________________________________
+TH2F * AliAnalysisTaskDptDptCorrelations::createHisto2F(const TString &  name, const TString &  title, 
+                                                        int nx, double xMin, double xMax, int ny, double yMin, double yMax, 
+                                                        const TString &  xTitle, const TString &  yTitle, const TString &  zTitle)
+{
+  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));
+  TH2F * h = new TH2F(name,title,nx,xMin,xMax,ny,yMin,yMax);
+  h->GetXaxis()->SetTitle(xTitle);
+  h->GetYaxis()->SetTitle(yTitle);
+  h->GetZaxis()->SetTitle(zTitle);
+  addToList(h);
+  return h;
+}
+
+//________________________________________________________________________
+TH2F * AliAnalysisTaskDptDptCorrelations::createHisto2F(const TString &  name, const TString &  title, 
+                                                        int nx, double* xbins, int ny, double yMin, double yMax, 
+                                                        const TString &  xTitle, const TString &  yTitle, const TString &  zTitle)
+{
+  AliInfo(Form("createHisto 2D histo %s   with %d non uniform nBins",name.Data(),nx));
+  TH2F * h;
+  h = new TH2F(name,title,nx,xbins,ny,yMin,yMax);
+  h->GetXaxis()->SetTitle(xTitle);
+  h->GetYaxis()->SetTitle(yTitle);
+  h->GetZaxis()->SetTitle(zTitle);
+  addToList(h);
+  return h;
+}
+
 
 //________________________________________________________________________
-TH3F * AliAnalysisTaskDptDptCorrelations::createHisto(const TString &  name, const TString &  title, 
+TH3F * AliAnalysisTaskDptDptCorrelations::createHisto3F(const TString &  name, const TString &  title, 
                                                       int nx, double xMin, double xMax, 
                                                       int ny, double yMin, double yMax, 
                                                       int nz, double zMin, double zMax, 
index ad499c1..68b9120 100644 (file)
@@ -48,15 +48,22 @@ public:
   
   virtual void   addToList(TH1 *h);
 
-  TH1D * createHisto(const TString &  name, const TString &  title,int n, double xmin, double xmax,const TString &  xTitle, const TString &  yTitle);
-  TH1D * createHisto(const TString &  name, const TString &  title,int n, double * bins,const TString &  xTitle, const TString &  yTitle);
-  TH2D * createHisto(const TString &  name, const TString &  title, 
-                    int nx, double xmin, double xmax, int ny, double ymin, double ymax, const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);
-  TH2D * createHisto(const TString &  name, const TString &  title, int nx, double* xbins, int ny, double ymin, double ymax, 
-                    const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);
-  TH3F * createHisto(const TString &  name, const TString &  title, 
-                    int nx, double xmin, double xmax, int ny, double ymin, double ymax, int nz, double zmin, double zmax, 
-                    const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);  
+  TH1D * createHisto1D(const TString &  name, const TString &  title,int n, double xmin, double xmax,const TString &  xTitle, const TString &  yTitle);
+  TH1D * createHisto1D(const TString &  name, const TString &  title,int n, double * bins,const TString &  xTitle, const TString &  yTitle);
+  TH2D * createHisto2D(const TString &  name, const TString &  title, 
+                       int nx, double xmin, double xmax, int ny, double ymin, double ymax, const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);
+  TH2D * createHisto2D(const TString &  name, const TString &  title, int nx, double* xbins, int ny, double ymin, double ymax, 
+                       const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);
+
+  TH1F * createHisto1F(const TString &  name, const TString &  title,int n, double xmin, double xmax,const TString &  xTitle, const TString &  yTitle);
+  TH1F * createHisto1F(const TString &  name, const TString &  title,int n, double * bins,const TString &  xTitle, const TString &  yTitle);
+  TH2F * createHisto2F(const TString &  name, const TString &  title, 
+                       int nx, double xmin, double xmax, int ny, double ymin, double ymax, const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);
+  TH2F * createHisto2F(const TString &  name, const TString &  title, int nx, double* xbins, int ny, double ymin, double ymax, 
+                       const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);
+  TH3F * createHisto3F(const TString &  name, const TString &  title, 
+                       int nx, double xmin, double xmax, int ny, double ymin, double ymax, int nz, double zmin, double zmax, 
+                       const TString &  xTitle, const TString &  yTitle, const TString &  zTitle);  
   TProfile * createProfile(const TString &  title,const TString &  description, int n,  double xMin,double xMax,
                            const TString &  xTitle, const TString &  yTitle);
   TProfile * createProfile(const TString &  name,const TString &  description, 
@@ -284,38 +291,38 @@ protected:
   
   // PARTICLE 1 (satisfies filter 1)
   // Primary filled quantities
-  TH1D      *  _n1_1_vsPt;         
-  TH2D      *  _n1_1_vsEtaVsPhi;
-  TH2D      *  _s1pt_1_vsEtaVsPhi; 
+  TH1F      *  _n1_1_vsPt;         
+  TH2F      *  _n1_1_vsEtaVsPhi;
+  TH2F      *  _s1pt_1_vsEtaVsPhi; 
   TH3F      *  _n1_1_vsZVsEtaVsPhiVsPt;
   TProfile *  _n1_1_vsM;  // w/ weight
   TProfile *  _s1pt_1_vsM;
   TProfile *  _n1Nw_1_vsM; // w/o weight
   TProfile *  _s1ptNw_1_vsM;
-  TH2D      *  _dedxVsP_1;
-  TH2D      *  _corrDedxVsP_1;
-  TH2D      *  _betaVsP_1;
+  TH2F      *  _dedxVsP_1;
+  TH2F      *  _corrDedxVsP_1;
+  TH2F      *  _betaVsP_1;
   
   // PARTICLE 2 (satisfies filter 2)
   // Primary filled quantities
-  TH1D      *  _n1_2_vsPt;         
-  TH2D      *  _n1_2_vsEtaVsPhi;
-  TH2D      *  _s1pt_2_vsEtaVsPhi;
+  TH1F      *  _n1_2_vsPt;         
+  TH2F      *  _n1_2_vsEtaVsPhi;
+  TH2F      *  _s1pt_2_vsEtaVsPhi;
   TH3F      *  _n1_2_vsZVsEtaVsPhiVsPt; 
   TProfile *  _n1_2_vsM;
   TProfile *  _s1pt_2_vsM;
   TProfile *  _n1Nw_2_vsM; // w/o weight
   TProfile *  _s1ptNw_2_vsM;
-  TH2D      *  _dedxVsP_2;
-  TH2D      *  _corrDedxVsP_2;
-  TH2D      *  _betaVsP_2;
+  TH2F      *  _dedxVsP_2;
+  TH2F      *  _corrDedxVsP_2;
+  TH2F      *  _betaVsP_2;
   
   // Pairs 1 & 2  
-  TH1D      * _n2_12_vsEtaPhi;        
-  TH2D      * _n2_12_vsPtVsPt;
-  TH1D      * _s2PtPt_12_vsEtaPhi;    
-  TH1D      * _s2PtN_12_vsEtaPhi;       
-  TH1D      * _s2NPt_12_vsEtaPhi;     
+  TH1F      * _n2_12_vsEtaPhi;        
+  TH2F      * _n2_12_vsPtVsPt;
+  TH1F      * _s2PtPt_12_vsEtaPhi;    
+  TH1F      * _s2PtN_12_vsEtaPhi;       
+  TH1F      * _s2NPt_12_vsEtaPhi;     
   
   TProfile * _n2_12_vsM;        
   TProfile * _s2PtPt_12_vsM;    
@@ -326,8 +333,8 @@ protected:
   TProfile * _s2PtNNw_12_vsM;       
   TProfile * _s2NPtNw_12_vsM; 
   
-  TH1D      * _invMass;
-  TH1D      * _invMassElec;
+  TH1F      * _invMass;
+  TH1F      * _invMassElec;
   
   TString n1Name;
   TString n1NwName;