]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/QA/DrawCaloQA.C
AliAnaPartCorrBase: Add setters and getters for the mass and asymetry histograms...
[u/mrichter/AliRoot.git] / PWG4 / macros / QA / DrawCaloQA.C
1 //Histograms
2 //CaloClusters 
3 TH1F * fhE  ; //! E distribution, Reco
4 TH1F * fhPt ; //! pT distribution, Reco
5 TH1F * fhPhi; //! phi distribution, Reco 
6 TH1F * fhEta; //! eta distribution, Reco 
7 TH2F * fhEtaPhi  ; //! eta vs phi, Reco 
8 TH3F * fhEtaPhiE  ; //! eta vs phi vs E, Reco
9 TH1F * fhECharged  ; //! E distribution, Reco, matched with track
10 TH1F * fhPtCharged ; //! pT distribution, Reco, matched with track
11 TH1F * fhPhiCharged; //! phi distribution, Reco, matched with track 
12 TH1F * fhEtaCharged; //! eta distribution, Reco, matched with track 
13 TH2F * fhEtaPhiCharged  ; //! eta vs phi, Reco, matched with track
14 TH1F * fhEChargedNoOut  ; //! E distribution, Reco, matched with track, no outer param
15 TH1F * fhPtChargedNoOut ; //! pT distribution, Reco, matched with track, no outer param
16 TH1F * fhPhiChargedNoOut; //! phi distribution, Reco, matched with track, no outer param
17 TH1F * fhEtaChargedNoOut; //! eta distribution, Reco, matched with track, no outer param
18 TH2F * fhEtaPhiChargedNoOut  ; //! eta vs phi, Reco, matched with track, no outer param
19 TH1F * fhDeltaE  ; //! MC-Reco E distribution   
20 TH1F * fhDeltaPt ; //! MC-Reco pT distribution
21 TH1F * fhDeltaPhi; //! MC-Reco phi distribution
22 TH1F * fhDeltaEta; //! MC-Reco eta distribution
23 TH1F * fhRatioE  ; //! Reco/MC E distribution   
24 TH1F * fhRatioPt ; //! Reco/MC pT distribution
25 TH1F * fhRatioPhi; //! Reco/MC phi distribution
26 TH1F * fhRatioEta; //! Reco/MC eta distribution
27 TH2F * fh2E  ; //! E distribution, Reco vs MC
28 TH2F * fh2Pt ; //! pT distribution, Reco vs MC
29 TH2F * fh2Phi; //! phi distribution, Reco vs MC
30 TH2F * fh2Eta; //! eta distribution, Reco vs MC
31 TH2F * fhIM; //! cluster pairs invariant mass
32 TH2F * fhIMCellCut; //! cluster pairs invariant mass, n cells > 1 per cluster
33 TH2F * fhAsym; //! cluster pairs invariant mass 
34 TH2F * fhNCellsPerCluster; //! N cells per cluster      
35 TH1F * fhNClusters; //! Number of clusters
36
37 //Calo Cells
38 TH1F * fhNCells; //! Number of towers/crystals with signal
39 TH1F * fhAmplitude; //! Amplitude measured in towers/crystals
40 TH1F * fhTime;      //! Time measured in towers/crystals
41 TH2F * fhTimeId;    //! Time vs Absolute cell Id
42 TH2F * fhTimeAmp;   //! Time vs Amplitude 
43
44 //Calorimeters Correlation
45 TH2F * fhCaloCorrNClusters; // EMCAL vs PHOS, number of clusters        
46 TH2F * fhCaloCorrEClusters; // EMCAL vs PHOS, total measured cluster energy
47 TH2F * fhCaloCorrNCells; // EMCAL vs PHOS, number of cells
48 TH2F * fhCaloCorrECells; // EMCAL vs PHOS,  total measured cell energy
49
50 //Module histograms
51 TH1F ** fhEMod  ;               //! E distribution for different module, Reco
52 TH1F ** fhNClustersMod ;        //! Number of clusters for different module, Reco
53 TH2F ** fhNCellsPerClusterMod ; //! N cells per clusters different module, Reco
54 TH1F ** fhNCellsMod ;           //! Number of towers/crystals with signal different module, Reco
55 TH2F ** fhGridCellsMod ;        //! Cells ordered in column/row for different module, Reco
56 TH2F ** fhGridCellsEMod ;       //! Cells ordered in column/row for different module, weighted with energy, Reco
57 TH1F ** fhAmplitudeMod ;        //! Amplitude measured in towers/crystals different module, Reco
58 TH2F ** fhIMMod;                //! cluster pairs invariant mass, different module,
59 TH2F ** fhIMCellCutMod;         //! cluster pairs invariant mass, n cells > 1 per cluster, different module
60
61
62 //MC  
63 TH1F *fhGenGamPt  ; // pt of primary gamma
64 TH1F *fhGenGamEta ; // eta of primart gamma
65 TH1F *fhGenGamPhi ; // phi of primary gamma     
66 TH1F *fhGenPi0Pt  ; // pt of primary pi0
67 TH1F *fhGenPi0Eta ; // eta of primart pi0
68 TH1F *fhGenPi0Phi ; // phi of primary pi0       
69 TH1F *fhGenEtaPt  ; // pt of primary eta
70 TH1F *fhGenEtaEta ; // eta of primart eta
71 TH1F *fhGenEtaPhi ; // phi of primary eta
72 TH1F *fhGenOmegaPt  ; // pt of primary omega
73 TH1F *fhGenOmegaEta ; // eta of primart omega
74 TH1F *fhGenOmegaPhi ; // phi of primary omega
75 TH1F *fhGenElePt  ; // pt of primary electron
76 TH1F *fhGenEleEta ; // eta of primart electron
77 TH1F *fhGenElePhi ; // phi of primary electron
78
79 //TH3F * fhEMVxyz    ; // Electromagnetic particle production vertex
80 TH2F * fhEMVxyz    ; // Electromagnetic particle production vertex
81 TH2F * fhEMR       ; // Electromagnetic distance to vertex vs rec energy  
82 //TH3F * fhHaVxyz    ; // Hadron production vertex
83 TH2F * fhHaVxyz    ; // Hadron production vertex
84 TH2F * fhHaR       ; // Hadron distance to vertex vs rec energy  
85
86 TH2F * fhGamE  ; //! E distribution of generated photons, Reco
87 TH2F * fhGamPt ; //! pT distribution of generated photons, Reco
88 TH2F * fhGamPhi; //! phi distribution of generated photon, Reco 
89 TH2F * fhGamEta; //! eta distribution of generated photons, Reco        
90 TH1F * fhGamDeltaE  ; //! MC-Reco E distribution of generated photons   
91 TH1F * fhGamDeltaPt ; //! MC-Reco pT distribution of generated photons
92 TH1F * fhGamDeltaPhi; //! MC-Reco phi distribution of generated photons
93 TH1F * fhGamDeltaEta; //! MC-Reco eta distribution of generated photons
94 TH1F * fhGamRatioE  ; //! Reco/MC E distribution of generated photons   
95 TH1F * fhGamRatioPt ; //! Reco/MC pT distribution of generated photons
96 TH1F * fhGamRatioPhi; //! Reco/MC phi distribution of generated photons
97 TH1F * fhGamRatioEta; //! Reco/MC eta distribution of generated photons
98 TH2F * fhEleE  ; //! E distribution of generated electrons, Reco
99 TH2F * fhElePt ; //! pT distribution of generated electrons, Reco
100 TH2F * fhElePhi; //! phi distribution of generated electron, Reco 
101 TH2F * fhEleEta; //! eta distribution of generated electrons, Reco              
102 TH2F * fhPi0E  ; //! E distribution of generated pi0, Reco, gamma decay overlapped
103 TH2F * fhPi0Pt ; //! pT distribution of generated pi0, Reco, gamma decay overlapped
104 TH2F * fhPi0Phi; //! phi distribution of generated pi0, Reco, gamma decay overlapped
105 TH2F * fhPi0Eta; //! eta distribution of generated pi0, Reco, gamma decay overlapped
106 TH2F * fhNeHadE  ; //! E distribution of generated neutral hadron, Reco
107 TH2F * fhNeHadPt ; //! pT distribution of generated neutral hadron, Reco
108 TH2F * fhNeHadPhi; //! phi distribution of generated neutral hadron, Reco 
109 TH2F * fhNeHadEta; //! eta distribution of generated neutral hadron, Reco       
110 TH2F * fhChHadE  ; //! E distribution of generated charged hadron, Reco
111 TH2F * fhChHadPt ; //! pT distribution of generated charged hadron, Reco
112 TH2F * fhChHadPhi; //! phi distribution of generated charged hadron, Reco 
113 TH2F * fhChHadEta; //! eta distribution of generated charged hadron, Reco 
114
115 TH2F * fhGamECharged  ; //! E distribution of generated photons, Reco, track matched cluster
116 TH2F * fhGamPtCharged ; //! pT distribution of generated photons, Reco, track matched cluster
117 TH2F * fhGamPhiCharged; //! phi distribution of generated photon, Reco, track matched cluster 
118 TH2F * fhGamEtaCharged; //! eta distribution of generated photons, Reco, track matched cluster 
119 TH2F * fhEleECharged  ; //! E distribution of generated electrons, Reco, track matched cluster
120 TH2F * fhElePtCharged ; //! pT distribution of generated electrons, Reco, track matched cluster
121 TH2F * fhElePhiCharged; //! phi distribution of generated electron, Reco, track matched cluster 
122 TH2F * fhEleEtaCharged; //! eta distribution of generated electrons, Reco, track matched cluster                
123 TH2F * fhPi0ECharged  ; //! E distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
124 TH2F * fhPi0PtCharged ; //! pT distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
125 TH2F * fhPi0PhiCharged; //! phi distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
126 TH2F * fhPi0EtaCharged; //! eta distribution of generated pi0, Reco, gamma decay overlapped, track matched cluster
127 TH2F * fhNeHadECharged  ; //! E distribution of generated neutral hadron, Reco, track matched cluster
128 TH2F * fhNeHadPtCharged ; //! pT distribution of generated neutral hadron, Reco, track matched cluster
129 TH2F * fhNeHadPhiCharged; //! phi distribution of generated neutral hadron, Reco , track matched cluster
130 TH2F * fhNeHadEtaCharged; //! eta distribution of generated neutral hadron, Reco, track matched cluster         
131 TH2F * fhChHadECharged  ; //! E distribution of generated charged hadron, Reco, track matched cluster
132 TH2F * fhChHadPtCharged ; //! pT distribution of generated charged hadron, Reco, track matched cluster
133 TH2F * fhChHadPhiCharged; //! phi distribution of generated charged hadron, Reco, track matched cluster 
134 TH2F * fhChHadEtaCharged; //! eta distribution of generated charged hadron, Reco, track matched cluster         
135
136 TH1F *fhGenGamAccE   ; // E of primary gamma
137 TH1F *fhGenGamAccPt  ; // pt of primary gamma
138 TH1F *fhGenGamAccEta ; // eta of primart gamma
139 TH1F *fhGenGamAccPhi ; // phi of primary gamma  
140 TH1F *fhGenPi0AccE   ; // E of primary pi0
141 TH1F *fhGenPi0AccPt  ; // pt of primary pi0
142 TH1F *fhGenPi0AccEta ; // eta of primart pi0
143 TH1F *fhGenPi0AccPhi ; // phi of primary pi0            
144
145 //Histograms for track-matching
146 TH2F *fh1pOverE;     //! p/E for track-cluster matches
147 TH1F *fh1dR;         //! distance between projected track and cluster
148 TH2F *fh2EledEdx;    //! dE/dx vs. momentum for electron candidates
149 TH2F *fh2MatchdEdx;  //! dE/dx vs. momentum for all matches
150 TH2F *fhMCEle1pOverE;     //! p/E for track-cluster matches, MC electrons
151 TH1F *fhMCEle1dR;         //! distance between projected track and cluster, MC electrons
152 TH2F *fhMCEle2MatchdEdx;  //! dE/dx vs. momentum for all matches, MC electrons  
153
154 TH2F *fhMCChHad1pOverE;     //! p/E for track-cluster matches, MC charged hadrons
155 TH1F *fhMCChHad1dR;         //! distance between projected track and cluster, MC charged hadrons
156 TH2F *fhMCChHad2MatchdEdx;  //! dE/dx vs. momentum for all matches, MC charged
157
158 TH2F *fhMCNeutral1pOverE;     //! p/E for track-cluster matches, MC neutral
159 TH1F *fhMCNeutral1dR;         //! distance between projected track and cluster, MC neutral
160 TH2F *fhMCNeutral2MatchdEdx;  //! dE/dx vs. momentum for all matches, MC neutral        
161
162 TH2F *fh1pOverER02;           //! p/E for track-cluster matches, dR > 0.2       
163 TH2F *fhMCEle1pOverER02;      //! p/E for track-cluster matches, dR > 0.2, MC electrons
164 TH2F *fhMCChHad1pOverER02;    //! p/E for track-cluster matches, dR > 0.2, MC charged hadrons
165 TH2F *fhMCNeutral1pOverER02;  //! p/E for track-cluster matches, dR > 0.2, MC neutral
166
167 //________________________________________________________________________
168 void ReadHistograms(TString name, TString dataType, Bool_t isDataMC, Bool_t  fCorrelateCalos, Int_t fNModules)
169 {
170         TFile *f = new TFile("Calo.Performance.root","read");
171         TList* outputList = f->Get("Calo.Performance");
172         
173         //Module histograms
174         fhEMod                = new TH1F*[fNModules];
175         fhNClustersMod        = new TH1F*[fNModules];
176         fhNCellsPerClusterMod = new TH2F*[fNModules];
177         fhNCellsMod           = new TH1F*[fNModules];
178         fhGridCellsMod        = new TH2F*[fNModules];
179         fhGridCellsEMod       = new TH2F*[fNModules];
180         fhAmplitudeMod        = new TH1F*[fNModules];
181         fhIMMod               = new TH2F*[fNModules];
182         fhIMCellCutMod        = new TH2F*[fNModules];
183         
184         
185         // Histograms of this analsys are kept in the same list as other analysis, recover the position of
186         // the first one and then add the next 
187         Int_t index = outputList->IndexOf(outputList->FindObject(name+"hE"));
188         //printf("Calo: %s, index: %d\n",fCalorimeter.Data(),index);
189         //Read histograms, must be in the same order as in GetCreateOutputObject.
190         fhE      = (TH1F *) outputList->At(index++);    
191         fhPt     = (TH1F *) outputList->At(index++); 
192         fhPhi    = (TH1F *) outputList->At(index++); 
193         fhEta    = (TH1F *) outputList->At(index++);
194         fhEtaPhi = (TH2F *) outputList->At(index++);
195         fhEtaPhiE = (TH3F *) outputList->At(index++);
196
197         fhECharged      = (TH1F *) outputList->At(index++);     
198         fhPtCharged     = (TH1F *) outputList->At(index++); 
199         fhPhiCharged    = (TH1F *) outputList->At(index++); 
200         fhEtaCharged    = (TH1F *) outputList->At(index++);
201         fhEtaPhiCharged = (TH2F *) outputList->At(index++);
202         
203         fhEChargedNoOut      = (TH1F *) outputList->At(index++);        
204         fhPtChargedNoOut     = (TH1F *) outputList->At(index++); 
205         fhPhiChargedNoOut    = (TH1F *) outputList->At(index++); 
206         fhEtaChargedNoOut    = (TH1F *) outputList->At(index++);
207         fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
208         
209         fh1pOverE    = (TH2F *) outputList->At(index++);
210         fh1dR        = (TH1F *) outputList->At(index++);
211         fh2MatchdEdx = (TH2F *) outputList->At(index++);
212         fh2EledEdx   = (TH2F *) outputList->At(index++);
213         fh1pOverER02 = (TH2F *) outputList->At(index++); 
214
215         fhIM     = (TH2F *) outputList->At(index++);
216         fhIMCellCut = (TH2F *) outputList->At(index++);
217         fhAsym   = (TH2F *) outputList->At(index++);
218         
219         fhNCellsPerCluster = (TH2F *) outputList->At(index++);
220         fhNClusters  = (TH1F *) outputList->At(index++); 
221         fhNCells     = (TH1F *) outputList->At(index++); 
222         fhAmplitude  = (TH1F *) outputList->At(index++); 
223         if(dataType=="ESD") {
224                 fhTime       = (TH1F *) outputList->At(index++); 
225                 fhTimeId     = (TH2F *) outputList->At(index++); 
226                 fhTimeAmp    = (TH2F *) outputList->At(index++); 
227         }
228         
229         if(fCorrelateCalos){
230                 fhCaloCorrNClusters = (TH2F *) outputList->At(index++);
231                 fhCaloCorrEClusters = (TH2F *) outputList->At(index++); 
232                 fhCaloCorrNCells    = (TH2F *) outputList->At(index++); 
233                 fhCaloCorrECells    = (TH2F *) outputList->At(index++); 
234         }
235         
236         for(Int_t imod = 0 ; imod < fNModules; imod++){
237                 fhEMod[imod]                = (TH1F *) outputList->At(index++);
238                 fhNClustersMod[imod]        = (TH1F *) outputList->At(index++); 
239                 fhNCellsPerClusterMod[imod] = (TH2F *) outputList->At(index++); 
240                 fhNCellsMod[imod]           = (TH1F *) outputList->At(index++);         
241                 fhGridCellsMod[imod]        = (TH2F *) outputList->At(index++);
242                 fhGridCellsEMod[imod]       = (TH2F *) outputList->At(index++); 
243                 fhAmplitudeMod[imod]        = (TH1F *) outputList->At(index++); 
244                 fhIMMod[imod]               = (TH2F *) outputList->At(index++); 
245                 fhIMCellCutMod[imod]        = (TH2F *) outputList->At(index++);         
246                 
247         }
248         
249         if(isDataMC){
250                 fhDeltaE   = (TH1F *) outputList->At(index++); 
251                 fhDeltaPt  = (TH1F *) outputList->At(index++); 
252                 fhDeltaPhi = (TH1F *) outputList->At(index++); 
253                 fhDeltaEta = (TH1F *) outputList->At(index++); 
254                 
255                 fhRatioE   = (TH1F *) outputList->At(index++); 
256                 fhRatioPt  = (TH1F *) outputList->At(index++); 
257                 fhRatioPhi = (TH1F *) outputList->At(index++); 
258                 fhRatioEta = (TH1F *) outputList->At(index++); 
259                 
260                 fh2E       = (TH2F *) outputList->At(index++); 
261                 fh2Pt      = (TH2F *) outputList->At(index++); 
262                 fh2Phi     = (TH2F *) outputList->At(index++); 
263                 fh2Eta     = (TH2F *) outputList->At(index++); 
264                 
265                 fhGamE     = (TH2F *) outputList->At(index++); 
266                 fhGamPt    = (TH2F *) outputList->At(index++); 
267                 fhGamPhi   = (TH2F *) outputList->At(index++); 
268                 fhGamEta   = (TH2F *) outputList->At(index++); 
269                 
270                 fhGamDeltaE   = (TH1F *) outputList->At(index++); 
271                 fhGamDeltaPt  = (TH1F *) outputList->At(index++); 
272                 fhGamDeltaPhi = (TH1F *) outputList->At(index++); 
273                 fhGamDeltaEta = (TH1F *) outputList->At(index++); 
274                 
275                 fhGamRatioE   = (TH1F *) outputList->At(index++); 
276                 fhGamRatioPt  = (TH1F *) outputList->At(index++); 
277                 fhGamRatioPhi = (TH1F *) outputList->At(index++); 
278                 fhGamRatioEta = (TH1F *) outputList->At(index++); 
279                                 
280                 fhPi0E     = (TH2F *) outputList->At(index++); 
281                 fhPi0Pt    = (TH2F *) outputList->At(index++); 
282                 fhPi0Phi   = (TH2F *) outputList->At(index++); 
283                 fhPi0Eta   = (TH2F *) outputList->At(index++);          
284                 
285                 fhEleE     = (TH2F *) outputList->At(index++); 
286                 fhElePt    = (TH2F *) outputList->At(index++); 
287                 fhElePhi   = (TH2F *) outputList->At(index++); 
288                 fhEleEta   = (TH2F *) outputList->At(index++);          
289                 
290                 fhNeHadE     = (TH2F *) outputList->At(index++); 
291                 fhNeHadPt    = (TH2F *) outputList->At(index++); 
292                 fhNeHadPhi   = (TH2F *) outputList->At(index++); 
293                 fhNeHadEta   = (TH2F *) outputList->At(index++);                
294                 
295                 fhChHadE     = (TH2F *) outputList->At(index++); 
296                 fhChHadPt    = (TH2F *) outputList->At(index++); 
297                 fhChHadPhi   = (TH2F *) outputList->At(index++); 
298                 fhChHadEta   = (TH2F *) outputList->At(index++);                                        
299                 fhGamECharged     = (TH2F *) outputList->At(index++); 
300                 fhGamPtCharged    = (TH2F *) outputList->At(index++); 
301                 fhGamPhiCharged   = (TH2F *) outputList->At(index++); 
302                 fhGamEtaCharged   = (TH2F *) outputList->At(index++); 
303                 
304                 fhPi0ECharged     = (TH2F *) outputList->At(index++); 
305                 fhPi0PtCharged    = (TH2F *) outputList->At(index++); 
306                 fhPi0PhiCharged   = (TH2F *) outputList->At(index++); 
307                 fhPi0EtaCharged   = (TH2F *) outputList->At(index++);           
308                 
309                 fhEleECharged     = (TH2F *) outputList->At(index++); 
310                 fhElePtCharged    = (TH2F *) outputList->At(index++); 
311                 fhElePhiCharged   = (TH2F *) outputList->At(index++); 
312                 fhEleEtaCharged   = (TH2F *) outputList->At(index++);           
313                 
314                 fhNeHadECharged     = (TH2F *) outputList->At(index++); 
315                 fhNeHadPtCharged    = (TH2F *) outputList->At(index++); 
316                 fhNeHadPhiCharged   = (TH2F *) outputList->At(index++); 
317                 fhNeHadEtaCharged   = (TH2F *) outputList->At(index++);                 
318                 
319                 fhChHadECharged     = (TH2F *) outputList->At(index++); 
320                 fhChHadPtCharged    = (TH2F *) outputList->At(index++); 
321                 fhChHadPhiCharged   = (TH2F *) outputList->At(index++); 
322                 fhChHadEtaCharged   = (TH2F *) outputList->At(index++);                                 
323                 
324 //              fhEMVxyz     = (TH3F *) outputList->At(index++); 
325 //              fhHaVxyz     = (TH3F *) outputList->At(index++); 
326                 
327                 fhEMVxyz     = (TH2F *) outputList->At(index++); 
328                 fhHaVxyz     = (TH2F *) outputList->At(index++); 
329                 fhEMR        = (TH2F *) outputList->At(index++); 
330                 fhHaR        = (TH2F *) outputList->At(index++); 
331                 
332                 fhGenGamPt    = (TH1F *) outputList->At(index++); 
333                 fhGenGamEta   = (TH1F *) outputList->At(index++); 
334                 fhGenGamPhi   = (TH1F *) outputList->At(index++); 
335                 
336                 fhGenPi0Pt    = (TH1F *) outputList->At(index++); 
337                 fhGenPi0Eta   = (TH1F *) outputList->At(index++); 
338                 fhGenPi0Phi   = (TH1F *) outputList->At(index++); 
339                 
340                 fhGenEtaPt    = (TH1F *) outputList->At(index++); 
341                 fhGenEtaEta   = (TH1F *) outputList->At(index++); 
342                 fhGenEtaPhi   = (TH1F *) outputList->At(index++); 
343                 
344                 fhGenOmegaPt  = (TH1F *) outputList->At(index++); 
345                 fhGenOmegaEta = (TH1F *) outputList->At(index++); 
346                 fhGenOmegaPhi = (TH1F *) outputList->At(index++); 
347                 
348                 fhGenElePt    = (TH1F *) outputList->At(index++); 
349                 fhGenEleEta   = (TH1F *) outputList->At(index++); 
350                 fhGenElePhi   = (TH1F *) outputList->At(index++); 
351                 
352                 fhGenGamAccE   = (TH1F *) outputList->At(index++);              
353                 fhGenGamAccPt  = (TH1F *) outputList->At(index++); 
354                 fhGenGamAccEta = (TH1F *) outputList->At(index++); 
355                 fhGenGamAccPhi = (TH1F *) outputList->At(index++); 
356                 
357                 fhGenPi0AccE   = (TH1F *) outputList->At(index++);              
358                 fhGenPi0AccPt  = (TH1F *) outputList->At(index++); 
359                 fhGenPi0AccEta = (TH1F *) outputList->At(index++); 
360                 fhGenPi0AccPhi = (TH1F *) outputList->At(index++); 
361              
362                 //Track matching
363                 fhMCEle1pOverE =    (TH2F *) outputList->At(index++);
364                 fhMCEle1dR =        (TH1F *) outputList->At(index++);
365                 fhMCEle2MatchdEdx = (TH2F *) outputList->At(index++);
366         
367                 fhMCChHad1pOverE =    (TH2F *) outputList->At(index++);
368                 fhMCChHad1dR =        (TH1F *) outputList->At(index++);
369                 fhMCChHad2MatchdEdx = (TH2F *) outputList->At(index++);
370         
371                 fhMCNeutral1pOverE    = (TH2F *) outputList->At(index++);
372                 fhMCNeutral1dR        = (TH1F *) outputList->At(index++);
373                 fhMCNeutral2MatchdEdx = (TH2F *) outputList->At(index++);
374         
375                 fhMCEle1pOverER02     =    (TH2F *) outputList->At(index++);
376                 fhMCChHad1pOverER02   =    (TH2F *) outputList->At(index++);
377                 fhMCNeutral1pOverER02 =    (TH2F *) outputList->At(index++);
378         }//Is data MC
379 }
380
381
382 //__________________________________________________________________
383 void  DrawCaloQA(TString fCalorimeter = "EMCAL", TString dataType = "ESD", Bool_t isDataMC = kFALSE) 
384 {
385         //Macro for replotting Calorimeter QA histograms
386         Bool_t fCorrelateCalos = kFALSE;
387         Int_t fNModules = 12;
388         //By default when PHOS QA is called correlation not done
389         if(fCalorimeter == "PHOS") {
390                 fCorrelateCalos = kFALSE;
391                 fNModules = 3;//5
392         }
393         else {
394                 fCorrelateCalos = kTRUE;
395                 fNModules = 4;//12
396         }
397         cout<<"Calo? "<<fCalorimeter<<" Correlate plots? "<<fCorrelateCalos<<" MC plots?"<<isDataMC<<endl;
398         //Do some plots to end
399         gROOT->Macro("./style.C");//Set different root style parameters
400         //Recover histograms from output histograms list, needed for distributed analysis.      
401         ReadHistograms(fCalorimeter+"_", dataType, isDataMC, fCorrelateCalos,fNModules);
402         Float_t minx = 0;
403         Float_t maxx = 10;
404         
405         char name[128];
406         char cname[128];
407         
408         //Reconstructed distributions
409         //printf("c1\n");
410         sprintf(cname,"QA_%s_rec",fCalorimeter.Data());
411         TCanvas  * c = new TCanvas(cname, "Reconstructed distributions", 400, 400) ;
412         c->Divide(2, 2);
413         
414         fhE->SetAxisRange(minx,maxx,"X");
415         fhPt->SetAxisRange(minx,maxx,"X");
416         
417         c->cd(1) ; 
418         if(fhE->GetEntries() > 0) gPad->SetLogy();
419         TLegend pLegendE(0.7,0.6,0.9,0.8);
420         pLegendE.SetTextSize(0.03);
421         pLegendE.AddEntry(fhE,"all modules","L");
422         pLegendE.SetFillColor(10);
423         pLegendE.SetBorderSize(1);
424         
425         fhE->SetLineColor(1);
426         fhE->Draw();
427         for(Int_t imod = 0; imod < fNModules; imod++){
428                 fhEMod[imod]->SetLineColor(imod+1);
429                 fhEMod[imod]->Draw("same");
430                 pLegendE.AddEntry(fhEMod[imod],Form("module %d",imod),"L");
431         }
432         pLegendE.Draw();
433         
434         c->cd(2) ; 
435         gPad->SetLogy();
436         fhPt->SetLineColor(4);
437         fhPt->Draw();
438         
439         c->cd(3) ; 
440         fhPhi->SetLineColor(4);
441         fhPhi->Draw();
442         
443         c->cd(4) ; 
444         fhEta->SetLineColor(4);
445         fhEta->Draw();
446         
447         sprintf(name,"QA_%s_ReconstructedDistributions.eps",fCalorimeter.Data());
448         c->Print(name);
449         
450         //Reconstructed distributions, matched with tracks
451         //printf("c2\n");
452         sprintf(cname,"QA_%s_rectrackmatch",fCalorimeter.Data());
453         TCanvas  * c2 = new TCanvas(cname, "Reconstructed distributions, matched with tracks", 400, 400) ;
454         c2->Divide(2, 2);
455         
456         fhECharged->SetAxisRange(minx,maxx,"X");
457         fhPtCharged->SetAxisRange(minx,maxx,"X");
458
459         c2->cd(1) ; 
460         gPad->SetLogy();
461         fhECharged->SetLineColor(4);
462         fhECharged->Draw();
463         
464         c2->cd(2) ; 
465         gPad->SetLogy();
466         fhPtCharged->SetLineColor(4);
467         fhPtCharged->Draw();
468         
469         c2->cd(3) ; 
470         fhPhiCharged->SetLineColor(4);
471         fhPhiCharged->Draw();
472         
473         c2->cd(4) ; 
474         fhEtaCharged->SetLineColor(4);
475         fhEtaCharged->Draw();
476         
477         sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched.eps",fCalorimeter.Data());
478         c2->Print(name);
479         
480         TH1F *  hEChargedClone   = (TH1F*)   fhECharged->Clone("EChargedClone");
481         TH1F *  hPtChargedClone  = (TH1F*)   fhPtCharged->Clone("PtChargedClone");
482         TH1F *  hEtaChargedClone = (TH1F*)   fhEtaCharged->Clone("EtaChargedClone");
483         TH1F *  hPhiChargedClone = (TH1F*)   fhPhiCharged->Clone("PhiChargedClone");
484         
485         TH1F *  hEChargedClone2   = (TH1F*)   fhECharged->Clone("EChargedClone2");
486         TH1F *  hPtChargedClone2  = (TH1F*)   fhPtCharged->Clone("PtChargedClone2");
487         TH1F *  hEtaChargedClone2 = (TH1F*)   fhEtaCharged->Clone("EtaChargedClone2");
488         TH1F *  hPhiChargedClone2 = (TH1F*)   fhPhiCharged->Clone("PhiChargedClone2");
489         
490         //Ratio: reconstructed track matched/ all reconstructed
491         //printf("c3\n");
492         sprintf(cname,"QA_%s_rectrackmatchrat",fCalorimeter.Data());
493         TCanvas  * c3 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
494         c3->Divide(2, 2);
495         
496         c3->cd(1) ;
497         gPad->SetLogy();
498         hEChargedClone->SetTitleOffset(1.6,"Y");
499         hEChargedClone->SetYTitle("track matched / all   ");
500         hEChargedClone->SetXTitle("E (GeV)");
501         hEChargedClone->Divide(fhE);
502         hEChargedClone->Draw();
503         
504         c3->cd(2) ; 
505         gPad->SetLogy();
506         hPtChargedClone->SetTitleOffset(1.6,"Y");
507         hPtChargedClone->SetYTitle("track matched / all   ");
508         hPtChargedClone->SetXTitle("p_{T} (GeV/c)");
509         hPtChargedClone->Divide(fhPt);
510         hPtChargedClone->Draw();
511         
512         c3->cd(3) ;
513         gPad->SetLogy();
514         hPhiChargedClone->SetTitleOffset(1.6,"Y");
515         hPhiChargedClone->SetYTitle("track matched / all   ");
516         hPhiChargedClone->SetXTitle("#phi (rad)");
517         hPhiChargedClone->Divide(fhPhi);
518         hPhiChargedClone->Draw();
519         
520         c3->cd(4) ; 
521         gPad->SetLogy();
522         hEtaChargedClone->SetTitleOffset(1.6,"Y");
523         hEtaChargedClone->SetYTitle("track matched / all   ");
524         hEtaChargedClone->SetXTitle("#eta");
525         hEtaChargedClone->Divide(fhEta);
526         hEtaChargedClone->Draw();
527         
528         sprintf(name,"QA_%s_RatioReconstructedMatchedDistributions.eps",fCalorimeter.Data());
529         c3->Print(name);
530         
531         //Ratio: reconstructed track matched (minus no track param) / all
532         //printf("c333\n");
533         sprintf(cname,"QA_%s_rectrackmatchratout",fCalorimeter.Data());
534         TCanvas  * c333 = new TCanvas(cname, "Ratio: reconstructed track matched (with outer track param)/ all", 400, 400) ;
535         c333->Divide(2, 2);
536         
537         c333->cd(1) ;
538         hEChargedClone2->Add(fhEChargedNoOut,-1);
539         hEChargedClone2->SetYTitle("track matched / all");
540         hEChargedClone2->SetXTitle("E (GeV)");
541         hEChargedClone2->Divide(fhE);
542         hEChargedClone2->Draw();
543         
544         c333->cd(2) ; 
545         hPtChargedClone2->Add(fhPtChargedNoOut,-1);
546         hPtChargedClone2->SetYTitle("track matched / all");
547         hPtChargedClone2->SetXTitle("p_{T} (GeV/c)");
548         hPtChargedClone2->Divide(fhPt);
549         hPtChargedClone2->Draw();
550         
551         c333->cd(3) ;
552         hPhiChargedClone2->Add(fhPhiChargedNoOut,-1);
553         hPhiChargedClone2->SetYTitle("track matched / all");
554         hPhiChargedClone2->SetXTitle("#phi (rad)");
555         hPhiChargedClone2->Divide(fhPhi);
556         hPhiChargedClone2->Draw();
557         
558         c333->cd(4) ; 
559         hEtaChargedClone2->Add(fhEtaChargedNoOut,-1);
560         hEtaChargedClone2->SetYTitle("track matched / all");
561         hEtaChargedClone2->SetXTitle("#eta");
562         hEtaChargedClone2->Divide(fhEta);
563         hEtaChargedClone2->Draw();
564         
565         sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsOuter.eps",fCalorimeter.Data());
566         c333->Print(name);
567         
568 //      //Reconstructed distributions, matched with tracks but no outer param
569 //      //printf("c2\n");
570 //      sprintf(cname,"QA_%s_rectrackmatch_noout",fCalorimeter.Data());
571 //      TCanvas  * c22 = new TCanvas(cname, "Reconstructed distributions, matched with tracks, no outer track param", 400, 400) ;
572 //      c22->Divide(2, 2);
573 //      
574 //      c22->cd(1) ; 
575 //      gPad->SetLogy();
576 //      fhEChargedNoOut->SetLineColor(4);
577 //      fhEChargedNoOut->Draw();
578 //      
579 //      c22->cd(2) ; 
580 //      gPad->SetLogy();
581 //      fhPtChargedNoOut->SetLineColor(4);
582 //      fhPtChargedNoOut->Draw();
583 //      
584 //      c22->cd(3) ; 
585 //      fhPhiChargedNoOut->SetLineColor(4);
586 //      fhPhiChargedNoOut->Draw();
587 //      
588 //      c22->cd(4) ; 
589 //      fhEtaChargedNoOut->SetLineColor(4);
590 //      fhEtaChargedNoOut->Draw();
591 //      
592 //      sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatched_NoOutParam.eps",fCalorimeter.Data());
593 //      c22->Print(name);
594         
595         //Ratio: reconstructed track matched/ all reconstructed
596         //printf("c3\n");
597         
598 //      TH1F *  hEChargedNoOutClone   = (TH1F*)   fhEChargedNoOut->Clone("EChargedNoOutClone");
599 //      TH1F *  hPtChargedNoOutClone  = (TH1F*)   fhPtChargedNoOut->Clone("PtChargedNoOutClone");
600 //      TH1F *  hEtaChargedNoOutClone = (TH1F*)   fhEtaChargedNoOut->Clone("EtaChargedNoOutClone");
601 //      TH1F *  hPhiChargedNoOutClone = (TH1F*)   fhPhiChargedNoOut->Clone("PhiChargedNoOutClone");     
602 //      
603 //      sprintf(cname,"QA_%s_rectrackmatchratnoout",fCalorimeter.Data());
604 //      TCanvas  * c33 = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed", 400, 400) ;
605 //      c33->Divide(2, 2);
606 //      
607 //      c33->cd(1) ;
608 //      hEChargedNoOutClone->SetYTitle("track matched no out/ all matched");
609 //      hEChargedNoOutClone->SetXTitle("E (GeV)");
610 //      hEChargedNoOutClone->Divide(fhECharged);
611 //      hEChargedNoOutClone->Draw();
612 //      
613 //      c33->cd(2) ; 
614 //      hPtChargedNoOutClone->SetYTitle("track matched no out / all matched");
615 //      hPtChargedNoOutClone->SetXTitle("p_{T} (GeV/c)");
616 //      hPtChargedNoOutClone->Divide(fhPtCharged);
617 //      hPtChargedNoOutClone->Draw();
618 //      
619 //      c33->cd(3) ;
620 //      hPhiChargedNoOutClone->SetYTitle("track matched no out/ all matched");
621 //      hPhiChargedNoOutClone->SetXTitle("#phi (rad)");
622 //      hPhiChargedNoOutClone->Divide(fhPhiCharged);
623 //      hPhiChargedNoOutClone->Draw();
624 //      
625 //      c33->cd(4) ; 
626 //      hEtaChargedNoOutClone->SetYTitle("track matched no out/ all matched");
627 //      hEtaChargedNoOutClone->SetXTitle("#eta");
628 //      hEtaChargedNoOutClone->Divide(fhEtaCharged);
629 //      hEtaChargedNoOutClone->Draw();
630 //      
631 //      sprintf(name,"QA_%s_RatioMatchedDistributionsAllToNoOut.eps",fCalorimeter.Data());
632 //      c33->Print(name);
633         
634         
635
636         //TRACK MATCHING P/E distributions
637         //printf("cPoverE\n");
638         sprintf(cname,"QA_%s_trkmatch",fCalorimeter.Data());
639         TCanvas *cme = new TCanvas(cname,"Track-matching distributions", 400, 400);
640         cme->Divide(2,2);
641         
642         TLegend pLegendpE0(0.6,0.55,0.9,0.8);
643         pLegendpE0.SetTextSize(0.04);
644         pLegendpE0.AddEntry(fh1pOverE,"all","L");
645         pLegendpE0.AddEntry(fh1pOverER02,"dR < 0.02","L");
646         pLegendpE0.SetFillColor(10);
647         pLegendpE0.SetBorderSize(1);
648         //pLegendpE0.Draw();
649         
650         cme->cd(1);
651         gPad->SetLogy();
652         fh1pOverE->SetTitle("Track matches p/E");
653         fh1pOverE->Draw();
654         fh1pOverER02->SetLineColor(4);
655         fh1pOverER02->Draw("same");
656         pLegendpE0.Draw();
657         
658         cme->cd(2);
659         gPad->SetLogy();
660         fh1dR->Draw();
661         
662         cme->cd(3);
663         fh2MatchdEdx->Draw();
664         
665         cme->cd(4);
666         fh2EledEdx->Draw();
667         
668         sprintf(name,"QA_%s_TrackMatchingEleDist.eps",fCalorimeter.Data());
669         cme->Print(name);       
670
671         //eta vs phi
672         //printf("c4\n");
673         sprintf(cname,"QA_%s_etavsphi",fCalorimeter.Data());
674 //      TCanvas  * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 600, 200) ;
675 //      c4->Divide(3, 1);
676         
677         TCanvas  * c4 = new TCanvas(cname, "reconstructed #eta vs #phi", 400, 200) ;
678         c4->Divide(2, 1);
679         
680         c4->cd(1) ;
681         fhEtaPhi->Draw("cont");
682         
683         c4->cd(2) ; 
684         fhEtaPhiCharged->Draw("cont");
685         
686 //      c4->cd(3) ; 
687 //      fhEtaPhiChargedNoOut->Draw("cont");
688
689         sprintf(name,"QA_%s_ReconstructedEtaVsPhi.eps",fCalorimeter.Data());
690         c4->Print(name);
691         
692         sprintf(name,"QA_%s_ReconstructedEtaVsPhiVsE.eps",fCalorimeter.Data());
693         c4->Print(name); printf("Plot: %s\n",name);
694         
695         //Invariant mass
696         Int_t binmin = -1;
697         Int_t binmax = -1;
698         
699         if(fhIM->GetEntries() > 1){
700                 Int_t nebins  = fhIM->GetNbinsX();
701                 Int_t emax = (Int_t) fhIM->GetXaxis()->GetXmax();
702                 Int_t emin = (Int_t) fhIM->GetXaxis()->GetXmin();
703                 if (emin != 0 ) printf("emin != 0 \n");
704                 //printf("IM: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
705                 
706                 sprintf(cname,"QA_%s_IM",fCalorimeter.Data());
707                 //      printf("c5\n");
708                 TCanvas  * c5 = new TCanvas(cname, "Invariant mass", 600, 400) ;
709                 c5->Divide(2, 3);
710                 
711                 c5->cd(1) ; 
712                 //fhIM->SetLineColor(4);
713                 //fhIM->Draw();
714                 binmin = 0;
715                 binmax =  (Int_t) (1-emin)*nebins/emax;
716                 TH1D *pyim1 = fhIM->ProjectionY("pyim1",binmin,binmax);
717                 pyim1->SetTitle("E_{pair} < 1 GeV");
718                 pyim1->SetLineColor(1);
719                 pyim1->Draw();
720                 TLegend pLegendIM(0.7,0.6,0.9,0.8);
721                 pLegendIM.SetTextSize(0.03);
722                 pLegendIM.AddEntry(pyim1,"all modules","L");
723                 pLegendIM.SetFillColor(10);
724                 pLegendIM.SetBorderSize(1);
725                 for(Int_t imod = 0; imod < fNModules; imod++){
726                         pyim1 = fhIMMod[imod]->ProjectionY(Form("pyim1_%d",imod),binmin,binmax);
727                         pLegendIM.AddEntry(pyim1,Form("module %d",imod),"L");
728                         pyim1->SetLineColor(imod+1);
729                         pyim1->Draw("same");
730                 }
731                 pLegendIM.Draw();
732                 
733                 c5->cd(2) ; 
734                 binmin =  (Int_t) (1-emin)*nebins/emax;
735                 binmax =  (Int_t) (2-emin)*nebins/emax;
736                 TH1D *pyim2 = fhIM->ProjectionY("pyim2",binmin,binmax);
737                 pyim2->SetTitle("1 < E_{pair} < 2 GeV");
738                 pyim2->SetLineColor(1);
739                 pyim2->Draw();
740                 for(Int_t imod = 0; imod < fNModules; imod++){
741                         pyim2 = fhIMMod[imod]->ProjectionY(Form("pyim2_%d",imod),binmin,binmax);
742                         pyim2->SetLineColor(imod+1);
743                         pyim2->Draw("same");
744                 }
745                 
746                 c5->cd(3) ; 
747                 binmin =  (Int_t) (2-emin)*nebins/emax;
748                 binmax =  (Int_t) (3-emin)*nebins/emax;
749                 TH1D *pyim3 = fhIM->ProjectionY("pyim3",binmin,binmax);
750                 pyim3->SetTitle("2 < E_{pair} < 3 GeV");
751                 pyim3->SetLineColor(1);
752                 pyim3->Draw();
753                 for(Int_t imod = 0; imod < fNModules; imod++){
754                         pyim3 = fhIMMod[imod]->ProjectionY(Form("pyim3_%d",imod),binmin,binmax);
755                         pyim3->SetLineColor(imod+1);
756                         pyim3->Draw("same");
757                 }
758                 
759                 c5->cd(4) ;
760                 binmin =  (Int_t) (3-emin)*nebins/emax;
761                 binmax =  (Int_t) (4-emin)*nebins/emax;
762                 TH1D *pyim4 = fhIM->ProjectionY("pyim4",binmin,binmax);
763                 pyim4->SetTitle("3 < E_{pair} < 4 GeV");
764                 pyim4->SetLineColor(1);
765                 pyim4->Draw();
766                 for(Int_t imod = 0; imod < fNModules; imod++){
767                         pyim4 = fhIMMod[imod]->ProjectionY(Form("pyim4_%d",imod),binmin,binmax);
768                         pyim4->SetLineColor(imod+1);
769                         pyim4->Draw("same");
770                 }
771                 
772                 c5->cd(5) ;
773                 binmin =  (Int_t) (4-emin)*nebins/emax;
774                 binmax =  (Int_t) (5-emin)*nebins/emax;
775                 TH1D *pyim5 = fhIM->ProjectionY("pyim5",binmin,binmax);
776                 pyim5->SetTitle("4< E_{pair} < 5 GeV");
777                 pyim5->SetLineColor(1);
778                 pyim5->Draw();
779                 for(Int_t imod = 0; imod < fNModules; imod++){
780                         pyim5 = fhIMMod[imod]->ProjectionY(Form("pyim5_%d",imod),binmin,binmax);
781                         pyim5->SetLineColor(imod+1);
782                         pyim5->Draw("same");
783                 }
784                 
785                 c5->cd(6) ;
786                 binmin =  (Int_t) (5-emin)*nebins/emax;
787                 binmax =  -1;
788                 TH1D *pyim10 = fhIM->ProjectionY("pyim10",binmin,binmax);
789                 pyim10->SetTitle("E_{pair} > 5 GeV");
790                 pyim10->SetLineColor(1);
791                 pyim10->Draw();
792                 for(Int_t imod = 0; imod < fNModules; imod++){
793                         pyim10 = fhIMMod[imod]->ProjectionY(Form("pyim10_%d",imod),binmin,binmax);
794                         pyim10->SetLineColor(imod+1);
795                         pyim10->Draw("same");
796                 }
797                 
798                 sprintf(name,"QA_%s_InvariantMass.eps",fCalorimeter.Data());
799                 c5->Print(name); printf("Plot: %s\n",name);
800         }
801         
802         
803         if(fhIMCellCut->GetEntries() > 1){
804                 Int_t nebins  = fhIMCellCut->GetNbinsX();
805                 Int_t emax = (Int_t) fhIMCellCut->GetXaxis()->GetXmax();
806                 Int_t emin = (Int_t) fhIMCellCut->GetXaxis()->GetXmin();
807                 if (emin != 0 ) printf("emin != 0 \n");
808                 //printf("IMCellCut: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
809                 
810                 sprintf(cname,"QA_%s_IMCellCut",fCalorimeter.Data());
811                 //      printf("c5cc\n");
812                 TCanvas  * c5cc = new TCanvas(cname, "Invariant mass, Cell Cut", 600, 400) ;
813                 c5cc->Divide(2, 3);
814                 
815                 c5cc->cd(1) ; 
816                 //fhIMCellCut->SetLineColor(4);
817                 //fhIMCellCut->Draw();
818                 binmin = 0;
819                 binmax =  (Int_t) (1-emin)*nebins/emax;
820                 TH1D *pyimcc1 = fhIMCellCut->ProjectionY("pyimcc1",binmin,binmax);
821                 pyimcc1->SetTitle("E_{pair} < 1 GeV");
822                 pyimcc1->SetLineColor(1);
823                 pyimcc1->Draw();
824                 TLegend pLegendIMCellCut(0.7,0.6,0.9,0.8);
825                 pLegendIMCellCut.SetTextSize(0.03);
826                 pLegendIMCellCut.AddEntry(pyimcc1,"all modules","L");
827                 pLegendIMCellCut.SetFillColor(10);
828                 pLegendIMCellCut.SetBorderSize(1);
829                 for(Int_t imod = 0; imod < fNModules; imod++){
830                         pyimcc1 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc1_%d",imod),binmin,binmax);
831                         pLegendIMCellCut.AddEntry(pyimcc1,Form("module %d",imod),"L");
832                         pyimcc1->SetLineColor(imod+1);
833                         pyimcc1->Draw("same");
834                 }
835                 pLegendIMCellCut.Draw();
836                 
837                 c5cc->cd(2) ; 
838                 binmin =  (Int_t) (1-emin)*nebins/emax;
839                 binmax =  (Int_t) (2-emin)*nebins/emax;
840                 TH1D *pyimcc2 = fhIMCellCut->ProjectionY("pyimcc2",binmin,binmax);
841                 pyimcc2->SetTitle("1 < E_{pair} < 2 GeV");
842                 pyimcc2->SetLineColor(1);
843                 pyimcc2->Draw();
844                 for(Int_t imod = 0; imod < fNModules; imod++){
845                         pyimcc2 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc2_%d",imod),binmin,binmax);
846                         pyimcc2->SetLineColor(imod+1);
847                         pyimcc2->Draw("same");
848                 }
849                 
850                 c5cc->cd(3) ; 
851                 binmin =  (Int_t) (2-emin)*nebins/emax;
852                 binmax =  (Int_t) (3-emin)*nebins/emax;
853                 TH1D *pyimcc3 = fhIMCellCut->ProjectionY("pyimcc3",binmin,binmax);
854                 pyimcc3->SetTitle("2 < E_{pair} < 3 GeV");
855                 pyimcc3->SetLineColor(1);
856                 pyimcc3->Draw();
857                 for(Int_t imod = 0; imod < fNModules; imod++){
858                         pyimcc3 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc3_%d",imod),binmin,binmax);
859                         pyimcc3->SetLineColor(imod+1);
860                         pyimcc3->Draw("same");
861                 }
862                 
863                 c5cc->cd(4) ;
864                 binmin =  (Int_t) (3-emin)*nebins/emax;
865                 binmax =  (Int_t) (4-emin)*nebins/emax;
866                 TH1D *pyimcc4 = fhIMCellCut->ProjectionY("pyimcc4",binmin,binmax);
867                 pyimcc4->SetTitle("3 < E_{pair} < 4 GeV");
868                 pyimcc4->SetLineColor(1);
869                 pyimcc4->Draw();
870                 for(Int_t imod = 0; imod < fNModules; imod++){
871                         pyimcc4 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc4_%d",imod),binmin,binmax);
872                         pyimcc4->SetLineColor(imod+1);
873                         pyimcc4->Draw("same");
874                 }
875                 
876                 c5cc->cd(5) ;
877                 binmin =  (Int_t) (4-emin)*nebins/emax;
878                 binmax =  (Int_t) (5-emin)*nebins/emax;
879                 TH1D *pyimcc5cc = fhIMCellCut->ProjectionY("pyimcc5cc",binmin,binmax);
880                 pyimcc5cc->SetTitle("4< E_{pair} < 5 GeV");
881                 pyimcc5cc->SetLineColor(1);
882                 pyimcc5cc->Draw();
883                 for(Int_t imod = 0; imod < fNModules; imod++){
884                         pyimcc5cc = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc5cc_%d",imod),binmin,binmax);
885                         pyimcc5cc->SetLineColor(imod+1);
886                         pyimcc5cc->Draw("same");
887                 }
888                 
889                 c5cc->cd(6) ;
890                 binmin =  (Int_t) (5-emin)*nebins/emax;
891                 binmax =  -1;
892                 TH1D *pyimcc10 = fhIMCellCut->ProjectionY("pyimcc10",binmin,binmax);
893                 pyimcc10->SetTitle("E_{pair} > 5 GeV");
894                 pyimcc10->SetLineColor(1);
895                 pyimcc10->Draw();
896                 for(Int_t imod = 0; imod < fNModules; imod++){
897                         pyimcc10 = fhIMCellCutMod[imod]->ProjectionY(Form("pyimcc10_%d",imod),binmin,binmax);
898                         pyimcc10->SetLineColor(imod+1);
899                         pyimcc10->Draw("same");
900                 }
901                 
902                 sprintf(name,"QA_%s_InvariantMass_CellCut.eps",fCalorimeter.Data());
903                 c5cc->Print(name); printf("Plot: %s\n",name);
904         }
905         //Asymmetry
906         //printf("c5b\n");
907         if(fhAsym->GetEntries() > 1){
908                 Int_t nebins  = fhAsym->GetNbinsX();
909                 Int_t emax = (Int_t) fhAsym->GetXaxis()->GetXmax();
910                 Int_t emin = (Int_t) fhAsym->GetXaxis()->GetXmin();
911                 if (emin != 0 ) printf("emin != 0 \n");
912                 //printf("Asym: nBinsX %d, emin %2.2f, emax %2.2f\n",nebins,emin,emax);
913                 
914                 sprintf(cname,"QA_%s_Asym",fCalorimeter.Data());
915                 //      printf("c5\n");
916                 TCanvas  * c5b = new TCanvas(cname, "Asymmetry", 400, 400) ;
917                 c5b->Divide(2, 2);
918                 
919                 c5b->cd(1) ; 
920                 fhAsym->SetTitleOffset(1.6,"Y");
921                 fhAsym->SetLineColor(4);
922                 fhAsym->Draw();
923                 
924                 c5b->cd(2) ; 
925                 binmin = 0;
926                 binmax = (Int_t) (5-emin)*nebins/emax;
927                 TH1D *pyAsym5 = fhAsym->ProjectionY("pyAsym5",binmin,binmax);
928                 pyAsym5->SetTitle("E_{pair} < 5 GeV");
929                 pyAsym5->SetLineColor(4);
930                 pyAsym5->Draw();
931                 
932                 c5b->cd(3) ; 
933                 binmin = (Int_t) (5-emin)*nebins/emax;
934                 binmax = (Int_t) (10-emin)*nebins/emax;
935                 TH1D *pyAsym510 = fhAsym->ProjectionY("pyAsym5_10",binmin,binmax);
936                 pyAsym510->SetTitle("5 < E_{pair} < 10 GeV");
937                 pyAsym510->SetLineColor(4);
938                 pyAsym510->Draw();
939                 
940                 c5b->cd(4) ;
941                 binmin = (Int_t) (10-emin)*nebins/emax;
942                 binmax = -1;
943                 TH1D *pyAsym10 = fhAsym->ProjectionY("pyAsym10",binmin,binmax);
944                 pyAsym10->SetTitle("E_{pair} > 10 GeV");
945                 pyAsym10->SetLineColor(4);
946                 pyAsym10->Draw();
947                 
948                 sprintf(name,"QA_%s_Asymmetry.eps",fCalorimeter.Data());
949                 c5b->Print(name);
950         }
951                 
952         
953         //CaloCells
954         //printf("c9\n");
955         sprintf(cname,"QA_%s_nclustercellsamp",fCalorimeter.Data());
956         TCanvas  * c9 = new TCanvas(cname, " CaloClusters and CaloCells", 400, 400) ;
957         c9->Divide(2, 2);
958         
959         c9->cd(1) ; 
960         
961         TLegend pLegendN(0.7,0.6,0.9,0.8);
962         pLegendN.SetTextSize(0.03);
963         pLegendN.AddEntry(fhNClusters,"all modules","L");
964         pLegendN.SetFillColor(10);
965         pLegendN.SetBorderSize(1);
966         
967         if(fhNClusters->GetEntries() > 0) gPad->SetLogy();
968         gPad->SetLogx();
969         fhNClusters->SetLineColor(1);
970         fhNClusters->Draw();
971         for(Int_t imod = 0; imod < fNModules; imod++){
972                 fhNClustersMod[imod]->SetLineColor(imod+1);
973                 fhNClustersMod[imod]->Draw("same");
974                 pLegendN.AddEntry(fhNClustersMod[imod],Form("module %d",imod),"L");
975         }
976         pLegendN.Draw();
977         
978         c9->cd(2) ; 
979         if(fhNCells->GetEntries() > 0) gPad->SetLogy();
980         gPad->SetLogx();
981         fhNCells->SetLineColor(1);
982         fhNCells->Draw();
983         for(Int_t imod = 0; imod < fNModules; imod++){
984                 fhNCellsMod[imod]->SetLineColor(imod+1);
985                 fhNCellsMod[imod]->Draw("same");
986         }
987         c9->cd(3) ; 
988         if(fhNCellsPerCluster->GetEntries() > 0) gPad->SetLogy();
989         gPad->SetLogx();
990         TH1D *cpc = fhNCellsPerCluster->ProjectionY("cpc",-1,-1);
991         cpc->SetLineColor(1);
992         cpc->Draw();
993         for(Int_t imod = 0; imod < fNModules; imod++){
994                 cpc = fhNCellsPerClusterMod[imod]->ProjectionY(Form("cpc_%d",imod),-1,-1);
995                 cpc->SetLineColor(imod+1);
996                 cpc->Draw("same");
997         }
998         
999         c9->cd(4) ; 
1000         if(fhAmplitude->GetEntries() > 0) gPad->SetLogy();
1001         gPad->SetLogx();
1002         fhAmplitude->SetLineColor(1);
1003         fhAmplitude->Draw();
1004         for(Int_t imod = 0; imod < fNModules; imod++){
1005                 fhAmplitudeMod[imod]->SetLineColor(imod+1);
1006                 fhAmplitudeMod[imod]->Draw("same");
1007         }
1008         
1009         sprintf(name,"QA_%s_CaloClustersAndCaloCells.eps",fCalorimeter.Data());
1010         c9->Print(name); printf("Plot: %s\n",name);
1011
1012         //Cell Time histograms, time only available in ESDs
1013         if(dataType=="ESD") {
1014                 
1015                 sprintf(cname,"QA_%s_cellstime",fCalorimeter.Data());
1016                 TCanvas  * ctime = new TCanvas(cname, " Cells time", 1200, 400) ;
1017                 ctime->Divide(3, 1);
1018                 
1019                 ctime->cd(1) ; 
1020                 if(fhTime->GetEntries() > 0) gPad->SetLogy();
1021                 fhTime->Draw();
1022                 
1023                 ctime->cd(2) ; 
1024                 //if(fhTimeId->GetEntries() > 0) gPad->SetLogy();
1025                 fhTimeId->Draw("colz");
1026                 
1027                 ctime->cd(3) ; 
1028                 //if(fhTimeAmp->GetEntries() > 0) gPad->SetLogy();
1029                 fhTimeAmp->Draw("colz");
1030                 
1031                 sprintf(name,"QA_%s_CellsTime.eps",fCalorimeter.Data());
1032                 ctime->Print(name); printf("Plot: %s\n",name);
1033         }
1034         
1035         
1036         if(fCorrelateCalos){
1037                 //Calorimeter Correlation, PHOS vs EMCAL
1038                 sprintf(cname,"QA_%s_CaloCorr_EMCALvsPHOS",fCalorimeter.Data());
1039                 TCanvas  * ccorr = new TCanvas(cname, " EMCAL vs PHOS", 400, 400) ;
1040                 ccorr->Divide(2, 2);
1041                 
1042                 ccorr->cd(1) ; 
1043                 //gPad->SetLogy();
1044                 //gPad->SetLogx();
1045                 fhCaloCorrNClusters ->Draw();
1046                 
1047                 ccorr->cd(2) ; 
1048                 //gPad->SetLogy();
1049                 //gPad->SetLogx();
1050                 fhCaloCorrNCells->Draw();
1051                 
1052                 ccorr->cd(3) ; 
1053                 //gPad->SetLogy();
1054                 //gPad->SetLogx();
1055                 fhCaloCorrEClusters->Draw();
1056                 
1057                 ccorr->cd(4) ; 
1058                 //gPad->SetLogy();
1059                 //gPad->SetLogx();
1060                 fhCaloCorrECells->Draw();
1061                 
1062                 sprintf(name,"QA_%s_CaloCorr_EMCALvsPHOS.eps",fCalorimeter.Data());
1063                 ccorr->Print(name); printf("Plot: %s\n",name);
1064         }
1065         
1066         //Grid of cell per module plots 
1067     {
1068                 gStyle->SetOptStat(0);
1069                 sprintf(cname,"QA_%s_GridCellEntries",fCalorimeter.Data());
1070                 //      printf("c5\n");
1071                 TCanvas *cgrid   = new TCanvas("cgrid","Number of entries per cell", 12,12,800,400);
1072                 if(fNModules%2 == 0)
1073                         cgrid->Divide(fNModules/2,2); 
1074                 else
1075                         cgrid->Divide(fNModules/2+1,2); 
1076                 
1077                 for(Int_t imod = 0; imod < fNModules ; imod++){
1078                         cgrid->cd(imod+1);
1079                         gPad->SetLogz();
1080                         gPad->SetGridy();
1081                         gPad->SetGridx();
1082                         fhGridCellsMod[imod]->SetLabelSize(0.025,"z");
1083                         fhGridCellsMod[imod]->Draw("colz");
1084                 }
1085                 sprintf(name,"QA_%s_GridCellsEntries.eps",fCalorimeter.Data());
1086                 cgrid->Print(name); printf("Plot: %s\n",name);
1087                 
1088                 sprintf(cname,"QA_%s_GridCellAccumEnergy",fCalorimeter.Data());
1089                 //      printf("c5\n");
1090                 TCanvas *cgridE   = new TCanvas("cgridE","Summed energy per cell", 12,12,800,400);
1091                 cgridE->Divide(fNModules/2,2); 
1092                 for(Int_t imod = 0; imod < fNModules ; imod++){
1093                         cgridE->cd(imod+1);
1094                         gPad->SetLogz();
1095                         gPad->SetGridy();
1096                         gPad->SetGridx();
1097                         fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
1098                         fhGridCellsEMod[imod]->Draw("colz");
1099                 }
1100                 sprintf(name,"QA_%s_GridCellsAccumEnergy.eps",fCalorimeter.Data());
1101                 cgridE->Print(name); printf("Plot: %s\n",name);
1102                 
1103                 sprintf(cname,"QA_%s_GridCellAverageEnergy",fCalorimeter.Data());
1104                 //      printf("c5\n");
1105                 TCanvas *cgridEA   = new TCanvas("cgridEA","Average energy per cell", 12,12,800,400);
1106                 cgridEA->Divide(fNModules/2,2); 
1107                 for(Int_t imod = 0; imod < fNModules ; imod++){
1108                         cgridEA->cd(imod+1);
1109                         gPad->SetLogz();
1110                         gPad->SetGridy();
1111                         gPad->SetGridx();
1112                         fhGridCellsEMod[imod]->SetLabelSize(0.025,"z");
1113                         fhGridCellsEMod[imod]->Divide(fhGridCellsMod[imod]);
1114                         fhGridCellsEMod[imod]->Draw("colz");
1115                 }
1116                 sprintf(name,"QA_%s_GridCellsAverageEnergy.eps",fCalorimeter.Data());
1117                 cgridEA->Print(name); printf("Plot: %s\n",name);
1118                 
1119         }       
1120         
1121         if(isDataMC){
1122           //Reconstructed vs MC distributions
1123           //printf("c6\n");
1124           sprintf(cname,"QA_%s_recvsmc",fCalorimeter.Data());
1125           TCanvas  * c6 = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1126           c6->Divide(2, 2);
1127           
1128           fh2E->SetAxisRange(minx,maxx,"X");
1129           fh2Pt->SetAxisRange(minx,maxx,"X");
1130           fh2E->SetAxisRange(minx,maxx,"Y");
1131           fh2Pt->SetAxisRange(minx,maxx,"Y");
1132           
1133           c6->cd(1) ; 
1134           fh2E->SetTitleOffset(1.6,"Y");
1135           fh2E->SetLineColor(4);
1136           fh2E->Draw();
1137           
1138           c6->cd(2) ; 
1139           fh2Pt->SetTitleOffset(1.6,"Y");
1140           fh2Pt->SetLineColor(4);
1141           fh2Pt->Draw();
1142           
1143           c6->cd(3) ; 
1144           fh2Phi->SetTitleOffset(1.6,"Y");
1145           fh2Phi->SetLineColor(4);
1146           fh2Phi->Draw();
1147           
1148           c6->cd(4) ; 
1149           fh2Eta->SetTitleOffset(1.6,"Y");
1150           fh2Eta->SetLineColor(4);
1151           fh2Eta->Draw();
1152           
1153           sprintf(name,"QA_%s_ReconstructedVSMCDistributions.eps",fCalorimeter.Data());
1154           c6->Print(name);      
1155           
1156           //Reconstructed vs MC distributions
1157           //printf("c6\n");
1158           sprintf(cname,"QA_%s_gamrecvsmc",fCalorimeter.Data());
1159           TCanvas  * c6Gam = new TCanvas(cname, "Reconstructed vs MC distributions", 400, 400) ;
1160           c6Gam->Divide(2, 2);
1161           
1162           fhGamE->SetAxisRange(minx,maxx,"X");
1163           fhGamPt->SetAxisRange(minx,maxx,"X");
1164           
1165           c6Gam->cd(1) ; 
1166           fhGamE->Draw();
1167           
1168           c6Gam->cd(2) ; 
1169           fhGamPt->Draw();
1170           
1171           c6Gam->cd(3) ; 
1172           fhGamPhi->Draw();
1173           
1174           c6Gam->cd(4) ; 
1175           fhGamEta->Draw();
1176           
1177           sprintf(name,"QA_%s_GammaReconstructedVSMCDistributions.eps",fCalorimeter.Data());
1178           c6->Print(name);      
1179           
1180           //Generated - reconstructed  
1181           //printf("c7\n");
1182           sprintf(cname,"QA_%s_diffgenrec",fCalorimeter.Data());
1183           TCanvas  * c7 = new TCanvas(cname, "generated - reconstructed", 400, 400) ;
1184           c7->Divide(2, 2);
1185           
1186           c7->cd(1) ; 
1187           gPad->SetLogy();
1188           fhGamDeltaE->SetLineColor(4);
1189           fhDeltaE->Draw();
1190           fhGamDeltaE->Draw("same");
1191           
1192           TLegend pLegendd(0.65,0.55,0.9,0.8);
1193           pLegendd.SetTextSize(0.06);
1194           pLegendd.AddEntry(fhDeltaE,"all","L");
1195           pLegendd.AddEntry(fhGamDeltaE,"from  #gamma","L");
1196           pLegendd.SetFillColor(10);
1197           pLegendd.SetBorderSize(1);
1198           pLegendd.Draw();
1199           
1200           c7->cd(2) ; 
1201           gPad->SetLogy();
1202           fhGamDeltaPt->SetLineColor(4);
1203           fhDeltaPt->Draw();
1204           fhGamDeltaPt->Draw("same");
1205           
1206           c7->cd(3) ; 
1207           gPad->SetLogy();
1208           fhGamDeltaPhi->SetLineColor(4);
1209           fhDeltaPhi->Draw();
1210           fhGamDeltaPhi->Draw("same");
1211           
1212           c7->cd(4) ; 
1213           gPad->SetLogy();
1214           fhGamDeltaEta->SetLineColor(4);
1215           fhDeltaEta->Draw();
1216           fhGamDeltaEta->Draw("same");
1217           
1218           sprintf(name,"QA_%s_DiffGeneratedReconstructed.eps",fCalorimeter.Data());
1219           c7->Print(name);
1220           
1221           // Reconstructed / Generated 
1222           //printf("c8\n");
1223           sprintf(cname,"QA_%s_ratiorecgen",fCalorimeter.Data());
1224           TCanvas  * c8 = new TCanvas(cname, " reconstructed / generated", 400, 400) ;
1225           c8->Divide(2, 2);
1226           
1227           c8->cd(1) ; 
1228           gPad->SetLogy();
1229           fhGamRatioE->SetLineColor(4);
1230           fhRatioE->Draw();
1231           fhGamRatioE->Draw("same");
1232           
1233           TLegend pLegendr(0.65,0.55,0.9,0.8);
1234           pLegendr.SetTextSize(0.06);
1235           pLegendr.AddEntry(fhRatioE,"all","L");
1236           pLegendr.AddEntry(fhGamRatioE,"from  #gamma","L");
1237           pLegendr.SetFillColor(10);
1238           pLegendr.SetBorderSize(1);
1239           pLegendr.Draw();
1240           
1241           c8->cd(2) ; 
1242           gPad->SetLogy();
1243           fhGamRatioPt->SetLineColor(4);
1244           fhRatioPt->Draw();
1245           fhGamRatioPt->Draw("same");
1246           
1247           c8->cd(3) ; 
1248           fhGamRatioPhi->SetLineColor(4);
1249           fhRatioPhi->Draw();
1250           fhGamRatioPhi->Draw("same");
1251           
1252           c8->cd(4) ; 
1253           fhGamRatioEta->SetLineColor(4);
1254           fhRatioEta->Draw();
1255           fhGamRatioEta->Draw("same");
1256           
1257           sprintf(name,"QA_%s_ReconstructedDivGenerated.eps",fCalorimeter.Data());
1258           c8->Print(name);
1259           
1260           
1261           //Generated distributions
1262           //printf("c1\n");
1263           sprintf(cname,"QA_%s_gen",fCalorimeter.Data());
1264           TCanvas  * c10 = new TCanvas(cname, "Generated distributions", 600, 200) ;
1265           c10->Divide(3, 1);
1266           
1267           c10->cd(1) ; 
1268           gPad->SetLogy();
1269           TH1F * haxispt  = (TH1F*) fhGenPi0Pt->Clone("axispt");  
1270           haxispt->SetTitle("Generated Particles p_{T}, |#eta| < 1");
1271           fhGenPi0Pt->SetLineColor(1);
1272           fhGenGamPt->SetLineColor(4);
1273           fhGenEtaPt->SetLineColor(2);
1274           fhGenOmegaPt->SetLineColor(7);
1275           fhGenElePt->SetLineColor(6);
1276           
1277           //Select the maximum of the histogram to show all lines.
1278           if(fhGenPi0Pt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenEtaPt->GetMaximum() && 
1279              fhGenPi0Pt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenPi0Pt->GetMaximum() >= fhGenElePt->GetMaximum())
1280             haxispt->SetMaximum(fhGenPi0Pt->GetMaximum());
1281           else if(fhGenGamPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenEtaPt->GetMaximum() && 
1282                   fhGenGamPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenGamPt->GetMaximum() >= fhGenElePt->GetMaximum())
1283             haxispt->SetMaximum(fhGenGamPt->GetMaximum());
1284           else if(fhGenEtaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && 
1285                   fhGenEtaPt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenEtaPt->GetMaximum() >= fhGenElePt->GetMaximum())
1286             haxispt->SetMaximum(fhGenEtaPt->GetMaximum());      
1287           else if(fhGenOmegaPt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenEtaPt->GetMaximum() && 
1288                   fhGenOmegaPt->GetMaximum() >= fhGenGamPt->GetMaximum() && fhGenOmegaPt->GetMaximum() >= fhGenElePt->GetMaximum())
1289             haxispt->SetMaximum(fhGenOmegaPt->GetMaximum());
1290           else if(fhGenElePt->GetMaximum() >= fhGenPi0Pt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenEtaPt->GetMaximum() && 
1291                   fhGenElePt->GetMaximum() >= fhGenOmegaPt->GetMaximum() && fhGenElePt->GetMaximum() >= fhGenGamPt->GetMaximum())
1292             haxispt->SetMaximum(fhGenElePt->GetMaximum());
1293           haxispt->SetMinimum(1);
1294           haxispt->SetAxisRange(minx,maxx,"X"); 
1295           haxispt->Draw("axis");
1296           fhGenPi0Pt->Draw("same");
1297           fhGenGamPt->Draw("same");
1298           fhGenEtaPt->Draw("same");
1299           fhGenOmegaPt->Draw("same");
1300           fhGenElePt->Draw("same");
1301           
1302           TLegend pLegend(0.85,0.65,0.95,0.93);
1303           pLegend.SetTextSize(0.06);
1304           pLegend.AddEntry(fhGenPi0Pt,"  #pi^{0}","L");
1305           pLegend.AddEntry(fhGenGamPt,"  #gamma","L");
1306           pLegend.AddEntry(fhGenEtaPt,"  #eta","L");
1307           pLegend.AddEntry(fhGenOmegaPt,"  #omega","L");
1308           pLegend.AddEntry(fhGenElePt,"  e^{#pm}","L");
1309           pLegend.SetFillColor(10);
1310           pLegend.SetBorderSize(1);
1311           pLegend.Draw();
1312           
1313           c10->cd(2) ;
1314           gPad->SetLogy();
1315           TH1F * haxiseta  = (TH1F*) fhGenPi0Eta->Clone("axiseta");  
1316           haxiseta->SetTitle("Generated Particles #eta, |#eta| < 1");
1317           fhGenPi0Eta->SetLineColor(1);
1318           fhGenGamEta->SetLineColor(4);
1319           fhGenEtaEta->SetLineColor(2);
1320           fhGenOmegaEta->SetLineColor(7);
1321           fhGenEleEta->SetLineColor(6);
1322           //Select the maximum of the histogram to show all lines.
1323           if(fhGenPi0Eta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEtaEta->GetMaximum() && 
1324              fhGenPi0Eta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenPi0Eta->GetMaximum() >= fhGenEleEta->GetMaximum())
1325             haxiseta->SetMaximum(fhGenPi0Eta->GetMaximum());
1326           else if(fhGenGamEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEtaEta->GetMaximum() && 
1327                   fhGenGamEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenGamEta->GetMaximum() >= fhGenEleEta->GetMaximum())
1328             haxiseta->SetMaximum(fhGenGamEta->GetMaximum());
1329           else if(fhGenEtaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && 
1330                   fhGenEtaEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEtaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
1331             haxiseta->SetMaximum(fhGenEtaEta->GetMaximum());    
1332           else if(fhGenOmegaEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEtaEta->GetMaximum() && 
1333                   fhGenOmegaEta->GetMaximum() >= fhGenGamEta->GetMaximum() && fhGenOmegaEta->GetMaximum() >= fhGenEleEta->GetMaximum())
1334             haxiseta->SetMaximum(fhGenOmegaEta->GetMaximum());
1335           else if(fhGenEleEta->GetMaximum() >= fhGenPi0Eta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenEtaEta->GetMaximum() && 
1336                   fhGenEleEta->GetMaximum() >= fhGenOmegaEta->GetMaximum() && fhGenEleEta->GetMaximum() >= fhGenGamEta->GetMaximum())
1337             haxiseta->SetMaximum(fhGenEleEta->GetMaximum());
1338           haxiseta->SetMinimum(100);
1339           haxiseta->Draw("axis");
1340           fhGenPi0Eta->Draw("same");
1341           fhGenGamEta->Draw("same");
1342           fhGenEtaEta->Draw("same");
1343           fhGenOmegaEta->Draw("same");
1344           fhGenEleEta->Draw("same");
1345           
1346           
1347           c10->cd(3) ; 
1348           gPad->SetLogy();
1349           TH1F * haxisphi  = (TH1F*) fhGenPi0Phi->Clone("axisphi");  
1350           haxisphi->SetTitle("Generated Particles #phi, |#eta| < 1");
1351           fhGenPi0Phi->SetLineColor(1);
1352           fhGenGamPhi->SetLineColor(4);
1353           fhGenEtaPhi->SetLineColor(2);
1354           fhGenOmegaPhi->SetLineColor(7);
1355           fhGenElePhi->SetLineColor(6);
1356           //Select the maximum of the histogram to show all lines.
1357           if(fhGenPi0Phi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenEtaPhi->GetMaximum() && 
1358              fhGenPi0Phi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenPi0Phi->GetMaximum() >= fhGenElePhi->GetMaximum())
1359             haxisphi->SetMaximum(fhGenPi0Phi->GetMaximum());
1360           else if(fhGenGamPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() && 
1361                   fhGenGamPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenGamPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
1362             haxisphi->SetMaximum(fhGenGamPhi->GetMaximum());
1363           else if(fhGenEtaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && 
1364                   fhGenEtaPhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenEtaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
1365             haxisphi->SetMaximum(fhGenEtaPhi->GetMaximum());    
1366           else if(fhGenOmegaPhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() && 
1367                   fhGenOmegaPhi->GetMaximum() >= fhGenGamPhi->GetMaximum() && fhGenOmegaPhi->GetMaximum() >= fhGenElePhi->GetMaximum())
1368             haxisphi->SetMaximum(fhGenOmegaPhi->GetMaximum());
1369           else if(fhGenElePhi->GetMaximum() >= fhGenPi0Phi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenEtaPhi->GetMaximum() && 
1370                   fhGenElePhi->GetMaximum() >= fhGenOmegaPhi->GetMaximum() && fhGenElePhi->GetMaximum() >= fhGenGamPhi->GetMaximum())
1371             haxisphi->SetMaximum(fhGenElePhi->GetMaximum());
1372           haxisphi->SetMinimum(100);
1373           haxisphi->Draw("axis");
1374           fhGenPi0Phi->Draw("same");
1375           fhGenGamPhi->Draw("same");
1376           fhGenEtaPhi->Draw("same");
1377           fhGenOmegaPhi->Draw("same");
1378           fhGenElePhi->Draw("same");
1379           
1380           sprintf(name,"QA_%s_GeneratedDistributions.eps",fCalorimeter.Data());
1381           c10->Print(name);
1382           
1383           
1384           //Reconstructed clusters depending on its original particle.
1385           //printf("c1\n");
1386           sprintf(cname,"QA_%s_recgenid",fCalorimeter.Data());
1387           TCanvas  * c11 = new TCanvas(cname, "Reconstructed particles, function of their original particle ID", 400, 400) ;
1388           c11->Divide(2, 2);
1389           
1390           
1391           c11->cd(1) ; 
1392           gPad->SetLogy();
1393           TH1F * hGamE   = (TH1F*) fhGamE->ProjectionX("hGamE",-1,-1);
1394           TH1F * hPi0E   = (TH1F*) fhPi0E->ProjectionX("hPi0E",-1,-1);
1395           TH1F * hEleE   = (TH1F*) fhEleE->ProjectionX("hEleE",-1,-1);
1396           TH1F * hNeHadE = (TH1F*) fhNeHadE->ProjectionX("hNeHadE",-1,-1);
1397           TH1F * hChHadE = (TH1F*) fhChHadE->ProjectionX("hChHadE",-1,-1);
1398           TH1F * haxisE  = (TH1F*) hPi0E->Clone("axisE");  
1399           haxisE->SetTitle("Reconstructed particles E, function of their original particle ID");
1400           haxisE->SetAxisRange(minx,maxx,"X");  
1401           
1402           hPi0E->SetLineColor(1);
1403           hGamE->SetLineColor(4);
1404           hNeHadE->SetLineColor(2);
1405           hChHadE->SetLineColor(7);
1406           hEleE->SetLineColor(6);
1407           
1408           //Select the maximum of the histogram to show all lines.
1409           if(hPi0E->GetMaximum() >= hGamE->GetMaximum() && hPi0E->GetMaximum() >= hNeHadE->GetMaximum() && 
1410              hPi0E->GetMaximum() >= hChHadE->GetMaximum() && hPi0E->GetMaximum() >= hEleE->GetMaximum())
1411             haxisE->SetMaximum(hPi0E->GetMaximum());
1412           else if(hGamE->GetMaximum() >= hPi0E->GetMaximum() && hGamE->GetMaximum() >= hNeHadE->GetMaximum() && 
1413                   hGamE->GetMaximum() >= hChHadE->GetMaximum() && hGamE->GetMaximum() >= hEleE->GetMaximum())
1414             haxisE->SetMaximum(hGamE->GetMaximum());
1415           else if(hNeHadE->GetMaximum() >= hPi0E->GetMaximum() && hNeHadE->GetMaximum() >= hGamE->GetMaximum() && 
1416                   hNeHadE->GetMaximum() >= hChHadE->GetMaximum() && hNeHadE->GetMaximum() >= hEleE->GetMaximum())
1417             haxisE->SetMaximum(hNeHadE->GetMaximum());  
1418           else if(hChHadE->GetMaximum() >= hPi0E->GetMaximum() && hChHadE->GetMaximum() >= hNeHadE->GetMaximum() && 
1419                   hChHadE->GetMaximum() >= hGamE->GetMaximum() && hChHadE->GetMaximum() >= hEleE->GetMaximum())
1420             haxisE->SetMaximum(hChHadE->GetMaximum());
1421           else if(hEleE->GetMaximum() >= hPi0E->GetMaximum() && hEleE->GetMaximum() >= hNeHadE->GetMaximum() && 
1422                   hEleE->GetMaximum() >= hChHadE->GetMaximum() && hEleE->GetMaximum() >= hGamE->GetMaximum())
1423             haxisE->SetMaximum(hEleE->GetMaximum());
1424           haxisE->SetXTitle("E (GeV)");
1425           haxisE->SetMinimum(1);
1426           haxisE->Draw("axis");
1427           hPi0E->Draw("same");
1428           hGamE->Draw("same");
1429           hNeHadE->Draw("same");
1430           hChHadE->Draw("same");
1431           hEleE->Draw("same");
1432           
1433           TLegend pLegend2(0.8,0.65,0.95,0.93);
1434           pLegend2.SetTextSize(0.06);
1435           pLegend2.AddEntry(hPi0E,"  #pi^{0}","L");
1436           pLegend2.AddEntry(hGamE,"  #gamma","L");
1437           pLegend2.AddEntry(hEleE,"  e^{#pm}","L");
1438           pLegend2.AddEntry(hChHadE,"  h^{#pm}","L");
1439           pLegend2.AddEntry(hNeHadE,"  h^{0}","L");
1440           pLegend2.SetFillColor(10);
1441           pLegend2.SetBorderSize(1);
1442           pLegend2.Draw();
1443           
1444           
1445           c11->cd(2) ; 
1446           gPad->SetLogy();
1447           //printf("%s, %s, %s, %s, %s\n",fhGamPt->GetName(),fhPi0Pt->GetName(),fhElePt->GetName(),fhNeHadPt->GetName(), fhChHadPt->GetName());
1448           TH1F * hGamPt   = (TH1F*) fhGamPt->ProjectionX("hGamPt",-1,-1);
1449           TH1F * hPi0Pt   = (TH1F*) fhPi0Pt->ProjectionX("hPi0Pt",-1,-1);
1450           TH1F * hElePt   = (TH1F*) fhElePt->ProjectionX("hElePt",-1,-1);
1451           TH1F * hNeHadPt = (TH1F*) fhNeHadPt->ProjectionX("hNeHadPt",-1,-1);
1452           TH1F * hChHadPt = (TH1F*) fhChHadPt->ProjectionX("hChHadPt",-1,-1);
1453           haxispt  = (TH1F*) hPi0Pt->Clone("axispt");  
1454           haxispt->SetTitle("Reconstructed particles p_{T}, function of their original particle ID");
1455           hPi0Pt->SetLineColor(1);
1456           hGamPt->SetLineColor(4);
1457           hNeHadPt->SetLineColor(2);
1458           hChHadPt->SetLineColor(7);
1459           hElePt->SetLineColor(6);
1460           
1461           //Select the maximum of the histogram to show all lines.
1462           if(hPi0Pt->GetMaximum() >= hGamPt->GetMaximum() && hPi0Pt->GetMaximum() >= hNeHadPt->GetMaximum() && 
1463              hPi0Pt->GetMaximum() >= hChHadPt->GetMaximum() && hPi0Pt->GetMaximum() >= hElePt->GetMaximum())
1464             haxispt->SetMaximum(hPi0Pt->GetMaximum());
1465           else if(hGamPt->GetMaximum() >= hPi0Pt->GetMaximum() && hGamPt->GetMaximum() >= hNeHadPt->GetMaximum() && 
1466                   hGamPt->GetMaximum() >= hChHadPt->GetMaximum() && hGamPt->GetMaximum() >= hElePt->GetMaximum())
1467             haxispt->SetMaximum(hGamPt->GetMaximum());
1468           else if(hNeHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hNeHadPt->GetMaximum() >= hGamPt->GetMaximum() && 
1469                   hNeHadPt->GetMaximum() >= hChHadPt->GetMaximum() && hNeHadPt->GetMaximum() >= hElePt->GetMaximum())
1470             haxispt->SetMaximum(hNeHadPt->GetMaximum());        
1471           else if(hChHadPt->GetMaximum() >= hPi0Pt->GetMaximum() && hChHadPt->GetMaximum() >= hNeHadPt->GetMaximum() && 
1472                   hChHadPt->GetMaximum() >= hGamPt->GetMaximum() && hChHadPt->GetMaximum() >= hElePt->GetMaximum())
1473             haxispt->SetMaximum(hChHadPt->GetMaximum());
1474           else if(hElePt->GetMaximum() >= hPi0Pt->GetMaximum() && hElePt->GetMaximum() >= hNeHadPt->GetMaximum() && 
1475                   hElePt->GetMaximum() >= hChHadPt->GetMaximum() && hElePt->GetMaximum() >= hGamPt->GetMaximum())
1476             haxispt->SetMaximum(hElePt->GetMaximum());
1477           haxispt->SetXTitle("p_{T} (GeV/c)");
1478           haxispt->SetMinimum(1);
1479           haxispt->SetAxisRange(minx,maxx,"X");
1480           haxispt->Draw("axis");
1481           hPi0Pt->Draw("same");
1482           hGamPt->Draw("same");
1483           hNeHadPt->Draw("same");
1484           hChHadPt->Draw("same");
1485           hElePt->Draw("same");
1486           
1487           
1488           c11->cd(3) ;
1489           gPad->SetLogy();
1490           
1491           TH1F * hGamEta   = (TH1F*) fhGamEta->ProjectionX("hGamEta",-1,-1);
1492           TH1F * hPi0Eta   = (TH1F*) fhPi0Eta->ProjectionX("hPi0Eta",-1,-1);
1493           TH1F * hEleEta   = (TH1F*) fhEleEta->ProjectionX("hEleEta",-1,-1);
1494           TH1F * hNeHadEta = (TH1F*) fhNeHadEta->ProjectionX("hNeHadEta",-1,-1);
1495           TH1F * hChHadEta = (TH1F*) fhChHadEta->ProjectionX("hChHadEta",-1,-1);
1496           haxiseta  = (TH1F*) hPi0Eta->Clone("axiseta");  
1497           haxiseta->SetTitle("Reconstructed particles #eta, function of their original particle ID");
1498           hPi0Eta->SetLineColor(1);
1499           hGamEta->SetLineColor(4);
1500           hNeHadEta->SetLineColor(2);
1501           hChHadEta->SetLineColor(7);
1502           hEleEta->SetLineColor(6);
1503           //Select the maximum of the histogram to show all lines.
1504           if(hPi0Eta->GetMaximum() >= hGamEta->GetMaximum() && hPi0Eta->GetMaximum() >= hNeHadEta->GetMaximum() && 
1505              hPi0Eta->GetMaximum() >= hChHadEta->GetMaximum() && hPi0Eta->GetMaximum() >= hEleEta->GetMaximum())
1506             haxiseta->SetMaximum(hPi0Eta->GetMaximum());
1507           else if(hGamEta->GetMaximum() >= hPi0Eta->GetMaximum() && hGamEta->GetMaximum() >= hNeHadEta->GetMaximum() && 
1508                   hGamEta->GetMaximum() >= hChHadEta->GetMaximum() && hGamEta->GetMaximum() >= hEleEta->GetMaximum())
1509             haxiseta->SetMaximum(hGamEta->GetMaximum());
1510           else if(hNeHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hNeHadEta->GetMaximum() >= hGamEta->GetMaximum() && 
1511                   hNeHadEta->GetMaximum() >= hChHadEta->GetMaximum() && hNeHadEta->GetMaximum() >= hEleEta->GetMaximum())
1512             haxiseta->SetMaximum(hNeHadEta->GetMaximum());      
1513           else if(hChHadEta->GetMaximum() >= hPi0Eta->GetMaximum() && hChHadEta->GetMaximum() >= hNeHadEta->GetMaximum() && 
1514                   hChHadEta->GetMaximum() >= hGamEta->GetMaximum() && hChHadEta->GetMaximum() >= hEleEta->GetMaximum())
1515             haxiseta->SetMaximum(hChHadEta->GetMaximum());
1516           else if(hEleEta->GetMaximum() >= hPi0Eta->GetMaximum() && hEleEta->GetMaximum() >= hNeHadEta->GetMaximum() && 
1517                   hEleEta->GetMaximum() >= hChHadEta->GetMaximum() && hEleEta->GetMaximum() >= hGamEta->GetMaximum())
1518             haxiseta->SetMaximum(hEleEta->GetMaximum());
1519           
1520           haxiseta->SetXTitle("#eta");
1521           haxiseta->Draw("axis");
1522           hPi0Eta->Draw("same");
1523           hGamEta->Draw("same");
1524           hNeHadEta->Draw("same");
1525           hChHadEta->Draw("same");
1526           hEleEta->Draw("same");
1527           
1528           
1529           c11->cd(4) ; 
1530           gPad->SetLogy();
1531           TH1F * hGamPhi   = (TH1F*) fhGamPhi->ProjectionX("hGamPhi",-1,-1);
1532           TH1F * hPi0Phi   = (TH1F*) fhPi0Phi->ProjectionX("hPi0Phi",-1,-1);
1533           TH1F * hElePhi   = (TH1F*) fhElePhi->ProjectionX("hElePhi",-1,-1);
1534           TH1F * hNeHadPhi = (TH1F*) fhNeHadPhi->ProjectionX("hNeHadPhi",-1,-1);
1535           TH1F * hChHadPhi = (TH1F*) fhChHadPhi->ProjectionX("hChHadPhi",-1,-1);
1536           haxisphi  = (TH1F*) hPi0Phi->Clone("axisphi");  
1537           haxisphi->SetTitle("Reconstructed particles #phi, function of their original particle ID");
1538           
1539           hPi0Phi->SetLineColor(1);
1540           hGamPhi->SetLineColor(4);
1541           hNeHadPhi->SetLineColor(2);
1542           hChHadPhi->SetLineColor(7);
1543           hElePhi->SetLineColor(6);
1544           //Select the maximum of the histogram to show all lines.
1545           if(hPi0Phi->GetMaximum() >= hGamPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hNeHadPhi->GetMaximum() && 
1546              hPi0Phi->GetMaximum() >= hChHadPhi->GetMaximum() && hPi0Phi->GetMaximum() >= hElePhi->GetMaximum())
1547             haxisphi->SetMaximum(hPi0Phi->GetMaximum());
1548           else if(hGamPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hGamPhi->GetMaximum() >= hNeHadPhi->GetMaximum() && 
1549                   hGamPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hGamPhi->GetMaximum() >= hElePhi->GetMaximum())
1550             haxisphi->SetMaximum(hGamPhi->GetMaximum());
1551           else if(hNeHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hNeHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && 
1552                   hNeHadPhi->GetMaximum() >= hChHadPhi->GetMaximum() && hNeHadPhi->GetMaximum() >= hElePhi->GetMaximum())
1553             haxisphi->SetMaximum(hNeHadPhi->GetMaximum());      
1554           else if(hChHadPhi->GetMaximum() >= hPi0Phi->GetMaximum() && hChHadPhi->GetMaximum() >= hNeHadPhi->GetMaximum() && 
1555                   hChHadPhi->GetMaximum() >= hGamPhi->GetMaximum() && hChHadPhi->GetMaximum() >= hElePhi->GetMaximum())
1556             haxisphi->SetMaximum(hChHadPhi->GetMaximum());
1557           else if(hElePhi->GetMaximum() >= hPi0Phi->GetMaximum() && hElePhi->GetMaximum() >= hNeHadPhi->GetMaximum() && 
1558                   hElePhi->GetMaximum() >= hChHadPhi->GetMaximum() && hElePhi->GetMaximum() >= hGamPhi->GetMaximum())
1559             haxisphi->SetMaximum(hElePhi->GetMaximum());
1560           haxisphi->SetXTitle("#phi (rad)");
1561           haxisphi->Draw("axis");
1562           hPi0Phi->Draw("same");
1563           hGamPhi->Draw("same");
1564           hNeHadPhi->Draw("same");
1565           hChHadPhi->Draw("same");
1566           hElePhi->Draw("same");
1567           
1568           sprintf(name,"QA_%s_RecDistributionsGenID.eps",fCalorimeter.Data());
1569           c11->Print(name);
1570           
1571           
1572           //Ratio reconstructed clusters / generated particles in acceptance, for different particle ID
1573           //printf("c1\n");
1574           
1575           TH1F *        hPi0EClone   = (TH1F*)   hPi0E  ->Clone("hPi0EClone");
1576           TH1F *        hGamEClone   = (TH1F*)   hGamE  ->Clone("hGamEClone");
1577           TH1F *        hPi0PtClone  = (TH1F*)   hPi0Pt ->Clone("hPi0PtClone");
1578           TH1F *        hGamPtClone  = (TH1F*)   hGamPt ->Clone("hGamPtClone"); 
1579           TH1F *        hPi0EtaClone = (TH1F*)   hPi0Eta->Clone("hPi0EtaClone");
1580           TH1F *        hGamEtaClone = (TH1F*)   hGamEta->Clone("hGamEtaClone");        
1581           TH1F *        hPi0PhiClone = (TH1F*)   hPi0Phi->Clone("hPi0PhiClone");
1582           TH1F *        hGamPhiClone = (TH1F*)   hGamPhi->Clone("hGamPhiClone");        
1583           
1584           sprintf(cname,"QA_%s_recgenidratio",fCalorimeter.Data());
1585           TCanvas  * c12 = new TCanvas(cname, "Ratio reconstructed clusters / generated particles in acceptance, for different particle ID", 400, 400) ;
1586           c12->Divide(2, 2);
1587           
1588           c12->cd(1) ; 
1589           gPad->SetLogy();
1590           haxisE->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
1591           hPi0EClone->Divide(fhGenPi0AccE);
1592           hGamEClone->Divide(fhGenGamAccE);
1593           haxisE->SetMaximum(1000);
1594           haxisE->SetMinimum(1e-2);
1595           haxisE->SetXTitle("E (GeV)");
1596           haxisE->SetYTitle("ratio = rec/gen");
1597           haxisE->Draw("axis");
1598           hPi0E->Draw("same");
1599           hGamE->Draw("same");
1600         
1601           TLegend pLegend3(0.75,0.2,0.9,0.4);
1602           pLegend3.SetTextSize(0.06);
1603           pLegend3.AddEntry(hPi0EClone,"  #pi^{0}","L");
1604           pLegend3.AddEntry(hGamEClone,"  #gamma","L");
1605           pLegend3.SetFillColor(10);
1606           pLegend3.SetBorderSize(1);
1607           pLegend3.Draw();
1608           
1609           c12->cd(2) ; 
1610           gPad->SetLogy();
1611           haxispt->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
1612           hPi0PtClone->Divide(fhGenPi0AccPt);
1613           hGamPtClone->Divide(fhGenGamAccPt);
1614           haxispt->SetMaximum(5);
1615           haxispt->SetMinimum(1e-2);
1616           haxispt->SetXTitle("p_{T} (GeV/c)");
1617           haxispt->SetYTitle("ratio = rec/gen");
1618           haxispt->Draw("axis");
1619           hPi0PtClone->Draw("same");
1620           hGamPtClone->Draw("same");
1621           
1622           c12->cd(3) ;
1623           gPad->SetLogy();
1624           
1625           haxiseta->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
1626           hPi0EtaClone->Divide(fhGenPi0AccEta);
1627           hGamEtaClone->Divide(fhGenGamAccEta);
1628           haxiseta->SetMaximum(1.2);
1629           haxiseta->SetMinimum(1e-2);
1630           haxiseta->SetYTitle("ratio = rec/gen");
1631           haxiseta->SetXTitle("#eta");
1632           haxiseta->Draw("axis");
1633           hPi0EtaClone->Draw("same");
1634           hGamEtaClone->Draw("same");
1635           
1636           
1637           c12->cd(4) ; 
1638           gPad->SetLogy();
1639           haxisphi->SetTitle("Ratio reconstructed clusters / generated particles in acceptance, for different particle ID");
1640           hPi0PhiClone->Divide(fhGenPi0AccPhi);
1641           hGamPhiClone->Divide(fhGenGamAccPhi);
1642           haxisphi->SetYTitle("ratio = rec/gen");
1643           haxisphi->SetXTitle("#phi (rad)");
1644           haxisphi->SetMaximum(1.2);
1645           haxisphi->SetMinimum(1e-2);
1646           haxisphi->Draw("axis");
1647           hPi0PhiClone->Draw("same");
1648           hGamPhiClone->Draw("same");
1649           
1650           sprintf(name,"QA_%s_EfficiencyGenID.eps",fCalorimeter.Data());
1651           c12->Print(name);
1652           
1653           
1654           //Reconstructed distributions
1655           //printf("c1\n");
1656           sprintf(cname,"QA_%s_vertex",fCalorimeter.Data());
1657           TCanvas  * c13 = new TCanvas(cname, "Particle vertex", 400, 400) ;
1658           c13->Divide(2, 2);
1659           
1660           c13->cd(1) ; 
1661           //gPad->SetLogy();
1662           fhEMVxyz->SetTitleOffset(1.6,"Y");
1663           fhEMVxyz->Draw();
1664           
1665           c13->cd(2) ; 
1666           //gPad->SetLogy();
1667           fhHaVxyz->SetTitleOffset(1.6,"Y");
1668           fhHaVxyz->Draw();
1669           
1670           c13->cd(3) ;
1671           gPad->SetLogy();
1672           TH1F * hEMR = (TH1F*) fhEMR->ProjectionY("hEM",-1,-1); 
1673           hEMR->SetLineColor(4);
1674           hEMR->Draw();
1675           
1676           c13->cd(4) ; 
1677           gPad->SetLogy();
1678           TH1F * hHaR = (TH1F*) fhHaR->ProjectionY("hHa",-1,-1); 
1679           hHaR->SetLineColor(4);
1680           hHaR->Draw();
1681           
1682           
1683           sprintf(name,"QA_%s_ParticleVertex.eps",fCalorimeter.Data());
1684           c13->Print(name);
1685           
1686           
1687           //Track-matching distributions
1688           
1689           
1690           //Reconstructed distributions, matched with tracks, generated particle dependence
1691           //printf("c2\n");
1692           sprintf(cname,"QA_%s_rectrackmatchGenID",fCalorimeter.Data());
1693           TCanvas  * c22ch = new TCanvas(cname, "Reconstructed distributions, matched with tracks, for different particle ID", 400, 400) ;
1694           c22ch->Divide(2, 2);
1695           
1696           c22ch->cd(1) ; 
1697           
1698           TH1F * hGamECharged   = (TH1F*) fhGamECharged->ProjectionX("hGamECharged",-1,-1);
1699           TH1F * hPi0ECharged   = (TH1F*) fhPi0ECharged->ProjectionX("hPi0ECharged",-1,-1);
1700           TH1F * hEleECharged   = (TH1F*) fhEleECharged->ProjectionX("hEleECharged",-1,-1);
1701           TH1F * hNeHadECharged = (TH1F*) fhNeHadECharged->ProjectionX("hNeHadECharged",-1,-1);
1702           TH1F * hChHadECharged = (TH1F*) fhChHadECharged->ProjectionX("hChHadECharged",-1,-1);
1703           hPi0ECharged->SetLineColor(1);
1704           hGamECharged->SetLineColor(4);
1705           hNeHadECharged->SetLineColor(2);
1706           hChHadECharged->SetLineColor(7);
1707           hEleECharged->SetLineColor(6);        
1708           gPad->SetLogy();
1709           fhECharged->SetLineColor(3);
1710           fhECharged->SetMinimum(0.5);
1711           fhECharged->Draw();
1712           hPi0ECharged->Draw("same");
1713           hGamECharged->Draw("same");
1714           hNeHadECharged->Draw("same");
1715           hChHadECharged->Draw("same");
1716           hEleECharged->Draw("same");
1717           TLegend pLegend22(0.75,0.45,0.9,0.8);
1718           pLegend22.SetTextSize(0.06);
1719           pLegend22.AddEntry(fhECharged,"all","L");
1720           pLegend22.AddEntry(hPi0ECharged,"#pi^{0}","L");
1721           pLegend22.AddEntry(hGamECharged,"#gamma","L");
1722           pLegend22.AddEntry(hEleECharged,"e^{#pm}","L");
1723           pLegend22.AddEntry(hChHadECharged,"h^{#pm}","L");
1724           pLegend22.AddEntry(hNeHadECharged,"h^{0}","L");
1725           pLegend22.SetFillColor(10);
1726           pLegend22.SetBorderSize(1);
1727           pLegend22.Draw();
1728           
1729           c22ch->cd(2) ; 
1730           
1731           TH1F * hGamPtCharged   = (TH1F*) fhGamPtCharged->ProjectionX("hGamPtCharged",-1,-1);
1732           TH1F * hPi0PtCharged   = (TH1F*) fhPi0PtCharged->ProjectionX("hPi0PtCharged",-1,-1);
1733           TH1F * hElePtCharged   = (TH1F*) fhElePtCharged->ProjectionX("hElePtCharged",-1,-1);
1734           TH1F * hNeHadPtCharged = (TH1F*) fhNeHadPtCharged->ProjectionX("hNeHadPtCharged",-1,-1);
1735           TH1F * hChHadPtCharged = (TH1F*) fhChHadPtCharged->ProjectionX("hChHadPtCharged",-1,-1);
1736           hPi0PtCharged->SetLineColor(1);
1737           hGamPtCharged->SetLineColor(4);
1738           hNeHadPtCharged->SetLineColor(2);
1739           hChHadPtCharged->SetLineColor(7);
1740           hElePtCharged->SetLineColor(6);       
1741           gPad->SetLogy();
1742           fhPtCharged->SetLineColor(3);
1743           fhPtCharged->SetMinimum(0.5);
1744           fhPtCharged->Draw();
1745           hPi0PtCharged->Draw("same");
1746           hGamPtCharged->Draw("same");
1747           hNeHadPtCharged->Draw("same");
1748           hChHadPtCharged->Draw("same");
1749           hElePtCharged->Draw("same");  
1750           
1751           c22ch->cd(4) ; 
1752           
1753           TH1F * hGamEtaCharged   = (TH1F*) fhGamEtaCharged->ProjectionX("hGamEtaCharged",-1,-1);
1754           TH1F * hPi0EtaCharged   = (TH1F*) fhPi0EtaCharged->ProjectionX("hPi0EtaCharged",-1,-1);
1755           TH1F * hEleEtaCharged   = (TH1F*) fhEleEtaCharged->ProjectionX("hEleEtaCharged",-1,-1);
1756           TH1F * hNeHadEtaCharged = (TH1F*) fhNeHadEtaCharged->ProjectionX("hNeHadEtaCharged",-1,-1);
1757           TH1F * hChHadEtaCharged = (TH1F*) fhChHadEtaCharged->ProjectionX("hChHadEtaCharged",-1,-1);
1758           hPi0EtaCharged->SetLineColor(1);
1759           hGamEtaCharged->SetLineColor(4);
1760           hNeHadEtaCharged->SetLineColor(2);
1761           hChHadEtaCharged->SetLineColor(7);
1762           hEleEtaCharged->SetLineColor(6);      
1763           gPad->SetLogy();
1764           fhEtaCharged->SetLineColor(3);
1765           fhEtaCharged->SetMinimum(0.5);
1766           fhEtaCharged->Draw();
1767           hPi0EtaCharged->Draw("same");
1768           hGamEtaCharged->Draw("same");
1769           hNeHadEtaCharged->Draw("same");
1770           hChHadEtaCharged->Draw("same");
1771           hEleEtaCharged->Draw("same");
1772           
1773           c22ch->cd(3) ; 
1774           
1775           TH1F * hGamPhiCharged   = (TH1F*) fhGamPhiCharged->ProjectionX("hGamPhiCharged",-1,-1);
1776           TH1F * hPi0PhiCharged   = (TH1F*) fhPi0PhiCharged->ProjectionX("hPi0PhiCharged",-1,-1);
1777           TH1F * hElePhiCharged   = (TH1F*) fhElePhiCharged->ProjectionX("hElePhiCharged",-1,-1);
1778           TH1F * hNeHadPhiCharged = (TH1F*) fhNeHadPhiCharged->ProjectionX("hNeHadPhiCharged",-1,-1);
1779           TH1F * hChHadPhiCharged = (TH1F*) fhChHadPhiCharged->ProjectionX("hChHadPhiCharged",-1,-1);
1780           hPi0PhiCharged->SetLineColor(1);
1781           hGamPhiCharged->SetLineColor(4);
1782           hNeHadPhiCharged->SetLineColor(2);
1783           hChHadPhiCharged->SetLineColor(7);
1784           hElePhiCharged->SetLineColor(6);      
1785           gPad->SetLogy();
1786           fhPhiCharged->SetLineColor(3);
1787           fhPhiCharged->SetMinimum(0.5);
1788           fhPhiCharged->Draw();
1789           hPi0PhiCharged->Draw("same");
1790           hGamPhiCharged->Draw("same");
1791           hNeHadPhiCharged->Draw("same");
1792           hChHadPhiCharged->Draw("same");
1793           hElePhiCharged->Draw("same");
1794           
1795           
1796           sprintf(name,"QA_%s_ReconstructedDistributions_TrackMatchedGenID.eps",fCalorimeter.Data());
1797           c22ch->Print(name);
1798           
1799           TH1F *        hGamEChargedClone   = (TH1F*)   hGamECharged->Clone("GamEChargedClone");
1800           TH1F *        hGamPtChargedClone  = (TH1F*)   hGamPtCharged->Clone("GamPtChargedClone");
1801           TH1F *        hGamEtaChargedClone = (TH1F*)   hGamEtaCharged->Clone("GamEtaChargedClone");
1802           TH1F *        hGamPhiChargedClone = (TH1F*)   hGamPhiCharged->Clone("GamPhiChargedClone");
1803           
1804           TH1F *        hPi0EChargedClone   = (TH1F*)   hPi0ECharged->Clone("Pi0EChargedClone");
1805           TH1F *        hPi0PtChargedClone  = (TH1F*)   hPi0PtCharged->Clone("Pi0PtChargedClone");
1806           TH1F *        hPi0EtaChargedClone = (TH1F*)   hPi0EtaCharged->Clone("Pi0EtaChargedClone");
1807           TH1F *        hPi0PhiChargedClone = (TH1F*)   hPi0PhiCharged->Clone("Pi0PhiChargedClone");
1808         
1809           TH1F *        hEleEChargedClone   = (TH1F*)   hEleECharged->Clone("EleEChargedClone");
1810           TH1F *        hElePtChargedClone  = (TH1F*)   hElePtCharged->Clone("ElePtChargedClone");
1811           TH1F *        hEleEtaChargedClone = (TH1F*)   hEleEtaCharged->Clone("EleEtaChargedClone");
1812           TH1F *        hElePhiChargedClone = (TH1F*)   hElePhiCharged->Clone("ElePhiChargedClone");    
1813           
1814           TH1F *        hNeHadEChargedClone   = (TH1F*)   hNeHadECharged->Clone("NeHadEChargedClone");
1815           TH1F *        hNeHadPtChargedClone  = (TH1F*)   hNeHadPtCharged->Clone("NeHadPtChargedClone");
1816           TH1F *        hNeHadEtaChargedClone = (TH1F*)   hNeHadEtaCharged->Clone("NeHadEtaChargedClone");
1817           TH1F *        hNeHadPhiChargedClone = (TH1F*)   hNeHadPhiCharged->Clone("NeHadPhiChargedClone");
1818           
1819           TH1F *        hChHadEChargedClone   = (TH1F*)   hChHadECharged->Clone("ChHadEChargedClone");
1820           TH1F *        hChHadPtChargedClone  = (TH1F*)   hChHadPtCharged->Clone("ChHadPtChargedClone");
1821           TH1F *        hChHadEtaChargedClone = (TH1F*)   hChHadEtaCharged->Clone("ChHadEtaChargedClone");
1822           TH1F *        hChHadPhiChargedClone = (TH1F*)   hChHadPhiCharged->Clone("ChHadPhiChargedClone");      
1823           
1824           //Ratio: reconstructed track matched/ all reconstructed
1825           //printf("c3\n");
1826           sprintf(cname,"QA_%s_rectrackmatchratGenID",fCalorimeter.Data());
1827           TCanvas  * c3ch = new TCanvas(cname, "Ratio: reconstructed track matched/ all reconstructed, for different particle ID", 400, 400) ;
1828           c3ch->Divide(2, 2);
1829           
1830           c3ch->cd(1) ;
1831           hEChargedClone->SetMaximum(1.2);
1832           hEChargedClone->SetMinimum(0.001);    
1833           hEChargedClone->SetLineColor(3);
1834           hEChargedClone->SetYTitle("track matched / all");
1835           hPi0EChargedClone->Divide(hPi0E);
1836           hGamEChargedClone->Divide(hGamE);
1837           hEleEChargedClone->Divide(hEleE);
1838           hNeHadEChargedClone->Divide(hNeHadE);
1839           hChHadEChargedClone->Divide(hChHadE);
1840           hEChargedClone->Draw();
1841           hPi0EChargedClone->Draw("same");
1842           hGamEChargedClone->Draw("same");
1843           hEleEChargedClone->Draw("same");
1844           hNeHadEChargedClone->Draw("same");
1845           hChHadEChargedClone->Draw("same");
1846           
1847           TLegend pLegend3ch(0.75,0.45,0.9,0.8);
1848           pLegend3ch.SetTextSize(0.06);
1849           pLegend3ch.AddEntry(hEChargedClone,"all","L");
1850           pLegend3ch.AddEntry(hPi0EChargedClone,"#pi^{0}","L");
1851           pLegend3ch.AddEntry(hGamEChargedClone,"#gamma","L");
1852           pLegend3ch.AddEntry(hEleEChargedClone,"e^{#pm}","L");
1853           pLegend3ch.AddEntry(hChHadEChargedClone,"h^{#pm}","L");
1854           pLegend3ch.AddEntry(hNeHadEChargedClone,"h^{0}","L");
1855           pLegend3ch.SetFillColor(10);
1856           pLegend3ch.SetBorderSize(1);
1857           pLegend3ch.Draw();
1858           
1859           c3ch->cd(2) ;
1860           hPtChargedClone->SetMaximum(1.2);
1861           hPtChargedClone->SetMinimum(0.001);   
1862           hPtChargedClone->SetLineColor(3);
1863           hPtChargedClone->SetYTitle("track matched / all");
1864           hPi0PtChargedClone->Divide(hPi0Pt);
1865           hGamPtChargedClone->Divide(hGamPt);
1866           hElePtChargedClone->Divide(hElePt);
1867           hNeHadPtChargedClone->Divide(hNeHadPt);
1868           hChHadPtChargedClone->Divide(hChHadPt);
1869           hPtChargedClone->Draw();
1870           hPi0PtChargedClone->Draw("same");
1871           hGamPtChargedClone->Draw("same");
1872           hElePtChargedClone->Draw("same");
1873           hNeHadPtChargedClone->Draw("same");
1874           hChHadPtChargedClone->Draw("same");
1875           
1876           c3ch->cd(4) ;
1877           hEtaChargedClone->SetMaximum(1.2);
1878           hEtaChargedClone->SetMinimum(0.001);  
1879           hEtaChargedClone->SetLineColor(3);
1880           hEtaChargedClone->SetYTitle("track matched / all");
1881           hPi0EtaChargedClone->Divide(hPi0Eta);
1882           hGamEtaChargedClone->Divide(hGamEta);
1883           hEleEtaChargedClone->Divide(hEleEta);
1884           hNeHadEtaChargedClone->Divide(hNeHadEta);
1885           hChHadEtaChargedClone->Divide(hChHadEta);
1886           hEtaChargedClone->Draw();
1887           hPi0EtaChargedClone->Draw("same");
1888           hGamEtaChargedClone->Draw("same");
1889           hEleEtaChargedClone->Draw("same");
1890           hNeHadEtaChargedClone->Draw("same");
1891           hChHadEtaChargedClone->Draw("same");
1892           
1893           c3ch->cd(3) ;
1894           hPhiChargedClone->SetMaximum(1.2);
1895           hPhiChargedClone->SetMinimum(0.001);
1896           hPhiChargedClone->SetLineColor(3);
1897           hPhiChargedClone->SetYTitle("track matched / all");
1898           hPi0PhiChargedClone->Divide(hPi0Phi);
1899           hGamPhiChargedClone->Divide(hGamPhi);
1900           hElePhiChargedClone->Divide(hElePhi);
1901           hNeHadPhiChargedClone->Divide(hNeHadPhi);
1902           hChHadPhiChargedClone->Divide(hChHadPhi);
1903           hPhiChargedClone->Draw();
1904           hPi0PhiChargedClone->Draw("same");
1905           hGamPhiChargedClone->Draw("same");
1906           hElePhiChargedClone->Draw("same");
1907           hNeHadPhiChargedClone->Draw("same");
1908           hChHadPhiChargedClone->Draw("same");
1909           
1910           sprintf(name,"QA_%s_RatioReconstructedMatchedDistributionsGenID.eps",fCalorimeter.Data());
1911           c3ch->Print(name);      
1912           
1913           sprintf(cname,"QA_%s_trkmatchMCEle",fCalorimeter.Data());
1914           TCanvas *cmemc = new TCanvas(cname,"Track-matching distributions from MC electrons", 600, 200);
1915           cmemc->Divide(3,1);
1916           
1917           cmemc->cd(1);
1918           gPad->SetLogy();
1919           fhMCEle1pOverE->Draw();
1920           fhMCEle1pOverER02->SetLineColor(4);
1921           fhMCEle1pOverE->SetLineColor(1);
1922           fhMCEle1pOverER02->Draw("same");
1923           pLegendpE0.Draw();
1924           
1925           cmemc->cd(2);
1926           gPad->SetLogy();
1927           fhMCEle1dR->Draw();
1928           
1929           cmemc->cd(3);
1930           fhMCEle2MatchdEdx->Draw();
1931           
1932           sprintf(name,"QA_%s_TrackMatchingDistMCEle.eps",fCalorimeter.Data());
1933           cmemc->Print(name);  
1934           
1935           sprintf(cname,"QA_%s_trkmatchMCChHad",fCalorimeter.Data());
1936           TCanvas *cmemchad = new TCanvas(cname,"Track-matching distributions from MC charged hadrons", 600, 200);
1937           cmemchad->Divide(3,1);
1938           
1939           cmemchad->cd(1);
1940           gPad->SetLogy();
1941           fhMCChHad1pOverE->Draw();
1942           fhMCChHad1pOverE->SetLineColor(1);
1943           fhMCChHad1pOverER02->SetLineColor(4);
1944           fhMCChHad1pOverER02->Draw("same");
1945           pLegendpE0.Draw();
1946           
1947           cmemchad->cd(2);
1948           gPad->SetLogy();
1949           fhMCChHad1dR->Draw();
1950           
1951           cmemchad->cd(3);
1952           fhMCChHad2MatchdEdx->Draw();
1953           
1954           sprintf(name,"QA_%s_TrackMatchingDistMCChHad.eps",fCalorimeter.Data());
1955           cmemchad->Print(name);       
1956           
1957           sprintf(cname,"QA_%s_trkmatchMCNeutral",fCalorimeter.Data());
1958           TCanvas *cmemcn = new TCanvas(cname,"Track-matching distributions from MC neutrals", 600, 200);
1959           cmemcn->Divide(3,1);
1960           
1961           cmemcn->cd(1);
1962           gPad->SetLogy();
1963           fhMCNeutral1pOverE->Draw();
1964           fhMCNeutral1pOverE->SetLineColor(1);
1965           fhMCNeutral1pOverER02->SetLineColor(4);
1966           fhMCNeutral1pOverER02->Draw("same");
1967           pLegendpE0.Draw();
1968           
1969           cmemcn->cd(2);
1970           gPad->SetLogy();
1971           fhMCNeutral1dR->Draw();
1972           
1973           cmemcn->cd(3);
1974           fhMCNeutral2MatchdEdx->Draw();
1975           
1976           sprintf(name,"QA_%s_TrackMatchingDistMCNeutral.eps",fCalorimeter.Data());
1977           cmemcn->Print(name);       
1978           
1979           sprintf(cname,"QA_%s_trkmatchpE",fCalorimeter.Data());
1980           TCanvas *cmpoe = new TCanvas(cname,"Track-matching distributions, p/E", 400, 200);
1981           cmpoe->Divide(2,1);
1982           
1983           cmpoe->cd(1);
1984           gPad->SetLogy();
1985           fh1pOverE->SetLineColor(1);
1986           fhMCEle1pOverE->SetLineColor(4);
1987           fhMCChHad1pOverE->SetLineColor(2);
1988           fhMCNeutral1pOverE->SetLineColor(7);
1989           fh1pOverE->SetMinimum(0.5);
1990           fh1pOverE->Draw();
1991           fhMCEle1pOverE->Draw("same");
1992           fhMCChHad1pOverE->Draw("same");
1993           fhMCNeutral1pOverE->Draw("same");
1994           TLegend pLegendpE(0.65,0.55,0.9,0.8);
1995           pLegendpE.SetTextSize(0.06);
1996           pLegendpE.AddEntry(fh1pOverE,"all","L");
1997           pLegendpE.AddEntry(fhMCEle1pOverE,"e^{#pm}","L");
1998           pLegendpE.AddEntry(fhMCChHad1pOverE,"h^{#pm}","L");
1999           pLegendpE.AddEntry(fhMCNeutral1pOverE,"neutrals","L");
2000           pLegendpE.SetFillColor(10);
2001           pLegendpE.SetBorderSize(1);
2002           pLegendpE.Draw();
2003           
2004           cmpoe->cd(2);
2005           gPad->SetLogy();
2006           fh1pOverER02->SetTitle("Track matches p/E, dR<0.2");
2007           fh1pOverER02->SetLineColor(1);
2008           fhMCEle1pOverER02->SetLineColor(4);
2009           fhMCChHad1pOverER02->SetLineColor(2);
2010           fhMCNeutral1pOverER02->SetLineColor(7);
2011           fh1pOverER02->SetMaximum(fh1pOverE->GetMaximum());
2012           fh1pOverER02->SetMinimum(0.5);
2013           fh1pOverER02->Draw();
2014           fhMCEle1pOverER02->Draw("same");
2015           fhMCChHad1pOverER02->Draw("same");
2016           fhMCNeutral1pOverER02->Draw("same");
2017           
2018           //            TLegend pLegendpE2(0.65,0.55,0.9,0.8);
2019           //            pLegendpE2.SetTextSize(0.06);
2020           //            pLegendpE2.SetHeader("dR < 0.02");
2021           //            pLegendpE2.SetFillColor(10);
2022           //            pLegendpE2.SetBorderSize(1);
2023           //            pLegendpE2.Draw();
2024         //Track matching histograms
2025         sprintf(name,"QA_%s_TrackMatchingPOverE.eps",fCalorimeter.Data());
2026         cmpoe->Print(name);             
2027         }//MC related histograms
2028
2029         //      char line[1024] ; 
2030         //      sprintf(line, ".!tar -zcf QA_%s_%s.tar.gz *%s*.eps", fCalorimeter.Data(), GetName(),fCalorimeter.Data()) ; 
2031         //      gROOT->ProcessLine(line);
2032         //      sprintf(line, ".!rm -fR *.eps"); 
2033         //      gROOT->ProcessLine(line);
2034         //      
2035         //      printf("AliAnaCalorimeterQA::Terminate() - !! All the pdf files are in QA_%s_%s.tar.gz !!!\n",  fCalorimeter.Data(), GetName());
2036         
2037 }
2038