contur.run package

Top level module for running contur. Submodules accessed directly from executable scripts.

Submodules

contur.run.run_analysis module

Main module for running Contur on a single YODA file or a parameter grid of YODA files

contur.run.run_analysis.analyse_grid(scan_paths, conturDepot, args)[source]

perform the analysis on a grid (called by process_grid) and store results in the depot

scan_paths should be a list of directories with results for a given beam.

contur.run.run_analysis.doc_argparser()[source]

wrap the arg parser for the documentation pages

contur.run.run_analysis.func(beam, scan_dirs, mergedDirs, depots, args)[source]

Build a depot for a single beam and add it to the depots dict.

contur.run.run_analysis.main(args)[source]

Main programme to run contur analysis on a grid of YODA files, a single YODA, or a YODA stream. arguments should be passed as a dictionary.

contur.run.run_analysis.process_grid(args, poolid=None, mergedDirs=[])[source]

Process the grid, creating a depot and calling analyse_grid for each beam.

contur.run.run_batch_submit module

Main module for building and submitting event generator jobs to a batch farm based on a parameter grid.

contur.run.run_batch_submit.batch_submit(args)[source]

Build event generator jobs for a parameter scan and submit shell scripts to batch args should be a dictionary

if “–single” is set, just make one directory with the required files, using the first parameter point in param_file.dat

contur.run.run_batch_submit.doc_argparser()[source]

wrap the arg parser for the documentation pages

contur.run.run_batch_submit.env_setup(setup_script, directory_path)[source]

return the command need to setup the generic (ie not generator specific) runtime environment.

contur.run.run_batch_submit.gen_analyse_batch_command(grid_name, directory_name, args, setup_commands, job_counter)[source]

Generate commands to write to batch file for a grid analysis job.

Parameters:
  • grid_name – the (relative) name of the directory containing the grid.

  • directory_name – the (relative) name of the output directory

  • args – command line arguments.

  • setup_commands – the commands read from the param file to set up the genertor. If not present, may be taken from the environment.

  • job_counter – integer just keeping track of how many jobs in this run.

contur.run.run_batch_submit.gen_batch_command(directory_name, directory_path, args, setup_commands, runbeam)[source]

Generate the shell commands to write to the batch file for submitting an event generation job

A script can be invoked to set up the general runtime environment for each job. This may not be necessary, but is taken from the following sources (in order of precedence). (1) setup script command line argument (2) line from param_file.dat (3) INSTDIR environment variable with a name guess of setupEnv.sh

The key contur environment variables will be taken from the current runtime environment. (see set_current_env) unless specified in param_file.dat

Parameters:
  • directory_name – name of the directory (without any path) in the which batch job will run (usual 4 integers eg 0123

  • directory_path – full, absolute path to the directory in which the batch job will run.

  • args – command line arugments

  • setup_commands – the commands read from the param file to set up the genertor. If not present, may be taken from the environment.

  • runbeam – the collider beam being run.

Returns:

batch_command, batch_filename, job_description_content[=None], job_description_filename[=None]

contur.run.run_batch_submit.gen_submit_command(queue, walltime=None, memory=None)[source]

Generate the appropriate batch submission command. :param queue: the queue or partition name to submit to.

contur.run.run_batch_submit.get_valid_job_lists(grid_name, num_points)[source]

find the valid yoda files in a given grid and return the as a List strings, with each string contain up to num_points file names of the same beam type.

contur.run.run_batch_submit.set_current_env()[source]

return a script (string) which set the important environment variable from the current setup.

contur.run.run_grid_tools module

Perform various manipulations on an existing contur scan grid or grids, but NOT the actual contur statistical analysis.

contur.run.run_grid_tools.doc_argparser()[source]

wrap the arg parser for the documentation pages

contur.run.run_grid_tools.main(args)[source]

arguments should be passed as a dictionary.

contur.run.run_plot module

Making plots (heatmap etc) out of database

contur.run.run_plot.doc_argparser()[source]

wrap the arg parser for the documentation pages

contur.run.run_plot.load_external_function(file_name)[source]

Load exteral functions for plotting additonal contours, from command line.

Parameters:

file_name – the name of the file containing the functions, with or without a .py extension. can be specified with a (rel or abs) path, otherwise with be assumed to be in the current working directory.

contur.run.run_plot.main(args)[source]

Main method Executable to make contur/contour plots from database files. args should be a dictionary

contur.run.run_init module

contur.run.run_init.debug(msg)[source]
contur.run.run_init.generate_rivet_lists(webpages)[source]

Generate various rivet analysis listings from the Contur database. Called on initialisation only.

  • the .ana files for Herwig running

  • the script to set the analysis list environment variables

  • (optionally) the contur webpage listings.

Parameters:

webpages – if true, also write out the contur webpage listings.

contur.run.run_init.log(msg, v)[source]
contur.run.run_init.main(args)[source]

Main programme to run over the known analysis and build SM theory yodas from the TheoryRaw or REF areas.

contur.run.run_init.warning(msg)[source]

contur.run.run_mkthy module

contur.run.run_mkthy.main(args)[source]

Main programme to run over the known analysis and build SM theory yodas from the TheoryRaw or REF areas.

contur.run.run_mkthy.make_sm_yoda(analysis)[source]

Make the SM yoda file for analysis

This is a pretty clunky and bespoke set of scripts because it has to handle data from a very varied set of sources. From these sources it produces standard SM prediction files to be stored in data/Theory

If source == “REF”, will look for additonal y axes on the REF plots (labelled y02 by default, others from axis parameter)

and replace them to convert into y01 /THY versions. Filters out analysis objects which are not assigned to an analysis pool.

if source == “RAW” will look in the TheoryRaw areas for /THY/ yodas and just filter them.

if source == “HEPDATA” will look in the TheoryRaw area for a (possibly modified) HEPDATA download where the y-axis name

should be replace y-axis of the REF histogram name

if source == “HEPDATA_APPEND” will look in the TheoryRaw area for a (possibly modified) HEPDATA download where the y-axis name

should be appended to the REF histogram name

if source == “SPECIAL” invoke a special routine for this analysis (usually reading from

text files supplied by theorists).

the above will only be applied to histograms with a regexp match to the pattern.

contur.run.run_mkbib module

contur.run.run_mkbib.main(args)[source]

Main programme to build the bibliography for the web pages. args should be a dictionary

contur.run.run_mkbib.sanitise_pool_description(text)[source]

contur.run.run_smtest module

contur.run.run_smtest.doc_argparser()[source]

wrap the arg parser for the documentation pages

contur.run.run_smtest.fake_thy_paths(ana, aos)[source]

make thy paths read from a file look like generated signal yoda paths for analysis ana.

contur.run.run_smtest.main(args)[source]

arguments should be passed as a dictionary.

contur.run.run_extract_xs_bf module

contur.run.run_extract_xs_bf.main(args)[source]
contur.run.run_extract_xs_bf.run_extract_xs_bf(args, input_dir=None, outfile=None)[source]

Extract various requested cross sections and branching ratios from from Herwig out files. args should be a dictionary.

contur.run.arg_utils module

contur.run.arg_utils.add_analysis_selection(parser)[source]
contur.run.arg_utils.add_batch(parser)[source]
contur.run.arg_utils.add_data_selection(parser)[source]
contur.run.arg_utils.add_dressing(parser)[source]
contur.run.arg_utils.add_generic(parser)[source]
contur.run.arg_utils.add_grid_info(parser, default=None)[source]
contur.run.arg_utils.add_html(parser)[source]
contur.run.arg_utils.add_outputdir(parser, default=None)[source]
contur.run.arg_utils.add_plotting(parser)[source]
contur.run.arg_utils.add_stats(parser)[source]
contur.run.arg_utils.add_tools(parser)[source]
contur.run.arg_utils.get_argparser(arg_group)[source]

Build and return an argument parser

Parameters:

arg_groups – which argument groups will be used.

The arg_group corresponds one-to-one to the run_XXX.py modules. It picks out the relevant subset of arguments to add.

  • group analysis for running analysis on a grid or a single yoda file

  • group batch_submit for running evgen batch jobs

  • group extract_xs_bf for extracting cross sections and branching fractions from a single yoda

  • group scan_xs_bf for extracting and plotting cross sections and branching fractions from a grid

  • group scan_xs_bf_alt for extracting and plotting cross sections and branching fractions from a grid with an alternative tool

  • group grid_tool for running grid utilities

  • group init initialisation

  • group mkbib for making bib html pages

  • group mkhtml for making rivet plot html pages

  • group mkthy for making theory yodas

  • group plot for plotting map file

  • group smtest for running statistical tests on SM theory

contur.run.arg_utils.get_args(argv, arg_group='unknown argument group')[source]

Parse command line arguments

contur.run.arg_utils.setup_batch(args)[source]

setup up the configuration parameters for the batch arguments/flags

contur.run.arg_utils.setup_common(args)[source]

Set up the configuration parameters for the common arguments/flags. If printVersion is set, do this and exit

contur.run.arg_utils.setup_selection(args, modeMessage)[source]
contur.run.arg_utils.setup_stats(args, message)[source]

setup the parameters for the stats argument group

contur.run.arg_utils.valid_batch_arguments(args)[source]

Check that command line arguments are valid; return True or False. This function is also responsible for formatting some arguments e.g. converting the RunInfo path to an absolute path and checking it contains .ana files. valid_args = True

contur.run.arg_utils.valid_beam_arg(args)[source]

Checks the arguments for what beams are selected and return them in a list. Returns None if the selection is isvalid.

contur.run.arg_utils.valid_mceg_arg(args)[source]

Checks the arguments for what mceg is selected, and set cfg.mceg Returns False if the selection is isvalid.

Module contents