]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
Add histograms to check for special clusters with high energy and low number of cells
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaCalorimeterQA.cxx
CommitLineData
9725fd2a 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15/* $Id: $ */
16
a6f26052 17//_________________________________________________________________________
18// Class to check results from simulations or reconstructed real data.
19// Fill few histograms and do some checking plots
20//
21//-- Author: Gustavo Conesa (INFN-LNF)
22//_________________________________________________________________________
9725fd2a 23
24
a6f26052 25// --- ROOT system ---
26//#include "Riostream.h"
591cc579 27#include "TObjArray.h"
9725fd2a 28#include "TParticle.h"
c180f65d 29#include "TDatabasePDG.h"
9725fd2a 30#include "TCanvas.h"
31#include "TPad.h"
32#include "TROOT.h"
a5fafd85 33#include "TH3F.h"
9725fd2a 34#include "TH2F.h"
35#include "TLegend.h"
a5fafd85 36#include "TStyle.h"
0c1383b5 37#include <TObjString.h>
9725fd2a 38
a6f26052 39//---- AliRoot system ----
9725fd2a 40#include "AliAnaCalorimeterQA.h"
41#include "AliCaloTrackReader.h"
42#include "AliStack.h"
c8fe2783 43#include "AliVCaloCells.h"
ff45398a 44#include "AliFiducialCut.h"
ff5cc919 45#include "AliAODTrack.h"
c8fe2783 46#include "AliVCluster.h"
47#include "AliVEvent.h"
902aa95c 48#include "AliVEventHandler.h"
49#include "AliAnalysisManager.h"
50#include "AliAODMCParticle.h"
51#include "AliMCAnalysisUtils.h"
6fa7d352 52#include "AliAODPid.h"
c8fe2783 53#include "AliExternalTrackParam.h"
9725fd2a 54
55ClassImp(AliAnaCalorimeterQA)
c8fe2783 56
a6f26052 57//____________________________________________________________________________
c8fe2783 58AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
59AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""),
d7c10d78 60fFillAllPosHisto(kFALSE), fFillAllTH12(kFALSE),
798a9b04 61fCorrelate(kTRUE), fNModules(12), fNRCU(2),
c8fe2783 62fTimeCutMin(-1), fTimeCutMax(9999999),
2302a644 63fEMCALCellAmpMin(0),fPHOSCellAmpMin(0),
b8187de4 64fHistoFinePtBins(1000), fHistoFinePtMax(5.), fHistoFinePtMin(0.),
a6f26052 65fHistoPOverEBins(100), fHistoPOverEMax(100.), fHistoPOverEMin(0.),
66fHistodEdxBins(100), fHistodEdxMax(100.), fHistodEdxMin(0.),
67fHistodRBins(100), fHistodRMax(100.), fHistodRMin(0.),
68fHistoTimeBins(100), fHistoTimeMax(100.), fHistoTimeMin(0.),
69fHistoNBins(100), fHistoNMax(100), fHistoNMin(0),
70fHistoRatioBins(100), fHistoRatioMax(100.), fHistoRatioMin(0.),
71fHistoVertexDistBins(100), fHistoVertexDistMax(100.), fHistoVertexDistMin(0.),
c8fe2783 72fHistoRBins(100), fHistoRMax(1000), fHistoRMin(-1000),
73fHistoXBins(100), fHistoXMax(1000), fHistoXMin(-1000),
74fHistoYBins(100), fHistoYMax(1000), fHistoYMin(-1000),
75fHistoZBins(100), fHistoZMax(1000), fHistoZMin(-1000),
a6f26052 76fHistoSSBins(25), fHistoSSMax(5), fHistoSSMin(0),
c8fe2783 77fhE(0),fhPt(0),fhPhi(0),fhEta(0), fhEtaPhiE(0),
78fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiECharged(0),
c8fe2783 79fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
80fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0),
81fhLambda(0), fhDispersion(0),
82fhIM(0), fhIMCellCut(0),fhAsym(0),
83fhNCellsPerCluster(0),fhNCellsPerClusterMIP(0), fhNCellsPerClusterMIPCharged(0), fhNClusters(0),
a95eac90 84fhClusterTimeEnergy(0),fhCellTimeSpreadRespectToCellMax(0),fhCellIdCellLargeTimeSpread(0),
85fhBadClusterMaxCellTimeEnergy(0), fhBadClusterMaxCellCloseCellRatio(0),fhClusterMaxCellTimeEnergy(0), fhClusterMaxCellCloseCellRatio(0),
c8fe2783 86fhRNCells(0),fhXNCells(0),fhYNCells(0),fhZNCells(0),
87fhRE(0), fhXE(0), fhYE(0), fhZE(0), fhXYZ(0),
88fhRCellE(0), fhXCellE(0), fhYCellE(0), fhZCellE(0),fhXYZCell(0),
89fhDeltaCellClusterRNCells(0),fhDeltaCellClusterXNCells(0),fhDeltaCellClusterYNCells(0),fhDeltaCellClusterZNCells(0),
90fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0), fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
91fhNCells(0), fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
92fhTime(0), fhTimeId(0), fhTimeAmp(0), //fhT0Time(0), fhT0TimeId(0), fhT0TimeAmp(0),
93fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
798a9b04 94fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0), fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
95fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0), fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
96fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0), fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
c8fe2783 97fhEMod(0), fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),
98fhGridCellsMod(0), fhGridCellsEMod(0), fhGridCellsTimeMod(0),
a6f26052 99fhAmplitudeMod(0), fhAmplitudeModFraction(0),fhTimeAmpPerRCU(0), //fhT0TimeAmpPerRCU(0), fhTimeCorrRCU(0),
c8fe2783 100fhIMMod(0), fhIMCellCutMod(0),
101fhGenGamPt(0),fhGenGamEta(0),fhGenGamPhi(0),fhGenPi0Pt(0),fhGenPi0Eta(0),fhGenPi0Phi(0),
102fhGenEtaPt(0),fhGenEtaEta(0),fhGenEtaPhi(0),fhGenOmegaPt(0),fhGenOmegaEta(0),fhGenOmegaPhi(0),
103fhGenElePt(0),fhGenEleEta(0),fhGenElePhi(0), fhEMVxyz(0), fhEMR(0), fhHaVxyz(0), fhHaR(0),
104fhGamE(0),fhGamPt(0),fhGamPhi(0),fhGamEta(0),
105fhGamDeltaE(0), fhGamDeltaPt(0),fhGamDeltaPhi(0),fhGamDeltaEta(0),
106fhGamRatioE(0), fhGamRatioPt(0),fhGamRatioPhi(0),fhGamRatioEta(0),
107fhEleE(0),fhElePt(0),fhElePhi(0),fhEleEta(0),
108fhPi0E(0),fhPi0Pt(0),fhPi0Phi(0),fhPi0Eta(0),
109fhNeHadE(0),fhNeHadPt(0),fhNeHadPhi(0),fhNeHadEta(0),
110fhChHadE(0),fhChHadPt(0),fhChHadPhi(0),fhChHadEta(0),
111fhGamECharged(0),fhGamPtCharged(0),fhGamPhiCharged(0),fhGamEtaCharged(0),
112fhEleECharged(0),fhElePtCharged(0),fhElePhiCharged(0),fhEleEtaCharged(0),
113fhPi0ECharged(0),fhPi0PtCharged(0),fhPi0PhiCharged(0),fhPi0EtaCharged(0),
114fhNeHadECharged(0),fhNeHadPtCharged(0),fhNeHadPhiCharged(0),fhNeHadEtaCharged(0),
115fhChHadECharged(0),fhChHadPtCharged(0),fhChHadPhiCharged(0),fhChHadEtaCharged(0),
116fhGenGamAccE(0),fhGenGamAccPt(0),fhGenGamAccEta(0),fhGenGamAccPhi(0),
117fhGenPi0AccE(0),fhGenPi0AccPt(0),fhGenPi0AccEta(0),fhGenPi0AccPhi(0),
118fh1pOverE(0),fh1dR(0),fh2EledEdx(0), fh2MatchdEdx(0),fhMCEle1pOverE(0),fhMCEle1dR(0),fhMCEle2MatchdEdx(0),
119fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
120fhMCNeutral1pOverE(0),fhMCNeutral1dR(0),fhMCNeutral2MatchdEdx(0),
121fh1pOverER02(0), fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
9725fd2a 122{
a6f26052 123 //Default Ctor
afabc52f 124
a6f26052 125 //Initialize parameters
9725fd2a 126 InitParameters();
127}
a5fafd85 128
a6f26052 129//________________________________________________________________________
0c1383b5 130TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
131{
a6f26052 132 //Save parameters used for analysis
2302a644 133 TString parList ; //this will be list of parameters used for this analysis.
f8006433 134 const Int_t buffersize = 255;
2302a644 135 char onePar[buffersize] ;
c8fe2783 136
2302a644 137 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
138 parList+=onePar ;
139 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
140 parList+=onePar ;
141 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
142 parList+=onePar ;
143 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
144 parList+=onePar ;
a6f26052 145 //Get parameters set in base class.
146 //parList += GetBaseParametersList() ;
2302a644 147
a6f26052 148 //Get parameters set in FiducialCut class (not available yet)
149 //parlist += GetFidCut()->GetFidCutParametersList()
0c1383b5 150
2302a644 151 return new TObjString(parList) ;
0c1383b5 152}
153
a5fafd85 154
a6f26052 155//________________________________________________________________________
9725fd2a 156TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
157{
a6f26052 158 // Create histograms to be saved in output file and
159 // store them in outputContainer
c8fe2783 160
2302a644 161 TList * outputContainer = new TList() ;
162 outputContainer->SetName("QAHistos") ;
163
a6f26052 164 //Histograms
2302a644 165 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
b8187de4 166 Int_t nfineptbins = GetHistoFinePtBins(); Float_t ptfinemax = GetHistoFinePtMax(); Float_t ptfinemin = GetHistoFinePtMin();
2302a644 167 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
168 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
169 Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
170 Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
171 Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
172 Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
173 Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
174 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
175 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
176 Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
177 Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
178 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
179 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
180 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
181 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
182 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
798a9b04 183 Int_t nv0sbins = GetHistoV0SignalBins(); Int_t nv0smax = GetHistoV0SignalMax(); Int_t nv0smin = GetHistoV0SignalMin();
184 Int_t nv0mbins = GetHistoV0MultiplicityBins();Int_t nv0mmax = GetHistoV0MultiplicityMax();Int_t nv0mmin = GetHistoV0MultiplicityMin();
185 Int_t ntrmbins = GetHistoTrackMultiplicityBins();Int_t ntrmmax = GetHistoTrackMultiplicityMax();Int_t ntrmmin = GetHistoTrackMultiplicityMin();
186
a6f26052 187 //EMCAL
2302a644 188 Int_t colmax = 48;
189 Int_t rowmax = 24;
190 fNRCU = 2 ;
a6f26052 191 //PHOS
2302a644 192 if(fCalorimeter=="PHOS"){
193 colmax = 56;
194 rowmax = 64;
195 fNRCU = 4 ;
196 }
197
a6f26052 198
2302a644 199 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
200 fhE->SetXTitle("E (GeV)");
201 outputContainer->Add(fhE);
202
203 if(fFillAllTH12){
a6f26052 204 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
205 fhPt->SetXTitle("p_{T} (GeV/c)");
206 outputContainer->Add(fhPt);
207
208 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
209 fhPhi->SetXTitle("#phi (rad)");
210 outputContainer->Add(fhPhi);
211
212 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
213 fhEta->SetXTitle("#eta ");
214 outputContainer->Add(fhEta);
2302a644 215 }
a6f26052 216
2302a644 217 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
c8fe2783 218 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2302a644 219 fhEtaPhiE->SetXTitle("#eta ");
220 fhEtaPhiE->SetYTitle("#phi (rad)");
221 fhEtaPhiE->SetZTitle("E (GeV) ");
222 outputContainer->Add(fhEtaPhiE);
223
224 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
c8fe2783 225 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2302a644 226 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
227 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
228 outputContainer->Add(fhClusterTimeEnergy);
a95eac90 229
230 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCell","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
231 nptbins,ptmin,ptmax, 100,0,1.);
232 fhClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
233 fhClusterMaxCellCloseCellRatio->SetYTitle("ratio");
234 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
235
236 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCell","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
237 nptbins,ptmin,ptmax, 100,0,1.);
238 fhBadClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
239 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
240 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
241
242 fhClusterMaxCellTimeEnergy = new TH2F ("hClusterMaxCellTimeEnergy","energy vs TOF of maximum constributing cell, reconstructed clusters",
243 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
244 fhClusterMaxCellTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
245 fhClusterMaxCellTimeEnergy->SetYTitle("TOF (ns)");
246 outputContainer->Add(fhClusterMaxCellTimeEnergy);
247
248 fhBadClusterMaxCellTimeEnergy = new TH2F ("hBadClusterMaxCellTimeEnergy","energy vs TOF of maximum constributing cell, reconstructed clusters",
249 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
250 fhBadClusterMaxCellTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
251 fhBadClusterMaxCellTimeEnergy->SetYTitle("TOF (ns)");
252 outputContainer->Add(fhBadClusterMaxCellTimeEnergy);
2302a644 253
a6f26052 254 //Shower shape
2302a644 255 fhLambda = new TH3F ("hLambda","#lambda_{0}^{2} vs #lambda_{1}^{2} vs energy, reconstructed clusters",
c8fe2783 256 ssbins,ssmin,ssmax,ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
2302a644 257 fhLambda->SetXTitle("#lambda_{0}^{2} ");
258 fhLambda->SetYTitle("#lambda_{1}^{2} ");
259 fhLambda->SetZTitle("E (GeV) ");
260 outputContainer->Add(fhLambda);
261
262 fhDispersion = new TH2F ("hDispersion"," dispersion vs energy, reconstructed clusters",
c8fe2783 263 ssbins,ssmin,ssmax,nptbins,ptmin,ptmax);
2302a644 264 fhDispersion->SetXTitle("Dispersion ");
265 fhDispersion->SetYTitle("E (GeV) ");
266 outputContainer->Add(fhDispersion);
267
a6f26052 268 //Track Matching
269 if(fFillAllTH12){
270 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
271 fhECharged->SetXTitle("E (GeV)");
272 outputContainer->Add(fhECharged);
273
274 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
275 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
276 outputContainer->Add(fhPtCharged);
277
278 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
279 fhPhiCharged->SetXTitle("#phi (rad)");
280 outputContainer->Add(fhPhiCharged);
281
282 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
283 fhEtaCharged->SetXTitle("#eta ");
284 outputContainer->Add(fhEtaCharged);
285 }
c8fe2783 286
2302a644 287 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
c8fe2783 288 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2302a644 289 fhEtaPhiECharged->SetXTitle("#eta ");
290 fhEtaPhiECharged->SetYTitle("#phi ");
291 fhEtaPhiECharged->SetZTitle("E (GeV) ");
292 outputContainer->Add(fhEtaPhiECharged);
293
294 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
295 fh1pOverE->SetYTitle("p/E");
296 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
297 outputContainer->Add(fh1pOverE);
298
299 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
300 fh1dR->SetXTitle("#Delta R (rad)");
301 outputContainer->Add(fh1dR) ;
302
303 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
304 fh2MatchdEdx->SetXTitle("p (GeV/c)");
305 fh2MatchdEdx->SetYTitle("<dE/dx>");
306 outputContainer->Add(fh2MatchdEdx);
307
308 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
309 fh2EledEdx->SetXTitle("p (GeV/c)");
310 fh2EledEdx->SetYTitle("<dE/dx>");
311 outputContainer->Add(fh2EledEdx) ;
312
313 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
314 fh1pOverER02->SetYTitle("p/E");
315 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
316 outputContainer->Add(fh1pOverER02);
317
318 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
319 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
320 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
321 outputContainer->Add(fhIM);
322
323 fhIMCellCut = new TH2F ("hIMCellCut","Cluster (n cell > 1) pairs Invariant mass vs reconstructed pair energy",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
324 fhIMCellCut->SetXTitle("p_{T, cluster pairs} (GeV) ");
325 fhIMCellCut->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
326 outputContainer->Add(fhIMCellCut);
a6f26052 327
b8187de4 328 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
329 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
330 fhAsym->SetYTitle("Asymmetry");
331 outputContainer->Add(fhAsym);
332
a6f26052 333
b8187de4 334 Int_t nlargeetabins = 3;
2302a644 335 if(fCalorimeter=="EMCAL") nlargeetabins = 8;
b8187de4 336
2302a644 337 fhNCellsPerCluster = new TH3F ("hNCellsPerCluster","# cells per cluster vs energy vs #eta",nptbins,ptmin,ptmax, nbins,nmin,nmax, nlargeetabins,etamin,etamax);
338 fhNCellsPerCluster->SetXTitle("E (GeV)");
339 fhNCellsPerCluster->SetYTitle("n cells");
340 fhNCellsPerCluster->SetZTitle("#eta");
341 outputContainer->Add(fhNCellsPerCluster);
342
343
344 fhNCellsPerClusterMIP = new TH3F ("hNCellsPerClusterMIP","# cells per cluster vs energy vs #eta, smaller bin for MIP search",
b8187de4 345 40,0.,2., 11,0,10,nlargeetabins,etamin,etamax);
2302a644 346 fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
347 fhNCellsPerClusterMIP->SetYTitle("n cells");
348 fhNCellsPerClusterMIP->SetZTitle("#eta");
349 outputContainer->Add(fhNCellsPerClusterMIP);
350
351
352 fhNCellsPerClusterMIPCharged = new TH3F ("hNCellsPerClusterMIPCharged","# cells per track-matched cluster vs energy vs #eta, smaller bin for MIP search",
b8187de4 353 40,0.,2., 11,0,10,nlargeetabins,etamin,etamax);
2302a644 354 fhNCellsPerClusterMIPCharged->SetXTitle("E (GeV)");
355 fhNCellsPerClusterMIPCharged->SetYTitle("n cells");
356 fhNCellsPerClusterMIPCharged->SetZTitle("#eta");
357 outputContainer->Add(fhNCellsPerClusterMIPCharged);
0866d83a 358
8b5f17b6 359
2302a644 360 fhNClusters = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax);
361 fhNClusters->SetXTitle("number of clusters");
362 outputContainer->Add(fhNClusters);
c8fe2783 363
b8187de4 364 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
365 fhXYZ->SetXTitle("x (cm)");
366 fhXYZ->SetYTitle("y (cm)");
367 fhXYZ->SetZTitle("z (cm) ");
368 outputContainer->Add(fhXYZ);
369
370 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Clusters per Cell",xbins,xmin,xmax,nbins,nmin,nmax);
371 fhXNCells->SetXTitle("x (cm)");
372 fhXNCells->SetYTitle("N cells per cluster");
373 outputContainer->Add(fhXNCells);
374
375 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Clusters per Cell",zbins,zmin,zmax,nbins,nmin,nmax);
376 fhZNCells->SetXTitle("z (cm)");
377 fhZNCells->SetYTitle("N cells per cluster");
378 outputContainer->Add(fhZNCells);
379
380 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
381 fhXE->SetXTitle("x (cm)");
382 fhXE->SetYTitle("E (GeV)");
383 outputContainer->Add(fhXE);
384
385 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
386 fhZE->SetXTitle("z (cm)");
387 fhZE->SetYTitle("E (GeV)");
388 outputContainer->Add(fhZE);
389
390
391 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Clusters per Cell",rbins,rmin,rmax,nbins,nmin,nmax);
392 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
393 fhRNCells->SetYTitle("N cells per cluster");
394 outputContainer->Add(fhRNCells);
395
396
397 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Clusters per Cell",ybins,ymin,ymax,nbins,nmin,nmax);
398 fhYNCells->SetXTitle("y (cm)");
399 fhYNCells->SetYTitle("N cells per cluster");
400 outputContainer->Add(fhYNCells);
401
402 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
403 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
404 fhRE->SetYTitle("E (GeV)");
405 outputContainer->Add(fhRE);
406
407 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
408 fhYE->SetXTitle("y (cm)");
409 fhYE->SetYTitle("E (GeV)");
410 outputContainer->Add(fhYE);
a6f26052 411
b8187de4 412 if(fFillAllPosHisto){
413
a6f26052 414 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
415 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
416 fhRCellE->SetYTitle("E (GeV)");
417 outputContainer->Add(fhRCellE);
418
419 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
420 fhXCellE->SetXTitle("x (cm)");
421 fhXCellE->SetYTitle("E (GeV)");
422 outputContainer->Add(fhXCellE);
423
424 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
425 fhYCellE->SetXTitle("y (cm)");
426 fhYCellE->SetYTitle("E (GeV)");
427 outputContainer->Add(fhYCellE);
428
429 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
430 fhZCellE->SetXTitle("z (cm)");
431 fhZCellE->SetYTitle("E (GeV)");
432 outputContainer->Add(fhZCellE);
433
434 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
435 fhXYZCell->SetXTitle("x (cm)");
436 fhXYZCell->SetYTitle("y (cm)");
437 fhXYZCell->SetZTitle("z (cm)");
438 outputContainer->Add(fhXYZCell);
439
440
441 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
442 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
443 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
444 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
445
446 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Clusters per Cell",rbins*2,-dr,dr,nbins,nmin,nmax);
447 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
448 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
449 outputContainer->Add(fhDeltaCellClusterRNCells);
450
451 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Clusters per Cell",xbins*2,-dx,dx,nbins,nmin,nmax);
452 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
453 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
454 outputContainer->Add(fhDeltaCellClusterXNCells);
455
456 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Clusters per Cell",ybins*2,-dy,dy,nbins,nmin,nmax);
457 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
458 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
459 outputContainer->Add(fhDeltaCellClusterYNCells);
460
461 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Clusters per Cell",zbins*2,-dz,dz,nbins,nmin,nmax);
462 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
463 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
464 outputContainer->Add(fhDeltaCellClusterZNCells);
465
466 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
467 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
468 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
469 outputContainer->Add(fhDeltaCellClusterRE);
470
471 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
472 fhDeltaCellClusterXE->SetXTitle("x (cm)");
473 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
474 outputContainer->Add(fhDeltaCellClusterXE);
475
476 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
477 fhDeltaCellClusterYE->SetXTitle("y (cm)");
478 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
479 outputContainer->Add(fhDeltaCellClusterYE);
480
481 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
482 fhDeltaCellClusterZE->SetXTitle("z (cm)");
483 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
484 outputContainer->Add(fhDeltaCellClusterZE);
485
486 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
487 fhEtaPhiAmp->SetXTitle("#eta ");
488 fhEtaPhiAmp->SetYTitle("#phi (rad)");
489 fhEtaPhiAmp->SetZTitle("E (GeV) ");
490 outputContainer->Add(fhEtaPhiAmp);
491
2302a644 492 }
c8fe2783 493
a6f26052 494 //Calo cells
2302a644 495 fhNCells = new TH1F ("hNCells","# cells", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
496 fhNCells->SetXTitle("n cells");
497 outputContainer->Add(fhNCells);
498
499 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
500 fhAmplitude->SetXTitle("Cell Energy (GeV)");
501 outputContainer->Add(fhAmplitude);
502
503 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
504 fhAmpId->SetXTitle("Cell Energy (GeV)");
505 outputContainer->Add(fhAmpId);
506
c8fe2783 507
a6f26052 508 //Cell Time histograms, time only available in ESDs
2302a644 509 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
510
511 fhCellTimeSpreadRespectToCellMax = new TH1F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", 100,-200,200);
512 fhCellTimeSpreadRespectToCellMax->SetXTitle("#Delta t (ns)");
513 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
514
515 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","", colmax*rowmax*fNModules,0,colmax*rowmax*fNModules);
516 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
517 outputContainer->Add(fhCellIdCellLargeTimeSpread);
a95eac90 518
2302a644 519 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
520 fhTime->SetXTitle("Cell Time (ns)");
521 outputContainer->Add(fhTime);
522
523 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
524 fhTimeId->SetXTitle("Cell Time (ns)");
525 fhTimeId->SetYTitle("Cell Absolute Id");
526 outputContainer->Add(fhTimeId);
527
528 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
529 fhTimeAmp->SetYTitle("Cell Time (ns)");
530 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
531 outputContainer->Add(fhTimeAmp);
532
a6f26052 533 // fhT0Time = new TH1F ("hT0Time","Cell Time",ntimebins,timemin,timemax);
534 // fhT0Time->SetXTitle("T_{0} - T_{EMCal} (ns)");
535 // outputContainer->Add(fhT0Time);
536 //
537 // fhT0TimeId = new TH2F ("hT0TimeId","Cell Time vs Absolute Id",ntimebins,timemin,timemax,rowmax*colmax*fNModules,0,rowmax*colmax*fNModules);
538 // fhT0TimeId->SetXTitle("T_{0} - T_{EMCal} (ns)");
539 // fhT0TimeId->SetYTitle("Cell Absolute Id");
540 // outputContainer->Add(fhT0TimeId);
541 //
542 // fhT0TimeAmp = new TH2F ("hT0TimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
543 // fhT0TimeAmp->SetYTitle("T_{0} - T_{EMCal} (ns)");
544 // fhT0TimeAmp->SetXTitle("Cell Energy (GeV)");
545 // outputContainer->Add(fhT0TimeAmp);
2302a644 546 }
a0bb4dc0 547
798a9b04 548 if(fCorrelate){
549 //PHOS vs EMCAL
2302a644 550 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nbins,nmin,nmax,nbins,nmin,nmax);
551 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
552 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
553 outputContainer->Add(fhCaloCorrNClusters);
554
798a9b04 555 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2302a644 556 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
557 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
558 outputContainer->Add(fhCaloCorrEClusters);
559
560 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", nbins,nmin,nmax, nbins,nmin,nmax);
561 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
562 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
563 outputContainer->Add(fhCaloCorrNCells);
564
798a9b04 565 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins*2,ptmin,ptmax*2);
2302a644 566 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
567 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
568 outputContainer->Add(fhCaloCorrECells);
798a9b04 569
570 //Calorimeter VS V0 signal
571 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nbins,nmin,nmax);
572 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
573 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
574 outputContainer->Add(fhCaloV0SCorrNClusters);
575
b3fdfed5 576 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
798a9b04 577 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
578 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
579 outputContainer->Add(fhCaloV0SCorrEClusters);
580
b3fdfed5 581 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax, nbins,nmin,nmax);
798a9b04 582 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
583 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
584 outputContainer->Add(fhCaloV0SCorrNCells);
585
586 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
587 fhCaloV0SCorrECells->SetXTitle("V0 signal");
588 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
589 outputContainer->Add(fhCaloV0SCorrECells);
590
591 //Calorimeter VS V0 multiplicity
592 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nbins,nmin,nmax);
593 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
594 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
595 outputContainer->Add(fhCaloV0MCorrNClusters);
596
b3fdfed5 597 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
798a9b04 598 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
599 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
600 outputContainer->Add(fhCaloV0MCorrEClusters);
601
b3fdfed5 602 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax, nbins,nmin,nmax);
798a9b04 603 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
604 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
605 outputContainer->Add(fhCaloV0MCorrNCells);
606
607 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
608 fhCaloV0MCorrECells->SetXTitle("V0 signal");
609 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
17d63906 610 outputContainer->Add(fhCaloV0MCorrECells);
798a9b04 611
612 //Calorimeter VS Track multiplicity
613 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nbins,nmin,nmax);
614 fhCaloTrackMCorrNClusters->SetXTitle("Track Multiplicity");
615 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
616 outputContainer->Add(fhCaloTrackMCorrNClusters);
617
b3fdfed5 618 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
798a9b04 619 fhCaloTrackMCorrEClusters->SetXTitle("Track Multiplicity");
620 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
621 outputContainer->Add(fhCaloTrackMCorrEClusters);
622
b3fdfed5 623 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax, nbins,nmin,nmax);
798a9b04 624 fhCaloTrackMCorrNCells->SetXTitle("Track Multiplicity");
625 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
626 outputContainer->Add(fhCaloTrackMCorrNCells);
627
628 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
629 fhCaloTrackMCorrECells->SetXTitle("Track Multiplicity");
630 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
17d63906 631 outputContainer->Add(fhCaloTrackMCorrECells);
798a9b04 632
633
2302a644 634 }//correlate calorimeters
635
a6f26052 636 //Module histograms
2302a644 637 fhEMod = new TH1F*[fNModules];
638 fhNClustersMod = new TH1F*[fNModules];
639 fhNCellsPerClusterMod = new TH2F*[fNModules];
640 fhNCellsMod = new TH1F*[fNModules];
641 fhGridCellsMod = new TH2F*[fNModules];
642 fhGridCellsEMod = new TH2F*[fNModules];
643 fhGridCellsTimeMod = new TH2F*[fNModules];
644 fhAmplitudeMod = new TH1F*[fNModules];
645 if(fCalorimeter=="EMCAL")
646 fhAmplitudeModFraction = new TH1F*[fNModules*3];
647
648 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
a6f26052 649 //fhT0TimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
650 //fhTimeCorrRCU = new TH2F*[fNModules*fNRCU*fNModules*fNRCU];
c8fe2783 651
2302a644 652 fhIMMod = new TH2F*[fNModules];
653 fhIMCellCutMod = new TH2F*[fNModules];
654
655 for(Int_t imod = 0; imod < fNModules; imod++){
656
657 fhEMod[imod] = new TH1F (Form("hE_Mod%d",imod),Form("Cluster reconstructed Energy in Module %d ",imod), nptbins,ptmin,ptmax);
658 fhEMod[imod]->SetXTitle("E (GeV)");
659 outputContainer->Add(fhEMod[imod]);
660
661 fhNClustersMod[imod] = new TH1F (Form("hNClusters_Mod%d",imod),Form("# clusters in Module %d",imod), nbins,nmin,nmax);
662 fhNClustersMod[imod]->SetXTitle("number of clusters");
663 outputContainer->Add(fhNClustersMod[imod]);
664
665 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
c8fe2783 666 Form("# cells per cluster vs cluster energy in Module %d",imod),
667 nptbins,ptmin,ptmax, nbins,nmin,nmax);
2302a644 668 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
669 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
670 outputContainer->Add(fhNCellsPerClusterMod[imod]);
671
672 fhNCellsMod[imod] = new TH1F (Form("hNCells_Mod%d",imod),Form("# cells in Module %d",imod), colmax*rowmax,0,colmax*rowmax);
673 fhNCellsMod[imod]->SetXTitle("n cells");
674 outputContainer->Add(fhNCellsMod[imod]);
675 fhGridCellsMod[imod] = new TH2F (Form("hGridCells_Mod%d",imod),Form("Entries in grid of cells in Module %d",imod),
c8fe2783 676 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
2302a644 677 fhGridCellsMod[imod]->SetYTitle("row (phi direction)");
678 fhGridCellsMod[imod]->SetXTitle("column (eta direction)");
679 outputContainer->Add(fhGridCellsMod[imod]);
c8fe2783 680
2302a644 681 fhGridCellsEMod[imod] = new TH2F (Form("hGridCellsE_Mod%d",imod),Form("Accumulated energy in grid of cells in Module %d",imod),
c8fe2783 682 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
2302a644 683 fhGridCellsEMod[imod]->SetYTitle("row (phi direction)");
684 fhGridCellsEMod[imod]->SetXTitle("column (eta direction)");
685 outputContainer->Add(fhGridCellsEMod[imod]);
686
687 fhGridCellsTimeMod[imod] = new TH2F (Form("hGridCellsTime_Mod%d",imod),Form("Accumulated time in grid of cells in Module %d, with E > 0.5 GeV",imod),
c8fe2783 688 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
2302a644 689 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction)");
690 fhGridCellsTimeMod[imod]->SetXTitle("column (eta direction)");
691 outputContainer->Add(fhGridCellsTimeMod[imod]);
692
693 fhAmplitudeMod[imod] = new TH1F (Form("hAmplitude_Mod%d",imod),Form("Cell Energy in Module %d",imod), nptbins*2,ptmin,ptmax);
694 fhAmplitudeMod[imod]->SetXTitle("Cell Energy (GeV)");
695 outputContainer->Add(fhAmplitudeMod[imod]);
696
697 if(fCalorimeter == "EMCAL"){
698 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
17d63906 699 fhAmplitudeModFraction[imod*3+ifrac] = new TH1F (Form("hAmplitude_Mod%d_Frac%d",imod,ifrac),Form("Cell reconstructed Energy in Module %d, Fraction %d ",imod,ifrac), nptbins,ptmin,ptmax);
700 fhAmplitudeModFraction[imod*3+ifrac]->SetXTitle("E (GeV)");
701 outputContainer->Add(fhAmplitudeModFraction[imod*3+ifrac]);
2302a644 702 }
703
704 }
ff5cc919 705 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2302a644 706
ff5cc919 707 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
708 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
709 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
710 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
711 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
712 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
713 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
714
715 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hT0TimeAmp_Mod%d_RCU%d",imod,ircu),
716 // Form("Cell Energy vs T0-Cell Time in Module %d, RCU %d ",imod,ircu),
717 // nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
718 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
719 // fhT0TimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("T_{0} - T_{EMCal} (ns)");
720 // outputContainer->Add(fhT0TimeAmpPerRCU[imod*fNRCU+ircu]);
721 //
722
723 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
724 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
725 // Int_t index = (imod2*fNRCU+ircu2)+(fNModules*fNRCU)*(ircu+imod)+fNRCU*fNModules*imod;
726 // fhTimeCorrRCU[index] = new TH2F (Form("hTimeCorrRCU_Mod%d_RCU%d_CompareTo_Mod%d_RCU%d",imod, ircu,imod2, ircu2),
727 // Form("Cell Energy > 0.3, Correlate cell Time in Module %d, RCU %d to Module %d, RCU %d",imod,ircu,imod2, ircu2),
728 // ntimebins,timemin,timemax,ntimebins,timemin,timemax);
729 // fhTimeCorrRCU[index]->SetXTitle("Trigger Cell Time (ns)");
730 // fhTimeCorrRCU[index]->SetYTitle("Cell Time (ns)");
731 // outputContainer->Add(fhTimeCorrRCU[index]);
732 // }
733 // }
734 }
2302a644 735 }
736
2302a644 737 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
c8fe2783 738 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
739 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2302a644 740 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
741 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
742 outputContainer->Add(fhIMMod[imod]);
c8fe2783 743
2302a644 744 fhIMCellCutMod[imod] = new TH2F (Form("hIMCellCut_Mod%d",imod),
c8fe2783 745 Form("Cluster (n cells > 1) pairs Invariant mass vs reconstructed pair energy in Module %d",imod),
746 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2302a644 747 fhIMCellCutMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
748 fhIMCellCutMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
749 outputContainer->Add(fhIMCellCutMod[imod]);
750
751 }
752
753
a6f26052 754 //Monte Carlo Histograms
2302a644 755 if(IsDataMC()){
756
757 fhDeltaE = new TH1F ("hDeltaE","MC - Reco E ", nptbins*2,-ptmax,ptmax);
758 fhDeltaE->SetXTitle("#Delta E (GeV)");
759 outputContainer->Add(fhDeltaE);
760
761 fhDeltaPt = new TH1F ("hDeltaPt","MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
762 fhDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
763 outputContainer->Add(fhDeltaPt);
764
765 fhDeltaPhi = new TH1F ("hDeltaPhi","MC - Reco #phi ",nphibins*2,-phimax,phimax);
766 fhDeltaPhi->SetXTitle("#Delta #phi (rad)");
767 outputContainer->Add(fhDeltaPhi);
768
769 fhDeltaEta = new TH1F ("hDeltaEta","MC- Reco #eta",netabins*2,-etamax,etamax);
770 fhDeltaEta->SetXTitle("#Delta #eta ");
771 outputContainer->Add(fhDeltaEta);
772
773 fhRatioE = new TH1F ("hRatioE","Reco/MC E ", nratiobins,ratiomin,ratiomax);
774 fhRatioE->SetXTitle("E_{reco}/E_{gen}");
775 outputContainer->Add(fhRatioE);
776
777 fhRatioPt = new TH1F ("hRatioPt","Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
778 fhRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
779 outputContainer->Add(fhRatioPt);
780
781 fhRatioPhi = new TH1F ("hRatioPhi","Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
782 fhRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
783 outputContainer->Add(fhRatioPhi);
784
785 fhRatioEta = new TH1F ("hRatioEta","Reco/MC #eta",nratiobins,ratiomin,ratiomax);
786 fhRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
787 outputContainer->Add(fhRatioEta);
788
789 fh2E = new TH2F ("h2E","E distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
790 fh2E->SetXTitle("E_{rec} (GeV)");
791 fh2E->SetYTitle("E_{gen} (GeV)");
792 outputContainer->Add(fh2E);
793
794 fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
795 fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
796 fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
797 outputContainer->Add(fh2Pt);
798
799 fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax);
800 fh2Phi->SetXTitle("#phi_{rec} (rad)");
801 fh2Phi->SetYTitle("#phi_{gen} (rad)");
802 outputContainer->Add(fh2Phi);
803
804 fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax);
805 fh2Eta->SetXTitle("#eta_{rec} ");
806 fh2Eta->SetYTitle("#eta_{gen} ");
807 outputContainer->Add(fh2Eta);
808
a6f26052 809 //Fill histos depending on origin of cluster
2302a644 810 fhGamE = new TH2F ("hGamE","E reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
811 fhGamE->SetXTitle("E_{rec} (GeV)");
812 fhGamE->SetXTitle("E_{gen} (GeV)");
813 outputContainer->Add(fhGamE);
814
815 fhGamPt = new TH2F ("hGamPt","p_{T} reconstructed vs E generated from #gamma", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
816 fhGamPt->SetXTitle("p_{T rec} (GeV/c)");
817 fhGamPt->SetYTitle("p_{T gen} (GeV/c)");
818 outputContainer->Add(fhGamPt);
819
820 fhGamPhi = new TH2F ("hGamPhi","#phi reconstructed vs E generated from #gamma",nphibins,phimin,phimax,nphibins,phimin,phimax);
821 fhGamPhi->SetXTitle("#phi_{rec} (rad)");
822 fhGamPhi->SetYTitle("#phi_{gen} (rad)");
823 outputContainer->Add(fhGamPhi);
824
825 fhGamEta = new TH2F ("hGamEta","#eta reconstructed vs E generated from #gamma",netabins,etamin,etamax,netabins,etamin,etamax);
826 fhGamEta->SetXTitle("#eta_{rec} ");
827 fhGamEta->SetYTitle("#eta_{gen} ");
828 outputContainer->Add(fhGamEta);
829
830 fhGamDeltaE = new TH1F ("hGamDeltaE","#gamma MC - Reco E ", nptbins*2,-ptmax,ptmax);
831 fhGamDeltaE->SetXTitle("#Delta E (GeV)");
832 outputContainer->Add(fhGamDeltaE);
833
834 fhGamDeltaPt = new TH1F ("hGamDeltaPt","#gamma MC - Reco p_{T} ", nptbins*2,-ptmax,ptmax);
835 fhGamDeltaPt->SetXTitle("#Delta p_{T} (GeV/c)");
836 outputContainer->Add(fhGamDeltaPt);
837
838 fhGamDeltaPhi = new TH1F ("hGamDeltaPhi","#gamma MC - Reco #phi ",nphibins*2,-phimax,phimax);
839 fhGamDeltaPhi->SetXTitle("#Delta #phi (rad)");
840 outputContainer->Add(fhGamDeltaPhi);
841
842 fhGamDeltaEta = new TH1F ("hGamDeltaEta","#gamma MC- Reco #eta",netabins*2,-etamax,etamax);
843 fhGamDeltaEta->SetXTitle("#Delta #eta ");
844 outputContainer->Add(fhGamDeltaEta);
845
846 fhGamRatioE = new TH1F ("hGamRatioE","#gamma Reco/MC E ", nratiobins,ratiomin,ratiomax);
847 fhGamRatioE->SetXTitle("E_{reco}/E_{gen}");
848 outputContainer->Add(fhGamRatioE);
849
850 fhGamRatioPt = new TH1F ("hGamRatioPt","#gamma Reco/MC p_{T} ", nratiobins,ratiomin,ratiomax);
851 fhGamRatioPt->SetXTitle("p_{T, reco}/p_{T, gen}");
852 outputContainer->Add(fhGamRatioPt);
853
854 fhGamRatioPhi = new TH1F ("hGamRatioPhi","#gamma Reco/MC #phi ",nratiobins,ratiomin,ratiomax);
855 fhGamRatioPhi->SetXTitle("#phi_{reco}/#phi_{gen}");
856 outputContainer->Add(fhGamRatioPhi);
857
858 fhGamRatioEta = new TH1F ("hGamRatioEta","#gamma Reco/MC #eta",nratiobins,ratiomin,ratiomax);
859 fhGamRatioEta->SetXTitle("#eta_{reco}/#eta_{gen} ");
860 outputContainer->Add(fhGamRatioEta);
861
862 fhPi0E = new TH2F ("hPi0E","E reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
863 fhPi0E->SetXTitle("E_{rec} (GeV)");
864 fhPi0E->SetYTitle("E_{gen} (GeV)");
865 outputContainer->Add(fhPi0E);
866
867 fhPi0Pt = new TH2F ("hPi0Pt","p_{T} reconstructed vs E generated from #pi^{0}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
868 fhPi0Pt->SetXTitle("p_{T rec} (GeV/c)");
869 fhPi0Pt->SetYTitle("p_{T gen} (GeV/c)");
870 outputContainer->Add(fhPi0Pt);
871
872 fhPi0Phi = new TH2F ("hPi0Phi","#phi reconstructed vs E generated from #pi^{0}",nphibins,phimin,phimax,nphibins,phimin,phimax);
873 fhPi0Phi->SetXTitle("#phi_{rec} (rad)");
874 fhPi0Phi->SetYTitle("#phi_{gen} (rad)");
875 outputContainer->Add(fhPi0Phi);
876
877 fhPi0Eta = new TH2F ("hPi0Eta","#eta reconstructed vs E generated from #pi^{0}",netabins,etamin,etamax,netabins,etamin,etamax);
878 fhPi0Eta->SetXTitle("#eta_{rec} ");
879 fhPi0Eta->SetYTitle("#eta_{gen} ");
880 outputContainer->Add(fhPi0Eta);
881
882 fhEleE = new TH2F ("hEleE","E reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
883 fhEleE->SetXTitle("E_{rec} (GeV)");
884 fhEleE->SetXTitle("E_{gen} (GeV)");
885 outputContainer->Add(fhEleE);
886
887 fhElePt = new TH2F ("hElePt","p_{T} reconstructed vs E generated from e^{#pm}", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
888 fhElePt->SetXTitle("p_{T rec} (GeV/c)");
889 fhElePt->SetYTitle("p_{T gen} (GeV/c)");
890 outputContainer->Add(fhElePt);
891
892 fhElePhi = new TH2F ("hElePhi","#phi reconstructed vs E generated from e^{#pm}",nphibins,phimin,phimax,nphibins,phimin,phimax);
893 fhElePhi->SetXTitle("#phi_{rec} (rad)");
894 fhElePhi->SetYTitle("#phi_{gen} (rad)");
895 outputContainer->Add(fhElePhi);
896
897 fhEleEta = new TH2F ("hEleEta","#eta reconstructed vs E generated from e^{#pm}",netabins,etamin,etamax,netabins,etamin,etamax);
898 fhEleEta->SetXTitle("#eta_{rec} ");
899 fhEleEta->SetYTitle("#eta_{gen} ");
900 outputContainer->Add(fhEleEta);
901
902 fhNeHadE = new TH2F ("hNeHadE","E reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
903 fhNeHadE->SetXTitle("E_{rec} (GeV)");
904 fhNeHadE->SetYTitle("E_{gen} (GeV)");
905 outputContainer->Add(fhNeHadE);
906
907 fhNeHadPt = new TH2F ("hNeHadPt","p_{T} reconstructed vs E generated from neutral hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
908 fhNeHadPt->SetXTitle("p_{T rec} (GeV/c)");
909 fhNeHadPt->SetYTitle("p_{T gen} (GeV/c)");
910 outputContainer->Add(fhNeHadPt);
911
912 fhNeHadPhi = new TH2F ("hNeHadPhi","#phi reconstructed vs E generated from neutral hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
913 fhNeHadPhi->SetXTitle("#phi_{rec} (rad)");
914 fhNeHadPhi->SetYTitle("#phi_{gen} (rad)");
915 outputContainer->Add(fhNeHadPhi);
916
917 fhNeHadEta = new TH2F ("hNeHadEta","#eta reconstructed vs E generated from neutral hadron",netabins,etamin,etamax,netabins,etamin,etamax);
918 fhNeHadEta->SetXTitle("#eta_{rec} ");
919 fhNeHadEta->SetYTitle("#eta_{gen} ");
920 outputContainer->Add(fhNeHadEta);
921
922 fhChHadE = new TH2F ("hChHadE","E reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
923 fhChHadE->SetXTitle("E_{rec} (GeV)");
924 fhChHadE->SetYTitle("E_{gen} (GeV)");
925 outputContainer->Add(fhChHadE);
926
927 fhChHadPt = new TH2F ("hChHadPt","p_{T} reconstructed vs E generated from charged hadron", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
928 fhChHadPt->SetXTitle("p_{T rec} (GeV/c)");
929 fhChHadPt->SetYTitle("p_{T gen} (GeV/c)");
930 outputContainer->Add(fhChHadPt);
931
932 fhChHadPhi = new TH2F ("hChHadPhi","#phi reconstructed vs E generated from charged hadron",nphibins,phimin,phimax,nphibins,phimin,phimax);
933 fhChHadPhi->SetXTitle("#phi_{rec} (rad)");
934 fhChHadPhi->SetYTitle("#phi_{gen} (rad)");
935 outputContainer->Add(fhChHadPhi);
936
937 fhChHadEta = new TH2F ("hChHadEta","#eta reconstructed vs E generated from charged hadron",netabins,etamin,etamax,netabins,etamin,etamax);
938 fhChHadEta->SetXTitle("#eta_{rec} ");
939 fhChHadEta->SetYTitle("#eta_{gen} ");
940 outputContainer->Add(fhChHadEta);
941
a6f26052 942 //Charged clusters
2302a644 943
944 fhGamECharged = new TH2F ("hGamECharged","E reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
945 fhGamECharged->SetXTitle("E_{rec} (GeV)");
946 fhGamECharged->SetXTitle("E_{gen} (GeV)");
947 outputContainer->Add(fhGamECharged);
948
949 fhGamPtCharged = new TH2F ("hGamPtCharged","p_{T} reconstructed vs E generated from #gamma, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
950 fhGamPtCharged->SetXTitle("p_{T rec} (GeV/c)");
951 fhGamPtCharged->SetYTitle("p_{T gen} (GeV/c)");
952 outputContainer->Add(fhGamPtCharged);
953
954 fhGamPhiCharged = new TH2F ("hGamPhiCharged","#phi reconstructed vs E generated from #gamma, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
955 fhGamPhiCharged->SetXTitle("#phi_{rec} (rad)");
956 fhGamPhiCharged->SetYTitle("#phi_{gen} (rad)");
957 outputContainer->Add(fhGamPhiCharged);
958
959 fhGamEtaCharged = new TH2F ("hGamEtaCharged","#eta reconstructed vs E generated from #gamma, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
960 fhGamEtaCharged->SetXTitle("#eta_{rec} ");
961 fhGamEtaCharged->SetYTitle("#eta_{gen} ");
962 outputContainer->Add(fhGamEtaCharged);
963
964 fhPi0ECharged = new TH2F ("hPi0ECharged","E reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
965 fhPi0ECharged->SetXTitle("E_{rec} (GeV)");
966 fhPi0ECharged->SetYTitle("E_{gen} (GeV)");
967 outputContainer->Add(fhPi0ECharged);
968
969 fhPi0PtCharged = new TH2F ("hPi0PtCharged","p_{T} reconstructed vs E generated from #pi^{0}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
970 fhPi0PtCharged->SetXTitle("p_{T rec} (GeV/c)");
971 fhPi0PtCharged->SetYTitle("p_{T gen} (GeV/c)");
972 outputContainer->Add(fhPi0PtCharged);
973
974 fhPi0PhiCharged = new TH2F ("hPi0PhiCharged","#phi reconstructed vs E generated from #pi^{0}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
975 fhPi0PhiCharged->SetXTitle("#phi_{rec} (rad)");
976 fhPi0PhiCharged->SetYTitle("#phi_{gen} (rad)");
977 outputContainer->Add(fhPi0PhiCharged);
978
979 fhPi0EtaCharged = new TH2F ("hPi0EtaCharged","#eta reconstructed vs E generated from #pi^{0}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
980 fhPi0EtaCharged->SetXTitle("#eta_{rec} ");
981 fhPi0EtaCharged->SetYTitle("#eta_{gen} ");
982 outputContainer->Add(fhPi0EtaCharged);
983
984 fhEleECharged = new TH2F ("hEleECharged","E reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
985 fhEleECharged->SetXTitle("E_{rec} (GeV)");
986 fhEleECharged->SetXTitle("E_{gen} (GeV)");
987 outputContainer->Add(fhEleECharged);
988
989 fhElePtCharged = new TH2F ("hElePtCharged","p_{T} reconstructed vs E generated from e^{#pm}, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
990 fhElePtCharged->SetXTitle("p_{T rec} (GeV/c)");
991 fhElePtCharged->SetYTitle("p_{T gen} (GeV/c)");
992 outputContainer->Add(fhElePtCharged);
993
994 fhElePhiCharged = new TH2F ("hElePhiCharged","#phi reconstructed vs E generated from e^{#pm}, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
995 fhElePhiCharged->SetXTitle("#phi_{rec} (rad)");
996 fhElePhiCharged->SetYTitle("#phi_{gen} (rad)");
997 outputContainer->Add(fhElePhiCharged);
998
999 fhEleEtaCharged = new TH2F ("hEleEtaCharged","#eta reconstructed vs E generated from e^{#pm}, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1000 fhEleEtaCharged->SetXTitle("#eta_{rec} ");
1001 fhEleEtaCharged->SetYTitle("#eta_{gen} ");
1002 outputContainer->Add(fhEleEtaCharged);
1003
1004 fhNeHadECharged = new TH2F ("hNeHadECharged","E reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1005 fhNeHadECharged->SetXTitle("E_{rec} (GeV)");
1006 fhNeHadECharged->SetYTitle("E_{gen} (GeV)");
1007 outputContainer->Add(fhNeHadECharged);
1008
1009 fhNeHadPtCharged = new TH2F ("hNeHadPtCharged","p_{T} reconstructed vs E generated from neutral hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1010 fhNeHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1011 fhNeHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1012 outputContainer->Add(fhNeHadPtCharged);
1013
1014 fhNeHadPhiCharged = new TH2F ("hNeHadPhiCharged","#phi reconstructed vs E generated from neutral hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1015 fhNeHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1016 fhNeHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1017 outputContainer->Add(fhNeHadPhiCharged);
1018
1019 fhNeHadEtaCharged = new TH2F ("hNeHadEtaCharged","#eta reconstructed vs E generated from neutral hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1020 fhNeHadEtaCharged->SetXTitle("#eta_{rec} ");
1021 fhNeHadEtaCharged->SetYTitle("#eta_{gen} ");
1022 outputContainer->Add(fhNeHadEtaCharged);
1023
1024 fhChHadECharged = new TH2F ("hChHadECharged","E reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1025 fhChHadECharged->SetXTitle("E_{rec} (GeV)");
1026 fhChHadECharged->SetYTitle("E_{gen} (GeV)");
1027 outputContainer->Add(fhChHadECharged);
1028
1029 fhChHadPtCharged = new TH2F ("hChHadPtCharged","p_{T} reconstructed vs E generated from charged hadron, track matched cluster", nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
1030 fhChHadPtCharged->SetXTitle("p_{T rec} (GeV/c)");
1031 fhChHadPtCharged->SetYTitle("p_{T gen} (GeV/c)");
1032 outputContainer->Add(fhChHadPtCharged);
1033
1034 fhChHadPhiCharged = new TH2F ("hChHadPhiCharged","#phi reconstructed vs E generated from charged hadron, track matched cluster",nphibins,phimin,phimax,nphibins,phimin,phimax);
1035 fhChHadPhiCharged->SetXTitle("#phi (rad)");
1036 fhChHadPhiCharged->SetXTitle("#phi_{rec} (rad)");
1037 fhChHadPhiCharged->SetYTitle("#phi_{gen} (rad)");
1038 outputContainer->Add(fhChHadPhiCharged);
1039
1040 fhChHadEtaCharged = new TH2F ("hChHadEtaCharged","#eta reconstructed vs E generated from charged hadron, track matched cluster",netabins,etamin,etamax,netabins,etamin,etamax);
1041 fhChHadEtaCharged->SetXTitle("#eta_{rec} ");
1042 fhChHadEtaCharged->SetYTitle("#eta_{gen} ");
1043 outputContainer->Add(fhChHadEtaCharged);
1044
a6f26052 1045 //Vertex of generated particles
2302a644 1046
1047 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1048 fhEMVxyz->SetXTitle("v_{x}");
1049 fhEMVxyz->SetYTitle("v_{y}");
a6f26052 1050 //fhEMVxyz->SetZTitle("v_{z}");
2302a644 1051 outputContainer->Add(fhEMVxyz);
1052
1053 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
1054 fhHaVxyz->SetXTitle("v_{x}");
1055 fhHaVxyz->SetYTitle("v_{y}");
a6f26052 1056 //fhHaVxyz->SetZTitle("v_{z}");
2302a644 1057 outputContainer->Add(fhHaVxyz);
1058
1059 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1060 fhEMR->SetXTitle("E (GeV)");
1061 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1062 outputContainer->Add(fhEMR);
1063
1064 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
1065 fhHaR->SetXTitle("E (GeV)");
1066 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
1067 outputContainer->Add(fhHaR);
1068
1069
c8fe2783 1070
a6f26052 1071 //Pure MC
2302a644 1072 fhGenGamPt = new TH1F("hGenGamPt" ,"p_{T} of generated #gamma",nptbins,ptmin,ptmax);
1073 fhGenGamEta = new TH1F("hGenGamEta","Y of generated #gamma",netabins,etamin,etamax);
1074 fhGenGamPhi = new TH1F("hGenGamPhi","#phi of generated #gamma",nphibins,phimin,phimax);
1075
1076 fhGenPi0Pt = new TH1F("hGenPi0Pt" ,"p_{T} of generated #pi^{0}",nptbins,ptmin,ptmax);
1077 fhGenPi0Eta = new TH1F("hGenPi0Eta","Y of generated #pi^{0}",netabins,etamin,etamax);
1078 fhGenPi0Phi = new TH1F("hGenPi0Phi","#phi of generated #pi^{0}",nphibins,phimin,phimax);
1079
1080 fhGenEtaPt = new TH1F("hGenEtaPt" ,"p_{T} of generated #eta",nptbins,ptmin,ptmax);
1081 fhGenEtaEta = new TH1F("hGenEtaEta","Y of generated #eta",netabins,etamin,etamax);
1082 fhGenEtaPhi = new TH1F("hGenEtaPhi","#phi of generated #eta",nphibins,phimin,phimax);
1083
1084 fhGenOmegaPt = new TH1F("hGenOmegaPt" ,"p_{T} of generated #omega",nptbins,ptmin,ptmax);
1085 fhGenOmegaEta = new TH1F("hGenOmegaEta","Y of generated #omega",netabins,etamin,etamax);
1086 fhGenOmegaPhi = new TH1F("hGenOmegaPhi","#phi of generated #omega",nphibins,phimin,phimax);
1087
1088 fhGenElePt = new TH1F("hGenElePt" ,"p_{T} of generated e^{#pm}",nptbins,ptmin,ptmax);
1089 fhGenEleEta = new TH1F("hGenEleEta","Y of generated e^{#pm}",netabins,etamin,etamax);
1090 fhGenElePhi = new TH1F("hGenElePhi","#phi of generated e^{#pm}",nphibins,phimin,phimax);
1091
1092 fhGenGamPt->SetXTitle("p_{T} (GeV/c)");
1093 fhGenGamEta->SetXTitle("#eta");
1094 fhGenGamPhi->SetXTitle("#phi (rad)");
1095 outputContainer->Add(fhGenGamPt);
1096 outputContainer->Add(fhGenGamEta);
1097 outputContainer->Add(fhGenGamPhi);
1098
1099 fhGenPi0Pt->SetXTitle("p_{T} (GeV/c)");
1100 fhGenPi0Eta->SetXTitle("#eta");
1101 fhGenPi0Phi->SetXTitle("#phi (rad)");
1102 outputContainer->Add(fhGenPi0Pt);
1103 outputContainer->Add(fhGenPi0Eta);
1104 outputContainer->Add(fhGenPi0Phi);
1105
1106 fhGenEtaPt->SetXTitle("p_{T} (GeV/c)");
1107 fhGenEtaEta->SetXTitle("#eta");
1108 fhGenEtaPhi->SetXTitle("#phi (rad)");
1109 outputContainer->Add(fhGenEtaPt);
1110 outputContainer->Add(fhGenEtaEta);
1111 outputContainer->Add(fhGenEtaPhi);
1112
1113 fhGenOmegaPt->SetXTitle("p_{T} (GeV/c)");
1114 fhGenOmegaEta->SetXTitle("#eta");
1115 fhGenOmegaPhi->SetXTitle("#phi (rad)");
1116 outputContainer->Add(fhGenOmegaPt);
1117 outputContainer->Add(fhGenOmegaEta);
1118 outputContainer->Add(fhGenOmegaPhi);
1119
1120 fhGenElePt->SetXTitle("p_{T} (GeV/c)");
1121 fhGenEleEta->SetXTitle("#eta");
1122 fhGenElePhi->SetXTitle("#phi (rad)");
1123 outputContainer->Add(fhGenElePt);
1124 outputContainer->Add(fhGenEleEta);
1125 outputContainer->Add(fhGenElePhi);
1126
1127 fhGenGamAccE = new TH1F("hGenGamAccE" ,"E of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1128 fhGenGamAccPt = new TH1F("hGenGamAccPt" ,"p_{T} of generated #gamma in calorimeter acceptance",nptbins,ptmin,ptmax);
1129 fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
1130 fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma in calorimeter acceptance",nphibins,phimin,phimax);
1131
1132 fhGenPi0AccE = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1133 fhGenPi0AccPt = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
1134 fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
1135 fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
1136
1137 fhGenGamAccE ->SetXTitle("E (GeV)");
1138 fhGenGamAccPt ->SetXTitle("p_{T} (GeV/c)");
1139 fhGenGamAccEta->SetXTitle("#eta");
1140 fhGenGamAccPhi->SetXTitle("#phi (rad)");
1141 outputContainer->Add(fhGenGamAccE);
1142 outputContainer->Add(fhGenGamAccPt);
1143 outputContainer->Add(fhGenGamAccEta);
1144 outputContainer->Add(fhGenGamAccPhi);
1145
1146 fhGenPi0AccE ->SetXTitle("E (GeV)");
1147 fhGenPi0AccPt ->SetXTitle("p_{T} (GeV/c)");
1148 fhGenPi0AccEta->SetXTitle("#eta");
1149 fhGenPi0AccPhi->SetXTitle("#phi (rad)");
1150 outputContainer->Add(fhGenPi0AccE);
1151 outputContainer->Add(fhGenPi0AccPt);
1152 outputContainer->Add(fhGenPi0AccEta);
1153 outputContainer->Add(fhGenPi0AccPhi);
1154
a6f26052 1155 //Track Matching
2302a644 1156
1157 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1158 fhMCEle1pOverE->SetYTitle("p/E");
1159 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
1160 outputContainer->Add(fhMCEle1pOverE);
1161
1162 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
1163 fhMCEle1dR->SetXTitle("#Delta R (rad)");
1164 outputContainer->Add(fhMCEle1dR) ;
1165
1166 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1167 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
1168 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
1169 outputContainer->Add(fhMCEle2MatchdEdx);
1170
1171 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1172 fhMCChHad1pOverE->SetYTitle("p/E");
1173 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
1174 outputContainer->Add(fhMCChHad1pOverE);
1175
1176 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
1177 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
1178 outputContainer->Add(fhMCChHad1dR) ;
1179
1180 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1181 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
1182 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
1183 outputContainer->Add(fhMCChHad2MatchdEdx);
1184
1185 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1186 fhMCNeutral1pOverE->SetYTitle("p/E");
1187 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
1188 outputContainer->Add(fhMCNeutral1pOverE);
1189
1190 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
1191 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
1192 outputContainer->Add(fhMCNeutral1dR) ;
1193
1194 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1195 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
1196 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
1197 outputContainer->Add(fhMCNeutral2MatchdEdx);
1198
1199 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1200 fhMCEle1pOverER02->SetYTitle("p/E");
1201 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
1202 outputContainer->Add(fhMCEle1pOverER02);
1203
1204 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1205 fhMCChHad1pOverER02->SetYTitle("p/E");
1206 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
1207 outputContainer->Add(fhMCChHad1pOverER02);
1208
1209 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1210 fhMCNeutral1pOverER02->SetYTitle("p/E");
1211 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
1212 outputContainer->Add(fhMCNeutral1pOverER02);
1213 }
c8fe2783 1214
17d63906 1215// for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
1216// printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
1217
2302a644 1218 return outputContainer;
9725fd2a 1219}
1220
a6f26052 1221//_______________________________________________________________________________________________________________________________________
3a75604b 1222Int_t AliAnaCalorimeterQA::GetNewRebinForRePlotting(TH1D* histo, const Float_t newXmin, const Float_t newXmax,const Int_t newXnbins) const
1223{
a6f26052 1224 //Calculate the rebinning for the new requested bin size, only used when replotting executing the Terminte
3a75604b 1225 Float_t oldbinsize = histo->GetBinWidth(0);
1226 Float_t newbinsize = TMath::Abs(newXmax-newXmin) / newXnbins;
a6f26052 1227 //printf("bin size, old %f, new %f\n",oldbinsize,newbinsize);
3a75604b 1228 if(newbinsize > oldbinsize) return (Int_t) (newbinsize/oldbinsize);
1229 else return 1;
1230}
a5fafd85 1231
a6f26052 1232//__________________________________________________
9725fd2a 1233void AliAnaCalorimeterQA::Init()
1234{
a6f26052 1235 //Check if the data or settings are ok
2302a644 1236 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL"){
1237 printf("AliAnaCalorimeterQA::Init() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data());
1238 abort();
1239 }
1240
1241 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC){
1242 printf("AliAnaCalorimeterQA::Init() - Analysis of reconstructed data, MC reader not aplicable\n");
1243 abort();
1244 }
1245
9725fd2a 1246}
1247
1248
a6f26052 1249//__________________________________________________
9725fd2a 1250void AliAnaCalorimeterQA::InitParameters()
1251{
a6f26052 1252 //Initialize the parameters of the analysis.
9725fd2a 1253 AddToHistogramsName("AnaCaloQA_");
c8fe2783 1254
9725fd2a 1255 fCalorimeter = "EMCAL"; //or PHOS
5a2dbc3c 1256 fStyleMacro = "" ;
1257 fNModules = 12; // set maximum to maximum number of EMCAL modules
eb5a51ae 1258 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
4cf55759 1259 fTimeCutMin = -1;
1260 fTimeCutMax = 9999999;
2302a644 1261 fEMCALCellAmpMin = 0.0;
1262 fPHOSCellAmpMin = 0.0;
1263
5a2dbc3c 1264 fHistoPOverEBins = 100 ; fHistoPOverEMax = 10. ; fHistoPOverEMin = 0. ;
1265 fHistodEdxBins = 200 ; fHistodEdxMax = 400. ; fHistodEdxMin = 0. ;
1266 fHistodRBins = 300 ; fHistodRMax = 3.15 ; fHistodRMin = 0. ;
c9141a7c 1267 fHistoTimeBins = 1000; fHistoTimeMax = 1.e3 ; fHistoTimeMin = 0. ;//ns
5a2dbc3c 1268 fHistoNBins = 300 ; fHistoNMax = 300 ; fHistoNMin = 0 ;
1269 fHistoRatioBins = 200 ; fHistoRatioMax = 2 ; fHistoRatioMin = 0. ;
1270 fHistoVertexDistBins = 100 ; fHistoVertexDistMax = 500. ; fHistoVertexDistMin = 0. ;
0866d83a 1271 fHistoRBins = 100 ; fHistoRMax = 500 ; fHistoRMin = -500 ;//cm
1272 fHistoXBins = 100 ; fHistoXMax = 500 ; fHistoXMin = -500 ;//cm
1273 fHistoYBins = 100 ; fHistoYMax = 500 ; fHistoYMin = -500 ;//cm
1274 fHistoZBins = 100 ; fHistoZMax = 600 ; fHistoZMin = -500 ;//cm
eb5a51ae 1275 fHistoSSBins = 40 ; fHistoSSMax = 10 ; fHistoSSMin = 0 ;
1276
9725fd2a 1277}
1278
a6f26052 1279//__________________________________________________________________
9725fd2a 1280void AliAnaCalorimeterQA::Print(const Option_t * opt) const
1281{
a6f26052 1282 //Print some relevant parameters set for the analysis
9725fd2a 1283 if(! opt)
1284 return;
1285
1286 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1287 AliAnaPartCorrBaseClass::Print(" ");
c8fe2783 1288
9725fd2a 1289 printf("Select Calorimeter %s \n",fCalorimeter.Data());
63f1dd86 1290 printf("Plots style macro %s \n",fStyleMacro.Data());
4cf55759 1291 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2302a644 1292 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
1293 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
5a2dbc3c 1294 printf("Histograms: %3.1f < p/E < %3.1f, Nbin = %d\n", fHistoPOverEMin, fHistoPOverEMax, fHistoPOverEBins);
1295 printf("Histograms: %3.1f < dEdx < %3.1f, Nbin = %d\n", fHistodEdxMin, fHistodEdxMax, fHistodEdxBins);
0866d83a 1296 printf("Histograms: %3.1f < dR (track cluster) < %3.1f, Nbin = %d\n", fHistodRMin, fHistodRMax, fHistodRBins);
255b904d 1297 printf("Histograms: %3.1f < R=sqrt{x^2+y^2} < %3.1f, Nbin = %d\n", fHistoRMin, fHistoRMax, fHistoRBins);
0866d83a 1298 printf("Histograms: %3.1f < X < %3.1f, Nbin = %d\n", fHistoXMin, fHistoXMax, fHistoXBins);
1299 printf("Histograms: %3.1f < Y < %3.1f, Nbin = %d\n", fHistoYMin, fHistoYMax, fHistoYBins);
1300 printf("Histograms: %3.1f < Z < %3.1f, Nbin = %d\n", fHistoZMin, fHistoZMax, fHistoZBins);
5a2dbc3c 1301 printf("Histograms: %g < Time < %g, Nbin = %d\n" , fHistoTimeMin, fHistoTimeMax, fHistoTimeBins);
1302 printf("Histograms: %d < N < %d, Nbin = %d\n" , fHistoNMin, fHistoNMax, fHistoNBins);
1303 printf("Histograms: %3.1f < Ratio< %3.1f, Nbin = %d\n", fHistoRatioMin, fHistoRatioMax, fHistoRatioBins);
1304 printf("Histograms: %3.1f < Vertex Distance < %3.1f, Nbin = %d\n", fHistoVertexDistMin, fHistoVertexDistMax, fHistoVertexDistBins);
c8fe2783 1305
9725fd2a 1306}
1307
a6f26052 1308//__________________________________________________________________
9725fd2a 1309void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
1310{
a6f26052 1311 //Fill Calorimeter QA histograms
2302a644 1312 TLorentzVector mom ;
1313 TLorentzVector mom2 ;
1314 TObjArray * caloClusters = NULL;
1315 Int_t nLabel = 0;
1316 Int_t *labels=0x0;
1317 Int_t nCaloClusters = 0;
1318 Int_t nCaloClustersAccepted = 0;
1319 Int_t nCaloCellsPerCluster = 0;
1320 Int_t nTracksMatched = 0;
1321 Int_t trackIndex = 0;
1322 Int_t nModule = -1;
c8fe2783 1323
5025c139 1324 //Get vertex for photon momentum calculation and event selection
1325 Double_t v[3] = {0,0,0}; //vertex ;
1326 GetReader()->GetVertex(v);
1327 if (TMath::Abs(v[2]) > GetZvertexCut()) return ;
1328
a6f26052 1329 //Play with the MC stack if available
1330 //Get the MC arrays and do some checks
2302a644 1331 if(IsDataMC()){
1332 if(GetReader()->ReadStack()){
c8fe2783 1333
2302a644 1334 if(!GetMCStack()) {
5025c139 1335 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1336 abort();
2302a644 1337 }
a6f26052 1338 //Fill some pure MC histograms, only primaries.
2302a644 1339 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++){//Only primary particles, for all MC transport put GetNtrack()
5025c139 1340 TParticle *primary = GetMCStack()->Particle(i) ;
a6f26052 1341 //printf("i %d, %s: status = %d, primary? %d\n",i, primary->GetName(), primary->GetStatusCode(), primary->IsPrimary());
5025c139 1342 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
1343 primary->Momentum(mom);
1344 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
2302a644 1345 } //primary loop
1346 }
1347 else if(GetReader()->ReadAODMCParticles()){
c8fe2783 1348
2302a644 1349 if(!GetReader()->GetAODMCParticles(0)) {
5025c139 1350 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - AODMCParticles not available!\n");
1351 abort();
2302a644 1352 }
a6f26052 1353 //Fill some pure MC histograms, only primaries.
2302a644 1354 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++){
5025c139 1355 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
a6f26052 1356 //printf("i %d, %s: primary? %d physical primary? %d, flag %d\n",
1357 // i,(TDatabasePDG::Instance()->GetParticle(aodprimary->GetPdgCode()))->GetName(),
1358 // aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), aodprimary->GetFlag());
5025c139 1359 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
a6f26052 1360 //aodprimary->Momentum(mom);
5025c139 1361 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
1362 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
2302a644 1363 } //primary loop
1364
1365 }
1366 }// is data and MC
1367
1368
a6f26052 1369 //Get List with CaloClusters
17708df9 1370 if (fCalorimeter == "PHOS") caloClusters = GetAODPHOS();
1371 else if (fCalorimeter == "EMCAL") caloClusters = GetAODEMCAL();
f8006433 1372 else
1373 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
17708df9 1374
f8006433 1375 // if (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetAODEMCAL();
1376 // else if(fCalorimeter == "PHOS") GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetAODPHOS();
1377 // else
1378 // AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
2302a644 1379
1380 if(!caloClusters) {
1381 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
1382 }
f8006433 1383 else{
1384 //----------------------------------------------------------
798a9b04 1385 //Correlate Calorimeters and V0 and track Multiplicity
f8006433 1386 //----------------------------------------------------------
798a9b04 1387 if(fCorrelate) Correlate();
f8006433 1388
f8006433 1389 //----------------------------------------------------------
1390 // CALOCLUSTERS
1391 //----------------------------------------------------------
1392
1393 nCaloClusters = caloClusters->GetEntriesFast() ;
f8006433 1394 Int_t *nClustersInModule = new Int_t[fNModules];
1395 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
1396
1397 if(GetDebug() > 0)
1398 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
1399
f8006433 1400 AliVTrack * track = 0x0;
f8006433 1401 Float_t pos[3] ;
1402 Float_t showerShape[3] ;
1403 Double_t tof = 0;
1404 //Loop over CaloClusters
1405 //if(nCaloClusters > 0)printf("QA : Vertex Cut passed %f, cut %f, entries %d, %s\n",v[2], 40., nCaloClusters, fCalorimeter.Data());
1406 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
c8fe2783 1407
f8006433 1408 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
1409 iclus+1,nCaloClusters,GetReader()->GetDataType());
c8fe2783 1410
9cde6de9 1411 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
1412 AliVCaloCells * cell = 0x0;
1413 if(fCalorimeter == "PHOS") cell = GetPHOSCells();
1414 else cell = GetEMCALCells();
1415
1416 //Get cluster kinematics
1417 clus->GetPosition(pos);
1418 clus->GetMomentum(mom,v);
1419 tof = clus->GetTOF()*1e9;
1420 if(tof < fTimeCutMin || tof > fTimeCutMax) continue;
1421
1422 //Check only certain regions
1423 Bool_t in = kTRUE;
1424 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1425 if(!in) continue;
1426
1427 //Get module of cluster
1428 nCaloClustersAccepted++;
1429 nModule = GetModuleNumber(clus);
1430 if(nModule >=0 && nModule < fNModules) nClustersInModule[nModule]++;
1431
1432 //MC labels
1433 nLabel = clus->GetNLabels();
1434 labels = clus->GetLabels();
1435
1436 //Cells per cluster
1437 nCaloCellsPerCluster = clus->GetNCells();
1438 //if(mom.E() > 10 && nCaloCellsPerCluster == 1 ) printf("%s:************** E = %f ********** ncells = %d\n",fCalorimeter.Data(), mom.E(),nCaloCellsPerCluster);
1439
1440 //matched cluster with tracks
1441 nTracksMatched = clus->GetNTracksMatched();
ff5cc919 1442 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1443 trackIndex = clus->GetTrackMatchedIndex();
1444 if(trackIndex >= 0){
1445 track = (AliVTrack*)GetReader()->GetInputEvent()->GetTrack(trackIndex);
1446 }
1447 else{
1448 if(nTracksMatched == 1) nTracksMatched = 0;
1449 track = 0;
1450 }
1451 }//kESD
1452 else{//AODs
1453 if(nTracksMatched > 0) track = (AliVTrack*)clus->GetTrackMatched(0);
9cde6de9 1454 }
1455
1456 //Shower shape parameters
1457 showerShape[0] = clus->GetM20();
1458 showerShape[1] = clus->GetM02();
1459 showerShape[2] = clus->GetDispersion();
1460
1461 //======================
1462 //Cells in cluster
1463 //======================
1464
1465 //Get list of contributors
1466 UShort_t * indexList = clus->GetCellsAbsId() ;
1467 // check time of cells respect to max energy cell
1468 //Get maximum energy cell
1469 Float_t emax = -1;
1470 Double_t tmax = -1;
1471 Int_t imax = -1;
1472 Int_t absId = -1 ;
1473 //printf("nCaloCellsPerCluster %d\n",nCaloCellsPerCluster);
1474 //Loop on cluster cells
1475 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1476 // printf("Index %d\n",ipos);
1477 absId = indexList[ipos];
c8fe2783 1478
9cde6de9 1479 //Get position of cell compare to cluster
1480 if(fFillAllPosHisto){
1481 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1482
1483 Double_t cellpos[] = {0, 0, 0};
1484 GetEMCALGeometry()->GetGlobal(absId, cellpos);
1485
1486 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
1487 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
1488 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
1489
1490 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],mom.E()) ;
1491 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],mom.E()) ;
1492 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],mom.E()) ;
1493
1494 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1495 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1496 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1497 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1498
1499 // Float_t celleta = 0, cellphi = 0;
1500 // GetEMCALGeometry()->EtaPhiFromIndex(absId, celleta, cellphi);
1501 // Int_t imod = -1, iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1;
1502 // GetEMCALGeometry()->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1503 // GetEMCALGeometry()->GetCellPhiEtaIndexInSModule(imod,iTower,
1504 // iIphi, iIeta,iphi,ieta);
1505 // printf("AbsId %d, SM %d, Index eta %d, phi %d\n", absId, imod, ieta, iphi);
1506 // printf("Cluster E %f, eta %f, phi %f; Cell: Amp %f, eta %f, phi%f\n", mom.E(),mom.Eta(), mom.Phi()*TMath::RadToDeg(), cell->GetCellAmplitude(absId),celleta, cellphi*TMath::RadToDeg());
1507 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1508 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1509 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1510 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1511 //
1512
1513 }//EMCAL and its matrices are available
1514 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1515 TVector3 xyz;
1516 Int_t relId[4], module;
1517 Float_t xCell, zCell;
1518
1519 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
1520 module = relId[0];
1521 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1522 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1523
1524 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
1525 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
1526 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
1527
1528 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),mom.E()) ;
1529 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),mom.E()) ;
1530 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),mom.E()) ;
1531
1532 Float_t r = TMath::Sqrt(pos[0]*pos[0] +pos[1]*pos[1]);// +pos[2]*pos[2]);
1533 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());//+xyz.Z()*xyz.Z());
1534 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
1535 fhDeltaCellClusterRE ->Fill(r-rcell, mom.E()) ;
1536
1537 // printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
1538 // printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
1539 // printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
1540 // printf("r cluster %f, r cell %f, cluster-cell %f\n",r, rcell, r-rcell);
1541 }//PHOS and its matrices are available
1542 }//Fill all position histograms
c8fe2783 1543
9cde6de9 1544 //Find maximum energy cluster
1545 if(cell->GetCellAmplitude(absId) > emax) {
1546 imax = ipos;
1547 emax = cell->GetCellAmplitude(absId);
1548 tmax = cell->GetCellTime(absId);
1549 }
c8fe2783 1550
9cde6de9 1551 }// cluster cell loop
a95eac90 1552 //Bad clusters histograms
1553 Float_t minNCells = 1+mom.E()/3;//-x*x*0.0033
1554 if(nCaloCellsPerCluster < minNCells) {
1555 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
1556 fhBadClusterMaxCellTimeEnergy->Fill(mom.E(),tmax);
1557 else
1558 fhBadClusterMaxCellTimeEnergy->Fill(mom.E(),tof);
1559 //printf("bad tof : %2.3f\n",tof);
1560
1561 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1562 // printf("Index %d\n",ipos);
1563 if(ipos!=imax){
1564 absId = indexList[ipos];
1565 Float_t frac = cell->GetCellAmplitude(absId)/emax;
1566 //printf("bad frac : %2.3f, e %2.2f, ncells %d, min %2.1f\n",frac,mom.E(),nCaloCellsPerCluster,minNCells);
1567 fhBadClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1568 }
1569 }
1570 }//Bad cluster
1571 else{
1572 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
1573 fhClusterMaxCellTimeEnergy->Fill(mom.E(),tmax);
1574 else
1575 fhClusterMaxCellTimeEnergy->Fill(mom.E(),tof);
1576 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
1577 // printf("Index %d\n",ipos);
1578 if(ipos!=imax){
1579 absId = indexList[ipos];
1580 Float_t frac = cell->GetCellAmplitude(absId)/emax;
1581 //printf("good frac : %2.3f\n",frac);
1582 fhClusterMaxCellCloseCellRatio->Fill(mom.E(),frac);
1583 }
1584 }
1585 }//good cluster
1586
9cde6de9 1587 // check time of cells respect to max energy cell
1588 if(nCaloCellsPerCluster > 1 && GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
f8006433 1589 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
9cde6de9 1590 if(imax == ipos) continue;
f8006433 1591 absId = indexList[ipos];
9cde6de9 1592 Float_t diff = (tmax-cell->GetCellTime(absId))*1e9;
9cde6de9 1593 fhCellTimeSpreadRespectToCellMax->Fill(diff);
1594 if(TMath::Abs(TMath::Abs(diff) > 100)) fhCellIdCellLargeTimeSpread->Fill(absId);
1595 }// fill cell-cluster histogram loop
1596 }//check time of cells respect to max energy cell
1597
1598 //-----------------------------------------------------------
1599 //Fill histograms related to single cluster or track matching
1600 //-----------------------------------------------------------
1601 ClusterHistograms(mom, tof, pos, showerShape, nCaloCellsPerCluster, nModule, nTracksMatched, track, labels, nLabel);
1602
1603
1604 //-----------------------------------------------------------
1605 //Invariant mass
1606 //-----------------------------------------------------------
1607 if(GetDebug()>1) printf("Invariant mass \n");
1608
1609 //do not do for bad vertex
1610 // Float_t fZvtxCut = 40. ;
1611 if(v[2]<-GetZvertexCut() || v[2]> GetZvertexCut()) continue ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
1612
1613 Int_t nModule2 = -1;
1614 Int_t nCaloCellsPerCluster2=0;
1615 if (nCaloClusters > 1 ) {
1616 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
1617 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
f8006433 1618
9cde6de9 1619 //Get cluster kinematics
1620 clus2->GetMomentum(mom2,v);
1621 //Check only certain regions
1622 Bool_t in2 = kTRUE;
1623 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
1624 if(!in2) continue;
1625 //Get module of cluster
1626 nModule2 = GetModuleNumber(clus2);
1627 //Cells per cluster
1628 nCaloCellsPerCluster2 = clus2->GetNCells();
1629 }
1630 //Fill invariant mass histograms
1631 //All modules
f8006433 1632
9cde6de9 1633 //printf("QA : Fill inv mass histo: pt1 %f, pt2 %f, pt12 %f, mass %f, calo %s \n",mom.Pt(),mom2.Pt(),(mom+mom2).Pt(),(mom+mom2).M(), fCalorimeter.Data());
1634 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1635 //Single module
1636 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
1637 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
f8006433 1638
9cde6de9 1639 //Select only clusters with at least 2 cells
1640 if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
f8006433 1641 //All modules
9cde6de9 1642 fhIMCellCut ->Fill((mom+mom2).Pt(),(mom+mom2).M());
1643 //Single modules
f8006433 1644 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
9cde6de9 1645 fhIMCellCutMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
1646 }
1647
1648 //Asymetry histograms
1649 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
1650
1651 }// 2nd cluster loop
f8006433 1652 }//cluster loop
1653
2302a644 1654 //Number of clusters histograms
1655 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
1656 // Number of clusters per module
f8006433 1657 for(Int_t imod = 0; imod < fNModules; imod++ ){
1658 if(GetDebug() > 1)
1659 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
1660 fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
1661 }
1662 delete [] nClustersInModule;
1663 //delete caloClusters;
1664 }// calo clusters array exists
c8fe2783 1665
a6f26052 1666 //----------------------------------------------------------
1667 // CALOCELLS
1668 //----------------------------------------------------------
0866d83a 1669
2302a644 1670 Int_t *nCellsInModule = new Int_t[fNModules];
1671 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
1672 Int_t icol = -1;
1673 Int_t irow = -1;
1674 Int_t iRCU = -1;
1675 Float_t amp = 0.;
1676 Float_t time = 0.;
1677 Int_t id = -1;
1678 Float_t recalF = 1.;
1679
c8fe2783 1680 AliVCaloCells * cell = 0x0;
1681 Int_t ncells = 0;
1682 if(fCalorimeter == "PHOS")
17708df9 1683 cell = GetPHOSCells();
c8fe2783 1684 else
17708df9 1685 cell = GetEMCALCells();
c8fe2783 1686
1687 if(!cell) {
ff5cc919 1688 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s CELLS available for analysis\n",fCalorimeter.Data());
c8fe2783 1689 abort();
1690 }
1691
c8fe2783 1692 if(GetDebug() > 0)
ff5cc919 1693 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", fCalorimeter.Data(), cell->GetNumberOfCells());
c8fe2783 1694
2302a644 1695 for (Int_t iCell = 0; iCell < cell->GetNumberOfCells(); iCell++) {
ff5cc919 1696 if(GetDebug() > 2)
1697 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cell->GetAmplitude(iCell), cell->GetCellNumber(iCell));
c8fe2783 1698 nModule = GetModuleNumberCellIndexes(cell->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
ff5cc919 1699 if(GetDebug() > 2)
1700 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
c8fe2783 1701
1702 if(nModule < fNModules) {
a6f26052 1703 //Check if the cell is a bad channel
c8fe2783 1704 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
1705 if(fCalorimeter=="EMCAL"){
1706 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
1707 }
1708 else {
1709 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
1710 printf("PHOS bad channel\n");
1711 continue;
1712 }
1713 }
1714 }
ff5cc919 1715 else return;
1716
a6f26052 1717 //Get Recalibration factor if set
c8fe2783 1718 if (GetCaloUtils()->IsRecalibrationOn()) {
1719 if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
17708df9 1720 else recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
2302a644 1721 //if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) - %f\n",nModule,icol,irow,recalF);
c8fe2783 1722 }
1723
1724 amp = cell->GetAmplitude(iCell)*recalF;
1725 time = cell->GetTime(iCell)*1e9;//transform time to ns
1726
ff5cc919 1727 //Remove noisy channels, only possible in ESDs
1728 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1729 if(time < fTimeCutMin || time > fTimeCutMax) continue;
1730 }
a6f26052 1731 //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
1732 // amp,time,nModule,icol,irow);
c8fe2783 1733
c8fe2783 1734 id = cell->GetCellNumber(iCell);
1735 fhAmplitude->Fill(amp);
1736 fhAmpId ->Fill(amp,id);
c8fe2783 1737
1738 fhAmplitudeMod[nModule]->Fill(amp);
1739 if(fCalorimeter=="EMCAL"){
1740 Int_t ifrac = 0;
1741 if(icol > 15 && icol < 32) ifrac = 1;
1742 else if(icol > 31) ifrac = 2;
1743 fhAmplitudeModFraction[nModule*3+ifrac]->Fill(amp);
c8fe2783 1744 }
1745
c8fe2783 1746 nCellsInModule[nModule]++;
1747 fhGridCellsMod[nModule] ->Fill(icol,irow);
1748 fhGridCellsEMod[nModule] ->Fill(icol,irow,amp);
ff5cc919 1749
1750 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
1751 //printf("%s: time %g\n",fCalorimeter.Data(), time);
1752 fhTime ->Fill(time);
1753 fhTimeId ->Fill(time,id);
1754 fhTimeAmp ->Fill(amp,time);
c8fe2783 1755
ff5cc919 1756 //Double_t t0 = GetReader()->GetInputEvent()->GetT0();
1757 //printf("---->>> Time EMCal %e, T0 %e, T0 vertex %e, T0 clock %e, T0 trig %d \n",time,t0,
1758 // GetReader()->GetInputEvent()->GetT0zVertex(),
1759 // GetReader()->GetInputEvent()->GetT0clock(),
1760 // GetReader()->GetInputEvent()->GetT0Trig());
1761 //fhT0Time ->Fill(time-t0);
1762 //fhT0TimeId ->Fill(time-t0,id);
1763 //fhT0TimeAmp ->Fill(amp,time-t0);
1764
1765 //printf("id %d, nModule %d, iRCU %d: Histo Name %s\n",id, nModule,iRCU, fhTimeAmpPerRCU[nModule*fNRCU+iRCU]->GetName());
1766 //fhT0TimeAmpPerRCU[nModule*fNRCU+iRCU]->Fill(amp, time-t0);
1767
1768 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
1769
1770 if(amp > 0.3){
1771 fhGridCellsTimeMod[nModule]->Fill(icol,irow,time);
1772
1773 // AliESDCaloCells * cell2 = 0x0;
1774 // if(fCalorimeter == "PHOS") cell2 = GetReader()->GetInputEvent()->GetPHOSCells();
1775 // else cell2 = GetReader()->GetInputEvent()->GetEMCALCells();
1776 // Int_t icol2 = -1;
1777 // Int_t irow2 = -1;
1778 // Int_t iRCU2 = -1;
1779 // Float_t amp2 = 0.;
1780 // Float_t time2 = 0.;
1781 // Int_t id2 = -1;
1782 // Int_t nModule2 = -1;
1783 // for (Int_t iCell2 = 0; iCell2 < ncells; iCell2++) {
1784 // amp2 = cell2->GetAmplitude(iCell2);
1785 // if(amp2 < 0.3) continue;
1786 // if(iCell2 == iCell) continue;
1787 // time2 = cell2->GetTime(iCell2)*1e9;//transform time to ns
1788 // //printf("%s: time %g\n",fCalorimeter.Data(), time);
1789 // id2 = cell2->GetCellNumber(iCell2);
1790 // nModule2 = GetModuleNumberCellIndexes(cell2->GetCellNumber(iCell2), fCalorimeter, icol2, irow2, iRCU2);
1791 // Int_t index = (nModule2*fNRCU+iRCU2)+(fNModules*fNRCU)*(iRCU+fNRCU*nModule);
1792 // //printf("id %d, nModule %d, iRCU %d, id2 %d, nModule2 %d, iRCU2 %d, index %d: Histo Name %s\n",id, nModule,iRCU,cell2->GetCellNumber(iCell2),nModule2,iRCU2,index, fhTimeCorrRCU[index]->GetName());
1793 // fhTimeCorrRCU[index]->Fill(time,time2);
1794 //
1795 // }// second cell loop
1796
1797 }// amplitude cut
1798 }
1799
c8fe2783 1800
a6f26052 1801 //Get Eta-Phi position of Cell
4b892846 1802 if(fFillAllPosHisto)
a6f26052 1803 {
1804 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
1805 Float_t celleta = 0.;
1806 Float_t cellphi = 0.;
1807 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
9cde6de9 1808
a6f26052 1809 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
1810 Double_t cellpos[] = {0, 0, 0};
1811 GetEMCALGeometry()->GetGlobal(id, cellpos);
1812 fhXCellE->Fill(cellpos[0],amp) ;
1813 fhYCellE->Fill(cellpos[1],amp) ;
1814 fhZCellE->Fill(cellpos[2],amp) ;
1815 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
1816 fhRCellE->Fill(rcell,amp) ;
1817 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
1818 }//EMCAL Cells
1819 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
1820 TVector3 xyz;
1821 Int_t relId[4], module;
1822 Float_t xCell, zCell;
1823
1824 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
1825 module = relId[0];
1826 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
1827 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
1828 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
1829 fhXCellE ->Fill(xyz.X(),amp) ;
1830 fhYCellE ->Fill(xyz.Y(),amp) ;
1831 fhZCellE ->Fill(xyz.Z(),amp) ;
1832 fhRCellE ->Fill(rcell ,amp) ;
1833 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
1834 }//PHOS cells
1835 }//fill cell position histograms
ff5cc919 1836
2302a644 1837 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
1838 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
a95eac90 1839 //else
1840 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
ff5cc919 1841 }//nmodules
c8fe2783 1842 }//cell loop
2302a644 1843 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
c8fe2783 1844
a6f26052 1845 //Number of cells per module
63f1dd86 1846 for(Int_t imod = 0; imod < fNModules; imod++ ) {
1847 if(GetDebug() > 1)
1848 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
1849 fhNCellsMod[imod]->Fill(nCellsInModule[imod]) ;
1850 }
4a745797 1851 delete [] nCellsInModule;
1852
902aa95c 1853 if(GetDebug() > 0)
1854 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
1855}
1856
a0bb4dc0 1857
17708df9 1858//_____________________________________________________________________________________________
1859void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof,
1860 Float_t *pos, Float_t *showerShape,
c8fe2783 1861 const Int_t nCaloCellsPerCluster,const Int_t nModule,
1862 const Int_t nTracksMatched, const AliVTrack * track,
1863 const Int_t * labels, const Int_t nLabels){
a6f26052 1864 //Fill CaloCluster related histograms
9725fd2a 1865
2302a644 1866 AliAODMCParticle * aodprimary = 0x0;
1867 TParticle * primary = 0x0;
c8fe2783 1868 Int_t tag = 0;
2302a644 1869
1870 Float_t e = mom.E();
1871 Float_t pt = mom.Pt();
1872 Float_t eta = mom.Eta();
1873 Float_t phi = mom.Phi();
1874 if(phi < 0) phi +=TMath::TwoPi();
1875 if(GetDebug() > 0) {
1876 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
1877 if(IsDataMC()) {
a6f26052 1878 //printf("\t Primaries: nlabels %d, labels pointer %p\n",nLabels,labels);
2302a644 1879 printf("\t Primaries: nlabels %d\n",nLabels);
1880 if(!nLabels || !labels) printf("\t Strange, no labels!!!\n");
1881 }
1882 }
c8fe2783 1883
2302a644 1884 fhE ->Fill(e);
1885 if(nModule >=0 && nModule < fNModules) fhEMod[nModule]->Fill(e);
a6f26052 1886 if(fFillAllTH12){
1887 fhPt ->Fill(pt);
1888 fhPhi ->Fill(phi);
1889 fhEta ->Fill(eta);
1890 }
2302a644 1891 fhEtaPhiE->Fill(eta,phi,e);
a6f26052 1892
1893 //Cells per cluster
2302a644 1894 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster,eta);
1895 fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster,eta);
a6f26052 1896
1897 //Position
ff5cc919 1898 fhXE ->Fill(pos[0],e);
1899 fhYE ->Fill(pos[1],e);
1900 fhZE ->Fill(pos[2],e);
1901 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
1902
1903 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
1904 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
1905 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
1906 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
1907 fhRE ->Fill(rxyz,e);
1908 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
b8187de4 1909
2302a644 1910 fhClusterTimeEnergy->Fill(e,tof);
0866d83a 1911
a6f26052 1912 //Shower shape parameters
2302a644 1913 fhLambda->Fill(showerShape[0], showerShape[1], e);
1914 fhDispersion->Fill(showerShape[2],e);
1915
1916 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
c8fe2783 1917
a6f26052 1918 //Fill histograms only possible when simulation
2302a644 1919 if(IsDataMC() && nLabels > 0 && labels){
c8fe2783 1920
a6f26052 1921 //Play with the MC stack if available
2302a644 1922 Int_t label = labels[0];
c8fe2783 1923
2302a644 1924 if(label < 0) {
1925 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** bad label ***: label %d \n", label);
1926 return;
1927 }
1928
1929 Int_t pdg =-1; Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1930 Float_t vxMC= 0; Float_t vyMC = 0;
1931 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1932 Int_t charge = 0;
c8fe2783 1933
a6f26052 1934 //Check the origin.
2302a644 1935 tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
c8fe2783 1936
2302a644 1937 if(GetReader()->ReadStack() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){ //it MC stack and known tag
c8fe2783 1938
2302a644 1939 if( label >= GetMCStack()->GetNtrack()) {
5025c139 1940 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1941 return ;
2302a644 1942 }
1943
1944 primary = GetMCStack()->Particle(label);
1945 iMother = label;
1946 pdg0 = TMath::Abs(primary->GetPdgCode());
1947 pdg = pdg0;
1948 status = primary->GetStatusCode();
1949 vxMC = primary->Vx();
1950 vyMC = primary->Vy();
1951 iParent = primary->GetFirstMother();
c8fe2783 1952
2302a644 1953 if(GetDebug() > 1 ) {
5025c139 1954 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1955 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
2302a644 1956 }
c8fe2783 1957
a6f26052 1958 //Get final particle, no conversion products
2302a644 1959 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
a6f26052 1960 //Get the parent
5025c139 1961 primary = GetMCStack()->Particle(iParent);
1962 pdg = TMath::Abs(primary->GetPdgCode());
1963 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1964 while((pdg == 22 || pdg == 11) && status != 1){
1965 iMother = iParent;
1966 primary = GetMCStack()->Particle(iMother);
1967 status = primary->GetStatusCode();
1968 iParent = primary->GetFirstMother();
1969 pdg = TMath::Abs(primary->GetPdgCode());
1970 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1971 }
c8fe2783 1972
5025c139 1973 if(GetDebug() > 1 ) {
1974 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1975 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1976 }
c8fe2783 1977
2302a644 1978 }
c8fe2783 1979
a6f26052 1980 //Overlapped pi0 (or eta, there will be very few), get the meson
2302a644 1981 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 1982 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
5025c139 1983 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1984 while(pdg != 111 && pdg != 221){
1985 iMother = iParent;
1986 primary = GetMCStack()->Particle(iMother);
1987 status = primary->GetStatusCode();
1988 iParent = primary->GetFirstMother();
1989 pdg = TMath::Abs(primary->GetPdgCode());
1990 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1991 if(iMother==-1) {
1992 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
a6f26052 1993 //break;
5025c139 1994 }
1995 }
c8fe2783 1996
5025c139 1997 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
a6f26052 1998 primary->GetName(),iMother);
2302a644 1999 }
c8fe2783 2000
2302a644 2001 eMC = primary->Energy();
2002 ptMC = primary->Pt();
2003 phiMC = primary->Phi();
2004 etaMC = primary->Eta();
2005 pdg = TMath::Abs(primary->GetPdgCode());
2006 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
c8fe2783 2007
2302a644 2008 }
2009 else if(GetReader()->ReadAODMCParticles() && !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown)){//it MC AOD and known tag
a6f26052 2010 //Get the list of MC particles
2302a644 2011 if(!GetReader()->GetAODMCParticles(0)) {
5025c139 2012 printf("AliAnaCalorimeterQA::ClusterHistograms() - MCParticles not available!\n");
2013 abort();
2302a644 2014 }
c8fe2783 2015
2302a644 2016 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
2017 iMother = label;
2018 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
2019 pdg = pdg0;
2020 status = aodprimary->IsPrimary();
2021 vxMC = aodprimary->Xv();
2022 vyMC = aodprimary->Yv();
2023 iParent = aodprimary->GetMother();
2024
2025 if(GetDebug() > 1 ) {
5025c139 2026 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
2027 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
a6f26052 2028 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
2302a644 2029 }
2030
a6f26052 2031 //Get final particle, no conversion products
2302a644 2032 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)){
5025c139 2033 if(GetDebug() > 1 )
2034 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
a6f26052 2035 //Get the parent
5025c139 2036 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
2037 pdg = TMath::Abs(aodprimary->GetPdgCode());
2038 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary()) {
2039 iMother = iParent;
2040 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2041 status = aodprimary->IsPrimary();
2042 iParent = aodprimary->GetMother();
2043 pdg = TMath::Abs(aodprimary->GetPdgCode());
2044 if(GetDebug() > 1 )
2045 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
a6f26052 2046 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
5025c139 2047 }
2048
2049 if(GetDebug() > 1 ) {
2050 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
2051 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
a6f26052 2052 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
5025c139 2053 }
2054
2302a644 2055 }
c8fe2783 2056
a6f26052 2057 //Overlapped pi0 (or eta, there will be very few), get the meson
2302a644 2058 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 2059 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
5025c139 2060 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
2061 while(pdg != 111 && pdg != 221){
c8fe2783 2062
5025c139 2063 iMother = iParent;
2064 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
2065 status = aodprimary->IsPrimary();
2066 iParent = aodprimary->GetMother();
2067 pdg = TMath::Abs(aodprimary->GetPdgCode());
2068
2069 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
2070
2071 if(iMother==-1) {
2072 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
a6f26052 2073 //break;
5025c139 2074 }
2075 }
2076
2077 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
a6f26052 2078 aodprimary->GetName(),iMother);
2302a644 2079 }
c8fe2783 2080
2302a644 2081 status = aodprimary->IsPrimary();
2082 eMC = aodprimary->E();
2083 ptMC = aodprimary->Pt();
2084 phiMC = aodprimary->Phi();
2085 etaMC = aodprimary->Eta();
2086 pdg = TMath::Abs(aodprimary->GetPdgCode());
2087 charge = aodprimary->Charge();
c8fe2783 2088
2302a644 2089 }
c8fe2783 2090
a6f26052 2091 //Float_t vz = primary->Vz();
2302a644 2092 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
2093 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1) {
2094 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2095 fhEMR ->Fill(e,rVMC);
2096 }
c8fe2783 2097
a6f26052 2098 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
2099 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
2100 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
c8fe2783 2101
2102
2302a644 2103 fh2E ->Fill(e, eMC);
2104 fh2Pt ->Fill(pt, ptMC);
2105 fh2Phi ->Fill(phi, phiMC);
2106 fh2Eta ->Fill(eta, etaMC);
2107 fhDeltaE ->Fill(eMC-e);
2108 fhDeltaPt ->Fill(ptMC-pt);
2109 fhDeltaPhi->Fill(phiMC-phi);
2110 fhDeltaEta->Fill(etaMC-eta);
2111 if(eMC > 0) fhRatioE ->Fill(e/eMC);
2112 if(ptMC > 0) fhRatioPt ->Fill(pt/ptMC);
2113 if(phiMC > 0) fhRatioPhi->Fill(phi/phiMC);
2114 if(etaMC > 0) fhRatioEta->Fill(eta/etaMC);
c8fe2783 2115
2116
a6f26052 2117 //Overlapped pi0 (or eta, there will be very few)
2302a644 2118 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
c8fe2783 2119 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)){
2120 fhPi0E ->Fill(e,eMC);
2121 fhPi0Pt ->Fill(pt,ptMC);
2122 fhPi0Eta ->Fill(eta,etaMC);
2123 fhPi0Phi ->Fill(phi,phiMC);
2124 if( nTracksMatched > 0){
2125 fhPi0ECharged ->Fill(e,eMC);
2126 fhPi0PtCharged ->Fill(pt,ptMC);
2127 fhPi0PhiCharged ->Fill(phi,phiMC);
2128 fhPi0EtaCharged ->Fill(eta,etaMC);
2129 }
2302a644 2130 }//Overlapped pizero decay
2131 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
c8fe2783 2132 fhGamE ->Fill(e,eMC);
2133 fhGamPt ->Fill(pt,ptMC);
2134 fhGamEta ->Fill(eta,etaMC);
2135 fhGamPhi ->Fill(phi,phiMC);
2136 fhGamDeltaE ->Fill(eMC-e);
2137 fhGamDeltaPt ->Fill(ptMC-pt);
2138 fhGamDeltaPhi->Fill(phiMC-phi);
2139 fhGamDeltaEta->Fill(etaMC-eta);
2140 if(eMC > 0) fhGamRatioE ->Fill(e/eMC);
2141 if(ptMC > 0) fhGamRatioPt ->Fill(pt/ptMC);
2142 if(phiMC > 0) fhGamRatioPhi->Fill(phi/phiMC);
2143 if(etaMC > 0) fhGamRatioEta->Fill(eta/etaMC);
2144 if( nTracksMatched > 0){
2145 fhGamECharged ->Fill(e,eMC);
2146 fhGamPtCharged ->Fill(pt,ptMC);
2147 fhGamPhiCharged ->Fill(phi,phiMC);
2148 fhGamEtaCharged ->Fill(eta,etaMC);
2149 }
2302a644 2150 }//photon
2151 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron)){
2152 fhEleE ->Fill(e,eMC);
2153 fhElePt ->Fill(pt,ptMC);
2154 fhEleEta ->Fill(eta,etaMC);
2155 fhElePhi ->Fill(phi,phiMC);
2156 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
2157 fhEMR ->Fill(e,rVMC);
2158 if( nTracksMatched > 0){
5025c139 2159 fhEleECharged ->Fill(e,eMC);
2160 fhElePtCharged ->Fill(pt,ptMC);
2161 fhElePhiCharged ->Fill(phi,phiMC);
2162 fhEleEtaCharged ->Fill(eta,etaMC);
2302a644 2163 }
2164 }
2165 else if(charge == 0){
2166 fhNeHadE ->Fill(e,eMC);
2167 fhNeHadPt ->Fill(pt,ptMC);
2168 fhNeHadEta ->Fill(eta,etaMC);
2169 fhNeHadPhi ->Fill(phi,phiMC);
2170 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2171 fhHaR ->Fill(e,rVMC);
2172 if( nTracksMatched > 0){
5025c139 2173 fhNeHadECharged ->Fill(e,eMC);
2174 fhNeHadPtCharged ->Fill(pt,ptMC);
2175 fhNeHadPhiCharged ->Fill(phi,phiMC);
2176 fhNeHadEtaCharged ->Fill(eta,etaMC);
2302a644 2177 }
2178 }
2179 else if(charge!=0){
2180 fhChHadE ->Fill(e,eMC);
2181 fhChHadPt ->Fill(pt,ptMC);
2182 fhChHadEta ->Fill(eta,etaMC);
2183 fhChHadPhi ->Fill(phi,phiMC);
2184 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
2185 fhHaR ->Fill(e,rVMC);
2186 if( nTracksMatched > 0){
5025c139 2187 fhChHadECharged ->Fill(e,eMC);
2188 fhChHadPtCharged ->Fill(pt,ptMC);
2189 fhChHadPhiCharged ->Fill(phi,phiMC);
2190 fhChHadEtaCharged ->Fill(eta,etaMC);
2302a644 2191 }
2192 }
2193 }//Work with MC
c8fe2783 2194
902aa95c 2195
a6f26052 2196 //Match tracks and clusters
2197 //To be Modified in case of AODs
ff5cc919 2198
2302a644 2199 if( nTracksMatched > 0){
a6f26052 2200 if(fFillAllTH12){
2201 fhECharged ->Fill(e);
2202 fhPtCharged ->Fill(pt);
2203 fhPhiCharged ->Fill(phi);
2204 fhEtaCharged ->Fill(eta);
2205 }
2302a644 2206 fhEtaPhiECharged->Fill(eta,phi,e);
2207 fhNCellsPerClusterMIPCharged->Fill(e, nCaloCellsPerCluster,eta);
2208
a6f26052 2209 //printf("track index %d ntracks %d\n", esd->GetNumberOfTracks());
2210 //Study the track and matched cluster if track exists.
2302a644 2211 if(!track) return;
2212 Double_t emcpos[3] = {0.,0.,0.};
2213 Double_t emcmom[3] = {0.,0.,0.};
2214 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
2215 Double_t bfield = 0.;
2216 Double_t tphi = 0;
2217 Double_t teta = 0;
2218 Double_t tmom = 0;
2219 Double_t tpt = 0;
2220 Double_t tmom2 = 0;
2221 Double_t tpcSignal = 0;
2222 Bool_t okpos = kFALSE;
2223 Bool_t okmom = kFALSE;
2224 Bool_t okout = kFALSE;
2225 Int_t nITS = 0;
2226 Int_t nTPC = 0;
2227
a6f26052 2228 //In case of ESDs get the parameters in this way
ff5cc919 2229 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2230 if (track->GetOuterParam() ) {
2231 okout = kTRUE;
2232
2233 bfield = GetReader()->GetInputEvent()->GetMagneticField();
2234 okpos = track->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
2235 okmom = track->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
2236 if(!(okpos && okmom)) return;
2237
2238 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2239 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2240 tphi = position.Phi();
2241 teta = position.Eta();
2242 tmom = momentum.Mag();
2243
2244 //Double_t tphi = track->GetOuterParam()->Phi();
2245 //Double_t teta = track->GetOuterParam()->Eta();
2246 //Double_t tmom = track->GetOuterParam()->P();
2247 tpt = track->Pt();
2248 tmom2 = track->P();
2249 tpcSignal = track->GetTPCsignal();
2250
2251 nITS = track->GetNcls(0);
2252 nTPC = track->GetNcls(1);
2253 }//Outer param available
2254 }// ESDs
2255 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD) {
2256 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
2257 if (pid) {
2258 okout = kTRUE;
2259 pid->GetEMCALPosition(emcpos);
2260 pid->GetEMCALMomentum(emcmom);
2261
2262 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
2263 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
2264 tphi = position.Phi();
2265 teta = position.Eta();
2266 tmom = momentum.Mag();
2267
2268 tpt = track->Pt();
2269 tmom2 = track->P();
2270 tpcSignal = pid->GetTPCsignal();
2271
2272 //nITS = ((AliAODTrack*)track)->GetNcls(0);
2273 //nTPC = ((AliAODTrack*)track)->GetNcls(1);
2274 }//pid
2275 }//AODs
c8fe2783 2276
2277 if(okout){
2278 Double_t deta = teta - eta;
2279 Double_t dphi = tphi - phi;
2280 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
2281 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
2282 Double_t dR = sqrt(dphi*dphi + deta*deta);
6fa7d352 2283
c8fe2783 2284 Double_t pOverE = tmom/e;
6fa7d352 2285
c8fe2783 2286 fh1pOverE->Fill(tpt, pOverE);
2287 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
6fa7d352 2288
c8fe2783 2289 fh1dR->Fill(dR);
2290 fh2MatchdEdx->Fill(tmom2,tpcSignal);
6fa7d352 2291
c8fe2783 2292 if(IsDataMC() && primary){
2293 Int_t pdg = primary->GetPdgCode();
2294 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
6fa7d352 2295
c8fe2783 2296 if(TMath::Abs(pdg) == 11){
2297 fhMCEle1pOverE->Fill(tpt,pOverE);
2298 fhMCEle1dR->Fill(dR);
2299 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
2300 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
2301 }
2302 else if(charge!=0){
2303 fhMCChHad1pOverE->Fill(tpt,pOverE);
2304 fhMCChHad1dR->Fill(dR);
2305 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
2306 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
2307 }
2308 else if(charge == 0){
2309 fhMCNeutral1pOverE->Fill(tpt,pOverE);
2310 fhMCNeutral1dR->Fill(dR);
2311 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
2312 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
2313 }
2314 }//DataMC
2315
2316 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
2317 && nCaloCellsPerCluster > 1 && nITS > 3 && nTPC > 20) {
2318 fh2EledEdx->Fill(tmom2,tpcSignal);
2319 }
2320 }
2321 else{//no ESD external param or AODPid
a6f26052 2322 // ULong_t status=AliESDtrack::kTPCrefit;
2323 // status|=AliESDtrack::kITSrefit;
2324 //printf("track status %d\n", track->GetStatus() );
2325 // fhEChargedNoOut ->Fill(e);
2326 // fhPtChargedNoOut ->Fill(pt);
2327 // fhPhiChargedNoOut ->Fill(phi);
2328 // fhEtaChargedNoOut ->Fill(eta);
2329 // fhEtaPhiChargedNoOut ->Fill(eta,phi);
2330 // if(GetDebug() >= 0 && ((track->GetStatus() & status) == status)) printf("ITS+TPC\n");
c8fe2783 2331 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
2332
2333 }//No out params
2302a644 2334 }//matched clusters with tracks
c8fe2783 2335
902aa95c 2336}// Clusters
c8fe2783 2337
17708df9 2338
2339//__________________________________
798a9b04 2340void AliAnaCalorimeterQA::Correlate(){
2341 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
2342
2343 //Clusters
2302a644 2344 TObjArray * caloClustersEMCAL = GetAODEMCAL();
2345 TObjArray * caloClustersPHOS = GetAODPHOS();
2346
798a9b04 2347 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
2348 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
c8fe2783 2349
c8fe2783 2350 Float_t sumClusterEnergyEMCAL = 0;
2351 Float_t sumClusterEnergyPHOS = 0;
2352 Int_t iclus = 0;
2353 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
2354 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
2355 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
2356 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
c8fe2783 2357
798a9b04 2358
2359 //Cells
c8fe2783 2360
17708df9 2361 AliVCaloCells * cellsEMCAL = GetEMCALCells();
2362 AliVCaloCells * cellsPHOS = GetPHOSCells();
798a9b04 2363
2364 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
2365 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
c8fe2783 2366
c8fe2783 2367 Float_t sumCellEnergyEMCAL = 0;
2368 Float_t sumCellEnergyPHOS = 0;
798a9b04 2369 Int_t icell = 0;
c8fe2783 2370 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
2371 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
2372 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
2373 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
798a9b04 2374
2375
2376 //Fill Histograms
2377 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
2378 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
2379 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
2380 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
2381
2382 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
2383 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
2384 Int_t trM = GetTrackMultiplicity();
2385 if(fCalorimeter=="PHOS"){
2386 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
2387 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
2388 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
2389 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
2390
2391 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
2392 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
2393 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
2394 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
2395
2396 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
2397 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
2398 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
2399 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
2400 }
2401 else{
2402 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
2403 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
2404 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
2405 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
2406
2407 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
2408 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
2409 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
2410 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
2411
2412 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
2413 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
2414 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
2415 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
2416 }
2417
2418 if(GetDebug() > 0 )
2419 {
2420 printf("AliAnaCalorimeterQA::Correlate(): \n");
c8fe2783 2421 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
798a9b04 2422 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
c8fe2783 2423 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
798a9b04 2424 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
2425 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
c8fe2783 2426 }
a0bb4dc0 2427}
2428
17708df9 2429
a6f26052 2430//______________________________________________________________________________
902aa95c 2431void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
a6f26052 2432 //Fill pure monte carlo related histograms
4865e325 2433
2302a644 2434 Float_t eMC = mom.E();
2435 Float_t ptMC = mom.Pt();
2436 Float_t phiMC = mom.Phi();
2437 if(phiMC < 0)
2438 phiMC += TMath::TwoPi();
2439 Float_t etaMC = mom.Eta();
2440
2441 if (TMath::Abs(etaMC) > 1) return;
2442
2443 Bool_t in = kTRUE;
2444 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2445
2446 if (pdg==22) {
2447 fhGenGamPt ->Fill(ptMC);
2448 fhGenGamEta->Fill(etaMC);
2449 fhGenGamPhi->Fill(phiMC);
2450 if(in){
2451 fhGenGamAccE ->Fill(eMC);
2452 fhGenGamAccPt ->Fill(ptMC);
2453 fhGenGamAccEta->Fill(etaMC);
2454 fhGenGamAccPhi->Fill(phiMC);
2455 }
2456 }
2457 else if (pdg==111) {
2458 fhGenPi0Pt ->Fill(ptMC);
2459 fhGenPi0Eta->Fill(etaMC);
2460 fhGenPi0Phi->Fill(phiMC);
2461 if(in){
2462 fhGenPi0AccE ->Fill(eMC);
2463 fhGenPi0AccPt ->Fill(ptMC);
2464 fhGenPi0AccEta->Fill(etaMC);
2465 fhGenPi0AccPhi->Fill(phiMC);
2466 }
2467 }
2468 else if (pdg==221) {
2469 fhGenEtaPt ->Fill(ptMC);
2470 fhGenEtaEta->Fill(etaMC);
2471 fhGenEtaPhi->Fill(phiMC);
2472 }
2473 else if (pdg==223) {
2474 fhGenOmegaPt ->Fill(ptMC);
2475 fhGenOmegaEta->Fill(etaMC);
2476 fhGenOmegaPhi->Fill(phiMC);
2477 }
2478 else if (TMath::Abs(pdg)==11) {
2479 fhGenElePt ->Fill(ptMC);
2480 fhGenEleEta->Fill(etaMC);
2481 fhGenElePhi->Fill(phiMC);
2482 }
c8fe2783 2483
902aa95c 2484}
c8fe2783 2485
a6f26052 2486//________________________________________________________________________
9725fd2a 2487void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
2488{
a6f26052 2489 // Needed when Terminate is executed in distributed environment
2490 // Refill analysis histograms of this class with corresponding histograms in output list.
9725fd2a 2491
a6f26052 2492 // Histograms of this analsys are kept in the same list as other analysis, recover the position of
2493 // the first one and then add the next
2302a644 2494 Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"hE"));
a6f26052 2495 //printf("Calo: %s, index: %d, nmodules %d\n",fCalorimeter.Data(),index,fNModules);
2302a644 2496
a6f26052 2497 //Read histograms, must be in the same order as in GetCreateOutputObject.
2302a644 2498 fhE = (TH1F *) outputList->At(index++);
a6f26052 2499 if(fFillAllTH12){
2500 fhPt = (TH1F *) outputList->At(index++);
2501 fhPhi = (TH1F *) outputList->At(index++);
2502 fhEta = (TH1F *) outputList->At(index++);
2503 }
2302a644 2504 fhEtaPhiE = (TH3F *) outputList->At(index++);
a6f26052 2505
2302a644 2506 fhClusterTimeEnergy = (TH2F*) outputList->At(index++);
2507
2508 fhLambda = (TH3F *) outputList->At(index++);
2509 fhDispersion = (TH2F *) outputList->At(index++);
a6f26052 2510 if(fFillAllTH12){
2511 fhECharged = (TH1F *) outputList->At(index++);
2512 fhPtCharged = (TH1F *) outputList->At(index++);
2513 fhPhiCharged = (TH1F *) outputList->At(index++);
2514 fhEtaCharged = (TH1F *) outputList->At(index++);
2515 }
2302a644 2516 fhEtaPhiECharged = (TH3F *) outputList->At(index++);
2517
2518 fh1pOverE = (TH2F *) outputList->At(index++);
2519 fh1dR = (TH1F *) outputList->At(index++);
2520 fh2MatchdEdx = (TH2F *) outputList->At(index++);
2521 fh2EledEdx = (TH2F *) outputList->At(index++);
2522 fh1pOverER02 = (TH2F *) outputList->At(index++);
2523
2524 fhIM = (TH2F *) outputList->At(index++);
2525 fhIMCellCut = (TH2F *) outputList->At(index++);
b8187de4 2526 fhAsym = (TH2F *) outputList->At(index++);
2302a644 2527
2528 fhNCellsPerCluster = (TH3F *) outputList->At(index++);
2529 fhNCellsPerClusterMIP = (TH3F *) outputList->At(index++);
2530 fhNCellsPerClusterMIPCharged = (TH3F *) outputList->At(index++);
2531 fhNClusters = (TH1F *) outputList->At(index++);
2532
2533 fhRNCells = (TH2F *) outputList->At(index++);
2534 fhXNCells = (TH2F *) outputList->At(index++);
2535 fhYNCells = (TH2F *) outputList->At(index++);
2536 fhZNCells = (TH2F *) outputList->At(index++);
2537 fhRE = (TH2F *) outputList->At(index++);
2538 fhXE = (TH2F *) outputList->At(index++);
2539 fhYE = (TH2F *) outputList->At(index++);
2540 fhZE = (TH2F *) outputList->At(index++);
2541 fhXYZ = (TH3F *) outputList->At(index++);
b8187de4 2542 if(fFillAllPosHisto){
a6f26052 2543 fhRCellE = (TH2F *) outputList->At(index++);
2544 fhXCellE = (TH2F *) outputList->At(index++);
2545 fhYCellE = (TH2F *) outputList->At(index++);
2546 fhZCellE = (TH2F *) outputList->At(index++);
2547 fhXYZCell = (TH3F *) outputList->At(index++);
2548 fhDeltaCellClusterRNCells = (TH2F *) outputList->At(index++);
2549 fhDeltaCellClusterXNCells = (TH2F *) outputList->At(index++);
2550 fhDeltaCellClusterYNCells = (TH2F *) outputList->At(index++);
2551 fhDeltaCellClusterZNCells = (TH2F *) outputList->At(index++);
2552 fhDeltaCellClusterRE = (TH2F *) outputList->At(index++);
2553 fhDeltaCellClusterXE = (TH2F *) outputList->At(index++);
2554 fhDeltaCellClusterYE = (TH2F *) outputList->At(index++);
2555 fhDeltaCellClusterZE = (TH2F *) outputList->At(index++);
2556 fhEtaPhiAmp = (TH3F *) outputList->At(index++);
2302a644 2557 }
a6f26052 2558
2302a644 2559 fhNCells = (TH1F *) outputList->At(index++);
2560 fhAmplitude = (TH1F *) outputList->At(index++);
2561 fhAmpId = (TH2F *) outputList->At(index++);
c8fe2783 2562
2302a644 2563 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2564
2565 fhCellTimeSpreadRespectToCellMax = (TH1F *) outputList->At(index++);
2566 fhCellIdCellLargeTimeSpread = (TH1F *) outputList->At(index++);
2567
2568 fhTime = (TH1F *) outputList->At(index++);
2569 fhTimeId = (TH2F *) outputList->At(index++);
2570 fhTimeAmp = (TH2F *) outputList->At(index++);
c8fe2783 2571
a6f26052 2572 // fhT0Time = (TH1F *) outputList->At(index++);
2573 // fhT0TimeId = (TH2F *) outputList->At(index++);
2574 // fhT0TimeAmp = (TH2F *) outputList->At(index++);
2302a644 2575
2576 }
2577
2578
798a9b04 2579 if(fCorrelate){
2302a644 2580 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
2581 fhCaloCorrEClusters = (TH2F *) outputList->At(index++);
2582 fhCaloCorrNCells = (TH2F *) outputList->At(index++);
2583 fhCaloCorrECells = (TH2F *) outputList->At(index++);
798a9b04 2584
2585 fhCaloV0SCorrNClusters = (TH2F *) outputList->At(index++);
2586 fhCaloV0SCorrEClusters = (TH2F *) outputList->At(index++);
2587 fhCaloV0SCorrNCells = (TH2F *) outputList->At(index++);
2588 fhCaloV0SCorrECells = (TH2F *) outputList->At(index++);
2589
2590 fhCaloV0MCorrNClusters = (TH2F *) outputList->At(index++);
2591 fhCaloV0MCorrEClusters = (TH2F *) outputList->At(index++);
2592 fhCaloV0MCorrNCells = (TH2F *) outputList->At(index++);
2593 fhCaloV0MCorrECells = (TH2F *) outputList->At(index++);
2594
2595 fhCaloTrackMCorrNClusters = (TH2F *) outputList->At(index++);
2596 fhCaloTrackMCorrEClusters = (TH2F *) outputList->At(index++);
2597 fhCaloTrackMCorrNCells = (TH2F *) outputList->At(index++);
2598 fhCaloTrackMCorrECells = (TH2F *) outputList->At(index++);
2302a644 2599 }
2600
a6f26052 2601 //Module histograms
2302a644 2602 fhEMod = new TH1F*[fNModules];
2603 fhNClustersMod = new TH1F*[fNModules];
2604 fhNCellsPerClusterMod = new TH2F*[fNModules];
2605 fhNCellsMod = new TH1F*[fNModules];
2606 fhGridCellsMod = new TH2F*[fNModules];
2607 fhGridCellsEMod = new TH2F*[fNModules];
2608 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2609 fhGridCellsTimeMod = new TH2F*[fNModules];
2610 fhAmplitudeMod = new TH1F*[fNModules];
2611 if(fCalorimeter=="EMCAL")
2612 fhAmplitudeModFraction = new TH1F*[fNModules*3];
2613
a6f26052 2614 //EMCAL
2302a644 2615 fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2616
2617 fhIMMod = new TH2F*[fNModules];
2618 fhIMCellCutMod = new TH2F*[fNModules];
2619
2620 for(Int_t imod = 0 ; imod < fNModules; imod++){
2621 fhEMod[imod] = (TH1F *) outputList->At(index++);
2622 fhNClustersMod[imod] = (TH1F *) outputList->At(index++);
2623 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++);
2624 fhNCellsMod[imod] = (TH1F *) outputList->At(index++);
2625 fhGridCellsMod[imod] = (TH2F *) outputList->At(index++);
2626 fhGridCellsEMod[imod] = (TH2F *) outputList->At(index++);
2627 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
2628 fhGridCellsTimeMod[imod] = (TH2F *) outputList->At(index++);
2629 fhAmplitudeMod[imod] = (TH1F *) outputList->At(index++);
2630
2631 if(fCalorimeter=="EMCAL"){
2632 for(Int_t ifrac = 0; ifrac < 3; ifrac++){
2633 fhAmplitudeModFraction[imod*3+ifrac] = (TH1F *) outputList->At(index++);
2634 }
2635 }
2636
2637 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2638 fhTimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
a6f26052 2639 //fhT0TimeAmpPerRCU[imod*fNRCU+ircu] = (TH2F *) outputList->At(index++);
2640 // for(Int_t imod2 = 0; imod2 < fNModules; imod2++){
2641 // for(Int_t ircu2 = 0; ircu2 < fNModules; ircu2++){
2642 // fhTimeCorrRCU[imod*fNRCU+ircu+imod2*fNRCU+ircu2] = (TH2F *) outputList->At(index++);
2643 // }
2644 // }
2302a644 2645 }
2646 fhIMMod[imod] = (TH2F *) outputList->At(index++);
2647 fhIMCellCutMod[imod] = (TH2F *) outputList->At(index++);
c8fe2783 2648
2302a644 2649 }
2650
2651 if(IsDataMC()){
2652 fhDeltaE = (TH1F *) outputList->At(index++);
2653 fhDeltaPt = (TH1F *) outputList->At(index++);
2654 fhDeltaPhi = (TH1F *) outputList->At(index++);
2655 fhDeltaEta = (TH1F *) outputList->At(index++);
2656
2657 fhRatioE = (TH1F *) outputList->At(index++);
2658 fhRatioPt = (TH1F *) outputList->At(index++);
2659 fhRatioPhi = (TH1F *) outputList->At(index++);
2660 fhRatioEta = (TH1F *) outputList->At(index++);
2661
2662 fh2E = (TH2F *) outputList->At(index++);
2663 fh2Pt = (TH2F *) outputList->At(index++);
2664 fh2Phi = (TH2F *) outputList->At(index++);
2665 fh2Eta = (TH2F *) outputList->At(index++);
2666
2667 fhGamE = (TH2F *) outputList->At(index++);
2668 fhGamPt = (TH2F *) outputList->At(index++);
2669 fhGamPhi = (TH2F *) outputList->At(index++);
2670 fhGamEta = (TH2F *) outputList->At(index++);
2671
2672 fhGamDeltaE = (TH1F *) outputList->At(index++);
2673 fhGamDeltaPt = (TH1F *) outputList->At(index++);
2674 fhGamDeltaPhi = (TH1F *) outputList->At(index++);
2675 fhGamDeltaEta = (TH1F *) outputList->At(index++);
2676
2677 fhGamRatioE = (TH1F *) outputList->At(index++);
2678 fhGamRatioPt = (TH1F *) outputList->At(index++);
2679 fhGamRatioPhi = (TH1F *) outputList->At(index++);
2680 fhGamRatioEta = (TH1F *) outputList->At(index++);
2681
2682 fhPi0E = (TH2F *) outputList->At(index++);
2683 fhPi0Pt = (TH2F *) outputList->At(index++);
2684 fhPi0Phi = (TH2F *) outputList->At(index++);
2685 fhPi0Eta = (TH2F *) outputList->At(index++);
2686
2687 fhEleE = (TH2F *) outputList->At(index++);
2688 fhElePt = (TH2F *) outputList->At(index++);
2689 fhElePhi = (TH2F *) outputList->At(index++);
2690 fhEleEta = (TH2F *) outputList->At(index++);
2691
2692 fhNeHadE = (TH2F *) outputList->At(index++);
2693 fhNeHadPt = (TH2F *) outputList->At(index++);
2694 fhNeHadPhi = (TH2F *) outputList->At(index++);
2695 fhNeHadEta = (TH2F *) outputList->At(index++);
2696
2697 fhChHadE = (TH2F *) outputList->At(index++);
2698 fhChHadPt = (TH2F *) outputList->At(index++);
2699 fhChHadPhi = (TH2F *) outputList->At(index++);
2700 fhChHadEta = (TH2F *) outputList->At(index++);
2701
2702 fhGamECharged = (TH2F *) outputList->At(index++);
2703 fhGamPtCharged = (TH2F *) outputList->At(index++);
2704 fhGamPhiCharged = (TH2F *) outputList->At(index++);
2705 fhGamEtaCharged = (TH2F *) outputList->At(index++);
2706
2707 fhPi0ECharged = (TH2F *) outputList->At(index++);
2708 fhPi0PtCharged = (TH2F *) outputList->At(index++);
2709 fhPi0PhiCharged = (TH2F *) outputList->At(index++);
2710 fhPi0EtaCharged = (TH2F *) outputList->At(index++);
2711
2712 fhEleECharged = (TH2F *) outputList->At(index++);
2713 fhElePtCharged = (TH2F *) outputList->At(index++);
2714 fhElePhiCharged = (TH2F *) outputList->At(index++);
2715 fhEleEtaCharged = (TH2F *) outputList->At(index++);
2716
2717 fhNeHadECharged = (TH2F *) outputList->At(index++);
2718 fhNeHadPtCharged = (TH2F *) outputList->At(index++);
2719 fhNeHadPhiCharged = (TH2F *) outputList->At(index++);
2720 fhNeHadEtaCharged = (TH2F *) outputList->At(index++);
2721
2722 fhChHadECharged = (TH2F *) outputList->At(index++);
2723 fhChHadPtCharged = (TH2F *) outputList->At(index++);
2724 fhChHadPhiCharged = (TH2F *) outputList->At(index++);
2725 fhChHadEtaCharged = (TH2F *) outputList->At(index++);
06e5656a 2726
a6f26052 2727 // fhEMVxyz = (TH3F *) outputList->At(index++);
2728 // fhHaVxyz = (TH3F *) outputList->At(index++);
9725fd2a 2729
2302a644 2730 fhEMVxyz = (TH2F *) outputList->At(index++);
2731 fhHaVxyz = (TH2F *) outputList->At(index++);
2732 fhEMR = (TH2F *) outputList->At(index++);
2733 fhHaR = (TH2F *) outputList->At(index++);
2734
2735 fhGenGamPt = (TH1F *) outputList->At(index++);
2736 fhGenGamEta = (TH1F *) outputList->At(index++);
2737 fhGenGamPhi = (TH1F *) outputList->At(index++);
2738
2739 fhGenPi0Pt = (TH1F *) outputList->At(index++);
2740 fhGenPi0Eta = (TH1F *) outputList->At(index++);
2741 fhGenPi0Phi = (TH1F *) outputList->At(index++);
2742
2743 fhGenEtaPt = (TH1F *) outputList->At(index++);
2744 fhGenEtaEta = (TH1F *) outputList->At(index++);
2745 fhGenEtaPhi = (TH1F *) outputList->At(index++);
2746
2747 fhGenOmegaPt = (TH1F *) outputList->At(index++);
2748 fhGenOmegaEta = (TH1F *) outputList->At(index++);
2749 fhGenOmegaPhi = (TH1F *) outputList->At(index++);
2750
2751 fhGenElePt = (TH1F *) outputList->At(index++);
2752 fhGenEleEta = (TH1F *) outputList->At(index++);
2753 fhGenElePhi = (TH1F *) outputList->At(index++);
2754
2755 fhGenGamAccE = (TH1F *) outputList->At(index++);
2756 fhGenGamAccPt = (TH1F *) outputList->At(index++);
2757 fhGenGamAccEta = (TH1F *) outputList->At(index++);
2758 fhGenGamAccPhi = (TH1F *) outputList->At(index++);
2759
2760 fhGenPi0AccE = (TH1F *) outputList->At(index++);
2761 fhGenPi0AccPt = (TH1F *) outputList->At(index++);
2762 fhGenPi0AccEta = (TH1F *) outputList->At(index++);
2763 fhGenPi0AccPhi = (TH1F *) outputList->At(index++);
2764
2765 fhMCEle1pOverE = (TH2F *) outputList->At(index++);
2766 fhMCEle1dR = (TH1F *) outputList->At(index++);
2767 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
2768
2769 fhMCChHad1pOverE = (TH2F *) outputList->At(index++);
2770 fhMCChHad1dR = (TH1F *) outputList->At(index++);
2771 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
2772
2773 fhMCNeutral1pOverE = (TH2F *) outputList->At(index++);
2774 fhMCNeutral1dR = (TH1F *) outputList->At(index++);
2775 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
2776
2777 fhMCEle1pOverER02 = (TH2F *) outputList->At(index++);
2778 fhMCChHad1pOverER02 = (TH2F *) outputList->At(index++);
2779 fhMCNeutral1pOverER02 = (TH2F *) outputList->At(index++);
2780 }
9725fd2a 2781}
2782
a6f26052 2783//__________________________________________________________________
9725fd2a 2784void AliAnaCalorimeterQA::Terminate(TList* outputList)
2785{
a6f26052 2786 //Do plots if requested
c8fe2783 2787
d7c10d78 2788 if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), MakePlotsOn());
2789
a6f26052 2790 //Do some plots to end
c8fe2783 2791 if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
a6f26052 2792 //Recover histograms from output histograms list, needed for distributed analysis.
54769bc0 2793 ReadHistograms(outputList);
2794
a6f26052 2795 //printf(" AliAnaCalorimeterQA::Terminate() *** %s Report:", GetName()) ;
2796 //printf(" AliAnaCalorimeterQA::Terminate() pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ;
c8fe2783 2797
164a1d84 2798 const Int_t buffersize = 255;
54769bc0 2799 char name[buffersize];
2800 char cname[buffersize];
2801
a6f26052 2802 //In case terminate is executed after the analysis, in a second step, and we want to rebin or to change the range of the histograms for plotting
54769bc0 2803 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
2804 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
2805 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
a6f26052 2806 // Int_t nmassbins = GetHistoMassBins(); Float_t massmax = GetHistoMassMax(); Float_t massmin = GetHistoMassMin();
2807 // Int_t nasymbins = GetHistoAsymmetryBins(); Float_t asymmax = GetHistoAsymmetryMax(); Float_t asymmin = GetHistoAsymmetryMin();
2808 // Int_t nPoverEbins = GetHistoPOverEBins(); Float_t pOverEmax = GetHistoPOverEMax(); Float_t pOverEmin = GetHistoPOverEMin();
2809 // Int_t ndedxbins = GetHistodEdxBins(); Float_t dedxmax = GetHistodEdxMax(); Float_t dedxmin = GetHistodEdxMin();
2810 // Int_t ndRbins = GetHistodRBins(); Float_t dRmax = GetHistodRMax(); Float_t dRmin = GetHistodRMin();
54769bc0 2811 Int_t ntimebins = GetHistoTimeBins(); Float_t timemax = GetHistoTimeMax(); Float_t timemin = GetHistoTimeMin();
2812 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
a6f26052 2813 // Int_t nratiobins = GetHistoRatioBins(); Float_t ratiomax = GetHistoRatioMax(); Float_t ratiomin = GetHistoRatioMin();
2814 // Int_t nvdistbins = GetHistoVertexDistBins(); Float_t vdistmax = GetHistoVertexDistMax(); Float_t vdistmin = GetHistoVertexDistMin();
54769bc0 2815 Int_t rbins = GetHistoRBins(); Float_t rmax = GetHistoRMax(); Float_t rmin = GetHistoRMin();
2816 Int_t xbins = GetHistoXBins(); Float_t xmax = GetHistoXMax(); Float_t xmin = GetHistoXMin();
2817 Int_t ybins = GetHistoYBins(); Float_t ymax = GetHistoYMax(); Float_t ymin = GetHistoYMin();
2818 Int_t zbins = GetHistoZBins(); Float_t zmax = GetHistoZMax(); Float_t zmin = GetHistoZMin();
2819
a6f26052 2820 //Color code for the different modules
54769bc0 2821 Int_t modColorIndex[]={2,4,6,8};
2822
a6f26052 2823 //--------------------------------------------------
2824 // Cluster energy distributions, module dependence
2825 //--------------------------------------------------
54769bc0 2826 snprintf(cname,buffersize,"QA_%s_ClusterEnergy",fCalorimeter.Data());
2827 TCanvas * c = new TCanvas(cname, "Energy distributions", 800, 400) ;
2828 c->Divide(2, 1);
2829 Int_t rbE = GetNewRebinForRePlotting((TH1D*)fhE, ptmin, ptmax,nptbins) ;
a6f26052 2830 //printf("new E rb %d\n",rbE);
54769bc0 2831 fhE->Rebin(rbE);
2832 fhE->SetAxisRange(ptmin,ptmax,"X");
2833 c->cd(1) ;
2834 if(fhE->GetEntries() > 0) gPad->SetLogy();
2835 TLegend pLegendE(0.7,0.6,0.9,0.8);
2836 pLegendE.SetTextSize(0.03);
2837 pLegendE.AddEntry(fhE,"all modules","L");
2838 pLegendE.SetFillColor(10);
2839 pLegendE.SetBorderSize(1);
2840
2841 fhE->SetMinimum(1);
2842 fhE->SetLineColor(1);
2843 fhE->Draw("HE");
2844 for(Int_t imod = 0; imod < fNModules; imod++){
2845 fhEMod[imod]->Rebin(rbE);
2846 fhEMod[imod]->SetLineColor(modColorIndex[imod]);
2847 fhEMod[imod]->Draw("HE same");
2848 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
2849 }
2850 pLegendE.Draw();
2851
a6f26052 2852 //Ratio of modules
54769bc0 2853 c->cd(2) ;
2854 TLegend pLegendER(0.55,0.8,0.9,0.9);
2855 pLegendER.SetTextSize(0.03);
2856 pLegendER.SetFillColor(10);
2857 pLegendER.SetBorderSize(1);
2858
2859 for(Int_t imod = 1; imod < fNModules; imod++){
2860 TH1D * htmp = (TH1D*)fhEMod[imod]->Clone(Form("hERat%d",imod));
2861 htmp->Divide(fhEMod[0]);
2862 htmp->SetLineColor(modColorIndex[imod]);
2863 if(imod==1){
2864 htmp->SetTitle("Ratio module X / module 0");
2865 htmp->SetAxisRange(ptmin,ptmax,"X");
2866 htmp->SetMaximum(5);
2867 htmp->SetMinimum(0);
2868 htmp->SetAxisRange(ptmin,ptmax,"X");
2869 htmp->Draw("HE");
2870 }
2871 else
2872 htmp->Draw("same HE");
2873
2874 pLegendER.AddEntry(fhEMod[imod],Form("module %d / module 0",imod),"L");
2875 }
2876 pLegendER.Draw();
2877
2878 snprintf(name,buffersize,"QA_%s_ClusterEnergy.eps",fCalorimeter.Data());
2879 c->Print(name); printf("Plot: %s\n",name);
2880
a6f26052 2881 //--------------------------------------------------
2882 // Cell energy distributions, module dependence
2883 //--------------------------------------------------
54769bc0 2884 snprintf(cname,buffersize,"%s_QA_CellEnergy",fCalorimeter.Data());
2885 TCanvas * ca = new TCanvas(cname, "Cell Energy distributions", 800, 400) ;
2886 ca->Divide(2, 1);
2887
2888 Int_t rbAmp = GetNewRebinForRePlotting((TH1D*)fhAmplitude, ptmin, ptmax,nptbins*2) ;
a6f26052 2889 //printf("new Amp rb %d\n",rbAmp);
54769bc0 2890 fhAmplitude->Rebin(rbAmp);
2891 fhAmplitude->SetAxisRange(ptmin,ptmax,"X");
2892
2893 ca->cd(1) ;
2894 if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
2895 TLegend pLegendA(0.7,0.6,0.9,0.8);
2896 pLegendA.SetTextSize(0.03);
2897 pLegendA.AddEntry(fhE,"all modules","L");
2898 pLegendA.SetFillColor(10);
2899 pLegendA.SetBorderSize(1);
2900 fhAmplitude->SetMinimum(0.1);
2901 fhAmplitude->SetLineColor(1);
2902 fhAmplitude->Draw("HE");
2903
2904 for(Int_t imod = 0; imod < fNModules; imod++){
2905 fhAmplitudeMod[imod]->Rebin(rbAmp);
2906 fhAmplitudeMod[imod]->SetLineColor(modColorIndex[imod]);
2907 fhAmplitudeMod[imod]->Draw("HE same");
2908 pLegendA.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
2909 }
2910 pLegendA.Draw();
2911
2912
2913 ca->cd(2) ;
2914 TLegend pLegendAR(0.55,0.8,0.9,0.9);
2915 pLegendAR.SetTextSize(0.03);
2916 pLegendAR.SetFillColor(10);
2917 pLegendAR.SetBorderSize(1);
2918
2919 for(Int_t imod = 1; imod < fNModules; imod++){
2920 TH1D * htmp = (TH1D*)fhAmplitudeMod[imod]->Clone(Form("hAmpRat%d",imod));
2921 htmp->Divide(fhAmplitudeMod[0]);
2922 htmp->SetLineColor(modColorIndex[imod]);
2923 if(imod==1){
2924 htmp->SetTitle("Ratio cells energy in module X / module 0");
2925 htmp->SetAxisRange(ptmin,ptmax,"X");
2926 htmp->SetMaximum(5);
2927 htmp->SetMinimum(0);
2928 htmp->Draw("HE");
2929 }
2930 else
2931 htmp->Draw("same HE");
2932 pLegendAR.AddEntry(fhAmplitudeMod[imod],Form("module %d",imod),"L");
2933 }
2934
2935 pLegendAR.Draw();
2936 snprintf(name,buffersize,"QA_%s_CellEnergy.eps",fCalorimeter.Data());
2937 ca->Print(name); printf("Plot: %s\n",name);
c8fe2783 2938
a6f26052 2939 //----------------------------------------------------------
2940 // Cell energy distributions, FRACTION of module dependence
2941 // See Super Module calibration difference
2942 //---------------------------------------------------------
54769bc0 2943 if(fCalorimeter=="EMCAL"){
a6f26052 2944 //Close To Eta 0
54769bc0 2945 snprintf(cname,buffersize,"%s_QA_SMThirds",fCalorimeter.Data());
2946 TCanvas * cfrac = new TCanvas(cname, "SM Thirds ratios", 800, 1200) ;
2947 cfrac->Divide(2, 3);
2948 cfrac->cd(1) ;
2949 if(fhAmplitude->GetEntries() > 0)
2950 gPad->SetLogy();
2951 TLegend pLegend1(0.6,0.6,0.9,0.8);
2952 pLegend1.SetTextSize(0.03);
2953 pLegend1.SetFillColor(10);
2954 pLegend1.SetBorderSize(1);
2955 pLegend1.SetHeader("Third close to Eta=0");
2956 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0");
2957 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
2958 fhAmplitudeModFraction[0]->Draw("axis");
2959 TH1D * hAverageThird1 = (TH1D *)fhAmplitudeModFraction[3*0+2]->Clone("AverageThird1");
2960 for(Int_t imod = 0; imod < fNModules; imod++){
2961 Int_t ifrac = 0;
2962 if(imod%2==0) ifrac = 2;
2963 if(imod > 0) hAverageThird1->Add( fhAmplitudeModFraction[3*imod+ifrac]);
2964 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
2965 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
2966 pLegend1.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
2967 }
2968 hAverageThird1 ->Scale(1./fNModules);
2969 pLegend1.Draw();
a6f26052 2970 //Ratio
54769bc0 2971 cfrac->cd(2) ;
2972 for(Int_t imod = 0; imod < fNModules; imod++){
2973 Int_t ifrac = 0;
2974 if(imod%2==0) ifrac = 2;
2975 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
2976 htmp->Divide(hAverageThird1);
2977 if(imod ==0) {
2978 htmp ->SetTitle("Close to eta = 0");
2979 htmp ->SetMaximum(5);
2980 htmp ->SetMinimum(0);
2981 htmp ->SetAxisRange(ptmin,ptmax,"X");
2982 htmp ->SetYTitle("ratio third to average");
2983 htmp -> Draw("HE");
2984 }
2985 else htmp -> Draw("same HE");
2986 }
a6f26052 2987 //pLegend1.Draw();
54769bc0 2988
a6f26052 2989 //Middle Eta
54769bc0 2990 cfrac->cd(3) ;
2991 if(fhAmplitude->GetEntries() > 0)
2992 gPad->SetLogy();
2993 TLegend pLegend2(0.6,0.6,0.9,0.8);
2994 pLegend2.SetTextSize(0.03);
2995 pLegend2.SetFillColor(10);
2996 pLegend2.SetBorderSize(1);
2997 pLegend2.SetHeader("Middle Third");
2998
2999 fhAmplitudeModFraction[0]->SetTitle("Middle Third");
3000 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3001 fhAmplitudeModFraction[0]->Draw("axis");
3002
3003 TH1D * hAverageThird2 = (TH1D *)fhAmplitudeModFraction[3*0+1]->Clone("AverageThird2");
3004 for(Int_t imod = 0; imod < fNModules; imod++){
3005 Int_t ifrac = 1;
3006 if(imod > 0) hAverageThird2->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3007 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3008 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3009 pLegend2.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3010 }
3011 hAverageThird2->Scale(1./fNModules);
3012 pLegend2.Draw();
3013
a6f26052 3014 //Ratio
54769bc0 3015 cfrac->cd(4) ;
3016
3017 for(Int_t imod = 0; imod < fNModules; imod++){
3018 Int_t ifrac = 1;
3019 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3020 htmp->Divide(hAverageThird2);
3021 if(imod ==0) {
3022 htmp ->SetTitle("Middle");
3023 htmp ->SetMaximum(5);
3024 htmp ->SetMinimum(0);
3025 htmp ->SetAxisRange(ptmin,ptmax,"X");
3026 htmp ->SetYTitle("ratio third to average");
3027 htmp -> Draw("HE");
3028 }
3029 else htmp -> Draw("same HE");
3030 }
a6f26052 3031 //pLegend2.Draw();
54769bc0 3032
a6f26052 3033 //Close To Eta 0.7
54769bc0 3034 cfrac->cd(5) ;
3035 if(fhAmplitude->GetEntries() > 0)
3036 gPad->SetLogy();
3037 TLegend pLegend3(0.6,0.6,0.9,0.8);
3038 pLegend3.SetTextSize(0.03);
3039 pLegend3.SetFillColor(10);
3040 pLegend3.SetBorderSize(1);
3041 pLegend3.SetHeader("Third close to Eta=0.7");
3042
3043 fhAmplitudeModFraction[0]->SetTitle("Third close to Eta=0.7");
3044 fhAmplitudeModFraction[0]->SetAxisRange(ptmin,ptmax,"X");
3045 fhAmplitudeModFraction[0]->Draw("axis");
3046
3047 TH1D * hAverageThird3 = (TH1D *)fhAmplitudeModFraction[3*0+0]->Clone("AverageThird3");
3048 for(Int_t imod = 0; imod < 4; imod++){
3049 Int_t ifrac = 2;
3050 if(imod%2==0) ifrac = 0;
3051 if(imod > 0) hAverageThird3->Add( fhAmplitudeModFraction[3*imod+ifrac]);
3052 fhAmplitudeModFraction[3*imod+ifrac]->SetLineColor(modColorIndex[imod]);
3053 fhAmplitudeModFraction[3*imod+ifrac]->Draw("HE same");
3054 pLegend3.AddEntry(fhAmplitudeModFraction[3*imod+ifrac],Form("super module %d",imod),"L");
3055 }
3056 hAverageThird3 ->Scale(1./fNModules);
3057 pLegend3.Draw();
3058
3059 cfrac->cd(6) ;
3060
3061 for(Int_t imod = 0; imod < fNModules; imod++){
3062 Int_t ifrac = 2;
3063 if(imod%2==0) ifrac = 0;
3064 TH1D * htmp = (TH1D*)fhAmplitudeModFraction[3*imod+ifrac]->Clone(Form("ThirdFractionAverage_%d_%d",imod,ifrac));
3065 htmp->Divide(hAverageThird3);
3066 if(imod ==0) {
3067 htmp ->SetTitle("Close to eta = 0.7");
3068 htmp ->SetMaximum(5);
3069 htmp ->SetMinimum(0);
3070 htmp ->SetAxisRange(ptmin,ptmax,"X");
3071 htmp ->SetYTitle("ratio third to average");
3072 htmp ->Draw("HE");
3073 }
3074 else htmp ->Draw("same HE");
3075 }
a6f26052 3076 //pLegend3.Draw();
54769bc0 3077
3078 snprintf(name,buffersize,"QA_%s_CellEnergyModuleFraction.eps",fCalorimeter.Data());
3079 cfrac->Print(name); printf("Create plot %s\n",name);
3080 }//EMCAL
3081
3082
a6f26052 3083 //----------------------------------------------------------
3084 // Cluster eta and phi distributions, energy cut dependence
3085 //---------------------------------------------------------
54769bc0 3086
3087 snprintf(cname,buffersize,"%s_QA_EtaPhiCluster",fCalorimeter.Data());
3088 TCanvas * cetaphic = new TCanvas(cname, "Eta-Phi Reconstructed distributions", 1200, 400) ;
3089 cetaphic->Divide(3, 1);
3090 Int_t binmin = 0;
3091 Int_t rbPhi = 1;
3092 Int_t rbEta = 1;
3093 Int_t ncuts = 7;
3094 Float_t ecut[] = {0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3};
3095 Int_t ecutcolor[]= {2, 4, 6, 7, 8, 9, 12};
3096 TH1D * hE = fhEtaPhiE->ProjectionZ();
3097
a6f26052 3098 //PHI
54769bc0 3099 cetaphic->cd(1) ;
3100 gPad->SetLogy();
3101 gPad->SetGridy();
3102
3103 TLegend pLegendPhiCl(0.83,0.6,0.95,0.93);
3104 pLegendPhiCl.SetTextSize(0.03);
3105 pLegendPhiCl.SetFillColor(10);
3106 pLegendPhiCl.SetBorderSize(1);
3107
3108 TH1D * htmp = fhEtaPhiE->ProjectionY("hphi_cluster_nocut",0,-1,0,-1);
3109 if(htmp){
3110 htmp->SetMinimum(1);
3111 rbPhi = GetNewRebinForRePlotting(htmp, phimin, phimax,nphibins) ;
a6f26052 3112 //printf("new Phi rb %d\n",rbPhi);
54769bc0 3113 htmp->Rebin(rbPhi);
3114 htmp->SetTitle("#phi of clusters for energy in cluster > threshold");
3115 htmp->SetAxisRange(phimin,phimax,"X");
3116 htmp->Draw("HE");
3117 pLegendPhiCl.AddEntry(htmp,"No cut","L");
3118
3119 for (Int_t i = 0; i < ncuts; i++) {
3120 binmin = hE->FindBin(ecut[i]);
a6f26052 3121 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3122 htmp = fhEtaPhiE->ProjectionY(Form("hphi_cluster_cut%d",i),0,-1,binmin,-1);
3123 htmp->SetLineColor(ecutcolor[i]);
3124 htmp->Rebin(rbPhi);
3125 htmp->Draw("same HE");
3126 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3127
3128 }
3129 }
3130 pLegendPhiCl.Draw();
3131
3132 //ETA
3133 cetaphic->cd(2) ;
3134 gPad->SetLogy();
3135 gPad->SetGridy();
3136
3137 delete htmp;
3138 htmp = fhEtaPhiE->ProjectionX("heta_cluster_nocut",0,-1,0,-1);
fbad5435 3139 if(htmp){
3140 rbEta = GetNewRebinForRePlotting(htmp,etamin, etamax,netabins) ;
3141 //printf("new Eta rb %d\n",rbEta);
54769bc0 3142 htmp->Rebin(rbEta);
3143 htmp->SetMinimum(1);
3144 htmp ->SetLineColor(1);
3145 htmp->SetTitle("#eta of clusters for energy in cluster > threshold");
3146 htmp->SetAxisRange(etamin,etamax,"X");
3147 htmp->Draw("HE");
3148
3149 for (Int_t i = 0; i < ncuts; i++) {
3150 binmin = hE->FindBin(ecut[i]);
a6f26052 3151 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3152 htmp = fhEtaPhiE->ProjectionX(Form("heta_cluster_cut%d",i),0,-1,binmin,-1);
3153 htmp->SetLineColor(ecutcolor[i]);
3154 htmp->Rebin(rbEta);
3155 htmp->Draw("same HE");
3156 }
3157 }
a6f26052 3158 //ETA vs PHI
54769bc0 3159 cetaphic->cd(3) ;
3160 TH2D* hEtaPhiCl = (TH2D*) fhEtaPhiE->Project3D("xy");
3161 hEtaPhiCl->SetAxisRange(etamin,etamax,"X");
3162 hEtaPhiCl->SetAxisRange(phimin,phimax,"Y");
3163 hEtaPhiCl->Draw("colz");
c8fe2783 3164
54769bc0 3165 snprintf(name,buffersize,"QA_%s_ClusterEtaPhi.eps",fCalorimeter.Data());
3166 cetaphic->Print(name); printf("Create plot %s\n",name);
c8fe2783 3167
a6f26052 3168 //----------------------------------------------------------
3169 // Cell eta and phi distributions, energy cut dependence
3170 //---------------------------------------------------------
255b904d 3171
54769bc0 3172 snprintf(cname,buffersize,"%s_QA_EtaPhiCell",fCalorimeter.Data());
3173 TCanvas * cetaphicell = new TCanvas(cname, "Eta-Phi Cells distributions", 1200, 400) ;
3174 cetaphicell->Divide(3, 1);
3175
a6f26052 3176 //PHI
54769bc0 3177 cetaphicell->cd(1) ;
3178 gPad->SetLogy();
3179 gPad->SetGridy();
3180
3181 TLegend pLegendPhiCell(0.83,0.6,0.95,0.93);
3182 pLegendPhiCell.SetTextSize(0.03);
3183 pLegendPhiCell.SetFillColor(10);
3184 pLegendPhiCell.SetBorderSize(1);
3185
3186 delete htmp;
3187 htmp = fhEtaPhiAmp->ProjectionY("hphi_cell_nocut",0,-1,0,-1);
3188 if(htmp){
3189 htmp->SetMinimum(1);
3190 htmp->Rebin(rbPhi);
3191 htmp->SetTitle("#phi of cells for cell energy > threshold");
3192 htmp->SetAxisRange(phimin,phimax,"X");
3193 htmp->Draw("HE");
3194 pLegendPhiCell.AddEntry(htmp,"No cut","L");
3195
3196 for (Int_t i = 0; i < ncuts; i++) {
3197 binmin = hE->FindBin(ecut[i]);
a6f26052 3198 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3199 htmp = fhEtaPhiAmp->ProjectionY(Form("hphi_cell_cut%d",i),0,-1,binmin,-1);
3200 htmp->SetLineColor(ecutcolor[i]);
3201 htmp->Rebin(rbPhi);
3202 htmp->Draw("same HE");
3203 pLegendPhiCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3204
3205 }
3206 }
3207 pLegendPhiCell.Draw();
3208
a6f26052 3209 //ETA
54769bc0 3210 cetaphicell->cd(2) ;
3211 gPad->SetLogy();
3212 gPad->SetGridy();
3213
3214 delete htmp;
3215 htmp = fhEtaPhiAmp->ProjectionX("heta_cell_nocut",0,-1,0,-1);
3216 if(htmp){
3217 htmp ->SetLineColor(1);
3218 htmp->Rebin(rbEta);
3219 htmp->SetMinimum(1);
3220 htmp->SetTitle("#eta of cells for cell energy > threshold");
3221 htmp->SetAxisRange(etamin,etamax,"X");
3222 htmp->Draw("HE");
3223
3224 for (Int_t i = 0; i < ncuts; i++) {
3225 binmin = hE->FindBin(ecut[i]);
a6f26052 3226 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
54769bc0 3227 htmp = fhEtaPhiAmp->ProjectionX(Form("heta_cell_cut%d",i),0,-1,binmin,-1);
3228 htmp->SetLineColor(ecutcolor[i]);
3229 htmp->Rebin(rbEta);
3230 htmp->Draw("same HE");
3231
3232 }
3233 }
a6f26052 3234 //ETA vs PHI
54769bc0 3235 cetaphicell->cd(3) ;
3236 TH2D* hEtaPhiCell = (TH2D*) fhEtaPhiAmp->Project3D("xy");
3237 hEtaPhiCell->SetAxisRange(etamin,etamax,"X");
3238 hEtaPhiCell->SetAxisRange(phimin,phimax,"Y");
3239 hEtaPhiCell->Draw("colz");
3240
3241 snprintf(name,buffersize,"QA_%s_CellEtaPhi.eps",fCalorimeter.Data());
3242 cetaphicell->Print(name); printf("Create plot %s\n",name);
3243
c8fe2783 3244
a6f26052 3245 ////////////////////////////////////////
3246 ///////// Global Positions /////////////
3247 ////////////////////////////////////////
3248
3249 //CLUSTERS
b8187de4 3250 Int_t rbX = 1;
3251 Int_t rbY = 1;
3252 Int_t rbZ = 1;
4b892846 3253 if(fFillAllPosHisto)
b8187de4 3254 {
164a1d84 3255 snprintf(cname,buffersize,"%s_QA_ClusterXY",fCalorimeter.Data());
a6f26052 3256 TCanvas * cxyz = new TCanvas(cname, "Cluster XY distributions", 1200, 400) ;
3257 cxyz->Divide(3, 1);
3258
3259 cxyz->cd(1) ;
3260 TH2D * hXY = (TH2D*) fhXYZ->Project3D("yx" );
3261 hXY->SetTitle("Cluster X vs Y");
3262 hXY->GetYaxis()->SetTitleOffset(1.6);
3263 hXY->Draw("colz");
3264 cxyz->cd(2) ;
3265 TH2D * hYZ = (TH2D*) fhXYZ->Project3D("yz" );
3266 hYZ->SetTitle("Cluster Z vs Y");
3267 hYZ->GetYaxis()->SetTitleOffset(1.6);
3268 hYZ->Draw("colz");
3269 cxyz->cd(3) ;
3270 TH2D * hXZ = (TH2D*) fhXYZ->Project3D("zx" );
3271 hXZ->SetTitle("Cluster X vs Z");
3272 hXZ->GetYaxis()->SetTitleOffset(1.6);
3273 hXZ->Draw("colz");
3274
164a1d84 3275 snprintf(name,buffersize,"QA_%s_ClusterXY_YZ_XZ.eps",fCalorimeter.Data());
a6f26052 3276 cxyz->Print(name); printf("Create plot %s\n",name);
3277
164a1d84 3278 snprintf(cname,buffersize,"QA_%s_ClusterX",fCalorimeter.Data());
a6f26052 3279 TCanvas * cx = new TCanvas(cname, "Cluster X distributions", 1200, 400) ;
3280 cx->Divide(3, 1);
3281
3282 cx->cd(1) ;
3283 TH1D * hX = (TH1D*) fhXYZ->Project3D("xe" );
c8fe2783 3284 //gPad->SetLogy();
a6f26052 3285 gPad->SetGridy();
3286 hX->SetTitle("Cluster X ");
3287 hX->Draw("HE");
3288 rbX = GetNewRebinForRePlotting(hX, xmin, xmax,xbins) ;
c8fe2783 3289 //printf("new X rb %d\n",rbX);
a6f26052 3290 hX->Rebin(rbX);
3291 hX->SetMinimum(hX->GetMaximum()/2);
3292 hX->SetAxisRange(xmin,xmax);
3293
3294 cx->cd(2) ;
3295 TH1D * hY = (TH1D*) fhXYZ->Project3D("ye" );
c8fe2783 3296 //gPad->SetLogy();
a6f26052 3297 hY->SetTitle("Cluster Y ");
3298 rbY = GetNewRebinForRePlotting(hY, ymin, ymax, ybins) ;
c8fe2783 3299 //printf("new Y rb %d\n",rbY);
a6f26052 3300 hY->Rebin(rbY);
3301 hY->SetMinimum(1);
3302 hY->SetAxisRange(ymin,ymax);
3303 hY->Draw("HE");
3304
3305 cx->cd(3) ;
3306 TH1D * hZ = (TH1D*) fhXYZ->Project3D("ze" );
c8fe2783 3307 //gPad->SetLogy();
a6f26052 3308 gPad->SetGridy();
3309 rbZ = GetNewRebinForRePlotting(hZ,zmin, zmax,zbins) ;
c8fe2783 3310 //printf("new Z rb %d\n",rbZ);
a6f26052 3311 hZ->Rebin(rbZ);
3312 hZ->SetMinimum(hZ->GetMaximum()/2);
3313 hZ->SetAxisRange(zmin,zmax);
3314 hZ->Draw("HE");
3315
164a1d84 3316 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z.eps",fCalorimeter.Data());
a6f26052 3317 cx->Print(name); printf("Create plot %s\n",name);
b8187de4 3318 }
5025c139 3319 //CELLS
b8187de4 3320 if(fFillAllPosHisto)
3321 {
164a1d84 3322 snprintf(cname,buffersize,"%s_QA_CellXY",fCalorimeter.Data());
a6f26052 3323 TCanvas * cellxyz = new TCanvas(cname, "Cell XY distributions", 1200, 400) ;
3324 cellxyz->Divide(3, 1);
3325
3326 cellxyz->cd(1) ;
3327 TH2D * hXYCell = (TH2D*) fhXYZCell->Project3D("yx" );
3328 hXYCell->SetTitle("Cell X vs Y");
3329 hXYCell->GetYaxis()->SetTitleOffset(1.6);
3330 hXYCell->Draw("colz");
3331 cellxyz->cd(2) ;
3332 TH2D * hYZCell = (TH2D*) fhXYZCell->Project3D("yz" );
3333 hYZCell->SetTitle("Cell Z vs Y");
3334 hYZCell->GetYaxis()->SetTitleOffset(1.6);
3335 hYZCell->Draw("colz");
3336 cellxyz->cd(3) ;
3337 TH2D * hXZCell = (TH2D*) fhXYZCell->Project3D("zx" );
3338 hXZCell->SetTitle("Cell X vs Z");
3339 hXZCell->GetYaxis()->SetTitleOffset(1.6);
3340 hXZCell->Draw("colz");
3341
164a1d84 3342 snprintf(name,buffersize,"QA_%s_CellXY_YZ_XZ.eps",fCalorimeter.Data());
a6f26052 3343 cellxyz->Print(name); printf("Create plot %s\n",name);
3344
3345
164a1d84 3346 snprintf(cname,buffersize,"%s_QA_CellX",fCalorimeter.Data());
a6f26052 3347 TCanvas * cellx = new TCanvas(cname, "Cell X distributions", 1200, 400) ;
3348 cellx->Divide(3, 1);
3349
3350 cellx->cd(1) ;
3351 TH1D * hXCell = (TH1D*) fhXYZCell->Project3D("xe" );
c8fe2783 3352 //gPad->SetLogy();
a6f26052 3353 gPad->SetGridy();
3354 hXCell->SetTitle("Cell X ");
3355 hXCell->Rebin(rbX);
3356 hXCell->SetMinimum(hXCell->GetMaximum()/2);
3357 hXCell->SetAxisRange(xmin,xmax);
3358 hXCell->Draw("HE");
3359
3360 cellx->cd(2) ;
3361 TH1D * hYCell = (TH1D*) fhXYZCell->Project3D("ye" );
c8fe2783 3362 //gPad->SetLogy();
a6f26052 3363 hYCell->SetTitle("Cell Y ");
3364 hYCell->Rebin(rbY);
3365 hYCell->SetAxisRange(ymin,ymax);
3366 hYCell->SetMinimum(1);
3367 hYCell->Draw("HE");
3368
3369 cellx->cd(3) ;
3370 TH1D * hZCell = (TH1D*) fhXYZCell->Project3D("ze" );
c8fe2783 3371 //gPad->SetLogy();
a6f26052 3372 gPad->SetGridy();
3373 hZCell->SetAxisRange(zmin,zmax);
3374 hZCell->SetTitle("Cell Z ");
3375 hZCell->Rebin(rbZ);
3376 hZCell->SetMinimum(hZCell->GetMaximum()/2);
3377 hZCell->Draw("HE");
3378
164a1d84 3379 snprintf(name,buffersize,"QA_%s_CellX_Y_Z.eps",fCalorimeter.Data());
a6f26052 3380 cellx->Print(name); printf("Create plot %s\n",name);
3381
3382
c8fe2783 3383 //----------------------------------------------------------
3384 // Cluster X, Y, Z, R, energy cut dependence
3385 //---------------------------------------------------------
a6f26052 3386
164a1d84 3387 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_ECut",fCalorimeter.Data());
a6f26052 3388 TCanvas * cxe = new TCanvas(cname, "Cluster X Y Z R, E cut", 800, 800) ;
3389 cxe->Divide(2, 2);
c8fe2783 3390 //R
a6f26052 3391 cxe->cd(1) ;
3392 gPad->SetLogy();
3393 gPad->SetGridy();
3394
3395 TLegend pLegendXCl(0.83,0.6,0.95,0.93);
3396 pLegendXCl.SetTextSize(0.03);
3397 pLegendXCl.SetFillColor(10);
3398 pLegendXCl.SetBorderSize(1);
3399
5025c139 3400 delete htmp;
a6f26052 3401 htmp = fhRE->ProjectionX("hre_cluster_nocut",0,-1);
3402 Int_t rbR=1;
3403 if(htmp){
3404 htmp->SetMinimum(1);
3405 rbR = GetNewRebinForRePlotting(htmp, rmin, rmax,rbins) ;
c8fe2783 3406 //printf("new R rb %d\n",rbR);
a6f26052 3407 htmp->Rebin(rbR);
3408 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3409 htmp->SetAxisRange(rmin,rmax,"X");
3410 htmp->Draw("HE");
3411 pLegendXCl.AddEntry(htmp,"No cut","L");
3412
3413 for (Int_t i = 0; i < ncuts; i++) {
3414 binmin = hE->FindBin(ecut[i]);
c8fe2783 3415 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3416 htmp = fhRE->ProjectionX(Form("hre_cluster_cut%d",i),binmin,-1);
3417 htmp->SetLineColor(ecutcolor[i]);
3418 htmp->Rebin(rbR);
3419 htmp->Draw("same HE");
3420 pLegendXCl.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3421 }
3422 }
3423 pLegendXCl.Draw();
3424
c8fe2783 3425 //X
a6f26052 3426 cxe->cd(2) ;
3427 gPad->SetLogy();
3428 gPad->SetGridy();
5025c139 3429 delete htmp;
a6f26052 3430 htmp = fhXE->ProjectionX("hxe_cluster_nocut",0,-1);
3431 if(htmp){
3432 htmp->SetMinimum(1);
3433 htmp->Rebin(rbX);
3434 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3435 htmp->SetAxisRange(xmin,xmax,"X");
3436 htmp->Draw("HE");
3437
3438 for (Int_t i = 0; i < ncuts; i++) {
3439 binmin = hE->FindBin(ecut[i]);
c8fe2783 3440 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3441 htmp = fhXE->ProjectionX(Form("hxe_cluster_cut%d",i),binmin,-1);
3442 htmp->SetLineColor(ecutcolor[i]);
3443 htmp->Rebin(rbX);
3444 htmp->Draw("same HE");
3445 }
3446 }
c8fe2783 3447 //Y
a6f26052 3448 cxe->cd(3) ;
3449 gPad->SetLogy();
3450 gPad->SetGridy();
5025c139 3451
3452 delete htmp;
a6f26052 3453 htmp = fhYE->ProjectionX("hye_cluster_nocut",0,-1);
3454 if(htmp){
3455 htmp->SetMinimum(1);
3456 htmp->Rebin(rbY);
3457 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3458 htmp->SetAxisRange(ymin,ymax,"X");
3459 htmp->Draw("HE");
3460
3461 for (Int_t i = 0; i < ncuts; i++) {
3462 binmin = hE->FindBin(ecut[i]);
c8fe2783 3463 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3464 htmp = fhYE->ProjectionX(Form("hye_cluster_cut%d",i),binmin,-1);
3465 htmp->SetLineColor(ecutcolor[i]);
3466 htmp->Rebin(rbY);
3467 htmp->Draw("same HE");
3468 }
3469 }
c8fe2783 3470 //Z
a6f26052 3471 cxe->cd(4) ;
3472 gPad->SetLogy();
3473 gPad->SetGridy();
3474
5025c139 3475 delete htmp;
a6f26052 3476 htmp = fhZE->ProjectionX("hze_cluster_nocut",0,-1);
3477 if(htmp){
3478 htmp->SetMinimum(1);
3479 htmp->Rebin(rbZ);
3480 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3481 htmp->SetAxisRange(zmin,zmax,"X");
3482 htmp->Draw("HE");
3483
3484 for (Int_t i = 0; i < ncuts; i++) {
3485 binmin = hE->FindBin(ecut[i]);
c8fe2783 3486 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3487 htmp = fhZE->ProjectionX(Form("hze_cluster_cut%d",i),binmin,-1);
3488 htmp->SetLineColor(ecutcolor[i]);
3489 htmp->Rebin(rbZ);
3490 htmp->Draw("same HE");
3491 }
3492 }
3493
164a1d84 3494 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_ECut.eps",fCalorimeter.Data());
a6f26052 3495 cxe->Print(name); printf("Create plot %s\n",name);
3496
3497
c8fe2783 3498 //----------------------------------------------------------
3499 // Cluster X, Y, Z, R, NCells in cluster dependence
3500 //---------------------------------------------------------
a6f26052 3501 Int_t ncellcut[]={2, 3, 4};
3502 Int_t ncellcuts = 3;
164a1d84 3503 snprintf(cname,buffersize,"%s_QA_ClusterX_Y_Z_R_NCellsCut",fCalorimeter.Data());
a6f26052 3504 TCanvas * cxn = new TCanvas(cname, "Cluster X Y Z R, NCells cut", 800, 800) ;
3505 cxn->Divide(2, 2);
c8fe2783 3506 //R
a6f26052 3507 cxn->cd(1) ;
3508 gPad->SetLogy();
3509 gPad->SetGridy();
3510
3511 TLegend pLegendXClN(0.83,0.6,0.95,0.93);
3512 pLegendXClN.SetTextSize(0.03);
3513 pLegendXClN.SetFillColor(10);
3514 pLegendXClN.SetBorderSize(1);
3515
5025c139 3516 delete htmp;
a6f26052 3517 htmp = fhRNCells->ProjectionX("hrn_cluster_nocut",0,-1);
3518 if(htmp){
3519 htmp->SetMinimum(1);
3520 htmp->Rebin(rbR);
3521 htmp->SetTitle("r of clusters for energy in cluster > threshold");
3522 htmp->SetAxisRange(rmin,rmax,"X");
3523 htmp->Draw("HE");
3524 pLegendXClN.AddEntry(htmp,"No cut","L");
3525
3526 for (Int_t i = 0; i < ncellcuts; i++) {
3527 if(i < ncellcuts-1) htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3528 else htmp = fhRNCells->ProjectionX(Form("hrn_cluster_cut%d",i),ncellcut[i],-1);
3529 htmp->SetLineColor(ecutcolor[i]);
3530 htmp->Rebin(rbR);
3531 htmp->Draw("same HE");
3532 if(i < ncellcuts-1) pLegendXClN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3533 else pLegendXClN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3534
3535 }
3536 }
3537 pLegendXClN.Draw();
3538
c8fe2783 3539 //X
a6f26052 3540 cxn->cd(2) ;
3541 gPad->SetLogy();
3542 gPad->SetGridy();
5025c139 3543
3544 delete htmp;
a6f26052 3545 htmp = fhXNCells->ProjectionX("hxn_cluster_nocut",0,-1);
3546 if(htmp){
3547 htmp->SetMinimum(1);
3548 htmp->Rebin(rbX);
3549 htmp->SetTitle("x of clusters for energy in cluster > threshold");
3550 htmp->SetAxisRange(xmin,xmax,"X");
3551 htmp->Draw("HE");
3552
3553 for (Int_t i = 0; i < ncellcuts; i++) {
3554 if(i < ncellcuts-1)htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3555 else htmp = fhXNCells->ProjectionX(Form("hxn_cluster_cut%d",i),ncellcut[i],-1);
3556 htmp->SetLineColor(ecutcolor[i]);
3557 htmp->Rebin(rbX);
3558 htmp->Draw("same HE");
3559 }
3560 }
c8fe2783 3561 //Y
a6f26052 3562 cxn->cd(3) ;
3563 gPad->SetLogy();
3564 gPad->SetGridy();
5025c139 3565 delete htmp;
a6f26052 3566 htmp = fhYNCells->ProjectionX("hyn_cluster_nocut",0,-1);
3567 if(htmp){
3568 htmp->SetMinimum(1);
3569 htmp->Rebin(rbY);
3570 htmp->SetTitle("y of clusters for energy in cluster > threshold");
3571 htmp->SetAxisRange(ymin,ymax,"X");
3572 htmp->Draw("HE");
3573
3574 for (Int_t i = 0; i < ncellcuts; i++) {
3575 if(i < ncellcuts-1) htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3576 else htmp = fhYNCells->ProjectionX(Form("hyn_cluster_cut%d",i),ncellcut[i],-1);
3577 htmp->SetLineColor(ecutcolor[i]);
3578 htmp->Rebin(rbY);
3579 htmp->Draw("same HE");
3580 }
3581 }
c8fe2783 3582 //Z
a6f26052 3583 cxn->cd(4) ;
3584 gPad->SetLogy();
3585 gPad->SetGridy();
3586
5025c139 3587 delete htmp;
a6f26052 3588 htmp = fhZNCells->ProjectionX("hzn_cluster_nocut",0,-1);
3589 if(htmp){
3590 htmp->SetMinimum(1);
3591 htmp->Rebin(rbZ);
3592 htmp->SetTitle("z of clusters for energy in cluster > threshold");
3593 htmp->SetAxisRange(zmin,zmax,"X");
3594 htmp->Draw("HE");
3595
3596 for (Int_t i = 0; i < ncellcuts; i++) {
3597 if(i < ncellcuts-1)htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],ncellcut[i]);
3598 else htmp = fhZNCells->ProjectionX(Form("hzn_cluster_cut%d",i),ncellcut[i],-1);
3599 htmp->SetLineColor(ecutcolor[i]);
3600 htmp->Rebin(rbZ);
3601 htmp->Draw("same HE");
3602 }
3603 }
3604
164a1d84 3605 snprintf(name,buffersize,"QA_%s_ClusterX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
a6f26052 3606 cxn->Print(name); printf("Create plot %s\n",name);
3607
3608
c8fe2783 3609 //----------------------------------------------------------
3610 // Cell X, Y, Z, R, energy cut dependence
3611 //---------------------------------------------------------
a6f26052 3612
164a1d84 3613 snprintf(cname,buffersize,"%s_QA_CellX_Y_Z_R_ECut",fCalorimeter.Data());
a6f26052 3614 TCanvas * cxecell = new TCanvas(cname, "Cell X Y Z R, E cut", 800, 800) ;
3615 cxecell->Divide(2, 2);
c8fe2783 3616 //R
a6f26052 3617 cxecell->cd(1) ;
3618 gPad->SetLogy();
3619 gPad->SetGridy();
3620
3621 TLegend pLegendXCell(0.83,0.6,0.95,0.93);
3622 pLegendXCell.SetTextSize(0.03);
3623 pLegendXCell.SetFillColor(10);
3624 pLegendXCell.SetBorderSize(1);
3625
5025c139 3626 delete htmp;
a6f26052 3627 htmp = fhRCellE->ProjectionX("hre_cell_nocut",0,-1);
3628 if(htmp){
3629 htmp->SetMinimum(1);
3630 htmp->Rebin(rbR);
3631 htmp->SetTitle("r of cells for energy in cluster > threshold");
3632 htmp->SetAxisRange(rmin,rmax,"X");
3633 htmp->Draw("HE");
3634 pLegendXCell.AddEntry(htmp,"No cut","L");
3635
3636 for (Int_t i = 0; i < ncuts; i++) {
3637 binmin = hE->FindBin(ecut[i]);
c8fe2783 3638 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3639 htmp = fhRCellE->ProjectionX(Form("hre_celr_cut%d",i),binmin,-1);
3640 htmp->SetLineColor(ecutcolor[i]);
3641 htmp->Rebin(rbR);
3642 htmp->Draw("same HE");
3643 pLegendXCell.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3644 }
3645 }
3646 pLegendXCell.Draw();
3647
c8fe2783 3648 //X
a6f26052 3649 cxecell->cd(2) ;
3650 gPad->SetLogy();
3651 gPad->SetGridy();
3652
5025c139 3653 delete htmp;
a6f26052 3654 htmp = fhXCellE->ProjectionX("hxe_cells_nocut",0,-1);
3655 if(htmp){
3656 htmp->SetMinimum(1);
3657 htmp->Rebin(rbX);
3658 htmp->SetTitle("x of cells for energy in cluster > threshold");
3659 htmp->SetAxisRange(xmin,xmax,"X");
3660 htmp->Draw("HE");
3661
3662 for (Int_t i = 0; i < ncuts; i++) {
3663 binmin = hE->FindBin(ecut[i]);
c8fe2783 3664 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
a6f26052 3665 htmp = fhXCellE->ProjectionX(Form("hxe_cells_cut%d",i),binmin,-1);
3666 htmp->SetLineColor(ecutcolor[i]);
3667 htmp->Rebin(rbX);
3668 htmp->Draw("same HE");
3669 }
3670 }
c8fe2783 3671 //Y
a6f26052 3672 cxecell->cd(3) ;
3673 gPad->SetLogy();
3674 gPad->SetGridy();
5025c139 3675 delete htmp;
a6f26052 3676 htmp = fhYCellE->ProjectionX("hye_cells_nocut",0,-1);
3677 if(htmp){
3678 htmp->SetMinimum(1);
3679 htmp->Rebin(rbY);
3680 htmp->SetTitle("y of cells for energy in cluster > threshold");
3681 htmp->SetAxisRange(ymin,ymax,"X");
3682 htmp->Draw("HE");
3683
3684 for (Int_t i = 0; i < ncuts; i++) {
3685 binmin = hE->FindBin(ecut[i]);
c8fe2783 3686 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3687 delete htmp;
a6f26052 3688 htmp = fhYCellE->ProjectionX(Form("hye_cells_cut%d",i),binmin,-1);
3689 htmp->SetLineColor(ecutcolor[i]);
3690 htmp->Rebin(rbY);
3691 htmp->Draw("same HE");
3692 }
3693 }
c8fe2783 3694 //Z
a6f26052 3695 cxecell->cd(4) ;
3696 gPad->SetLogy();
3697 gPad->SetGridy();
5025c139 3698 delete htmp;
a6f26052 3699 htmp = fhZCellE->ProjectionX("hze_cells_nocut",0,-1);
3700 if(htmp){
3701 htmp->SetMinimum(1);
3702 htmp->Rebin(rbZ);
3703 htmp->SetTitle("z of cells for energy in cluster > threshold");
3704 htmp->SetAxisRange(zmin,zmax,"X");
3705 htmp->Draw("HE");
3706
3707 for (Int_t i = 0; i < ncuts; i++) {
3708 binmin = hE->FindBin(ecut[i]);
c8fe2783 3709 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3710 delete htmp;
a6f26052 3711 htmp = fhZCellE->ProjectionX(Form("hze_cells_cut%d",i),binmin,-1);
3712 htmp->SetLineColor(ecutcolor[i]);
3713 htmp->Rebin(rbZ);
3714 htmp->Draw("same HE");
3715 }
3716 }
164a1d84 3717 snprintf(name,buffersize,"QA_%s_CellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
a6f26052 3718 cxecell->Print(name); printf("Create plot %s\n",name);
3719
3720
c8fe2783 3721 //----------------------------------------------------------
3722 // Cluster-Cell X, Y, Z, R, cluster energy cut dependence
3723 //---------------------------------------------------------
a6f26052 3724 Int_t rbDR= 1;//rbR;
3725 Int_t rbDX= 1;//rbX;
3726 Int_t rbDY= 1;//rbY;
3727 Int_t rbDZ= 1;//rbZ;
3728
164a1d84 3729 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_ECut",fCalorimeter.Data());
a6f26052 3730 TCanvas * cxde = new TCanvas(cname, "Cluster-Cell X, Y, Z, R, E cut", 800, 800) ;
3731 cxde->Divide(2, 2);
c8fe2783 3732 //R
a6f26052 3733 cxde->cd(1) ;
3734 gPad->SetLogy();
3735 gPad->SetGridy();
3736
3737 TLegend pLegendXClD(0.83,0.6,0.95,0.93);
3738 pLegendXClD.SetTextSize(0.03);
3739 pLegendXClD.SetFillColor(10);
3740 pLegendXClD.SetBorderSize(1);
3741
5025c139 3742 delete htmp;
a6f26052 3743 htmp = fhDeltaCellClusterRE->ProjectionX("hrde_nocut",0,-1);
3744 if(htmp){
3745 htmp->SetMinimum(1);
3746 htmp->Rebin(rbDR);
3747 htmp->SetTitle("r clusters - r cells for energy in cluster > threshold");
3748 htmp->SetAxisRange(-50,50,"X");
3749 htmp->Draw("HE");
3750 pLegendXCl.AddEntry(htmp,"No cut","L");
3751
3752 for (Int_t i = 0; i < ncuts; i++) {
3753 binmin = hE->FindBin(ecut[i]);
c8fe2783 3754 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3755 delete htmp;
a6f26052 3756 htmp = fhDeltaCellClusterRE->ProjectionX(Form("hrde_cut%d",i),binmin,-1);
3757 htmp->SetLineColor(ecutcolor[i]);
3758 htmp->Rebin(rbDR);
3759 htmp->Draw("same HE");
3760 pLegendXClD.AddEntry(htmp,Form("E>%1.1f",ecut[i]),"L");
3761 }
3762 }
3763 pLegendXClD.Draw();
3764
c8fe2783 3765 //X
a6f26052 3766 cxde->cd(2) ;
3767 gPad->SetLogy();
3768 gPad->SetGridy();
5025c139 3769 delete htmp;
a6f26052 3770 htmp = fhDeltaCellClusterXE->ProjectionX("hxde_nocut",0,-1);
3771 if(htmp){
3772 htmp->SetMinimum(1);
3773 htmp->Rebin(rbDX);
3774 htmp->SetTitle("x clusters -x cells for energy in cluster > threshold");
3775 htmp->SetAxisRange(-50,50,"X");
3776 htmp->Draw("HE");
3777
3778 for (Int_t i = 0; i < ncuts; i++) {
3779 binmin = hE->FindBin(ecut[i]);
c8fe2783 3780 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3781 delete htmp;
a6f26052 3782 htmp = fhDeltaCellClusterXE->ProjectionX(Form("hxde_cut%d",i),binmin,-1);
3783 htmp->SetLineColor(ecutcolor[i]);
3784 htmp->Rebin(rbDX);
3785 htmp->Draw("same HE");
3786
3787 }
3788 }
c8fe2783 3789 //Y
a6f26052 3790 cxde->cd(3) ;
3791 gPad->SetLogy();
3792 gPad->SetGridy();
5025c139 3793 delete htmp;
a6f26052 3794 htmp = fhDeltaCellClusterYE->ProjectionX("hyde_nocut",0,-1);
3795 if(htmp){
3796 htmp->SetMinimum(1);
3797 htmp->Rebin(rbDY);
3798 htmp->SetTitle("y clusters - ycells for energy in cluster > threshold");
3799 htmp->SetAxisRange(-50,50,"X");
3800 htmp->Draw("HE");
3801
3802 for (Int_t i = 0; i < ncuts; i++) {
3803 binmin = hE->FindBin(ecut[i]);
c8fe2783 3804 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3805 delete htmp;
a6f26052 3806 htmp = fhDeltaCellClusterYE->ProjectionX(Form("hyde_cut%d",i),binmin,-1);
3807 htmp->SetLineColor(ecutcolor[i]);
3808 htmp->Rebin(rbDY);
3809 htmp->Draw("same HE");
3810
3811 }
3812 }
c8fe2783 3813 //Z
a6f26052 3814 cxde->cd(4) ;
3815 gPad->SetLogy();
3816 gPad->SetGridy();
3817
5025c139 3818 delete htmp;
a6f26052 3819 htmp = fhDeltaCellClusterZE->ProjectionX("hzde_nocut",0,-1);
3820 if(htmp){
3821 htmp->SetMinimum(1);
3822 htmp->Rebin(rbZ);
3823 htmp->SetTitle("z clusters - z cells for energy in cluster > threshold");
3824 htmp->SetAxisRange(-50,50,"X");
3825 htmp->Draw("HE");
3826
3827 for (Int_t i = 0; i < ncuts; i++) {
3828 binmin = hE->FindBin(ecut[i]);
c8fe2783 3829 //printf(" bins %d for e %f\n",binmin[i],ecut[i]);
5025c139 3830 delete htmp;
a6f26052 3831 htmp = fhDeltaCellClusterZE->ProjectionX(Form("hzde_cut%d",i),binmin,-1);
3832 htmp->SetLineColor(ecutcolor[i]);
3833 htmp->Rebin(rbZ);
3834 htmp->Draw("same HE");
3835
3836 }
3837 }
3838
164a1d84 3839 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_ECut.eps",fCalorimeter.Data());
a6f26052 3840 cxde->Print(name); printf("Create plot %s\n",name);
3841
3842
c8fe2783 3843 //----------------------------------------------------------
3844 // Cluster-Cell X, Y, Z, R, NCells in cluster dependence
3845 //---------------------------------------------------------
164a1d84 3846 snprintf(cname,buffersize,"%s_QA_DeltaClusterCellX_Y_Z_R_NCellsCut",fCalorimeter.Data());
a6f26052 3847 TCanvas * cxdn = new TCanvas(cname, "Cluster-Cell X Y Z R, NCells cut", 800, 800) ;
3848 cxdn->Divide(2, 2);
c8fe2783 3849 //R
a6f26052 3850 cxdn->cd(1) ;
3851 gPad->SetLogy();
3852 gPad->SetGridy();
3853
3854 TLegend pLegendXClDN(0.83,0.6,0.95,0.93);
3855 pLegendXClDN.SetTextSize(0.03);
3856 pLegendXClDN.SetFillColor(10);
3857 pLegendXClDN.SetBorderSize(1);
5025c139 3858 delete htmp;
a6f26052 3859 htmp = fhDeltaCellClusterRNCells->ProjectionX("hrdn_nocut",0,-1);
3860 if(htmp){
3861 htmp->SetMinimum(1);
3862 htmp->Rebin(rbDR);
3863 htmp->SetTitle("r clusters - r cells for n cells in cluster > threshold");
3864 htmp->SetAxisRange(-50,50,"X");
3865 htmp->Draw("HE");
3866 pLegendXClDN.AddEntry(htmp,"No cut","L");
3867
3868 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 3869 delete htmp;
a6f26052 3870 if(i < ncellcuts-1) htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],ncellcut[i]);
3871 else htmp = fhDeltaCellClusterRNCells->ProjectionX(Form("hrdn_cut%d",i),ncellcut[i],-1);
3872 htmp->SetLineColor(ecutcolor[i]);
3873 htmp->Rebin(rbDR);
3874 htmp->Draw("same HE");
3875 if(i < ncellcuts-1) pLegendXClDN.AddEntry(htmp,Form("n = %1.1d",ncellcut[i]-1),"L");
3876 else pLegendXClDN.AddEntry(htmp,Form("n >= %1.1d",ncellcut[i]-1),"L");
3877
3878 }
3879 }
3880 pLegendXClDN.Draw();
3881
c8fe2783 3882 //X
a6f26052 3883 cxdn->cd(2) ;
3884 gPad->SetLogy();
3885 gPad->SetGridy();
5025c139 3886 delete htmp;
a6f26052 3887 htmp = fhDeltaCellClusterXNCells->ProjectionX("hxdn_nocut",0,-1);
3888 if(htmp){
3889 htmp->SetMinimum(1);
3890 htmp->Rebin(rbDX);
3891 htmp->SetTitle("x clusters - x cells for n cells in cluster > threshold");
3892 htmp->SetAxisRange(-50,50,"X");
3893 htmp->Draw("HE");
3894
3895 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 3896 delete htmp;
a6f26052 3897 if(i < ncellcuts-1)htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],ncellcut[i]);
3898 else htmp = fhDeltaCellClusterXNCells->ProjectionX(Form("hxdn_cut%d",i),ncellcut[i],-1);
3899 htmp->SetLineColor(ecutcolor[i]);
3900 htmp->Rebin(rbDX);
3901 htmp->Draw("same HE");
3902
3903 }
3904 }
c8fe2783 3905 //Y
a6f26052 3906 cxdn->cd(3) ;
3907 gPad->SetLogy();
3908 gPad->SetGridy();
5025c139 3909 delete htmp;
a6f26052 3910 htmp = fhDeltaCellClusterYNCells->ProjectionX("hydn_nocut",0,-1);
3911 if(htmp){
3912 htmp->SetMinimum(1);
3913 htmp->Rebin(rbDY);
3914 htmp->SetTitle("y clusters - y cells for n cells in cluster > threshold");
3915 htmp->SetAxisRange(-50,50,"X");
3916 htmp->Draw("HE");
3917
3918 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 3919 delete htmp;
a6f26052 3920 if(i < ncellcuts-1) htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],ncellcut[i]);
3921 else htmp = fhDeltaCellClusterYNCells->ProjectionX(Form("hydn_cut%d",i),ncellcut[i],-1);
3922 htmp->SetLineColor(ecutcolor[i]);
3923 htmp->Rebin(rbDY);
3924 htmp->Draw("same HE");
3925
3926 }
3927 }
c8fe2783 3928 //Z
a6f26052 3929 cxdn->cd(4) ;
3930 gPad->SetLogy();
3931 gPad->SetGridy();
5025c139 3932 delete htmp;
a6f26052 3933 htmp = fhDeltaCellClusterZNCells->ProjectionX("hzdn_nocut",0,-1);
3934 if(htmp){
3935 htmp->SetMinimum(1);
3936 htmp->Rebin(rbDZ);
3937 htmp->SetTitle("z clusters - z cells for ncells in cluster > threshold");
3938 htmp->SetAxisRange(-50,50,"X");
3939 htmp->Draw("HE");
3940
3941 for (Int_t i = 0; i < ncellcuts; i++) {
5025c139 3942 delete htmp;
a6f26052 3943 if(i < ncellcuts-1)htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],ncellcut[i]);
3944 else htmp = fhDeltaCellClusterZNCells->ProjectionX(Form("hzdn_cut%d",i),ncellcut[i],-1);
3945 htmp->SetLineColor(ecutcolor[i]);
3946 htmp->Rebin(rbDZ);
3947 htmp->Draw("same HE");
3948
3949 }
3950 }
3951
164a1d84 3952 snprintf(name,buffersize,"QA_%s_DeltaClusterCellX_Y_Z_R_NCellsCut.eps",fCalorimeter.Data());
a6f26052 3953 cxdn->Print(name); printf("Create plot %s\n",name);
3954
54769bc0 3955 }
c8fe2783 3956
a6f26052 3957 //----------------------------------------------------------
3958 //Reconstructed clusters energy-eta-phi distributions, matched with tracks
3959 //----------------------------------------------------------
3960 TH1F * hEChargedClone = 0 ;
3961 TH1F * hPtChargedClone = 0 ;
3962 TH1F * hEtaChargedClone = 0 ;
3963 TH1F * hPhiChargedClone = 0 ;
54769bc0 3964 if(fFillAllTH12){
a6f26052 3965 hEChargedClone = (TH1F*) fhECharged->Clone(Form("%sClone",fhECharged->GetName()));
3966 hPtChargedClone = (TH1F*) fhPtCharged->Clone(Form("%sClone",fhPtCharged->GetName()));
3967 hEtaChargedClone = (TH1F*) fhEtaCharged->Clone(Form("%sClone",fhEtaCharged->GetName()));
3968 hPhiChargedClone = (TH1F*) fhPhiCharged->Clone(Form("%sClone",fhPhiCharged->GetName()));
3969
164a1d84 3970 snprintf(cname,buffersize,"QA_%s_rectrackmatch",fCalorimeter.Data());
a6f26052 3971 TCanvas * ccltm = new TCanvas(cname, "Reconstructed clusters E-Phi-Eta, matched with tracks", 1200, 400) ;
3972 ccltm->Divide(3, 1);
3973
3974 ccltm->cd(1) ;
3975 if(fhECharged->GetEntries() > 0) gPad->SetLogy();
3976 fhECharged->Rebin(rbE);
3977 fhECharged->SetAxisRange(ptmin,ptmax,"X");
3978 fhECharged->SetMinimum(1);
3979 fhECharged->Draw();
3980
3981 ccltm->cd(2) ;
3982 if(fhPhiCharged->GetEntries() > 0) gPad->SetLogy();
3983 fhPhiCharged->Rebin(rbPhi);
3984 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
3985 fhPhiCharged->Draw();
3986 fhPhiCharged->Draw();
3987
3988 ccltm->cd(3) ;
3989 if(fhEtaCharged->GetEntries() > 0) gPad->SetLogy();
3990 fhEtaCharged->Rebin(rbEta);
3991 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
3992 fhEtaCharged->Draw();
3993 fhEtaCharged->Draw();
3994
164a1d84 3995 snprintf(name,buffersize,"QA_%s_ClusterEnergyPhiEta_TrackMatched.eps",fCalorimeter.Data());
a6f26052 3996 ccltm->Print(name); printf("Plot: %s\n",name);
3997
c8fe2783 3998 //----------------------------------------------------------
3999 // Ratio of reconstructed clusters energy-eta-phi distributions, matched with tracks over all
4000 //----------------------------------------------------------
a6f26052 4001
164a1d84 4002 snprintf(cname,buffersize,"%s_QA_ChargedRatio",fCalorimeter.Data());
a6f26052 4003 TCanvas * ccharge = new TCanvas(cname, "Charged clusters over all clusters", 1200, 400) ;
4004 ccharge->Divide(3, 1);
4005
4006 ccharge->cd(1) ;
4007 fhECharged->Sumw2();
4008 fhE->Sumw2();
4009 fhECharged->Divide(fhE);
4010 fhECharged->SetAxisRange(ptmin,ptmax,"X");
4011 fhECharged->SetMaximum(0.5);
4012 fhECharged->SetYTitle("track-matched clusters / all clusters");
4013 fhECharged->Draw("HE");
4014
4015 ccharge->cd(2) ;
4016 fhPhiCharged->Sumw2();
4017 fhPhi->Rebin(rbPhi);
4018 fhPhi->Sumw2();
4019 fhPhiCharged->Divide(fhPhi);
4020 fhPhiCharged->SetAxisRange(phimin,phimax,"X");
4021 fhPhiCharged->SetMaximum(0.5);
4022 fhPhiCharged->SetYTitle("track-matched clusters / all clusters");
4023 fhPhiCharged->Draw("HE");
4024
4025 ccharge->cd(3) ;
4026 fhEtaCharged->Sumw2();
4027 fhEta->Rebin(rbEta);
4028 fhEta->Sumw2();
4029 fhEtaCharged->Divide(fhEta);
4030 fhEtaCharged->SetAxisRange(etamin,etamax,"X");
4031 fhEtaCharged->SetMaximum(0.5);
4032 fhEtaCharged->SetYTitle("track-matched clusters / all clusters");
4033 fhEtaCharged->Draw("HE");
4034
164a1d84 4035 snprintf(name,buffersize,"QA_%s_ClustersMatchedToAllRatios.eps",fCalorimeter.Data());
a6f26052 4036 ccharge->Print(name); printf("Create plot %s\n",name);
54769bc0 4037 }
a6f26052 4038 //-------------------------------------------
4039 // N Cells - N Clusters - N Cells per cluster
4040 //-------------------------------------------
54769bc0 4041 snprintf(cname,buffersize,"QA_%s_nclustercells",fCalorimeter.Data());
4042 TCanvas * cN = new TCanvas(cname, " Number of CaloClusters and CaloCells", 800, 1200) ;
4043 cN->Divide(2, 3);
4044
4045 cN->cd(1) ;
4046
4047 TLegend pLegendN(0.7,0.6,0.9,0.8);
4048 pLegendN.SetTextSize(0.03);
4049 pLegendN.AddEntry(fhNClusters,"all modules","L");
4050 pLegendN.SetFillColor(10);
4051 pLegendN.SetBorderSize(1);
4052
4053 if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
4054 gPad->SetLogx();
4055 fhNClusters->SetLineColor(1);
4056
4057 Int_t rbN = 1;
4058 if(fhNClusters->GetNbinsX()> nbins) rbN = fhNClusters->GetNbinsX()/nbins;
4059
4060 fhNClusters->SetAxisRange(nmin,nmax,"X");
4061 fhNClusters->Draw("HE");
4062 for(Int_t imod = 0; imod < fNModules; imod++){
4063 fhNClustersMod[imod]->SetAxisRange(nmin,nmax,"X");
4064 fhNClustersMod[imod]->SetLineColor(modColorIndex[imod]);
4065 fhNClustersMod[imod]->Draw("same");
4066 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
4067 }
4068 pLegendN.Draw();
4069
4070 cN->cd(2) ;
4071 gPad->SetLogx();
4072 for(Int_t imod = 1; imod < fNModules; imod++){
5025c139 4073 delete htmp;
54769bc0 4074 htmp = (TH1D*)fhNClustersMod[imod]->Clone(Form("hNClustersRat%d",imod));
4075 htmp->Divide(fhNClustersMod[0]);
4076 htmp->SetLineColor(modColorIndex[imod]);
4077 if(imod==1){
4078 htmp->SetTitle("Ratio # clusters in module X / module 0");
4079 htmp->SetMaximum(5);
4080 htmp->SetMinimum(0);
4081 htmp->Draw("HE");
4082 }
4083 else
4084 htmp->Draw("same HE");
4085
4086 }
4087
4088 cN->cd(3) ;
4089 if(fhNCells->GetEntries() > 0) gPad->SetLogy();
4090 gPad->SetLogx();
4091 fhNCells->SetLineColor(1);
4092 fhNCells->SetAxisRange(nmin,nmax,"X");
4093 fhNCells->Draw("HE");
4094 for(Int_t imod = 0; imod < fNModules; imod++){
4095 fhNCellsMod[imod]->SetAxisRange(nmin,nmax,"X");
4096 fhNCellsMod[imod]->SetLineColor(modColorIndex[imod]);
4097 fhNCellsMod[imod]->Draw("same HE");
4098 }
4099
4100
4101 cN->cd(4) ;
4102 gPad->SetLogx();
4103 for(Int_t imod = 1; imod < fNModules; imod++){
5025c139 4104 delete htmp;
54769bc0 4105 htmp = (TH1D*)fhNCellsMod[imod]->Clone(Form("hNCellsRat%d",imod));
4106 htmp->Divide(fhNCellsMod[0]);
4107 htmp->SetLineColor(modColorIndex[imod]);
4108 if(imod==1){
4109 htmp->SetTitle("Ratio # cells in module X / module 0");
4110 htmp->SetMaximum(5);
4111 htmp->SetMinimum(0);
4112 htmp->Draw("HE");
4113 }
4114 else
4115 htmp->Draw("same HE");
4116
4117 }
4118
4119 cN->cd(5) ;
4120 if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
4121 gPad->SetLogx();
4122 TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1,-1,-1);
4123 cpc->SetLineColor(1);
4124 cpc->SetTitle("# cells per cluster");
4125 cpc->Draw("HE");
4126 TH1D ** hNCellsCluster1D = new TH1D*[fNModules];
4127
4128 for(Int_t imod = 0; imod < fNModules; imod++){
4129 hNCellsCluster1D[imod] = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
4130 hNCellsCluster1D[imod]->SetLineColor(modColorIndex[imod]);
4131 hNCellsCluster1D[imod]->Draw("same HE");
4132 }
4133
4134
4135 cN->cd(6) ;
4136 gPad->SetLogx();
4137 for(Int_t imod = 1; imod < fNModules; imod++){
5025c139 4138 delete htmp;
54769bc0 4139 htmp = (TH1D*)hNCellsCluster1D[imod]->Clone(Form("hNClustersCells1DRat%d",imod));
4140 htmp->Divide(hNCellsCluster1D[0]);
4141 htmp->SetLineColor(modColorIndex[imod]);
4142 if(imod==1){
4143 htmp->SetTitle("Ratio # cells per cluster in module X / module 0");
a6f26052 4144 //htmp->SetAxisRange(ptmin,ptmax,"X");
54769bc0 4145 htmp->SetMaximum(3.5);
4146 htmp->SetMinimum(0);
4147 htmp->Draw("HE");
4148 }
4149 else
4150 htmp->Draw("same HE");
4151 }
572157db 4152 delete [] hNCellsCluster1D;
54769bc0 4153
4154 snprintf(name,buffersize,"QA_%s_NumberCaloClustersAndCaloCells.eps",fCalorimeter.Data());
4155 cN->Print(name); printf("Print plot %s\n",name);
4156
a6f26052 4157 //----------------------------------------------------
4158 // Cell Time histograms, time only available in ESDs
4159 //----------------------------------------------------
54769bc0 4160 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
c8fe2783 4161
54769bc0 4162 snprintf(cname,buffersize,"QA_%s_cellstime",fCalorimeter.Data());
4163 TCanvas * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
4164 ctime->Divide(3, 1);
4165
4166 Int_t rbTime = 1;
4167 if(fhTime->GetNbinsX()> ntimebins) rbTime = fhTime->GetNbinsX()/ntimebins;
4168
4169 ctime->cd(1) ;
4170 if(fhTime->GetEntries() > 0) gPad->SetLogy();
4171 fhTime->Rebin(rbTime);
4172 fhTime->SetAxisRange(timemin,timemax,"X");
4173 fhTime->Draw();
4174
4175 ctime->cd(2) ;
4176 fhTimeId->SetTitleOffset(1.8,"Y");
4177 fhTimeId->SetAxisRange(timemin,timemax,"X");
4178 fhTimeId->Draw("colz");
4179
4180 ctime->cd(3) ;
4181 fhTimeAmp->SetTitle("Cell Energy vs Cell Time");
4182 fhTimeAmp->SetTitleOffset(1.8,"Y");
4183 fhTimeAmp->SetAxisRange(timemin,timemax,"Y");
4184 fhTimeAmp->SetAxisRange(ptmin,ptmax,"X");
4185 fhTimeAmp->Draw("colz");
4186
4187 snprintf(name,buffersize,"QA_%s_CellsTime.eps",fCalorimeter.Data());
4188 ctime->Print(name); printf("Plot: %s\n",name);
4189 }
4190
4191
a6f26052 4192 //---------------------------------
4193 //Grid of cell per module plots
4194 //---------------------------------
54769bc0 4195 {
a6f26052 4196 //Number of entries per cell
c8fe2783 4197 gStyle->SetPadRightMargin(0.15);
164a1d84 4198 snprintf(cname,buffersize,"%s_QA_GridCellEntries",fCalorimeter.Data());
c8fe2783 4199 TCanvas *cgrid = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
4200 if(fNModules%2 == 0)
4201 cgrid->Divide(fNModules/2,2);
4202 else
4203 cgrid->Divide(fNModules/2+1,2);
4204
4205 for(Int_t imod = 0; imod < fNModules ; imod++){
4206 cgrid->cd(imod+1);
4207 gPad->SetLogz();
4208 gPad->SetGridy();
4209 gPad->SetGridx();
a6f26052 4210 //fhGridCellsMod[imod]->GetYAxis()->SetTitleColor(1);
c8fe2783 4211 fhGridCellsMod[imod]->SetZTitle("Counts ");
4212 fhGridCellsMod[imod]->SetYTitle("row (phi direction) ");
a6f26052 4213 //fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4214 fhGridCellsMod[imod]->Draw("colz");
4215 }
164a1d84 4216 snprintf(name,buffersize,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
c8fe2783 4217 cgrid->Print(name); printf("Create plot %s\n",name);
4218
164a1d84 4219 snprintf(cname,buffersize,"%s_QA_GridCellAccumEnergy",fCalorimeter.Data());
c8fe2783 4220 TCanvas *cgridE = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
4221 if(fNModules%2 == 0)
4222 cgridE->Divide(fNModules/2,2);
4223 else
4224 cgridE->Divide(fNModules/2+1,2);
4225 for(Int_t imod = 0; imod < fNModules ; imod++){
4226 cgridE->cd(imod+1);
4227 gPad->SetLogz();
4228 gPad->SetGridy();
4229 gPad->SetGridx();
a6f26052 4230 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4231 fhGridCellsEMod[imod]->SetZTitle("Accumulated Energy (GeV) ");
4232 fhGridCellsEMod[imod]->SetYTitle("row (phi direction) ");
4233 fhGridCellsEMod[imod]->Draw("colz");
4234 }
164a1d84 4235 snprintf(name,buffersize,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
c8fe2783 4236 cgridE->Print(name); printf("Create plot %s\n",name);
4237
a6f26052 4238 //Accumulated energy per cell
164a1d84 4239 snprintf(cname,buffersize,"%s_QA_GridCellAverageEnergy",fCalorimeter.Data());
c8fe2783 4240 TCanvas *cgridEA = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
4241 if(fNModules%2 == 0)
4242 cgridEA->Divide(fNModules/2,2);
4243 else
4244 cgridEA->Divide(fNModules/2+1,2);
4245 for(Int_t imod = 0; imod < fNModules ; imod++){
4246 cgridEA->cd(imod+1);
4247 gPad->SetLogz();
4248 gPad->SetGridy();
4249 gPad->SetGridx();
a6f26052 4250 //fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4251 fhGridCellsEMod[imod]->SetZTitle("Average Energy (GeV) ");
4252 fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
4253 fhGridCellsEMod[imod]->Draw("colz");
4254 }
164a1d84 4255 snprintf(name,buffersize,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
c8fe2783 4256 cgridEA->Print(name); printf("Create plot %s\n",name);
4257
a6f26052 4258 //Accumulated Time per cell, E > 0.5 GeV
c8fe2783 4259
164a1d84 4260 snprintf(cname,buffersize,"%s_QA_GridCellAccumTime",fCalorimeter.Data());
c8fe2783 4261 TCanvas *cgridT = new TCanvas("cgridT","Summed time per cell", 12,12,800,400);
4262 if(fNModules%2 == 0)
4263 cgridT->Divide(fNModules/2,2);
4264 else
4265 cgridE->Divide(fNModules/2+1,2);
4266 for(Int_t imod = 0; imod < fNModules ; imod++){
4267 cgridT->cd(imod+1);
4268 gPad->SetLogz();
4269 gPad->SetGridy();
4270 gPad->SetGridx();
a6f26052 4271 //fhGridCellsTimeMod[imod]->SetLabelSize(0.025,"z");
c8fe2783 4272 fhGridCellsTimeMod[imod]->SetZTitle("Accumulated Time (ns) ");
4273 fhGridCellsTimeMod[imod]->SetYTitle("row (phi direction) ");
4274 fhGridCellsTimeMod[imod]->Draw("colz");
4275 }
164a1d84 4276 snprintf(name,buffersize,"QA_%s_GridCellsAccumTime.eps",fCalorimeter.Data());
c8fe2783 4277 cgridT->Print(name); printf("Create plot %s\n",name);
255b904d 4278
54769bc0 4279 }
4280
a6f26052 4281 //---------------------------------------------
4282 //Calorimeter Correlation, PHOS vs EMCAL
4283 //---------------------------------------------
798a9b04 4284 if(fCorrelate){
54769bc0 4285
4286 snprintf(cname,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
4287 TCanvas * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
4288 ccorr->Divide(2, 2);
c8fe2783 4289
54769bc0 4290 ccorr->cd(1) ;
a6f26052 4291 //gPad->SetLogy();
4292 //gPad->SetLogx();
54769bc0 4293 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"X");
4294 fhCaloCorrNClusters->SetAxisRange(nmin,nmax,"Y");
4295 fhCaloCorrNClusters ->Draw();
c8fe2783 4296
54769bc0 4297 ccorr->cd(2) ;
a6f26052 4298 //gPad->SetLogy();
4299 //gPad->SetLogx();
54769bc0 4300 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"X");
4301 fhCaloCorrNCells->SetAxisRange(nmin,nmax,"Y");
4302 fhCaloCorrNCells->Draw();
c8fe2783 4303
a6f26052 4304 //gPad->SetLogy();
4305 //gPad->SetLogx();
54769bc0 4306 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"X");
4307 fhCaloCorrEClusters->SetAxisRange(ptmin,ptmax,"Y");
4308 fhCaloCorrEClusters->Draw();
c8fe2783 4309
54769bc0 4310 ccorr->cd(4) ;
a6f26052 4311 //gPad->SetLogy();
4312 //gPad->SetLogx();
54769bc0 4313 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"X");
4314 fhCaloCorrECells->SetAxisRange(ptmin,ptmax,"Y");
4315 fhCaloCorrECells->Draw();
c8fe2783 4316
54769bc0 4317 snprintf(name,buffersize,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
4318 ccorr->Print(name); printf("Plot: %s\n",name);
4319 }
c8fe2783 4320
a6f26052 4321 //----------------------------
4322 //Invariant mass
4323 //-----------------------------
255b904d 4324
54769bc0 4325 Int_t imbinmin = -1;
4326 Int_t imbinmax = -1;
4327
4328 if(fhIM->GetEntries() > 1){
4329 Int_t nebins = fhIM->GetNbinsX();
4330 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
4331 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
4332 if (emin != 0 ) printf("emin != 0 \n");
a6f26052 4333 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
54769bc0 4334
4335 snprintf(cname,buffersize,"QA_%s_IM",fCalorimeter.Data());
a6f26052 4336 // printf("c5\n");
54769bc0 4337 TCanvas * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
4338 c5->Divide(2, 3);
4339
4340 c5->cd(1) ;
a6f26052 4341 //fhIM->SetLineColor(4);
4342 //fhIM->Draw();
54769bc0 4343 imbinmin = 0;
4344 imbinmax = (Int_t) (1-emin)*nebins/emax;
4345 TH1D *pyim1 = fhIM->ProjectionY(Form("%s_py1",fhIM->GetName()),imbinmin,imbinmax);
4346 pyim1->SetTitle("E_{pair} < 1 GeV");
4347 pyim1->SetLineColor(1);
4348 pyim1->Draw();
4349 TLegend pLegendIM(0.7,0.6,0.9,0.8);
4350 pLegendIM.SetTextSize(0.03);
4351 pLegendIM.AddEntry(pyim1,"all modules","L");
4352 pLegendIM.SetFillColor(10);
4353 pLegendIM.SetBorderSize(1);
a6f26052 4354 //FIXME
54769bc0 4355 for(Int_t imod = 0; imod < fNModules; imod++){
4356 pyim1 = fhIMMod[imod]->ProjectionY(Form("%s_py1",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4357 pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
4358 pyim1->SetLineColor(imod+1);
4359 pyim1->Draw("same");
4360 }
4361 pLegendIM.Draw();
4362
4363 c5->cd(2) ;
4364 imbinmin = (Int_t) (1-emin)*nebins/emax;
4365 imbinmax = (Int_t) (2-emin)*nebins/emax;
4366 TH1D *pyim2 = fhIM->ProjectionY(Form("%s_py2",fhIM->GetName()),imbinmin,imbinmax);
4367 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
4368 pyim2->SetLineColor(1);
4369 pyim2->Draw();
4370 for(Int_t imod = 0; imod < fNModules; imod++){
4371 pyim2 = fhIMMod[imod]->ProjectionY(Form("%s_py2",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4372 pyim2->SetLineColor(imod+1);
4373 pyim2->Draw("same");
4374 }
4375
4376 c5->cd(3) ;
4377 imbinmin = (Int_t) (2-emin)*nebins/emax;
4378 imbinmax = (Int_t) (3-emin)*nebins/emax;
4379 TH1D *pyim3 = fhIM->ProjectionY(Form("%s_py3",fhIM->GetName()),imbinmin,imbinmax);
4380 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
4381 pyim3->SetLineColor(1);
4382 pyim3->Draw();
4383 for(Int_t imod = 0; imod < fNModules; imod++){
4384 pyim3 = fhIMMod[imod]->ProjectionY(Form("%s_py3",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4385 pyim3->SetLineColor(imod+1);
4386 pyim3->Draw("same");
4387 }
4388
4389 c5->cd(4) ;
4390 imbinmin = (Int_t) (3-emin)*nebins/emax;
4391 imbinmax = (Int_t) (4-emin)*nebins/emax;
4392 TH1D *pyim4 = fhIM->ProjectionY(Form("%s_py4",fhIM->GetName()),imbinmin,imbinmax);
4393 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
4394 pyim4->SetLineColor(1);
4395 pyim4->Draw();
4396 for(Int_t imod = 0; imod < fNModules; imod++){
4397 pyim4 = fhIMMod[imod]->ProjectionY(Form("%s_py4",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4398 pyim4->SetLineColor(imod+1);
4399 pyim4->Draw("same");
4400 }
4401
4402 c5->cd(5) ;
4403 imbinmin = (Int_t) (4-emin)*nebins/emax;
4404 imbinmax = (Int_t) (5-emin)*nebins/emax;
4405 TH1D *pyim5 = fhIM->ProjectionY(Form("%s_py5",fhIM->GetName()),imbinmin,imbinmax);
4406 pyim5->SetTitle("4< E_{pair} < 5 GeV");
4407 pyim5->SetLineColor(1);
4408 pyim5->Draw();
4409 for(Int_t imod = 0; imod < fNModules; imod++){
4410 pyim5 = fhIMMod[imod]->ProjectionY(Form("%s_py5",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4411 pyim5->SetLineColor(imod+1);
4412 pyim5->Draw("same");
4413 }
4414
4415 c5->cd(6) ;
4416 imbinmin = (Int_t) (5-emin)*nebins/emax;
4417 imbinmax = -1;
4418 TH1D *pyim10 = fhIM->ProjectionY(Form("%s_py6",fhIM->GetName()),imbinmin,imbinmax);
4419 pyim10->SetTitle("E_{pair} > 5 GeV");
4420 pyim10->SetLineColor(1);
4421 pyim10->Draw();
4422 for(Int_t imod = 0; imod < fNModules; imod++){
4423 pyim10 = fhIMMod[imod]->ProjectionY(Form("%s_py6",fhIMMod[imod]->GetName()),imbinmin,imbinmax);
4424 pyim10->SetLineColor(imod+1);
4425 pyim10->Draw("same");
4426 }
4427
4428 snprintf(name,buffersize,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
4429 c5->Print(name); printf("Plot: %s\n",name);
4430 }
4431
a6f26052 4432 //--------------------------------------------------
4433 //Invariant mass, clusters with more than one cell
4434 //-------------------------------------------------
54769bc0 4435 if(fhIMCellCut->GetEntries() > 1){
4436 Int_t nebins = fhIMCellCut->GetNbinsX();
4437 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
4438 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
4439 if (emin != 0 ) printf("emin != 0 \n");
a6f26052 4440 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
a5fafd85 4441
54769bc0 4442 snprintf(cname,buffersize,"QA_%s_IMCellCut",fCalorimeter.Data());
a6f26052 4443 // printf("c5cc\n");
54769bc0 4444 TCanvas * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
4445 c5cc->Divide(2, 3);
4446
4447 c5cc->cd(1) ;
a6f26052 4448 //fhIMCellCut->SetLineColor(4);
4449 //fhIMCellCut->Draw();
54769bc0 4450 imbinmin = 0;
4451 imbinmax = (Int_t) (1-emin)*nebins/emax;
4452 TH1D *pyimcc1 = fhIMCellCut->ProjectionY(Form("%s_py1",fhIMCellCut->GetName()),imbinmin,imbinmax);
4453 pyimcc1->SetTitle("E_{pair} < 1 GeV");
4454 pyimcc1->SetLineColor(1);
4455 pyimcc1->Draw();
4456 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
4457 pLegendIMCellCut.SetTextSize(0.03);
4458 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
4459 pLegendIMCellCut.SetFillColor(10);
4460 pLegendIMCellCut.SetBorderSize(1);
4461
4462 for(Int_t imod = 0; imod < fNModules; imod++){
4463 pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4464 pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
4465 pyimcc1->SetLineColor(imod+1);
4466 pyimcc1->Draw("same");
4467 }
4468 pLegendIMCellCut.Draw();
4469
4470 c5cc->cd(2) ;
4471 imbinmin = (Int_t) (1-emin)*nebins/emax;
4472 imbinmax = (Int_t) (2-emin)*nebins/emax;
4473 TH1D *pyimcc2 = fhIMCellCut->ProjectionY(Form("%s_py2",fhIMCellCut->GetName()),imbinmin,imbinmax);
4474 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
4475 pyimcc2->SetLineColor(1);
4476 pyimcc2->Draw();
4477 for(Int_t imod = 0; imod < fNModules; imod++){
4478 pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4479 pyimcc2->SetLineColor(imod+1);
4480 pyimcc2->Draw("same");
4481 }
4482
4483 c5cc->cd(3) ;
4484 imbinmin = (Int_t) (2-emin)*nebins/emax;
4485 imbinmax = (Int_t) (3-emin)*nebins/emax;
4486 TH1D *pyimcc3 = fhIMCellCut->ProjectionY(Form("%s_py3",fhIMCellCut->GetName()),imbinmin,imbinmax);
4487 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
4488 pyimcc3->SetLineColor(1);
4489 pyimcc3->Draw();
4490 for(Int_t imod = 0; imod < fNModules; imod++){
4491 pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4492 pyimcc3->SetLineColor(imod+1);
4493 pyimcc3->Draw("same");
4494 }
4495
4496 c5cc->cd(4) ;
4497 imbinmin = (Int_t) (3-emin)*nebins/emax;
4498 imbinmax = (Int_t) (4-emin)*nebins/emax;
4499 TH1D *pyimcc4 = fhIMCellCut->ProjectionY(Form("%s_py4",fhIMCellCut->GetName()),imbinmin,imbinmax);
4500 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
4501 pyimcc4->SetLineColor(1);
4502 pyimcc4->Draw();
4503 for(Int_t imod = 0; imod < fNModules; imod++){
4504 pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4505 pyimcc4->SetLineColor(imod+1);
4506 pyimcc4->Draw("same");
4507 }
4508
4509 c5cc->cd(5) ;
4510 imbinmin = (Int_t) (4-emin)*nebins/emax;
4511 imbinmax = (Int_t) (5-emin)*nebins/emax;
4512 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY(Form("%s_py5",fhIMCellCut->GetName()),imbinmin,imbinmax);
4513 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
4514 pyimcc5cc->SetLineColor(1);
4515 pyimcc5cc->Draw();
4516 for(Int_t imod = 0; imod < fNModules; imod++){
4517 pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py5",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4518 pyimcc5cc->SetLineColor(imod+1);
4519 pyimcc5cc->Draw("same");
4520 }
4521
4522 c5cc->cd(6) ;
4523 imbinmin = (Int_t) (5-emin)*nebins/emax;
4524 imbinmax = -1;
4525 TH1D *pyimcc10 = fhIMCellCut->ProjectionY(Form("%s_py6",fhIMCellCut->GetName()),imbinmin,imbinmax);
4526 pyimcc10->SetTitle("E_{pair} > 5 GeV");
4527 pyimcc10->SetLineColor(1);
4528 pyimcc10->Draw();
4529 for(Int_t imod = 0; imod < fNModules; imod++){
4530 pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("%s_py1",fhIMCellCutMod[imod]->GetName()),imbinmin,imbinmax);
4531 pyimcc10->SetLineColor(imod+1);
4532 pyimcc10->Draw("same");
4533 }
4534
4535 snprintf(name,buffersize,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
4536 c5cc->Print(name); printf("Plot: %s\n",name);
4537 }
4538
4539
a6f26052 4540 //Asymmetry
54769bc0 4541 if(fhAsym->GetEntries() > 1){
4542 Int_t nebins = fhAsym->GetNbinsX();
4543 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
4544 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
4545 if (emin != 0 ) printf("emin != 0 \n");
a6f26052 4546 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
54769bc0 4547
4548 snprintf(cname,buffersize,"QA_%s_Asym",fCalorimeter.Data());
a6f26052 4549 // printf("c5\n");
54769bc0 4550 TCanvas * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
4551 c5b->Divide(2, 2);
4552
4553 c5b->cd(1) ;
4554 fhAsym->SetTitleOffset(1.6,"Y");
4555 fhAsym->SetLineColor(4);
4556 fhAsym->Draw();
4557
4558 c5b->cd(2) ;
4559 imbinmin = 0;
4560 imbinmax = (Int_t) (5-emin)*nebins/emax;
4561 TH1D *pyAsym5 = fhAsym->ProjectionY(Form("%s_py5",fhAsym->GetName()),imbinmin,imbinmax);
4562 pyAsym5->SetTitle("E_{pair} < 5 GeV");
4563 pyAsym5->SetLineColor(4);
4564 pyAsym5->Draw();
4565
4566 c5b->cd(3) ;
4567 imbinmin = (Int_t) (5-emin)*nebins/emax;
4568 imbinmax = (Int_t) (10-emin)*nebins/emax;
4569 TH1D *pyAsym510 = fhAsym->ProjectionY(Form("%s_py510",fhAsym->GetName()),imbinmin,imbinmax);
4570 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
4571 pyAsym510->SetLineColor(4);
4572 pyAsym510->Draw();
4573
4574 c5b->cd(4) ;
4575 imbinmin = (Int_t) (10-emin)*nebins/emax;
4576 imbinmax = -1;
4577 TH1D *pyAsym10 = fhAsym->ProjectionY(Form("%s_py10",fhAsym->GetName()),imbinmin,imbinmax);
4578 pyAsym10->SetTitle("E_{pair} > 10 GeV");
4579 pyAsym10->SetLineColor(4);
4580 pyAsym10->Draw();
4581
4582 snprintf(name,buffersize,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
4583 c5b->Print(name); printf("Plot: %s\n",name);
4584 }
4585
4586
4587 if(IsDataMC()){
a6f26052 4588 //Reconstructed vs MC distributions
4589 //printf("c6\n");
164a1d84 4590 snprintf(cname,buffersize,"QA_%s_recvsmc",fCalorimeter.Data());
c8fe2783 4591 TCanvas * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4592 c6->Divide(2, 2);
4593
4594 c6->cd(1) ;
4595 fh2E->SetTitleOffset(1.6,"Y");
4596 fh2E->SetLineColor(4);
4597 fh2E->Draw();
4598
4599 c6->cd(2) ;
4600 fh2Pt->SetTitleOffset(1.6,"Y");
4601 fh2Pt->SetLineColor(4);
4602 fh2Pt->Draw();
4603
4604 c6->cd(3) ;
4605 fh2Phi->SetTitleOffset(1.6,"Y");
4606 fh2Phi->SetLineColor(4);
4607 fh2Phi->Draw();
4608
4609 c6->cd(4) ;
4610 fh2Eta->SetTitleOffset(1.6,"Y");
4611 fh2Eta->SetLineColor(4);
4612 fh2Eta->Draw();
4613
164a1d84 4614 snprintf(name,buffersize,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
c8fe2783 4615 c6->Print(name); printf("Plot: %s\n",name);
4616
a6f26052 4617 //Reconstructed vs MC distributions
4618 //printf("c6\n");
164a1d84 4619 snprintf(cname,buffersize,"QA_%s_gamrecvsmc",fCalorimeter.Data());
c8fe2783 4620 TCanvas * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
4621 c6Gam->Divide(2, 2);
4622
4623 c6Gam->cd(1) ;
4624 fhGamE->Draw();
4625
4626 c6Gam->cd(2) ;
4627 fhGamPt->Draw();
4628
4629 c6Gam->cd(3) ;
4630 fhGamPhi->Draw();
4631
4632 c6Gam->cd(4) ;
4633 fhGamEta->Draw();
4634
164a1d84 4635 snprintf(name,buffersize,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
c8fe2783 4636 c6->Print(name); printf("Plot: %s\n",name);
4637
a6f26052 4638 //Generated - reconstructed
4639 //printf("c7\n");
164a1d84 4640 snprintf(cname,buffersize,"QA_%s_diffgenrec",fCalorimeter.Data());
c8fe2783 4641 TCanvas * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
4642 c7->Divide(2, 2);
4643
4644 c7->cd(1) ;
4645 if(fhDeltaE->GetEntries() > 0) gPad->SetLogy();
4646 fhGamDeltaE->SetLineColor(4);
4647 fhDeltaE->Draw();
4648 fhGamDeltaE->Draw("same");
4649
4650 TLegend pLegendd(0.65,0.55,0.9,0.8);
4651 pLegendd.SetTextSize(0.06);
4652 pLegendd.AddEntry(fhDeltaE,"all","L");
4653 pLegendd.AddEntry(fhGamDeltaE,"from #gamma","L");
4654 pLegendd.SetFillColor(10);
4655 pLegendd.SetBorderSize(1);
4656 pLegendd.Draw();
4657
4658 c7->cd(2) ;
4659 if(fhDeltaPt->GetEntries() > 0) gPad->SetLogy();
4660 fhGamDeltaPt->SetLineColor(4);
4661 fhDeltaPt->Draw();
4662 fhGamDeltaPt->Draw("same");
4663
4664 c7->cd(3) ;
4665 fhGamDeltaPhi->SetLineColor(4);
4666 fhDeltaPhi->Draw();
4667 fhGamDeltaPhi->Draw("same");
4668
4669 c7->cd(4) ;
4670 fhGamDeltaEta->SetLineColor(4);
4671 fhDeltaEta->Draw();
4672 fhGamDeltaEta->Draw("same");
4673
164a1d84 4674 snprintf(name,buffersize,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
c8fe2783 4675 c7->Print(name); printf("Plot: %s\n",name);
4676
a6f26052 4677 // Reconstructed / Generated
4678 //printf("c8\n");
164a1d84 4679 snprintf(cname,buffersize,"QA_%s_ratiorecgen",fCalorimeter.Data());
c8fe2783 4680 TCanvas * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
4681 c8->Divide(2, 2);
4682
4683 c8->cd(1) ;
4684 if(fhRatioE->GetEntries() > 0) gPad->SetLogy();
4685 fhGamRatioE->SetLineColor(4);
4686 fhRatioE->Draw();
4687 fhGamRatioE->Draw("same");
4688
4689 TLegend pLegendr(0.65,0.55,0.9,0.8);
4690 pLegendr.SetTextSize(0.06);
4691 pLegendr.AddEntry(fhRatioE,"all","L");
4692 pLegendr.AddEntry(fhGamRatioE,"from #gamma","L");
4693 pLegendr.SetFillColor(10);
4694 pLegendr.SetBorderSize(1);
4695 pLegendr.Draw();
4696
4697 c8->cd(2) ;
4698 if(fhRatioPt->GetEntries() > 0) gPad->SetLogy();
4699 fhGamRatioPt->SetLineColor(4);
4700 fhRatioPt->Draw();
4701 fhGamRatioPt->Draw("same");
4702
4703 c8->cd(3) ;
4704 fhGamRatioPhi->SetLineColor(4);
4705 fhRatioPhi->Draw();
4706 fhGamRatioPhi->Draw("same");
4707
4708 c8->cd(4) ;
4709 fhGamRatioEta->SetLineColor(4);
4710 fhRatioEta->Draw();
4711 fhGamRatioEta->Draw("same");
4712
164a1d84 4713 snprintf(name,buffersize,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
c8fe2783 4714 c8->Print(name); printf("Plot: %s\n",name);
4715
a6f26052 4716 //MC
c8fe2783 4717
a6f26052 4718 //Generated distributions
4719 //printf("c1\n");
164a1d84 4720 snprintf(cname,buffersize,"QA_%s_gen",fCalorimeter.Data());
c8fe2783 4721 TCanvas * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
4722 c10->Divide(3, 1);
4723
4724 c10->cd(1) ;
4725 gPad->SetLogy();
4726 TH1F * haxispt = (TH1F*) fhGenPi0Pt->Clone(Form("%s_axispt",fhGenPi0Pt->GetName()));
4727 haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
4728 fhGenPi0Pt->SetLineColor(1);
4729 fhGenGamPt->SetLineColor(4);
4730 fhGenEtaPt->SetLineColor(2);
4731 fhGenOmegaPt->SetLineColor(7);
4732 fhGenElePt->SetLineColor(6);
4733
a6f26052 4734 //Select the maximum of the histogram to show all lines.
c8fe2783 4735 if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4736 fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
4737 haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
4738 else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4739 fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
4740 haxispt->SetMaximum(fhGenGamPt->GetMaximum());
4741 else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() &&
4742 fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4743 haxispt->SetMaximum(fhGenEtaPt->GetMaximum());
4744 else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4745 fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
4746 haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
4747 else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() &&
4748 fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
4749 haxispt->SetMaximum(fhGenElePt->GetMaximum());
4750 haxispt->SetMinimum(1);
4751 haxispt->Draw("axis");
4752 fhGenPi0Pt->Draw("same");
4753 fhGenGamPt->Draw("same");
4754 fhGenEtaPt->Draw("same");
4755 fhGenOmegaPt->Draw("same");
4756 fhGenElePt->Draw("same");
4757
4758 TLegend pLegend(0.85,0.65,0.95,0.93);
4759 pLegend.SetTextSize(0.06);
4760 pLegend.AddEntry(fhGenPi0Pt," #pi^{0}","L");
4761 pLegend.AddEntry(fhGenGamPt," #gamma","L");
4762 pLegend.AddEntry(fhGenEtaPt," #eta","L");
4763 pLegend.AddEntry(fhGenOmegaPt," #omega","L");
4764 pLegend.AddEntry(fhGenElePt," e^{#pm}","L");
4765 pLegend.SetFillColor(10);
4766 pLegend.SetBorderSize(1);
4767 pLegend.Draw();
4768
4769 c10->cd(2) ;
4770 gPad->SetLogy();
4771 TH1F * haxiseta = (TH1F*) fhGenPi0Eta->Clone(Form("%s_axiseta",fhGenPi0Eta->GetName()));
4772 haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
4773 fhGenPi0Eta->SetLineColor(1);
4774 fhGenGamEta->SetLineColor(4);
4775 fhGenEtaEta->SetLineColor(2);
4776 fhGenOmegaEta->SetLineColor(7);
4777 fhGenEleEta->SetLineColor(6);
a6f26052 4778 //Select the maximum of the histogram to show all lines.
c8fe2783 4779 if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4780 fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
4781 haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
4782 else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4783 fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4784 haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
4785 else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() &&
4786 fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4787 haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());
4788 else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4789 fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
4790 haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
4791 else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() &&
4792 fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
4793 haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
4794 haxiseta->SetMinimum(100);
4795 haxiseta->Draw("axis");
4796 fhGenPi0Eta->Draw("same");
4797 fhGenGamEta->Draw("same");
4798 fhGenEtaEta->Draw("same");
4799 fhGenOmegaEta->Draw("same");
4800 fhGenEleEta->Draw("same");
4801
4802
4803 c10->cd(3) ;
4804 gPad->SetLogy();
4805 TH1F * haxisphi = (TH1F*) fhGenPi0Phi->Clone(Form("%s_axisphi",fhGenPi0Phi->GetName()));
4806 haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
4807 fhGenPi0Phi->SetLineColor(1);
4808 fhGenGamPhi->SetLineColor(4);
4809 fhGenEtaPhi->SetLineColor(2);
4810 fhGenOmegaPhi->SetLineColor(7);
4811 fhGenElePhi->SetLineColor(6);
a6f26052 4812 //Select the maximum of the histogram to show all lines.
c8fe2783 4813 if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4814 fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
4815 haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
4816 else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4817 fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4818 haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
4819 else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() &&
4820 fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4821 haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());
4822 else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4823 fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
4824 haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
4825 else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() &&
4826 fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
4827 haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
4828 haxisphi->SetMinimum(100);
4829 haxisphi->Draw("axis");
4830 fhGenPi0Phi->Draw("same");
4831 fhGenGamPhi->Draw("same");
4832 fhGenEtaPhi->Draw("same");
4833 fhGenOmegaPhi->Draw("same");
4834 fhGenElePhi->Draw("same");
4835
164a1d84 4836 snprintf(name,buffersize,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
c8fe2783 4837 c10->Print(name); printf("Plot: %s\n",name);
4838
4839
a6f26052 4840 //Reconstructed clusters depending on its original particle.
4841 //printf("c1\n");
164a1d84 4842 snprintf(cname,buffersize,"QA_%s_recgenid",fCalorimeter.Data());
c8fe2783 4843 TCanvas * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
4844 c11->Divide(2, 2);
4845
4846
4847 c11->cd(1) ;
4848 gPad->SetLogy();
4849 TH1F * hGamE = (TH1F*) fhGamE->ProjectionX(Form("%s_px",fhGamE->GetName()),-1,-1);
4850 TH1F * hPi0E = (TH1F*) fhPi0E->ProjectionX(Form("%s_px",fhPi0E->GetName()),-1,-1);
4851 TH1F * hEleE = (TH1F*) fhEleE->ProjectionX(Form("%s_px",fhEleE->GetName()),-1,-1);
4852 TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX(Form("%s_px",fhNeHadE->GetName()),-1,-1);
4853 TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX(Form("%s_px",fhChHadE->GetName()),-1,-1);
4854 TH1F * haxisE = (TH1F*) hPi0E->Clone(Form("%s_axisE",fhPi0E->GetName()));
4855 haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
4856 hPi0E->SetLineColor(1);
4857 hGamE->SetLineColor(4);
4858 hNeHadE->SetLineColor(2);
4859 hChHadE->SetLineColor(7);
4860 hEleE->SetLineColor(6);
4861
a6f26052 4862 //Select the maximum of the histogram to show all lines.
c8fe2783 4863 if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() &&
4864 hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
4865 haxisE->SetMaximum(hPi0E->GetMaximum());
4866 else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() &&
4867 hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
4868 haxisE->SetMaximum(hGamE->GetMaximum());
4869 else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() &&
4870 hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
4871 haxisE->SetMaximum(hNeHadE->GetMaximum());
4872 else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() &&
4873 hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
4874 haxisE->SetMaximum(hChHadE->GetMaximum());
4875 else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() &&
4876 hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
4877 haxisE->SetMaximum(hEleE->GetMaximum());
4878 haxisE->SetXTitle("E (GeV)");
4879 haxisE->SetMinimum(1);
4880 haxisE->Draw("axis");
4881 hPi0E->Draw("same");
4882 hGamE->Draw("same");
4883 hNeHadE->Draw("same");
4884 hChHadE->Draw("same");
4885 hEleE->Draw("same");
4886
4887 TLegend pLegend2(0.8,0.65,0.95,0.93);
4888 pLegend2.SetTextSize(0.06);
4889 pLegend2.AddEntry(hPi0E," #pi^{0}","L");
4890 pLegend2.AddEntry(hGamE," #gamma","L");
4891 pLegend2.AddEntry(hEleE," e^{#pm}","L");
4892 pLegend2.AddEntry(hChHadE," h^{#pm}","L");
4893 pLegend2.AddEntry(hNeHadE," h^{0}","L");
4894 pLegend2.SetFillColor(10);
4895 pLegend2.SetBorderSize(1);
4896 pLegend2.Draw();
4897
4898
4899 c11->cd(2) ;
4900 gPad->SetLogy();
a6f26052 4901 //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
c8fe2783 4902 TH1F * hGamPt = (TH1F*) fhGamPt->ProjectionX(Form("%s_px",fhGamPt->GetName()),-1,-1);
4903 TH1F * hPi0Pt = (TH1F*) fhPi0Pt->ProjectionX(Form("%s_px",fhPi0Pt->GetName()),-1,-1);
4904 TH1F * hElePt = (TH1F*) fhElePt->ProjectionX(Form("%s_px",fhElePt->GetName()),-1,-1);
4905 TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX(Form("%s_px",fhNeHadPt->GetName()),-1,-1);
4906 TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX(Form("%s_px",fhChHadPt->GetName()),-1,-1);
4907 haxispt = (TH1F*) hPi0Pt->Clone(Form("%s_axisPt",fhPi0Pt->GetName()));
4908 haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
4909 hPi0Pt->SetLineColor(1);
4910 hGamPt->SetLineColor(4);
4911 hNeHadPt->SetLineColor(2);
4912 hChHadPt->SetLineColor(7);
4913 hElePt->SetLineColor(6);
4914
a6f26052 4915 //Select the maximum of the histogram to show all lines.
c8fe2783 4916 if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4917 hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
4918 haxispt->SetMaximum(hPi0Pt->GetMaximum());
4919 else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4920 hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
4921 haxispt->SetMaximum(hGamPt->GetMaximum());
4922 else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() &&
4923 hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
4924 haxispt->SetMaximum(hNeHadPt->GetMaximum());
4925 else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4926 hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
4927 haxispt->SetMaximum(hChHadPt->GetMaximum());
4928 else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() &&
4929 hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
4930 haxispt->SetMaximum(hElePt->GetMaximum());
4931 haxispt->SetXTitle("p_{T} (GeV/c)");
4932 haxispt->SetMinimum(1);
4933 haxispt->Draw("axis");
4934 hPi0Pt->Draw("same");
4935 hGamPt->Draw("same");
4936 hNeHadPt->Draw("same");
4937 hChHadPt->Draw("same");
4938 hElePt->Draw("same");
4939
4940 c11->cd(3) ;
4941 gPad->SetLogy();
4942
4943 TH1F * hGamEta = (TH1F*) fhGamEta->ProjectionX(Form("%s_px",fhGamEta->GetName()),-1,-1);
4944 TH1F * hPi0Eta = (TH1F*) fhPi0Eta->ProjectionX(Form("%s_px",fhPi0Eta->GetName()),-1,-1);
4945 TH1F * hEleEta = (TH1F*) fhEleEta->ProjectionX(Form("%s_px",fhEleEta->GetName()),-1,-1);
4946 TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX(Form("%s_px",fhNeHadEta->GetName()),-1,-1);
4947 TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX(Form("%s_px",fhChHadEta->GetName()),-1,-1);
4948 haxiseta = (TH1F*) hPi0Eta->Clone(Form("%s_axisEta",fhPi0Eta->GetName()));
4949 haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
4950 hPi0Eta->SetLineColor(1);
4951 hGamEta->SetLineColor(4);
4952 hNeHadEta->SetLineColor(2);
4953 hChHadEta->SetLineColor(7);
4954 hEleEta->SetLineColor(6);
a6f26052 4955 //Select the maximum of the histogram to show all lines.
c8fe2783 4956 if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4957 hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
4958 haxiseta->SetMaximum(hPi0Eta->GetMaximum());
4959 else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4960 hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
4961 haxiseta->SetMaximum(hGamEta->GetMaximum());
4962 else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() &&
4963 hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
4964 haxiseta->SetMaximum(hNeHadEta->GetMaximum());
4965 else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4966 hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
4967 haxiseta->SetMaximum(hChHadEta->GetMaximum());
4968 else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() &&
4969 hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
4970 haxiseta->SetMaximum(hEleEta->GetMaximum());
4971
4972 haxiseta->SetXTitle("#eta");
4973 haxiseta->Draw("axis");
4974 hPi0Eta->Draw("same");
4975 hGamEta->Draw("same");
4976 hNeHadEta->Draw("same");
4977 hChHadEta->Draw("same");
4978 hEleEta->Draw("same");
4979
4980
4981 c11->cd(4) ;
4982 gPad->SetLogy();
4983 TH1F * hGamPhi = (TH1F*) fhGamPhi->ProjectionX(Form("%s_px",fhGamPhi->GetName()),-1,-1);
4984 TH1F * hPi0Phi = (TH1F*) fhPi0Phi->ProjectionX(Form("%s_px",fhPi0Phi->GetName()),-1,-1);
4985 TH1F * hElePhi = (TH1F*) fhElePhi->ProjectionX(Form("%s_px",fhElePhi->GetName()),-1,-1);
4986 TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX(Form("%s_px",fhNeHadPhi->GetName()),-1,-1);
4987 TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX(Form("%s_px",fhChHadPhi->GetName()),-1,-1);
4988 haxisphi = (TH1F*) hPi0Phi->Clone(Form("%s_axisPhi",fhPi0Phi->GetName()));
4989 haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
4990
4991 hPi0Phi->SetLineColor(1);
4992 hGamPhi->SetLineColor(4);
4993 hNeHadPhi->SetLineColor(2);
4994 hChHadPhi->SetLineColor(7);
4995 hElePhi->SetLineColor(6);
a6f26052 4996 //Select the maximum of the histogram to show all lines.
c8fe2783 4997 if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
4998 hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
4999 haxisphi->SetMaximum(hPi0Phi->GetMaximum());
5000 else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5001 hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
5002 haxisphi->SetMaximum(hGamPhi->GetMaximum());
5003 else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() &&
5004 hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5005 haxisphi->SetMaximum(hNeHadPhi->GetMaximum());
5006 else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5007 hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
5008 haxisphi->SetMaximum(hChHadPhi->GetMaximum());
5009 else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() &&
5010 hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
5011 haxisphi->SetMaximum(hElePhi->GetMaximum());
5012 haxisphi->SetXTitle("#phi (rad)");
5013 haxisphi->Draw("axis");
5014 hPi0Phi->Draw("same");
5015 hGamPhi->Draw("same");
5016 hNeHadPhi->Draw("same");
5017 hChHadPhi->Draw("same");
5018 hElePhi->Draw("same");
5019
164a1d84 5020 snprintf(name,buffersize,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
c8fe2783 5021 c11->Print(name); printf("Plot: %s\n",name);
5022
5023
a6f26052 5024 //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
5025 //printf("c1\n");
c8fe2783 5026
5027 TH1F * hPi0EClone = (TH1F*) hPi0E ->Clone(Form("%s_Clone",fhPi0E->GetName()));
5028 TH1F * hGamEClone = (TH1F*) hGamE ->Clone(Form("%s_Clone",fhGamE->GetName()));
5029 TH1F * hPi0PtClone = (TH1F*) hPi0Pt ->Clone(Form("%s_Clone",fhPi0Pt->GetName()));
5030 TH1F * hGamPtClone = (TH1F*) hGamPt ->Clone(Form("%s_Clone",fhGamPt->GetName()));
5031 TH1F * hPi0EtaClone = (TH1F*) hPi0Eta->Clone(Form("%s_Clone",fhPi0Eta->GetName()));
5032 TH1F * hGamEtaClone = (TH1F*) hGamEta->Clone(Form("%s_Clone",fhGamEta->GetName()));
5033 TH1F * hPi0PhiClone = (TH1F*) hPi0Phi->Clone(Form("%s_Clone",fhPi0Phi->GetName()));
5034 TH1F * hGamPhiClone = (TH1F*) hGamPhi->Clone(Form("%s_Clone",fhGamPhi->GetName()));
5035
164a1d84 5036 snprintf(cname,buffersize,"QA_%s_recgenidratio",fCalorimeter.Data());
c8fe2783 5037 TCanvas * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
5038 c12->Divide(2, 2);
5039
5040 c12->cd(1) ;
5041 gPad->SetLogy();
5042 haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5043 hPi0EClone->Divide(fhGenPi0AccE);
5044 hGamEClone->Divide(fhGenGamAccE);
5045 haxisE->SetMaximum(5);
5046 haxisE->SetMinimum(1e-2);
5047 haxisE->SetXTitle("E (GeV)");
5048 haxisE->SetYTitle("ratio = rec/gen");
5049 haxisE->Draw("axis");
5050 hPi0E->Draw("same");
5051 hGamE->Draw("same");
5052
5053 TLegend pLegend3(0.75,0.2,0.9,0.4);
5054 pLegend3.SetTextSize(0.06);
5055 pLegend3.AddEntry(hPi0EClone," #pi^{0}","L");
5056 pLegend3.AddEntry(hGamEClone," #gamma","L");
5057 pLegend3.SetFillColor(10);
5058 pLegend3.SetBorderSize(1);
5059 pLegend3.Draw();
5060
5061 c12->cd(2) ;
5062 gPad->SetLogy();
5063 haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5064 hPi0PtClone->Divide(fhGenPi0AccPt);
5065 hGamPtClone->Divide(fhGenGamAccPt);
5066 haxispt->SetMaximum(5);
5067 haxispt->SetMinimum(1e-2);
5068 haxispt->SetXTitle("p_{T} (GeV/c)");
5069 haxispt->SetYTitle("ratio = rec/gen");
5070 haxispt->Draw("axis");
5071 hPi0PtClone->Draw("same");
5072 hGamPtClone->Draw("same");
5073
5074 c12->cd(3) ;
5075 gPad->SetLogy();
5076
5077 haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5078 hPi0EtaClone->Divide(fhGenPi0AccEta);
5079 hGamEtaClone->Divide(fhGenGamAccEta);
5080 haxiseta->SetMaximum(1.2);
5081 haxiseta->SetMinimum(1e-2);
5082 haxiseta->SetYTitle("ratio = rec/gen");
5083 haxiseta->SetXTitle("#eta");
5084 haxiseta->Draw("axis");
5085 hPi0EtaClone->Draw("same");
5086 hGamEtaClone->Draw("same");
5087
5088
5089 c12->cd(4) ;
5090 gPad->SetLogy();
5091 haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
5092 hPi0PhiClone->Divide(fhGenPi0AccPhi);
5093 hGamPhiClone->Divide(fhGenGamAccPhi);
5094 haxisphi->SetYTitle("ratio = rec/gen");
5095 haxisphi->SetXTitle("#phi (rad)");
5096 haxisphi->SetMaximum(1.2);
5097 haxisphi->SetMinimum(1e-2);
5098 haxisphi->Draw("axis");
5099 hPi0PhiClone->Draw("same");
5100 hGamPhiClone->Draw("same");
5101
164a1d84 5102 snprintf(name,buffersize,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
c8fe2783 5103 c12->Print(name); printf("Plot: %s\n",name);
5104
5105
5106
a6f26052 5107 //Reconstructed distributions
5108 //printf("c1\n");
164a1d84 5109 snprintf(cname,buffersize,"QA_%s_vertex",fCalorimeter.Data());
c8fe2783 5110 TCanvas * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
5111 c13->Divide(2, 2);
5112
5113 c13->cd(1) ;
a6f26052 5114 //gPad->SetLogy();
c8fe2783 5115 fhEMVxyz->SetTitleOffset(1.6,"Y");
5116 fhEMVxyz->Draw();
5117
5118 c13->cd(2) ;
a6f26052 5119 //gPad->SetLogy();
c8fe2783 5120 fhHaVxyz->SetTitleOffset(1.6,"Y");
5121 fhHaVxyz->Draw();
5122
5123 c13->cd(3) ;
5124 gPad->SetLogy();
5125 TH1F * hEMR = (TH1F*) fhEMR->ProjectionY(Form("%s_py",fhEMR->GetName()),-1,-1);
5126 hEMR->SetLineColor(4);
5127 hEMR->Draw();
5128
5129 c13->cd(4) ;
5130 gPad->SetLogy();
5131 TH1F * hHaR = (TH1F*) fhHaR->ProjectionY(Form("%s_py",fhHaR->GetName()),-1,-1);
5132 hHaR->SetLineColor(4);
5133 hHaR->Draw();
5134
5135
164a1d84 5136 snprintf(name,buffersize,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
c8fe2783 5137 c13->Print(name); printf("Plot: %s\n",name);
5138
5139
a6f26052 5140 //Track-matching distributions
5141 if(fFillAllTH12){
c8fe2783 5142 //Reconstructed distributions, matched with tracks, generated particle dependence
5143 //printf("c2\n");
164a1d84 5144 snprintf(cname,buffersize,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
a6f26052 5145 TCanvas * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
5146 c22ch->Divide(2, 2);
5147
5148 c22ch->cd(1) ;
5149
5150 TH1F * hGamECharged = (TH1F*) fhGamECharged->ProjectionX(Form("%s_px",fhGamECharged->GetName()),-1,-1);
5151 TH1F * hPi0ECharged = (TH1F*) fhPi0ECharged->ProjectionX(Form("%s_px",fhPi0ECharged->GetName()),-1,-1);
5152 TH1F * hEleECharged = (TH1F*) fhEleECharged->ProjectionX(Form("%s_px",fhEleECharged->GetName()),-1,-1);
5153 TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX(Form("%s_px",fhNeHadECharged->GetName()),-1,-1);
5154 TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX(Form("%s_px",fhChHadECharged->GetName()),-1,-1);
5155 hPi0ECharged->SetLineColor(1);
5156 hGamECharged->SetLineColor(4);
5157 hNeHadECharged->SetLineColor(2);
5158 hChHadECharged->SetLineColor(7);
5159 hEleECharged->SetLineColor(6);
5160 gPad->SetLogy();
5161 fhECharged->SetLineColor(3);
5162 fhECharged->SetMinimum(0.5);
5163 fhECharged->Draw();
5164 hPi0ECharged->Draw("same");
5165 hGamECharged->Draw("same");
5166 hNeHadECharged->Draw("same");
5167 hChHadECharged->Draw("same");
5168 hEleECharged->Draw("same");
5169 TLegend pLegend22(0.75,0.45,0.9,0.8);
5170 pLegend22.SetTextSize(0.06);
5171 pLegend22.AddEntry(fhECharged,"all","L");
5172 pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
5173 pLegend22.AddEntry(hGamECharged,"#gamma","L");
5174 pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
5175 pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
5176 pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
5177 pLegend22.SetFillColor(10);
5178 pLegend22.SetBorderSize(1);
5179 pLegend22.Draw();
5180
5181 c22ch->cd(2) ;
5182
5183 TH1F * hGamPtCharged = (TH1F*) fhGamPtCharged->ProjectionX(Form("%s_px",fhGamPtCharged->GetName()),-1,-1);
5184 TH1F * hPi0PtCharged = (TH1F*) fhPi0PtCharged->ProjectionX(Form("%s_px",fhPi0PtCharged->GetName()),-1,-1);
5185 TH1F * hElePtCharged = (TH1F*) fhElePtCharged->ProjectionX(Form("%s_px",fhElePtCharged->GetName()),-1,-1);
5186 TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX(Form("%s_px",fhNeHadPtCharged->GetName()),-1,-1);
5187 TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX(Form("%s_px",fhChHadPtCharged->GetName()),-1,-1);
5188 hPi0PtCharged->SetLineColor(1);
5189 hGamPtCharged->SetLineColor(4);
5190 hNeHadPtCharged->SetLineColor(2);
5191 hChHadPtCharged->SetLineColor(7);
5192 hElePtCharged->SetLineColor(6);
5193 gPad->SetLogy();
5194 fhPtCharged->SetLineColor(3);
5195 fhPtCharged->SetMinimum(0.5);
5196 fhPtCharged->Draw();
5197 hPi0PtCharged->Draw("same");
5198 hGamPtCharged->Draw("same");
5199 hNeHadPtCharged->Draw("same");
5200 hChHadPtCharged->Draw("same");
5201 hElePtCharged->Draw("same");
5202
5203 c22ch->cd(4) ;
5204
5205 TH1F * hGamEtaCharged = (TH1F*) fhGamEtaCharged->ProjectionX(Form("%s_px",fhGamEtaCharged->GetName()),-1,-1);
5206 TH1F * hPi0EtaCharged = (TH1F*) fhPi0EtaCharged->ProjectionX(Form("%s_px",fhPi0EtaCharged->GetName()),-1,-1);
5207 TH1F * hEleEtaCharged = (TH1F*) fhEleEtaCharged->ProjectionX(Form("%s_px",fhEleEtaCharged->GetName()),-1,-1);
5208 TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX(Form("%s_px",fhNeHadEtaCharged->GetName()),-1,-1);
5209 TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX(Form("%s_px",fhChHadEtaCharged->GetName()),-1,-1);
5210 hPi0EtaCharged->SetLineColor(1);
5211 hGamEtaCharged->SetLineColor(4);
5212 hNeHadEtaCharged->SetLineColor(2);
5213 hChHadEtaCharged->SetLineColor(7);
5214 hEleEtaCharged->SetLineColor(6);
5215 gPad->SetLogy();
5216 fhEtaCharged->SetLineColor(3);
5217 fhEtaCharged->SetMinimum(0.5);
5218 fhEtaCharged->Draw();
5219 hPi0EtaCharged->Draw("same");
5220 hGamEtaCharged->Draw("same");
5221 hNeHadEtaCharged->Draw("same");
5222 hChHadEtaCharged->Draw("same");
5223 hEleEtaCharged->Draw("same");
5224
5225 c22ch->cd(3) ;
5226
5227 TH1F * hGamPhiCharged = (TH1F*) fhGamPhiCharged->ProjectionX(Form("%s_px",fhGamPhiCharged->GetName()),-1,-1);
5228 TH1F * hPi0PhiCharged = (TH1F*) fhPi0PhiCharged->ProjectionX(Form("%s_px",fhPi0PhiCharged->GetName()),-1,-1);
5229 TH1F * hElePhiCharged = (TH1F*) fhElePhiCharged->ProjectionX(Form("%s_px",fhElePhiCharged->GetName()),-1,-1);
5230 TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX(Form("%s_px",fhNeHadPhiCharged->GetName()),-1,-1);
5231 TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX(Form("%s_px",fhChHadPhiCharged->GetName()),-1,-1);
5232 hPi0PhiCharged->SetLineColor(1);
5233 hGamPhiCharged->SetLineColor(4);
5234 hNeHadPhiCharged->SetLineColor(2);
5235 hChHadPhiCharged->SetLineColor(7);
5236 hElePhiCharged->SetLineColor(6);
5237 gPad->SetLogy();
5238 fhPhiCharged->SetLineColor(3);
5239 fhPhiCharged->SetMinimum(0.5);
5240 fhPhiCharged->Draw();
5241 hPi0PhiCharged->Draw("same");
5242 hGamPhiCharged->Draw("same");
5243 hNeHadPhiCharged->Draw("same");
5244 hChHadPhiCharged->Draw("same");
5245 hElePhiCharged->Draw("same");
5246
5247
164a1d84 5248 snprintf(name,buffersize,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
a6f26052 5249 c22ch->Print(name); printf("Plot: %s\n",name);
5250
5251 TH1F * hGamEChargedClone = (TH1F*) hGamECharged->Clone(Form("%s_Clone",fhGamECharged->GetName()));
5252 TH1F * hGamPtChargedClone = (TH1F*) hGamPtCharged->Clone(Form("%s_Clone",fhGamPtCharged->GetName()));
5253 TH1F * hGamEtaChargedClone = (TH1F*) hGamEtaCharged->Clone(Form("%s_Clone",fhGamEtaCharged->GetName()));
5254 TH1F * hGamPhiChargedClone = (TH1F*) hGamPhiCharged->Clone(Form("%s_Clone",fhGamPhiCharged->GetName()));
5255
5256 TH1F * hPi0EChargedClone = (TH1F*) hPi0ECharged->Clone(Form("%s_Clone",fhPi0ECharged->GetName()));
5257 TH1F * hPi0PtChargedClone = (TH1F*) hPi0PtCharged->Clone(Form("%s_Clone",fhPi0PtCharged->GetName()));
5258 TH1F * hPi0EtaChargedClone = (TH1F*) hPi0EtaCharged->Clone(Form("%s_Clone",fhPi0EtaCharged->GetName()));
5259 TH1F * hPi0PhiChargedClone = (TH1F*) hPi0PhiCharged->Clone(Form("%s_Clone",fhPi0PhiCharged->GetName()));
5260
5261 TH1F * hEleEChargedClone = (TH1F*) hEleECharged->Clone(Form("%s_Clone",fhEleECharged->GetName()));
5262 TH1F * hElePtChargedClone = (TH1F*) hElePtCharged->Clone(Form("%s_Clone",fhElePtCharged->GetName()));
5263 TH1F * hEleEtaChargedClone = (TH1F*) hEleEtaCharged->Clone(Form("%s_Clone",fhEleEtaCharged->GetName()));
5264 TH1F * hElePhiChargedClone = (TH1F*) hElePhiCharged->Clone(Form("%s_Clone",fhElePhiCharged->GetName()));
5265
5266 TH1F * hNeHadEChargedClone = (TH1F*) hNeHadECharged->Clone(Form("%s_Clone",fhNeHadECharged->GetName()));
5267 TH1F * hNeHadPtChargedClone = (TH1F*) hNeHadPtCharged->Clone(Form("%s_Clone",fhNeHadPtCharged->GetName()));
5268 TH1F * hNeHadEtaChargedClone = (TH1F*) hNeHadEtaCharged->Clone(Form("%s_Clone",fhNeHadEtaCharged->GetName()));
5269 TH1F * hNeHadPhiChargedClone = (TH1F*) hNeHadPhiCharged->Clone(Form("%s_Clone",fhNeHadPhiCharged->GetName()));
5270
5271 TH1F * hChHadEChargedClone = (TH1F*) hChHadECharged->Clone(Form("%s_Clone",fhChHadECharged->GetName()));
5272 TH1F * hChHadPtChargedClone = (TH1F*) hChHadPtCharged->Clone(Form("%s_Clone",fhChHadPtCharged->GetName()));
5273 TH1F * hChHadEtaChargedClone = (TH1F*) hChHadEtaCharged->Clone(Form("%s_Clone",fhChHadEtaCharged->GetName()));
5274 TH1F * hChHadPhiChargedClone = (TH1F*) hChHadPhiCharged->Clone(Form("%s_Clone",fhChHadPhiCharged->GetName()));
5275
c8fe2783 5276 //Ratio: reconstructed track matched/ all reconstructed
5277 //printf("c3\n");
164a1d84 5278 snprintf(cname,buffersize,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
a6f26052 5279 TCanvas * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
5280 c3ch->Divide(2, 2);
5281
5282 c3ch->cd(1) ;
5283 hEChargedClone->SetMaximum(1.2);
5284 hEChargedClone->SetMinimum(0.001);
5285 hEChargedClone->SetLineColor(3);
5286 hEChargedClone->SetYTitle("track matched / all");
5287 hPi0EChargedClone->Divide(hPi0E);
5288 hGamEChargedClone->Divide(hGamE);
5289 hEleEChargedClone->Divide(hEleE);
5290 hNeHadEChargedClone->Divide(hNeHadE);
5291 hChHadEChargedClone->Divide(hChHadE);
5292 hEChargedClone->Draw();
5293 hPi0EChargedClone->Draw("same");
5294 hGamEChargedClone->Draw("same");
5295 hEleEChargedClone->Draw("same");
5296 hNeHadEChargedClone->Draw("same");
5297 hChHadEChargedClone->Draw("same");
5298
5299 TLegend pLegend3ch(0.75,0.45,0.9,0.8);
5300 pLegend3ch.SetTextSize(0.06);
5301 pLegend3ch.AddEntry(hEChargedClone,"all","L");
5302 pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
5303 pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
5304 pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
5305 pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
5306 pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
5307 pLegend3ch.SetFillColor(10);
5308 pLegend3ch.SetBorderSize(1);
5309 pLegend3ch.Draw();
5310
5311 c3ch->cd(2) ;
5312 hPtChargedClone->SetMaximum(1.2);
5313 hPtChargedClone->SetMinimum(0.001);
5314 hPtChargedClone->SetLineColor(3);
5315 hPtChargedClone->SetYTitle("track matched / all");
5316 hPi0PtChargedClone->Divide(hPi0Pt);
5317 hGamPtChargedClone->Divide(hGamPt);
5318 hElePtChargedClone->Divide(hElePt);
5319 hNeHadPtChargedClone->Divide(hNeHadPt);
5320 hChHadPtChargedClone->Divide(hChHadPt);
5321 hPtChargedClone->Draw();
5322 hPi0PtChargedClone->Draw("same");
5323 hGamPtChargedClone->Draw("same");
5324 hElePtChargedClone->Draw("same");
5325 hNeHadPtChargedClone->Draw("same");
5326 hChHadPtChargedClone->Draw("same");
5327
5328 c3ch->cd(4) ;
5329 hEtaChargedClone->SetMaximum(1.2);
5330 hEtaChargedClone->SetMinimum(0.001);
5331 hEtaChargedClone->SetLineColor(3);
5332 hEtaChargedClone->SetYTitle("track matched / all");
5333 hPi0EtaChargedClone->Divide(hPi0Eta);
5334 hGamEtaChargedClone->Divide(hGamEta);
5335 hEleEtaChargedClone->Divide(hEleEta);
5336 hNeHadEtaChargedClone->Divide(hNeHadEta);
5337 hChHadEtaChargedClone->Divide(hChHadEta);
5338 hEtaChargedClone->Draw();
5339 hPi0EtaChargedClone->Draw("same");
5340 hGamEtaChargedClone->Draw("same");
5341 hEleEtaChargedClone->Draw("same");
5342 hNeHadEtaChargedClone->Draw("same");
5343 hChHadEtaChargedClone->Draw("same");
5344
5345 c3ch->cd(3) ;
5346 hPhiChargedClone->SetMaximum(1.2);
5347 hPhiChargedClone->SetMinimum(0.001);
5348 hPhiChargedClone->SetLineColor(3);
5349 hPhiChargedClone->SetYTitle("track matched / all");
5350 hPi0PhiChargedClone->Divide(hPi0Phi);
5351 hGamPhiChargedClone->Divide(hGamPhi);
5352 hElePhiChargedClone->Divide(hElePhi);
5353 hNeHadPhiChargedClone->Divide(hNeHadPhi);
5354 hChHadPhiChargedClone->Divide(hChHadPhi);
5355 hPhiChargedClone->Draw();
5356 hPi0PhiChargedClone->Draw("same");
5357 hGamPhiChargedClone->Draw("same");
5358 hElePhiChargedClone->Draw("same");
5359 hNeHadPhiChargedClone->Draw("same");
5360 hChHadPhiChargedClone->Draw("same");
5361
164a1d84 5362 snprintf(name,buffersize,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
a6f26052 5363 c3ch->Print(name); printf("Plot: %s\n",name);
5364
5365 }
5366 }
5367 //Track-matching distributions
c8fe2783 5368
54769bc0 5369 snprintf(cname,buffersize,"QA_%s_trkmatch",fCalorimeter.Data());
5370 TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
5371 cme->Divide(2,2);
c8fe2783 5372
54769bc0 5373 TLegend pLegendpE0(0.6,0.55,0.9,0.8);
5374 pLegendpE0.SetTextSize(0.04);
5375 pLegendpE0.AddEntry(fh1pOverE,"all","L");
5376 pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
5377 pLegendpE0.SetFillColor(10);
5378 pLegendpE0.SetBorderSize(1);
a6f26052 5379 //pLegendpE0.Draw();
c8fe2783 5380
54769bc0 5381 cme->cd(1);
5382 if(fh1pOverE->GetEntries() > 0) gPad->SetLogy();
5383 fh1pOverE->SetTitle("Track matches p/E");
5384 fh1pOverE->Draw();
5385 fh1pOverER02->SetLineColor(4);
5386 fh1pOverER02->Draw("same");
5387 pLegendpE0.Draw();
5388
5389 cme->cd(2);
5390 if(fh1dR->GetEntries() > 0) gPad->SetLogy();
5391 fh1dR->Draw();
5392
5393 cme->cd(3);
5394 fh2MatchdEdx->Draw();
5395
5396 cme->cd(4);
5397 fh2EledEdx->Draw();
5398
5399 snprintf(name,buffersize,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
5400 cme->Print(name); printf("Plot: %s\n",name);
5401
5402 if(IsDataMC()){
164a1d84 5403 snprintf(cname,buffersize,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
c8fe2783 5404 TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
5405 cmemc->Divide(3,1);
5406
5407 cmemc->cd(1);
5408 gPad->SetLogy();
5409 fhMCEle1pOverE->Draw();
5410 fhMCEle1pOverER02->SetLineColor(4);
5411 fhMCEle1pOverE->SetLineColor(1);
5412 fhMCEle1pOverER02->Draw("same");
5413 pLegendpE0.Draw();
5414
5415 cmemc->cd(2);
5416 gPad->SetLogy();
5417 fhMCEle1dR->Draw();
5418
5419 cmemc->cd(3);
5420 fhMCEle2MatchdEdx->Draw();
5421
164a1d84 5422 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
c8fe2783 5423 cmemc->Print(name); printf("Plot: %s\n",name);
5424
6fa7d352 5425
164a1d84 5426 snprintf(cname,buffersize,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
c8fe2783 5427 TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
5428 cmemchad->Divide(3,1);
5429
5430 cmemchad->cd(1);
5431 gPad->SetLogy();
5432 fhMCChHad1pOverE->Draw();
5433 fhMCChHad1pOverER02->SetLineColor(4);
5434 fhMCChHad1pOverE->SetLineColor(1);
5435 fhMCChHad1pOverER02->Draw("same");
5436 pLegendpE0.Draw();
5437
5438 cmemchad->cd(2);
5439 gPad->SetLogy();
5440 fhMCChHad1dR->Draw();
5441
5442 cmemchad->cd(3);
5443 fhMCChHad2MatchdEdx->Draw();
6fa7d352 5444
164a1d84 5445 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
c8fe2783 5446 cmemchad->Print(name); printf("Plot: %s\n",name);
5447
164a1d84 5448 snprintf(cname,buffersize,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
c8fe2783 5449 TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
5450 cmemcn->Divide(3,1);
5451
5452 cmemcn->cd(1);
5453 gPad->SetLogy();
5454 fhMCNeutral1pOverE->Draw();
5455 fhMCNeutral1pOverE->SetLineColor(1);
5456 fhMCNeutral1pOverER02->SetLineColor(4);
5457 fhMCNeutral1pOverER02->Draw("same");
5458 pLegendpE0.Draw();
5459
5460 cmemcn->cd(2);
5461 gPad->SetLogy();
5462 fhMCNeutral1dR->Draw();
5463
5464 cmemcn->cd(3);
5465 fhMCNeutral2MatchdEdx->Draw();
5466
164a1d84 5467 snprintf(name,buffersize,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
c8fe2783 5468 cmemcn->Print(name); printf("Plot: %s\n",name);
5469
164a1d84 5470 snprintf(cname,buffersize,"QA_%s_trkmatchpE",fCalorimeter.Data());
c8fe2783 5471 TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
5472 cmpoe->Divide(2,1);
5473
5474 cmpoe->cd(1);
5475 gPad->SetLogy();
5476 fh1pOverE->SetLineColor(1);
5477 fhMCEle1pOverE->SetLineColor(4);
5478 fhMCChHad1pOverE->SetLineColor(2);
5479 fhMCNeutral1pOverE->SetLineColor(7);
5480 fh1pOverER02->SetMinimum(0.5);
5481 fh1pOverE->Draw();
5482 fhMCEle1pOverE->Draw("same");
5483 fhMCChHad1pOverE->Draw("same");
5484 fhMCNeutral1pOverE->Draw("same");
5485 TLegend pLegendpE(0.65,0.55,0.9,0.8);
5486 pLegendpE.SetTextSize(0.06);
5487 pLegendpE.AddEntry(fh1pOverE,"all","L");
5488 pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
5489 pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
5490 pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
5491 pLegendpE.SetFillColor(10);
5492 pLegendpE.SetBorderSize(1);
5493 pLegendpE.Draw();
5494
5495 cmpoe->cd(2);
5496 gPad->SetLogy();
5497 fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
5498 fh1pOverER02->SetLineColor(1);
5499 fhMCEle1pOverER02->SetLineColor(4);
5500 fhMCChHad1pOverER02->SetLineColor(2);
5501 fhMCNeutral1pOverER02->SetLineColor(7);
5502 fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
5503 fh1pOverER02->SetMinimum(0.5);
5504 fh1pOverER02->Draw();
5505 fhMCEle1pOverER02->Draw("same");
5506 fhMCChHad1pOverER02->Draw("same");
5507 fhMCNeutral1pOverER02->Draw("same");
5508
a6f26052 5509 // TLegend pLegendpE2(0.65,0.55,0.9,0.8);
5510 // pLegendpE2.SetTextSize(0.06);
5511 // pLegendpE2.SetHeader("dR < 0.02");
5512 // pLegendpE2.SetFillColor(10);
5513 // pLegendpE2.SetBorderSize(1);
5514 // pLegendpE2.Draw();
c8fe2783 5515
164a1d84 5516 snprintf(name,buffersize,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
c8fe2783 5517 cmpoe->Print(name); printf("Plot: %s\n",name);
54769bc0 5518 }
5519
5520 char line[buffersize] ;
5521 snprintf(line, buffersize,".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ;
5522 gROOT->ProcessLine(line);
5523 snprintf(line, buffersize,".!rm -fR *.eps");
5524 gROOT->ProcessLine(line);
5525
5526 printf("AliAnaCalorimeterQA::Terminate() - !! All the eps files are in QA_%s_%s.tar.gz !!!\n", fCalorimeter.Data(), GetName());
5527
9725fd2a 5528}