From 5255ffbc267b2e5b812f78ddb15623e86a60bcf0 Mon Sep 17 00:00:00 2001
From: Felix Metzner <felixmetzner@outlook.com>
Date: Mon, 15 Apr 2024 17:16:21 +0200
Subject: [PATCH] Changing calculation of relative statistical bin
 uncertainties for shape sys plots.

---
 .../fitting/dedicated_fit_approach/plotting_tools.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rdstar/offline_analysis/fitting/dedicated_fit_approach/plotting_tools.py b/rdstar/offline_analysis/fitting/dedicated_fit_approach/plotting_tools.py
index 2d7630191..b2e3feab5 100644
--- a/rdstar/offline_analysis/fitting/dedicated_fit_approach/plotting_tools.py
+++ b/rdstar/offline_analysis/fitting/dedicated_fit_approach/plotting_tools.py
@@ -196,12 +196,12 @@ class ShapePlotInfoContainer:
 
     @property
     def relative_stat_error(self) -> np.ndarray:
-        # norm: np.ndarray = np.where(
-        #     self.normed_base_shape > 0,
-        #     self.normed_base_shape,
-        #     np.ones_like(self.normed_base_shape),
-        # )
-        return np.sqrt(self.pure_bin_counts)
+        norm: np.ndarray = np.where(
+            self.pure_bin_counts > 0,
+            self.pure_bin_counts,
+            np.ones_like(self.pure_bin_counts),
+        )
+        return np.sqrt(self.pure_bin_counts) / norm
 
 
 @dataclass(frozen=True)
-- 
GitLab