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