]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PYTHIA8/pythia8130/xmldoc/HadronLevelStandalone.xml
bug fix and small changed in the macros
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8130 / xmldoc / HadronLevelStandalone.xml
CommitLineData
5ad4eb21 1<chapter name="Hadron-Level Standalone">
2
3<h2>Hadron-Level Standalone</h2>
4
5The Les Houches Accord allows external process-level configurations
6to be fed in, for subsequent parton-level and hadron-level generation
7to be handled internally by PYTHIA. There is no correspondingly
8standardized interface if you have external events that have also
9been generated through the parton-level stage, so that only the
10hadron-level remains to be handled. A non-standard way to achieve this
11exists, however, and can be useful both for real applications and
12for various tests of the hadronization model on its own.
13
14<p/>
15The key trick is to set the flag <code>ProcessLevel:all = off</code>.
16When <code>pythia.next()</code> is called it then does not try to
17generate a hard process, and therefore also cannot do anything on the
18parton level. Instead only the <code>HadronLevel</code> methods are
19called, to take the current content of the event record stored in
20<code>pythia.event</code> as a starting point for any hadronization
21and decays that are allowed by the normal parameters of this step.
22Often the input would consist solely of partons grouped into colour
23singlets, but also (colour-singlet) particles are allowed.
24
25<p/>
26To set up all the parameters, a <code>pythia.init()</code> call has
27to be used, without any arguments. In brief, the structure of the
28main program therefore should be something like
29<pre>
30 Pythia pythia; // Declare generator.
31 Event& event = pythia.event // Convenient shorthand.
32 pythia.readString("ProcessLevel:all = off"); // The trick!
33 pythia.init(); // Initialization.
34 for (int iEvent = 0; iEvent < nEvent; ++iEvent) {
35 // Insert filling of event here!
36 pythia.next(); // Do the hadron level.
37 }
38</pre>
39Of course this should be supplemented by analysis of events, error checks,
40and so on, as for a normal PYTHIA run. The unique aspect is how to fill
41the <code>event</code> inside the loop, before <code>pythia.next()</code>
42is called.
43
44<h3>Input configuration</h3>
45
46To set up a new configuration the first step is to throw away the current
47one, with <code>event.reset()</code>. This routine will also reserve
48the zeroth entry in the even record to represent the event as a whole.
49
50<p/>
51With the <code>event.append(...)</code> methods a new entry is added at the
52bottom of the current record, i.e. the first time it is called entry
53number 1 is filled, and so on. The <code>append</code> method basically
54exists in four variants, either without or with history information,
55and with four-momentum provided either as a <code>Vec4</code> four-vector
56or as four individual components:
57<pre>
58 append( id, status, col, acol, p, m)
59 append( id, status, col, acol, px, py, pz, e, m)
60 append( id, status, mother1, mother2, daughter1, daughter2, col, acol, p, m)
61 append( id, status, mother1, mother2, daughter1, daughter2, col, acol, px, py, pz, e, m)
62</pre>
63The methods return the index at which the entry has been stored,
64but normally you would not use this feature.
65
66<p/>
67You can find descriptions of the input variables
68<aloc href="ParticleProperties">here</aloc>.
69The PDG particle code <code>id</code> and the Les Houches Accord colour
70<code>col</code> and anticolour <code>acol</code> tags must be set
71correctly. The four-momentum and mass have to be provided in units of GeV;
72if you omit the mass it defaults to 0.
73
74<p/>
75The status code can normally be simplified, however; you only need to recall
76that positive numbers correspond to particles that are still around, while
77negative numbers denote ones that already hadronized or decayed, so usually
78<ei>+-1</ei> is good enough. When <code>pythia.next()</code> is called
79those positive-status particles that hadronize/decay get the sign of the
80status code flipped to negative but the absolute value is retained. The
81new particles are added with normal PYTHIA status codes.
82
83<p/>
84For normal hadronization/decays in <code>pythia.next()</code> the
85history encoded in the mother and daughter indices is not used.
86Therefore the first two <code>append</code> methods, which set all these
87indices vanishing, should suffice. The subsequent hadronization/decays
88will still be properly documented.
89
90<p/>
91The exception is when you want to include junctions in your string
92topology, i.e. have three string pieces meet. Then you must insert in
93your event record the (decayed) particle that is the reason for the
94presence of a junction, e.g. a baryon beam remnant from which several
95valence quarks have been kicked out, or a neutralino that underwent a
96baryon-number-violating decay. This particle must have as daughters
97the three partons that together carry the baryon number.
98
99<p/>
100The sample program in <code>main21.cc</code> illustrates how you can work
101with this facility, both for simple parton configurations and for more
102complicated ones with junctions.
103
104<h3>Repeated hadronization or decay</h3>
105
106An alternative approach is possible with the
107<code>pythia.forceHadronLevel()</code> routine. This method does
108a call to the <code>HadronLevel</code> methods, irrespective of the
109value of the <code>HadronLevel:all</code> flag. If you hadronize
110externally generated events it is equivalent to a
111<code>pythia.next()</code> call with
112<code>ProcessLevel:all = off</code>.
113
114<p/>
115The real application instead is for repeated hadronization of the same
116PYTHIA process- and parton-level event. This may for some studies
117help to save time, given that these two first step are more
118time-consuming than the hadronization one.
119
120<p/>
121For repeated hadronization you should first generate an event as usual,
122but with <code>HadronLevel:all = off</code>. This event you can save
123in a temporary copy, e.g. <code>Event savedEvent = pythia.event</code>.
124Inside a loop you copy back with <code>pythia.event = savedEvent</code>,
125and call <code>pythia.forceHadronLevel()</code> to obtain a new
126hadronization history.
127
128<p/>
129A more limited form of repetition is if you want to decay a given kind
130of particle repeatedly, without having to generate the rest of the event
131anew. This could be the case e.g. in <ei>B</ei> physics applications.
132Then you can use the <code>pythia.moreDecays()</code> method, which
133decays all particles in the event record that have not been decayed
134but should have been done so. The
135<code>ParticleDataTable::mayDecay( id, false/true)</code> method
136may be used to switch off/on the decays of a particle species
137<code>id</code>, so that it is not decayed in the
138<code>pythia.next()</code> call but only inside a loop over a number of
139tries.
140
141<p/>
142Between each loop the newly produced decay products must be
143removed and the decayed particle status restored to undecayed.
144The former is simple, since the new products are appended to the
145end of the event record: <code>event.saveSize()</code> saves the
146initial size of the event record, and <code>event.restoreSize()</code>
147can later be used repeatedly to restore this original size, which means
148that the new particles at the end are thrown away. The latter is more
149complicated, and requires the user to identify the positions of all
150particles of the species and restore a positive status code with
151<code>event[i].statusPos()</code>.
152
153<p/>
154The <code>main15.cc</code> program illustrates both these methods,
155i.e. either repeated hadronization or repeated decay of PYTHIA
156events.
157
158</chapter>
159
160<!-- Copyright (C) 2008 Torbjorn Sjostrand -->