Matching and Merging
 
 
This page first describes the matching and merging capabilitities of 
PYTHIA, and then, below, the use of a somewhat generic example main 
program to produce matched or merged results. 
 
Precision and a wide kinematical coverage are important ingredients 
to the applicability of Event Generators. Both can be aided by including 
higher-order corrections into the Generator. Depending on needs, the 
inclusion of higher orders (on top of a Born-level leading-order (LO) 
process) can be prioritized in different ways: 
 
- A formal order-by-order perturbative calculation, in each order 
higher including graphs both with one particle more in the final 
state and with one loop more in the intermediate state. This is 
accurate to the order of the calculation, and limited to a first- 
or second-order corrections. 
- Multiple hard real emission corrections, but neglecting the 
virtual corrections that should accompany the corrections. 
Thereby it is possible to allow for topologies with a larger and 
varying number of partons, at the prize of not being accurate to any 
particular order. 
- The parton shower provides an approximation to higher orders, 
both real and virtual contributions for the emission of arbitrarily 
many particles. 
Each of these approaches have drawbacks in complementary phasespace 
regions (the first two not being suitable in soft/collinear emissions 
regions, and thus unsuitable to combine with hadronization, while the third 
fails in hard, well-separated regions), such that many schemes to combine 
the strengths of the different approaches exist. 
 
 
The common traits of all combination methods are that matrix elements 
are used to describe the production of hard and well separated 
particles, and parton showers for the production of soft or collinear 
particles. What differs between the various approaches that have been 
proposed are which matrix elements are being used, how doublecounting 
is avoided, and how the transition from the hard to the soft regime is 
handled. These combination methods are typically referred to as 
"matching" or "merging" algorithms. There is some confusion about the 
distinction between the two terms. We will use "matching" to describe 
the combination of one (NLO) calculation with the parton shower, and 
"merging" when several calculations are combined with each other (and 
the shower).  PYTHIA offers implementations of several different 
matching and merging algorithms, which hopefully suit most needs. 
- For many/most resonance decays the first branching in the shower 
is merged with first-order matrix elements []
Nor01. This means that the emission rate is accurate to NLO, 
similarly to the POWHEG strategy (see below), but built into the 
timelike showers. The angular 
orientation of the event after the first emission is only handled by 
the parton shower kinematics, however. Needless to say, this formalism 
is precisely what is tested by Z^0 decays at LEP1, and it is 
known to do a pretty good job there.
- Also the spacelike showers 
contain a correction to first-order matrix elements, but only for the 
one-body-final-state processes q qbar → 
gamma^*/Z^0/W^+-/h^0/H^0/A0/Z'0/W'+-/R0 [Miu99] and 
g g → h^0/H^0/A0, and only to leading order. That is, it 
is equivalent to the POWHEG formalism for the real emission, but the 
prefactor "cross section normalization" is LO rather than 
NLO. Therefore this framework is less relevant, and has been 
superseded the following ones.
- The POWHEG strategy [Nas04] provides a cross section 
accurate to NLO. The hardest emission is constructed with unit 
probability, based on the ratio of the real-emission matrix element to 
the Born-level cross section, and with a Sudakov factor derived from 
this ratio, i.e. the philosophy introduced in [Ben87]. 
 While POWHEG is a generic strategy, the POWHEG BOX 
[Ali10] is an explicit framework, within which several 
processes are available. The code required for merging the PYTHIA 
showers with POWHEG input can be found ininclude/Pythia8Plugins/PowHegHooks.h, and is further 
described on a separate page.  A 
user example is found inexamples/main153.cc.
- The other traditional approach for NLO calculations is the MC@NLO 
one [Fri02]. In it the shower emission probability, without 
its Sudakov factor, is subtracted from the real-emission matrix 
element to regularize divergences. It therefore requires a analytic 
knowledge of the way the shower populates phase space.  The aMC@NLO 
package [Fre11] offers an implementation for PYTHIA 8, 
developed by Paolo Torrielli and Stefano Frixione. The global-recoil 
option of the PYTHIA final-state shower has been constructed to be 
used for the above-mentioned subtraction.
- Multi-jet merging in the CKKW-L approach [Lon01] is 
directly available. Its implementation, relevant parameters and test 
programs are documented on a 
separate page.
- Multi-jet matching in the MLM approach [Man02, Man07] is 
also available, either based on the ALPGEN or on the Madgraph variant, 
and with input events either from ALPGEN or from Madgraph. For details 
see separate page.
- Unitarised matrix element + parton shower merging (UMEPS) is 
directly available. Its implementation, relevant parameters and test 
programs are documented on a 
separate page.
- Next-to-leading order multi-jet merging (in the NL3 and UNLOPS 
approaches) is directly available. Its implementation, relevant 
parameters and test programs are documented on a 
separate page.
- Next-to-leading order jet matching in the FxFx approach is also 
available. For details see 
the jet matching page.
For quick-and-dirty studies, note that the field is 
open-ended, however: any external program can feed in 
Les Houches events that 
PYTHIA subsequently processes. In this case, the maximum pT of the 
shower evolution is set by the Les Houchesscale, on the one 
hand, and by the values of the SpaceShower:pTmaxMatch, 
TimeShower:pTmaxMatch and other parton-shower settings, 
on the other. It is typically not possible to achieve perfect 
matching this simplistic way, given that the PYTHIA pT evolution 
variables are not likely to agree with the variables used for cuts 
in the external program. Often one can get close enough with simple 
means but, for an improved matching, 
User Hooks may be inserted to control 
the steps taken on the way, e.g. to veto those parton shower 
branchings that would doublecount emissions included in the matrix 
elements. 
 
 
 
main164.cc: A generic interface for matching and merging
 
 
A common Pythia main program for MC@NLO NLO+PS matching, MLM jet merging, 
FxFx (NLO) jet merging, CKKW-L merging, UMEPS merging and UNLOPS (NLO) 
merging is available through main164.cc, together with the input 
files main164mcatnlo.cmnd, main164powheg.cmnd, 
main164mlm.cmnd, main164fxfx.cmnd, 
main164ckkwl.cmnd, main164ckkwl.cmnd, 
main164umeps.cmnd and main164unlops.cmnd. 
These rely on input from external matrix-element generators such as 
MadGraph5_aMC@NLO or POWHEG-BOX. 
 
main164.cc can produce HepMC events [Dob01] or 
interfaced directly to RIVET [Buc10]. 
If the user is not familiar with HepMC or RIVET, it is possible to instead use 
Pythia's histogramming routines. For this,  histogram events as illustrated 
for the histogram pTWsum in main162.cc. 
 
 
All settings can be transferred to main164.cc through an input 
file. The input file is part of the command line input of 
main164.cc, i.e. you can execute main164 with the 
command 
 
./main164 myInputFile.cmnd 
 
to read the input myInputFile.cmnd. 
Since main164.cc is currently a "front-end" for different types 
of matching/merging, we will briefly discuss the inputs for this 
sample program in the following. 
 
Inputs
 
 
In its current form, main164.cc uses LHA input to transfer 
(weighted) phase space points to Pythia. This can either be via traditional 
LHE files by setting 
 
Beams:frameType = 4
 
Beams:LHEF      = file.lhe 
 
or with HDF5 event files by setting 
 
Beams:frameType = 5
 
Beams:LHEF      = file.hdf5 
 
It is possible to include all parton multiplicities in one sample. 
If e.g. UMEPS merging for W-boson + up to two additional partons is to be 
performed, either one LHE file containing W+zero, W+one and W+two parton 
events or three separate LHE files can be generated. 
 
 
All input settings are handed to main164.cc in the form of an 
input file. We have included the input settings files 
 
          main164mlm.cmnd, which 
 illustrates the MLM jet matching interface, 
  
          main164fxfx.cmnd, which 
illustrates the FxFx NLO jet matching interface, 
 
          main164ckkwl.cmnd, which 
illustrates the CKKW-L multi-jet merging interface, 
 
          main164mess.cmnd, which 
illustrates the VINCIA MESS multi-jet merging interface, 
 
           main164umeps.cmnd, which 
illustrates the UMEPS multi-jet merging interface, and 
  
           main164unlops.cmnd, which 
illustrates the UNLOPS multi-jet NLO merging interface. 
 
Other settings (e.g. using main164.cc as simple LO+PS or 
as MC@NLO interface) are of course possible. In the following, we will 
briefly explain how input for the five choices above are generated and 
handled. 
 
MC@NLO matching with main164.cc
 
 
For MC@NLO matching, main164.cc currently relies on LHEF input 
from MadGraph5_aMC@NLO, which relies on the simple shower with a specific 
global recoil scheme for final-state branchings. As such, it can only be used 
with PartonShowers:model = 1 and specific settings within this 
shower model. Example MC@NLO settings can be found in 
main164mcatnlo.cmnd. Be aware that the lines below 
! DO NOT TOUCH must not be changed in order to ensure correct 
NLO matching. Please consult 
aMC@NLO matching for more details. 
 
POWHEG matching with main164.cc
 
 
For POWHEG matching, main164.cc currently relies on LHEF input 
from POWHEG-BOX. It is not tied to a specific parton shower and can be used 
with either of the PartonShowers:model settings. 
Example POWHEG settings can be found in main164powheg.cmnd. 
Please consult POWHEG matching for more 
details. 
 
MLM jet matching with main164.cc
 
 
For MLM jet matching, main164.cc currently relies on LHEF input 
from MadGraph. Due to the particular unweighting strategy performed in the 
generation of these inputs, the sample program starts by estimating the 
cross section. After this estimate, MLM jet matching within the Madgraph 
approach is performed in a second Pythia run. Example MLM settings can be 
found in main164mlm.cmnd. Please consult 
Jet Matching for more details. 
 
FxFx (NLO) jet matching with main164.cc
 
 
For FxFx jet matching, main164.cc relies on MC@NLO input LHE 
files generated with aMC@NLO. To produce FxFx outputs in aMC@NLO, the settings 
PYTHIA8  = parton_shower, 3 = ickkw and 
x = ptj are necessary in your aMC@NLO run card. Here, 
x is the value of the matching scale in FxFx, i.e. has be 
identical to JetMatching:qCutME in the Pythia inputs. 
Example FxFx settings for Pythia can be found in 
main164fxfx.cmnd. Please consult 
Jet Matching and 
aMC@NLO matching for more details. 
 
CKKW-L merging with main164.cc
 
 
For CKKW-L merging, main164.cc currently relies on LHEF inputs 
generated with the leading-order mode of MadGraph5_aMC@NLO. 
No run to estimate the cross section estimate is needed. Example CKKW-L 
settings can be found in main164ckkwl.cmnd. Please consult 
CKKW-L merging for more details. 
 
Sector merging (MESS) in VINCIA with main164.cc
 
 
For MESS merging, main164.cc currently relies on LHEF inputs 
generated with the leading-order mode of MadGraph5_aMC@NLO. 
No run to estimate the cross section estimate is needed. Example MESS 
settings can be found in main164mess.cmnd. Please consult 
MESS merging for more details. 
 
UMEPS merging with main164.cc
 
 
For UMEPS merging, main164.cc currently relies on LHEF inputs 
generated with the leading-order mode of aMC@NLO as well (see above). 
main164.cc automatically assigns if an event will be used as 
"standard" event or as "subtractive" contribution. Example UMEPS 
settings can be found in main164umeps.cmnd. Please 
consult UMEPS merging and 
CKKW-L merging for more details. 
 
UNLOPS (NLO) merging with main164.cc
 
 
For UNLOPS merging, main164.cc currently relies on LHEF inputs 
generated with the aMC@NLO. The UNLOPS interface in main164.cc 
requires a) leading-order inputs generated with the leading-order mode of 
aMC@NLO, using the UNLOPS prescription, and b) next-to-leading-order inputs 
generated with the NLO mode of aMC@NLO, using the UNLOPS prescription. 
To produce UNLOPS outputs in aMC@NLO, the settings 
PYTHIA8  = parton_shower, 4 = ickkw and 
x = ptj are necessary in your aMC@NLO run card. Here, 
x is the value of the merging scale in UNLOPS, i.e. 
has be identical to Merging:TMS in the Pythia inputs. 
main164.cc will then process NLO inputs and LO inputs 
consecutively, and will automatically assign if an event will be used as 
"standard" event or as "subtractive" contribution. Example UNLOPS 
settings can be found in main164umeps.cmnd. Please 
consult NLO Merging, 
UMEPS merging, and 
CKKW-L merging for more details.