Package madgraph :: Package iolibs :: Module export_v4 :: Class ProcessExporterFortran
[hide private]
[frames] | no frames]

Class ProcessExporterFortran

source code

     object --+    
              |    
VirtualExporter --+
                  |
                 ProcessExporterFortran
Known Subclasses:

Class to take care of exporting a set of matrix elements to Fortran (v4) format.

Instance Methods [hide private]
 
__init__(self, dir_path='', opt=None)
Initiate the ProcessExporterFortran with directory information
source code
 
export_processes(self, matrix_elements, fortran_model)
Make the switch between grouped and not grouped output
source code
 
create_run_card(self, matrix_elements, history) source code
 
copy_template(self, model)
create the directory run_name as a copy of the MadEvent Template, and clean the directory
source code
 
create_default_madanalysis5_cards(self, history, proc_defs, processes, ma5_path, output_dir, levels=['parton', 'hadron'])
Call MA5 so that it writes default cards for both parton and post-shower levels, tailored for this particular process.
source code
 
write_procdef_mg5(self, file_pos, modelname, process_str)
write an equivalent of the MG4 proc_card in order that all the Madevent Perl script of MadEvent4 are still working properly for pure MG5 run.
source code
 
pass_information_from_cmd(self, cmd)
Pass information for MA5
source code
 
finalize(self, matrix_elements, history='', mg5options={}, flaglist=[])
Function to finalize v4 directory, for inheritance.
source code
 
create_MA5_cards(self, matrix_elements, history)
A wrapper around the creation of the MA5 cards so that it can be bypassed by daughter classes (i.e.
source code
 
create_proc_charac(self, matrix_elements=None, history='', **opts) source code
 
write_matrix_element_v4(self)
Function to write a matrix.f file, for inheritance.
source code
 
write_pdf_opendata(self)
modify the pdf opendata file, to allow direct access to cluster node repository if configure
source code
 
write_maxparticles_file(self, writer, matrix_elements)
Write the maxparticles.inc file for MadEvent
source code
 
export_model_files(self, model_path)
Configure the files/link of the process according to the model
source code
 
make_model_symbolic_link(self)
Make the copy/symbolic links
source code
 
make_source_links(self)
Create the links from the files in sources
source code
 
export_helas(self, helas_path)
Configure the files/link of the process according to the model
source code
 
generate_subprocess_directory(self, matrix_element, fortran_model, me_number)
Routine to generate a subprocess directory (for inheritance)
source code
 
get_source_libraries_list(self)
Returns the list of libraries to be compiling when compiling the SOURCE directory.
source code
 
write_source_makefile(self, writer)
Write the nexternal.inc file for MG4
source code
 
write_nexternal_madspin(self, writer, nexternal, ninitial)
Write the nexternal_prod.inc file for madspin
source code
 
write_helamp_madspin(self, writer, ncomb)
Write the helamp.inc file for madspin
source code
 
write_nexternal_file(self, writer, nexternal, ninitial)
Write the nexternal.inc file for MG4
source code
 
write_pmass_file(self, writer, matrix_element)
Write the pmass.inc file for MG4
source code
 
write_ngraphs_file(self, writer, nconfigs)
Write the ngraphs.inc file for MG4.
source code
 
write_leshouche_file(self, writer, matrix_element)
Write the leshouche.inc file for MG4
source code
 
get_leshouche_lines(self, matrix_element, numproc)
Write the leshouche.inc file for MG4
source code
 
write_maxamps_file(self, writer, maxamps, maxflows, maxproc, maxsproc)
Write the maxamps.inc file for MG4.
source code
 
convert_model(self, model, wanted_lorentz=[], wanted_couplings=[])
Create a full valid MG4 model from a MG5 model (coming from UFO)
source code
 
modify_grouping(self, matrix_element)
allow to modify the grouping (if grouping is in place)...
source code
 
get_mg5_info_lines(self)
Return info lines for MG5, suitable to place at beginning of Fortran files
source code
 
get_process_info_lines(self, matrix_element)
Return info lines describing the processes for this matrix element
source code
 
get_helicity_lines(self, matrix_element, array_name='NHEL')
Return the Helicity matrix definition lines for this matrix element
source code
 
get_ic_line(self, matrix_element)
Return the IC definition line coming after helicities, required by switchmom in madevent
source code
 
set_chosen_SO_index(self, process, squared_orders)
From the squared order constraints set by the user, this function finds what indices of the squared_orders list the user intends to pick.
source code
 
get_split_orders_lines(self, orders, array_name, n=5)
Return the split orders definition as defined in the list orders and for the name of the array 'array_name'.
source code
 
format_integer_list(self, list, name, n=5)
Return an initialization of the python list in argument following the fortran syntax using the data keyword assignment, filling an array of name 'name'.
source code
 
get_color_data_lines(self, matrix_element, n=6)
Return the color matrix definition lines for this matrix element.
source code
 
get_den_factor_line(self, matrix_element)
Return the denominator factor line for this matrix element
source code
 
get_icolamp_lines(self, mapconfigs, matrix_element, num_matrix_element)
Return the ICOLAMP matrix, showing which JAMPs contribute to which configs (diagrams).
source code
 
get_amp2_lines(self, matrix_element, config_map=[])
Return the amp2(i) = sum(amp for diag(i))^2 lines
source code
 
get_JAMP_coefs(self, color_amplitudes, color_basis=None, tag_letter='', n=50, Nc_value=3)
This functions return the lines defining the DATA statement setting the coefficients building the JAMPS out of the AMPS.
source code
 
get_JAMP_lines_split_order(self, col_amps, split_order_amps, split_order_names=None, JAMP_format='JAMP(%s)', AMP_format='AMP(%s)')
Return the JAMP = sum(fermionfactor * AMP(i)) lines from col_amps defined as a matrix element or directly as a color_amplitudes dictionary.
source code
 
get_JAMP_lines(self, col_amps, JAMP_format='JAMP(%s)', AMP_format='AMP(%s)', split=-1)
Return the JAMP = sum(fermionfactor * AMP(i)) lines from col_amps defined as a matrix element or directly as a color_amplitudes dictionary, Jamp_formatLC should be define to allow to add LeadingColor computation (usefull for MatchBox) The split argument defines how the JAMP lines should be split in order not to be too long.
source code
 
get_pdf_lines(self, matrix_element, ninitial, subproc_group=False)
Generate the PDF lines for the auto_dsig.f file
source code
 
write_props_file(self, writer, matrix_element, s_and_t_channels)
Write the props.inc file for MadEvent.
source code
 
write_configs_file(self, writer, matrix_element)
Write the configs.inc file for MadEvent
source code
 
write_configs_file_from_diagrams(self, writer, configs, mapconfigs, nexternal, ninitial, model)
Write the actual configs.inc file.
source code
 
coeff(self, ff_number, frac, is_imaginary, Nc_power, Nc_value=3)
Returns a nicely formatted string for the coefficients in JAMP lines
source code
 
set_fortran_compiler(self, default_compiler, force=False)
Set compiler based on what's available on the system
source code
 
set_compiler(self, default_compiler, force=False)
Set compiler based on what's available on the system
source code
 
set_cpp_compiler(self, default_compiler, force=False)
Set compiler based on what's available on the system
source code
 
replace_make_opt_f_compiler(self, compilers, root_dir='')
Set FC=compiler in Source/make_opts
source code
 
replace_make_opt_c_compiler(self, compiler, root_dir='')
Set CXX=compiler in Source/make_opts.
source code

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

Class Variables [hide private]
  default_opt = {'clean': False, 'complex_mass': False, 'export_...
  grouped_mode = False

Inherited from VirtualExporter: check, exporter, output, sa_symmetry

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dir_path='', opt=None)
(Constructor)

source code 

Initiate the ProcessExporterFortran with directory information

Overrides: object.__init__

copy_template(self, model)

source code 

create the directory run_name as a copy of the MadEvent Template, and clean the directory

Overrides: VirtualExporter.copy_template

pass_information_from_cmd(self, cmd)

source code 

Pass information for MA5

Overrides: VirtualExporter.pass_information_from_cmd

finalize(self, matrix_elements, history='', mg5options={}, flaglist=[])

source code 

Function to finalize v4 directory, for inheritance.

Overrides: VirtualExporter.finalize

create_MA5_cards(self, matrix_elements, history)

source code 

A wrapper around the creation of the MA5 cards so that it can be bypassed by daughter classes (i.e. in standalone).

export_model_files(self, model_path)

source code 

Configure the files/link of the process according to the model

Overrides: VirtualExporter.export_model_files

export_helas(self, helas_path)

source code 

Configure the files/link of the process according to the model

Overrides: VirtualExporter.export_helas

generate_subprocess_directory(self, matrix_element, fortran_model, me_number)

source code 

Routine to generate a subprocess directory (for inheritance)

Overrides: VirtualExporter.generate_subprocess_directory

get_source_libraries_list(self)

source code 

Returns the list of libraries to be compiling when compiling the SOURCE directory. It is different for loop_induced processes and also depends on the value of the 'output_dependencies' option

write_ngraphs_file(self, writer, nconfigs)

source code 

Write the ngraphs.inc file for MG4. Needs input from write_configs_file.

convert_model(self, model, wanted_lorentz=[], wanted_couplings=[])

source code 

Create a full valid MG4 model from a MG5 model (coming from UFO)

Overrides: VirtualExporter.convert_model

modify_grouping(self, matrix_element)

source code 
allow to modify the grouping (if grouping is in place)
return two value:
- True/False if the matrix_element was modified
- the new(or old) matrix element

Overrides: VirtualExporter.modify_grouping

set_chosen_SO_index(self, process, squared_orders)

source code 

From the squared order constraints set by the user, this function finds what indices of the squared_orders list the user intends to pick. It returns this as a string of comma-separated successive '.true.' or '.false.' for each index.

get_split_orders_lines(self, orders, array_name, n=5)

source code 

Return the split orders definition as defined in the list orders and for the name of the array 'array_name'. Split rows in chunks of size n.

format_integer_list(self, list, name, n=5)

source code 

Return an initialization of the python list in argument following the fortran syntax using the data keyword assignment, filling an array of name 'name'. It splits rows in chunks of size n.

get_color_data_lines(self, matrix_element, n=6)

source code 

Return the color matrix definition lines for this matrix element. Split rows in chunks of size n.

get_JAMP_coefs(self, color_amplitudes, color_basis=None, tag_letter='', n=50, Nc_value=3)

source code 

This functions return the lines defining the DATA statement setting the coefficients building the JAMPS out of the AMPS. Split rows in bunches of size n. One can specify the color_basis from which the color amplitudes originates so that there are commentaries telling what color structure each JAMP corresponds to.

get_JAMP_lines_split_order(self, col_amps, split_order_amps, split_order_names=None, JAMP_format='JAMP(%s)', AMP_format='AMP(%s)')

source code 

Return the JAMP = sum(fermionfactor * AMP(i)) lines from col_amps defined as a matrix element or directly as a color_amplitudes dictionary. The split_order_amps specifies the group of amplitudes sharing the same amplitude orders which should be put in together in a given set of JAMPS. The split_order_amps is supposed to have the format of the second output of the function get_split_orders_mapping function in helas_objects.py. The split_order_names is optional (it should correspond to the process 'split_orders' attribute) and only present to provide comments in the JAMP definitions in the code.

write_props_file(self, writer, matrix_element, s_and_t_channels)

source code 

Write the props.inc file for MadEvent. Needs input from write_configs_file.

write_configs_file_from_diagrams(self, writer, configs, mapconfigs, nexternal, ninitial, model)

source code 

Write the actual configs.inc file.

configs is the diagrams corresponding to configs (each diagrams is a list of corresponding diagrams for all subprocesses, with None if there is no corresponding diagrams for a given process). mapconfigs gives the diagram number for each config.

For s-channels, we need to output one PDG for each subprocess in the subprocess group, in order to be able to pick the right one for multiprocesses.

replace_make_opt_c_compiler(self, compiler, root_dir='')

source code 

Set CXX=compiler in Source/make_opts. The version is also checked, in order to set some extra flags if the compiler is clang (on MACOS)


Class Variable Details [hide private]

default_opt

Value:
{'clean': False,
 'complex_mass': False,
 'export_format': 'madevent',
 'mp': False,
 'output_options': {},
 'v5_model': True}