![]() |
ATLAS Offline Software
|
Functions | |
def | stack_subprocess (command, **kwargs) |
def | setup_path_protection () |
def | config_only_check () |
def | generate_prep (process_dir) |
def | error_check (errors_a, return_code) |
def | write_test_script () |
def | new_process (process='generate p p > t t~\noutput -f', plugin=None, keepJpegs=False, usePMGSettings=False) |
def | get_default_runcard (process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | generate (process_dir='PROC_mssm_0', grid_pack=False, gridpack_compile=False, extlhapath=None, required_accuracy=0.01, runArgs=None, bias_module=None, requirePMGSettings=False) |
def | generate_from_gridpack (runArgs=None, extlhapath=None, gridpack_compile=None, requirePMGSettings=False) |
def | setupFastjet (process_dir=None) |
def | get_LHAPDF_DATA_PATH () |
def | get_LHAPDF_PATHS () |
def | get_lhapdf_id_and_name (pdf) |
def | setupLHAPDF (process_dir=None, extlhapath=None, allow_links=True) |
def | setNCores (process_dir, Ncores=None) |
def | resetLHAPDF (origLHAPATH='', origLHAPDF_DATA_PATH='') |
def | get_mg5_executable () |
def | add_lifetimes (process_dir, threshold=None) |
def | add_madspin (madspin_card=None, process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | madspin_on_lhe (input_LHE, madspin_card, runArgs=None, keep_original=False) |
def | arrange_output (process_dir=MADGRAPH_GRIDPACK_LOCATION, lhe_version=None, saveProcDir=False, runArgs=None, fixEventWeightsForBridgeMode=False) |
def | get_expected_reweight_names (reweight_card_loc) |
def | get_expected_systematic_names (syst_setting) |
def | setup_bias_module (bias_module, process_dir) |
def | get_reweight_card (process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | check_reweight_card (process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | helpful_SUSY_definitions () |
def | get_SUSY_variations (process, masses, syst_mod, ktdurham=None) |
def | SUSY_process (process='') |
def | SUSY_Generation (runArgs=None, process=None, plugin=None, syst_mod=None, keepOutput=False, param_card=None, writeGridpack=False, madspin_card=None, run_settings={}, params={}, fixEventWeightsForBridgeMode=False, add_lifetimes_lhe=False, usePMGSettings=True) |
def | update_lhe_file (lhe_file_old, param_card_old=None, lhe_file_new=None, masses={}, delete_old_lhe=True) |
def | remap_lhe_pdgids (lhe_file_old, lhe_file_new=None, pdgid_map={}, delete_old_lhe=True) |
def | find_key_and_update (akey, dictionary) |
def | modify_param_card (param_card_input=None, param_card_backup=None, process_dir=MADGRAPH_GRIDPACK_LOCATION, params={}, output_location=None) |
def | modify_run_card (run_card_input=None, run_card_backup=None, process_dir=MADGRAPH_GRIDPACK_LOCATION, runArgs=None, settings={}, skipBaseFragment=False) |
def | modify_config_card (config_card_backup=None, process_dir=MADGRAPH_GRIDPACK_LOCATION, settings={}, set_commented=True) |
def | print_cards_from_dir (process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | print_cards (proc_card='proc_card_mg5.dat', run_card=None, param_card=None, madspin_card=None, reweight_card=None, warn_on_missing=True) |
def | is_gen_from_gridpack () |
def | get_default_config_card (process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | get_cluster_type (process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | is_NLO_run (process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | run_card_consistency_check (isNLO=False, process_dir='.') |
def | add_reweighting (run_name, reweight_card=None, process_dir=MADGRAPH_GRIDPACK_LOCATION) |
def | check_reset_proc_number (opts) |
def | ls_dir (directory) |
def | fix_fks_makefile (process_dir) |
Variables | |
mglog = Logging.logging.getLogger('MadGraphUtils') | |
string | python = 'python' |
string | MADGRAPH_GRIDPACK_LOCATION = 'madevent' |
string | MADGRAPH_RUN_NAME = 'run_01' |
bool | MADGRAPH_CATCH_ERRORS = True |
MADGRAPH_PDFSETTING = None | |
list | MADGRAPH_COMMAND_STACK = [] |
string | patched_shutil_loc = '/cvmfs/atlas.cern.ch/repo/sw/Generators/madgraph/models/latest/shutil_patch' |
def python.MadGraphUtils.add_lifetimes | ( | process_dir, | |
threshold = None |
|||
) |
Add lifetimes to the generated LHE file. Should be called after generate_events is called.
Definition at line 1061 of file MadGraphUtils.py.
def python.MadGraphUtils.add_madspin | ( | madspin_card = None , |
|
process_dir = MADGRAPH_GRIDPACK_LOCATION |
|||
) |
Run madspin on the generated LHE file. Should be run when you have inputGeneratorFile set. Only requires a simplified process with the same model that you are interested in (needed to set up a process directory for MG5_aMC)
Definition at line 1105 of file MadGraphUtils.py.
def python.MadGraphUtils.add_reweighting | ( | run_name, | |
reweight_card = None , |
|||
process_dir = MADGRAPH_GRIDPACK_LOCATION |
|||
) |
Definition at line 2500 of file MadGraphUtils.py.
def python.MadGraphUtils.arrange_output | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION , |
|
lhe_version = None , |
|||
saveProcDir = False , |
|||
runArgs = None , |
|||
fixEventWeightsForBridgeMode = False |
|||
) |
Definition at line 1250 of file MadGraphUtils.py.
def python.MadGraphUtils.check_reset_proc_number | ( | opts | ) |
Definition at line 2512 of file MadGraphUtils.py.
def python.MadGraphUtils.check_reweight_card | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION | ) |
Definition at line 1618 of file MadGraphUtils.py.
def python.MadGraphUtils.config_only_check | ( | ) |
Definition at line 67 of file MadGraphUtils.py.
def python.MadGraphUtils.error_check | ( | errors_a, | |
return_code | |||
) |
Definition at line 103 of file MadGraphUtils.py.
def python.MadGraphUtils.find_key_and_update | ( | akey, | |
dictionary | |||
) |
Helper function when looking at param cards In some cases it's tricky to match keys - they may differ only in white space. This tries to sort out when we have a match, and then uses the one in blockParams afterwards. In the case of no match, it returns the original key.
Definition at line 2007 of file MadGraphUtils.py.
def python.MadGraphUtils.fix_fks_makefile | ( | process_dir | ) |
Definition at line 2531 of file MadGraphUtils.py.
def python.MadGraphUtils.generate | ( | process_dir = 'PROC_mssm_0' , |
|
grid_pack = False , |
|||
gridpack_compile = False , |
|||
extlhapath = None , |
|||
required_accuracy = 0.01 , |
|||
runArgs = None , |
|||
bias_module = None , |
|||
requirePMGSettings = False |
|||
) |
Definition at line 385 of file MadGraphUtils.py.
def python.MadGraphUtils.generate_from_gridpack | ( | runArgs = None , |
|
extlhapath = None , |
|||
gridpack_compile = None , |
|||
requirePMGSettings = False |
|||
) |
Definition at line 598 of file MadGraphUtils.py.
def python.MadGraphUtils.generate_prep | ( | process_dir | ) |
Definition at line 78 of file MadGraphUtils.py.
def python.MadGraphUtils.get_cluster_type | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION | ) |
Definition at line 2415 of file MadGraphUtils.py.
def python.MadGraphUtils.get_default_config_card | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION | ) |
Definition at line 2394 of file MadGraphUtils.py.
def python.MadGraphUtils.get_default_runcard | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION | ) |
Copy the default runcard from one of several locations to a local file with name run_card.tmp.dat
Definition at line 353 of file MadGraphUtils.py.
def python.MadGraphUtils.get_expected_reweight_names | ( | reweight_card_loc | ) |
Definition at line 1528 of file MadGraphUtils.py.
def python.MadGraphUtils.get_expected_systematic_names | ( | syst_setting | ) |
Definition at line 1544 of file MadGraphUtils.py.
def python.MadGraphUtils.get_LHAPDF_DATA_PATH | ( | ) |
Definition at line 831 of file MadGraphUtils.py.
def python.MadGraphUtils.get_lhapdf_id_and_name | ( | ) |
Definition at line 852 of file MadGraphUtils.py.
def python.MadGraphUtils.get_LHAPDF_PATHS | ( | ) |
Definition at line 835 of file MadGraphUtils.py.
def python.MadGraphUtils.get_mg5_executable | ( | ) |
Definition at line 1054 of file MadGraphUtils.py.
def python.MadGraphUtils.get_reweight_card | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION | ) |
Definition at line 1612 of file MadGraphUtils.py.
def python.MadGraphUtils.get_SUSY_variations | ( | process, | |
masses, | |||
syst_mod, | |||
ktdurham = None |
|||
) |
Definition at line 1681 of file MadGraphUtils.py.
def python.MadGraphUtils.helpful_SUSY_definitions | ( | ) |
Definition at line 1654 of file MadGraphUtils.py.
def python.MadGraphUtils.is_gen_from_gridpack | ( | ) |
Simple function for checking if there is a grid pack. Relies on the specific location of the unpacked gridpack (madevent) which is here set as a global variable. The gridpack is untarred by the transform (Gen_tf.py) and no sign is sent to the job itself that there is a gridpack in use except the file's existence
Definition at line 2382 of file MadGraphUtils.py.
def python.MadGraphUtils.is_NLO_run | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION | ) |
Definition at line 2426 of file MadGraphUtils.py.
def python.MadGraphUtils.ls_dir | ( | directory | ) |
Definition at line 2523 of file MadGraphUtils.py.
def python.MadGraphUtils.madspin_on_lhe | ( | input_LHE, | |
madspin_card, | |||
runArgs = None , |
|||
keep_original = False |
|||
) |
Run MadSpin on an input LHE file. Takes the process from the LHE file, so you don't need to have a process directory set up in advance. Runs MadSpin and packs the LHE file up appropriately Needs runArgs for the file handling
Definition at line 1162 of file MadGraphUtils.py.
def python.MadGraphUtils.modify_config_card | ( | config_card_backup = None , |
|
process_dir = MADGRAPH_GRIDPACK_LOCATION , |
|||
settings = {} , |
|||
set_commented = True |
|||
) |
Build a new configuration from an existing one. This function can get a fresh runcard from DATAPATH or start from the process directory. Settings is a dictionary of keys (no spaces needed) and values to replace.
Definition at line 2275 of file MadGraphUtils.py.
def python.MadGraphUtils.modify_param_card | ( | param_card_input = None , |
|
param_card_backup = None , |
|||
process_dir = MADGRAPH_GRIDPACK_LOCATION , |
|||
params = {} , |
|||
output_location = None |
|||
) |
Build a new param_card.dat from an existing one. Params should be a dictionary of dictionaries. The first key is the block name, and the second in the param name. Keys can include MASS (for masses) and DECAY X (for decays of particle X)
Definition at line 2022 of file MadGraphUtils.py.
def python.MadGraphUtils.modify_run_card | ( | run_card_input = None , |
|
run_card_backup = None , |
|||
process_dir = MADGRAPH_GRIDPACK_LOCATION , |
|||
runArgs = None , |
|||
settings = {} , |
|||
skipBaseFragment = False |
|||
) |
Build a new run_card.dat from an existing one. This function can get a fresh runcard from DATAPATH or start from the process directory. Settings is a dictionary of keys (no spaces needed) and values to replace.
Definition at line 2170 of file MadGraphUtils.py.
def python.MadGraphUtils.new_process | ( | process = 'generate p p > t t~\noutput -f' , |
|
plugin = None , |
|||
keepJpegs = False , |
|||
usePMGSettings = False |
|||
) |
Generate a new process in madgraph. Pass a process string. Optionally request JPEGs to be kept and request for PMG settings to be used in the param card Return the name of the process directory.
Definition at line 216 of file MadGraphUtils.py.
def python.MadGraphUtils.print_cards | ( | proc_card = 'proc_card_mg5.dat' , |
|
run_card = None , |
|||
param_card = None , |
|||
madspin_card = None , |
|||
reweight_card = None , |
|||
warn_on_missing = True |
|||
) |
Definition at line 2337 of file MadGraphUtils.py.
def python.MadGraphUtils.print_cards_from_dir | ( | process_dir = MADGRAPH_GRIDPACK_LOCATION | ) |
Definition at line 2331 of file MadGraphUtils.py.
def python.MadGraphUtils.remap_lhe_pdgids | ( | lhe_file_old, | |
lhe_file_new = None , |
|||
pdgid_map = {} , |
|||
delete_old_lhe = True |
|||
) |
Update the PDG IDs used in an LHE file. This is a bit finicky, as we have to both touch the LHE file metadata _and_ modify the events themselves. But since this is "just" a remapping, it should be safe assuming Pythia8 is told the correct thing afterwards and can get the showering right.
Definition at line 1940 of file MadGraphUtils.py.
def python.MadGraphUtils.resetLHAPDF | ( | origLHAPATH = '' , |
|
origLHAPDF_DATA_PATH = '' |
|||
) |
Definition at line 1046 of file MadGraphUtils.py.
def python.MadGraphUtils.run_card_consistency_check | ( | isNLO = False , |
|
process_dir = '.' |
|||
) |
Definition at line 2433 of file MadGraphUtils.py.
def python.MadGraphUtils.setNCores | ( | process_dir, | |
Ncores = None |
|||
) |
Definition at line 1033 of file MadGraphUtils.py.
def python.MadGraphUtils.setup_bias_module | ( | bias_module, | |
process_dir | |||
) |
Definition at line 1562 of file MadGraphUtils.py.
def python.MadGraphUtils.setup_path_protection | ( | ) |
Definition at line 47 of file MadGraphUtils.py.
def python.MadGraphUtils.setupFastjet | ( | process_dir = None | ) |
Definition at line 800 of file MadGraphUtils.py.
def python.MadGraphUtils.setupLHAPDF | ( | process_dir = None , |
|
extlhapath = None , |
|||
allow_links = True |
|||
) |
Definition at line 886 of file MadGraphUtils.py.
def python.MadGraphUtils.stack_subprocess | ( | command, | |
** | kwargs | ||
) |
Definition at line 41 of file MadGraphUtils.py.
def python.MadGraphUtils.SUSY_Generation | ( | runArgs = None , |
|
process = None , |
|||
plugin = None , |
|||
syst_mod = None , |
|||
keepOutput = False , |
|||
param_card = None , |
|||
writeGridpack = False , |
|||
madspin_card = None , |
|||
run_settings = {} , |
|||
params = {} , |
|||
fixEventWeightsForBridgeMode = False , |
|||
add_lifetimes_lhe = False , |
|||
usePMGSettings = True |
|||
) |
Keyword Arguments: usePMGSettings (bool): See :py:func:`new_process`. Will set SM parameters to the appropriate values. Default: True.
Definition at line 1779 of file MadGraphUtils.py.
def python.MadGraphUtils.SUSY_process | ( | process = '' | ) |
Definition at line 1749 of file MadGraphUtils.py.
def python.MadGraphUtils.update_lhe_file | ( | lhe_file_old, | |
param_card_old = None , |
|||
lhe_file_new = None , |
|||
masses = {} , |
|||
delete_old_lhe = True |
|||
) |
Build a new LHE file from an old one and an updated param card. The masses of some particles can be changed via the masses dictionary. No particles that appear in the events may have their masses changed. If the param card is provided, the decay block in the LHE file will be replaced with the one in the param card. By default, the old LHE file is removed. If None is provided as a new LHE file name, the new file will replace the old one.
Definition at line 1834 of file MadGraphUtils.py.
def python.MadGraphUtils.write_test_script | ( | ) |
Definition at line 198 of file MadGraphUtils.py.
bool python.MadGraphUtils.MADGRAPH_CATCH_ERRORS = True |
Definition at line 20 of file MadGraphUtils.py.
list python.MadGraphUtils.MADGRAPH_COMMAND_STACK = [] |
Definition at line 23 of file MadGraphUtils.py.
string python.MadGraphUtils.MADGRAPH_GRIDPACK_LOCATION = 'madevent' |
Definition at line 16 of file MadGraphUtils.py.
python.MadGraphUtils.MADGRAPH_PDFSETTING = None |
Definition at line 22 of file MadGraphUtils.py.
string python.MadGraphUtils.MADGRAPH_RUN_NAME = 'run_01' |
Definition at line 18 of file MadGraphUtils.py.
python.MadGraphUtils.mglog = Logging.logging.getLogger('MadGraphUtils') |
Definition at line 11 of file MadGraphUtils.py.
string python.MadGraphUtils.patched_shutil_loc = '/cvmfs/atlas.cern.ch/repo/sw/Generators/madgraph/models/latest/shutil_patch' |
Definition at line 25 of file MadGraphUtils.py.
string python.MadGraphUtils.python = 'python' |
Definition at line 14 of file MadGraphUtils.py.