From 0fae68ee17cd4178c1bb33155eeca619996d3e42 Mon Sep 17 00:00:00 2001
From: Frank Sauerburger <f.sauerburger@cern.ch>
Date: Fri, 13 Nov 2020 09:38:04 +0100
Subject: [PATCH] Fix blinding

The blinding was broken due to the presence of under- and overflow edges in the
blinding window optimizer. This led to invalid inf-inf computations.
---
 nnfwtbn/plot.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nnfwtbn/plot.py b/nnfwtbn/plot.py
index 6c9fa64..226e872 100644
--- a/nnfwtbn/plot.py
+++ b/nnfwtbn/plot.py
@@ -216,7 +216,7 @@ def hist(dataframe, variable, bins, stacks, selection=None,
     for i_stack, stack in enumerate(stacks):
         stack_items = []
         if stack in blind and variable.blinding is not None:
-            c_blind = variable.blinding(variable, bins)
+            c_blind = variable.blinding(variable, bins[1:-1])
         else:
             c_blind = lambda d: d
 
@@ -260,7 +260,7 @@ def hist(dataframe, variable, bins, stacks, selection=None,
 
         # Get denominator hist
         if denominator in blind and variable.blinding is not None:
-            c_blind = variable.blinding(variable, bins)
+            c_blind = variable.blinding(variable, bins[1:-1])
         else:
             c_blind = lambda d: d
 
@@ -279,7 +279,7 @@ def hist(dataframe, variable, bins, stacks, selection=None,
         numerators_data = []
         for i_numerator, numerator in enumerate(numerators):
             if numerator in blind and variable.blinding is not None:
-                c_blind = variable.blinding(variable, bins)
+                c_blind = variable.blinding(variable, bins[1:-1])
             else:
                 c_blind = lambda d: d
 
-- 
GitLab