Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions mcgeneration/helpers/Gridpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self,**kwargs):
'save_diagrams': False, # Runs a modified version of the generation script that exits early to keep feynman diagrams
'use_coupling_model': False, # Use the 'coupling_orders' version of the dim6 model
'coupling_string': None, # If not None replaces "DIM6=1" with the specified string in the process card
'replace_model': None, # If not None overwrites the import model line of the process card
'replace_model': None, # If not None needs to be a tuple/list of length 2 that specifies the old and new model to be replaced
'flavor_scheme': 5,
'default_limits': [-10,10],
}
Expand Down Expand Up @@ -200,10 +200,10 @@ def saveProcessCard(self,indent=0):
run_process(['sed','-i','-e',sed_str,fpath])

if self.ops['replace_model']:
rep_model = self.ops['replace_model']
print "{ind}Using {model} model".format(model=rep_model,ind=indent_str)
old = "dim6top_LO_UFO"
sed_str = "s|import model {old}|import model {new}|g".format(old=old,new=rep_model)
old = self.ops['replace_model'][0]
new = self.ops['replace_model'][1]
print "{ind}Using {model} model".format(model=old,ind=indent_str)
sed_str = "s|import model {old}|import model {new}|g".format(old=old,new=new)
run_process(['sed','-i','-e',sed_str,fpath])

# Replace SUBSETUP in the process card with the correct name
Expand Down Expand Up @@ -498,10 +498,16 @@ def setup(self,indent=0):
print "[ERROR] Invalid BatchType for saving diagrams: {btype}".format(btype=self.ops['btype'])
return False

if self.ops['replace_model'] and len(self.ops['replace_model']) != 2:
# Note: This won't catch the very unlikely edge case where the input is a string of length 2
print "[ERROR] Invalid option for 'replace_model': {op}".format(op=self.ops['replace_model'])
return False

if self.ops['stype'] == ScanType.NONE:
# Don't do any reweighting
self.scan_pts = []


print "{0:>{w}}Setup gridpack: {setup}...".format("",setup=setup,w=4*indent)

# Set the random seed adding extra events to the pilotrun
Expand Down