1 |
#!/usr/bin/env python
|
2 |
###################################################
|
3 |
# This python script ...
|
4 |
####################################################
|
5 |
|
6 |
import os,sys,string,re,math
|
7 |
from array import array
|
8 |
|
9 |
try:
|
10 |
from ROOT import *
|
11 |
except:
|
12 |
print "\nCannot load PYROOT, make sure you have setup ROOT in the path"
|
13 |
print "and pyroot library is also defined in the variable PYTHONPATH, try:\n"
|
14 |
if (os.getenv("PYTHONPATH")):
|
15 |
print " setenv PYTHONPATH ${PYTHONPATH}:$ROOTSYS/lib\n"
|
16 |
else:
|
17 |
print " setenv PYTHONPATH $ROOTSYS/lib\n"
|
18 |
#sys.exit()
|
19 |
|
20 |
#import Inspector
|
21 |
#import Style
|
22 |
|
23 |
gROOT.SetStyle("Plain")
|
24 |
gStyle.SetOptStat(0)
|
25 |
DEBUG = False
|
26 |
|
27 |
# style
|
28 |
#thestyle = Style.Style()
|
29 |
HasCMSStyle = False
|
30 |
style = None
|
31 |
if os.path.isfile('tdrstyle.C'):
|
32 |
gROOT.ProcessLine('.L tdrstyle.C')
|
33 |
ROOT.setTDRStyle()
|
34 |
print "Found tdrstyle.C file, using this style."
|
35 |
HasCMSStyle = True
|
36 |
if os.path.isfile('CMSTopStyle.cc'):
|
37 |
gROOT.ProcessLine('.L CMSTopStyle.cc+')
|
38 |
style = CMSTopStyle()
|
39 |
print "Found CMSTopStyle.cc file, use TOP style if requested in xml file."
|
40 |
if not HasCMSStyle:
|
41 |
print "No CMSTopStyle.cc"
|
42 |
|
43 |
#FOpen = ['results_4Top_1100.root',
|
44 |
# 'results_4Top_1000.root',
|
45 |
# 'results_4Top_900.root',
|
46 |
# 'results_4Top_700.root',
|
47 |
# 'results_4Top_500.root',
|
48 |
# 'results_4TopSM.root']
|
49 |
#
|
50 |
########################################
|
51 |
##def Disc(ofile, name):
|
52 |
#######################################
|
53 |
#for ofile in FOpen:
|
54 |
# tmpname = ofile.replace('results_','')
|
55 |
# name = tmpname.replace('.root','')
|
56 |
#
|
57 |
# infile = TFile(ofile)
|
58 |
# histo1 = infile.Get("/MET/Stlep_"+name)
|
59 |
# histo2 = infile.Get("/MET/Ht_"+name)
|
60 |
#
|
61 |
# scale1 = 1/histo1.Integral()
|
62 |
# scale2 = 1/histo2.Integral()
|
63 |
#
|
64 |
# histo1.Scale(scale1)
|
65 |
# histo2.Scale(scale2)
|
66 |
#
|
67 |
# #totalhisto = TH1F(histo1*histo2)
|
68 |
#
|
69 |
# #if ofile[1]:
|
70 |
# # c1.cd()
|
71 |
# # histo1.Draw("Hist")
|
72 |
# #else:
|
73 |
# # c1.cd()
|
74 |
# # histo1.Draw("Hist same")
|
75 |
# #if ofile[len(FOpen)]: c1.SaveAs("test.png")
|
76 |
|
77 |
def legend():
|
78 |
leg = TLegend(0.75,0.65,0.93,0.93)
|
79 |
leg.SetMargin(0.12)
|
80 |
leg.SetTextSize(0.035)
|
81 |
leg.SetFillColor(0)
|
82 |
leg.SetFillStyle(0)
|
83 |
leg.SetBorderSize(0)
|
84 |
leg.AddEntry(h4TopSM_1, style.FourTopSMText, "l" )
|
85 |
leg.AddEntry(h4Top_1100_1,"Gh 1.1 TeV", "l" )
|
86 |
leg.AddEntry(h4Top_1000_1,"Gh 1.0 TeV", "l" )
|
87 |
leg.AddEntry(h4Top_900_1,"Gh 0.9 TeV", "l" )
|
88 |
leg.AddEntry(h4Top_700_1,"Gh 0.7 TeV", "l" )
|
89 |
leg.AddEntry(h4Top_500_1,"Gh 0.5 TeV", "l" )
|
90 |
leg.Draw()
|
91 |
return leg
|
92 |
|
93 |
|
94 |
# Open files
|
95 |
f4Top_1100 = TFile("/eos/uscms/store/user/algomez/FourTop/resultsTreeAnalyzer/results09/results_4Top1100.root")
|
96 |
h4Top_1100_1 = f4Top_1100.Get("/MET/Stjet_4Top1100")
|
97 |
h4Top_1100_1.Scale(1/h4Top_1100_1.Integral())
|
98 |
h4Top_1100_2 = f4Top_1100.Get("/MET/Ht_4Top1100")
|
99 |
h4Top_1100_2.Scale(1/h4Top_1100_2.Integral())
|
100 |
h4Top_1100_3 = f4Top_1100.Get("/MET/Stlep_4Top1100")
|
101 |
h4Top_1100_3.Scale(1/h4Top_1100_3.Integral())
|
102 |
h4Top_1100_4 = f4Top_1100.Get("/jets/Njets_cut1_4Top1100")
|
103 |
h4Top_1100_4.Scale(1/h4Top_1100_4.Integral())
|
104 |
h4Top_1100_5 = f4Top_1100.Get("/jets/Nbjets_CSVL_4Top1100")
|
105 |
h4Top_1100_5.Scale(1/h4Top_1100_5.Integral())
|
106 |
#h4Top_1100_6 = f4Top_1100.Get("/jets/Nbjets_CSVL_4Top1100")
|
107 |
#h4Top_1100_6.Scale(1/h4Top_1100_6.Integral())
|
108 |
|
109 |
f4Top_1000 = TFile("/eos/uscms/store/user/algomez/FourTop/resultsTreeAnalyzer/results09/results_4Top1000.root")
|
110 |
h4Top_1000_1 = f4Top_1000.Get("/MET/Stjet_4Top1000")
|
111 |
h4Top_1000_1.Scale(1/h4Top_1000_1.Integral())
|
112 |
h4Top_1000_2 = f4Top_1000.Get("/MET/Ht_4Top1000")
|
113 |
h4Top_1000_2.Scale(1/h4Top_1000_2.Integral())
|
114 |
h4Top_1000_3 = f4Top_1000.Get("/MET/Stlep_4Top1000")
|
115 |
h4Top_1000_3.Scale(1/h4Top_1000_3.Integral())
|
116 |
h4Top_1000_4 = f4Top_1000.Get("/jets/Njets_cut1_4Top1000")
|
117 |
h4Top_1000_4.Scale(1/h4Top_1000_4.Integral())
|
118 |
h4Top_1000_5 = f4Top_1000.Get("/jets/Nbjets_CSVL_4Top1000")
|
119 |
h4Top_1000_5.Scale(1/h4Top_1000_5.Integral())
|
120 |
|
121 |
f4Top_900 = TFile("/eos/uscms/store/user/algomez/FourTop/resultsTreeAnalyzer/results09/results_4Top900.root")
|
122 |
h4Top_900_1 = f4Top_900.Get("/MET/Stjet_4Top900")
|
123 |
h4Top_900_1.Scale(1/h4Top_900_1.Integral())
|
124 |
h4Top_900_2 = f4Top_900.Get("/MET/Ht_4Top900")
|
125 |
h4Top_900_2.Scale(1/h4Top_900_2.Integral())
|
126 |
h4Top_900_3 = f4Top_900.Get("/MET/Stlep_4Top900")
|
127 |
h4Top_900_3.Scale(1/h4Top_900_3.Integral())
|
128 |
h4Top_900_4 = f4Top_900.Get("/jets/Njets_cut1_4Top900")
|
129 |
h4Top_900_4.Scale(1/h4Top_900_4.Integral())
|
130 |
h4Top_900_5 = f4Top_900.Get("/jets/Nbjets_CSVL_4Top900")
|
131 |
h4Top_900_5.Scale(1/h4Top_900_5.Integral())
|
132 |
|
133 |
f4Top_700 = TFile("/eos/uscms/store/user/algomez/FourTop/resultsTreeAnalyzer/results09/results_4Top700.root")
|
134 |
h4Top_700_1 = f4Top_700.Get("/MET/Stjet_4Top700")
|
135 |
h4Top_700_1.Scale(1/h4Top_700_1.Integral())
|
136 |
h4Top_700_2 = f4Top_700.Get("/MET/Ht_4Top700")
|
137 |
h4Top_700_2.Scale(1/h4Top_700_2.Integral())
|
138 |
h4Top_700_3 = f4Top_700.Get("/MET/Stlep_4Top700")
|
139 |
h4Top_700_3.Scale(1/h4Top_700_3.Integral())
|
140 |
h4Top_700_4 = f4Top_700.Get("/jets/Njets_cut1_4Top700")
|
141 |
h4Top_700_4.Scale(1/h4Top_700_4.Integral())
|
142 |
h4Top_700_5 = f4Top_700.Get("/jets/Nbjets_CSVL_4Top700")
|
143 |
h4Top_700_5.Scale(1/h4Top_700_5.Integral())
|
144 |
|
145 |
f4Top_500 = TFile("/eos/uscms/store/user/algomez/FourTop/resultsTreeAnalyzer/results09/results_4Top500.root")
|
146 |
h4Top_500_1 = f4Top_500.Get("/MET/Stjet_4Top500")
|
147 |
h4Top_500_1.Scale(1/h4Top_500_1.Integral())
|
148 |
h4Top_500_2 = f4Top_500.Get("/MET/Ht_4Top500")
|
149 |
h4Top_500_2.Scale(1/h4Top_500_2.Integral())
|
150 |
h4Top_500_3 = f4Top_500.Get("/MET/Stlep_4Top500")
|
151 |
h4Top_500_3.Scale(1/h4Top_500_3.Integral())
|
152 |
h4Top_500_4 = f4Top_500.Get("/jets/Njets_cut1_4Top500")
|
153 |
h4Top_500_4.Scale(1/h4Top_500_4.Integral())
|
154 |
h4Top_500_5 = f4Top_500.Get("/jets/Nbjets_CSVL_4Top500")
|
155 |
h4Top_500_5.Scale(1/h4Top_500_5.Integral())
|
156 |
|
157 |
f4TopSM = TFile("/eos/uscms/store/user/algomez/FourTop/resultsTreeAnalyzer/results09/results_4TopSM.root")
|
158 |
h4TopSM_1 = f4TopSM.Get("/MET/Stjet_4TopSM")
|
159 |
h4TopSM_1.Scale(1/h4TopSM_1.Integral())
|
160 |
h4TopSM_2 = f4TopSM.Get("/MET/Ht_4TopSM")
|
161 |
h4TopSM_2.Scale(1/h4TopSM_2.Integral())
|
162 |
h4TopSM_3 = f4TopSM.Get("/MET/Stlep_4TopSM")
|
163 |
h4TopSM_3.Scale(1/h4TopSM_3.Integral())
|
164 |
h4TopSM_4 = f4TopSM.Get("/jets/Njets_cut1_4TopSM")
|
165 |
h4TopSM_4.Scale(1/h4TopSM_4.Integral())
|
166 |
h4TopSM_5 = f4TopSM.Get("/jets/Nbjets_CSVL_4TopSM")
|
167 |
h4TopSM_5.Scale(1/h4TopSM_5.Integral())
|
168 |
|
169 |
|
170 |
can1 = TCanvas('can1', '', 800,600)
|
171 |
can1.cd()
|
172 |
can1.SetLogy()
|
173 |
|
174 |
h4Top_1100_1.SetLineColor(1)
|
175 |
h4Top_1100_1.SetMaximum(1)
|
176 |
h4Top_1100_1.SetYTitle('1/N dN/dx')
|
177 |
h4Top_1100_1.Draw("Hist")
|
178 |
|
179 |
h4Top_1000_1.SetLineColor(2)
|
180 |
h4Top_1000_1.SetLineWidth(1)
|
181 |
h4Top_1000_1.Draw("Hist same")
|
182 |
|
183 |
h4Top_900_1.SetLineColor(3)
|
184 |
h4Top_900_1.SetLineWidth(1)
|
185 |
h4Top_900_1.Draw("Hist same")
|
186 |
|
187 |
h4Top_700_1.SetLineColor(4)
|
188 |
h4Top_700_1.SetLineWidth(1)
|
189 |
h4Top_700_1.Draw("Hist same")
|
190 |
|
191 |
h4Top_500_1.SetLineColor(6)
|
192 |
h4Top_500_1.SetLineWidth(1)
|
193 |
h4Top_500_1.Draw("Hist same")
|
194 |
|
195 |
h4TopSM_1.SetLineColor(style.FourTopSMColor)
|
196 |
h4TopSM_1.SetLineWidth(2)
|
197 |
h4TopSM_1.Draw("Hist same")
|
198 |
|
199 |
leg = legend()
|
200 |
can1.SaveAs("diff_Stjet_4Top.png")
|
201 |
|
202 |
can2 = TCanvas('can2', '', 800,600)
|
203 |
can2.cd()
|
204 |
can2.SetLogy()
|
205 |
|
206 |
h4Top_1100_2.SetLineColor(1)
|
207 |
h4Top_1100_2.SetMaximum(1)
|
208 |
h4Top_1100_2.SetYTitle('1/N dN/dx')
|
209 |
h4Top_1100_2.Draw("Hist")
|
210 |
|
211 |
h4Top_1000_2.SetLineColor(2)
|
212 |
h4Top_1000_2.SetLineWidth(1)
|
213 |
h4Top_1000_2.Draw("Hist same")
|
214 |
|
215 |
h4Top_900_2.SetLineColor(3)
|
216 |
h4Top_900_2.SetLineWidth(1)
|
217 |
h4Top_900_2.Draw("Hist same")
|
218 |
|
219 |
h4Top_700_2.SetLineColor(4)
|
220 |
h4Top_700_2.SetLineWidth(1)
|
221 |
h4Top_700_2.Draw("Hist same")
|
222 |
|
223 |
h4Top_500_2.SetLineColor(6)
|
224 |
h4Top_500_2.SetLineWidth(1)
|
225 |
h4Top_500_2.Draw("Hist same")
|
226 |
|
227 |
h4TopSM_2.SetLineColor(style.FourTopSMColor)
|
228 |
h4TopSM_2.SetLineWidth(2)
|
229 |
h4TopSM_2.Draw("Hist same")
|
230 |
|
231 |
leg = legend()
|
232 |
can2.SaveAs("diff_Ht_4Top.png")
|
233 |
|
234 |
can3 = TCanvas('can3', '', 800,600)
|
235 |
can3.cd()
|
236 |
can3.SetLogy()
|
237 |
|
238 |
h4Top_1100_3.SetLineColor(1)
|
239 |
h4Top_1100_3.SetMaximum(1)
|
240 |
h4Top_1100_3.SetYTitle('1/N dN/dx')
|
241 |
h4Top_1100_3.Draw("Hist")
|
242 |
|
243 |
h4Top_1000_3.SetLineColor(2)
|
244 |
h4Top_1000_3.SetLineWidth(1)
|
245 |
h4Top_1000_3.Draw("Hist same")
|
246 |
|
247 |
h4Top_900_3.SetLineColor(3)
|
248 |
h4Top_900_3.SetLineWidth(1)
|
249 |
h4Top_900_3.Draw("Hist same")
|
250 |
|
251 |
h4Top_700_3.SetLineColor(4)
|
252 |
h4Top_700_3.SetLineWidth(1)
|
253 |
h4Top_700_3.Draw("Hist same")
|
254 |
|
255 |
h4Top_500_3.SetLineColor(6)
|
256 |
h4Top_500_3.SetLineWidth(1)
|
257 |
h4Top_500_3.Draw("Hist same")
|
258 |
|
259 |
h4TopSM_3.SetLineColor(style.FourTopSMColor)
|
260 |
h4TopSM_3.SetLineWidth(2)
|
261 |
h4TopSM_3.Draw("Hist same")
|
262 |
|
263 |
leg = legend()
|
264 |
can3.SaveAs("diff_Stlep_4Top.png")
|
265 |
|
266 |
can4 = TCanvas('can4', '', 800,600)
|
267 |
can4.cd()
|
268 |
can4.SetLogy()
|
269 |
|
270 |
h4Top_1100_4.SetLineColor(1)
|
271 |
h4Top_1100_4.SetMaximum(1)
|
272 |
h4Top_1100_4.SetYTitle('1/N dN/dx')
|
273 |
h4Top_1100_4.Draw("Hist")
|
274 |
|
275 |
h4Top_1000_4.SetLineColor(2)
|
276 |
h4Top_1000_4.SetLineWidth(1)
|
277 |
h4Top_1000_4.Draw("Hist same")
|
278 |
|
279 |
h4Top_900_4.SetLineColor(3)
|
280 |
h4Top_900_4.SetLineWidth(1)
|
281 |
h4Top_900_4.Draw("Hist same")
|
282 |
|
283 |
h4Top_700_4.SetLineColor(4)
|
284 |
h4Top_700_4.SetLineWidth(1)
|
285 |
h4Top_700_4.Draw("Hist same")
|
286 |
|
287 |
h4Top_500_4.SetLineColor(6)
|
288 |
h4Top_500_4.SetLineWidth(1)
|
289 |
h4Top_500_4.Draw("Hist same")
|
290 |
|
291 |
h4TopSM_4.SetLineColor(style.FourTopSMColor)
|
292 |
h4TopSM_4.SetLineWidth(2)
|
293 |
h4TopSM_4.Draw("Hist same")
|
294 |
|
295 |
leg = legend()
|
296 |
can4.SaveAs("diff_Njets_4Top.png")
|
297 |
|
298 |
can5 = TCanvas('can5', '', 800,600)
|
299 |
can5.cd()
|
300 |
can5.SetLogy()
|
301 |
|
302 |
h4Top_1100_5.SetLineColor(1)
|
303 |
h4Top_1100_5.SetMaximum(1)
|
304 |
h4Top_1100_5.SetYTitle('1/N dN/dx')
|
305 |
h4Top_1100_5.Draw("Hist")
|
306 |
|
307 |
h4Top_1000_5.SetLineColor(2)
|
308 |
h4Top_1000_5.SetLineWidth(1)
|
309 |
h4Top_1000_5.Draw("Hist same")
|
310 |
|
311 |
h4Top_900_5.SetLineColor(3)
|
312 |
h4Top_900_5.SetLineWidth(1)
|
313 |
h4Top_900_5.Draw("Hist same")
|
314 |
|
315 |
h4Top_700_5.SetLineColor(4)
|
316 |
h4Top_700_5.SetLineWidth(1)
|
317 |
h4Top_700_5.Draw("Hist same")
|
318 |
|
319 |
h4Top_500_5.SetLineColor(6)
|
320 |
h4Top_500_5.SetLineWidth(1)
|
321 |
h4Top_500_5.Draw("Hist same")
|
322 |
|
323 |
h4TopSM_5.SetLineColor(style.FourTopSMColor)
|
324 |
h4TopSM_5.SetLineWidth(2)
|
325 |
h4TopSM_5.Draw("Hist same")
|
326 |
|
327 |
leg = legend()
|
328 |
can5.SaveAs("diff_Nbjets_CSVL_4Top.png")
|