Skip to content

Commit

Permalink
Update DataFrameWrapper.py
Browse files Browse the repository at this point in the history
No-one ever knows that there should be an overflow bin. Avoiding this insane idea
  • Loading branch information
nucleosynthesis authored Jun 6, 2024
1 parent 158258c commit 21ba602
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/DataFrameWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 21ba602

Please sign in to comment.