Skip to content

Commit

Permalink
fix 2023 btag wps
Browse files Browse the repository at this point in the history
  • Loading branch information
mafrahm committed Jan 27, 2025
1 parent 8f3b8d8 commit 61a6701
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 8 additions & 6 deletions hbw/config/config_run2.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,19 @@ def if_era(
# https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation106XUL17?rev=17
cfg.x.btag_working_points = DotDict.wrap({
"deepjet": {
"loose": {"2016preVFP": 0.0508, "2016postVFP": 0.0480, "2017": 0.0532, "2018": 0.0490, "2022preEE": 0.0583, "2022postEE": 0.0614, "2023": 0.0479, "2023BPix": 0.048}.get(cfg.x.cpn_tag, 0.0), # noqa
"medium": {"2016preVFP": 0.2598, "2016postVFP": 0.2489, "2017": 0.3040, "2018": 0.2783, "2022preEE": 0.3086, "2022postEE": 0.3196, "2023": 0.2431, "2023BPix": 0.2435}.get(cfg.x.cpn_tag, 0.0), # noqa
"tight": {"2016preVFP": 0.6502, "2016postVFP": 0.6377, "2017": 0.7476, "2018": 0.7100, "2022preEE": 0.7183, "2022postEE": 0.73, "2023": 0.6553, "2023BPix": 0.6563}.get(cfg.x.cpn_tag, 0.0), # noqa
"loose": {"2016preVFP": 0.0508, "2016postVFP": 0.0480, "2017": 0.0532, "2018": 0.0490, "2022preEE": 0.0583, "2022postEE": 0.0614, "2023preBPix": 0.0479, "2023BPix": 0.048}.get(cfg.x.cpn_tag, 0.0), # noqa
"medium": {"2016preVFP": 0.2598, "2016postVFP": 0.2489, "2017": 0.3040, "2018": 0.2783, "2022preEE": 0.3086, "2022postEE": 0.3196, "2023preBPix": 0.2431, "2023BPix": 0.2435}.get(cfg.x.cpn_tag, 0.0), # noqa
"tight": {"2016preVFP": 0.6502, "2016postVFP": 0.6377, "2017": 0.7476, "2018": 0.7100, "2022preEE": 0.7183, "2022postEE": 0.73, "2023preBPix": 0.6553, "2023BPix": 0.6563}.get(cfg.x.cpn_tag, 0.0), # noqa
},
"deepcsv": {
"loose": {"2016preVFP": 0.2027, "2016postVFP": 0.1918, "2017": 0.1355, "2018": 0.1208}.get(cfg.x.cpn_tag, 0.0), # noqa
"medium": {"2016preVFP": 0.6001, "2016postVFP": 0.5847, "2017": 0.4506, "2018": 0.4168}.get(cfg.x.cpn_tag, 0.0), # noqa
"tight": {"2016preVFP": 0.8819, "2016postVFP": 0.8767, "2017": 0.7738, "2018": 0.7665}.get(cfg.x.cpn_tag, 0.0), # noqa
},
"particlenet": {
"loose": {"2022preEE": 0.047, "2022postEE": 0.0499, "2023": 0.0358, "2023BPix": 0.359}.get(cfg.x.cpn_tag, 0.0), # noqa
"medium": {"2022preEE": 0.245, "2022postEE": 0.2605, "2023": 0.1917, "2023BPix": 0.1919}.get(cfg.x.cpn_tag, 0.0), # noqa
"tight": {"2022preEE": 0.6734, "2022postEE": 0.6915, "2023": 0.6172, "2023BPix": 0.6133}.get(cfg.x.cpn_tag, 0.0), # noqa
"loose": {"2022preEE": 0.047, "2022postEE": 0.0499, "2023preBPix": 0.0358, "2023postBPix": 0.359}.get(cfg.x.cpn_tag, 0.0), # noqa
"medium": {"2022preEE": 0.245, "2022postEE": 0.2605, "2023preBPix": 0.1917, "2023postBPix": 0.1919}.get(cfg.x.cpn_tag, 0.0), # noqa
"tight": {"2022preEE": 0.6734, "2022postEE": 0.6915, "2023preBPix": 0.6172, "2023postBPix": 0.6133}.get(cfg.x.cpn_tag, 0.0), # noqa
},
})

Expand All @@ -365,6 +365,8 @@ def if_era(
cfg.x.btag_wp_score = (
cfg.x.btag_working_points[cfg.x.b_tagger][cfg.x.btag_wp]
)
if cfg.x.btag_wp_score == 0.0:
raise ValueError(f"Unknown b-tag working point '{cfg.x.btag_wp}' for campaign {cfg.x.cpn_tag}")

# met configuration
cfg.x.met_name = {
Expand Down
1 change: 0 additions & 1 deletion hbw/config/defaults_and_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ def set_config_defaults_and_groups(config_inst):
"ncols": 2,
"fontsize": 16,
"bbox_to_anchor": (0., 0., 1., 1.),
"reverse": True,
},
"annotate_cfg": {
"xy": (0.05, 0.95),
Expand Down

0 comments on commit 61a6701

Please sign in to comment.