AliPhysics  a8fcd8c (a8fcd8c)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DrawPtHardBins.C
Go to the documentation of this file.
1 
31 //---------------------------------------------------------
32 // Set includes and declare methods for compilation
33 
34 #if !defined(__CINT__) || defined(__MAKECINT__)
35 
36 #include "TString.h"
37 #include "TH1F.h"
38 #include "TH2F.h"
39 #include "TFile.h"
40 #include "TCanvas.h"
41 #include "TPad.h"
42 #include "TStyle.h"
43 #include "TLine.h"
44 #include "TLegend.h"
45 #include "TMath.h"
46 #include "TGaxis.h"
47 
48 #endif
49 
60 //_______________________________________________________________________
61 void DrawPtHardBins
62 (
63  Int_t minE = 1,
64  Int_t maxE = 70,
65  const Int_t nBin = 20,
66  Int_t firstBin = 1,
67  Bool_t scaleHisto = kFALSE
68  )
69 {
70  TH1F * hNEvents;
71  TH1F * hXsec;
72  TH1F * hTrials;
73 
74  TH1F * hPtHard[nBin][2];
75  TH1F * hPtHardSum[2];
76 
77  TH1F * hClusterE[nBin][2];
78  TH1F * hClusterESum[2];
79 
80  TH1F * hClusterD[nBin][2];
81  TH1F * hClusterDSum[2];
82 
83  TH1F * hTrackPt[nBin][2][3];
84  TH1F * hTrackPtSum[2][3];
85 
86  TH1F * hPi0[nBin][2];
87  TH1F * hPi0Sum[2];
88 
89  TH1F * hPi0E[nBin][2];
90  TH1F * hPi0ESum[2];
91 
92  TH1F * hPi0D[nBin][2];
93  TH1F * hPi0DSum[2];
94 
95  TH1F * hGam[nBin][2];
96  TH1F * hGamSum[2];
97 
98  TH1F * hGamE[nBin][2];
99  TH1F * hGamESum[2];
100 
101  TH1F * hGamD[nBin][2];
102  TH1F * hGamDSum[2];
103 
104  TH2F * hEtaPhi [nBin][2];
105  TH2F * hCellEtaPhi [nBin][2];
106  TH2F * hTrackEtaPhi[nBin][2];
107 
108  TH2F * hIMEMCal[nBin][2];
109  TH2F * hIMDCal [nBin][2];
110 
111  TH2F * hEtaPhiSum [2];
112  TH2F * hCellEtaPhiSum [2];
113  TH2F * hTrackEtaPhiSum[2];
114 
115  TH2F * hIMEMCalSum[2];
116  TH2F * hIMDCalSum [2];
117 
118  TH2F* hTrackPhiGlobal[nBin][2];
119  TH2F* hTrackPhiNoSPD [nBin][2];
120 
121  TH2F* hTrackPhiGlobalSum[2];
122  TH2F* hTrackPhiNoSPDSum [2];
123 
124  TFile * f[nBin][2];
125  TFile * fTot [2];
126 
127  Int_t color[] =
128  { kRed -3, kRed, kRed +3, kBlue -3, kBlue, kBlue +3, kGreen -3, kGreen , kGreen +3,
129  kViolet-3, kViolet, kViolet+3, kOrange-3, kOrange, kOrange+3, kYellow-3, kYellow, kYellow+3,
130  kMagenta-3, kMagenta,kMagenta+3};
131 
132  Double_t scale[nBin];
133 
134  for(Int_t k = 0; k < 2; k++)
135  {
136  if ( k==1 ) fTot[k] = TFile::Open("Scaled.root" ,"read");
137  else fTot[k] = TFile::Open("NotScaled.root","read");
138 
139  for(Int_t i = 0; i < nBin; i++)
140  {
141  if ( k==1 ) f[i][k] = TFile::Open(Form("%d/ScaledMerged.root" ,i+firstBin),"read");
142  else f[i][k] = TFile::Open(Form("%d/NotScaledMerged.root",i+firstBin),"read");
143 
144  if(!f[i][k]) continue;
145 
146  //printf("i %d, k %d, f %p\n",i,k,f[i][k]);
147 
148  hPtHard[i][k] = (TH1F*) f[i][k]->Get("hPtHard");
149  hPtHard[i][k]->SetLineColor(color[i]);
150  hPtHard[i][k]->SetLineWidth(2);
151  //hPtHard[i][k]->SetAxisRange(minE, maxE,"X");
152 
153  // Recover scaling parameters
154  if ( k==0 )
155  {
156  hNEvents = (TH1F*) f[i][k]->Get("hNEvents");
157  hXsec = (TH1F*) f[i][k]->Get("hXsec");
158  hTrials = (TH1F*) f[i][k]->Get("hTrials");
159 
160  scale[i] =
161  (hXsec->GetBinContent(1)/hXsec->GetEntries()) /
162  (hTrials->GetBinContent(1)/ hNEvents->GetBinContent(1)) / hNEvents->GetBinContent(1);
163 // hXsec->GetBinContent(1)/hTrials->GetBinContent(1);
164 // 1. / hNEvents->GetBinContent(1);
165 // 1./ hPtHard[i][k]->GetEntries();
166 // hXsec->GetBinContent(1)/hTrials->GetBinContent(1)/hPtHard[i][k]->GetEntries();
167 
168  printf("bin i %d, events %2.3e, pT hard entries %2.3e (fraction of pT hard %2.4f),"
169  "chunks %2.0f, xsec %2.3e, trails %2.0f, xsec/chunks %2.3e, trials/nevents %2.3e, scale %2.3e \n",
170  i, hNEvents->GetBinContent(1),hPtHard[i][k]->GetEntries(), hPtHard[i][k]->GetEntries()/hNEvents->GetBinContent(1),
171  hXsec->GetEntries(), hXsec->GetBinContent(1), hTrials->GetBinContent(1),
172  hXsec->GetBinContent(1)/hXsec->GetEntries(),hTrials->GetBinContent(1)/ hNEvents->GetBinContent(1), scale[i] );
173  }
174 
175 
176  hClusterE[i][k] = (TH1F*) f[i][k]->Get("AnaPhoton_Calo0_hEPhoton");
177  hClusterE[i][k]->SetLineColor(color[i]);
178  hClusterE[i][k]->SetLineWidth(2);
179  hClusterE[i][k]->SetAxisRange(minE, maxE,"X");
180 
181  hClusterD[i][k] = (TH1F*) f[i][k]->Get("AnaPhoton_Calo1_hEPhoton");
182  if(hClusterD[i][k])
183  {
184  hClusterD[i][k]->SetLineColor(color[i]);
185  hClusterD[i][k]->SetLineWidth(2);
186  hClusterD[i][k]->SetAxisRange(minE, maxE,"X");
187  }
188 
189  for(Int_t j=0; j<3; j++)
190  {
191  if(!hTrackPt[i][k][j]) continue;
192  if(j==0) hTrackPt[i][k][j] = (TH1F*) f[i][k]->Get("AnaHadrons_hPt");
193  if(j==1) hTrackPt[i][k][j] = (TH1F*) f[i][k]->Get("AnaHadrons_hPtSPDRefit");
194  if(j==2) hTrackPt[i][k][j] = (TH1F*) f[i][k]->Get("AnaHadrons_hPtNoSPDRefit");
195  hTrackPt[i][k][j]->SetLineColor(color[i]);
196  hTrackPt[i][k][j]->SetLineWidth(2);
197  hTrackPt[i][k][j]->SetLineStyle(j);
198  hTrackPt[i][k][j]->SetAxisRange(minE, maxE,"X");
199  }
200 
201  hPi0[i][k] = (TH1F*) f[i][k]->Get("AnaPi0_Calo0_hPrimPi0Pt");
202  hPi0[i][k]->SetLineColor(color[i]);
203  hPi0[i][k]->SetLineWidth(2);
204  hPi0[i][k]->SetAxisRange(minE, maxE,"X");
205 
206  hPi0E[i][k] = (TH1F*) f[i][k]->Get("AnaPi0_Calo0_hPrimPi0PtInCalo");
207  hPi0E[i][k]->SetLineColor(color[i]);
208  hPi0E[i][k]->SetLineWidth(2);
209  hPi0E[i][k]->SetAxisRange(minE, maxE,"X");
210 
211  hPi0D[i][k] = (TH1F*) f[i][k]->Get("AnaPi0_Calo1_hPrimPi0PtInCalo");
212  if(hPi0D[i][k])
213  {
214  hPi0D[i][k]->SetLineColor(color[i]);
215  hPi0D[i][k]->SetLineWidth(2);
216  hPi0D[i][k]->SetAxisRange(minE, maxE,"X");
217  }
218 
219  hGam[i][k] = (TH1F*) f[i][k]->Get("AnaPhoton_Calo0_hPtPrim_MCPhoton");
220  hGam[i][k]->SetLineColor(color[i]);
221  hGam[i][k]->SetLineWidth(2);
222  hGam[i][k]->SetAxisRange(minE, maxE,"X");
223 
224  hGamE[i][k] = (TH1F*) f[i][k]->Get("AnaPhoton_Calo0_hPtPrimAcc_MCPhoton");
225  hGamE[i][k]->SetLineColor(color[i]);
226  hGamE[i][k]->SetLineWidth(2);
227  hGamE[i][k]->SetAxisRange(minE, maxE,"X");
228 
229  hGamD[i][k] = (TH1F*) f[i][k]->Get("AnaPhoton_Calo1_hPtPrimAcc_MCPhoton");
230  if(hGamD[i][k])
231  {
232  hGamD[i][k]->SetLineColor(color[i]);
233  hGamD[i][k]->SetLineWidth(2);
234  hGamD[i][k]->SetAxisRange(minE, maxE,"X");
235  }
236 
237  hIMEMCal[i][k] = (TH2F*) f[i][k]->Get("AnaPi0_Calo0_hRe_cen0_pidbit0_asy0_dist1");
238  hIMDCal [i][k] = (TH2F*) f[i][k]->Get("AnaPi0_Calo1_hRe_cen0_pidbit0_asy0_dist1");
239 
240  hTrackPhiGlobal[i][k] = (TH2F*) f[i][k]->Get("AnaHadrons_hEtaPhiSPDRefitPt02");
241  hTrackPhiNoSPD [i][k] = (TH2F*) f[i][k]->Get("AnaHadrons_hEtaPhiNoSPDRefitPt02");
242 
243  hEtaPhi [i][k] = (TH2F*) f[i][k]->Get("hEMCALReaderEtaPhi");
244  hCellEtaPhi [i][k] = (TH2F*) f[i][k]->Get("QA_Cell_hGridCells");
245  hTrackEtaPhi[i][k] = (TH2F*) f[i][k]->Get("AnaHadrons_hEtaPhiNegative");
246  hTrackEtaPhi[i][k]->Add((TH2F*) f[i][k]->Get("AnaHadrons_hEtaPhiPositive"));
247 
248  if(k==0)
249  {
250  hPtHard [i][k]->Sumw2();
251  hClusterE[i][k]->Sumw2();
252  if(hClusterD[i][k]) hClusterD[i][k]->Sumw2();
253  hPi0 [i][k]->Sumw2();
254  hPi0E [i][k]->Sumw2();
255  if(hPi0D[i][k]) hPi0D [i][k]->Sumw2();
256  hGam [i][k]->Sumw2();
257  hGamE [i][k]->Sumw2();
258  if(hGamD[i][k]) hGamD [i][k]->Sumw2();
259  for(Int_t j = 0; j < 3; j++) hTrackPt[i][k][j]->Sumw2();
260  //hEtaPhi [i][k]->Sumw2();
261  //hCellEtaPhi [i][k]->Sumw2();
262  //hTrackEtaPhi[i][k]->Sumw2();
263  hIMEMCal [i][k]->Sumw2();
264  if(hIMDCal[i][k]) hIMDCal[i][k]->Sumw2();
265 
266  hTrackPhiNoSPD [i][k]->Sumw2();
267  hTrackPhiGlobal[i][k]->Sumw2();
268  }
269 
270  // Recover the summed histograms, or scale sum
271  if ( k==1 || (k==0 && !scaleHisto))
272  {
273  hPtHardSum[k] = (TH1F*) fTot[k]->Get("hPtHard");
274  hPtHardSum[k]->SetLineColor(1);
275  hPtHardSum[k]->SetLineWidth(2);
276  //hPtHardSum[k]->SetAxisRange(minE, maxE,"X");
277 
278  hClusterESum[k] = (TH1F*) fTot[k]->Get("AnaPhoton_Calo0_hEPhoton");
279  hClusterESum[k]->SetLineColor(1);
280  hClusterESum[k]->SetLineWidth(2);
281  hClusterESum[k]->SetAxisRange(minE, maxE,"X");
282 
283  hClusterDSum[k] = (TH1F*) fTot[k]->Get("AnaPhoton_Calo1_hEPhoton");
284  if(hClusterDSum[k])
285  {
286  hClusterDSum[k]->SetLineColor(1);
287  hClusterDSum[k]->SetLineWidth(2);
288  hClusterDSum[k]->SetAxisRange(minE, maxE,"X");
289  }
290 
291  for(Int_t j = 0; j < 3; j++)
292  {
293  if(!hTrackPtSum[k][j]) continue;
294  if(j==0) hTrackPtSum[k][j] = (TH1F*) fTot[k]->Get("AnaHadrons_hPt");
295  if(j==1) hTrackPtSum[k][j] = (TH1F*) fTot[k]->Get("AnaHadrons_hPtSPDRefit");
296  if(j==2) hTrackPtSum[k][j] = (TH1F*) fTot[k]->Get("AnaHadrons_hPtNoSPDRefit");
297  hTrackPtSum[k][j]->SetLineColor(1);
298  hTrackPtSum[k][j]->SetLineWidth(2);
299  hTrackPtSum[k][j]->SetLineStyle(j);
300  hTrackPtSum[k][j]->SetAxisRange(minE, maxE,"X");
301  }
302 
303  hPi0Sum[k] = (TH1F*) fTot[k]->Get("AnaPi0_Calo0_hPrimPi0Pt");
304  hPi0Sum[k]->SetLineColor(1);
305  hPi0Sum[k]->SetLineWidth(2);
306  hPi0Sum[k]->SetAxisRange(minE, maxE,"X");
307 
308  hPi0ESum[k] = (TH1F*) fTot[k]->Get("AnaPi0_Calo0_hPrimPi0PtInCalo");
309  hPi0ESum[k]->SetLineColor(1);
310  hPi0ESum[k]->SetLineWidth(2);
311  hPi0ESum[k]->SetAxisRange(minE, maxE,"X");
312 
313  hPi0DSum[k] = (TH1F*) fTot[k]->Get("AnaPi0_Calo1_hPrimPi0PtInCalo");
314  if(hPi0DSum[k])
315  {
316  hPi0DSum[k]->SetLineColor(1);
317  hPi0DSum[k]->SetLineWidth(2);
318  hPi0DSum[k]->SetAxisRange(minE, maxE,"X");
319  }
320 
321  hGamSum[k] = (TH1F*) fTot[k]->Get("AnaPhoton_Calo0_hPtPrim_MCPhoton");
322  hGamSum[k]->SetLineColor(1);
323  hGamSum[k]->SetLineWidth(2);
324  hGamSum[k]->SetAxisRange(minE, maxE,"X");
325 
326  hGamESum[k] = (TH1F*) fTot[k]->Get("AnaPhoton_Calo0_hPtPrimAcc_MCPhoton");
327  hGamESum[k]->SetLineColor(1);
328  hGamESum[k]->SetLineWidth(2);
329  hGamESum[k]->SetAxisRange(minE, maxE,"X");
330 
331  hGamDSum[k] = (TH1F*) fTot[k]->Get("AnaPhoton_Calo1_hPtPrimAcc_MCPhoton");
332  if(hGamDSum[k])
333  {
334  hGamDSum[k]->SetLineColor(1);
335  hGamDSum[k]->SetLineWidth(2);
336  hGamDSum[k]->SetAxisRange(minE, maxE,"X");
337  }
338 
339  hIMEMCalSum[k] = (TH2F*) fTot[k]->Get("AnaPi0_Calo0_hRe_cen0_pidbit0_asy0_dist1");
340  hIMDCalSum [k] = (TH2F*) fTot[k]->Get("AnaPi0_Calo1_hRe_cen0_pidbit0_asy0_dist1");
341 
342  hTrackPhiGlobalSum[k] = (TH2F*) fTot[k]->Get("AnaHadrons_hEtaPhiSPDRefitPt02");
343  hTrackPhiNoSPDSum [k] = (TH2F*) fTot[k]->Get("AnaHadrons_hEtaPhiNoSPDRefitPt02");
344 
345  hEtaPhiSum [k] = (TH2F*) fTot[k]->Get("hEMCALReaderEtaPhi");
346  hCellEtaPhiSum [k] = (TH2F*) fTot[k]->Get("QA_Cell_hGridCells");
347  hTrackEtaPhiSum[k] = (TH2F*) fTot[k]->Get("AnaHadrons_hEtaPhiNegative");
348  hTrackEtaPhiSum[k]->Add((TH2F*) fTot[k]->Get("AnaHadrons_hEtaPhiPositive"));
349 
350 // if(k==0)
351 // {
352 // hPtHardSum [k]->Sumw2();
353 // hClusterESum[k]->Sumw2();
354 // hClusterDSum[k]->Sumw2();
355 // hPi0Sum [k]->Sumw2();
356 // hPi0ESum [k]->Sumw2();
357 // if(hPi0DSum[k])hPi0DSum[k]->Sumw2();
358 // hGamSum [k]->Sumw2();
359 // hGamESum [k]->Sumw2();
360 // if(hGamDSum[k])hGamDSum[k]->Sumw2();
361 // for(Int_t j = 0; j < 3; j++) hTrackPtSum[k][j]->Sumw2();
362 // //hEtaPhiSum [k]->Sumw2();
363 // //hCellEtaPhiSum [k]->Sumw2();
364 // //hTrackEtaPhiSum[k]->Sumw2();
365 // hIMEMCalSum [k]->Sumw2();
366 // if(hIMDCalSum[k])hIMDCalSum[k]->Sumw2();
367 // hTrackPhiNoSPDSum [k]->Sumw2();
368 // hTrackPhiGlobalSum[k]->Sumw2();
369 // }
370 
371  }
372  // Scaler and merge
373  else if ( scaleHisto && k == 0 )
374  {
375  hPtHard [i][k]->Scale(scale[i]);
376  hClusterE[i][k]->Scale(scale[i]);
377  if(hClusterD[i][k])hClusterD[i][k]->Scale(scale[i]);
378  hPi0 [i][k]->Scale(scale[i]);
379  hPi0E [i][k]->Scale(scale[i]);
380  if(hPi0D[i][k])hPi0D[i][k]->Scale(scale[i]);
381  hGam [i][k]->Scale(scale[i]);
382  hGamE [i][k]->Scale(scale[i]);
383  if(hGamD[i][k])hGamD[i][k]->Scale(scale[i]);
384 
385  for(Int_t j = 0; j < 3; j++) hTrackPt[i][k][j]->Scale(scale[i]);
386 
387  hEtaPhi [i][k]->Scale(scale[i]);
388  hCellEtaPhi [i][k]->Scale(scale[i]);
389  hTrackEtaPhi[i][k]->Scale(scale[i]);
390 
391  hIMEMCal[i][k]->Scale(scale[i]);
392  if(hIMDCal[i][k])hIMDCal[i][k]->Scale(scale[i]);
393 
394  hTrackPhiNoSPD [i][k]->Scale(scale[i]);
395  hTrackPhiGlobal[i][k]->Scale(scale[i]);
396 
397  if ( i == 0 )
398  {
399  hPtHardSum[k] = (TH1F*) hPtHard[i][k]->Clone("hPtHardSum");
400  hPtHardSum[k]->SetLineColor(1);
401 
402  hClusterESum[k] = (TH1F*) hClusterE[i][k]->Clone("hClusterESum");
403  hClusterESum[k]->SetLineColor(1);
404 
405  hClusterDSum[k] = (TH1F*) hClusterD[i][k]->Clone("hClusterDSum");
406  if(hClusterDSum[k])hClusterDSum[k]->SetLineColor(1);
407 
408  hPi0Sum [k] = (TH1F*) hPi0 [i][k]->Clone("hPi0Sum");
409  hPi0Sum [k]->SetLineColor(1);
410 
411  hPi0ESum[k] = (TH1F*) hPi0E[i][k]->Clone("hPi0ESum");
412  hPi0ESum[k]->SetLineColor(1);
413 
414  hPi0DSum[k] = (TH1F*) hPi0D[i][k]->Clone("hPi0DSum");
415  if(hPi0DSum[k])hPi0DSum[k]->SetLineColor(1);
416 
417  hGamSum [k] = (TH1F*) hPi0 [i][k]->Clone("hGamSum");
418  hGamSum [k]->SetLineColor(1);
419 
420  hGamESum[k] = (TH1F*) hPi0E[i][k]->Clone("hGamESum");
421  hGamESum[k]->SetLineColor(1);
422 
423  hGamDSum[k] = (TH1F*) hPi0D[i][k]->Clone("hGamDSum");
424  if(hGamDSum[k])hGamDSum[k]->SetLineColor(1);
425 
426  for(Int_t j = 0; j < 3; j++)
427  {
428  hTrackPtSum[k][j] = (TH1F*) hTrackPt[i][k][j]->Clone(Form("%sSum",hTrackPt[i][k][j]->GetName()));
429  hTrackPtSum[k][j]->SetLineColor(1);
430  }
431 
432  hEtaPhiSum [k] = (TH2F*) hEtaPhi [i][k]->Clone("hEtaPhiSum");
433  hCellEtaPhiSum [k] = (TH2F*) hEtaPhi [i][k]->Clone("hCellEtaPhiSum");
434  hTrackEtaPhiSum[k] = (TH2F*) hTrackEtaPhi [i][k]->Clone("hTrackEtaPhiSum");
435 
436  hIMEMCalSum[k] = (TH2F*) hIMEMCal[i][k]->Clone("hIMEMCalSum");
437  if(hIMDCal[i][k])hIMDCalSum [k] = (TH2F*) hIMDCal [i][k]->Clone("hIMDCalSum");
438 
439  hTrackPhiGlobalSum[k] = (TH2F*) hTrackPhiGlobal[i][k]->Clone("hTrackPhiGlobalSum");
440  hTrackPhiNoSPDSum [k] = (TH2F*) hTrackPhiNoSPD [i][k]->Clone("hTrackPhiNoSPDSum");
441  }
442  else
443  {
444  hPtHardSum [k]->Add(hPtHard[i][k]);
445 
446  hClusterESum[k]->Add(hClusterE[i][k]);
447  if(hClusterD[i][k])hClusterDSum[k]->Add(hClusterD[i][k]);
448 
449  hPi0Sum [k]->Add(hPi0 [i][k]);
450  hPi0ESum[k]->Add(hPi0E[i][k]);
451  if(hPi0D[i][k])hPi0DSum[k]->Add(hPi0D[i][k]);
452 
453  hGamSum [k]->Add(hGam [i][k]);
454  hGamESum[k]->Add(hGamE[i][k]);
455  if(hGamD[i][k])hGamDSum[k]->Add(hGamD[i][k]);
456 
457  for(Int_t j = 0; j < 3; j++) hTrackPtSum[k][j]->Add(hTrackPt[i][k][j]);
458 
459  hEtaPhiSum [k]->Add(hEtaPhi [i][k]);
460  hCellEtaPhiSum [k]->Add(hCellEtaPhi [i][k]);
461  hTrackEtaPhiSum[k]->Add(hTrackEtaPhi[i][k]);
462 
463  hIMEMCalSum[k]->Add(hIMEMCal[i][k]);
464  if(hIMDCal[i][k])hIMDCalSum[k]->Add(hIMDCal[i][k]);
465 
466  hTrackPhiNoSPDSum [k]->Add(hTrackPhiNoSPD [i][k]);
467  hTrackPhiGlobalSum[k]->Add(hTrackPhiGlobal[i][k]);
468  }
469  }
470 
471  } // pT hard loop
472 
473  } // loop scaled/non scaled
474 
475 
476 
477  TString scaleCase [] = {"NotScaled" ,"Scaled"};
478  TString scaleTitle[] = {"Not scaled","Scaled"};
479  TString trackType [] = {"All","Global","noSPD"};
480 
481  for(Int_t k = 0; k < 2; k++)
482  {
483 
484  gStyle->SetPadTopMargin(0.10);
485  gStyle->SetPadRightMargin(0.02);
486 
487  gStyle->SetPadBottomMargin(0.12);
488  gStyle->SetPadLeftMargin(0.14);
489 
490  gStyle->SetOptTitle(1);
491  gStyle->SetTitleOffset(1.6,"Y");
492  gStyle->SetOptStat(0);
493  gStyle->SetOptFit(000000);
494 
495  TLegend l(0.8,0.3, 0.95, 0.95);
496  l.SetBorderSize(0);
497  l.SetFillColor(0);
498  l.SetTextSize(0.04);
499  l.SetHeader(scaleTitle[k]);
500 
501  //
502  // CLUSTER spectrum
503  //
504  // EMCal
505  TCanvas * cE = new TCanvas(Form("cClusterE%d",k),Form("cluster EMCal %s", scaleCase[k].Data()), 200,200);
506 
507  gPad->SetLogy();
508  //gPad->SetLogx();
509  hClusterESum[k]->SetTitle(Form("EMCal cluster, %s",scaleTitle[k].Data()));
510  hClusterESum[k]->Draw("H");
511  //hClusterESum[k]->SetMinimum(1);
512  l.AddEntry(hClusterESum[k],"Sum","L");
513 
514  for(Int_t i = 0; i < nBin; i++)
515  {
516  if(!hClusterE[i][k]) continue;
517  hClusterE[i][k]->Draw("H same");
518  l.AddEntry(hClusterE[i][k],Form("Bin %d",i+firstBin),"L");
519  }
520 
521  hClusterESum[k]->Draw("H same");
522 
523  l.Draw();
524 
525  cE->Print(Form("Cluster_Energy_EMCal_%s.eps",scaleCase[k].Data()));
526 
527  // DCal
528  if(hClusterDSum[k])
529  {
530  TCanvas * cD = new TCanvas(Form("cClusterD%d",k),Form("cluster DCal %s", scaleCase[k].Data()), 200,200);
531 
532  gPad->SetLogy();
533  //gPad->SetLogx();
534 
535  hClusterDSum[k]->SetTitle(Form("DCal cluster, %s",scaleTitle[k].Data()));
536  hClusterDSum[k]->Draw("H");
537  //hClusterDSum[k]->SetMinimum(1);
538 
539  for(Int_t i = 0; i < nBin; i++)
540  {
541  hClusterD[i][k]->Draw("H same");
542  }
543 
544  hClusterDSum[k]->Draw("H same");
545 
546  l.Draw();
547 
548  cD->Print(Form("Cluster_Energy_DCal_%s.eps",scaleCase[k].Data()));
549  }
550 
551  //
552  // Parton PT hard spectrum
553  //
554  TCanvas * cHard = new TCanvas(Form("cPtHard%d",k),Form("pT Hard %s", scaleCase[k].Data()), 200,200);
555 
556  gPad->SetLogy();
557  //gPad->SetLogx();
558 
559  hPtHardSum[k]->SetTitle(Form("Generated parton hard-pT, %s",scaleTitle[k].Data()));
560  hPtHardSum[k]->Draw("H");
561  //hPtHardSum[k]->SetMinimum(1);
562 
563  for(Int_t i = 0; i < nBin; i++)
564  {
565  if(!hPtHard[i][k]) continue;
566  hPtHard[i][k]->Draw("H same");
567  }
568 
569  hPtHardSum[k]->Draw("H same");
570 
571  l.Draw();
572 
573  cHard->Print(Form("PtHard_%s.eps",scaleCase[k].Data()));
574 
575  //
576  // TRACK spectra
577  //
578  for(Int_t j=0; j<3; j++)
579  {
580  TCanvas * cTr = new TCanvas(Form("cTrackPt%d_Type%d",k,j),
581  Form("Track Pt Type %s, %s",trackType[j].Data(),scaleTitle[k].Data()),
582  200,200);
583  gPad->SetLogy();
584  //gPad->SetLogx();
585 
586  hTrackPtSum[k][j]->SetTitle(Form("Hybrid tracks, %s",scaleTitle[k].Data()));
587  hTrackPtSum[k][j]->Draw("H");
588  //hTrackPtSum[k][j]->SetMinimum(1);
589  for(Int_t i = 0; i < nBin; i++)
590  {
591  if(!hTrackPt[i][k][j]) continue;
592  hTrackPt[i][k][j]->Draw("H same");
593  }
594 
595  l.Draw();
596 
597  cTr->Print(Form("TrackPt_%s_%s.eps",scaleCase[k].Data(),trackType[j].Data()));
598  }
599 
600  //
601  // Generated Pi0 spectrum
602  //
603  // No acceptance selection
604  TCanvas * cPi0 = new TCanvas(Form("cPi0%d",k),Form("Generated Pi0 %s", scaleCase[k].Data()), 200,200);
605 
606  gPad->SetLogy();
607  //gPad->SetLogx();
608 
609  hPi0Sum[k]->SetTitle(Form("Generated #pi^{0}, %s",scaleTitle[k].Data()));
610  hPi0Sum[k]->Draw("H");
611  //hPi0Sum[k]->SetMinimum(1);
612 
613  for(Int_t i = 0; i < nBin; i++)
614  {
615  if(!hPi0[i][k]) continue;
616  hPi0[i][k]->Draw("H same");
617  }
618 
619  l.Draw();
620 
621  cPi0->Print(Form("GeneratedPi0_Pt_%s.eps",scaleCase[k].Data()));
622 
623  // EMCal
624  TCanvas * cPi0E = new TCanvas(Form("cPi0E%d",k),Form("Generated Pi0 in EMCal acceptance %s", scaleCase[k].Data()), 200,200);
625 
626  gPad->SetLogy();
627  //gPad->SetLogx();
628 
629  hPi0ESum[k]->SetTitle(Form("Generated #pi^{0} in EMCal, %s",scaleTitle[k].Data()));
630  hPi0ESum[k]->Draw("H");
631  //hPi0ESum[k]->SetMinimum(1);
632 
633  for(Int_t i = 0; i < nBin; i++)
634  {
635  if(!hPi0E[i][k]) continue;
636  hPi0E[i][k]->Draw("H same");
637  }
638 
639  l.Draw();
640 
641  cPi0E->Print(Form("GeneratedPi0_EMCal_Pt_%s.eps",scaleCase[k].Data()));
642 
643  // DCal
644  if(hPi0DSum[k])
645  {
646  TCanvas * cPi0D = new TCanvas(Form("cPi0D%d",k),Form("Generated Pi0 in DCal acceptance %s", scaleCase[k].Data()), 200,200);
647 
648  gPad->SetLogy();
649  //gPad->SetLogx();
650 
651  hPi0DSum[k]->SetTitle(Form("Generated #pi^{0} in DCal, %s",scaleTitle[k].Data()));
652  hPi0DSum[k]->Draw("H");
653  //hPi0DSum[k]->SetMinimum(1);
654 
655  for(Int_t i = 0; i < nBin; i++)
656  {
657  if(!hPi0D[i][k]) continue;
658  hPi0D[i][k]->Draw("H same");
659  }
660 
661  l.Draw();
662 
663  cPi0D->Print(Form("GeneratedPi0_DCal_Pt_%s.eps",scaleCase[k].Data()));
664  }
665 
666  //
667  // Generated Gamma spectrum
668  //
669  // No acceptance selection
670  TCanvas * cGam = new TCanvas(Form("cGamma%d",k),Form("Generated Gamma %s", scaleCase[k].Data()), 200,200);
671 
672  gPad->SetLogy();
673  //gPad->SetLogx();
674 
675  hGamSum[k]->SetTitle(Form("Generated #gamma, %s",scaleTitle[k].Data()));
676  hGamSum[k]->Draw("H");
677  //hGamSum[k]->SetMinimum(1);
678 
679  for(Int_t i = 0; i < nBin; i++)
680  {
681  if(!hGam[i][k]) continue;
682  hGam[i][k]->Draw("H same");
683  }
684 
685  l.Draw();
686 
687  cGam->Print(Form("GeneratedGam_Pt_%s.eps",scaleCase[k].Data()));
688 
689  // EMCal
690  TCanvas * cGamE = new TCanvas(Form("cGammaE%d",k),Form("Generated Gamma in EMCal acceptance %s", scaleCase[k].Data()), 200,200);
691 
692  gPad->SetLogy();
693  //gPad->SetLogx();
694 
695  hGamESum[k]->SetTitle(Form("Generated #gamma in EMCal acceptance, %s",scaleTitle[k].Data()));
696  hGamESum[k]->Draw("H");
697  //hGamESum[k]->SetMinimum(1);
698 
699  for(Int_t i = 0; i < nBin; i++)
700  {
701  if(!hGamE[i][k]) continue;
702  hGamE[i][k]->Draw("H same");
703  }
704 
705  l.Draw();
706 
707  cGamE->Print(Form("GeneratedGamma_EMCal_Pt_%s.eps",scaleCase[k].Data()));
708 
709  // DCal
710  if(hGamDSum[k])
711  {
712  TCanvas * cGamD = new TCanvas(Form("cGammaD%d",k),Form("Generated Gamma in DCal acceptance %s", scaleCase[k].Data()), 200,200);
713 
714  gPad->SetLogy();
715  //gPad->SetLogx();
716 
717  hGamDSum[k]->SetTitle(Form("Generated #gamma in DCal acceptance, %s",scaleTitle[k].Data()));
718  hGamDSum[k]->Draw("H");
719  //hGamDSum[k]->SetMinimum(1);
720 
721  for(Int_t i = 0; i < nBin; i++)
722  {
723  if(!hGamD[i][k]) continue;
724  hGamD[i][k]->Draw("H same");
725  }
726 
727  l.Draw();
728 
729  cGamD->Print(Form("GeneratedGamma_DCal_Pt_%s.eps",scaleCase[k].Data()));
730  }
731 
733  // Inv. Mass. Projections //
735  Int_t binmin = hIMEMCalSum[k]->GetXaxis()->FindBin(5);
736  Int_t binmax = hIMEMCalSum[k]->GetXaxis()->FindBin(10);
737  //printf("Bins Min %d, Max %d\n",binmin,binmax);
738 
739  TH1F * hInvMassEMC = (TH1F*) hIMEMCalSum[k]->ProjectionY(Form("hEMCInvMass%d",k),binmin,binmax);
740  hInvMassEMC->SetLineColor(1);
741 
742  TH1F * hInvMassDMC = 0;
743  if(hIMDCalSum[k])
744  {
745  hInvMassDMC = (TH1F*) hIMDCalSum[k] ->ProjectionY(Form("hDMCInvMass%d",k),binmin,binmax);
746  hInvMassDMC->SetLineColor(4);
747  }
748 
749  TCanvas * cIMProj = new TCanvas(Form("cIMProj%d",k),Form("DCal/EMCa; Inv. Mass; %s",scaleCase[k].Data()), 200,200);
750 
751  //gPad->SetLogz();
752  gPad->SetGridx();
753 
754  hInvMassEMC->SetAxisRange(0.05, 0.3);
755  hInvMassEMC->SetMinimum(1);
756 
757  hInvMassEMC->SetTitle(Form("Cluster pair M in #pi^{0} region, %s",scaleTitle[k].Data()));
758 
759  hInvMassEMC->Draw("H");
760  if(hInvMassDMC)hInvMassDMC->Draw("H same");
761 
762  TLegend lim(0.6,0.8,0.98,0.98);
763  lim.SetHeader("5 < E < 10 GeV ");
764  lim.AddEntry(hInvMassEMC,"EMCal","L");
765  if(hInvMassDMC)lim.AddEntry(hInvMassDMC,"EMCal","L");
766  lim.Draw();
767 
768  cIMProj->Print(Form("InvMassDCalEMCal_5_10GeV_%s.eps",scaleCase[k].Data()));
769 
771  // Track Phi Projections //
773 
774  TCanvas * cPhiProj = new TCanvas(Form("cPhiProj%d",k),Form("Track phi; %s",scaleCase[k].Data()), 200,200);
775 
776  TH1F* hPhiSPD = (TH1F*)hTrackPhiGlobalSum[k]->ProjectionY(Form("%s_hTrackPhiSPD" ,scaleCase[k].Data()),0,1000);
777  TH1F* hPhiNoSPD = (TH1F*)hTrackPhiNoSPDSum [k]->ProjectionY(Form("%s_hTrackPhiNoSPD",scaleCase[k].Data()),0,1000);
778  TH1F* hPhi = (TH1F*)hPhiSPD->Clone(Form("%s_hTrackPhi",scaleCase[k].Data()));
779  hPhi->Add(hPhiNoSPD);
780 
781  Float_t normFactor = 1./hPhi->Integral();
782  hPhi ->Scale(normFactor);
783  hPhiSPD ->Scale(normFactor);
784  hPhiNoSPD->Scale(normFactor);
785 
786  hPhi ->SetTitle(Form("Hybrid track type #varphi, 0.2<#it{p}_{T}<2 GeV/#it{c}, %s",scaleTitle[k].Data()));
787  hPhi ->SetLineColor(1);
788  hPhiSPD ->SetLineColor(2);
789  hPhiNoSPD->SetLineColor(4);
790 
791  hPhi ->SetMinimum(0);
792  hPhi ->SetMaximum(hPhi->GetMaximum()*1.3);
793  hPhi ->SetTitleOffset(1.5,"Y");
794  hPhi ->SetYTitle("Entries");
795 
796  TGaxis::SetMaxDigits(3);
797 
798  hPhi ->Draw("H");
799  hPhiSPD ->Draw("Hsame");
800  hPhiNoSPD->Draw("Hsame");
801 
802  TLegend lphi(0.2,0.75,0.4,0.89);
803  lphi.SetTextSize(0.04);
804  lphi.AddEntry(hPhi,"Sum","L");
805  lphi.AddEntry(hPhiSPD ,"SPD+Refit","L");
806  lphi.AddEntry(hPhiNoSPD,"No SPD+Refit","L");
807  lphi.SetBorderSize(0);
808  lphi.SetFillColor(0);
809  lphi.Draw();
810 
811  cPhiProj->Print(Form("TrackPhi_%s.eps",scaleCase[k].Data()));
812 
814  // Acceptance
816 
817  gStyle->SetPadRightMargin(0.12);
818 
819 
820  TCanvas * cEtaPhi = new TCanvas(Form("cEtaPhi%d",k),Form("cluster Eta/phi, %s",scaleCase[k].Data()), 200,200);
821 
822  gPad->SetLogz();
823  //gPad->SetLogx();
824 
825  hEtaPhiSum[k]->SetAxisRange(-1,1,"X");
826  hEtaPhiSum[k]->SetAxisRange( 1,6,"Y");
827 
828  hEtaPhiSum[k]->SetTitle(Form("EMCal/DCal Cluster acceptance, %s",scaleTitle[k].Data()));
829 
830  hEtaPhiSum[k]->Draw("colz");
831 
832  cEtaPhi->Print(Form("EtaPhi_Cluster_%s.eps",scaleCase[k].Data()));
833 
834  TCanvas * cCellEtaPhi = new TCanvas(Form("cCellEtaPhi%d",k),Form("cell Eta/phi, %s",scaleCase[k].Data()), 200,200);
835 
836  gPad->SetLogz();
837  //gPad->SetLogx();
838 
839  hCellEtaPhiSum[k]->SetTitle(Form("EMCal/DCal cell acceptance, %s",scaleTitle[k].Data()));
840 
841  hCellEtaPhiSum[k]->Draw("colz");
842 
843  cCellEtaPhi->Print(Form("EtaPhi_Cell_%s.eps",scaleCase[k].Data()));
844 
845  TCanvas * cTrackEtaPhi = new TCanvas(Form("cTrackEtaPhi%d",k),Form("track Eta/phi, %s",scaleCase[k].Data()), 200,200);
846 
847  gPad->SetLogz();
848  //gPad->SetLogx();
849 
850  hTrackEtaPhiSum[k]->SetTitle(Form("Hybrid track acceptance, %s",scaleTitle[k].Data()));
851 
852  hTrackEtaPhiSum[k]->Draw("colz");
853 
854  cTrackEtaPhi->Print(Form("EtaPhi_Track_%s.eps",scaleCase[k].Data()));
855 
857  // EMCal Invariant mass
859  TCanvas * cIM = new TCanvas(Form("cIM%d",k),Form("EMCal Inv. Mass, %s",scaleCase[k].Data()), 200,200);
860 
861  gPad->SetLogz();
862  //gPad->SetLogx();
863 
864  hIMEMCalSum[k]->SetAxisRange(4,20,"X");
865 
866  hIMEMCalSum[k]->SetTitle(Form("EMCal cluster invariant mass, %s",scaleTitle[k].Data()));
867 
868  hIMEMCalSum[k]->Draw("colz");
869 
870  cIM->Print(Form("InvMassEMCal_%s.eps",scaleCase[k].Data()));
871 
873  // DCal Invariant mass
875  if(hIMDCalSum[k])
876  {
877  TCanvas * cIMD = new TCanvas(Form("cIMD%d",k),Form("DCal Inv. Mass, %s",scaleCase[k].Data()), 200,200);
878 
879  gPad->SetLogz();
880  //gPad->SetLogx();
881 
882  hIMDCalSum[k]->SetAxisRange(4,20,"X");
883 
884  hIMDCalSum[k]->SetTitle(Form("DCal cluster invariant mass, %s",scaleTitle[k].Data()));
885 
886  hIMDCalSum[k]->Draw("colz");
887 
888  cIMD->Print(Form("InvMassDCal_%s.eps",scaleCase[k].Data()));
889  }
890 
891  }
892 
893 }
894 
895 
Int_t color[]
print message on plot with ok/not ok
double Double_t
Definition: External.C:58
Definition: External.C:236
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
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)
void DrawPtHardBins(Int_t minE=1, Int_t maxE=70, const Int_t nBin=20, Int_t firstBin=1, Bool_t scaleHisto=kFALSE)
TH2 * Scale(TH2 *h, TH1 *g)
bool Bool_t
Definition: External.C:53