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