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.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_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_grid_tools module
Perform various manipulations on an existing contur scan grid or grids, but NOT the actual contur statistical analysis.
contur.run.run_plot module
Making plots (heatmap etc) out of database
- 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_init module
- 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_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_smtest module
contur.run.run_extract_xs_bf module
contur.run.arg_utils module
- 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_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