]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/CaloTrackCorrelations/AliAnaPhoton.cxx
fix coverity 24307 and change some prints by AliFatal or AliInfo
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaPhoton.cxx
index 94570e78897e02fa766aa9446b1568a768311f1c..592bfbda98a059248b08931687c3ca2ae932890b 100755 (executable)
@@ -1,4 +1,4 @@
- /**************************************************************************
+/**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
 // Class for the photon identification.
 // Clusters from calorimeters are identified as photons
 // and kept in the AOD. Few histograms produced.
-// Produces input for other analysis classes like AliAnaPi0, 
-// AliAnaParticleHadronCorrelation ... 
+// Produces input for other analysis classes like AliAnaPi0,
+// AliAnaParticleHadronCorrelation ...
 //
-// -- Author: Gustavo Conesa (LNF-INFN) 
+// -- Author: Gustavo Conesa (LNF-INFN)
 //////////////////////////////////////////////////////////////////////////////
-  
-  
-// --- ROOT system --- 
+
+
+// --- ROOT system ---
 #include <TH2F.h>
 #include <TH3D.h>
 #include <TClonesArray.h>
@@ -33,8 +33,8 @@
 #include "TParticle.h"
 #include "TDatabasePDG.h"
 
-// --- Analysis system --- 
-#include "AliAnaPhoton.h" 
+// --- Analysis system ---
+#include "AliAnaPhoton.h"
 #include "AliCaloTrackReader.h"
 #include "AliStack.h"
 #include "AliCaloPID.h"
 #include "AliAODEvent.h"
 #include "AliESDEvent.h"
 
-// --- Detectors --- 
+// --- Detectors ---
 #include "AliPHOSGeoUtils.h"
 #include "AliEMCALGeometry.h"
 
 ClassImp(AliAnaPhoton)
-  
+
 //____________________________
-AliAnaPhoton::AliAnaPhoton() : 
-    AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""), 
-    fMinDist(0.),                 fMinDist2(0.),                fMinDist3(0.), 
-    fRejectTrackMatch(0),         fFillTMHisto(kFALSE),
-    fTimeCutMin(-10000),          fTimeCutMax(10000),         
-    fNCellsCut(0),                
-    fNLMCutMin(-1),               fNLMCutMax(10), 
-    fFillSSHistograms(kFALSE),    fFillOnlySimpleSSHisto(1),   
-    fNOriginHistograms(8),        fNPrimaryHistograms(4),
-    fFillPileUpHistograms(0),     fFillEMCALBCHistograms(0),
-    // Histograms
-    fhNCellsE(0),                 fhCellsE(0),   // Control histograms            
-    fhMaxCellDiffClusterE(0),     fhTimeE(0),    // Control histograms
-    fhEtaPhi(0),                  fhEtaPhiEMCALBC0(0),
-    fhEtaPhiEMCALBC1(0),          fhEtaPhiEMCALBCN(0),
-    fhEPhoton(0),                 fhPtPhoton(0),  
-    fhPhiPhoton(0),               fhEtaPhoton(0), 
-    fhEtaPhiPhoton(0),            fhEtaPhi05Photon(0),
-    fhEtaPhiPhotonEMCALBC0(0),    fhEtaPhiPhotonEMCALBC1(0),   fhEtaPhiPhotonEMCALBCN(0),
-    fhPtCentralityPhoton(0),      fhPtEventPlanePhoton(0),
+AliAnaPhoton::AliAnaPhoton() :
+AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""),
+fMinDist(0.),                 fMinDist2(0.),                fMinDist3(0.),
+fRejectTrackMatch(0),         fFillTMHisto(kFALSE),
+fTimeCutMin(-10000),          fTimeCutMax(10000),
+fNCellsCut(0),
+fNLMCutMin(-1),               fNLMCutMax(10),
+fFillSSHistograms(kFALSE),    fFillOnlySimpleSSHisto(1),
+fNOriginHistograms(8),        fNPrimaryHistograms(4),
+fFillPileUpHistograms(0),     fFillEMCALBCHistograms(0),
+// Histograms
+fhNCellsE(0),                 fhCellsE(0),   // Control histograms
+fhMaxCellDiffClusterE(0),     fhTimePt(0),   // Control histograms
+fhEtaPhi(0),                  fhEtaPhiEMCALBC0(0),
+fhEtaPhiEMCALBC1(0),          fhEtaPhiEMCALBCN(0),
+fhTimeTriggerEMCALBCCluster(0),
+fhTimeTriggerEMCALBCUMCluster(0),
+fhEtaPhiTriggerEMCALBCClusterOverTh(0),
+fhEtaPhiTriggerEMCALBCUMClusterOverTh(0),
+fhEtaPhiTriggerEMCALBCClusterBelowTh1(0),
+fhEtaPhiTriggerEMCALBCUMClusterBelowTh1(0),
+fhEtaPhiTriggerEMCALBCClusterBelowTh2(0),
+fhEtaPhiTriggerEMCALBCUMClusterBelowTh2(0),
+fhEtaPhiTriggerEMCALBCExotic(0),             fhTimeTriggerEMCALBCExotic(0),
+fhEtaPhiTriggerEMCALBCUMExotic(0),           fhTimeTriggerEMCALBCUMExotic(0),
+fhEtaPhiTriggerEMCALBCBad(0),                fhTimeTriggerEMCALBCBad(0),
+fhEtaPhiTriggerEMCALBCUMBad(0),              fhTimeTriggerEMCALBCUMBad(0),
+fhEtaPhiTriggerEMCALBCBadExotic(0),          fhTimeTriggerEMCALBCBadExotic(0),
+fhEtaPhiTriggerEMCALBCUMBadExotic(0),        fhTimeTriggerEMCALBCUMBadExotic(0),
+fhEtaPhiTriggerEMCALBCExoticCluster(0),      fhTimeTriggerEMCALBCExoticCluster(0),
+fhEtaPhiTriggerEMCALBCUMExoticCluster(0),    fhTimeTriggerEMCALBCUMExoticCluster(0),
+fhEtaPhiTriggerEMCALBCBadCluster(0),         fhTimeTriggerEMCALBCBadCluster(0),
+fhEtaPhiTriggerEMCALBCUMBadCluster(0),       fhTimeTriggerEMCALBCUMBadCluster(0),
+fhEtaPhiTriggerEMCALBCBadExoticCluster(0),   fhTimeTriggerEMCALBCBadExoticCluster(0),
+fhEtaPhiTriggerEMCALBCUMBadExoticCluster(0), fhTimeTriggerEMCALBCUMBadExoticCluster(0),
+fhTimeTriggerEMCALBCBadMaxCell(0),           fhTimeTriggerEMCALBCUMBadMaxCell(0),
+fhTimeTriggerEMCALBCBadMaxCellExotic(0),     fhTimeTriggerEMCALBCUMBadMaxCellExotic(0),
+fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster (0), fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster(0),
+fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster(0),fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster(0),
+fhEtaPhiTriggerEMCALBCUMReMatchBothCluster(0),      fhTimeTriggerEMCALBCUMReMatchBothCluster(0),
+fhTimeTriggerEMCALBC0UMReMatchOpenTime(0),
+fhTimeTriggerEMCALBC0UMReMatchCheckNeigh(0),
+fhTimeTriggerEMCALBC0UMReMatchBoth(0),
 
-    // Shower shape histograms
-    fhNLocMax(0),
-    fhDispE(0),                   fhLam0E(0),                   fhLam1E(0), 
-    fhDispETRD(0),                fhLam0ETRD(0),                fhLam1ETRD(0),
-    fhDispETM(0),                 fhLam0ETM(0),                 fhLam1ETM(0), 
-    fhDispETMTRD(0),              fhLam0ETMTRD(0),              fhLam1ETMTRD(0),
+fhEtaPhiNoTrigger(0),                        fhTimeNoTrigger(0),
 
-    fhNCellsLam0LowE(0),          fhNCellsLam1LowE(0),          fhNCellsDispLowE(0),  
-    fhNCellsLam0HighE(0),         fhNCellsLam1HighE(0),         fhNCellsDispHighE(0),
+fhEPhoton(0),                 fhPtPhoton(0),
+fhPhiPhoton(0),               fhEtaPhoton(0),
+fhEtaPhiPhoton(0),            fhEtaPhi05Photon(0),
+fhEtaPhiPhotonEMCALBC0(0),    fhEtaPhiPhotonEMCALBC1(0),   fhEtaPhiPhotonEMCALBCN(0),
+fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime(0),
+fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh(0),
+fhTimePhotonTriggerEMCALBC0UMReMatchBoth(0),
 
-    fhEtaLam0LowE(0),             fhPhiLam0LowE(0), 
-    fhEtaLam0HighE(0),            fhPhiLam0HighE(0), 
-    fhLam0DispLowE(0),            fhLam0DispHighE(0), 
-    fhLam1Lam0LowE(0),            fhLam1Lam0HighE(0), 
-    fhDispLam1LowE(0),            fhDispLam1HighE(0),
-    fhDispEtaE(0),                fhDispPhiE(0),
-    fhSumEtaE(0),                 fhSumPhiE(0),                 fhSumEtaPhiE(0),
-    fhDispEtaPhiDiffE(0),         fhSphericityE(0),
-    fhDispSumEtaDiffE(0),         fhDispSumPhiDiffE(0),
+fhPtCentralityPhoton(0),      fhPtEventPlanePhoton(0),
 
-    // MC histograms
-    fhMCPhotonELambda0NoOverlap(0),       fhMCPhotonELambda0TwoOverlap(0),      fhMCPhotonELambda0NOverlap(0),
-    // Embedding
-    fhEmbeddedSignalFractionEnergy(0),     
-    fhEmbedPhotonELambda0FullSignal(0),   fhEmbedPhotonELambda0MostlySignal(0),  
-    fhEmbedPhotonELambda0MostlyBkg(0),    fhEmbedPhotonELambda0FullBkg(0),       
-    fhEmbedPi0ELambda0FullSignal(0),      fhEmbedPi0ELambda0MostlySignal(0),    
-    fhEmbedPi0ELambda0MostlyBkg(0),       fhEmbedPi0ELambda0FullBkg(0),
-    // PileUp
-    fhTimeENoCut(0),                      fhTimeESPD(0),        fhTimeESPDMulti(0),
-    fhTimeNPileUpVertSPD(0),              fhTimeNPileUpVertTrack(0),
-    fhTimeNPileUpVertContributors(0),
-    fhTimePileUpMainVertexZDistance(0),   fhTimePileUpMainVertexZDiamond(0),
-    fhClusterMultSPDPileUp(),             fhClusterMultNoPileUp(),
-    fhEtaPhiBC0(0),  fhEtaPhiBCPlus(0),   fhEtaPhiBCMinus(0),
-    fhEtaPhiBC0PileUpSPD(0),
-    fhEtaPhiBCPlusPileUpSPD(0),
-    fhEtaPhiBCMinusPileUpSPD(0)
- {
+// Shower shape histograms
+fhNLocMax(0),
+fhDispE(0),                   fhLam0E(0),                   fhLam1E(0),
+fhDispETRD(0),                fhLam0ETRD(0),                fhLam1ETRD(0),
+fhDispETM(0),                 fhLam0ETM(0),                 fhLam1ETM(0),
+fhDispETMTRD(0),              fhLam0ETMTRD(0),              fhLam1ETMTRD(0),
+
+fhNCellsLam0LowE(0),          fhNCellsLam1LowE(0),          fhNCellsDispLowE(0),
+fhNCellsLam0HighE(0),         fhNCellsLam1HighE(0),         fhNCellsDispHighE(0),
+
+fhEtaLam0LowE(0),             fhPhiLam0LowE(0),
+fhEtaLam0HighE(0),            fhPhiLam0HighE(0),
+fhLam0DispLowE(0),            fhLam0DispHighE(0),
+fhLam1Lam0LowE(0),            fhLam1Lam0HighE(0),
+fhDispLam1LowE(0),            fhDispLam1HighE(0),
+fhDispEtaE(0),                fhDispPhiE(0),
+fhSumEtaE(0),                 fhSumPhiE(0),                 fhSumEtaPhiE(0),
+fhDispEtaPhiDiffE(0),         fhSphericityE(0),
+fhDispSumEtaDiffE(0),         fhDispSumPhiDiffE(0),
+
+// MC histograms
+fhMCPhotonELambda0NoOverlap(0),       fhMCPhotonELambda0TwoOverlap(0),      fhMCPhotonELambda0NOverlap(0),
+// Embedding
+fhEmbeddedSignalFractionEnergy(0),
+fhEmbedPhotonELambda0FullSignal(0),   fhEmbedPhotonELambda0MostlySignal(0),
+fhEmbedPhotonELambda0MostlyBkg(0),    fhEmbedPhotonELambda0FullBkg(0),
+fhEmbedPi0ELambda0FullSignal(0),      fhEmbedPi0ELambda0MostlySignal(0),
+fhEmbedPi0ELambda0MostlyBkg(0),       fhEmbedPi0ELambda0FullBkg(0),
+// PileUp
+fhTimePtNoCut(0),                     fhTimePtSPD(0),
+fhTimePtPhotonNoCut(0),               fhTimePtPhotonSPD(0),
+fhTimeNPileUpVertSPD(0),              fhTimeNPileUpVertTrack(0),
+fhTimeNPileUpVertContributors(0),
+fhTimePileUpMainVertexZDistance(0),   fhTimePileUpMainVertexZDiamond(0),
+fhClusterMultSPDPileUp(),             fhClusterMultNoPileUp(),
+fhEtaPhiBC0(0),  fhEtaPhiBCPlus(0),   fhEtaPhiBCMinus(0),
+fhEtaPhiBC0PileUpSPD(0),
+fhEtaPhiBCPlusPileUpSPD(0),           fhEtaPhiBCMinusPileUpSPD(0),
+fhPtNPileUpSPDVtx(0),                 fhPtNPileUpTrkVtx(0),
+fhPtNPileUpSPDVtxTimeCut(0),          fhPtNPileUpTrkVtxTimeCut(0),
+fhPtNPileUpSPDVtxTimeCut2(0),         fhPtNPileUpTrkVtxTimeCut2(0),
+fhPtPhotonNPileUpSPDVtx(0),           fhPtPhotonNPileUpTrkVtx(0),
+fhPtPhotonNPileUpSPDVtxTimeCut(0),    fhPtPhotonNPileUpTrkVtxTimeCut(0),
+fhPtPhotonNPileUpSPDVtxTimeCut2(0),   fhPtPhotonNPileUpTrkVtxTimeCut2(0),
+fhEClusterSM(0),                      fhEPhotonSM(0),
+fhPtClusterSM(0),                     fhPtPhotonSM(0)
+{
   //default ctor
   
   for(Int_t i = 0; i < 14; i++)
@@ -121,9 +164,9 @@ AliAnaPhoton::AliAnaPhoton() :
     fhMCE      [i] = 0;
     fhMCPhi    [i] = 0;
     fhMCEta    [i] = 0;
-    fhMCDeltaE [i] = 0;                
+    fhMCDeltaE [i] = 0;
     fhMCDeltaPt[i] = 0;
-    fhMC2E     [i] = 0;              
+    fhMC2E     [i] = 0;
     fhMC2Pt    [i] = 0;
   }
   
@@ -132,11 +175,13 @@ AliAnaPhoton::AliAnaPhoton() :
     fhPtPrimMC [i] = 0;
     fhEPrimMC  [i] = 0;
     fhPhiPrimMC[i] = 0;
+    fhEtaPrimMC[i] = 0;
     fhYPrimMC  [i] = 0;
     
     fhPtPrimMCAcc [i] = 0;
     fhEPrimMCAcc  [i] = 0;
     fhPhiPrimMCAcc[i] = 0;
+    fhEtaPrimMCAcc[i] = 0;
     fhYPrimMCAcc  [i] = 0;
     
     fhDispEtaDispPhi[i] = 0;
@@ -146,34 +191,35 @@ AliAnaPhoton::AliAnaPhoton() :
     fhPtPileUp       [i] = 0;
     fhPtChargedPileUp[i] = 0;
     fhPtPhotonPileUp [i] = 0;
-
+    
     fhLambda0PileUp       [i] = 0;
     fhLambda0ChargedPileUp[i] = 0;
     
     fhClusterEFracLongTimePileUp  [i] = 0;
     
+    fhClusterCellTimePileUp       [i] = 0;
     fhClusterTimeDiffPileUp       [i] = 0;
     fhClusterTimeDiffChargedPileUp[i] = 0;
     fhClusterTimeDiffPhotonPileUp [i] = 0;
-
+    
     for(Int_t j = 0; j < 6; j++)
     {
       fhMCDispEtaDispPhi[i][j] = 0;
       fhMCLambda0DispEta[i][j] = 0;
       fhMCLambda0DispPhi[i][j] = 0;
     }
-  }  
+  }
   
   for(Int_t i = 0; i < 6; i++)
   {
     fhMCELambda0    [i]                  = 0;
     fhMCELambda1    [i]                  = 0;
     fhMCEDispersion [i]                  = 0;
-    fhMCNCellsE     [i]                  = 0; 
-    fhMCMaxCellDiffClusterE[i]           = 0; 
+    fhMCNCellsE     [i]                  = 0;
+    fhMCMaxCellDiffClusterE[i]           = 0;
     fhLambda0DispEta[i]                  = 0;
     fhLambda0DispPhi[i]                  = 0;
-
+    
     fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
     fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
     fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
@@ -188,45 +234,58 @@ AliAnaPhoton::AliAnaPhoton() :
     fhMCESphericity    [i]               = 0;
   }
   
-   for(Int_t i = 0; i < 5; i++) 
-   {
-     fhClusterCuts[i] = 0;
-   }
-  
-   // Track matching residuals
-   for(Int_t i = 0; i < 2; i++)
-   {
-     fhTrackMatchedDEta[i] = 0;                fhTrackMatchedDPhi[i] = 0;         fhTrackMatchedDEtaDPhi[i] = 0;   
-     fhTrackMatchedDEtaTRD[i] = 0;             fhTrackMatchedDPhiTRD[i] = 0;          
-     fhTrackMatchedDEtaMCOverlap[i] = 0;       fhTrackMatchedDPhiMCOverlap[i] = 0;
-     fhTrackMatchedDEtaMCNoOverlap[i] = 0;     fhTrackMatchedDPhiMCNoOverlap[i] = 0;
-     fhTrackMatchedDEtaMCConversion[i] = 0;    fhTrackMatchedDPhiMCConversion[i] = 0;
-     fhTrackMatchedMCParticle[i] = 0;          fhTrackMatchedMCParticle[i] = 0;   
-     fhdEdx[i] = 0;                            fhEOverP[i] = 0;
-     fhEOverPTRD[i] = 0;
-   }
-   
-   for(Int_t i = 0; i < 4; i++) 
-   {
-     fhClusterMultSPDPileUp[i] = 0;
-     fhClusterMultNoPileUp [i] = 0;
-   }
-   
-   for(Int_t i = 0; i < 13; i++)
-   {
-     fhEtaPhiTriggerEMCALBC[i] = 0 ;
-     fhTimeTriggerEMCALBC  [i] = 0 ;
-     fhEtaPhiPhotonTriggerEMCALBC[i] = 0 ;
-     fhTimePhotonTriggerEMCALBC  [i] = 0 ;
-   }
-   
+  for(Int_t i = 0; i < 5; i++)
+  {
+    fhClusterCuts[i] = 0;
+  }
+  
+  // Track matching residuals
+  for(Int_t i = 0; i < 2; i++)
+  {
+    fhTrackMatchedDEta   [i] = 0;             fhTrackMatchedDPhi   [i] = 0;         fhTrackMatchedDEtaDPhi   [i] = 0;
+    fhTrackMatchedDEtaNeg[i] = 0;             fhTrackMatchedDPhiNeg[i] = 0;         fhTrackMatchedDEtaDPhiNeg[i] = 0;
+    fhTrackMatchedDEtaPos[i] = 0;             fhTrackMatchedDPhiPos[i] = 0;         fhTrackMatchedDEtaDPhiPos[i] = 0;
+    fhTrackMatchedDEtaTRD[i] = 0;             fhTrackMatchedDPhiTRD[i] = 0;
+    fhTrackMatchedDEtaMCOverlap[i] = 0;       fhTrackMatchedDPhiMCOverlap[i] = 0;
+    fhTrackMatchedDEtaMCNoOverlap[i] = 0;     fhTrackMatchedDPhiMCNoOverlap[i] = 0;
+    fhTrackMatchedDEtaMCConversion[i] = 0;    fhTrackMatchedDPhiMCConversion[i] = 0;
+    fhTrackMatchedMCParticle[i] = 0;          fhTrackMatchedMCParticle[i] = 0;
+    fhdEdx[i] = 0;                            fhEOverP[i] = 0;
+    fhEOverPTRD[i] = 0;
+  }
+  
+  for(Int_t i = 0; i < 4; i++)
+  {
+    fhClusterMultSPDPileUp[i] = 0;
+    fhClusterMultNoPileUp [i] = 0;
+  }
+  
+  for(Int_t i = 0; i < 11; i++)
+  {
+    fhEtaPhiTriggerEMCALBC             [i] = 0 ;
+    fhTimeTriggerEMCALBC               [i] = 0 ;
+    fhEtaPhiTriggerEMCALBCUM           [i] = 0 ;
+    fhTimeTriggerEMCALBCUM             [i] = 0 ;
+    
+    fhEtaPhiPhotonTriggerEMCALBC       [i] = 0 ;
+    fhTimePhotonTriggerEMCALBC         [i] = 0 ;
+    fhEtaPhiPhotonTriggerEMCALBCUM     [i] = 0 ;
+    fhTimePhotonTriggerEMCALBCUM       [i] = 0 ;
+    
+    fhTimePhotonTriggerEMCALBCPileUpSPD[i] = 0 ;
+    fhTimeTriggerEMCALBCPileUpSPD      [i] = 0 ;
+    
+    fhEtaPhiTriggerEMCALBCCluster      [i] = 0 ;
+    fhEtaPhiTriggerEMCALBCUMCluster    [i] = 0 ;    
+  }
+  
   //Initialize parameters
   InitParameters();
-
+  
 }
 
-//_____________________________________________________________________________________________________
-Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int_t nMaxima) 
+//_________________________________________________________________________________________
+Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int_t nMaxima)
 {
   //Select clusters if they pass different cuts
   
@@ -235,13 +294,13 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int
   Float_t l0cluster  = calo->GetM02();
   Float_t etacluster = mom.Eta();
   Float_t phicluster = mom.Phi();
-  if(phicluster<0) phicluster+=TMath::TwoPi();
+  if(phicluster < 0) phicluster+=TMath::TwoPi();
   Float_t tofcluster   = calo->GetTOF()*1.e9;
-  Float_t tofclusterUS = TMath::Abs(tofcluster);
   
+  Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
   
   if(GetDebug() > 2)
-    printf("AliAnaPhoton::ClusterSelected() Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
+    printf("AliAnaPhoton::ClusterSelected() Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
            GetReader()->GetEventNumber(),
            ecluster,ptcluster, phicluster*TMath::RadToDeg(),etacluster);
   
@@ -249,162 +308,24 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int
   
   if(ecluster > 0.5) fhEtaPhi->Fill(etacluster, phicluster);
   
-  if(fFillEMCALBCHistograms && fCalorimeter=="EMCAL")
+  Int_t   nSM  = GetModuleNumber(calo);
+  if(nSM < GetCaloUtils()->GetNumberOfSuperModulesUsed() && nSM >=0)
   {
-    if(ecluster > 2)
-    {
-      if      (tofclusterUS < 25) fhEtaPhiEMCALBC0->Fill(etacluster, phicluster);
-      else if (tofclusterUS < 75) fhEtaPhiEMCALBC1->Fill(etacluster, phicluster);
-      else                        fhEtaPhiEMCALBCN->Fill(etacluster, phicluster);
-    }
-    
-    Int_t bc = GetReader()->IsPileUpClusterTriggeredEvent();
-    if(bc > -6 && bc < 8)
-    {
-      if(ecluster > 2) fhEtaPhiTriggerEMCALBC[bc+5]->Fill(etacluster, phicluster);
-      fhTimeTriggerEMCALBC[bc+5]->Fill(ecluster, tofcluster);
-      if(GetReader()->IsPileUpFromSPD()) fhTimeTriggerEMCALBCPileUpSPD[bc+5]->Fill(ecluster, tofcluster);
-
-    }
-    else printf("AliAnaPhoton::ClusterSelected() - Trigger BC not expected = %d\n",bc);
-    
+    fhEClusterSM ->Fill(ecluster ,nSM);
+    fhPtClusterSM->Fill(ptcluster,nSM);
   }
   
+  FillEMCALTriggerClusterBCHistograms(calo->GetID(),ecluster,tofcluster,etacluster,phicluster);
+  
   //.......................................
   //If too small or big energy, skip it
-  if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ; 
+  if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
   
   if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
   
   fhClusterCuts[2]->Fill(ecluster);
-
-  if(fFillPileUpHistograms)
-  {
-    // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
-    AliVCaloCells* cells = 0;
-    if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
-    else                        cells = GetPHOSCells();
-    
-    Float_t maxCellFraction = 0.;
-    Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
-
-    Double_t tmax  = cells->GetCellTime(absIdMax);
-    GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
-    tmax*=1.e9;
-    
-    Bool_t okPhoton = kFALSE;
-    if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
-
-    Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
-    Float_t clusterLongTimeE = 0;
-    Float_t clusterOKTimeE   = 0;
-    //Loop on cells inside cluster
-    for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
-    {
-      Int_t absId  = calo->GetCellsAbsId()[ipos];
-      //if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
-      if(cells->GetCellAmplitude(absIdMax) > 0.1)
-      {
-        Double_t time  = cells->GetCellTime(absId);
-        Float_t  amp   = cells->GetCellAmplitude(absId);
-        Int_t    bc    = GetReader()->GetInputEvent()->GetBunchCrossNumber();
-        GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
-        time*=1e9;
-        
-        Float_t diff = (tmax-time);
-      
-        if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimeE   += amp;
-        else                                      clusterLongTimeE += amp;
-        
-        if(GetReader()->IsPileUpFromSPD())
-        {
-          fhClusterTimeDiffPileUp[0]->Fill(ecluster, diff);
-          if(!matched)
-          {
-            fhClusterTimeDiffChargedPileUp[0]->Fill(ecluster, diff);
-            if(okPhoton)  fhClusterTimeDiffPhotonPileUp[0]->Fill(ecluster, diff);
-          }
-        }
-        
-        if(GetReader()->IsPileUpFromEMCal())
-        {
-          fhClusterTimeDiffPileUp[1]->Fill(ecluster, diff);
-          if(!matched)
-          {
-            fhClusterTimeDiffChargedPileUp[1]->Fill(ecluster, diff);
-            if(okPhoton)  fhClusterTimeDiffPhotonPileUp[1]->Fill(ecluster, diff);
-          }
-        }
-
-        if(GetReader()->IsPileUpFromSPDOrEMCal())
-        {
-          fhClusterTimeDiffPileUp[2]->Fill(ecluster, diff);
-          if(!matched)
-          {
-            fhClusterTimeDiffChargedPileUp[2]->Fill(ecluster, diff);
-            if(okPhoton)  fhClusterTimeDiffPhotonPileUp[2]->Fill(ecluster, diff);
-          }
-        }
-        
-        if(GetReader()->IsPileUpFromSPDAndEMCal())
-        {
-          fhClusterTimeDiffPileUp[3]->Fill(ecluster, diff);
-          if(!matched)
-          {
-            fhClusterTimeDiffChargedPileUp[3]->Fill(ecluster, diff);
-            if(okPhoton)  fhClusterTimeDiffPhotonPileUp[3]->Fill(ecluster, diff);
-          }
-        }
-        
-        if(GetReader()->IsPileUpFromSPDAndNotEMCal())
-        {
-          fhClusterTimeDiffPileUp[4]->Fill(ecluster, diff);
-          if(!matched)
-          {
-            fhClusterTimeDiffChargedPileUp[4]->Fill(ecluster, diff);
-            if(okPhoton)  fhClusterTimeDiffPhotonPileUp[4]->Fill(ecluster, diff);
-          }
-        }
-        
-        if(GetReader()->IsPileUpFromEMCalAndNotSPD())
-        {
-          fhClusterTimeDiffPileUp[5]->Fill(ecluster, diff);
-          if(!matched)
-          {
-            fhClusterTimeDiffChargedPileUp[5]->Fill(ecluster, diff);
-            if(okPhoton)  fhClusterTimeDiffPhotonPileUp[5]->Fill(ecluster, diff);
-          }
-        }
-
-        if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
-        {
-          fhClusterTimeDiffPileUp[6]->Fill(ecluster, diff);
-          if(!matched)
-          {
-            fhClusterTimeDiffChargedPileUp[6]->Fill(ecluster, diff);
-            if(okPhoton)  fhClusterTimeDiffPhotonPileUp[6]->Fill(ecluster, diff);
-          }
-        }
-      }// Not max
-    }//loop
-    
-    Float_t frac = 0;
-    if(clusterLongTimeE+clusterOKTimeE > 0.001)
-      frac = clusterLongTimeE/(clusterLongTimeE+clusterOKTimeE);
-    //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimeE,clusterOKTimeE,frac,ecluster);
-    
-    if(GetReader()->IsPileUpFromSPD())               {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ecluster,frac);}
-    if(GetReader()->IsPileUpFromEMCal())             {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ecluster,frac);}
-    if(GetReader()->IsPileUpFromSPDOrEMCal())        {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ecluster,frac);}
-    if(GetReader()->IsPileUpFromSPDAndEMCal())       {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ecluster,frac);}
-    if(GetReader()->IsPileUpFromSPDAndNotEMCal())    {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ecluster,frac);}
-    if(GetReader()->IsPileUpFromEMCalAndNotSPD())    {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ecluster,frac);}
-    if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ecluster,frac);}
-    
-    if(tmax > -25 && tmax < 25) {fhEtaPhiBC0    ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD    ->Fill(mom.Eta(),mom.Phi()); }
-    else if (tmax > 25)         {fhEtaPhiBCPlus ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(mom.Eta(),mom.Phi()); }
-    else if (tmax <-25)         {fhEtaPhiBCMinus->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(mom.Eta(),mom.Phi()); }
-  }
+  
+  FillClusterPileUpHistograms(calo,matched,ptcluster,etacluster,phicluster,l0cluster);
   
   //.......................................
   // TOF cut, BE CAREFUL WITH THIS CUT
@@ -414,19 +335,19 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int
   if(GetDebug() > 2)  printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
   
   fhClusterCuts[3]->Fill(ecluster);
-
+  
   //.......................................
   if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
   
   if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
   
   fhClusterCuts[4]->Fill(ecluster);
-
+  
   if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
   if(GetDebug() > 2) printf(" \t Cluster %d pass NLM %d of out of range \n",calo->GetID(), nMaxima);
-
+  
   fhClusterCuts[5]->Fill(ecluster);
-
+  
   //.......................................
   //Check acceptance selection
   if(IsFiducialCutOn())
@@ -435,10 +356,10 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int
     if(! in ) return kFALSE ;
   }
   
-  if(GetDebug() > 2) printf("Fiducial cut passed \n");
+  if(GetDebug() > 2) printf("\t Fiducial cut passed \n");
   
   fhClusterCuts[6]->Fill(ecluster);
-
+  
   //.......................................
   //Skip matched clusters with tracks
   
@@ -447,17 +368,17 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int
   
   if(fRejectTrackMatch)
   {
-    if(IsTrackMatched(calo,GetReader()->GetInputEvent())) 
+    if(matched)
     {
       if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
       return kFALSE ;
     }
-    else  
+    else
       if(GetDebug() > 2)  printf(" Track-matching cut passed \n");
   }// reject matched clusters
   
   fhClusterCuts[7]->Fill(ecluster);
-
+  
   if(fFillPileUpHistograms)
   {
     if(GetReader()->IsPileUpFromSPD())               {fhPtChargedPileUp[0]->Fill(ptcluster); fhLambda0ChargedPileUp[0]->Fill(ecluster,l0cluster); }
@@ -473,7 +394,7 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int
   //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) 
+  if(distBad < fMinDist)
   {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
     return kFALSE ;
   }
@@ -481,14 +402,14 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int
   
   fhClusterCuts[8]->Fill(ecluster);
   
-  if(GetDebug() > 0) 
+  if(GetDebug() > 0)
     printf("AliAnaPhoton::ClusterSelected() Current Event %d; After  selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
-           GetReader()->GetEventNumber(), 
+           GetReader()->GetEventNumber(),
            ecluster, ptcluster,mom.Phi()*TMath::RadToDeg(),mom.Eta());
   
   //All checks passed, cluster selected
   return kTRUE;
-    
+  
 }
 
 //___________________________________________
@@ -501,19 +422,21 @@ void AliAnaPhoton::FillAcceptanceHistograms()
   Double_t photonPt  = -1 ;
   Double_t photonPhi =  100 ;
   Double_t photonEta = -1 ;
-
+  
   Int_t    pdg       =  0 ;
   Int_t    tag       =  0 ;
   Int_t    mcIndex   =  0 ;
   Bool_t   inacceptance = kFALSE;
-
+  
   if(GetReader()->ReadStack())
-  {    
+  {
     AliStack * stack = GetMCStack();
     if(stack)
     {
       for(Int_t i=0 ; i<stack->GetNtrack(); i++)
       {
+        if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
+        
         TParticle * prim = stack->Particle(i) ;
         pdg = prim->GetPdgCode();
         //printf("i %d, %s %d  %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
@@ -533,12 +456,12 @@ void AliAnaPhoton::FillAcceptanceHistograms()
           }
           
           //Get photon kinematics
-          if(prim->Energy() == TMath::Abs(prim->Pz()))  continue ; //Protection against floating point exception         
+          if(prim->Energy() == TMath::Abs(prim->Pz()))  continue ; //Protection against floating point exception
           
           photonY   = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
           photonE   = prim->Energy() ;
           photonPt  = prim->Pt() ;
-          photonPhi = TMath::RadToDeg()*prim->Phi() ;
+          photonPhi = prim->Phi() ;
           if(photonPhi < 0) photonPhi+=TMath::TwoPi();
           photonEta = prim->Eta() ;
           
@@ -552,17 +475,17 @@ void AliAnaPhoton::FillAcceptanceHistograms()
             {
               Int_t mod ;
               Double_t x,z ;
-              if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x)) 
+              if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
                 inacceptance = kTRUE;
               if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
             }
             else
             {
-              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter)) 
+              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
                 inacceptance = kTRUE ;
               if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
             }
-          }       
+          }
           else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
           {
             if(GetEMCALGeometry())
@@ -571,16 +494,16 @@ void AliAnaPhoton::FillAcceptanceHistograms()
               
               GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
               
-              if( absID >= 0) 
+              if( absID >= 0)
                 inacceptance = kTRUE;
               
-              //                  if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2)) 
+              //                  if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
               //                    inacceptance = kTRUE;
               if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
             }
             else
             {
-              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter)) 
+              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
                 inacceptance = kTRUE ;
               if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
             }
@@ -593,13 +516,14 @@ void AliAnaPhoton::FillAcceptanceHistograms()
             fhEPrimMC  [kmcPPhoton]->Fill(photonE ) ;
             fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
             fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
-            fhYPrimMC  [kmcPPhoton]->Fill(photonE , photonEta) ;
+            fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
           }
           if(inacceptance)
           {
             fhEPrimMCAcc  [kmcPPhoton]->Fill(photonE ) ;
             fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt) ;
             fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
+            fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
             fhYPrimMCAcc  [kmcPPhoton]->Fill(photonE , photonY) ;
           }//Accepted
           
@@ -620,7 +544,7 @@ void AliAnaPhoton::FillAcceptanceHistograms()
           {
             mcIndex = kmcPPi0Decay;
           }
-          else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) || 
+          else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
                     GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
           {
             mcIndex = kmcPOtherDecay;
@@ -636,18 +560,20 @@ void AliAnaPhoton::FillAcceptanceHistograms()
             fhEPrimMC  [mcIndex]->Fill(photonE ) ;
             fhPtPrimMC [mcIndex]->Fill(photonPt) ;
             fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
-            fhYPrimMC  [mcIndex]->Fill(photonE , photonEta) ;
+            fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
           }
+          
           if(inacceptance)
           {
             fhEPrimMCAcc  [mcIndex]->Fill(photonE ) ;
             fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
             fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
+            fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
             fhYPrimMCAcc  [mcIndex]->Fill(photonE , photonY) ;
           }//Accepted
           
-        }// Primary photon 
-      }//loop on primaries     
+        }// Primary photon
+      }//loop on primaries
     }//stack exists and data is MC
   }//read stack
   else if(GetReader()->ReadAODMCParticles())
@@ -659,7 +585,9 @@ void AliAnaPhoton::FillAcceptanceHistograms()
       
       for(Int_t i=0; i < nprim; i++)
       {
-        AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);   
+        if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
+        
+        AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
         
         pdg = prim->GetPdgCode();
         
@@ -677,7 +605,7 @@ void AliAnaPhoton::FillAcceptanceHistograms()
           }
           
           //Get photon kinematics
-          if(prim->E() == TMath::Abs(prim->Pz()))  continue ; //Protection against floating point exception     
+          if(prim->E() == TMath::Abs(prim->Pz()))  continue ; //Protection against floating point exception
           
           photonY   = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
           photonE   = prim->E() ;
@@ -703,11 +631,11 @@ void AliAnaPhoton::FillAcceptanceHistograms()
             }
             else
             {
-              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter)) 
+              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
                 inacceptance = kTRUE ;
               if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
             }
-          }       
+          }
           else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
           {
             if(GetEMCALGeometry())
@@ -716,14 +644,14 @@ void AliAnaPhoton::FillAcceptanceHistograms()
               
               GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
               
-              if( absID >= 0) 
+              if( absID >= 0)
                 inacceptance = kTRUE;
               
               if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
             }
             else
             {
-              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter)) 
+              if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
                 inacceptance = kTRUE ;
               if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
             }
@@ -737,7 +665,7 @@ void AliAnaPhoton::FillAcceptanceHistograms()
             fhEPrimMC  [kmcPPhoton]->Fill(photonE ) ;
             fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
             fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
-            fhYPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
+            fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
           }
           
           if(inacceptance)
@@ -745,6 +673,7 @@ void AliAnaPhoton::FillAcceptanceHistograms()
             fhEPrimMCAcc[kmcPPhoton]  ->Fill(photonE ) ;
             fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
             fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
+            fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
             fhYPrimMCAcc[kmcPPhoton]  ->Fill(photonE , photonY) ;
           }//Accepted
           
@@ -765,7 +694,7 @@ void AliAnaPhoton::FillAcceptanceHistograms()
           {
             mcIndex = kmcPPi0Decay;
           }
-          else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) || 
+          else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
                     GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
           {
             mcIndex = kmcPOtherDecay;
@@ -781,47 +710,417 @@ void AliAnaPhoton::FillAcceptanceHistograms()
             fhEPrimMC  [mcIndex]->Fill(photonE ) ;
             fhPtPrimMC [mcIndex]->Fill(photonPt) ;
             fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
-            fhYPrimMC  [mcIndex]->Fill(photonE , photonEta) ;
+            fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
           }
           if(inacceptance)
           {
             fhEPrimMCAcc  [mcIndex]->Fill(photonE ) ;
             fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
             fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
+            fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
             fhYPrimMCAcc  [mcIndex]->Fill(photonE , photonY) ;
           }//Accepted
-                    
-        }// Primary photon 
-      }//loop on primaries     
+          
+        }// Primary photon
+      }//loop on primaries
       
     }//kmc array exists and data is MC
   }    // read AOD MC
 }
 
-//___________________________________________________________________
-void AliAnaPhoton::FillPileUpHistogramsPerEvent(TObjArray * clusters) 
+//________________________________________________________________________________________________________________
+void  AliAnaPhoton::FillEMCALTriggerClusterBCHistograms(Int_t idcalo,       Float_t ecluster,  Float_t tofcluster,
+                                                        Float_t etacluster, Float_t phicluster)
+
+{
+  // Fill trigger related histograms
+  
+  if(!fFillEMCALBCHistograms || fCalorimeter!="EMCAL") return ;
+  
+  Float_t tofclusterUS = TMath::Abs(tofcluster);
+  
+  if(ecluster > 2)
+  {
+    if      (tofclusterUS < 25) fhEtaPhiEMCALBC0->Fill(etacluster, phicluster);
+    else if (tofclusterUS < 75) fhEtaPhiEMCALBC1->Fill(etacluster, phicluster);
+    else                        fhEtaPhiEMCALBCN->Fill(etacluster, phicluster);
+  }
+  
+  Int_t  bc     = GetReader()->GetTriggerClusterBC();
+  Int_t  id     = GetReader()->GetTriggerClusterId();
+  Bool_t badMax = GetReader()->IsBadMaxCellTriggerEvent();
+  
+  Int_t histoBC = bc+5;
+  if(GetReader()->AreBadTriggerEventsRemoved()) histoBC=0; // histograms created only for one BC since the others where rejected
+
+  if(id==-2)
+  {
+    //printf("AliAnaPhoton::ClusterSelected() - No trigger found bc=%d\n",bc);
+    fhEtaPhiNoTrigger->Fill(etacluster, phicluster);
+    fhTimeNoTrigger  ->Fill(ecluster, tofcluster);
+  }
+  else if(TMath::Abs(bc) < 6)
+  {
+    if(!GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent() )
+    {
+      if(GetReader()->IsTriggerMatched())
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBC[histoBC]->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBC[histoBC]->Fill(ecluster, tofcluster);
+        if(GetReader()->IsPileUpFromSPD()) fhTimeTriggerEMCALBCPileUpSPD[histoBC]->Fill(ecluster, tofcluster);
+        
+        if(idcalo ==  GetReader()->GetTriggerClusterId())
+        {
+          fhEtaPhiTriggerEMCALBCCluster[histoBC]->Fill(etacluster, phicluster);
+          fhTimeTriggerEMCALBCCluster        ->Fill(ecluster, tofcluster);
+          
+          if(bc==0)
+          {
+            Float_t threshold = GetReader()->GetEventTriggerL1Threshold() ;
+            if(GetReader()->IsEventEMCALL0()) threshold = GetReader()->GetEventTriggerL0Threshold() ;
+            
+            if(ecluster > threshold)
+              fhEtaPhiTriggerEMCALBCClusterOverTh->Fill(etacluster, phicluster);
+            else if(ecluster > threshold-1)
+              fhEtaPhiTriggerEMCALBCClusterBelowTh1->Fill(etacluster, phicluster);
+            else
+              fhEtaPhiTriggerEMCALBCClusterBelowTh2->Fill(etacluster, phicluster);
+          }
+        }
+      }
+      else
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBCUM[histoBC]->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBCUM[histoBC]->Fill(ecluster, tofcluster);
+        
+        if(bc==0)
+        {
+          if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimeTriggerEMCALBC0UMReMatchOpenTime   ->Fill(ecluster, tofcluster);
+          if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimeTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(ecluster, tofcluster);
+          if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimeTriggerEMCALBC0UMReMatchBoth       ->Fill(ecluster, tofcluster);
+        }
+        
+        if(idcalo ==  GetReader()->GetTriggerClusterId())
+        {
+          fhEtaPhiTriggerEMCALBCUMCluster[histoBC]->Fill(etacluster, phicluster);
+          fhTimeTriggerEMCALBCUMCluster->Fill(ecluster, tofcluster);
+          if(bc==0)
+          {
+            Float_t threshold = GetReader()->GetEventTriggerL1Threshold() ;
+            if(GetReader()->IsEventEMCALL0()) threshold = GetReader()->GetEventTriggerL0Threshold() ;
+            
+            if(ecluster > threshold)
+              fhEtaPhiTriggerEMCALBCUMClusterOverTh->Fill(etacluster, phicluster);
+            else if(ecluster > threshold-1)
+              fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->Fill(etacluster, phicluster);
+            else
+              fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->Fill(etacluster, phicluster);
+            
+            if(GetReader()->IsTriggerMatchedOpenCuts(0))
+            {
+              fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->Fill(etacluster, phicluster);
+              fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster  ->Fill(ecluster, tofcluster);
+            }
+            if(GetReader()->IsTriggerMatchedOpenCuts(1))
+            {
+              fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->Fill(etacluster, phicluster);
+              fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster  ->Fill(ecluster, tofcluster);
+            }
+            if(GetReader()->IsTriggerMatchedOpenCuts(2))
+            {
+              fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->Fill(etacluster, phicluster);
+              fhTimeTriggerEMCALBCUMReMatchBothCluster  ->Fill(ecluster, tofcluster);
+            }
+            
+          }
+        }
+      }
+    }// neither bad nor exotic
+    else if(GetReader()->IsBadCellTriggerEvent() && GetReader()->IsExoticEvent())
+    {
+      if(GetReader()->IsTriggerMatched())
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBCBadExotic->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBCBadExotic->Fill(ecluster, tofcluster);
+        if(badMax)  fhTimeTriggerEMCALBCBadMaxCellExotic->Fill(ecluster, tofcluster);
+      }
+      else
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBadExotic->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBCUMBadExotic->Fill(ecluster, tofcluster);
+        if(badMax)  fhTimeTriggerEMCALBCUMBadMaxCellExotic->Fill(ecluster, tofcluster);
+        
+      }
+    }// Bad and exotic cluster trigger
+    else if(GetReader()->IsBadCellTriggerEvent() )
+    {
+      if(GetReader()->IsTriggerMatched())
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBCBad->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBCBad->Fill(ecluster, tofcluster);
+        if(badMax)  fhTimeTriggerEMCALBCBadMaxCell->Fill(ecluster, tofcluster);
+      }
+      else
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBad->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBCUMBad->Fill(ecluster, tofcluster);
+        if(badMax)  fhTimeTriggerEMCALBCUMBadMaxCell->Fill(ecluster, tofcluster);
+      }
+    }// Bad cluster trigger
+    else if(GetReader()->IsExoticEvent() )
+    {
+      if(GetReader()->IsTriggerMatched())
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBCExotic->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBCExotic->Fill(ecluster, tofcluster);
+      }
+      else
+      {
+        if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMExotic->Fill(etacluster, phicluster);
+        fhTimeTriggerEMCALBCUMExotic->Fill(ecluster, tofcluster);
+      }
+    }
+  }
+  else if(TMath::Abs(bc) >= 6)
+    printf("AliAnaPhoton::ClusterSelected() - Trigger BC not expected = %d\n",bc);
+  
+}
+
+//_________________________________________________________________________________________________________
+void  AliAnaPhoton::FillClusterPileUpHistograms(AliVCluster * calo, Bool_t matched,     Float_t ptcluster,
+                                                Float_t etacluster, Float_t phicluster, Float_t l0cluster)
+{
+  // Fill some histograms related to pile up before any cluster cut is applied
+  
+  if(!fFillPileUpHistograms) return ;
+  
+  // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
+  AliVCaloCells* cells = 0;
+  if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
+  else                        cells = GetPHOSCells();
+  
+  Float_t maxCellFraction = 0.;
+  Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
+  
+  Double_t tmax  = cells->GetCellTime(absIdMax);
+  GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
+  tmax*=1.e9;
+  
+  Bool_t okPhoton = kFALSE;
+  if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
+  
+  Float_t clusterLongTimePt = 0;
+  Float_t clusterOKTimePt   = 0;
+    
+  //Loop on cells inside cluster, max cell must be over 100 MeV and time in BC=0
+  if(cells->GetCellAmplitude(absIdMax) > 0.1 && TMath::Abs(tmax) < 30)
+  {
+    for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
+    {
+      Int_t absId  = calo->GetCellsAbsId()[ipos];
+      
+      if( absId == absIdMax ) continue ;
+      
+      Double_t time  = cells->GetCellTime(absId);
+      Float_t  amp   = cells->GetCellAmplitude(absId);
+      Int_t    bc    = GetReader()->GetInputEvent()->GetBunchCrossNumber();
+      GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
+      time*=1e9;
+      
+      Float_t diff = (tmax-time);
+      
+      if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimePt   += amp;
+      else                                      clusterLongTimePt += amp;
+      
+      if( cells->GetCellAmplitude(absIdMax) < 0.1 ) continue ;
+      
+      if(GetReader()->IsPileUpFromSPD())
+      {
+        fhClusterCellTimePileUp[0]->Fill(ptcluster, time);
+        fhClusterTimeDiffPileUp[0]->Fill(ptcluster, diff);
+        if(!matched)
+        {
+          fhClusterTimeDiffChargedPileUp[0]->Fill(ptcluster, diff);
+          if(okPhoton)  fhClusterTimeDiffPhotonPileUp[0]->Fill(ptcluster, diff);
+        }
+      }
+      
+      if(GetReader()->IsPileUpFromEMCal())
+      {
+        fhClusterCellTimePileUp[1]->Fill(ptcluster, time);
+        fhClusterTimeDiffPileUp[1]->Fill(ptcluster, diff);
+        if(!matched)
+        {
+          fhClusterTimeDiffChargedPileUp[1]->Fill(ptcluster, diff);
+          if(okPhoton)  fhClusterTimeDiffPhotonPileUp[1]->Fill(ptcluster, diff);
+        }
+      }
+      
+      if(GetReader()->IsPileUpFromSPDOrEMCal())
+      {
+        fhClusterCellTimePileUp[2]->Fill(ptcluster, time);
+        fhClusterTimeDiffPileUp[2]->Fill(ptcluster, diff);
+        if(!matched)
+        {
+          fhClusterTimeDiffChargedPileUp[2]->Fill(ptcluster, diff);
+          if(okPhoton)  fhClusterTimeDiffPhotonPileUp[2]->Fill(ptcluster, diff);
+        }
+      }
+      
+      if(GetReader()->IsPileUpFromSPDAndEMCal())
+      {
+        fhClusterCellTimePileUp[3]->Fill(ptcluster, time);
+        fhClusterTimeDiffPileUp[3]->Fill(ptcluster, diff);
+        if(!matched)
+        {
+          fhClusterTimeDiffChargedPileUp[3]->Fill(ptcluster, diff);
+          if(okPhoton)  fhClusterTimeDiffPhotonPileUp[3]->Fill(ptcluster, diff);
+        }
+      }
+      
+      if(GetReader()->IsPileUpFromSPDAndNotEMCal())
+      {
+        fhClusterCellTimePileUp[4]->Fill(ptcluster, time);
+        fhClusterTimeDiffPileUp[4]->Fill(ptcluster, diff);
+        if(!matched)
+        {
+          fhClusterTimeDiffChargedPileUp[4]->Fill(ptcluster, diff);
+          if(okPhoton)  fhClusterTimeDiffPhotonPileUp[4]->Fill(ptcluster, diff);
+        }
+      }
+      
+      if(GetReader()->IsPileUpFromEMCalAndNotSPD())
+      {
+        fhClusterCellTimePileUp[5]->Fill(ptcluster, time);
+        fhClusterTimeDiffPileUp[5]->Fill(ptcluster, diff);
+        if(!matched)
+        {
+          fhClusterTimeDiffChargedPileUp[5]->Fill(ptcluster, diff);
+          if(okPhoton)  fhClusterTimeDiffPhotonPileUp[5]->Fill(ptcluster, diff);
+        }
+      }
+      
+      if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
+      {
+        fhClusterCellTimePileUp[6]->Fill(ptcluster, time);
+        fhClusterTimeDiffPileUp[6]->Fill(ptcluster, diff);
+        if(!matched)
+        {
+          fhClusterTimeDiffChargedPileUp[6]->Fill(ptcluster, diff);
+          if(okPhoton)  fhClusterTimeDiffPhotonPileUp[6]->Fill(ptcluster, diff);
+        }
+      }
+    }//loop
+    
+    
+    Float_t frac = 0;
+    if(clusterLongTimePt+clusterOKTimePt > 0.001)
+      frac = clusterLongTimePt/(clusterLongTimePt+clusterOKTimePt);
+    //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimePt,clusterOKTimePt,frac,ptcluster);
+    
+    if(GetReader()->IsPileUpFromSPD())               {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ptcluster,frac);}
+    if(GetReader()->IsPileUpFromEMCal())             {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ptcluster,frac);}
+    if(GetReader()->IsPileUpFromSPDOrEMCal())        {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ptcluster,frac);}
+    if(GetReader()->IsPileUpFromSPDAndEMCal())       {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ptcluster,frac);}
+    if(GetReader()->IsPileUpFromSPDAndNotEMCal())    {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ptcluster,frac);}
+    if(GetReader()->IsPileUpFromEMCalAndNotSPD())    {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ptcluster,frac);}
+    if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ptcluster,frac);}
+    
+    fhEtaPhiBC0->Fill(etacluster,phicluster);
+    if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD    ->Fill(etacluster,phicluster);
+  }
+  
+  else if (tmax > 25)         {fhEtaPhiBCPlus ->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(etacluster,phicluster); }
+  else if (tmax <-25)         {fhEtaPhiBCMinus->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(etacluster,phicluster); }
+}
+
+//_______________________________________________
+void AliAnaPhoton::FillPileUpHistogramsPerEvent()
 {
   // Fill some histograms per event to understand pile-up
   // Open the time cut in the reader to be more meaningful
   
   if(!fFillPileUpHistograms) return;
-    
-  // Loop on clusters, get the maximum energy cluster as reference
-  Int_t nclusters = clusters->GetEntriesFast();
-  Int_t   idMax = 0; 
+  
+  AliVEvent * event = GetReader()->GetInputEvent();
+       
+  AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
+  AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
+       
+  // N pile up vertices
+  Int_t nVtxSPD = -1;
+  Int_t nVtxTrk = -1;
+  TLorentzVector mom;
+       
+  if      (esdEv)
+  {
+               nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
+               nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
+  }//ESD
+  else if (aodEv)
+  {
+               nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
+               nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
+  }//AOD
+       
+       
+       // Get the appropriate list of clusters
+       TClonesArray * clusterList = 0;
+       TString  clusterListName   = GetReader()->GetEMCALClusterListName();
+       if     (event->FindListObject(clusterListName))
+               clusterList = dynamic_cast<TClonesArray*> (event->FindListObject(clusterListName));
+       else if(GetReader()->GetOutputEvent())
+               clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
+       
+       // Loop on clusters, get the maximum energy cluster as reference
+  Int_t nclusters = 0;
+       if(clusterList) nclusters = clusterList->GetEntriesFast();
+       else            nclusters = event->GetNumberOfCaloClusters();
+       
+  Int_t   idMax = 0;
   Float_t  eMax = 0;
   Float_t  tMax = 0;
   for(Int_t iclus = 0; iclus < nclusters ; iclus++)
   {
-         AliVCluster * clus =  (AliVCluster*) (clusters->At(iclus));   
-    if(clus->E() > eMax && TMath::Abs(clus->GetTOF()*1e9) < 20)
+               AliVCluster * clus = 0;
+               if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
+    else            clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
+               
+               if(!clus)            continue;
+               
+               if(!clus->IsEMCAL()) continue;
+               
+               Float_t tof = clus->GetTOF()*1e9;
+               if(clus->E() > eMax && TMath::Abs(tof) < 30)
     {
       eMax  = clus->E();
-      tMax  = clus->GetTOF()*1e9;
+                       tMax  = tof;
       idMax = iclus;
     }
-  }
+         
+               clus->GetMomentum(mom,GetVertex(0));
+               Float_t pt = mom.Pt();
+         
+               fhPtNPileUpSPDVtx->Fill(pt,nVtxSPD);
+               fhPtNPileUpTrkVtx->Fill(pt,nVtxTrk);
+    
+               if(TMath::Abs(tof) < 30)
+               {
+                       fhPtNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
+                       fhPtNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
+               }
+    
+    if(tof < 75 && tof > -30)
+    {
+      fhPtNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
+      fhPtNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
+    }
+    
+    fhTimePtNoCut->Fill(pt,tof);
+    if(GetReader()->IsPileUpFromSPD()) fhTimePtSPD->Fill(pt,tof);
 
+  }
+       
   if(eMax < 5) return;
   
   // Loop again on clusters to compare this max cluster t and the rest of the clusters, if E > 0.3
@@ -829,16 +1128,22 @@ void AliAnaPhoton::FillPileUpHistogramsPerEvent(TObjArray * clusters)
   Int_t n40  = 0;
   Int_t n    = 0;
   Int_t nOK  = 0;
-
+  
   for(Int_t iclus = 0; iclus < nclusters ; iclus++)
   {
-         AliVCluster * clus =  (AliVCluster*) (clusters->At(iclus));   
+               AliVCluster * clus = 0;
+               if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
+    else            clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
+               
+               if(!clus)            continue;
+               
+               if(!clus->IsEMCAL()) continue;
     
     if(clus->E() < 0.3 || iclus==idMax) continue;
     
     Float_t tdiff = TMath::Abs(tMax-clus->GetTOF()*1e9);
     n++;
-    if(tdiff < 20) nOK++;
+    if(tdiff < 25) nOK++;
     else
     {
       n20++;
@@ -848,19 +1153,19 @@ void AliAnaPhoton::FillPileUpHistogramsPerEvent(TObjArray * clusters)
   
   // Check pile-up and fill histograms depending on the different cluster multiplicities
   if(GetReader()->IsPileUpFromSPD())
-  {    
+  {
     fhClusterMultSPDPileUp[0]->Fill(eMax,n  );
     fhClusterMultSPDPileUp[1]->Fill(eMax,nOK);
     fhClusterMultSPDPileUp[2]->Fill(eMax,n20);
     fhClusterMultSPDPileUp[3]->Fill(eMax,n40);
   }
-  else 
+  else
   {
     fhClusterMultNoPileUp[0]->Fill(eMax,n  );
     fhClusterMultNoPileUp[1]->Fill(eMax,nOK);
     fhClusterMultNoPileUp[2]->Fill(eMax,n20);
-    fhClusterMultNoPileUp[3]->Fill(eMax,n40);    
-  }  
+    fhClusterMultNoPileUp[3]->Fill(eMax,n40);
+  }
   
 }
 
@@ -882,9 +1187,8 @@ void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time
   if(GetReader()->IsPileUpFromEMCalAndNotSPD())    fhPtPhotonPileUp[5]->Fill(pt);
   if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt);
   
-  fhTimeENoCut->Fill(energy,time);
-  if(GetReader()->IsPileUpFromSPD())     fhTimeESPD     ->Fill(energy,time);
-  if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
+  fhTimePtPhotonNoCut->Fill(pt,time);
+  if(GetReader()->IsPileUpFromSPD()) fhTimePtPhotonSPD->Fill(pt,time);
   
   if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
   
@@ -892,31 +1196,46 @@ void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time
   AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
   
   // N pile up vertices
-  Int_t nVerticesSPD    = -1;
-  Int_t nVerticesTracks = -1;
+  Int_t nVtxSPD = -1;
+  Int_t nVtxTrk = -1;
   
   if      (esdEv)
   {
-    nVerticesSPD    = esdEv->GetNumberOfPileupVerticesSPD();
-    nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
-
+    nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
+    nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
+    
   }//ESD
   else if (aodEv)
   {
-    nVerticesSPD    = aodEv->GetNumberOfPileupVerticesSPD();
-    nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
+    nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
+    nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
   }//AOD
   
-  fhTimeNPileUpVertSPD  ->Fill(time,nVerticesSPD);
-  fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
+  fhTimeNPileUpVertSPD  ->Fill(time,nVtxSPD);
+  fhTimeNPileUpVertTrack->Fill(time,nVtxTrk);
+  
+  fhPtPhotonNPileUpSPDVtx->Fill(pt,nVtxSPD);
+  fhPtPhotonNPileUpTrkVtx->Fill(pt,nVtxTrk);
+       
+  if(TMath::Abs(time) < 25)
+  {
+    fhPtPhotonNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
+    fhPtPhotonNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
+  }
+       
+  if(time < 75 && time > -25)
+  {
+    fhPtPhotonNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
+    fhPtPhotonNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
+  }
   
-  //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n", 
-  //       GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
+  //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
+  //       GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVtxSPD,nVtxTrk);
   
   Int_t ncont = -1;
   Float_t z1 = -1, z2 = -1;
   Float_t diamZ = -1;
-  for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
+  for(Int_t iVert=0; iVert<nVtxSPD;iVert++)
   {
     if      (esdEv)
     {
@@ -938,21 +1257,21 @@ void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time
     
     Double_t distZ  = TMath::Abs(z2-z1);
     diamZ  = TMath::Abs(z2-diamZ);
-
+    
     fhTimeNPileUpVertContributors  ->Fill(time,ncont);
     fhTimePileUpMainVertexZDistance->Fill(time,distZ);
     fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
-
+    
   }// loop
 }
 
 //____________________________________________________________________________________
 void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
 {
-    //Fill cluster Shower Shape histograms
+  //Fill cluster Shower Shape histograms
   
   if(!fFillSSHistograms || GetMixedEvent()) return;
-
+  
   Float_t energy  = cluster->E();
   Int_t   ncells  = cluster->GetNCells();
   Float_t lambda0 = cluster->GetM02();
@@ -977,7 +1296,7 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
   fhLam0E ->Fill(energy,lambda0);
   fhLam1E ->Fill(energy,lambda1);
   fhDispE ->Fill(energy,disp);
-    
+  
   if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
   {
     fhLam0ETRD->Fill(energy,lambda0);
@@ -986,8 +1305,8 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
   }
   
   Float_t l0   = 0., l1   = 0.;
-  Float_t dispp= 0., dEta = 0., dPhi    = 0.; 
-  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;  
+  Float_t dispp= 0., dEta = 0., dPhi    = 0.;
+  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
   if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
   {
     GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
@@ -1004,16 +1323,16 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
     fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
     if(dEta+dPhi>0)fhSphericityE     -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
     if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
-    if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));  
+    if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
     
     Int_t ebin = -1;
     if      (energy < 2 ) ebin = 0;
     else if (energy < 4 ) ebin = 1;
     else if (energy < 6 ) ebin = 2;
     else if (energy < 10) ebin = 3;
-    else if (energy < 15) ebin = 4;  
-    else if (energy < 20) ebin = 5;  
-    else                  ebin = 6;  
+    else if (energy < 15) ebin = 4;
+    else if (energy < 20) ebin = 5;
+    else                  ebin = 6;
     
     fhDispEtaDispPhi[ebin]->Fill(dEta   ,dPhi);
     fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
@@ -1021,7 +1340,7 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
     
   }
   
-  // if track-matching was of, check effect of track-matching residual cut 
+  // if track-matching was of, check effect of track-matching residual cut
   
   if(!fRejectTrackMatch)
   {
@@ -1031,7 +1350,7 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
     {
       dR = 2000., dZ = 2000.;
       GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
-    }   
+    }
     
     if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
     {
@@ -1046,10 +1365,11 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
         fhDispETMTRD->Fill(energy,disp);
       }
     }
-  }// if track-matching was of, check effect of matching residual cut  
+  }// if track-matching was of, check effect of matching residual cut
   
   
-  if(!fFillOnlySimpleSSHisto){
+  if(!fFillOnlySimpleSSHisto)
+  {
     if(energy < 2)
     {
       fhNCellsLam0LowE ->Fill(ncells,lambda0);
@@ -1060,9 +1380,9 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
       fhLam0DispLowE  ->Fill(lambda0,disp);
       fhDispLam1LowE  ->Fill(disp,lambda1);
       fhEtaLam0LowE   ->Fill(eta,lambda0);
-      fhPhiLam0LowE   ->Fill(phi,lambda0);  
+      fhPhiLam0LowE   ->Fill(phi,lambda0);
     }
-    else 
+    else
     {
       fhNCellsLam0HighE ->Fill(ncells,lambda0);
       fhNCellsLam1HighE ->Fill(ncells,lambda1);
@@ -1075,6 +1395,7 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
       fhPhiLam0HighE   ->Fill(phi, lambda0);
     }
   }
+  
   if(IsDataMC())
   {
     AliVCaloCells* cells = 0;
@@ -1083,87 +1404,81 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
     
     //Fill histograms to check shape of embedded clusters
     Float_t fraction = 0;
-   // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
-  
+    // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
+    
     if(GetReader()->IsEmbeddedClusterSelectionOn())
     {//Only working for EMCAL
-   //  printf("embedded\n");
+      //       printf("embedded\n");
       Float_t clusterE = 0; // recalculate in case corrections applied.
       Float_t cellE    = 0;
       for(Int_t icell  = 0; icell < cluster->GetNCells(); icell++)
       {
         cellE    = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
-        clusterE+=cellE;  
+        clusterE+=cellE;
         fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
       }
       
       //Fraction of total energy due to the embedded signal
       fraction/=clusterE;
       
-      if(GetDebug() > 1 ) 
+      if(GetDebug() > 1 )
         printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
       
       fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
       
-    }  // embedded fraction    
+    }  // embedded fraction
     
     // Get the fraction of the cluster energy that carries the cell with highest energy
-    Int_t   absID           =-1 ;
     Float_t maxCellFraction = 0.;
+    Int_t absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
     
-    absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
-    
+    if( absID < 0 ) AliFatal("Wrong absID");
+      
     // Check the origin and fill histograms
     
     Int_t mcIndex = -1;
     
-    if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton)     && 
+    if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton)     &&
        !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
        !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0)        &&
        !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
     {
       mcIndex = kmcssPhoton ;
-
+      
       if(!GetReader()->IsEmbeddedClusterSelectionOn())
       {
         //Check particle overlaps in cluster
         
-        // Compare the primary depositing more energy with the rest, 
+        // Compare the primary depositing more energy with the rest,
         // if no photon/electron as comon ancestor (conversions), count as other particle
-        Int_t ancPDG = 0, ancStatus = -1;
-        TLorentzVector momentum; TVector3 prodVertex;
-        Int_t ancLabel = 0;
-        Int_t noverlaps = 1;      
-        for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ ) 
-        {
-          ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab], 
-                                                               GetReader(),ancPDG,ancStatus,momentum,prodVertex);
-          if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
-        }
+        const UInt_t nlabels = cluster->GetNLabels();
+        Int_t overpdg[nlabels];
+        Int_t noverlaps = GetMCAnalysisUtils()->GetNOverlaps(cluster->GetLabels(), nlabels,mcTag,-1,GetReader(),overpdg);
+
         //printf("N overlaps %d \n",noverlaps);
         
-        if(noverlaps == 1)
+        if(noverlaps == 0)
         {
           fhMCPhotonELambda0NoOverlap  ->Fill(energy, lambda0);
         }
-        else if(noverlaps == 2)
-        {        
+        else if(noverlaps == 1)
+        {
           fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
         }
-        else if(noverlaps > 2)
-        {          
+        else if(noverlaps > 1)
+        {
           fhMCPhotonELambda0NOverlap   ->Fill(energy, lambda0);
         }
-        else 
+        else
         {
-          printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
+          printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!\n", noverlaps);
         }
       }//No embedding
       
       //Fill histograms to check shape of embedded clusters
       if(GetReader()->IsEmbeddedClusterSelectionOn())
       {
-        if     (fraction > 0.9) 
+        if     (fraction > 0.9)
         {
           fhEmbedPhotonELambda0FullSignal   ->Fill(energy, lambda0);
         }
@@ -1172,7 +1487,7 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
           fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
         }
         else if(fraction > 0.1)
-        { 
+        {
           fhEmbedPhotonELambda0MostlyBkg    ->Fill(energy, lambda0);
         }
         else
@@ -1182,15 +1497,18 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
       } // embedded
       
     }//photon   no conversion
+    else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton)     &&
+               GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
+              !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0)        &&
+              !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
+    {
+      mcIndex = kmcssConversion ;
+    }//conversion photon
+
     else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
     {
       mcIndex = kmcssElectron ;
     }//electron
-    else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) && 
-               GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
-    {
-      mcIndex = kmcssConversion ;
-    }//conversion photon
     else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0)  )
     {
       mcIndex = kmcssPi0 ;
@@ -1198,7 +1516,7 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
       //Fill histograms to check shape of embedded clusters
       if(GetReader()->IsEmbeddedClusterSelectionOn())
       {
-        if     (fraction > 0.9) 
+        if     (fraction > 0.9)
         {
           fhEmbedPi0ELambda0FullSignal   ->Fill(energy, lambda0);
         }
@@ -1207,24 +1525,24 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
           fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
         }
         else if(fraction > 0.1)
-        { 
+        {
           fhEmbedPi0ELambda0MostlyBkg    ->Fill(energy, lambda0);
         }
         else
         {
           fhEmbedPi0ELambda0FullBkg      ->Fill(energy, lambda0);
         }
-      } // embedded      
+      } // embedded
       
     }//pi0
     else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta)  )
     {
       mcIndex = kmcssEta ;
-    }//eta    
-    else 
+    }//eta
+    else
     {
-      mcIndex = kmcssOther ; 
-    }//other particles 
+      mcIndex = kmcssOther ;
+    }//other particles
     
     fhMCELambda0           [mcIndex]->Fill(energy, lambda0);
     fhMCELambda1           [mcIndex]->Fill(energy, lambda1);
@@ -1256,20 +1574,20 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
         fhMCEDispPhi        [mcIndex]-> Fill(energy,dPhi);
         fhMCESumEtaPhi      [mcIndex]-> Fill(energy,sEtaPhi);
         fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
-        if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));  
+        if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
         
         Int_t ebin = -1;
         if      (energy < 2 ) ebin = 0;
         else if (energy < 4 ) ebin = 1;
         else if (energy < 6 ) ebin = 2;
         else if (energy < 10) ebin = 3;
-        else if (energy < 15) ebin = 4;  
-        else if (energy < 20) ebin = 5;  
-        else                  ebin = 6;  
+        else if (energy < 15) ebin = 4;
+        else if (energy < 20) ebin = 5;
+        else                  ebin = 6;
         
         fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta   ,dPhi);
         fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
-        fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);      
+        fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
       }
     }
   }//MC data
@@ -1277,12 +1595,12 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
 }
 
 //__________________________________________________________________________
-void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster, 
+void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
                                                        Int_t cut)
 {
   // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
   // Residual filled for different cuts 0 (No cut), after 1 PID cut
-    
+  
   Float_t dZ = cluster->GetTrackDz();
   Float_t dR = cluster->GetTrackDx();
   
@@ -1290,14 +1608,34 @@ void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
   {
     dR = 2000., dZ = 2000.;
     GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
-  }   
-    
+  }
+  
+  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
+  
+  Bool_t positive = kFALSE;
+  if(track) positive = (track->Charge()>0);
+  
   if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
   {
     fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
     fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
-    
     if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
+
+    if(track)
+    {
+      if(positive)
+      {
+        fhTrackMatchedDEtaPos[cut]->Fill(cluster->E(),dZ);
+        fhTrackMatchedDPhiPos[cut]->Fill(cluster->E(),dR);
+        if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiPos[cut]->Fill(dZ,dR);
+      }
+      else
+      {
+        fhTrackMatchedDEtaNeg[cut]->Fill(cluster->E(),dZ);
+        fhTrackMatchedDPhiNeg[cut]->Fill(cluster->E(),dR);
+        if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiNeg[cut]->Fill(dZ,dR);
+      }
+    }
     
     Int_t nSMod = GetModuleNumber(cluster);
     
@@ -1308,15 +1646,11 @@ void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
     }
     
     // Check dEdx and E/p of matched clusters
-    
+
     if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
-    {      
-      
-      AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
-      
-      if(track) 
+    {
+      if(track)
       {
-        
         Float_t dEdx   = track->GetTPCsignal();
         Float_t eOverp = cluster->E()/track->P();
         
@@ -1329,7 +1663,7 @@ void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
         
       }
       else
-          printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
+        printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
       
       
       
@@ -1341,13 +1675,13 @@ void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
         if  ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)  )
         {
           if       ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0)      ||
-                     GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta)       ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
+                    GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta)       ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
           else if  ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)    ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
           else if  ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron)  ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
           else                                                                                 fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
           
           // Check if several particles contributed to cluster and discard overlapped mesons
-          if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) || 
+          if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
              !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
           {
             if(cluster->GetNLabels()==1)
@@ -1355,7 +1689,7 @@ void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
               fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
               fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
             }
-            else 
+            else
             {
               fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
               fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
@@ -1367,23 +1701,23 @@ void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
         else
         {
           if       ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0)      ||
-                     GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta)       ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
+                    GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta)       ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
           else if  ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)    ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
           else if  ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron)  ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
           else                                                                                 fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
           
           // Check if several particles contributed to cluster
-          if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) || 
+          if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
              !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
           {
             fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
             fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
             
-          }// Check overlaps          
+          }// Check overlaps
           
         }
         
-      } // MC 
+      } // MC
       
     } // residuals window
     
@@ -1393,14 +1727,14 @@ void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
 
 //___________________________________________
 TObjString *  AliAnaPhoton::GetAnalysisCuts()
-{      
+{
   //Save parameters used for analysis
   TString parList ; //this will be list of parameters used for this analysis.
   const Int_t buffersize = 255;
   char onePar[buffersize] ;
   
   snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
-  parList+=onePar ;    
+  parList+=onePar ;
   snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
   parList+=onePar ;
   snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
@@ -1410,7 +1744,7 @@ TObjString *  AliAnaPhoton::GetAnalysisCuts()
   snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
   parList+=onePar ;
   snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
-  parList+=onePar ;  
+  parList+=onePar ;
   
   //Get parameters set in base class.
   parList += GetBaseParametersList() ;
@@ -1419,7 +1753,7 @@ TObjString *  AliAnaPhoton::GetAnalysisCuts()
   parList += GetCaloPID()->GetPIDParametersList() ;
   
   //Get parameters set in FiducialCut class (not available yet)
-  //parlist += GetFidCut()->GetFidCutParametersList() 
+  //parlist += GetFidCut()->GetFidCutParametersList()
   
   return new TObjString(parList) ;
 }
@@ -1427,446 +1761,924 @@ TObjString *  AliAnaPhoton::GetAnalysisCuts()
 //________________________________________________________________________
 TList *  AliAnaPhoton::GetCreateOutputObjects()
 {
-  // Create histograms to be saved in output file and 
+  // Create histograms to be saved in output file and
   // store them in outputContainer
-  TList * outputContainer = new TList() ; 
-  outputContainer->SetName("PhotonHistos") ; 
+  TList * outputContainer = new TList() ;
+  outputContainer->SetName("PhotonHistos") ;
        
-  Int_t nptbins  = GetHistogramRanges()->GetHistoPtBins();  Float_t ptmax  = GetHistogramRanges()->GetHistoPtMax();  Float_t ptmin  = GetHistogramRanges()->GetHistoPtMin(); 
-  Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin(); 
-  Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();  
+  Int_t nptbins  = GetHistogramRanges()->GetHistoPtBins();  Float_t ptmax  = GetHistogramRanges()->GetHistoPtMax();  Float_t ptmin  = GetHistogramRanges()->GetHistoPtMin();
+  Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
+  Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
   Int_t ssbins   = GetHistogramRanges()->GetHistoShowerShapeBins();  Float_t ssmax   = GetHistogramRanges()->GetHistoShowerShapeMax();  Float_t ssmin   = GetHistogramRanges()->GetHistoShowerShapeMin();
-  Int_t nbins    = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t   nmax    = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t   nmin    = GetHistogramRanges()->GetHistoNClusterCellMin(); 
-  Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins();         Float_t timemax = GetHistogramRanges()->GetHistoTimeMax();         Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();       
-
-  Int_t   nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();          
-  Float_t resetamax   = GetHistogramRanges()->GetHistoTrackResidualEtaMax();          
+  Int_t nbins    = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t   nmax    = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t   nmin    = GetHistogramRanges()->GetHistoNClusterCellMin();
+  Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins();         Float_t timemax = GetHistogramRanges()->GetHistoTimeMax();         Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
+  
+  Int_t   nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
+  Float_t resetamax   = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
   Float_t resetamin   = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
-  Int_t   nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();          
-  Float_t resphimax   = GetHistogramRanges()->GetHistoTrackResidualPhiMax();          
+  Int_t   nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
+  Float_t resphimax   = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
   Float_t resphimin   = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
   
-  Int_t   ndedxbins   = GetHistogramRanges()->GetHistodEdxBins();         
-  Float_t dedxmax     = GetHistogramRanges()->GetHistodEdxMax();         
+  Int_t   ndedxbins   = GetHistogramRanges()->GetHistodEdxBins();
+  Float_t dedxmax     = GetHistogramRanges()->GetHistodEdxMax();
   Float_t dedxmin     = GetHistogramRanges()->GetHistodEdxMin();
-  Int_t   nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();       
-  Float_t pOverEmax   = GetHistogramRanges()->GetHistoPOverEMax();       
+  Int_t   nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
+  Float_t pOverEmax   = GetHistogramRanges()->GetHistoPOverEMax();
   Float_t pOverEmin   = GetHistogramRanges()->GetHistoPOverEMin();
   
   Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
   
+  Int_t nTrigBC  = 1;
+  Int_t iBCShift = 0;
+  if(!GetReader()->AreBadTriggerEventsRemoved())
+  {
+    nTrigBC = 11;
+    iBCShift = 5;
+  }
+  
   TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
-  for (Int_t i = 0; i < 10 ;  i++) 
+  for (Int_t i = 0; i < 10 ;  i++)
   {
     fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
                                 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
-                                nptbins,ptmin,ptmax); 
-    fhClusterCuts[i]->SetYTitle("dN/dE ");
-    fhClusterCuts[i]->SetXTitle("E (GeV)");
-    outputContainer->Add(fhClusterCuts[i]) ;   
+                                nptbins,ptmin,ptmax);
+    fhClusterCuts[i]->SetYTitle("d#it{N}/d#it{E} ");
+    fhClusterCuts[i]->SetXTitle("#it{E} (GeV)");
+    outputContainer->Add(fhClusterCuts[i]) ;
   }
   
-  fhNCellsE  = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax); 
-  fhNCellsE->SetXTitle("E (GeV)");
+  fhEClusterSM = new TH2F("hEClusterSM","Raw clusters E and super-module number",
+                          nptbins,ptmin,ptmax,
+                          GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
+  fhEClusterSM->SetYTitle("SuperModule ");
+  fhEClusterSM->SetXTitle("#it{E} (GeV)");
+  outputContainer->Add(fhEClusterSM) ;
+
+  fhPtClusterSM = new TH2F("hPtClusterSM","Raw clusters #it{p}_[T] and super-module number",
+                          nptbins,ptmin,ptmax,
+                          GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
+  fhPtClusterSM->SetYTitle("SuperModule ");
+  fhPtClusterSM->SetXTitle("#it{E} (GeV)");
+  outputContainer->Add(fhPtClusterSM) ;
+  
+  fhEPhotonSM = new TH2F("hEPhotonSM","Selected clusters E and super-module number",
+                          nptbins,ptmin,ptmax,
+                          GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
+  fhEPhotonSM->SetYTitle("SuperModule ");
+  fhEPhotonSM->SetXTitle("#it{E} (GeV)");
+  outputContainer->Add(fhEPhotonSM) ;
+  
+  fhPtPhotonSM = new TH2F("hPtPhotonSM","Selected clusters #it{p}_[T] and super-module number",
+                           nptbins,ptmin,ptmax,
+                           GetCaloUtils()->GetNumberOfSuperModulesUsed(),0,GetCaloUtils()->GetNumberOfSuperModulesUsed());
+  fhPtPhotonSM->SetYTitle("SuperModule ");
+  fhPtPhotonSM->SetXTitle("#it{E} (GeV)");
+  outputContainer->Add(fhPtPhotonSM) ;
+  
+  fhNCellsE  = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
+  fhNCellsE->SetXTitle("#it{E} (GeV)");
   fhNCellsE->SetYTitle("# of cells in cluster");
-  outputContainer->Add(fhNCellsE);    
+  outputContainer->Add(fhNCellsE);
   
-  fhCellsE  = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax); 
-  fhCellsE->SetXTitle("E_{cluster} (GeV)");
-  fhCellsE->SetYTitle("E_{cell} (GeV)");
-  outputContainer->Add(fhCellsE);    
+  fhCellsE  = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
+  fhCellsE->SetXTitle("#it{E}_{cluster} (GeV)");
+  fhCellsE->SetYTitle("#it{E}_{cell} (GeV)");
+  outputContainer->Add(fhCellsE);
   
-  fhTimeE  = new TH2F ("hTimeE","time of cluster vs E of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax); 
-  fhTimeE->SetXTitle("E (GeV)");
-  fhTimeE->SetYTitle("time (ns)");
-  outputContainer->Add(fhTimeE);  
+  fhTimePt  = new TH2F ("hTimePt","time of cluster vs pT of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+  fhTimePt->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+  fhTimePt->SetYTitle("#it{time} (ns)");
+  outputContainer->Add(fhTimePt);
   
   fhMaxCellDiffClusterE  = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
-                                    nptbins,ptmin,ptmax, 500,0,1.); 
-  fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
-  fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
-  outputContainer->Add(fhMaxCellDiffClusterE);  
-  
-  fhEPhoton  = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax); 
-  fhEPhoton->SetYTitle("N");
-  fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
-  outputContainer->Add(fhEPhoton) ;   
-  
-  fhPtPhoton  = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax); 
-  fhPtPhoton->SetYTitle("N");
-  fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
-  outputContainer->Add(fhPtPhoton) ; 
-
-  fhPtCentralityPhoton  = new TH2F("hPtCentralityPhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
+                                     nptbins,ptmin,ptmax, 500,0,1.);
+  fhMaxCellDiffClusterE->SetXTitle("#it{E}_{cluster} (GeV) ");
+  fhMaxCellDiffClusterE->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
+  outputContainer->Add(fhMaxCellDiffClusterE);
+  
+  fhEPhoton  = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
+  fhEPhoton->SetYTitle("#it{counts}");
+  fhEPhoton->SetXTitle("#it{E}_{#gamma}(GeV)");
+  outputContainer->Add(fhEPhoton) ;
+  
+  fhPtPhoton  = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs #it{p}_[T]",nptbins,ptmin,ptmax);
+  fhPtPhoton->SetYTitle("#it{counts}");
+  fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/#it{c})");
+  outputContainer->Add(fhPtPhoton) ;
+  
+  fhPtCentralityPhoton  = new TH2F("hPtCentralityPhoton","centrality vs #it{p}_[T]",nptbins,ptmin,ptmax, 100,0,100);
   fhPtCentralityPhoton->SetYTitle("Centrality");
-  fhPtCentralityPhoton->SetXTitle("p_{T}(GeV/c)");
+  fhPtCentralityPhoton->SetXTitle("#it{p}_[T](GeV/#it{c})");
   outputContainer->Add(fhPtCentralityPhoton) ;
   
-  fhPtEventPlanePhoton  = new TH2F("hPtEventPlanePhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
+  fhPtEventPlanePhoton  = new TH2F("hPtEventPlanePhoton","centrality vs #it{p}_[T]",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
   fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
-  fhPtEventPlanePhoton->SetXTitle("p_{T} (GeV/c)");
+  fhPtEventPlanePhoton->SetXTitle("#it{p}_[T] (GeV/#it{c})");
   outputContainer->Add(fhPtEventPlanePhoton) ;
-
+  
   fhEtaPhi  = new TH2F
-  ("hEtaPhi","cluster,E > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
+  ("hEtaPhi","cluster,#it{E} > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
   fhEtaPhi->SetYTitle("#phi (rad)");
   fhEtaPhi->SetXTitle("#eta");
   outputContainer->Add(fhEtaPhi) ;
-
+  
   if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
   {
     fhEtaPhiEMCALBC0  = new TH2F
-    ("hEtaPhiEMCALBC0","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
+    ("hEtaPhiEMCALBC0","cluster,#it{E} > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
     fhEtaPhiEMCALBC0->SetYTitle("#phi (rad)");
     fhEtaPhiEMCALBC0->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhiEMCALBC0) ;
     
     fhEtaPhiEMCALBC1  = new TH2F
-    ("hEtaPhiEMCALBC1","cluster,E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
+    ("hEtaPhiEMCALBC1","cluster,#it{E} > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
     fhEtaPhiEMCALBC1->SetYTitle("#phi (rad)");
     fhEtaPhiEMCALBC1->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhiEMCALBC1) ;
     
     fhEtaPhiEMCALBCN  = new TH2F
-    ("hEtaPhiEMCALBCN","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
+    ("hEtaPhiEMCALBCN","cluster,#it{E} > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
     fhEtaPhiEMCALBCN->SetYTitle("#phi (rad)");
     fhEtaPhiEMCALBCN->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhiEMCALBCN) ;
     
-    for(Int_t i = 0; i < 13; i++)
+    for(Int_t i = 0; i < nTrigBC; i++)
     {
       fhEtaPhiTriggerEMCALBC[i] = new TH2F
-      (Form("hEtaPhiTriggerEMCALBC%d",i-5),
-       Form("cluster,E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=%d",i-5),
+      (Form("hEtaPhiTriggerEMCALBC%d",i-iBCShift),
+       Form("cluster #it{E} > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=%d",i-iBCShift),
        netabins,etamin,etamax,nphibins,phimin,phimax);
       fhEtaPhiTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
       fhEtaPhiTriggerEMCALBC[i]->SetXTitle("#eta");
       outputContainer->Add(fhEtaPhiTriggerEMCALBC[i]) ;
       
       fhTimeTriggerEMCALBC[i] = new TH2F
-      (Form("hTimeTriggerEMCALBC%d",i-5),
-       Form("time of cluster vs E of clusters, Trigger EMCAL-BC=%d",i-5),
+      (Form("hTimeTriggerEMCALBC%d",i-iBCShift),
+       Form("cluster #it{time} vs #it{E} of clusters, Trigger EMCAL-BC=%d",i-iBCShift),
        nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
-      fhTimeTriggerEMCALBC[i]->SetXTitle("E (GeV)");
-      fhTimeTriggerEMCALBC[i]->SetYTitle("time (ns)");
+      fhTimeTriggerEMCALBC[i]->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBC[i]->SetYTitle("#it{time} (ns)");
       outputContainer->Add(fhTimeTriggerEMCALBC[i]);
       
       fhTimeTriggerEMCALBCPileUpSPD[i] = new TH2F
-      (Form("hTimeTriggerEMCALBC%dPileUpSPD",i-5),
-       Form("time of cluster vs E of clusters, Trigger EMCAL-BC=%d",i-5),
+      (Form("hTimeTriggerEMCALBC%dPileUpSPD",i-iBCShift),
+       Form("cluster #it{time} vs #it{E} of clusters, Trigger EMCAL-BC=%d",i-iBCShift),
        nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
-      fhTimeTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
-      fhTimeTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
+      fhTimeTriggerEMCALBCPileUpSPD[i]->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCPileUpSPD[i]->SetYTitle("#it{time} (ns)");
       outputContainer->Add(fhTimeTriggerEMCALBCPileUpSPD[i]);
-
+      
+      fhEtaPhiTriggerEMCALBCUM[i] = new TH2F
+      (Form("hEtaPhiTriggerEMCALBC%d_UnMatch",i-iBCShift),
+       Form("cluster #it{E} > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUM[i]->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUM[i]) ;
+      
+      fhTimeTriggerEMCALBCUM[i] = new TH2F
+      (Form("hTimeTriggerEMCALBC%d_UnMatch",i-iBCShift),
+       Form("cluster #it{time} vs #it{E} of clusters, unmatched trigger EMCAL-BC=%d",i-iBCShift),
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUM[i]->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUM[i]->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUM[i]);
+      
+      fhEtaPhiTriggerEMCALBCCluster[i] = new TH2F
+      (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger",i-iBCShift),
+       Form("trigger cluster, #eta vs #phi, Trigger EMCAL-BC=%d",i-iBCShift),
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCCluster[i]->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCCluster[i]->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCCluster[i]) ;
+            
+      fhEtaPhiTriggerEMCALBCUMCluster[i] = new TH2F
+      (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger_UnMatch",i-iBCShift),
+       Form("trigger cluster, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUMCluster[i]->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUMCluster[i]->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUMCluster[i]) ;
+    }
+    
+    fhTimeTriggerEMCALBCCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger",
+                                           "trigger cluster #it{time} vs #it{E} of clusters",
+                                           nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBCCluster->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBCCluster->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBCCluster);
+    
+    fhTimeTriggerEMCALBCUMCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger_UnMatch",
+                                             "trigger cluster #it{time} vs #it{E} of clusters, unmatched trigger",
+                                             nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBCUMCluster->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBCUMCluster->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBCUMCluster);
+    
+    fhEtaPhiTriggerEMCALBCClusterOverTh = new TH2F
+    ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold",
+     "trigger cluster #it{E} > trigger threshold, #eta vs #phi, Trigger EMCAL-BC=0",
+     netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCClusterOverTh->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCClusterOverTh->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterOverTh) ;
+    
+    fhEtaPhiTriggerEMCALBCUMClusterOverTh = new TH2F
+    ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold_UnMatch",
+     "trigger cluster #it{E} > trigger threshold, #eta vs #phi, unmatched trigger EMCAL-BC=0",
+     netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterOverTh) ;
+    
+    fhEtaPhiTriggerEMCALBCClusterBelowTh1 = new TH2F
+    ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1",
+     "trigger cluster thresh-1 < #it{E} < thres, #eta vs #phi, Trigger EMCAL-BC=0",
+     netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh1) ;
+    
+    fhEtaPhiTriggerEMCALBCUMClusterBelowTh1 = new TH2F
+    ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1_UnMatch",
+     "trigger cluster thresh-1 < #it{E} < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
+     netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh1) ;
+    
+    fhEtaPhiTriggerEMCALBCClusterBelowTh2 = new TH2F
+    ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2",
+     "trigger cluster thresh-2 < #it{E} < thres, #eta vs #phi, Trigger EMCAL-BC=0",
+     netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh2) ;
+    
+    fhEtaPhiTriggerEMCALBCUMClusterBelowTh2 = new TH2F
+    ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2_UnMatch",
+     "trigger cluster thresh-2 < #it{E} < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
+     netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh2) ;
+    
+    if(!GetReader()->AreBadTriggerEventsRemoved())
+    {
+      fhEtaPhiTriggerEMCALBCExotic = new TH2F
+      ("hEtaPhiTriggerExotic",
+       "cluster #it{E} > 2 GeV, #eta vs #phi, Trigger Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCExotic->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCExotic->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCExotic) ;
+      
+      fhTimeTriggerEMCALBCExotic = new TH2F
+      ("hTimeTriggerExotic",
+       "cluster #it{time} vs #it{E} of clusters, Trigger Exotic ",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCExotic->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCExotic->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCExotic);
+      
+      fhEtaPhiTriggerEMCALBCUMExotic = new TH2F
+      ("hEtaPhiTriggerExotic_UnMatch",
+       "cluster #it{E} > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUMExotic->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUMExotic->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExotic) ;
+      
+      fhTimeTriggerEMCALBCUMExotic = new TH2F
+      ("hTimeTriggerExotic_UnMatch",
+       "cluster #it{time} vs #it{E} of clusters, unmatched trigger Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMExotic->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMExotic->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMExotic);
+      
+      fhEtaPhiTriggerEMCALBCExoticCluster = new TH2F
+      ("hEtaPhiTriggerExotic_OnlyTrigger",
+       "trigger cluster #it{E} > 2 GeV, #eta vs #phi, Trigger Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCExoticCluster->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCExoticCluster->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCExoticCluster) ;
+      
+      fhTimeTriggerEMCALBCExoticCluster = new TH2F
+      ("hTimeTriggerExotic_OnlyTrigger",
+       "trigger cluster #it{time} vs #it{E} of clusters, Trigger Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCExoticCluster->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCExoticCluster->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCExoticCluster);
+      
+      fhEtaPhiTriggerEMCALBCUMExoticCluster = new TH2F
+      ("hEtaPhiTriggerExotic_OnlyTrigger_UnMatch",
+       "trigger cluster #it{E} > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUMExoticCluster->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUMExoticCluster->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExoticCluster) ;
+      
+      fhTimeTriggerEMCALBCUMExoticCluster = new TH2F
+      ("hTimeTriggerExotic_OnlyTrigger_UnMatch",
+       "trigger cluster #it{time} vs #it{E} of clusters, unmatched trigger Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMExoticCluster->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMExoticCluster->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMExoticCluster);
+      
+      fhEtaPhiTriggerEMCALBCBad = new TH2F
+      ("hEtaPhiTriggerBad",
+       "cluster #it{E} > 2 GeV, #eta vs #phi, Trigger Bad",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCBad->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCBad->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCBad) ;
+      
+      fhTimeTriggerEMCALBCBad = new TH2F
+      ("hTimeTriggerBad",
+       "cluster #it{time} vs #it{E} of clusters, Trigger Bad ",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCBad->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCBad->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCBad);
+      
+      fhEtaPhiTriggerEMCALBCUMBad = new TH2F
+      ("hEtaPhiTriggerBad_UnMatch",
+       "cluster #it{E} > 2 GeV, #eta vs #phi, unmatched trigger Bad",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUMBad->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUMBad->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBad) ;
+      
+      fhTimeTriggerEMCALBCUMBad = new TH2F
+      ("hTimeTriggerBad_UnMatch",
+       "cluster #it{time} vs #it{E} of clusters, unmatched trigger Bad",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMBad->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMBad->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMBad);
+      
+      fhEtaPhiTriggerEMCALBCBadCluster = new TH2F
+      ("hEtaPhiTriggerBad_OnlyTrigger",
+       "trigger cluster #it{E} > 2 GeV, #eta vs #phi, Trigger Bad",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCBadCluster->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCBadCluster->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCBadCluster) ;
+      
+      fhTimeTriggerEMCALBCBadCluster = new TH2F
+      ("hTimeTriggerBad_OnlyTrigger",
+       "trigger cluster #it{time} vs #it{E} of clusters, Trigger Bad",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCBadCluster->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCBadCluster->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCBadCluster);
+      
+      fhEtaPhiTriggerEMCALBCUMBadCluster = new TH2F
+      ("hEtaPhiTriggerBad_OnlyTrigger_UnMatch",
+       "trigger cluster #it{E} > 2 GeV, #eta vs #phi, unmatched trigger Bad",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUMBadCluster->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUMBadCluster->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadCluster) ;
+      
+      fhTimeTriggerEMCALBCUMBadCluster = new TH2F
+      ("hTimeTriggerBad_OnlyTrigger_UnMatch",
+       "trigger cluster time vs #it{E} of clusters, unmatched trigger Bad",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMBadCluster->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMBadCluster->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMBadCluster);
+      
+      fhEtaPhiTriggerEMCALBCBadExotic = new TH2F
+      ("hEtaPhiTriggerBadExotic",
+       "cluster #it{E} > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCBadExotic->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCBadExotic->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExotic) ;
+      
+      fhTimeTriggerEMCALBCBadExotic = new TH2F
+      ("hTimeTriggerBadExotic",
+       "cluster #it{time} vs #it{E} of clusters, Trigger Bad&Exotic ",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCBadExotic->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCBadExotic->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCBadExotic);
+      
+      fhEtaPhiTriggerEMCALBCUMBadExotic = new TH2F
+      ("hEtaPhiTriggerBadExotic_UnMatch",
+       "cluster #it{E} > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUMBadExotic->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUMBadExotic->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExotic) ;
+      
+      fhTimeTriggerEMCALBCUMBadExotic = new TH2F
+      ("hTimeTriggerBadExotic_UnMatch",
+       "cluster #it{time} vs #it{E} of clusters, unmatched trigger Bad&Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMBadExotic->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMBadExotic->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMBadExotic);
+      
+      fhEtaPhiTriggerEMCALBCBadExoticCluster = new TH2F
+      ("hEtaPhiTriggerBadExotic_OnlyTrigger",
+       "trigger cluster #it{E} > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCBadExoticCluster->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCBadExoticCluster->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExoticCluster) ;
+      
+      fhTimeTriggerEMCALBCBadExoticCluster = new TH2F
+      ("hTimeTriggerBadExotic_OnlyTrigger",
+       "trigger cluster #it{time} vs #it{E} of clusters, Trigger Bad&Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCBadExoticCluster->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCBadExoticCluster->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCBadExoticCluster);
+      
+      fhEtaPhiTriggerEMCALBCUMBadExoticCluster = new TH2F
+      ("hEtaPhiTriggerBadExotic_OnlyTrigger_UnMatch",
+       "trigger cluster #it{E} > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetYTitle("#phi (rad)");
+      fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExoticCluster) ;
+      
+      fhTimeTriggerEMCALBCUMBadExoticCluster = new TH2F
+      ("hTimeTriggerBadExotic_OnlyTrigger_UnMatch",
+       "trigger cluster #it{time} vs #it{E} of clusters, unmatched trigger Bad&Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMBadExoticCluster->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMBadExoticCluster->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMBadExoticCluster);
+      
+      fhTimeTriggerEMCALBCBadMaxCell = new TH2F
+      ("hTimeTriggerBadMaxCell",
+       "cluster #it{time} vs #it{E} of clusters, Trigger BadMaxCell",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCBadMaxCell->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCBadMaxCell->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCell);
+      
+      fhTimeTriggerEMCALBCUMBadMaxCell = new TH2F
+      ("hTimeTriggerBadMaxCell_UnMatch",
+       "cluster #it{time} vs #it{E} of clusters, unmatched trigger BadMaxCell",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMBadMaxCell->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMBadMaxCell->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCell);
+      
+      
+      fhTimeTriggerEMCALBCBadMaxCellExotic = new TH2F
+      ("hTimeTriggerBadMaxCellExotic",
+       "cluster #it{time} vs #it{E} of clusters, Trigger BadMaxCell&Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCBadMaxCellExotic->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCBadMaxCellExotic->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCellExotic);
+      
+      fhTimeTriggerEMCALBCUMBadMaxCellExotic = new TH2F
+      ("hTimeTriggerBadMaxCellExotic_UnMatch",
+       "cluster #it{time} vs #it{E} of clusters, unmatched trigger BadMaxCell&Exotic",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetXTitle("#it{E} (GeV)");
+      fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCellExotic);
+      
+      fhTimeNoTrigger = new TH2F
+      ("hTimeNoTrigger",
+       "events with no foundable trigger, time vs e of clusters",
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimeNoTrigger->SetXTitle("#it{E} (GeV)");
+      fhTimeNoTrigger->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimeNoTrigger);
+      
+      fhEtaPhiNoTrigger = new TH2F
+      ("hEtaPhiNoTrigger",
+       "events with no foundable trigger, eta vs phi of clusters",
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiNoTrigger->SetYTitle("#phi (rad)");
+      fhEtaPhiNoTrigger->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiNoTrigger) ;
     }
+    
+    fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_OpenTime",
+                                                       "cluster #it{E} > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time",
+                                                       netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster) ;
+    
+    fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_OpenTime",
+                                                     "cluster #it{time} vs #it{E} of clusters, no match, rematch open time",
+                                                     nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster);
+    
+    
+    fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
+                                                         "cluster #it{E} > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch with neighbour patches",
+                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster) ;
+    
+    fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
+                                                       "cluster #it{time} vs #it{E} of clusters, no match, rematch with neigbour parches",
+                                                       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster);
+    
+    fhEtaPhiTriggerEMCALBCUMReMatchBothCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_Both",
+                                                   "cluster #it{E} > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time and neighbour",
+                                                   netabins,etamin,etamax,nphibins,phimin,phimax);
+    fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetYTitle("#phi (rad)");
+    fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetXTitle("#eta");
+    outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchBothCluster) ;
+    
+    fhTimeTriggerEMCALBCUMReMatchBothCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_Both",
+                                                 "cluster #it{time} vs #it{E} of clusters, no match, rematch open time and neigbour",
+                                                 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBCUMReMatchBothCluster->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBCUMReMatchBothCluster->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchBothCluster);
+    
+    fhTimeTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_OpenTime",
+                                                            "cluster #it{time} vs #it{E} of clusters, no match, rematch open time",
+                                                            nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchOpenTime);
+    
+        
+    fhTimeTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
+                                                              "cluster #it{time} vs #it{E} of clusters, no match, rematch with neigbour parches",
+                                                              nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchCheckNeigh);
+        
+    fhTimeTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_Both",
+                                                        "cluster #it{time} vs #it{E} of clusters, no match, rematch open time and neigbour",
+                                                        nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimeTriggerEMCALBC0UMReMatchBoth->SetXTitle("#it{E} (GeV)");
+    fhTimeTriggerEMCALBC0UMReMatchBoth->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchBoth);
+    
   }
   
   fhPhiPhoton  = new TH2F
-    ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
+  ("hPhiPhoton","#phi_{#gamma} vs #it{p}_[T]",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
   fhPhiPhoton->SetYTitle("#phi (rad)");
-  fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
-  outputContainer->Add(fhPhiPhoton) ; 
+  fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/#it{c})");
+  outputContainer->Add(fhPhiPhoton) ;
   
   fhEtaPhoton  = new TH2F
-    ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
+  ("hEtaPhoton","#eta_{#gamma} vs #it{p}_[T]",nptbins,ptmin,ptmax,netabins,etamin,etamax);
   fhEtaPhoton->SetYTitle("#eta");
-  fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
+  fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/#it{c})");
   outputContainer->Add(fhEtaPhoton) ;
   
   fhEtaPhiPhoton  = new TH2F
-  ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax); 
+  ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
   fhEtaPhiPhoton->SetYTitle("#phi (rad)");
   fhEtaPhiPhoton->SetXTitle("#eta");
   outputContainer->Add(fhEtaPhiPhoton) ;
   if(GetMinPt() < 0.5)
   {
     fhEtaPhi05Photon  = new TH2F
-    ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax); 
+    ("hEtaPhi05Photon","#eta vs #phi, E < 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
     fhEtaPhi05Photon->SetYTitle("#phi (rad)");
     fhEtaPhi05Photon->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhi05Photon) ;
   }
-
+  
   if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
   {
     fhEtaPhiPhotonEMCALBC0  = new TH2F
-    ("hEtaPhiPhotonEMCALBC0","identified photon, E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
+    ("hEtaPhiPhotonEMCALBC0","identified photon, #it{E} > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
     fhEtaPhiPhotonEMCALBC0->SetYTitle("#phi (rad)");
     fhEtaPhiPhotonEMCALBC0->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhiPhotonEMCALBC0) ;
     
     fhEtaPhiPhotonEMCALBC1  = new TH2F
-    ("hEtaPhiPhotonEMCALBC1","identified photon, E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
+    ("hEtaPhiPhotonEMCALBC1","identified photon, #it{E} > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
     fhEtaPhiPhotonEMCALBC1->SetYTitle("#phi (rad)");
     fhEtaPhiPhotonEMCALBC1->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhiPhotonEMCALBC1) ;
     
     fhEtaPhiPhotonEMCALBCN  = new TH2F
-    ("hEtaPhiPhotonEMCALBCN","identified photon, E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
+    ("hEtaPhiPhotonEMCALBCN","identified photon, #it{E} > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
     fhEtaPhiPhotonEMCALBCN->SetYTitle("#phi (rad)");
     fhEtaPhiPhotonEMCALBCN->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhiPhotonEMCALBCN) ;
     
-    for(Int_t i = 0; i < 13; i++)
+    for(Int_t i = 0; i < nTrigBC; i++)
     {
       fhEtaPhiPhotonTriggerEMCALBC[i] = new TH2F
-      (Form("hEtaPhiPhotonTriggerEMCALBC%d",i-5),
-       Form("cluster,E > 2 GeV, #eta vs #phi, PhotonTrigger EMCAL-BC=%d",i-5),
+      (Form("hEtaPhiPhotonTriggerEMCALBC%d",i-iBCShift),
+       Form("photon #it{E} > 2 GeV, #eta vs #phi, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
        netabins,etamin,etamax,nphibins,phimin,phimax);
       fhEtaPhiPhotonTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
       fhEtaPhiPhotonTriggerEMCALBC[i]->SetXTitle("#eta");
       outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBC[i]) ;
       
       fhTimePhotonTriggerEMCALBC[i] = new TH2F
-      (Form("hTimePhotonTriggerEMCALBC%d",i-5),
-       Form("time of cluster vs E of clusters, PhotonTrigger EMCAL-BC=%d",i-5),
+      (Form("hTimePhotonTriggerEMCALBC%d",i-iBCShift),
+       Form("photon #it{time} vs #it{E} of clusters, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
        nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
-      fhTimePhotonTriggerEMCALBC[i]->SetXTitle("E (GeV)");
-      fhTimePhotonTriggerEMCALBC[i]->SetYTitle("time (ns)");
+      fhTimePhotonTriggerEMCALBC[i]->SetXTitle("#it{E} (GeV)");
+      fhTimePhotonTriggerEMCALBC[i]->SetYTitle("#it{time} (ns)");
       outputContainer->Add(fhTimePhotonTriggerEMCALBC[i]);
       
       fhTimePhotonTriggerEMCALBCPileUpSPD[i] = new TH2F
-      (Form("hTimePhotonTriggerEMCALBC%dPileUpSPD",i-5),
-       Form("time of cluster vs E of clusters, PhotonTrigger EMCAL-BC=%d",i-5),
+      (Form("hTimePhotonTriggerEMCALBC%dPileUpSPD",i-iBCShift),
+       Form("photon #it{time} vs #it{E}, PhotonTrigger EMCAL-BC=%d",i-iBCShift),
        nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
-      fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
-      fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
+      fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetXTitle("#it{E} (GeV)");
+      fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetYTitle("#it{time} (ns)");
       outputContainer->Add(fhTimePhotonTriggerEMCALBCPileUpSPD[i]);
       
+      fhEtaPhiPhotonTriggerEMCALBCUM[i] = new TH2F
+      (Form("hEtaPhiPhotonTriggerEMCALBC%d_UnMatch",i-iBCShift),
+       Form("photon #it{E} > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-iBCShift),
+       netabins,etamin,etamax,nphibins,phimin,phimax);
+      fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
+      fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetXTitle("#eta");
+      outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBCUM[i]) ;
+      
+      fhTimePhotonTriggerEMCALBCUM[i] = new TH2F
+      (Form("hTimePhotonTriggerEMCALBC%d_UnMatch",i-iBCShift),
+       Form("photon #it{time} vs #it{E}, unmatched trigger EMCAL-BC=%d",i-iBCShift),
+       nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+      fhTimePhotonTriggerEMCALBCUM[i]->SetXTitle("#it{E} (GeV)");
+      fhTimePhotonTriggerEMCALBCUM[i]->SetYTitle("#it{time} (ns)");
+      outputContainer->Add(fhTimePhotonTriggerEMCALBCUM[i]);
+      
     }
+    
+    fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_OpenTime",
+                                                      "cluster #it{time} vs #it{E} of photons, no match, rematch open time",
+                                                      nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("#it{E} (GeV)");
+    fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime);
+    
+    
+    fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
+                                                        "cluster #it{time} vs #it{E} of photons, no match, rematch with neigbour parches",
+                                                        nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("#it{E} (GeV)");
+    fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh);
+    
+    fhTimePhotonTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_Both",
+                                                  "cluster #it{time} vs #it{E} of photons, no match, rematch open time and neigbour",
+                                                  nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetXTitle("#it{E} (GeV)");
+    fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchBoth);
+
   }
   
   fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
-                       nptbins,ptmin,ptmax,10,0,10); 
+                       nptbins,ptmin,ptmax,10,0,10);
   fhNLocMax ->SetYTitle("N maxima");
-  fhNLocMax ->SetXTitle("E (GeV)");
-  outputContainer->Add(fhNLocMax) ;  
+  fhNLocMax ->SetXTitle("#it{E} (GeV)");
+  outputContainer->Add(fhNLocMax) ;
   
   //Shower shape
   if(fFillSSHistograms)
   {
-    fhLam0E  = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+    fhLam0E  = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
     fhLam0E->SetYTitle("#lambda_{0}^{2}");
-    fhLam0E->SetXTitle("E (GeV)");
-    outputContainer->Add(fhLam0E);  
+    fhLam0E->SetXTitle("#it{E} (GeV)");
+    outputContainer->Add(fhLam0E);
     
-    fhLam1E  = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+    fhLam1E  = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
     fhLam1E->SetYTitle("#lambda_{1}^{2}");
-    fhLam1E->SetXTitle("E (GeV)");
-    outputContainer->Add(fhLam1E);  
+    fhLam1E->SetXTitle("#it{E} (GeV)");
+    outputContainer->Add(fhLam1E);
     
-    fhDispE  = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+    fhDispE  = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
     fhDispE->SetYTitle("D^{2}");
-    fhDispE->SetXTitle("E (GeV) ");
+    fhDispE->SetXTitle("#it{E} (GeV) ");
     outputContainer->Add(fhDispE);
-
+    
     if(!fRejectTrackMatch)
     {
-      fhLam0ETM  = new TH2F ("hLam0ETM","#lambda_{0}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+      fhLam0ETM  = new TH2F ("hLam0ETM","#lambda_{0}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
       fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
-      fhLam0ETM->SetXTitle("E (GeV)");
-      outputContainer->Add(fhLam0ETM);  
+      fhLam0ETM->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhLam0ETM);
       
-      fhLam1ETM  = new TH2F ("hLam1ETM","#lambda_{1}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+      fhLam1ETM  = new TH2F ("hLam1ETM","#lambda_{1}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
       fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
-      fhLam1ETM->SetXTitle("E (GeV)");
-      outputContainer->Add(fhLam1ETM);  
+      fhLam1ETM->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhLam1ETM);
       
-      fhDispETM  = new TH2F ("hDispETM"," dispersion^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+      fhDispETM  = new TH2F ("hDispETM"," dispersion^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
       fhDispETM->SetYTitle("D^{2}");
-      fhDispETM->SetXTitle("E (GeV) ");
+      fhDispETM->SetXTitle("#it{E} (GeV) ");
       outputContainer->Add(fhDispETM);
     }
     
     if(fCalorimeter == "EMCAL")
     {
-      fhLam0ETRD  = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+      fhLam0ETRD  = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
       fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
-      fhLam0ETRD->SetXTitle("E (GeV)");
-      outputContainer->Add(fhLam0ETRD);  
+      fhLam0ETRD->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhLam0ETRD);
       
-      fhLam1ETRD  = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+      fhLam1ETRD  = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
       fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
-      fhLam1ETRD->SetXTitle("E (GeV)");
-      outputContainer->Add(fhLam1ETRD);  
+      fhLam1ETRD->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhLam1ETRD);
       
-      fhDispETRD  = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+      fhDispETRD  = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
       fhDispETRD->SetYTitle("Dispersion^{2}");
-      fhDispETRD->SetXTitle("E (GeV) ");
+      fhDispETRD->SetXTitle("#it{E} (GeV) ");
       outputContainer->Add(fhDispETRD);
       
       if(!fRejectTrackMatch)
       {
-        fhLam0ETMTRD  = new TH2F ("hLam0ETMTRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+        fhLam0ETMTRD  = new TH2F ("hLam0ETMTRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
-        fhLam0ETMTRD->SetXTitle("E (GeV)");
-        outputContainer->Add(fhLam0ETMTRD);  
+        fhLam0ETMTRD->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhLam0ETMTRD);
         
-        fhLam1ETMTRD  = new TH2F ("hLam1ETMTRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+        fhLam1ETMTRD  = new TH2F ("hLam1ETMTRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
-        fhLam1ETMTRD->SetXTitle("E (GeV)");
-        outputContainer->Add(fhLam1ETMTRD);  
+        fhLam1ETMTRD->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhLam1ETMTRD);
         
-        fhDispETMTRD  = new TH2F ("hDispETMTRD"," dispersion^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+        fhDispETMTRD  = new TH2F ("hDispETMTRD"," dispersion^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05,  |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhDispETMTRD->SetYTitle("Dispersion^{2}");
-        fhDispETMTRD->SetXTitle("E (GeV) ");
-        outputContainer->Add(fhDispETMTRD);         
-      } 
-    } 
+        fhDispETMTRD->SetXTitle("#it{E} (GeV) ");
+        outputContainer->Add(fhDispETMTRD);
+      }
+    }
     
     if(!fFillOnlySimpleSSHisto)
     {
-      fhNCellsLam0LowE  = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax); 
+      fhNCellsLam0LowE  = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
       fhNCellsLam0LowE->SetXTitle("N_{cells}");
       fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
-      outputContainer->Add(fhNCellsLam0LowE);  
+      outputContainer->Add(fhNCellsLam0LowE);
       
-      fhNCellsLam0HighE  = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax); 
+      fhNCellsLam0HighE  = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, #it{E} > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
       fhNCellsLam0HighE->SetXTitle("N_{cells}");
       fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
-      outputContainer->Add(fhNCellsLam0HighE);  
+      outputContainer->Add(fhNCellsLam0HighE);
       
-      fhNCellsLam1LowE  = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax); 
+      fhNCellsLam1LowE  = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
       fhNCellsLam1LowE->SetXTitle("N_{cells}");
       fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
-      outputContainer->Add(fhNCellsLam1LowE);  
+      outputContainer->Add(fhNCellsLam1LowE);
       
-      fhNCellsLam1HighE  = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax); 
+      fhNCellsLam1HighE  = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, #it{E} > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
       fhNCellsLam1HighE->SetXTitle("N_{cells}");
       fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
-      outputContainer->Add(fhNCellsLam1HighE);  
+      outputContainer->Add(fhNCellsLam1HighE);
       
-      fhNCellsDispLowE  = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax); 
+      fhNCellsDispLowE  = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
       fhNCellsDispLowE->SetXTitle("N_{cells}");
       fhNCellsDispLowE->SetYTitle("D^{2}");
-      outputContainer->Add(fhNCellsDispLowE);  
+      outputContainer->Add(fhNCellsDispLowE);
       
-      fhNCellsDispHighE  = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax); 
+      fhNCellsDispHighE  = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
       fhNCellsDispHighE->SetXTitle("N_{cells}");
       fhNCellsDispHighE->SetYTitle("D^{2}");
-      outputContainer->Add(fhNCellsDispHighE);  
+      outputContainer->Add(fhNCellsDispHighE);
       
-      fhEtaLam0LowE  = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax); 
+      fhEtaLam0LowE  = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
       fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
       fhEtaLam0LowE->SetXTitle("#eta");
-      outputContainer->Add(fhEtaLam0LowE);  
+      outputContainer->Add(fhEtaLam0LowE);
       
-      fhPhiLam0LowE  = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax); 
+      fhPhiLam0LowE  = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
       fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
       fhPhiLam0LowE->SetXTitle("#phi");
-      outputContainer->Add(fhPhiLam0LowE);  
+      outputContainer->Add(fhPhiLam0LowE);
       
-      fhEtaLam0HighE  = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax); 
+      fhEtaLam0HighE  = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, #it{E} > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
       fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
       fhEtaLam0HighE->SetXTitle("#eta");
-      outputContainer->Add(fhEtaLam0HighE);  
+      outputContainer->Add(fhEtaLam0HighE);
       
-      fhPhiLam0HighE  = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax); 
+      fhPhiLam0HighE  = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, #it{E} > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
       fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
       fhPhiLam0HighE->SetXTitle("#phi");
-      outputContainer->Add(fhPhiLam0HighE);  
+      outputContainer->Add(fhPhiLam0HighE);
       
-      fhLam1Lam0LowE  = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax); 
+      fhLam1Lam0LowE  = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
       fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
       fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
-      outputContainer->Add(fhLam1Lam0LowE);  
+      outputContainer->Add(fhLam1Lam0LowE);
       
-      fhLam1Lam0HighE  = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax); 
+      fhLam1Lam0HighE  = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of #it{E} > 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
       fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
       fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
-      outputContainer->Add(fhLam1Lam0HighE);  
+      outputContainer->Add(fhLam1Lam0HighE);
       
-      fhLam0DispLowE  = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax); 
+      fhLam0DispLowE  = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
       fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
       fhLam0DispLowE->SetYTitle("D^{2}");
-      outputContainer->Add(fhLam0DispLowE);  
+      outputContainer->Add(fhLam0DispLowE);
       
-      fhLam0DispHighE  = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax); 
+      fhLam0DispHighE  = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of #it{E} > 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
       fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
       fhLam0DispHighE->SetYTitle("D^{2}");
-      outputContainer->Add(fhLam0DispHighE);  
+      outputContainer->Add(fhLam0DispHighE);
       
-      fhDispLam1LowE  = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax); 
+      fhDispLam1LowE  = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
       fhDispLam1LowE->SetXTitle("D^{2}");
       fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
-      outputContainer->Add(fhDispLam1LowE);  
+      outputContainer->Add(fhDispLam1LowE);
       
-      fhDispLam1HighE  = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax); 
+      fhDispLam1HighE  = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of #it{E} > 2 GeV",  ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
       fhDispLam1HighE->SetXTitle("D^{2}");
       fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
-      outputContainer->Add(fhDispLam1HighE);  
+      outputContainer->Add(fhDispLam1HighE);
       
       if(fCalorimeter == "EMCAL")
       {
-        fhDispEtaE  = new TH2F ("hDispEtaE","#sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax); 
-        fhDispEtaE->SetXTitle("E (GeV)");
+        fhDispEtaE  = new TH2F ("hDispEtaE","#sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
+        fhDispEtaE->SetXTitle("#it{E} (GeV)");
         fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
-        outputContainer->Add(fhDispEtaE);     
+        outputContainer->Add(fhDispEtaE);
         
-        fhDispPhiE  = new TH2F ("hDispPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax); 
-        fhDispPhiE->SetXTitle("E (GeV)");
+        fhDispPhiE  = new TH2F ("hDispPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
+        fhDispPhiE->SetXTitle("#it{E} (GeV)");
         fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
-        outputContainer->Add(fhDispPhiE);  
+        outputContainer->Add(fhDispPhiE);
         
-        fhSumEtaE  = new TH2F ("hSumEtaE","#delta^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i})^{2} / #Sigma w_{i} - <#eta>^{2} vs E",  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax); 
-        fhSumEtaE->SetXTitle("E (GeV)");
+        fhSumEtaE  = new TH2F ("hSumEtaE","#delta^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i})^{2} / #Sigma w_{i} - <#eta>^{2} vs E",  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
+        fhSumEtaE->SetXTitle("#it{E} (GeV)");
         fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
-        outputContainer->Add(fhSumEtaE);     
+        outputContainer->Add(fhSumEtaE);
         
-        fhSumPhiE  = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",  
-                               nptbins,ptmin,ptmax, ssbins,ssmin,ssmax); 
-        fhSumPhiE->SetXTitle("E (GeV)");
+        fhSumPhiE  = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
+                               nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
+        fhSumPhiE->SetXTitle("#it{E} (GeV)");
         fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
-        outputContainer->Add(fhSumPhiE);  
+        outputContainer->Add(fhSumPhiE);
         
-        fhSumEtaPhiE  = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",  
-                                  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax); 
-        fhSumEtaPhiE->SetXTitle("E (GeV)");
+        fhSumEtaPhiE  = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
+                                  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
+        fhSumEtaPhiE->SetXTitle("#it{E} (GeV)");
         fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
         outputContainer->Add(fhSumEtaPhiE);
         
-        fhDispEtaPhiDiffE  = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E", 
-                                       nptbins,ptmin,ptmax,200, -10,10); 
-        fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
+        fhDispEtaPhiDiffE  = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
+                                       nptbins,ptmin,ptmax,200, -10,10);
+        fhDispEtaPhiDiffE->SetXTitle("#it{E} (GeV)");
         fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
-        outputContainer->Add(fhDispEtaPhiDiffE);    
+        outputContainer->Add(fhDispEtaPhiDiffE);
         
-        fhSphericityE  = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",  
-                                   nptbins,ptmin,ptmax, 200, -1,1); 
-        fhSphericityE->SetXTitle("E (GeV)");
+        fhSphericityE  = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
+                                   nptbins,ptmin,ptmax, 200, -1,1);
+        fhSphericityE->SetXTitle("#it{E} (GeV)");
         fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
         outputContainer->Add(fhSphericityE);
         
-        fhDispSumEtaDiffE  = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E",  nptbins,ptmin,ptmax, 200,-0.01,0.01); 
-        fhDispSumEtaDiffE->SetXTitle("E (GeV)");
+        fhDispSumEtaDiffE  = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E",  nptbins,ptmin,ptmax, 200,-0.01,0.01);
+        fhDispSumEtaDiffE->SetXTitle("#it{E} (GeV)");
         fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
-        outputContainer->Add(fhDispSumEtaDiffE);     
+        outputContainer->Add(fhDispSumEtaDiffE);
         
-        fhDispSumPhiDiffE  = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E",  nptbins,ptmin,ptmax, 200,-0.01,0.01); 
-        fhDispSumPhiDiffE->SetXTitle("E (GeV)");
+        fhDispSumPhiDiffE  = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E",  nptbins,ptmin,ptmax, 200,-0.01,0.01);
+        fhDispSumPhiDiffE->SetXTitle("#it{E} (GeV)");
         fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
-        outputContainer->Add(fhDispSumPhiDiffE);  
+        outputContainer->Add(fhDispSumPhiDiffE);
         
         for(Int_t i = 0; i < 7; i++)
         {
-          fhDispEtaDispPhi[i] = new TH2F (Form("hDispEtaDispPhi_EBin%d",i),Form("#sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]), 
-                                          ssbins,ssmin,ssmax , ssbins,ssmin,ssmax); 
+          fhDispEtaDispPhi[i] = new TH2F (Form("hDispEtaDispPhi_EBin%d",i),Form("#sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]),
+                                          ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
           fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
           fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
-          outputContainer->Add(fhDispEtaDispPhi[i]); 
+          outputContainer->Add(fhDispEtaDispPhi[i]);
           
-          fhLambda0DispEta[i] = new TH2F (Form("hLambda0DispEta_EBin%d",i),Form("#lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]), 
-                                          ssbins,ssmin,ssmax , ssbins,ssmin,ssmax); 
+          fhLambda0DispEta[i] = new TH2F (Form("hLambda0DispEta_EBin%d",i),Form("#lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]),
+                                          ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
           fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
           fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
-          outputContainer->Add(fhLambda0DispEta[i]);       
+          outputContainer->Add(fhLambda0DispEta[i]);
           
-          fhLambda0DispPhi[i] = new TH2F (Form("hLambda0DispPhi_EBin%d",i),Form("#lambda^{2}_{0}} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",bin[i],bin[i+1]), 
-                                          ssbins,ssmin,ssmax , ssbins,ssmin,ssmax); 
+          fhLambda0DispPhi[i] = new TH2F (Form("hLambda0DispPhi_EBin%d",i),Form("#lambda^{2}_{0}} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",bin[i],bin[i+1]),
+                                          ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
           fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
           fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
-          outputContainer->Add(fhLambda0DispPhi[i]);         
+          outputContainer->Add(fhLambda0DispPhi[i]);
         }
       }
     }
@@ -1876,273 +2688,195 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
   
   if(fFillTMHisto)
   {
-    fhTrackMatchedDEta[0]  = new TH2F
-    ("hTrackMatchedDEtaNoCut",
-     "d#eta of cluster-track vs cluster energy, no photon cuts",
-     nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-    fhTrackMatchedDEta[0]->SetYTitle("d#eta");
-    fhTrackMatchedDEta[0]->SetXTitle("E_{cluster} (GeV)");
-    
-    fhTrackMatchedDPhi[0]  = new TH2F
-    ("hTrackMatchedDPhiNoCut",
-     "d#phi of cluster-track vs cluster energy, no photon cuts",
-     nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-    fhTrackMatchedDPhi[0]->SetYTitle("d#phi (rad)");
-    fhTrackMatchedDPhi[0]->SetXTitle("E_{cluster} (GeV)");
-    
-    fhTrackMatchedDEtaDPhi[0]  = new TH2F
-    ("hTrackMatchedDEtaDPhiNoCut",
-     "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
-     nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax); 
-    fhTrackMatchedDEtaDPhi[0]->SetYTitle("d#phi (rad)");
-    fhTrackMatchedDEtaDPhi[0]->SetXTitle("d#eta");   
-        
-    fhdEdx[0]  = new TH2F ("hdEdxNoCut","matched track <dE/dx> vs cluster E, no photon cuts ", 
-                           nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax); 
-    fhdEdx[0]->SetXTitle("E (GeV)");
-    fhdEdx[0]->SetYTitle("<dE/dx>");
-    
-    fhEOverP[0]  = new TH2F ("hEOverPNoCut","matched track E/p vs cluster E, no photon cuts ", 
-                             nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax); 
-    fhEOverP[0]->SetXTitle("E (GeV)");
-    fhEOverP[0]->SetYTitle("E/p");
-    
-    outputContainer->Add(fhTrackMatchedDEta[0]) ; 
-    outputContainer->Add(fhTrackMatchedDPhi[0]) ;
-    outputContainer->Add(fhTrackMatchedDEtaDPhi[0]) ;
-    outputContainer->Add(fhdEdx[0]);  
-    outputContainer->Add(fhEOverP[0]);  
-
-    fhTrackMatchedDEta[1]  = new TH2F
-    ("hTrackMatchedDEta",
-     "d#eta of cluster-track vs cluster energy, no photon cuts",
-     nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-    fhTrackMatchedDEta[1]->SetYTitle("d#eta");
-    fhTrackMatchedDEta[1]->SetXTitle("E_{cluster} (GeV)");
-    
-    fhTrackMatchedDPhi[1]  = new TH2F
-    ("hTrackMatchedDPhi",
-     "d#phi of cluster-track vs cluster energy, no photon cuts",
-     nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-    fhTrackMatchedDPhi[1]->SetYTitle("d#phi (rad)");
-    fhTrackMatchedDPhi[1]->SetXTitle("E_{cluster} (GeV)");
-    
-    fhTrackMatchedDEtaDPhi[1]  = new TH2F
-    ("hTrackMatchedDEtaDPhi",
-     "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
-     nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax); 
-    fhTrackMatchedDEtaDPhi[1]->SetYTitle("d#phi (rad)");
-    fhTrackMatchedDEtaDPhi[1]->SetXTitle("d#eta");   
-    
-    fhdEdx[1]  = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ", 
-                           nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax); 
-    fhdEdx[1]->SetXTitle("E (GeV)");
-    fhdEdx[1]->SetYTitle("<dE/dx>");
-    
-    fhEOverP[1]  = new TH2F ("hEOverP","matched track E/p vs cluster E ", 
-                             nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax); 
-    fhEOverP[1]->SetXTitle("E (GeV)");
-    fhEOverP[1]->SetYTitle("E/p");
-    
-    outputContainer->Add(fhTrackMatchedDEta[1]) ; 
-    outputContainer->Add(fhTrackMatchedDPhi[1]) ;
-    outputContainer->Add(fhTrackMatchedDEtaDPhi[1]) ;
-    outputContainer->Add(fhdEdx[1]);  
-    outputContainer->Add(fhEOverP[1]);      
-    
-    if(fCalorimeter=="EMCAL")
-    {
-      fhTrackMatchedDEtaTRD[0]  = new TH2F
-      ("hTrackMatchedDEtaTRDNoCut",
-       "d#eta of cluster-track vs cluster energy, SM behind TRD, no photon cuts",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaTRD[0]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaTRD[0]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiTRD[0]  = new TH2F
-      ("hTrackMatchedDPhiTRDNoCut",
-       "d#phi of cluster-track vs cluster energy, SM behing TRD, no photon cuts",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiTRD[0]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiTRD[0]->SetXTitle("E_{cluster} (GeV)");
-            
-      fhEOverPTRD[0]  = new TH2F ("hEOverPTRDNoCut","matched track E/p vs cluster E, behind TRD, no photon cuts ", 
-                                  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax); 
-      fhEOverPTRD[0]->SetXTitle("E (GeV)");
-      fhEOverPTRD[0]->SetYTitle("E/p");
-      
-      outputContainer->Add(fhTrackMatchedDEtaTRD[0]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiTRD[0]) ;
-      outputContainer->Add(fhEOverPTRD[0]);  
-      
-      fhTrackMatchedDEtaTRD[1]  = new TH2F
-      ("hTrackMatchedDEtaTRD",
-       "d#eta of cluster-track vs cluster energy, SM behind TRD",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaTRD[1]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaTRD[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiTRD[1]  = new TH2F
-      ("hTrackMatchedDPhiTRD",
-       "d#phi of cluster-track vs cluster energy, SM behing TRD",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiTRD[1]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiTRD[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhEOverPTRD[1]  = new TH2F ("hEOverPTRD","matched track E/p vs cluster E, behind TRD ", 
-                                  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax); 
-      fhEOverPTRD[1]->SetXTitle("E (GeV)");
-      fhEOverPTRD[1]->SetYTitle("E/p");
-      
-      outputContainer->Add(fhTrackMatchedDEtaTRD[1]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiTRD[1]) ;
-      outputContainer->Add(fhEOverPTRD[1]);  
-      
-    }
+    TString cutTM [] = {"NoCut",""};
     
-    if(IsDataMC())
+    for(Int_t i = 0; i < 2; i++)
     {
-      fhTrackMatchedDEtaMCNoOverlap[0]  = new TH2F
-      ("hTrackMatchedDEtaMCNoOverlapNoCut",
-       "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaMCNoOverlap[0]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiMCNoOverlap[0]  = new TH2F
-      ("hTrackMatchedDPhiMCNoOverlapNoCut",
-       "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiMCNoOverlap[0]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
-      
-      outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[0]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[0]) ;
-      
-      fhTrackMatchedDEtaMCNoOverlap[1]  = new TH2F
-      ("hTrackMatchedDEtaMCNoOverlap",
-       "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaMCNoOverlap[1]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiMCNoOverlap[1]  = new TH2F
-      ("hTrackMatchedDPhiMCNoOverlap",
-       "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiMCNoOverlap[1]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[1]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[1]) ;
-      
-      fhTrackMatchedDEtaMCOverlap[0]  = new TH2F
-      ("hTrackMatchedDEtaMCOverlapNoCut",
-       "d#eta of cluster-track vs cluster energy, several MC particles overlap",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaMCOverlap[0]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiMCOverlap[0]  = new TH2F
-      ("hTrackMatchedDPhiMCOverlapNoCut",
-       "d#phi of cluster-track vs cluster energy, several MC particles overlap",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiMCOverlap[0]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
-      
-      outputContainer->Add(fhTrackMatchedDEtaMCOverlap[0]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiMCOverlap[0]) ;
-      
-      fhTrackMatchedDEtaMCOverlap[1]  = new TH2F
-      ("hTrackMatchedDEtaMCOverlap",
-       "d#eta of cluster-track vs cluster energy, several MC particles overlap",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaMCOverlap[1]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiMCOverlap[1]  = new TH2F
-      ("hTrackMatchedDPhiMCOverlap",
-       "d#phi of cluster-track vs cluster energy, several MC particles overlap",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiMCOverlap[1]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      outputContainer->Add(fhTrackMatchedDEtaMCOverlap[1]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiMCOverlap[1]) ;      
-      
-      fhTrackMatchedDEtaMCConversion[0]  = new TH2F
-      ("hTrackMatchedDEtaMCConversionNoCut",
-       "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaMCConversion[0]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiMCConversion[0]  = new TH2F
-      ("hTrackMatchedDPhiMCConversionNoCut",
-       "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiMCConversion[0]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
-      
-      outputContainer->Add(fhTrackMatchedDEtaMCConversion[0]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiMCConversion[0]) ;
-       
-      
-      fhTrackMatchedDEtaMCConversion[1]  = new TH2F
-      ("hTrackMatchedDEtaMCConversion",
-       "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
-       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
-      fhTrackMatchedDEtaMCConversion[1]->SetYTitle("d#eta");
-      fhTrackMatchedDEtaMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      fhTrackMatchedDPhiMCConversion[1]  = new TH2F
-      ("hTrackMatchedDPhiMCConversion",
-       "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
-       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
-      fhTrackMatchedDPhiMCConversion[1]->SetYTitle("d#phi (rad)");
-      fhTrackMatchedDPhiMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
-      
-      outputContainer->Add(fhTrackMatchedDEtaMCConversion[1]) ; 
-      outputContainer->Add(fhTrackMatchedDPhiMCConversion[1]) ;
-      
-      
-      fhTrackMatchedMCParticle[0]  = new TH2F
-      ("hTrackMatchedMCParticleNoCut",
-       "Origin of particle vs energy",
-       nptbins,ptmin,ptmax,8,0,8); 
-      fhTrackMatchedMCParticle[0]->SetXTitle("E (GeV)");   
-      //fhTrackMatchedMCParticle[0]->SetYTitle("Particle type");
-      
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(1 ,"Photon");
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(2 ,"Electron");
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(4 ,"Rest");
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
-      fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
-      
-      fhTrackMatchedMCParticle[1]  = new TH2F
-      ("hTrackMatchedMCParticle",
-       "Origin of particle vs energy",
-       nptbins,ptmin,ptmax,8,0,8); 
-      fhTrackMatchedMCParticle[1]->SetXTitle("E (GeV)");   
-      //fhTrackMatchedMCParticle[1]->SetYTitle("Particle type");
-      
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(1 ,"Photon");
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(2 ,"Electron");
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(4 ,"Rest");
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
-      fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");      
-      
-      outputContainer->Add(fhTrackMatchedMCParticle[0]);            
-      outputContainer->Add(fhTrackMatchedMCParticle[1]);       
+      fhTrackMatchedDEta[i]  = new TH2F
+      (Form("hTrackMatchedDEta%s",cutTM[i].Data()),
+       Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
+      fhTrackMatchedDEta[i]->SetYTitle("d#eta");
+      fhTrackMatchedDEta[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+      
+      fhTrackMatchedDPhi[i]  = new TH2F
+      (Form("hTrackMatchedDPhi%s",cutTM[i].Data()),
+       Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
+      fhTrackMatchedDPhi[i]->SetYTitle("d#phi (rad)");
+      fhTrackMatchedDPhi[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+      
+      fhTrackMatchedDEtaDPhi[i]  = new TH2F
+      (Form("hTrackMatchedDEtaDPhi%s",cutTM[i].Data()),
+       Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
+      fhTrackMatchedDEtaDPhi[i]->SetYTitle("d#phi (rad)");
+      fhTrackMatchedDEtaDPhi[i]->SetXTitle("d#eta");
+      
+      fhTrackMatchedDEtaPos[i]  = new TH2F
+      (Form("hTrackMatchedDEtaPos%s",cutTM[i].Data()),
+       Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
+      fhTrackMatchedDEtaPos[i]->SetYTitle("d#eta");
+      fhTrackMatchedDEtaPos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+      
+      fhTrackMatchedDPhiPos[i]  = new TH2F
+      (Form("hTrackMatchedDPhiPos%s",cutTM[i].Data()),
+       Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
+      fhTrackMatchedDPhiPos[i]->SetYTitle("d#phi (rad)");
+      fhTrackMatchedDPhiPos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+      
+      fhTrackMatchedDEtaDPhiPos[i]  = new TH2F
+      (Form("hTrackMatchedDEtaDPhiPos%s",cutTM[i].Data()),
+       Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
+      fhTrackMatchedDEtaDPhiPos[i]->SetYTitle("d#phi (rad)");
+      fhTrackMatchedDEtaDPhiPos[i]->SetXTitle("d#eta");
+      
+      fhTrackMatchedDEtaNeg[i]  = new TH2F
+      (Form("hTrackMatchedDEtaNeg%s",cutTM[i].Data()),
+       Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
+      fhTrackMatchedDEtaNeg[i]->SetYTitle("d#eta");
+      fhTrackMatchedDEtaNeg[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+      
+      fhTrackMatchedDPhiNeg[i]  = new TH2F
+      (Form("hTrackMatchedDPhiNeg%s",cutTM[i].Data()),
+       Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
+      fhTrackMatchedDPhiNeg[i]->SetYTitle("d#phi (rad)");
+      fhTrackMatchedDPhiNeg[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+      
+      fhTrackMatchedDEtaDPhiNeg[i]  = new TH2F
+      (Form("hTrackMatchedDEtaDPhiNeg%s",cutTM[i].Data()),
+       Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
+       nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
+      fhTrackMatchedDEtaDPhiNeg[i]->SetYTitle("d#phi (rad)");
+      fhTrackMatchedDEtaDPhiNeg[i]->SetXTitle("d#eta");
+      
+      fhdEdx[i]  = new TH2F (Form("hdEdx%s",cutTM[i].Data()),Form("matched track <dE/dx> vs cluster E, %s",cutTM[i].Data()),
+                             nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
+      fhdEdx[i]->SetXTitle("#it{E} (GeV)");
+      fhdEdx[i]->SetYTitle("<dE/dx>");
+      
+      fhEOverP[i]  = new TH2F (Form("hEOverP%s",cutTM[i].Data()),Form("matched track E/p vs cluster E, %s",cutTM[i].Data()),
+                               nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
+      fhEOverP[i]->SetXTitle("#it{E} (GeV)");
+      fhEOverP[i]->SetYTitle("E/p");
+      
+      outputContainer->Add(fhTrackMatchedDEta[i]) ;
+      outputContainer->Add(fhTrackMatchedDPhi[i]) ;
+      outputContainer->Add(fhTrackMatchedDEtaDPhi[i]) ;
+      outputContainer->Add(fhTrackMatchedDEtaPos[i]) ;
+      outputContainer->Add(fhTrackMatchedDPhiPos[i]) ;
+      outputContainer->Add(fhTrackMatchedDEtaDPhiPos[i]) ;
+      outputContainer->Add(fhTrackMatchedDEtaNeg[i]) ;
+      outputContainer->Add(fhTrackMatchedDPhiNeg[i]) ;
+      outputContainer->Add(fhTrackMatchedDEtaDPhiNeg[i]) ;
+      outputContainer->Add(fhdEdx[i]);
+      outputContainer->Add(fhEOverP[i]);
+      
+      if(fCalorimeter=="EMCAL")
+      {
+        fhTrackMatchedDEtaTRD[i]  = new TH2F
+        (Form("hTrackMatchedDEtaTRD%s",cutTM[i].Data()),
+         Form("d#eta of cluster-track vs cluster energy, SM behind TRD, %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
+        fhTrackMatchedDEtaTRD[i]->SetYTitle("d#eta");
+        fhTrackMatchedDEtaTRD[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        fhTrackMatchedDPhiTRD[i]  = new TH2F
+        (Form("hTrackMatchedDPhiTRD%s",cutTM[i].Data()),
+         Form("d#phi of cluster-track vs cluster energy, SM behing TRD, %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
+        fhTrackMatchedDPhiTRD[i]->SetYTitle("d#phi (rad)");
+        fhTrackMatchedDPhiTRD[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        fhEOverPTRD[i]  = new TH2F
+        (Form("hEOverPTRD%s",cutTM[i].Data()),
+         Form("matched track E/p vs cluster E, behind TRD, %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
+        fhEOverPTRD[i]->SetXTitle("#it{E} (GeV)");
+        fhEOverPTRD[i]->SetYTitle("E/p");
+        
+        outputContainer->Add(fhTrackMatchedDEtaTRD[i]) ;
+        outputContainer->Add(fhTrackMatchedDPhiTRD[i]) ;
+        outputContainer->Add(fhEOverPTRD[i]);
+      }
       
+      if(IsDataMC())
+      {
+        fhTrackMatchedDEtaMCNoOverlap[i]  = new TH2F
+        (Form("hTrackMatchedDEtaMCNoOverlap%s",cutTM[i].Data()),
+         Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
+        fhTrackMatchedDEtaMCNoOverlap[i]->SetYTitle("d#eta");
+        fhTrackMatchedDEtaMCNoOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        fhTrackMatchedDPhiMCNoOverlap[i]  = new TH2F
+        (Form("hTrackMatchedDPhiMCNoOverlap%s",cutTM[i].Data()),
+         Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
+        fhTrackMatchedDPhiMCNoOverlap[i]->SetYTitle("d#phi (rad)");
+        fhTrackMatchedDPhiMCNoOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[i]) ;
+        outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[i]) ;
+        fhTrackMatchedDEtaMCOverlap[i]  = new TH2F
+        (Form("hTrackMatchedDEtaMCOverlap%s",cutTM[i].Data()),
+         Form("d#eta of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
+        fhTrackMatchedDEtaMCOverlap[i]->SetYTitle("d#eta");
+        fhTrackMatchedDEtaMCOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        fhTrackMatchedDPhiMCOverlap[i]  = new TH2F
+        (Form("hTrackMatchedDPhiMCOverlap%s",cutTM[i].Data()),
+         Form("d#phi of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
+        fhTrackMatchedDPhiMCOverlap[i]->SetYTitle("d#phi (rad)");
+        fhTrackMatchedDPhiMCOverlap[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        outputContainer->Add(fhTrackMatchedDEtaMCOverlap[i]) ;
+        outputContainer->Add(fhTrackMatchedDPhiMCOverlap[i]) ;
+        
+        fhTrackMatchedDEtaMCConversion[i]  = new TH2F
+        (Form("hTrackMatchedDEtaMCConversion%s",cutTM[i].Data()),
+         Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
+        fhTrackMatchedDEtaMCConversion[i]->SetYTitle("d#eta");
+        fhTrackMatchedDEtaMCConversion[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        fhTrackMatchedDPhiMCConversion[i]  = new TH2F
+        (Form("hTrackMatchedDPhiMCConversion%s",cutTM[i].Data()),
+         Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
+        fhTrackMatchedDPhiMCConversion[i]->SetYTitle("d#phi (rad)");
+        fhTrackMatchedDPhiMCConversion[i]->SetXTitle("#it{E}_{cluster} (GeV)");
+        
+        outputContainer->Add(fhTrackMatchedDEtaMCConversion[i]) ;
+        outputContainer->Add(fhTrackMatchedDPhiMCConversion[i]) ;
+        
+        fhTrackMatchedMCParticle[i]  = new TH2F
+        (Form("hTrackMatchedMCParticle%s",cutTM[i].Data()),
+         Form("Origin of particle vs energy %s",cutTM[i].Data()),
+         nptbins,ptmin,ptmax,8,0,8);
+        fhTrackMatchedMCParticle[i]->SetXTitle("#it{E} (GeV)");
+        //fhTrackMatchedMCParticle[i]->SetYTitle("Particle type");
+        
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(1 ,"Photon");
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(2 ,"Electron");
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(4 ,"Rest");
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
+        fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
+        
+        outputContainer->Add(fhTrackMatchedMCParticle[i]);
+      }
     }
-  }  
+  }
   
   if(fFillPileUpHistograms)
   {
@@ -2152,62 +2886,69 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
     for(Int_t i = 0 ; i < 7 ; i++)
     {
       fhPtPileUp[i]  = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
-                                       Form("Cluster  p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
-      fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)");
+                                Form("Cluster  #it{p}_[T] distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
+      fhPtPileUp[i]->SetXTitle("#it{p}_[T] (GeV/#it{c})");
       outputContainer->Add(fhPtPileUp[i]);
       
       fhPtChargedPileUp[i]  = new TH1F(Form("hPtChargedPileUp%s",pileUpName[i].Data()),
-                                      Form("Charged clusters p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
-      fhPtChargedPileUp[i]->SetXTitle("p_{T} (GeV/c)");
+                                       Form("Charged clusters #it{p}_[T] distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
+      fhPtChargedPileUp[i]->SetXTitle("#it{p}_[T] (GeV/#it{c})");
       outputContainer->Add(fhPtChargedPileUp[i]);
-
+      
       fhPtPhotonPileUp[i]  = new TH1F(Form("hPtPhotonPileUp%s",pileUpName[i].Data()),
-                                      Form("Selected photon p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
-      fhPtPhotonPileUp[i]->SetXTitle("p_{T} (GeV/c)");
+                                      Form("Selected photon #it{p}_[T] distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
+      fhPtPhotonPileUp[i]->SetXTitle("#it{p}_[T] (GeV/#it{c})");
       outputContainer->Add(fhPtPhotonPileUp[i]);
       
       
       fhClusterEFracLongTimePileUp[i]  = new TH2F(Form("hClusterEFracLongTimePileUp%s",pileUpName[i].Data()),
-                                             Form("Cluster E vs fraction of cluster energy from large T cells, %s Pile-Up event",pileUpName[i].Data()),
-                                             nptbins,ptmin,ptmax,200,0,1);
-      fhClusterEFracLongTimePileUp[i]->SetXTitle("E (GeV)");
+                                                  Form("Cluster E vs fraction of cluster energy from large T cells, %s Pile-Up event",pileUpName[i].Data()),
+                                                  nptbins,ptmin,ptmax,200,0,1);
+      fhClusterEFracLongTimePileUp[i]->SetXTitle("#it{E} (GeV)");
       fhClusterEFracLongTimePileUp[i]->SetYTitle("E(large time) / E");
       outputContainer->Add(fhClusterEFracLongTimePileUp[i]);
       
+      fhClusterCellTimePileUp[i]  = new TH2F(Form("hClusterCellTimePileUp%s",pileUpName[i].Data()),
+                                             Form("Cluster E vs cell time in cluster, %s Pile-Up event",pileUpName[i].Data()),
+                                             nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
+      fhClusterCellTimePileUp[i]->SetXTitle("#it{E} (GeV)");
+      fhClusterCellTimePileUp[i]->SetYTitle("t_{cell} (ns)");
+      outputContainer->Add(fhClusterCellTimePileUp[i]);
+      
       fhClusterTimeDiffPileUp[i]  = new TH2F(Form("hClusterTimeDiffPileUp%s",pileUpName[i].Data()),
-                                Form("Cluster E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
-                                             nptbins,ptmin,ptmax,200,-100,100);
-      fhClusterTimeDiffPileUp[i]->SetXTitle("E (GeV)");
+                                             Form("Cluster E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
+                                             nptbins,ptmin,ptmax,400,-200,200);
+      fhClusterTimeDiffPileUp[i]->SetXTitle("#it{E} (GeV)");
       fhClusterTimeDiffPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
       outputContainer->Add(fhClusterTimeDiffPileUp[i]);
       
       fhClusterTimeDiffChargedPileUp[i]  = new TH2F(Form("hClusterTimeDiffChargedPileUp%s",pileUpName[i].Data()),
-                                       Form("Charged clusters E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
-                                                    nptbins,ptmin,ptmax,200,-100,100);
-      fhClusterTimeDiffChargedPileUp[i]->SetXTitle("E (GeV)");
+                                                    Form("Charged clusters E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
+                                                    nptbins,ptmin,ptmax,400,-200,200);
+      fhClusterTimeDiffChargedPileUp[i]->SetXTitle("#it{E} (GeV)");
       fhClusterTimeDiffChargedPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
       outputContainer->Add(fhClusterTimeDiffChargedPileUp[i]);
       
       fhClusterTimeDiffPhotonPileUp[i]  = new TH2F(Form("hClusterTimeDiffPhotonPileUp%s",pileUpName[i].Data()),
-                                      Form("Selected photon E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
-                                                   nptbins,ptmin,ptmax,200,-100,100);
-      fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("E (GeV)");
+                                                   Form("Selected photon E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
+                                                   nptbins,ptmin,ptmax,400,-200,200);
+      fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("#it{E} (GeV)");
       fhClusterTimeDiffPhotonPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
       outputContainer->Add(fhClusterTimeDiffPhotonPileUp[i]);
-
+      
       fhLambda0PileUp[i]  = new TH2F(Form("hLambda0PileUp%s",pileUpName[i].Data()),
                                      Form("Cluster E vs #lambda^{2}_{0} in cluster, %s Pile-Up event",pileUpName[i].Data()),
                                      nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
-      fhLambda0PileUp[i]->SetXTitle("E (GeV)");
+      fhLambda0PileUp[i]->SetXTitle("#it{E} (GeV)");
       fhLambda0PileUp[i]->SetYTitle("#lambda^{2}_{0}");
       outputContainer->Add(fhLambda0PileUp[i]);
       
       fhLambda0ChargedPileUp[i]  = new TH2F(Form("hLambda0ChargedPileUp%s",pileUpName[i].Data()),
-                                                    Form("Charged clusters E vs #lambda^{2}_{0}in cluster, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
-      fhLambda0ChargedPileUp[i]->SetXTitle("E (GeV)");
+                                            Form("Charged clusters E vs #lambda^{2}_{0}in cluster, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
+      fhLambda0ChargedPileUp[i]->SetXTitle("#it{E} (GeV)");
       fhLambda0ChargedPileUp[i]->SetYTitle("#lambda^{2}_{0}");
       outputContainer->Add(fhLambda0ChargedPileUp[i]);
-
+      
     }
     
     fhEtaPhiBC0  = new TH2F ("hEtaPhiBC0","eta-phi for clusters tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
@@ -2239,440 +2980,533 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
     fhEtaPhiBCMinusPileUpSPD->SetXTitle("#eta ");
     fhEtaPhiBCMinusPileUpSPD->SetYTitle("#phi (rad)");
     outputContainer->Add(fhEtaPhiBCMinusPileUpSPD);
-
-    fhTimeENoCut  = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
-    fhTimeENoCut->SetXTitle("E (GeV)");
-    fhTimeENoCut->SetYTitle("time (ns)");
-    outputContainer->Add(fhTimeENoCut);  
-    
-    fhTimeESPD  = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax); 
-    fhTimeESPD->SetXTitle("E (GeV)");
-    fhTimeESPD->SetYTitle("time (ns)");
-    outputContainer->Add(fhTimeESPD);  
-    
-    fhTimeESPDMulti  = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax); 
-    fhTimeESPDMulti->SetXTitle("E (GeV)");
-    fhTimeESPDMulti->SetYTitle("time (ns)");
-    outputContainer->Add(fhTimeESPDMulti);  
-    
-    fhTimeNPileUpVertSPD  = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50); 
+    
+    fhTimePtNoCut  = new TH2F ("hTimePt_NoCut","time of cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimePtNoCut->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    fhTimePtNoCut->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePtNoCut);
+    
+    fhTimePtSPD  = new TH2F ("hTimePt_SPD","time of cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimePtSPD->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    fhTimePtSPD->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePtSPD);
+    
+    fhTimePtPhotonNoCut  = new TH2F ("hTimePtPhoton_NoCut","time of photon cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimePtPhotonNoCut->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    fhTimePtPhotonNoCut->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePtPhotonNoCut);
+    
+    fhTimePtPhotonSPD  = new TH2F ("hTimePtPhoton_SPD","time of  photon cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
+    fhTimePtPhotonSPD->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    fhTimePtPhotonSPD->SetYTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePtPhotonSPD);
+        
+    fhTimeNPileUpVertSPD  = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,20,0,20);
     fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
-    fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
+    fhTimeNPileUpVertSPD->SetXTitle("#it{time} (ns)");
     outputContainer->Add(fhTimeNPileUpVertSPD);
     
-    fhTimeNPileUpVertTrack  = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 ); 
+    fhTimeNPileUpVertTrack  = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 20,0,20 );
     fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
-    fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
-    outputContainer->Add(fhTimeNPileUpVertTrack);  
+    fhTimeNPileUpVertTrack->SetXTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeNPileUpVertTrack);
     
-    fhTimeNPileUpVertContributors  = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50); 
+    fhTimeNPileUpVertContributors  = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
     fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
-    fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
-    outputContainer->Add(fhTimeNPileUpVertContributors);  
+    fhTimeNPileUpVertContributors->SetXTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimeNPileUpVertContributors);
     
-    fhTimePileUpMainVertexZDistance  = new TH2F ("hTime_PileUpMainVertexZDistance","time of cluster vs distance in Z pile-up SPD vertex - main SPD vertex",ntimebins,timemin,timemax,100,0,50); 
+    fhTimePileUpMainVertexZDistance  = new TH2F ("hTime_PileUpMainVertexZDistance","time of cluster vs distance in Z pile-up SPD vertex - main SPD vertex",ntimebins,timemin,timemax,100,0,50);
     fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
-    fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
-    outputContainer->Add(fhTimePileUpMainVertexZDistance);  
+    fhTimePileUpMainVertexZDistance->SetXTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePileUpMainVertexZDistance);
     
-    fhTimePileUpMainVertexZDiamond  = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50); 
+    fhTimePileUpMainVertexZDiamond  = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
     fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
-    fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
-    outputContainer->Add(fhTimePileUpMainVertexZDiamond); 
+    fhTimePileUpMainVertexZDiamond->SetXTitle("#it{time} (ns)");
+    outputContainer->Add(fhTimePileUpMainVertexZDiamond);
     
     TString title[] = {"no |t diff| cut","|t diff|<20 ns","|t diff|>20 ns","|t diff|>40 ns"};
     TString name [] = {"TDiffNoCut","TDiffSmaller20ns","TDiffLarger20ns","TDiffLarger40ns"};
-    for(Int_t i = 0; i < 4; i++) 
-    {      
+    for(Int_t i = 0; i < 4; i++)
+    {
       fhClusterMultSPDPileUp[i] = new TH2F(Form("fhClusterMultSPDPileUp_%s", name[i].Data()),
-                                           Form("Number of clusters per pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
-                                           nptbins,ptmin,ptmax,100,0,100); 
+                                           Form("Number of clusters per pile up event with #it{E} > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
+                                           nptbins,ptmin,ptmax,100,0,100);
       fhClusterMultSPDPileUp[i]->SetYTitle("n clusters ");
-      fhClusterMultSPDPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
-      outputContainer->Add(fhClusterMultSPDPileUp[i]) ;   
+      fhClusterMultSPDPileUp[i]->SetXTitle("#it{E}_{cluster max} (GeV)");
+      outputContainer->Add(fhClusterMultSPDPileUp[i]) ;
       
       fhClusterMultNoPileUp[i] = new TH2F(Form("fhClusterMultNoPileUp_%s", name[i].Data()),
-                                          Form("Number of clusters per non pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
-                                          nptbins,ptmin,ptmax,100,0,100); 
+                                          Form("Number of clusters per non pile up event with #it{E} > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
+                                          nptbins,ptmin,ptmax,100,0,100);
       fhClusterMultNoPileUp[i]->SetYTitle("n clusters ");
-      fhClusterMultNoPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
-      outputContainer->Add(fhClusterMultNoPileUp[i]) ;         
+      fhClusterMultNoPileUp[i]->SetXTitle("#it{E}_{cluster max} (GeV)");
+      outputContainer->Add(fhClusterMultNoPileUp[i]) ;
     }
     
+    fhPtNPileUpSPDVtx  = new TH2F ("hPt_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
+                                   nptbins,ptmin,ptmax,20,0,20);
+    fhPtNPileUpSPDVtx->SetYTitle("# vertex ");
+    fhPtNPileUpSPDVtx->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtNPileUpSPDVtx);
+         
+    fhPtNPileUpTrkVtx  = new TH2F ("hPt_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
+                                   nptbins,ptmin,ptmax, 20,0,20 );
+    fhPtNPileUpTrkVtx->SetYTitle("# vertex ");
+    fhPtNPileUpTrkVtx->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtNPileUpTrkVtx);
+    
+    fhPtNPileUpSPDVtxTimeCut  = new TH2F ("hPt_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
+                                          nptbins,ptmin,ptmax,20,0,20);
+    fhPtNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
+    fhPtNPileUpSPDVtxTimeCut->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtNPileUpSPDVtxTimeCut);
+         
+    fhPtNPileUpTrkVtxTimeCut  = new TH2F ("hPt_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
+                                          nptbins,ptmin,ptmax, 20,0,20 );
+    fhPtNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
+    fhPtNPileUpTrkVtxTimeCut->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtNPileUpTrkVtxTimeCut);
+    
+               fhPtNPileUpSPDVtxTimeCut2  = new TH2F ("hPt_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
+                                           nptbins,ptmin,ptmax,20,0,20);
+    fhPtNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
+    fhPtNPileUpSPDVtxTimeCut2->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtNPileUpSPDVtxTimeCut2);
+         
+    fhPtNPileUpTrkVtxTimeCut2  = new TH2F ("hPt_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex, -25 < tof < 75 ns",
+                                           nptbins,ptmin,ptmax, 20,0,20 );
+    fhPtNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
+    fhPtNPileUpTrkVtxTimeCut2->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtNPileUpTrkVtxTimeCut2);
+    
+    fhPtPhotonNPileUpSPDVtx  = new TH2F ("hPtPhoton_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
+                                         nptbins,ptmin,ptmax,20,0,20);
+    fhPtPhotonNPileUpSPDVtx->SetYTitle("# vertex ");
+    fhPtPhotonNPileUpSPDVtx->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtPhotonNPileUpSPDVtx);
+         
+    fhPtPhotonNPileUpTrkVtx  = new TH2F ("hPtPhoton_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
+                                         nptbins,ptmin,ptmax, 20,0,20 );
+    fhPtPhotonNPileUpTrkVtx->SetYTitle("# vertex ");
+    fhPtPhotonNPileUpTrkVtx->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtPhotonNPileUpTrkVtx);
+         
+    fhPtPhotonNPileUpSPDVtxTimeCut  = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
+                                                nptbins,ptmin,ptmax,20,0,20);
+    fhPtPhotonNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
+    fhPtPhotonNPileUpSPDVtxTimeCut->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut);
+         
+    fhPtPhotonNPileUpTrkVtxTimeCut  = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
+                                                nptbins,ptmin,ptmax, 20,0,20 );
+    fhPtPhotonNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
+    fhPtPhotonNPileUpTrkVtxTimeCut->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut);
+         
+    fhPtPhotonNPileUpSPDVtxTimeCut2  = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
+                                                 nptbins,ptmin,ptmax,20,0,20);
+    fhPtPhotonNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
+    fhPtPhotonNPileUpSPDVtxTimeCut2->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut2);
+         
+    fhPtPhotonNPileUpTrkVtxTimeCut2  = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex,  -25 < tof < 75 ns",
+                                                 nptbins,ptmin,ptmax, 20,0,20 );
+    fhPtPhotonNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
+    fhPtPhotonNPileUpTrkVtxTimeCut2->SetXTitle("#it{p}_[T] (GeV/#it{c})");
+    outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut2);
+    
   }
   
   if(IsDataMC())
   {
     TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
-                        "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
-                        "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String"                                } ; 
+      "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
+      "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String"                                } ;
     
     TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
-                        "Conversion", "Hadron", "AntiNeutron","AntiProton",
-                        "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
+      "Conversion", "Hadron", "AntiNeutron","AntiProton",
+      "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
     
     for(Int_t i = 0; i < fNOriginHistograms; i++)
-    { 
+    {
       fhMCE[i]  = new TH1F(Form("hE_MC%s",pname[i].Data()),
-                                Form("cluster from %s : E ",ptype[i].Data()),
-                                nptbins,ptmin,ptmax); 
-      fhMCE[i]->SetXTitle("E (GeV)");
-      outputContainer->Add(fhMCE[i]) ; 
+                           Form("cluster from %s : E ",ptype[i].Data()),
+                           nptbins,ptmin,ptmax);
+      fhMCE[i]->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhMCE[i]) ;
       
       fhMCPt[i]  = new TH1F(Form("hPt_MC%s",pname[i].Data()),
-                           Form("cluster from %s : p_{T} ",ptype[i].Data()),
-                           nptbins,ptmin,ptmax); 
-      fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
+                            Form("cluster from %s : #it{p}_[T] ",ptype[i].Data()),
+                            nptbins,ptmin,ptmax);
+      fhMCPt[i]->SetXTitle("#it{p}_[T] (GeV/#it{c})");
       outputContainer->Add(fhMCPt[i]) ;
       
       fhMCEta[i]  = new TH2F(Form("hEta_MC%s",pname[i].Data()),
-                           Form("cluster from %s : #eta ",ptype[i].Data()),
-                           nptbins,ptmin,ptmax,netabins,etamin,etamax); 
+                             Form("cluster from %s : #eta ",ptype[i].Data()),
+                             nptbins,ptmin,ptmax,netabins,etamin,etamax);
       fhMCEta[i]->SetYTitle("#eta");
-      fhMCEta[i]->SetXTitle("E (GeV)");
+      fhMCEta[i]->SetXTitle("#it{E} (GeV)");
       outputContainer->Add(fhMCEta[i]) ;
       
       fhMCPhi[i]  = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
-                           Form("cluster from %s : #phi ",ptype[i].Data()),
-                           nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
+                             Form("cluster from %s : #phi ",ptype[i].Data()),
+                             nptbins,ptmin,ptmax,nphibins,phimin,phimax);
       fhMCPhi[i]->SetYTitle("#phi (rad)");
-      fhMCPhi[i]->SetXTitle("E (GeV)");
+      fhMCPhi[i]->SetXTitle("#it{E} (GeV)");
       outputContainer->Add(fhMCPhi[i]) ;
       
       
       fhMCDeltaE[i]  = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
-                                 Form("MC - Reco E from %s",pname[i].Data()), 
-                                 nptbins,ptmin,ptmax, 200,-50,50); 
-      fhMCDeltaE[i]->SetXTitle("#Delta E (GeV)");
+                                 Form("MC - Reco E from %s",pname[i].Data()),
+                                 nptbins,ptmin,ptmax, 200,-50,50);
+      fhMCDeltaE[i]->SetYTitle("#Delta #it{E} (GeV)");
+      fhMCDeltaE[i]->SetXTitle("#it{E} (GeV)");
       outputContainer->Add(fhMCDeltaE[i]);
       
       fhMCDeltaPt[i]  = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
-                                  Form("MC - Reco p_{T} from %s",pname[i].Data()), 
-                                  nptbins,ptmin,ptmax, 200,-50,50); 
-      fhMCDeltaPt[i]->SetXTitle("#Delta p_{T} (GeV/c)");
+                                  Form("MC - Reco #it{p}_[T] from %s",pname[i].Data()),
+                                  nptbins,ptmin,ptmax, 200,-50,50);
+      fhMCDeltaPt[i]->SetXTitle("p_{T,rec} (GeV/#it{c})");
+      fhMCDeltaPt[i]->SetYTitle("#Delta #it{p}_[T] (GeV/#it{c})");
       outputContainer->Add(fhMCDeltaPt[i]);
-            
+      
       fhMC2E[i]  = new TH2F (Form("h2E_MC%s",pname[i].Data()),
-                             Form("E distribution, reconstructed vs generated from %s",pname[i].Data()), 
-                             nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); 
-      fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
-      fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
-      outputContainer->Add(fhMC2E[i]);          
+                             Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
+                             nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMC2E[i]->SetXTitle("#it{E}_{rec} (GeV)");
+      fhMC2E[i]->SetYTitle("#it{E}_{gen} (GeV)");
+      outputContainer->Add(fhMC2E[i]);
       
       fhMC2Pt[i]  = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
-                              Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()), 
-                              nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); 
-      fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
-      fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
+                              Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
+                              nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
+      fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/#it{c})");
+      fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/#it{c})");
       outputContainer->Add(fhMC2Pt[i]);
       
       
     }
     
     TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
-                         "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ; 
+      "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
     
     TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
-                         "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
+      "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
     
     for(Int_t i = 0; i < fNPrimaryHistograms; i++)
-    { 
+    {
       fhEPrimMC[i]  = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
-                           Form("primary photon %s : E ",pptype[i].Data()),
-                           nptbins,ptmin,ptmax); 
-      fhEPrimMC[i]->SetXTitle("E (GeV)");
-      outputContainer->Add(fhEPrimMC[i]) ; 
+                               Form("primary photon %s : E ",pptype[i].Data()),
+                               nptbins,ptmin,ptmax);
+      fhEPrimMC[i]->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhEPrimMC[i]) ;
       
       fhPtPrimMC[i]  = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
-                            Form("primary photon %s : p_{T} ",pptype[i].Data()),
-                            nptbins,ptmin,ptmax); 
-      fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
+                                Form("primary photon %s : #it{p}_[T] ",pptype[i].Data()),
+                                nptbins,ptmin,ptmax);
+      fhPtPrimMC[i]->SetXTitle("#it{p}_[T] (GeV/#it{c})");
       outputContainer->Add(fhPtPrimMC[i]) ;
       
       fhYPrimMC[i]  = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
-                             Form("primary photon %s : Rapidity ",pptype[i].Data()),
-                             nptbins,ptmin,ptmax,800,-8,8); 
+                               Form("primary photon %s : Rapidity ",pptype[i].Data()),
+                               nptbins,ptmin,ptmax,200,-2,2);
       fhYPrimMC[i]->SetYTitle("Rapidity");
-      fhYPrimMC[i]->SetXTitle("E (GeV)");
+      fhYPrimMC[i]->SetXTitle("#it{E} (GeV)");
       outputContainer->Add(fhYPrimMC[i]) ;
       
+      fhEtaPrimMC[i]  = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
+                               Form("primary photon %s : #eta",pptype[i].Data()),
+                               nptbins,ptmin,ptmax,200,-2,2);
+      fhEtaPrimMC[i]->SetYTitle("#eta");
+      fhEtaPrimMC[i]->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhEtaPrimMC[i]) ;
+      
       fhPhiPrimMC[i]  = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
-                             Form("primary photon %s : #phi ",pptype[i].Data()),
-                             nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
+                                 Form("primary photon %s : #phi ",pptype[i].Data()),
+                                 nptbins,ptmin,ptmax,nphibins,0,TMath::TwoPi());
       fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
-      fhPhiPrimMC[i]->SetXTitle("E (GeV)");
+      fhPhiPrimMC[i]->SetXTitle("#it{E} (GeV)");
       outputContainer->Add(fhPhiPrimMC[i]) ;
-     
+      
       
       fhEPrimMCAcc[i]  = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
-                               Form("primary photon %s in acceptance: E ",pptype[i].Data()),
-                               nptbins,ptmin,ptmax); 
-      fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
-      outputContainer->Add(fhEPrimMCAcc[i]) ; 
+                                  Form("primary photon %s in acceptance: E ",pptype[i].Data()),
+                                  nptbins,ptmin,ptmax);
+      fhEPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhEPrimMCAcc[i]) ;
       
       fhPtPrimMCAcc[i]  = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
-                                Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
-                                nptbins,ptmin,ptmax); 
-      fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
+                                   Form("primary photon %s in acceptance: #it{p}_[T] ",pptype[i].Data()),
+                                   nptbins,ptmin,ptmax);
+      fhPtPrimMCAcc[i]->SetXTitle("#it{p}_[T] (GeV/#it{c})");
       outputContainer->Add(fhPtPrimMCAcc[i]) ;
       
       fhYPrimMCAcc[i]  = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
-                                 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
-                                 nptbins,ptmin,ptmax,100,-1,1); 
+                                  Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
+                                  nptbins,ptmin,ptmax,100,-1,1);
       fhYPrimMCAcc[i]->SetYTitle("Rapidity");
-      fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
+      fhYPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
       outputContainer->Add(fhYPrimMCAcc[i]) ;
+
+      fhEtaPrimMCAcc[i]  = new TH2F(Form("hEtaPrimAcc_MC%s",ppname[i].Data()),
+                                  Form("primary photon %s in acceptance: #eta ",pptype[i].Data()),
+                                  nptbins,ptmin,ptmax,netabins,etamin,etamax);
+      fhEtaPrimMCAcc[i]->SetYTitle("#eta");
+      fhEtaPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
+      outputContainer->Add(fhEtaPrimMCAcc[i]) ;
       
       fhPhiPrimMCAcc[i]  = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
-                                 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
-                                 nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
+                                    Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
+                                    nptbins,ptmin,ptmax,nphibins,phimin,phimax);
       fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
-      fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
+      fhPhiPrimMCAcc[i]->SetXTitle("#it{E} (GeV)");
       outputContainer->Add(fhPhiPrimMCAcc[i]) ;
       
     }
-               
+    
     if(fFillSSHistograms)
     {
-      TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ; 
+      TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
       
       TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
       
       for(Int_t i = 0; i < 6; i++)
-      { 
+      {
         fhMCELambda0[i]  = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
                                     Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
-                                    nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                    nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
-        fhMCELambda0[i]->SetXTitle("E (GeV)");
-        outputContainer->Add(fhMCELambda0[i]) ; 
+        fhMCELambda0[i]->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhMCELambda0[i]) ;
         
         fhMCELambda1[i]  = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
                                     Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
-                                    nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                    nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
-        fhMCELambda1[i]->SetXTitle("E (GeV)");
-        outputContainer->Add(fhMCELambda1[i]) ; 
+        fhMCELambda1[i]->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhMCELambda1[i]) ;
         
         fhMCEDispersion[i]  = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
                                        Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
-                                       nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                       nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhMCEDispersion[i]->SetYTitle("D^{2}");
-        fhMCEDispersion[i]->SetXTitle("E (GeV)");
-        outputContainer->Add(fhMCEDispersion[i]) ; 
+        fhMCEDispersion[i]->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhMCEDispersion[i]) ;
         
         fhMCNCellsE[i]  = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
-                                    Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()), 
-                                    nptbins,ptmin,ptmax, nbins,nmin,nmax); 
-        fhMCNCellsE[i]->SetXTitle("E (GeV)");
+                                    Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
+                                    nptbins,ptmin,ptmax, nbins,nmin,nmax);
+        fhMCNCellsE[i]->SetXTitle("#it{E} (GeV)");
         fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
-        outputContainer->Add(fhMCNCellsE[i]);  
+        outputContainer->Add(fhMCNCellsE[i]);
         
         fhMCMaxCellDiffClusterE[i]  = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
                                                 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
-                                                nptbins,ptmin,ptmax, 500,0,1.); 
-        fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
-        fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
-        outputContainer->Add(fhMCMaxCellDiffClusterE[i]);  
+                                                nptbins,ptmin,ptmax, 500,0,1.);
+        fhMCMaxCellDiffClusterE[i]->SetXTitle("#it{E}_{cluster} (GeV) ");
+        fhMCMaxCellDiffClusterE[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
+        outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
         
         if(!fFillOnlySimpleSSHisto)
         {
           fhMCLambda0vsClusterMaxCellDiffE0[i]  = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
                                                            Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
-                                                           ssbins,ssmin,ssmax,500,0,1.); 
+                                                           ssbins,ssmin,ssmax,500,0,1.);
           fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
-          fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
-          outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ; 
+          fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
+          outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
           
           fhMCLambda0vsClusterMaxCellDiffE2[i]  = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
                                                            Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
-                                                           ssbins,ssmin,ssmax,500,0,1.); 
+                                                           ssbins,ssmin,ssmax,500,0,1.);
           fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
-          fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
-          outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ; 
+          fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
+          outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
           
           fhMCLambda0vsClusterMaxCellDiffE6[i]  = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
-                                                           Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
-                                                           ssbins,ssmin,ssmax,500,0,1.); 
+                                                           Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, #it{E} > 6 GeV",ptypess[i].Data()),
+                                                           ssbins,ssmin,ssmax,500,0,1.);
           fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
-          fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
-          outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ; 
+          fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
+          outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
           
           fhMCNCellsvsClusterMaxCellDiffE0[i]  = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
                                                           Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
-                                                          nbins/5,nmin,nmax/5,500,0,1.); 
+                                                          nbins/5,nmin,nmax/5,500,0,1.);
           fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
-          fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
-          outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ; 
+          fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
+          outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
           
           fhMCNCellsvsClusterMaxCellDiffE2[i]  = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
                                                           Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
-                                                          nbins/5,nmin,nmax/5,500,0,1.); 
+                                                          nbins/5,nmin,nmax/5,500,0,1.);
           fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
-          fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
-          outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ; 
+          fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
+          outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
           
           fhMCNCellsvsClusterMaxCellDiffE6[i]  = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
-                                                          Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
-                                                          nbins/5,nmin,nmax/5,500,0,1.); 
+                                                          Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, #it{E} > 6 GeV",ptypess[i].Data()),
+                                                          nbins/5,nmin,nmax/5,500,0,1.);
           fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
-          fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
-          outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ; 
+          fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("#it{E} (GeV)");
+          outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
           
           if(fCalorimeter=="EMCAL")
           {
             fhMCEDispEta[i]  = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
                                          Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
-                                         nptbins,ptmin,ptmax, ssbins,ssmin,ssmax); 
-            fhMCEDispEta[i]->SetXTitle("E (GeV)");
+                                         nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
+            fhMCEDispEta[i]->SetXTitle("#it{E} (GeV)");
             fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
-            outputContainer->Add(fhMCEDispEta[i]);     
+            outputContainer->Add(fhMCEDispEta[i]);
             
             fhMCEDispPhi[i]  = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
                                          Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
-                                         nptbins,ptmin,ptmax, ssbins,ssmin,ssmax); 
-            fhMCEDispPhi[i]->SetXTitle("E (GeV)");
+                                         nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
+            fhMCEDispPhi[i]->SetXTitle("#it{E} (GeV)");
             fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
-            outputContainer->Add(fhMCEDispPhi[i]);  
+            outputContainer->Add(fhMCEDispPhi[i]);
             
             fhMCESumEtaPhi[i]  = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
-                                           Form("cluster from %s : #delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",ptypess[i].Data()),  
-                                           nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax); 
-            fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
+                                           Form("cluster from %s : #delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",ptypess[i].Data()),
+                                           nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
+            fhMCESumEtaPhi[i]->SetXTitle("#it{E} (GeV)");
             fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
             outputContainer->Add(fhMCESumEtaPhi[i]);
             
             fhMCEDispEtaPhiDiff[i]  = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
-                                                Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),  
-                                                nptbins,ptmin,ptmax,200,-10,10); 
-            fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
+                                                Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
+                                                nptbins,ptmin,ptmax,200,-10,10);
+            fhMCEDispEtaPhiDiff[i]->SetXTitle("#it{E} (GeV)");
             fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
-            outputContainer->Add(fhMCEDispEtaPhiDiff[i]);    
+            outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
             
             fhMCESphericity[i]  = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
-                                            Form("cluster from %s : (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",ptypess[i].Data()),  
-                                            nptbins,ptmin,ptmax, 200,-1,1); 
-            fhMCESphericity[i]->SetXTitle("E (GeV)");
+                                            Form("cluster from %s : (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",ptypess[i].Data()),
+                                            nptbins,ptmin,ptmax, 200,-1,1);
+            fhMCESphericity[i]->SetXTitle("#it{E} (GeV)");
             fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
             outputContainer->Add(fhMCESphericity[i]);
             
             for(Int_t ie = 0; ie < 7; ie++)
             {
               fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
-                                                    Form("cluster from %s : #sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]), 
-                                                    ssbins,ssmin,ssmax , ssbins,ssmin,ssmax); 
+                                                    Form("cluster from %s : #sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
+                                                    ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
               fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
               fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
-              outputContainer->Add(fhMCDispEtaDispPhi[ie][i]); 
+              outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
               
               fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
-                                                    Form("cluster from %s : #lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]), 
-                                                    ssbins,ssmin,ssmax , ssbins,ssmin,ssmax); 
+                                                    Form("cluster from %s : #lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
+                                                    ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
               fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
               fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
-              outputContainer->Add(fhMCLambda0DispEta[ie][i]);       
+              outputContainer->Add(fhMCLambda0DispEta[ie][i]);
               
               fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
-                                                    Form("cluster from %s :#lambda^{2}_{0} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]), 
-                                                    ssbins,ssmin,ssmax , ssbins,ssmin,ssmax); 
+                                                    Form("cluster from %s :#lambda^{2}_{0} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
+                                                    ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
               fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
               fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
-              outputContainer->Add(fhMCLambda0DispPhi[ie][i]); 
+              outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
             }
           }
         }
-      }// loop    
+      }// loop
       
       if(!GetReader()->IsEmbeddedClusterSelectionOn())
       {
         fhMCPhotonELambda0NoOverlap  = new TH2F("hELambda0_MCPhoton_NoOverlap",
                                                 "cluster from Photon : E vs #lambda_{0}^{2}",
-                                                nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
-        fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
-        outputContainer->Add(fhMCPhotonELambda0NoOverlap) ; 
+        fhMCPhotonELambda0NoOverlap->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
         
         fhMCPhotonELambda0TwoOverlap  = new TH2F("hELambda0_MCPhoton_TwoOverlap",
                                                  "cluster from Photon : E vs #lambda_{0}^{2}",
-                                                 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
-        fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
-        outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ; 
+        fhMCPhotonELambda0TwoOverlap->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
         
         fhMCPhotonELambda0NOverlap  = new TH2F("hELambda0_MCPhoton_NOverlap",
                                                "cluster from Photon : E vs #lambda_{0}^{2}",
-                                               nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                               nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
-        fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
-        outputContainer->Add(fhMCPhotonELambda0NOverlap) ; 
+        fhMCPhotonELambda0NOverlap->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
         
-      } //No embedding     
+      } //No embedding
       
       if(GetReader()->IsEmbeddedClusterSelectionOn())
       {
         
         fhEmbeddedSignalFractionEnergy  = new TH2F("hEmbeddedSignal_FractionEnergy",
                                                    "Energy Fraction of embedded signal versus cluster energy",
-                                                   nptbins,ptmin,ptmax,100,0.,1.); 
+                                                   nptbins,ptmin,ptmax,100,0.,1.);
         fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
-        fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbeddedSignalFractionEnergy) ; 
+        fhEmbeddedSignalFractionEnergy->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
         
         fhEmbedPhotonELambda0FullSignal  = new TH2F("hELambda0_EmbedPhoton_FullSignal",
                                                     "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
-                                                    nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                    nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ; 
+        fhEmbedPhotonELambda0FullSignal->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
         
         fhEmbedPhotonELambda0MostlySignal  = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
                                                       "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
-                                                      nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                      nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ; 
+        fhEmbedPhotonELambda0MostlySignal->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
         
         fhEmbedPhotonELambda0MostlyBkg  = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
                                                    "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
-                                                   nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                   nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ; 
+        fhEmbedPhotonELambda0MostlyBkg->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
         
         fhEmbedPhotonELambda0FullBkg  = new TH2F("hELambda0_EmbedPhoton_FullBkg",
                                                  "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
-                                                 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ; 
+        fhEmbedPhotonELambda0FullBkg->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
         
         fhEmbedPi0ELambda0FullSignal  = new TH2F("hELambda0_EmbedPi0_FullSignal",
                                                  "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
-                                                 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ; 
+        fhEmbedPi0ELambda0FullSignal->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
         
         fhEmbedPi0ELambda0MostlySignal  = new TH2F("hELambda0_EmbedPi0_MostlySignal",
                                                    "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
-                                                   nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                   nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ; 
+        fhEmbedPi0ELambda0MostlySignal->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
         
         fhEmbedPi0ELambda0MostlyBkg  = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
                                                 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
-                                                nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                                nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ; 
+        fhEmbedPi0ELambda0MostlyBkg->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
         
         fhEmbedPi0ELambda0FullBkg  = new TH2F("hELambda0_EmbedPi0_FullBkg",
                                               "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
-                                              nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
+                                              nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
         fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
-        fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
-        outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ; 
+        fhEmbedPi0ELambda0FullBkg->SetXTitle("#it{E} (GeV)");
+        outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
         
       }// embedded histograms
       
@@ -2680,7 +3514,7 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
     }// Fill SS MC histograms
     
   }//Histos with MC
-      
+  
   return outputContainer ;
   
 }
@@ -2727,17 +3561,17 @@ void AliAnaPhoton::InitParameters()
 }
 
 //__________________________________________________________________
-void  AliAnaPhoton::MakeAnalysisFillAOD() 
+void  AliAnaPhoton::MakeAnalysisFillAOD()
 {
   //Do photon analysis and fill aods
   
-  //Get the vertex 
+  //Get the vertex
   Double_t v[3] = {0,0,0}; //vertex ;
   GetReader()->GetVertex(v);
   
   //Select the Calorimeter of the photon
-  TObjArray * pl = 0x0; 
-  AliVCaloCells* cells    = 0;  
+  TObjArray * pl = 0x0;
+  AliVCaloCells* cells    = 0;
   if      (fCalorimeter == "PHOS" )
   {
     pl    = GetPHOSClusters();
@@ -2749,13 +3583,13 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
     cells = GetEMCALCells();
   }
   
-  if(!pl) 
+  if(!pl)
   {
     Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
     return;
   }
   
-  FillPileUpHistogramsPerEvent(pl); 
+  FillPileUpHistogramsPerEvent();
   
   // Loop on raw clusters before filtering in the reader and fill control histogram
   if((GetReader()->GetEMCALClusterListName()=="" && fCalorimeter=="EMCAL") || fCalorimeter=="PHOS")
@@ -2767,10 +3601,10 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
       else if(fCalorimeter == "EMCAL" && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin()) fhClusterCuts[0]->Fill(clus->E());
     }
   }
-  else 
+  else
   { // reclusterized
     TClonesArray * clusterList = 0;
-
+    
     if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
       clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
     else if(GetReader()->GetOutputEvent())
@@ -2779,14 +3613,95 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
     if(clusterList)
     {
       Int_t nclusters = clusterList->GetEntriesFast();
-      for (Int_t iclus =  0; iclus <  nclusters; iclus++) 
+      for (Int_t iclus =  0; iclus <  nclusters; iclus++)
       {
-        AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));        
+        AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
         if(clus)fhClusterCuts[0]->Fill(clus->E());
-      }  
+      }
     }
   }
   
+  // Fill some trigger related histograms
+  Int_t  idTrig = GetReader()->GetTriggerClusterIndex();
+  Bool_t exotic = GetReader()->IsExoticEvent();
+  Bool_t bad    = GetReader()->IsBadCellTriggerEvent();
+  
+  if( fFillEMCALBCHistograms && fCalorimeter=="EMCAL" &&
+     ( bad || exotic )  && idTrig >= 0 && !GetReader()->AreBadTriggerEventsRemoved())
+  {
+    //    printf("Index %d, Id %d,  bad %d, exo %d\n",
+    //           GetReader()->GetTriggerClusterIndex(),
+    //           GetReader()->GetTriggerClusterId(),
+    //           GetReader()->IsBadCellTriggerEvent(),
+    //           GetReader()->IsExoticEvent() );
+    
+    TClonesArray * clusterList = 0;
+    TString  clusterListName   = GetReader()->GetEMCALClusterListName();
+    if     (GetReader()->GetInputEvent()->FindListObject(clusterListName))
+      clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent() ->FindListObject(clusterListName));
+    else if(GetReader()->GetOutputEvent())
+      clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
+    
+    AliVCluster  *  badClusTrig = 0;
+    if(clusterList) badClusTrig = (AliVCluster*) clusterList->At(idTrig);
+    else            badClusTrig = GetReader()->GetInputEvent()->GetCaloCluster(idTrig);
+    
+    if(!badClusTrig)
+      printf("AliAnaPhoton::MakeAnalysisFillAOD() - No cluster (bad-exotic trigger) found with requested index %d \n",idTrig);
+    else
+    {
+      TLorentzVector momBadClus;
+      
+      badClusTrig->GetMomentum(momBadClus,GetVertex(0));
+      
+      Float_t etaclusterBad = momBadClus.Eta();
+      Float_t phiclusterBad = momBadClus.Phi();
+      if( phiclusterBad < 0 ) phiclusterBad+=TMath::TwoPi();
+      Float_t tofclusterBad = badClusTrig->GetTOF()*1.e9;
+      Float_t eclusterBad   = badClusTrig->E();
+      
+      if( bad && exotic )
+      {
+        if(GetReader()->IsTriggerMatched())
+        {
+          fhEtaPhiTriggerEMCALBCBadExoticCluster->Fill(etaclusterBad, phiclusterBad);
+          fhTimeTriggerEMCALBCBadExoticCluster  ->Fill(eclusterBad,   tofclusterBad);
+        }
+        else
+        {
+          fhEtaPhiTriggerEMCALBCUMBadExoticCluster->Fill(etaclusterBad, phiclusterBad);
+          fhTimeTriggerEMCALBCUMBadExoticCluster  ->Fill(eclusterBad,   tofclusterBad);
+        }
+      }
+      else if( bad && !exotic )
+      {
+        if(GetReader()->IsTriggerMatched())
+        {
+          fhEtaPhiTriggerEMCALBCBadCluster->Fill(etaclusterBad, phiclusterBad);
+          fhTimeTriggerEMCALBCBadCluster  ->Fill(eclusterBad,   tofclusterBad);
+        }
+        else
+        {
+          fhEtaPhiTriggerEMCALBCUMBadCluster->Fill(etaclusterBad, phiclusterBad);
+          fhTimeTriggerEMCALBCUMBadCluster  ->Fill(eclusterBad,   tofclusterBad);
+        }
+      }// Bad cluster trigger
+      else if( !bad && exotic )
+      {
+        if(GetReader()->IsTriggerMatched())
+        {
+          fhEtaPhiTriggerEMCALBCExoticCluster->Fill(etaclusterBad, phiclusterBad);
+          fhTimeTriggerEMCALBCExoticCluster  ->Fill(eclusterBad, tofclusterBad);
+        }
+        else
+        {
+          fhEtaPhiTriggerEMCALBCUMExoticCluster->Fill(etaclusterBad, phiclusterBad);
+          fhTimeTriggerEMCALBCUMExoticCluster  ->Fill(eclusterBad, tofclusterBad);
+        }
+      }
+    }// cluster exists
+  } // study bad/exotic trigger BC
+  
   //Init arrays, variables, get number of clusters
   TLorentzVector mom, mom2 ;
   Int_t nCaloClusters = pl->GetEntriesFast();
@@ -2798,23 +3713,24 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
   //----------------------------------------------------
   // Loop on clusters
   for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
-  {    
-         AliVCluster * calo =  (AliVCluster*) (pl->At(icalo)); 
+  {
+         AliVCluster * calo =  (AliVCluster*) (pl->At(icalo));
     //printf("calo %d, %f\n",icalo,calo->E());
     
     //Get the index where the cluster comes, to retrieve the corresponding vertex
-    Int_t evtIndex = 0 ; 
-    if (GetMixedEvent()) 
+    Int_t evtIndex = 0 ;
+    if (GetMixedEvent())
     {
-      evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ; 
+      evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
       //Get the vertex and check it is not too large in z
       if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
     }
     
-    //Cluster selection, not charged, with photon id and in fiducial cut         
+    //Cluster selection, not charged, with photon id and in fiducial cut
     if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
     {
-      calo->GetMomentum(mom,GetVertex(evtIndex)) ;}//Assume that come from vertex in straight line
+      calo->GetMomentum(mom,GetVertex(evtIndex)) ;
+    }//Assume that come from vertex in straight line
     else
     {
       Double_t vertex[]={0,0,0};
@@ -2826,14 +3742,14 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
     //--------------------------------------
     Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
     if(!ClusterSelected(calo,mom,nMaxima)) continue;
-
+    
     //----------------------------
     //Create AOD for analysis
     //----------------------------
     AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
     
     //...............................................
-    //Set the indeces of the original caloclusters (MC, ID), and calorimeter  
+    //Set the indeces of the original caloclusters (MC, ID), and calorimeter
     Int_t label = calo->GetLabel();
     aodph.SetLabel(label);
     aodph.SetCaloLabel(calo->GetID(),-1);
@@ -2844,7 +3760,7 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
     //Set bad channel distance bit
     Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
     if     (distBad > fMinDist3) aodph.SetDistToBad(2) ;
-    else if(distBad > fMinDist2) aodph.SetDistToBad(1) ; 
+    else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
     else                         aodph.SetDistToBad(0) ;
     //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
     
@@ -2862,8 +3778,8 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
       
       if(GetDebug() > 0)
         printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
-    }//Work with stack also   
-        
+    }//Work with stack also
+    
     
     //--------------------------------------------------------------------------------------
     //Fill some shower shape histograms before PID is applied
@@ -2887,10 +3803,10 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
       if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
       
       //If cluster does not pass pid, not photon, skip it.
-      if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;                  
+      if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
       
     }
-
+    
     //...............................................
     // Data, PID check off
     else
@@ -2900,16 +3816,23 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
       
       GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
       
-      if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");              
+      if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
     }
     
     if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",
                               aodph.Pt(), aodph.GetIdentifiedParticleType());
     
     fhClusterCuts[9]->Fill(calo->E());
-
+    
+    Int_t   nSM  = GetModuleNumber(calo);
+    if(nSM < GetCaloUtils()->GetNumberOfSuperModulesUsed() && nSM >=0)
+    {
+      fhEPhotonSM ->Fill(mom.E (),nSM);
+      fhPtPhotonSM->Fill(mom.Pt(),nSM);
+    }
+    
     fhNLocMax->Fill(calo->E(),nMaxima);
-
+    
     // Matching after cuts
     if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,1);
     
@@ -2920,7 +3843,7 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
     // Add number of local maxima to AOD, method name in AOD to be FIXED
     aodph.SetFiducialArea(nMaxima);
     
-    if(fFillEMCALBCHistograms && fCalorimeter=="EMCAL")
+    if(fFillEMCALBCHistograms && fCalorimeter=="EMCAL" && idTrig >= 0)
     {
       Double_t calotof   = calo->GetTOF()*1e9;
       Float_t  calotofUS = TMath::Abs(calotof);
@@ -2934,34 +3857,55 @@ void  AliAnaPhoton::MakeAnalysisFillAOD()
         else                     fhEtaPhiPhotonEMCALBCN->Fill(aodph.Eta(), phicluster);
       }
       
-      Int_t bc = GetReader()->IsPileUpClusterTriggeredEvent();
-      if(bc > -6 && bc < 8)
+      Int_t bc = GetReader()->GetTriggerClusterBC();
+      Int_t histoBC = bc-5;
+      if(GetReader()->AreBadTriggerEventsRemoved()) histoBC=0; // histograms created only for one BC since the others where rejected
+      if(TMath::Abs(bc) < 6 && !GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent())
       {
-        if(calo->E() > 2) fhEtaPhiPhotonTriggerEMCALBC[bc+5]->Fill(aodph.Eta(), phicluster);
-        fhTimePhotonTriggerEMCALBC[bc+5]->Fill(calo->E(), calotof);
-        if(GetReader()->IsPileUpFromSPD()) fhTimePhotonTriggerEMCALBCPileUpSPD[bc+5]->Fill(calo->E(), calotof);
+        if(GetReader()->IsTriggerMatched())
+        {
+          if(calo->E() > 2) fhEtaPhiPhotonTriggerEMCALBC[histoBC]->Fill(aodph.Eta(), phicluster);
+          fhTimePhotonTriggerEMCALBC[histoBC]->Fill(calo->E(), calotof);
+          if(GetReader()->IsPileUpFromSPD()) fhTimePhotonTriggerEMCALBCPileUpSPD[histoBC]->Fill(calo->E(), calotof);
+        }
+        else
+        {
+          if(calo->E() > 2) fhEtaPhiPhotonTriggerEMCALBCUM[histoBC]->Fill(aodph.Eta(), phicluster);
+          fhTimePhotonTriggerEMCALBCUM[histoBC]->Fill(calo->E(), calotof);
+          
+          if(bc==0)
+          {
+            if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime   ->Fill(calo->E(), calotof);
+            if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(calo->E(), calotof);
+            if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimePhotonTriggerEMCALBC0UMReMatchBoth       ->Fill(calo->E(), calotof);
+          }
+        }
       }
-      else printf("AliAnaPhoton::MakeAnalysisFillAOD() - Trigger BC not expected = %d\n",bc);
+      else if(TMath::Abs(bc) >= 6)
+        printf("AliAnaPhoton::MakeAnalysisFillAOD() - Trigger BC not expected = %d\n",bc);
     }
     
     //Add AOD with photon object to aod branch
     AddAODParticle(aodph);
     
   }//loop
-       
-  if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD()  End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());  
+  
+  if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD()  End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
   
 }
 
 //__________________________________________________________________
-void  AliAnaPhoton::MakeAnalysisFillHistograms() 
+void  AliAnaPhoton::MakeAnalysisFillHistograms()
 {
   //Fill histograms
-      
+  
+  //In case of simulated data, fill acceptance histograms
+  if(IsDataMC()) FillAcceptanceHistograms();
+  
   // Get vertex
   Double_t v[3] = {0,0,0}; //vertex ;
   GetReader()->GetVertex(v);
-  //fhVertex->Fill(v[0],v[1],v[2]);  
+  //fhVertex->Fill(v[0],v[1],v[2]);
   if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
   
   //----------------------------------
@@ -2970,8 +3914,8 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
   if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
   
   Float_t cen = GetEventCentrality();
- // printf("++++++++++ GetEventCentrality() %f\n",cen);
 // printf("++++++++++ GetEventCentrality() %f\n",cen);
+  
   Float_t ep  = GetEventPlaneAngle();
   
   for(Int_t iaod = 0; iaod < naod ; iaod++)
@@ -2979,19 +3923,19 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
     AliAODPWG4Particle* ph =  (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
     Int_t pdg = ph->GetIdentifiedParticleType();
     
-    if(GetDebug() > 3) 
-      printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n", 
+    if(GetDebug() > 3)
+      printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n",
              ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
     
     //If PID used, fill histos with photons in Calorimeter fCalorimeter
-    if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue; 
+    if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
     if(ph->GetDetector() != fCalorimeter) continue;
     
-    if(GetDebug() > 2) 
+    if(GetDebug() > 2)
       printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
     
     //................................
-    //Fill photon histograms 
+    //Fill photon histograms
     Float_t ptcluster  = ph->Pt();
     Float_t phicluster = ph->Phi();
     Float_t etacluster = ph->Eta();
@@ -3000,18 +3944,16 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
     fhEPhoton   ->Fill(ecluster);
     fhPtPhoton  ->Fill(ptcluster);
     fhPhiPhoton ->Fill(ptcluster,phicluster);
-    fhEtaPhoton ->Fill(ptcluster,etacluster);    
+    fhEtaPhoton ->Fill(ptcluster,etacluster);
     if     (ecluster   > 0.5) fhEtaPhiPhoton  ->Fill(etacluster, phicluster);
     else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
-
+    
     fhPtCentralityPhoton ->Fill(ptcluster,cen) ;
     fhPtEventPlanePhoton ->Fill(ptcluster,ep ) ;
     
     //Get original cluster, to recover some information
-    Int_t absID             = 0; 
-    Float_t maxCellFraction = 0;
     AliVCaloCells* cells    = 0;
-    TObjArray * clusters    = 0; 
+    TObjArray * clusters    = 0;
     if(fCalorimeter == "EMCAL")
     {
       cells    = GetEMCALCells();
@@ -3024,19 +3966,22 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
     }
     
     Int_t iclus = -1;
-    AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus); 
+    AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
     if(cluster)
     {
-      absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
-      
+      Float_t maxCellFraction = 0;
+      Int_t absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster, maxCellFraction);
+      if( absID < 0 ) AliFatal("Wrong absID");
+
       // Control histograms
-      fhMaxCellDiffClusterE->Fill(ph->E(),maxCellFraction);
-      fhNCellsE            ->Fill(ph->E(),cluster->GetNCells());
-      fhTimeE              ->Fill(ph->E(),cluster->GetTOF()*1.e9);
+      fhMaxCellDiffClusterE->Fill(ph->E() ,maxCellFraction);
+      fhNCellsE            ->Fill(ph->E() ,cluster->GetNCells());
+      fhTimePt             ->Fill(ph->Pt(),cluster->GetTOF()*1.e9);
+
       if(cells)
       {
-      for(Int_t icell = 0; icell <  cluster->GetNCells(); icell++)
-        fhCellsE->Fill(ph->E(),cells->GetCellAmplitude(cluster->GetCellsAbsId()[icell]));
+        for(Int_t icell = 0; icell <  cluster->GetNCells(); icell++)
+          fhCellsE->Fill(ph->E(),cells->GetCellAmplitude(cluster->GetCellsAbsId()[icell]));
       }
     }
     
@@ -3053,16 +3998,14 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
         else if(GetReader()->ReadAODMCParticles() && !GetReader()->GetAODMCParticles())
         {
           printf("AliAnaPhoton::MakeAnalysisFillHistograms() -  Standard MCParticles not available!\n");
-        }      
-      }    
-      
-      FillAcceptanceHistograms();
-      
+        }
+      }
+            
       //....................................................................
       // Access MC information in stack if requested, check that it exists.
       Int_t label =ph->GetLabel();
       
-      if(label < 0) 
+      if(label < 0)
       {
         if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***:  label %d \n", label);
         continue;
@@ -3075,7 +4018,7 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
       if(ok)
       {
         eprim   = primary.Energy();
-        ptprim  = primary.Pt();                
+        ptprim  = primary.Pt();
       }
       
       Int_t tag =ph->GetTag();
@@ -3088,11 +4031,11 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
         fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster);
         
         fhMC2E     [kmcPhoton] ->Fill(ecluster, eprim);
-        fhMC2Pt    [kmcPhoton] ->Fill(ptcluster, ptprim);     
+        fhMC2Pt    [kmcPhoton] ->Fill(ptcluster, ptprim);
         fhMCDeltaE [kmcPhoton] ->Fill(ecluster,eprim-ecluster);
-        fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster,ptprim-ptcluster); 
+        fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster,ptprim-ptcluster);
         
-        if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && 
+        if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
            GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)     &&
            fhMCE[kmcConversion])
         {
@@ -3102,55 +4045,55 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
           fhMCEta[kmcConversion] ->Fill(ecluster,etacluster);
           
           fhMC2E     [kmcConversion] ->Fill(ecluster, eprim);
-          fhMC2Pt    [kmcConversion] ->Fill(ptcluster, ptprim);     
+          fhMC2Pt    [kmcConversion] ->Fill(ptcluster, ptprim);
           fhMCDeltaE [kmcConversion] ->Fill(ecluster,eprim-ecluster);
-          fhMCDeltaPt[kmcConversion] ->Fill(ptcluster,ptprim-ptcluster); 
-        }                      
+          fhMCDeltaPt[kmcConversion] ->Fill(ptcluster,ptprim-ptcluster);
+        }
         
-        if     (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[kmcPrompt])
+        if     (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt))
         {
           mcParticleTag = kmcPrompt;
         }
-        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[kmcFragmentation])
+        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation))
         {
           mcParticleTag = kmcFragmentation;
         }
         else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[kmcISR])
         {
-          mcParticleTag = kmcISR; 
+          mcParticleTag = kmcISR;
         }
-        else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) && 
-                !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0Decay])
+        else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
+                !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0))
         {
           mcParticleTag = kmcPi0Decay;
         }
-        else if((( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) && 
-                  !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta)        ) || 
-                   GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[kmcOtherDecay])
+        else if((( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) &&
+                  !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta)        ) ||
+                 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ))
         {
           mcParticleTag = kmcOtherDecay;
         }
-        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0])
+        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0))
         {
-          mcParticleTag = kmcPi0;   
-        } 
-        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[kmcEta])
+          mcParticleTag = kmcPi0;
+        }
+        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
         {
           mcParticleTag = kmcEta;
-        }      
+        }
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[kmcAntiNeutron])
+      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron))
       {
         mcParticleTag = kmcAntiNeutron;
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[kmcAntiProton])
+      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton))
       {
-        mcParticleTag = kmcAntiProton; 
-      } 
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[kmcElectron])
+        mcParticleTag = kmcAntiProton;
+      }
+      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron))
       {
-        mcParticleTag = kmcElectron;            
-      }     
+        mcParticleTag = kmcElectron;
+      }
       else if( fhMCE[kmcOther])
       {
         mcParticleTag = kmcOther;
@@ -3164,16 +4107,18 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
         
       }
       
-      fhMCE  [mcParticleTag] ->Fill(ecluster);
-      fhMCPt [mcParticleTag] ->Fill(ptcluster);
-      fhMCPhi[mcParticleTag] ->Fill(ecluster,phicluster);
-      fhMCEta[mcParticleTag] ->Fill(ecluster,etacluster);
-      
-      fhMC2E[mcParticleTag]     ->Fill(ecluster, eprim);
-      fhMC2Pt[mcParticleTag]    ->Fill(ptcluster, ptprim);     
-      fhMCDeltaE[mcParticleTag] ->Fill(ecluster,eprim-ecluster);
-      fhMCDeltaPt[mcParticleTag]->Fill(ptcluster,ptprim-ptcluster); 
-      
+      if(mcParticleTag >= 0 && fhMCE  [mcParticleTag])
+      {
+        fhMCE  [mcParticleTag]->Fill(ecluster);
+        fhMCPt [mcParticleTag]->Fill(ptcluster);
+        fhMCPhi[mcParticleTag]->Fill(ecluster,phicluster);
+        fhMCEta[mcParticleTag]->Fill(ecluster,etacluster);
+        
+        fhMC2E     [mcParticleTag]->Fill(ecluster, eprim);
+        fhMC2Pt    [mcParticleTag]->Fill(ptcluster, ptprim);
+        fhMCDeltaE [mcParticleTag]->Fill(ecluster,eprim-ecluster);
+        fhMCDeltaPt[mcParticleTag]->Fill(ptcluster,ptprim-ptcluster);
+      }
     }//Histograms with MC
     
   }// aod loop
@@ -3191,7 +4136,7 @@ void AliAnaPhoton::Print(const Option_t * opt) const
   
   printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
   AliAnaCaloTrackCorrBaseClass::Print(" ");
-
+  
   printf("Calorimeter            =     %s\n", fCalorimeter.Data()) ;
   printf("Min Distance to Bad Channel   = %2.1f\n",fMinDist);
   printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
@@ -3201,4 +4146,4 @@ void AliAnaPhoton::Print(const Option_t * opt) const
   printf("Number of cells in cluster is        > %d \n", fNCellsCut);
   printf("    \n") ;
        
-} 
+}