source: HiSusy/trunk/Pythia8/pythia8170/xmldoc/EventRecord.xml @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 22.0 KB
Line 
1<chapter name="The Event Record">
2
3<h2>The Event Record</h2>
4
5A <code>Pythia</code> instance contains two members of the 
6<code>Event</code> class. The one called <code>process</code> provides
7a brief summary of the main steps of the hard process, while the
8one called <code>event</code> contains the full history. The
9user would normally interact mainly with the second one, so
10we will examplify primarily with that one.
11
12<p/>
13The <code>Event</code> class to first approximation is a vector of
14<code>Particle</code>s, so that it can expand to fit the current
15event size. The index operator is overloaded, so that e.g.
16<code>event[i]</code> corresponds to the <ei>i</ei>'th particle
17of the object <code>event</code>. Thus <code>event[i].id()</code> 
18returns the identity of the <ei>i</ei>'th particle, and so on.
19Therefore the methods of the
20<code><aloc href="ParticleProperties">Particle</aloc></code> class
21are at least as essential as those of the <code>Event</code> class
22itself.
23
24<p/>
25As used inside PYTHIA, some conventions are imposed on the structure
26of the event record. Entry 0 of the <code>vector&lt;Particle&gt;</code> 
27is used to represent the event as a whole, with its total four-momentum
28and invariant mass, but does not form part of the event history.
29Lines 1 and 2 contains the two incoming beams, and only from here on
30history tracing works as could be expected. That way unassigned mother
31and daughter indices can be put 0 without ambiguity. Depending on the
32task at hand, a loop may therefore start at index 1 rather than 0
33without any loss. Specifically, for translation to other event record
34formats such as HepMC <ref>Dob01</ref>, where the first index is 1, the
35Pythia entry 0 definitely ought to be skipped in order to minimize the
36danger of indexing errors.
37
38<p/>
39In the following we will list the methods available.
40Only a few of them have a function to fill in normal user code.
41
42<h3>Basic output methods</h3>
43
44Some methods are available to read out information on the
45current event record:
46
47<method name="Particle& Event::operator[](int i)">
48</method>
49<methodmore name="const Particle& Event::operator[](int i)">
50</methodmore>
51<methodmore name="Particle& Event::at(int i)">
52returns a (<code>const</code>) reference to the <ei>i</ei>'th particle
53in the event record, which can be used to get (or set) all the
54<aloc href="ParticleProperties">properties</aloc> of this particle.
55</methodmore>
56
57<method name="int Event::size()">
58The event size, i.e. the sie of the <code>vector&lt;Particle&gt;</code>.
59Thus valid particles, to be accessed by the above indexing operator,
60are stored in the range <ei>0 &lt;= i &lt; size()</ei>. See comment
61above about the (ir)relevance of entry 0.
62</method>
63
64<method name="void Event::list()">
65</method>
66<methodmore name="void Event::list(ostream& os)">
67</methodmore>
68<methodmore name="void Event::list(bool showScaleAndVertex,
69bool showMothersAndDaughters = false)">
70</methodmore>
71<methodmore name="void Event::list(bool showScaleAndVertex,
72bool showMothersAndDaughters, ostream& os)">
73Provide a listing of the whole event, i.e. of the
74<code>vector&lt;Particle&gt;</code>. The methods with fewer arguments
75call the final one with the respective default values, and are
76non-inlined so they can be used in a debugger. The basic identity
77code, status, mother, daughter, colour, four-momentum and mass data
78are always given, but the methods can also be called with a few
79optional arguments for further information:
80<argument name="showScaleAndVertex" default="false"> optionally give a
81second line for each particle, with the production scale (in GeV),
82the particle polarization (dimensionless), the production vertex
83(in mm or mm/c) and the invariant lifetime (also in mm/c).
84</argument>
85<argument name="showMothersAndDaughters" default="false">
86gives a list of all daughters and mothers of a particle, as defined by
87the <code>motherList(i)</code> and <code>daughterList(i)</code> methods
88described below. It is mainly intended for debug purposes.
89</argument>
90<argument name="os" default="cout"> a reference to the <code>ostream</code>
91object to which the event listing will be directed.
92</argument>
93
94</method>
95
96<p/>
97Each <code>Particle</code> has two mother and two daughter indices.
98These may be used to encode zero, one, two or more mothers/daughters,
99depending on the combination of values and status code, according to
100well-defined <aloc href="ParticleProperties">rules</aloc>. The
101two methods below can do this job easier for you.
102
103<method name="vector&lt;int&gt; Event::motherList(int i)"> 
104returns a vector of all the mother indices of the particle at index
105<ei>i</ei>. This list is empty for entries 0, 1 and 2,
106i.e. the "system" in line 0 is not counted as part of the history.
107Normally the list contains one or two mothers, but it can also be more,
108e.g. in string fragmentation the whole fragmenting system is counted
109as mothers to the primary hadrons. Many particles may have the same
110<code>motherList</code>. Mothers are listed in ascending order.
111</method>
112
113<method name="vector&lt;int&gt; Event::daughterList(int i)">
114returns a vector of all the daughter indices of the particle at index
115<ei>i</ei>. This list is empty for a particle that did
116not decay (or, if the evolution is stopped early enough, a parton
117that did not branch), while otherwise it can contain a list of
118varying length, from one to many. For the two incoming beam particles,
119all shower initiators and beam remnants are counted as daughters,
120with the one in slot 0 being the one leading up to the hardest
121interaction. The "system" in line 0 does not have any daughters,
122i.e. is not counted as part of the history. Many partons may have the
123same <code>daughterList</code>. Daughters are listed in ascending order.
124</method>
125
126<method name="int Event::statusHepMC(int i)">
127returns the status code according to the HepMC conventions agreed in
128February 2009. This convention does not preserve the full information
129provided by the internal PYTHIA status code, as obtained by
130<code>Particle::status()</code>, but comes reasonably close.
131The allowed output values are:
132<ul>
133<li>0 : an empty entry, with no meaningful information and therefore
134to be skipped unconditionally (should not occur in PYTHIA);</li> 
135<li>1 : a final-state particle, i.e. a particle that is not decayed
136further by the generator (may also include unstable particles that
137are to be decayed later, as part of the detector simulation);</li> 
138<li>2 : a decayed Standard Model hadron or tau or mu lepton, excepting
139virtual intermediate states thereof (i.e. the particle must undergo
140a normal decay, not e.g. a shower branching);</li>
141<li>3 : a documentation entry (not used in PYTHIA);</li> 
142<li>4 : an incoming beam particle;</li> 
143<li>11 - 200 : an intermediate (decayed/branched/...) particle that does
144not fulfill the criteria of status code 2, with a generator-dependent
145classification of its nature; in PYTHIA the absolute value of the normal
146status code is used.</li> 
147</ul>
148
149</method>
150
151<h3>Further output methods</h3>
152
153The above methods are the main ones that a normal user would make
154frequent use of. There are some further methods that also could come
155in handy, in the exploration of the history of an event, but where
156the outcome is not always obvious if one is not familiar with the
157detailed structure of an event record.
158
159<method name="int Event::iTopCopy(int i)"> 
160</method>
161<methodmore name="int Event::iBotCopy(int i)"> 
162are used to trace carbon copies of the particle at index <ei>i</ei> up
163to its top mother or down to its bottom daughter. If there are no such
164carbon copies, <ei>i</ei> itself will be returned. A carbon copy is
165when the "same" particle appears several times in the event record, but
166with changed momentum owing to recoil effects.
167</methodmore>
168
169<method name="int Event::iTopCopyId(int i)"> 
170</method>
171<methodmore name="int Event::iBotCopyId(int i)"> 
172also trace top mother and bottom daughter, but do not require carbon
173copies, only that one can find an unbroken chain, of mothers or daughters,
174with the same flavour <code>id</code> code. When it encounters ambiguities,
175say a <ei>g -> g g</ei> branching or a <ei>u u -> u u</ei> hard scattering,
176it will stop the tracing and return the current position. It can be confused
177by nontrivial flavour changes, e.g. a hard process <ei>u d -> d u</ei> 
178by <ei>W^+-</ei> exchange will give the wrong answer. These methods
179therefore are of limited use for common particles, in particular for the
180gluon, but should work well for "rare" particles.
181</method>
182
183<method name="vector&lt;int&gt; Event::sisterList(int i)"> 
184returns a vector of all the sister indices of the particle at index
185<ei>i</ei>, i.e. all the daughters of the first mother, except the
186particle itself.
187</method>
188
189<method name="vector&lt;int&gt; Event::sisterListTopBot(int i,
190bool widenSearch = true)">
191returns a vector of all the sister indices of the particle at index
192<ei>i</ei>, tracking up and back down through carbon copies
193if required. That is, the particle is first traced up with
194<code>iTopCopy()</code> before its mother is found, and then all
195the particles in the <code>daughterList()</code> of this mother are
196traced down with <code>iBotCopy()</code>, omitting the original
197particle itself. Any non-final particles are removed from the list.
198Should this make the list empty the search criterion is widened so that
199all final daughters are allowed, not only carbon-copy ones. A second
200argument <code>false</code> inhibits the second step, and increases
201the risk that an empty list is returned. A typical example of this
202is for ISR cascades, e.g. <ei>e -> e gamma</ei> where the photon
203may not have any obvious sister in the final state if the bottom copy
204of the photon is an electron that annihilates and thus is not part of
205the final state. 
206</method>
207
208<method name="bool Event::isAncestor(int i, int iAncestor)"> 
209traces the particle <ei>i</ei> upwards through mother, grandmother,
210and so on, until either <ei>iAncestor</ei> is found or the top of
211the record is reached. Normally one unique mother is required,
212as is the case e.g. in decay chains or in parton showers, so that
213e.g. the tracing through a hard scattering would not work. For
214hadronization, first-rank hadrons are identified with the respective
215string endpoint quark, which may be useful e.g. for <ei>b</ei> physics,
216while higher-rank hadrons give <code>false</code>. Currently also
217ministrings that collapsed to one single hadron and junction topologies
218give <code>false</code>
219</method>
220
221<p/>
222One data member in an <code>Event</code> object is used to keep track
223of the largest <code>col()</code> or <code>acol()</code> colour tag set
224so far, so that new ones do not clash.
225
226<modeopen name="Event:startColTag" default="100" min="0" max="1000">
227This sets the initial colour tag value used, so that the first one
228assigned is <code>startColTag + 1</code>, etc. The Les Houches accord
229<ref>Boo01</ref> suggests this number to be 500, but 100 works equally
230well.
231</modeopen>
232
233<method name="void Event::initColTag(int colTag = 0)">
234forces the current colour tag value to be the larger of the input
235<code>colTag</code> and the above <code>Event:startColTag</code>
236values.
237</method>
238
239<method name="int Event::lastColTag()">
240returns the current maximum colour tag.
241</method>
242
243<method name="int Event::nextColTag()">
244increases the current maximum colour tag by one and returns this
245new value. This method is used whenever a new colour tag is needed.
246</method> 
247
248<p/>
249Many event properties are accessible via the <code>Info</code> class,
250<aloc href="EventInformation">see here</aloc>. Since they are used
251directly in the event generation, a few are stored directly in the
252<code>Event</code> class, however.
253
254<method name="void Event::scale( double scaleIn)">
255</method>
256<methodmore name="double Event::scale()">
257set or get the scale (in GeV) of the hardest process in the event.
258Matches the function of the <code>scale</code> variable in the
259<aloc href="LesHouchesAccord">Les Houches Accord</aloc>.
260</methodmore>
261
262<method name="void Event::scaleSecond( double scaleSecondIn)">
263</method>
264<methodmore name="double Event::scaleSecond()">
265set or get the scale (in GeV) of a second hard process in the event,
266in those cases where such a one
267<aloc href="SecondHardProcess">has been requested</aloc>.
268</methodmore>
269
270<h3>Constructors and modifications of the event record</h3>
271 
272Although you would not normally need to create your own
273<code>Event</code> instance, there may be times where that
274could be convenient. The typical exampel would be if you want to
275create a new event record that is the sum of a few different ones,
276e.g. if you want to simulate pileup events. There may also be cases
277where you want to add one or a few particles to an existing event
278record. 
279
280<method name="Event::Event(int capacity = 100)">
281creates an empty event record, but with a reserved size
282<ei>capacity</ei> for the <code>Particle</code> vector. 
283</method>
284
285<method name="Event& Event::operator=(const Event& oldEvent)">
286copies the input event record.
287</method>
288
289<method name="Event& Event::operator+=(const Event& addEvent)">
290appends an event to an existing one. For the appended particles
291mother, daughter and colour tags are shifted to make a consistent
292record. The zeroth particle of the appended event is not copied,
293but the zeroth particle of the combined event is updated to the
294full energy-momentum content.
295</method>
296
297<method name="void Event::init(string headerIn = &quot;&quot;,
298ParticleData* particleDataPtrIn = 0, int startColTagIn = 100)">
299initializes colour, the pointer to the particle database, and the
300header specification used for the event listing. We remind that a
301<code>Pythia</code> object contains two event records
302<code>process</code> and <code>event</code>. Thus one may e.g.
303call either  <code>pythia.process.list()</code> or
304<code>pythia.event.list()</code>. To distinguish those two rapidly
305at visual inspection, the <code>"Pythia Event Listing"</code> header
306is printed out differently, in one case adding
307<code>"(hard process)"</code> and in the other
308<code>"(complete event)"</code>. When <code>+=</code> is used to
309append an event, the modified event is printed with
310<code>"(combination of several events)"</code> as a reminder.
311</method>
312
313<method name="void Event::clear()">
314empties event record. Specifically the <code>Particle</code> vector
315size is reset to zero.
316</method>
317
318<method name="void Event::reset()">
319empties the event record, as <code>clear()</code> above, but then
320fills the zero entry of the <code>Particle</code> vector with the
321pseudoparticle used to represent the event as a whole. At this point
322the pseudoparticle is not assigned any momentum or mass.
323</method>
324
325<method name="void Event::popBack(int n = 1)">
326removes the last <ei>n</ei> particle entries; must be a positive
327number.
328</method>
329
330<method name="int Event::append(Particle entryIn)">
331appends a particle to the bottom of the event record and
332returns the index of this position.
333</method>
334
335<method name="int Event::append(int id, int status, int mother1,
336int mother2, int daughter1, int daughter2, int col, int acol,
337double px, double py, double pz,  double e, double m = 0.,
338double scale = 0., double pol = 9.)">
339appends a particle to the bottom of the event record and
340returns the index of this position;
341<aloc href="ParticleProperties">see here</aloc> for the meaning
342of the various particle properties.
343</method>
344
345<method name="int Event::append(int id, int status, int mother1,
346int mother2, int daughter1, int daughter2, int col, int acol,
347Vec4 p, double m = 0., double scale = 0., double pol = 9.)">
348appends a particle to the bottom of the event record and
349returns the index of this position, as above but with four-momentum
350as a <code>Vec4</code>.
351</method>
352
353<method name="int Event::append(int id, int status, int col, int acol,
354double px, double py, double pz, double e, double m = 0.,
355double scale = 0., double pol = 9.)">
356</method>
357<methodmore name="int Event::append(int id, int status, int col,
358int acol, Vec4 p, double m = 0., double scale = 0., double pol = 9.)">
359appends a particle to the bottom of the event record and
360returns the index of this position, as above but with vanishing
361(i.e. zero) mother and daughter indices.
362</method>
363
364<method name="int Event::setPDTPtr(int iSet = -1)">
365send in a pointer to the <code>ParticleData</code> database for
366particle <code>iSet</code>, by default the most recently appended
367particle. Also generates a pointer to the
368<code>ParticleDataEntry</code> object of the identity code
369of the particle.
370</method>
371
372<method name="int Event::copy(int iCopy, int newStatus = 0)">
373copies the existing particle in entry <code>iCopy</code> to the
374bottom of the event record and returns the index of this position.
375By default, i.e. with <code>newStatus = 0</code>, everything is
376copied precisely as it is, which means that history information
377has to be modified further by hand to make sense. With a positive
378<code>newStatus</code>, the new copy is set up to be the daughter of
379the old, with status code <code>newStatus</code>, while the status
380code of <code>iCopy</code> is negated. With a negative
381<code>newStatus</code>, the new copy is instead set up to be the
382mother of <code>iCopy</code>. An attempt to copy an out-of-range
383entry will return -1.
384</method>
385
386<method name="Particle& Event::back()">
387returns a reference to the last particle in the event record.
388</method>
389
390<method name="void Event::restorePtrs()">
391each particle in the event record has a pointer to the whole database
392and another to the particle species itself, used to find some particle
393properties. The latter pointer is automatically set/changed whenever
394the particle identity is set/changed by one of the normal methods.
395(It is the "changed" part that prompts the inclusion of a pointer
396to the whole database.) Of course the pointer values are specific to
397the memory locations of the current run, and so it has no sense to
398save them if events are written to file. Should you use some
399persistency scheme that bypasses the normal methods when the event is
400read back in, you can use <code>restorePtrs()</code> afterwards to set
401these pointers appropriately.
402</method>
403
404<p/>
405A few methods exist to rotate and boost events. These derive from the
406<aloc href="FourVectors">Vec4</aloc> methods, and affect both the
407momentum and the vertex (position) components of all particles.
408
409<method name="void Event::rot(double theta, double phi)"> 
410rotate all particles in the event by this polar and azimuthal angle
411(expressed in radians).
412</method>
413
414<method name="void Event::bst(double betaX, double betaY, double betaZ)"> 
415</method>
416<methodmore name="void Event::bst(double betaX, double betaY,
417double betaZ, double gamma)"> 
418</methodmore>
419<methodmore name="void Event::bst(const Vec4& vec)"> 
420boost all particles in the event by this three-vector.
421Optionally you may provide the <ei>gamma</ei> value as a fourth argument,
422which may help avoid roundoff errors for big boosts. You may alternatively
423supply a <code>Vec4</code> four-vector, in which case the boost vector
424becomes <ei>beta = p/E</ei>.
425</methodmore>
426
427<method name="void Event::rotbst(const RotBstMatrix& M)"> 
428rotate and boost by the combined action encoded in the
429<code><aloc href="FourVectors">RotBstMatrix</aloc> M</code>.
430</method>
431
432<h3>The Junction Class</h3>
433
434The event record also contains a vector of junctions, which often
435is empty or else contains only a very few per event. Methods are
436available to add further junctions or query the current junction list.
437This is only for the expert user, however, and is not discussed
438further here, but only the main points. 
439
440<p/>
441A junction stores the properites associated with a baryon number that
442is fully resolved, i.e. where three different colour indices are
443involved. There are two main applications,
444<ol> 
445<li>baryon beams, where at least two valence quarks are kicked out,
446and so the motion of the baryon number is notrivial;</li>
447<li>baryon-number violating processes, e.g. in SUSY with broken
448<ei>R</ei>-parity.</li>
449</ol>
450Information on junctions is set, partly in the process generation,
451partly in the beam remnants machinery, and used by the fragmentation
452routines, but the normal user does not have to know the details.
453
454<p/>
455For each junction, information is stored on the kind of junction, and
456on the three (anti)colour indices that are involved in the junction.
457The possibilities foreseen are:
458<ul>
459<li><code>kind = 1</code> : incoming colourless particle to three
460outgoing colours (e.g. baryon beam remnant or
461<ei>neutralino -> q q q</ei>);</li>
462<li><code>kind = 2</code> : incoming colourless particle to three
463outgoing anticolours;</li>
464<li><code>kind = 3</code> : one incoming anticolour (stored first)
465and two outgoing  colours (e.g. antisquark decaying to two quarks, or
466  gluino decay to three quarks);</li>
467<li><code>kind = 4</code> : one incoming colour (stored first) and two
468outgoing anticolours (e.g. squark decaying to two antiquarks, or
469  gluino decaying to three antiquarks);</li>
470<li><code>kind = 5</code> : two incoming anticolours (stored first)
471and one outgoing colour (e.g. resonant squark production through RPV);</li>
472<li><code>kind = 6</code> : two incoming colours (stored first)
473and one outgoing anticolour (e.g. resonant antisquark production
474  through RPV);
475</li>
476</ul>
477The odd (even) <code>kind</code> codes corresponds to a +1 (-1) change in
478baryon number across the junction.
479
480<p/>
481The kind and colour information in the list of junctions can be set
482or read with methods of the <code>Event</code> class, but are not of
483common interest and so not described here.
484
485<p/>
486A listing of current junctions can be obtained with the
487<code>listJunctions()</code> method.
488 
489<h3>Subsystems</h3>
490
491Separate from the event record as such, but closely tied to it is the
492<code><aloc href="AdvancedUsage">PartonSystems</aloc></code> class,
493which mainly stores the parton indices of incoming and outgoing partons,
494classified by collision subsystem. Such information is needed to
495interleave multiparton interactions, initial-state showers and final-state
496showers, and append beam remnants. It could also be used in other places.
497It is intended to be accessed only by experts, such as implementors of
498<aloc href="ImplementNewShowers">new showering models</aloc>.
499
500</chapter>
501
502<!-- Copyright (C) 2012 Torbjorn Sjostrand -->
Note: See TracBrowser for help on using the repository browser.