]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.cxx
Modification of AddTRD task for calibration (Raphaelle)
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaPi0EbE.cxx
index d4bc2d37cecade99c7ed47b7bc320cf3e534ae7f..196c6c83bbba197e43a3717673ded2930f6f6620 100755 (executable)
@@ -48,66 +48,77 @@ ClassImp(AliAnaPi0EbE)
 
 //____________________________
 AliAnaPi0EbE::AliAnaPi0EbE() :
-AliAnaCaloTrackCorrBaseClass(),fAnaType(kIMCalo),            fCalorimeter(""),
-fMinDist(0.),fMinDist2(0.),    fMinDist3(0.),
-fNLMCutMin(-1),                fNLMCutMax(10),
-fTimeCutMin(-10000),           fTimeCutMax(10000),
+AliAnaCaloTrackCorrBaseClass(),     fAnaType(kIMCalo),                  fCalorimeter(""),
+fMinDist(0.),fMinDist2(0.),         fMinDist3(0.),
+fNLMCutMin(-1),                     fNLMCutMax(10),
+fTimeCutMin(-10000),                fTimeCutMax(10000),
 fRejectTrackMatch(kTRUE),
 fFillPileUpHistograms(0),
-fFillWeightHistograms(kFALSE), fFillTMHisto(0),
-fFillSelectClHisto(0),         fFillOnlySimpleSSHisto(1),    fFillEMCALBCHistograms(0),
+fFillWeightHistograms(kFALSE),      fFillTMHisto(0),
+fFillSelectClHisto(0),              fFillOnlySimpleSSHisto(1),          fFillEMCALBCHistograms(0),
 fInputAODGammaConvName(""),
+fCheckSplitDistToBad(0),
 // Histograms
-fhPt(0),                       fhE(0),
-fhEEta(0),                     fhEPhi(0),
-fhPtEta(0),                    fhPtPhi(0),                   fhEtaPhi(0),
-fhEtaPhiEMCALBC0(0),           fhEtaPhiEMCALBC1(0),          fhEtaPhiEMCALBCN(0),
+fhPt(0),                            fhE(0),
+fhEEta(0),                          fhEPhi(0),
+fhPtEta(0),                         fhPtPhi(0),                         fhEtaPhi(0),
+fhEtaPhiEMCALBC0(0),                fhEtaPhiEMCALBC1(0),                fhEtaPhiEMCALBCN(0),
 fhTimeTriggerEMCALBC0UMReMatchOpenTime(0),
 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh(0),
 fhTimeTriggerEMCALBC0UMReMatchBoth(0),
-fhPtCentrality(),              fhPtEventPlane(0),
-fhPtReject(0),                 fhEReject(0),
-fhEEtaReject(0),               fhEPhiReject(0),              fhEtaPhiReject(0),
-fhMass(0),                     fhMassPt(0),                  fhMassSplitPt(0),
-fhSelectedMass(0),             fhSelectedMassPt(0),          fhSelectedMassSplitPt(0),
-fhAsymmetry(0),                fhSelectedAsymmetry(0),
-fhSplitE(0),                   fhSplitPt(0),
-fhSplitPtEta(0),               fhSplitPtPhi(0),
+fhPtCentrality(),                   fhPtEventPlane(0),
+fhPtReject(0),                      fhEReject(0),
+fhEEtaReject(0),                    fhEPhiReject(0),                    fhEtaPhiReject(0),
+fhMass(0),                          fhMassPt(0),                        fhMassSplitPt(0),
+fhSelectedMass(0),                  fhSelectedMassPt(0),                fhSelectedMassSplitPt(0),
+fhMassNoOverlap(0),                 fhMassPtNoOverlap(0),               fhMassSplitPtNoOverlap(0),
+fhSelectedMassNoOverlap(0),         fhSelectedMassPtNoOverlap(0),       fhSelectedMassSplitPtNoOverlap(0),
+fhMCPi0PtRecoPtPrim(0),                       fhMCEtaPtRecoPtPrim(0),
+fhMCPi0PtRecoPtPrimNoOverlap(0),              fhMCEtaPtRecoPtPrimNoOverlap(0),
+fhMCPi0SplitPtRecoPtPrim(0),                  fhMCEtaSplitPtRecoPtPrim(0),
+fhMCPi0SplitPtRecoPtPrimNoOverlap(0),         fhMCEtaSplitPtRecoPtPrimNoOverlap(0),
+fhMCPi0SelectedPtRecoPtPrim(0),               fhMCEtaSelectedPtRecoPtPrim(0),
+fhMCPi0SelectedPtRecoPtPrimNoOverlap(0),      fhMCEtaSelectedPtRecoPtPrimNoOverlap(0),
+fhMCPi0SelectedSplitPtRecoPtPrim(0),          fhMCEtaSelectedSplitPtRecoPtPrim(0),
+fhMCPi0SelectedSplitPtRecoPtPrimNoOverlap(0), fhMCEtaSelectedSplitPtRecoPtPrimNoOverlap(0),
+fhAsymmetry(0),                     fhSelectedAsymmetry(0),
+fhSplitE(0),                        fhSplitPt(0),
+fhSplitPtEta(0),                    fhSplitPtPhi(0),
 fhNLocMaxSplitPt(0),
-fhPtDecay(0),                  fhEDecay(0),
+fhPtDecay(0),                       fhEDecay(0),
 // Shower shape histos
-fhEDispersion(0),              fhELambda0(0),                fhELambda1(0),
-fhELambda0NoTRD(0),            fhELambda0FracMaxCellCut(0),
-fhEFracMaxCell(0),             fhEFracMaxCellNoTRD(0),
-fhENCells(0),                  fhETime(0),                   fhEPairDiffTime(0),
-fhDispEtaE(0),                 fhDispPhiE(0),
-fhSumEtaE(0),                  fhSumPhiE(0),                 fhSumEtaPhiE(0),
-fhDispEtaPhiDiffE(0),          fhSphericityE(0),
+fhEDispersion(0),                   fhELambda0(0),                      fhELambda1(0),
+fhELambda0NoTRD(0),                 fhELambda0FracMaxCellCut(0),
+fhEFracMaxCell(0),                  fhEFracMaxCellNoTRD(0),
+fhENCells(0),                       fhETime(0),                         fhEPairDiffTime(0),
+fhDispEtaE(0),                      fhDispPhiE(0),
+fhSumEtaE(0),                       fhSumPhiE(0),                       fhSumEtaPhiE(0),
+fhDispEtaPhiDiffE(0),               fhSphericityE(0),
 
 // MC histos
-fhMCE(),                       fhMCPt(),
-fhMCPhi(),                     fhMCEta(),
-fhMCEReject(),                 fhMCPtReject(),
+fhMCE(),                            fhMCPt(),
+fhMCPhi(),                          fhMCEta(),
+fhMCEReject(),                      fhMCPtReject(),
 fhMCPtCentrality(),
-fhMCPi0PtGenRecoFraction(0),   fhMCEtaPtGenRecoFraction(0),
-fhMCPi0DecayPt(0),             fhMCPi0DecayPtFraction(0),
-fhMCEtaDecayPt(0),             fhMCEtaDecayPtFraction(0),
+fhMCPi0PtGenRecoFraction(0),        fhMCEtaPtGenRecoFraction(0),
+fhMCPi0DecayPt(0),                  fhMCPi0DecayPtFraction(0),
+fhMCEtaDecayPt(0),                  fhMCEtaDecayPtFraction(0),
 fhMCOtherDecayPt(0),
-fhMassPairMCPi0(0),            fhMassPairMCEta(0),
-fhAnglePairMCPi0(0),           fhAnglePairMCEta(0),
+fhMassPairMCPi0(0),                 fhMassPairMCEta(0),
+fhAnglePairMCPi0(0),                fhAnglePairMCEta(0),
 // Weight studies
-fhECellClusterRatio(0),        fhECellClusterLogRatio(0),
-fhEMaxCellClusterRatio(0),     fhEMaxCellClusterLogRatio(0),
-fhTrackMatchedDEta(0),         fhTrackMatchedDPhi(0),        fhTrackMatchedDEtaDPhi(0),
-fhTrackMatchedDEtaPos(0),      fhTrackMatchedDPhiPos(0),     fhTrackMatchedDEtaDPhiPos(0),
-fhTrackMatchedDEtaNeg(0),      fhTrackMatchedDPhiNeg(0),     fhTrackMatchedDEtaDPhiNeg(0),
+fhECellClusterRatio(0),             fhECellClusterLogRatio(0),
+fhEMaxCellClusterRatio(0),          fhEMaxCellClusterLogRatio(0),
+fhTrackMatchedDEta(0),              fhTrackMatchedDPhi(0),              fhTrackMatchedDEtaDPhi(0),
+fhTrackMatchedDEtaPos(0),           fhTrackMatchedDPhiPos(0),           fhTrackMatchedDEtaDPhiPos(0),
+fhTrackMatchedDEtaNeg(0),           fhTrackMatchedDPhiNeg(0),           fhTrackMatchedDEtaDPhiNeg(0),
 fhTrackMatchedMCParticleE(0),
-fhTrackMatchedMCParticleDEta(0), fhTrackMatchedMCParticleDPhi(0),
-fhdEdx(0),                     fhEOverP(0),                 fhEOverPNoTRD(0),
+fhTrackMatchedMCParticleDEta(0),    fhTrackMatchedMCParticleDPhi(0),
+fhdEdx(0),                          fhEOverP(0),                        fhEOverPNoTRD(0),
 // Number of local maxima in cluster
-fhNLocMaxE(0),                 fhNLocMaxPt(0),
+fhNLocMaxE(0),                      fhNLocMaxPt(0),                     fhNLocMaxPtReject(0),
 // PileUp
-fhTimePtNoCut(0),                    fhTimePtSPD(0),           fhTimePtSPDMulti(0),
+fhTimePtNoCut(0),                   fhTimePtSPD(0),                     fhTimePtSPDMulti(0),
 fhTimeNPileUpVertSPD(0),            fhTimeNPileUpVertTrack(0),
 fhTimeNPileUpVertContributors(0),
 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0),
@@ -121,7 +132,6 @@ fhPtNPileUpSPDVtxTimeCut2(0),       fhPtNPileUpTrkVtxTimeCut2(0)
   {
     fhMCE              [i] = 0;
     fhMCPt             [i] = 0;
-    fhMCNLocMaxPt      [i] = 0;
     fhMCPhi            [i] = 0;
     fhMCEta            [i] = 0;
     fhMCPtCentrality   [i] = 0;
@@ -130,7 +140,10 @@ fhPtNPileUpSPDVtxTimeCut2(0),       fhPtNPileUpTrkVtxTimeCut2(0)
     fhMCSplitPt        [i] = 0;
     fhMCSplitPtPhi     [i] = 0;
     fhMCSplitPtEta     [i] = 0;
+    
+    fhMCNLocMaxPt      [i] = 0;
     fhMCNLocMaxSplitPt [i] = 0;
+    fhMCNLocMaxPtReject[i] = 0;
     
     fhEMCLambda0       [i] = 0;
     fhEMCLambda0NoTRD  [i] = 0;
@@ -151,6 +164,11 @@ fhPtNPileUpSPDVtxTimeCut2(0),       fhPtNPileUpTrkVtxTimeCut2(0)
     fhMCSelectedMassPt     [i]=0;
     fhMCSelectedMassSplitPt[i]=0;
     
+    fhMCMassPtNoOverlap             [i]=0;
+    fhMCMassSplitPtNoOverlap        [i]=0;
+    fhMCSelectedMassPtNoOverlap     [i]=0;
+    fhMCSelectedMassSplitPtNoOverlap[i]=0;
+    
     for(Int_t j = 0; j < 7; j++)
     {
       fhMCLambda0DispEta    [j][i] = 0;
@@ -210,8 +228,8 @@ fhPtNPileUpSPDVtxTimeCut2(0),       fhPtNPileUpTrkVtxTimeCut2(0)
   
 }
 
-//_______________________________________________________________________________________________
-void AliAnaPi0EbE::FillPileUpHistograms(const Float_t pt, const Float_t time, AliVCluster * calo)
+//___________________________________________________________________________________
+void AliAnaPi0EbE::FillPileUpHistograms(Float_t pt, Float_t time, AliVCluster * calo)
 {
   // Fill some histograms to understand pile-up
   if(!fFillPileUpHistograms) return;
@@ -384,8 +402,8 @@ void AliAnaPi0EbE::FillPileUpHistograms(const Float_t pt, const Float_t time, Al
 }
 
 
-//___________________________________________________________________________________________
-void AliAnaPi0EbE::FillRejectedClusterHistograms(const TLorentzVector mom, const Int_t mctag)
+//______________________________________________________________________________________________
+void AliAnaPi0EbE::FillRejectedClusterHistograms(TLorentzVector mom, Int_t mctag, Int_t nMaxima)
 {
   // Fill histograms that do not pass the identification (SS case only)
   
@@ -402,19 +420,20 @@ void AliAnaPi0EbE::FillRejectedClusterHistograms(const TLorentzVector mom, const
   fhEPhiReject   ->Fill(ener,phi);
   fhEtaPhiReject ->Fill(eta,phi);
   
+  fhNLocMaxPtReject->Fill(pt,nMaxima);
+
   if(IsDataMC())
   {
     Int_t mcIndex = GetMCIndex(mctag);
     fhMCEReject  [mcIndex] ->Fill(ener);
     fhMCPtReject [mcIndex] ->Fill(pt);
+    fhMCNLocMaxPtReject[mcIndex]->Fill(pt,nMaxima);
   }
 }
 
-//_____________________________________________________________________________________
-void AliAnaPi0EbE::FillSelectedClusterHistograms(AliVCluster* cluster,
-                                                 const Int_t nMaxima,
-                                                 const Int_t tag,
-                                                 const Float_t asy)
+//___________________________________________________________________________________
+void AliAnaPi0EbE::FillSelectedClusterHistograms(AliVCluster* cluster, Int_t nMaxima,
+                                                 Int_t tag, Float_t asy)
 {
   // Fill shower shape, timing and other histograms for selected clusters from decay
   
@@ -986,6 +1005,33 @@ TList *  AliAnaPi0EbE::GetCreateOutputObjects()
   fhSelectedMassPt->SetYTitle("mass (GeV/c^{2})");
   fhSelectedMassPt->SetXTitle("p_{T} (GeV/c)");
   outputContainer->Add(fhSelectedMassPt) ;
+
+  if(IsDataMC() && fAnaType == kSSCalo)
+  {
+    fhMassNoOverlap  = new TH2F
+    ("hMassNoOverlap","all pairs mass: E vs mass, no overlap",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+    fhMassNoOverlap->SetYTitle("mass (GeV/c^{2})");
+    fhMassNoOverlap->SetXTitle("E (GeV)");
+    outputContainer->Add(fhMassNoOverlap) ;
+    
+    fhSelectedMassNoOverlap  = new TH2F
+    ("hSelectedMassNoOverlap","Selected #pi^{0} (#eta) pairs mass: E vs mass, no overlap",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+    fhSelectedMassNoOverlap->SetYTitle("mass (GeV/c^{2})");
+    fhSelectedMassNoOverlap->SetXTitle("E (GeV)");
+    outputContainer->Add(fhSelectedMassNoOverlap) ;
+    
+    fhMassPtNoOverlap  = new TH2F
+    ("hMassPtNoOverlap","all pairs mass: p_{T} vs mass, no overlap",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+    fhMassPtNoOverlap->SetYTitle("mass (GeV/c^{2})");
+    fhMassPtNoOverlap->SetXTitle("p_{T} (GeV/c)");
+    outputContainer->Add(fhMassPtNoOverlap) ;
+    
+    fhSelectedMassPtNoOverlap  = new TH2F
+    ("hSelectedMassPtNoOverlap","Selected #pi^{0} (#eta) pairs mass: p_{T} vs mass, no overlap",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+    fhSelectedMassPtNoOverlap->SetYTitle("mass (GeV/c^{2})");
+    fhSelectedMassPtNoOverlap->SetXTitle("p_{T} (GeV/c)");
+    outputContainer->Add(fhSelectedMassPtNoOverlap) ;
+  }
   
   if(fAnaType != kSSCalo)
   {
@@ -1122,11 +1168,17 @@ TList *  AliAnaPi0EbE::GetCreateOutputObjects()
     
     if(fAnaType == kSSCalo)
     {
-      fhNLocMaxPt = new TH2F("hNLocMaxPt","Number of local maxima in cluster",
+      fhNLocMaxPt = new TH2F("hNLocMaxPt","Number of local maxima in cluster, selected clusters",
                              nptbins,ptmin,ptmax,10,0,10);
       fhNLocMaxPt ->SetYTitle("N maxima");
       fhNLocMaxPt ->SetXTitle("p_{T} (GeV/c)");
       outputContainer->Add(fhNLocMaxPt) ;
+
+      fhNLocMaxPtReject = new TH2F("hNLocMaxPtReject","Number of local maxima in cluster, rejected clusters",
+                             nptbins,ptmin,ptmax,10,0,10);
+      fhNLocMaxPtReject ->SetYTitle("N maxima");
+      fhNLocMaxPtReject ->SetXTitle("p_{T} (GeV/c)");
+      outputContainer->Add(fhNLocMaxPtReject) ;
     }
     
     for (Int_t i = 0; i < 3; i++)
@@ -1543,14 +1595,21 @@ TList *  AliAnaPi0EbE::GetCreateOutputObjects()
         
         if(fAnaType == kSSCalo)
         {
-          
           fhMCNLocMaxPt[i] = new TH2F
           (Form("hNLocMaxPt_MC%s",pname[i].Data()),
-           Form("cluster from %s, pT of cluster, for NLM",ptype[i].Data()),
+           Form("cluster from %s, pT of cluster vs NLM, accepted",ptype[i].Data()),
            nptbins,ptmin,ptmax,10,0,10);
           fhMCNLocMaxPt[i] ->SetYTitle("N maxima");
           fhMCNLocMaxPt[i] ->SetXTitle("p_{T} (GeV/c)");
           outputContainer->Add(fhMCNLocMaxPt[i]) ;
+          fhMCNLocMaxPtReject[i] = new TH2F
+          (Form("hNLocMaxPtReject_MC%s",pname[i].Data()),
+           Form("cluster from %s, pT of cluster vs NLM, rejected",ptype[i].Data()),
+           nptbins,ptmin,ptmax,10,0,10);
+          fhMCNLocMaxPtReject[i] ->SetYTitle("N maxima");
+          fhMCNLocMaxPtReject[i] ->SetXTitle("p_{T} (GeV/c)");
+          outputContainer->Add(fhMCNLocMaxPtReject[i]) ;
           
           fhMCEReject[i]  = new TH1F
           (Form("hEReject_MC%s",pname[i].Data()),
@@ -1603,6 +1662,24 @@ TList *  AliAnaPi0EbE::GetCreateOutputObjects()
         fhMCSelectedMassPt[i]->SetXTitle("p_{T} (GeV/c)");
         outputContainer->Add(fhMCSelectedMassPt[i]) ;
         
+        if(fAnaType == kSSCalo)
+        {
+          fhMCMassPtNoOverlap[i]  = new TH2F
+          (Form("hMassPtNoOverlap_MC%s",pname[i].Data()),
+           Form("all pairs mass: p_{T} vs massfrom %s, no overlap",ptype[i].Data()),
+           nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+          fhMCMassPt[i]->SetYTitle("mass (GeV/c^{2})");
+          fhMCMassPt[i]->SetXTitle("p_{T} (GeV/c)");
+          outputContainer->Add(fhMCMassPtNoOverlap[i]) ;
+          
+          fhMCSelectedMassPtNoOverlap[i]  = new TH2F
+          (Form("hSelectedMassPtNoOverlap_MC%s",pname[i].Data()),
+           Form("Selected #pi^{0} (#eta) pairs mass: p_{T} vs massfrom %s, no overlap",ptype[i].Data()),
+           nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+          fhMCSelectedMassPtNoOverlap[i]->SetYTitle("mass (GeV/c^{2})");
+          fhMCSelectedMassPtNoOverlap[i]->SetXTitle("p_{T} (GeV/c)");
+          outputContainer->Add(fhMCSelectedMassPtNoOverlap[i]) ;
+        }
         
         if( fFillSelectClHisto )
         {
@@ -1768,21 +1845,150 @@ TList *  AliAnaPi0EbE::GetCreateOutputObjects()
     
     
     fhMassSplitPt  = new TH2F
-    ("hMassSplitPt","all pairs mass: sum split sub-cluster p_{T} vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+    ("hMassSplitPt","all pairs mass: sum split sub-cluster p_{T} vs mass",
+     nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
     fhMassSplitPt->SetYTitle("mass (GeV/c^{2})");
     fhMassSplitPt->SetXTitle("p_{T} (GeV/c)");
     outputContainer->Add(fhMassSplitPt) ;
     
     fhSelectedMassSplitPt  = new TH2F
-    ("hSelectedMassSplitPt","Selected #pi^{0} (#eta) pairs mass: sum split sub-cluster p_{T} vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+    ("hSelectedMassSplitPt","Selected #pi^{0} (#eta) pairs mass: sum split sub-cluster p_{T} vs mass",
+     nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
     fhSelectedMassSplitPt->SetYTitle("mass (GeV/c^{2})");
     fhSelectedMassSplitPt->SetXTitle("p_{T} (GeV/c)");
     outputContainer->Add(fhSelectedMassSplitPt) ;
     
-    
-    
     if(IsDataMC())
     {
+      fhMassSplitPtNoOverlap  = new TH2F
+      ("hMassSplitPtNoOverlap","all pairs mass: sum split sub-cluster p_{T} vs mass, no overlap",
+       nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+      fhMassSplitPtNoOverlap->SetYTitle("mass (GeV/c^{2})");
+      fhMassSplitPtNoOverlap->SetXTitle("p_{T} (GeV/c)");
+      outputContainer->Add(fhMassSplitPtNoOverlap) ;
+      
+      fhSelectedMassSplitPtNoOverlap  = new TH2F
+      ("hSelectedMassSplitPtNoOverlap","Selected #pi^{0} (#eta) pairs mass: sum split sub-cluster p_{T} vs mass, no overlap",
+       nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+      fhSelectedMassSplitPtNoOverlap->SetYTitle("mass (GeV/c^{2})");
+      fhSelectedMassSplitPtNoOverlap->SetXTitle("p_{T} (GeV/c)");
+      outputContainer->Add(fhSelectedMassSplitPtNoOverlap) ;
+
+      
+      fhMCPi0PtRecoPtPrim  = new TH2F
+      ("hMCPi0PtRecoPtPrim","p_{T,reco} vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0PtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0PtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0PtRecoPtPrim ) ;
+      
+      fhMCPi0PtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCPi0PtRecoPtPrimNoOverlap","p_{T,reco} vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0PtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0PtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0PtRecoPtPrimNoOverlap ) ;
+      
+      fhMCPi0SelectedPtRecoPtPrim  = new TH2F
+      ("hMCPi0SelectedPtRecoPtPrim","p_{T,reco} vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0SelectedPtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0SelectedPtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0SelectedPtRecoPtPrim ) ;
+      
+      fhMCPi0SelectedPtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCPi0SelectedPtRecoPtPrimNoOverlap","p_{T,reco} vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0SelectedPtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0SelectedPtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0SelectedPtRecoPtPrimNoOverlap ) ;
+
+      
+      fhMCPi0SplitPtRecoPtPrim  = new TH2F
+      ("hMCPi0SplitPtRecoPtPrim","p_{T,reco} (split sum) vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0SplitPtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0SplitPtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0SplitPtRecoPtPrim ) ;
+      
+      fhMCPi0SplitPtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCPi0SplitPtRecoPtPrimNoOverlap","p_{T,reco} (split sum) vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0SplitPtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0SplitPtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0SplitPtRecoPtPrimNoOverlap ) ;
+      
+      fhMCPi0SelectedSplitPtRecoPtPrim  = new TH2F
+      ("hMCPi0SelectedSplitPtRecoPtPrim","p_{T,reco} (split sum) vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0SelectedSplitPtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0SelectedSplitPtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0SelectedSplitPtRecoPtPrim ) ;
+      
+      fhMCPi0SelectedSplitPtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCPi0SelectedSplitPtRecoPtPrimNoOverlap","p_{T,reco} (split sum) vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCPi0SelectedSplitPtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCPi0SelectedSplitPtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCPi0SelectedSplitPtRecoPtPrimNoOverlap ) ;
+
+      fhMCEtaPtRecoPtPrim  = new TH2F
+      ("hMCEtaPtRecoPtPrim","p_{T,reco} vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaPtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaPtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaPtRecoPtPrim ) ;
+      
+      fhMCEtaPtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCEtaPtRecoPtPrimNoOverlap","p_{T,reco} vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaPtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaPtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaPtRecoPtPrimNoOverlap ) ;
+      
+      fhMCEtaSelectedPtRecoPtPrim  = new TH2F
+      ("hMCEtaSelectedPtRecoPtPrim","p_{T,reco} vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaSelectedPtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaSelectedPtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaSelectedPtRecoPtPrim ) ;
+      
+      fhMCEtaSelectedPtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCEtaSelectedPtRecoPtPrimNoOverlap","p_{T,reco} vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaSelectedPtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaSelectedPtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaSelectedPtRecoPtPrimNoOverlap ) ;
+      
+      
+      fhMCEtaSplitPtRecoPtPrim  = new TH2F
+      ("hMCEtaSplitPtRecoPtPrim","p_{T,reco} (split sum) vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaSplitPtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaSplitPtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaSplitPtRecoPtPrim ) ;
+      
+      fhMCEtaSplitPtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCEtaSplitPtRecoPtPrimNoOverlap","p_{T,reco} (split sum) vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaSplitPtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaSplitPtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaSplitPtRecoPtPrimNoOverlap ) ;
+      
+      fhMCEtaSelectedSplitPtRecoPtPrim  = new TH2F
+      ("hMCEtaSelectedSplitPtRecoPtPrim","p_{T,reco} (split sum) vs p_{T,gen}",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaSelectedSplitPtRecoPtPrim ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaSelectedSplitPtRecoPtPrim ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaSelectedSplitPtRecoPtPrim ) ;
+      
+      fhMCEtaSelectedSplitPtRecoPtPrimNoOverlap  = new TH2F
+      ("hMCEtaSelectedSplitPtRecoPtPrimNoOverlap","p_{T,reco} (split sum) vs p_{T,gen}, no overlap",
+       nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMCEtaSelectedSplitPtRecoPtPrimNoOverlap ->SetYTitle("p_{T,gen} (GeV/c)");
+      fhMCEtaSelectedSplitPtRecoPtPrimNoOverlap ->SetXTitle("p_{T,reco} (GeV/c)");
+      outputContainer->Add(fhMCEtaSelectedSplitPtRecoPtPrimNoOverlap ) ;
+      
       for(Int_t i = 0; i< 6; i++)
       {
         fhMCEAsymmetry[i]  = new TH2F (Form("hEAsymmetry_MC%s",pname[i].Data()),
@@ -1849,7 +2055,22 @@ TList *  AliAnaPi0EbE::GetCreateOutputObjects()
         fhMCSelectedMassSplitPt[i]->SetYTitle("mass (GeV/c^{2})");
         fhMCSelectedMassSplitPt[i]->SetXTitle("p_{T} (GeV/c)");
         outputContainer->Add(fhMCSelectedMassSplitPt[i]) ;
+
+        fhMCMassSplitPtNoOverlap[i]  = new TH2F
+        (Form("hMassSplitPtNoOverlap_MC%s",pname[i].Data()),
+         Form("all pairs mass: split p_{T} vs mass from %s, no overlap",ptype[i].Data()),
+         nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+        fhMCMassSplitPtNoOverlap[i]->SetYTitle("mass (GeV/c^{2})");
+        fhMCMassSplitPtNoOverlap[i]->SetXTitle("p_{T} (GeV/c)");
+        outputContainer->Add(fhMCMassSplitPtNoOverlap[i]) ;
         
+        fhMCSelectedMassSplitPtNoOverlap[i]  = new TH2F
+        (Form("hSelectedMassSplitPtNoOverlap_MC%s",pname[i].Data()),
+         Form("Selected #pi^{0} (#eta) pairs mass: split p_{T} vs mass from %s, no overlap",ptype[i].Data()),
+         nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
+        fhMCSelectedMassSplitPtNoOverlap[i]->SetYTitle("mass (GeV/c^{2})");
+        fhMCSelectedMassSplitPtNoOverlap[i]->SetXTitle("p_{T} (GeV/c)");
+        outputContainer->Add(fhMCSelectedMassSplitPtNoOverlap[i]) ;
       }
     }
   }
@@ -1946,7 +2167,7 @@ TList *  AliAnaPi0EbE::GetCreateOutputObjects()
       
       fhPtTimeDiffPileUp[i]  = new TH2F(Form("hPtTimeDiffPileUp%s",pileUpName[i].Data()),
                                              Form("Pt vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
-                                             nptbins,ptmin,ptmax,200,-100,100);
+                                             nptbins,ptmin,ptmax,400,-200,200);
       fhPtTimeDiffPileUp[i]->SetXTitle("p_{T} (GeV/c");
       fhPtTimeDiffPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
       outputContainer->Add(fhPtTimeDiffPileUp[i]);
@@ -2063,7 +2284,7 @@ Int_t AliAnaPi0EbE::GetMCIndex(const Int_t tag)
     return kmcEta ;
   }//eta
   else if  ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
-            GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
+             GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
   {
     return kmcConversion ;
   }//conversion photon
@@ -2611,19 +2832,6 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
     if(GetDebug() > 1)
       printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Min pt cut and fiducial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",mom.Pt(),mom.Phi(),mom.Eta());
     
-    //Check Distance to Bad channel, set bit.
-    Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
-    if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
-    if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm)
-      continue ;
-    
-    if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Bad channel cut passed %4.2f\n",distBad);
-    
-    //.......................................
-    // TOF cut, BE CAREFUL WITH THIS CUT
-    Double_t tof = calo->GetTOF()*1e9;
-    if(tof < fTimeCutMin || tof > fTimeCutMax) continue ;
-    
     //Play with the MC stack if available
     //Check origin of the candidates
     Int_t tag  = 0 ;
@@ -2634,57 +2842,163 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
       if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Origin of candidate %d\n",tag);
     }
     
-    //Skip matched clusters with tracks
-    if(fRejectTrackMatch && IsTrackMatched(calo, GetReader()->GetInputEvent()))
+    //Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
+    
+    //Check Distance to Bad channel, set bit.
+    Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
+    if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
+    if(distBad < fMinDist){ //In bad channel (PHOS cristal size 2.2x2.2 cm)
+      //FillRejectedClusterHistograms(mom,tag,nMaxima);
+      continue ;
+    }
+    if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Bad channel cut passed %4.2f\n",distBad);
+    
+    //If too low number of cells, skip it
+    if ( calo->GetNCells() < GetCaloPID()->GetClusterSplittingMinNCells())
     {
-      FillRejectedClusterHistograms(mom,tag);
+      //FillRejectedClusterHistograms(mom,tag,nMaxima);
       continue ;
     }
     
+    if(GetDebug() > 1)
+      printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: N cells cut passed %d > %d\n",
+             calo->GetNCells(), GetCaloPID()->GetClusterSplittingMinNCells());
+    
+    //.......................................
+    // TOF cut, BE CAREFUL WITH THIS CUT
+    Double_t tof = calo->GetTOF()*1e9;
+    if(tof < fTimeCutMin || tof > fTimeCutMax)
+    {
+      //FillRejectedClusterHistograms(mom,tag,nMaxima);
+      continue ;
+    }
+
     //Check PID
     //PID selection or bit setting
-    Int_t    nMaxima = 0 ;
-    Double_t mass    = 0 , angle = 0;
+    Int_t    nMaxima  = 0;
+    Double_t mass     = 0, angle    = 0;
+    Int_t    absId1   =-1, absId2   =-1;
+    Float_t  distbad1 =-1, distbad2 =-1;
+    Bool_t   fidcut1  = 0, fidcut2  = 0;
     TLorentzVector    l1, l2;
-    Int_t    absId1 = -1; Int_t absId2 = -1;
-    
+
     Int_t idPartType = GetCaloPID()->GetIdentifiedParticleTypeFromClusterSplitting(calo,cells,GetCaloUtils(),
                                                                                    GetVertex(evtIndex),nMaxima,
-                                                                                   mass,angle,l1,l2,absId1,absId2) ;
+                                                                                   mass,angle,l1,l2,absId1,absId2,
+                                                                                   distbad1,distbad2,fidcut1,fidcut2) ;
+    
     
     if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - PDG of identified particle %d\n",idPartType);
     
     
+    // Skip events where one of the new clusters (lowest energy) is close to an EMCal border or a bad channel
+    if( (fCheckSplitDistToBad) &&
+       (!fidcut2 || !fidcut1 || distbad1 < fMinDist || distbad2 < fMinDist))
+    {
+      if(GetDebug() > 1)
+        Info("MakeShowerShapeIdentification", "Dist to bad channel cl %f, cl1 %f, cl2 %f; fid cl1 %d, cl2 %d \n",
+               calo->GetDistanceToBadChannel(),distbad1,distbad2, fidcut1,fidcut2);
+      
+      //FillRejectedClusterHistograms(mom,tag,nMaxima);
+      continue ;
+    }
+    
     //Skip events with too few or too many  NLM
     if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax)
     {
-      FillRejectedClusterHistograms(mom,tag);
+      //FillRejectedClusterHistograms(mom,tag,nMaxima);
       continue ;
     }
     
-    if(nMaxima == 1 && fNLMECutMin[0] > mom.E()) continue;
-    if(nMaxima == 2 && fNLMECutMin[1] > mom.E()) continue;
-    if(nMaxima >  2 && fNLMECutMin[2] > mom.E()) continue;
-    
     if(GetDebug() > 1)
       printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - NLM %d accepted \n",nMaxima);
     
+    //Skip matched clusters with tracks
+    if(fRejectTrackMatch && IsTrackMatched(calo, GetReader()->GetInputEvent()))
+    {
+      FillRejectedClusterHistograms(mom,tag,nMaxima);
+      continue ;
+    }
+
     Float_t e1 = l1.Energy();
     Float_t e2 = l2.Energy();
     TLorentzVector l12 = l1+l2;
     Float_t ptSplit = l12.Pt();
     Float_t  eSplit = e1+e2;
-    Int_t mcIndex = GetMCIndex(tag);
+    
+    Int_t   mcIndex   =-1;
+    Int_t   noverlaps = 0;
+    Float_t ptprim    = 0;
+    if(IsDataMC())
+    {
+      mcIndex = GetMCIndex(tag);
+      
+      Bool_t ok      = kFALSE;
+      Int_t  mcLabel = calo->GetLabel();
+      
+      TLorentzVector primary = GetMCAnalysisUtils()->GetMother(mcLabel,GetReader(),ok);
+      
+      Int_t mesonLabel = -1;
+      
+      if(mcIndex == kmcPi0 || mcIndex == kmcEta)
+      {
+        if(mcIndex == kmcPi0)
+        {
+          TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(mcLabel,111,GetReader(),ok,mesonLabel);
+          if(grandmom.E() > 0 && ok) ptprim =  grandmom.Pt();
+        }
+        else
+        {
+          TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(mcLabel,221,GetReader(),ok,mesonLabel);
+          if(grandmom.E() > 0 && ok) ptprim =  grandmom.Pt();
+        }
+      }
+            
+      const UInt_t nlabels = calo->GetNLabels();
+      Int_t overpdg[nlabels];
+      noverlaps = GetMCAnalysisUtils()->GetNOverlaps(calo->GetLabels(), nlabels,tag,mesonLabel,GetReader(),overpdg);
+    }
     
     //mass of all clusters
-    fhMass       ->Fill(mom.E(),mass);
+    fhMass       ->Fill(mom.E() ,mass);
     fhMassPt     ->Fill(mom.Pt(),mass);
-    fhMassSplitPt->Fill(ptSplit,mass);
+    fhMassSplitPt->Fill(ptSplit ,mass);
     
     if(IsDataMC())
     {
       fhMCMassPt[mcIndex]     ->Fill(mom.Pt(),mass);
-      fhMCMassSplitPt[mcIndex]->Fill(ptSplit,mass);
+      fhMCMassSplitPt[mcIndex]->Fill(ptSplit ,mass);
+      if(mcIndex==kmcPi0)
+      {
+        fhMCPi0PtRecoPtPrim     ->Fill(mom.Pt(),ptprim);
+        fhMCPi0SplitPtRecoPtPrim->Fill(ptSplit ,ptprim);
+      }
+      else if(mcIndex==kmcEta)
+      {
+        fhMCEtaPtRecoPtPrim     ->Fill(mom.Pt(),ptprim);
+        fhMCEtaSplitPtRecoPtPrim->Fill(ptSplit ,ptprim);
+      }
+
+      if(noverlaps==0)
+      {
+        if(mcIndex==kmcPi0)
+        {
+          fhMCPi0PtRecoPtPrimNoOverlap     ->Fill(mom.Pt(),ptprim);
+          fhMCPi0SplitPtRecoPtPrimNoOverlap->Fill(ptSplit ,ptprim);
+        }
+        else if(mcIndex==kmcEta)
+        {
+          fhMCEtaPtRecoPtPrimNoOverlap     ->Fill(mom.Pt(),ptprim);
+          fhMCEtaSplitPtRecoPtPrimNoOverlap->Fill(ptSplit ,ptprim);
+        }
+        
+        fhMassNoOverlap       ->Fill(mom.E() ,mass);
+        fhMassPtNoOverlap     ->Fill(mom.Pt(),mass);
+        fhMassSplitPtNoOverlap->Fill(ptSplit ,mass);
+        
+        fhMCMassPtNoOverlap[mcIndex]     ->Fill(mom.Pt(),mass);
+        fhMCMassSplitPtNoOverlap[mcIndex]->Fill(ptSplit ,mass);
+      }
     }
     
     // Asymmetry of all clusters
@@ -2693,7 +3007,6 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
     if(e1+e2 > 0) asy = (e1-e2) / (e1+e2);
     fhAsymmetry->Fill(mom.E(),asy);
     
-    
     if(IsDataMC())
     {
       fhMCEAsymmetry[mcIndex]->Fill(mom.E(),asy);
@@ -2702,20 +3015,20 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
     // If cluster does not pass pid, not pi0/eta, skip it.
     if     (GetOutputAODName().Contains("Pi0") && idPartType != AliCaloPID::kPi0)
     {
-      if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Pi0\n");
-      FillRejectedClusterHistograms(mom,tag);
+      if(GetDebug() > 1) Info("MakeShowerShapeIdentification","Cluster is not Pi0\n");
+      FillRejectedClusterHistograms(mom,tag,nMaxima);
       continue ;
     }
     
     else if(GetOutputAODName().Contains("Eta") && idPartType != AliCaloPID::kEta)
     {
-      if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Eta\n");
-      FillRejectedClusterHistograms(mom,tag);
+      if(GetDebug() > 1) Info("MakeShowerShapeIdentification","Cluster is not Eta\n");
+      FillRejectedClusterHistograms(mom,tag,nMaxima);
       continue ;
     }
     
     if(GetDebug() > 1)
-      printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Pi0/Eta selection cuts passed: pT %3.2f, pdg %d\n",
+      Info("MakeShowerShapeIdentification","Pi0/Eta selection cuts passed: pT %3.2f, pdg %d\n",
              mom.Pt(), idPartType);
     
     //Mass and asymmetry of selected pairs
@@ -2724,6 +3037,38 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
     fhSelectedMassPt     ->Fill(mom.Pt(),mass);
     fhSelectedMassSplitPt->Fill(ptSplit ,mass);
     
+    if(IsDataMC())
+    {
+      if(mcIndex==kmcPi0)
+      {
+        fhMCPi0SelectedPtRecoPtPrim     ->Fill(mom.Pt(),ptprim);
+        fhMCPi0SelectedSplitPtRecoPtPrim->Fill(ptSplit ,ptprim);
+      }
+      else if(mcIndex==kmcEta)
+      {
+        fhMCEtaSelectedPtRecoPtPrim     ->Fill(mom.Pt(),ptprim);
+        fhMCEtaSelectedSplitPtRecoPtPrim->Fill(ptSplit ,ptprim);
+      }
+      
+      if(noverlaps==0)
+      {
+        fhSelectedMassNoOverlap       ->Fill(mom.E() ,mass);
+        fhSelectedMassPtNoOverlap     ->Fill(mom.Pt(),mass);
+        fhSelectedMassSplitPtNoOverlap->Fill(ptSplit ,mass);
+        
+        if(mcIndex==kmcPi0)
+        {
+          fhMCPi0SelectedPtRecoPtPrimNoOverlap     ->Fill(mom.Pt(),ptprim);
+          fhMCPi0SelectedSplitPtRecoPtPrimNoOverlap->Fill(ptSplit ,ptprim);
+        }
+        else if(mcIndex==kmcEta)
+        {
+          fhMCEtaSelectedPtRecoPtPrimNoOverlap     ->Fill(mom.Pt(),ptprim);
+          fhMCEtaSelectedSplitPtRecoPtPrimNoOverlap->Fill(ptSplit ,ptprim);
+        }
+      }
+    }
+    
     fhSplitE        ->Fill( eSplit);
     fhSplitPt       ->Fill(ptSplit);
     Float_t phi = mom.Phi();
@@ -2756,11 +3101,20 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
       
       fhMCSelectedMassPt     [mcIndex]->Fill(mom.Pt(),mass);
       fhMCSelectedMassSplitPt[mcIndex]->Fill(ptSplit,mass);
+      if(noverlaps==0)
+      {
+        fhMCSelectedMassPtNoOverlap     [mcIndex]->Fill(mom.Pt(),mass);
+        fhMCSelectedMassSplitPtNoOverlap[mcIndex]->Fill(ptSplit,mass);
+      }
     }
     
     //-----------------------
     //Create AOD for analysis
     
+    if(nMaxima == 1 && fNLMECutMin[0] > mom.E()) continue;
+    if(nMaxima == 2 && fNLMECutMin[1] > mom.E()) continue;
+    if(nMaxima >  2 && fNLMECutMin[2] > mom.E()) continue;
+    
     AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom);
     aodpi0.SetLabel(calo->GetLabel());
     
@@ -2829,7 +3183,7 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
          }
       }
       else if(TMath::Abs(bc) >= 6)
-        printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Trigger BC not expected = %d\n",bc);
+        Info("MakeShowerShapeIdentification","Trigger BC not expected = %d\n",bc);
     }
     
     //Add AOD with pi0 object to aod branch
@@ -2837,7 +3191,7 @@ void  AliAnaPi0EbE::MakeShowerShapeIdentification()
     
   }//loop
   
-  if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - End fill AODs \n");
+  if(GetDebug() > 1) Info("MakeShowerShapeIdentification","End fill AODs \n");
   
 }
 //______________________________________________
@@ -2847,12 +3201,11 @@ void  AliAnaPi0EbE::MakeAnalysisFillHistograms()
   
   if(!GetOutputAODBranch())
   {
-    printf("AliAnaPi0EbE::MakeAnalysisFillHistograms()  - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data());
-    abort();
+    AliFatal(Form("No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data()));
   }
   //Loop on stored AOD pi0
   Int_t naod = GetOutputAODBranch()->GetEntriesFast();
-  if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
+  if(GetDebug() > 0) Info("MakeAnalysisFillHistograms","aod branch entries %d\n", naod);
   
   Float_t cen = GetEventCentrality();
   Float_t ep  = GetEventPlaneAngle();