Package madgraph :: Package interface :: Module madgraph_interface :: Class MadGraphCmd
[hide private]
[frames] | no frames]

Class MadGraphCmd

source code

                      object --+        
                               |        
            extended_cmd.HelpCmd --+    
                                   |    
                           HelpToCmd --+
                                       |
                      object --+       |
                               |       |
           extended_cmd.CheckCmd --+   |
                                   |   |
                    CheckValidForCmd --+
                                       |
                      object --+       |
                               |       |
        extended_cmd.CompleteCmd --+   |
                                   |   |
                      CompleteForCmd --+
                                       |
                  object --+           |
                           |           |
       extended_cmd.CheckCmd --+       |
                               |       |
                  object --+   |       |
                           |   |       |
        extended_cmd.HelpCmd --+       |
                               |       |
                  object --+   |       |
                           |   |       |
    extended_cmd.CompleteCmd --+       |
                               |       |
              object --+       |       |
                       |       |       |
extended_cmd.OriginalCmd --+   |       |
                           |   |       |
       extended_cmd.BasicCmd --+       |
                               |       |
                extended_cmd.Cmd --+   |
                                   |   |
                         CmdExtended --+
                                       |
                                      MadGraphCmd
Known Subclasses:

The command line processor of MadGraph

Nested Classes [hide private]

Inherited from CheckValidForCmd: RWError

Inherited from CmdExtended: ConfigurationError, InvalidCmd

Instance Methods [hide private]
 
__init__(self, mgme_dir='', *completekey, **stdin)
add a tracker of the history
source code
 
add_default_multiparticles(self)
add default particle from file interface.multiparticles_default.txt
source code
 
add_model(self, args)
merge two model
source code
 
advanced_install(self, tool_to_install, HepToolsInstaller_web_address=None, additional_options=[])
Uses the HEPToolsInstaller.py script maintened online to install HEP tools with more complicated dependences.
source code
 
check_for_export_dir(self, filepath)
Check if the files is in a valid export directory and assign it to export path if if is
source code
 
clean_process(self)
ensure that all processes are cleaned from memory.
source code
 
compute_widths_SMWidth(self, line, model=None)
Compute widths with SMWidth.
source code
 
create_loop_induced(self, line, myprocdef=None)
Routine to create the MultiProcess for the loop-induced case
source code
 
do_add(self, line)
Generate an amplitude for a given process and add to existing amplitudes or merge two model
source code
 
do_check(self, line)
Check a given process or set of processes
source code
 
do_compute_widths(self, line, model=None, do2body=True, decaymodel=None)
Documented commands:Generate amplitudes for decay width calculation, with fixed number of final particles (called level) syntax; compute_widths particle [other particles] [--options=]
source code
 
do_customize_model(self, line)
create a restriction card in a interactive way
source code
 
do_decay_diagram(self, line, skip_2body=False, model=None)
Not in help: Generate amplitudes for decay width calculation, with fixed number of final particles (called level) syntax; decay_diagram part_name level param_path args; part_name level param_path part_name = name of the particle you want to calculate width level = a.) when level is int, it means the max number of decay products b.) when level is float, it means the required precision for width.
source code
 
do_define(self, line, log=True)
Define a multiparticle
source code
 
do_display(self, line, output=sys.stdout)
Display current internal status
source code
 
do_generate(self, line)
Main commands: Generate an amplitude for a given process
source code
 
do_help(self, line)
propose some usefull possible action
source code
 
do_import(self, line, force=False)
Main commands: Import files with external formats
source code
 
do_install(self, line, paths=None, additional_options=[])
Install optional package from the MG suite.
source code
 
do_launch(self, line)
Main commands: Ask for editing the parameter and then Execute the code (madevent/standalone/...)
source code
 
do_load(self, line)
Not in help: Load information from file
source code
 
do_open(self, line)
Open a text file/ eps file / html file
source code
 
do_output(self, line)
Main commands: Initialize a new Template or reinitialize one
source code
 
do_quit(self, line)
Not in help: Do quit
source code
 
do_save(self, line, check=True, to_keep={}, log=True)
Not in help: Save information to file
source code
 
do_set(self, line, log=True, model_reload=True)
Set an option, which will be default for coming generations/outputs.
source code
 
do_tutorial(self, line)
Activate/deactivate the tutorial mode.
source code
 
draw(self, line, selection='all', Dtype='')
draw the Feynman diagram for the given process.
source code
 
export(self, nojpeg=False, main_file_name='', group_processes=True, args=[])
Export a generated amplitude to file.
source code
 
extract_decay_chain_process(self, line, level_down=False, proc_number=0)
Recursively extract a decay chain process definition from a string.
source code
 
extract_particle_ids(self, args)
Extract particle ids from a list of particle names.
source code
 
extract_process(self, line, proc_number=0, overall_orders={})
Extract a process definition from a string.
source code
 
finalize(self, nojpeg, online=False, flaglist=[])
Make the html output, write proc_card_mg5.dat and create madevent.tar.gz for a MadEvent directory
source code
 
get_final_part(self, procline)
Takes a valid process and return a set of id of final states particles.
source code
 
import_mg4_proc_card(self, filepath)
read a V4 proc card, convert it and run it in mg5
source code
 
import_ufo_model(self, model_name)
import the UFO model
source code
 
install_update(self, args, wget)
check if the current version of mg5 is up-to-date.
source code
 
multiparticle_string(self, key)
Returns a nicely formatted string for the multiparticle
source code
 
optimize_order(self, pdg_list)
Optimize the order of particles in a pdg list, so that similar particles are next to each other.
source code
 
post_set(self, stop, line)
Check if we need to save this in the option file
source code
 
preloop(self)
Initializing before starting the main loop
source code
 
process_model(self)
Set variables _particle_names and _couplings for tab completion, define multiparticles
source code
 
remove_pointless_decay(self, param_card)
For simple decay chain: remove diagram that are not in the BR.
source code
 
set_configuration(self, config_path=None, final=True)
assign all configuration variable from file ./input/mg5_configuration.txt.
source code
 
setup(self)
Actions to carry when switching to this interface
source code

Inherited from HelpToCmd: help_add, help_check, help_compute_widths, help_customize_model, help_decay_diagram, help_define, help_display, help_generate, help_import, help_install, help_launch, help_load, help_open, help_output, help_save, help_set, help_tutorial

Inherited from CheckValidForCmd: check_add, check_check, check_compute_widths, check_customize_model, check_decay_diagram, check_define, check_display, check_draw, check_generate, check_import, check_install, check_launch, check_load, check_open, check_output, check_process_format, check_save, check_set, check_tutorial, find_import_type, find_output_type, get_default_path

Inherited from CompleteForCmd: aloha_complete_output, complete_add, complete_check, complete_compute_widths, complete_customize_model, complete_decay_diagram, complete_define, complete_display, complete_draw, complete_generate, complete_import, complete_install, complete_launch, complete_load, complete_open, complete_output, complete_save, complete_set, complete_tutorial, find_restrict_card, model_completion, nlo_completion

Inherited from CmdExtended: default, get_history_header, postcmd

Inherited from extended_cmd.Cmd: ask, avoid_history_duplicate, check_answer_in_input_file, cmdloop, compile, define_child_cmd_interface, do_EOF, do_exit, do_history, emptyline, error_handling, exec_cmd, get_stored_line, import_command_file, nice_config_error, nice_error_handling, nice_user_error, no_notification, onecmd, onecmd_orig, postloop, precmd, run_cmd, stop_on_keyboard_stop, store_line, write_configuration

Inherited from extended_cmd.CheckCmd: check_history

Inherited from extended_cmd.HelpCmd: help_EOF, help_help, help_history, help_quit

Inherited from extended_cmd.CompleteCmd: complete_history

Inherited from extended_cmd.BasicCmd: complete, deal_multiple_categories, getTerminalSize, print_suggestions, set_readline_completion_display_matches_hook

Inherited from extended_cmd.OriginalCmd: columnize, complete_help, completedefault, completenames, get_names, parseline, print_topics

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
split_process_line(procline)
Takes a valid process and return a tuple (core_process, options).
source code

Inherited from extended_cmd.Cmd: timed_input

Inherited from extended_cmd.BasicCmd: list_completion, path_completion, split_arg

Class Variables [hide private]
  _OLP_supported = ['MadLoop', 'GoSam']
  _add_opts = ['process', 'model']
  _advanced_install_opts = ['pythia8', 'zlib', 'boost', 'lhapdf6...
  _check_opts = ['full', 'timing', 'stability', 'profile', 'perm...
  _curr_amps = []
  _curr_decaymodel = None
hash(x)
  _curr_exporter = None
hash(x)
  _curr_helas_model = None
hash(x)
  _curr_matrix_elements = ...
  _curr_model = None
hash(x)
  _curr_proc_defs = []
  _display_opts = ['particles', 'interactions', 'processes', 'di...
  _done_export = False
  _export_formats = ['madevent', 'standalone', 'standalone_msP',...
  _import_formats = ['model_v4', 'model', 'proc_v4', 'command', ...
  _install_opts = ['Delphes', 'MadAnalysis4', 'ExRootAnalysis', ...
  _output_dependencies_supported = ['external', 'internal', 'env...
  _save_opts = ['model', 'processes', 'options']
  _set_options = ['group_subprocesses', 'ignore_six_quark_proces...
  _switch_opts = ['mg5', 'aMC@NLO', 'ML5']
  _tutorial_opts = ['aMCatNLO', 'stop', 'MadLoop', 'MadGraph5']
  _v4_export_formats = ['madevent', 'standalone', 'standalone_ms...
  _valid_amp_so_types = ['=', '<=', '==', '>']
  _valid_nlo_modes = ['all', 'real', 'virt', 'sqrvirt', 'tree', ...
  _valid_sqso_types = ['==', '<=', '=', '>']
  helporder = ['Main commands', 'Documented commands']
  install_ad = {'Delphes': ['arXiv:1307.6346'], 'Delphes2': ['ar...
  install_name = {'Delphes2': 'Delphes', 'Delphes3': 'Delphes', ...
  install_plugin = ['maddm', 'maddump']
  install_server = ['http://madgraph.phys.ucl.ac.be/package_info...
  options_configuration = {'OLP': 'MadLoop', 'amcfast': 'amcfast...
  options_madevent = {'automatic_html_opening': True, 'nb_core':...
  options_madgraph = {'complex_mass_scheme': False, 'default_uns...
  writing_dir = '.'

Inherited from CompleteForCmd (private): _online_model, _online_model2

Inherited from CmdExtended: config_debug, debug_output, error_debug, intro_banner, keyboard_stop_msg, next_possibility

Inherited from extended_cmd.Cmd: PluginCandidate, allow_notification_center, dirlist, history_header, onedir, plugin_path

Inherited from extended_cmd.OriginalCmd: doc_header, doc_leader, identchars, intro, lastcmd, misc_header, nohelp, prompt, ruler, undoc_header, use_rawinput

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, mgme_dir='', *completekey, **stdin)
(Constructor)

source code 

add a tracker of the history

Overrides: object.__init__

advanced_install(self, tool_to_install, HepToolsInstaller_web_address=None, additional_options=[])

source code 

Uses the HEPToolsInstaller.py script maintened online to install HEP tools with more complicated dependences. Additional options will be added to the list when calling HEPInstaller

clean_process(self)

source code 

ensure that all processes are cleaned from memory. typically called from import model and generate XXX command

do_compute_widths(self, line, model=None, do2body=True, decaymodel=None)

source code 
Documented commands:Generate amplitudes for decay width calculation, with fixed
number of final particles (called level)
syntax; compute_widths particle [other particles] [--options=]

 - particle/other particles can also be multiparticle name (can also be
pid of the particle)

--body_decay=X [default=4.0025] allow to choose the precision.
     if X is an integer: compute all X body decay
     if X is a float <1: compute up to the time that total error < X
     if X is a float >1: stops at the first condition.

--path=X. Use a given file for the param_card. (default UFO built-in)

special argument:
    - skip_2body: allow to not consider those decay (use FR)
    - model: use the model pass in argument.

do_decay_diagram(self, line, skip_2body=False, model=None)

source code 
Not in help: Generate amplitudes for decay width calculation, with fixed
number of final particles (called level)
syntax; decay_diagram part_name level param_path
args; part_name level param_path
part_name = name of the particle you want to calculate width
level = a.) when level is int,
            it means the max number of decay products
        b.) when level is float,
            it means the required precision for width.
param_path = path for param_card
(this is necessary to determine whether a channel is onshell or not)
e.g. calculate width for higgs up to 2-body decays.
calculate_width h 2 [path]
N.B. param_card must be given so that the program knows which channel
is on shell and which is not.

special argument:
    - skip_2body: allow to not consider those decay (use FR)
    - model: use the model pass in argument.

do_display(self, line, output=sys.stdout)

source code 

Display current internal status

Overrides: extended_cmd.Cmd.do_display

do_help(self, line)

source code 

propose some usefull possible action

Overrides: extended_cmd.OriginalCmd.do_help

do_import(self, line, force=False)

source code 

Main commands: Import files with external formats

Overrides: extended_cmd.Cmd.do_import

do_install(self, line, paths=None, additional_options=[])

source code 

Install optional package from the MG suite. The argument 'additional_options' will be passed to the advanced_install functions. If it contains the option '--force', then the advanced_install function will overwrite any existing installation of the tool without warnings.

do_quit(self, line)

source code 

Not in help: Do quit

Overrides: extended_cmd.Cmd.do_quit

do_save(self, line, check=True, to_keep={}, log=True)

source code 

Not in help: Save information to file

Overrides: extended_cmd.Cmd.do_save

draw(self, line, selection='all', Dtype='')

source code 

draw the Feynman diagram for the given process. Dtype refers to born, real or loop

extract_decay_chain_process(self, line, level_down=False, proc_number=0)

source code 

Recursively extract a decay chain process definition from a string. Returns a ProcessDefinition.

extract_particle_ids(self, args)

source code 

Extract particle ids from a list of particle names. If there are | in the list, this corresponds to an or-list, which is represented as a list of id lists. An or-list is used to allow multiple required s-channel propagators to be specified (e.g. Z/gamma).

extract_process(self, line, proc_number=0, overall_orders={})

source code 

Extract a process definition from a string. Returns a ProcessDefinition.

get_final_part(self, procline)

source code 

Takes a valid process and return a set of id of final states particles. [Used by MadSpin]

install_update(self, args, wget)

source code 

check if the current version of mg5 is up-to-date. and allow user to install the latest version of MG5

optimize_order(self, pdg_list)

source code 
Optimize the order of particles in a pdg list, so that
similar particles are next to each other. Sort according to:
1. pdg > 0, 2. spin, 3. color, 4. mass > 0

preloop(self)

source code 

Initializing before starting the main loop

Overrides: extended_cmd.OriginalCmd.preloop

remove_pointless_decay(self, param_card)

source code 

For simple decay chain: remove diagram that are not in the BR. param_card should be a ParamCard instance.

set_configuration(self, config_path=None, final=True)

source code 

assign all configuration variable from file ./input/mg5_configuration.txt. assign to default if not define

split_process_line(procline)
Static Method

source code 

Takes a valid process and return a tuple (core_process, options). This removes

  • any NLO specifications.
  • any options

[Used by MadSpin]


Class Variable Details [hide private]

_advanced_install_opts

Value:
['pythia8',
 'zlib',
 'boost',
 'lhapdf6',
 'lhapdf5',
 'collier',
 'hepmc',
 'mg5amc_py8_interface',
...

_check_opts

Value:
['full',
 'timing',
 'stability',
 'profile',
 'permutation',
 'gauge',
 'lorentz',
 'brs',
...

_curr_matrix_elements

Value:
{
    'matrix_elements': []
}

_display_opts

Value:
['particles',
 'interactions',
 'processes',
 'diagrams',
 'diagrams_text',
 'multiparticles',
 'couplings',
 'lorentz',
...

_export_formats

Value:
['madevent',
 'standalone',
 'standalone_msP',
 'standalone_msF',
 'matrix',
 'standalone_rw',
 'madweight',
 'standalone_cpp',
...

_import_formats

Value:
['model_v4', 'model', 'proc_v4', 'command', 'banner']

_install_opts

Value:
['Delphes',
 'MadAnalysis4',
 'ExRootAnalysis',
 'update',
 'Golem95',
 'PJFry',
 'QCDLoop',
 'maddm',
...

_output_dependencies_supported

Value:
['external', 'internal', 'environment_paths']

_set_options

Value:
['group_subprocesses',
 'ignore_six_quark_processes',
 'stdout_level',
 'fortran_compiler',
 'cpp_compiler',
 'loop_optimized_output',
 'complex_mass_scheme',
 'include_lepton_initiated_processes',
...

_v4_export_formats

Value:
['madevent',
 'standalone',
 'standalone_msP',
 'standalone_msF',
 'matrix',
 'standalone_rw',
 'madweight']

_valid_nlo_modes

Value:
['all', 'real', 'virt', 'sqrvirt', 'tree', 'noborn', 'LOonly']

install_ad

Value:
{'Delphes': ['arXiv:1307.6346'],
 'Delphes2': ['arXiv:0903.2225'],
 'Golem95': ['arXiv:0807.0605'],
 'MadAnalysis': ['arXiv:1206.1599'],
 'MadAnalysis5': ['arXiv:1206.1599'],
 'PJFry': ['arXiv:1210.4095', 'arXiv:1112.0500'],
 'QCDLoop': ['arXiv:0712.1851'],
 'SysCalc': ['arXiv:1801.08401'],
...

install_name

Value:
{'Delphes2': 'Delphes',
 'Delphes3': 'Delphes',
 'ExRootAnalysis': 'ExRootAnalysis',
 'Golem95': 'golem95',
 'MadAnalysis': 'madanalysis5',
 'MadAnalysis4': 'MadAnalysis',
 'MadAnalysis5': 'madanalysis5',
 'PJFry': 'PJFry',
...

install_server

Value:
['http://madgraph.phys.ucl.ac.be/package_info.dat',
 'http://madgraph.physics.illinois.edu/package_info.dat']

options_configuration

Value:
{'OLP': 'MadLoop',
 'amcfast': 'amcfast-config',
 'applgrid': 'applgrid-config',
 'auto_update': 7,
 'cluster_local_path': None,
 'cluster_nb_retry': 1,
 'cluster_queue': None,
 'cluster_retry_wait': 300,
...

options_madevent

Value:
{'automatic_html_opening': True,
 'nb_core': None,
 'notification_center': True,
 'run_mode': 2}

options_madgraph

Value:
{'complex_mass_scheme': False,
 'default_unset_couplings': 99,
 'gauge': 'unitary',
 'group_subprocesses': 'Auto',
 'ignore_six_quark_processes': False,
 'include_lepton_initiated_processes': False,
 'loop_color_flows': False,
 'loop_optimized_output': True,
...