Chapter 12
C++ matrix element interface

Since version 10.1, MCFM offers a dedicated C++ interface to access its analytic one-loop amplitudes. Please cite ref. [69] in addition to the main MCFM references when using the C++ interface.

12.1 Processes with C++ interface

The following Standard-Model processes are available:

Process Order EW Order QCD
pp + 2 1
pp +j 2 2
pp +jj 2 3
pp ±ν 2 1
pp ±νj 2 2
pp ±νjj 2 3
pp h 1 2
pp hj 1 3
pp hjj 1 4
pp hh 2 2
pp +h 3 1
pp +hj 3 2
pp ±νh 3 1
pp ±νhj 3 2
pp γj 1 2
pp γjj 1 3
pp γγ 2 1
gg γγ 2 1
pp γγj 2 2
pp γγγ 3 1
pp γγγγ 4 1
pp +γ 3 1
pp ±νγ 3 1
pp νν¯γ 3 1
pp +νν¯ 4 1
pp +νν¯ 4 1
pp +νν¯ 4 1
pp ++ 4 1
pp ++ 4 1
pp +±ν 4 1
pp ±ννν¯ 4 1
pp +±ν 4 1
pp +γj 3 2
pp ±νγj 3 2
pp +νν¯j 4 2
pp +νν¯j 4 2
pp +νν¯j 4 2
pp ++j 4 2
pp ++j 4 2
pp +±νj 4 2
pp tt¯ 0 3
pp jj 0 3

In addition, the following HEFT processes are available (requires model=heft):

Process Order EW Order QCD
pp h 1 2
pp hj 1 3
pp hjj 1 4

All processes are crossing invariant.

Further processes may be implemented in the future. Please contact the authors if interested in a specific process.

12.2 Installation

To use the C++ interface, please enable compiling MCFM as a library by adding the following flag

cmake .. -DWITH_LIBRARY

This will create a shared library libMCFM.so in the lib/ directory.

12.3 Usage

Examples showing the basic usage of the interface and how to fill the complete list of parameters with default values are given in src/BLHA/text.cxx and src/BLHA/params.cxx, respectively.

The MCFM C++ interface is constructed as a C++ class

CXX_Interface mcfm;

included in the header

#include "MCFM/CXX_Interface.h"

It must be initialized on a std::map of std::string, containing all (standard-model) parameters

bool CXX_Interface::Initialize(std::map<std::string,std::string>& parameters);

Prior to use, each process has to be initialized in the interface

int CXX_Interface::InitializeProcess(const Process_Info &pi);

which takes a Process_Info object as input, which in turn contains the defining parameters of a given process, i.e. the PDG IDs, number of incoming particles, and QCD and EW coupling orders

Process_Info(const std::vector<int> &ids, const int nin,const int oqcd, const int oew);

Phase space points are defined using the FourVec struct, which represents four-vectors in the ordering (E,px,py,pz)

FourVec(double e, double px, double py, double pz);

Given a list of four-vectors in this format, one-loop matrix elements can be calculated either using the process ID returned by the InitializeProcess method

void CXX_Interface::Calc(int procID,const std::vector<FourVec> &p, int oqcd);

or using a Process_Info struct:

void CXX_Interface::Calc(const Process_Info &pi,const std::vector<FourVec> &p,int oqcd);

In the same way, the result of this calculation can be accessed either via the process ID

const std::vector<double>& CXX_Interface::GetResult(int procID);

or using the Process_Info struct:

const std::vector<double> &CXX_Interface::GetResult(const Process_Info &pi)

The result is returned as a list of Laurent series coefficients in the format

(𝒪(𝜀0),𝒪(𝜀1),𝒪(𝜀2),Born).

However, by default only the 𝒪(𝜀0) coefficient, i.e. the finite part, is returned.

The calculation of the pole terms and the Born can be enabled by setting the following switch to 1

void CXX_Interface::SetPoleCheck(int check);

12.4 Tests

A set of programs to test MCFM’s amplitudes against OpenLoops, Recola, and MadLoop can be compiled. For example to compile the OpenLoops test program an additional OpenLoops directory -DOLDIR=$HOME/OpenLoops must be specified that contains the header files in the include subdirectory. For Recola and MadLoops the variables RCLDIR and MLDIR must be specified, respectively.