From 21ba6025dbe7b42f12d58b0c914edd9f42cb6940 Mon Sep 17 00:00:00 2001 From: nckw Date: Thu, 6 Jun 2024 12:51:14 +0100 Subject: [PATCH] Update DataFrameWrapper.py No-one ever knows that there should be an overflow bin. Avoiding this insane idea --- python/DataFrameWrapper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/DataFrameWrapper.py b/python/DataFrameWrapper.py index cb6d984879e..6e14fe1bac0 100644 --- a/python/DataFrameWrapper.py +++ b/python/DataFrameWrapper.py @@ -100,12 +100,12 @@ def Get(self, object_name): def convert_to_th1(df, th1_class): """ Receive a dataframe and convert it to a TH1. Index is taken as the - binning for labelling. Last bin is overflow. + binning for labelling. Overflowbin should be ignored! """ name = df.index.names[0] - nbins = df.shape[0] - 1 + nbins = df.shape[0] th1 = getattr(ROOT, th1_class)(name, name, nbins, 0.0, float(nbins)) - for i in range(nbins + 1): + for i in range(nbins): sum_w, sum_ww = df.iloc[i] th1.SetBinContent(i + 1, sum_w) th1.SetBinError(i + 1, np.sqrt(sum_ww))