Package madgraph :: Package interface :: Module master_interface
[hide private]
[frames] | no frames]

Source Code for Module madgraph.interface.master_interface

  1  ################################################################################ 
  2  # 
  3  # Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors 
  4  # 
  5  # This file is a part of the MadGraph5_aMC@NLO project, an application which  
  6  # automatically generates Feynman diagrams and matrix elements for arbitrary 
  7  # high-energy processes in the Standard Model and beyond. 
  8  # 
  9  # It is subject to the MadGraph5_aMC@NLO license which should accompany this  
 10  # distribution. 
 11  # 
 12  # For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch 
 13  # 
 14  ################################################################################ 
 15  """A user friendly command line interface to access all MadGraph5_aMC@NLO features. 
 16     Uses the cmd package for command interpretation and tab completion. 
 17  """ 
 18   
 19   
 20  import atexit 
 21  import logging 
 22  import optparse 
 23  import os 
 24  import pydoc 
 25  import re 
 26  import subprocess 
 27  import sys 
 28  import traceback 
 29  import time 
 30   
 31  root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0] 
 32  root_path = os.path.split(root_path)[0] 
 33  sys.path.insert(0, root_path) 
 34   
 35  #usefull shortcut 
 36  pjoin = os.path.join 
 37   
 38  import madgraph 
 39  import madgraph.core.diagram_generation as diagram_generation 
 40  import madgraph.core.helas_objects as helas_objects 
 41  import madgraph.loop.loop_base_objects as loop_base_objects 
 42  import madgraph.interface.extended_cmd as cmd 
 43  import madgraph.interface.madgraph_interface as MGcmd 
 44  import madgraph.interface.loop_interface as LoopCmd 
 45  import madgraph.interface.amcatnlo_interface as amcatnloCmd 
 46  import madgraph.fks.fks_base as fks_base 
 47  import madgraph.iolibs.files as files 
 48  import madgraph.various.misc as misc 
 49   
 50  from madgraph import MG4DIR, MG5DIR, MadGraph5Error, InvalidCmd 
 51   
 52  logger = logging.getLogger('cmdprint') # -> stdout 
53 54 55 -class Switcher(object):
56 """ Helping class containing all the switching routine """ 57
58 - def __init__(self, main='MadGraph', *args, **opt):
59 60 # define the interface 61 self.change_principal_cmd(main) 62 self.cmd.__init__(self, *args, **opt)
63 64 interface_names= {'MadGraph':('MG5_aMC',MGcmd.MadGraphCmd), 65 'MadLoop':('MG5_aMC',LoopCmd.LoopInterface), 66 'aMC@NLO':('MG5_aMC',amcatnloCmd.aMCatNLOInterface)} 67 68 _switch_opts = interface_names.keys() 69 current_interface = None 70 71 # Helper functions 72
73 - def setup(self, *args, **opts):
74 """ Function to initialize the interface when switched to it. It is not 75 the same as __init__ as this latter functions would call its mother 76 from madgraph_interface and this is only desirable for the first 77 initialization when launching MG5 """ 78 return self.cmd.setup(self, *args, **opts)
79 157 158 159 160 @staticmethod
161 - def extract_process_type(line):
162 """Extract from a string what is the type of the computation. This 163 returns a tuple (mode, option, pert_orders) where mode can be either 'NLO' or 'tree' 164 and option 'all', 'real' or 'virt'.""" 165 166 # Perform sanity modifications on the lines: 167 # Add a space before and after any > , $ / | [ ] 168 space_before = re.compile(r"(?P<carac>\S)(?P<tag>[\\[\\]/\,\\$\\>|])(?P<carac2>\S)") 169 line2 = space_before.sub(r'\g<carac> \g<tag> \g<carac2>', line) 170 171 # Use regular expressions to extract the loop mode (if present) and its 172 # option, specified in the line with format [ option = loop_orders ] or 173 # [ loop_orders ] which implicitly select the 'all' option. 174 loopRE = re.compile(r"^(.*)(?P<loop>\[(\s*(?P<option>\w+)\s*=)?(?P<orders>.+)?\])(.*)$") 175 # Make sure that the content of options following '--' are not considered. 176 res=loopRE.search(re.split('%s\-\-', line,1)[0]) 177 if res: 178 orders=res.group('orders').split() if res.group('orders') else [] 179 if res.group('option') and len(res.group('option').split())==1: 180 if res.group('option').split()[0]=='tree': 181 return ('tree',res.group('option').split()[0],orders) 182 else: 183 return ('NLO',res.group('option').split()[0],orders) 184 else: 185 # If not option is set the convention is that the mode is 'all' 186 # unless no perturbation orders is defined. 187 # if order is set to LOonly assume LOonly=QCD 188 if orders == ['LOonly']: 189 return ('NLO', 'LOonly', ['QCD']) 190 elif len(orders)>0: 191 return ('NLO','all',orders) 192 else: 193 return ('tree',None,[]) 194 else: 195 return ('tree',None,[])
196 197 # Wrapping functions possibly switching to new interfaces 198
199 - def do_add(self, line, *args, **opts):
200 201 allow_switch = True 202 if self._curr_amps: 203 allow_switch = False 204 205 argss = cmd.Cmd.split_arg(line) 206 if len(argss)>=1 and argss[0] in ['process','timing','profile']: 207 proc_line = ' '.join(argss[1:]) 208 (type,nlo_mode,orders)=self.extract_process_type(proc_line) 209 if type=='NLO': 210 if not nlo_mode in self._valid_nlo_modes: raise self.InvalidCMD( \ 211 'The NLO mode %s is not valid. Please choose one among: %s' \ 212 % (nlo_mode, ' '.join(self._valid_nlo_modes))) 213 elif nlo_mode in ['all', 'real', 'LOonly']: 214 self.change_principal_cmd('aMC@NLO', allow_switch) 215 elif nlo_mode in ['virt', 'sqrvirt']: 216 self.change_principal_cmd('MadLoop', allow_switch) 217 elif nlo_mode == 'noborn': 218 if self.current_interface == "MadGraph": 219 allow_switch = True 220 self.change_principal_cmd('MadLoop', allow_switch) 221 self.cmd.validate_model(self, loop_type=nlo_mode, 222 coupling_type=orders) 223 self.change_principal_cmd('MadGraph', allow_switch) 224 return self.cmd.create_loop_induced(self, line, *args, **opts) 225 else: 226 self.change_principal_cmd('MadGraph', allow_switch) 227 try: 228 return self.cmd.do_add(self, line, *args, **opts) 229 except fks_base.NoBornException: 230 logger.info("------------------------------------------------------------------------", '$MG:BOLD') 231 logger.info(" No Born diagrams found. Now switching to the loop-induced mode. ", '$MG:BOLD') 232 logger.info(" Please cite ref. 'arXiv:1507.00020' when using results from this mode. ", '$MG:BOLD') 233 logger.info("------------------------------------------------------------------------", '$MG:BOLD') 234 self.change_principal_cmd('MadGraph',allow_switch) 235 return self.cmd.create_loop_induced(self, line, *args, **opts)
236 237
238 - def do_check(self, line, *args, **opts):
239 240 argss = self.split_arg(line) 241 proc_line = " ".join(argss[1:]) 242 (type,nlo_mode,orders)=self.extract_process_type(proc_line) 243 if type=='NLO': 244 if not nlo_mode in self._valid_nlo_modes: raise self.InvalidCMD(\ 245 'The NLO mode %s is not valid. Please chose one among: %s' \ 246 % (nlo_mode, ' '.join(self._valid_nlo_modes))) 247 elif nlo_mode == 'all': 248 self.change_principal_cmd('MadLoop') 249 elif nlo_mode == 'real': 250 raise self.InvalidCMD('Mode [real=...] not valid for checking processes.') 251 self.change_principal_cmd('aMC@NLO') 252 elif nlo_mode == 'virt' or nlo_mode == 'sqrvirt': 253 self.change_principal_cmd('MadLoop') 254 else: 255 self.change_principal_cmd('MadGraph') 256 257 return self.cmd.do_check(self, line, *args, **opts)
258
259 - def do_generate(self, line, *args, **opts):
260 261 argss = cmd.Cmd.split_arg(line) 262 # Make sure to switch to the right interface. 263 if len(argss)>=1: 264 proc_line = ' '.join(argss[1:]) 265 (type,nlo_mode,orders)=self.extract_process_type(proc_line) 266 if type=='NLO': 267 if not nlo_mode in self._valid_nlo_modes: raise self.InvalidCmd( \ 268 'The NLO mode %s is not valid. Please chose one among: %s' \ 269 % (nlo_mode, ' '.join(self._valid_nlo_modes))) 270 elif nlo_mode in ['all', 'real', 'LOonly']: 271 self._fks_multi_proc = fks_base.FKSMultiProcess() 272 self.change_principal_cmd('aMC@NLO') 273 elif nlo_mode == 'virt' or nlo_mode == 'virtsqr': 274 self.change_principal_cmd('MadLoop') 275 else: 276 self.change_principal_cmd('MadGraph') 277 return self.cmd.do_generate(self, line, *args, **opts)
278
279 - def do_import(self, *args, **opts):
280 self.cmd.do_import(self, *args, **opts) 281 if self._curr_model: 282 if isinstance(self._curr_model, loop_base_objects.LoopModel) and \ 283 self._curr_model['perturbation_couplings']!=[] and \ 284 self.current_interface not in ['aMC@NLO','MadLoop']: 285 self.change_principal_cmd('aMC@NLO') 286 if (not isinstance(self._curr_model, loop_base_objects.LoopModel) or \ 287 self._curr_model['perturbation_couplings']==[]) and \ 288 self.current_interface in ['MadLoop']: 289 self.change_principal_cmd('MadGraph') 290 import madgraph.various.misc as misc 291 return
292
293 - def do_output(self, line, *args, **opts):
294 """ treat output aloha in order to use always the one in MG5 """ 295 if line.strip().startswith('aloha'): 296 MGcmd.MadGraphCmd.do_output(self, line, *args, **opts) 297 else: 298 self.cmd.do_output(self, line, *args, **opts)
299
300 - def check_output(self, arg, *args, **opts):
301 if arg and arg[0] == 'aloha': 302 MGcmd.MadGraphCmd.check_output(self, arg, *args, **opts) 303 else: 304 self.cmd.check_output(self, arg, *args, **opts)
305 306 307 308 309 # Dummy functions, not triggering any switch of interfaces 310
311 - def export(self, *args, **opts):
312 return self.cmd.export(self, *args, **opts)
313
314 - def check_add(self, *args, **opts):
315 return self.cmd.check_add(self, *args, **opts)
316
317 - def check_answer_in_input_file(self, *args, **opts):
318 return self.cmd.check_answer_in_input_file(self, *args, **opts)
319
320 - def check_check(self, *args, **opts):
321 return self.cmd.check_check(self, *args, **opts)
322
323 - def check_define(self, *args, **opts):
324 return self.cmd.check_define(self, *args, **opts)
325
326 - def check_decay_diagram(self, *args, **opts):
327 return self.cmd.check_decay_diagram(self, *args, **opts)
328
329 - def complete_decay_diagram(self, *args, **opts):
330 return self.cmd.complete_decay_diagram(self, *args, **opts)
331
332 - def do_decay_diagram(self, *args, **opts):
333 return self.cmd.do_decay_diagram(self, *args, **opts)
334
335 - def help_decay_diagram(self, *args, **opts):
336 return self.cmd.help_decay_diagram(self, *args, **opts)
337
338 - def check_compute_widths(self, *args, **opts):
339 return self.cmd.check_compute_widths(self, *args, **opts)
340
341 - def complete_compute_widths(self, *args, **opts):
342 return self.cmd.complete_compute_widths(self, *args, **opts)
343
344 - def do_compute_widths(self, *args, **opts):
345 return self.cmd.do_compute_widths(self, *args, **opts)
346
347 - def help_compute_widths(self, *args, **opts):
348 return self.cmd.help_compute_widths(self, *args, **opts)
349
350 - def check_display(self, *args, **opts):
351 return self.cmd.check_display(self, *args, **opts)
352
353 - def check_draw(self, *args, **opts):
354 return self.cmd.check_draw(self, *args, **opts)
355
356 - def check_for_export_dir(self, *args, **opts):
357 return self.cmd.check_for_export_dir(self, *args, **opts)
358
359 - def check_generate(self, *args, **opts):
360 return self.cmd.check_generate(self, *args, **opts)
361
362 - def check_tutorial(self, *args, **opts):
363 return self.cmd.check_tutorial(self, *args, **opts)
364
365 - def check_history(self, *args, **opts):
366 return self.cmd.check_history(self, *args, **opts)
367
368 - def check_import(self, *args, **opts):
369 return self.cmd.check_import(self, *args, **opts)
370
371 - def check_install(self, *args, **opts):
372 return self.cmd.check_install(self, *args, **opts)
373
374 - def check_launch(self, *args, **opts):
375 return self.cmd.check_launch(self, *args, **opts)
376
377 - def check_load(self, *args, **opts):
378 return self.cmd.check_load(self, *args, **opts)
379
380 - def check_open(self, *args, **opts):
381 return self.cmd.check_open(self, *args, **opts)
382
383 - def check_process_format(self, *args, **opts):
384 return self.cmd.check_process_format(self, *args, **opts)
385
386 - def check_save(self, *args, **opts):
387 return self.cmd.check_save(self, *args, **opts)
388
389 - def check_set(self, *args, **opts):
390 return self.cmd.check_set(self, *args, **opts)
391
392 - def get_stored_line(self, *args, **opts):
393 return self.cmd.get_stored_line(self, *args, **opts)
394
395 - def complete_add(self, *args, **opts):
396 return self.cmd.complete_add(self, *args, **opts)
397
398 - def complete_switch(self, *args, **opts):
399 return self.cmd.complete_switch(self, *args, **opts)
400
401 - def complete_check(self, *args, **opts):
402 return self.cmd.complete_check(self, *args, **opts)
403
404 - def complete_define(self, *args, **opts):
405 return self.cmd.complete_define(self, *args, **opts)
406
407 - def complete_display(self, *args, **opts):
408 return self.cmd.complete_display(self, *args, **opts)
409
410 - def complete_draw(self, *args, **opts):
411 return self.cmd.complete_draw(self, *args, **opts)
412
413 - def complete_generate(self, *args, **opts):
414 return self.cmd.complete_generate(self, *args, **opts)
415
416 - def complete_help(self, *args, **opts):
417 return self.cmd.complete_help(self, *args, **opts)
418
419 - def complete_history(self, *args, **opts):
420 return self.cmd.complete_history(self, *args, **opts)
421
422 - def complete_import(self, *args, **opts):
423 return self.cmd.complete_import(self, *args, **opts)
424
425 - def complete_install(self, *args, **opts):
426 return self.cmd.complete_install(self, *args, **opts)
427
428 - def complete_launch(self, *args, **opts):
429 return self.cmd.complete_launch(self, *args, **opts)
430
431 - def complete_load(self, *args, **opts):
432 return self.cmd.complete_load(self, *args, **opts)
433
434 - def complete_open(self, *args, **opts):
435 return self.cmd.complete_open(self, *args, **opts)
436
437 - def complete_output(self, *args, **opts):
438 return self.cmd.complete_output(self, *args, **opts)
439
440 - def complete_save(self, *args, **opts):
441 return self.cmd.complete_save(self, *args, **opts)
442
443 - def complete_set(self, *args, **opts):
444 return self.cmd.complete_set(self, *args, **opts)
445
446 - def complete_tutorial(self, *args, **opts):
447 return self.cmd.complete_tutorial(self, *args, **opts)
448
449 - def do_switch(self, *args, **opts):
450 """Not in help """ 451 return self.cmd.do_switch(self, *args, **opts)
452
453 - def do_EOF(self, *args, **opts):
454 return self.cmd.do_EOF(self, *args, **opts)
455
456 - def do_define(self, *args, **opts):
457 return self.cmd.do_define(self, *args, **opts)
458
459 - def do_display(self, *args, **opts):
460 return self.cmd.do_display(self, *args, **opts)
461
462 - def do_exit(self, *args, **opts):
463 return self.cmd.do_exit(self, *args, **opts)
464
465 - def do_help(self, *args, **opts):
466 return self.cmd.do_help(self, *args, **opts)
467
468 - def do_history(self, *args, **opts):
469 return self.cmd.do_history(self, *args, **opts)
470
471 - def do_install(self, *args, **opts):
472 self.cmd.do_install(self, *args, **opts)
473
474 - def do_launch(self, line, *argss, **opts):
475 args = cmd.Cmd.split_arg(line) 476 # check if a path is given 477 if len(args) >=1: 478 if os.path.isdir(args[0]): 479 path = os.path.realpath(args[0]) 480 elif os.path.isdir(pjoin(MG5DIR,args[0])): 481 path = pjoin(MG5DIR,args[0]) 482 elif MG4DIR and os.path.isdir(pjoin(MG4DIR,args[0])): 483 path = pjoin(MG4DIR,args[0]) 484 else: 485 path=None 486 # if there is a path, find what output has been done 487 if path: 488 type = self.cmd.find_output_type(self, path) 489 if type in ['standalone', 'standalone_cpp', 'pythia8', 'madevent']: 490 self.change_principal_cmd('MadGraph') 491 elif type == 'aMC@NLO': 492 self.change_principal_cmd('aMC@NLO') 493 elif type == 'MadLoop': 494 self.change_principal_cmd('MadLoop') 495 496 return self.cmd.do_launch(self, line, *argss, **opts)
497
498 - def do_load(self, *args, **opts):
499 return self.cmd.do_load(self, *args, **opts)
500
501 - def do_open(self, *args, **opts):
502 return self.cmd.do_open(self, *args, **opts)
503
504 - def do_quit(self, *args, **opts):
505 return self.cmd.do_quit(self, *args, **opts)
506
507 - def do_save(self, *args, **opts):
508 return self.cmd.do_save(self, *args, **opts)
509
510 - def do_set(self, *args, **opts):
511 return self.cmd.do_set(self, *args, **opts)
512
513 - def do_tutorial(self, *args, **opts):
514 return self.cmd.do_tutorial(self, *args, **opts)
515
516 - def help_EOF(self, *args, **opts):
517 return self.cmd.help_EOF(self, *args, **opts)
518
519 - def help_add(self, *args, **opts):
520 return self.cmd.help_add(self, *args, **opts)
521
522 - def help_check(self, *args, **opts):
523 return self.cmd.help_check(self, *args, **opts)
524
525 - def help_define(self, *args, **opts):
526 return self.cmd.help_define(self, *args, **opts)
527
528 - def help_display(self, *args, **opts):
529 return self.cmd.help_display(self, *args, **opts)
530
531 - def help_generate(self, *args, **opts):
532 return self.cmd.help_generate(self, *args, **opts)
533
534 - def help_help(self, *args, **opts):
535 return self.cmd.help_help(self, *args, **opts)
536
537 - def help_history(self, *args, **opts):
538 return self.cmd.help_history(self, *args, **opts)
539
540 - def help_import(self, *args, **opts):
541 return self.cmd.help_import(self, *args, **opts)
542
543 - def help_install(self, *args, **opts):
544 return self.cmd.help_install(self, *args, **opts)
545
546 - def help_launch(self, *args, **opts):
547 return self.cmd.help_launch(self, *args, **opts)
548
549 - def help_load(self, *args, **opts):
550 return self.cmd.help_load(self, *args, **opts)
551
552 - def help_open(self, *args, **opts):
553 return self.cmd.help_open(self, *args, **opts)
554
555 - def help_output(self, *args, **opts):
556 return self.cmd.help_output(self, *args, **opts)
557
558 - def help_quit(self, *args, **opts):
559 return self.cmd.help_quit(self, *args, **opts)
560
561 - def help_save(self, *args, **opts):
562 return self.cmd.help_save(self, *args, **opts)
563
564 - def help_set(self, *args, **opts):
565 return self.cmd.help_set(self, *args, **opts)
566
567 - def help_tutorial(self, *args, **opts):
568 return self.cmd.help_tutorial(self, *args, **opts)
569
570 - def test_interface(self, *args, **opts):
571 return self.cmd.test_interface(self, *args, **opts)
572
573 - def set_configuration(self, *args, **opts):
574 return self.cmd.set_configuration(self, *args, **opts)
575
576 - def check_customize_model(self, *args, **opts):
577 return self.cmd.check_customize_model(self, *args, **opts)
578
579 - def complete_customize_model(self, *args, **opts):
580 return self.cmd.complete_customize_model(self, *args, **opts)
581
582 - def do_customize_model(self, *args, **opts):
583 return self.cmd.do_customize_model(self, *args, **opts)
584
585 - def help_customize_model(self, *args, **opts):
586 return self.cmd.help_customize_model(self, *args, **opts)
587
588 -class MasterCmd(Switcher, LoopCmd.LoopInterface, amcatnloCmd.aMCatNLOInterface, cmd.CmdShell):
589
590 - def __init__(self, main='MadGraph', *args, **opt):
591 592 # define the interface 593 if main in self.interface_names.keys(): 594 self.prompt= self.interface_names[main][0]+'>' 595 self.cmd= self.interface_names[main][1] 596 self.current_interface=main 597 else: 598 raise MadGraph5Error, 'Type of interface not valid: %s' % main 599 self.cmd.__init__(self, *args, **opt) 600 self.current_interface = main
601
602 - def complete_switch(self, text, line, begidx, endidx):
603 """Complete the switch command""" 604 return self.list_completion(text,self._switch_opts)
605
606 - def do_switch(self, line):
607 """Not in help: Allow to switch to any given interface from command line """ 608 609 args = cmd.Cmd.split_arg(line) 610 if len(args)==1 and args[0] in self.interface_names.keys(): 611 self.change_principal_cmd(args[0]) 612 else: 613 raise self.InvalidCmd("Invalid switch command or non existing interface %s."\ 614 %args[0]+" Valid interfaces are %s"\ 615 %','.join(interface_quick_name.keys()))
616
617 - def change_principal_cmd(self, name, allow_switch=True):
618 619 620 old_cmd=self.current_interface 621 if old_cmd == name: 622 return 623 elif not allow_switch: 624 raise InvalidCmd, "Command not compatible with previous command: Can not combine LO/NLO feature." 625 626 if name in self.interface_names.keys(): 627 self.prompt= self.interface_names[name][0]+'>' 628 self.cmd= self.interface_names[name][1] 629 self.current_interface=name 630 else: 631 raise MadGraph5Error, 'Type of interface not valid: %s' % name 632 633 if self.interface_names[old_cmd][0]!=self.interface_names[name][0]: 634 logger.info("Switching from interface %s to %s"\ 635 %(self.interface_names[old_cmd][0],\ 636 self.interface_names[name][0])) 637 # Setup the interface 638 self.cmd.setup(self) 639 640 if __debug__: 641 self.debug_link_to_command()
642
643 644 -class MasterCmdWeb(MGcmd.MadGraphCmdWeb, Switcher, LoopCmd.LoopInterfaceWeb):
645
646 - def __init__(self, *arg, **opt):
647 648 if os.environ.has_key('_CONDOR_SCRATCH_DIR'): 649 self.writing_dir = pjoin(os.environ['_CONDOR_SCRATCH_DIR'], \ 650 os.path.pardir) 651 else: 652 self.writing_dir = pjoin(os.environ['MADGRAPH_DATA'], 653 os.environ['REMOTE_USER']) 654 655 656 #standard initialization 657 Switcher.__init__(self, mgme_dir = '', *arg, **opt) 658 659 self.options['timeout'] = 1 # time authorize to answer question [0 is no time limit]
660
661 - def change_principal_cmd(self, name):
662 if name == 'MadGraph': 663 self.cmd = MGcmd.MadGraphCmdWeb 664 elif name == 'Loop': 665 self.cmd = LoopCmd.LoopInterfaceWeb 666 else: 667 raise MadGraph5Error, 'Type of interface not valid' 668 669 if __debug__: 670 self.debug_link_to_command()
671
672 - def do_shell(self, *args):
673 raise Exception
674
675 - def finalize(self, nojpeg, flaglist=[]):
676 """Finalize web generation""" 677 678 if flaglist != []: 679 raise Exception 680 self.cmd.finalize(self, nojpeg, online = True)
681
682 - def finalize(self, nojpeg, **opts):
683 """Finalize web generation""" 684 685 opts['online'] = True 686 self.cmd.finalize(self, nojpeg, opts)
687 688 # Generate a new amplitude
689 - def do_generate(self, line):
690 """Generate an amplitude for a given process""" 691 692 try: 693 Switcher.do_generate(self, line) 694 except: 695 # put the stop logo on the web 696 files.cp(self._export_dir+'/HTML/stop.jpg',self._export_dir+'/HTML/card.jpg') 697 raise
698 699 # Add a process to the existing multiprocess definition
700 - def do_add(self, line):
701 """Generate an amplitude for a given process and add to 702 existing amplitudes 703 syntax: 704 """ 705 try: 706 Switcher.do_add(self, line) 707 except: 708 # put the stop logo on the web 709 files.cp(self._export_dir+'/HTML/stop.jpg',self._export_dir+'/HTML/card.jpg') 710 raise
711 712 # Use the cluster file for the configuration
713 - def set_configuration(self, config_path=None, final=False):
714 715 """Force to use the web configuration file only""" 716 config_path = pjoin(os.environ['MADGRAPH_BASE'], 'mg5_configuration.txt') 717 return Switcher.set_configuration(self, config_path=config_path, final=final)
718
719 - def do_save(self, line, check=True, **opt):
720 """Save information to file""" 721 722 if check: 723 self.check_save([]) 724 raise #useless but full security 725 726 args = self.split_arg(line) 727 if args[0] != 'options': 728 Switcher.do_save(self, line,check, opt) 729 else: 730 # put default options since 731 # in the web the local file is not used 732 # in download the default file is more usefull 733 files.cp(pjoin(MG5DIR,'input','mg5_configuration.txt'), args[1])
734
735 - def do_install(self, line):
736 """block all install""" 737 return
738