Commit f463e03d authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Fix model parameter positions.

parent d88fe499
Pipeline #3471728 skipped with stage
......@@ -254,15 +254,20 @@ def plot_exclusion_and_bestfit_1d(
r.fill_legend(legend, legend_entries)
draw_objs.append(legend)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -577,15 +582,20 @@ def plot_exclusion_and_bestfit_2d(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......
......@@ -108,15 +108,20 @@ def plot_gof_distribution(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -301,15 +306,20 @@ def plot_gofs(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......
......@@ -228,15 +228,20 @@ def plot_likelihood_scan_1d(
legend.AddEntry(*tpl)
draw_objs.append(legend)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -465,19 +470,19 @@ def plot_likelihood_scans_1d(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
y_offset = 40
if legend_cols == 3:
y_offset = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad,
y_offset=y_offset))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix,
layout="outside_horizontal")
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if legend_cols == 3:
param_kwargs["y_offset"] = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -765,15 +770,20 @@ def plot_likelihood_scan_2d(
r.fill_legend(legend, legend_entries)
draw_objs.append(legend)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -956,15 +966,19 @@ def plot_likelihood_scans_2d(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=180))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix,
layout="outside_horizontal")
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if legend_cols == 3:
param_kwargs["y_offset"] = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -1178,15 +1192,19 @@ def plot_nuisance_likelihood_scans(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=180))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix,
layout="outside_horizontal")
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if legend_cols == 3:
param_kwargs["y_offset"] = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......
......@@ -237,15 +237,20 @@ def plot_limit_scan(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -478,19 +483,19 @@ def plot_limit_scans(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
y_offset = 40
if legend_cols == 3:
y_offset = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad,
y_offset=y_offset))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix,
layout="outside_horizontal")
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if legend_cols == 3:
param_kwargs["y_offset"] = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -807,24 +812,24 @@ def plot_limit_points(
r.setup_latex(rlabel, props={"NDC": True, "TextAlign": 32, "TextSize": 14})
draw_objs.append(rlabel)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# legend
legend = r.routines.create_legend(pad=pad, width=430, n=3, props={"NColumns": 2})
r.fill_legend(legend, legend_entries)
draw_objs.append(legend)
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# energy label
# ecm_label = ROOT.TLatex(cms_labels[0].GetX(), cms_labels[0].GetY() - 0.088, "13 TeV")
# r.setup_latex(ecm_label, props={"TextSize": 20, "TextAlign": 13})
# draw_objs.append(ecm_label)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
......@@ -1061,15 +1066,20 @@ def plot_limit_scan_2d(
r.fill_legend(legend, legend_entries)
draw_objs.append(legend)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -1226,8 +1236,9 @@ def plot_benchmark_limits(
draw_objs.append(legend)
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# campaign label
......
......@@ -405,16 +405,20 @@ def plot_s_over_b(
r.fill_legend(legend_procs, legend_entries_procs[::-1])
draw_objs1.append(legend_procs)
# model parameter labels
if model_parameters:
draw_objs1.extend(create_model_parameters(model_parameters, pad1))
# cms label
layout = "outside_horizontal" if backgrounds else "inside_vertical"
cms_labels = r.routines.create_cms_labels(layout=layout, pad=pad1,
postfix="" if paper else cms_postfix,)
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad1, postfix=_cms_postfix, layout=cms_layout)
draw_objs1.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs1.extend(create_model_parameters(model_parameters, pad1, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......
......@@ -354,7 +354,9 @@ def plot_pulls_impacts(
draw_objs.append(fit_label)
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix)
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix,
layout="inside_vertical")
draw_objs.extend(cms_labels)
# campaign label
......
......@@ -179,15 +179,20 @@ def plot_significance_scan_1d(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -342,19 +347,19 @@ def plot_significance_scans_1d(
props={"LineWidth": 0, "FillColor": colors.white_trans_70})
draw_objs.insert(-1, legend_box)
# model parameter labels
if model_parameters:
y_offset = 40
if legend_cols == 3:
y_offset = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad,
y_offset=y_offset))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix,
layout="outside_horizontal")
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if legend_cols == 3:
param_kwargs["y_offset"] = 1. - 0.25 * pad.GetTopMargin() - legend.GetY1()
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......@@ -517,15 +522,20 @@ def plot_significance_scan_2d(
r.setup_graph(g_sm, props={"MarkerStyle": 33, "MarkerSize": 2.5}, color=colors.red)
draw_objs.insert(-1, (g_sm, "P"))
# model parameter labels
if model_parameters:
draw_objs.extend(create_model_parameters(model_parameters, pad, y_offset=100))
# cms label
cms_labels = r.routines.create_cms_labels(pad=pad, postfix="" if paper else cms_postfix,
layout="outside_horizontal")
cms_layout = "outside_horizontal"
_cms_postfix = "" if paper else cms_postfix
cms_labels = r.routines.create_cms_labels(pad=pad, postfix=_cms_postfix, layout=cms_layout)
draw_objs.extend(cms_labels)
# model parameter labels
if model_parameters:
param_kwargs = {}
if cms_layout.startswith("inside"):
y_offset = 100 if cms_layout == "inside_vertical" and _cms_postfix else 80
param_kwargs = {"y_offset": y_offset}
draw_objs.extend(create_model_parameters(model_parameters, pad, **param_kwargs))
# campaign label
if campaign:
campaign_label = to_root_latex(campaign_labels.get(campaign, campaign))
......
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