Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plot_DataSimComp.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plot_DataSimComp.py
1 #! /usr/bin/env python
2 from optparse import OptionParser
3 import sys
4 import os
5 import datetime
6 from array import *
7 from ROOT import *
8 import numpy
9 import math
10 import glob
11 from plotUtil import *
12 
13 gROOT.LoadMacro('./sPHENIXStyle/sPhenixStyle.C')
14 gROOT.ProcessLine('SetsPhenixStyle()')
15 gROOT.SetBatch(True)
16 
17 def Draw_1Dhist_datasimcomp(hdata, hsims, gpadmargin, norm, logy, ymaxscale, XaxisName, Ytitle_unit, prelim, simlegtex, outname):
18  hsimcolor = colorset(len(hsims))
19 
20  hdata.Sumw2()
21  for hsim in hsims:
22  hsim.Sumw2()
23 
24  binwidth = hdata.GetXaxis().GetBinWidth(1)
25 
26  if norm == 'unity':
27  hdata.Scale(1. / hdata.Integral(-1, -1))
28  for hsim in hsims:
29  hsim.Scale(1. / hsim.Integral(-1, -1))
30  elif norm == 'data':
31  for hsim in hsims:
32  hsim.Scale(hdata.Integral(-1, -1) / hsim.Integral(-1, -1))
33  else:
34  if norm != 'none':
35  print('Invalid normalization option: {}'.format(norm))
36  sys.exit(1)
37 
38  # Get the maximum bin content
39  maxbincontent = max(hdata.GetMaximum(), hsim.GetMaximum())
40 
41  c = TCanvas('c', 'c', 800, 700)
42  if logy:
43  c.SetLogy()
44  c.cd()
45  gPad.SetRightMargin(gpadmargin[0])
46  gPad.SetTopMargin(gpadmargin[1])
47  gPad.SetLeftMargin(gpadmargin[2])
48  gPad.SetBottomMargin(gpadmargin[3])
49 
50  for i, hsim in enumerate(hsims):
51  if i == 0:
52  if norm == 'unity':
53  if Ytitle_unit == '':
54  hsim.GetYaxis().SetTitle(
55  'Normalized entries / ({:g})'.format(binwidth))
56  else:
57  hsim.GetYaxis().SetTitle(
58  'Normalized entries / ({:g} {unit})'.format(binwidth, unit=Ytitle_unit))
59  else:
60  if Ytitle_unit == '':
61  hsim.GetYaxis().SetTitle('Entries / ({:g})'.format(binwidth))
62  else:
63  hsim.GetYaxis().SetTitle(
64  'Entries / ({:g} {unit})'.format(binwidth, unit=Ytitle_unit))
65 
66  if logy:
67  hsim.GetYaxis().SetRangeUser(hsim.GetMinimum(0)*0.5, (hsim.GetMaximum()) * ymaxscale)
68  else:
69  hsim.GetYaxis().SetRangeUser(0., (hsim.GetMaximum()) * ymaxscale)
70 
71  hsim.GetXaxis().SetTitle(XaxisName)
72  hsim.GetXaxis().SetTitleOffset(1.1)
73  hsim.GetYaxis().SetTitleOffset(1.35)
74  hsim.SetLineColor(TColor.GetColor(hsimcolor[i]))
75  hsim.SetLineWidth(2)
76  hsim.SetMarkerSize(0)
77  hsim.Draw('histe')
78  else:
79  hsim.SetLineColor(TColor.GetColor(hsimcolor[i]))
80  hsim.SetLineWidth(2)
81  hsim.SetMarkerSize(0)
82  hsim.Draw('histe same')
83 
84  hdata.SetMarkerStyle(20)
85  hdata.SetMarkerSize(1)
86  hdata.SetMarkerColor(1)
87  hdata.SetLineColor(1)
88  hdata.SetLineWidth(2)
89  hdata.Draw('same PE1')
90  shift = 0.45 if prelim else 0.54
91  legylow = 0.2 + 0.04 * (len(hsims) - 1)
92  leg = TLegend((1-RightMargin)-shift, (1-TopMargin)-legylow,
93  (1-RightMargin)-0.1, (1-TopMargin)-0.03)
94  leg.SetTextSize(0.04)
95  leg.SetFillStyle(0)
96  prelimtext = 'Preliminary' if prelim else 'Work-in-progress'
97  leg.AddEntry('', '#it{#bf{sPHENIX}} '+prelimtext, '')
98  leg.AddEntry('', 'Au+Au #sqrt{s_{NN}}=200 GeV', '')
99  leg.AddEntry(hdata, 'Data', "PE1");
100  for i, lt in enumerate(simlegtex):
101  leg.AddEntry(hsims[i], lt, "le");
102  leg.Draw()
103  c.RedrawAxis()
104  c.Draw()
105  c.SaveAs(outname+'.pdf')
106  c.SaveAs(outname+'.png')
107  if(c):
108  c.Close()
109  gSystem.ProcessEvents()
110  del c
111  c = 0
112 
113 # Customized version for data-sim comparison with 2 data sets
114 def Draw_1Dhist_datasimcomp_v2(hdata1, hdata2, hsim, gpadmargin, norm, logy, ymaxscale, XaxisName, Ytitle_unit, legtext, prelim, outname):
115  hdata1.Sumw2()
116  hdata2.Sumw2()
117  hsim.Sumw2()
118  binwidth = hdata1.GetXaxis().GetBinWidth(1)
119  if norm == 'unity':
120  hdata1.Scale(1. / hdata1.Integral(-1, -1))
121  hdata2.Scale(1. / hdata2.Integral(-1, -1))
122  hsim.Scale(1. / hsim.Integral(-1, -1))
123  elif norm == 'data':
124  hsim.Scale((hdata1.Integral(-1, -1)+hdata2.Integral(-1, -1)) / hsim.Integral(-1, -1))
125  else:
126  if norm != 'none':
127  print('Invalid normalization option: {}'.format(norm))
128  sys.exit(1)
129 
130  c = TCanvas('c', 'c', 800, 700)
131  if logy:
132  c.SetLogy()
133  c.cd()
134  gPad.SetRightMargin(gpadmargin[0])
135  gPad.SetTopMargin(gpadmargin[1])
136  gPad.SetLeftMargin(gpadmargin[2])
137  gPad.SetBottomMargin(gpadmargin[3])
138  if norm == 'unity':
139  if Ytitle_unit == '':
140  hsim.GetYaxis().SetTitle(
141  'Normalized entries / ({:g})'.format(binwidth))
142  else:
143  hsim.GetYaxis().SetTitle(
144  'Normalized entries / ({:g} {unit})'.format(binwidth, unit=Ytitle_unit))
145  else:
146  if Ytitle_unit == '':
147  hsim.GetYaxis().SetTitle('Entries / ({:g})'.format(binwidth))
148  else:
149  hsim.GetYaxis().SetTitle(
150  'Entries / ({:g} {unit})'.format(binwidth, unit=Ytitle_unit))
151 
152  if logy:
153  hsim.GetYaxis().SetRangeUser(hsim.GetMinimum(0)*0.5, (hsim.GetMaximum()) * ymaxscale)
154  else:
155  hsim.GetYaxis().SetRangeUser(0., (hsim.GetMaximum()) * ymaxscale)
156  hsim.GetXaxis().SetTitle(XaxisName)
157  hsim.GetXaxis().SetTitleOffset(1.1)
158  hsim.GetYaxis().SetTitleOffset(1.35)
159  hsim.SetLineColor(1)
160  hsim.SetLineWidth(2)
161  hsim.Draw('hist')
162  hdata1.SetMarkerStyle(20)
163  hdata1.SetMarkerSize(1)
164  hdata1.SetMarkerColor(TColor.GetColor('#0B60B0'))
165  hdata1.SetLineColor(TColor.GetColor('#0B60B0'))
166  hdata1.SetLineWidth(2)
167  hdata1.Draw('same PE1')
168  hdata2.SetMarkerStyle(20)
169  hdata2.SetMarkerSize(1)
170  hdata2.SetMarkerColor(TColor.GetColor('#D24545'))
171  hdata2.SetLineColor(TColor.GetColor('#D24545'))
172  hdata2.SetLineWidth(2)
173  hdata2.Draw('same PE1')
174  shift = 0.45 if prelim else 0.52
175  leg = TLegend((1-RightMargin)-shift, (1-TopMargin)-0.25,
176  (1-RightMargin)-0.1, (1-TopMargin)-0.03)
177  leg.SetTextSize(0.04)
178  leg.SetFillStyle(0)
179  prelimtext = 'Preliminary' if prelim else 'Work-in-progress'
180  leg.AddEntry('', '#it{#bf{sPHENIX}} '+prelimtext, '')
181  leg.AddEntry('', 'Au+Au #sqrt{s_{NN}}=200 GeV', '')
182  leg.AddEntry(hdata1, legtext[0], "PE1");
183  leg.AddEntry(hdata2, legtext[1], "PE1");
184  leg.AddEntry(hsim, legtext[2], "l");
185  leg.Draw()
186  c.RedrawAxis()
187  c.Draw()
188  c.SaveAs(outname+'.pdf')
189  c.SaveAs(outname+'.png')
190  if(c):
191  c.Close()
192  gSystem.ProcessEvents()
193  del c
194  c = 0
195 
196 # comparae data and (one of the) simulation
197 def Draw_2Dhist_datasimcomp(hdata, hsim, logz, norm, rmargin, XaxisName, YaxisName, outname):
198  if norm == 'unity':
199  hdata.Scale(1. / hdata.Integral(-1, -1, -1, -1))
200  hsim.Scale(1. / hsim.Integral(-1, -1, -1, -1))
201  elif norm == 'data':
202  hsim.Scale(hdata.Integral(-1, -1, -1, -1) / hsim.Integral(-1, -1, -1, -1))
203  else:
204  if norm != 'none':
205  print('Invalid normalization option: {}'.format(norm))
206  sys.exit(1)
207 
208  c = TCanvas('c', 'c', 800, 700)
209  if logz:
210  c.SetLogz()
211  c.cd()
212  gPad.SetRightMargin(rmargin)
213  gPad.SetTopMargin(TopMargin)
214  gPad.SetLeftMargin(LeftMargin)
215  gPad.SetBottomMargin(BottomMargin)
216  hdata.GetXaxis().SetTitle(XaxisName)
217  hdata.GetYaxis().SetTitle(YaxisName)
218  hdata.GetXaxis().SetTickSize(TickSize)
219  hdata.GetYaxis().SetTickSize(TickSize)
220  hdata.GetXaxis().SetTitleSize(AxisTitleSize)
221  hdata.GetYaxis().SetTitleSize(AxisTitleSize)
222  hdata.GetXaxis().SetLabelSize(AxisLabelSize)
223  hdata.GetYaxis().SetLabelSize(AxisLabelSize)
224  hdata.GetXaxis().SetTitleOffset(1.1)
225  hdata.GetYaxis().SetTitleOffset(1.3)
226  hdata.GetZaxis().SetLabelSize(AxisLabelSize)
227  hdata.SetLineColor(kBlack)
228  hdata.SetLineWidth(1)
229  hdata.Draw('box')
230  hsim.SetLineColorAlpha(kRed, 0.5)
231  hsim.SetLineWidth(1)
232  hsim.Draw('box same')
233  c.RedrawAxis()
234  c.Draw()
235  c.SaveAs(outname+'.pdf')
236  c.SaveAs(outname+'.png')
237  if(c):
238  c.Close()
239  gSystem.ProcessEvents()
240  del c
241  c = 0
242 
243 
244 if __name__ == '__main__':
245  parser = OptionParser(usage='usage: %prog ver [options -h]')
246  parser.add_option('-d', '--datahistdir', dest='datahistdir', type='string', default='/sphenix/user/hjheng/TrackletAna/analysis_INTT/plot/hists/data_run20869/Hists_RecoTracklets_merged.root', help='Histogram file name (data)')
247  parser.add_option('-s', '--simhistdir', action='append', dest='simhistdir', type='string', help='Histogram file name (simulation). Example: /sphenix/user/hjheng/TrackletAna/analysis_INTT/plot/hists/ana382_zvtx-20cm_dummyAlignParams/Hists_RecoTracklets_merged.root')
248  parser.add_option('-l', '--simlegtext', action='append', dest='simlegtext', type='string', help='Legend text for simulation. Example: HIJING/EPOS/AMPT)')
249  parser.add_option('-p', '--plotdir', dest='plotdir', type='string', default='ana382_zvtx-20cm_dummyAlignParams', help='Plot directory')
250 
251  (opt, args) = parser.parse_args()
252 
253  print('opt: {}'.format(opt))
254 
255  datahistdir = opt.datahistdir
256  simhistdir = opt.simhistdir
257  simlegtext = opt.simlegtext
258  plotdir = opt.plotdir
259 
260  if os.path.isfile("{}/hists_merged.root".format(datahistdir)):
261  os.system("rm {}/hists_merged.root".format(datahistdir))
262  os.system("hadd {}/hists_merged.root {}/hists_*.root".format(datahistdir, datahistdir))
263  else:
264  os.system("hadd {}/hists_merged.root {}/hists_*.root".format(datahistdir, datahistdir))
265 
266  for simhistd in simhistdir:
267  if os.path.isfile("{}/hists_merged.root".format(simhistd)):
268  os.system("rm {}/hists_merged.root".format(simhistd))
269  os.system("hadd {}/hists_merged.root {}/hists_*.root".format(simhistd, simhistd))
270  else:
271  os.system("hadd {}/hists_merged.root {}/hists_*.root".format(simhistd, simhistd))
272 
273  os.makedirs('./DataSimComp/{}'.format(plotdir), exist_ok=True)
274 
275  hM_NClusLayer1_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_NClusLayer1')
276  hM_NPrototkl_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_NPrototkl')
277  hM_NRecotkl_Raw_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_NRecotkl_Raw')
278  hM_dEta_reco_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dEta_reco')
279  hM_dEta_reco_altrange_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dEta_reco_altrange')
280  hM_dEta_reco_altrange_Nclusle4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dEta_reco_altrange_Nclusle4000')
281  hM_dEta_reco_altrange_Nclusgt4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dEta_reco_altrange_Nclusgt4000')
282  hM_dPhi_reco_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dPhi_reco')
283  hM_dPhi_reco_altrange_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dPhi_reco_altrange')
284  hM_dPhi_reco_altrange_Nclusle4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dPhi_reco_altrange_Nclusle4000')
285  hM_dPhi_reco_altrange_Nclusgt4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dPhi_reco_altrange_Nclusgt4000')
286  hM_dR_reco_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dR_reco')
287  hM_dR_reco_Nclusle4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dR_reco_Nclusle4000')
288  hM_dR_reco_Nclusgt4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_dR_reco_Nclusgt4000')
289  hM_Eta_reco_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_Eta_reco')
290  hM_Eta_reco_Nclusle4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_Eta_reco_Nclusle4000')
291  hM_Eta_reco_Nclusgt4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_Eta_reco_Nclusgt4000')
292  hM_Phi_reco_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_Phi_reco')
293  hM_Phi_reco_Nclusle4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_Phi_reco_Nclusle4000')
294  hM_Phi_reco_Nclusgt4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_Phi_reco_Nclusgt4000')
295  hM_RecoPVz_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_RecoPVz')
296  hM_RecoPVz_Nclusle4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_RecoPVz_Nclusle4000')
297  hM_RecoPVz_Nclusgt4000_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_RecoPVz_Nclusgt4000')
298  hM_clusphi_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_clusphi')
299  hM_cluseta_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_cluseta')
300  hM_clusphisize_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_clusphisize')
301  hM_cluseta_clusphisize_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_cluseta_clusphisize')
302  hM_clusphi_clusphisize_data = GetHistogram("{}/hists_merged.root".format(datahistdir), 'hM_clusphi_clusphisize')
303 
304  l_hM_NClusLayer1_sim = []
305  l_hM_NPrototkl_sim = []
306  l_hM_NRecotkl_Raw_sim = []
307  l_hM_dEta_reco_sim = []
308  l_hM_dEta_reco_altrange_sim = []
309  l_hM_dPhi_reco_sim = []
310  l_hM_dPhi_reco_altrange_sim = []
311  l_hM_dR_reco_sim = []
312  l_hM_Eta_reco_sim = []
313  l_hM_Phi_reco_sim = []
314  l_hM_RecoPVz_sim = []
315  l_hM_clusphi_sim = []
316  l_hM_cluseta_sim = []
317  l_hM_clusphisize_sim = []
318  l_hM_cluseta_clusphisize_sim = []
319  l_hM_clusphi_clusphisize_sim = []
320  for i, simhistd in enumerate(simhistdir):
321  l_hM_NClusLayer1_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_NClusLayer1'))
322  l_hM_NPrototkl_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_NPrototkl'))
323  l_hM_NRecotkl_Raw_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_NRecotkl_Raw'))
324  l_hM_dEta_reco_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_dEta_reco'))
325  l_hM_dEta_reco_altrange_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_dEta_reco_altrange'))
326  l_hM_dPhi_reco_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_dPhi_reco'))
327  l_hM_dPhi_reco_altrange_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_dPhi_reco_altrange'))
328  l_hM_dR_reco_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_dR_reco'))
329  l_hM_Eta_reco_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_Eta_reco'))
330  l_hM_Phi_reco_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_Phi_reco'))
331  l_hM_RecoPVz_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_RecoPVz'))
332  l_hM_clusphi_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_clusphi'))
333  l_hM_cluseta_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_cluseta'))
334  l_hM_clusphisize_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_clusphisize'))
335  l_hM_cluseta_clusphisize_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_cluseta_clusphisize'))
336  l_hM_clusphi_clusphisize_sim.append(GetHistogram("{}/hists_merged.root".format(simhistd), 'hM_clusphi_clusphisize'))
337 
338  # Draw_1Dhist_datasimcomp(hdata, hsim, norm, logy, ymaxscale, XaxisName, Ytitle_unit, prelim, outname)
339  hM_NClusLayer1_data.GetXaxis().SetMaxDigits(2)
340  for hM_NClusLayer1_sim in l_hM_NClusLayer1_sim:
341  hM_NClusLayer1_sim.GetXaxis().SetMaxDigits(2)
342  Draw_1Dhist_datasimcomp(hM_NClusLayer1_data, l_hM_NClusLayer1_sim, [0.1,0.08,0.15,0.13], 'data', True, 10, 'Number of clusters (inner)', '', False, simlegtext, './DataSimComp/{}/NClusLayer1'.format(plotdir))
343  hM_NPrototkl_data.GetXaxis().SetMaxDigits(2)
344  for hM_NPrototkl_sim in l_hM_NPrototkl_sim:
345  hM_NPrototkl_sim.GetXaxis().SetMaxDigits(2)
346  Draw_1Dhist_datasimcomp(hM_NPrototkl_data, l_hM_NPrototkl_sim, [0.1,0.08,0.15,0.13], 'data', True, 3, 'Number of proto-tracklets', '', False, simlegtext, './DataSimComp/{}/NProtoTracklets'.format(plotdir))
347  hM_NRecotkl_Raw_data.GetXaxis().SetMaxDigits(2)
348  for hM_NRecotkl_Raw_sim in l_hM_NRecotkl_Raw_sim:
349  hM_NRecotkl_Raw_sim.GetXaxis().SetMaxDigits(2)
350  Draw_1Dhist_datasimcomp(hM_NRecotkl_Raw_data, l_hM_NRecotkl_Raw_sim, [0.1,0.08,0.15,0.13], 'data', True, 10, 'Number of reco-tracklets', '', False, simlegtext, './DataSimComp/{}/NRecoTracklets_Raw'.format(plotdir))
351  Draw_1Dhist_datasimcomp(hM_RecoPVz_data, l_hM_RecoPVz_sim, [0.1,0.08,0.15,0.13], 'data', True, 250, 'Reco PV z [cm]', 'cm', False, simlegtext, './DataSimComp/{}/RecoPVz'.format(plotdir))
352  # Draw_1Dhist_datasimcomp_v2(hM_RecoPVz_Nclusle4000_data, hM_RecoPVz_Nclusgt4000_data, l_hM_RecoPVz_sim, [0.1,0.08,0.15,0.13], 'unity', True, 250, 'Reco PV z [cm]', '', ['# of clusters (inner) < 4000', '# of clusters (inner) > 4000', 'Simulation'], False, './DataSimComp/{}/RecoPVz_Nclusle4000_Nclusgt4000'.format(plotdir))
353  Draw_1Dhist_datasimcomp(hM_clusphi_data, l_hM_clusphi_sim, [0.1,0.08,0.15,0.13], 'data', False, 1.8, 'Cluster #phi', '', False, simlegtext, './DataSimComp/{}/Cluster_Phi'.format(plotdir))
354  Draw_1Dhist_datasimcomp(hM_cluseta_data, l_hM_cluseta_sim, [0.1,0.08,0.15,0.13], 'data', False, 1.8, 'Cluster #eta', '', False, simlegtext, './DataSimComp/{}/Cluster_Eta'.format(plotdir))
355  Draw_1Dhist_datasimcomp(hM_clusphisize_data, l_hM_clusphisize_sim, [0.1,0.08,0.15,0.13], 'data', True, 10, 'Cluster #phi size', '', False, simlegtext, './DataSimComp/{}/Cluster_PhiSize'.format(plotdir))
356 
357  Draw_1Dhist_datasimcomp(hM_dEta_reco_data, l_hM_dEta_reco_sim, [0.08,0.08,0.15,0.13], 'data', True, 250, 'Reco-tracklet #Delta#eta', '', False, simlegtext, './DataSimComp/{}/RecoTracklet_dEta'.format(plotdir))
358  Draw_1Dhist_datasimcomp(hM_dEta_reco_altrange_data, l_hM_dEta_reco_altrange_sim, [0.08,0.08,0.15,0.13], 'data', True, 250, 'Reco-tracklet #Delta#eta', '', False, simlegtext, './DataSimComp/{}/RecoTracklet_dEta_altrange'.format(plotdir))
359  # Draw_1Dhist_datasimcomp_v2(hM_dEta_reco_altrange_Nclusle4000_data, hM_dEta_reco_altrange_Nclusgt4000_data, l_hM_dEta_reco_altrange_sim, [0.08,0.08,0.15,0.13], 'unity', True, 50, 'Reco-tracklet #Delta#eta', '', ['# of clusters (inner) < 4000', '# of clusters (inner) > 4000', 'Simulation'], False, simlegtext, './DataSimComp/{}/RecoTracklet_dEta_altrange_Nclusle4000_Nclusgt4000'.format(plotdir))
360  Draw_1Dhist_datasimcomp(hM_dPhi_reco_data, l_hM_dPhi_reco_sim, [0.08,0.08,0.15,0.13], 'data', True, 500, 'Reco-tracklet #Delta#phi', '', False, simlegtext, './DataSimComp/{}/RecoTracklet_dPhi'.format(plotdir))
361  hM_dPhi_reco_altrange_data.GetXaxis().SetMaxDigits(2)
362  for hM_dPhi_reco_altrange_sim in l_hM_dPhi_reco_altrange_sim:
363  hM_dPhi_reco_altrange_sim.GetXaxis().SetMaxDigits(2)
364  Draw_1Dhist_datasimcomp(hM_dPhi_reco_altrange_data, l_hM_dPhi_reco_altrange_sim, [0.1,0.08,0.15,0.13], 'data', True, 150, 'Reco-tracklet #Delta#phi', '', False, simlegtext, './DataSimComp/{}/RecoTracklet_dPhi_altrange'.format(plotdir))
365  # Draw_1Dhist_datasimcomp_v2(hM_dPhi_reco_altrange_Nclusle4000_data, hM_dPhi_reco_altrange_Nclusgt4000_data, l_hM_dPhi_reco_altrange_sim, [0.1,0.08,0.15,0.13], 'unity', True, 50, 'Reco-tracklet #Delta#phi', '', ['# of clusters (inner) < 4000', '# of clusters (inner) > 4000', 'Simulation'], False, './DataSimComp/{}/RecoTracklet_dPhi_altrange_Nclusle4000_Nclusgt4000'.format(plotdir))
366  Draw_1Dhist_datasimcomp(hM_dR_reco_data, l_hM_dR_reco_sim, [0.08,0.08,0.15,0.13], 'data', True, 3, 'Reco-tracklet #DeltaR', '', False, simlegtext, './DataSimComp/{}/RecoTracklet_dR'.format(plotdir))
367  # Draw_1Dhist_datasimcomp_v2(hM_dR_reco_Nclusle4000_data, hM_dR_reco_Nclusgt4000_data, hM_dR_reco_sim, [0.08,0.08,0.15,0.13], 'unity', True, 50, 'Reco-tracklet #DeltaR', '', ['# of clusters (inner) < 4000', '# of clusters (inner) > 4000', 'Simulation'], False, './DataSimComp/{}/RecoTracklet_dR_Nclusle4000_Nclusgt4000'.format(plotdir))
368  Draw_1Dhist_datasimcomp(hM_Eta_reco_data, l_hM_Eta_reco_sim, [0.08,0.08,0.15,0.13], 'data', False, 1.8, 'Reco-tracklet #eta', '', False, simlegtext, './DataSimComp/{}/RecoTracklet_Eta'.format(plotdir))
369  # Draw_1Dhist_datasimcomp_v2(hM_Eta_reco_Nclusle4000_data, hM_Eta_reco_Nclusgt4000_data, hM_Eta_reco_sim, [0.08,0.08,0.15,0.13], 'unity', True, 750, 'Reco-tracklet #eta', '', ['# of clusters (inner) < 4000', '# of clusters (inner) > 4000', 'Simulation'], False, './DataSimComp/{}/RecoTracklet_Eta_Nclusle4000_Nclusgt4000'.format(plotdir))
370  Draw_1Dhist_datasimcomp(hM_Phi_reco_data, l_hM_Phi_reco_sim, [0.08,0.08,0.15,0.13], 'data', False, 1.8, 'Reco-tracklet #phi', '', False, simlegtext, './DataSimComp/{}/RecoTracklet_Phi'.format(plotdir))
371  hM_Phi_reco_Nclusle4000_data.GetYaxis().SetMaxDigits(2)
372  hM_Phi_reco_Nclusgt4000_data.GetYaxis().SetMaxDigits(2)
373  for hM_Phi_reco_sim in l_hM_Phi_reco_sim:
374  hM_Phi_reco_sim.GetYaxis().SetMaxDigits(2)
375  # Draw_1Dhist_datasimcomp_v2(hM_Phi_reco_Nclusle4000_data, hM_Phi_reco_Nclusgt4000_data, l_hM_Phi_reco_sim, [0.08,0.08,0.15,0.13], 'unity', False, 1.7, 'Reco-tracklet #phi', '', ['# of clusters (inner) < 4000', '# of clusters (inner) > 4000', 'Simulation'], False, './DataSimComp/{}/RecoTracklet_Phi_Nclusle4000_Nclusgt4000'.format(plotdir))
376 
377  # Draw_2Dhist_datasimcomp(hdata, hsim, logz, norm, rmargin, XaxisName, YaxisName, outname)
378  Draw_2Dhist_datasimcomp(hM_cluseta_clusphisize_data, l_hM_cluseta_clusphisize_sim[0], False, 'data', 0.1, 'Cluster #eta', 'Cluster #phi size', './DataSimComp/{}/ClusEta_ClusPhiSize'.format(plotdir))
379  Draw_2Dhist_datasimcomp(hM_clusphi_clusphisize_data, l_hM_clusphi_clusphisize_sim[0], False, 'data', 0.1, 'Cluster #phi', 'Cluster #phi size', './DataSimComp/{}/ClusPhi_ClusPhiSize'.format(plotdir))
380 
381