Skip to content

Commit edf2773

Browse files
committed
Fix technicalities
1 parent cefa052 commit edf2773

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

machine_learning_hep/analysis/analyzer_jets.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ def __init__(self, datap, case, typean, period):
8686
self.p_pdfnames = datap["analysis"][self.typean].get("pdf_names")
8787
self.p_param_names = datap["analysis"][self.typean].get("param_names")
8888

89-
# TODO: should come entirely from DB
9089
self.observables = {
91-
"qa": ["zg", "rg", "nsd", "zpar", "dr", "lntheta", "lnkt", "lntheta-lnkt"],
90+
"qa": [*self.cfg("observables", {})],
9291
"all": [*self.cfg("observables", {})],
9392
}
9493

@@ -685,7 +684,6 @@ def _subtract_sideband(self, hist, var, mcordata, ipt):
685684
# project out the mass regions (first axis)
686685
axes = list(range(get_dim(hist)))[1:]
687686
fh[region] = project_hist(hist, axes, {0: bins[region]})
688-
self.logger.info("Projecting %s to %s in %s: %g entries", hist, axes, bins[region], fh[region].GetEntries())
689687
self._save_hist(
690688
fh[region], f"sideband/h_ptjet{label}_{region}_{string_range_pthf(range_pthf)}_{mcordata}.png"
691689
)
@@ -1128,7 +1126,7 @@ def estimate_feeddown(self):
11281126
project_hist(h3_fd_gen_orig[var], [0, 2], {}),
11291127
f"fd/h_ptjet-{var}_feeddown_genonly_noeffscaling.png",
11301128
)
1131-
powheg_xsection_scale_factor = 1.0 # FIXME: retrieve cross section
1129+
powheg_xsection_scale_factor = 0. # FIXME: retrieve cross section
11321130

11331131
case fd_input:
11341132
self.logger.critical("Invalid feeddown input %s", fd_input)

machine_learning_hep/workflow/workflow_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from functools import reduce
1616
from os.path import join
17+
from typing import TypeVar
1718

1819
# pylint: disable=import-error, no-name-in-module
1920
from ROOT import gStyle
@@ -37,7 +38,8 @@ def __init__(self, datap, case, typean, period=None):
3738
self.typean = typean
3839
self.period = period
3940

40-
def cfg(self, param, default=None):
41+
T = TypeVar("T")
42+
def cfg(self, param: str, default: T = None) -> T:
4143
return reduce(
4244
lambda d, key: d.get(key, default) if isinstance(d, dict) else default,
4345
param.split("."),

0 commit comments

Comments
 (0)