Skip to content

Commit 9037de7

Browse files
used Anas ABCD base and merged master
2 parents 43af169 + 50e8c64 commit 9037de7

File tree

10 files changed

+358
-231
lines changed

10 files changed

+358
-231
lines changed

hbt/config/configs_hbt.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ def if_era(
117117
"hh_vbf_hbb_htt_kv1_k2v1_kl2",
118118
"hh_vbf_hbb_htt_kv1_k2v2_kl1",
119119
"hh_vbf_hbb_htt_kv1p74_k2v1p37_kl14p4",
120-
"hh_vbf_hbb_htt_kvm0p012_k2v0p030_kl10p2",
120+
"hh_vbf_hbb_htt_kvm0p012_k2v0p03_kl10p2",
121121
"hh_vbf_hbb_htt_kvm0p758_k2v1p44_klm19p3",
122122
"hh_vbf_hbb_htt_kvm0p962_k2v0p959_klm1p43",
123123
"hh_vbf_hbb_htt_kvm1p21_k2v1p94_klm0p94",
124-
"hh_vbf_hbb_htt_kvm1p60_k2v2p72_klm1p36",
124+
"hh_vbf_hbb_htt_kvm1p6_k2v2p72_klm1p36",
125125
"hh_vbf_hbb_htt_kvm1p83_k2v3p57_klm3p39",
126126
"hh_vbf_hbb_htt_kvm2p12_k2v3p87_klm5p96",
127127
]),
@@ -174,11 +174,11 @@ def if_era(
174174
"hh_vbf_hbb_htt_kv1_k2v0_kl1_madgraph",
175175
"hh_vbf_hbb_htt_kv1_k2v2_kl1_madgraph",
176176
"hh_vbf_hbb_htt_kv1p74_k2v1p37_kl14p4_madgraph",
177-
"hh_vbf_hbb_htt_kvm0p012_k2v0p030_kl10p2_madgraph",
177+
"hh_vbf_hbb_htt_kvm0p012_k2v0p03_kl10p2_madgraph",
178178
"hh_vbf_hbb_htt_kvm0p758_k2v1p44_klm19p3_madgraph",
179179
"hh_vbf_hbb_htt_kvm0p962_k2v0p959_klm1p43_madgraph",
180180
"hh_vbf_hbb_htt_kvm1p21_k2v1p94_klm0p94_madgraph",
181-
"hh_vbf_hbb_htt_kvm1p60_k2v2p72_klm1p36_madgraph",
181+
"hh_vbf_hbb_htt_kvm1p6_k2v2p72_klm1p36_madgraph",
182182
"hh_vbf_hbb_htt_kvm1p83_k2v3p57_klm3p39_madgraph",
183183
"hh_vbf_hbb_htt_kvm2p12_k2v3p87_klm5p96_madgraph",
184184
# some resonances
@@ -296,9 +296,9 @@ def if_era(
296296
cfg.x.default_selector = "default"
297297
cfg.x.default_producer = "default"
298298
cfg.x.default_ml_model = None
299-
cfg.x.default_inference_model = "test_no_shifts"
299+
cfg.x.default_inference_model = "default_no_shifts"
300300
cfg.x.default_categories = ("incl__os__iso",)
301-
cfg.x.default_variables = ("n_jet", "n_btag", "res_pdnn_hh")
301+
cfg.x.default_variables = ("n_jet", "n_btag", "res_pdnn_hh", "res_dnn_hh")
302302
cfg.x.default_weight_producer = "default"
303303

304304
# process groups for conveniently looping over certain processs
@@ -307,6 +307,12 @@ def if_era(
307307
"signals": [
308308
"hh_ggf_hbb_htt_kl1_kt1",
309309
],
310+
"signals_ggf": [
311+
"hh_ggf_hbb_htt_kl0_kt1",
312+
"hh_ggf_hbb_htt_kl1_kt1",
313+
"hh_ggf_hbb_htt_kl2p45_kt1",
314+
"hh_ggf_hbb_htt_kl5_kt1",
315+
],
310316
"backgrounds": (backgrounds := [
311317
"h",
312318
"tt",
@@ -372,7 +378,7 @@ def if_era(
372378
}
373379
cfg.x.default_custom_style_config = "small_legend"
374380

375-
cfg.x.default_blinding_threshold = 7e-4
381+
cfg.x.default_blinding_threshold = 3e-4
376382

377383
################################################################################################
378384
# luminosity and normalization
@@ -405,20 +411,20 @@ def if_era(
405411
"lumi_13TeV_correlated": 0.02j,
406412
})
407413
elif year == 2022 and campaign.has_tag("preEE"):
408-
cfg.x.luminosity = Number(7980.4, {
409-
"total": 0.014j,
414+
cfg.x.luminosity = Number(7_980.4, {
415+
"lumi_13p6TeV_correlated": 0.014j,
410416
})
411417
elif year == 2022 and campaign.has_tag("postEE"):
412-
cfg.x.luminosity = Number(26671.7, {
413-
"total": 0.014j,
418+
cfg.x.luminosity = Number(26_671.7, {
419+
"lumi_13p6TeV_correlated": 0.014j,
414420
})
415421
elif year == 2023:
416-
cfg.x.luminosity = Number(27208, {
417-
"lumi_13TeV_correlated": 0.0j,
422+
cfg.x.luminosity = Number(27_208, {
423+
"lumi_13p6TeV_correlated": 0.0j,
418424
})
419425
elif year == 2024:
420426
cfg.x.luminosity = Number(0, {
421-
"lumi_13TeV_correlated": 0.0j,
427+
"lumi_13p6TeV_correlated": 0.0j,
422428
})
423429
else:
424430
assert False
@@ -951,6 +957,8 @@ def add_external(name, value):
951957
add_external("hh_btag_repo", ("https://github.com/hh-italian-group/HHbtag/archive/df5220db5d4a32d05dc81d652083aece8c99ccab.tar.gz", "v2")) # noqa
952958
# Tobias' tautauNN (https://github.com/uhh-cms/tautauNN)
953959
add_external("res_pdnn", ("/afs/cern.ch/work/m/mrieger/public/hbt/models/res_prod3/model_fold0.tgz", "v1"))
960+
# non-parametric (flat) training up to mX = 800 GeV
961+
add_external("res_dnn", ("/afs/cern.ch/work/m/mrieger/public/hbt/models/res_prod3_nonparam/model_fold0.tgz", "v1"))
954962

955963
# run specific files
956964
if run == 2:

hbt/config/variables.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,19 @@ def add_variables(config: od.Config) -> None:
248248
x_title=r"$\eta$",
249249
)
250250

251-
# outputs of the resonant pDNN at SM-like mass and spin values
252251
for proc in ["hh", "tt", "dy"]:
252+
# outputs of the resonant pDNN at SM-like mass and spin values
253253
config.add_variable(
254254
name=f"res_pdnn_{proc}",
255255
expression=f"res_pdnn_s0_m500_{proc}",
256256
binning=(25, 0.0, 1.0),
257257
x_title=rf"{proc.upper()} output node, res. pDNN$_{{m_{{HH}}=500\,GeV,s=0}}$",
258258
)
259+
260+
# outputs of the resonant DNN trained over flat masses
261+
config.add_variable(
262+
name=f"res_dnn_{proc}",
263+
expression=f"res_dnn_{proc}",
264+
binning=(25, 0.0, 1.0),
265+
x_title=rf"{proc.upper()} output node, res. DNN",
266+
)

hbt/inference/default.py

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# coding: utf-8
2+
3+
"""
4+
Default inference model.
5+
"""
6+
7+
from columnflow.inference import inference_model, ParameterType
8+
9+
10+
@inference_model
11+
def default(self):
12+
13+
#
14+
# categories
15+
#
16+
17+
self.add_category(
18+
"incl",
19+
config_category="incl__os__iso",
20+
config_variable="res_dnn_hh",
21+
config_data_datasets=["data_*"],
22+
mc_stats=8.0,
23+
)
24+
25+
#
26+
# processes
27+
#
28+
29+
for kl in ["0", "1", "2p45", "5"]:
30+
self.add_process(
31+
f"ggHH_kl_{kl}_kt_1_13p6TeV_hbbhtt",
32+
is_signal=True,
33+
config_process=f"hh_ggf_hbb_htt_kl{kl}_kt1",
34+
config_mc_datasets=[f"hh_ggf_hbb_htt_kl{kl}_kt1_powheg"],
35+
)
36+
self.add_process(
37+
"TT",
38+
config_process="tt",
39+
config_mc_datasets=["^tt_(sl|dl|fh)_powheg$"],
40+
)
41+
self.add_process(
42+
"DY",
43+
config_process="dy",
44+
config_mc_datasets=["dy_*_amcatnlo"],
45+
)
46+
47+
#
48+
# parameters
49+
#
50+
51+
# general groups
52+
self.add_parameter_group("experiment")
53+
self.add_parameter_group("theory")
54+
55+
# groups that contain parameters that solely affect the signal cross section and/or br
56+
self.add_parameter_group("signal_norm_xs")
57+
self.add_parameter_group("signal_norm_xsbr")
58+
59+
# parameter that is added by the HH physics model, representing kl-dependent QCDscale + mtop
60+
# uncertainties on the ggHH cross section
61+
self.add_parameter_to_group("THU_HH", "theory")
62+
self.add_parameter_to_group("THU_HH", "signal_norm_xs")
63+
self.add_parameter_to_group("THU_HH", "signal_norm_xsbr")
64+
65+
# theory uncertainties
66+
self.add_parameter(
67+
"BR_hbb",
68+
type=ParameterType.rate_gauss,
69+
process=["*_hbb", "*_hbbhtt"],
70+
effect=(0.9874, 1.0124),
71+
group=["theory", "signal_norm_xsbr"],
72+
)
73+
self.add_parameter(
74+
"BR_htt",
75+
type=ParameterType.rate_gauss,
76+
process=["*_htt", "*_hbbhtt"],
77+
effect=(0.9837, 1.0165),
78+
group=["theory", "signal_norm_xsbr"],
79+
)
80+
self.add_parameter(
81+
"pdf_gg", # contains alpha_s
82+
type=ParameterType.rate_gauss,
83+
process="TT",
84+
effect=1.042,
85+
group=["theory"],
86+
)
87+
self.add_parameter(
88+
"pdf_Higgs_ggHH", # contains alpha_s
89+
type=ParameterType.rate_gauss,
90+
process="ggHH_*",
91+
effect=1.023,
92+
group=["theory", "signal_norm_xs", "signal_norm_xsbr"],
93+
)
94+
self.add_parameter(
95+
"pdf_Higgs_qqHH", # contains alpha_s
96+
type=ParameterType.rate_gauss,
97+
process="qqHH_*",
98+
effect=1.027,
99+
group=["theory", "signal_norm_xs", "signal_norm_xsbr"],
100+
)
101+
self.add_parameter(
102+
"QCDscale_ttbar",
103+
type=ParameterType.rate_gauss,
104+
process="TT",
105+
effect=(0.965, 1.024),
106+
group=["theory"],
107+
)
108+
self.add_parameter(
109+
"QCDscale_qqHH",
110+
type=ParameterType.rate_gauss,
111+
process="qqHH_*",
112+
effect=(0.9997, 1.0005),
113+
group=["theory", "signal_norm_xs", "signal_norm_xsbr"],
114+
)
115+
116+
# lumi
117+
lumi = self.config_inst.x.luminosity
118+
for unc_name in lumi.uncertainties:
119+
self.add_parameter(
120+
unc_name,
121+
type=ParameterType.rate_gauss,
122+
effect=lumi.get(names=unc_name, direction=("down", "up"), factor=True),
123+
group="experiment",
124+
)
125+
126+
# btag
127+
for name in self.config_inst.x.btag_unc_names:
128+
self.add_parameter(
129+
f"CMS_btag_{name}",
130+
type=ParameterType.shape,
131+
config_shift_source=f"btag_{name}",
132+
group="experiment",
133+
)
134+
135+
# pileup
136+
self.add_parameter(
137+
"CMS_pileup_2022",
138+
type=ParameterType.shape,
139+
config_shift_source="minbias_xs",
140+
group="experiment",
141+
)
142+
143+
#
144+
# cleanup
145+
#
146+
147+
self.cleanup(keep_parameters="THU_HH")
148+
149+
150+
@inference_model
151+
def default_no_shifts(self):
152+
# same initialization as "default" above
153+
default.init_func.__get__(self, self.__class__)()
154+
155+
#
156+
# remove all parameters that require a shift source other than nominal
157+
#
158+
159+
for category_name, process_name, parameter in self.iter_parameters():
160+
if parameter.type.is_shape or any(trafo.from_shape for trafo in parameter.transformations):
161+
self.remove_parameter(parameter.name, process=process_name, category=category_name)
162+
163+
#
164+
# cleanup
165+
#
166+
167+
self.cleanup(keep_parameters="THU_HH")

hbt/inference/inf_model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,13 @@ def test_unc(self):
6060

6161
# electron uncertainty
6262
self.add_parameter(
63-
"CMS_eff_e", # this is the name of the uncertainty as it will show in the datacard. Let's use some variant of the official naming
63+
"CMS_eff_e", # this is the name of the uncertainty as it will show in the datacard. Let's use some variant of the official naming # noqa
6464
process="*",
6565
type=ParameterType.shape,
6666
config_shift_source="e", # this is the name of the shift (alias) in the config
6767
)
6868
self.add_parameter_to_group("CMS_eff_e", "experiment")
6969

70-
7170
# a custom asymmetric uncertainty
7271
self.add_parameter(
7372
"QCDscale_ttbar",
@@ -78,7 +77,6 @@ def test_unc(self):
7877
)
7978
self.add_parameter_to_group("QCDscale_ttbar", "experiment")
8079

81-
8280
"""
8381
# tune uncertainty
8482
self.add_parameter(

0 commit comments

Comments
 (0)