Bug Fix in mg_card.py
now madminer delete all lines in the run_card related to systematics (and not just the first)
@@ -146,6 +146,9 @@ def export_run_card(template_filename, run_card_filename, systematics=None):
# Remove old entries
for i, line in enumerate(run_card_lines):
comment_pos = line.find("#")
+ if comment_pos >= 0:
+ line = line[:comment_pos]
+ comment_pos = line.find("!")
if comment_pos >= 0:
line = line[:comment_pos]
@@ -157,9 +160,9 @@ def export_run_card(template_filename, run_card_filename, systematics=None):
if line_key in settings:
del run_card_lines[i]
- break
+ continue
- # Add new entries
+ # Add new entries - sytematics
run_card_lines.append("")
run_card_lines.append("#*********************************************************************")
run_card_lines.append("# MadMiner systematics setup *")
