Package madgraph :: Package various :: Module process_checks
[hide private]
[frames] | no frames]

Module process_checks

source code

Several different checks for processes (and hence models): permutation tests, gauge invariance tests, lorentz invariance tests. Also class for evaluation of Python matrix elements, MatrixElementEvaluator.

Classes [hide private]
  FakeInterface
Just an 'option container' to mimick the interface which is passed to the tests.
  MatrixElementEvaluator
Class taking care of matrix element evaluation, storing relevant quantities for speedup.
  LoopMatrixElementEvaluator
Class taking care of matrix element evaluation for loop processes.
  LoopMatrixElementTimer
Class taking care of matrix element evaluation and running timing for loop processes.
Functions [hide private]
 
clean_added_globals(to_clean) source code
 
boost_momenta(p, boost_direction=1, beta=0.5)
boost the set momenta in the 'boost direction' by the 'beta' factor
source code
 
evaluate_helicities(process, param_card=None, mg_root='', cmass_scheme=False)
Perform a python evaluation of the matrix element independently for all possible helicity configurations for a fixed number of points N and returns the average for each in the format [[hel_config, eval],...].
source code
 
run_multiprocs_no_crossings(function, multiprocess, stored_quantities, opt=None, options=None)
A wrapper function for running an iteration of a function over a multiprocess, without having to first create a process list (which makes a big difference for very large multiprocesses.
source code
 
check_already_checked(is_ids, fs_ids, sorted_ids, process, model, id_anti_id_dict={})
Check if process already checked, if so return True, otherwise add process and antiprocess to sorted_ids.
source code
 
generate_loop_matrix_element(process_definition, reuse, output_path=None, cmd=FakeInterface(), proc_name=None, loop_filter=None)
Generate a loop matrix element from the process definition, and returns it along with the timing information dictionary.
source code
 
check_profile(process_definition, param_card=None, cuttools='', tir={}, options={}, cmd=FakeInterface(), output_path=None, MLOptions={})
For a single loop process, check both its timings and then its stability in one go without regenerating it.
source code
 
check_stability(process_definition, param_card=None, cuttools='', tir={}, options=None, nPoints=100, output_path=None, cmd=FakeInterface(), MLOptions={})
For a single loop process, give a detailed summary of the generation and execution timing.
source code
 
check_timing(process_definition, param_card=None, cuttools='', tir={}, output_path=None, options={}, cmd=FakeInterface(), MLOptions={})
For a single loop process, give a detailed summary of the generation and execution timing.
source code
 
check_processes(processes, param_card=None, quick=[], cuttools='', tir={}, options=None, reuse=False, output_path=None, cmd=FakeInterface())
Check processes by generating them with all possible orderings of particles (which means different diagram building and Helas calls), and comparing the resulting matrix element values.
source code
 
check_process(process, evaluator, quick, options)
Check the helas calls for a process by generating the process using all different permutations of the process legs (or, if quick, use a subset of permutations), and check that the matrix element is invariant under this.
source code
 
clean_up(mg_root)
Clean-up the possible left-over outputs from 'evaluate_matrix element' of the LoopMatrixEvaluator (when its argument proliferate is set to true).
source code
 
format_output(output, format)
Return a string for 'output' with the specified format.
source code
 
output_profile(myprocdef, stability, timing, output_path, reusing=False)
Present the results from a timing and stability consecutive check
source code
 
output_stability(stability, output_path, reusing=False)
Present the result of a stability check in a nice format.
source code
 
output_timings(process, timings)
Present the result of a timings check in a nice format
source code
 
output_comparisons(comparison_results)
Present the results of a comparison in a nice list format mode short: return the number of fail process
source code
 
fixed_string_length(mystr, length)
Helper function to fix the length of a string by cutting it or adding extra space.
source code
 
check_gauge(processes, param_card=None, cuttools='', tir={}, reuse=False, options=None, output_path=None, cmd=FakeInterface())
Check gauge invariance of the processes by using the BRS check.
source code
 
check_gauge_process(process, evaluator, options=None)
Check gauge invariance for the process, unless it is already done.
source code
 
output_gauge(comparison_results, output='text')
Present the results of a comparison in a nice list format
source code
 
check_lorentz(processes, param_card=None, cuttools='', tir={}, options=None, reuse=False, output_path=None, cmd=FakeInterface())
Check if the square matrix element (sum over helicity) is lorentz invariant by boosting the momenta with different value.
source code
 
check_lorentz_process(process, evaluator, options=None)
Check gauge invariance for the process, unless it is already done.
source code
 
check_unitary_feynman(processes_unit, processes_feynm, param_card=None, options=None, tir={}, output_path=None, cuttools='', reuse=False, cmd=FakeInterface())
Check gauge invariance of the processes by flipping the gauge of the model
source code
 
check_complex_mass_scheme(process_line, param_card=None, cuttools='', tir={}, cmd=FakeInterface(), output_path=None, MLOptions={}, options={})
Check complex mass scheme consistency in the offshell region of s-channels detected for this process, by varying the expansion paramer consistently with the corresponding width and making sure that the difference between the complex mass-scheme and the narrow-width approximation is higher order.
source code
 
check_complex_mass_scheme_process(process, evaluator, opt=[], options=None)
Check CMS for the process in argument.
source code
 
get_value(process, evaluator, p=None, options=None)
Return the value/momentum for a phase space point
source code
 
output_lorentz_inv_loop(comparison_results, output='text')
Present the results of a comparison in a nice list format for loop processes.
source code
 
output_lorentz_inv(comparison_results, output='text')
Present the results of a comparison in a nice list format if output='fail' return the number of failed process -- for test--
source code
 
output_unitary_feynman(comparison_results, output='text')
Present the results of a comparison in a nice list format if output='fail' return the number of failed process -- for test--
source code
 
CMS_save_path(extension, cms_res, used_model, opts, output_path=None)
Creates a suitable filename for saving these results.
source code
 
output_complex_mass_scheme(result, output_path, options, model, output='text')
Outputs nicely the outcome of the complex mass scheme check performed by varying the width in the offshell region of resonances found for eahc process.
source code
Variables [hide private]
  ADDED_GLOBAL = []
  temp_dir_prefix = 'TMP_CHECK'
  logger = logging.getLogger('madgraph.various.process_checks')
  __package__ = 'madgraph.various'
Function Details [hide private]

evaluate_helicities(process, param_card=None, mg_root='', cmass_scheme=False)

source code 

Perform a python evaluation of the matrix element independently for all possible helicity configurations for a fixed number of points N and returns the average for each in the format [[hel_config, eval],...]. This is used to determine what are the vanishing and dependent helicity configurations at generation time and accordingly setup the output. This is not yet implemented at LO.

run_multiprocs_no_crossings(function, multiprocess, stored_quantities, opt=None, options=None)

source code 

A wrapper function for running an iteration of a function over a multiprocess, without having to first create a process list (which makes a big difference for very large multiprocesses. stored_quantities is a dictionary for any quantities that we want to reuse between runs.

generate_loop_matrix_element(process_definition, reuse, output_path=None, cmd=FakeInterface(), proc_name=None, loop_filter=None)

source code 

Generate a loop matrix element from the process definition, and returns it along with the timing information dictionary. If reuse is True, it reuses the already output directory if found. There is the possibility of specifying the proc_name.

format_output(output, format)

source code 

Return a string for 'output' with the specified format. If output is None, it returns 'NA'.

output_stability(stability, output_path, reusing=False)

source code 

Present the result of a stability check in a nice format. The full info is printed out in 'Stability_result_<proc_shell_string>.dat' under the MadGraph5_aMC@NLO root folder (output_path)

check_gauge(processes, param_card=None, cuttools='', tir={}, reuse=False, options=None, output_path=None, cmd=FakeInterface())

source code 

Check gauge invariance of the processes by using the BRS check. For one of the massless external bosons (e.g. gluon or photon), replace the polarization vector (epsilon_mu) with its momentum (p_mu)

check_complex_mass_scheme_process(process, evaluator, opt=[], options=None)

source code 
Check CMS for the process in argument. The options 'opt' is quite important.
When opt is a list, it means that we are doing NWA and we are filling the
list with the following tuple 
                   ('proc_name',({'ParticlePDG':ParticlePDG,
                                  'FinalStateMothersNumbers':set([]), 
                                  'PS_point_used':[]},...))
When opt is a dictionary, we are in the CMS mode and it will be reused then.

output_lorentz_inv_loop(comparison_results, output='text')

source code 

Present the results of a comparison in a nice list format for loop processes. It detail the results from each lorentz transformation performed.

output_complex_mass_scheme(result, output_path, options, model, output='text')

source code 

Outputs nicely the outcome of the complex mass scheme check performed by varying the width in the offshell region of resonances found for eahc process. Output just specifies whether text should be returned or a list of failed processes. Use 'concise_text' for a consise report of the results.