Skip to content

Commit

Permalink
remove _manybins postfix from dnn variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mafrahm committed Nov 25, 2024
1 parent 6dbef6f commit 7201bdf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions hbw/config/hist_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def rebin(task, hists: hist.Histogram):

# edges for 2b channel
edges = {
"mlscore.hh_ggf_hbb_hvv2l2nu_kl1_kt1_manybins": [0.0, 0.429, 0.509, 0.5720000000000001, 0.629, 0.68, 0.72, 0.757, 0.789, 0.8200000000000001, 1.0], # noqa
"mlscore.hh_vbf_hbb_hvv2l2nu_kv1_k2v1_kl1_manybins": [0.0, 0.427, 0.529, 0.637, 0.802, 1.0],
"mlscore.tt_manybins": [0.0, 0.533, 0.669, 1.0],
"mlscore.h_manybins": [0.0, 0.494, 0.651, 1.0],
"mlscore.hh_ggf_hbb_hvv2l2nu_kl1_kt1": [0.0, 0.429, 0.509, 0.5720000000000001, 0.629, 0.68, 0.72, 0.757, 0.789, 0.8200000000000001, 1.0], # noqa
"mlscore.hh_vbf_hbb_hvv2l2nu_kv1_k2v1_kl1": [0.0, 0.427, 0.529, 0.637, 0.802, 1.0],
"mlscore.tt": [0.0, 0.533, 0.669, 1.0],
"mlscore.h": [0.0, 0.494, 0.651, 1.0],
}

h_rebinned = DotDict()
Expand Down
2 changes: 1 addition & 1 deletion hbw/inference/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def config_variable(self: InferenceModel, config_cat_inst: od.Config):
root_cats = config_cat_inst.x.root_cats
if dnn_cat := root_cats.get("dnn"):
dnn_proc = dnn_cat.replace("ml_", "")
return f"mlscore.{dnn_proc}_manybins"
return f"mlscore.{dnn_proc}"
else:
return "mli_mbb"

Expand Down
4 changes: 2 additions & 2 deletions hbw/ml/derived/dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def setup(self):
# NOTE: since these variables are only used in ConfigTasks,
# we do not need to add these variables to all configs
for proc in self.processes:
if f"mlscore.{proc}_manybins" not in self.config_inst.variables:
if f"mlscore.{proc}" not in self.config_inst.variables:
self.config_inst.add_variable(
name=f"mlscore.{proc}_manybins",
name=f"mlscore.{proc}",
expression=f"mlscore.{proc}",
null_value=-1,
binning=(1000, 0., 1.),
Expand Down
4 changes: 2 additions & 2 deletions hbw/ml/derived/sl.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def setup(self):
# NOTE: since these variables are only used in ConfigTasks,
# we do not need to add these variables to all configs
for proc in self.processes:
if f"mlscore.{proc}_manybins" not in self.config_inst.variables:
if f"mlscore.{proc}" not in self.config_inst.variables:
self.config_inst.add_variable(
name=f"mlscore.{proc}_manybins",
name=f"mlscore.{proc}",
expression=f"mlscore.{proc}",
null_value=-1,
binning=(1000, 0., 1.),
Expand Down
2 changes: 1 addition & 1 deletion hbw/ml/derived/sl_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def setup(self):
)
self.config_inst.add_variable(
# TODO: to be used for rebinning
name=f"mlscore.{proc}_manybins",
name=f"mlscore.{proc}",
expression=f"mlscore.{proc}",
null_value=-1,
binning=(1000, 0., 1.),
Expand Down

0 comments on commit 7201bdf

Please sign in to comment.