Package madgraph :: Package interface :: Module amcatnlo_run_interface :: Class aMCatNLOCmd
[hide private]
[frames] | no frames]

Class aMCatNLOCmd

source code

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

The command line processor of MadGraph

Nested Classes [hide private]
  action_switcher

Inherited from CmdExtended: ConfigurationError, InvalidCmd

Inherited from common_run_interface.CommonRunCmd: RunWebHandling

Instance Methods [hide private]
 
__init__(self, me_dir=None, options={}, *completekey, **stdin)
add information to the cmd
source code
 
do_shower(self, line)
run the shower on a given parton level file
source code
 
do_plot(self, line)
Create the plot for a given run
source code
 
do_calculate_xsect(self, line)
Main commands: calculates LO/NLO cross-section, using madevent_mintFO this function wraps the do_launch one
source code
 
do_banner_run(self, line)
Make a run from the banner file
source code
 
do_generate_events(self, line)
Main commands: generate events this function just wraps the do_launch one
source code
 
do_treatcards(self, line, amcatnlo=True, mode='')
Advanced commands: this is for creating the correct run_card.inc from the nlo format
source code
 
set_configuration(self, amcatnlo=True, **opt)
assign all configuration variable from file loop over the different config file if config_file not define
source code
 
do_launch(self, line, options={}, argss=[], switch={})
Main commands: launch the full chain options and args are relevant if the function is called from other functions, such as generate_events or calculate_xsect mode gives the list of switch needed for the computation (usefull for banner_run)
source code
 
do_compile(self, line)
Advanced commands: just compile the executables
source code
 
update_random_seed(self)
Update random number seed with the value from the run_card.
source code
 
run(self, mode, options)
runs aMC@NLO.
source code
 
create_jobs_to_run(self, options, p_dirs, req_acc, run_mode, integration_step, mode, fixed_order=True)
Creates a list of dictionaries with all the jobs to be run
source code
 
prepare_directories(self, jobs_to_run, mode, fixed_order=True)
Set-up the G* directories for running
source code
 
write_input_file(self, job, fixed_order)
write the input file for the madevent_mint* executable in the appropriate directory
source code
 
run_all_jobs(self, jobs_to_run, integration_step, fixed_order=True)
Loops over the jobs_to_run and executes them using the function 'run_exe'
source code
 
collect_the_results(self, options, req_acc, jobs_to_run, jobs_to_collect, integration_step, mode, run_mode, fixed_order=True)
Collect the results, make HTML pages, print the summary and determine if there are more jobs to run.
source code
 
write_nevents_unweighted_file(self, jobs, jobs0events)
writes the nevents_unweighted file in the SubProcesses directory.
source code
 
write_nevts_files(self, jobs)
write the nevts files in the SubProcesses/P*/G*/ directories
source code
 
combine_split_order_run(self, jobs_to_run)
Combines jobs and grids from split jobs that have been run
source code
 
combine_split_order_jobs(self, job_group)
combine the jobs in job_group and return a single summed job
source code
 
combine_split_order_grids(self, job_group)
Combines the mint_grids and MC-integer grids from the split order jobs (fixed order only).
source code
 
split_jobs_fixed_order(self, jobs_to_run, jobs_to_collect)
Looks in the jobs_to_run to see if there is the need to split the jobs, depending on the expected time they take.
source code
 
check_the_need_to_split(self, jobs_to_run, jobs_to_collect)
Looks in the jobs_to_run to see if there is the need to split the event generation step.
source code
 
update_jobs_to_run(self, req_acc, step, jobs, fixed_order=True)
For (N)LO+PS: determines the number of events and/or the required accuracy per job.
source code
 
get_randinit_seed(self)
Get the random number seed from the randinit file
source code
 
append_the_results(self, jobs, integration_step)
Appends the results for each of the jobs in the job list
source code
 
write_res_txt_file(self, jobs, integration_step)
writes the res.txt files in the SubProcess dir
source code
 
collect_scale_pdf_info(self, options, jobs)
read the scale_pdf_dependence.dat files and collects there results
source code
 
combine_plots_FO(self, folder_name, jobs)
combines the plots and puts then in the Events/run* directory
source code
 
combine_FO_lhe(self, jobs)
combine the various lhe file generated in each directory.
source code
 
combine_plots_HwU(self, jobs, out, normalisation=None)
Sums all the plots in the HwU format.
source code
 
applgrid_combine(self, cross, error, jobs)
Combines the APPLgrids in all the SubProcess/P*/all_G*/ directories
source code
 
applgrid_distribute(self, options, mode, p_dirs)
Distributes the APPLgrids ready to be filled by a second run of the code
source code
 
collect_log_files(self, jobs, integration_step)
collect the log files and put them in a single, html-friendly file inside the Events/run_.../ directory
source code
 
finalise_run_FO(self, folder_name, jobs)
Combine the plots and put the res*.txt files in the Events/run.../ folder.
source code
 
setup_cluster_or_multicore(self)
setup the number of cores for multicore, and the cluster-type for cluster runs
source code
 
clean_previous_results(self, options, p_dirs, folder_name)
Clean previous results.
source code
 
print_summary(self, options, step, mode, scale_pdf_info=[], done=True)
print a summary of the results contained in self.cross_sect_dict.
source code
 
archive_files(self, evt_path, mode)
Copies in the Events/Run_<xxx> directory relevant files characterizing the run.
source code
 
compile_advanced_stats(self, log_GV_files, all_log_files, message)
This functions goes through the log files given in arguments and compiles statistics about MadLoop stability, virtual integration optimization and detection of potential error messages into a nice debug message to printed at the end of the run
source code
 
reweight_and_collect_events(self, options, mode, nevents, event_norm)
this function calls the reweighting routines and creates the event file in the Event dir.
source code
 
run_mcatnlo(self, evt_file, options)
runs mcatnlo on the generated event file, to produce showered-events
source code
 
set_run_name(self, name, tag=None, level='parton', reload_card=False)
define the run name, the run_tag, the banner and the results.
source code
 
store_result(self)
tar the pythia results.
source code
 
get_Gdir(self, Pdir=None)
get the list of Gdirectory if not yet saved.
source code
 
get_init_dict(self, evt_file)
reads the info in the init block and returns them in a dictionary
source code
 
banner_to_mcatnlo(self, evt_file)
creates the mcatnlo input script using the values set in the header of the event_file.
source code
 
run_reweight(self, only)
runs the reweight_xsec_events executables on each sub-event file generated to compute on the fly scale and/or PDF uncertainities
source code
 
pdf_scale_from_reweighting(self, evt_files, evt_wghts)
This function takes the files with the scale and pdf values written by the reweight_xsec_events.f code (P*/G*/pdf_scale_dependence.dat) and computes the overall scale and PDF uncertainty (the latter is computed using the Hessian method (if lhaid<90000) or Gaussian (if lhaid>90000)) and returns it in percents.
source code
 
wait_for_complete(self, run_type)
this function waits for jobs on cluster to complete their run.
source code
 
run_all(self, job_dict, arg_list, run_type='monitor', split_jobs=False)
runs the jobs in job_dict (organized as folder: [job_list]), with arguments args
source code
 
check_event_files(self, jobs)
check the integrity of the event files after splitting, and resubmit those which are not nicely terminated
source code
 
find_jobs_to_split(self, pdir, job, arg)
looks into the nevents_unweighed_splitted file to check how many split jobs are needed for this (pdir, job).
source code
 
run_exe(self, exe, args, run_type, cwd=None)
this basic function launch locally/on cluster exe with args as argument.
source code
 
getIO_ajob(self, exe, cwd, args) source code
 
compile(self, mode, options)
compiles aMC@NLO to compute either NLO or NLO matched to shower, as specified in mode
source code
 
donothing(*args) source code
 
check_tests(self, test, dir)
just call the correct parser for the test log.
source code
 
parse_test_mx_log(self, log)
read and parse the test_ME/MC.log file
source code
 
parse_check_poles_log(self, log)
reads and parse the check_poles.log file
source code
 
write_test_input(self, test)
write the input files to run test_ME/MC or check_poles
source code
 
ask_run_configuration(self, mode, options, switch={})
Ask the question when launching generate_events/multi_run
source code

Inherited from CmdExtended: get_history_header, nice_config_error, nice_error_handling, nice_user_error, postcmd, stop_on_keyboard_stop

Inherited from HelpToCmd: help_banner_run, help_calculate_xsect, help_compile, help_generate_events, help_launch, help_open, help_shower, run_options_help

Inherited from CompleteForCmd: complete_banner_run, complete_calculate_xsect, complete_compile, complete_delphes, complete_generate_events, complete_launch, complete_pgs, complete_plot, complete_shower

Inherited from common_run_interface.CommonRunCmd: __del__, add_error_log_in_html, ask_edit_cards, ask_madanalysis5_run_configuration, check_madanalysis5, check_param_card, complete_check_events, complete_compute_widths, complete_decay_events, complete_madanalysis5_hadron, complete_print_results, complete_reweight, complete_systematics, configure_directory, configure_run_mode, copy_lhapdf_set, create_plot, do_EOF, do_check_events, do_compute_widths, do_decay_events, do_delphes, do_exit, do_madanalysis5_hadron, do_open, do_pgs, do_print_results, do_quit, do_reweight, do_set, do_systematics, find_model_name, gen_card_html, generate_Pythia8_HwU_plots, get_Pdir, get_available_tag, get_characteristics, get_lhapdf_libdir, get_lhapdf_pdfsets_list, get_lhapdf_pdfsetsdir, get_lhapdf_version, get_model, get_pdf_input_filename, get_pid_final_initial_states, help_print_result, help_systematics, install_lhapdf_pdfset, keep_cards, link_lhapdf, load_results_db, make_make_all_html_results, post_set, run_hep2lhe, run_madanalysis5, split_arg, store_scan_result, update_make_opts, update_status, write_RunWeb

Inherited from common_run_interface.HelpToCmd: help_compute_widths, help_decay_events, help_delphes, help_pgs, help_plot, help_set, help_treatcards

Inherited from common_run_interface.CheckValidForCmd: check_check_events, check_compute_widths, check_decay_events, check_delphes, check_open, check_set, check_treatcards, get_events_path

Inherited from extended_cmd.Cmd: ask, avoid_history_duplicate, check_answer_in_input_file, check_import, cmdloop, default, define_child_cmd_interface, do_display, do_help, do_history, do_import, do_save, emptyline, error_handling, exec_cmd, get_stored_line, import_command_file, no_notification, onecmd, onecmd_orig, postloop, precmd, preloop, run_cmd, store_line, write_configuration

Inherited from extended_cmd.CheckCmd: check_history, check_save

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

Inherited from extended_cmd.CompleteCmd: complete_display, complete_history, complete_save

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 CheckValidForCmd: check_banner_run, check_calculate_xsect, check_compile, check_generate_events, check_launch, check_pgs, check_plot, check_shower

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

Static Methods [hide private]

Inherited from common_run_interface.CommonRunCmd: ask_edit_card_static, detect_card_type, find_available_run_name, get_MadAnalysis5_interpreter, get_lhapdf_pdfsets_list_static, install_lhapdf_pdfset_static, runMA5, static_check_param_card, static_compute_widths, update_make_opts_full, writeRunWeb

Inherited from extended_cmd.Cmd: timed_input

Inherited from extended_cmd.BasicCmd: list_completion, path_completion

Class Variables [hide private]
  true = ['T', '.true.', True, 'true']
  _run_options = ['--cluster', '--multicore', '--nb_core=', '--n...
  _generate_options = ['-f', '--laststep=parton', '--laststep=py...
  _calculate_decay_options = ['-f', '--accuracy=0.']
  _set_options = ['stdout_level', 'fortran_compiler', 'cpp_compi...
  _plot_mode = ['all', 'parton', 'shower', 'pgs', 'delphes']
  _clean_mode = ['all', 'parton', 'shower', 'pgs', 'delphes', 'c...
  _display_opts = ['run_name', 'options', 'variable']
  web = False
  cluster_mode = 0
  queue = 'madgraph'
  nb_core = None
hash(x)
  make_opts_var = {}
  next_possibility = {'generate_events': ['generate_events [OPTI...

Inherited from CmdExtended: config_debug, debug_output, error_debug, keyboard_stop_msg

Inherited from common_run_interface.CommonRunCmd: helporder, options_configuration, options_madevent, options_madgraph, sleep_for_error

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, me_dir=None, options={}, *completekey, **stdin)
(Constructor)

source code 

add information to the cmd

Overrides: object.__init__

do_treatcards(self, line, amcatnlo=True, mode='')

source code 

Advanced commands: this is for creating the correct run_card.inc from the nlo format

Overrides: common_run_interface.CommonRunCmd.do_treatcards

set_configuration(self, amcatnlo=True, **opt)

source code 

assign all configuration variable from file loop over the different config file if config_file not define

Overrides: common_run_interface.CommonRunCmd.set_configuration

update_random_seed(self)

source code 

Update random number seed with the value from the run_card. If this is 0, update the number according to a fresh one

run(self, mode, options)

source code 

runs aMC@NLO. Returns the name of the event file created

collect_the_results(self, options, req_acc, jobs_to_run, jobs_to_collect, integration_step, mode, run_mode, fixed_order=True)

source code 

Collect the results, make HTML pages, print the summary and determine if there are more jobs to run. Returns the list of the jobs that still need to be run, as well as the complete list of jobs that need to be collected to get the final answer.

write_nevents_unweighted_file(self, jobs, jobs0events)

source code 

writes the nevents_unweighted file in the SubProcesses directory. We also need to write the jobs that will generate 0 events, because that makes sure that the cross section from those channels is taken into account in the event weights (by collect_events.f).

split_jobs_fixed_order(self, jobs_to_run, jobs_to_collect)

source code 

Looks in the jobs_to_run to see if there is the need to split the jobs, depending on the expected time they take. Updates jobs_to_run and jobs_to_collect to replace the split-job by its splits.

check_the_need_to_split(self, jobs_to_run, jobs_to_collect)

source code 

Looks in the jobs_to_run to see if there is the need to split the event generation step. Updates jobs_to_run and jobs_to_collect to replace the split-job by its splits. Also removes jobs that do not need any events.

update_jobs_to_run(self, req_acc, step, jobs, fixed_order=True)

source code 

For (N)LO+PS:    determines the number of events and/or the required
                 accuracy per job.
For fixed order: determines which jobs need higher precision and
                 returns those with the newly requested precision.

combine_FO_lhe(self, jobs)

source code 

combine the various lhe file generated in each directory. They are two steps: 1) banner 2) reweight each sample by the factor written at the end of each file 3) concatenate each of the new files (gzip those).

clean_previous_results(self, options, p_dirs, folder_name)

source code 

Clean previous results. o. If doing only the reweighting step, do not delete anything and return directlty. o. Always remove all the G*_* files (from split event generation). o. Remove the G* (or born_G* or all_G*) only when NOT doing only_generation or reweight_only.

print_summary(self, options, step, mode, scale_pdf_info=[], done=True)

source code 

print a summary of the results contained in self.cross_sect_dict. step corresponds to the mintMC step, if =2 (i.e. after event generation) some additional infos are printed

reweight_and_collect_events(self, options, mode, nevents, event_norm)

source code 

this function calls the reweighting routines and creates the event file in the Event dir. Return the name of the event file created

store_result(self)

source code 

tar the pythia results. This is done when we are quite sure that the pythia output will not be use anymore

Overrides: common_run_interface.CommonRunCmd.store_result

banner_to_mcatnlo(self, evt_file)

source code 

creates the mcatnlo input script using the values set in the header of the event_file. It also checks if the lhapdf library is used

pdf_scale_from_reweighting(self, evt_files, evt_wghts)

source code 

This function takes the files with the scale and pdf values written by the reweight_xsec_events.f code (P*/G*/pdf_scale_dependence.dat) and computes the overall scale and PDF uncertainty (the latter is computed using the Hessian method (if lhaid<90000) or Gaussian (if lhaid>90000)) and returns it in percents. The expected format of the file is: n_scales xsec_scale_central xsec_scale1 ... n_pdf xsec_pdf0 xsec_pdf1 ....

find_jobs_to_split(self, pdir, job, arg)

source code 

looks into the nevents_unweighed_splitted file to check how many split jobs are needed for this (pdir, job). arg is F, B or V

compile(self, mode, options)

source code 

compiles aMC@NLO to compute either NLO or NLO matched to shower, as specified in mode

Overrides: extended_cmd.Cmd.compile

check_tests(self, test, dir)

source code 

just call the correct parser for the test log. Skip check_poles for LOonly folders


Class Variable Details [hide private]

_run_options

Value:
['--cluster', '--multicore', '--nb_core=', '--nb_core=2', '-c', '-m']

_generate_options

Value:
['-f',
 '--laststep=parton',
 '--laststep=pythia',
 '--laststep=pgs',
 '--laststep=delphes']

_set_options

Value:
['stdout_level', 'fortran_compiler', 'cpp_compiler', 'timeout']

_clean_mode

Value:
['all', 'parton', 'shower', 'pgs', 'delphes', 'channel', 'banner']

next_possibility

Value:
{'generate_events': ['generate_events [OPTIONS]', 'shower'],
 'launch': ['launch [OPTIONS]', 'shower'],
 'shower': ['generate_events [OPTIONS]'],
 'start': ['generate_events [OPTIONS]',
           'calculate_crossx [OPTIONS]',
           'launch [OPTIONS]',
           'help generate_events']}