## Spacelike Showers

The PYTHIA algorithm for spacelike initial-state showers is based on the article [Sjo05], where a transverse-momentum-ordered backwards evolution scheme is introduced, with the extension to fully interleaved evolution covered in [Cor10a]. This algorithm is a further development of the virtuality-ordered one presented in [Sjo85], with matching to first-order matrix element for Z^0, W^+- and Higgs (in the m_t → infinity limit) production as introduced in [Miu99].

The normal user is not expected to call `SpaceShower` directly, but only have it called from `Pythia`, via `PartonLevel`. Nonetheless, some of the parameters below, in particular `SpaceShower:alphaSvalue`, would be of interest for uncertainty estimates and tuning exercises. Note that PYTHIA also incorporates an automated framework for shower uncertainty variations.

### Main variables

The maximum pT to be allowed in the shower evolution is related to the nature of the hard process itself. It involves a delicate balance between not double-counting and not leaving any gaps in the coverage. The best procedure may depend on information only the user has: how the events were generated and mixed (e.g. with Les Houches Accord external input), and how they are intended to be used. Therefore a few options are available, with a sensible default behaviour.

`mode` SpaceShower:pTmaxMatch (`default = 0`; `minimum = 0`; `maximum = 2`)
Way in which the maximum shower evolution scale is set to match the scale of the hard process itself.
`option` 0 : (i) if the final state of the hard process (not counting subsequent resonance decays) contains at least one quark (u, d, s, c ,b), gluon or photon then pT_max is chosen to be the factorization scale for internal processes and the `scale` value for Les Houches input; (ii) if not, emissions are allowed to go all the way up to the kinematical limit. The reasoning is that in the former set of processes the ISR emission of yet another quark, gluon or photon could lead to double-counting, while no such danger exists in the latter case.
`option` 1 : always use the factorization scale for an internal process and the `scale` value for Les Houches input, i.e. the lower value. This should avoid double-counting, but may leave out some emissions that ought to have been simulated. (Also known as wimpy showers.)
`option` 2 : always allow emissions up to the kinematical limit. This will simulate all possible event topologies, but may lead to double-counting. (Also known as power showers.)
Note 1: Some processes contain matrix-element matching to the first emission; this is the case notably for single gamma^*/Z^0, W^+- and H^0 production. Then default and option 2 give the correct result, while option 1 should never be used.
Note 2: as enumerated in the text, these options take effect both for internal and external processes. Whether a particular option makes sense depends on the context. For instance, if events for the same basic process to different orders are to be matched, then option 1 would be a reasonable first guess. Note, however, that a program like the POWHEG BOX uses a pT definition for ISR and FSR that does not quite agree with the PYTHIA evolution scale, and thus there will be some amount of mismatch. In more sophisticated descriptions, therefore, option 2 could be combined with `UserHooks` vetoes on emissions that would lead to double-counting, using more flexible phase space boundaries. Further details are found in the Matching and Merging description, with an example in `examples/main31`. Option 0, finally, may be most realistic when only Born-level processes are involved, possibly in combination with a nonzero `SpaceShower:pTdampMatch`. The rules used for avoiding double-counting are not foolproof, however. As an example, for the t-channel process gamma gamma → e^+ e^- its pT scale is the plausible upper shower limit, with only dampened emissions above it. But the initial state is not checked and, had only incoming quarks and gluons been taken into account, only the s-channel process q qbar → gamma^*/Z^0 → e^+ e^- would have been possible, where indeed the whole phase space should be populated. So this is erroneously used, giving too much emissions.
Note 3: These options only apply to the hard interaction. If a "second hard" process is present, the two are analyzed and set separately for the default 0 option, while both are affected the same way for non-default options 1 and 2. Emissions off subsequent multiparton interactions are always constrained to be below the factorization scale of each process itself.

`parm` SpaceShower:pTmaxFudge (`default = 1.0`; `minimum = 0.25`; `maximum = 2.0`)
In cases where the above `pTmaxMatch` rules would imply that pT_max = pT_factorization, `pTmaxFudge` introduces a multiplicative factor f such that instead pT_max = f * pT_factorization. Only applies to the hardest interaction in an event, and a "second hard" if there is such a one, cf. below. It is strongly suggested that f = 1, but variations around this default can be useful to test this assumption.

`parm` SpaceShower:pTmaxFudgeMPI (`default = 1.0`; `minimum = 0.25`; `maximum = 2.0`)
A multiplicative factor f such that pT_max = f * pT_factorization, as above, but here for the non-hardest interactions (when multiparton interactions are allowed).

`mode` SpaceShower:pTdampMatch (`default = 3`; `minimum = 0`; `maximum = 4`)
These options only take effect when a process is allowed to radiate up to the kinematical limit by the above `pTmaxMatch` choice, and no matrix-element corrections are available. Then, in many processes, the fall-off in pT will be too slow by one factor of pT^2. That is, while showers have an approximate dpT^2/pT^2 shape, often it should become like dpT^2/pT^4 at pT values above the scale of the hard process. Whether this actually is the case depends on the particular process studied, e.g. if t-channel gluon exchange is likely to dominate. If so, the options below could provide a reasonable high-pT behaviour without requiring higher-order calculations.
`option` 0 : emissions go up to the kinematical limit, with no special dampening.
`option` 1 : emissions go up to the kinematical limit, but dampened by a factor k^2 Q^2_fac/(pT^2 + k^2 Q^2_fac), where Q_fac is the factorization scale and k is a multiplicative fudge factor stored in `pTdampFudge` below.
`option` 2 : emissions go up to the kinematical limit, but dampened by a factor k^2 Q^2_ren/(pT^2 + k^2 Q^2_ren), where Q_ren is the renormalization scale and k is a multiplicative fudge factor stored in `pTdampFudge` below.
`option` 3 : as option 1, but in addition to the standard requirements for dampening it is further necessary to have ar least two top or beyond-the-Standard-Model coloured particles in the final state. Examples include t tbar and squark gluino production.
`option` 4 : as option 2, but in addition to the standard requirements for dampening it is further necessary to have ar least two top or beyond-the-Standard-Model coloured particles in the final state. Examples include t tbar and squark gluino production.
Note: These options only apply to the hard interaction. Specifically, a "second hard" interaction would not be affected. Emissions off subsequent multiparton interactions are always constrained to be below the factorization scale of the process itself.

`parm` SpaceShower:pTdampFudge (`default = 1.0`; `minimum = 0.25`; `maximum = 4.0`)
In cases 1 and 2 above, where a dampening is imposed at around the factorization or renormalization scale, respectively, this allows the pT scale of dampening of radiation by a half to be shifted by this factor relative to the default Q_fac or Q_ren. This number ought to be in the neighbourhood of unity, but variations away from this value could do better in some processes.

The amount of QCD radiation in the shower is determined by

`parm` SpaceShower:alphaSvalue (`default = 0.1365`; `minimum = 0.06`; `maximum = 0.25`)
The alpha_strong value at scale `M_Z^2`.

The actual value is then regulated by the running to the scale pT^2, at which it is evaluated

`mode` SpaceShower:alphaSorder (`default = 1`; `minimum = 0`; `maximum = 2`)
Order at which alpha_strong runs,
`option` 0 : zeroth order, i.e. alpha_strong is kept fixed.
`option` 1 : first order, which is the normal value.
`option` 2 : second order. Since other parts of the code do not go to second order there is no strong reason to use this option, but there is also nothing wrong with it.

The CMW rescaling of Lambda_QCD (see the section on StandardModelParameters) can be applied to the alpha_strong values used for spacelike showers. Note that tunes using this option need lower values of alpha_strong(m_Z^2) than tunes that do not.

`flag` SpaceShower:alphaSuseCMW (`default = off`)
`option` off : Do not apply the CMW rescaling.
`option` on : Apply the CMW rescaling, increasing Lambda_QCD for spacelike showers by a factor roughly 1.6.

QED radiation is regulated by the alpha_electromagnetic value at the pT^2 scale of a branching.

`mode` SpaceShower:alphaEMorder (`default = 1`; `minimum = -1`; `maximum = 1`)
The running of alpha_em.
`option` 1 : first-order running, constrained to agree with `StandardModel:alphaEMmZ` at the Z^0 mass.
`option` 0 : zeroth order, i.e. alpha_em is kept fixed at its value at vanishing momentum transfer.
`option` -1 : zeroth order, i.e. alpha_em is kept fixed, but at `StandardModel:alphaEMmZ`, i.e. its value at the Z^0 mass.

The natural scale for couplings and PDFs is pT^2. To explore uncertainties it is possibly to vary around this value, however, in analogy with what can be done for hard processes. (Note that there is also an automated framework for shower uncertainties.)

`parm` SpaceShower:renormMultFac (`default = 1.`; `minimum = 0.1`; `maximum = 10.`)
The default pT^2 renormalization scale is multiplied by this prefactor. For QCD this is equivalent to a change of Lambda^2 in the opposite direction, i.e. to a change of alpha_strong(M_Z^2) (except that flavour thresholds remain at fixed scales). Below, when pT^2 + pT_0^2 is used as scale, it is this whole expression that is multiplied by the prefactor.

`parm` SpaceShower:factorMultFac (`default = 1.`; `minimum = 0.1`; `maximum = 10.`)
The default pT^2 factorization scale is multiplied by this prefactor.

There are two complementary ways of regularizing the small-pT divergence, a sharp cutoff and a smooth dampening. These can be combined as desired but it makes sense to coordinate with how the same issue is handled in multiparton interactions.

`flag` SpaceShower:samePTasMPI (`default = off`)
Regularize the pT → 0 divergence using the same sharp cutoff and smooth dampening parameters as used to describe multiparton interactions. That is, the `MultipartonInteractions:pT0Ref`, `MultipartonInteractions:ecmRef`, `MultipartonInteractions:ecmPow` and `MultipartonInteractions:pTmin` parameters are used to regularize all ISR QCD radiation, rather than the corresponding parameters below. This is a sensible physics ansatz, based on the assumption that colour screening effects influence both MPI and ISR in the same way. Photon radiation is regularized separately in either case.
Note: For photon-photon collisions these parameters are set as in Photoproduction.
Warning: if a large `pT0` is picked for multiparton interactions, such that the integrated interaction cross section is below the nondiffractive inelastic one, this `pT0` will automatically be scaled down to cope. Information on such a rescaling does NOT propagate to `SpaceShower`, however.

The actual pT0 parameter used at a given CM energy scale, ecmNow, is obtained from a power law or a logarithmic parametrization. The former is default with hadron beams and the latter for photon-photon collisions.

`mode` SpaceShower:pT0parametrization (`default = 0`; `minimum = 0`; `maximum = 1`)
Choice of pT0 parametrization.
`option` 0 : Power law dependence on ecmNow:
pT0 = pT0(ecmNow) = pT0Ref * (ecmNow / ecmRef)^ecmPow
`option` 1 : Logarithmic dependence on ecmNow:
pT0 = pT0(ecmNow) = pT0Ref + ecmPow * log (ecmNow / ecmRef)
where pT0Ref, ecmRef and ecmPow are the three parameters below.

`parm` SpaceShower:pT0Ref (`default = 2.0`; `minimum = 0.5`; `maximum = 10.0`)
Regularization of the divergence of the QCD emission probability for pT → 0 is obtained by a factor pT^2 / (pT0^2 + pT^2), and by using an alpha_s(pT0^2 + pT^2). An energy dependence of the pT0 choice is introduced by the next two parameters, so that pT0Ref is the pT0 value for the reference cm energy, pT0Ref = pT0(ecmRef).

`parm` SpaceShower:ecmRef (`default = 7000.0`; `minimum = 1.`)
The ecmRef reference energy scale introduced above.

`parm` SpaceShower:ecmPow (`default = 0.0`; `minimum = 0.`; `maximum = 0.5`)
The ecmPow energy rescaling pace introduced above.

`parm` SpaceShower:pTmin (`default = 0.2`; `minimum = 0.1`; `maximum = 10.0`)
Lower cutoff in pT, below which no further ISR branchings are allowed. Normally the pT0 above would be used to provide the main regularization of the branching rate for pT → 0, in which case pTmin is used mainly for technical reasons. It is possible, however, to set pT0Ref = 0 and use pTmin to provide a step-function regularization, or to combine them in intermediate approaches. Currently pTmin is taken to be energy-independent.

`parm` SpaceShower:pTminChgQ (`default = 0.5`; `minimum = 0.01`)
Parton shower cut-off pT for photon coupling to a coloured particle.

`parm` SpaceShower:pTminChgL (`default = 0.0005`; `minimum = 0.0001`)
Parton shower cut-off mass for pure QED branchings. Assumed smaller than (or equal to) pTminChgQ.

`flag` SpaceShower:rapidityOrder (`default = on`)
Force emissions, after the first, to be ordered in rapidity, i.e. in terms of decreasing angles in a backwards-evolution sense. Could be used to probe sensitivity to unordered emissions. Only affects QCD emissions, and only the hard subcollision of an event. (For the case "soft QCD" processes the first MPI counts as the hard subcollision.)

`flag` SpaceShower:rapidityOrderMPI (`default = on`)
Same as the last switch, but this time only emissions in secondary scattering systems from MPIs are forced to be ordered in rapidity. Each MPI is ordered separately from the others.

### Dipole showers

By default the recoil of an ISR emission is taken by the whole final state. The option below gives an alternative approach with local recoils, where only one final-state parton takes the recoil of an emission. See [Cab17] for further details on the philosophy and implementation.

The existing initial-initial global recoil scheme is maintained for an emission off a colour line that stretches through the hard process, so it is the handling of initial-final dipole ends that is changed. Here the single recoiler is picked based on the colour flow of the hard process. Additionally the description unifies the emission of a gluon from the initial-final and final-initial dipole ends, and handles both as part of the ISR framework. Therefore the separation into ISR and FSR is not a meaningful classification, and either both should be simulated or none.

Note that this option should not be combined with the global option for FSR, `TimeShower:globalRecoil`. Further some settings are neglected internally to ensure the same behaviour as obtained for `TimeShower:allowBeamRecoil = on`, `TimeShower:dampenBeamRecoil = off`, and `SpaceShower:phiIntAsym = off`.

The dipole recoil option for the first time allows the simulation of Deeply Inelastic Scattering processes in PYTHIA 8, see the `main36.cc` example. Note that the simultaneous emission of photons off the lepton leg has not yet been implemented, so you need to set `PDF:lepton = off` and `TimeShower:QEDshowerByL = off`. You are further recommended to set `SpaceShower:pTmaxMatch = 2` to fill the whole phase space with parton showers. This is allowed since the shower and matrix-element behaviours match well over the whole phase space (at least for the first emission).

`flag` SpaceShower:dipoleRecoil (`default = off`)
Option to switch on the dipole-recoil scheme as described above.

### Weak showers

The emission of weak gauge bosons is an integrated part of the initial- and final-state radiation, see Weak Showers. The following settings are those specifically related to the initial-state weak radiation, while common settings are found in the Weak Showers description.

`flag` SpaceShower:weakShower (`default = off`)
Allow a weak shower, yes or no.

`mode` SpaceShower:weakShowerMode (`default = 0`; `minimum = 0`; `maximum = 2`)
Determine which branchings are allowed.
`option` 0 : both W^+- and Z^0 branchings.
`option` 1 : only W^+- branchings.
`option` 2 : only Z^0 branchings.

`parm` SpaceShower:pTminWeak (`default = 1.0`; `minimum = 0.1`; `maximum = 2.0`)
Parton shower cut-off pT for weak branchings.

### Further variables

These should normally not be touched. Their only function is for cross-checks.

There are three flags you can use to switch on or off selected branchings in the shower:

`flag` SpaceShower:QCDshower (`default = on`)
Allow a QCD shower; on/off = true/false.

`flag` SpaceShower:QEDshowerByQ (`default = on`)
Allow quarks to radiate photons; on/off = true/false.

`flag` SpaceShower:QEDshowerByL (`default = on`)
Allow leptons to radiate photons; on/off = true/false.

There are some further possibilities to modify the shower:

`flag` SpaceShower:MEcorrections (`default = on`)
Use of matrix element corrections; on/off = true/false.

`flag` SpaceShower:MEafterFirst (`default = on`)
Use of matrix element corrections also after the first emission, for dipole ends of the same system that did not yet radiate. Only has a meaning if `MEcorrections` above is switched on.

`flag` SpaceShower:phiPolAsym (`default = on`)
Azimuthal asymmetry induced by gluon polarization; on/off = true/false.

`flag` SpaceShower:phiPolAsymHard (`default = on`)
Extend the above azimuthal asymmetry (if on) also back to gluons produced in the hard process itself, where feasible; on/off = true/false.

`flag` SpaceShower:phiIntAsym (`default = on`)
Azimuthal asymmetry induced by interference; on/off = true/false.

`parm` SpaceShower:strengthIntAsym (`default = 0.7`; `minimum = 0.`; `maximum = 0.9`)
Size of asymmetry induced by interference. Natural value of order 0.5; expression would blow up for a value of 1.

`mode` SpaceShower:nQuarkIn (`default = 5`; `minimum = 0`; `maximum = 5`)
Number of allowed quark flavours in g → q qbar branchings, when kinematically allowed, and thereby also in incoming beams. Changing it to 4 would forbid g → b bbar, etc.

`flag` SpaceShower:useFixedFacScale (`default = off`)
Allow the possibility to use a fixed factorization scale, set by the `parm` below. This option is unphysical and only intended for toy-model and debug studies.

`parm` SpaceShower:fixedFacScale (`default = 100.`; `minimum = 1.`)
The fixed factorization scale, in GeV, that would be used in the evaluation of parton densities if the `flag` above is on.

### Technical notes

Almost everything is equivalent to the algorithm in [Sjo05,Cor10a]. Minor changes are as follows.

- It is now possible to have a second-order running alpha_s, in addition to fixed or first-order running.
- The description of heavy flavour production in the threshold region has been modified, so as to be more forgiving about mismatches between the c/b masses used in Pythia relative to those used in a respective PDF parametrization. The basic idea is that, in the threshold region of a heavy quark Q, Q = c/b, the effect of subsequent Q → Q g branchings is negligible. If so, then
  f_Q(x, pT2) = integral_mQ2^pT2 dpT'2/pT'2 * alpha_s(pT'2)/2pi * integral P(z) g(x', pT'2) delta(x - z x')
  so use this to select the pT2 of the g → Q Qbar branching. In the old formalism the same kind of behaviour should be obtained, but by a cancellation of a 1/f_Q that diverges at the threshold and a Sudakov that vanishes.
  The strategy therefore is that, once pT2 < f * mQ2, with f a parameter of the order of 2, a pT2 is chosen like dpT2/pT2 between mQ2 and f * mQ2, a nd a z flat in the allowed range. Thereafter acceptance is based on the product of three factors, representing the running of alpha_strong, the splitting kernel (including the mass term) and the gluon density weight. At failure, a new pT2 is chosen in the same range, i.e. is not required to be lower since no Sudakov is involved.
- The QED algorithm now allows for hadron beams with non-zero photon content. The backwards-evolution of a photon in a hadron is identical to that of a gluon, with CF → eq^2 and CA → 0. Note that this will only work in conjunction with parton distributions that explicitly include photons as part of the hadron structure, such as the NNPDF2.3 QCD+QED sets. The possibility of a fermion backwards-evolving to a photon has not yet been included, nor has photon backwards-evolution in lepton beams.