Skip to content
Snippets Groups Projects
Commit ca33412d authored by Felix Metzner's avatar Felix Metzner
Browse files

Debugging SystematicsShapePlotter.

parent 4652991f
Branches
No related tags found
No related merge requests found
......@@ -332,7 +332,7 @@ class SystematicsShapePlotter:
def create_systematics_shape_plots(
self,
sys_shape_info: ShapePlotInfoContainer,
) -> None:
) -> Generator[SpecificShapePlotInfoContainer, None, None]:
target_dir_path: PathType = os.path.join(self.output_dir_path, sys_shape_info.name)
os.makedirs(target_dir_path, exist_ok=True)
......@@ -381,6 +381,7 @@ class SystematicsShapePlotter:
spec_sys_shape_info=_this_shape_info,
target_dir_path=target_dir_path,
)
yield _this_shape_info
raise RuntimeError("Stopping test!") # TODO: Remove this!
......@@ -393,10 +394,12 @@ class SystematicsShapePlotter:
final_target_dir_path: PathType = os.path.join(target_dir_path, spec_sys_shape_info.observable.col_name)
os.makedirs(final_target_dir_path, exist_ok=True)
fn_subset_str: str = "All" if spec_sys_shape_info.subset_index == -1 else f"SubSet{spec_sys_shape_info.subset_index}"
plot_file_name: str = f"{self.plot_name_prefix}"
plot_file_name += f"_{spec_sys_shape_info.observable.col_name}"
plot_file_name += f"_comp{spec_sys_shape_info.component_info.name}_ch{spec_sys_shape_info.reco_ch_info.name}"
plot_file_name += f"_{spec_sys_shape_info.name}_SubSet{spec_sys_shape_info.subset_index}"
plot_file_name += f"_{spec_sys_shape_info.name}_{fn_subset_str}"
fig, ax = plt.subplots(figsize=self.fig_size, dpi=300) # type: FigureType, AxesType
......@@ -437,7 +440,7 @@ class SystematicsShapePlotter:
ax.bar(
x=bin_mids,
height=2 * bin_shape_uncert_height,
height=bin_shape_uncert_height,
width=bin_widths,
bottom=norm_bin_count + bin_shape_uncert_lower_value,
color="black",
......@@ -452,9 +455,10 @@ class SystematicsShapePlotter:
y_limits = ax.get_ylim()
ax.set_ylim(bottom=y_limits[0], top=y_axis_scale * y_limits[1])
title_subset_str: str = "all" if spec_sys_shape_info.subset_index == -1 else f"{spec_sys_shape_info.subset_index}"
plot_title: str = (
spec_sys_shape_info.latex_str
+ f" ({spec_sys_shape_info.subset_index}) Shape Sys. in "
+ f" ({title_subset_str}) Shape Sys. in "
+ spec_sys_shape_info.reco_ch_info.latex_label
)
plt.title(plot_title, fontsize=20)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment