AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DrawProductionComparison.C
Go to the documentation of this file.
1 
23 // Some global variables
24 const Int_t nProd = 3;
25 
26 TString prod[] = {"AOD142","AOD115","ESD"};
27 
29 
30 TFile *file[nProd];
31 
33 
34 Int_t color[]={kBlack,kRed,kBlue,kOrange+1,kYellow+1,kGreen+2,kCyan+1,kViolet,kMagenta+2,kGray};
35 
37 
38 //_______________________________________________________________________
43 //_______________________________________________________________________
44 void DrawProductionComparison(TString listName = "Pi0IM_GammaTrackCorr_EMCAL_default",
45  TString fileName = "AnalysisResults.root")
46 {
47  printf("Open <%s>; Get List : <%s>\n",fileName.Data(),listName.Data());
48 
49  histoTag = listName;
50 
51  //Access the file and list of histograms, global variables
52  GetFileAndList(fileName, listName);
53 
54  gStyle->SetOptTitle(1);
55  gStyle->SetOptStat(0);
56  gStyle->SetOptFit(000000);
57  gStyle->SetPadRightMargin(0.15);
58  //gStyle->SetPadTopMargin(0.02);
59  //gStyle->SetPadLeftMargin(0.15);
60  gStyle->SetTitleFontSize(0.06);
61 
62  // Declare the different histograms, arrays input is production
63  TH1F* hRaw [nProd];
64  TH1F* hCorr[nProd];
65  TH1F* hTM [nProd];
66  TH1F* hShSh[nProd];
67 
68  TH1F* hRatRaw [nProd-1];
69  TH1F* hRatCorr[nProd-1];
70  TH1F* hRatTM [nProd-1];
71  TH1F* hRatShSh[nProd-1];
72 
73  TH1F* hCen [nProd];
74  TH1F* hRatCen[nProd-1];
75 
76  TH1F* hVertex[3][nProd];
77  TH1F* hRatVertex[3][nProd-1];
78 
79  TH2F* h2TrackMatchResEtaNeg[nProd];
80  TH2F* h2TrackMatchResEtaPos[nProd];
81  TH2F* h2TrackMatchResPhiNeg[nProd];
82  TH2F* h2TrackMatchResPhiPos[nProd];
83 
84  TH1F* hTrackMatchResEtaNeg[nProd];
85  TH1F* hTrackMatchResEtaPos[nProd];
86  TH1F* hTrackMatchResPhiNeg[nProd];
87  TH1F* hTrackMatchResPhiPos[nProd];
88 
89  TH1F* hRatTrackMatchResEtaNeg[nProd-1];
90  TH1F* hRatTrackMatchResEtaPos[nProd-1];
91  TH1F* hRatTrackMatchResPhiNeg[nProd-1];
92  TH1F* hRatTrackMatchResPhiPos[nProd-1];
93 
94  TH1F * hTrackPt[nProd] ;
95  TH1F * hTrackPtSPD[nProd] ;
96  TH1F * hTrackPtNoSPD[nProd] ;
97  TH1F * hRatTrackPt[nProd-1] ;
98  TH1F * hRatTrackPtSPD[nProd-1] ;
99  TH1F * hRatTrackPtNoSPD[nProd-1] ;
100 
101  TH2F * hTrackEtaPhi[nProd] ;
102  TH2F * hTrackEtaPhiSPD[nProd] ;
103  TH2F * hTrackEtaPhiNoSPD[nProd] ;
104  TH1F * hTrackPhi[nProd] ;
105  TH1F * hTrackPhiSPD[nProd] ;
106  TH1F * hTrackPhiNoSPD[nProd] ;
107  TH1F * hRatTrackPhi[nProd-1] ;
108  TH1F * hRatTrackPhiSPD[nProd-1] ;
109  TH1F * hRatTrackPhiNoSPD[nProd-1] ;
110 
111  TH2F* h2XE[nProd];
112  TH2F* h2XEUE[nProd];
113  TH1F* hXE[nProd];
114  TH1F* hXEUE[nProd];
115  TH1F* hRatXE[nProd-1];
116  TH1F* hRatXEUE[nProd-1];
117 
118  // Fill the histograms array for each of the productions, do the comparison ratios
119  for(Int_t iprod = 0; iprod < nProd; iprod++)
120  {
121  // Calorimeter Clusters
122  {
123  hRaw [iprod] = (TH1F*) GetHisto("AnaPhoton_hPt_Cut_0_Open" ,iprod);
124  hCorr[iprod] = (TH1F*) GetHisto("AnaPhoton_hPt_Cut_4_NCells" ,iprod);
125  hTM [iprod] = (TH1F*) GetHisto("AnaPhoton_hPt_Cut_7_Matching",iprod);
126  hShSh[iprod] = (TH1F*) GetHisto("AnaPhoton_hPt_Cut_9_PID" ,iprod);
127 
128  hRaw [iprod]->Sumw2();
129  hCorr[iprod]->Sumw2();
130  hTM [iprod]->Sumw2();
131  hShSh[iprod]->Sumw2();
132 
133  hRaw [iprod]->Scale(1./nEvents[iprod]);
134  hCorr[iprod]->Scale(1./nEvents[iprod]);
135  hTM [iprod]->Scale(1./nEvents[iprod]);
136  hShSh[iprod]->Scale(1./nEvents[iprod]);
137 
138  hRaw[iprod]->SetMarkerColor(color[iprod]);
139  hRaw[iprod]->SetMarkerStyle(24);
140 
141  hCorr[iprod]->SetTitle("Cluster spectra with/out cuts");
142  hCorr[iprod]->SetYTitle("1/N_{events} dN/dp_{T}");
143  hCorr[iprod]->SetTitleOffset(1.5,"Y");
144  hCorr[iprod]->SetMarkerColor(color[iprod]);
145  hCorr[iprod]->SetMarkerStyle(20);
146  hCorr[iprod]->SetAxisRange(0.,30.,"X");
147  //hCorr[iprod]->SetMaximum(1.1);
148  //hCorr[iprod]->SetMinimum(0);
149 
150  hTM [iprod]->SetMarkerColor(color[iprod]);
151  hTM [iprod]->SetMarkerStyle(21);
152 
153  hShSh[iprod]->SetMarkerColor(color[iprod]);
154  hShSh[iprod]->SetMarkerStyle(22);
155 
156  hRaw [iprod]->SetTitleOffset(1.5,"Y");
157  hTM [iprod]->SetTitleOffset(1.5,"Y");
158  hShSh[iprod]->SetTitleOffset(1.5,"Y");
159  hCorr[iprod]->SetTitleOffset(1.5,"Y");
160 
161  if(iprod > 0)
162  {
163  hRatRaw [iprod-1] = (TH1F*)hRaw [iprod]->Clone(Form("hRatRaw%s" ,prod[iprod].Data()));
164  hRatCorr[iprod-1] = (TH1F*)hCorr[iprod]->Clone(Form("hRatCorr%s",prod[iprod].Data()));
165  hRatTM [iprod-1] = (TH1F*)hTM [iprod]->Clone(Form("hRatTM%s" ,prod[iprod].Data()));
166  hRatShSh[iprod-1] = (TH1F*)hShSh[iprod]->Clone(Form("hRatShSh%s",prod[iprod].Data()));
167 
168  hRatRaw [iprod-1]->Divide(hRatRaw [iprod-1],hRaw [0],1.000,1,"B");
169  hRatCorr[iprod-1]->Divide(hRatCorr[iprod-1],hCorr[0],0.975,1,"B");
170  hRatTM [iprod-1]->Divide(hRatTM [iprod-1],hTM [0],0.950,1,"B");
171  hRatShSh[iprod-1]->Divide(hRatShSh[iprod-1],hShSh[0],0.925,1,"B");
172  }
173  }
174 
175  // Cluster-Track Matching Residuals
176  {
177  h2TrackMatchResEtaNeg[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDEtaNeg",iprod);
178  h2TrackMatchResEtaPos[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDEtaPos",iprod);
179  h2TrackMatchResPhiNeg[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDPhiNeg",iprod);
180  h2TrackMatchResPhiPos[iprod] = (TH2F*) GetHisto("QA_hTrackMatchedDPhiPos",iprod);
181 
182  Float_t binMin = hCorr[iprod]->FindBin(0.5);
183  Float_t binMax = hCorr[iprod]->FindBin(2);
184  hTrackMatchResEtaNeg[iprod] = (TH1F*) h2TrackMatchResEtaNeg[iprod]->ProjectionY(Form("TMProjEtaNeg%s",prod[iprod].Data()),binMin, binMax);
185  hTrackMatchResEtaPos[iprod] = (TH1F*) h2TrackMatchResEtaPos[iprod]->ProjectionY(Form("TMProjEtaPos%s",prod[iprod].Data()),binMin, binMax);
186  hTrackMatchResPhiNeg[iprod] = (TH1F*) h2TrackMatchResPhiNeg[iprod]->ProjectionY(Form("TMProjPhiNeg%s",prod[iprod].Data()),binMin, binMax);
187  hTrackMatchResPhiPos[iprod] = (TH1F*) h2TrackMatchResPhiPos[iprod]->ProjectionY(Form("TMProjPhiPos%s",prod[iprod].Data()),binMin, binMax);
188 
189  hTrackMatchResEtaNeg[iprod]->SetXTitle("#Delta #eta");
190  hTrackMatchResEtaNeg[iprod]->SetYTitle("entries / N events");
191  hTrackMatchResEtaNeg[iprod]->SetTitle("Track-cluster #eta residuals, 0.5 < E < 2 GeV");
192  hTrackMatchResEtaNeg[iprod]->SetAxisRange(-0.05,0.05,"X");
193  hTrackMatchResEtaNeg[iprod]->Sumw2();
194  hTrackMatchResEtaNeg[iprod]->SetMarkerStyle(24);
195  hTrackMatchResEtaNeg[iprod]->SetMarkerColor(color[iprod]);
196 
197  hTrackMatchResEtaPos[iprod]->Sumw2();
198  hTrackMatchResEtaPos[iprod]->SetAxisRange(-0.05,0.05,"X");
199  hTrackMatchResEtaPos[iprod]->SetMarkerStyle(25);
200  hTrackMatchResEtaPos[iprod]->SetMarkerColor(color[iprod]);
201 
202  hTrackMatchResPhiNeg[iprod]->SetXTitle("#Delta #phi");
203  hTrackMatchResPhiNeg[iprod]->SetTitle("Track-cluster #phi residuals, 0.5 < E < 2 GeV");
204  hTrackMatchResPhiNeg[iprod]->SetYTitle("entries / N events");
205  hTrackMatchResPhiNeg[iprod]->SetAxisRange(-0.05,0.05,"X");
206  hTrackMatchResPhiNeg[iprod]->Sumw2();
207  hTrackMatchResPhiNeg[iprod]->SetMarkerStyle(24);
208  hTrackMatchResPhiNeg[iprod]->SetMarkerColor(color[iprod]);
209 
210  hTrackMatchResPhiPos[iprod]->Sumw2();
211  hTrackMatchResPhiPos[iprod]->SetAxisRange(-0.05,0.05,"X");
212  hTrackMatchResPhiPos[iprod]->SetMarkerStyle(25);
213  hTrackMatchResPhiPos[iprod]->SetMarkerColor(color[iprod]);
214 
215  hTrackMatchResEtaNeg[iprod]->Scale(1./nEvents[iprod]);
216  hTrackMatchResEtaPos[iprod]->Scale(1./nEvents[iprod]);
217  hTrackMatchResPhiNeg[iprod]->Scale(1./nEvents[iprod]);
218  hTrackMatchResPhiPos[iprod]->Scale(1./nEvents[iprod]);
219 
220  hTrackMatchResEtaNeg[iprod]->SetTitleOffset(1.5,"Y");
221  hTrackMatchResEtaPos[iprod]->SetTitleOffset(1.5,"Y");
222  hTrackMatchResPhiNeg[iprod]->SetTitleOffset(1.5,"Y");
223  hTrackMatchResPhiPos[iprod]->SetTitleOffset(1.5,"Y");
224 
225  if(iprod > 0)
226  {
227  hRatTrackMatchResPhiPos[iprod-1] = (TH1F*)hTrackMatchResPhiPos[iprod]->Clone(Form("hRatPhiPos%s",prod[iprod].Data()));
228  hRatTrackMatchResPhiNeg[iprod-1] = (TH1F*)hTrackMatchResPhiNeg[iprod]->Clone(Form("hRatPhiNeg%s",prod[iprod].Data()));
229  hRatTrackMatchResEtaPos[iprod-1] = (TH1F*)hTrackMatchResEtaPos[iprod]->Clone(Form("hRatEtaPos%s",prod[iprod].Data()));
230  hRatTrackMatchResEtaNeg[iprod-1] = (TH1F*)hTrackMatchResEtaNeg[iprod]->Clone(Form("hRatEtaNeg%s",prod[iprod].Data()));
231 
232  hRatTrackMatchResPhiPos[iprod-1]->Divide(hRatTrackMatchResPhiPos[iprod-1],hTrackMatchResPhiPos[0],1.000,1,"B");
233  hRatTrackMatchResPhiNeg[iprod-1]->Divide(hRatTrackMatchResPhiNeg[iprod-1],hTrackMatchResPhiNeg[0],1.000,1,"B");
234  hRatTrackMatchResEtaPos[iprod-1]->Divide(hRatTrackMatchResEtaPos[iprod-1],hTrackMatchResEtaPos[0],1.000,1,"B");
235  hRatTrackMatchResEtaNeg[iprod-1]->Divide(hRatTrackMatchResEtaNeg[iprod-1],hTrackMatchResEtaNeg[0],1.000,1,"B");
236  }
237  }
238 
239  // Hybrid Tracks
240  {
241  hTrackPt [iprod] = (TH1F*) GetHisto("AnaHadrons_hPt" ,iprod);
242  hTrackPtSPD [iprod] = (TH1F*) GetHisto("AnaHadrons_hPtSPDRefit" ,iprod);
243  hTrackPtNoSPD [iprod] = (TH1F*) GetHisto("AnaHadrons_hPtNoSPDRefit" ,iprod);
244  hTrackEtaPhiSPD [iprod] = (TH2F*) GetHisto("AnaHadrons_hEtaPhiSPDRefitPt02" ,iprod);
245  hTrackEtaPhiNoSPD[iprod] = (TH2F*) GetHisto("AnaHadrons_hEtaPhiNoSPDRefitPt02",iprod);
246  hTrackEtaPhi [iprod] = (TH2F*) GetHisto("AnaHadrons_hEtaPhiPositive" ,iprod);
247  hTrackEtaPhi [iprod]->Add((TH2F*) GetHisto("AnaHadrons_hEtaPhiNegative" ,iprod));
248 
249  hTrackPhiSPD [iprod] = (TH1F*)hTrackEtaPhiSPD [iprod]->ProjectionY(Form("hTrackPhiSPD%s" ,prod[iprod].Data()),0,1000);
250  hTrackPhiNoSPD [iprod] = (TH1F*)hTrackEtaPhiNoSPD[iprod]->ProjectionY(Form("hTrackPhiNoSPD%s",prod[iprod].Data()),0,1000);
251  hTrackPhi [iprod] = (TH1F*)hTrackEtaPhi [iprod]->ProjectionY(Form("hTrackPhi%s" ,prod[iprod].Data()),0,1000);
252 
253  hTrackPt [iprod]->Sumw2();
254  hTrackPtSPD [iprod]->Sumw2();
255  hTrackPtNoSPD[iprod]->Sumw2();
256 
257  hTrackPt [iprod]->Scale(1./nEvents[iprod]);
258  hTrackPtSPD [iprod]->Scale(1./nEvents[iprod]);
259  hTrackPtNoSPD[iprod]->Scale(1./nEvents[iprod]);
260 
261  hTrackPhi [iprod]->Sumw2();
262  hTrackPhiSPD [iprod]->Sumw2();
263  hTrackPhiNoSPD[iprod]->Sumw2();
264 
265  hTrackPhi [iprod]->Scale(1./nEvents[iprod]);
266  hTrackPhiSPD [iprod]->Scale(1./nEvents[iprod]);
267  hTrackPhiNoSPD[iprod]->Scale(1./nEvents[iprod]);
268 
269  hTrackPt[iprod]->SetTitle("Track spectra with/out SPD");
270  hTrackPt[iprod]->SetYTitle("1/N_{events} dN/dp_{T}");
271  hTrackPt[iprod]->SetTitleOffset(1.5,"Y");
272  hTrackPt[iprod]->SetMarkerColor(color[iprod]);
273  hTrackPt[iprod]->SetMarkerStyle(20);
274  hTrackPt[iprod]->SetAxisRange(0.,30.,"X");
275  //hTrackPt[iprod]->SetMaximum(1.1);
276  //hTrackPt[iprod]->SetMinimum(0);
277 
278  hTrackPtSPD[iprod]->SetMarkerColor(color[iprod]);
279  hTrackPtSPD[iprod]->SetMarkerStyle(26);
280 
281  hTrackPtNoSPD[iprod]->SetMarkerColor(color[iprod]);
282  hTrackPtNoSPD[iprod]->SetMarkerStyle(25);
283 
284  hTrackPhi[iprod]->SetTitle("Track #phi with/out SPD");
285  hTrackPhi[iprod]->SetYTitle("1/N_{events} dN/d#phi");
286  hTrackPhi[iprod]->SetTitleOffset(1.5,"Y");
287  hTrackPhi[iprod]->SetMarkerColor(color[iprod]);
288  hTrackPhi[iprod]->SetMarkerStyle(20);
289  hTrackPhi[iprod]->SetAxisRange(0.,30.,"X");
290  //hTrackPhi[iprod]->SetMaximum(1.1);
291  //hTrackPhi[iprod]->SetMinimum(0);
292 
293  hTrackPhiSPD[iprod]->SetMarkerColor(color[iprod]);
294  hTrackPhiSPD[iprod]->SetMarkerStyle(26);
295 
296  hTrackPhiNoSPD[iprod]->SetMarkerColor(color[iprod]);
297  hTrackPhiNoSPD[iprod]->SetMarkerStyle(25);
298 
299  if(iprod > 0)
300  {
301  hRatTrackPhi [iprod-1] = (TH1F*)hTrackPhi [iprod]->Clone(Form("hRatTrackPhi%s" ,prod[iprod].Data()));
302  hRatTrackPhiNoSPD[iprod-1] = (TH1F*)hTrackPhiNoSPD[iprod]->Clone(Form("hRatTrackPhiNoSPD%s",prod[iprod].Data()));
303  hRatTrackPhiSPD [iprod-1] = (TH1F*)hTrackPhiSPD [iprod]->Clone(Form("hRatTrackPhiSPD%s" ,prod[iprod].Data()));
304 
305  hRatTrackPhi [iprod-1]->Divide(hRatTrackPhi [iprod-1],hTrackPhi [0],1.000,1,"B");
306  hRatTrackPhiSPD [iprod-1]->Divide(hRatTrackPhiSPD [iprod-1],hTrackPhiSPD [0],1.000,1,"B");
307  hRatTrackPhiNoSPD[iprod-1]->Divide(hRatTrackPhiNoSPD[iprod-1],hTrackPhiNoSPD[0],1.000,1,"B");
308 
309  hRatTrackPt [iprod-1] = (TH1F*)hTrackPt [iprod]->Clone(Form("hRatTrackPt%s" ,prod[iprod].Data()));
310  hRatTrackPtNoSPD[iprod-1] = (TH1F*)hTrackPtNoSPD[iprod]->Clone(Form("hRatTrackPtNoSPD%s",prod[iprod].Data()));
311  hRatTrackPtSPD [iprod-1] = (TH1F*)hTrackPtSPD [iprod]->Clone(Form("hRatTrackPtSPD%s" ,prod[iprod].Data()));
312 
313  hRatTrackPt [iprod-1]->Divide(hRatTrackPt [iprod-1],hTrackPt [0],1.000,1,"B");
314  hRatTrackPtSPD [iprod-1]->Divide(hRatTrackPtSPD [iprod-1],hTrackPtSPD [0],1.000,1,"B");
315  hRatTrackPtNoSPD[iprod-1]->Divide(hRatTrackPtNoSPD[iprod-1],hTrackPtNoSPD[0],1.000,1,"B");
316  }
317  }
318 
319  // photon-track correlation
320  {
321  h2XE [iprod]= (TH2F*) GetHisto("AnaPhotonHadronCorr_hXECharged",iprod);
322  h2XEUE [iprod]= (TH2F*) GetHisto("AnaPhotonHadronCorr_hXEUeCharged",iprod);
323 
324  Float_t minClusterE = 8;
325  TH1F * hTrigger = (TH1F*) GetHisto("AnaPhotonHadronCorr_hPtTrigger",iprod);
326  Int_t minClusterEBin = hTrigger->FindBin(minClusterE);
327  Float_t nTrig = hTrigger->Integral(minClusterE,100000);
328 
329  hXE [iprod] = (TH1F*)h2XE [iprod]->ProjectionY(Form("hXE%s" ,prod[iprod].Data()),minClusterEBin,1000);
330  hXEUE[iprod] = (TH1F*)h2XEUE[iprod]->ProjectionY(Form("hXEUE%s",prod[iprod].Data()),minClusterEBin,1000);
331 
332  hXE [iprod]->Sumw2();
333  hXEUE[iprod]->Sumw2();
334 
335  hXE [iprod]->Scale(1./nTrig);
336  hXEUE[iprod]->Scale(1./nTrig);
337 
338  hXE[iprod]->SetTitle(Form("#gamma-hadron x_{E}, p_{T,Trig}>%2.1f GeV/c",minClusterE));
339  hXE[iprod]->SetYTitle("1/N_{trigger} dN/dx_{E}");
340  hXE[iprod]->SetTitleOffset(1.5,"Y");
341  hXE[iprod]->SetMarkerColor(color[iprod]);
342  hXE[iprod]->SetMarkerStyle(20);
343  hXE[iprod]->SetAxisRange(0.,1.,"X");
344  //hXE[iprod]->SetMaximum(1.1);
345  //hXE[iprod]->SetMinimum(0);
346 
347  hXEUE[iprod]->SetMarkerColor(color[iprod]);
348  hXEUE[iprod]->SetMarkerStyle(25);
349 
350  if(iprod > 0)
351  {
352  hRatXE [iprod-1] = (TH1F*)hXE [iprod]->Clone(Form("hRatXE%s" ,prod[iprod].Data()));
353  hRatXEUE[iprod-1] = (TH1F*)hXEUE[iprod]->Clone(Form("hRatXEUE%s",prod[iprod].Data()));
354 
355  hRatXE [iprod-1]->Divide(hRatXE [iprod-1],hXE [0],1.000,1,"B");
356  hRatXEUE[iprod-1]->Divide(hRatXEUE[iprod-1],hXEUE[0],1.000,1,"B");
357  }
358  }
359 
360  //Centrality
361  {
362  hCen[iprod] = (TH1F*) GetHisto("hCentrality",iprod);
363 
364  hCen[iprod]->Sumw2();
365 
366  hCen[iprod]->Scale(1./nEvents[iprod]);
367 
368  hCen[iprod]->SetTitle("Centrality");
369  hCen[iprod]->SetYTitle("1/N_{events} dN/d centrality");
370  hCen[iprod]->SetTitleOffset(1.5,"Y");
371  hCen[iprod]->SetMarkerColor(color[iprod]);
372  hCen[iprod]->SetMarkerStyle(20);
373  //hCen[iprod]->SetAxisRange(0.,30.,"X");
374  //hCen[iprod]->SetMaximum(1.1);
375  //hCen[iprod]->SetMinimum(0);
376 
377  if(iprod > 0)
378  {
379  hRatCen[iprod-1] = (TH1F*)hCen[iprod]->Clone(Form("hRatCen%s" ,prod[iprod].Data()));
380 
381  hRatCen[iprod-1]->Divide(hRatCen[iprod-1],hCen [0],1.000,1,"B");
382  }
383  }
384 
385  //Vertex
386  {
387  hVertex[0][iprod] = (TH1F*) GetHisto("hZVertex",iprod);
388  hVertex[1][iprod] = (TH1F*) GetHisto("hYVertex",iprod);
389  hVertex[2][iprod] = (TH1F*) GetHisto("hXVertex",iprod);
390 
391  hVertex[0][iprod]->Sumw2();
392  hVertex[1][iprod]->Sumw2();
393  hVertex[2][iprod]->Sumw2();
394 
395  for(Int_t ivertex = 0; ivertex < 3; ivertex++)
396  {
397  //hVertex[ivertex][iprod]->Sumw2();
398 
399  hVertex[ivertex][iprod]->Scale(1./nEvents[iprod]);
400 
401  //hVertex[ivertex][iprod]->SetTitle("Centrality");
402  hVertex[ivertex][iprod]->SetYTitle("1/N_{events} dN/ d vertex");
403  hVertex[ivertex][iprod]->SetTitleOffset(1.5,"Y");
404  hVertex[ivertex][iprod]->SetMarkerColor(color[iprod]);
405  hVertex[ivertex][iprod]->SetLineColor(color[iprod]);
406  hVertex[ivertex][iprod]->SetMarkerStyle(20);
407  if(ivertex==0)hVertex[ivertex][iprod]->SetAxisRange(-10,10.,"X");
408  else hVertex[ivertex][iprod]->SetAxisRange(-1.5,1.5,"X");
409  //hVertex[ivertex][iprod]->SetMaximum(1.1);
410  //hVertex[ivertex][iprod]->SetMinimum(0);
411 
412  if(iprod > 0)
413  {
414  hRatVertex[ivertex][iprod-1] = (TH1F*)hVertex[ivertex][iprod]->Clone(Form("hRatVertex%s_%d" ,prod[iprod].Data(),ivertex));
415 
416  hRatVertex[ivertex][iprod-1]->Divide(hRatVertex[ivertex][iprod-1],hVertex[ivertex][0],1.000,1,"B");
417  }
418  }
419  }
420 
421  }
422 
424  // Make the plots
426 
427  //Legend for productions
428  TLegend lprod(0.3,0.475,0.84,0.675);
429  lprod.SetTextSize(0.04);
430  lprod.SetBorderSize(0);
431  lprod.SetFillColor(0);
432 
433  //Calimeter Cluster
434  {
435  TCanvas * ccalo = new TCanvas(Form("Cluster_%s",histoTag.Data()),"",1000,500);
436  ccalo->Divide(2,1);
437 
438  ccalo->cd(1);
439  gPad->SetLogy();
440 
441  hCorr[0]->Draw();
442  for(Int_t iprod = 0; iprod < nProd; iprod++)
443  {
444  hRaw [iprod]->Draw("same");
445  hCorr[iprod]->Draw("same");
446  hTM [iprod]->Draw("same");
447  hShSh[iprod]->Draw("same");
448 
449  lprod.AddEntry(hRaw[iprod],prod[iprod],"P");
450  }
451 
452  lprod.Draw();
453 
454  TLegend lcl(0.35,0.7,0.84,0.89);
455  lcl.SetTextSize(0.04);
456  lcl.SetBorderSize(0);
457  lcl.SetFillColor(0);
458  lcl.AddEntry(hRaw [0],"Raw","P");
459  lcl.AddEntry(hCorr[0],"No Exotics + non lin.","P");
460  lcl.AddEntry(hTM [0], "+ Track matching","P");
461  lcl.AddEntry(hShSh[0],"+ #lambda^{2}_{0} < 0.4","P");
462  lcl.Draw();
463 
464  ccalo->cd(2);
465  //gPad->SetLogy();
466 
467  hRatCorr[0]->SetTitle("Cluster spectra ratio");
468  hRatCorr[0]->SetYTitle(Form("data X / %s",prod[0].Data()));
469  hRatCorr[0]->SetMinimum(0.850);
470  hRatCorr[0]->SetMaximum(1.025);
471  hRatCorr[0]->Draw("");
472 
473  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
474  {
475  hRatRaw [iprod]->Draw("same");
476  hRatCorr[iprod]->Draw("same");
477  hRatTM [iprod]->Draw("same");
478  hRatShSh[iprod]->Draw("same");
479  }
480 
481  TLine l1(0,1,30,1);
482  TLine l2(0,0.975,30,0.975);
483  TLine l3(0,0.95,30,0.95);
484  TLine l4(0,0.925,30,0.925);
485 
486  l1.Draw("same");
487  l2.Draw("same");
488  l3.Draw("same");
489  l4.Draw("same");
490 
491  ccalo->Print(Form("%s_ClusterSpectraComp.eps",histoTag.Data()));
492  }
493 
494  //Cluster-Track Matching Residual
495  {
496  TLine l0(0,hTrackMatchResEtaNeg[0]->GetMinimum(),0,hTrackMatchResEtaNeg[0]->GetMaximum()*1.2);
497 
498  TLegend lres(0.6,0.75,0.84,0.89);
499  lres.SetTextSize(0.04);
500  //lres.SetBorderSize(0);
501  lres.SetFillColor(0);
502  lres.AddEntry(hTrackMatchResEtaNeg[0],"Negative","P");
503  lres.AddEntry(hTrackMatchResEtaPos[0],"Positive","P");
504  lres.Draw();
505 
506  TCanvas * ccalo2 = new TCanvas(Form("MatchingResiduals_%s",histoTag.Data()),"",500,500);
507  ccalo2->Divide(2,2);
508 
509  ccalo2->cd(1);
510  //gPad->SetLogy();
511 
512  hTrackMatchResEtaPos[0]->Draw("");
513  for(Int_t iprod = 0; iprod < nProd; iprod++)
514  {
515  hTrackMatchResEtaNeg[iprod]->Draw("same");
516  hTrackMatchResEtaPos[iprod]->Draw("same");
517  }
518 
519  l0.Draw("same");
520  lres.Draw();
521  lprod.Draw();
522  ccalo2->cd(2);
523 
524  hTrackMatchResPhiPos[0]->Draw("");
525  for(Int_t iprod = 0; iprod < nProd; iprod++)
526  {
527  hTrackMatchResPhiNeg[iprod]->Draw("same");
528  hTrackMatchResPhiPos[iprod]->Draw("same");
529  }
530 
531  l0.Draw("same");
532 
533  ccalo2->cd(3);
534  //gPad->SetLogy();
535 
536  hRatTrackMatchResEtaPos[0]->SetMaximum(1.25);
537  hRatTrackMatchResEtaPos[0]->SetMinimum(0.98);
538  hRatTrackMatchResEtaPos[0]->Draw("");
539  hRatTrackMatchResEtaPos[0]->SetYTitle(Form("data X / %s",prod[0].Data()));
540  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
541  {
542  hRatTrackMatchResEtaNeg[iprod]->Draw("same");
543  hRatTrackMatchResEtaPos[iprod]->Draw("same");
544  }
545 
546  //l0.Draw("same");
547 
548  ccalo2->cd(4);
549 
550  hRatTrackMatchResPhiPos[0]->SetMaximum(1.20);
551  hRatTrackMatchResPhiPos[0]->SetMinimum(0.95);
552  hRatTrackMatchResPhiPos[0]->Draw("");
553  hRatTrackMatchResPhiPos[0]->SetYTitle(Form("data X / %s",prod[0].Data()));
554  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
555  {
556  hRatTrackMatchResPhiNeg[iprod]->Draw("same");
557  hRatTrackMatchResPhiPos[iprod]->Draw("same");
558  }
559 
560  ccalo2->Print(Form("%s_MatchingResidualsComp.eps",histoTag.Data()));
561  }
562 
563  // Hybrid tracks
564  {
565  TLegend ltrack(0.6,0.75,0.84,0.89);
566  ltrack.SetTextSize(0.04);
567  //ltrack.SetBorderSize(0);
568  ltrack.SetFillColor(0);
569  ltrack.AddEntry(hTrackPt [0],"All","P");
570  ltrack.AddEntry(hTrackPtSPD [0],"SPD","P");
571  ltrack.AddEntry(hTrackPtNoSPD[0],"No SPD","P");
572 
573  TCanvas * ctrack = new TCanvas(Form("TrackHisto_%s",histoTag.Data()),"",1500,1500);
574  ctrack->Divide(2,2);
575  ctrack->cd(1);
576  gPad->SetLogy();
577  hTrackPt[0]->Draw("");
578  for(Int_t iprod = 0; iprod < nProd; iprod++)
579  {
580  hTrackPt [iprod]->Draw("same");
581  hTrackPtSPD [iprod]->Draw("same");
582  hTrackPtNoSPD[iprod]->Draw("same");
583  }
584 
585  ltrack.Draw();
586  lprod.Draw();
587 
588  ctrack->cd(2);
589 
590  hRatTrackPt[0]->SetMaximum(1.05);
591  hRatTrackPt[0]->SetMinimum(0.95);
592  hRatTrackPt[0]->Draw("");
593  hRatTrackPt[0]->SetYTitle(Form("data X / %s",prod[0].Data()));
594  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
595  {
596  hRatTrackPt [iprod]->Draw("same");
597  hRatTrackPtSPD [iprod]->Draw("same");
598  hRatTrackPtNoSPD[iprod]->Draw("same");
599  }
600 
601  ctrack->cd(3);
602  hTrackPhi[0]->SetMaximum(3.);
603  hTrackPhi[0]->SetMinimum(0.);
604  hTrackPhi[0]->Draw("");
605  for(Int_t iprod = 0; iprod < nProd; iprod++)
606  {
607  hTrackPhi [iprod]->Draw("same");
608  hTrackPhiSPD [iprod]->Draw("same");
609  hTrackPhiNoSPD[iprod]->Draw("same");
610  }
611 
612  ctrack->cd(4);
613  //gPad->SetLogy();
614 
615  hRatTrackPhi[0]->SetMaximum(1.05);
616  hRatTrackPhi[0]->SetMinimum(0.95);
617  hRatTrackPhi[0]->Draw("");
618  hRatTrackPhi[0]->SetYTitle(Form("data X / %s",prod[0].Data()));
619  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
620  {
621  hRatTrackPhi [iprod]->Draw("same");
622  hRatTrackPhiSPD [iprod]->Draw("same");
623  hRatTrackPhiNoSPD[iprod]->Draw("same");
624  }
625 
626  ctrack->Print(Form("%s_TrackComp.eps",histoTag.Data()));
627  }
628 
629  // XE
630  {
631  TLegend lxe(0.6,0.75,0.84,0.89);
632  lxe.SetTextSize(0.04);
633  //lxe.SetBorderSize(0);
634  lxe.SetFillColor(0);
635  lxe.AddEntry(hXE [0],"Signal+bkg","P");
636  lxe.AddEntry(hXEUE[0],"Und. Event","P");
637 
638  TCanvas * cxe = new TCanvas(Form("XEHisto_%s",histoTag.Data()),"",1000,500);
639  cxe->Divide(2,1);
640  cxe->cd(1);
641  gPad->SetLogy();
642  hXE[0]->Draw("");
643  for(Int_t iprod = 0; iprod < nProd; iprod++)
644  {
645  hXE [iprod]->Draw("same");
646  hXEUE[iprod]->Draw("same");
647  }
648 
649  lxe.Draw();
650  lprod.Draw();
651 
652  cxe->cd(2);
653 
654  hRatXE[0]->SetMaximum(1.05);
655  hRatXE[0]->SetMinimum(0.95);
656  hRatXE[0]->Draw("");
657  hRatXE[0]->SetYTitle(Form("data X / %s",prod[0].Data()));
658  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
659  {
660  hRatXE [iprod]->Draw("same");
661  hRatXEUE[iprod]->Draw("same");
662  }
663 
664  cxe->Print(Form("%s_XEComp.eps",histoTag.Data()));
665  }
666 
667  // Centrality
668  {
669  TCanvas * ccen = new TCanvas(Form("Centrality_%s",histoTag.Data()),"",1000,500);
670  ccen->Divide(2,1);
671 
672  ccen->cd(1);
673  //gPad->SetLogy();
674 
675  hCen[0]->Draw();
676  for(Int_t iprod = 0; iprod < nProd; iprod++)
677  {
678  hCen[iprod]->Draw("same");
679  }
680 
681  lprod.Draw();
682 
683  ccen->cd(2);
684  //gPad->SetLogy();
685 
686  hRatCen[0]->SetTitle("Centrality");
687  hRatCen[0]->SetYTitle(Form("data X / %s",prod[0].Data()));
688  hRatCen[0]->SetMinimum(0.95);
689  hRatCen[0]->SetMaximum(1.05);
690  hRatCen[0]->Draw("");
691 
692  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
693  {
694  hRatCen [iprod]->Draw("same");
695  }
696 
697  TLine l1(0,1,100,1);
698 
699  l1.Draw("same");
700 
701  ccen->Print(Form("%s_CentralityComp.eps",histoTag.Data()));
702  }
703 
704  // Vertex
705  {
706  TCanvas * cvertex = new TCanvas(Form("Vertex_%s",histoTag.Data()),"",3*500,2*500);
707  cvertex->Divide(3,2);
708  Int_t npannel = 1;
709  for(Int_t ivertex = 0; ivertex < 3; ivertex++)
710  {
711  cvertex->cd(npannel);
712  //gPad->SetLogy();
713 
714  hVertex[ivertex][0]->Draw();
715  for(Int_t iprod = 0; iprod < nProd; iprod++)
716  {
717  hVertex[ivertex][iprod]->Draw("same");
718  }
719 
720  lprod.Draw();
721 
722  cvertex->cd(npannel+3);
723  gPad->SetGridy();
724 
725  //hRatVertex[ivertex][0]->SetTitle("");
726  hRatVertex[ivertex][0]->SetYTitle(Form("data X / %s",prod[0].Data()));
727  hRatVertex[ivertex][0]->SetMinimum(0.90);
728  hRatVertex[ivertex][0]->SetMaximum(1.10);
729  hRatVertex[ivertex][0]->Draw("");
730 
731  for(Int_t iprod = 0; iprod < nProd-1; iprod++)
732  {
733  hRatVertex[ivertex][iprod]->Draw("same");
734  }
735 
736  npannel++;
737  }
738  cvertex->Print(Form("%s_VertexComp.eps",histoTag.Data()));
739  }
740 }
741 
742 //_____________________________________________________
745 //_____________________________________________________
747 {
748  for(Int_t iprod = 0; iprod < nProd; iprod++)
749  {
750  file[iprod] = new TFile(Form("%s/%s",prod[iprod].Data(),fileName.Data()),"read");
751  if(file[iprod]->Get("hNEvents"))
752  {
753  nEvents[iprod] = ((TH1F*)file[iprod]->Get("hNEvents"))->GetEntries();
754  printf("%s: nEvents %e\n",prod[iprod].Data(),nEvents[iprod]);
755  }
756 
757  TDirectory * dir = (TDirectory*) file[iprod]->Get(listName);
758  if(dir)
759  {
760  list[iprod] = (TList*) dir->Get(listName);
761  nEvents[iprod] = ((TH1F*)list[iprod]->FindObject("hNEvents"))->GetEntries();
762  printf("%s: nEvents %e\n",prod[iprod],nEvents[iprod]);
763  }
764  else list[iprod] = 0;
765  }
766 }
767 
768 //___________________________________
771 //___________________________________
772 TObject * GetHisto(TString histoName, Int_t iprod)
773 {
774  if(list[iprod]) return list[iprod]->FindObject(histoName);
775  else return file[iprod]->Get (histoName);
776 }
Definition: External.C:236
TString fileName
TObject * GetHisto(TString histoName, Int_t iprod)
int Int_t
Definition: External.C:63
const Int_t nProd
float Float_t
Definition: External.C:68
void GetFileAndList(TString fileName, TString listName)
TList * list[nProd]
productions directory name
TFile * file[nProd]
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TObject * FindObject(int bin, const char *nameH, const TList *lst, Bool_t normPerEvent=kTRUE)
Float_t nEvents[nProd]
TString histoTag
Int_t color[]
void DrawProductionComparison(TString listName="Pi0IM_GammaTrackCorr_EMCAL_default", TString fileName="AnalysisResults.root")
TString prod[]
total number of productions