<chapter name="StringFragmentation"> 
 
<h2>Lund String Fragmentation</h2> 
 
The standard fragmentation in PYTHIA is based on the Lund string model 
<ref>And83, Sjo84</ref>. Several different aspects are involved in 
the physics description, which here therefore is split accordingly. 
This also, at least partly, reflects the set of classes involved in 
the fragmentation machinery. See the 
<aloc href="HadronizationOverview">Hadronization Overview</aloc> 
to understand how the key classes are related, and also how 
the basic Lund String Fragmentation machinery is the starting point 
for a number of alternatives or extensions. 
 
<p/> 
There are three main auxiliary classes for string fragmentation, 
each handling an important physics step. Many of the settings for 
each of them play a key role in the tuning to data, while some others 
should not be touched except by experts. 
<ul> 
<li>The choice of quark flavours at string breaks, and the choice of 
a hadron from a given flavour combination, is managed in the 
<code>StringFlav</code> class, with settings as described on the 
<aloc href="FlavourSelection">Flavour Selection</aloc> page. 
The fragmentation flavour-choice machinery is also used in a few 
other places of the program, notably in particle decays. 
</li> 
<li>The choice of <ei>pT</ei> transverse momentum kicks in string breaks 
is managed by the <code>StringPT</code> class, with settings as described 
on the <aloc href="PTSelection">pT Selection</aloc> page. 
</li> 
<li>The choice of the <ei>z</ei> variable, representing the 
energy-momentum lightcone fraction that a new hadron takes out of the 
remaining (i.e. not yet fragmented) amount, 
is managed by the <code>StringZ</code> class, with settings as described 
on the <aloc href="ZSelection">z Selection</aloc> page. 
</li> 
</ul> 
 
<p/> 
Several further options and parameters, e.g., for the joining of jets 
and for the handling of a number of special systems, such as low-mass 
strings and string junctions, are documented below. Most of them are 
intended for experts, and can be left at their default values. 
 
<h3>Jet joining procedure</h3> 
 
String fragmentation is carried out iteratively from both string ends 
inwards, which means that the two chains of hadrons have to be joined 
up somewhere in the middle of the event. This joining is described by 
parameters that in principle follow from the standard fragmentation 
parameters. Ideally, these joining parameters should be tuned such 
that the rapidity spacing and mass distribution of hadrons produced in 
the joining step match those produced in the standard fragmentation 
process as closely as possible.  The current default values were 
determined for the JETSET tune and have not been retuned since. Recent 
studies have shown that these choices do not produce a smooth joining 
for the current default Monash tune settings. Work is underway to 
improve the smoothness - and robustness - of this procedure. As a 
temporary step, the <code>stopMass</code> below was somewhat reduced 
in version 8.316, from <ei>1.0</ei> to <ei>0.8</ei> GeV. 
 
<parm name="StringFragmentation:stopMass" default="0.8" min="0.0" max="2.0"> 
Is used to define a <ei>W_min = m_q1 + m_q2 + stopMass</ei>, 
where <ei>m_q1</ei> and <ei>m_q2</ei> are the masses of the two 
current endpoint quarks or diquarks. 
</parm> 
 
<parm name="StringFragmentation:stopNewFlav" default="2.0" min="0.0" 
max="2.0"> 
Add to <ei>W_min</ei> an amount <ei>stopNewFlav * m_q_last</ei>, 
where <ei>q_last</ei> is the last <ei>q qbar</ei> pair produced 
between the final two hadrons. 
</parm> 
 
<parm name="StringFragmentation:stopSmear" default="0.2" min="0.0" max="0.5"> 
The <ei>W_min</ei> above is then smeared uniformly in the range 
<ei>W_min_smeared = W_min * [ 1 - stopSmear, 1 + stopSmear ]</ei>. 
</parm> 
 
<p/> 
This <ei>W_min_smeared</ei> is then compared with the current remaining 
<ei>W_transverse</ei> to determine if there is energy left for further 
particle production. If not, i.e. if 
<ei>W_transverse &lt; W_min_smeared</ei>, the final two particles are 
produced from what is currently left, if possible. (If not, the 
fragmentation process is started over.) 
 
<h3>Colour tracing</h3> 
 
<flag name="StringFragmentation:TraceColours" default="off"> 
In some cases it is interesting to trace the primary hadrons back 
to the string pieces from which they were 
formed. If <code>StringFragmentation:TraceColours</code> is switched 
<code>on</code>, this is done by setting colour and anticolour 
indices for the primary hadrons to the indices of the string piece 
where the corresponding break-ups are assumed to have happened. To 
avoid the possible confusion of having colour indices on colour 
singlet particles, this flag is by default <code>off</code>. 
</flag> 
 
<h3>Simplifying systems</h3> 
 
There are a few situations when it is meaningful to simplify the 
original task, one way or another. 
 
<parm name="HadronLevel:mStringMin" default="1." min="0.5" max="1.5"> 
Decides whether a partonic system should be considered as a normal 
string or a ministring, the latter only producing one or two primary 
hadrons. The system mass should be above <ei>mStringMin</ei> plus the 
sum of quark/diquark constituent masses for a normal string description, 
else the ministring scenario is used. 
</parm> 
 
<parm name="FragmentationSystems:mJoin" default="0.3" min="0.2" max="1."> 
When two colour-connected partons are very nearby, with at least 
one being a gluon, they can be joined into one, to avoid technical 
problems of very small string regions. The requirement for joining is 
that the invariant mass of the pair is below <ei>mJoin</ei>, where a 
gluon only counts with half its momentum, i.e. with its contribution 
to the string region under consideration. (Note that, for technical 
reasons, the 0.2 GeV lower limit is de facto hardcoded.) 
</parm> 
 
<parm name="FragmentationSystems:mJoinJunction" default="1.0" min="0.5" 
max="2."> 
When the invariant mass of two of the quarks in a three-quark junction 
string system becomes too small, the system is simplified to a 
quark-diquark simple string. The requirement for this simplification 
is that the diquark mass, minus the two quark masses, falls below 
<ei>mJoinJunction</ei>. Gluons on the string between the junction and 
the respective quark, if any, are counted as part of the quark 
four-momentum. Those on the two combined legs are clustered with the 
diquark when it is formed. 
</parm> 
 
<h3>Ministrings</h3> 
 
The <code>MiniStringFragmentation</code> machinery is only used when a 
string system has so small invariant mass that normal string fragmentation 
is difficult/impossible. Instead one or two particles are produced, 
in the former case shuffling energy-momentum relative to another 
colour singlet system in the event, while preserving the invariant 
mass of that system. With one exception parameters are the same as 
defined for normal string fragmentation, to the extent that they are 
at all applicable in this case. 
 
A discussion of the relevant physics is found in <ref>Nor00</ref>. 
The current implementation does not completely abide to the scheme 
presented there, however, but has in part been simplified. (In part 
for greater clarity, in part since the class is not quite finished yet.) 
 
<modeopen name="MiniStringFragmentation:nTry" default="2" min="1" max="10"> 
Whenever the machinery is called, first this many attempts are made 
to pick two hadrons that the system fragments to. If the hadrons are 
too massive the attempt will fail, but a new subsequent try could 
involve other flavour and hadrons and thus still succeed. 
After <ei>nTry</ei> attempts, instead an attempt is made to produce a 
single hadron from the system. Should also this fail, some further 
attempts at obtaining two hadrons will be made before eventually 
giving up. 
</modeopen> 
 
<flag name="MiniStringFragmentation:tryAfterFailedFrag" default="off"> 
If normal string fragmentation fails for a parton system, it is optionally 
possible to attempt to fragment it as if it had been a ministring 
(c.f. <code>HadronLevel:mStringMin</code>). This is mainly relevant for 
heavy-ion collisions and for the QCD-based colour-reconnection model, 
where many high-multiplicity events have a higher probability to have 
failed fragmentation (hence throwing the whole event away may skew the 
multiplicity distribution). 
</flag> 
 
<h3>String junctions</h3> 
 
A junction topology corresponds to an Y arrangement of strings 
i.e. where three string pieces have to be joined up in a junction. 
Such topologies can arise if several valence quarks are kicked out 
from a proton beam, or in baryon-number-violating SUSY decays. 
Special attention is necessary to handle the region just around the 
junction, where the baryon number topologically is located. The 
junction fragmentation scheme is described in <ref>Sjo03</ref> and 
<ref>Alt24</ref>. The parameters in this section should not be 
touched except by experts. 
 
<parm name="StringFragmentation:pNormJunction" default="2.0" min="0.5" 
max="10"> 
Used to find the effective rest frame of the junction, which is 
complicated when the three string legs may contain additional 
gluons between the junction and the endpoint. Should in principle be 
(close to) <ei>sqrt((1 + a) / b)</ei>, with <ei>a</ei> and <ei>b</ei> 
the parameters of the Lund symmetric fragmentation function. 
</parm> 
 
<parm name="StringFragmentation:eJunctionCutoff" default="0.0"> 
Used as a stopping condition for the fragmentation of the first two 
junction legs. Fragmentation of the given junction leg is stopped if 
performing another break would leave the remaining energy of the 
junction leg below <ei>eJunctionCutoff</ei>. Value should be less than 
<ei>eBothLeftJunction</ei>. 
</parm> 
 
<parm name="StringFragmentation:mJunctionCutoff" default="0.0"> 
Used as a stopping condition for the fragmentation of the first two 
junction legs. Fragmentation of the given junction leg is stopped if 
performing another break would leave the mass of the junction diquark 
below <ei>mJunctionCutoff</ei>. 
</parm> 
 
<parm name="StringFragmentation:eBothLeftJunction" default="1.0" min="0.5"> 
Retry (up to 10 times) when the first two considered strings in to a 
junction both have a remaining energy (in the junction rest frame) 
above this number. 
</parm> 
 
<parm name="StringFragmentation:eMaxLeftJunction" default="10.0" min="0."> 
Retry (up to 10 times) when the first two considered strings in to a 
junction has a highest remaining energy (in the junction rest frame) 
above a random energy evenly distributed between 
<ei>eBothLeftJunction</ei> and 
<ei>eBothLeftJunction + eMaxLeftJunction</ei> 
(drawn anew for each test). 
</parm> 
 
<parm name="StringFragmentation:eMinLeftJunction" default="0.2" min="0."> 
Retry (up to 10 times) when the invariant mass-squared of the final leg 
and the leftover momentum of the first two treated legs falls below 
<ei>eMinLeftJunction</ei> times the energy of the final leg (in the 
junction rest frame). 
</parm> 
 
<flag name="StringFragmentation:doStrangeJunctions" default="off"> 
Switching this parameter on allows strangeness enhancement for string breaks 
next to a junction. 
</flag> 
 
<parm name="StringFragmentation:enhanceStrangeJunction" default="0.5" min="0." 
      max="1.0"> 
This parameter, <ei>s<sub>J</sub></ei>, scales how much strangeness 
enhancement around a junction by modifying the probability 
<code>StringFlav:probStoUD</code>, 
<eq> 
    P'(s:u/d) = P(s:u/d)<sup>(1 - s_J)</sup>. 
</eq> 
</parm> 
 
</chapter> 
 
<!-- Copyright (C) 2025 Torbjorn Sjostrand --> 
