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

Add option to use custom plotting styles in 2D nll plot.

parent 7c1bb606
......@@ -371,6 +371,7 @@ def plot_likelihood_scan_2d(
model_parameters=None,
campaign=None,
paper=False,
style=None,
):
"""
Creates a likelihood plot of the 2D scan of two POIs *poi1* and *poi2*, and saves it at *paths*.
......@@ -408,7 +409,8 @@ def plot_likelihood_scan_2d(
in case *show_contours_only* is not activated. *model_parameters* can be a dictionary of
key-value pairs of model parameters. *campaign* should refer to the name of a campaign label
defined in *dhi.config.campaign_labels*. When *paper* is *True*, certain plot configurations are
adjusted for use in publications.
adjusted for use in publications. Setting *style* leads to slight variations of the plot style.
Currently, only the default style is implemented.
Example: https://cms-hh.web.cern.ch/tools/inference/tasks/likelihood.html#2d
"""
......
......@@ -296,6 +296,12 @@ class PlotLikelihoodScan(LikelihoodBase, POIPlotTask):
description="save allowed parameter ranges in an additional output; 1D only; "
"default: False",
)
plot_style = luigi.Parameter(
default=law.NO_STR,
significant=False,
description="the name of a custom style as provided by the underlying plotting function; "
"2D only; no default",
)
save_hep_data = None
......@@ -403,6 +409,7 @@ class PlotLikelihoodScan(LikelihoodBase, POIPlotTask):
model_parameters=self.get_shown_parameters(),
campaign=self.campaign if self.campaign != law.NO_STR else None,
paper=self.paper,
style=self.plot_style if self.plot_style != law.NO_STR else None,
)
def load_scan_data(self, inputs, recompute_dnll2=True, merge_scans=True):
......
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