Changes between Initial Version and Version 1 of FAQ-General-15


Ignore:
Timestamp:
Aug 20, 2016, 1:33:01 AM (8 years ago)
Author:
Olivier Mattelaer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FAQ-General-15

    v1 v1  
     1=How can I remove some unwanted diagram?
     2
     3== Warning
     4
     5Be carefull about gauge invariance (a non gauge invariant subset will also break lorentz invariance)
     6
     7== Requirements:
     8
     9 1. This method is implemented since MG5aMC version 2.5.0
     10 1. This method is only implemented for leading order processes
     11
     12== method:
     13
     14=== user_filter.py
     15
     16You need to define the file user_filter.py who should define the function remove_diag(diag):
     17It should return True if you want to discard the diagram.
     18
     19example of file
     20{{{
     21def remove_diag(diag):
     22    """remove all diagram with quark in T-channel"""
     23    for vertex in diag['vertices']: #last
     24         if vertex['id'] == 0: #special final vertex
     25             continue
     26         if vertex['legs'][-1]['number'] < 3: #this means T-channel
     27             if abs(vertex['legs'][-1]['id']) <6:
     28                  return True
     29    return False
     30}}}
     31
     32=== running with user_filter
     33
     34to activate the filtering, you have to add '--diagram_filter'
     35to the command
     36example
     37{{{
     38generate p p > w+ w+ j j --diagram_filter
     39}}}
     40
     41If you remove any diagram you should see on the screen:
     42{{{
     43INFO: Trying process: c c > w+ w+ s s WEIGHTED<=6 @1
     44WARNING: Diagram filter is ON and removed 12 diagrams for this subprocess.
     45}}}