Commit 7fa7eb4c authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Revive model studies tasks.

parent f141c2f7
Pipeline #3469805 skipped with stage
......@@ -1173,7 +1173,7 @@ class HHModel(HHModelBase):
def getYieldScale(self, bin, process):
"""
Hook called by the super class to determine the scaling, or an expressions modeling the
Hook called by the super class to determine the scaling, or an expression modeling the
scaling of a *process* in a specific datacard *bin*.
Here, we distinguish several cases, depending on which type of process is considered:
......
......@@ -20,10 +20,13 @@ from dhi.tasks.combine import (
CombineDatacards,
)
from dhi.datacard_tools import create_datacard_instance
from dhi.config import poi_data, color_sequence, cms_postfix
from dhi.config import poi_data, colors, color_sequence, cms_postfix
from dhi.util import import_ROOT, create_tgraph, to_root_latex
colors = colors.root
class PlotMorphingScales(PlotTask, HHModelTask, ParameterScanTask, ParameterValuesTask):
task_namespace = "study"
......@@ -69,7 +72,7 @@ class PlotMorphingScales(PlotTask, HHModelTask, ParameterScanTask, ParameterValu
formula = getattr(model, "{}_formula".format(self.signal))
# store scaling functions mapped to samples in the formula
scale_fns = OrderedDict(zip(formula.sample_list, formula.coeffs))
scale_fns = OrderedDict(zip(formula.samples, formula.coeffs))
# create graphs
graphs = []
......@@ -122,7 +125,7 @@ class PlotMorphingScales(PlotTask, HHModelTask, ParameterScanTask, ParameterValu
# write graphs
for graph, label, col in zip(graphs, labels, color_sequence[: len(graphs)]):
r.setup_graph(graph, props={"LineWidth": 1, "MarkerStyle": 20, "MarkerSize": 0.5},
color=col)
color=colors[col])
draw_objs.append((graph, "SAME,PL"))
legend_entries.append((graph, label))
......@@ -208,7 +211,7 @@ class PlotMorphedDiscriminant(PlotTask, DatacardTask, MultiHHModelTask, Paramete
# store signal names in order of model samples
signal_names = []
for sample in formula.sample_list:
for sample in formula.samples:
for signal_name in dc.signals:
if signal_name.startswith(sample.label):
signal_names.append(signal_name)
......@@ -315,7 +318,7 @@ class PlotMorphedDiscriminant(PlotTask, DatacardTask, MultiHHModelTask, Paramete
# write histograms
for hist, label, col in zip(hists, labels, color_sequence[: len(hists)]):
r.setup_hist(hist, props={"LineWidth": 1}, color=col, color_flags="lm")
r.setup_hist(hist, props={"LineWidth": 1}, color=colors[col], color_flags="lm")
draw_objs.append((hist, "SAME,HIST,E"))
legend_entries.append((hist, label))
......@@ -328,7 +331,8 @@ class PlotMorphedDiscriminant(PlotTask, DatacardTask, MultiHHModelTask, Paramete
draw_objs.append(legend)
# cms label
cms_labels = r.routines.create_cms_labels(postfix=cms_postfix, layout="outside_horizontal", pad=pad)
cms_labels = r.routines.create_cms_labels(postfix=cms_postfix, layout="outside_horizontal",
pad=pad)
draw_objs.extend(cms_labels)
# bin label
......@@ -436,7 +440,7 @@ class PlotStatErrorScan(PlotMorphedDiscriminant, ParameterScanTask):
# write graphs
for graph, label, col in zip(graphs, labels, color_sequence[: len(graphs)]):
r.setup_graph(graph, props={"LineWidth": 1, "MarkerStyle": 20, "MarkerSize": 0.5},
color=col)
color=colors[col])
draw_objs.append((graph, "SAME,PL"))
legend_entries.append((graph, label))
......@@ -449,7 +453,8 @@ class PlotStatErrorScan(PlotMorphedDiscriminant, ParameterScanTask):
draw_objs.append(legend)
# cms label
cms_labels = r.routines.create_cms_labels(postfix=cms_postfix, layout="outside_horizontal", pad=pad)
cms_labels = r.routines.create_cms_labels(postfix=cms_postfix, layout="outside_horizontal",
pad=pad)
draw_objs.extend(cms_labels)
# bin label
......
Markdown is supported
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