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

More work on sys shape plots.

parent 5f510a01
Branches
No related tags found
No related merge requests found
......@@ -1135,6 +1135,7 @@ class RDStarFitEvaluator:
relative_shape_error=fit_instance.ff_sig_rel_shape_sys_uncert_matrix,
components_to_consider=("BpDztau", "BzDmtau", "BpDzStau", "BzDmStau"),
scale_factor=10,
plot_subsets=False,
)
yield from sys_shape_plotter.create_systematics_shape_plots(sys_shape_info=example_sys_shape_info)
......@@ -1157,6 +1158,30 @@ class RDStarFitEvaluator:
relative_shape_error=fit_instance.ff_norm_rel_shape_sys_uncert_matrix,
components_to_consider=("BpDzl", "BzDml", "BpDzSl", "BzDmSl"),
scale_factor=10,
plot_subsets=False,
)
yield from sys_shape_plotter.create_systematics_shape_plots(sys_shape_info=example_sys_shape_info)
def plot_l_id_sys_shape_effects(
self,
fit_status_container: RDStarFitStatusContainer,
) -> Generator[SpecificShapePlotInfoContainer, None, None]:
sys_shape_plotter: SystematicsShapePlotter = SystematicsShapePlotter(
base_output_dir_path=self.base_output_dir_path,
fit_setup=self.fit_setup,
)
fit_instance: RDStarFitter = fit_status_container.fitter_instance
example_sys_shape_info = ShapePlotInfoContainer(
name=RDStarFitter.full_systematics_container.add_sys__pid_lepton.systematics_key,
latex_str=RDStarFitter.full_systematics_container.add_sys__pid_lepton.latex_str,
normed_base_shape=fit_instance.template_shapes,
relative_shape_error=fit_instance.lepton_id_rel_shape_sys_uncert_matrix,
components_to_consider=("BpDzl", "BzDml", "BpDzSl", "BzDmSl", "BBbarBKG_in_cB", "BBbarBKG_in_nB"),
scale_factor=10,
plot_subsets=False,
)
yield from sys_shape_plotter.create_systematics_shape_plots(sys_shape_info=example_sys_shape_info)
......
......@@ -165,6 +165,7 @@ class ShapePlotInfoContainer:
relative_shape_error: np.ndarray
scale_factor: Optional[float] = None
components_to_consider: Optional[Tuple[str, ...]] = None
plot_subsets: bool = True
def __post_init__(self) -> None:
assert len(self.normed_base_shape.shape) == 2, (
......@@ -312,18 +313,19 @@ class SystematicsShapePlotter:
obs_info.n_bins,
)
for subset_id in range(sys_shape_info.relative_shape_error.shape[2]):
yield SpecificShapePlotInfoContainer(
name=sys_shape_info.name,
latex_str=sys_shape_info.latex_str,
subset_index=subset_id,
normed_base_shape=projected_normed_base_shape,
relative_shape_error=projected_relative_shape_error_splits[subset_id][obs_index],
observable=obs_info,
reco_ch_info=reco_ch_info,
component_info=component_info,
scale_factor=sys_shape_info.scale_factor,
)
if sys_shape_info.plot_subsets:
for subset_id in range(sys_shape_info.relative_shape_error.shape[2]):
yield SpecificShapePlotInfoContainer(
name=sys_shape_info.name,
latex_str=sys_shape_info.latex_str,
subset_index=subset_id,
normed_base_shape=projected_normed_base_shape,
relative_shape_error=projected_relative_shape_error_splits[subset_id][obs_index],
observable=obs_info,
reco_ch_info=reco_ch_info,
component_info=component_info,
scale_factor=sys_shape_info.scale_factor,
)
yield SpecificShapePlotInfoContainer(
name=sys_shape_info.name,
......@@ -509,7 +511,7 @@ class SystematicsShapePlotter:
stacked=False,
color=[KITColors.kit_blue, KITColors.kit_orange],
lw=1.3,
label=["up", "down"],
label=["up", "down"], # type: ignore # The type here is correct!
histtype="step",
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment