How to select of subset of the loop for the computation

Created by Olivier Mattelaer
Keywords:
loop filter diagram loop-induced
Last updated by:
Olivier Mattelaer

For loop computation, they are some cases where reducing the number of loop generated can make sense.

A first word of caution, they are also a lot of cases where doing so can lead to unphysical result (like if you break gauge invariance).
In most cases MG5aMC will not apply any sanity check of the meaningfullness of your selection. THIS IS YOUR RESPONSABILITY.
Note that breaking gauge, typically leads to breaking lorentz invariance so computing one matrix-element in various frame is a convenient way to check (events generation are always done in the partonic center of mass frame so no way to test at that level)

For "simple" loop filtering, you can use the syntax
--loop_filter=EXPR

where EXPR is a python expression that needs to return True for the diagram that you keep and return False for the diagram that you want to discard. Such expression can use the following variable:
  - 'n': number of particle within the loop (so 3 for triangle, 4 for boxes, ...)
  - 'loop_pdgs': list of the pdg of the particles within the loop
  - 'struct_pdgs': pdg of the particle attached to the loop
  - 'loop_masses': masses (variable name) of the particles present in the loop
  - 'struct_masses': masses (variable name) of the particles attached to the loop
  - 'id': unique identifier

So to discard all boxes you can do
--loop_filter=n<4

If that syntax is not powerfull enough for your need, the only solution is the hardcode your selection within
madgraph/loop/loop_diagram_generation.py (function get_loop_filter)
and then to run your generation with
--loop_filter=True