Fix Bug in LHEProcessor
Fix bug so that cuts are applied ...
@@ -183,14 +183,18 @@ def parse_lhe_file(
variables[obs_name] = obs_value
# Check cuts
+ pass_cut=True
for cut, default_pass in zip(cuts, cuts_default_pass):
try:
cut_result = eval(cut, variables)
if not cut_result:
- continue
+ pass_cut=False
except (SyntaxError, NameError, TypeError, ZeroDivisionError, IndexError):
if not default_pass:
+ pass_cut=False
+
+ if not pass_cut:
continue
# Store results
@@ -257,14 +261,18 @@ def parse_lhe_file(
variables[obs_name] = obs_value
# Check cuts
+ pass_cut=True
for cut, default_pass in zip(cuts, cuts_default_pass):
try:
cut_result = eval(cut, variables)
if not cut_result:
- continue
+ pass_cut=False
except (SyntaxError, NameError, TypeError, ZeroDivisionError, IndexError):
if not default_pass:
+ pass_cut=False
+
+ if not pass_cut:
continue
# Store results
