-
Notifications
You must be signed in to change notification settings - Fork 1
/
Create_VBF.py
554 lines (503 loc) · 29.1 KB
/
Create_VBF.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
if __name__ == "__main__":
import ROOT
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--scale', default="nominal", choices=['nominal', 'up', 'down', 'wup', 'wdown','qcdup','qcddown','JESup','JESdown','allJES','allTES','fakeES'], help="Which TES?")
nbhist=1
options = parser.parse_args()
postfix=""
fgg15=ROOT.TFile("files_"+options.scale+"/bbtt15.root","r")
fgg20=ROOT.TFile("files_"+options.scale+"/bbtt20.root","r")
fgg25=ROOT.TFile("files_"+options.scale+"/bbtt25.root","r")
fgg30=ROOT.TFile("files_"+options.scale+"/bbtt30.root","r")
fgg35=ROOT.TFile("files_"+options.scale+"/bbtt35.root","r")
fgg40=ROOT.TFile("files_"+options.scale+"/bbtt40.root","r")
fgg45=ROOT.TFile("files_"+options.scale+"/bbtt45.root","r")
fgg50=ROOT.TFile("files_"+options.scale+"/bbtt50.root","r")
fgg55=ROOT.TFile("files_"+options.scale+"/bbtt55.root","r")
fgg60=ROOT.TFile("files_"+options.scale+"/bbtt60.root","r")
fvbf20=ROOT.TFile("files_"+options.scale+"/VBFbbtt20.root","r")
fvbf40=ROOT.TFile("files_"+options.scale+"/VBFbbtt40.root","r")
fvbf60=ROOT.TFile("files_"+options.scale+"/VBFbbtt60.root","r")
fout=ROOT.TFile("files_"+options.scale+"/VBFsignal.root","recreate")
dir0jet=fout.mkdir("mt_incl_2b")
dir1jet=fout.mkdir("mt_2b")
dir2jet=fout.mkdir("mt_incl_1b")
dir3jet=fout.mkdir("mt_1b")
dir4jet=fout.mkdir("mt_1b_lt80")
dir5jet=fout.mkdir("mt_1b_80to100")
dir6jet=fout.mkdir("mt_1b_100to120")
postfixData=""
mypostfix=[""]
if options.scale=="allTES":
nbhist=18
mypostfix=["_CMS_scale_t_13TeVDown","_CMS_scale_t_13TeVUp","_CMS_scale_t_1prong_13TeVDown","_CMS_scale_t_1prong_13TeVUp","_CMS_scale_t_1prong1pizero_13TeVDown","_CMS_scale_t_1prong1pizero_13TeVUp","_CMS_scale_t_3prong_13TeVDown","_CMS_scale_t_3prong_13TeVUp","_CMS_scale_m_13TeVUp","_CMS_scale_m_13TeVDown","_CMS_btag_heavy_13TeVUp","_CMS_btag_heavy_13TeVDown","_CMS_btag_light_13TeVUp","_CMS_btag_light_13TeVDown","_CMS_scale_met_unclustered_13TeVDown","_CMS_scale_met_unclustered_13TeVUp","_CMS_scale_j_13TeVDown","_CMS_scale_j_13TeVUp"]
if options.scale=="fakeES":
nbhist=12
fData=ROOT.TFile("files_fakeES/Data.root","r")
mypostfix=["_CMS_fakeRate10_var1_13TeVUp","_CMS_fakeRate10_var1_13TeVDown","_CMS_fakeRate10_var2_13TeVUp","_CMS_fakeRate10_var2_13TeVDown","_CMS_fakeRate1_var1_13TeVUp","_CMS_fakeRate1_var1_13TeVDown","_CMS_fakeRate1_var2_13TeVUp","_CMS_fakeRate1_var2_13TeVDown","_CMS_fakeRate0_var1_13TeVUp","_CMS_fakeRate0_var1_13TeVDown","_CMS_fakeRate0_var2_13TeVUp","_CMS_fakeRate0_var2_13TeVDown"]
for k in range(0,nbhist):
if nbhist!=1:
postfix=mypostfix[k]
if options.scale=="fakeES":
postfixData=postfix
print postfix,fvbf20.Get("mt_incl_2b/VBFbbtt20"+postfix).Integral()
acc_incl_2b= ((fvbf20.Get("mt_incl_2b/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_incl_2b/ggH_haa_bbtt20"+postfix).Integral())+(fvbf40.Get("mt_incl_2b/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_incl_2b/ggH_haa_bbtt40"+postfix).Integral())+(fvbf60.Get("mt_incl_2b/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_incl_2b/ggH_haa_bbtt60"+postfix).Integral()))/3
acc_2b= ((fvbf20.Get("mt_2b/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_2b/ggH_haa_bbtt20"+postfix).Integral())+(fvbf40.Get("mt_2b/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_2b/ggH_haa_bbtt40"+postfix).Integral())+(fvbf60.Get("mt_2b/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_2b/ggH_haa_bbtt60"+postfix).Integral()))/3
acc_incl_1b= ((fvbf20.Get("mt_incl_1b/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_incl_1b/ggH_haa_bbtt20"+postfix).Integral())+(fvbf40.Get("mt_incl_1b/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_incl_1b/ggH_haa_bbtt40"+postfix).Integral())+(fvbf60.Get("mt_incl_1b/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_incl_1b/ggH_haa_bbtt60"+postfix).Integral()))/3
acc_1b= ((fvbf20.Get("mt_1b/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_1b/ggH_haa_bbtt20"+postfix).Integral())+(fvbf40.Get("mt_1b/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_1b/ggH_haa_bbtt40"+postfix).Integral())+(fvbf60.Get("mt_1b/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_1b/ggH_haa_bbtt60"+postfix).Integral()))/3
acc_1b_lt80= ((fvbf20.Get("mt_1b_lt80/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_1b_lt80/ggH_haa_bbtt20"+postfix).Integral())+(fvbf40.Get("mt_1b_lt80/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_1b_lt80/ggH_haa_bbtt40"+postfix).Integral())+(fvbf60.Get("mt_1b_lt80/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_1b_lt80/ggH_haa_bbtt60"+postfix).Integral()))/3
acc_1b_80to100= ((fvbf20.Get("mt_1b_80to100/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_1b_80to100/ggH_haa_bbtt20"+postfix).Integral())+(fvbf40.Get("mt_1b_80to100/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_1b_80to100/ggH_haa_bbtt40"+postfix).Integral())+(fvbf60.Get("mt_1b_80to100/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_1b_80to100/ggH_haa_bbtt60"+postfix).Integral()))/3
acc_1b_100to120= ((fvbf20.Get("mt_1b_100to120/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_1b_100to120/ggH_haa_bbtt20"+postfix).Integral())+(fvbf40.Get("mt_1b_100to120/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_1b_100to120/ggH_haa_bbtt40"+postfix).Integral())+(fvbf60.Get("mt_1b_100to120/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_1b_100to120/ggH_haa_bbtt60"+postfix).Integral()))/3
acc_1b= (fvbf20.Get("mt_1b/VBFbbtt20"+postfix).Integral()+fvbf40.Get("mt_1b/VBFbbtt40"+postfix).Integral()+fvbf60.Get("mt_1b/VBFbbtt60"+postfix).Integral())/(fgg20.Get("mt_1b/ggH_haa_bbtt20"+postfix).Integral()+fgg40.Get("mt_1b/ggH_haa_bbtt40"+postfix).Integral()+fgg60.Get("mt_1b/ggH_haa_bbtt60"+postfix).Integral())
acc_incl_2b= (fvbf20.Get("mt_incl_2b/VBFbbtt20"+postfix).Integral()+fvbf40.Get("mt_incl_2b/VBFbbtt40"+postfix).Integral()+fvbf60.Get("mt_incl_2b/VBFbbtt60"+postfix).Integral())/(fgg20.Get("mt_incl_2b/ggH_haa_bbtt20"+postfix).Integral()+fgg40.Get("mt_incl_2b/ggH_haa_bbtt40"+postfix).Integral()+fgg60.Get("mt_incl_2b/ggH_haa_bbtt60"+postfix).Integral())
acc_1b_lt80= (fvbf20.Get("mt_1b_lt80/VBFbbtt20"+postfix).Integral()+fvbf40.Get("mt_1b_lt80/VBFbbtt40"+postfix).Integral()+fvbf60.Get("mt_1b_lt80/VBFbbtt60"+postfix).Integral())/(fgg20.Get("mt_1b_lt80/ggH_haa_bbtt20"+postfix).Integral()+fgg40.Get("mt_1b_lt80/ggH_haa_bbtt40"+postfix).Integral()+fgg60.Get("mt_1b_lt80/ggH_haa_bbtt60"+postfix).Integral())
acc_1b_80to100= (fvbf20.Get("mt_1b_80to100/VBFbbtt20"+postfix).Integral()+fvbf40.Get("mt_1b_80to100/VBFbbtt40"+postfix).Integral()+fvbf60.Get("mt_1b_80to100/VBFbbtt60"+postfix).Integral())/(fgg20.Get("mt_1b_80to100/ggH_haa_bbtt20"+postfix).Integral()+fgg40.Get("mt_1b_80to100/ggH_haa_bbtt40"+postfix).Integral()+fgg60.Get("mt_1b_80to100/ggH_haa_bbtt60"+postfix).Integral())
acc_1b_100to120= (fvbf20.Get("mt_1b_100to120/VBFbbtt20"+postfix).Integral()+fvbf40.Get("mt_1b_100to120/VBFbbtt40"+postfix).Integral()+fvbf60.Get("mt_1b_100to120/VBFbbtt60"+postfix).Integral())/(fgg20.Get("mt_1b_100to120/ggH_haa_bbtt20"+postfix).Integral()+fgg40.Get("mt_1b_100to120/ggH_haa_bbtt40"+postfix).Integral()+fgg60.Get("mt_1b_100to120/ggH_haa_bbtt60"+postfix).Integral())
acc_incl_1b= (fvbf20.Get("mt_incl_1b/VBFbbtt20"+postfix).Integral()+fvbf40.Get("mt_incl_1b/VBFbbtt40"+postfix).Integral()+fvbf60.Get("mt_incl_1b/VBFbbtt60"+postfix).Integral())/(fgg20.Get("mt_incl_1b/ggH_haa_bbtt20"+postfix).Integral()+fgg40.Get("mt_incl_1b/ggH_haa_bbtt40"+postfix).Integral()+fgg60.Get("mt_incl_1b/ggH_haa_bbtt60"+postfix).Integral())
acc_2b= (fvbf20.Get("mt_2b/VBFbbtt20"+postfix).Integral()+fvbf40.Get("mt_2b/VBFbbtt40"+postfix).Integral()+fvbf60.Get("mt_2b/VBFbbtt60"+postfix).Integral())/(fgg20.Get("mt_2b/ggH_haa_bbtt20"+postfix).Integral()+fgg40.Get("mt_2b/ggH_haa_bbtt40"+postfix).Integral()+fgg60.Get("mt_2b/ggH_haa_bbtt60"+postfix).Integral())
print acc_incl_2b,acc_2b,acc_incl_1b,acc_1b,acc_1b_lt80,acc_1b_80to100,acc_1b_100to120
err_gg20=ROOT.Double(0)
err_vbf20=ROOT.Double(0)
integg20=fgg60.Get("mt_1b_100to120/ggH_haa_bbtt60"+postfix).IntegralAndError(0,15,err_gg20)
intevbf20=fvbf60.Get("mt_1b_100to120/VBFbbtt60"+postfix).IntegralAndError(0,15,err_vbf20)
print integg20,err_gg20,intevbf20,err_vbf20
print "100 a 120: ",acc_1b_100to120,(fvbf20.Get("mt_1b_100to120/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_1b_100to120/ggH_haa_bbtt20"+postfix).Integral()),(fvbf40.Get("mt_1b_100to120/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_1b_100to120/ggH_haa_bbtt40"+postfix).Integral()),(fvbf60.Get("mt_1b_100to120/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_1b_100to120/ggH_haa_bbtt60"+postfix).Integral())
print "80 a 100: ",acc_1b_80to100,(fvbf20.Get("mt_1b_80to100/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_1b_80to100/ggH_haa_bbtt20"+postfix).Integral()),(fvbf40.Get("mt_1b_80to100/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_1b_80to100/ggH_haa_bbtt40"+postfix).Integral()),(fvbf60.Get("mt_1b_80to100/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_1b_80to100/ggH_haa_bbtt60"+postfix).Integral())
print "less than 80: ",acc_1b_lt80,(fvbf20.Get("mt_1b_lt80/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_1b_lt80/ggH_haa_bbtt20"+postfix).Integral()),(fvbf40.Get("mt_1b_lt80/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_1b_lt80/ggH_haa_bbtt40"+postfix).Integral()),(fvbf60.Get("mt_1b_lt80/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_1b_lt80/ggH_haa_bbtt60"+postfix).Integral())
print "More than 120: ",acc_incl_1b,(fvbf20.Get("mt_incl_1b/VBFbbtt20"+postfix).Integral()/fgg20.Get("mt_incl_1b/ggH_haa_bbtt20"+postfix).Integral()),(fvbf40.Get("mt_incl_1b/VBFbbtt40"+postfix).Integral()/fgg40.Get("mt_incl_1b/ggH_haa_bbtt40"+postfix).Integral()),(fvbf60.Get("mt_incl_1b/VBFbbtt60"+postfix).Integral()/fgg60.Get("mt_incl_1b/ggH_haa_bbtt60"+postfix).Integral())
ROOT.gStyle.SetFrameLineWidth(3)
ROOT.gStyle.SetLineWidth(3)
ROOT.gStyle.SetOptStat(0)
ggh_lt80=ROOT.TH1F("ggh80","ggh80",3,0,3)
fgg20.Get("mt_1b_lt80/ggH_haa_bbtt20"+postfix).IntegralAndError(0,15,err_gg20)
ggh_lt80.SetBinContent(1,fgg20.Get("mt_1b_lt80/ggH_haa_bbtt20"+postfix).Integral())
ggh_lt80.SetBinError(1,err_gg20)
fgg40.Get("mt_1b_lt80/ggH_haa_bbtt40"+postfix).IntegralAndError(0,15,err_gg20)
ggh_lt80.SetBinContent(2,fgg40.Get("mt_1b_lt80/ggH_haa_bbtt40"+postfix).Integral())
ggh_lt80.SetBinError(2,err_gg20)
fgg60.Get("mt_1b_lt80/ggH_haa_bbtt60"+postfix).IntegralAndError(0,15,err_gg20)
ggh_lt80.SetBinContent(3,fgg60.Get("mt_1b_lt80/ggH_haa_bbtt60"+postfix).Integral())
ggh_lt80.SetBinError(3,err_gg20)
ggh_lt80.Sumw2()
vbf_lt80=ROOT.TH1F("","",3,0,3)
fvbf20.Get("mt_1b_lt80/VBFbbtt20"+postfix).IntegralAndError(0,15,err_vbf20)
vbf_lt80.SetBinContent(1,fvbf20.Get("mt_1b_lt80/VBFbbtt20"+postfix).Integral())
vbf_lt80.SetBinError(1,err_vbf20)
fvbf40.Get("mt_1b_lt80/VBFbbtt40"+postfix).IntegralAndError(0,15,err_vbf20)
vbf_lt80.SetBinContent(2,fvbf40.Get("mt_1b_lt80/VBFbbtt40"+postfix).Integral())
vbf_lt80.SetBinError(2,err_vbf20)
fvbf60.Get("mt_1b_lt80/VBFbbtt60"+postfix).IntegralAndError(0,15,err_vbf20)
vbf_lt80.SetBinContent(3,fvbf60.Get("mt_1b_lt80/VBFbbtt60"+postfix).Integral())
vbf_lt80.SetBinError(3,err_vbf20)
vbf_lt80.Sumw2()
vbf_lt80.Divide(ggh_lt80)
vbf_lt80.GetXaxis().SetBinLabel(1,"m_{a}=20 GeV")
vbf_lt80.GetXaxis().SetBinLabel(2,"m_{a}=40 GeV")
vbf_lt80.GetXaxis().SetBinLabel(3,"m_{a}=60 GeV")
vbf_lt80.GetYaxis().SetTitle("VBF to ggH ratio")
#c=ROOT.TCanvas("canvas","",0,0,600,600)
#c.SetLeftMargin(0.15)
#vbf_lt80.GetYaxis().SetTitleOffset(1.60)
#vbf_lt80.Draw()
#myline=ROOT.TLine(0,acc_1b_lt80,3,acc_1b_lt80)
#mylineu=ROOT.TLine(0,1.10*acc_1b_lt80,3,1.10*acc_1b_lt80)
#mylined=ROOT.TLine(0,0.90*acc_1b_lt80,3,0.90*acc_1b_lt80)
#myline.SetLineColor(2)
#mylineu.SetLineColor(2)
#mylined.SetLineColor(2)
#mylineu.SetLineStyle(2)
#mylined.SetLineStyle(2)
#myline.Draw("same")
#mylineu.Draw("same")
#mylined.Draw("same")
#vbf_lt80.Draw("same")
#c.SaveAs("acc_vbf_mt_lt80.pdf")
#fgg20.Get("mt_1b_80to100/ggH_haa_bbtt20"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(1,fgg20.Get("mt_1b_80to100/ggH_haa_bbtt20"+postfix).Integral())
#ggh_lt80.SetBinError(1,err_gg20)
#fgg40.Get("mt_1b_80to100/ggH_haa_bbtt40"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(2,fgg40.Get("mt_1b_80to100/ggH_haa_bbtt40"+postfix).Integral())
#ggh_lt80.SetBinError(2,err_gg20)
#fgg60.Get("mt_1b_80to100/ggH_haa_bbtt60"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(3,fgg60.Get("mt_1b_80to100/ggH_haa_bbtt60"+postfix).Integral())
#ggh_lt80.SetBinError(3,err_gg20)
#fvbf20.Get("mt_1b_80to100/VBFbbtt20"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(1,fvbf20.Get("mt_1b_80to100/VBFbbtt20"+postfix).Integral())
#vbf_lt80.SetBinError(1,err_vbf20)
#fvbf40.Get("mt_1b_80to100/VBFbbtt40"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(2,fvbf40.Get("mt_1b_80to100/VBFbbtt40"+postfix).Integral())
#vbf_lt80.SetBinError(2,err_vbf20)
#fvbf60.Get("mt_1b_80to100/VBFbbtt60"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(3,fvbf60.Get("mt_1b_80to100/VBFbbtt60"+postfix).Integral())
#vbf_lt80.SetBinError(3,err_vbf20)
#vbf_lt80.Divide(ggh_lt80)
#vbf_lt80.Draw()
#myline=ROOT.TLine(0,acc_1b_80to100,3,acc_1b_80to100)
#mylineu=ROOT.TLine(0,1.10*acc_1b_80to100,3,1.10*acc_1b_80to100)
#mylined=ROOT.TLine(0,0.90*acc_1b_80to100,3,0.90*acc_1b_80to100)
#myline.SetLineColor(2)
#mylineu.SetLineColor(2)
#mylined.SetLineColor(2)
#mylineu.SetLineStyle(2)
#mylined.SetLineStyle(2)
#myline.Draw("same")
#mylineu.Draw("same")
#mylined.Draw("same")
#vbf_lt80.Draw("same")
#c.SaveAs("acc_vbf_mt_80to100.pdf")
#fgg20.Get("mt_1b_100to120/ggH_haa_bbtt20"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(1,fgg20.Get("mt_1b_100to120/ggH_haa_bbtt20"+postfix).Integral())
#ggh_lt80.SetBinError(1,err_gg20)
#fgg40.Get("mt_1b_100to120/ggH_haa_bbtt40"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(2,fgg40.Get("mt_1b_100to120/ggH_haa_bbtt40"+postfix).Integral())
#ggh_lt80.SetBinError(2,err_gg20)
#fgg60.Get("mt_1b_100to120/ggH_haa_bbtt60"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(3,fgg60.Get("mt_1b_100to120/ggH_haa_bbtt60"+postfix).Integral())
#ggh_lt80.SetBinError(3,err_gg20)
#fvbf20.Get("mt_1b_100to120/VBFbbtt20"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(1,fvbf20.Get("mt_1b_100to120/VBFbbtt20"+postfix).Integral())
#vbf_lt80.SetBinError(1,err_vbf20)
#fvbf40.Get("mt_1b_100to120/VBFbbtt40"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(2,fvbf40.Get("mt_1b_100to120/VBFbbtt40"+postfix).Integral())
#vbf_lt80.SetBinError(2,err_vbf20)
#fvbf60.Get("mt_1b_100to120/VBFbbtt60"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(3,fvbf60.Get("mt_1b_100to120/VBFbbtt60"+postfix).Integral())
#vbf_lt80.SetBinError(3,err_vbf20)
#vbf_lt80.Divide(ggh_lt80)
#vbf_lt80.Draw()
#myline=ROOT.TLine(0,acc_1b_100to120,3,acc_1b_100to120)
#mylineu=ROOT.TLine(0,1.10*acc_1b_100to120,3,1.10*acc_1b_100to120)
#mylined=ROOT.TLine(0,0.90*acc_1b_100to120,3,0.90*acc_1b_100to120)
#myline.SetLineColor(2)
#mylineu.SetLineColor(2)
#mylined.SetLineColor(2)
#mylineu.SetLineStyle(2)
#mylined.SetLineStyle(2)
#myline.Draw("same")
#mylineu.Draw("same")
#mylined.Draw("same")
#vbf_lt80.Draw("same")
#c.SaveAs("acc_vbf_mt_100to120.pdf")
#fgg20.Get("mt_incl_1b/ggH_haa_bbtt20"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(1,fgg20.Get("mt_incl_1b/ggH_haa_bbtt20"+postfix).Integral())
#ggh_lt80.SetBinError(1,err_gg20)
#fgg40.Get("mt_incl_1b/ggH_haa_bbtt40"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(2,fgg40.Get("mt_incl_1b/ggH_haa_bbtt40"+postfix).Integral())
#ggh_lt80.SetBinError(2,err_gg20)
#fgg60.Get("mt_incl_1b/ggH_haa_bbtt60"+postfix).IntegralAndError(0,15,err_gg20)
#ggh_lt80.SetBinContent(3,fgg60.Get("mt_incl_1b/ggH_haa_bbtt60"+postfix).Integral())
#ggh_lt80.SetBinError(3,err_gg20)
#fvbf20.Get("mt_incl_1b/VBFbbtt20"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(1,fvbf20.Get("mt_incl_1b/VBFbbtt20"+postfix).Integral())
#vbf_lt80.SetBinError(1,err_vbf20)
#fvbf40.Get("mt_incl_1b/VBFbbtt40"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(2,fvbf40.Get("mt_incl_1b/VBFbbtt40"+postfix).Integral())
#vbf_lt80.SetBinError(2,err_vbf20)
#fvbf60.Get("mt_incl_1b/VBFbbtt60"+postfix).IntegralAndError(0,15,err_vbf20)
#vbf_lt80.SetBinContent(3,fvbf60.Get("mt_incl_1b/VBFbbtt60"+postfix).Integral())
#vbf_lt80.SetBinError(3,err_vbf20)
#vbf_lt80.Sumw2()
#vbf_lt80.Divide(ggh_lt80)
#vbf_lt80.Draw()
#myline=ROOT.TLine(0,acc_incl_1b,3,acc_incl_1b)
#mylineu=ROOT.TLine(0,1.10*acc_incl_1b,3,1.10*acc_incl_1b)
#mylined=ROOT.TLine(0,0.90*acc_incl_1b,3,0.90*acc_incl_1b)
#myline.SetLineColor(2)
#mylineu.SetLineColor(2)
#mylined.SetLineColor(2)
#mylineu.SetLineStyle(2)
#mylined.SetLineStyle(2)
#myline.Draw("same")
#mylineu.Draw("same")
#mylined.Draw("same")
#vbf_lt80.Draw("same")
#c.SaveAs("acc_vbf_mt_gt120.pdf")
h15_0=fgg15.Get("mt_incl_2b/ggH_haa_bbtt15"+postfix)
h15_1=fgg15.Get("mt_2b/ggH_haa_bbtt15"+postfix)
h15_2=fgg15.Get("mt_incl_1b/ggH_haa_bbtt15"+postfix)
h15_3=fgg15.Get("mt_1b/ggH_haa_bbtt15"+postfix)
h15_4=fgg15.Get("mt_1b_lt80/ggH_haa_bbtt15"+postfix)
h15_5=fgg15.Get("mt_1b_80to100/ggH_haa_bbtt15"+postfix)
h15_6=fgg15.Get("mt_1b_100to120/ggH_haa_bbtt15"+postfix)
h15_0.Scale(acc_incl_2b)
h15_1.Scale(acc_2b)
h15_2.Scale(acc_incl_1b)
h15_3.Scale(acc_1b)
h15_4.Scale(acc_1b_lt80)
h15_5.Scale(acc_1b_80to100)
h15_6.Scale(acc_1b_100to120)
h20_0=fgg20.Get("mt_incl_2b/ggH_haa_bbtt20"+postfix)
h20_1=fgg20.Get("mt_2b/ggH_haa_bbtt20"+postfix)
h20_2=fgg20.Get("mt_incl_1b/ggH_haa_bbtt20"+postfix)
h20_3=fgg20.Get("mt_1b/ggH_haa_bbtt20"+postfix)
h20_4=fgg20.Get("mt_1b_lt80/ggH_haa_bbtt20"+postfix)
h20_5=fgg20.Get("mt_1b_80to100/ggH_haa_bbtt20"+postfix)
h20_6=fgg20.Get("mt_1b_100to120/ggH_haa_bbtt20"+postfix)
h20_0.Scale(acc_incl_2b)
h20_1.Scale(acc_2b)
h20_2.Scale(acc_incl_1b)
h20_3.Scale(acc_1b)
h20_4.Scale(acc_1b_lt80)
h20_5.Scale(acc_1b_80to100)
h20_6.Scale(acc_1b_100to120)
h25_0=fgg25.Get("mt_incl_2b/ggH_haa_bbtt25"+postfix)
h25_1=fgg25.Get("mt_2b/ggH_haa_bbtt25"+postfix)
h25_2=fgg25.Get("mt_incl_1b/ggH_haa_bbtt25"+postfix)
h25_3=fgg25.Get("mt_1b/ggH_haa_bbtt25"+postfix)
h25_4=fgg25.Get("mt_1b_lt80/ggH_haa_bbtt25"+postfix)
h25_5=fgg25.Get("mt_1b_80to100/ggH_haa_bbtt25"+postfix)
h25_6=fgg25.Get("mt_1b_100to120/ggH_haa_bbtt25"+postfix)
h25_0.Scale(acc_incl_2b)
h25_1.Scale(acc_2b)
h25_2.Scale(acc_incl_1b)
h25_3.Scale(acc_1b)
h25_4.Scale(acc_1b_lt80)
h25_5.Scale(acc_1b_80to100)
h25_6.Scale(acc_1b_100to120)
h30_0=fgg30.Get("mt_incl_2b/ggH_haa_bbtt30"+postfix)
h30_1=fgg30.Get("mt_2b/ggH_haa_bbtt30"+postfix)
h30_2=fgg30.Get("mt_incl_1b/ggH_haa_bbtt30"+postfix)
h30_3=fgg30.Get("mt_1b/ggH_haa_bbtt30"+postfix)
h30_4=fgg30.Get("mt_1b_lt80/ggH_haa_bbtt30"+postfix)
h30_5=fgg30.Get("mt_1b_80to100/ggH_haa_bbtt30"+postfix)
h30_6=fgg30.Get("mt_1b_100to120/ggH_haa_bbtt30"+postfix)
h30_0.Scale(acc_incl_2b)
h30_1.Scale(acc_2b)
h30_2.Scale(acc_incl_1b)
h30_3.Scale(acc_1b)
h30_4.Scale(acc_1b_lt80)
h30_5.Scale(acc_1b_80to100)
h30_6.Scale(acc_1b_100to120)
h35_0=fgg35.Get("mt_incl_2b/ggH_haa_bbtt35"+postfix)
h35_1=fgg35.Get("mt_2b/ggH_haa_bbtt35"+postfix)
h35_2=fgg35.Get("mt_incl_1b/ggH_haa_bbtt35"+postfix)
h35_3=fgg35.Get("mt_1b/ggH_haa_bbtt35"+postfix)
h35_4=fgg35.Get("mt_1b_lt80/ggH_haa_bbtt35"+postfix)
h35_5=fgg35.Get("mt_1b_80to100/ggH_haa_bbtt35"+postfix)
h35_6=fgg35.Get("mt_1b_100to120/ggH_haa_bbtt35"+postfix)
h35_0.Scale(acc_incl_2b)
h35_1.Scale(acc_2b)
h35_2.Scale(acc_incl_1b)
h35_3.Scale(acc_1b)
h35_4.Scale(acc_1b_lt80)
h35_5.Scale(acc_1b_80to100)
h35_6.Scale(acc_1b_100to120)
h40_0=fgg40.Get("mt_incl_2b/ggH_haa_bbtt40"+postfix)
h40_1=fgg40.Get("mt_2b/ggH_haa_bbtt40"+postfix)
h40_2=fgg40.Get("mt_incl_1b/ggH_haa_bbtt40"+postfix)
h40_3=fgg40.Get("mt_1b/ggH_haa_bbtt40"+postfix)
h40_4=fgg40.Get("mt_1b_lt80/ggH_haa_bbtt40"+postfix)
h40_5=fgg40.Get("mt_1b_80to100/ggH_haa_bbtt40"+postfix)
h40_6=fgg40.Get("mt_1b_100to120/ggH_haa_bbtt40"+postfix)
h40_0.Scale(acc_incl_2b)
h40_1.Scale(acc_2b)
h40_2.Scale(acc_incl_1b)
h40_3.Scale(acc_1b)
h40_4.Scale(acc_1b_lt80)
h40_5.Scale(acc_1b_80to100)
h40_6.Scale(acc_1b_100to120)
h45_0=fgg45.Get("mt_incl_2b/ggH_haa_bbtt45"+postfix)
h45_1=fgg45.Get("mt_2b/ggH_haa_bbtt45"+postfix)
h45_2=fgg45.Get("mt_incl_1b/ggH_haa_bbtt45"+postfix)
h45_3=fgg45.Get("mt_1b/ggH_haa_bbtt45"+postfix)
h45_4=fgg45.Get("mt_1b_lt80/ggH_haa_bbtt45"+postfix)
h45_5=fgg45.Get("mt_1b_80to100/ggH_haa_bbtt45"+postfix)
h45_6=fgg45.Get("mt_1b_100to120/ggH_haa_bbtt45"+postfix)
h45_0.Scale(acc_incl_2b)
h45_1.Scale(acc_2b)
h45_2.Scale(acc_incl_1b)
h45_3.Scale(acc_1b)
h45_4.Scale(acc_1b_lt80)
h45_5.Scale(acc_1b_80to100)
h45_6.Scale(acc_1b_100to120)
h50_0=fgg50.Get("mt_incl_2b/ggH_haa_bbtt50"+postfix)
h50_1=fgg50.Get("mt_2b/ggH_haa_bbtt50"+postfix)
h50_2=fgg50.Get("mt_incl_1b/ggH_haa_bbtt50"+postfix)
h50_3=fgg50.Get("mt_1b/ggH_haa_bbtt50"+postfix)
h50_4=fgg50.Get("mt_1b_lt80/ggH_haa_bbtt50"+postfix)
h50_5=fgg50.Get("mt_1b_80to100/ggH_haa_bbtt50"+postfix)
h50_6=fgg50.Get("mt_1b_100to120/ggH_haa_bbtt50"+postfix)
h50_0.Scale(acc_incl_2b)
h50_1.Scale(acc_2b)
h50_2.Scale(acc_incl_1b)
h50_3.Scale(acc_1b)
h50_4.Scale(acc_1b_lt80)
h50_5.Scale(acc_1b_80to100)
h50_6.Scale(acc_1b_100to120)
h55_0=fgg55.Get("mt_incl_2b/ggH_haa_bbtt55"+postfix)
h55_1=fgg55.Get("mt_2b/ggH_haa_bbtt55"+postfix)
h55_2=fgg55.Get("mt_incl_1b/ggH_haa_bbtt55"+postfix)
h55_3=fgg55.Get("mt_1b/ggH_haa_bbtt55"+postfix)
h55_4=fgg55.Get("mt_1b_lt80/ggH_haa_bbtt55"+postfix)
h55_5=fgg55.Get("mt_1b_80to100/ggH_haa_bbtt55"+postfix)
h55_6=fgg55.Get("mt_1b_100to120/ggH_haa_bbtt55"+postfix)
h55_0.Scale(acc_incl_2b)
h55_1.Scale(acc_2b)
h55_2.Scale(acc_incl_1b)
h55_3.Scale(acc_1b)
h55_4.Scale(acc_1b_lt80)
h55_5.Scale(acc_1b_80to100)
h55_6.Scale(acc_1b_100to120)
h60_0=fgg60.Get("mt_incl_2b/ggH_haa_bbtt60"+postfix)
h60_1=fgg60.Get("mt_2b/ggH_haa_bbtt60"+postfix)
h60_2=fgg60.Get("mt_incl_1b/ggH_haa_bbtt60"+postfix)
h60_3=fgg60.Get("mt_1b/ggH_haa_bbtt60"+postfix)
h60_4=fgg60.Get("mt_1b_lt80/ggH_haa_bbtt60"+postfix)
h60_5=fgg60.Get("mt_1b_80to100/ggH_haa_bbtt60"+postfix)
h60_6=fgg60.Get("mt_1b_100to120/ggH_haa_bbtt60"+postfix)
h60_0.Scale(acc_incl_2b)
h60_1.Scale(acc_2b)
h60_2.Scale(acc_incl_1b)
h60_3.Scale(acc_1b)
h60_4.Scale(acc_1b_lt80)
h60_5.Scale(acc_1b_80to100)
h60_6.Scale(acc_1b_100to120)
fout.cd()
dir0jet.cd()
h15_0.SetName("qqH_haa_bbtt15"+postfix)
h20_0.SetName("qqH_haa_bbtt20"+postfix)
h25_0.SetName("qqH_haa_bbtt25"+postfix)
h30_0.SetName("qqH_haa_bbtt30"+postfix)
h35_0.SetName("qqH_haa_bbtt35"+postfix)
h40_0.SetName("qqH_haa_bbtt40"+postfix)
h45_0.SetName("qqH_haa_bbtt45"+postfix)
h50_0.SetName("qqH_haa_bbtt50"+postfix)
h55_0.SetName("qqH_haa_bbtt55"+postfix)
h60_0.SetName("qqH_haa_bbtt60"+postfix)
h15_0.Write()
h20_0.Write()
h25_0.Write()
h30_0.Write()
h35_0.Write()
h40_0.Write()
h45_0.Write()
h50_0.Write()
h55_0.Write()
h60_0.Write()
dir1jet.cd()
h15_1.SetName("qqH_haa_bbtt15"+postfix)
h20_1.SetName("qqH_haa_bbtt20"+postfix)
h25_1.SetName("qqH_haa_bbtt25"+postfix)
h30_1.SetName("qqH_haa_bbtt30"+postfix)
h35_1.SetName("qqH_haa_bbtt35"+postfix)
h40_1.SetName("qqH_haa_bbtt40"+postfix)
h45_1.SetName("qqH_haa_bbtt45"+postfix)
h50_1.SetName("qqH_haa_bbtt50"+postfix)
h55_1.SetName("qqH_haa_bbtt55"+postfix)
h60_1.SetName("qqH_haa_bbtt60"+postfix)
h15_1.Write()
h20_1.Write()
h25_1.Write()
h30_1.Write()
h35_1.Write()
h40_1.Write()
h45_1.Write()
h50_1.Write()
h55_1.Write()
h60_1.Write()
dir2jet.cd()
h15_2.SetName("qqH_haa_bbtt15"+postfix)
h20_2.SetName("qqH_haa_bbtt20"+postfix)
h25_2.SetName("qqH_haa_bbtt25"+postfix)
h30_2.SetName("qqH_haa_bbtt30"+postfix)
h35_2.SetName("qqH_haa_bbtt35"+postfix)
h40_2.SetName("qqH_haa_bbtt40"+postfix)
h45_2.SetName("qqH_haa_bbtt45"+postfix)
h50_2.SetName("qqH_haa_bbtt50"+postfix)
h55_2.SetName("qqH_haa_bbtt55"+postfix)
h60_2.SetName("qqH_haa_bbtt60"+postfix)
h15_2.Write()
h20_2.Write()
h25_2.Write()
h30_2.Write()
h35_2.Write()
h40_2.Write()
h45_2.Write()
h50_2.Write()
h55_2.Write()
h60_2.Write()
dir3jet.cd()
h15_3.SetName("qqH_haa_bbtt15"+postfix)
h20_3.SetName("qqH_haa_bbtt20"+postfix)
h25_3.SetName("qqH_haa_bbtt25"+postfix)
h30_3.SetName("qqH_haa_bbtt30"+postfix)
h35_3.SetName("qqH_haa_bbtt35"+postfix)
h40_3.SetName("qqH_haa_bbtt40"+postfix)
h45_3.SetName("qqH_haa_bbtt45"+postfix)
h50_3.SetName("qqH_haa_bbtt50"+postfix)
h55_3.SetName("qqH_haa_bbtt55"+postfix)
h60_3.SetName("qqH_haa_bbtt60"+postfix)
h15_3.Write()
h20_3.Write()
h25_3.Write()
h30_3.Write()
h35_3.Write()
h40_3.Write()
h45_3.Write()
h50_3.Write()
h55_3.Write()
h60_3.Write()
dir4jet.cd()
h15_4.SetName("qqH_haa_bbtt15"+postfix)
h20_4.SetName("qqH_haa_bbtt20"+postfix)
h25_4.SetName("qqH_haa_bbtt25"+postfix)
h30_4.SetName("qqH_haa_bbtt30"+postfix)
h35_4.SetName("qqH_haa_bbtt35"+postfix)
h40_4.SetName("qqH_haa_bbtt40"+postfix)
h45_4.SetName("qqH_haa_bbtt45"+postfix)
h50_4.SetName("qqH_haa_bbtt50"+postfix)
h55_4.SetName("qqH_haa_bbtt55"+postfix)
h60_4.SetName("qqH_haa_bbtt60"+postfix)
h15_4.Write()
h20_4.Write()
h25_4.Write()
h30_4.Write()
h35_4.Write()
h40_4.Write()
h45_4.Write()
h50_4.Write()
h55_4.Write()
h60_4.Write()
dir5jet.cd()
h15_5.SetName("qqH_haa_bbtt15"+postfix)
h20_5.SetName("qqH_haa_bbtt20"+postfix)
h25_5.SetName("qqH_haa_bbtt25"+postfix)
h30_5.SetName("qqH_haa_bbtt30"+postfix)
h35_5.SetName("qqH_haa_bbtt35"+postfix)
h40_5.SetName("qqH_haa_bbtt40"+postfix)
h45_5.SetName("qqH_haa_bbtt45"+postfix)
h50_5.SetName("qqH_haa_bbtt50"+postfix)
h55_5.SetName("qqH_haa_bbtt55"+postfix)
h60_5.SetName("qqH_haa_bbtt60"+postfix)
h15_5.Write()
h20_5.Write()
h25_5.Write()
h30_5.Write()
h35_5.Write()
h40_5.Write()
h45_5.Write()
h50_5.Write()
h55_5.Write()
h60_5.Write()
dir6jet.cd()
h15_6.SetName("qqH_haa_bbtt15"+postfix)
h20_6.SetName("qqH_haa_bbtt20"+postfix)
h25_6.SetName("qqH_haa_bbtt25"+postfix)
h30_6.SetName("qqH_haa_bbtt30"+postfix)
h35_6.SetName("qqH_haa_bbtt35"+postfix)
h40_6.SetName("qqH_haa_bbtt40"+postfix)
h45_6.SetName("qqH_haa_bbtt45"+postfix)
h50_6.SetName("qqH_haa_bbtt50"+postfix)
h55_6.SetName("qqH_haa_bbtt55"+postfix)
h60_6.SetName("qqH_haa_bbtt60"+postfix)
h15_6.Write()
h20_6.Write()
h25_6.Write()
h30_6.Write()
h35_0.Write()
h40_6.Write()
h45_6.Write()
h50_6.Write()
h55_6.Write()
h60_6.Write()