Changes between Version 4 and Version 5 of FAQ-General-4


Ignore:
Timestamp:
Feb 15, 2016, 10:40:11 AM (8 years ago)
Author:
Olivier Mattelaer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FAQ-General-4

    v4 v5  
     1=== Can I just calculate the amplitudes for a (sub)process and check them  point-by-point in phase space points using MadGraph ? ===
     2
     3The easiest way to do this is to create a Standalone package:
     4{{{
     5   generate p p > e+ e-
     6   output standalone PATH
     7}}}
     8You can then easily choose which diagrams to include in the matrix.f files of the !SubProcesses/P_xx_xxxx directories. There is also an example program (check_sa.f) in the !SubProcesses directory which shows how to calculate the amplitude at specific phase space points or by using PS configurations from RAMBO.
     9
     10You can also returns a valid c++ standalon code by running
     11{{{
     12   generate p p > e+ e-
     13   output standalone_cpp PATH
     14}}}
     15
     16If you want to have acces to the matrix-element via python. The easiest is to have the fortran code wrapped into python (evaluating a matrix element in python is just too slow to be usable). Each of the SubProcesses/P_xx_xxxx of the standalone directory can be compiled to be python linkable (note this require f2py part of numpy and to have python-devel package installed):
     17{{{
     18make matrix2py.so
     19}}}
     20
     21Then you can link this from your python code. Here is an example:
     22{{{
     23import matrix2py
     24
     25def invert_momenta(p):
     26        """ fortran/C-python do not order table in the same order"""
     27        new_p = []
     28        for i in range(len(p[0])):  new_p.append([0]*len(p))
     29        for i, onep in enumerate(p):
     30            for j, x in enumerate(onep):
     31                new_p[j][i] = x
     32        return new_p
     33
     34matrix2py.initialise('../../Cards/param_card.dat')
     35p = [[   0.5000000E+03,  0.0000000E+00,  0.0000000E+00,  0.5000000E+03],
     36     [   0.5000000E+03,  0.0000000E+00,  0.0000000E+00, -0.5000000E+03],
     37     [   0.5000000E+03,  0.1109243E+03,  0.4448308E+03, -0.1995529E+03],
     38     [   0.5000000E+03, -0.1109243E+03, -0.4448308E+03,  0.1995529E+03]]
     39
     40P =invert_momenta(p)
     41alphas = 0.13
     42nhel = 0 # means sum over all helicity                                                                                                                                                                   
     43me2 = matrix2py.get_me(P, alphas, nhel)
     44print me2
     45}}}
    146
    247
    3 === Can I just calculate the amplitudes for a (sub)process and check them  point-by-point in phase space points using MadGraph ? ===
    4 
    5 The easiest way to do this is to download the StandAlone !MadGraph package and generate the process. You can then easily choose which diagrams to include in the matrix.f files of the !SubProcesses/P_xx_xxxx directories. There is also an example program (check_sa.f) in the !SubProcesses directory which shows how to calculate the amplitude at specific phase space points or by using PS configurations from RAMBO.
    6 
    7 
    8  
    9 -- Main.FabioMaltoni - 02 Mar 2009
    10