]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/CaloTrackCorrelations/AliAnaParticleHadronCorrelation.cxx
Initialize the path name to the geometry file in the Init and not in the InitParameters
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaParticleHadronCorrelation.cxx
index 92ec915242d515ac702682e12ceb8442d489d026..0c2fcdca2740c35be18ecde216440211b14cadad 100755 (executable)
@@ -189,93 +189,94 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
   outputContainer->Add(fhEtaLeading);
   
   //Correlation with charged hadrons
-  if(GetReader()->IsCTSSwitchedOn()) {
+  if(GetReader()->IsCTSSwitchedOn()) 
+  {
     fhDeltaPhiDeltaEtaCharged  = new TH2F
-    ("DeltaPhiDeltaEtaCharged","#phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
+    ("hDeltaPhiDeltaEtaCharged","#phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
      140,-2.,5.,200,-2,2); 
     fhDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi");
     fhDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");    
     
     fhPhiCharged  = new TH2F
-    ("PhiCharged","#phi_{h^{#pm}}  vs p_{T #pm}",
+    ("hPhiCharged","#phi_{h^{#pm}}  vs p_{T #pm}",
      nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
     fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)");
     fhPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
     
     fhEtaCharged  = new TH2F
-    ("EtaCharged","#eta_{h^{#pm}}  vs p_{T #pm}",
+    ("hEtaCharged","#eta_{h^{#pm}}  vs p_{T #pm}",
      nptbins,ptmin,ptmax,netabins,etamin,etamax); 
     fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
     fhEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
     
     fhDeltaPhiCharged  = new TH2F
-    ("DeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
+    ("hDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
      nptbins,ptmin,ptmax,140,-2.,5.); 
     fhDeltaPhiCharged->SetYTitle("#Delta #phi");
     fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhDeltaPhiChargedPt  = new TH2F
-    ("DeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
+    ("hDeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
      nptbins,ptmin,ptmax,140,-2.,5.);
     fhDeltaPhiChargedPt->SetYTitle("#Delta #phi");
     fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
     
     fhDeltaPhiUeChargedPt  = new TH2F
-    ("DeltaPhiUeChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}}",
+    ("hDeltaPhiUeChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}}",
      nptbins,ptmin,ptmax,140,-2.,5.);
     fhDeltaPhiUeChargedPt->SetYTitle("#Delta #phi");
     fhDeltaPhiUeChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
     
     fhDeltaEtaCharged  = new TH2F
-    ("DeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",
+    ("hDeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",
      nptbins,ptmin,ptmax,200,-2,2); 
     fhDeltaEtaCharged->SetYTitle("#Delta #eta");
     fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhPtImbalanceCharged  = 
-    new TH2F("CorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
+    new TH2F("hCorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}");
     fhPtImbalanceCharged->SetXTitle("p_{T trigger}");
     
     fhPtImbalanceUeCharged  = 
-    new TH2F("CorrelationUeCharged","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger}",
+    new TH2F("hCorrelationUeCharged","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger}",
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhPtImbalanceUeCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
     fhPtImbalanceUeCharged->SetXTitle("p_{T trigger}");
     
     fhPtImbalancePosCharged  = 
-    new TH2F("CorrelationPositiveCharged","z_{trigger h^{+}} = p_{T h^{+}} / p_{T trigger}",
+    new TH2F("hCorrelationPositiveCharged","z_{trigger h^{+}} = p_{T h^{+}} / p_{T trigger}",
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhPtImbalancePosCharged->SetYTitle("z_{trigger h^{+}}");
     fhPtImbalancePosCharged->SetXTitle("p_{T trigger}");
     
     fhPtImbalanceNegCharged  = 
-    new TH2F("CorrelationNegativeCharged","z_{trigger h^{-}} = p_{T h^{-}} / p_{T trigger}",
+    new TH2F("hCorrelationNegativeCharged","z_{trigger h^{-}} = p_{T h^{-}} / p_{T trigger}",
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhPtImbalanceNegCharged->SetYTitle("z_{trigger h^{-}}");
     fhPtImbalanceNegCharged->SetXTitle("p_{T trigger}");
     
     fhPtHbpCharged  = 
-    new TH2F("HbpCharged","#xi = ln(1/x_{E}) with charged hadrons",
+    new TH2F("hHbpCharged","#xi = ln(1/x_{E}) with charged hadrons",
              nptbins,ptmin,ptmax,200,0.,10.); 
     fhPtHbpCharged->SetYTitle("ln(1/x_{E})");
     fhPtHbpCharged->SetXTitle("p_{T trigger}");
     
     fhPtHbpUeCharged  = 
-    new TH2F("HbpUeCharged","#xi = ln(1/x_{E}) with charged hadrons",
+    new TH2F("hHbpUeCharged","#xi = ln(1/x_{E}) with charged hadrons",
              nptbins,ptmin,ptmax,200,0.,10.); 
     fhPtHbpUeCharged->SetYTitle("ln(1/x_{E})");
     fhPtHbpUeCharged->SetXTitle("p_{T trigger}");
     
     fhPtTrigPout  = 
-    new TH2F("PtTrigPout","Pout with triggers",
+    new TH2F("hPtTrigPout","Pout with triggers",
              nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax); 
     fhPtTrigPout->SetYTitle("p_{out} (GeV/c)");
     fhPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)"); 
     
     fhPtTrigCharged  = 
-    new TH2F("PtTrigCharged","trgger and charged tracks pt distribution",
+    new TH2F("hPtTrigCharged","trgger and charged tracks pt distribution",
              nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); 
     fhPtTrigCharged->SetYTitle("p_{T h^{#pm}} (GeV/c)");
     fhPtTrigCharged->SetXTitle("p_{T trigger} (GeV/c)");    
@@ -296,7 +297,8 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
     outputContainer->Add(fhPtTrigPout) ;
     outputContainer->Add(fhPtTrigCharged) ;
     
-    if(DoEventSelect()){ 
+    if(DoEventSelect())
+    { 
       Int_t nMultiBins = GetMultiBin();
       fhTrigDeltaPhiCharged = new TH2F*[nMultiBins] ;
       fhTrigDeltaEtaCharged = new TH2F*[nMultiBins] ;
@@ -304,19 +306,19 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
       fhTrigUeCorr          = new TH2F*[nMultiBins];
       for(Int_t im=0; im<nMultiBins; im++){
         fhTrigDeltaPhiCharged[im]  = new TH2F 
-        (Form("fhTrigDeltaPhiCharged_%d",im),Form("fhTrigDeltaPhiCharged_%d",im), nptbins,ptmin,ptmax, 140,-2.,5.); 
+        (Form("hTrigDeltaPhiCharged_%d",im),Form("hTrigDeltaPhiCharged_%d",im), nptbins,ptmin,ptmax, 140,-2.,5.); 
         fhTrigDeltaPhiCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
         fhTrigDeltaPhiCharged[im]->SetYTitle("#Delta #phi");
         fhTrigDeltaEtaCharged[im]  = new TH2F 
-        (Form("fhTrigDeltaEtaCharged_%d",im),Form("fhTrigDeltaEtaCharged_%d",im), nptbins,ptmin,ptmax, 200,-2,2); 
+        (Form("hTrigDeltaEtaCharged_%d",im),Form("hTrigDeltaEtaCharged_%d",im), nptbins,ptmin,ptmax, 200,-2,2); 
         fhTrigDeltaEtaCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
         fhTrigDeltaEtaCharged[im]->SetYTitle("#Delta #eta");
         fhTrigCorr[im]  = new TH2F
-        (Form("fhTrigPtCorr_%d",im),Form("fhTrigPtCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.); 
+        (Form("hTrigPtCorr_%d",im),Form("hTrigPtCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.); 
         fhTrigCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
         fhTrigCorr[im]->SetXTitle("p_{T trigger}");
         fhTrigUeCorr[im]  = new TH2F
-        (Form("fhTrigPtUeCorr_%d",im),Form("fhTrigPtUeCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.); 
+        (Form("hTrigPtUeCorr_%d",im),Form("hTrigPtUeCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.); 
         fhTrigUeCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
         fhTrigUeCorr[im]->SetXTitle("p_{T trigger}");       
         
@@ -328,26 +330,26 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
       }
     }
     
-    fhAssocPt           = new TH2F("fhAssocPt", " Trigger p_{T} vs associated hadron p_{T}",
+    fhAssocPt           = new TH2F("hAssocPt", " Trigger p_{T} vs associated hadron p_{T}",
                                    nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
     fhAssocPt->SetXTitle("p_{T trigger}");
     fhAssocPt->SetYTitle("p_{T associated}");
     outputContainer->Add(fhAssocPt) ;
     
-    fhAssocPtBkg        = new TH2F("fhAssocPtBkg", " Trigger p_{T} vs associated hadron p_{T} from background",
+    fhAssocPtBkg        = new TH2F("hAssocPtBkg", " Trigger p_{T} vs associated hadron p_{T} from background",
                                    nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
     fhAssocPtBkg->SetXTitle("p_{T trigger}");
     fhAssocPtBkg->SetYTitle("p_{T associated}");
     outputContainer->Add(fhAssocPtBkg) ;
     
-    fhDeltaPhiBrad = new TH2F("fhDeltaPhiBrad","atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs p_{T trigger} ", 
+    fhDeltaPhiBrad = new TH2F("hDeltaPhiBrad","atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs p_{T trigger} ", 
                               nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
     fhDeltaPhiBrad->SetXTitle("p_{T trigger}");
     fhDeltaPhiBrad->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
     
     outputContainer->Add(fhDeltaPhiBrad) ;
 
-    fhXE       = new TH2F("fhXE", "x_{E} vs p_{T trigger}", 
+    fhXE       = new TH2F("hXE", "x_{E} vs p_{T trigger}", 
                           nptbins, ptmin, ptmax,50, 0.0, 2.0);
     fhXE->SetXTitle("p_{T trigger}");
     fhXE->SetYTitle("x_{E}");
@@ -360,33 +362,34 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
     fhDeltaPhiAssocPtBinHMPIDAcc= new TH2F*[fNAssocPtBins] ;
     fhDeltaPhiBradAssocPtBin = new TH2F*[fNAssocPtBins] ;
     fhXEAssocPtBin           = new TH2F*[fNAssocPtBins] ;
-    for(Int_t i = 0 ; i < fNAssocPtBins ; i++){
-      fhDeltaPhiAssocPtBin[i] = new TH2F(Form("fhDeltaPhiPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
+    for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
+    {
+      fhDeltaPhiAssocPtBin[i] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                          Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                          nptbins, ptmin, ptmax,140,-2.,5.);
       fhDeltaPhiAssocPtBin[i]->SetXTitle("p_{T trigger}");
       fhDeltaPhiAssocPtBin[i]->SetYTitle("#Delta #phi");
  
-      fhDeltaPhiAssocPtBinHMPID[i] = new TH2F(Form("fhDeltaPhiPtAssocPt%2.1f_%2.1fHMPID", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
+      fhDeltaPhiAssocPtBinHMPID[i] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1fHMPID", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                          Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f], with track having HMPID signal", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                          nptbins, ptmin, ptmax,140,-2.,5.);
       fhDeltaPhiAssocPtBinHMPID[i]->SetXTitle("p_{T trigger}");
       fhDeltaPhiAssocPtBinHMPID[i]->SetYTitle("#Delta #phi");      
       
-      fhDeltaPhiAssocPtBinHMPIDAcc[i] = new TH2F(Form("fhDeltaPhiPtAssocPt%2.1f_%2.1fHMPIDAcc", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
+      fhDeltaPhiAssocPtBinHMPIDAcc[i] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1fHMPIDAcc", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                               Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f], with track within 5<phi<20 deg", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                               nptbins, ptmin, ptmax,140,-2.,5.);
       fhDeltaPhiAssocPtBinHMPIDAcc[i]->SetXTitle("p_{T trigger}");
       fhDeltaPhiAssocPtBinHMPIDAcc[i]->SetYTitle("#Delta #phi");    
       
-      fhDeltaPhiBradAssocPtBin[i] = new TH2F(Form("fhDeltaPhiBradPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
+      fhDeltaPhiBradAssocPtBin[i] = new TH2F(Form("hDeltaPhiBradPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                              Form("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                              nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
       fhDeltaPhiBradAssocPtBin[i]->SetXTitle("p_{T trigger}");
       fhDeltaPhiBradAssocPtBin[i]->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
       
       
-      fhXEAssocPtBin[i]       = new TH2F(Form("fhXEAssocPtBin%1.f_%1.f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
+      fhXEAssocPtBin[i]       = new TH2F(Form("hXEAssocPtBin%1.f_%1.f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                          Form("x_{E} vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]), 
                                          nptbins, ptmin, ptmax,50, 0.0, 2.0);
       fhXEAssocPtBin[i]->SetXTitle("p_{T trigger}");
@@ -399,7 +402,8 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
       outputContainer->Add(fhXEAssocPtBin[i]);
     }
     
-    if(fPi0Trigger){
+    if(fPi0Trigger)
+    {
       fhPtPi0DecayRatio  = new TH2F
       ("hPtPi0DecayRatio","p_T of #pi^{0} and the ratio of pt for two decay", 
        nptbins,ptmin,ptmax, 100,0.,2.); 
@@ -407,13 +411,13 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
       fhPtPi0DecayRatio->SetYTitle("p_{T}^{Decay}/p_{T}^{#pi^{0}}");
       
       fhDeltaPhiDecayCharged  = new TH2F
-      ("DeltaPhiDecayCharged","#phi_{Decay} - #phi_{h^{#pm}} vs p_{T Decay}",
+      ("hDeltaPhiDecayCharged","#phi_{Decay} - #phi_{h^{#pm}} vs p_{T Decay}",
        nptbins,ptmin,ptmax,140,-2.,5.); 
       fhDeltaPhiDecayCharged->SetYTitle("#Delta #phi");
       fhDeltaPhiDecayCharged->SetXTitle("p_{T Decay} (GeV/c)");
       
       fhPtImbalanceDecayCharged  = 
-      new TH2F("CorrelationDecayCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T Decay}",
+      new TH2F("hCorrelationDecayCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T Decay}",
                nptbins,ptmin,ptmax,200,0.,2.); 
       fhPtImbalanceDecayCharged->SetYTitle("z_{decay h^{#pm}}");
       fhPtImbalanceDecayCharged->SetXTitle("p_{T decay}");
@@ -424,44 +428,45 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
     }    
     
     
-    if(fMakeSeveralUE){ 
+    if(fMakeSeveralUE)
+    { 
       fhDeltaPhiUeLeftCharged  = new TH2F
-      ("DeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left side range of trigger particles",
+      ("hDeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left side range of trigger particles",
        nptbins,ptmin,ptmax,140,-2.,5.);
       fhDeltaPhiUeLeftCharged->SetYTitle("#Delta #phi");
       fhDeltaPhiUeLeftCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
       outputContainer->Add(fhDeltaPhiUeLeftCharged) ;
       
       fhDeltaPhiUeRightCharged  = new TH2F
-      ("DeltaPhiUeRightChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right side range of trigger particles",
+      ("hDeltaPhiUeRightChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right side range of trigger particles",
        nptbins,ptmin,ptmax,140,-2.,5.);
       fhDeltaPhiUeRightCharged->SetYTitle("#Delta #phi");
       fhDeltaPhiUeRightCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
       outputContainer->Add(fhDeltaPhiUeRightCharged) ;
       
       fhPtImbalanceUeLeftCharged  = 
-      new TH2F("CorrelationUeChargedLeft","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE left side of trigger",
+      new TH2F("hCorrelationUeChargedLeft","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE left side of trigger",
                nptbins,ptmin,ptmax,200,0.,2.); 
       fhPtImbalanceUeLeftCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
       fhPtImbalanceUeLeftCharged->SetXTitle("p_{T trigger}");
       outputContainer->Add(fhPtImbalanceUeLeftCharged) ;
       
       fhPtImbalanceUeRightCharged  = 
-      new TH2F("CorrelationUeChargedRight","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE right side of trigger",
+      new TH2F("hCorrelationUeChargedRight","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE right side of trigger",
                nptbins,ptmin,ptmax,200,0.,2.); 
       fhPtImbalanceUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
       fhPtImbalanceUeRightCharged->SetXTitle("p_{T trigger}");
       outputContainer->Add(fhPtImbalanceUeRightCharged) ;
       
       fhPtHbpUeLeftCharged  = 
-      new TH2F("HbpUeChargedLeft","#xi = ln(1/x_{E}) with charged UE left side of trigger",
+      new TH2F("hHbpUeChargedLeft","#xi = ln(1/x_{E}) with charged UE left side of trigger",
                nptbins,ptmin,ptmax,200,0.,10.); 
       fhPtHbpUeLeftCharged->SetYTitle("ln(1/x_{E})");
       fhPtHbpUeLeftCharged->SetXTitle("p_{T trigger}");
       outputContainer->Add(fhPtHbpUeLeftCharged) ;
       
       fhPtHbpUeRightCharged  = 
-      new TH2F("HbpUeChargedRight","#xi = ln(1/x_{E}) with charged UE right side of trigger",
+      new TH2F("hHbpUeChargedRight","#xi = ln(1/x_{E}) with charged UE right side of trigger",
                nptbins,ptmin,ptmax,200,0.,10.); 
       fhPtHbpUeRightCharged->SetYTitle("ln(1/x_{E})");
       fhPtHbpUeRightCharged->SetXTitle("p_{T trigger}");
@@ -471,70 +476,70 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
   }  //Correlation with charged hadrons
   
   //Correlation with neutral hadrons
-  if(fNeutralCorr){
-    
+  if(fNeutralCorr)
+  {
     fhDeltaPhiDeltaEtaNeutral  = new TH2F
-    ("DeltaPhiDeltaEtaNeutral","#phi_{trigger} - #phi_{h^{0}} vs #eta_{trigger} - #eta_{h^{0}}",
+    ("hDeltaPhiDeltaEtaNeutral","#phi_{trigger} - #phi_{h^{0}} vs #eta_{trigger} - #eta_{h^{0}}",
      140,-2.,5.,200,-2,2); 
     fhDeltaPhiDeltaEtaNeutral->SetXTitle("#Delta #phi");
     fhDeltaPhiDeltaEtaNeutral->SetYTitle("#Delta #eta");   
          
     fhPhiNeutral  = new TH2F
-    ("PhiNeutral","#phi_{#pi^{0}}  vs p_{T #pi^{0}}",
+    ("hPhiNeutral","#phi_{#pi^{0}}  vs p_{T #pi^{0}}",
      nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
     fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
     fhPhiNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
     
     fhEtaNeutral  = new TH2F
-    ("EtaNeutral","#eta_{#pi^{0}}  vs p_{T #pi^{0}}",
+    ("hEtaNeutral","#eta_{#pi^{0}}  vs p_{T #pi^{0}}",
      nptbins,ptmin,ptmax,netabins,etamin,etamax); 
     fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
     fhEtaNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
     
     fhDeltaPhiNeutral  = new TH2F
-    ("DeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",
+    ("hDeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",
      nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
     fhDeltaPhiNeutral->SetYTitle("#Delta #phi");
     fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhDeltaPhiNeutralPt  = new TH2F
-    ("DeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
+    ("hDeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
      nptbins,ptmin,ptmax,140,-2.,5.); 
     fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi");
     fhDeltaPhiNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
     
     fhDeltaPhiUeNeutralPt  = new TH2F
-    ("DeltaPhiUeNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
+    ("hDeltaPhiUeNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
      nptbins,ptmin,ptmax,140,-2.,5.); 
     fhDeltaPhiUeNeutralPt->SetYTitle("#Delta #phi");
     fhDeltaPhiUeNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
     
     fhDeltaEtaNeutral  = new TH2F
-    ("DeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",
+    ("hDeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",
      nptbins,ptmin,ptmax,200,-2,2); 
     fhDeltaEtaNeutral->SetYTitle("#Delta #eta");
     fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhPtImbalanceNeutral  = 
-    new TH2F("CorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
+    new TH2F("hCorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhPtImbalanceNeutral->SetYTitle("z_{trigger #pi^{0}}");
     fhPtImbalanceNeutral->SetXTitle("p_{T trigger}");
     
     fhPtImbalanceUeNeutral  = 
-    new TH2F("CorrelationUeNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
+    new TH2F("hCorrelationUeNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhPtImbalanceUeNeutral->SetYTitle("z_{trigger #pi^{0}}");
     fhPtImbalanceUeNeutral->SetXTitle("p_{T trigger}");
     
     fhPtHbpNeutral  = 
-    new TH2F("HbpNeutral","#xi = ln(1/x_{E}) with neutral particles",
+    new TH2F("hHbpNeutral","#xi = ln(1/x_{E}) with neutral particles",
              nptbins,ptmin,ptmax,200,0.,10.); 
     fhPtHbpNeutral->SetYTitle("ln(1/x_{E})");
     fhPtHbpNeutral->SetXTitle("p_{T trigger}");
     
     fhPtHbpUeNeutral  = 
-    new TH2F("HbpUeNeutral","#xi = ln(1/x_{E}) with neutral particles",
+    new TH2F("hHbpUeNeutral","#xi = ln(1/x_{E}) with neutral particles",
              nptbins,ptmin,ptmax,200,0.,10.); 
     fhPtHbpUeNeutral->SetYTitle("ln(1/x_{E})");
     fhPtHbpUeNeutral->SetXTitle("p_{T trigger}");
@@ -552,15 +557,16 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
     outputContainer->Add(fhPtHbpNeutral) ;
     outputContainer->Add(fhPtHbpUeNeutral) ;    
     
-    if(fPi0Trigger){
+    if(fPi0Trigger)
+    {
       fhDeltaPhiDecayNeutral  = new TH2F
-      ("DeltaPhiDecayNeutral","#phi_{Decay} - #phi_{h^{0}} vs p_{T Decay}",
+      ("hDeltaPhiDecayNeutral","#phi_{Decay} - #phi_{h^{0}} vs p_{T Decay}",
        nptbins,ptmin,ptmax,140,-2.,5.); 
       fhDeltaPhiDecayNeutral->SetYTitle("#Delta #phi");
       fhDeltaPhiDecayNeutral->SetXTitle("p_{T Decay} (GeV/c)");
       
       fhPtImbalanceDecayNeutral  = 
-      new TH2F("CorrelationDecayNeutral","z_{trigger h^{0}} = p_{T h^{0}} / p_{T Decay}",
+      new TH2F("hCorrelationDecayNeutral","z_{trigger h^{0}} = p_{T h^{0}} / p_{T Decay}",
                nptbins,ptmin,ptmax,200,0.,2.); 
       fhPtImbalanceDecayNeutral->SetYTitle("z_{decay h^{0}}");
       fhPtImbalanceDecayNeutral->SetXTitle("p_{T decay}");
@@ -570,44 +576,45 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
     }
     
     
-    if(fMakeSeveralUE){ 
+    if(fMakeSeveralUE)
+    { 
       fhDeltaPhiUeLeftNeutral  = new TH2F
-      ("DeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T h^{0}} with neutral UE left side range of trigger particles",
+      ("hDeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T h^{0}} with neutral UE left side range of trigger particles",
        nptbins,ptmin,ptmax,140,-2.,5.);
       fhDeltaPhiUeLeftNeutral->SetYTitle("#Delta #phi");
       fhDeltaPhiUeLeftNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
       outputContainer->Add(fhDeltaPhiUeLeftNeutral) ;
       
       fhDeltaPhiUeRightNeutral  = new TH2F
-      ("DeltaPhiUeRightNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T Ueh^{0}} with neutral UE right side range of trigger particles",
+      ("hDeltaPhiUeRightNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T Ueh^{0}} with neutral UE right side range of trigger particles",
        nptbins,ptmin,ptmax,140,-2.,5.);
       fhDeltaPhiUeRightNeutral->SetYTitle("#Delta #phi");
       fhDeltaPhiUeRightNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
       outputContainer->Add(fhDeltaPhiUeRightNeutral) ;
       
       fhPtImbalanceUeLeftNeutral  = 
-      new TH2F("CorrelationUeNeutralLeft","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger",
+      new TH2F("hCorrelationUeNeutralLeft","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger",
                nptbins,ptmin,ptmax,140,0.,2.); 
       fhPtImbalanceUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}");
       fhPtImbalanceUeLeftNeutral->SetXTitle("p_{T trigger}");
       outputContainer->Add(fhPtImbalanceUeLeftNeutral) ;
       
       fhPtImbalanceUeRightNeutral  = 
-      new TH2F("CorrelationUeNeutralRight","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger",
+      new TH2F("hCorrelationUeNeutralRight","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger",
                nptbins,ptmin,ptmax,200,0.,2.); 
       fhPtImbalanceUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}");
       fhPtImbalanceUeRightNeutral->SetXTitle("p_{T trigger}");
       outputContainer->Add(fhPtImbalanceUeRightNeutral) ;
       
       fhPtHbpUeLeftNeutral  = 
-      new TH2F("HbpUeNeutralLeft","#xi = ln(1/x_{E}) with neutral UE left side of trigger",
+      new TH2F("hHbpUeNeutralLeft","#xi = ln(1/x_{E}) with neutral UE left side of trigger",
                nptbins,ptmin,ptmax,200,0.,10.); 
       fhPtHbpUeLeftNeutral->SetYTitle("ln(1/x_{E})");
       fhPtHbpUeLeftNeutral->SetXTitle("p_{T trigger}");
       outputContainer->Add(fhPtHbpUeLeftNeutral) ;
       
       fhPtHbpUeRightNeutral  = 
-      new TH2F("HbpUeNeutralRight","#xi = ln(1/x_{E}) with neutral UE right side of trigger",
+      new TH2F("hHbpUeNeutralRight","#xi = ln(1/x_{E}) with neutral UE right side of trigger",
                nptbins,ptmin,ptmax,200,0.,10.); 
       fhPtHbpUeRightNeutral->SetYTitle("ln(1/x_{E})");
       fhPtHbpUeRightNeutral->SetXTitle("p_{T trigger}");
@@ -618,71 +625,71 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
   }//Correlation with neutral hadrons
   
   //if data is MC, fill more histograms
-  if(IsDataMC()){
-    
-    fh2phiLeadingParticle=new TH2F("fh2phiLeadingParticle","#phi resolustion for trigger particles",nptbins,ptmin,ptmax,100,-1,1);
+  if(IsDataMC())
+  {
+    fh2phiLeadingParticle=new TH2F("h2phiLeadingParticle","#phi resolustion for trigger particles",nptbins,ptmin,ptmax,100,-1,1);
     fh2phiLeadingParticle->GetXaxis()->SetTitle("p_{T gen Leading} (GeV/c)");
     fh2phiLeadingParticle->GetYaxis()->SetTitle("(#phi_{rec}-#phi_{gen})/#phi_{gen}");
     
-    fhMCLeadingCount=new TH1F("MCLeadingTriggerCount","MCLeadingTriggerCount",nptbins,ptmin,ptmax);
+    fhMCLeadingCount=new TH1F("hMCLeadingTriggerCount","MCLeadingTriggerCount",nptbins,ptmin,ptmax);
     fhMCLeadingCount->SetXTitle("p_{T trig}");
     
     fhMCEtaCharged  = new TH2F
-    ("MCEtaCharged","MC #eta_{h^{#pm}}  vs p_{T #pm}",
+    ("hMCEtaCharged","MC #eta_{h^{#pm}}  vs p_{T #pm}",
      nptbins,ptmin,ptmax,netabins,etamin,etamax); 
     fhMCEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
     fhMCEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
     
     fhMCPhiCharged  = new TH2F
-    ("MCPhiCharged","#MC phi_{h^{#pm}}  vs p_{T #pm}",
+    ("hMCPhiCharged","#MC phi_{h^{#pm}}  vs p_{T #pm}",
      200,ptmin,ptmax,nphibins,phimin,phimax); 
     fhMCPhiCharged->SetYTitle("MC #phi_{h^{#pm}} (rad)");
     fhMCPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
     
     fhMCDeltaPhiDeltaEtaCharged  = new TH2F
-    ("MCDeltaPhiDeltaEtaCharged","#MC phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
+    ("hMCDeltaPhiDeltaEtaCharged","#MC phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
      140,-2.,5.,200,-2,2); 
     fhMCDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi");
     fhMCDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");    
     
     fhMCDeltaEtaCharged  = new TH2F
-    ("MCDeltaEtaCharged","MC #eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger} and p_{T assoc}",
+    ("hMCDeltaEtaCharged","MC #eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger} and p_{T assoc}",
      nptbins,ptmin,ptmax,200,-2,2); 
     fhMCDeltaEtaCharged->SetYTitle("#Delta #eta");
     fhMCDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhMCDeltaPhiCharged  = new TH2F
-    ("MCDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
+    ("hMCDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
      nptbins,ptmin,ptmax,140,-2.,5.); 
     fhMCDeltaPhiCharged->SetYTitle("#Delta #phi");
     fhMCDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhMCDeltaPhiChargedPt  = new TH2F
-    ("MCDeltaPhiChargedPt","MC #phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
+    ("hMCDeltaPhiChargedPt","MC #phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
      nptbins,ptmin,ptmax,140,-2.,5.);
     fhMCDeltaPhiChargedPt->SetYTitle("#Delta #phi");
     fhMCDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
     
     fhMCPtImbalanceCharged  = 
-    new TH2F("MCCorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
+    new TH2F("hMCCorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhMCPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}");
     fhMCPtImbalanceCharged->SetXTitle("p_{T trigger}");  
     
     fhMCPtHbpCharged  = 
-    new TH2F("MCHbpCharged","MC #xi = ln(1/x_{E}) with charged hadrons",
+    new TH2F("hMCHbpCharged","MC #xi = ln(1/x_{E}) with charged hadrons",
              nptbins,ptmin,ptmax,200,0.,10.); 
     fhMCPtHbpCharged->SetYTitle("ln(1/x_{E})");
     fhMCPtHbpCharged->SetXTitle("p_{T trigger}");
     
     fhMCPtTrigPout  = 
-    new TH2F("MCPtTrigPout","AOD MC Pout with triggers",
+    new TH2F("hMCPtTrigPout","AOD MC Pout with triggers",
              nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax); 
     fhMCPtTrigPout->SetYTitle("p_{out} (GeV/c)");
     fhMCPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)"); 
     
     fhMCPtAssocDeltaPhi  = 
-    new TH2F("fhMCPtAssocDeltaPhi","AOD MC delta phi with associated charged hadrons",
+    new TH2F("hMCPtAssocDeltaPhi","AOD MC delta phi with associated charged hadrons",
              nptbins,ptmin,ptmax,140,-2.,5.); 
     fhMCPtAssocDeltaPhi->SetYTitle("#Delta #phi");
     fhMCPtAssocDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); 
@@ -746,12 +753,14 @@ void  AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
 {  
   //Particle-Hadron Correlation Analysis, fill AODs
   
-  if(!GetInputAODBranch()){
+  if(!GetInputAODBranch())
+  {
     printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
     abort();
   }
        
-  if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation")){
+  if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation"))
+  {
     printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Wrong type of AOD object, change AOD class name in input AOD: It should be <AliAODPWG4ParticleCorrelation> and not <%s> \n",GetInputAODBranch()->GetClass()->GetName());
     abort();
   }
@@ -773,29 +782,18 @@ void  AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
   Double_t ptTrig      = fMinTriggerPt ;
   fLeadingTriggerIndex = -1 ;
   Int_t    naod        = GetInputAODBranch()->GetEntriesFast() ;
-  for(Int_t iaod = 0; iaod < naod ; iaod++){
+  for(Int_t iaod = 0; iaod < naod ; iaod++)
+  {
     AliAODPWG4ParticleCorrelation* particle =  (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
     
-    //vertex cut in case of mixing
-    if (GetMixedEvent()) {
-      Int_t evt=-1;
-      Int_t id =-1;
-      if     (particle->GetCaloLabel(0)  >= 0 ){
-        id=particle->GetCaloLabel(0); 
-        if(id >= 0 )evt= GetMixedEvent()-> EventIndexForCaloCluster(id) ;
-      }
-      else if(particle->GetTrackLabel(0) >= 0 ){
-        id=particle->GetTrackLabel(0);
-        if(id >= 0 )evt= GetMixedEvent()->EventIndex(id) ;
-      }
-      else continue;
-      
-      if (TMath::Abs(GetVertex(evt)[2]) > GetZvertexCut()) 
-        return ;
-    }
-    
+    // Vertex cut in case of mixing
+    Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
+    if(check ==  0) continue;
+    if(check == -1) return;
+        
     // find the leading particles with highest momentum
-    if (particle->Pt() > ptTrig) {
+    if (particle->Pt() > ptTrig) 
+    {
       ptTrig               = particle->Pt() ;
       fLeadingTriggerIndex = iaod ;
     }
@@ -803,7 +801,8 @@ void  AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
        
   
   //Do correlation with leading particle
-  if(fLeadingTriggerIndex >= 0){
+  if(fLeadingTriggerIndex >= 0)
+  {
          
     AliAODPWG4ParticleCorrelation* particle =  (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
     
@@ -840,7 +839,7 @@ void  AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
     printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Begin hadron correlation analysis, fill histograms \n");
     printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
   }
-  
+    
   //Get the vertex and check it is not too large in z
   Double_t v[3] = {0,0,0}; //vertex ;
   GetReader()->GetVertex(v);
@@ -848,65 +847,70 @@ void  AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
   
   //Loop on stored AOD particles, find leading
   Double_t ptTrig    = fMinTriggerPt;
-  if(fLeadingTriggerIndex < 0){//Search leading if not done before
+  if(fLeadingTriggerIndex < 0)
+  {
+    //Search leading if not done before
     Int_t    naod      = GetInputAODBranch()->GetEntriesFast() ;
-    for(Int_t iaod = 0; iaod < naod ; iaod++){  //loop on input trigger AOD file 
+    for(Int_t iaod = 0; iaod < naod ; iaod++)
+    {   //loop on input trigger AOD file 
       AliAODPWG4ParticleCorrelation* particle =  (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
-      //vertex cut in case of mixing
-      if (GetMixedEvent()) {
-        Int_t evt=-1;
-        Int_t id =-1;
-        if     (particle->GetCaloLabel(0)  >= 0 ){
-          id=particle->GetCaloLabel(0); 
-          if(id >= 0 )evt= GetMixedEvent()-> EventIndexForCaloCluster(id) ;
-        }
-        else if(particle->GetTrackLabel(0) >= 0 ){
-          id=particle->GetTrackLabel(0);
-          if(id >= 0 )evt= GetMixedEvent()->EventIndex(id) ;
-        }
-        else continue;
-        
-        if (TMath::Abs(GetVertex(evt)[2]) > GetZvertexCut()) 
-          return ;
-      }
-            
+
+      // Vertex cut in case of mixing
+      Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
+      if(check ==  0) continue;
+      if(check == -1) return;
+      
       //check if the particle is isolated or if we want to take the isolation into account
       if(OnlyIsolated() && !particle->IsIsolated()) continue;
       
-      //check if inside the vertex cut
       //find the leading particles with highest momentum
-      if (particle->Pt() > ptTrig) {
+      if (particle->Pt() > ptTrig) 
+      {
         ptTrig               = particle->Pt() ;
         fLeadingTriggerIndex = iaod ;
       }
-    }//finish search of leading trigger particle
-  }//Search leading if not done before
+      
+    }// Finish search of leading trigger particle
+  }// Search leading if not done before
   
-  if(fLeadingTriggerIndex >= 0 ){ //using trigger particle to do correlations
+  if(fLeadingTriggerIndex >= 0 )
+  { //using trigger particle to do correlations
+    
     AliAODPWG4ParticleCorrelation* particle =  (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
 
-    //check if the particle is isolated or if we want to take the isolation into account
+    // Check if trigger is in fiducial region
+    if(IsFiducialCutOn())
+    {
+      Bool_t in = GetFiducialCut()->IsInFiducialCut(*particle->Momentum(),particle->GetDetector()) ;
+      if(! in ) return ;
+    }    
+    
+    // Check if the particle is isolated or if we want to take the isolation into account
     if(OnlyIsolated() && !particle->IsIsolated()) return;
     
-    //Make correlation with charged hadrons
+    // Make correlation with charged hadrons
     Bool_t okcharged = kTRUE;
     Bool_t okneutral = kTRUE;
-    if(GetReader()->IsCTSSwitchedOn() ){
+    if(GetReader()->IsCTSSwitchedOn() )
+    {
       okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kTRUE);
-      if(IsDataMC()){      
+      if(IsDataMC())
+      {      
         MakeMCChargedCorrelation(particle);
       }
     }  
     
     TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
-    if(fNeutralCorr && pi0list){
+    if(fNeutralCorr && pi0list)
+    {
       if(pi0list->GetEntriesFast() > 0)
         okneutral = MakeNeutralCorrelation(particle, pi0list,kTRUE);
     }
     
     // Fill leading particle histogram if correlation went well and 
     // no problem was found, like not absolute leading, or bad vertex in mixing.
-    if(okcharged && okneutral){
+    if(okcharged && okneutral)
+    {
       fhPtLeading->Fill(particle->Pt());
       Float_t phi = particle->Phi();
       if(phi<0)phi+=TMath::TwoPi();
@@ -937,14 +941,14 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
   Double_t v[3]      = {0,0,0}; //vertex ;
   GetReader()->GetVertex(v);
   
-  if (GetMixedEvent()) {
+  if (GetMixedEvent()) 
+  {
     evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
     evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;    
     evtIndex13 = GetMixedEvent()->EventIndex(aodParticle->GetTrackLabel(0)) ;
   }
   
   Double_t phiTrig = aodParticle->Phi();
-  Double_t etaTrig = aodParticle->Eta(); 
   Double_t ptTrig  = aodParticle->Pt();  
   
   Double_t pt             = -100. ;
@@ -980,38 +984,47 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
   Int_t nrefs           = 0;
   Int_t nTracks         = GetCTSTracks()->GetEntriesFast() ;
   
-  if(fPi0Trigger){
+  if(fPi0Trigger)
+  {
     indexPhoton1 = aodParticle->GetCaloLabel (0);
     indexPhoton2 = aodParticle->GetCaloLabel (1);
     if(GetDebug() > 1)printf("indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
     
-    if(indexPhoton1!=-1 && indexPhoton2!=-1){
+    if(indexPhoton1!=-1 && indexPhoton2!=-1)
+    {
       if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
       else                                    clusters = GetPHOSClusters()  ;
-      for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){
+      
+      for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++)
+      {
         AliVCluster * photon =  (AliVCluster*) (clusters->At(iclus));  
         photon->GetMomentum(photonMom,GetVertex(0)) ;
-        if(photon->GetID()==indexPhoton1) {
+        if(photon->GetID()==indexPhoton1) 
+        {
           ptDecay1  = photonMom.Pt();
           pxDecay1  = photonMom.Px();
           pyDecay1  = photonMom.Py();
           phiDecay1 = photonMom.Phi();
           if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig);
         }
-        if(photon->GetID()==indexPhoton2) {
+        if(photon->GetID()==indexPhoton2) 
+        {
           ptDecay2  = photonMom.Pt();
           pxDecay2  = photonMom.Px();
           pyDecay2  = photonMom.Py();
           phiDecay2 = photonMom.Phi();
           if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay2/ptTrig);
         } 
+        
         if(GetDebug() > 1)printf("Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
+        
       } //cluster loop        
     } //index of decay photons found
   } //make decay-hadron correlation
   
   //Track loop, select tracks with good pt, phi and fill AODs or histograms
-  for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ ){
+  for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ )
+  {
     AliVTrack * track = (AliVTrack *) (pl->At(ipr)) ;
     
     Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
@@ -1031,19 +1044,16 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
         track->GetID() == aodParticle->GetTrackLabel(2) || track->GetID() == aodParticle->GetTrackLabel(3)   ) 
       continue ;
     
-    if(IsFiducialCutOn()){
-      Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ;
-      if(! in ) continue ;
-    }    
-    
     //jump out this event if near side associated particle pt larger than trigger
-    if (fMakeAbsoluteLeading){
+    if (fMakeAbsoluteLeading)
+    {
       if(pt > ptTrig && TMath::Abs(phi-phiTrig)<TMath::PiOver2())  return kFALSE;
     }
     
     //Only for mixed event
     Int_t evtIndex2 = 0 ; 
-    if (GetMixedEvent()) {
+    if (GetMixedEvent()) 
+    {
       evtIndex2 = GetMixedEvent()->EventIndex(track->GetID()) ;
       if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 || evtIndex13 == evtIndex2 ) // photon and track from different events
         continue ; 
@@ -1052,8 +1062,10 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
         return kFALSE;
     }    
     
-    if(fPi0Trigger){
-      if(indexPhoton1!=-1 && indexPhoton2!=-1){
+    if(fPi0Trigger)
+    {
+      if(indexPhoton1!=-1 && indexPhoton2!=-1)
+      {
         if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
         if(ptDecay2) ratDecay2 = pt/ptDecay2 ; 
         deltaPhiDecay1 = phiDecay1-phi;
@@ -1100,25 +1112,27 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
       
       //Hardcoded values, BAD, FIXME
       Double_t  dphiBrad = atan2(sin(deltaPhiOrg), cos(deltaPhiOrg))/TMath::Pi();//-1 to 1
-      if(TMath::Abs(dphiBrad)>0.325 && TMath::Abs(dphiBrad)<0.475){
+      if(TMath::Abs(dphiBrad)>0.325 && TMath::Abs(dphiBrad)<0.475)
+      {
         fhAssocPtBkg->Fill(ptTrig, pt);
       }
       
       if(dphiBrad<-1./3) dphiBrad += 2;
       fhDeltaPhiBrad->Fill(ptTrig, dphiBrad);
       
-      if(assocBin>=0){
+      if(assocBin>=0)
+      {
         fhDeltaPhiBradAssocPtBin[assocBin]->Fill(ptTrig, dphiBrad);
         fhDeltaPhiAssocPtBin    [assocBin]->Fill(ptTrig, deltaPhi);
-        if(track->GetHMPIDsignal()>0){
-          printf("Track pt %f with HMPID signal %f \n",pt,track->GetHMPIDsignal());
+        if(track->GetHMPIDsignal()>0)
+        {
+          //printf("Track pt %f with HMPID signal %f \n",pt,track->GetHMPIDsignal());
           fhDeltaPhiAssocPtBinHMPID[assocBin]->Fill(ptTrig, deltaPhi);        
         }
         
         if(phi > 5*TMath::DegToRad() && phi < 20*TMath::DegToRad()){
           //printf("Track pt %f in HMPID acceptance phi %f \n ",pt,phi*TMath::RadToDeg() );
           fhDeltaPhiAssocPtBinHMPIDAcc[assocBin]->Fill(ptTrig, deltaPhi);        
-
         }
         
       }
@@ -1141,7 +1155,8 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
       }
       
       //delta phi cut for correlation
-      if      ( (deltaPhi > fDeltaPhiMinCut)   && (deltaPhi < fDeltaPhiMaxCut)   ) {
+      if      ( (deltaPhi > fDeltaPhiMinCut)   && (deltaPhi < fDeltaPhiMaxCut)   ) 
+      {
         fhDeltaPhiChargedPt ->Fill(pt,deltaPhi);
         fhPtImbalanceCharged->Fill(ptTrig,xE); 
         fhPtHbpCharged ->Fill(ptTrig, cosi);
@@ -1157,7 +1172,8 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
           }
         } //multiplicity events selection
       } //delta phi cut for correlation
-      else if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) ) { //UE study
+      else if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) ) 
+      { //UE study
         fhDeltaPhiUeChargedPt->Fill(pt,deltaPhi);
         Double_t randomphi = gRandom->Uniform(TMath::Pi()/2,3*TMath::Pi()/2);
         Double_t uexE = -(pt/ptTrig)*TMath::Cos(randomphi);
@@ -1174,44 +1190,50 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
         
       } //UE study
       
-      if(fPi0Trigger){
-        if(indexPhoton1!=-1 && indexPhoton2!=-1){
+      if(fPi0Trigger)
+      {
+        if(indexPhoton1!=-1 && indexPhoton2!=-1)
+        {
           fhDeltaPhiDecayCharged->Fill(ptDecay1, deltaPhiDecay1);
           fhDeltaPhiDecayCharged->Fill(ptDecay2, deltaPhiDecay2);
+          
           if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
+          
           if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
             fhPtImbalanceDecayCharged->Fill(ptDecay1,ratDecay1); 
+          
           if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
             fhPtImbalanceDecayCharged->Fill(ptDecay2,ratDecay2);
+          
           if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2);
+          
         } //index of decay photons found
       } //make decay-hadron correlation          
       
       //several UE calculation 
-      if(fMakeSeveralUE){
-        if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut)){  
+      if(fMakeSeveralUE)
+      {
+        if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut))
+        {  
           fhDeltaPhiUeLeftCharged->Fill(pt,deltaPhi);
           fhPtImbalanceUeLeftCharged->Fill(ptTrig,rat);
           fhPtHbpUeLeftCharged->Fill(ptTrig,cosi);
         }
-        if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut)){  
+        
+        if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut))
+        {  
           fhDeltaPhiUeRightCharged->Fill(pt,deltaPhi);
           fhPtImbalanceUeRightCharged->Fill(ptTrig,rat);
           fhPtHbpUeRightCharged->Fill(ptTrig,cosi);
-          
         }
       } //several UE calculation
-      
-      //Fill leading particle histogram   
-      fhPtLeading->Fill(ptTrig);
-      if(phiTrig<0)phiTrig+=TMath::TwoPi();
-      fhPhiLeading->Fill(ptTrig, phiTrig);
-      fhEtaLeading->Fill(ptTrig, etaTrig);
-      
+            
     } //Fill histogram 
-    else{
+    else
+    {
       nrefs++;
-      if(nrefs==1){
+      if(nrefs==1)
+      {
         reftracks = new TObjArray(0);
         TString trackname = Form("%s+Tracks", GetAODObjArrayName().Data());
         reftracks->SetName(trackname.Data());
@@ -1222,7 +1244,8 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
   }// track loop
   
   //Fill AOD with reference tracks, if not filling histograms
-  if(!bFillHisto && reftracks) {
+  if(!bFillHisto && reftracks) 
+  {
     aodParticle->AddObjArray(reftracks);
   }
   
@@ -1239,7 +1262,8 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Partic
   
   Int_t evtIndex11 = 0 ; 
   Int_t evtIndex12 = 0 ; 
-  if (GetMixedEvent()) {
+  if (GetMixedEvent()) 
+  {
     evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
     evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;    
   }  
@@ -1285,44 +1309,58 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Partic
     if(GetDebug() > 1)
       printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
     
-    if(indexPhoton1!=-1 && indexPhoton2!=-1){
+    if(indexPhoton1!=-1 && indexPhoton2!=-1)
+    {
       if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
       else                                    clusters = GetPHOSClusters() ;
-      for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){
+      
+      for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++)
+      {
         AliVCluster * photon =  (AliVCluster*) (clusters->At(iclus));  
         photon->GetMomentum(photonMom,GetVertex(0)) ;
-        if(photon->GetID()==indexPhoton1) {
+        if(photon->GetID()==indexPhoton1) 
+        {
           ptDecay1  = photonMom.Pt();
           pxDecay1  = photonMom.Px();
           pyDecay1  = photonMom.Py();
           phiDecay1 = photonMom.Phi();
         }
-        if(photon->GetID()==indexPhoton2) {
+        
+        if(photon->GetID()==indexPhoton2) 
+        {
           ptDecay2  = photonMom.Pt();
           pxDecay2  = photonMom.Px();
           pyDecay2  = photonMom.Py();
           phiDecay2 = photonMom.Phi();
         } 
+        
         if(GetDebug() > 1)
           printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
+        
       } //photonAOD loop        
     } //index of decay photons found
+    
     if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig, ptDecay2/ptTrig);
+
   } //make decay-hadron correlation
   
   TObjArray * refpi0    =0x0;
   Int_t nrefs = 0;
   
   //Loop on stored AOD pi0
+  
   Int_t naod = pi0list->GetEntriesFast();
   if(GetDebug() > 0) 
     printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() -  aod branch entries %d\n", naod);
-  for(Int_t iaod = 0; iaod < naod ; iaod++){
+  
+  for(Int_t iaod = 0; iaod < naod ; iaod++)
+  {
     AliAODPWG4Particle* pi0 =  (AliAODPWG4Particle*) (pi0list->At(iaod));
     
     Int_t evtIndex2 = 0 ; 
     Int_t evtIndex3 = 0 ; 
-    if (GetMixedEvent()) {
+    if (GetMixedEvent()) 
+    {
       evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(0)) ;
       evtIndex3 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(1)) ;
       
@@ -1348,10 +1386,11 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Partic
     //Float_t deltaPhi = TMath::Abs(phiTrig-phi);
     //if( (deltaPhi < fDeltaPhiMinCut) || ( deltaPhi > fDeltaPhiMaxCut) ) continue ;
     
-    if(bFillHisto){
+    if(bFillHisto)
+    {
       
       deltaPhi = phiTrig-phi;
-      if(deltaPhi<-TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
+      if(deltaPhi<-TMath::PiOver2())  deltaPhi+=TMath::TwoPi();
       if(deltaPhi>3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
       
       rat = pt/ptTrig ;
@@ -1364,8 +1403,10 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Partic
       cosi = -100;
       if(xE > 0 ) cosi = TMath::Log(1./xE); 
       
-      if(fPi0Trigger){
-        if(indexPhoton1!=-1 && indexPhoton2!=-1){
+      if(fPi0Trigger)
+      {
+        if(indexPhoton1!=-1 && indexPhoton2!=-1)
+        {
           if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
           if(ptDecay2) ratDecay2 = pt/ptDecay2 ; 
           deltaPhiDecay1 = phiDecay1-phi;
@@ -1392,33 +1433,39 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Partic
       fhDeltaPhiDeltaEtaNeutral->Fill(deltaPhi,etaTrig-eta);
       
       //delta phi cut for correlation
-      if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) ) {
+      if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) ) 
+      {
         fhDeltaPhiNeutralPt->Fill(pt,deltaPhi);
         fhPtImbalanceNeutral->Fill(ptTrig,rat); 
         fhPtHbpNeutral->Fill(ptTrig,cosi); 
       }
-      else {
+      else 
+      {
         fhDeltaPhiUeNeutralPt->Fill(pt,deltaPhi);
         fhPtImbalanceUeNeutral->Fill(ptTrig,rat);
         fhPtHbpUeNeutral->Fill(ptTrig,cosi); 
       }
       //several UE calculation 
       if(fMakeSeveralUE){
-        if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut)){  
+        if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut))
+        {  
           fhDeltaPhiUeLeftNeutral->Fill(pt,deltaPhi);
           fhPtImbalanceUeLeftNeutral->Fill(ptTrig,rat);
           fhPtHbpUeLeftNeutral->Fill(ptTrig,cosi);
         }
-        if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut)){  
+        if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut))
+        {  
           fhDeltaPhiUeRightNeutral->Fill(pt,deltaPhi);
           fhPtImbalanceUeRightNeutral->Fill(ptTrig,rat);
           fhPtHbpUeRightNeutral->Fill(ptTrig,cosi);
         }
       } //several UE calculation
          }
-    else{
+    else
+    {
       nrefs++;
-      if(nrefs==1){
+      if(nrefs==1)
+      {
         refpi0 = new TObjArray(0);
         refpi0->SetName(GetAODObjArrayName()+"Pi0s");
         refpi0->SetOwner(kFALSE);
@@ -1472,10 +1519,14 @@ void  AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4Partic
   Double_t mcTrackPy  = 0 ;
   Double_t mcTrackPz  = 0 ;
 
-  if(GetReader()->ReadStack()){
+  if(GetReader()->ReadStack())
+  {
     nTracks = GetMCStack()->GetNtrack() ;
   }
-  else nTracks = GetReader()->GetAODMCParticles()->GetEntriesFast() ;
+  else 
+  {
+    nTracks = GetReader()->GetAODMCParticles()->GetEntriesFast() ;
+  }
   //Int_t trackIndex[nTracks];
   
   Int_t label= aodParticle->GetLabel();
@@ -1484,7 +1535,8 @@ void  AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4Partic
     return;
   }  
   
-  if(GetReader()->ReadStack()){
+  if(GetReader()->ReadStack())
+  {
     stack =  GetMCStack() ;
     if(!stack) {
       printf(" AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation- Stack not available, is the MC handler called? STOP\n");
@@ -1492,27 +1544,33 @@ void  AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4Partic
     }
     
     nTracks=stack->GetNprimary();
-    if(label >=  stack->GetNtrack()) {
+    if(label >=  stack->GetNtrack()) 
+    {
       if(GetDebug() > 2)  printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***:  label %d, n tracks %d \n", label, stack->GetNtrack());
       return ;
     }
+    
     primary = stack->Particle(label);
-    if(!primary){
+    if(!primary)
+    {
       printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no primary ***:  label %d \n", label);   
       return;
     }
     
-    eprim    = primary->Energy();
-    ptprim   = primary->Pt();
-    phiprim  = primary->Phi();
-    etaprim  = primary->Eta();
-    pxprim   = primary->Px();
-    pyprim   = primary->Py();
-    pzprim   = primary->Pz(); 
-    
-    if(primary){
+    if(primary)
+    {
+      eprim    = primary->Energy();
+      ptprim   = primary->Pt();
+      phiprim  = primary->Phi();
+      etaprim  = primary->Eta();
+      pxprim   = primary->Px();
+      pyprim   = primary->Py();
+      pzprim   = primary->Pz(); 
+      
+      if(ptprim < 0.01 || eprim < 0.01) return ;
       
-      for (iParticle = 0 ; iParticle <  nTracks ; iParticle++) {
+      for (iParticle = 0 ; iParticle <  nTracks ; iParticle++) 
+      {
         TParticle * particle = stack->Particle(iParticle);
         TLorentzVector momentum;
         //keep only final state particles
@@ -1522,7 +1580,8 @@ void  AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4Partic
         particle->Momentum(momentum);
         
         //---------- Charged particles ----------------------
-        if(charge != 0){   
+        if(charge != 0)
+        {   
           //Particles in CTS acceptance
           Bool_t inCTS =  GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
           if(TMath::Abs(pdg) == 11 && stack->Particle(particle->GetFirstMother())->GetPdgCode()==22) continue ;
@@ -1590,38 +1649,48 @@ void  AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4Partic
       } //track loop
     } //when the leading particles could trace back to MC
   } //ESD MC
-  else if(GetReader()->ReadAODMCParticles()){
+  else if(GetReader()->ReadAODMCParticles())
+  {
     //Get the list of MC particles
     mcparticles0 = GetReader()->GetAODMCParticles(0);
     if(!mcparticles0) return;
-    if(label >=mcparticles0->GetEntriesFast()){
+    if(label >=mcparticles0->GetEntriesFast())
+    {
       if(GetDebug() > 2)  
         printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***:  label %d, n tracks %d \n", label,mcparticles0->GetEntriesFast());
       return;
     }
     //Get the particle
     aodprimary = (AliAODMCParticle*) mcparticles0->At(label);
-    if(!aodprimary)  {
+    if(!aodprimary)  
+    {
       printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no AOD primary ***:  label %d \n", label);   
       return;
     }
     
-    ptprim  = aodprimary->Pt();
-    phiprim = aodprimary->Phi();
-    etaprim = aodprimary->Eta();
-    pxprim  = aodprimary->Px();
-    pyprim  = aodprimary->Py();
-    pzprim  = aodprimary->Pz();  
-    if(aodprimary){
+    if(aodprimary)
+    {
+      ptprim  = aodprimary->Pt();
+      phiprim = aodprimary->Phi();
+      etaprim = aodprimary->Eta();
+      pxprim  = aodprimary->Px();
+      pyprim  = aodprimary->Py();
+      pzprim  = aodprimary->Pz();  
+      
+      if(ptprim < 0.01 || eprim < 0.01) return ;
+      
       mcparticles= GetReader()->GetAODMCParticles();
-      for (Int_t i=0; i<nTracks;i++) {
+      for (Int_t i=0; i<nTracks;i++) 
+      {
         AliAODMCParticle *part = (AliAODMCParticle*) mcparticles->At(i);
         if (!part->IsPhysicalPrimary()) continue;        
         Int_t pdg = part->GetPdgCode();        
         charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
         TLorentzVector momentum(part->Px(),part->Py(),part->Pz(),part->E());        
-        if(charge != 0){
-          if(part->Pt()> GetReader()->GetCTSPtMin()){
+        if(charge != 0)
+        {
+          if(part->Pt()> GetReader()->GetCTSPtMin())
+          {
             //Particles in CTS acceptance
             Bool_t inCTS =  GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
             Int_t indexmother=part->GetMother();
@@ -1630,6 +1699,7 @@ void  AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4Partic
               Int_t mPdg = ((AliAODMCParticle*) mcparticles->At(indexmother)) ->GetPdgCode();
               if(TMath::Abs(pdg) == 11 && mPdg == 22) continue;
             }
+            
             if(inCTS)
             {            
               mcTrackPt  =part->Pt();