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