-
Notifications
You must be signed in to change notification settings - Fork 1
/
Create_VH.py
372 lines (329 loc) · 13.3 KB
/
Create_VH.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
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")
fout=ROOT.TFile("files_"+options.scale+"/VHsignal.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
acc=0.050
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)
h15_1.Scale(acc)
h15_2.Scale(acc)
h15_3.Scale(acc)
h15_4.Scale(acc)
h15_5.Scale(acc)
h15_6.Scale(acc)
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)
h20_1.Scale(acc)
h20_2.Scale(acc)
h20_3.Scale(acc)
h20_4.Scale(acc)
h20_5.Scale(acc)
h20_6.Scale(acc)
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)
h25_1.Scale(acc)
h25_2.Scale(acc)
h25_3.Scale(acc)
h25_4.Scale(acc)
h25_5.Scale(acc)
h25_6.Scale(acc)
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)
h30_1.Scale(acc)
h30_2.Scale(acc)
h30_3.Scale(acc)
h30_4.Scale(acc)
h30_5.Scale(acc)
h30_6.Scale(acc)
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)
h35_1.Scale(acc)
h35_2.Scale(acc)
h35_3.Scale(acc)
h35_4.Scale(acc)
h35_5.Scale(acc)
h35_6.Scale(acc)
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)
h40_1.Scale(acc)
h40_2.Scale(acc)
h40_3.Scale(acc)
h40_4.Scale(acc)
h40_5.Scale(acc)
h40_6.Scale(acc)
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)
h45_1.Scale(acc)
h45_2.Scale(acc)
h45_3.Scale(acc)
h45_4.Scale(acc)
h45_5.Scale(acc)
h45_6.Scale(acc)
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)
h50_1.Scale(acc)
h50_2.Scale(acc)
h50_3.Scale(acc)
h50_4.Scale(acc)
h50_5.Scale(acc)
h50_6.Scale(acc)
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)
h55_1.Scale(acc)
h55_2.Scale(acc)
h55_3.Scale(acc)
h55_4.Scale(acc)
h55_5.Scale(acc)
h55_6.Scale(acc)
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)
h60_1.Scale(acc)
h60_2.Scale(acc)
h60_3.Scale(acc)
h60_4.Scale(acc)
h60_5.Scale(acc)
h60_6.Scale(acc)
fout.cd()
dir0jet.cd()
h15_0.SetName("VH_haa_bbtt15"+postfix)
h20_0.SetName("VH_haa_bbtt20"+postfix)
h25_0.SetName("VH_haa_bbtt25"+postfix)
h30_0.SetName("VH_haa_bbtt30"+postfix)
h35_0.SetName("VH_haa_bbtt35"+postfix)
h40_0.SetName("VH_haa_bbtt40"+postfix)
h45_0.SetName("VH_haa_bbtt45"+postfix)
h50_0.SetName("VH_haa_bbtt50"+postfix)
h55_0.SetName("VH_haa_bbtt55"+postfix)
h60_0.SetName("VH_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("VH_haa_bbtt15"+postfix)
h20_1.SetName("VH_haa_bbtt20"+postfix)
h25_1.SetName("VH_haa_bbtt25"+postfix)
h30_1.SetName("VH_haa_bbtt30"+postfix)
h35_1.SetName("VH_haa_bbtt35"+postfix)
h40_1.SetName("VH_haa_bbtt40"+postfix)
h45_1.SetName("VH_haa_bbtt45"+postfix)
h50_1.SetName("VH_haa_bbtt50"+postfix)
h55_1.SetName("VH_haa_bbtt55"+postfix)
h60_1.SetName("VH_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("VH_haa_bbtt15"+postfix)
h20_2.SetName("VH_haa_bbtt20"+postfix)
h25_2.SetName("VH_haa_bbtt25"+postfix)
h30_2.SetName("VH_haa_bbtt30"+postfix)
h35_2.SetName("VH_haa_bbtt35"+postfix)
h40_2.SetName("VH_haa_bbtt40"+postfix)
h45_2.SetName("VH_haa_bbtt45"+postfix)
h50_2.SetName("VH_haa_bbtt50"+postfix)
h55_2.SetName("VH_haa_bbtt55"+postfix)
h60_2.SetName("VH_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("VH_haa_bbtt15"+postfix)
h20_3.SetName("VH_haa_bbtt20"+postfix)
h25_3.SetName("VH_haa_bbtt25"+postfix)
h30_3.SetName("VH_haa_bbtt30"+postfix)
h35_3.SetName("VH_haa_bbtt35"+postfix)
h40_3.SetName("VH_haa_bbtt40"+postfix)
h45_3.SetName("VH_haa_bbtt45"+postfix)
h50_3.SetName("VH_haa_bbtt50"+postfix)
h55_3.SetName("VH_haa_bbtt55"+postfix)
h60_3.SetName("VH_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("VH_haa_bbtt15"+postfix)
h20_4.SetName("VH_haa_bbtt20"+postfix)
h25_4.SetName("VH_haa_bbtt25"+postfix)
h30_4.SetName("VH_haa_bbtt30"+postfix)
h35_4.SetName("VH_haa_bbtt35"+postfix)
h40_4.SetName("VH_haa_bbtt40"+postfix)
h45_4.SetName("VH_haa_bbtt45"+postfix)
h50_4.SetName("VH_haa_bbtt50"+postfix)
h55_4.SetName("VH_haa_bbtt55"+postfix)
h60_4.SetName("VH_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("VH_haa_bbtt15"+postfix)
h20_5.SetName("VH_haa_bbtt20"+postfix)
h25_5.SetName("VH_haa_bbtt25"+postfix)
h30_5.SetName("VH_haa_bbtt30"+postfix)
h35_5.SetName("VH_haa_bbtt35"+postfix)
h40_5.SetName("VH_haa_bbtt40"+postfix)
h45_5.SetName("VH_haa_bbtt45"+postfix)
h50_5.SetName("VH_haa_bbtt50"+postfix)
h55_5.SetName("VH_haa_bbtt55"+postfix)
h60_5.SetName("VH_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("VH_haa_bbtt15"+postfix)
h20_6.SetName("VH_haa_bbtt20"+postfix)
h25_6.SetName("VH_haa_bbtt25"+postfix)
h30_6.SetName("VH_haa_bbtt30"+postfix)
h35_6.SetName("VH_haa_bbtt35"+postfix)
h40_6.SetName("VH_haa_bbtt40"+postfix)
h45_6.SetName("VH_haa_bbtt45"+postfix)
h50_6.SetName("VH_haa_bbtt50"+postfix)
h55_6.SetName("VH_haa_bbtt55"+postfix)
h60_6.SetName("VH_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()