Commit 8fc6f25e authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Fix typo in remove_shape_bins script.

parent 6b90df43
......@@ -281,6 +281,9 @@ def remove_shape_bins(datacard, rules, directory=None, skip_shapes=False, mass="
1 + len(syst_shapes) * 2, bin_name, proc_name))
break
logger.info("loaded shapes of {} process(es) in datacard bin {}".format(
len(shapes[bin_name]), bin_name))
# keep sets of shape bin indices per datacard bin to remove
remove_bin_indices = {bin_name: set() for bin_name in shapes}
......@@ -386,7 +389,7 @@ def remove_shape_bins(datacard, rules, directory=None, skip_shapes=False, mass="
if proc_name == "data_obs":
new_observations[bin_name] = new_hist.Integral()
else:
new_rates.setdefault("bin_name", {})[proc_name] = new_hist.Integral()
new_rates.setdefault(bin_name, {})[proc_name] = new_hist.Integral()
# update the all syst hists
for _syst_shapes in syst_shapes.values():
......@@ -418,7 +421,7 @@ def remove_shape_bins(datacard, rules, directory=None, skip_shapes=False, mass="
"does not match".format(len(rates_bin_names), len(process_names),
len(rate_values)))
new_rate_values = [
new_rates.get(bin_name, {}).get(proc_name, rate)
(str(new_rates.get(bin_name, {}).get(proc_name, rate)) if rate != "-1" else rate)
for bin_name, proc_name, rate in zip(rates_bin_names, process_names, rate_values)
]
blocks["rates"][3] = "rate " + " ".join(new_rate_values)
......
......@@ -563,7 +563,7 @@ class TFileCache(object):
towner.cd()
args = (name,) if name else ()
tobj.Write(*args)
self.logger.debug("written object '{}'".format(tobj.GetName()))
# self.logger.debug("written object '{}'".format(tobj.GetName()))
data["tfile"].Close()
......@@ -582,6 +582,7 @@ class TFileCache(object):
class ROOTColorGetter(object):
def __init__(self, **cache):
super(ROOTColorGetter, self).__init__()
......
Subproject commit 9bf351e20cd66977ef877ec6062cc808472ae709
Subproject commit e8ab5781bea4c839e326090469dc366647cf4972
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment