Commit 4e9b83c1 authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Fix z-axis resolution in 2D likelihood plots.

parent e0b32e67
......@@ -431,7 +431,7 @@ def plot_likelihood_scan_2d(
draw_objs.append((h_dummy, ""))
# setup the nll hist
r.setup_hist(h_nll, props={"ContourXX": 100, "Minimum": z_min, "Maximum": z_max})
r.setup_hist(h_nll, props={"Contour": 100, "Minimum": z_min, "Maximum": z_max})
r.setup_z_axis(h_nll.GetZaxis(), pad=pad, props={"Title": z_title, "TitleOffset": 1.3})
draw_objs.append((h_nll, "SAME,COLZ"))
......@@ -819,15 +819,15 @@ def plot_nuisance_likelihood_scans(
draw_objs = [(h_dummy, "HIST")]
legend_entries = []
# horizontal guidance line at dnll = 1 in log scale
if y_log and (_y_min < 1. < y_max_line):
# horizontal and vertical guidance lines
if (_y_min < 1 < y_max_line) and (y_log or y_max_line < 100):
# horizontal
line = ROOT.TLine(x_min, 1., x_max, 1.)
r.setup_line(line, props={"LineColor": 12, "LineStyle": 2, "NDC": False})
draw_objs.append(line)
# vertical guidance lines in log scale
for x in [-1, 1]:
if y_log and (x_min < x < x_max):
# vertical
for x in [-1, 1]:
line = ROOT.TLine(x, _y_min, x, min(1., y_max_line))
r.setup_line(line, props={"LineColor": 12, "LineStyle": 2, "NDC": False})
draw_objs.append(line)
......
......@@ -97,7 +97,7 @@ class MergeLikelihoodScan(LikelihoodBase):
data = []
dtype = [(p, np.float32) for p in self.scan_parameter_names] + [
("delta_nll", np.float32),
("dnll", np.float32),
("dnll2", np.float32),
]
poi_mins = self.n_pois * [np.nan]
......@@ -106,7 +106,8 @@ class MergeLikelihoodScan(LikelihoodBase):
scan_values = branch_map[branch]
f = inp.load(formatter="uproot")["limit"]
failed = len(f["deltaNLL"].array()) <= 1
dnll = f["deltaNLL"].array()
failed = len(dnll) <= 1
if failed:
data.append(scan_values + (np.nan, np.nan))
continue
......@@ -116,7 +117,7 @@ class MergeLikelihoodScan(LikelihoodBase):
poi_mins = [f[p].array()[0] for p in self.pois]
# store the value of that point
dnll = f["deltaNLL"].array()[1]
dnll = dnll[1]
data.append(scan_values + (dnll, dnll * 2.0))
data = np.array(data, dtype=dtype)
......
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