## Colour Reconnection

The colour flows in the separate subprocesses defined in the multiparton-interactions scenario are tied together via the assignment of colour flow in the beam remnant. This is not an unambiguous procedure, and currently two different methods are implemented. In the first model the colour flow is reconstructed by how a PS could have constructed the configuration. In the second model, the full QCD colour calculation is taken into account, however the dynamical effects are modeled loosely, only an overall saturation is taken into account. The idea is to later account for other dynamical effects through colour reconnections.

A simple "minimal" procedure of colour flow only via the beam remnants does not result in a scenario in agreement with data, however, notably not a sufficiently steep rise of <pT>(n_ch). The true origin of this behaviour and the correct mechanism to reproduce it remains one of the big unsolved issues at the borderline between perturbative and nonperturbative QCD. Since no final answer is known, several models are implemented. The different models also rely on the two different colour assignments in the beam remnant. There are two, somewhat motivated, models implemented: the original PYTHIA scheme and a new scheme that tries to incorporate more of the colour knowledge from QCD.

The original PYTHIA scheme relies on the PS-like colour configuration of the beam remnant. This is combined with an additional step, wherein the gluons of a lower-pT MPI system are merged with the ones in a higher-pT MPI. A more detailed description of the merging can be found below. Relative to the other models it tests fewer reconnection possibilities, and therefore tends to be reasonably fast.

The new scheme [Chr14a]relies on the full QCD colour configuration in the beam remnant. This is followed up by a colour reconnection, where the potential string energy is minimized (ie. the lambda measure is minimized). The QCD colour rules are also incorporated in the colour reconnection, and determine the probability that a reconnection is allowed. The model also allows the creation of junction structures.

In addition to the two models described above, a simple model is implemented, wherein gluons can be moved from one location to another so as to reduce the total string length. This is one out of a range of simple models developed to study potential colour reconnection effects e.g. on top mass [Arg14], not from the point of view of having the most realistic description, but in order to probe the potential worst-case spread of predictions. All of these models are made available separately in `include/Pythia8Plugins/ColourReconnectionHooks.h`, with the setup illustrated in `examples/main29.cc`, but only the gluon-move one is sufficiently general and realistic that it has been included among the standard options here.

Finally, the SK I and SK II models [Sjo94] have a smaller range of applicability, originally intended for e^+ e^- → W^+ W^-, but in this context offers a more detailed approach. They are not suitable for hadronic collisions, since they would only address CR inside a gauge boson pair, and not CR in the rest of the event.

`flag` ColourReconnection:reconnect (`default = on`)
Allow or not a system to be merged with another one.

`mode` ColourReconnection:mode (`default = 0`; `minimum = 0`; `maximum = 4`)
Determine which model is used for colour reconnection. Beware that some settings may need to be changed to match the model selected.
`option` 0 : The MPI-based original Pythia 8 scheme.
`option` 1 : The new more QCD based scheme. Should be combined ewith `BeamRemnants:remnantMode = 1.`
`option` 2 : The new gluon-move model.
`option` 3 : The SK I e^+ e^- CR model. Requires `ColourReconnection:forceResonance = on` (and default `PartonLevel:earlyResDec = off`) to give any CR.
`option` 4 : The SK II e^+ e^- CR model. Requires `ColourReconnection:forceResonance = on` (and default `PartonLevel:earlyResDec = off`) to give any CR.

`flag` ColourReconnection:forceHadronLevelCR (`default = off`)
This flag switches on colour reconnection in the `forceHadronLevel` function. The function is called when only the hadron level of PYTHIA is used (see Hadron-level Standalone). The MPI-based model is not available for this setup and any resonance decays not already decayed are not included in the CR.

`flag` ColourReconnection:forceResonance (`default = off`)
This parameter allows an additional CR after late resonance decays. All the particles from all resonance decays are allowed to reconnect with each other. It is mainly intended for H -> WW -> qqqq , where the Higgs decay ensures a separation between the W bosons and the MPI systems. Reconnections between the decay products from the two W bosons is still a possibility, however. This option is not available for colored resonances, and not for the MPI-based model.

### The MPI-based scheme

In this scheme partons are classified by which MPI system they belong to. The colour flow of two such systems can be fused, and if so the partons of the lower-pT system are added to the strings defined by the higher-pT system in such a way as to give the smallest total string length. The bulk of these lower-pT partons are gluons, and this is what the scheme is optimized to handle.

In more detail, an MPI system with a scale pT of the hard interaction (normally 2 → 2) can be merged with one of a harder scale with a probability that is pT0_Rec^2 / (pT0_Rec^2 + pT^2), where pT0_Rec is `range` times pT0, the latter being the same energy-dependent dampening parameter as used for MPIs. Thus it is easy to merge a low-pT system with any other, but difficult to merge two high-pT ones with each other.

`parm` ColourReconnection:range (`default = 1.8`; `minimum = 0.`; `maximum = 10.`)
The `range` parameter defined above. The higher this number is the more reconnections can occur. For values above unity the reconnection rate tends to saturate, since then most systems are already connected with each other. This is why 10 is set as an effective upper limit, beyond which it is not meaningful to let the parameter go.

The reconnection procedure is applied iteratively. Thus first the reconnection probability P = pT0_Rec^2 / (pT0_Rec^2 + pT^2) of the lowest-pT system is found, and gives the probability for merger with the second-lowest one. If not merged, it is tested with the third-lowest one, and so on. For the m'th higher system the reconnection probability thus becomes (1 - P)^(m-1) P. That is, there is no explicit dependence on the higher pT scale, but implicitly there is via the survival probability of not already having been merged with a lower-pT system. Also note that the total reconnection probability for the lowest-pT system in an event with n systems becomes 1 - (1 - P)^(n-1). Once the fate of the lowest-pT system has been decided, the second-lowest is considered with respect to the ones above it, then the third-lowest, and so on.

Once it has been decided which systems should be joined, the actual merging is carried out in the opposite direction. That is, first the hardest system is studied, and all colour dipoles in it are found (including to the beam remnants, as defined by the holes of the incoming partons). Next each softer system to be merged is studied in turn. Its gluons are, in decreasing pT order, inserted on the colour dipole i,j that gives the smallest (p_g p_i)(p_g p_j)/(p_i p_j), i.e. minimizes the "disturbance" on the existing dipole, in terms of pT^2 or Lambda measure (string length). The insertion of the gluon means that the old dipole is replaced by two new ones. Also the (rather few) quark-antiquark pairs that can be traced back to a gluon splitting are treated in close analogy with the gluon case. Quark lines that attach directly to the beam remnants cannot be merged but are left behind.

The joining procedure can be viewed as a more sophisticated variant of the one introduced already in [Sjo87]. Clearly it is ad hoc. It hopefully captures some elements of truth. The lower pT scale a system has the larger its spatial extent and therefore the larger its overlap with other systems. It could be argued that one should classify individual initial-state partons by pT rather than the system as a whole. However, for final-state radiation, a soft gluon radiated off a hard parton is actually produced at late times and therefore probably less likely to reconnect. In the balance, a classification by system pT scale appears sensible as a first try.

Note that the reconnection is carried out before resonance decays are considered by default. Colour inside a resonance therefore is not reconnected. The `PartonLevel:earlyResDec` can be switched on to perform resonance decays before colour reconnection, and then the partons from resonance decays could be affected. Ideally the time scales of resonance decays and of colour reconnection should be picked dynamically, but this is not yet the case. Notably the W, Z and t have intermediate decay time scales, somewhat but not much shorter than typical hadronization times, whereas the H is much more long-lived.

### The newer scheme

The newer CR scheme builds on the minimization of the string length as well as the colour rules from QCD. A main feature of the new model is the introduction of junction structures. These are possible outcomes of the reconnection in addition to the more common string-string reconnections. The model works by constructing all pair of dipoles that are allowed to reconnect by QCD colour rules and switching if the new pair has a lower string length. Junctions are also allowed to be directly produced from three, and in some special cases, four dipoles. This is done iteratively until no further allowed reconnection lowers the total string length.

According to QCD colour rules, an uncorrelated triplet and anti-triplet are allowed to form a singlet state 1/9 times. This is reflected in the model by giving each dipole a colour number between 0-8 and only dipoles with the same colour number are allowed to reconnect. The junction probability is given by the product of two triplets, which provides an anti-triplet 1/3 times. This is achieved in the model by allowing reconnections between dipoles where modulo three of the color numbers agree. In addition to the colour rules, the dipoles also need to be causally connected in order to perform a reconnection. The definition of causally connected dipoles is not exact, and several different options are available. All the time dilation modes introduce a tuneable parameter, which provides a handle on the overall amount of colour reconnection.

When the two strings are allowed to reconnect, they will reconnect if it lowers the total string length. The total string length is in the model defined by an approximation to the lambda-measure. The lambda-measure is not well understood, especially for junction structures, and a tuneable parameter is introduced to vary the behaviour between junctions and ordinary strings.

To avoid problems with very low mass string and junction structures, these are excluded from participating in the colour reconnections. This is achieved by forming the dipole or junction into a pseudo-particle if the invariant mass is too low. Especially the approximations made in the lambda-measure provides problems at low invariant masses.

The new CR scheme introduce several tuneable parameters, which all are listed below. In addition to these, other parameters in PYTHIA also need to retuned to account for the new CR. The default values below, together with changing `MultipartonInteractions:pT0Ref = 2.15` and `ColourReconnection:allowDoubleJunRem = off`, provides a good starting point. Additional fragmentation variables were also adjusted in the first tune, but these provide a smaller change (see [Chr14a] for a complete list).

`mode` ColourReconnection:lambdaForm (`default = 0`; `minimum = 0`; `maximum = 1`)
This allows to switch between different options for what lambda-measure to use. The formula shown are how much each end of a dipole or junction contribute to the total lambda-measure. The energies are defined in respectively the dipole or junction rest frame.
`option` 0 : lambda = ln( max(1., (E + p)/(m + m0)) )
`option` 1 : lambda = ln (1 + sqrt(2) E/m0)

`parm` ColourReconnection:m0 (`default = 0.3`; `minimum = 0.1`; `maximum = 5.`)
Used in the lambda-measure as a protection against small mass systems in `lambdaForm`=0, and used as a regularisation parameter in `lambdaForm`=1.

`parm` ColourReconnection:junctionCorrection (`default = 1.20`; `minimum = 0.01`; `maximum = 10.`)
Used in the lambda-measure for junction strings, this parameter allows one to vary how easily junctions form. It is implemented as a multiplicative correction to the mass term in the denominator of the lambda-measure. For `lambdaForm = 0`, it multiplies (m+m0) and results in a constant offset from the standard lambda-measure. For `lambdaForm = 1`, this parameter simply multiplies m0.

`parm` ColourReconnection:mPseudo (`default = 0.3`; `minimum = 0.1`; `maximum = 5.`)
This variable is used as a cut for forming pseudo particles that are not colour reconnected.

`mode` ColourReconnection:nColours (`default = 9`; `minimum = 1`; `maximum = 30`)
The number of reconnection colours, this should not be confused with the standard number of QCD colours. Each string is given an integer number between 0 and `nColours - 1`. Only strings with the same number are allowed to do a normal string reconnection. The default value provides the standard QCD probability that a triplet and an anti-triplet is in a singlet state. The probability for two strings to form a junction structure is in QCD given by the product of two triplets, which gives a probability of 1/3. Therefore the number of reconnection colours for junction formation is `iColours % 3`, where iColours refer to the integer of the string. The behaviour of junction formation therefore only changes slightly with this variable.

`flag` ColourReconnection:sameNeighbourColours (`default = off`)
In the normal colour reconnection two neighbouring strings are not allowed to have the same colour. Similar two strings originating from a gluon split is not allowed to reconnect. The physics motivation for this is that it would require colour singlet gluons, and therefore for ordinary physics studies this should be turned off. But for testing of extreme scenarios (i.e. 1 colour), this variable needs to be turned on, since it is not possible to have different neighbouring colours.

`flag` ColourReconnection:allowJunctions (`default = on`)
This switch disables the formation of junctions in the colour reconnection.

`mode` ColourReconnection:heavyLambdaForm (`default = 0`; `minimum = 0`; `maximum = 2`)
This allows to include a pure rapidity-based lambda-measure independent of m0 in case a dipole end is a heavy quark (c or b): lambda = ln ((E + p)/mq).
`option` 0 : No special treatment of heavy quarks.
`option` 1 : Rapidity-based lambda for heavy quarks attached to junctions only.
`option` 2 : Rapidity-based lambda for all heavy quarks.

`flag` ColourReconnection:allowDoubleJunRem (`default = on`)
This parameter tells whether or not to allow a directly connected junction-antijunction pair to split into two strings. The lambda measure of the junction system is compared to that of the two possible string configurations. If the chosen configuration is the junction system, a q-qbar system is inserted between the junctions by removing some energy/momentum from the other legs.

`mode` ColourReconnection:timeDilationMode (`default = 2`; `minimum = 0`; `maximum = 5`)
Disallow colour reconnection between strings that are not in causal contact; if either string has already decayed before the other string forms, there is no space-time region in which the reconnection could physically occur. The exact defintion of causal contact is not known, hence several possible defintions are included. They all include the boost factor, gamma, and the majority also rely on the typical hadronization scale, r, which is kept fixed at 1 fm. A tuneable dimensionless parameter is included, which can be used to control the overall amount of colour reconnection.
`option` 0 : All strings are allowed to reconnect.
`option` 1 : Strings are allowed to reconnect if gamma < timeDilationPar and all strings should be causally connected to allow a reconnection.
`option` 2 : Strings are allowed to reconnect if gamma < timeDilationPar * mDip * r and all strings should be in causal contact to allow a reconnection.
`option` 3 : Strings are allowed to reconnect if gamma < timeDilationPar * mDip * r and if a single pair of dipoles are in causal contact the reconnection is allowed.
`option` 4 : Strings are allowed to reconnect if gamma < timeDilationPar * mDip' * r and all strings should be in causal contact to allow a reconnection. mDip' is the invariant mass at the formation of the dipole (ie. the first time the colour tag appear in the perturbative expansion).
`option` 5 : Strings are allowed to reconnect if gamma < timeDilationPar * mDip' * r and if a single pair of dipoles are in causal contact the reconnection is allowed. mDip' is the invariant mass at the formation of the dipole (ie. the first time the colour tag appear in the perturbative expansion).

`parm` ColourReconnection:timeDilationPar (`default = 0.18`; `minimum = 0`; `maximum = 100`)
This is a tuneable parameter for the time dilation. The definition can be seen above under `timeDilationMode`.

`parm` ColourReconnection:dipoleMaxDist (`default = 0.0`; `minimum = 0.0`; `maximum = 50.0`)
This is a tuneable parameter for the allowed maximum impact parameter distance between the centres of two dipoles to be Colour reconnected. It also restricts CR from three dipoles, all of the dipoles pairs have to be seperated not more than the value of this parameter. The distance is measured in the unit of fm. If set to 0, there is no maximum.

`flag` ColourReconnection:allowDiquarkJunctionCR (`default = on`)
This flag decides whether or not to allow dipoles containing diquarks to participate in junction colour reconnections. If it's `off` then dipoles containing diquarks cannot be reconnected into junction systems. Reconnections not involving junctions are still allowed. Contextual note: this parameter was introduced to disallow junctions connected (directly) to diquarks, because they caused a lot of hadronization failures in the heavy-ion remnant region (many, largely parallel, diquarks that attempt junction reconnections).

### The gluon-move scheme

This approach contains two steps, a first "move" one and an optional second "flip" one. Both are intended to reduce the total "string length" lambda measure of an event. For multiparton topologies the correct lambda measure can become quite cumbersome, so here it is approximated by the sum of lambda contributions from each pair of partons connected by a colour string piece. For two partons i and j with invariant mass m_ij this contribution is defined as lambda_ij = ln(1 + m^2_ij / m2Lambda). The 1 is added ad hoc to avoid problems in the m_ij → 0 limit, problems which mainly comes from the approximate treatment, and m2Lambda is a parameter set below.

In the move step all final gluons are identified, alternatively only a fraction fracGluon of them, and also all colour-connected parton pairs. For each gluon and each pair it is calculated how the total lambda would shift if the gluon would be removed from its current location and inserted in between the pair. The gluon move that gives the largest negative shift, if any, is then carried out. Alternatively, only shifts more negative than dLambdaCut are considered. The procedure is iterated so long as allowed moves can be found.

There is some fine print. If a colour singlet subsystem consists of two gluons only then it is not allowed to move any of them, since that then would result in in a colour singlet gluon. Also, at most as many moves are made as there are gluons, which normally should be enough. A specific gluon may be moved more than once, however. Finally, a gluon directly connected to a junction cannot be moved, and also no gluon can be inserted between it and the junction. This is entirely for practical reasons, but should not be a problem, since junctions are rare in this model.

The gluon-move steps will not break the connection between string endpoints, in the sense that a quark and an antiquark that are colour-connected via a number of gluons will remain so, only the number and identity of the intermediate gluons may change. Such a scenario may be too restrictive. Therefore an optional second flip step is introduced. In it all such colour chains are identified, omitting closed gluon loops. The lambda change is defined by what happens if the two colour lines are crossed somewhere, e.g. such that two systems q1 - g1 - qbar1 and q2 - g2 - qbar2 are flipped to q1 - g1 - g2 - qbar2 and q2 - qbar1. The flip that gives the largest lambda reduction is carried out, again with dLambdaCut offering a possibility to restrict the options. As with the move step, the procedure is repeated so long as it is allowed. An important restriction is imposed, however, that a given system is only allowed to flip once, and not with itself. The practical reason is that repeated flips could split off closed gluon loops quite easily, which tends to result in bad agreement with data.

As an option, singlet subsystems containing a junction may or may not be allowed to take part in the flip step. Since the number of junction systems is limited in this model the differences are not so important.

`parm` ColourReconnection:m2Lambda (`default = 1.`; `minimum = 0.25`; `maximum = 16.`)
The m2Lambda parameter used in the definition of the approximate lambda measure above. It represents an approximate hadronic mass-square scale, cf. m0 in the previous model. Its value is uncertain up to factors of 2, but the lambda change induced by a potential move or flip is rather insensitive to the precise value, owing to large cancellations.

`parm` ColourReconnection:fracGluon (`default = 1.`; `minimum = 0.`; `maximum = 1.`)
The probability that a given gluon will be considered for being moved. It thus gives the average fraction of gluons being considered.

`parm` ColourReconnection:dLambdaCut (`default = 0.`; `minimum = 0.`; `maximum = 10.`)
Restrict gluon moves and colour flips to those that reduce lambda by more than this amount. The larger this number, the fewer moves and flips will be performed, but those that remain are the ones most likely to produce large effects.

`mode` ColourReconnection:flipMode (`default = 0`; `minimum = 0`; `maximum = 4`)
Performing the flip step or not. Also possibility to omit the move step.
`option` 0 : No flip handling.
`option` 1 : Allow flips, but not for strings in junction topologies.
`option` 2 : Allow flips, including for strings in junction topologies.
`option` 3 : No move handling. Allow flips, but not for strings in junction topologies.
`option` 4 : No move handling. Allow flips, including for strings in junction topologies.

### The e^+ e^- colour reconnection schemes

The SK I and SK II models [Sjo94] were specifically developed for e^+ e^- → W^+ W^- → q_1 qbar_2 q_3 qbar_4 at LEP 2, and equally well works for e^+ e^- → gamma^*/Z^0 gamma^*/Z^0. They are not intended to handle hadronic collisions, except in special contexts. The prime of these is Higgs decays of the same character as above, H^0 → W^+ W^- / Z^0 Z^0, since the Higgs is sufficiently long-lived that its decay products can be considered separately from the rest of the event. The administrative machinery for this possibility is not yet in place, however.

The labels I and II refer to the colour-confinement strings being modelled either by analogy with type I or type II superconductors. In the former model the strings are viewed as transversely extended "bags". The likelihood of reconnection is then related to the integrated space-time overlap of string pieces from the W^+ with those from the W^-. In the latter model instead strings are assumed to be analogous with vortex lines, where all the topological information is stored in a thin core region. Reconnection therefore only can occur when these cores pass through each other.

Both of these models are based on a detailed modelling of the space-time separation of the W^+ and W^- decay vertices, on the subsequent shower evolution, on the continued space-time evolution of all the string pieces stretched between the showered partons, and on the cutoff provided by the strings disappearing by the hadronization process. As such, they are more sophisticated than any other reconnection models. Unfortunately they would not easily carry over to hadronic collisions, where both the initial and the final states are far more complicated, and the space-time details less well controlled.

The SK II model has few free parameters, giving more predictive power. Conversely, SK I has a a free overall CR strength parameter, making it more convenient for tunes to data. The LEP collaborations have used SK I as a common reference to establish the existence of CR in W^+ W^- events.

`flag` ColourReconnection:lowerLambdaOnly (`default = on`)
Only allow overlaps that lowers the total string length.

`flag` ColourReconnection:singleReconnection (`default = on`)
Limit the number of reconnections to a single reconnection.

`parm` ColourReconnection:kI (`default = 0.6`; `minimum = 0.`; `maximum = 100.`)
kI is the main free parameter in the reconnection probability for SK I. This probability is given by kI times the space-time overlap volume, up to saturation effects.

`parm` ColourReconnection:fragmentationTime (`default = 1.5`; `minimum = 1.`; `maximum = 2.`)
This parameter specifies the average fragmentation time of the string, in fm. This is used as an upper limit on the invariant time where strings still exist and thus can collide. The expected fragmentation time is related to the a and b parameters of the Lund string fragmentation function as well as to the string tension. It is therefore not a quite free parameter.

`parm` ColourReconnection:rHadron (`default = 0.5`; `minimum = 0.3`; `maximum = 1.`)
Width of the type I string in reconnection calculations, in fm, giving the radius of the Gaussian distribution in x and y separately.

`parm` ColourReconnection:blowR (`default = 2.5`; `minimum = 1.`; `maximum = 4.`)
Technical parameter used in the Monte Carlo sampling of the spatial phase space volume in SK I. There is no real reason to change this number.

`parm` ColourReconnection:blowT (`default = 2.0`; `minimum = 1.`; `maximum = 4.`)
Technical parameter used in the Monte Carlo sampling of the temporal phase space volume in SK I. There is no real reason to change this number.