## Beam Remnants

### Introduction

The `BeamParticle` class contains information on all partons extracted from a beam (so far). As each consecutive multiparton interaction defines its respective incoming parton to the hard scattering a new slot is added to the list. This information is modified when the backwards evolution of the spacelike shower defines a new initiator parton. It is used, both for the multiparton interactions and the spacelike showers, to define rescaled parton densities based on the x and flavours already extracted, and to distinguish between valence, sea and companion quarks. Once the perturbative evolution is finished, further beam remnants are added to obtain a consistent set of flavours. The current physics framework is further described in [Sjo04].

The introduction of rescattering in the multiparton interactions framework further complicates the processing of events. Specifically, when combined with showers, the momentum of an individual parton is no longer uniquely associated with one single subcollision. Nevertheless the parton is classified with one system, owing to the technical and administrative complications of more complete classifications. Therefore the addition of primordial kT to the subsystem initiator partons does not automatically guarantee overall pT conservation. Various tricks are used to minimize the mismatch, with a brute force shift of all parton pT's as a final step.

Much of the above information is stored in a vector of `ResolvedParton` objects, which each contains flavour and momentum information, as well as valence/companion information and more. The `BeamParticle` method `list()` shows the contents of this vector, mainly for debug purposes.

The `BeamRemnants` class takes over for the final step of adding primordial kT to the initiators and remnants, assigning the relative longitudinal momentum sharing among the remnants, and constructing the overall kinematics and colour flow. This step couples the two sides of an event, and could therefore not be covered in the `BeamParticle` class, which only considers one beam at a time.

The methods of these classes are not intended for general use, and so are not described here.

In addition to the parameters described on this page, note that the choice of parton densities is made in the `Pythia` class. Then pointers to the pdf's are handed on to `BeamParticle` at initialization, for all subsequent usage.

### Primordial kT

The primordial kT of initiators of hard-scattering subsystems are selected according to Gaussian distributions in p_x and p_y separately. The widths of these distributions are chosen to be dependent on the hard scale of the central process and on the mass of the whole subsystem defined by the two initiators:
sigma = (sigma_soft * Q_half + sigma_hard * Q) / (Q_half + Q) * m / (m_half + m)
Here Q is the hard-process renormalization scale for the hardest process and the pT scale for subsequent multiparton interactions, m the mass of the system, and sigma_soft, sigma_hard, Q_half and m_half parameters defined below. Furthermore each separately defined beam remnant has a distribution of width sigma_remn, independently of kinematical variables.

`flag` BeamRemnants:primordialKT (`default = on`)
Allow or not selection of primordial kT according to the parameter values below.

`parm` BeamRemnants:primordialKTsoft (`default = 0.5`; `minimum = 0.`)
The width sigma_soft in the above equation, assigned as a primordial kT to initiators in the soft-interaction limit.

`parm` BeamRemnants:primordialKThard (`default = 2.0`; `minimum = 0.`)
The width sigma_hard in the above equation, assigned as a primordial kT to initiators in the hard-interaction limit.

`parm` BeamRemnants:halfScaleForKT (`default = 1.`; `minimum = 0.`)
The scale Q_half in the equation above, defining the half-way point between hard and soft interactions.

`parm` BeamRemnants:halfMassForKT (`default = 1.`; `minimum = 0.`)
The scale m_half in the equation above, defining the half-way point between low-mass and high-mass subsystems. (Kinematics construction can easily fail if a system is assigned a primordial kT value higher than its mass, so the mass-dampening is intended to reduce some troubles later on.)

`parm` BeamRemnants:primordialKTremnant (`default = 0.4`; `minimum = 0.`)
The width sigma_remn, assigned as a primordial kT to beam-remnant partons.

A net kT imbalance is obtained from the vector sum of the primordial kT values of all initiators and all beam remnants. This quantity is compensated by a shift shared equally between all partons, except that the dampening factor m / (m_half + m) is again used to suppress the role of small-mass systems.

Note that the current sigma definition implies that <pT^2> = <p_x^2>+ <p_y^2> = 2 sigma^2. It thus cannot be compared directly with the sigma of nonperturbative hadronization, where each quark-antiquark breakup corresponds to <pT^2> = sigma^2 and only for hadrons it holds that <pT^2> = 2 sigma^2. The comparison is further complicated by the reduction of primordial kT values by the overall compensation mechanism.

`flag` BeamRemnants:rescatterRestoreY (`default = off`)
Is only relevant when rescattering is switched on in the multiparton interactions scenario. For a normal interaction the rapidity and mass of a system is preserved when primordial kT is introduced, by appropriate modification of the incoming parton momenta. Kinematics construction is more complicated for a rescattering, and two options are offered. Differences between these can be used to explore systematic uncertainties in the rescattering framework.
The default behaviour is to keep the incoming rescattered parton as is, but to modify the unrescattered incoming parton so as to preserve the invariant mass of the system. Thereby the rapidity of the rescattering is modified.
The alternative is to retain the rapidity (and mass) of the rescattered system when primordial kT is introduced. This is made at the expense of a modified longitudinal momentum of the incoming rescattered parton, so that it does not agree with the momentum it ought to have had by the kinematics of the previous interaction.
For a double rescattering, when both incoming partons have already scattered, there is no obvious way to retain the invariant mass of the system in the first approach, so the second is always used.

### Colour flow

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, but currently no parameters are directly associated with it. However, a simple "minimal" procedure of colour flow only via the beam remnants does not result in a scenario in agreement with data, 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. As a simple attempt, an additional step is introduced, wherein the gluons of a lower-pT system are merged with the ones in a higher-pT one.

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

`parm` BeamRemnants:reconnectRange (`default = 10.0`; `minimum = 0.`; `maximum = 10.`)
A system with a hard scale pT 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 `reconnectRange` times pT0, the latter being the same energy-dependent dampening parameter as used for multiparton interactions. Thus it is easy to merge a low-pT system with any other, but difficult to merge two high-pT ones with each other.

The procedure is used 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. Colour inside a resonance therefore is not reconnected. This is a deliberate choice, but certainly open to discussion and extensions at a later stage, as is the rest of this procedure.

### Further variables

`mode` BeamRemnants:maxValQuark (`default = 3`; `minimum = 0`; `maximum = 5`)
The maximum valence quark kind allowed in acceptable incoming beams, for which multiparton interactions are simulated. Default is that hadrons may contain u, d and s quarks, but not c and b ones, since sensible kinematics has not really been worked out for the latter.

`mode` BeamRemnants:companionPower (`default = 4`; `minimum = 0`; `maximum = 4`)
When a sea quark has been found, a companion antisea quark ought to be nearby in x. The shape of this distribution can be derived from the gluon mother distribution convoluted with the g -> q qbar splitting kernel. In practice, simple solutions are only feasible if the gluon shape is assumed to be of the form g(x) ~ (1 - x)^p / x, where p is an integer power, the parameter above. Allowed values correspond to the cases programmed.
Since the whole framework is approximate anyway, this should be good enough. Note that companions typically are found at small Q^2, if at all, so the form is supposed to represent g(x) at small Q^2 scales, close to the lower cutoff for multiparton interactions.

When assigning relative momentum fractions to beam-remnant partons, valence quarks are chosen according to a distribution like (1 - x)^power / sqrt(x). This power is given below for quarks in mesons, and separately for u and d quarks in the proton, based on the approximate shape of low-Q^2 parton densities. The power for other baryons is derived from the proton ones, by an appropriate mixing. The x of a diquark is chosen as the sum of its two constituent x values, and can thus be above unity. (A common rescaling of all remnant partons and particles will fix that.) An additional enhancement of the diquark momentum is obtained by its x value being rescaled by the `valenceDiqEnhance` factor.

`parm` BeamRemnants:valencePowerMeson (`default = 0.8`; `minimum = 0.`)
The abovementioned power for valence quarks in mesons.

`parm` BeamRemnants:valencePowerUinP (`default = 3.5`; `minimum = 0.`)
The abovementioned power for valence u quarks in protons.

`parm` BeamRemnants:valencePowerDinP (`default = 2.0`; `minimum = 0.`)
The abovementioned power for valence d quarks in protons.

`parm` BeamRemnants:valenceDiqEnhance (`default = 2.0`; `minimum = 0.5`; `maximum = 10.`)
Enhancement factor for valence diquarks in baryons, relative to the simple sum of the two constituent quarks.

`flag` BeamRemnants:allowJunction (`default = on`)
The `off` option is intended for debug purposes only, as follows. When more than one valence quark is kicked out of a baryon beam, as part of the multiparton interactions scenario, the subsequent hadronization is described in terms of a junction string topology. This description involves a number of technical complications that may make the program more unstable. As an alternative, by switching this option off, junction configurations are rejected (which gives an error message that the remnant flavour setup failed), and the multiparton interactions and showers are redone until a junction-free topology is found.