]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
First try to reduce the size of the QA wagon
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaCalorimeterQA.cxx
index c3f7311d87994629a8f2fe147be8cfaaeefbea07..a32f0667dfc1ac249c9fbebc39655ba23aa8b2ee 100755 (executable)
  **************************************************************************/
 /* $Id: $ */
 
-  //_________________________________________________________________________
-  // Class to check results from simulations or reconstructed real data. 
-  // Fill few histograms and do some checking plots
-  //
-  //-- Author: Gustavo Conesa (INFN-LNF)
-  //_________________________________________________________________________
+//_________________________________________________________________________
+// Class to check results from simulations or reconstructed real data. 
+// Fill few histograms and do some checking plots
+//
+//-- Author: Gustavo Conesa (INFN-LNF)
+//_________________________________________________________________________
 
 
-  // --- ROOT system ---
-  //#include "Riostream.h"
+// --- ROOT system ---
+//#include "Riostream.h"
 #include "TObjArray.h"
 #include "TParticle.h"
 #include "TDatabasePDG.h"
@@ -36,7 +36,7 @@
 #include "TStyle.h"
 #include <TObjString.h>
 
-  //---- AliRoot system ----
+//---- AliRoot system ----
 #include "AliAnaCalorimeterQA.h"
 #include "AliCaloTrackReader.h"
 #include "AliStack.h"
 
 ClassImp(AliAnaCalorimeterQA)
 
-  //____________________________________________________________________________
+//____________________________________________________________________________
 AliAnaCalorimeterQA::AliAnaCalorimeterQA() : 
 AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""), 
-fMakePlots(kFALSE), fCorrelateCalos(kFALSE), fNModules(12), fNRCU(2),
+fMakePlots(kFALSE), fFillAllPosHisto(kFALSE), fFillAllTH12(kFALSE),
+fCorrelateCalos(kFALSE), fNModules(12), fNRCU(2),
 fTimeCutMin(-1), fTimeCutMax(9999999),
-fHistoPOverEBins(100),     fHistoPOverEMax(100.),     fHistoPOverEMin(0.),
-fHistodEdxBins(100),       fHistodEdxMax(100.),       fHistodEdxMin(0.),
-fHistodRBins(100),         fHistodRMax(100.),         fHistodRMin(0.),
-fHistoTimeBins(100),       fHistoTimeMax(100.),       fHistoTimeMin(0.),
-fHistoNBins(100),          fHistoNMax(100),           fHistoNMin(0),
-fHistoRatioBins(100),      fHistoRatioMax(100.),      fHistoRatioMin(0.),
-fHistoVertexDistBins(100), fHistoVertexDistMax(100.), fHistoVertexDistMin(0.),
+fHistoPOverEBins(100),     fHistoPOverEMax(100.),      fHistoPOverEMin(0.),
+fHistodEdxBins(100),       fHistodEdxMax(100.),        fHistodEdxMin(0.),
+fHistodRBins(100),         fHistodRMax(100.),          fHistodRMin(0.),
+fHistoTimeBins(100),       fHistoTimeMax(100.),        fHistoTimeMin(0.),
+fHistoNBins(100),          fHistoNMax(100),            fHistoNMin(0),
+fHistoRatioBins(100),      fHistoRatioMax(100.),       fHistoRatioMin(0.),
+fHistoVertexDistBins(100), fHistoVertexDistMax(100.),  fHistoVertexDistMin(0.),
 fHistoRBins(100),          fHistoRMax(1000),           fHistoRMin(-1000),
 fHistoXBins(100),          fHistoXMax(1000),           fHistoXMin(-1000),
 fHistoYBins(100),          fHistoYMax(1000),           fHistoYMin(-1000),
 fHistoZBins(100),          fHistoZMax(1000),           fHistoZMin(-1000),
-fHistoSSBins(40),          fHistoSSMax(10),            fHistoSSMin(0),
+fHistoSSBins(25),          fHistoSSMax(5),             fHistoSSMin(0),
 fhE(0),fhPt(0),fhPhi(0),fhEta(0),   fhEtaPhiE(0),
 fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiECharged(0), 
-  //fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0), 
 fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
 fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0),
 fhLambda(0), fhDispersion(0), 
@@ -90,8 +90,7 @@ fhTime(0), fhTimeId(0), fhTimeAmp(0), //fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(
 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
 fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),  
 fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0), 
-fhAmplitudeMod(0), fhAmplitudeModFraction(0),fhTimeAmpPerRCU(0), //fhT0TimeAmpPerRCU(0), 
-                                                                 //fhTimeCorrRCU(0),
+fhAmplitudeMod(0), fhAmplitudeModFraction(0),fhTimeAmpPerRCU(0), //fhT0TimeAmpPerRCU(0), fhTimeCorrRCU(0),
 fhIMMod(0),  fhIMCellCutMod(0),
 fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
 fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
@@ -115,102 +114,16 @@ fhMCChHad1pOverE(0),  fhMCChHad1dR(0),  fhMCChHad2MatchdEdx(0),
 fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
 fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
 {
-    //Default Ctor
+  //Default Ctor
   
-    //Initialize parameters
+  //Initialize parameters
   InitParameters();
 }
-/*
- //____________________________________________________________________________
- AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :   
- AliAnaPartCorrBaseClass(qa), fCalorimeter(qa.fCalorimeter), fStyleMacro(qa.fStyleMacro), 
- fMakePlots(qa.fMakePlots), fCorrelateCalos(qa.fCorrelateCalos), fNModules(qa.fNModules), fNRCU(qa.fNRCU),
- fTimeCutMin(qa.fTimeCutMin), fTimeCutMax(qa.fTimeCutMax),     
- fHistoPOverEBins(qa.fHistoPOverEBins), fHistoPOverEMax(qa.fHistoPOverEMax), fHistoPOverEMin(qa.fHistoPOverEMin),
- fHistodEdxBins(qa.fHistodEdxBins), fHistodEdxMax(qa.fHistodEdxMax), fHistodEdxMin(qa.fHistodEdxMin), 
- fHistodRBins(qa.fHistodRBins), fHistodRMax(qa.fHistodRMax), fHistodRMin(qa.fHistodRMin),
- fHistoTimeBins(qa.fHistoTimeBins), fHistoTimeMax(qa.fHistoTimeMax), fHistoTimeMin(qa.fHistoTimeMin),
- fHistoNBins(qa.fHistoNBins), fHistoNMax(qa.fHistoNMax), fHistoNMin(qa.fHistoNMin),
- fHistoRatioBins(qa.fHistoRatioBins), fHistoRatioMax(qa.fHistoRatioMax), fHistoRatioMin(qa.fHistoRatioMin),
- fHistoVertexDistBins(qa.fHistoVertexDistBins), fHistoVertexDistMax(qa.fHistoVertexDistMax), fHistoVertexDistMin(qa.fHistoVertexDistMin),
- fHistoRBins(qa.fHistoRBins), fHistoRMax(qa.fHistoRMax),  fHistoRMin(qa.fHistoRMin),
- fHistoXBins(qa.fHistoXBins), fHistoXMax(qa.fHistoXMax),  fHistoXMin(qa.fHistoXMin),
- fHistoYBins(qa.fHistoYBins), fHistoYMax(qa.fHistoYMax),  fHistoYMin(qa.fHistoYMin),
- fHistoZBins(qa.fHistoZBins), fHistoZMax(qa.fHistoZMax),  fHistoZMin(qa.fHistoZMin),
- fHistoSSBins(qa.fHistoSSBins),fHistoSSMax(qa.fHistoSSMax), fHistoSSMin(qa.fHistoSSMin),
- fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta), fhEtaPhiE(qa.fhEtaPhiE), 
- fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
- fhEtaCharged(qa.fhEtaCharged), fhEtaPhiECharged(qa.fhEtaPhiECharged), 
- //fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
- //fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut), 
- fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
- fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
- fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta), 
- fhLambda(qa.fhLambda), fhDispersion(qa.fhDispersion), 
- fhIM(qa.fhIM), fhIMCellCut(qa.fhIMCellCut), fhAsym(qa.fhAsym), 
- fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNCellsPerClusterMIP(qa.fhNCellsPerClusterMIP),
- fhNCellsPerClusterMIPCharged(qa.fhNCellsPerClusterMIPCharged),fhNClusters(qa.fhNClusters),
- fhClusterTimeEnergy(qa.fhClusterTimeEnergy),  
- fhCellTimeSpreadRespectToCellMax(qa.fhCellTimeSpreadRespectToCellMax),
- fhCellIdCellLargeTimeSpread(qa.fhCellIdCellLargeTimeSpread),
- fhRNCells(qa.fhRNCells),fhXNCells(qa.fhXNCells),fhYNCells(qa.fhYNCells),fhZNCells(qa.fhZNCells),
- fhRE(qa.fhRE),          fhXE(qa.fhXE),          fhYE(qa.fhYE),          fhZE(qa.fhZE),        fhXYZ(qa.fhXYZ),
- fhRCellE(qa.fhXCellE),  fhXCellE(qa.fhXCellE),  fhYCellE(qa.fhYCellE),  fhZCellE(qa.fhZCellE),fhXYZCell(qa.fhXYZCell),
- fhDeltaCellClusterRNCells(qa.fhDeltaCellClusterRNCells),fhDeltaCellClusterXNCells(qa.fhDeltaCellClusterXNCells),
- fhDeltaCellClusterYNCells(qa.fhDeltaCellClusterYNCells),fhDeltaCellClusterZNCells(qa.fhDeltaCellClusterZNCells),
- fhDeltaCellClusterRE(qa.fhDeltaCellClusterRE),          fhDeltaCellClusterXE(qa.fhDeltaCellClusterXE),
- fhDeltaCellClusterYE(qa.fhDeltaCellClusterYE),          fhDeltaCellClusterZE(qa.fhDeltaCellClusterZE),
- fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude), fhAmpId(fhAmpId), fhEtaPhiAmp(qa.fhEtaPhiAmp),
- fhTime(qa.fhTime), fhTimeId(qa.fhTimeId),fhTimeAmp(qa.fhTimeAmp),
- //fhT0Time(qa.fhT0Time),fhT0TimeId(qa.fhT0TimeId), fhT0TimeAmp(qa.fhT0TimeAmp), 
- fhCaloCorrNClusters(qa.fhCaloCorrNClusters), fhCaloCorrEClusters(qa.fhCaloCorrEClusters),
- fhCaloCorrNCells(qa.fhCaloCorrNCells), fhCaloCorrECells(qa.fhCaloCorrECells),
- fhEMod(qa.fhEMod), fhNClustersMod(qa.fhNClustersMod), 
- fhNCellsPerClusterMod(qa.fhNCellsPerClusterMod), fhNCellsMod(qa.fhNCellsMod),  
- fhGridCellsMod(qa.fhGridCellsMod),  fhGridCellsEMod(qa.fhGridCellsEMod), fhGridCellsTimeMod(qa.fhGridCellsTimeMod), 
- fhAmplitudeMod(qa.fhAmplitudeMod), fhAmplitudeModFraction(qa.fhAmplitudeModFraction),
- fhTimeAmpPerRCU(qa.fhTimeAmpPerRCU), //fhT0TimeAmpPerRCU(qa.fhT0TimeAmpPerRCU), fhTimeCorrRCU(qa.fhTimeCorrRCU),
- fhIMMod(qa.fhIMMod),fhIMCellCutMod(qa.fhIMCellCutMod),
- fhGenGamPt(qa.fhGenGamPt), fhGenGamEta(qa.fhGenGamEta), fhGenGamPhi(qa.fhGenGamPhi),
- fhGenPi0Pt(qa.fhGenPi0Pt), fhGenPi0Eta(qa.fhGenPi0Eta), fhGenPi0Phi(qa.fhGenPi0Phi),
- fhGenEtaPt(qa.fhGenEtaPt), fhGenEtaEta(qa.fhGenEtaEta), fhGenEtaPhi(qa.fhGenEtaPhi),
- fhGenOmegaPt(qa.fhGenOmegaPt), fhGenOmegaEta(qa.fhGenOmegaEta), fhGenOmegaPhi(qa.fhGenOmegaPhi),
- fhGenElePt(qa.fhGenElePt), fhGenEleEta(qa.fhGenEleEta), fhGenElePhi(qa.fhGenElePhi), 
- fhEMVxyz(qa.fhEMVxyz),  fhEMR(qa.fhEMR), fhHaVxyz(qa.fhHaVxyz),  fhHaR(qa.fhHaR),
- fhGamE(qa.fhGamE),fhGamPt(qa.fhGamPt),fhGamPhi(qa.fhGamPhi),fhGamEta(qa.fhGamEta), 
- fhGamDeltaE(qa.fhGamDeltaE), fhGamDeltaPt(qa.fhGamDeltaPt), fhGamDeltaPhi(qa.fhGamDeltaPhi), fhGamDeltaEta(qa.fhGamDeltaEta),
- fhGamRatioE(qa.fhGamRatioE), fhGamRatioPt(qa.fhGamRatioPt), fhGamRatioPhi(qa.fhGamRatioPhi), fhGamRatioEta(qa.fhGamRatioEta),
- fhEleE(qa.fhEleE),fhElePt(qa.fhElePt),fhElePhi(qa.fhElePhi),fhEleEta(qa.fhEleEta),
- fhPi0E(qa.fhPi0E),fhPi0Pt(qa.fhPi0Pt),fhPi0Phi(qa.fhPi0Phi),fhPi0Eta(qa.fhPi0Eta), 
- fhNeHadE(qa.fhNeHadE),fhNeHadPt(qa.fhNeHadPt),fhNeHadPhi(qa.fhNeHadPhi),fhNeHadEta(qa.fhNeHadEta), 
- fhChHadE(qa.fhChHadE),fhChHadPt(qa.fhChHadPt),fhChHadPhi(qa.fhChHadPhi),fhChHadEta(qa.fhChHadEta),
- fhGamECharged(qa.fhGamECharged),fhGamPtCharged(qa.fhGamPtCharged),fhGamPhiCharged(qa.fhGamPhiCharged),fhGamEtaCharged(qa.fhGamEtaCharged), 
- fhEleECharged(qa.fhEleECharged),fhElePtCharged(qa.fhElePtCharged),fhElePhiCharged(qa.fhElePhiCharged),fhEleEtaCharged(qa.fhEleEtaCharged),
- fhPi0ECharged(qa.fhPi0ECharged),fhPi0PtCharged(qa.fhPi0PtCharged),fhPi0PhiCharged(qa.fhPi0PhiCharged),fhPi0EtaCharged(qa.fhPi0EtaCharged), 
- fhNeHadECharged(qa.fhNeHadECharged),fhNeHadPtCharged(qa.fhNeHadPtCharged),fhNeHadPhiCharged(qa.fhNeHadPhiCharged),fhNeHadEtaCharged(qa.fhNeHadEtaCharged), 
- fhChHadECharged(qa.fhChHadECharged),fhChHadPtCharged(qa.fhChHadPtCharged),fhChHadPhiCharged(qa.fhChHadPhiCharged),fhChHadEtaCharged(qa.fhChHadEtaCharged),
- fhGenGamAccE(qa.fhGenGamAccE),fhGenGamAccPt(qa.fhGenGamAccPt),fhGenGamAccEta(qa.fhGenGamAccEta),fhGenGamAccPhi(qa.fhGenGamAccPhi),
- fhGenPi0AccE(qa.fhGenPi0AccE),fhGenPi0AccPt(qa.fhGenPi0AccPt),fhGenPi0AccEta(qa.fhGenPi0AccEta),fhGenPi0AccPhi(qa.fhGenPi0AccPhi),
- fh1pOverE(qa.fh1pOverE),fh1dR(qa.fh1dR),fh2EledEdx(qa.fh2EledEdx), fh2MatchdEdx(qa.fh2MatchdEdx),
- fhMCEle1pOverE(qa.fhMCEle1pOverE),fhMCEle1dR(qa.fhMCEle1dR), fhMCEle2MatchdEdx(qa.fhMCEle2MatchdEdx),
- fhMCChHad1pOverE(qa.fhMCChHad1pOverE),fhMCChHad1dR(qa.fhMCChHad1dR), fhMCChHad2MatchdEdx(qa.fhMCChHad2MatchdEdx),
- fhMCNeutral1pOverE(qa.fhMCNeutral1pOverE),fhMCNeutral1dR(qa.fhMCNeutral1dR), fhMCNeutral2MatchdEdx(qa.fhMCNeutral2MatchdEdx),
- fh1pOverER02(qa.fh1pOverER02), fhMCEle1pOverER02(qa.fhMCEle1pOverER02),fhMCChHad1pOverER02(qa.fhMCChHad1pOverER02), fhMCNeutral1pOverER02(qa.fhMCNeutral1pOverER02)
- {
- // cpy ctor
- }
- */
-  //________________________________________________________________________________________________________________________________________________
-  //AliAnaCalorimeterQA::~AliAnaCalorimeterQA() {
-       // dtor
 
-  //}
-
-  //________________________________________________________________________
+//________________________________________________________________________
 TObjString *  AliAnaCalorimeterQA::GetAnalysisCuts()
 {      
-    //Save parameters used for analysis
+  //Save parameters used for analysis
        TString parList ; //this will be list of parameters used for this analysis.
        char onePar[255] ;
        
@@ -221,26 +134,26 @@ TObjString *  AliAnaCalorimeterQA::GetAnalysisCuts()
        sprintf(onePar,"Time Cut : %2.2f < T < %2.2f ns  \n",fTimeCutMin, fTimeCutMax) ;
        parList+=onePar ;
   
-    //Get parameters set in base class.
-    //parList += GetBaseParametersList() ;
+  //Get parameters set in base class.
+  //parList += GetBaseParametersList() ;
        
-    //Get parameters set in FiducialCut class (not available yet)
-    //parlist += GetFidCut()->GetFidCutParametersList() 
+  //Get parameters set in FiducialCut class (not available yet)
+  //parlist += GetFidCut()->GetFidCutParametersList() 
        
        return new TObjString(parList) ;
 }
 
 
-  //________________________________________________________________________
+//________________________________________________________________________
 TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
 {  
-    // Create histograms to be saved in output file and 
-    // store them in outputContainer
+  // Create histograms to be saved in output file and 
+  // store them in outputContainer
   
        TList * outputContainer = new TList() ; 
        outputContainer->SetName("QAHistos") ; 
        
-    //Histograms
+  //Histograms
        Int_t nptbins     = GetHistoPtBins();           Float_t ptmax     = GetHistoPtMax();           Float_t ptmin     = GetHistoPtMin();
        Int_t nphibins    = GetHistoPhiBins();              Float_t phimax    = GetHistoPhiMax();          Float_t phimin    = GetHistoPhiMin();
        Int_t netabins    = GetHistoEtaBins();          Float_t etamax    = GetHistoEtaMax();          Float_t etamin    = GetHistoEtaMin();    
@@ -259,11 +172,11 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        Int_t zbins       = GetHistoZBins();            Float_t zmax      = GetHistoZMax();            Float_t zmin      = GetHistoZMin(); 
        Int_t ssbins      = GetHistoShowerShapeBins();  Float_t ssmax     = GetHistoShowerShapeMax();  Float_t ssmin     = GetHistoShowerShapeMin();
        
-    //EMCAL
+  //EMCAL
        Int_t colmax = 48;
        Int_t rowmax = 24;
        fNRCU   = 2 ;
-    //PHOS
+  //PHOS
        if(fCalorimeter=="PHOS"){
                colmax = 56;
                rowmax = 64;
@@ -271,22 +184,24 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        }
        
        
-       fhE  = new TH1F ("hE","E reconstructed clusters ", nptbins,ptmin,ptmax); 
+       fhE  = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5); 
        fhE->SetXTitle("E (GeV)");
        outputContainer->Add(fhE);
-       
-       fhPt  = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax); 
-       fhPt->SetXTitle("p_{T} (GeV/c)");
-       outputContainer->Add(fhPt);
-       
-       fhPhi  = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax); 
-       fhPhi->SetXTitle("#phi (rad)");
-       outputContainer->Add(fhPhi);
-       
-       fhEta  = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax); 
-       fhEta->SetXTitle("#eta ");
-       outputContainer->Add(fhEta);
-       
+  
+       if(fFillAllTH12){
+    fhPt  = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax); 
+    fhPt->SetXTitle("p_{T} (GeV/c)");
+    outputContainer->Add(fhPt);
+    
+    fhPhi  = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax); 
+    fhPhi->SetXTitle("#phi (rad)");
+    outputContainer->Add(fhPhi);
+    
+    fhEta  = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax); 
+    fhEta->SetXTitle("#eta ");
+    outputContainer->Add(fhEta);
+       }
+  
        fhEtaPhiE  = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
                          netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax); 
        fhEtaPhiE->SetXTitle("#eta ");
@@ -301,7 +216,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        outputContainer->Add(fhClusterTimeEnergy);
        
        
-    //Shower shape
+  //Shower shape
        fhLambda  = new TH3F ("hLambda","#lambda_{0}^{2} vs #lambda_{1}^{2} vs energy, reconstructed clusters",
                         ssbins,ssmin,ssmax,ssbins,ssmin,ssmax,nptbins,ptmin,ptmax); 
        fhLambda->SetXTitle("#lambda_{0}^{2}  ");
@@ -315,24 +230,25 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        fhDispersion->SetYTitle("E (GeV) ");
        outputContainer->Add(fhDispersion);
        
-    //Track Matching
+  //Track Matching
+  if(fFillAllTH12){
+    fhECharged  = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax); 
+    fhECharged->SetXTitle("E (GeV)");
+    outputContainer->Add(fhECharged);
+    
+    fhPtCharged  = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax); 
+    fhPtCharged->SetXTitle("p_{T} (GeV/c)");
+    outputContainer->Add(fhPtCharged);
+    
+    fhPhiCharged  = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax); 
+    fhPhiCharged->SetXTitle("#phi (rad)");
+    outputContainer->Add(fhPhiCharged);
+    
+    fhEtaCharged  = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax); 
+    fhEtaCharged->SetXTitle("#eta ");
+    outputContainer->Add(fhEtaCharged);
+  }
   
-       fhECharged  = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax); 
-       fhECharged->SetXTitle("E (GeV)");
-       outputContainer->Add(fhECharged);
-       
-       fhPtCharged  = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax); 
-       fhPtCharged->SetXTitle("p_{T} (GeV/c)");
-       outputContainer->Add(fhPtCharged);
-       
-       fhPhiCharged  = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax); 
-       fhPhiCharged->SetXTitle("#phi (rad)");
-       outputContainer->Add(fhPhiCharged);
-       
-       fhEtaCharged  = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax); 
-       fhEtaCharged->SetXTitle("#eta ");
-       outputContainer->Add(fhEtaCharged);
-       
        fhEtaPhiECharged  = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
                                 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax); 
        fhEtaPhiECharged->SetXTitle("#eta ");
@@ -340,28 +256,6 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        fhEtaPhiECharged->SetZTitle("E (GeV) ");
        outputContainer->Add(fhEtaPhiECharged); 
   
-  
-    // fhEChargedNoOut  = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);                                     
-    // fhEChargedNoOut->SetXTitle("E (GeV)");                                                                                                                                          
-    // outputContainer->Add(fhEChargedNoOut);                                                                                                                                         
-    //                                                                                                                                                                 
-    // fhPtChargedNoOut  = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);                               
-    // fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");                                                                                                                               
-    // outputContainer->Add(fhPtChargedNoOut);                                                                                                                                       
-    //                                                                                                                                                                         
-    // fhPhiChargedNoOut  = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);                    
-    // fhPhiChargedNoOut->SetXTitle("#phi (rad)");                                                                                                                               
-    // outputContainer->Add(fhPhiChargedNoOut);                                                                                                                        
-    //                                                                                                                                                                   
-    // fhEtaChargedNoOut  = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);               
-    // fhEtaChargedNoOut->SetXTitle("#eta ");                                                                                                                           
-    // outputContainer->Add(fhEtaChargedNoOut);                                                                                                                             
-    //                                                                                                                                                                       
-    // fhEtaPhiChargedNoOut  = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax); 
-    // fhEtaPhiChargedNoOut->SetXTitle("#eta ");                                                                                                    
-    // fhEtaPhiChargedNoOut->SetYTitle("#phi ");                                                                                                                       
-    // outputContainer->Add(fhEtaPhiChargedNoOut);     
-  
        fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
        fh1pOverE->SetYTitle("p/E");
        fh1pOverE->SetXTitle("p_{T} (GeV/c)");
@@ -395,13 +289,15 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
        fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
        outputContainer->Add(fhIMCellCut);
-       
-       fhAsym  = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax); 
-       fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
-       fhAsym->SetYTitle("Asymmetry");
-       outputContainer->Add(fhAsym);   
-       
-       fhNCellsPerCluster  = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, netabins,etamin,etamax); 
+  
+  if(fFillAllTH12){
+    fhAsym  = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax); 
+    fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
+    fhAsym->SetYTitle("Asymmetry");
+    outputContainer->Add(fhAsym);      
+  }
+  
+       fhNCellsPerCluster  = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, 10,etamin,etamax); 
        fhNCellsPerCluster->SetXTitle("E (GeV)");
        fhNCellsPerCluster->SetYTitle("n cells");
        fhNCellsPerCluster->SetZTitle("#eta");
@@ -409,7 +305,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        
        
        fhNCellsPerClusterMIP  = new TH3F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search", 
-                                     100,0.,1., 6,0,5,netabins,etamin,etamax); 
+                                     20,0.,1., 6,0,5,10,etamin,etamax); 
        fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
        fhNCellsPerClusterMIP->SetYTitle("n cells");
        fhNCellsPerClusterMIP->SetZTitle("#eta");
@@ -417,7 +313,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        
        
        fhNCellsPerClusterMIPCharged  = new TH3F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search", 
-                                            100,0.,1., 6,0,5,netabins,etamin,etamax); 
+                                            20,0.,1., 6,0,5,10,etamin,etamax); 
        fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
        fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
        fhNCellsPerClusterMIPCharged->SetZTitle("#eta");
@@ -427,133 +323,136 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        fhNClusters  = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax); 
        fhNClusters->SetXTitle("number of clusters");
        outputContainer->Add(fhNClusters);
-       
-       fhRNCells  = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax); 
-       fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
-       fhRNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhRNCells);
-       
-       fhXNCells  = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax); 
-       fhXNCells->SetXTitle("x (cm)");
-       fhXNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhXNCells);
-       
-       fhYNCells  = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax); 
-       fhYNCells->SetXTitle("y (cm)");
-       fhYNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhYNCells);
-       
-       fhZNCells  = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax); 
-       fhZNCells->SetXTitle("z (cm)");
-       fhZNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhZNCells);
-       
-       fhRE  = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax); 
-       fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
-       fhRE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhRE);
-       
-       fhXE  = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax); 
-       fhXE->SetXTitle("x (cm)");
-       fhXE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhXE);
-  
-       fhYE  = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax); 
-       fhYE->SetXTitle("y (cm)");
-       fhYE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhYE);
-       
-       fhZE  = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax); 
-       fhZE->SetXTitle("z (cm)");
-       fhZE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhZE);
-       
-       fhXYZ  = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax); 
-       fhXYZ->SetXTitle("x (cm)");
-       fhXYZ->SetYTitle("y (cm)");
-       fhXYZ->SetZTitle("z (cm) ");
-       outputContainer->Add(fhXYZ);
-  
-       fhRCellE  = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax); 
-       fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
-       fhRCellE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhRCellE);
-       
-       fhXCellE  = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax); 
-       fhXCellE->SetXTitle("x (cm)");
-       fhXCellE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhXCellE);
-  
-       fhYCellE  = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax); 
-       fhYCellE->SetXTitle("y (cm)");
-       fhYCellE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhYCellE);
-       
-       fhZCellE  = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax); 
-       fhZCellE->SetXTitle("z (cm)");
-       fhZCellE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhZCellE);
-       
-       fhXYZCell  = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax); 
-       fhXYZCell->SetXTitle("x (cm)");
-       fhXYZCell->SetYTitle("y (cm)");
-       fhXYZCell->SetZTitle("z (cm)");
-       outputContainer->Add(fhXYZCell);
-  
-  
-       Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
-       Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
-       Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
-       Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
-  
-       fhDeltaCellClusterRNCells  = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax); 
-       fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
-       fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhDeltaCellClusterRNCells);
-       
-       fhDeltaCellClusterXNCells  = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax); 
-       fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
-       fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhDeltaCellClusterXNCells);
-       
-       fhDeltaCellClusterYNCells  = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax); 
-       fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
-       fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhDeltaCellClusterYNCells);
-       
-       fhDeltaCellClusterZNCells  = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax); 
-       fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
-       fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
-       outputContainer->Add(fhDeltaCellClusterZNCells);
-       
-       fhDeltaCellClusterRE  = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax); 
-       fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
-       fhDeltaCellClusterRE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhDeltaCellClusterRE);             
-       
-       fhDeltaCellClusterXE  = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax); 
-       fhDeltaCellClusterXE->SetXTitle("x (cm)");
-       fhDeltaCellClusterXE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhDeltaCellClusterXE);
-       
-       fhDeltaCellClusterYE  = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax); 
-       fhDeltaCellClusterYE->SetXTitle("y (cm)");
-       fhDeltaCellClusterYE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhDeltaCellClusterYE);
-       
-       fhDeltaCellClusterZE  = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax); 
-       fhDeltaCellClusterZE->SetXTitle("z (cm)");
-       fhDeltaCellClusterZE->SetYTitle("E (GeV)");
-       outputContainer->Add(fhDeltaCellClusterZE);
-       
-       fhEtaPhiAmp  = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax); 
-       fhEtaPhiAmp->SetXTitle("#eta ");
-       fhEtaPhiAmp->SetYTitle("#phi (rad)");
-       fhEtaPhiAmp->SetZTitle("E (GeV) ");
-       outputContainer->Add(fhEtaPhiAmp);              
   
+  if(fFillAllPosHisto){
+    
+    fhRNCells  = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax); 
+    fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
+    fhRNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhRNCells);
+    
+    fhXNCells  = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax); 
+    fhXNCells->SetXTitle("x (cm)");
+    fhXNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhXNCells);
+    
+    fhYNCells  = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax); 
+    fhYNCells->SetXTitle("y (cm)");
+    fhYNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhYNCells);
+    
+    fhZNCells  = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax); 
+    fhZNCells->SetXTitle("z (cm)");
+    fhZNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhZNCells);
+    
+    fhRE  = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax); 
+    fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
+    fhRE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhRE);
+    
+    fhXE  = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax); 
+    fhXE->SetXTitle("x (cm)");
+    fhXE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhXE);
+    
+    fhYE  = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax); 
+    fhYE->SetXTitle("y (cm)");
+    fhYE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhYE);
+    
+    fhZE  = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax); 
+    fhZE->SetXTitle("z (cm)");
+    fhZE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhZE);    
+    
+    fhXYZ  = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax); 
+    fhXYZ->SetXTitle("x (cm)");
+    fhXYZ->SetYTitle("y (cm)");
+    fhXYZ->SetZTitle("z (cm) ");
+    outputContainer->Add(fhXYZ);
+    
+    fhRCellE  = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax); 
+    fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
+    fhRCellE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhRCellE);
+    
+    fhXCellE  = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax); 
+    fhXCellE->SetXTitle("x (cm)");
+    fhXCellE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhXCellE);
+    
+    fhYCellE  = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax); 
+    fhYCellE->SetXTitle("y (cm)");
+    fhYCellE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhYCellE);
+    
+    fhZCellE  = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax); 
+    fhZCellE->SetXTitle("z (cm)");
+    fhZCellE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhZCellE);
+    
+    fhXYZCell  = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax); 
+    fhXYZCell->SetXTitle("x (cm)");
+    fhXYZCell->SetYTitle("y (cm)");
+    fhXYZCell->SetZTitle("z (cm)");
+    outputContainer->Add(fhXYZCell);
+    
+    
+    Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
+    Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
+    Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
+    Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
+    
+    fhDeltaCellClusterRNCells  = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax); 
+    fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
+    fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhDeltaCellClusterRNCells);
+    
+    fhDeltaCellClusterXNCells  = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax); 
+    fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
+    fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhDeltaCellClusterXNCells);
+    
+    fhDeltaCellClusterYNCells  = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax); 
+    fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
+    fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhDeltaCellClusterYNCells);
+    
+    fhDeltaCellClusterZNCells  = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax); 
+    fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
+    fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
+    outputContainer->Add(fhDeltaCellClusterZNCells);
+    
+    fhDeltaCellClusterRE  = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax); 
+    fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
+    fhDeltaCellClusterRE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhDeltaCellClusterRE);                
+    
+    fhDeltaCellClusterXE  = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax); 
+    fhDeltaCellClusterXE->SetXTitle("x (cm)");
+    fhDeltaCellClusterXE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhDeltaCellClusterXE);
+    
+    fhDeltaCellClusterYE  = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax); 
+    fhDeltaCellClusterYE->SetXTitle("y (cm)");
+    fhDeltaCellClusterYE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhDeltaCellClusterYE);
+    
+    fhDeltaCellClusterZE  = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax); 
+    fhDeltaCellClusterZE->SetXTitle("z (cm)");
+    fhDeltaCellClusterZE->SetYTitle("E (GeV)");
+    outputContainer->Add(fhDeltaCellClusterZE);
+    
+    fhEtaPhiAmp  = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax); 
+    fhEtaPhiAmp->SetXTitle("#eta ");
+    fhEtaPhiAmp->SetYTitle("#phi (rad)");
+    fhEtaPhiAmp->SetZTitle("E (GeV) ");
+    outputContainer->Add(fhEtaPhiAmp);         
+    
+       }
   
-    //Calo cells
+  //Calo cells
        fhNCells  = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules); 
        fhNCells->SetXTitle("n cells");
        outputContainer->Add(fhNCells);
@@ -569,7 +468,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        outputContainer->Add(fhAmpId);
        
        
-    //Cell Time histograms, time only available in ESDs
+  //Cell Time histograms, time only available in ESDs
        if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
                
                fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200); 
@@ -594,23 +493,21 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fhTimeAmp->SetXTitle("Cell Energy (GeV)");
                outputContainer->Add(fhTimeAmp);
                
-      //               fhT0Time  = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax); 
-      //               fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
-      //               outputContainer->Add(fhT0Time);
-      //               
-      //               fhT0TimeId  = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules); 
-      //               fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
-      //               fhT0TimeId->SetYTitle("Cell Absolute Id");
-      //               outputContainer->Add(fhT0TimeId);
-      //               
-      //               fhT0TimeAmp  = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax); 
-      //               fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
-      //               fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
-      //               outputContainer->Add(fhT0TimeAmp);
+    //         fhT0Time  = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax); 
+    //         fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
+    //         outputContainer->Add(fhT0Time);
+    //         
+    //         fhT0TimeId  = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules); 
+    //         fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
+    //         fhT0TimeId->SetYTitle("Cell Absolute Id");
+    //         outputContainer->Add(fhT0TimeId);
+    //         
+    //         fhT0TimeAmp  = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax); 
+    //         fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
+    //         fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
+    //         outputContainer->Add(fhT0TimeAmp);
        }
        
-       
-       
        if(fCorrelateCalos){
                fhCaloCorrNClusters  = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax); 
                fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
@@ -633,7 +530,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                outputContainer->Add(fhCaloCorrECells);
        }//correlate calorimeters
        
-    //Module histograms
+  //Module histograms
        fhEMod                 = new TH1F*[fNModules];
        fhNClustersMod         = new TH1F*[fNModules];
        fhNCellsPerClusterMod  = new TH2F*[fNModules];
@@ -646,8 +543,8 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fhAmplitudeModFraction = new TH1F*[fNModules*3];
   
        fhTimeAmpPerRCU        = new TH2F*[fNModules*fNRCU];
-    //fhT0TimeAmpPerRCU      = new TH2F*[fNModules*fNRCU];
-    //fhTimeCorrRCU          = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
+  //fhT0TimeAmpPerRCU      = new TH2F*[fNModules*fNRCU];
+  //fhTimeCorrRCU          = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
        
        fhIMMod                = new TH2F*[fNModules];
        fhIMCellCutMod         = new TH2F*[fNModules];
@@ -711,25 +608,25 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
       fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
       outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
                        
-        //                             fhT0TimeAmpPerRCU[imod*fNRCU+ircu]  = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
-        //                                                                                                                       Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu), 
-        //                                                                                                                       nptbins,ptmin,ptmax,ntimebins,timemin,timemax); 
-        //                             fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
-        //                             fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
-        //                             outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
-        //                     
+      //                               fhT0TimeAmpPerRCU[imod*fNRCU+ircu]  = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
+      //                                                                                                                         Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu), 
+      //                                                                                                                         nptbins,ptmin,ptmax,ntimebins,timemin,timemax); 
+      //                               fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
+      //                               fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
+      //                               outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
+      //                       
                        
-        //                             for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
-        //                                             for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
-        //                                                     Int_t index =  (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod; 
-        //                                                     fhTimeCorrRCU[index]  = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
-        //                                                                                                                                                     Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
-        //                                                                                                                                                     ntimebins,timemin,timemax,ntimebins,timemin,timemax); 
-        //                                                     fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
-        //                                                     fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
-        //                                                     outputContainer->Add(fhTimeCorrRCU[index]);
-        //                                             }
-        //                             }
+      //                               for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
+      //                                               for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
+      //                                                       Int_t index =  (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod; 
+      //                                                       fhTimeCorrRCU[index]  = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
+      //                                                                                                                                                       Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
+      //                                                                                                                                                       ntimebins,timemin,timemax,ntimebins,timemin,timemax); 
+      //                                                       fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
+      //                                                       fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
+      //                                                       outputContainer->Add(fhTimeCorrRCU[index]);
+      //                                               }
+      //                               }
                }
                
                
@@ -750,7 +647,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        }
        
        
-    //Monte Carlo Histograms
+  //Monte Carlo Histograms
        if(IsDataMC()){
                
                fhDeltaE  = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax); 
@@ -805,7 +702,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fh2Eta->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fh2Eta);
                
-      //Fill histos depending on origin of cluster
+    //Fill histos depending on origin of cluster
                fhGamE  = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
                fhGamE->SetXTitle("E_{rec} (GeV)");
                fhGamE->SetXTitle("E_{gen} (GeV)");
@@ -938,7 +835,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fhChHadEta->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fhChHadEta);
                
-      //Charged clusters
+    //Charged clusters
                
                fhGamECharged  = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
                fhGamECharged->SetXTitle("E_{rec} (GeV)");
@@ -1041,18 +938,18 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fhChHadEtaCharged);
                
-      //Vertex of generated particles 
+    //Vertex of generated particles 
                
                fhEMVxyz  = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500); 
                fhEMVxyz->SetXTitle("v_{x}");
                fhEMVxyz->SetYTitle("v_{y}");
-      //fhEMVxyz->SetZTitle("v_{z}");
+    //fhEMVxyz->SetZTitle("v_{z}");
                outputContainer->Add(fhEMVxyz);
                
                fhHaVxyz  = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500); 
                fhHaVxyz->SetXTitle("v_{x}");
                fhHaVxyz->SetYTitle("v_{y}");
-      //fhHaVxyz->SetZTitle("v_{z}");
+    //fhHaVxyz->SetZTitle("v_{z}");
                outputContainer->Add(fhHaVxyz);
                
                fhEMR  = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax); 
@@ -1067,7 +964,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                
     
                
-      //Pure MC
+    //Pure MC
                fhGenGamPt  = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
                fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
                fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
@@ -1151,7 +1048,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                outputContainer->Add(fhGenPi0AccEta);
                outputContainer->Add(fhGenPi0AccPhi);
                
-      //Track Matching 
+    //Track Matching 
                
          fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
          fhMCEle1pOverE->SetYTitle("p/E");
@@ -1214,21 +1111,21 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        return outputContainer;
 }
 
-  //_______________________________________________________________________________________________________________________________________
+//_______________________________________________________________________________________________________________________________________
 Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
 {
-    //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
+  //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
   Float_t oldbinsize =  histo->GetBinWidth(0);
   Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
-    //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
+  //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
   if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
   else  return 1;
 }
 
-  //__________________________________________________
+//__________________________________________________
 void AliAnaCalorimeterQA::Init()
 { 
-    //Check if the data or settings are ok
+  //Check if the data or settings are ok
        if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
                printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
                abort();
@@ -1242,10 +1139,10 @@ void AliAnaCalorimeterQA::Init()
 }
 
 
-  //__________________________________________________
+//__________________________________________________
 void AliAnaCalorimeterQA::InitParameters()
 { 
-    //Initialize the parameters of the analysis.
+  //Initialize the parameters of the analysis.
   AddToHistogramsName("AnaCaloQA_");
   
   fCalorimeter = "EMCAL"; //or PHOS
@@ -1270,10 +1167,10 @@ void AliAnaCalorimeterQA::InitParameters()
        
 }
 
-  //__________________________________________________________________
+//__________________________________________________________________
 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
 {
-    //Print some relevant parameters set for the analysis
+  //Print some relevant parameters set for the analysis
   if(! opt)
     return;
   
@@ -1298,10 +1195,10 @@ void AliAnaCalorimeterQA::Print(const Option_t * opt) const
   
 } 
 
-  //__________________________________________________________________
+//__________________________________________________________________
 void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms() 
 {
-    //Fill Calorimeter QA histograms
+  //Fill Calorimeter QA histograms
        TLorentzVector mom ;
        TLorentzVector mom2 ;
        TRefArray * caloClusters = new TRefArray();
@@ -1313,8 +1210,8 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        Int_t trackIndex = 0;
        Int_t nModule = -1;
   
-    //Play with the MC stack if available      
-    //Get the MC arrays and do some checks
+  //Play with the MC stack if available        
+  //Get the MC arrays and do some checks
        if(IsDataMC()){
                if(GetReader()->ReadStack()){
       
@@ -1322,10 +1219,10 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
                                abort();
                        }
-        //Fill some pure MC histograms, only primaries.
+      //Fill some pure MC histograms, only primaries.
                        for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
                                TParticle *primary = GetMCStack()->Particle(i) ;
-          //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
+        //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
                                if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG 
                                primary->Momentum(mom);
                                MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
@@ -1337,14 +1234,14 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                printf("AliAnaPhoton::MakeAnalysisFillHistograms() -  AODMCParticles not available!\n");
                                abort();
                        }
-        //Fill some pure MC histograms, only primaries.
+      //Fill some pure MC histograms, only primaries.
                        for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
                                AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
-          //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
-          //      i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(), 
-          //      aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
+        //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
+        //        i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(), 
+        //        aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
                                if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
-                                                //aodprimary->Momentum(mom);
+        //aodprimary->Momentum(mom);
                                mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
                                MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
                        } //primary loop
@@ -1353,7 +1250,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        }// is data and MC      
        
        
-    //Get List with CaloClusters  
+  //Get List with CaloClusters  
        
   if     (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetAODEMCAL();
   else if(fCalorimeter == "PHOS") GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetAODPHOS();
@@ -1363,15 +1260,15 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        if(!caloClusters) 
                AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
        
-    //----------------------------------------------------------
-    //Correlate Calorimeters
-    //----------------------------------------------------------
+  //----------------------------------------------------------
+  //Correlate Calorimeters
+  //----------------------------------------------------------
        if(fCorrelateCalos)     CorrelateCalorimeters(caloClusters);
   
        
-    //----------------------------------------------------------
-    // CALOCLUSTERS
-    //----------------------------------------------------------
+  //----------------------------------------------------------
+  // CALOCLUSTERS
+  //----------------------------------------------------------
        
        nCaloClusters = caloClusters->GetEntriesFast() ; 
        fhNClusters->Fill(nCaloClusters);
@@ -1381,7 +1278,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        if(GetDebug() > 0)
                printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
        
-    //Get vertex for photon momentum calculation
+  //Get vertex for photon momentum calculation
        Double_t v[3] = {0,0,0}; //vertex ;
        GetReader()->GetVertex(v);
        AliVTrack * track = 0x0;
@@ -1389,12 +1286,12 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        Float_t pos[3] ;
        Float_t showerShape[3] ;
        Double_t tof = 0;
-    //Loop over CaloClusters
-    //if(nCaloClusters > 0)printf("QA  : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
+  //Loop over CaloClusters
+  //if(nCaloClusters > 0)printf("QA  : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
        for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
                
                if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
-                               iclus+1,nCaloClusters,GetReader()->GetDataType());
+                              iclus+1,nCaloClusters,GetReader()->GetDataType());
                
                if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
                        AliVCluster* clus =  (AliVCluster*)caloClusters->At(iclus);
@@ -1402,35 +1299,35 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                        if(fCalorimeter == "PHOS") cell =  GetReader()->GetInputEvent()->GetPHOSCells();
                        else                               cell =  GetReader()->GetInputEvent()->GetEMCALCells();
                        
-        //Check if the cluster contains any bad channel or it is close to the calorimeter borders
+      //Check if the cluster contains any bad channel or it is close to the calorimeter borders
                        if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue; 
                        if(!GetCaloUtils()->CheckCellFiducialRegion(clus, cell, GetReader()->GetInputEvent(), 0)) continue;
-        //Recalibrate the cluster energy 
+      //Recalibrate the cluster energy 
                        if( GetCaloUtils()->IsRecalibrationOn())        {
                                Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
                                clus->SetE(energy);
                        }
                        
-        //Get cluster kinematics
+      //Get cluster kinematics
                        clus->GetPosition(pos);
                        clus->GetMomentum(mom,v);
                        tof = clus->GetTOF()*1e9;
                        if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
                        
-        //Check only certain regions
+      //Check only certain regions
                        Bool_t in = kTRUE;
                        if(IsFiducialCutOn()) in =  GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
                        if(!in) continue;
-        //Get module of cluster
+      //Get module of cluster
                        nModule = GetModuleNumber(clus);
                        if(nModule < fNModules) nClustersInModule[nModule]++;
-        //MC labels
+      //MC labels
                        nLabel = clus->GetNLabels();
                        labels = clus->GetLabels();
-        //Cells per cluster
+      //Cells per cluster
                        nCaloCellsPerCluster =  clus->GetNCells();
-        //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
-        //matched cluster with tracks
+      //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
+      //matched cluster with tracks
                        nTracksMatched = clus->GetNTracksMatched();
                        trackIndex     = clus->GetTrackMatchedIndex();
                        if(trackIndex >= 0){
@@ -1441,48 +1338,49 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                track = 0;
                        }
                        
-        //Shower shape parameters
+      //Shower shape parameters
                        showerShape[0] = clus->GetM20();
                        showerShape[1] = clus->GetM02();
                        showerShape[2] = clus->GetDispersion();
       
-        //======================
-        //Cells in cluster
-        //======================
+      //======================
+      //Cells in cluster
+      //======================
       
-        //Get list of contributors
+      //Get list of contributors
                        UShort_t * indexList = clus->GetCellsAbsId() ;
-        // check time of cells respect to max energy cell
-        //Get maximum energy cell
+      // check time of cells respect to max energy cell
+      //Get maximum energy cell
                        Float_t emax  = -1;
                        Double_t tmax = -1;
                        Int_t imax    = -1;
                        Int_t absId   = -1 ;
-        //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
-        //Loop on cluster cells
+      //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
+      //Loop on cluster cells
                        for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
-          //   printf("Index %d\n",ipos);
+        //     printf("Index %d\n",ipos);
                          absId  = indexList[ipos]; 
                          
-          //Get position of cell compare to cluster
-                         if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
-                           
-                           Double_t cellpos[] = {0, 0, 0};
-                           GetEMCALGeometry()->GetGlobal(absId, cellpos);
-                           
-                           fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ; 
-                           fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ; 
-                           fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
-                           
-                           fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E())  ; 
-                           fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E())  ; 
-                           fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E())  ; 
-                           
-                           Float_t r     = TMath::Sqrt(pos[0]*pos[0]        +pos[1]*pos[1]);//     +pos[2]*pos[2]);
-                           Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
-                           fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ; 
-                           fhDeltaCellClusterRE     ->Fill(r-rcell, mom.E())  ; 
-          
+        //Get position of cell compare to cluster
+        if(fFillAllPosHisto){
+          if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
+            
+            Double_t cellpos[] = {0, 0, 0};
+            GetEMCALGeometry()->GetGlobal(absId, cellpos);
+            
+            fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ; 
+            fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ; 
+            fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
+            
+            fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E())  ; 
+            fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E())  ; 
+            fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E())  ; 
+            
+            Float_t r     = TMath::Sqrt(pos[0]*pos[0]        +pos[1]*pos[1]);//     +pos[2]*pos[2]);
+            Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
+            fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ; 
+            fhDeltaCellClusterRE     ->Fill(r-rcell, mom.E())  ; 
+            
             //                                 Float_t celleta = 0, cellphi = 0;
             //                                 GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi); 
             //                                 Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
@@ -1496,38 +1394,39 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
             //                                 printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
             //                                 printf("r cluster %f, r cell %f, cluster-cell %f\n",r,      rcell,     r-rcell);
             //                                 
-          
-                         }//EMCAL and its matrices are available
-                         else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
-                           TVector3 xyz;
-                           Int_t relId[4], module;
-                           Float_t xCell, zCell;
-                           
-                           GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
-                           module = relId[0];
-                           GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
-                           GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
-                           
-                           fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ; 
-                           fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ; 
-                           fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
-                           
-                           fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E())  ; 
-                           fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E())  ; 
-                           fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E())  ; 
-                           
-                           Float_t r     = TMath::Sqrt(pos[0]*pos[0]  +pos[1]*pos[1]);//     +pos[2]*pos[2]);
-                           Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
-                           fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ; 
-                           fhDeltaCellClusterRE     ->Fill(r-rcell, mom.E())  ; 
-                           
+            
+          }//EMCAL and its matrices are available
+          else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
+            TVector3 xyz;
+            Int_t relId[4], module;
+            Float_t xCell, zCell;
+            
+            GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
+            module = relId[0];
+            GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
+            GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
+            
+            fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ; 
+            fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ; 
+            fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
+            
+            fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E())  ; 
+            fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E())  ; 
+            fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E())  ; 
+            
+            Float_t r     = TMath::Sqrt(pos[0]*pos[0]  +pos[1]*pos[1]);//     +pos[2]*pos[2]);
+            Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
+            fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ; 
+            fhDeltaCellClusterRE     ->Fill(r-rcell, mom.E())  ; 
+            
             //                         printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
             //                         printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
             //                         printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
             //                                 printf("r cluster %f, r cell %f, cluster-cell %f\n",r,      rcell,     r-rcell);
-                         }//PHOS and its matrices are available
+          }//PHOS and its matrices are available
+        }//Fill all position histograms
         
-          //Find maximum energy cluster
+        //Find maximum energy cluster
                          if(cell->GetCellAmplitude(absId) > emax) {
                            imax = ipos;
                            emax = cell->GetCellAmplitude(absId);
@@ -1536,7 +1435,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
         
                        }// cluster cell loop
                        
-        // check time of cells respect to max energy cell
+      // check time of cells respect to max energy cell
                        if(nCaloCellsPerCluster > 1){
                          for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
                            if(imax == ipos) continue;
@@ -1548,19 +1447,19 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                          
                        }//check time of cells respect to max energy cell
       
-        //-----------------------------------------------------------
-        //Fill histograms related to single cluster or track matching
-        //-----------------------------------------------------------
+      //-----------------------------------------------------------
+      //Fill histograms related to single cluster or track matching
+      //-----------------------------------------------------------
       
       ClusterHistograms(mom, tof, pos, showerShape, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);     
       
       
-        //-----------------------------------------------------------
-        //Invariant mass
-        //-----------------------------------------------------------
+      //-----------------------------------------------------------
+      //Invariant mass
+      //-----------------------------------------------------------
       if(GetDebug()>1) printf("Invariant mass \n");
       
-        //do not do for bad vertex
+      //do not do for bad vertex
       Float_t fZvtxCut = 40. ; 
       if(v[2]<-fZvtxCut || v[2]> fZvtxCut) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
       
@@ -1572,47 +1471,47 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                        AliVCaloCells  * cell2 = 0x0; 
                                        if(fCalorimeter == "PHOS") cell2 =  GetReader()->GetInputEvent()->GetPHOSCells();
                                        else                               cell2 =  GetReader()->GetInputEvent()->GetEMCALCells();
-            //Check if the cluster contains any bad channel or it is close to calorimeter borders
+          //Check if the cluster contains any bad channel or it is close to calorimeter borders
                                        if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
                                        if(!GetCaloUtils()->CheckCellFiducialRegion(clus2, cell2, GetReader()->GetInputEvent(), 0)) continue;
           
-            //Get cluster kinematics
+          //Get cluster kinematics
                                        clus2->GetMomentum(mom2,v);
-            //Check only certain regions
+          //Check only certain regions
                                        Bool_t in2 = kTRUE;
                                        if(IsFiducialCutOn()) in2 =  GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
                                        if(!in2) continue;      
-            //Get module of cluster
+          //Get module of cluster
                                        nModule2 = GetModuleNumber(clus2);
-            //Cells per cluster
+          //Cells per cluster
                                        nCaloCellsPerCluster2 = clus2->GetNCells();
         }
-          //Fill invariant mass histograms
-          //All modules
+        //Fill invariant mass histograms
+        //All modules
         
-          //printf("QA : Fill inv mass histo: pt1 %f, pt2 %f, pt12 %f, mass %f, calo %s \n",mom.Pt(),mom2.Pt(),(mom+mom2).Pt(),(mom+mom2).M(), fCalorimeter.Data());
+        //printf("QA : Fill inv mass histo: pt1 %f, pt2 %f, pt12 %f, mass %f, calo %s \n",mom.Pt(),mom2.Pt(),(mom+mom2).Pt(),(mom+mom2).M(), fCalorimeter.Data());
                                fhIM  ->Fill((mom+mom2).Pt(),(mom+mom2).M());
-          //Single module
+        //Single module
                                if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
                                  fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
         
-          //Select only clusters with at least 2 cells
+        //Select only clusters with at least 2 cells
                                if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
-            //All modules
+          //All modules
                                  fhIMCellCut  ->Fill((mom+mom2).Pt(),(mom+mom2).M());
-            //Single modules
+          //Single modules
                                  if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
                                    fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
                                }
         
-          //Asymetry histograms
-                               fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
+        //Asymetry histograms
+        if(fFillAllTH12) fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
         
                        }// 2nd cluster loop
                }////more than 1 cluster in calorimeter         
        }//cluster loop
        
-    //Number of clusters per module
+  //Number of clusters per module
        for(Int_t imod = 0; imod < fNModules; imod++ ){ 
                if(GetDebug() > 1) 
                        printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]); 
@@ -1621,9 +1520,9 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        delete [] nClustersInModule;
        delete caloClusters;
   
-    //----------------------------------------------------------
-    // CALOCELLS
-    //----------------------------------------------------------
+  //----------------------------------------------------------
+  // CALOCELLS
+  //----------------------------------------------------------
        
        Int_t *nCellsInModule = new Int_t[fNModules];
        for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
@@ -1658,7 +1557,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
     if(GetDebug() > 2) printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
     
     if(nModule < fNModules) {  
-                               //Check if the cell is a bad channel
+      //Check if the cell is a bad channel
       if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
         if(fCalorimeter=="EMCAL"){
           if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
@@ -1671,7 +1570,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
         }
       }
       
-                               //Get Recalibration factor if set
+      //Get Recalibration factor if set
       if (GetCaloUtils()->IsRecalibrationOn()) {
         if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
         else                          recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
@@ -1681,26 +1580,26 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
       amp     = cell->GetAmplitude(iCell)*recalF;
       time    = cell->GetTime(iCell)*1e9;//transform time to ns
       
-                               //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
-                               //                                                                                 amp,time,nModule,icol,irow);
+      //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
+      //                                                                                  amp,time,nModule,icol,irow);
       
       if(time < fTimeCutMin || time > fTimeCutMax) continue;
       
-                               //printf("%s: time %g\n",fCalorimeter.Data(), time);
+      //printf("%s: time %g\n",fCalorimeter.Data(), time);
       id      = cell->GetCellNumber(iCell);
       fhAmplitude->Fill(amp);
       fhAmpId    ->Fill(amp,id);
       fhTime     ->Fill(time);
       fhTimeId   ->Fill(time,id);
       fhTimeAmp  ->Fill(amp,time);
-                               //Double_t t0 = GetReader()->GetInputEvent()->GetT0();
-                               //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0, 
-                               //         GetReader()->GetInputEvent()->GetT0zVertex(),
-                               //         GetReader()->GetInputEvent()->GetT0clock(),
-                               //         GetReader()->GetInputEvent()->GetT0Trig());
-                               //fhT0Time     ->Fill(time-t0);
-                               //fhT0TimeId   ->Fill(time-t0,id);
-                               //fhT0TimeAmp  ->Fill(amp,time-t0);
+      //Double_t t0 = GetReader()->GetInputEvent()->GetT0();
+      //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0, 
+      //          GetReader()->GetInputEvent()->GetT0zVertex(),
+      //          GetReader()->GetInputEvent()->GetT0clock(),
+      //          GetReader()->GetInputEvent()->GetT0Trig());
+      //fhT0Time     ->Fill(time-t0);
+      //fhT0TimeId   ->Fill(time-t0,id);
+      //fhT0TimeAmp  ->Fill(amp,time-t0);
       
       fhAmplitudeMod[nModule]->Fill(amp);
       if(fCalorimeter=="EMCAL"){
@@ -1713,77 +1612,77 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
       }
       
       fhTimeAmpPerRCU  [nModule*fNRCU+iRCU]->Fill(amp, time);
-                               //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
-                               //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
+      //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
+      //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
       nCellsInModule[nModule]++;
       fhGridCellsMod[nModule]    ->Fill(icol,irow);
       fhGridCellsEMod[nModule]   ->Fill(icol,irow,amp);
       if(amp > 0.3){
         fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
         
-          //                                   AliESDCaloCells * cell2 = 0x0; 
-          //                                   if(fCalorimeter == "PHOS") cell2 =  GetReader()->GetInputEvent()->GetPHOSCells();
-          //                                   else                       cell2 = GetReader()->GetInputEvent()->GetEMCALCells();
-          //                                   Int_t icol2    = -1;
-          //                                   Int_t irow2    = -1;
-          //                                   Int_t iRCU2    = -1;
-          //                                   Float_t amp2   =  0.;
-          //                                   Float_t time2  =  0.;
-          //                                   Int_t id2      = -1;
-          //                                   Int_t nModule2 = -1;
-          //                                   for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {  
-          //                                           amp2    = cell2->GetAmplitude(iCell2);
-          //                                           if(amp2 < 0.3) continue;
-          //                                           if(iCell2 == iCell) continue;
-          //                                           time2    = cell2->GetTime(iCell2)*1e9;//transform time to ns
-          //                                           //printf("%s: time %g\n",fCalorimeter.Data(), time);
-          //                                           id2      = cell2->GetCellNumber(iCell2);
-          //                                           nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
-          //                                           Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule); 
-          //                                           //printf("id %d, nModule %d, iRCU %d, id2 %d, nModule2 %d, iRCU2 %d, index %d: Histo Name %s\n",id, nModule,iRCU,cell2->GetCellNumber(iCell2),nModule2,iRCU2,index, fhTimeCorrRCU[index]->GetName());
-          //                                           fhTimeCorrRCU[index]->Fill(time,time2); 
-          //                                           
-          //                                   }// second cell loop
+        //                                     AliESDCaloCells * cell2 = 0x0; 
+        //                                     if(fCalorimeter == "PHOS") cell2 =  GetReader()->GetInputEvent()->GetPHOSCells();
+        //                                     else                       cell2 = GetReader()->GetInputEvent()->GetEMCALCells();
+        //                                     Int_t icol2    = -1;
+        //                                     Int_t irow2    = -1;
+        //                                     Int_t iRCU2    = -1;
+        //                                     Float_t amp2   =  0.;
+        //                                     Float_t time2  =  0.;
+        //                                     Int_t id2      = -1;
+        //                                     Int_t nModule2 = -1;
+        //                                     for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {  
+        //                                             amp2    = cell2->GetAmplitude(iCell2);
+        //                                             if(amp2 < 0.3) continue;
+        //                                             if(iCell2 == iCell) continue;
+        //                                             time2    = cell2->GetTime(iCell2)*1e9;//transform time to ns
+        //                                             //printf("%s: time %g\n",fCalorimeter.Data(), time);
+        //                                             id2      = cell2->GetCellNumber(iCell2);
+        //                                             nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
+        //                                             Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule); 
+        //                                             //printf("id %d, nModule %d, iRCU %d, id2 %d, nModule2 %d, iRCU2 %d, index %d: Histo Name %s\n",id, nModule,iRCU,cell2->GetCellNumber(iCell2),nModule2,iRCU2,index, fhTimeCorrRCU[index]->GetName());
+        //                                             fhTimeCorrRCU[index]->Fill(time,time2); 
+        //                                             
+        //                                     }// second cell loop
       }// amplitude cut
     }//nmodules
     
-                       //Get Eta-Phi position of Cell
-    if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
-      Float_t celleta = 0.;
-      Float_t cellphi = 0.;
-      GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi); 
-      fhEtaPhiAmp->Fill(celleta,cellphi,amp);
-      
-      Double_t cellpos[] = {0, 0, 0};
-      GetEMCALGeometry()->GetGlobal(id, cellpos);
-      fhXCellE->Fill(cellpos[0],amp)  ; 
-      fhYCellE->Fill(cellpos[1],amp)  ; 
-      fhZCellE->Fill(cellpos[2],amp)  ;
-      Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
-      fhRCellE->Fill(rcell,amp)  ;
-      
-      fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2])  ;
-    }//EMCAL Cells
-    else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
-      TVector3 xyz;
-      Int_t relId[4], module;
-      Float_t xCell, zCell;
-      
-      GetPHOSGeometry()->AbsToRelNumbering(id,relId);
-      module = relId[0];
-      GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
-      GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
-      Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
-      fhXCellE ->Fill(xyz.X(),amp)  ; 
-      fhYCellE ->Fill(xyz.Y(),amp)  ; 
-      fhZCellE ->Fill(xyz.Z(),amp)  ;
-      fhRCellE ->Fill(rcell  ,amp)  ;
-      fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z())  ;
-    }//PHOS cells
-    
+    //Get Eta-Phi position of Cell
+    if(fFillAllPosHisto)
+    {
+      if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
+        Float_t celleta = 0.;
+        Float_t cellphi = 0.;
+        GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi); 
+        fhEtaPhiAmp->Fill(celleta,cellphi,amp);
+        Double_t cellpos[] = {0, 0, 0};
+        GetEMCALGeometry()->GetGlobal(id, cellpos);
+        fhXCellE->Fill(cellpos[0],amp)  ; 
+        fhYCellE->Fill(cellpos[1],amp)  ; 
+        fhZCellE->Fill(cellpos[2],amp)  ;
+        Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
+        fhRCellE->Fill(rcell,amp)  ;
+        fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2])  ;
+      }//EMCAL Cells
+      else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
+        TVector3 xyz;
+        Int_t relId[4], module;
+        Float_t xCell, zCell;
+        
+        GetPHOSGeometry()->AbsToRelNumbering(id,relId);
+        module = relId[0];
+        GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
+        GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
+        Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
+        fhXCellE ->Fill(xyz.X(),amp)  ; 
+        fhYCellE ->Fill(xyz.Y(),amp)  ; 
+        fhZCellE ->Fill(xyz.Z(),amp)  ;
+        fhRCellE ->Fill(rcell  ,amp)  ;
+        fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z())  ;
+      }//PHOS cells
+    }//fill cell position histograms
   }//cell loop
   
-    //Number of cells per module
+  //Number of cells per module
        for(Int_t imod = 0; imod < fNModules; imod++ ) {
                if(GetDebug() > 1) 
                        printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]); 
@@ -1796,12 +1695,12 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
 }
 
 
-  //__________________________________
+//__________________________________
 void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof, Float_t *pos, Float_t *showerShape,
                                             const Int_t nCaloCellsPerCluster,const Int_t nModule,
                                             const Int_t nTracksMatched,  const AliVTrack * track,  
                                             const Int_t * labels, const Int_t nLabels){
-    //Fill CaloCluster related histograms
+  //Fill CaloCluster related histograms
        
        AliAODMCParticle * aodprimary  = 0x0;
        TParticle * primary = 0x0;
@@ -1815,7 +1714,7 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
        if(GetDebug() > 0) {
                printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
                if(IsDataMC()) {
-        //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
+      //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
                        printf("\t Primaries: nlabels %d\n",nLabels);
                        if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
                }
@@ -1823,36 +1722,43 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
   
        fhE     ->Fill(e);      
        if(nModule < fNModules) fhEMod[nModule]->Fill(e);
-       fhPt     ->Fill(pt);
-       fhPhi    ->Fill(phi);
-       fhEta    ->Fill(eta);
+  if(fFillAllTH12){
+    fhPt     ->Fill(pt);
+    fhPhi    ->Fill(phi);
+    fhEta    ->Fill(eta);
+  }
        fhEtaPhiE->Fill(eta,phi,e);
-       fhXE     ->Fill(pos[0],e);
-       fhYE     ->Fill(pos[1],e);
-       fhZE     ->Fill(pos[2],e);
-       fhXYZ    ->Fill(pos[0], pos[1],pos[2]);
-       Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
-       fhRE     ->Fill(rxyz,e);
+  
+  //Cells per cluster
+       fhNCellsPerCluster   ->Fill(e, nCaloCellsPerCluster,eta);
+       fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
+  
+  //Position
+  if(fFillAllPosHisto){
+    fhXE     ->Fill(pos[0],e);
+    fhYE     ->Fill(pos[1],e);
+    fhZE     ->Fill(pos[2],e);
+    fhXYZ    ->Fill(pos[0], pos[1],pos[2]);
+   
+    fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
+    fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
+    fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
+    Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
+    fhRE     ->Fill(rxyz,e);
+    fhRNCells->Fill(rxyz  ,nCaloCellsPerCluster);
+  }
        fhClusterTimeEnergy->Fill(e,tof);
        
-    //Shower shape parameters
+  //Shower shape parameters
        fhLambda->Fill(showerShape[0], showerShape[1], e);
        fhDispersion->Fill(showerShape[2],e);
   
-    //Cells per cluster
-       fhNCellsPerCluster   ->Fill(e, nCaloCellsPerCluster,eta);
-       fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
-       fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
-       fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
-       fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
-       fhRNCells->Fill(rxyz  ,nCaloCellsPerCluster);
-       
        if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
        
-    //Fill histograms only possible when simulation
+  //Fill histograms only possible when simulation
        if(IsDataMC() && nLabels > 0 && labels){
     
-      //Play with the MC stack if available
+    //Play with the MC stack if available
                Int_t label = labels[0];
     
                if(label < 0) {
@@ -1865,7 +1771,7 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
                Int_t charge = 0;       
                
-      //Check the origin.
+    //Check the origin.
                tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
     
                if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
@@ -1889,9 +1795,9 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                                printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
                        }
       
-        //Get final particle, no conversion products
+      //Get final particle, no conversion products
                        if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
-          //Get the parent
+        //Get the parent
                                primary = GetMCStack()->Particle(iParent);
                                pdg = TMath::Abs(primary->GetPdgCode());
                                if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
@@ -1911,7 +1817,7 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
         
                        }
       
-        //Overlapped pi0 (or eta, there will be very few), get the meson
+      //Overlapped pi0 (or eta, there will be very few), get the meson
                        if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) || 
          GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
                                if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
@@ -1924,12 +1830,12 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                                        if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg,  primary->GetName(),iMother);
                                        if(iMother==-1) {
                                                printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
-              //break;
+            //break;
                                        }
                                }
         
                                if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n", 
-                                    primary->GetName(),iMother);
+                                   primary->GetName(),iMother);
                        }
       
                        eMC    = primary->Energy();
@@ -1941,7 +1847,7 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
       
                }
                else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
-                                                                                                                          //Get the list of MC particles
+      //Get the list of MC particles
                        if(!GetReader()->GetAODMCParticles(0))  {
                                printf("AliAnaCalorimeterQA::ClusterHistograms() -  MCParticles not available!\n");
                                abort();
@@ -1959,14 +1865,14 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                        if(GetDebug() > 1 ) {
                                printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
                                printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
-                iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
+               iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
                        }
                        
-        //Get final particle, no conversion products
+      //Get final particle, no conversion products
                        if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
                                if(GetDebug() > 1 ) 
                                        printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
-          //Get the parent
+        //Get the parent
                                aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
                                pdg = TMath::Abs(aodprimary->GetPdgCode());
                                while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
@@ -1977,18 +1883,18 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                                        pdg        = TMath::Abs(aodprimary->GetPdgCode());
                                        if(GetDebug() > 1 )
                                                printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
-                    pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());   
+                   pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());    
                                }       
                                
                                if(GetDebug() > 1 ) {
                                        printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
                                        printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
-                  iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
+                 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
                                }
                                
                        }
       
-        //Overlapped pi0 (or eta, there will be very few), get the meson
+      //Overlapped pi0 (or eta, there will be very few), get the meson
                        if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) || 
          GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
                                if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
@@ -2004,12 +1910,12 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                                        
                                        if(iMother==-1) {
                                                printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
-              //break;
+            //break;
                                        }
                                }       
                                
                                if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n", 
-                                    aodprimary->GetName(),iMother);
+                                   aodprimary->GetName(),iMother);
                        }       
       
                        status = aodprimary->IsPrimary();
@@ -2022,16 +1928,16 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
       
                }
     
-      //Float_t vz = primary->Vz();
+    //Float_t vz = primary->Vz();
                Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
                if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
                        fhEMVxyz   ->Fill(vxMC,vyMC);//,vz);
                        fhEMR      ->Fill(e,rVMC);
                }
     
-      //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
-      //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
-      //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
+    //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
+    //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
+    //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
     
     
                fh2E      ->Fill(e, eMC);
@@ -2048,7 +1954,7 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);                      
     
     
-      //Overlapped pi0 (or eta, there will be very few)
+    //Overlapped pi0 (or eta, there will be very few)
                if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) || 
        GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
       fhPi0E     ->Fill(e,eMC);        
@@ -2127,21 +2033,23 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
        }//Work with MC
   
        
-    //Match tracks and clusters
-    //To be Modified in case of AODs
+  //Match tracks and clusters
+  //To be Modified in case of AODs
        
-    //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
+  //if(ntracksmatched==1 && trackIndex==-1) ntracksmatched=0;
        
        if( nTracksMatched > 0){
-               fhECharged      ->Fill(e);              
-               fhPtCharged     ->Fill(pt);
-               fhPhiCharged    ->Fill(phi);
-               fhEtaCharged    ->Fill(eta);
+    if(fFillAllTH12){
+      fhECharged      ->Fill(e);       
+      fhPtCharged     ->Fill(pt);
+      fhPhiCharged    ->Fill(phi);
+      fhEtaCharged    ->Fill(eta);
+    }
                fhEtaPhiECharged->Fill(eta,phi,e);              
                fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster,eta);
                
-      //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());       
-      //Study the track and matched cluster if track exists.
+    //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks()); 
+    //Study the track and matched cluster if track exists.
                if(!track) return;
                Double_t emcpos[3] = {0.,0.,0.};
                Double_t emcmom[3] = {0.,0.,0.};
@@ -2159,8 +2067,8 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                Int_t nITS   = 0;
                Int_t nTPC   = 0;
                
-      //In case of ESDs get the parameters in this way
-      //               if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
+    //In case of ESDs get the parameters in this way
+    //         if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
     if (track->GetOuterParam() ) {
       okout = kTRUE;
       
@@ -2175,9 +2083,9 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
       teta = position.Eta();
       tmom = momentum.Mag();
       
-                               //Double_t tphi  = track->GetOuterParam()->Phi();
-                               //Double_t teta  = track->GetOuterParam()->Eta();
-                               //Double_t tmom  = track->GetOuterParam()->P();
+      //Double_t tphi  = track->GetOuterParam()->Phi();
+      //Double_t teta  = track->GetOuterParam()->Eta();
+      //Double_t tmom  = track->GetOuterParam()->P();
       tpt       = track->Pt();
       tmom2     = track->P();
       tpcSignal = track->GetTPCsignal();
@@ -2185,29 +2093,29 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
       nITS = track->GetNcls(0);
       nTPC = track->GetNcls(1);
     }//Outer param available 
-     //}// ESDs
-     //                        else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
-     //                                AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
-     //                                if (pid) {
-     //                                        okout = kTRUE;
-     //                                        pid->GetEMCALPosition(emcpos);
-     //                                        pid->GetEMCALMomentum(emcmom);  
-     //                                        
-     //                                        TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
-     //                                        TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
-     //                                        tphi = position.Phi();
-     //                                        teta = position.Eta();
-     //                                        tmom = momentum.Mag();
-     //                                        
-     //                                        tpt       = ((AliAODTrack*)track)->Pt();
-     //                                        tmom2     = ((AliAODTrack*)track)->P();
-     //                                        tpcSignal = pid->GetTPCsignal();
-     //                                
-     //                                        //nITS = ((AliAODTrack*)track)->GetNcls(0);
-     //                                        //nTPC = ((AliAODTrack*)track)->GetNcls(1);
-     //                                }//Outer param available 
-     //                        }//AODs
-     //                        else return; //Do nothing case not implemented.
+    //}// ESDs
+    //                 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
+    //                         AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
+    //                         if (pid) {
+    //                                 okout = kTRUE;
+    //                                 pid->GetEMCALPosition(emcpos);
+    //                                 pid->GetEMCALMomentum(emcmom);  
+    //                                 
+    //                                 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
+    //                                 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
+    //                                 tphi = position.Phi();
+    //                                 teta = position.Eta();
+    //                                 tmom = momentum.Mag();
+    //                                 
+    //                                 tpt       = ((AliAODTrack*)track)->Pt();
+    //                                 tmom2     = ((AliAODTrack*)track)->P();
+    //                                 tpcSignal = pid->GetTPCsignal();
+    //                         
+    //                                 //nITS = ((AliAODTrack*)track)->GetNcls(0);
+    //                                 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
+    //                         }//Outer param available 
+    //                 }//AODs
+    //                 else return; //Do nothing case not implemented.
                
     if(okout){
       Double_t deta = teta - eta;
@@ -2254,15 +2162,15 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
       }
     }
     else{//no ESD external param or AODPid
-         //                                    ULong_t status=AliESDtrack::kTPCrefit;
-         //                            status|=AliESDtrack::kITSrefit;
-         //printf("track status %d\n", track->GetStatus() );
-         //                            fhEChargedNoOut      ->Fill(e);         
-         //                            fhPtChargedNoOut     ->Fill(pt);
-         //                            fhPhiChargedNoOut    ->Fill(phi);
-         //                            fhEtaChargedNoOut    ->Fill(eta);
-         //                            fhEtaPhiChargedNoOut ->Fill(eta,phi);
-         //                            if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
+      //                                       ULong_t status=AliESDtrack::kTPCrefit;
+      //                               status|=AliESDtrack::kITSrefit;
+      //printf("track status %d\n", track->GetStatus() );
+      //                               fhEChargedNoOut      ->Fill(e);         
+      //                               fhPtChargedNoOut     ->Fill(pt);
+      //                               fhPhiChargedNoOut    ->Fill(phi);
+      //                               fhEtaChargedNoOut    ->Fill(eta);
+      //                               fhEtaPhiChargedNoOut ->Fill(eta,phi);
+      //                               if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
       if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
       
     }//No out params
@@ -2270,13 +2178,13 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
   
 }// Clusters
 
-  //__________________________________
+//__________________________________
 void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
-    // Correlate information from PHOS and EMCAL
+  // Correlate information from PHOS and EMCAL
        TRefArray * caloClustersEMCAL = 0;
        TRefArray * caloClustersPHOS  = 0;
        
-    // Get once the array of clusters per calorimeter, avoid an extra loop.
+  // Get once the array of clusters per calorimeter, avoid an extra loop.
   if(fCalorimeter == "EMCAL"){ 
     caloClustersPHOS = new TRefArray();
     GetReader()->GetInputEvent()->GetPHOSClusters(caloClustersPHOS);
@@ -2288,7 +2196,7 @@ void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
     caloClustersPHOS = new TRefArray(*refArray);
   }
   
-               //Fill histograms with clusters
+  //Fill histograms with clusters
   
   fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
   Float_t sumClusterEnergyEMCAL = 0;
@@ -2300,7 +2208,7 @@ void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
     sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
   fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
   
-               //Fill histograms with cells
+  //Fill histograms with cells
   
   AliVCaloCells * cellsEMCAL = GetReader()->GetInputEvent()->GetEMCALCells();
   AliVCaloCells * cellsPHOS  = GetReader()->GetInputEvent()->GetPHOSCells();
@@ -2317,9 +2225,9 @@ void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
   if(GetDebug() > 0 ){
     printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
     printf("\t EMCAL: N cells %d, N clusters  %d, summed E cells %f, summed E clusters %f \n",
-            cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
+           cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
     printf("\t PHOS : N cells %d, N clusters  %d, summed E cells %f, summed E clusters %f \n",
-            cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
+           cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
   }
        
        delete caloClustersEMCAL;
@@ -2327,9 +2235,9 @@ void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
        
 }
 
-  //______________________________________________________________________________
+//______________________________________________________________________________
 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
-    //Fill pure monte carlo related histograms
+  //Fill pure monte carlo related histograms
        
        Float_t eMC    = mom.E();
        Float_t ptMC   = mom.Pt();
@@ -2383,41 +2291,38 @@ void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg
        
 }
 
-  //________________________________________________________________________
+//________________________________________________________________________
 void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
 {
-    // Needed when Terminate is executed in distributed environment
-    // Refill analysis histograms of this class with corresponding histograms in output list. 
+  // Needed when Terminate is executed in distributed environment
+  // Refill analysis histograms of this class with corresponding histograms in output list. 
        
-    // Histograms of this analsys are kept in the same list as other analysis, recover the position of
-    // the first one and then add the next 
+  // Histograms of this analsys are kept in the same list as other analysis, recover the position of
+  // the first one and then add the next 
        Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
-    //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
+  //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
        
-    //Read histograms, must be in the same order as in GetCreateOutputObject.
+  //Read histograms, must be in the same order as in GetCreateOutputObject.
        fhE       = (TH1F *) outputList->At(index++);   
-       fhPt      = (TH1F *) outputList->At(index++); 
-       fhPhi     = (TH1F *) outputList->At(index++); 
-       fhEta     = (TH1F *) outputList->At(index++);
+  if(fFillAllTH12){
+    fhPt      = (TH1F *) outputList->At(index++); 
+    fhPhi     = (TH1F *) outputList->At(index++); 
+    fhEta     = (TH1F *) outputList->At(index++);
+  }
        fhEtaPhiE = (TH3F *) outputList->At(index++);
-       
+  
        fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
        
        fhLambda      = (TH3F *)  outputList->At(index++);
        fhDispersion  = (TH2F *)  outputList->At(index++);
-       
-       fhECharged       = (TH1F *) outputList->At(index++);    
-       fhPtCharged      = (TH1F *) outputList->At(index++); 
-       fhPhiCharged     = (TH1F *) outputList->At(index++); 
-       fhEtaCharged     = (TH1F *) outputList->At(index++);
+  if(fFillAllTH12){
+    fhECharged       = (TH1F *) outputList->At(index++);       
+    fhPtCharged      = (TH1F *) outputList->At(index++); 
+    fhPhiCharged     = (TH1F *) outputList->At(index++); 
+    fhEtaCharged     = (TH1F *) outputList->At(index++);
+  }
        fhEtaPhiECharged = (TH3F *) outputList->At(index++);
        
-    // fhEChargedNoOut      = (TH1F *) outputList->At(index++);        
-    // fhPtChargedNoOut     = (TH1F *) outputList->At(index++); 
-    // fhPhiChargedNoOut    = (TH1F *) outputList->At(index++); 
-    // fhEtaChargedNoOut    = (TH1F *) outputList->At(index++);
-    // fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
-  
        fh1pOverE =    (TH2F *) outputList->At(index++);
        fh1dR =        (TH1F *) outputList->At(index++);
        fh2MatchdEdx = (TH2F *) outputList->At(index++);
@@ -2426,38 +2331,39 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
        
        fhIM        = (TH2F *) outputList->At(index++);
        fhIMCellCut = (TH2F *) outputList->At(index++);
-       fhAsym      = (TH2F *) outputList->At(index++);
+  if(fFillAllTH12) fhAsym      = (TH2F *) outputList->At(index++);
        
        fhNCellsPerCluster           = (TH3F *) outputList->At(index++);
        fhNCellsPerClusterMIP        = (TH3F *) outputList->At(index++);
        fhNCellsPerClusterMIPCharged = (TH3F *) outputList->At(index++);
        fhNClusters  = (TH1F *) outputList->At(index++); 
-       
-       fhRNCells = (TH2F *) outputList->At(index++);
-       fhXNCells = (TH2F *) outputList->At(index++);
-       fhYNCells = (TH2F *) outputList->At(index++);
-       fhZNCells = (TH2F *) outputList->At(index++);
-       fhRE      = (TH2F *) outputList->At(index++);
-       fhXE      = (TH2F *) outputList->At(index++);
-       fhYE      = (TH2F *) outputList->At(index++);
-       fhZE      = (TH2F *) outputList->At(index++); 
-       fhXYZ     = (TH3F *) outputList->At(index++); 
-       
-       fhRCellE          = (TH2F *) outputList->At(index++);
-       fhXCellE          = (TH2F *) outputList->At(index++);
-       fhYCellE          = (TH2F *) outputList->At(index++);
-       fhZCellE          = (TH2F *) outputList->At(index++); 
-       fhXYZCell         = (TH3F *) outputList->At(index++); 
-       fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
-       fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
-       fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
-       fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
-       fhDeltaCellClusterRE      = (TH2F *) outputList->At(index++);
-       fhDeltaCellClusterXE      = (TH2F *) outputList->At(index++);
-       fhDeltaCellClusterYE      = (TH2F *) outputList->At(index++);
-       fhDeltaCellClusterZE      = (TH2F *) outputList->At(index++); 
-       fhEtaPhiAmp               = (TH3F *) outputList->At(index++); 
-       
+  
+  if(fFillAllPosHisto){
+    fhRNCells = (TH2F *) outputList->At(index++);
+    fhXNCells = (TH2F *) outputList->At(index++);
+    fhYNCells = (TH2F *) outputList->At(index++);
+    fhZNCells = (TH2F *) outputList->At(index++);
+    fhRE         = (TH2F *) outputList->At(index++);
+    fhXE         = (TH2F *) outputList->At(index++);
+    fhYE         = (TH2F *) outputList->At(index++);
+    fhZE         = (TH2F *) outputList->At(index++); 
+    fhXYZ        = (TH3F *) outputList->At(index++); 
+    fhRCellE     = (TH2F *) outputList->At(index++);
+    fhXCellE     = (TH2F *) outputList->At(index++);
+    fhYCellE     = (TH2F *) outputList->At(index++);
+    fhZCellE     = (TH2F *) outputList->At(index++); 
+    fhXYZCell    = (TH3F *) outputList->At(index++); 
+    fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
+    fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
+    fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
+    fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
+    fhDeltaCellClusterRE         = (TH2F *) outputList->At(index++);
+    fhDeltaCellClusterXE         = (TH2F *) outputList->At(index++);
+    fhDeltaCellClusterYE         = (TH2F *) outputList->At(index++);
+    fhDeltaCellClusterZE         = (TH2F *) outputList->At(index++); 
+    fhEtaPhiAmp               = (TH3F *) outputList->At(index++); 
+       }
+  
        fhNCells     = (TH1F *) outputList->At(index++); 
        fhAmplitude  = (TH1F *) outputList->At(index++); 
        fhAmpId      = (TH2F *) outputList->At(index++); 
@@ -2471,9 +2377,9 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
                fhTimeId     = (TH2F *) outputList->At(index++); 
                fhTimeAmp    = (TH2F *) outputList->At(index++); 
                
-      //               fhT0Time       = (TH1F *) outputList->At(index++); 
-      //               fhT0TimeId     = (TH2F *) outputList->At(index++); 
-      //               fhT0TimeAmp    = (TH2F *) outputList->At(index++); 
+    //         fhT0Time       = (TH1F *) outputList->At(index++); 
+    //         fhT0TimeId     = (TH2F *) outputList->At(index++); 
+    //         fhT0TimeAmp    = (TH2F *) outputList->At(index++); 
                
        }
        
@@ -2485,7 +2391,7 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
                fhCaloCorrECells    = (TH2F *) outputList->At(index++); 
        }
        
-    //Module histograms
+  //Module histograms
        fhEMod                 = new TH1F*[fNModules];
        fhNClustersMod         = new TH1F*[fNModules];
        fhNCellsPerClusterMod  = new TH2F*[fNModules];
@@ -2498,7 +2404,7 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
        if(fCalorimeter=="EMCAL")
                fhAmplitudeModFraction = new TH1F*[fNModules*3];
        
-    //EMCAL
+  //EMCAL
        fhTimeAmpPerRCU        = new TH2F*[fNModules*fNRCU];
        
        fhIMMod                = new TH2F*[fNModules];
@@ -2523,12 +2429,12 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
                
                for(Int_t ircu = 0; ircu < fNRCU; ircu++){
                        fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++); 
-        //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++); 
-        //                     for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
-        //                             for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
-        //                                     fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2]  = (TH2F *) outputList->At(index++);
-        //                             }
-        //                     }
+      //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++); 
+      //                       for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
+      //                               for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
+      //                                       fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2]  = (TH2F *) outputList->At(index++);
+      //                               }
+      //                       }
                }
                fhIMMod[imod]                = (TH2F *) outputList->At(index++); 
                fhIMCellCutMod[imod]         = (TH2F *) outputList->At(index++);        
@@ -2611,8 +2517,8 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
                fhChHadPhiCharged   = (TH2F *) outputList->At(index++); 
                fhChHadEtaCharged   = (TH2F *) outputList->At(index++);                                 
                
-      //               fhEMVxyz     = (TH3F *) outputList->At(index++); 
-      //               fhHaVxyz     = (TH3F *) outputList->At(index++); 
+    //         fhEMVxyz     = (TH3F *) outputList->At(index++); 
+    //         fhHaVxyz     = (TH3F *) outputList->At(index++); 
                
                fhEMVxyz     = (TH2F *) outputList->At(index++); 
                fhHaVxyz     = (TH2F *) outputList->At(index++); 
@@ -2667,54 +2573,54 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
        }
 }
 
-  //__________________________________________________________________
+//__________________________________________________________________
 void  AliAnaCalorimeterQA::Terminate(TList* outputList) 
 {
-    //Do plots if requested    
+  //Do plots if requested      
   
        if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
        if(!fMakePlots) return;
        
-    //Do some plots to end
+  //Do some plots to end
   if(fStyleMacro!="")gROOT->Macro(fStyleMacro); 
-    //Recover histograms from output histograms list, needed for distributed analysis. 
+  //Recover histograms from output histograms list, needed for distributed analysis.   
        ReadHistograms(outputList);
        
-    //printf(" AliAnaCalorimeterQA::Terminate()  *** %s Report:", GetName()) ; 
-    //printf(" AliAnaCalorimeterQA::Terminate()        pt         : %5.3f , RMS : %5.3f \n", fhPt->GetMean(),   fhPt->GetRMS() ) ;
+  //printf(" AliAnaCalorimeterQA::Terminate()  *** %s Report:", GetName()) ; 
+  //printf(" AliAnaCalorimeterQA::Terminate()        pt         : %5.3f , RMS : %5.3f \n", fhPt->GetMean(),   fhPt->GetRMS() ) ;
   
        char name[128];
        char cname[128];
        
-    //In case terminate is executed after the analysis, in a second step, and we want to rebin or to change the range of the histograms for plotting
+  //In case terminate is executed after the analysis, in a second step, and we want to rebin or to change the range of the histograms for plotting
        Int_t nptbins     = GetHistoPtBins();           Float_t ptmax     = GetHistoPtMax();           Float_t ptmin     = GetHistoPtMin();
        Int_t nphibins    = GetHistoPhiBins();          Float_t phimax    = GetHistoPhiMax();          Float_t phimin    = GetHistoPhiMin();
        Int_t netabins    = GetHistoEtaBins();          Float_t etamax    = GetHistoEtaMax();          Float_t etamin    = GetHistoEtaMin();    
-    // Int_t nmassbins   = GetHistoMassBins();         Float_t massmax   = GetHistoMassMax();         Float_t massmin   = GetHistoMassMin();
-    // Int_t nasymbins   = GetHistoAsymmetryBins();    Float_t asymmax   = GetHistoAsymmetryMax();    Float_t asymmin   = GetHistoAsymmetryMin();
-    // Int_t nPoverEbins = GetHistoPOverEBins();       Float_t pOverEmax = GetHistoPOverEMax();       Float_t pOverEmin = GetHistoPOverEMin();
-    // Int_t ndedxbins   = GetHistodEdxBins();         Float_t dedxmax   = GetHistodEdxMax();         Float_t dedxmin   = GetHistodEdxMin();
-    // Int_t ndRbins     = GetHistodRBins();           Float_t dRmax     = GetHistodRMax();           Float_t dRmin     = GetHistodRMin();
+  //   Int_t nmassbins   = GetHistoMassBins();         Float_t massmax   = GetHistoMassMax();         Float_t massmin   = GetHistoMassMin();
+  //   Int_t nasymbins   = GetHistoAsymmetryBins();    Float_t asymmax   = GetHistoAsymmetryMax();    Float_t asymmin   = GetHistoAsymmetryMin();
+  //   Int_t nPoverEbins = GetHistoPOverEBins();       Float_t pOverEmax = GetHistoPOverEMax();       Float_t pOverEmin = GetHistoPOverEMin();
+  //   Int_t ndedxbins   = GetHistodEdxBins();         Float_t dedxmax   = GetHistodEdxMax();         Float_t dedxmin   = GetHistodEdxMin();
+  //   Int_t ndRbins     = GetHistodRBins();           Float_t dRmax     = GetHistodRMax();           Float_t dRmin     = GetHistodRMin();
        Int_t ntimebins   = GetHistoTimeBins();         Float_t timemax   = GetHistoTimeMax();         Float_t timemin   = GetHistoTimeMin();       
        Int_t nbins       = GetHistoNClusterCellBins(); Int_t nmax        = GetHistoNClusterCellMax(); Int_t nmin        = GetHistoNClusterCellMin(); 
-    // Int_t nratiobins  = GetHistoRatioBins();        Float_t ratiomax  = GetHistoRatioMax();        Float_t ratiomin  = GetHistoRatioMin();
-    // Int_t nvdistbins  = GetHistoVertexDistBins();   Float_t vdistmax  = GetHistoVertexDistMax();   Float_t vdistmin  = GetHistoVertexDistMin();
+  //   Int_t nratiobins  = GetHistoRatioBins();        Float_t ratiomax  = GetHistoRatioMax();        Float_t ratiomin  = GetHistoRatioMin();
+  //   Int_t nvdistbins  = GetHistoVertexDistBins();   Float_t vdistmax  = GetHistoVertexDistMax();   Float_t vdistmin  = GetHistoVertexDistMin();
        Int_t rbins       = GetHistoRBins();            Float_t rmax        = GetHistoRMax();          Float_t rmin      = GetHistoRMin(); 
        Int_t xbins       = GetHistoXBins();            Float_t xmax        = GetHistoXMax();          Float_t xmin      = GetHistoXMin(); 
        Int_t ybins       = GetHistoYBins();            Float_t ymax        = GetHistoYMax();          Float_t ymin      = GetHistoYMin(); 
        Int_t zbins       = GetHistoZBins();            Float_t zmax        = GetHistoZMax();          Float_t zmin      = GetHistoZMin(); 
        
-    //Color code for the different modules
+  //Color code for the different modules
        Int_t modColorIndex[]={2,4,6,8};
        
-    //--------------------------------------------------
-    // Cluster energy distributions, module dependence
-    //--------------------------------------------------
+  //--------------------------------------------------
+  // Cluster energy distributions, module dependence
+  //--------------------------------------------------
        sprintf(cname,"QA_%s_ClusterEnergy",fCalorimeter.Data());
        TCanvas  * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
        c->Divide(2, 1);
        Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
-    //printf("new E rb %d\n",rbE);
+  //printf("new E rb %d\n",rbE);
        fhE->Rebin(rbE);
        fhE->SetAxisRange(ptmin,ptmax,"X");
        c->cd(1) ; 
@@ -2736,7 +2642,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        }
        pLegendE.Draw();
        
-    //Ratio of modules
+  //Ratio of modules
        c->cd(2) ; 
        TLegend pLegendER(0.55,0.8,0.9,0.9);
        pLegendER.SetTextSize(0.03);
@@ -2765,15 +2671,15 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        sprintf(name,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
        c->Print(name); printf("Plot: %s\n",name);
        
-    //--------------------------------------------------
-    // Cell energy distributions, module dependence
-    //--------------------------------------------------
+  //--------------------------------------------------
+  // Cell energy distributions, module dependence
+  //--------------------------------------------------
        sprintf(cname,"%s_QA_CellEnergy",fCalorimeter.Data());
        TCanvas  * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
        ca->Divide(2, 1);
        
        Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
-    //printf("new Amp rb %d\n",rbAmp);
+  //printf("new Amp rb %d\n",rbAmp);
        fhAmplitude->Rebin(rbAmp);
        fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
        
@@ -2823,12 +2729,12 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        sprintf(name,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
        ca->Print(name); printf("Plot: %s\n",name);     
   
-    //----------------------------------------------------------
-    // Cell energy distributions, FRACTION of module dependence
-    // See Super Module calibration difference
-    //---------------------------------------------------------        
+  //----------------------------------------------------------
+  // Cell energy distributions, FRACTION of module dependence
+  // See Super Module calibration difference
+  //---------------------------------------------------------  
        if(fCalorimeter=="EMCAL"){
-      //Close To Eta 0 
+    //Close To Eta 0 
                sprintf(cname,"%s_QA_SMThirds",fCalorimeter.Data());
                TCanvas  * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
                cfrac->Divide(2, 3);
@@ -2854,7 +2760,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                }
                hAverageThird1 ->Scale(1./fNModules);
                pLegend1.Draw();
-      //Ratio
+    //Ratio
                cfrac->cd(2) ; 
                for(Int_t imod = 0; imod < fNModules; imod++){
                        Int_t ifrac = 0;
@@ -2871,9 +2777,9 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                        }
                        else htmp -> Draw("same HE");
                }
-      //pLegend1.Draw();
+    //pLegend1.Draw();
                
-      //Middle Eta
+    //Middle Eta
                cfrac->cd(3) ; 
                if(fhAmplitude->GetEntries() > 0) 
                        gPad->SetLogy();
@@ -2898,7 +2804,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                hAverageThird2->Scale(1./fNModules);
                pLegend2.Draw();
                
-      //Ratio
+    //Ratio
                cfrac->cd(4) ; 
                
                for(Int_t imod = 0; imod < fNModules; imod++){
@@ -2915,9 +2821,9 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                        }
                        else htmp -> Draw("same HE");
                }
-      //pLegend2.Draw();
+    //pLegend2.Draw();
                
-      //Close To Eta 0.7 
+    //Close To Eta 0.7 
                cfrac->cd(5) ; 
                if(fhAmplitude->GetEntries() > 0) 
                        gPad->SetLogy();
@@ -2960,16 +2866,16 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                        }
                        else htmp ->Draw("same HE");
                }
-      //pLegend3.Draw();
+    //pLegend3.Draw();
                
                sprintf(name,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
                cfrac->Print(name); printf("Create plot %s\n",name);
        }//EMCAL        
        
        
-    //----------------------------------------------------------
-    // Cluster eta and phi distributions, energy cut dependence
-    //---------------------------------------------------------        
+  //----------------------------------------------------------
+  // Cluster eta and phi distributions, energy cut dependence
+  //---------------------------------------------------------  
        
        sprintf(cname,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
        TCanvas  * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
@@ -2982,7 +2888,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        Int_t   ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
        TH1D * hE = fhEtaPhiE->ProjectionZ();
        
-    //PHI
+  //PHI
        cetaphic->cd(1) ; 
        gPad->SetLogy();
        gPad->SetGridy();
@@ -2996,7 +2902,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        if(htmp){
          htmp->SetMinimum(1);
          rbPhi =  GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
-      //printf("new Phi rb %d\n",rbPhi);
+    //printf("new Phi rb %d\n",rbPhi);
          htmp->Rebin(rbPhi);
          htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
          htmp->SetAxisRange(phimin,phimax,"X");
@@ -3005,7 +2911,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     
          for (Int_t i = 0; i < ncuts; i++) {
            binmin =  hE->FindBin(ecut[i]);
-        //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
+      //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
            htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
            htmp->SetLineColor(ecutcolor[i]);
            htmp->Rebin(rbPhi);
@@ -3016,7 +2922,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        }
        pLegendPhiCl.Draw();
        
-    //ETA
+  //ETA
        cetaphic->cd(2) ; 
        gPad->SetLogy();
        gPad->SetGridy();
@@ -3024,7 +2930,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
        htmp ->SetLineColor(1);
        rbEta =  GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
-    //printf("new Eta rb %d\n",rbEta);
+  //printf("new Eta rb %d\n",rbEta);
        if(htmp){
          htmp->Rebin(rbEta);
          htmp->SetMinimum(1);
@@ -3034,14 +2940,14 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
          
          for (Int_t i = 0; i < ncuts; i++) {
            binmin =  hE->FindBin(ecut[i]);
-        //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
+      //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
            htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
            htmp->SetLineColor(ecutcolor[i]);
            htmp->Rebin(rbEta);
            htmp->Draw("same HE");      
          }
        }
-    //ETA vs PHI       
+  //ETA vs PHI 
        cetaphic->cd(3) ;
        TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
        hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
@@ -3051,15 +2957,15 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        sprintf(name,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
        cetaphic->Print(name); printf("Create plot %s\n",name);
   
-    //----------------------------------------------------------
-    // Cell eta and phi distributions, energy cut dependence
-    //---------------------------------------------------------        
+  //----------------------------------------------------------
+  // Cell eta and phi distributions, energy cut dependence
+  //---------------------------------------------------------  
        
        sprintf(cname,"%s_QA_EtaPhiCell",fCalorimeter.Data());
        TCanvas  * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
        cetaphicell->Divide(3, 1);
        
-    //PHI
+  //PHI
        cetaphicell->cd(1) ; 
        gPad->SetLogy();
        gPad->SetGridy();
@@ -3080,7 +2986,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
          
          for (Int_t i = 0; i < ncuts; i++) {
            binmin =  hE->FindBin(ecut[i]);
-        //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
+      //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
            htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
            htmp->SetLineColor(ecutcolor[i]);
            htmp->Rebin(rbPhi);
@@ -3091,7 +2997,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        }
        pLegendPhiCell.Draw();
        
-    //ETA
+  //ETA
        cetaphicell->cd(2) ; 
        gPad->SetLogy();
        gPad->SetGridy();
@@ -3107,7 +3013,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
          
          for (Int_t i = 0; i < ncuts; i++) {
            binmin =  hE->FindBin(ecut[i]);
-        //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
+      //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
            htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
            htmp->SetLineColor(ecutcolor[i]);
            htmp->Rebin(rbEta);
@@ -3115,7 +3021,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
            
          }
        }
-    //ETA vs PHI       
+  //ETA vs PHI 
        cetaphicell->cd(3) ;
        TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
        hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
@@ -3125,766 +3031,772 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        sprintf(name,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
        cetaphicell->Print(name); printf("Create plot %s\n",name);
        
-    ////////////////////////////////////////        
-    ///////// Global Positions /////////////       
-    ////////////////////////////////////////       
-       
-    //CLUSTERS
-       sprintf(cname,"%s_QA_ClusterXY",fCalorimeter.Data());
-       TCanvas  * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
-       cxyz->Divide(3, 1);
-       
-       cxyz->cd(1) ; 
-       TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
-       hXY->SetTitle("Cluster X vs Y");
-       hXY->GetYaxis()->SetTitleOffset(1.6);
-       hXY->Draw("colz");
-       cxyz->cd(2) ; 
-       TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
-       hYZ->SetTitle("Cluster Z vs Y");
-       hYZ->GetYaxis()->SetTitleOffset(1.6);
-       hYZ->Draw("colz");      
-       cxyz->cd(3) ; 
-       TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
-       hXZ->SetTitle("Cluster X vs Z");
-       hXZ->GetYaxis()->SetTitleOffset(1.6);
-       hXZ->Draw("colz");
-       
-       sprintf(name,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
-       cxyz->Print(name); printf("Create plot %s\n",name);
-       
-       Int_t rbX = 1;
-       Int_t rbY = 1;
-       Int_t rbZ = 1;
-       
-       sprintf(cname,"QA_%s_ClusterX",fCalorimeter.Data());
-       TCanvas  * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
-       cx->Divide(3, 1);
   
-       cx->cd(1) ; 
-       TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
+  ////////////////////////////////////////        
+  ///////// Global Positions /////////////       
+  ////////////////////////////////////////       
+       
+  //CLUSTERS
+  if(fFillAllPosHisto){
+    sprintf(cname,"%s_QA_ClusterXY",fCalorimeter.Data());
+    TCanvas  * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
+    cxyz->Divide(3, 1);
+    
+    cxyz->cd(1) ; 
+    TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
+    hXY->SetTitle("Cluster X vs Y");
+    hXY->GetYaxis()->SetTitleOffset(1.6);
+    hXY->Draw("colz");
+    cxyz->cd(2) ; 
+    TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
+    hYZ->SetTitle("Cluster Z vs Y");
+    hYZ->GetYaxis()->SetTitleOffset(1.6);
+    hYZ->Draw("colz"); 
+    cxyz->cd(3) ; 
+    TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
+    hXZ->SetTitle("Cluster X vs Z");
+    hXZ->GetYaxis()->SetTitleOffset(1.6);
+    hXZ->Draw("colz");
+    
+    sprintf(name,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
+    cxyz->Print(name); printf("Create plot %s\n",name);
+    
+    Int_t rbX = 1;
+    Int_t rbY = 1;
+    Int_t rbZ = 1;
+    
+    sprintf(cname,"QA_%s_ClusterX",fCalorimeter.Data());
+    TCanvas  * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
+    cx->Divide(3, 1);
+    
+    cx->cd(1) ; 
+    TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
     //gPad->SetLogy();
-       gPad->SetGridy();
-       hX->SetTitle("Cluster X ");
-       hX->Draw("HE");
-       rbX =  GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
+    gPad->SetGridy();
+    hX->SetTitle("Cluster X ");
+    hX->Draw("HE");
+    rbX =  GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
     //printf("new X rb %d\n",rbX);
-       hX->Rebin(rbX);
-       hX->SetMinimum(hX->GetMaximum()/2);
-       hX->SetAxisRange(xmin,xmax);
-  
-       cx->cd(2) ; 
-       TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
+    hX->Rebin(rbX);
+    hX->SetMinimum(hX->GetMaximum()/2);
+    hX->SetAxisRange(xmin,xmax);
+    
+    cx->cd(2) ; 
+    TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
     //gPad->SetLogy();
-       hY->SetTitle("Cluster Y ");
-       rbY =  GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
+    hY->SetTitle("Cluster Y ");
+    rbY =  GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
     //printf("new Y rb %d\n",rbY);
-       hY->Rebin(rbY);
-       hY->SetMinimum(1);
-       hY->SetAxisRange(ymin,ymax);
-       hY->Draw("HE"); 
-       
-       cx->cd(3) ; 
-       TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
+    hY->Rebin(rbY);
+    hY->SetMinimum(1);
+    hY->SetAxisRange(ymin,ymax);
+    hY->Draw("HE");    
+    
+    cx->cd(3) ; 
+    TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
     //gPad->SetLogy();
-       gPad->SetGridy();
-       rbZ =  GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
+    gPad->SetGridy();
+    rbZ =  GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
     //printf("new Z rb %d\n",rbZ);
-       hZ->Rebin(rbZ); 
-       hZ->SetMinimum(hZ->GetMaximum()/2);
-       hZ->SetAxisRange(zmin,zmax);
-       hZ->Draw("HE");
-       
-       sprintf(name,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
-       cx->Print(name); printf("Create plot %s\n",name);
-  
+    hZ->Rebin(rbZ);    
+    hZ->SetMinimum(hZ->GetMaximum()/2);
+    hZ->SetAxisRange(zmin,zmax);
+    hZ->Draw("HE");
+    
+    sprintf(name,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
+    cx->Print(name); printf("Create plot %s\n",name);
+    
     //CELLS
-       
-       sprintf(cname,"%s_QA_CellXY",fCalorimeter.Data());
-       TCanvas  * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
-       cellxyz->Divide(3, 1);
-       
-       cellxyz->cd(1) ; 
-       TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
-       hXYCell->SetTitle("Cell X vs Y");
-       hXYCell->GetYaxis()->SetTitleOffset(1.6);
-       hXYCell->Draw("colz");
-       cellxyz->cd(2) ; 
-       TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
-       hYZCell->SetTitle("Cell Z vs Y");
-       hYZCell->GetYaxis()->SetTitleOffset(1.6);
-       hYZCell->Draw("colz");  
-       cellxyz->cd(3) ; 
-       TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
-       hXZCell->SetTitle("Cell X vs Z");
-       hXZCell->GetYaxis()->SetTitleOffset(1.6);
-       hXZCell->Draw("colz");
-  
-       sprintf(name,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
-       cellxyz->Print(name); printf("Create plot %s\n",name);
-       
-       
-       sprintf(cname,"%s_QA_CellX",fCalorimeter.Data());
-       TCanvas  * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
-       cellx->Divide(3, 1);
-       
-       cellx->cd(1) ; 
-       TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
+    
+    sprintf(cname,"%s_QA_CellXY",fCalorimeter.Data());
+    TCanvas  * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
+    cellxyz->Divide(3, 1);
+    
+    cellxyz->cd(1) ; 
+    TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
+    hXYCell->SetTitle("Cell X vs Y");
+    hXYCell->GetYaxis()->SetTitleOffset(1.6);
+    hXYCell->Draw("colz");
+    cellxyz->cd(2) ; 
+    TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
+    hYZCell->SetTitle("Cell Z vs Y");
+    hYZCell->GetYaxis()->SetTitleOffset(1.6);
+    hYZCell->Draw("colz");     
+    cellxyz->cd(3) ; 
+    TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
+    hXZCell->SetTitle("Cell X vs Z");
+    hXZCell->GetYaxis()->SetTitleOffset(1.6);
+    hXZCell->Draw("colz");
+    
+    sprintf(name,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
+    cellxyz->Print(name); printf("Create plot %s\n",name);
+    
+    
+    sprintf(cname,"%s_QA_CellX",fCalorimeter.Data());
+    TCanvas  * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
+    cellx->Divide(3, 1);
+    
+    cellx->cd(1) ; 
+    TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
     //gPad->SetLogy();
-       gPad->SetGridy();
-       hXCell->SetTitle("Cell X ");
-       hXCell->Rebin(rbX);
-       hXCell->SetMinimum(hXCell->GetMaximum()/2);
-       hXCell->SetAxisRange(xmin,xmax);
-       hXCell->Draw("HE");
-  
-       cellx->cd(2) ; 
-       TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
+    gPad->SetGridy();
+    hXCell->SetTitle("Cell X ");
+    hXCell->Rebin(rbX);
+    hXCell->SetMinimum(hXCell->GetMaximum()/2);
+    hXCell->SetAxisRange(xmin,xmax);
+    hXCell->Draw("HE");
+    
+    cellx->cd(2) ; 
+    TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
     //gPad->SetLogy();
-       hYCell->SetTitle("Cell Y ");
-       hYCell->Rebin(rbY);
-       hYCell->SetAxisRange(ymin,ymax);
-       hYCell->SetMinimum(1);
-       hYCell->Draw("HE");     
-       
-       cellx->cd(3) ; 
-       TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
+    hYCell->SetTitle("Cell Y ");
+    hYCell->Rebin(rbY);
+    hYCell->SetAxisRange(ymin,ymax);
+    hYCell->SetMinimum(1);
+    hYCell->Draw("HE");        
+    
+    cellx->cd(3) ; 
+    TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
     //gPad->SetLogy();
-       gPad->SetGridy();
-       hZCell->SetAxisRange(zmin,zmax);
-       hZCell->SetTitle("Cell Z ");
-       hZCell->Rebin(rbZ);
-       hZCell->SetMinimum(hZCell->GetMaximum()/2);
-       hZCell->Draw("HE");
-       
-       sprintf(name,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
-       cellx->Print(name); printf("Create plot %s\n",name);
-  
-       
+    gPad->SetGridy();
+    hZCell->SetAxisRange(zmin,zmax);
+    hZCell->SetTitle("Cell Z ");
+    hZCell->Rebin(rbZ);
+    hZCell->SetMinimum(hZCell->GetMaximum()/2);
+    hZCell->Draw("HE");
+    
+    sprintf(name,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
+    cellx->Print(name); printf("Create plot %s\n",name);
+    
+    
     //----------------------------------------------------------
     // Cluster X, Y, Z, R, energy cut dependence
     //---------------------------------------------------------        
-       
-       sprintf(cname,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
-       TCanvas  * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
-       cxe->Divide(2, 2);              
+    
+    sprintf(cname,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
+    TCanvas  * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
+    cxe->Divide(2, 2);         
     //R
-       cxe->cd(1) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       TLegend pLegendXCl(0.83,0.6,0.95,0.93);
-       pLegendXCl.SetTextSize(0.03);
-       pLegendXCl.SetFillColor(10);
-       pLegendXCl.SetBorderSize(1);
-       
-       htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
-       Int_t rbR=1;
-       if(htmp){
-         htmp->SetMinimum(1);
-         rbR =  GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
+    cxe->cd(1) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    TLegend pLegendXCl(0.83,0.6,0.95,0.93);
+    pLegendXCl.SetTextSize(0.03);
+    pLegendXCl.SetFillColor(10);
+    pLegendXCl.SetBorderSize(1);
+    
+    htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
+    Int_t rbR=1;
+    if(htmp){
+      htmp->SetMinimum(1);
+      rbR =  GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
       //printf("new R rb %d\n",rbR);
-         htmp->Rebin(rbR);
-         htmp->SetTitle("r of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(rmin,rmax,"X");
-         htmp->Draw("HE");
-         pLegendXCl.AddEntry(htmp,"No cut","L");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+      htmp->Rebin(rbR);
+      htmp->SetTitle("r of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(rmin,rmax,"X");
+      htmp->Draw("HE");
+      pLegendXCl.AddEntry(htmp,"No cut","L");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbR);
-           htmp->Draw("same HE");
-           pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
-         }
-       }
-       pLegendXCl.Draw();
-       
+        htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbR);
+        htmp->Draw("same HE");
+        pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
+      }
+    }
+    pLegendXCl.Draw();
+    
     //X
-       cxe->cd(2) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbX);
-         htmp->SetTitle("x of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(xmin,xmax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+    cxe->cd(2) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbX);
+      htmp->SetTitle("x of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(xmin,xmax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbX);
-           htmp->Draw("same HE");
-         }
-       }
+        htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbX);
+        htmp->Draw("same HE");
+      }
+    }
     //Y
-       cxe->cd(3) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbY);
-         htmp->SetTitle("y of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(ymin,ymax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+    cxe->cd(3) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbY);
+      htmp->SetTitle("y of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(ymin,ymax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbY);
-           htmp->Draw("same HE");
-         }
-       }
+        htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbY);
+        htmp->Draw("same HE");
+      }
+    }
     //Z
-       cxe->cd(4) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbZ);
-         htmp->SetTitle("z of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(zmin,zmax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+    cxe->cd(4) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbZ);
+      htmp->SetTitle("z of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(zmin,zmax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbZ);
-           htmp->Draw("same HE"); 
-         }
-       }
-       
-       sprintf(name,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
-       cxe->Print(name); printf("Create plot %s\n",name);
-       
-       
+        htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbZ);
+        htmp->Draw("same HE"); 
+      }
+    }
+    
+    sprintf(name,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
+    cxe->Print(name); printf("Create plot %s\n",name);
+    
+    
     //----------------------------------------------------------
     // Cluster X, Y, Z, R, NCells in cluster dependence
     //---------------------------------------------------------        
-       Int_t ncellcut[]={2, 3, 4};
-       Int_t ncellcuts = 3;
-       sprintf(cname,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
-       TCanvas  * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
-       cxn->Divide(2, 2);              
+    Int_t ncellcut[]={2, 3, 4};
+    Int_t ncellcuts = 3;
+    sprintf(cname,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
+    TCanvas  * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
+    cxn->Divide(2, 2);         
     //R
-       cxn->cd(1) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       TLegend pLegendXClN(0.83,0.6,0.95,0.93);
-       pLegendXClN.SetTextSize(0.03);
-       pLegendXClN.SetFillColor(10);
-       pLegendXClN.SetBorderSize(1);
-       
-       htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbR);
-         htmp->SetTitle("r of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(rmin,rmax,"X");
-         htmp->Draw("HE");
-         pLegendXClN.AddEntry(htmp,"No cut","L");
-         
-         for (Int_t i = 0; i < ncellcuts; i++) {
-           if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
-           else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbR);
-           htmp->Draw("same HE");
-           if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
-           else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
-           
-         }
-       }
-       pLegendXClN.Draw();
-       
+    cxn->cd(1) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    TLegend pLegendXClN(0.83,0.6,0.95,0.93);
+    pLegendXClN.SetTextSize(0.03);
+    pLegendXClN.SetFillColor(10);
+    pLegendXClN.SetBorderSize(1);
+    
+    htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbR);
+      htmp->SetTitle("r of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(rmin,rmax,"X");
+      htmp->Draw("HE");
+      pLegendXClN.AddEntry(htmp,"No cut","L");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbR);
+        htmp->Draw("same HE");
+        if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
+        else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
+        
+      }
+    }
+    pLegendXClN.Draw();
+    
     //X
-       cxn->cd(2) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbX);
-         htmp->SetTitle("x of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(xmin,xmax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncellcuts; i++) {
-           if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
-           else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbX);
-           htmp->Draw("same HE");   
-         }
-       }
+    cxn->cd(2) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbX);
+      htmp->SetTitle("x of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(xmin,xmax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbX);
+        htmp->Draw("same HE");   
+      }
+    }
     //Y
-       cxn->cd(3) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbY);
-         htmp->SetTitle("y of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(ymin,ymax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncellcuts; i++) {
-           if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
-           else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbY);
-           htmp->Draw("same HE");  
-         }
-       }
+    cxn->cd(3) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbY);
+      htmp->SetTitle("y of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(ymin,ymax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbY);
+        htmp->Draw("same HE");  
+      }
+    }
     //Z
-       cxn->cd(4) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbZ);
-         htmp->SetTitle("z of clusters for energy in cluster > threshold");
-         htmp->SetAxisRange(zmin,zmax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncellcuts; i++) {
-           if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
-           else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbZ);
-           htmp->Draw("same HE");    
-         }
-       }
-       
-       sprintf(name,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
-       cxn->Print(name); printf("Create plot %s\n",name);
-       
-       
+    cxn->cd(4) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbZ);
+      htmp->SetTitle("z of clusters for energy in cluster > threshold");
+      htmp->SetAxisRange(zmin,zmax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbZ);
+        htmp->Draw("same HE");    
+      }
+    }
+    
+    sprintf(name,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
+    cxn->Print(name); printf("Create plot %s\n",name);
+    
+    
     //----------------------------------------------------------
     // Cell X, Y, Z, R, energy cut dependence
     //---------------------------------------------------------        
-       
-       sprintf(cname,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
-       TCanvas  * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
-       cxecell->Divide(2, 2);          
+    
+    sprintf(cname,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
+    TCanvas  * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
+    cxecell->Divide(2, 2);             
     //R
-       cxecell->cd(1) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       TLegend pLegendXCell(0.83,0.6,0.95,0.93);
-       pLegendXCell.SetTextSize(0.03);
-       pLegendXCell.SetFillColor(10);
-       pLegendXCell.SetBorderSize(1);
-       
-       htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbR);
-         htmp->SetTitle("r of cells for energy in cluster > threshold");
-         htmp->SetAxisRange(rmin,rmax,"X");
-         htmp->Draw("HE");
-         pLegendXCell.AddEntry(htmp,"No cut","L");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+    cxecell->cd(1) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    TLegend pLegendXCell(0.83,0.6,0.95,0.93);
+    pLegendXCell.SetTextSize(0.03);
+    pLegendXCell.SetFillColor(10);
+    pLegendXCell.SetBorderSize(1);
+    
+    htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbR);
+      htmp->SetTitle("r of cells for energy in cluster > threshold");
+      htmp->SetAxisRange(rmin,rmax,"X");
+      htmp->Draw("HE");
+      pLegendXCell.AddEntry(htmp,"No cut","L");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbR);
-           htmp->Draw("same HE");
-           pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L"); 
-         }
-       }
-       pLegendXCell.Draw();
-       
+        htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbR);
+        htmp->Draw("same HE");
+        pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L"); 
+      }
+    }
+    pLegendXCell.Draw();
+    
     //X
-       cxecell->cd(2) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbX);
-         htmp->SetTitle("x of cells for energy in cluster > threshold");
-         htmp->SetAxisRange(xmin,xmax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+    cxecell->cd(2) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbX);
+      htmp->SetTitle("x of cells for energy in cluster > threshold");
+      htmp->SetAxisRange(xmin,xmax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbX);
-           htmp->Draw("same HE");
-         }
-       }
+        htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbX);
+        htmp->Draw("same HE");
+      }
+    }
     //Y
-       cxecell->cd(3) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbY);
-         htmp->SetTitle("y of cells for energy in cluster > threshold");
-         htmp->SetAxisRange(ymin,ymax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+    cxecell->cd(3) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbY);
+      htmp->SetTitle("y of cells for energy in cluster > threshold");
+      htmp->SetAxisRange(ymin,ymax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbY);
-           htmp->Draw("same HE");
-         }
-       }
+        htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbY);
+        htmp->Draw("same HE");
+      }
+    }
     //Z
-       cxecell->cd(4) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
-       if(htmp){
-         htmp->SetMinimum(1);
-         htmp->Rebin(rbZ);
-         htmp->SetTitle("z of cells for energy in cluster > threshold");
-         htmp->SetAxisRange(zmin,zmax,"X");
-         htmp->Draw("HE");
-         
-         for (Int_t i = 0; i < ncuts; i++) {
-           binmin =  hE->FindBin(ecut[i]);
+    cxecell->cd(4) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbZ);
+      htmp->SetTitle("z of cells for energy in cluster > threshold");
+      htmp->SetAxisRange(zmin,zmax,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-           htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
-           htmp->SetLineColor(ecutcolor[i]);
-           htmp->Rebin(rbZ);
-           htmp->Draw("same HE"); 
-         }
-       }
-       sprintf(name,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
-       cxecell->Print(name); printf("Create plot %s\n",name);
-       
-       
+        htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbZ);
+        htmp->Draw("same HE"); 
+      }
+    }
+    sprintf(name,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
+    cxecell->Print(name); printf("Create plot %s\n",name);
+    
+    
     //----------------------------------------------------------
     // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
     //---------------------------------------------------------        
-       Int_t rbDR= 1;//rbR;
-       Int_t rbDX= 1;//rbX;
-       Int_t rbDY= 1;//rbY;
-       Int_t rbDZ= 1;//rbZ;
-  
-       sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
-       TCanvas  * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
-       cxde->Divide(2, 2);             
+    Int_t rbDR= 1;//rbR;
+    Int_t rbDX= 1;//rbX;
+    Int_t rbDY= 1;//rbY;
+    Int_t rbDZ= 1;//rbZ;
+    
+    sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
+    TCanvas  * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
+    cxde->Divide(2, 2);                
     //R
-       cxde->cd(1) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       TLegend pLegendXClD(0.83,0.6,0.95,0.93);
-       pLegendXClD.SetTextSize(0.03);
-       pLegendXClD.SetFillColor(10);
-       pLegendXClD.SetBorderSize(1);
-       
-       htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbDR);
-               htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               pLegendXCl.AddEntry(htmp,"No cut","L");
-               
-               for (Int_t i = 0; i < ncuts; i++) {
-                       binmin =  hE->FindBin(ecut[i]);
+    cxde->cd(1) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    TLegend pLegendXClD(0.83,0.6,0.95,0.93);
+    pLegendXClD.SetTextSize(0.03);
+    pLegendXClD.SetFillColor(10);
+    pLegendXClD.SetBorderSize(1);
+    
+    htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbDR);
+      htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      pLegendXCl.AddEntry(htmp,"No cut","L");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-                       htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbDR);
-                       htmp->Draw("same HE");
-                       pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
-               }
-       }
-       pLegendXClD.Draw();
-       
+        htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbDR);
+        htmp->Draw("same HE");
+        pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
+      }
+    }
+    pLegendXClD.Draw();
+    
     //X
-       cxde->cd(2) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbDX);
-               htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               
-               for (Int_t i = 0; i < ncuts; i++) {
-                       binmin =  hE->FindBin(ecut[i]);
+    cxde->cd(2) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbDX);
+      htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-                       htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbDX);
-                       htmp->Draw("same HE");
-                       
-               }
-       }
+        htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbDX);
+        htmp->Draw("same HE");
+        
+      }
+    }
     //Y
-       cxde->cd(3) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbDY);
-               htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               
-               for (Int_t i = 0; i < ncuts; i++) {
-                       binmin =  hE->FindBin(ecut[i]);
+    cxde->cd(3) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbDY);
+      htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-                       htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbDY);
-                       htmp->Draw("same HE");
-                       
-               }
-       }
+        htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbDY);
+        htmp->Draw("same HE");
+        
+      }
+    }
     //Z
-       cxde->cd(4) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbZ);
-               htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               
-               for (Int_t i = 0; i < ncuts; i++) {
-                       binmin =  hE->FindBin(ecut[i]);
+    cxde->cd(4) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbZ);
+      htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncuts; i++) {
+        binmin =  hE->FindBin(ecut[i]);
         //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
-                       htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbZ);
-                       htmp->Draw("same HE");
-                       
-               }
-       }
-       
-       sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
-       cxde->Print(name); printf("Create plot %s\n",name);
-       
-       
+        htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbZ);
+        htmp->Draw("same HE");
+        
+      }
+    }
+    
+    sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
+    cxde->Print(name); printf("Create plot %s\n",name);
+    
+    
     //----------------------------------------------------------
     // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
     //---------------------------------------------------------        
-       sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
-       TCanvas  * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
-       cxdn->Divide(2, 2);             
+    sprintf(cname,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
+    TCanvas  * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
+    cxdn->Divide(2, 2);                
     //R
-       cxdn->cd(1) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
-       pLegendXClDN.SetTextSize(0.03);
-       pLegendXClDN.SetFillColor(10);
-       pLegendXClDN.SetBorderSize(1);
-       
-       htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbDR);
-               htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               pLegendXClDN.AddEntry(htmp,"No cut","L");
-               
-               for (Int_t i = 0; i < ncellcuts; i++) {
-                       if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
-                       else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbDR);
-                       htmp->Draw("same HE");
-                       if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
-                       else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
-                       
-               }
-       }
-       pLegendXClDN.Draw();
-       
+    cxdn->cd(1) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
+    pLegendXClDN.SetTextSize(0.03);
+    pLegendXClDN.SetFillColor(10);
+    pLegendXClDN.SetBorderSize(1);
+    
+    htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbDR);
+      htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      pLegendXClDN.AddEntry(htmp,"No cut","L");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbDR);
+        htmp->Draw("same HE");
+        if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
+        else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
+        
+      }
+    }
+    pLegendXClDN.Draw();
+    
     //X
-       cxdn->cd(2) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbDX);
-               htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               
-               for (Int_t i = 0; i < ncellcuts; i++) {
-                       if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
-                       else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbDX);
-                       htmp->Draw("same HE");
-                       
-               }
-       }
+    cxdn->cd(2) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbDX);
+      htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbDX);
+        htmp->Draw("same HE");
+        
+      }
+    }
     //Y
-       cxdn->cd(3) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbDY);
-               htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               
-               for (Int_t i = 0; i < ncellcuts; i++) {
-                       if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
-                       else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbDY);
-                       htmp->Draw("same HE");
-                       
-               }
-       }
+    cxdn->cd(3) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbDY);
+      htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbDY);
+        htmp->Draw("same HE");
+        
+      }
+    }
     //Z
-       cxdn->cd(4) ; 
-       gPad->SetLogy();
-       gPad->SetGridy();
-       
-       htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
-       if(htmp){
-               htmp->SetMinimum(1);
-               htmp->Rebin(rbDZ);
-               htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
-               htmp->SetAxisRange(-50,50,"X");
-               htmp->Draw("HE");
-               
-               for (Int_t i = 0; i < ncellcuts; i++) {
-                       if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
-                       else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
-                       htmp->SetLineColor(ecutcolor[i]);
-                       htmp->Rebin(rbDZ);
-                       htmp->Draw("same HE");
-                       
-               }
+    cxdn->cd(4) ; 
+    gPad->SetLogy();
+    gPad->SetGridy();
+    
+    htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
+    if(htmp){
+      htmp->SetMinimum(1);
+      htmp->Rebin(rbDZ);
+      htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
+      htmp->SetAxisRange(-50,50,"X");
+      htmp->Draw("HE");
+      
+      for (Int_t i = 0; i < ncellcuts; i++) {
+        if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
+        else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
+        htmp->SetLineColor(ecutcolor[i]);
+        htmp->Rebin(rbDZ);
+        htmp->Draw("same HE");
+        
+      }
+    }
+    
+    sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
+    cxdn->Print(name); printf("Create plot %s\n",name);
+    
        }
-       
-       sprintf(name,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
-       cxdn->Print(name); printf("Create plot %s\n",name);
   
-       
-    //----------------------------------------------------------
-    //Reconstructed clusters energy-eta-phi distributions, matched with tracks
-    //----------------------------------------------------------
-       
-       TH1F *  hEChargedClone   = (TH1F*)   fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
-       TH1F *  hPtChargedClone  = (TH1F*)   fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
-       TH1F *  hEtaChargedClone = (TH1F*)   fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
-       TH1F *  hPhiChargedClone = (TH1F*)   fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
-  
-       
-       sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
-       TCanvas  * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
-       ccltm->Divide(3, 1);
-       
-       ccltm->cd(1) ; 
-       if(fhECharged->GetEntries() > 0) gPad->SetLogy();
-       fhECharged->Rebin(rbE);
-       fhECharged->SetAxisRange(ptmin,ptmax,"X");
-       fhECharged->SetMinimum(1);
-       fhECharged->Draw();
-  
-       ccltm->cd(2) ; 
-       if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
-       fhPhiCharged->Rebin(rbPhi);
-       fhPhiCharged->SetAxisRange(phimin,phimax,"X");
-       fhPhiCharged->Draw();
-       fhPhiCharged->Draw();
-       
-       ccltm->cd(3) ;
-       if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
-       fhEtaCharged->Rebin(rbEta);
-       fhEtaCharged->SetAxisRange(etamin,etamax,"X");  
-       fhEtaCharged->Draw();
-       fhEtaCharged->Draw();
-       
-       sprintf(name,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
-       ccltm->Print(name); printf("Plot: %s\n",name);
-       
+  //----------------------------------------------------------
+  //Reconstructed clusters energy-eta-phi distributions, matched with tracks
+  //----------------------------------------------------------
+  TH1F *       hEChargedClone   = 0 ;
+  TH1F *       hPtChargedClone  = 0 ;
+  TH1F *       hEtaChargedClone = 0 ;
+  TH1F *       hPhiChargedClone = 0 ;
+       if(fFillAllTH12){
+    hEChargedClone   = (TH1F*)   fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
+    hPtChargedClone  = (TH1F*)   fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
+    hEtaChargedClone = (TH1F*)   fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
+    hPhiChargedClone = (TH1F*)   fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
+    
+    sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
+    TCanvas  * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
+    ccltm->Divide(3, 1);
+    
+    ccltm->cd(1) ; 
+    if(fhECharged->GetEntries() > 0) gPad->SetLogy();
+    fhECharged->Rebin(rbE);
+    fhECharged->SetAxisRange(ptmin,ptmax,"X");
+    fhECharged->SetMinimum(1);
+    fhECharged->Draw();
+    
+    ccltm->cd(2) ; 
+    if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
+    fhPhiCharged->Rebin(rbPhi);
+    fhPhiCharged->SetAxisRange(phimin,phimax,"X");
+    fhPhiCharged->Draw();
+    fhPhiCharged->Draw();
+    
+    ccltm->cd(3) ;
+    if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
+    fhEtaCharged->Rebin(rbEta);
+    fhEtaCharged->SetAxisRange(etamin,etamax,"X");     
+    fhEtaCharged->Draw();
+    fhEtaCharged->Draw();
+    
+    sprintf(name,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
+    ccltm->Print(name); printf("Plot: %s\n",name);
+    
     //----------------------------------------------------------
     // Ratio  of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
     //----------------------------------------------------------
-       
-       sprintf(cname,"%s_QA_ChargedRatio",fCalorimeter.Data());
-       TCanvas  * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
-       ccharge->Divide(3, 1);
-       
-       ccharge->cd(1) ; 
-       fhECharged->Sumw2();
-       fhE->Sumw2();
-       fhECharged->Divide(fhE);
-       fhECharged->SetAxisRange(ptmin,ptmax,"X");
-       fhECharged->SetMaximum(0.5);
-       fhECharged->SetYTitle("track-matched clusters / all clusters");
-       fhECharged->Draw("HE");
-  
-       ccharge->cd(2) ; 
-       fhPhiCharged->Sumw2();
-       fhPhi->Rebin(rbPhi);
-       fhPhi->Sumw2();
-       fhPhiCharged->Divide(fhPhi);
-       fhPhiCharged->SetAxisRange(phimin,phimax,"X");
-       fhPhiCharged->SetMaximum(0.5);
-       fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
-       fhPhiCharged->Draw("HE");
-       
-       ccharge->cd(3) ; 
-       fhEtaCharged->Sumw2();
-       fhEta->Rebin(rbEta);
-       fhEta->Sumw2();
-       fhEtaCharged->Divide(fhEta);
-       fhEtaCharged->SetAxisRange(etamin,etamax,"X");
-       fhEtaCharged->SetMaximum(0.5);
-       fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
-       fhEtaCharged->Draw("HE");
-       
-       sprintf(name,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
-       ccharge->Print(name); printf("Create plot %s\n",name);
-       
-    //-------------------------------------------      
-    // N Cells - N Clusters - N Cells per cluster
-    //-------------------------------------------
+    
+    sprintf(cname,"%s_QA_ChargedRatio",fCalorimeter.Data());
+    TCanvas  * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
+    ccharge->Divide(3, 1);
+    
+    ccharge->cd(1) ; 
+    fhECharged->Sumw2();
+    fhE->Sumw2();
+    fhECharged->Divide(fhE);
+    fhECharged->SetAxisRange(ptmin,ptmax,"X");
+    fhECharged->SetMaximum(0.5);
+    fhECharged->SetYTitle("track-matched clusters / all clusters");
+    fhECharged->Draw("HE");
+    
+    ccharge->cd(2) ; 
+    fhPhiCharged->Sumw2();
+    fhPhi->Rebin(rbPhi);
+    fhPhi->Sumw2();
+    fhPhiCharged->Divide(fhPhi);
+    fhPhiCharged->SetAxisRange(phimin,phimax,"X");
+    fhPhiCharged->SetMaximum(0.5);
+    fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
+    fhPhiCharged->Draw("HE");
+    
+    ccharge->cd(3) ; 
+    fhEtaCharged->Sumw2();
+    fhEta->Rebin(rbEta);
+    fhEta->Sumw2();
+    fhEtaCharged->Divide(fhEta);
+    fhEtaCharged->SetAxisRange(etamin,etamax,"X");
+    fhEtaCharged->SetMaximum(0.5);
+    fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
+    fhEtaCharged->Draw("HE");
+    
+    sprintf(name,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
+    ccharge->Print(name); printf("Create plot %s\n",name);
+       }
+  //-------------------------------------------        
+  // N Cells - N Clusters - N Cells per cluster
+  //-------------------------------------------
        sprintf(cname,"QA_%s_nclustercells",fCalorimeter.Data());
        TCanvas  * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
        cN->Divide(2, 3);
@@ -3985,7 +3897,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                htmp->SetLineColor(modColorIndex[imod]);
                if(imod==1){
                        htmp->SetTitle("Ratio # cells per cluster in  module X / module 0");
-        //htmp->SetAxisRange(ptmin,ptmax,"X");
+      //htmp->SetAxisRange(ptmin,ptmax,"X");
                        htmp->SetMaximum(3.5);
                        htmp->SetMinimum(0);
                        htmp->Draw("HE");
@@ -3997,9 +3909,9 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        sprintf(name,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
        cN->Print(name); printf("Print plot %s\n",name);
        
-    //----------------------------------------------------     
-    // Cell Time histograms, time only available in ESDs
-    //----------------------------------------------------
+  //----------------------------------------------------       
+  // Cell Time histograms, time only available in ESDs
+  //----------------------------------------------------
        if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
     
                sprintf(cname,"QA_%s_cellstime",fCalorimeter.Data());
@@ -4032,11 +3944,11 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        }
        
        
-    //---------------------------------
-    //Grid of cell per module plots 
-    //---------------------------------
+  //---------------------------------
+  //Grid of cell per module plots 
+  //---------------------------------
        {
-      //Number of entries per cell
+    //Number of entries per cell
     gStyle->SetPadRightMargin(0.15);
     sprintf(cname,"%s_QA_GridCellEntries",fCalorimeter.Data());
     TCanvas *cgrid   = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
@@ -4050,10 +3962,10 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
       gPad->SetLogz();
       gPad->SetGridy();
       gPad->SetGridx();
-        //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
+      //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
       fhGridCellsMod[imod]->SetZTitle("Counts    ");
       fhGridCellsMod[imod]->SetYTitle("row (phi direction)    ");
-        //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
+      //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
       fhGridCellsMod[imod]->Draw("colz");
     }
     sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
@@ -4070,7 +3982,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
       gPad->SetLogz();
       gPad->SetGridy();
       gPad->SetGridx();
-        //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
+      //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
       fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV)    ");
       fhGridCellsEMod[imod]->SetYTitle("row (phi direction)    ");
       fhGridCellsEMod[imod]->Draw("colz");
@@ -4078,7 +3990,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
     cgridE->Print(name); printf("Create plot %s\n",name);
     
-      //Accumulated energy per cell
+    //Accumulated energy per cell
     sprintf(cname,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
     TCanvas *cgridEA   = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
     if(fNModules%2 == 0)         
@@ -4090,7 +4002,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
       gPad->SetLogz();
       gPad->SetGridy();
       gPad->SetGridx();
-        //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
+      //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
       fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV)    ");
       fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
       fhGridCellsEMod[imod]->Draw("colz");
@@ -4098,7 +4010,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
     cgridEA->Print(name); printf("Create plot %s\n",name);
                
-      //Accumulated Time per cell, E > 0.5 GeV
+    //Accumulated Time per cell, E > 0.5 GeV
                
     sprintf(cname,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
     TCanvas *cgridT   = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
@@ -4111,7 +4023,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
       gPad->SetLogz();
       gPad->SetGridy();
       gPad->SetGridx();
-        //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
+      //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
       fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns)    ");
       fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)    ");
       fhGridCellsTimeMod[imod]->Draw("colz");
@@ -4121,9 +4033,9 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                
        }
        
-    //---------------------------------------------
-    //Calorimeter Correlation, PHOS vs EMCAL
-    //---------------------------------------------
+  //---------------------------------------------
+  //Calorimeter Correlation, PHOS vs EMCAL
+  //---------------------------------------------
        if(fCorrelateCalos){
                
                sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
@@ -4131,28 +4043,28 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                ccorr->Divide(2, 2);
     
                ccorr->cd(1) ; 
-      //gPad->SetLogy();
-      //gPad->SetLogx();
+    //gPad->SetLogy();
+    //gPad->SetLogx();
                fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
                fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");               
                fhCaloCorrNClusters ->Draw();
     
                ccorr->cd(2) ; 
-      //gPad->SetLogy();
-      //gPad->SetLogx();
+    //gPad->SetLogy();
+    //gPad->SetLogx();
                fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
                fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");          
                fhCaloCorrNCells->Draw();
     
-      //gPad->SetLogy();
-      //gPad->SetLogx();
+    //gPad->SetLogy();
+    //gPad->SetLogx();
                fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
                fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");             
                fhCaloCorrEClusters->Draw();
     
                ccorr->cd(4) ; 
-      //gPad->SetLogy();
-      //gPad->SetLogx();
+    //gPad->SetLogy();
+    //gPad->SetLogx();
                fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
                fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");                
                fhCaloCorrECells->Draw();
@@ -4161,9 +4073,9 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                ccorr->Print(name); printf("Plot: %s\n",name);
        }
   
-    //----------------------------
-    //Invariant mass
-    //-----------------------------
+  //----------------------------
+  //Invariant mass
+  //-----------------------------
        
        Int_t imbinmin = -1;
        Int_t imbinmax = -1;
@@ -4173,16 +4085,16 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
                Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
                if (emin != 0 ) printf("emin != 0 \n");
-      //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
+    //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
                
                sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
-      //       printf("c5\n");
+    // printf("c5\n");
                TCanvas  * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
                c5->Divide(2, 3);
                
                c5->cd(1) ; 
-      //fhIM->SetLineColor(4);
-      //fhIM->Draw();
+    //fhIM->SetLineColor(4);
+    //fhIM->Draw();
                imbinmin = 0;
                imbinmax =  (Int_t) (1-emin)*nebins/emax;
                TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
@@ -4194,7 +4106,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                pLegendIM.AddEntry(pyim1,"all modules","L");
                pLegendIM.SetFillColor(10);
                pLegendIM.SetBorderSize(1);
-      //FIXME
+    //FIXME
                for(Int_t imod = 0; imod < fNModules; imod++){
                        pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
                        pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
@@ -4272,24 +4184,24 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                c5->Print(name); printf("Plot: %s\n",name);
        }
        
-    //--------------------------------------------------
-    //Invariant mass, clusters with more than one cell
-    //-------------------------------------------------
+  //--------------------------------------------------
+  //Invariant mass, clusters with more than one cell
+  //-------------------------------------------------
        if(fhIMCellCut->GetEntries() > 1){
                Int_t nebins  = fhIMCellCut->GetNbinsX();
                Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
                Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
                if (emin != 0 ) printf("emin != 0 \n");
-      //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
+    //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
                
                sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
-      //       printf("c5cc\n");
+    // printf("c5cc\n");
                TCanvas  * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
                c5cc->Divide(2, 3);
                
                c5cc->cd(1) ; 
-      //fhIMCellCut->SetLineColor(4);
-      //fhIMCellCut->Draw();
+    //fhIMCellCut->SetLineColor(4);
+    //fhIMCellCut->Draw();
                imbinmin = 0;
                imbinmax =  (Int_t) (1-emin)*nebins/emax;
                TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
@@ -4380,16 +4292,16 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        }
        
        
-    //Asymmetry
+  //Asymmetry
        if(fhAsym->GetEntries() > 1){
                Int_t nebins  = fhAsym->GetNbinsX();
                Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
                Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
                if (emin != 0 ) printf("emin != 0 \n");
-      //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
+    //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
                
                sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
-      //       printf("c5\n");
+    // printf("c5\n");
                TCanvas  * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
                c5b->Divide(2, 2);
                
@@ -4428,8 +4340,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        
        
        if(IsDataMC()){
-      //Reconstructed vs MC distributions
-      //printf("c6\n");
+    //Reconstructed vs MC distributions
+    //printf("c6\n");
     sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
     TCanvas  * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
     c6->Divide(2, 2);
@@ -4457,8 +4369,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
     c6->Print(name); printf("Plot: %s\n",name);        
     
-      //Reconstructed vs MC distributions
-      //printf("c6\n");
+    //Reconstructed vs MC distributions
+    //printf("c6\n");
     sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
     TCanvas  * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
     c6Gam->Divide(2, 2);
@@ -4478,8 +4390,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
     c6->Print(name); printf("Plot: %s\n",name);        
     
-      //Generated - reconstructed  
-      //printf("c7\n");
+    //Generated - reconstructed  
+    //printf("c7\n");
     sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
     TCanvas  * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
     c7->Divide(2, 2);
@@ -4517,8 +4429,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
     c7->Print(name); printf("Plot: %s\n",name);
     
-      // Reconstructed / Generated 
-      //printf("c8\n");
+    // Reconstructed / Generated 
+    //printf("c8\n");
     sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
     TCanvas  * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
     c8->Divide(2, 2);
@@ -4556,10 +4468,10 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
     c8->Print(name); printf("Plot: %s\n",name);
     
-      //MC
+    //MC
     
-      //Generated distributions
-      //printf("c1\n");
+    //Generated distributions
+    //printf("c1\n");
     sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
     TCanvas  * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
     c10->Divide(3, 1);
@@ -4574,7 +4486,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     fhGenOmegaPt->SetLineColor(7);
     fhGenElePt->SetLineColor(6);
     
-      //Select the maximum of the histogram to show all lines.
+    //Select the maximum of the histogram to show all lines.
     if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() && 
        fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
       haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
@@ -4618,7 +4530,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     fhGenEtaEta->SetLineColor(2);
     fhGenOmegaEta->SetLineColor(7);
     fhGenEleEta->SetLineColor(6);
-      //Select the maximum of the histogram to show all lines.
+    //Select the maximum of the histogram to show all lines.
     if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() && 
        fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
       haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
@@ -4652,7 +4564,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     fhGenEtaPhi->SetLineColor(2);
     fhGenOmegaPhi->SetLineColor(7);
     fhGenElePhi->SetLineColor(6);
-      //Select the maximum of the histogram to show all lines.
+    //Select the maximum of the histogram to show all lines.
     if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() && 
        fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
       haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
@@ -4680,8 +4592,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     c10->Print(name); printf("Plot: %s\n",name);
     
     
-      //Reconstructed clusters depending on its original particle.
-      //printf("c1\n");
+    //Reconstructed clusters depending on its original particle.
+    //printf("c1\n");
     sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
     TCanvas  * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
     c11->Divide(2, 2);
@@ -4702,7 +4614,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     hChHadE->SetLineColor(7);
     hEleE->SetLineColor(6);
     
-      //Select the maximum of the histogram to show all lines.
+    //Select the maximum of the histogram to show all lines.
     if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() && 
        hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
       haxisE->SetMaximum(hPi0E->GetMaximum());
@@ -4741,7 +4653,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     
     c11->cd(2) ; 
     gPad->SetLogy();
-      //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
+    //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
     TH1F * hGamPt   = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
     TH1F * hPi0Pt   = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
     TH1F * hElePt   = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
@@ -4755,7 +4667,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     hChHadPt->SetLineColor(7);
     hElePt->SetLineColor(6);
     
-      //Select the maximum of the histogram to show all lines.
+    //Select the maximum of the histogram to show all lines.
     if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() && 
        hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
       haxispt->SetMaximum(hPi0Pt->GetMaximum());
@@ -4795,7 +4707,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     hNeHadEta->SetLineColor(2);
     hChHadEta->SetLineColor(7);
     hEleEta->SetLineColor(6);
-      //Select the maximum of the histogram to show all lines.
+    //Select the maximum of the histogram to show all lines.
     if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() && 
        hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
       haxiseta->SetMaximum(hPi0Eta->GetMaximum());
@@ -4836,7 +4748,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     hNeHadPhi->SetLineColor(2);
     hChHadPhi->SetLineColor(7);
     hElePhi->SetLineColor(6);
-      //Select the maximum of the histogram to show all lines.
+    //Select the maximum of the histogram to show all lines.
     if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() && 
        hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
       haxisphi->SetMaximum(hPi0Phi->GetMaximum());
@@ -4864,8 +4776,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     c11->Print(name); printf("Plot: %s\n",name);
     
     
-      //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
-      //printf("c1\n");
+    //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
+    //printf("c1\n");
     
     TH1F *     hPi0EClone   = (TH1F*)   hPi0E  ->Clone(Form("%s_Clone",fhPi0E->GetName()));
     TH1F *     hGamEClone   = (TH1F*)   hGamE  ->Clone(Form("%s_Clone",fhGamE->GetName()));
@@ -4947,19 +4859,19 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     
     
     
-      //Reconstructed distributions
-      //printf("c1\n");
+    //Reconstructed distributions
+    //printf("c1\n");
     sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
     TCanvas  * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
     c13->Divide(2, 2);
     
     c13->cd(1) ; 
-      //gPad->SetLogy();
+    //gPad->SetLogy();
     fhEMVxyz->SetTitleOffset(1.6,"Y");
     fhEMVxyz->Draw();
     
     c13->cd(2) ; 
-      //gPad->SetLogy();
+    //gPad->SetLogy();
     fhHaVxyz->SetTitleOffset(1.6,"Y");
     fhHaVxyz->Draw();
     
@@ -4980,233 +4892,234 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     c13->Print(name); printf("Plot: %s\n",name);
     
     
-      //Track-matching distributions
-    
+    //Track-matching distributions
+    if(fFillAllTH12){
       //Reconstructed distributions, matched with tracks, generated particle dependence
       //printf("c2\n");
-    sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
-    TCanvas  * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
-    c22ch->Divide(2, 2);
-    
-    c22ch->cd(1) ; 
-    
-    TH1F * hGamECharged   = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
-    TH1F * hPi0ECharged   = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
-    TH1F * hEleECharged   = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
-    TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
-    TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
-    hPi0ECharged->SetLineColor(1);
-    hGamECharged->SetLineColor(4);
-    hNeHadECharged->SetLineColor(2);
-    hChHadECharged->SetLineColor(7);
-    hEleECharged->SetLineColor(6);     
-    gPad->SetLogy();
-    fhECharged->SetLineColor(3);
-    fhECharged->SetMinimum(0.5);
-    fhECharged->Draw();
-    hPi0ECharged->Draw("same");
-    hGamECharged->Draw("same");
-    hNeHadECharged->Draw("same");
-    hChHadECharged->Draw("same");
-    hEleECharged->Draw("same");
-    TLegend pLegend22(0.75,0.45,0.9,0.8);
-    pLegend22.SetTextSize(0.06);
-    pLegend22.AddEntry(fhECharged,"all","L");
-    pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
-    pLegend22.AddEntry(hGamECharged,"#gamma","L");
-    pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
-    pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
-    pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
-    pLegend22.SetFillColor(10);
-    pLegend22.SetBorderSize(1);
-    pLegend22.Draw();
-    
-    c22ch->cd(2) ; 
-    
-    TH1F * hGamPtCharged   = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
-    TH1F * hPi0PtCharged   = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
-    TH1F * hElePtCharged   = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
-    TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
-    TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
-    hPi0PtCharged->SetLineColor(1);
-    hGamPtCharged->SetLineColor(4);
-    hNeHadPtCharged->SetLineColor(2);
-    hChHadPtCharged->SetLineColor(7);
-    hElePtCharged->SetLineColor(6);    
-    gPad->SetLogy();
-    fhPtCharged->SetLineColor(3);
-    fhPtCharged->SetMinimum(0.5);
-    fhPtCharged->Draw();
-    hPi0PtCharged->Draw("same");
-    hGamPtCharged->Draw("same");
-    hNeHadPtCharged->Draw("same");
-    hChHadPtCharged->Draw("same");
-    hElePtCharged->Draw("same");       
-    
-    c22ch->cd(4) ; 
-    
-    TH1F * hGamEtaCharged   = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
-    TH1F * hPi0EtaCharged   = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
-    TH1F * hEleEtaCharged   = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
-    TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
-    TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
-    hPi0EtaCharged->SetLineColor(1);
-    hGamEtaCharged->SetLineColor(4);
-    hNeHadEtaCharged->SetLineColor(2);
-    hChHadEtaCharged->SetLineColor(7);
-    hEleEtaCharged->SetLineColor(6);   
-    gPad->SetLogy();
-    fhEtaCharged->SetLineColor(3);
-    fhEtaCharged->SetMinimum(0.5);
-    fhEtaCharged->Draw();
-    hPi0EtaCharged->Draw("same");
-    hGamEtaCharged->Draw("same");
-    hNeHadEtaCharged->Draw("same");
-    hChHadEtaCharged->Draw("same");
-    hEleEtaCharged->Draw("same");
-    
-    c22ch->cd(3) ; 
-    
-    TH1F * hGamPhiCharged   = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
-    TH1F * hPi0PhiCharged   = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
-    TH1F * hElePhiCharged   = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
-    TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
-    TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
-    hPi0PhiCharged->SetLineColor(1);
-    hGamPhiCharged->SetLineColor(4);
-    hNeHadPhiCharged->SetLineColor(2);
-    hChHadPhiCharged->SetLineColor(7);
-    hElePhiCharged->SetLineColor(6);   
-    gPad->SetLogy();
-    fhPhiCharged->SetLineColor(3);
-    fhPhiCharged->SetMinimum(0.5);
-    fhPhiCharged->Draw();
-    hPi0PhiCharged->Draw("same");
-    hGamPhiCharged->Draw("same");
-    hNeHadPhiCharged->Draw("same");
-    hChHadPhiCharged->Draw("same");
-    hElePhiCharged->Draw("same");
-    
-    
-    sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
-    c22ch->Print(name); printf("Plot: %s\n",name);
-    
-    TH1F *     hGamEChargedClone   = (TH1F*)   hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
-    TH1F *     hGamPtChargedClone  = (TH1F*)   hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
-    TH1F *     hGamEtaChargedClone = (TH1F*)   hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
-    TH1F *     hGamPhiChargedClone = (TH1F*)   hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
-    
-    TH1F *     hPi0EChargedClone   = (TH1F*)   hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
-    TH1F *     hPi0PtChargedClone  = (TH1F*)   hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
-    TH1F *     hPi0EtaChargedClone = (TH1F*)   hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
-    TH1F *     hPi0PhiChargedClone = (TH1F*)   hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
-    
-    TH1F *     hEleEChargedClone   = (TH1F*)   hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
-    TH1F *     hElePtChargedClone  = (TH1F*)   hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
-    TH1F *     hEleEtaChargedClone = (TH1F*)   hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
-    TH1F *     hElePhiChargedClone = (TH1F*)   hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));     
-    
-    TH1F *     hNeHadEChargedClone   = (TH1F*)   hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
-    TH1F *     hNeHadPtChargedClone  = (TH1F*)   hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
-    TH1F *     hNeHadEtaChargedClone = (TH1F*)   hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
-    TH1F *     hNeHadPhiChargedClone = (TH1F*)   hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
-    
-    TH1F *     hChHadEChargedClone   = (TH1F*)   hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
-    TH1F *     hChHadPtChargedClone  = (TH1F*)   hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
-    TH1F *     hChHadEtaChargedClone = (TH1F*)   hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
-    TH1F *     hChHadPhiChargedClone = (TH1F*)   hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));       
-    
+      sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
+      TCanvas  * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
+      c22ch->Divide(2, 2);
+      
+      c22ch->cd(1) ; 
+      
+      TH1F * hGamECharged   = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
+      TH1F * hPi0ECharged   = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
+      TH1F * hEleECharged   = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
+      TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
+      TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
+      hPi0ECharged->SetLineColor(1);
+      hGamECharged->SetLineColor(4);
+      hNeHadECharged->SetLineColor(2);
+      hChHadECharged->SetLineColor(7);
+      hEleECharged->SetLineColor(6);   
+      gPad->SetLogy();
+      fhECharged->SetLineColor(3);
+      fhECharged->SetMinimum(0.5);
+      fhECharged->Draw();
+      hPi0ECharged->Draw("same");
+      hGamECharged->Draw("same");
+      hNeHadECharged->Draw("same");
+      hChHadECharged->Draw("same");
+      hEleECharged->Draw("same");
+      TLegend pLegend22(0.75,0.45,0.9,0.8);
+      pLegend22.SetTextSize(0.06);
+      pLegend22.AddEntry(fhECharged,"all","L");
+      pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
+      pLegend22.AddEntry(hGamECharged,"#gamma","L");
+      pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
+      pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
+      pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
+      pLegend22.SetFillColor(10);
+      pLegend22.SetBorderSize(1);
+      pLegend22.Draw();
+      
+      c22ch->cd(2) ; 
+      
+      TH1F * hGamPtCharged   = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
+      TH1F * hPi0PtCharged   = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
+      TH1F * hElePtCharged   = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
+      TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
+      TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
+      hPi0PtCharged->SetLineColor(1);
+      hGamPtCharged->SetLineColor(4);
+      hNeHadPtCharged->SetLineColor(2);
+      hChHadPtCharged->SetLineColor(7);
+      hElePtCharged->SetLineColor(6);  
+      gPad->SetLogy();
+      fhPtCharged->SetLineColor(3);
+      fhPtCharged->SetMinimum(0.5);
+      fhPtCharged->Draw();
+      hPi0PtCharged->Draw("same");
+      hGamPtCharged->Draw("same");
+      hNeHadPtCharged->Draw("same");
+      hChHadPtCharged->Draw("same");
+      hElePtCharged->Draw("same");     
+      
+      c22ch->cd(4) ; 
+      
+      TH1F * hGamEtaCharged   = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
+      TH1F * hPi0EtaCharged   = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
+      TH1F * hEleEtaCharged   = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
+      TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
+      TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
+      hPi0EtaCharged->SetLineColor(1);
+      hGamEtaCharged->SetLineColor(4);
+      hNeHadEtaCharged->SetLineColor(2);
+      hChHadEtaCharged->SetLineColor(7);
+      hEleEtaCharged->SetLineColor(6); 
+      gPad->SetLogy();
+      fhEtaCharged->SetLineColor(3);
+      fhEtaCharged->SetMinimum(0.5);
+      fhEtaCharged->Draw();
+      hPi0EtaCharged->Draw("same");
+      hGamEtaCharged->Draw("same");
+      hNeHadEtaCharged->Draw("same");
+      hChHadEtaCharged->Draw("same");
+      hEleEtaCharged->Draw("same");
+      
+      c22ch->cd(3) ; 
+      
+      TH1F * hGamPhiCharged   = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
+      TH1F * hPi0PhiCharged   = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
+      TH1F * hElePhiCharged   = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
+      TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
+      TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
+      hPi0PhiCharged->SetLineColor(1);
+      hGamPhiCharged->SetLineColor(4);
+      hNeHadPhiCharged->SetLineColor(2);
+      hChHadPhiCharged->SetLineColor(7);
+      hElePhiCharged->SetLineColor(6); 
+      gPad->SetLogy();
+      fhPhiCharged->SetLineColor(3);
+      fhPhiCharged->SetMinimum(0.5);
+      fhPhiCharged->Draw();
+      hPi0PhiCharged->Draw("same");
+      hGamPhiCharged->Draw("same");
+      hNeHadPhiCharged->Draw("same");
+      hChHadPhiCharged->Draw("same");
+      hElePhiCharged->Draw("same");
+      
+      
+      sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
+      c22ch->Print(name); printf("Plot: %s\n",name);
+      
+      TH1F *   hGamEChargedClone   = (TH1F*)   hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
+      TH1F *   hGamPtChargedClone  = (TH1F*)   hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
+      TH1F *   hGamEtaChargedClone = (TH1F*)   hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
+      TH1F *   hGamPhiChargedClone = (TH1F*)   hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
+      
+      TH1F *   hPi0EChargedClone   = (TH1F*)   hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
+      TH1F *   hPi0PtChargedClone  = (TH1F*)   hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
+      TH1F *   hPi0EtaChargedClone = (TH1F*)   hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
+      TH1F *   hPi0PhiChargedClone = (TH1F*)   hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
+      
+      TH1F *   hEleEChargedClone   = (TH1F*)   hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
+      TH1F *   hElePtChargedClone  = (TH1F*)   hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
+      TH1F *   hEleEtaChargedClone = (TH1F*)   hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
+      TH1F *   hElePhiChargedClone = (TH1F*)   hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));     
+      
+      TH1F *   hNeHadEChargedClone   = (TH1F*)   hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
+      TH1F *   hNeHadPtChargedClone  = (TH1F*)   hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
+      TH1F *   hNeHadEtaChargedClone = (TH1F*)   hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
+      TH1F *   hNeHadPhiChargedClone = (TH1F*)   hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
+      
+      TH1F *   hChHadEChargedClone   = (TH1F*)   hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
+      TH1F *   hChHadPtChargedClone  = (TH1F*)   hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
+      TH1F *   hChHadEtaChargedClone = (TH1F*)   hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
+      TH1F *   hChHadPhiChargedClone = (TH1F*)   hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));       
+      
       //Ratio: reconstructed track matched/ all reconstructed
       //printf("c3\n");
-    sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
-    TCanvas  * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
-    c3ch->Divide(2, 2);
-    
-    c3ch->cd(1) ;
-    hEChargedClone->SetMaximum(1.2);
-    hEChargedClone->SetMinimum(0.001); 
-    hEChargedClone->SetLineColor(3);
-    hEChargedClone->SetYTitle("track matched / all");
-    hPi0EChargedClone->Divide(hPi0E);
-    hGamEChargedClone->Divide(hGamE);
-    hEleEChargedClone->Divide(hEleE);
-    hNeHadEChargedClone->Divide(hNeHadE);
-    hChHadEChargedClone->Divide(hChHadE);
-    hEChargedClone->Draw();
-    hPi0EChargedClone->Draw("same");
-    hGamEChargedClone->Draw("same");
-    hEleEChargedClone->Draw("same");
-    hNeHadEChargedClone->Draw("same");
-    hChHadEChargedClone->Draw("same");
-    
-    TLegend pLegend3ch(0.75,0.45,0.9,0.8);
-    pLegend3ch.SetTextSize(0.06);
-    pLegend3ch.AddEntry(hEChargedClone,"all","L");
-    pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
-    pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
-    pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
-    pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
-    pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
-    pLegend3ch.SetFillColor(10);
-    pLegend3ch.SetBorderSize(1);
-    pLegend3ch.Draw();
-    
-    c3ch->cd(2) ;
-    hPtChargedClone->SetMaximum(1.2);
-    hPtChargedClone->SetMinimum(0.001);        
-    hPtChargedClone->SetLineColor(3);
-    hPtChargedClone->SetYTitle("track matched / all");
-    hPi0PtChargedClone->Divide(hPi0Pt);
-    hGamPtChargedClone->Divide(hGamPt);
-    hElePtChargedClone->Divide(hElePt);
-    hNeHadPtChargedClone->Divide(hNeHadPt);
-    hChHadPtChargedClone->Divide(hChHadPt);
-    hPtChargedClone->Draw();
-    hPi0PtChargedClone->Draw("same");
-    hGamPtChargedClone->Draw("same");
-    hElePtChargedClone->Draw("same");
-    hNeHadPtChargedClone->Draw("same");
-    hChHadPtChargedClone->Draw("same");
-    
-    c3ch->cd(4) ;
-    hEtaChargedClone->SetMaximum(1.2);
-    hEtaChargedClone->SetMinimum(0.001);       
-    hEtaChargedClone->SetLineColor(3);
-    hEtaChargedClone->SetYTitle("track matched / all");
-    hPi0EtaChargedClone->Divide(hPi0Eta);
-    hGamEtaChargedClone->Divide(hGamEta);
-    hEleEtaChargedClone->Divide(hEleEta);
-    hNeHadEtaChargedClone->Divide(hNeHadEta);
-    hChHadEtaChargedClone->Divide(hChHadEta);
-    hEtaChargedClone->Draw();
-    hPi0EtaChargedClone->Draw("same");
-    hGamEtaChargedClone->Draw("same");
-    hEleEtaChargedClone->Draw("same");
-    hNeHadEtaChargedClone->Draw("same");
-    hChHadEtaChargedClone->Draw("same");
-    
-    c3ch->cd(3) ;
-    hPhiChargedClone->SetMaximum(1.2);
-    hPhiChargedClone->SetMinimum(0.001);
-    hPhiChargedClone->SetLineColor(3);
-    hPhiChargedClone->SetYTitle("track matched / all");
-    hPi0PhiChargedClone->Divide(hPi0Phi);
-    hGamPhiChargedClone->Divide(hGamPhi);
-    hElePhiChargedClone->Divide(hElePhi);
-    hNeHadPhiChargedClone->Divide(hNeHadPhi);
-    hChHadPhiChargedClone->Divide(hChHadPhi);
-    hPhiChargedClone->Draw();
-    hPi0PhiChargedClone->Draw("same");
-    hGamPhiChargedClone->Draw("same");
-    hElePhiChargedClone->Draw("same");
-    hNeHadPhiChargedClone->Draw("same");
-    hChHadPhiChargedClone->Draw("same");
-    
-    sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
-    c3ch->Print(name); printf("Plot: %s\n",name);
-    
-       }       
-    //Track-matching distributions
+      sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
+      TCanvas  * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
+      c3ch->Divide(2, 2);
+      
+      c3ch->cd(1) ;
+      hEChargedClone->SetMaximum(1.2);
+      hEChargedClone->SetMinimum(0.001);       
+      hEChargedClone->SetLineColor(3);
+      hEChargedClone->SetYTitle("track matched / all");
+      hPi0EChargedClone->Divide(hPi0E);
+      hGamEChargedClone->Divide(hGamE);
+      hEleEChargedClone->Divide(hEleE);
+      hNeHadEChargedClone->Divide(hNeHadE);
+      hChHadEChargedClone->Divide(hChHadE);
+      hEChargedClone->Draw();
+      hPi0EChargedClone->Draw("same");
+      hGamEChargedClone->Draw("same");
+      hEleEChargedClone->Draw("same");
+      hNeHadEChargedClone->Draw("same");
+      hChHadEChargedClone->Draw("same");
+      
+      TLegend pLegend3ch(0.75,0.45,0.9,0.8);
+      pLegend3ch.SetTextSize(0.06);
+      pLegend3ch.AddEntry(hEChargedClone,"all","L");
+      pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
+      pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
+      pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
+      pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
+      pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
+      pLegend3ch.SetFillColor(10);
+      pLegend3ch.SetBorderSize(1);
+      pLegend3ch.Draw();
+      
+      c3ch->cd(2) ;
+      hPtChargedClone->SetMaximum(1.2);
+      hPtChargedClone->SetMinimum(0.001);      
+      hPtChargedClone->SetLineColor(3);
+      hPtChargedClone->SetYTitle("track matched / all");
+      hPi0PtChargedClone->Divide(hPi0Pt);
+      hGamPtChargedClone->Divide(hGamPt);
+      hElePtChargedClone->Divide(hElePt);
+      hNeHadPtChargedClone->Divide(hNeHadPt);
+      hChHadPtChargedClone->Divide(hChHadPt);
+      hPtChargedClone->Draw();
+      hPi0PtChargedClone->Draw("same");
+      hGamPtChargedClone->Draw("same");
+      hElePtChargedClone->Draw("same");
+      hNeHadPtChargedClone->Draw("same");
+      hChHadPtChargedClone->Draw("same");
+      
+      c3ch->cd(4) ;
+      hEtaChargedClone->SetMaximum(1.2);
+      hEtaChargedClone->SetMinimum(0.001);     
+      hEtaChargedClone->SetLineColor(3);
+      hEtaChargedClone->SetYTitle("track matched / all");
+      hPi0EtaChargedClone->Divide(hPi0Eta);
+      hGamEtaChargedClone->Divide(hGamEta);
+      hEleEtaChargedClone->Divide(hEleEta);
+      hNeHadEtaChargedClone->Divide(hNeHadEta);
+      hChHadEtaChargedClone->Divide(hChHadEta);
+      hEtaChargedClone->Draw();
+      hPi0EtaChargedClone->Draw("same");
+      hGamEtaChargedClone->Draw("same");
+      hEleEtaChargedClone->Draw("same");
+      hNeHadEtaChargedClone->Draw("same");
+      hChHadEtaChargedClone->Draw("same");
+      
+      c3ch->cd(3) ;
+      hPhiChargedClone->SetMaximum(1.2);
+      hPhiChargedClone->SetMinimum(0.001);
+      hPhiChargedClone->SetLineColor(3);
+      hPhiChargedClone->SetYTitle("track matched / all");
+      hPi0PhiChargedClone->Divide(hPi0Phi);
+      hGamPhiChargedClone->Divide(hGamPhi);
+      hElePhiChargedClone->Divide(hElePhi);
+      hNeHadPhiChargedClone->Divide(hNeHadPhi);
+      hChHadPhiChargedClone->Divide(hChHadPhi);
+      hPhiChargedClone->Draw();
+      hPi0PhiChargedClone->Draw("same");
+      hGamPhiChargedClone->Draw("same");
+      hElePhiChargedClone->Draw("same");
+      hNeHadPhiChargedClone->Draw("same");
+      hChHadPhiChargedClone->Draw("same");
+      
+      sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
+      c3ch->Print(name); printf("Plot: %s\n",name);
+      
+    }  
+  }
+  //Track-matching distributions
   
        sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
        TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
@@ -5218,7 +5131,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");              
        pLegendpE0.SetFillColor(10);
        pLegendpE0.SetBorderSize(1);
-    //pLegendpE0.Draw();
+  //pLegendpE0.Draw();
   
        cme->cd(1);
        if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
@@ -5348,12 +5261,12 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
     fhMCChHad1pOverER02->Draw("same");
     fhMCNeutral1pOverER02->Draw("same");
     
-      //               TLegend pLegendpE2(0.65,0.55,0.9,0.8);
-      //               pLegendpE2.SetTextSize(0.06);
-      //               pLegendpE2.SetHeader("dR < 0.02");
-      //               pLegendpE2.SetFillColor(10);
-      //               pLegendpE2.SetBorderSize(1);
-      //               pLegendpE2.Draw();
+    //         TLegend pLegendpE2(0.65,0.55,0.9,0.8);
+    //         pLegendpE2.SetTextSize(0.06);
+    //         pLegendpE2.SetHeader("dR < 0.02");
+    //         pLegendpE2.SetFillColor(10);
+    //         pLegendpE2.SetBorderSize(1);
+    //         pLegendpE2.Draw();
     
     sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
     cmpoe->Print(name); printf("Plot: %s\n",name);