]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
more track matching plots/histograms added, also some cosmetics to the plots
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Jun 2009 14:54:31 +0000 (14:54 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Jun 2009 14:54:31 +0000 (14:54 +0000)
PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
PWG4/PartCorrDep/AliAnaCalorimeterQA.h

index bbc4e329bd4f84e224831663c36271d4750e714e..6f34a4b1fe0cb1c9ae526f02f6490230d83f0058 100755 (executable)
@@ -58,13 +58,19 @@ ClassImp(AliAnaCalorimeterQA)
     fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0),  fhEMR(0), fhHaVxyz(0),  fhHaR(0),
     fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0), 
     fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0), fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
-    fhGam2E(0),fhGam2Pt(0),fhGam2Phi(0),fhGam2Eta(0),
     fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
     fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0), fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0), 
     fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
+       fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0), 
+       fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
+       fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0), 
+       fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0), 
+       fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
     fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
     fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
-    fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0)
+    fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
+       fhMCChHad1pOverE(0),fhMCChHad1dR(0),fhMCChHad2MatchdEdx(0),fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
+    fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
 {
   //Default Ctor
 
@@ -94,14 +100,22 @@ AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
   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),
-  fhGam2E(qa.fhGam2E), fhGam2Pt(qa.fhGam2Pt), fhGam2Phi(qa.fhGam2Phi),fhGam2Eta(qa.fhGam2Eta), 
   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)
+  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
   
@@ -172,7 +186,6 @@ AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA
   fhGamDeltaE   = qa.fhDeltaE; fhGamDeltaPt  = qa.fhDeltaPt; fhGamDeltaPhi = qa.fhDeltaPhi; fhGamDeltaEta = qa.fhDeltaEta;
        
   fhGamRatioE   = qa.fhGamRatioE;  fhGamRatioPt  = qa.fhGamRatioPt;  fhGamRatioPhi = qa.fhGamRatioPhi;  fhGamRatioEta = qa.fhGamRatioEta;
-  fhGam2E   = qa.fhGam2E;       fhGam2Pt  = qa.fhGam2Pt; fhGam2Phi = qa.fhGam2Phi; fhGam2Eta = qa.fhGam2Eta;
 
   fhEleE = qa.fhEleE ;fhElePt = qa.fhElePt ;fhElePhi = qa.fhElePhi ;fhEleEta = qa.fhEleEta ;
   fhPi0E = qa.fhPi0E ;fhPi0Pt = qa.fhPi0Pt ;fhPi0Phi = qa.fhPi0Phi ;fhPi0Eta = qa.fhPi0Eta ; 
@@ -182,10 +195,25 @@ AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA
   fhGenGamAccPt = qa.fhGenGamAccPt ;fhGenGamAccEta = qa.fhGenGamAccEta ;fhGenGamAccPhi = qa.fhGenGamAccPhi ;
   fhGenPi0AccPt = qa.fhGenPi0AccPt ;fhGenPi0AccEta = qa.fhGenPi0AccEta; fhGenPi0AccPhi = qa.fhGenPi0AccPhi ;   
                
-  fh1pOverE = qa.fh1pOverE;
-  fh1dR = qa.fh1dR;
+  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;    
+       
+  fh1pOverE    = qa.fh1pOverE;
+  fh1dR        = qa.fh1dR;
   fh2MatchdEdx = qa.fh2MatchdEdx;
-  fh2EledEdx = qa.fh2EledEdx;  
+  fh2EledEdx   = qa.fh2EledEdx;        
+       
+  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;
        
   return *this;
 
@@ -358,19 +386,23 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                
                //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 (GeV)");
+               fhGamE->SetXTitle("E_{rec} (GeV)");
+               fhGamE->SetXTitle("E_{gen} (GeV)");
                outputContainer->Add(fhGamE);
                
                fhGamPt  = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhGamPt->SetXTitle("p_{T} (GeV/c)");
+               fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
+               fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
                outputContainer->Add(fhGamPt);
                
                fhGamPhi  = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax); 
-               fhGamPhi->SetXTitle("#phi (rad)");
+               fhGamPhi->SetXTitle("#phi_{rec} (rad)");
+               fhGamPhi->SetYTitle("#phi_{gen} (rad)");
                outputContainer->Add(fhGamPhi);
                
                fhGamEta  = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax); 
-               fhGamEta->SetXTitle("#eta ");
+               fhGamEta->SetXTitle("#eta_{rec} ");
+               fhGamEta->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fhGamEta);
                
                fhGamDeltaE  = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", 200,-50,50); 
@@ -405,90 +437,189 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
                outputContainer->Add(fhGamRatioEta);
 
-               fhGam2E  = new TH2F ("hGam2E","#gamma E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); 
-               fhGam2E->SetXTitle("E_{rec} (GeV)");
-               fhGam2E->SetYTitle("E_{gen} (GeV)");
-               outputContainer->Add(fhGam2E);    
-               
-               fhGam2Pt  = new TH2F ("hGam2Pt","#gamma p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); 
-               fhGam2Pt->SetXTitle("p_{T,rec} (GeV/c)");
-               fhGam2Pt->SetYTitle("p_{T,gen} (GeV/c)");
-               outputContainer->Add(fhGam2Pt);
-               
-               fhGam2Phi  = new TH2F ("hGam2Phi","#gamma #phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax); 
-               fhGam2Phi->SetXTitle("#phi_{rec} (rad)");
-               fhGam2Phi->SetYTitle("#phi_{gen} (rad)");
-               outputContainer->Add(fhGam2Phi);
-               
-               fhGam2Eta  = new TH2F ("hGam2Eta","#gamma #eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax); 
-               fhGam2Eta->SetXTitle("#eta_{rec} ");
-               fhGam2Eta->SetYTitle("#eta_{gen} ");
-               outputContainer->Add(fhGam2Eta);
-
-               fhPi0E  = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^0", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhPi0E->SetXTitle("E (GeV)");
+               fhPi0E  = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhPi0E->SetXTitle("E_{rec} (GeV)");
+               fhPi0E->SetYTitle("E_{gen} (GeV)");
                outputContainer->Add(fhPi0E);
                
                fhPi0Pt  = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhPi0Pt->SetXTitle("p_{T} (GeV/c)");
+               fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
+               fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
                outputContainer->Add(fhPi0Pt);
                
                fhPi0Phi  = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax); 
-               fhPi0Phi->SetXTitle("#phi (rad)");
+               fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
+               fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
                outputContainer->Add(fhPi0Phi);
                
                fhPi0Eta  = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax); 
-               fhPi0Eta->SetXTitle("#eta ");
+               fhPi0Eta->SetXTitle("#eta_{rec} ");
+               fhPi0Eta->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fhPi0Eta);
                
                fhEleE  = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhEleE->SetXTitle("E (GeV)");
+               fhEleE->SetXTitle("E_{rec} (GeV)");
+               fhEleE->SetXTitle("E_{gen} (GeV)");             
                outputContainer->Add(fhEleE);           
                
                fhElePt  = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhElePt->SetXTitle("p_{T} (GeV/c)");
+               fhElePt->SetXTitle("p_{T rec} (GeV/c)");
+               fhElePt->SetYTitle("p_{T gen} (GeV/c)");
                outputContainer->Add(fhElePt);
                
-               fhElePhi  = new TH2F ("hElePhi","#phi reconstructed vs E generated frome^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax); 
-               fhElePhi->SetXTitle("#phi (rad)");
+               fhElePhi  = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax); 
+               fhElePhi->SetXTitle("#phi_{rec} (rad)");
+               fhElePhi->SetYTitle("#phi_{gen} (rad)");
                outputContainer->Add(fhElePhi);
                
                fhEleEta  = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax); 
-               fhEleEta->SetXTitle("#eta ");
+               fhEleEta->SetXTitle("#eta_{rec} ");
+               fhEleEta->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fhEleEta);
                
-               fhNeHadE  = new TH2F ("hNeHadE","E reconstructed vs E generated from #pi^0", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhNeHadE->SetXTitle("E (GeV)");
+               fhNeHadE  = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhNeHadE->SetXTitle("E_{rec} (GeV)");
+               fhNeHadE->SetYTitle("E_{gen} (GeV)");
                outputContainer->Add(fhNeHadE);
                
                fhNeHadPt  = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhNeHadPt->SetXTitle("p_{T} (GeV/c)");
+               fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
+               fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
                outputContainer->Add(fhNeHadPt);
                
                fhNeHadPhi  = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax); 
-               fhNeHadPhi->SetXTitle("#phi (rad)");
+               fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
+               fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
                outputContainer->Add(fhNeHadPhi);
                
                fhNeHadEta  = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax); 
-               fhNeHadEta->SetXTitle("#eta ");
+               fhNeHadEta->SetXTitle("#eta_{rec} ");
+               fhNeHadEta->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fhNeHadEta);
                
-               fhChHadE  = new TH2F ("hChHadE","E reconstructed vs E generated from #pi^0", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhChHadE->SetXTitle("E (GeV)");
+               fhChHadE  = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhChHadE->SetXTitle("E_{rec} (GeV)");
+               fhChHadE->SetYTitle("E_{gen} (GeV)");
                outputContainer->Add(fhChHadE);
                
                fhChHadPt  = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
-               fhChHadPt->SetXTitle("p_{T} (GeV/c)");
+               fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
+               fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
                outputContainer->Add(fhChHadPt);
                
                fhChHadPhi  = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax); 
-               fhChHadPhi->SetXTitle("#phi (rad)");
+               fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
+               fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
                outputContainer->Add(fhChHadPhi);
                
                fhChHadEta  = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax); 
-               fhChHadEta->SetXTitle("#eta ");
+               fhChHadEta->SetXTitle("#eta_{rec} ");
+               fhChHadEta->SetYTitle("#eta_{gen} ");
                outputContainer->Add(fhChHadEta);
                
+               //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)");
+               fhGamECharged->SetXTitle("E_{gen} (GeV)");
+               outputContainer->Add(fhGamECharged);
+               
+               fhGamPtCharged  = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
+               fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
+               outputContainer->Add(fhGamPtCharged);
+               
+               fhGamPhiCharged  = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax); 
+               fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
+               fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
+               outputContainer->Add(fhGamPhiCharged);
+               
+               fhGamEtaCharged  = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax); 
+               fhGamEtaCharged->SetXTitle("#eta_{rec} ");
+               fhGamEtaCharged->SetYTitle("#eta_{gen} ");
+               outputContainer->Add(fhGamEtaCharged);
+               
+               fhPi0ECharged  = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
+               fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
+               outputContainer->Add(fhPi0ECharged);
+               
+               fhPi0PtCharged  = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
+               fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
+               outputContainer->Add(fhPi0PtCharged);
+               
+               fhPi0PhiCharged  = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax); 
+               fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
+               fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
+               outputContainer->Add(fhPi0PhiCharged);
+               
+               fhPi0EtaCharged  = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax); 
+               fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
+               fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
+               outputContainer->Add(fhPi0EtaCharged);
+               
+               fhEleECharged  = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhEleECharged->SetXTitle("E_{rec} (GeV)");
+               fhEleECharged->SetXTitle("E_{gen} (GeV)");              
+               outputContainer->Add(fhEleECharged);            
+               
+               fhElePtCharged  = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
+               fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
+               outputContainer->Add(fhElePtCharged);
+               
+               fhElePhiCharged  = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax); 
+               fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
+               fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
+               outputContainer->Add(fhElePhiCharged);
+               
+               fhEleEtaCharged  = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax); 
+               fhEleEtaCharged->SetXTitle("#eta_{rec} ");
+               fhEleEtaCharged->SetYTitle("#eta_{gen} ");
+               outputContainer->Add(fhEleEtaCharged);
+               
+               fhNeHadECharged  = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
+               fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
+               outputContainer->Add(fhNeHadECharged);
+               
+               fhNeHadPtCharged  = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
+               fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
+               outputContainer->Add(fhNeHadPtCharged);
+               
+               fhNeHadPhiCharged  = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax); 
+               fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
+               fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
+               outputContainer->Add(fhNeHadPhiCharged);
+               
+               fhNeHadEtaCharged  = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax); 
+               fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
+               fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
+               outputContainer->Add(fhNeHadEtaCharged);
+               
+               fhChHadECharged  = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhChHadECharged->SetXTitle("E_{rec} (GeV)");
+               fhChHadECharged->SetYTitle("E_{gen} (GeV)");
+               outputContainer->Add(fhChHadECharged);
+               
+               fhChHadPtCharged  = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax); 
+               fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
+               fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
+               outputContainer->Add(fhChHadPtCharged);
+               
+               fhChHadPhiCharged  = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax); 
+               fhChHadPhiCharged->SetXTitle("#phi (rad)");
+               fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
+               fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
+               outputContainer->Add(fhChHadPhiCharged);
+               
+               fhChHadEtaCharged  = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax); 
+               fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
+               fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
+               outputContainer->Add(fhChHadEtaCharged);
+               
                //Vertex of generated particles 
                
                fhEMVxyz  = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",100,0,500,100,0,500);//,100,0,500); 
@@ -513,6 +644,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
                outputContainer->Add(fhHaR);
                
+
                
                //Pure MC
                fhGenGamPt  = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
@@ -601,11 +733,11 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        }
        
        
-       fh1pOverE = new TH1F("h1pOverE","EMCAL-TRACK matches p/E",100,0.,10.);
+       fh1pOverE = new TH1F("h1pOverE","TRACK matches p/E",100,0.,10.);
        fh1pOverE->SetXTitle("p/E");
        outputContainer->Add(fh1pOverE);
        
-       fh1dR = new TH1F("h1dR","EMCAL-TRACK matches dR",300, 0.,TMath::Pi());
+       fh1dR = new TH1F("h1dR","TRACK matches dR",300, 0.,TMath::Pi());
        fh1dR->SetXTitle("#Delta R (rad)");
        outputContainer->Add(fh1dR) ;
        
@@ -619,6 +751,61 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        fh2EledEdx->SetYTitle("<dE/dx>");
        outputContainer->Add(fh2EledEdx) ;
        
+       fhMCEle1pOverE = new TH1F("hMCEle1pOverE","TRACK matches p/E, MC electrons",100,0.,10.);
+       fhMCEle1pOverE->SetXTitle("p/E");
+       outputContainer->Add(fhMCEle1pOverE);
+       
+       fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",300, 0.,TMath::Pi());
+       fhMCEle1dR->SetXTitle("#Delta R (rad)");
+       outputContainer->Add(fhMCEle1dR) ;
+       
+       fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",200,0.,50.,200,0.,400.);
+       fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
+       fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
+       outputContainer->Add(fhMCEle2MatchdEdx);
+       
+       fhMCChHad1pOverE = new TH1F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",100,0.,10.);
+       fhMCChHad1pOverE->SetXTitle("p/E");
+       outputContainer->Add(fhMCChHad1pOverE);
+       
+       fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",300, 0.,TMath::Pi());
+       fhMCChHad1dR->SetXTitle("#Delta R (rad)");
+       outputContainer->Add(fhMCChHad1dR) ;
+       
+       fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",200,0.,50.,200,0.,400.);
+       fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
+       fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
+       outputContainer->Add(fhMCChHad2MatchdEdx);
+       
+       fhMCNeutral1pOverE = new TH1F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",100,0.,10.);
+       fhMCNeutral1pOverE->SetXTitle("p/E");
+       outputContainer->Add(fhMCNeutral1pOverE);
+       
+       fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",300, 0.,TMath::Pi());
+       fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
+       outputContainer->Add(fhMCNeutral1dR) ;
+       
+       fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",200,0.,50.,200,0.,400.);
+       fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
+       fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
+       outputContainer->Add(fhMCNeutral2MatchdEdx);
+       
+       fh1pOverER02 = new TH1F("h1pOverER02","TRACK matches p/E, all",100,0.,10.);
+       fh1pOverER02->SetXTitle("p/E");
+       outputContainer->Add(fh1pOverER02);
+       
+       fhMCEle1pOverER02 = new TH1F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",100,0.,10.);
+       fhMCEle1pOverER02->SetXTitle("p/E");
+       outputContainer->Add(fhMCEle1pOverER02);
+       
+       fhMCChHad1pOverER02 = new TH1F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",100,0.,10.);
+       fhMCChHad1pOverER02->SetXTitle("p/E");
+       outputContainer->Add(fhMCChHad1pOverER02);
+       
+       fhMCNeutral1pOverER02 = new TH1F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",100,0.,10.);
+       fhMCNeutral1pOverER02->SetXTitle("p/E");
+       outputContainer->Add(fhMCNeutral1pOverER02);
+       
        return outputContainer;
 }
 
@@ -714,64 +901,11 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                fhPhi   ->Fill(phi);
                fhEta   ->Fill(eta);
                fhEtaPhi->Fill(eta,phi);
-
+               
                //matched cluster with tracks
-               if(calo->GetNTracksMatched() > 0){
-                       fhECharged     ->Fill(e);               
-                       fhPtCharged    ->Fill(pt);
-                       fhPhiCharged   ->Fill(phi);
-                       fhEtaCharged   ->Fill(eta);
-                       fhEtaPhiCharged->Fill(eta,phi);                         
-                       if((!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent"))) {
-                               AliESDEvent *esd = (AliESDEvent*) GetReader()->GetInputEvent();
-                               AliESDCaloCluster * esdcalo = (AliESDCaloCluster*) esd->GetCaloCluster(calo->GetID());
-                               Int_t trackIndex = esdcalo->GetTrackMatched();
-                               //printf("track index %d ntracks %d\n", trackIndex, esd->GetNumberOfTracks());
-                               if(trackIndex >= 0){
-                                       AliESDtrack* track = (AliESDtrack*) esd->GetTrack(trackIndex);
-                                       if (track && track->GetOuterParam() ) {
-                               
-                                               Double_t tphi = track->GetOuterParam()->Phi();
-                                               Double_t teta = track->GetOuterParam()->Eta();
-                                               Double_t tmom = track->GetOuterParam()->P();
-                                               Double_t deta = teta - eta;
-                                               Double_t dphi = tphi - phi;
-                                               if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
-                                               if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
-                                               Double_t dR = sqrt(dphi*dphi + deta*deta);
-                                               
-                                               Double_t pOverE = tmom/e;
-                                               
-                                               fh1pOverE->Fill(pOverE);
-                                               fh1dR->Fill(dR);
-                                               fh2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
-                                               
-                                               int nITS = track->GetNcls(0);
-                                               int nTPC = track->GetNcls(1);
-                                               if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
-                                                  && calo->GetNCells() > 1 && nITS > 3 && nTPC > 20) {
-                                                       fh2EledEdx->Fill(track->P(),track->GetTPCsignal());
-                                                       //cout<<track->P()<<" "<<track->P()<<endl;
-                                               }
-                                       } 
-                                       else if(!track->GetOuterParam()){
-                                         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 ( (track->GetStatus() & status) == status) printf("ITS+TPC\n");
-                                       }
-                                       else {
-                                               Printf("ERROR: Could not receive track %d", trackIndex);
-                                       }
-                               }// non negative track index
-                       }//do only if input are ESDs
-               }// at least one track matched
+               Int_t ntracksmatched = calo->GetNTracksMatched();
                
+               //Fill histograms only possible when simulation
                if(IsDataMC()){
                //Play with the MC stack if available
                    Int_t label = calo->GetLabel(0);
@@ -793,8 +927,8 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                    //Float_t vz = primary->Vz();
                    Float_t r = TMath::Sqrt(vx*vx + vy*vy);
                    if((pdg == 22 || TMath::Abs(pdg)==11) && primary->GetStatusCode()!=1) {
-                     fhEMVxyz   ->Fill(vx,vy);//,vz);
-                     fhEMR      ->Fill(e,r);
+                               fhEMVxyz   ->Fill(vx,vy);//,vz);
+                               fhEMR      ->Fill(e,r);
                    }
                    
                    //                  printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
@@ -806,14 +940,14 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                    Int_t mother= primary->GetFirstMother();
                    Int_t finallabel = -1;
                    if(status == 0){
-                     while(mother >= 0){
-                       primary = GetMCStack()->Particle(mother);
-                       finallabel = mother;
-                       status = primary->GetStatusCode();
-                       mother= primary->GetFirstMother();
-                       if(status == 1) break;             
-                       //printf("mother %d\n",mother);
-                     } 
+                               while(mother >= 0){
+                                       primary = GetMCStack()->Particle(mother);
+                                       finallabel = mother;
+                                       status = primary->GetStatusCode();
+                                       mother= primary->GetFirstMother();
+                                       if(status == 1) break;             
+                                       //printf("mother %d\n",mother);
+                               }       
                    }
                    
                        fh2E      ->Fill(e, primary->Energy());
@@ -832,119 +966,230 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                    //cout<<"Final Label "<<finallabel<<" mother "<<mother<<endl;
                    pdg = primary->GetPdgCode();
                        Double_t  charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
-
+                       
                    if(pdg == 22){
-                     //cout<<"pdg "<<pdg<<" status "<<status<<" "<<primary->GetStatusCode()<<endl;     
-                     TParticle *pi0 = 0x0;
-                     TParticle *p1 = 0x0;
-                     TParticle *p2 = 0x0;
-                     TParticle * tmp = 0x0;
-                     Int_t pdgpi0 = 0;
-                     Int_t mothertmp = 0;
-                     //Check if it is a decay photon from pi0, in this case, check if both decay contribute cluster
-                     Bool_t ok1 = kFALSE;
-                     Bool_t ok2 = kFALSE;
-                     
-                     if(calo->GetNLabel() > 1){
-                       if(pdg !=111){
-                         while(mother >= 0){
-                           pi0 = GetMCStack()->Particle(mother);
-                           pdgpi0 = pi0->GetPdgCode();
-                           if(pdgpi0 == 111) break;
-                           mother= pi0->GetFirstMother();
-                           //printf("mother %d\n",mother);
-                         }
-                       }
-                       else   pi0 = primary;
-                       //cout<<"MOTHER PI0 LABEL "<<mother<<" pt" << pi0->Pt()<<endl;
-                       if(pi0->GetNDaughters() == 2){
-                         //  cout<<"pi0, 2 daughters "<<endl;
-                         Int_t id1 = pi0->GetFirstDaughter();
-                         Int_t id2 = pi0->GetFirstDaughter()+1;
-                         p1=GetMCStack()->Particle(id1);
-                         p2=GetMCStack()->Particle(id2);
-                         
-                         if(p1->GetFirstMother()!=p2->GetFirstMother()) cout <<"Decay photon mothers are not the same!!"<<endl;
-                         if(p1->GetPdgCode()==22 && p2->GetPdgCode()==22){
-                           // cout<<"2 photons, labels "<< id1<<" "<<id2<<endl;
-                           for(UInt_t ilabel = 0; ilabel < calo->GetNLabel(); ilabel++){
-                             Int_t iprim = calo->GetLabel(ilabel);
-                             //cout<<"iprim "<<iprim<<endl;
-                             if (iprim == id1) ok1 = kTRUE;
-                             else if (iprim == id2) ok2 = kTRUE;
-                             mothertmp = iprim;
-                             while(mothertmp >= 0){
-                               tmp = GetMCStack()->Particle(mothertmp);                                    
-                               mothertmp= tmp->GetFirstMother();
-                               //      cout<<"mothertmp "<<mothertmp<<" "<<tmp->GetName()<< " pt "<<tmp->Pt()<<endl;
-                               if (mothertmp == id1) ok1 = kTRUE;
-                               else if (mothertmp == id2) ok2 = kTRUE;
-                               if(ok1 && ok2) break;
-                               //printf("mother %d\n",mother);
-                             }
-                           } 
-                         }//2 photon daughters
-                       }////mother pi0, 2 daughers
-                     }//more than one contribution to clust
-                     
-                     if(ok1 && ok2){
-                       //cout<<"Fill pi0"<< "E  "<< e <<" prim E "<<primary->Energy()<<endl;
-                       fhPi0E     ->Fill(e,primary->Energy()); 
-                       fhPi0Pt    ->Fill(pt,primary->Pt());
-                       fhPi0Eta   ->Fill(eta,primary->Eta());  
-                       fhPi0Phi   ->Fill(phi,primary->Phi());                                  
-                     }
-                     else{
-                       fhGamE     ->Fill(e,primary->Energy()); 
-                       fhGamPt    ->Fill(pt,primary->Pt());
-                       fhGamEta   ->Fill(eta,primary->Eta());  
-                       fhGamPhi   ->Fill(phi,primary->Phi());
-                       fhGamDeltaE  ->Fill(primary->Energy()-e);
-                       fhGamDeltaPt ->Fill(primary->Pt()-pt);
-                       fhGamDeltaPhi->Fill(primary->Phi()-phi);
-                       fhGamDeltaEta->Fill(primary->Eta()-eta);
-                       if(primary->Energy() > 0) fhGamRatioE  ->Fill(e/primary->Energy());
-                       if(primary->Pt()     > 0) fhGamRatioPt ->Fill(pt/primary->Pt());
-                       if(primary->Phi()    > 0) fhGamRatioPhi->Fill(phi/primary->Phi());
-                       if(primary->Eta()    > 0) fhGamRatioEta->Fill(eta/primary->Eta());
-                       fhGam2E      ->Fill(e, primary->Energy());
-                       fhGam2Pt     ->Fill(pt, primary->Pt());
-                       fhGam2Phi    ->Fill(phi, primary->Phi());
-                       fhGam2Eta    ->Fill(eta, primary->Eta());
-                     }
+                               //cout<<"pdg "<<pdg<<" status "<<status<<" "<<primary->GetStatusCode()<<endl;   
+                               TParticle *pi0 = 0x0;
+                               TParticle *p1 = 0x0;
+                               TParticle *p2 = 0x0;
+                               TParticle * tmp = 0x0;
+                               Int_t pdgpi0 = 0;
+                               Int_t mothertmp = 0;
+                               //Check if it is a decay photon from pi0, in this case, check if both decay contribute cluster
+                               Bool_t ok1 = kFALSE;
+                               Bool_t ok2 = kFALSE;
+                               
+                               if(calo->GetNLabel() > 1){
+                                       if(pdg !=111){
+                                               while(mother >= 0){
+                                                       pi0 = GetMCStack()->Particle(mother);
+                                                       pdgpi0 = pi0->GetPdgCode();
+                                                       if(pdgpi0 == 111) break;
+                                                       mother= pi0->GetFirstMother();
+                                                       //printf("mother %d\n",mother);
+                                               }
+                                       }
+                                       else   pi0 = primary;
+                                       //cout<<"MOTHER PI0 LABEL "<<mother<<" pt" << pi0->Pt()<<endl;
+                                       if(pi0->GetNDaughters() == 2){
+                                               //  cout<<"pi0, 2 daughters "<<endl;
+                                               Int_t id1 = pi0->GetFirstDaughter();
+                                               Int_t id2 = pi0->GetFirstDaughter()+1;
+                                               p1=GetMCStack()->Particle(id1);
+                                               p2=GetMCStack()->Particle(id2);
+                                               
+                                               if(p1->GetFirstMother()!=p2->GetFirstMother()) cout <<"Decay photon mothers are not the same!!"<<endl;
+                                               if(p1->GetPdgCode()==22 && p2->GetPdgCode()==22){
+                                                       // cout<<"2 photons, labels "<< id1<<" "<<id2<<endl;
+                                                       for(UInt_t ilabel = 0; ilabel < calo->GetNLabel(); ilabel++){
+                                                               Int_t iprim = calo->GetLabel(ilabel);
+                                                               //cout<<"iprim "<<iprim<<endl;
+                                                               if (iprim == id1) ok1 = kTRUE;
+                                                               else if (iprim == id2) ok2 = kTRUE;
+                                                               mothertmp = iprim;
+                                                               while(mothertmp >= 0){
+                                                                       tmp = GetMCStack()->Particle(mothertmp);                                    
+                                                                       mothertmp= tmp->GetFirstMother();
+                                                                       //      cout<<"mothertmp "<<mothertmp<<" "<<tmp->GetName()<< " pt "<<tmp->Pt()<<endl;
+                                                                       if (mothertmp == id1) ok1 = kTRUE;
+                                                                       else if (mothertmp == id2) ok2 = kTRUE;
+                                                                       if(ok1 && ok2) break;
+                                                                       //printf("mother %d\n",mother);
+                                                               }
+                                                       } 
+                                               }//2 photon daughters
+                                       }////mother pi0, 2 daughers
+                               }//more than one contribution to clust
+                               
+                               if(ok1 && ok2){
+                                       //cout<<"Fill pi0"<< "E  "<< e <<" prim E "<<primary->Energy()<<endl;
+                                       fhPi0E     ->Fill(e,primary->Energy()); 
+                                       fhPi0Pt    ->Fill(pt,primary->Pt());
+                                       fhPi0Eta   ->Fill(eta,primary->Eta());  
+                                       fhPi0Phi   ->Fill(phi,primary->Phi());
+                                       if( ntracksmatched > 0){
+                                               fhPi0ECharged     ->Fill(e,primary->Energy());          
+                                               fhPi0PtCharged    ->Fill(pt,primary->Pt());
+                                               fhPi0PhiCharged   ->Fill(phi,primary->Phi());
+                                               fhPi0EtaCharged   ->Fill(eta,primary->Eta());
+                                       }
+                               }
+                               else{
+                                       fhGamE     ->Fill(e,primary->Energy()); 
+                                       fhGamPt    ->Fill(pt,primary->Pt());
+                                       fhGamEta   ->Fill(eta,primary->Eta());  
+                                       fhGamPhi   ->Fill(phi,primary->Phi());
+                                       fhGamDeltaE  ->Fill(primary->Energy()-e);
+                                       fhGamDeltaPt ->Fill(primary->Pt()-pt);  
+                                       fhGamDeltaPhi->Fill(primary->Phi()-phi);
+                                       fhGamDeltaEta->Fill(primary->Eta()-eta);
+                                       if(primary->Energy() > 0) fhGamRatioE  ->Fill(e/primary->Energy());
+                                       if(primary->Pt()     > 0) fhGamRatioPt ->Fill(pt/primary->Pt());
+                                       if(primary->Phi()    > 0) fhGamRatioPhi->Fill(phi/primary->Phi());
+                                       if(primary->Eta()    > 0) fhGamRatioEta->Fill(eta/primary->Eta());
+                                       if( ntracksmatched > 0){
+                                               fhGamECharged     ->Fill(e,primary->Energy());          
+                                               fhGamPtCharged    ->Fill(pt,primary->Pt());
+                                               fhGamPhiCharged   ->Fill(phi,primary->Phi());
+                                               fhGamEtaCharged   ->Fill(eta,primary->Eta());
+                                       }
+                               }
                    }//pdg == 22
                    else if(TMath::Abs(pdg) == 11) {
-                     fhEleE     ->Fill(e,primary->Energy());   
-                     fhElePt    ->Fill(pt,primary->Pt());
-                     fhEleEta   ->Fill(eta,primary->Eta());    
-                     fhElePhi   ->Fill(phi,primary->Phi());
-                     fhEMVxyz   ->Fill(vx,vy);//,vz);
-                     fhEMR      ->Fill(e,r);
+                               fhEleE     ->Fill(e,primary->Energy()); 
+                               fhElePt    ->Fill(pt,primary->Pt());
+                               fhEleEta   ->Fill(eta,primary->Eta());  
+                               fhElePhi   ->Fill(phi,primary->Phi());
+                               fhEMVxyz   ->Fill(vx,vy);//,vz);
+                               fhEMR      ->Fill(e,r);
+                               if( ntracksmatched > 0){
+                                       fhEleECharged     ->Fill(e,primary->Energy());          
+                                       fhElePtCharged    ->Fill(pt,primary->Pt());
+                                       fhElePhiCharged   ->Fill(phi,primary->Phi());
+                                       fhEleEtaCharged   ->Fill(eta,primary->Eta());
+                               }
                    }
                    else if(pdg == 111) {
-                     fhPi0E     ->Fill(e,primary->Energy());   
-                     fhPi0Pt    ->Fill(pt,primary->Pt());
-                     fhPi0Eta   ->Fill(eta,primary->Eta());    
-                     fhPi0Phi   ->Fill(phi,primary->Phi());
+                               fhPi0E     ->Fill(e,primary->Energy()); 
+                               fhPi0Pt    ->Fill(pt,primary->Pt());
+                               fhPi0Eta   ->Fill(eta,primary->Eta());  
+                               fhPi0Phi   ->Fill(phi,primary->Phi());
+                               if( ntracksmatched > 0){
+                                       fhPi0ECharged     ->Fill(e,primary->Energy());          
+                                       fhPi0PtCharged    ->Fill(pt,primary->Pt());
+                                       fhPi0PhiCharged   ->Fill(phi,primary->Phi());
+                                       fhPi0EtaCharged   ->Fill(eta,primary->Eta());
+                               }
                    }
                    else if(charge == 0){
-                     fhNeHadE     ->Fill(e,primary->Energy()); 
-                     fhNeHadPt    ->Fill(pt,primary->Pt());
-                     fhNeHadEta   ->Fill(eta,primary->Eta());  
-                     fhNeHadPhi   ->Fill(phi,primary->Phi());  
-                     fhHaVxyz     ->Fill(vx,vy);//,vz);
-                     fhHaR        ->Fill(e,r);
+                               fhNeHadE     ->Fill(e,primary->Energy());       
+                               fhNeHadPt    ->Fill(pt,primary->Pt());
+                               fhNeHadEta   ->Fill(eta,primary->Eta());        
+                               fhNeHadPhi   ->Fill(phi,primary->Phi());        
+                               fhHaVxyz     ->Fill(vx,vy);//,vz);
+                               fhHaR        ->Fill(e,r);
+                               if( ntracksmatched > 0){
+                                       fhNeHadECharged     ->Fill(e,primary->Energy());                
+                                       fhNeHadPtCharged    ->Fill(pt,primary->Pt());
+                                       fhNeHadPhiCharged   ->Fill(phi,primary->Phi());
+                                       fhNeHadEtaCharged   ->Fill(eta,primary->Eta());
+                               }
                    }
                    else if(charge!=0){
-                     fhChHadE     ->Fill(e,primary->Energy()); 
-                     fhChHadPt    ->Fill(pt,primary->Pt());
-                     fhChHadEta   ->Fill(eta,primary->Eta());  
-                     fhChHadPhi   ->Fill(phi,primary->Phi());  
-                     fhHaVxyz     ->Fill(vx,vy);//,vz);
-                     fhHaR        ->Fill(e,r);
+                               fhChHadE     ->Fill(e,primary->Energy());       
+                               fhChHadPt    ->Fill(pt,primary->Pt());
+                               fhChHadEta   ->Fill(eta,primary->Eta());        
+                               fhChHadPhi   ->Fill(phi,primary->Phi());        
+                               fhHaVxyz     ->Fill(vx,vy);//,vz);
+                               fhHaR        ->Fill(e,r);
+                               if( ntracksmatched > 0){
+                                       fhChHadECharged     ->Fill(e,primary->Energy());                
+                                       fhChHadPtCharged    ->Fill(pt,primary->Pt());
+                                       fhChHadPhiCharged   ->Fill(phi,primary->Phi());
+                                       fhChHadEtaCharged   ->Fill(eta,primary->Eta());
+                               }
                    }
                }//Work with stack also
                
+               //matched cluster with tracks
+               if( ntracksmatched > 0){
+                       fhECharged     ->Fill(e);               
+                       fhPtCharged    ->Fill(pt);
+                       fhPhiCharged   ->Fill(phi);
+                       fhEtaCharged   ->Fill(eta);
+                       fhEtaPhiCharged->Fill(eta,phi);                         
+                       if((!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent"))) {
+                               AliESDEvent *esd = (AliESDEvent*) GetReader()->GetInputEvent();
+                               AliESDCaloCluster * esdcalo = (AliESDCaloCluster*) esd->GetCaloCluster(calo->GetID());
+                               Int_t trackIndex = esdcalo->GetTrackMatched();
+                               //printf("track index %d ntracks %d\n", trackIndex, esd->GetNumberOfTracks());
+                               if(trackIndex >= 0){
+                                       AliESDtrack* track = (AliESDtrack*) esd->GetTrack(trackIndex);
+                                       if (track && track->GetOuterParam() ) {
+                                               
+                                               Double_t tphi = track->GetOuterParam()->Phi();
+                                               Double_t teta = track->GetOuterParam()->Eta();
+                                               Double_t tmom = track->GetOuterParam()->P();
+                                               Double_t deta = teta - eta;
+                                               Double_t dphi = tphi - phi;
+                                               if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
+                                               if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
+                                               Double_t dR = sqrt(dphi*dphi + deta*deta);
+                                               
+                                               Double_t pOverE = tmom/e;
+                                               
+                                               fh1pOverE->Fill(pOverE);
+                                               if(dR < 0.02) fh1pOverER02->Fill(pOverE);
+                                               
+                                               fh1dR->Fill(dR);
+                                               fh2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
+                                           Int_t pdg = primary->GetPdgCode();
+                                               Double_t  charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
+                                               if(IsDataMC() && primary){ 
+                                                       if(TMath::Abs(pdg) == 11){
+                                                               fhMCEle1pOverE->Fill(pOverE);
+                                                               fhMCEle1dR->Fill(dR);
+                                                               fhMCEle2MatchdEdx->Fill(track->P(),track->GetTPCsignal());              
+                                                               if(dR < 0.02) fhMCEle1pOverER02->Fill(pOverE);
+                                                       }
+                                                       else if(charge!=0){
+                                                               fhMCChHad1pOverE->Fill(pOverE);
+                                                               fhMCChHad1dR->Fill(dR);
+                                                               fhMCChHad2MatchdEdx->Fill(track->P(),track->GetTPCsignal());    
+                                                               if(dR < 0.02) fhMCChHad1pOverER02->Fill(pOverE);
+                                                       }
+                                                       else if(charge == 0){
+                                                               fhMCNeutral1pOverE->Fill(pOverE);
+                                                               fhMCNeutral1dR->Fill(dR);
+                                                               fhMCNeutral2MatchdEdx->Fill(track->P(),track->GetTPCsignal());  
+                                                               if(dR < 0.02) fhMCNeutral1pOverER02->Fill(pOverE);
+                                                       }
+                                               }
+                                               int nITS = track->GetNcls(0);
+                                               int nTPC = track->GetNcls(1);
+                                               if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
+                                                  && calo->GetNCells() > 1 && nITS > 3 && nTPC > 20) {
+                                                       fh2EledEdx->Fill(track->P(),track->GetTPCsignal());
+                                               }
+                                       } 
+                                       else if(!track->GetOuterParam()){
+                                               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 ( (track->GetStatus() & status) == status) printf("ITS+TPC\n");
+                                       }
+                                       else {
+                                               Printf("ERROR: Could not receive track %d", trackIndex);
+                                       }
+                               }// non negative track index
+                       }//do only if input are ESDs
+               }// at least one track matched          
+               
                //Invariant mass
                if (nclusters > 1 ) {
                        for(Int_t jclus = iclus + 1 ; jclus < nclusters ; jclus++) {
@@ -1114,11 +1359,6 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
                fhGamRatioPhi = (TH1F *) outputList->At(index++); 
                fhGamRatioEta = (TH1F *) outputList->At(index++); 
 
-               fhGam2E       = (TH2F *) outputList->At(index++); 
-               fhGam2Pt      = (TH2F *) outputList->At(index++); 
-               fhGam2Phi     = (TH2F *) outputList->At(index++); 
-               fhGam2Eta     = (TH2F *) outputList->At(index++); 
-
                fhPi0E     = (TH2F *) outputList->At(index++); 
                fhPi0Pt    = (TH2F *) outputList->At(index++); 
                fhPi0Phi   = (TH2F *) outputList->At(index++); 
@@ -1139,6 +1379,31 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
                fhChHadPhi   = (TH2F *) outputList->At(index++); 
                fhChHadEta   = (TH2F *) outputList->At(index++);                                
                
+               fhGamECharged     = (TH2F *) outputList->At(index++); 
+               fhGamPtCharged    = (TH2F *) outputList->At(index++); 
+               fhGamPhiCharged   = (TH2F *) outputList->At(index++); 
+               fhGamEtaCharged   = (TH2F *) outputList->At(index++); 
+                               
+               fhPi0ECharged     = (TH2F *) outputList->At(index++); 
+               fhPi0PtCharged    = (TH2F *) outputList->At(index++); 
+               fhPi0PhiCharged   = (TH2F *) outputList->At(index++); 
+               fhPi0EtaCharged   = (TH2F *) outputList->At(index++);           
+               
+               fhEleECharged     = (TH2F *) outputList->At(index++); 
+               fhElePtCharged    = (TH2F *) outputList->At(index++); 
+               fhElePhiCharged   = (TH2F *) outputList->At(index++); 
+               fhEleEtaCharged   = (TH2F *) outputList->At(index++);           
+               
+               fhNeHadECharged     = (TH2F *) outputList->At(index++); 
+               fhNeHadPtCharged    = (TH2F *) outputList->At(index++); 
+               fhNeHadPhiCharged   = (TH2F *) outputList->At(index++); 
+               fhNeHadEtaCharged   = (TH2F *) outputList->At(index++);                 
+               
+               fhChHadECharged     = (TH2F *) outputList->At(index++); 
+               fhChHadPtCharged    = (TH2F *) outputList->At(index++); 
+               fhChHadPhiCharged   = (TH2F *) outputList->At(index++); 
+               fhChHadEtaCharged   = (TH2F *) outputList->At(index++);                                 
+               
 //             fhEMVxyz     = (TH3F *) outputList->At(index++); 
 //             fhHaVxyz     = (TH3F *) outputList->At(index++); 
                
@@ -1184,7 +1449,25 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
        fh2MatchdEdx = (TH2F *) outputList->At(index++);
        fh2EledEdx =   (TH2F *) outputList->At(index++);
        
-//     for(Int_t i = 0;  i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
+       if(IsDataMC()){
+               fhMCEle1pOverE =    (TH1F *) outputList->At(index++);
+               fhMCEle1dR =        (TH1F *) outputList->At(index++);
+               fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
+               
+               fhMCChHad1pOverE =    (TH1F *) outputList->At(index++);
+               fhMCChHad1dR =        (TH1F *) outputList->At(index++);
+               fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
+               
+               fhMCNeutral1pOverE    = (TH1F *) outputList->At(index++);
+               fhMCNeutral1dR        = (TH1F *) outputList->At(index++);
+               fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
+               
+               fh1pOverER02          =    (TH1F *) outputList->At(index++);
+               fhMCEle1pOverER02     =    (TH1F *) outputList->At(index++);
+               fhMCChHad1pOverER02   =    (TH1F *) outputList->At(index++);
+               fhMCNeutral1pOverER02 =    (TH1F *) outputList->At(index++);
+       }
+       //for(Int_t i = 0;  i<index ; i++) cout<<outputList->At(i)->GetName()<<endl;
 }
 
 //__________________________________________________________________
@@ -1201,9 +1484,9 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
 
        char name[128];
        char cname[128];
-       
+               
        //Reconstructed distributions
-       //printf("c\n");
+       //printf("c1\n");
        sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
        TCanvas  * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
        c->Divide(2, 2);
@@ -1260,12 +1543,12 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        TH1F *  hPtChargedClone  = (TH1F*)   fhPtCharged->Clone("PtChargedClone");
        TH1F *  hEtaChargedClone = (TH1F*)   fhEtaCharged->Clone("EtaChargedClone");
        TH1F *  hPhiChargedClone = (TH1F*)   fhPhiCharged->Clone("PhiChargedClone");
-
+       
        TH1F *  hEChargedClone2   = (TH1F*)   fhECharged->Clone("EChargedClone2");
        TH1F *  hPtChargedClone2  = (TH1F*)   fhPtCharged->Clone("PtChargedClone2");
        TH1F *  hEtaChargedClone2 = (TH1F*)   fhEtaCharged->Clone("EtaChargedClone2");
        TH1F *  hPhiChargedClone2 = (TH1F*)   fhPhiCharged->Clone("PhiChargedClone2");
-
+       
        //Ratio: reconstructed track matched/ all reconstructed
        //printf("c3\n");
        sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
@@ -1273,62 +1556,78 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        c3->Divide(2, 2);
        
        c3->cd(1) ;
-       hEChargedClone->SetYTitle("track matched / all");
+       gPad->SetLogy();
+       hEChargedClone->SetTitleOffset(1.6,"Y");
+    hEChargedClone->SetYTitle("track matched / all   ");
+       hEChargedClone->SetXTitle("E (GeV)");
        hEChargedClone->Divide(fhE);
        hEChargedClone->Draw();
        
        c3->cd(2) ; 
-       hPtChargedClone->SetYTitle("track matched / all");
+       gPad->SetLogy();
+       hPtChargedClone->SetTitleOffset(1.6,"Y");
+       hPtChargedClone->SetYTitle("track matched / all   ");
+    hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
        hPtChargedClone->Divide(fhPt);
        hPtChargedClone->Draw();
        
        c3->cd(3) ;
-       hPhiChargedClone->SetYTitle("track matched / all");
+       gPad->SetLogy();
+       hPhiChargedClone->SetTitleOffset(1.6,"Y");
+       hPhiChargedClone->SetYTitle("track matched / all   ");
+       hPhiChargedClone->SetXTitle("#phi (rad)");
        hPhiChargedClone->Divide(fhPhi);
        hPhiChargedClone->Draw();
        
        c3->cd(4) ; 
-       hEtaChargedClone->SetYTitle("track matched / all");
-       hEtaChargedClone->Divide(fhEta);
+       gPad->SetLogy();
+       hEtaChargedClone->SetTitleOffset(1.6,"Y");
+       hEtaChargedClone->SetYTitle("track matched / all   ");
+       hEtaChargedClone->SetXTitle("#eta");
+    hEtaChargedClone->Divide(fhEta);
        hEtaChargedClone->Draw();
        
        sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
        c3->Print(name);
        
        //Ratio: reconstructed track matched (minus no track param) / all
-       //printf("c333\n");
+       //printf("c3\n");
        sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
        TCanvas  * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
        c333->Divide(2, 2);
-
+       
        c333->cd(1) ;
        hEChargedClone2->Add(fhEChargedNoOut,-1);
        hEChargedClone2->SetYTitle("track matched / all");
+       hEChargedClone2->SetXTitle("E (GeV)");
        hEChargedClone2->Divide(fhE);
        hEChargedClone2->Draw();
        
        c333->cd(2) ; 
        hPtChargedClone2->Add(fhPtChargedNoOut,-1);
        hPtChargedClone2->SetYTitle("track matched / all");
+       hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
        hPtChargedClone2->Divide(fhPt);
        hPtChargedClone2->Draw();
        
        c333->cd(3) ;
        hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
        hPhiChargedClone2->SetYTitle("track matched / all");
+       hPhiChargedClone2->SetXTitle("#phi (rad)");
        hPhiChargedClone2->Divide(fhPhi);
        hPhiChargedClone2->Draw();
        
        c333->cd(4) ; 
        hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
        hEtaChargedClone2->SetYTitle("track matched / all");
+       hEtaChargedClone2->SetXTitle("#eta");
        hEtaChargedClone2->Divide(fhEta);
        hEtaChargedClone2->Draw();
        
        sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
        c333->Print(name);
-
-       //Reconstructed distributions, matched with tracks
+       
+       //Reconstructed distributions, matched with tracks but no outer param
        //printf("c2\n");
        sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
        TCanvas  * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
@@ -1356,61 +1655,70 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        c22->Print(name);
        
        //Ratio: reconstructed track matched/ all reconstructed
-       //printf("c33\n");
-       TH1F *  hEChargedNoOutClone   = (TH1F*)   fhEChargedNoOut->Clone("EChargedNoOutClone");
-       TH1F *  hPtChargedNoOutClone  = (TH1F*)   fhPtChargedNoOut->Clone("PtChargedNoOutClone");
-       TH1F *  hEtaChargedNoOutClone = (TH1F*)   fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
-       TH1F *  hPhiChargedNoOutClone = (TH1F*)   fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");     
-       
-       sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
-       TCanvas  * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
-       c33->Divide(2, 2);
-       
-       c33->cd(1) ;
-       hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
-       hEChargedNoOutClone->Divide(fhECharged);
-       hEChargedNoOutClone->Draw();
-       
-       c33->cd(2) ; 
-       hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
-       hPtChargedNoOutClone->Divide(fhPtCharged);
-       hPtChargedNoOutClone->Draw();
-       
-       c33->cd(3) ;
-       hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
-       hPhiChargedNoOutClone->Divide(fhPhiCharged);
-       hPhiChargedNoOutClone->Draw();
-       
-       c33->cd(4) ; 
-       hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
-       hEtaChargedNoOutClone->Divide(fhEtaCharged);
-       hEtaChargedNoOutClone->Draw();
-       
-       sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
-       c33->Print(name);
-
+       //printf("c3\n");
+       
+//     TH1F *  hEChargedNoOutClone   = (TH1F*)   fhEChargedNoOut->Clone("EChargedNoOutClone");
+//     TH1F *  hPtChargedNoOutClone  = (TH1F*)   fhPtChargedNoOut->Clone("PtChargedNoOutClone");
+//     TH1F *  hEtaChargedNoOutClone = (TH1F*)   fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
+//     TH1F *  hPhiChargedNoOutClone = (TH1F*)   fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");     
+       
+//     sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
+//     TCanvas  * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
+//     c33->Divide(2, 2);
+//     
+//     c33->cd(1) ;
+//     hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
+//     hEChargedNoOutClone->SetXTitle("E (GeV)");
+//     hEChargedNoOutClone->Divide(fhECharged);
+//     hEChargedNoOutClone->Draw();
+//     
+//     c33->cd(2) ; 
+//     hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
+//     hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
+//     hPtChargedNoOutClone->Divide(fhPtCharged);
+//     hPtChargedNoOutClone->Draw();
+//     
+//     c33->cd(3) ;
+//     hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
+//     hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
+//     hPhiChargedNoOutClone->Divide(fhPhiCharged);
+//     hPhiChargedNoOutClone->Draw();
+//     
+//     c33->cd(4) ; 
+//     hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
+//     hEtaChargedNoOutClone->SetXTitle("#eta");
+//     hEtaChargedNoOutClone->Divide(fhEtaCharged);
+//     hEtaChargedNoOutClone->Draw();
+//     
+//     sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
+//     c33->Print(name);
+       
+       
        //eta vs phi
        //printf("c4\n");
        sprintf(cname,"QA_%s_etavsphi",fCalorimeter.Data());
-       TCanvas  * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 200, 600) ;
-       c4->Divide(1, 3);
-               
+       //      TCanvas  * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
+       //      c4->Divide(3, 1);
+       
+       TCanvas  * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 400, 200) ;
+       c4->Divide(2, 1);
+       
        c4->cd(1) ;
        fhEtaPhi->Draw("cont");
        
        c4->cd(2) ; 
        fhEtaPhiCharged->Draw("cont");
        
-       c4->cd(3) ; 
-       fhEtaPhiChargedNoOut->Draw("cont");
-
+       //      c4->cd(3) ; 
+       //      fhEtaPhiChargedNoOut->Draw("cont");
+       
        sprintf(name,"QA_%s_ReconstructedEtaVsPhi.eps",fCalorimeter.Data());
        c4->Print(name);
        
        //Invariant mass
        Int_t binmin = -1;
        Int_t binmax = -1;
-
+       
        if(fhIM->GetEntries() > 1){
                Int_t nebins  = fhIM->GetNbinsX();
                Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
@@ -1419,7 +1727,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                //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", 400, 400) ;
                c5->Divide(2, 2);
                
@@ -1469,6 +1777,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                c5b->Divide(2, 2);
                
                c5b->cd(1) ; 
+               fhAsym->SetTitleOffset(1.6,"Y");
                fhAsym->SetLineColor(4);
                fhAsym->Draw();
                
@@ -1508,25 +1817,28 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        c6->Divide(2, 2);
        
        c6->cd(1) ; 
+       fh2E->SetTitleOffset(1.6,"Y");
        fh2E->SetLineColor(4);
        fh2E->Draw();
        
        c6->cd(2) ; 
+       fh2Pt->SetTitleOffset(1.6,"Y");
        fh2Pt->SetLineColor(4);
        fh2Pt->Draw();
        
        c6->cd(3) ; 
+       fh2Phi->SetTitleOffset(1.6,"Y");
        fh2Phi->SetLineColor(4);
        fh2Phi->Draw();
        
        c6->cd(4) ; 
+       fh2Eta->SetTitleOffset(1.6,"Y");
        fh2Eta->SetLineColor(4);
        fh2Eta->Draw();
        
        sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
        c6->Print(name);        
        
-       
        //Reconstructed vs MC distributions
        //printf("c6\n");
        sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
@@ -1534,24 +1846,20 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        c6Gam->Divide(2, 2);
        
        c6Gam->cd(1) ; 
-       fhGam2E->SetLineColor(4);
-       fhGam2E->Draw();
+       fhGamE->Draw();
        
        c6Gam->cd(2) ; 
-       fhGam2Pt->SetLineColor(4);
-       fhGam2Pt->Draw();
+       fhGamPt->Draw();
        
        c6Gam->cd(3) ; 
-       fhGam2Phi->SetLineColor(4);
-       fhGam2Phi->Draw();
+       fhGamPhi->Draw();
        
        c6Gam->cd(4) ; 
-       fhGam2Eta->SetLineColor(4);
-       fhGam2Eta->Draw();
+       fhGamEta->Draw();
        
        sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
        c6->Print(name);        
-
+       
        //Generated - reconstructed  
        //printf("c7\n");
        sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
@@ -1563,7 +1871,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        fhGamDeltaE->SetLineColor(4);
        fhDeltaE->Draw();
        fhGamDeltaE->Draw("same");
-
+       
        TLegend pLegendd(0.65,0.55,0.9,0.8);
        pLegendd.SetTextSize(0.06);
        pLegendd.AddEntry(fhDeltaE,"all","L");
@@ -1571,27 +1879,26 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        pLegendd.SetFillColor(10);
        pLegendd.SetBorderSize(1);
        pLegendd.Draw();
-
+       
        c7->cd(2) ; 
        gPad->SetLogy();
        fhGamDeltaPt->SetLineColor(4);
        fhDeltaPt->Draw();
-               fhGamDeltaPt->Draw("same");
-
+       fhGamDeltaPt->Draw("same");
+       
        c7->cd(3) ; 
        fhGamDeltaPhi->SetLineColor(4);
        fhDeltaPhi->Draw();
-               fhGamDeltaPhi->Draw("same");
+       fhGamDeltaPhi->Draw("same");
        
        c7->cd(4) ; 
        fhGamDeltaEta->SetLineColor(4);
        fhDeltaEta->Draw();
        fhGamDeltaEta->Draw("same");
-
+       
        sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
        c7->Print(name);
        
-       
        // Reconstructed / Generated 
        //printf("c8\n");
        sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
@@ -1603,7 +1910,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        fhGamRatioE->SetLineColor(4);
        fhRatioE->Draw();
        fhGamRatioE->Draw("same");
-
+       
        TLegend pLegendr(0.65,0.55,0.9,0.8);
        pLegendr.SetTextSize(0.06);
        pLegendr.AddEntry(fhRatioE,"all","L");
@@ -1611,26 +1918,27 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        pLegendr.SetFillColor(10);
        pLegendr.SetBorderSize(1);
        pLegendr.Draw();
-
+       
        c8->cd(2) ; 
        gPad->SetLogy();
        fhGamRatioPt->SetLineColor(4);
        fhRatioPt->Draw();
-               fhGamRatioPt->Draw("same");
-
+       fhGamRatioPt->Draw("same");
+       
        c8->cd(3) ; 
        fhGamRatioPhi->SetLineColor(4);
        fhRatioPhi->Draw();
-               fhGamRatioPhi->Draw("same");
-
+       fhGamRatioPhi->Draw("same");
+       
        c8->cd(4) ; 
        fhGamRatioEta->SetLineColor(4);
        fhRatioEta->Draw();
-               fhGamRatioEta->Draw("same");
-
+       fhGamRatioEta->Draw("same");
+       
        sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
        c8->Print(name);
        
+       
        // CaloClusters CaloCells
        //printf("c9\n");
        sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
@@ -1688,7 +1996,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
           fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
                haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
        else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() && 
-          fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
+                       fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
                haxispt->SetMaximum(fhGenGamPt->GetMaximum());
        else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && 
                        fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
@@ -1699,7 +2007,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() && 
                        fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
                haxispt->SetMaximum(fhGenElePt->GetMaximum());
-       
+       haxispt->SetMinimum(1);
        haxispt->Draw("axis");
        fhGenPi0Pt->Draw("same");
        fhGenGamPt->Draw("same");
@@ -1707,13 +2015,13 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        fhGenOmegaPt->Draw("same");
        fhGenElePt->Draw("same");
        
-       TLegend pLegend(0.75,0.45,0.9,0.8);
+       TLegend pLegend(0.85,0.65,0.95,0.93);
        pLegend.SetTextSize(0.06);
-       pLegend.AddEntry(fhGenPi0Pt,"#pi^{0}","L");
-       pLegend.AddEntry(fhGenGamPt,"#gamma","L");
-       pLegend.AddEntry(fhGenEtaPt,"#eta","L");
-       pLegend.AddEntry(fhGenOmegaPt,"#omega","L");
-       pLegend.AddEntry(fhGenElePt,"e^{#pm}","L");
+       pLegend.AddEntry(fhGenPi0Pt,"  #pi^{0}","L");
+       pLegend.AddEntry(fhGenGamPt,"  #gamma","L");
+       pLegend.AddEntry(fhGenEtaPt,"  #eta","L");
+       pLegend.AddEntry(fhGenOmegaPt,"  #omega","L");
+       pLegend.AddEntry(fhGenElePt,"  e^{#pm}","L");
        pLegend.SetFillColor(10);
        pLegend.SetBorderSize(1);
        pLegend.Draw();
@@ -1743,7 +2051,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() && 
                        fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
                haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
-       
+       haxiseta->SetMinimum(100);
        haxiseta->Draw("axis");
        fhGenPi0Eta->Draw("same");
        fhGenGamEta->Draw("same");
@@ -1777,7 +2085,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() && 
                        fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
                haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
-       
+       haxisphi->SetMinimum(100);
        haxisphi->Draw("axis");
        fhGenPi0Phi->Draw("same");
        fhGenGamPhi->Draw("same");
@@ -1798,11 +2106,11 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        
        c11->cd(1) ; 
        gPad->SetLogy();
-       TH1F * hGamE   = (TH1F*) fhGamE->ProjectionY("hGamE",-1,-1);
-       TH1F * hPi0E   = (TH1F*) fhPi0E->ProjectionY("hPi0E",-1,-1);
-       TH1F * hEleE   = (TH1F*) fhEleE->ProjectionY("hEleE",-1,-1);
-       TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionY("hNeHadE",-1,-1);
-       TH1F * hChHadE = (TH1F*) fhNeHadE->ProjectionY("hChHadE",-1,-1);
+       TH1F * hGamE   = (TH1F*) fhGamE->ProjectionX("hGamE",-1,-1);
+       TH1F * hPi0E   = (TH1F*) fhPi0E->ProjectionX("hPi0E",-1,-1);
+       TH1F * hEleE   = (TH1F*) fhEleE->ProjectionX("hEleE",-1,-1);
+       TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX("hNeHadE",-1,-1);
+       TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX("hChHadE",-1,-1);
        TH1F * haxisE  = (TH1F*) hPi0E->Clone("axisE");  
        haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
        hPi0E->SetLineColor(1);
@@ -1827,7 +2135,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() && 
                        hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
                haxisE->SetMaximum(hEleE->GetMaximum());
-       
+       haxisE->SetXTitle("E (GeV)");
+       haxisE->SetMinimum(1);
        haxisE->Draw("axis");
        hPi0E->Draw("same");
        hGamE->Draw("same");
@@ -1835,13 +2144,13 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        hChHadE->Draw("same");
        hEleE->Draw("same");
        
-       TLegend pLegend2(0.75,0.45,0.9,0.8);
+       TLegend pLegend2(0.8,0.65,0.95,0.93);
        pLegend2.SetTextSize(0.06);
-       pLegend2.AddEntry(hPi0E,"#pi^{0}","L");
-       pLegend2.AddEntry(hGamE,"#gamma","L");
-       pLegend2.AddEntry(hEleE,"e^{#pm}","L");
-       pLegend2.AddEntry(hChHadE,"h^{#pm}","L");
-       pLegend2.AddEntry(hNeHadE,"h^{0}","L");
+       pLegend2.AddEntry(hPi0E,"  #pi^{0}","L");
+       pLegend2.AddEntry(hGamE,"  #gamma","L");
+       pLegend2.AddEntry(hEleE,"  e^{#pm}","L");
+       pLegend2.AddEntry(hChHadE,"  h^{#pm}","L");
+       pLegend2.AddEntry(hNeHadE,"  h^{0}","L");
        pLegend2.SetFillColor(10);
        pLegend2.SetBorderSize(1);
        pLegend2.Draw();
@@ -1850,11 +2159,11 @@ 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());
-       TH1F * hGamPt   = (TH1F*) fhGamPt->ProjectionY("hGamPt",-1,-1);
-       TH1F * hPi0Pt   = (TH1F*) fhPi0Pt->ProjectionY("hPi0Pt",-1,-1);
-       TH1F * hElePt   = (TH1F*) fhElePt->ProjectionY("hElePt",-1,-1);
-       TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionY("hNeHadPt",-1,-1);
-       TH1F * hChHadPt = (TH1F*) fhNeHadPt->ProjectionY("hChHadPt",-1,-1);
+       TH1F * hGamPt   = (TH1F*) fhGamPt->ProjectionX("hGamPt",-1,-1);
+       TH1F * hPi0Pt   = (TH1F*) fhPi0Pt->ProjectionX("hPi0Pt",-1,-1);
+       TH1F * hElePt   = (TH1F*) fhElePt->ProjectionX("hElePt",-1,-1);
+       TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX("hNeHadPt",-1,-1);
+       TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX("hChHadPt",-1,-1);
        haxispt  = (TH1F*) hPi0Pt->Clone("axispt");  
        haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
        hPi0Pt->SetLineColor(1);
@@ -1879,23 +2188,24 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() && 
                        hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
                haxispt->SetMaximum(hElePt->GetMaximum());
-       
+       haxispt->SetXTitle("p_{T} (GeV/c)");
+       haxispt->SetMinimum(1);
        haxispt->Draw("axis");
        hPi0Pt->Draw("same");
        hGamPt->Draw("same");
        hNeHadPt->Draw("same");
        hChHadPt->Draw("same");
-       hElePt->Draw("same");
+    hElePt->Draw("same");
        
        
        c11->cd(3) ;
        gPad->SetLogy();
-
-       TH1F * hGamEta   = (TH1F*) fhGamEta->ProjectionY("hGamEta",-1,-1);
-       TH1F * hPi0Eta   = (TH1F*) fhPi0Eta->ProjectionY("hPi0Eta",-1,-1);
-       TH1F * hEleEta   = (TH1F*) fhEleEta->ProjectionY("hEleEta",-1,-1);
-       TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionY("hNeHadEta",-1,-1);
-       TH1F * hChHadEta = (TH1F*) fhNeHadEta->ProjectionY("hChHadEta",-1,-1);
+       
+       TH1F * hGamEta   = (TH1F*) fhGamEta->ProjectionX("hGamEta",-1,-1);
+       TH1F * hPi0Eta   = (TH1F*) fhPi0Eta->ProjectionX("hPi0Eta",-1,-1);
+       TH1F * hEleEta   = (TH1F*) fhEleEta->ProjectionX("hEleEta",-1,-1);
+       TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX("hNeHadEta",-1,-1);
+       TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX("hChHadEta",-1,-1);
        haxiseta  = (TH1F*) hPi0Eta->Clone("axiseta");  
        haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
        hPi0Eta->SetLineColor(1);
@@ -1920,6 +2230,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                        hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
                haxiseta->SetMaximum(hEleEta->GetMaximum());
        
+    haxiseta->SetXTitle("#eta");
        haxiseta->Draw("axis");
        hPi0Eta->Draw("same");
        hGamEta->Draw("same");
@@ -1930,14 +2241,14 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        
        c11->cd(4) ; 
        gPad->SetLogy();
-       TH1F * hGamPhi   = (TH1F*) fhGamPhi->ProjectionY("hGamPhi",-1,-1);
-       TH1F * hPi0Phi   = (TH1F*) fhPi0Phi->ProjectionY("hPi0Phi",-1,-1);
-       TH1F * hElePhi   = (TH1F*) fhElePhi->ProjectionY("hElePhi",-1,-1);
-       TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionY("hNeHadPhi",-1,-1);
-       TH1F * hChHadPhi = (TH1F*) fhNeHadPhi->ProjectionY("hChHadPhi",-1,-1);
+       TH1F * hGamPhi   = (TH1F*) fhGamPhi->ProjectionX("hGamPhi",-1,-1);
+       TH1F * hPi0Phi   = (TH1F*) fhPi0Phi->ProjectionX("hPi0Phi",-1,-1);
+       TH1F * hElePhi   = (TH1F*) fhElePhi->ProjectionX("hElePhi",-1,-1);
+       TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX("hNeHadPhi",-1,-1);
+       TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX("hChHadPhi",-1,-1);
        haxisphi  = (TH1F*) hPi0Phi->Clone("axisphi");  
        haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
-
+       
        hPi0Phi->SetLineColor(1);
        hGamPhi->SetLineColor(4);
        hNeHadPhi->SetLineColor(2);
@@ -1959,7 +2270,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() && 
                        hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
                haxisphi->SetMaximum(hElePhi->GetMaximum());
-       
+       haxisphi->SetXTitle("#phi (rad)");
        haxisphi->Draw("axis");
        hPi0Phi->Draw("same");
        hGamPhi->Draw("same");
@@ -1972,7 +2283,7 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        
        
        //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
-       //printf("c12\n");
+       //printf("c1\n");
        
        TH1F *  hPi0EClone   = (TH1F*)   hPi0E  ->Clone("hPi0EClone");
        TH1F *  hGamEClone   = (TH1F*)   hGamE  ->Clone("hGamEClone");
@@ -1981,7 +2292,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        TH1F *  hPi0EtaClone = (TH1F*)   hPi0Eta->Clone("hPi0EtaClone");
        TH1F *  hGamEtaClone = (TH1F*)   hGamEta->Clone("hGamEtaClone");        
        TH1F *  hPi0PhiClone = (TH1F*)   hPi0Phi->Clone("hPi0PhiClone");
-       TH1F *  hGamPhiClone = (TH1F*)   hGamPhi->Clone("hGamPhiClone");
+       TH1F *  hGamPhiClone = (TH1F*)   hGamPhi->Clone("hGamPhiClone");        
+       
        sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
        TCanvas  * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
        c12->Divide(2, 2);
@@ -1991,18 +2303,18 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
        hPi0EClone->Divide(fhGenPi0AccE);
        hGamEClone->Divide(fhGenGamAccE);
-       haxisE->SetMaximum(1.2);
+       haxisE->SetMaximum(5);
+       haxisE->SetMinimum(1e-2);
+       haxisE->SetXTitle("E (GeV)");
        haxisE->SetYTitle("ratio = rec/gen");
        haxisE->Draw("axis");
-       hPi0EClone->SetLineColor(1);
-       hGamEClone->SetLineColor(4);
-       hPi0EClone->Draw("same");
-       hGamEClone->Draw("same");
+       hPi0E->Draw("same");
+       hGamE->Draw("same");
        
-       TLegend pLegend3(0.75,0.45,0.9,0.8);
+       TLegend pLegend3(0.75,0.2,0.9,0.4);
        pLegend3.SetTextSize(0.06);
-       pLegend3.AddEntry(hPi0EClone,"#pi^{0}","L");
-       pLegend3.AddEntry(hGamEClone,"#gamma","L");
+       pLegend3.AddEntry(hPi0EClone,"  #pi^{0}","L");
+       pLegend3.AddEntry(hGamEClone,"  #gamma","L");
        pLegend3.SetFillColor(10);
        pLegend3.SetBorderSize(1);
        pLegend3.Draw();
@@ -2012,11 +2324,11 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
        hPi0PtClone->Divide(fhGenPi0AccPt);
        hGamPtClone->Divide(fhGenGamAccPt);
-       haxispt->SetMaximum(1.2);
+       haxispt->SetMaximum(5);
+       haxispt->SetMinimum(1e-2);
+       haxispt->SetXTitle("p_{T} (GeV/c)");
        haxispt->SetYTitle("ratio = rec/gen");
        haxispt->Draw("axis");
-       hPi0PtClone->SetLineColor(1);
-       hGamPtClone->SetLineColor(4);
        hPi0PtClone->Draw("same");
        hGamPtClone->Draw("same");
        
@@ -2027,10 +2339,10 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        hPi0EtaClone->Divide(fhGenPi0AccEta);
        hGamEtaClone->Divide(fhGenGamAccEta);
        haxiseta->SetMaximum(1.2);
+       haxiseta->SetMinimum(1e-2);
        haxiseta->SetYTitle("ratio = rec/gen");
+       haxiseta->SetXTitle("#eta");
        haxiseta->Draw("axis");
-       hPi0EtaClone->SetLineColor(1);
-       hGamEtaClone->SetLineColor(4);
        hPi0EtaClone->Draw("same");
        hGamEtaClone->Draw("same");
        
@@ -2040,15 +2352,14 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
        hPi0PhiClone->Divide(fhGenPi0AccPhi);
        hGamPhiClone->Divide(fhGenGamAccPhi);
-       haxisphi->SetYTitle("ratio = rec/gen");
+    haxisphi->SetYTitle("ratio = rec/gen");
+       haxisphi->SetXTitle("#phi (rad)");
        haxisphi->SetMaximum(1.2);
+       haxisphi->SetMinimum(1e-2);
        haxisphi->Draw("axis");
-       hPi0PhiClone->SetLineColor(1);
-       hGamPhiClone->SetLineColor(4);
        hPi0PhiClone->Draw("same");
        hGamPhiClone->Draw("same");
        
-       
        sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
        c12->Print(name);
        
@@ -2061,10 +2372,12 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        
        c13->cd(1) ; 
        //gPad->SetLogy();
-       fhEMVxyz->Draw();
+       fhEMVxyz->SetTitleOffset(1.6,"Y");
+    fhEMVxyz->Draw();
        
        c13->cd(2) ; 
        //gPad->SetLogy();
+       fhHaVxyz->SetTitleOffset(1.6,"Y");
        fhHaVxyz->Draw();
        
        c13->cd(3) ;
@@ -2084,16 +2397,259 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
        c13->Print(name);
        
        
+       //Track-matching distributions
+       
+       
+       //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("hGamECharged",-1,-1);
+       TH1F * hPi0ECharged   = (TH1F*) fhPi0ECharged->ProjectionX("hPi0ECharged",-1,-1);
+       TH1F * hEleECharged   = (TH1F*) fhEleECharged->ProjectionX("hEleECharged",-1,-1);
+       TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX("hNeHadECharged",-1,-1);
+       TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX("hChHadECharged",-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("hGamPtCharged",-1,-1);
+       TH1F * hPi0PtCharged   = (TH1F*) fhPi0PtCharged->ProjectionX("hPi0PtCharged",-1,-1);
+       TH1F * hElePtCharged   = (TH1F*) fhElePtCharged->ProjectionX("hElePtCharged",-1,-1);
+       TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX("hNeHadPtCharged",-1,-1);
+       TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX("hChHadPtCharged",-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("hGamEtaCharged",-1,-1);
+       TH1F * hPi0EtaCharged   = (TH1F*) fhPi0EtaCharged->ProjectionX("hPi0EtaCharged",-1,-1);
+       TH1F * hEleEtaCharged   = (TH1F*) fhEleEtaCharged->ProjectionX("hEleEtaCharged",-1,-1);
+       TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX("hNeHadEtaCharged",-1,-1);
+       TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX("hChHadEtaCharged",-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("hGamPhiCharged",-1,-1);
+       TH1F * hPi0PhiCharged   = (TH1F*) fhPi0PhiCharged->ProjectionX("hPi0PhiCharged",-1,-1);
+       TH1F * hElePhiCharged   = (TH1F*) fhElePhiCharged->ProjectionX("hElePhiCharged",-1,-1);
+       TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX("hNeHadPhiCharged",-1,-1);
+       TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX("hChHadPhiCharged",-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);
+       
+       TH1F *  hGamEChargedClone   = (TH1F*)   hGamECharged->Clone("GamEChargedClone");
+       TH1F *  hGamPtChargedClone  = (TH1F*)   hGamPtCharged->Clone("GamPtChargedClone");
+       TH1F *  hGamEtaChargedClone = (TH1F*)   hGamEtaCharged->Clone("GamEtaChargedClone");
+       TH1F *  hGamPhiChargedClone = (TH1F*)   hGamPhiCharged->Clone("GamPhiChargedClone");
+       
+       TH1F *  hPi0EChargedClone   = (TH1F*)   hPi0ECharged->Clone("Pi0EChargedClone");
+       TH1F *  hPi0PtChargedClone  = (TH1F*)   hPi0PtCharged->Clone("Pi0PtChargedClone");
+       TH1F *  hPi0EtaChargedClone = (TH1F*)   hPi0EtaCharged->Clone("Pi0EtaChargedClone");
+       TH1F *  hPi0PhiChargedClone = (TH1F*)   hPi0PhiCharged->Clone("Pi0PhiChargedClone");
+       
+       TH1F *  hEleEChargedClone   = (TH1F*)   hEleECharged->Clone("EleEChargedClone");
+       TH1F *  hElePtChargedClone  = (TH1F*)   hElePtCharged->Clone("ElePtChargedClone");
+       TH1F *  hEleEtaChargedClone = (TH1F*)   hEleEtaCharged->Clone("EleEtaChargedClone");
+       TH1F *  hElePhiChargedClone = (TH1F*)   hElePhiCharged->Clone("ElePhiChargedClone");    
+       
+       TH1F *  hNeHadEChargedClone   = (TH1F*)   hNeHadECharged->Clone("NeHadEChargedClone");
+       TH1F *  hNeHadPtChargedClone  = (TH1F*)   hNeHadPtCharged->Clone("NeHadPtChargedClone");
+       TH1F *  hNeHadEtaChargedClone = (TH1F*)   hNeHadEtaCharged->Clone("NeHadEtaChargedClone");
+       TH1F *  hNeHadPhiChargedClone = (TH1F*)   hNeHadPhiCharged->Clone("NeHadPhiChargedClone");
+       
+       TH1F *  hChHadEChargedClone   = (TH1F*)   hChHadECharged->Clone("ChHadEChargedClone");
+       TH1F *  hChHadPtChargedClone  = (TH1F*)   hChHadPtCharged->Clone("ChHadPtChargedClone");
+       TH1F *  hChHadEtaChargedClone = (TH1F*)   hChHadEtaCharged->Clone("ChHadEtaChargedClone");
+       TH1F *  hChHadPhiChargedClone = (TH1F*)   hChHadPhiCharged->Clone("ChHadPhiChargedClone");      
+       
+       //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);
+       
+       
        //Track-matching distributions
        if(!strcmp(GetReader()->GetInputEvent()->GetName(),"AliESDEvent")){
+               
+               
                sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
                TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
                cme->Divide(2,2);
                
+               TLegend pLegendpE0(0.6,0.55,0.9,0.8);
+               pLegendpE0.SetTextSize(0.04);
+               pLegendpE0.AddEntry(fh1pOverE,"all","L");
+               pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
+               pLegendpE0.SetFillColor(10);
+               pLegendpE0.SetBorderSize(1);
+               //pLegendpE0.Draw();
+               
                cme->cd(1);
+               gPad->SetLogy();
+               fh1pOverE->SetTitle("Track matches p/E");
                fh1pOverE->Draw();
+               fh1pOverER02->SetLineColor(4);
+               fh1pOverER02->Draw("same");
+               pLegendpE0.Draw();
                
                cme->cd(2);
+               gPad->SetLogy();
                fh1dR->Draw();
                
                cme->cd(3);
@@ -2104,7 +2660,126 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
                
                sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
                cme->Print(name);       
+               
+               
+               sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
+               TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
+               cmemc->Divide(3,1);
+               
+               cmemc->cd(1);
+               gPad->SetLogy();
+               fhMCEle1pOverE->Draw();
+               fhMCEle1pOverER02->SetLineColor(4);
+               fhMCEle1pOverE->SetLineColor(1);
+               fhMCEle1pOverER02->Draw("same");
+               pLegendpE0.Draw();
+               
+               cmemc->cd(2);
+               gPad->SetLogy();
+               fhMCEle1dR->Draw();
+               
+               cmemc->cd(3);
+               fhMCEle2MatchdEdx->Draw();
+               
+               sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
+               cmemc->Print(name);  
+               
+               sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
+               TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
+               cmemchad->Divide(3,1);
+               
+               cmemchad->cd(1);
+               gPad->SetLogy();
+               fhMCChHad1pOverE->Draw();
+               fhMCChHad1pOverER02->SetLineColor(4);
+               fhMCChHad1pOverE->SetLineColor(1);
+               fhMCChHad1pOverER02->Draw("same");
+               pLegendpE0.Draw();
+               
+               cmemchad->cd(2);
+               gPad->SetLogy();
+               fhMCChHad1dR->Draw();
+               
+               cmemchad->cd(3);
+               fhMCChHad2MatchdEdx->Draw();
+               
+               sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
+               cmemchad->Print(name);       
+               
+               sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
+               TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
+               cmemcn->Divide(3,1);
+               
+               cmemcn->cd(1);
+               gPad->SetLogy();
+               fhMCNeutral1pOverE->Draw();
+               fhMCNeutral1pOverE->SetLineColor(1);
+               fhMCNeutral1pOverER02->SetLineColor(4);
+               fhMCNeutral1pOverER02->Draw("same");
+               pLegendpE0.Draw();
+               
+               cmemcn->cd(2);
+               gPad->SetLogy();
+               fhMCNeutral1dR->Draw();
+               
+               cmemcn->cd(3);
+               fhMCNeutral2MatchdEdx->Draw();
+               
+               sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
+               cmemcn->Print(name);       
+               
+               sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
+               TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
+               cmpoe->Divide(2,1);
+               
+               cmpoe->cd(1);
+               gPad->SetLogy();
+               fh1pOverE->SetLineColor(1);
+               fhMCEle1pOverE->SetLineColor(4);
+               fhMCChHad1pOverE->SetLineColor(2);
+               fhMCNeutral1pOverE->SetLineColor(7);
+               fh1pOverER02->SetMinimum(0.5);
+               fh1pOverE->Draw();
+               fhMCEle1pOverE->Draw("same");
+               fhMCChHad1pOverE->Draw("same");
+               fhMCNeutral1pOverE->Draw("same");
+               TLegend pLegendpE(0.65,0.55,0.9,0.8);
+               pLegendpE.SetTextSize(0.06);
+               pLegendpE.AddEntry(fh1pOverE,"all","L");
+               pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
+               pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
+               pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
+               pLegendpE.SetFillColor(10);
+               pLegendpE.SetBorderSize(1);
+               pLegendpE.Draw();
+               
+               cmpoe->cd(2);
+               gPad->SetLogy();
+               fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
+               fh1pOverER02->SetLineColor(1);
+               fhMCEle1pOverER02->SetLineColor(4);
+               fhMCChHad1pOverER02->SetLineColor(2);
+               fhMCNeutral1pOverER02->SetLineColor(7);
+               fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
+               fh1pOverER02->SetMinimum(0.5);
+               fh1pOverER02->Draw();
+               fhMCEle1pOverER02->Draw("same");
+               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();
+               
+               sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
+               cmpoe->Print(name);                             
+               
+               
        }
+       
        char line[1024] ; 
        sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ; 
        gROOT->ProcessLine(line);
index a01553f9213eb45eb90bb586634a000f2f77d4f6..7958d1b1cf39c3839dccc02b8cbd03ae8da7b8ee 100755 (executable)
@@ -123,10 +123,6 @@ class AliAnaCalorimeterQA : public AliAnaPartCorrBaseClass {
   TH1F * fhGamRatioPt ; //! Reco/MC pT distribution of generated photons
   TH1F * fhGamRatioPhi; //! Reco/MC phi distribution of generated photons
   TH1F * fhGamRatioEta; //! Reco/MC eta distribution of generated photons
-  TH2F * fhGam2E  ; //! E distribution, Reco vs MC of generated photons
-  TH2F * fhGam2Pt ; //! pT distribution, Reco vs MC of generated photons
-  TH2F * fhGam2Phi; //! phi distribution, Reco vs MC of generated photons
-  TH2F * fhGam2Eta; //! eta distribution, Reco vs MC of generated photons      
   TH2F * fhEleE  ; //! E distribution of generated electrons, Reco
   TH2F * fhElePt ; //! pT distribution of generated electrons, Reco
   TH2F * fhElePhi; //! phi distribution of generated electron, Reco 
@@ -143,6 +139,27 @@ class AliAnaCalorimeterQA : public AliAnaPartCorrBaseClass {
   TH2F * fhChHadPt ; //! pT distribution of generated charged hadron, Reco
   TH2F * fhChHadPhi; //! phi distribution of generated charged hadron, Reco 
   TH2F * fhChHadEta; //! eta distribution of generated charged hadron, Reco 
+
+  TH2F * fhGamECharged  ; //! E distribution of generated photons, Reco, track matched cluster
+  TH2F * fhGamPtCharged ; //! pT distribution of generated photons, Reco, track matched cluster
+  TH2F * fhGamPhiCharged; //! phi distribution of generated photon, Reco, track matched cluster 
+  TH2F * fhGamEtaCharged; //! eta distribution of generated photons, Reco, track matched cluster 
+  TH2F * fhEleECharged  ; //! E distribution of generated electrons, Reco, track matched cluster
+  TH2F * fhElePtCharged ; //! pT distribution of generated electrons, Reco, track matched cluster
+  TH2F * fhElePhiCharged; //! phi distribution of generated electron, Reco, track matched cluster 
+  TH2F * fhEleEtaCharged; //! eta distribution of generated electrons, Reco, track matched cluster             
+  TH2F * fhPi0ECharged  ; //! E distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
+  TH2F * fhPi0PtCharged ; //! pT distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
+  TH2F * fhPi0PhiCharged; //! phi distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
+  TH2F * fhPi0EtaCharged; //! eta distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
+  TH2F * fhNeHadECharged  ; //! E distribution of generated neutral hadron, Reco, track matched cluster
+  TH2F * fhNeHadPtCharged ; //! pT distribution of generated neutral hadron, Reco, track matched cluster
+  TH2F * fhNeHadPhiCharged; //! phi distribution of generated neutral hadron, Reco , track matched cluster
+  TH2F * fhNeHadEtaCharged; //! eta distribution of generated neutral hadron, Reco, track matched cluster      
+  TH2F * fhChHadECharged  ; //! E distribution of generated charged hadron, Reco, track matched cluster
+  TH2F * fhChHadPtCharged ; //! pT distribution of generated charged hadron, Reco, track matched cluster
+  TH2F * fhChHadPhiCharged; //! phi distribution of generated charged hadron, Reco, track matched cluster 
+  TH2F * fhChHadEtaCharged; //! eta distribution of generated charged hadron, Reco, track matched cluster      
        
   TH1F *fhGenGamAccE   ; // E of primary gamma
   TH1F *fhGenGamAccPt  ; // pt of primary gamma
@@ -159,6 +176,23 @@ class AliAnaCalorimeterQA : public AliAnaPartCorrBaseClass {
   TH2F *fh2EledEdx;    //! dE/dx vs. momentum for electron candidates
   TH2F *fh2MatchdEdx;  //! dE/dx vs. momentum for all matches
        
+  TH1F *fhMCEle1pOverE;     //! p/E for track-cluster matches, MC electrons
+  TH1F *fhMCEle1dR;         //! distance between projected track and cluster, MC electrons
+  TH2F *fhMCEle2MatchdEdx;  //! dE/dx vs. momentum for all matches, MC electrons       
+       
+  TH1F *fhMCChHad1pOverE;     //! p/E for track-cluster matches, MC charged hadrons
+  TH1F *fhMCChHad1dR;         //! distance between projected track and cluster, MC charged hadrons
+  TH2F *fhMCChHad2MatchdEdx;  //! dE/dx vs. momentum for all matches, MC charged
+       
+  TH1F *fhMCNeutral1pOverE;     //! p/E for track-cluster matches, MC neutral
+  TH1F *fhMCNeutral1dR;         //! distance between projected track and cluster, MC neutral
+  TH2F *fhMCNeutral2MatchdEdx;  //! dE/dx vs. momentum for all matches, MC neutral     
+       
+  TH1F *fh1pOverER02;           //! p/E for track-cluster matches, dR > 0.2    
+  TH1F *fhMCEle1pOverER02;      //! p/E for track-cluster matches, dR > 0.2, MC electrons
+  TH1F *fhMCChHad1pOverER02;    //! p/E for track-cluster matches, dR > 0.2, MC charged hadrons
+  TH1F *fhMCNeutral1pOverER02;  //! p/E for track-cluster matches, dR > 0.2, MC neutral
+       
        ClassDef(AliAnaCalorimeterQA,1)
 } ;