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