77
77
class LoopInterface(CheckLoop, CompleteLoop, HelpLoop, mg_interface.MadGraphCmd):
79
def __init__(self, mgme_dir = '', *completekey, **stdin):
80
""" Special init tasks for the Loop Interface """
82
mg_interface.MadGraphCmd.__init__(self, mgme_dir = '', *completekey, **stdin)
86
""" Special tasks when switching to this interface """
88
# Refresh all the interface stored value as things like generated
89
# processes and amplitudes are not to be reused in between different
91
# Clear history, amplitudes and matrix elements when a model is imported
92
# Remove previous imports, generations and outputs from history
93
self.clean_history(remove_bef_lb1='import')
94
# Reset amplitudes and matrix elements
95
self._done_export=False
96
self._curr_amps = diagram_generation.AmplitudeList()
97
self._curr_matrix_elements = helas_objects.HelasMultiProcess()
99
# Set where to look for CutTools installation.
100
# In further versions, it will be set in the same manner as _mgme_dir so that
101
# the user can chose its own CutTools distribution.
102
self._cuttools_dir=str(os.path.join(self._mgme_dir,'vendor','CutTools'))
103
if not os.path.isdir(os.path.join(self._cuttools_dir, 'src','cts')):
104
logger.warning(('Warning: Directory %s is not a valid CutTools directory.'+\
105
'Using default CutTools instead.') % \
107
self._cuttools_dir=str(os.path.join(self._mgme_dir,'vendor','CutTools'))
79
109
def do_generate(self, line, *args,**opt):
81
111
# Check args validity
143
173
if answer != 'y':
144
174
raise self.InvalidCmd('Stopped by user request')
146
if os.path.isdir(os.path.join(self._mgme_dir, 'loop_material')):
176
if os.path.isdir(os.path.join(self._mgme_dir, 'Template/loop_material')):
147
177
self._curr_exporter = loop_exporters.LoopProcessExporterFortranSA(\
148
178
self._mgme_dir, self._export_dir, not noclean,\
149
os.path.join(self._mgme_dir, 'loop_material'),\
179
os.path.join(self._mgme_dir, 'Template/loop_material'),\
150
180
self._cuttools_dir)
152
182
raise MadGraph5Error('MG5 cannot find the \'loop_material\' directory'+\