From 8cf6e84b7d7f68267a26093b5f946fff347a5b4e Mon Sep 17 00:00:00 2001
From: Frank Sauerburger <frank@sauerburger.com>
Date: Wed, 24 Mar 2021 10:59:23 +0100
Subject: [PATCH] Change uncertainty computation in ratio plot

---
 uhepp-js/src/components/UheppHist.jsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/uhepp-js/src/components/UheppHist.jsx b/uhepp-js/src/components/UheppHist.jsx
index 1ba32d8..9c4923b 100644
--- a/uhepp-js/src/components/UheppHist.jsx
+++ b/uhepp-js/src/components/UheppHist.jsx
@@ -253,8 +253,7 @@ const Ratio = ({
         const y_values = bin_indices.map(i => numerator[i] / denominator[i])
         const [new_x, new_y] = histogramify(edges, y_values)
 
-        const stat = bin_indices.map(i => Math.sqrt(stat_num[i]**2 / denominator[i]**2
-                               + numerator[i]**2 / denominator[i]**4 * stat_den[i]**2))
+        const stat = bin_indices.map(i => stat_num[i] / denominator[i])
 
         objects.push(<Step x={new_x}
                            y={new_y}
@@ -277,8 +276,7 @@ const Ratio = ({
         const stat_den = sumStat(uhepp.yields, ratio_item.denominator, bin_i + 1)
 
         const y_value = numerator / denominator
-        const stat = Math.sqrt(stat_num**2 / denominator**2
-                               + numerator**2 / denominator**4 * stat_den**2)
+        const stat = stat_num / denominator
         const bin_center = (edges[bin_i + 1] + edges[bin_i]) / 2
         const width = edges[bin_i + 1] - edges[bin_i]
 
-- 
GitLab