]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PYTHIA8/pythia8130/xmldoc/ParticleDataScheme.xml
bug fix and small changed in the macros
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8130 / xmldoc / ParticleDataScheme.xml
CommitLineData
5ad4eb21 1<chapter name="The Particle Data Scheme">
2
3<h2>The Particle Data Scheme</h2>
4
5The particle data scheme may take somewhat longer to understand than
6the settings one. In particular the set of methods to access information
7is rather more varied, to allow better functionality for advanced usage.
8However, PYTHIA does come with a sensible default set of particle
9properties and decay tables. Thus there is no need to learn any of the
10methods on this page to get going. Only when you perceive a specific need
11does it make sense to learn the basics.
12
13<p/>
14The central section on this page is the Operation one. The preceding
15sections are mainly there to introduce the basic structure and the set
16of properties that can be accessed.
17
18<h3>Databases</h3>
19
20The management of particle data is based on the four classes:
21<ul>
22<li><code>ParticleDataEntry</code>, which stores the relevant information
23on a particle species, and</li>
24<li><code>ParticleDataTable</code>, which is a map of PDG particle
25<code>id</code> numbers <ref>Yao06</ref> onto the relevant
26<code>ParticleDataEntry</code>.</li>
27<li><code>DecayChannel</code>, which stores info on one particular decay
28mode.</li>
29<li><code>DecayTable</code>, which is a vector of
30<code>DecayChannel</code>'s, containing all the decay modes of a
31particle, and also methods for picking a decay mode.</li>
32</ul>
33The objects of these classes together form a database that is
34continuously being used as the program has to assign particle masses,
35decay modes etc.
36
37<p/>
38The <code>ParticleDataTable</code> class is purely static, i.e. you
39can interact with it directly by
40<code>ParticleDataTable::command(argument)</code>.
41However, a <code>particleData</code> object of the
42<code>ParticleDataTable</code> class is a public member of the
43<code>Pythia</code> class, so an alternative
44notation would be <code>pythia.particleData.command(argument)</code>,
45assuming that <code>pythia</code> is an instance of the
46<code>Pythia</code> class. Further, for some of the most frequent user
47tasks, <code>Pythia</code> methods have been defined, so that
48<code>pythia.command(argument)</code>
49would work, see further below.
50
51<p/>
52A fundamental difference between the <code>ParticleData</code>
53classes and the <code>Settings</code> ones is that the former
54are accessed regularly during the event generation process, as a new
55particle is produced and its mass need to be set, e.g., while
56<code>Settings</code> is mainly/only used at the initialization stage.
57Nevertheless, it is not a good idea to change data in either of them
58in mid-run, since this may lead to inconsistencies.
59
60<h3>Stored properties for particles</h3>
61
62Currently the following particle properties are stored in the
63<code>ParticleDataTable</code> for a given PDG particle identity code
64<code>id</code>, here presented by the name used to access this property:
65
66<method name="name(id)">
67particle and antiparticle names are stored separately, the sign of
68<code>id</code> determines which of the two is returned, with
69<code>void</code> used to indicate the absence of an antiparticle.
70</method>
71
72<method name="spinType(id)">
73the spin type, of the form <ei>2 s + 1</ei>, with special code 0
74for entries of unknown or indeterminate spin.
75</method>
76
77<method name="chargeType(id)">
78three times the charge (to make it an integer), taking into account
79the sign of <code>id</code>.
80</method>
81
82<method name="colType(id)">
83the colour type, with 0 uncoloured, 1 triplet, -1 antitriplet and 2
84octet, taking into account the sign of <code>id</code>.
85</method>
86
87<method name="m0(id)">
88the nominal mass <ei>m_0</ei> (in GeV).
89</method>
90
91<method name="mWidth(id)">
92the width <ei>Gamma</ei> of the Breit-Wigner distribution (in GeV).
93</method>
94
95<method name="mMin(id), mMax(id)">
96the lower and upper limit, respectively, of the allowed mass range
97generated by the Breit-Wigner (in GeV). If <ei>mMax &lt; mMin</ei>
98then no upper limit is imposed. Have no meanings for particles
99without width, and would typically be 0 there.
100</method>
101
102<method name="tau0(id)">
103the nominal proper lifetime <ei>tau_0</ei> (in mm/c).
104</method>
105
106<method name="isResonance(id)">
107a flag telling whether a particle species are considered as a resonance
108or not. Here <aloc href="ResonanceDecays">"resonance"</aloc>
109is used as shorthand for any massive particle
110where the decay process should be counted as part of the hard process
111itself, and thus be performed before showers and other event aspects
112are added. Restrictions on allowed decay channels is also directly
113reflected in the cross section of simulated processes, while those of
114normal hadrons and other light particles are not.
115In practice, it is reserved for states above the <ei>b bbar</ei>
116bound systems in mass, i.e. for <ei>W, Z, t</ei>, Higgs states,
117supersymmetric states and (most?) other states in any new theory.
118All particles with <code>m0</code> above 20 GeV are by default
119initialized to be considered as resonances.
120</method>
121
122<method name="mayDecay(id)">
123a flag telling whether a particle species may decay or not, offering
124the main user switch. Whether a given particle of this kind then actually
125will decay also depends on it having allowed decay channels, and on
126other flags for <aloc href="ParticleDecays">particle decays</aloc>.
127All particles with <code>tau0</code> below 1000 mm are
128by default initialized to allow decays.
129</method>
130
131<method name="doExternalDecay(id)">
132a flag telling whether a particle should be handled by an external
133decay package or not, with the latter default. Can be manipulated as
134described on this page, but should normally not be. Instead the
135<aloc href="ExternalDecays"><code>pythia.decayPtr</code></aloc>
136method should be provided with the list of relevant particles.
137</method>
138
139<method name="isVisible(id)">
140a flag telling whether a particle species is to be considered as
141visible in a detector or not, as used e.g. in analysis routines.
142By default this includes neutrinos and a few BSM particles
143(gravitino, sneutrinos, neutralinos) that have neither strong nor
144electromagnetic charge, and are not made up of constituents that
145have it. The value of this flag is only relevant if a particle is
146long-lived enough actually to make it to a detector.
147</method>
148
149<method name="doForceWidth(id)">
150a flag valid only for resonances where PYTHIA contains code to
151calculate the width of the resonance from encoded matrix-element
152expressions, i.e. the <ei>Z^0</ei>, <ei>W^+-</ei>, <ei>t</ei>,
153<ei>h^0</ei>, and a few more. The normal behaviour (<code>false</code>)
154is then that the width is calculated from the mass, but it is
155possible to <aloc href="ResonanceDecays">force</aloc> the resonance
156to retain the nominal width. Branching ratios and the running of the
157total width are unaffected.
158</method>
159
160<p/>
161Similarly-named methods can also be used to set these properties.
162We do not provide the details here, since other methods to be
163introduced below are the ones likely to be used for such tasks.
164(Normally the correspondence is obvious in the header file, but
165for the name you either can use two methods to set name and
166antiparticle name separately, or use one method that takes them
167both as input.)
168
169<p/>
170There are some further methods for output only, i.e. properties
171that cannot be set directly:
172
173<method name="particleDataPtr(id)">
174returns a pointer to the <code>ParticleDataEntry</code> object.
175</method>
176
177<method name="hasAnti(id)">
178bool whether a distinct antiparticle exists or not. Is true if an
179antiparticle name has been set (and is different from
180<code>void</code>).
181</method>
182
183<method name="charge(id)">
184the electrical charge of a particle, as a <code>double</code> equal
185to <code>chargeType(id)/3</code>.
186
187<method name="mass(id)">
188returns a mass distributed according to a truncated Breit-Wigner,
189with parameters as above (see also the
190<code>ParticleData:modeBreitWigner</code> switch). Is equal to
191<code>m0(id)</code> for particles without width.
192</method>
193
194<method name="constituentMass(id)">
195is the constituent mass for a quark, hardcoded as
196<ei>m_u = m_d = 0.325</ei>, <ei>m_s = 0.50</ei>, <ei>m_c = 1.60</ei>
197and <ei>m_b = 5.0</ei> GeV, for a diquark the sum of quark constituent
198masses, and for everything else the same as the ordinary mass.
199</method>
200
201<method name="m0Min(id), m0Max(id)">
202similar to <code>mMin()</code> and <code>mMax()</code>, except that
203for particles with no width the <code>m0(id)</code> value is returned.
204</method>
205
206<method name="isLepton(id)">
207true for a lepton or an antilepton (including neutrinos).
208</method>
209
210<method name="isQuark(id)">
211true for a quark or an antiquark.
212</method>
213
214<method name="isGluon(id)">
215true for a gluon.
216</method>
217
218<method name="isHadron(id)">
219true for a hadron (made up out of normal quarks and gluons,
220i.e. not for R-hadrons and other exotic states).
221</method>
222
223<method name="heaviestQuark(id)">
224extracts the heaviest quark or antiquark, i.e. one with largest
225<code>id</code> number, for a hadron.
226</method>
227
228<h3>Stored properties for decays</h3>
229
230The following properties are stored for each decay channel:
231
232<method name="onMode()">
2330 if a channel is off,<br/>
2341 if on,<br/>
2352 if on for a particle but off for an antiparticle,<br/>
2363 if on for an antiparticle but off for a particle.<br/>
237If a particle is its own antiparticle then 2 is on and 3 off
238but, of course, for such particles it is much simpler and safer
239to use only 1 and 0.<br/>
240The 2 and 3 options can be used e.g. to encode CP violation in
241B decays, or to let the <ei>W</ei>'s in a <ei>q qbar -> W^+ W^-</ei>
242process decay in different channels.
243</method>
244
245<method name="bRatio()">
246the branching ratio.
247</method>
248
249<method name="meMode()">
250the mode of processing this channel, possibly with matrix elements
251(see the <aloc href="ParticleDecays">particle decays</aloc> description);
252</method>
253
254<method name="multiplicity()">
255the number of decay products in a channel, at most 8.
256(Is not set as such, but obtained from the products list below.)
257</method>
258
259<method name="product(i)">
260a list of the decay products, 8 products 0 &lt;= i &lt; 8,
261with trailing unused ones set to 0.
262</method>
263
264<p/>
265The decay table, a vector of decay channels, also defines a
266few methods:
267
268<method name="addChannel( branchingRatio, meMode, product1, ...)">
269adds a decay channel with up to 8 products.
270</method>
271
272<method name="size()">
273gives the number of decay channels for a particle.
274</method>
275
276<method name="rescaleBR(newSumBR)">
277rescale all branching ratios to the provided new sum,
278by default unity.
279</method>
280
281<method name="pick()">
282picks one decay channel according to their respective branching
283ratios.
284</method>
285
286<method name="dynamicPick()">
287intended for resonances specifically, this picks one decay channel
288according to the respective partial widths for the specific mass
289value of the resonance; assumes that the partial widths are input
290beforehand, using a special <code>dynamicBR()</code> method.
291</method>
292
293<h3>Operation</h3>
294
295The normal flow of the particle data operations is:
296
297<ol>
298
299<li>
300When a <code>Pythia</code> object <code>pythia</code> is created, the
301<code>ParticleDataTable</code> member <code>pythia.particleData</code>
302is asked to scan the <code>ParticleData.xml</code> file.
303
304<p/>
305All lines beginning with <code>&lt;particle</code> are scanned for
306information on a particle species, and all lines beginning with
307<code>&lt;channel</code> are assumed to contain a decay channel of the
308enclosing particle. In both cases XML syntax is used, with attributes
309used to identify the stored properties, and with omitted properties
310defaulting back to 0 where meaningful. The particle and channel
311information may be split over several lines, up to the &gt; endtoken.
312The format of a <code>&lt;particle</code> tag is:
313<pre>
314 &lt;particle id="..." name="..." antiName="..." spinType="..." chargeType="..." colType="..."
315 m0="..." mWidth="..." mMin="..." mMax="..." tau0="..."&gt;
316 &lt;/particle&gt;
317</pre>
318where the fields are the properties already introduced above.
319Note that <code>isResonance</code>, <code>mayDecay</code>,
320<code>doExternalDecay</code>, <code>isVisible</code> and
321<code>doForceWidth</code> are not set here, but are provided with
322default values by the rules described above. Once initialized, also
323these latter properties can be changed, see below.<br/>
324
325The format of a <code>&lt;channel></code> tag is:
326<pre>
327 &lt;channel onMode="..." bRatio="..." meMode="..." products="..." /&gt;
328</pre>
329again see properties above. The products are given as a blank-separated
330list of <code>id</code> codes.
331<note>Important</note>: the values in the <code>.xml</code> file should not
332be changed, except by the PYTHIA authors. Any changes should be done
333with the help of the methods described below.
334</li>
335
336<li> <p/>
337Between the creation of the <code>Pythia</code> object and the
338<code>init</code> call for it, you may use the methods of the
339<code>ParticleDataTable</code> class to modify some of the default values.
340Several different approaches can be chosen for this.
341
342<p/>
343a) Inside your main program you can directly set values with
344<pre>
345 pythia.readString(string);
346</pre>
347where both the variable name and the value are contained inside
348the character string, separated by blanks and/or a =, e.g.
349<pre>
350 pythia.readString("111:mayDecay = off");
351</pre>
352switches off the decays of the <ei>pi^0</ei>.<br/>
353
354The particle id (> 0) and the property to be changed must be given,
355separated by a colon.<br/>
356
357The allowed properties are: <code>name</code>, <code>antiName</code>,
358<code>spinType</code>, <code>chargeType</code>, <code>colType</code>,
359<code>m0</code>, <code>mWidth</code>, <code>mMin</code>,
360<code>mMax</code>, <code>tau0</code>, <code>isResonance</code>,
361<code>mayDecay</code>, <code>doExternalDecay</code>,
362<code>isVisible</code> and <code>doForceWidth</code>. All of these names
363are case-insensitive. Names that do not match an existing variable
364are ignored. A warning is printed, however, unless an optional
365second argument <code>false</code> is used.<br/>
366Strings beginning with a non-alphanumeric character, like # or !,
367are assumed to be comments and are not processed at all. For
368<code>bool</code> values, the following notation may be used
369interchangeably: <code>true = on = yes = ok = 1</code>, while everything
370else gives <code>false</code> (including but not limited to
371<code>false</code>, <code>off</code>, <code>no</code> and 0).
372
373<p/>
374Particle data often comes in sets of closely related information.
375Therefore some properties expect the value to consist of several
376numbers. These can then be separated by blanks (or by commas).
377A simple example is <code>names</code>, which expects both the
378name and antiname to be given. A more interesting one is the
379<code>all</code> property,
380<pre>
381 id:all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0
382</pre>
383where all the current information on the particle itself is replaced,
384but any decay channels are kept unchanged. Using <code>new</code> instead
385of <code>all</code> also removes any previous decay channels.
386If the string contains fewer fields than expected the trailing
387properties are set to vanish ("void", 0 or 0.). Note that such a
388truncated string should not be followed by a comment, since this
389comment would then be read in as if it contained the missing properties.
390The truncation can be done anywhere, specifically a string with only
391<code>id:new</code> defines a new "empty" particle.
392As before, <code>isResonance</code>, <code>mayDecay</code>,
393<code>doExternalDecay</code>, <code>isVisible</code> and
394<code>doForceWidth</code>are (re)set to their default values, and
395would have to be changed separately if required.
396
397<p/>
398A further command is <code>rescaleBR</code>, which rescales each of the
399existing branching ratios with a common factor, such that their new
400sum is the provided value. This may be a first step towards adding
401new decay channels, see further below.
402
403<p/>
404Alternatively the <code>id</code> code may be followed by another integer,
405which then gives the decay channel number. This then has to be
406followed by the property specific to this channel, either
407<code>onMode</code>, <code>bRatio</code>, <code>meMode</code> or
408<code>products</code>. In the latter case all the products of the channel
409should be given:
410<pre>
411 id:channel:products = product1 product2 ....
412</pre>
413The line will be scanned until the end of the line, or until a
414non-number word is encountered, or until the maximum allowed number
415of eight products is encountered, whichever happens first. It is also
416possible to replace all the properties of a channel in a similar way:
417<pre>
418 id:channel:all = onMode bRatio meMode product1 product2 ....
419</pre>
420To add a new channel at the end, use
421<pre>
422 id:addChannel = onMode bRatio meMode product1 product2 ....
423</pre>
424
425<p/>
426It is currently not possible to remove a channel selectively, but
427setting its branching ratio vanishing is as effective. If you want to
428remove all existing channels and force decays into one new channel
429you can use
430<pre>
431 id:oneChannel = onMode bRatio meMode product1 product2 ....
432</pre>
433 A first <code>oneChannel</code> command could be followed by
434several subsequent <code>addChannel</code> ones, to build
435up a completely new decay table for an existing particle.
436
437<p/>
438When adding new channels or changing branching ratios in general,
439note that, once a particle is to be decayed, the sum of branching
440ratios is always rescaled to unity. Beforehand, <code>rescaleBR</code>
441may be used to rescale an existing branching ratio by the given factor.
442
443<p/>
444There are a few commands that will study all the decay channels of the
445given particle, to switch them on or off as desired. The
446<pre>
447 id:onMode = onMode
448</pre>
449will set the <code>onMode</code> property of all channels to the
450desired value. The
451<pre>
452 id:offIfAny = product1 product2 ....
453 id:onIfAny = product1 product2 ....
454 id:onPosIfAny = product1 product2 ....
455 id:onNegIfAny = product1 product2 ....
456</pre>
457will set the <code>onMode</code> 0, 1, 2 or 3, respectively, for all
458channels which contain any of the enumerated products, where the matching
459to these products is done without distinction of particles and
460antiparticles. Note that "<code>Pos</code>" and "<code>Neg</code>"
461are slightly misleading since it refers to the particle and antiparticle
462of the <code>id</code> species rather than charge, but should still be
463simpler to remember and understand than alternative notations.
464Correspondingly
465<pre>
466 id:offIfAll = product1 product2 ....
467 id:onIfAll = product1 product2 ....
468 id:onPosIfAll = product1 product2 ....
469 id:onNegIfAll = product1 product2 ....
470</pre>
471will set the <code>onMode</code> 0, 1, 2 or 3, respectively, for all
472channels which contain all of the enumerated products, again without
473distinction of particles and antiparticles. If the same product appears
474twice in the list it must also appear twice in the decay channel, and
475so on. The decay channel is allowed to contain further particles,
476beyond the product list. By contrast,
477<pre>
478 id:offIfMatch = product1 product2 ....
479 id:onIfMatch = product1 product2 ....
480 id:onPosIfMatch = product1 product2 ....
481 id:onPosIfMatch = product1 product2 ....
482</pre>
483requires the decay-channel multiplicity to agree with that of the product
484list, but otherwise works as the <code>onIfAll/offIfAll</code> methods.
485
486<p/>
487Note that the action of several of the commands depends on the order
488in which they are executed, as one would logically expect. For instance,
489<code>id:oneChannel</code> removes all decay channels of <code>id</code>
490and thus all previous changes in this decay table, while subsequent
491additions or changes would still take effect. Another example would be that
492<code>23:onMode = off</code> followed by <code>23:onIfAny = 1 2 3 4 5</code>
493would let the <ei>Z^0</ei> decay to quarks, while no decays would be
494allowed if the order were to be reversed.
495
496<p/>
497b) The <code>Pythia</code> <code>readString(string)</code> method actually
498does not do changes itself, but sends on the string either to the
499<code>ParticleData</code> class or to the <code>Settings</code> one.
500If desired, it is possible to communicate directly with the corresponding
501<code>ParticleData</code> method:
502<pre>
503 pythia.particleData.readString("111:mayDecay = off");
504 pythia.particleData.readString("15:2:products = 16 -211");
505</pre>
506In this case, changes intended for <code>Settings</code> would not be
507understood.
508
509<p/>
510c) Underlying this are commands for all the individual properties in
511the <code>ParticleDataTable</code> class, one for each. Thus, an example
512now reads
513<pre>
514 pythia.particleData.mayDecay(111, false);
515</pre>
516Boolean values should here be given as <code>true</code> or
517<code>false</code>.
518
519<p/>
520d) A simpler and more useful way is to collect all your changes
521in a separate file, with one line per change, e.g.
522<pre>
523 111:mayDecay = off
524</pre>
525The file can be read by the
526<pre>
527 pythia.readFile(fileName);
528</pre>
529method, where <code>fileName</code> is a string, e.g.
530<code>pythia.readFile("main.cmnd")</code>. Each line is process as
531described for the string in 2a). This file can freely mix commands to
532the <code>Settings</code> and <code>ParticleData</code> classes.
533</li>
534
535<li> <p/>
536A routine <code>reInit(fileName)</code> is provided, and can be used to
537zero the particle data table and reinitialize from scratch. Such a call
538might be required if several <code>Pythia</code> objects are created in the
539same run, and requested to have different values - by default the
540<code>init()</code> call is only made the first time. Several
541<code>pythia</code> with different values would have to run sequentially
542and not in parallel, though; recall that there is only one instance of
543the particle data table.
544</li>
545
546<li> <p/>
547You may at any time obtain a listing of all the particle data by calling
548<pre>
549 pythia.particleData.listAll();
550</pre>
551The listing is by increasing <code>id</code> number. It shows the basic
552quantities introduced above. Some are abbreviated in the header to fit on
553the lines: <code>spn = spinType</code>, <code>chg = chargeType</code>,
554<code>col = colType</code>, <code>res = isResonance</code>,
555<code>dec = mayDecay && canDecay</code> (the latter checks that decay
556channels have been defined), <code>ext = doExternalDecay</code>,
557<code>vis = isVisible</code> and <code>wid = doForceWidth</code>.<br/>
558
559To list only those particles that were changed (one way or another, the
560listing will not tell what property or decay channel was changed), instead use
561<pre>
562 pythia.particleData.listChanged();
563</pre>
564(This info is based on a further <code>hasChanged</code> flag of a particle
565or a channel, set <code>true</code> whenever any of the changing methods are
566used. It is possible to manipulate this value, but this is not recommended.)
567By default the internal initialization of the widths of resonances such as
568<ei>gamma^*/Z^0, W^+-, t/tbar, H^0</ei> do not count as changes; if you want
569to list also those changes instead call <code>listChanged(true)</code>.
570<br/>
571
572To list only one particle, give its <code>id</code> code as argument to
573the <code>list(...)</code> function.. To list a restricted set of particles,
574give in their <code>id</code> codes to <code>list(...)</code> as a
575<code>vector&lt;int></code>.
576</li>
577
578<li> <p/>
579For wholesale changes of particle properties all available data can be
580written out, edited, and then read back in again. These methods are
581mainly intended for expert users. You can choose between two alternative
582syntaxes.
583
584<p/>
585a) XML syntax, using the <code>&lt;particle</code> and
586<code>&lt;channel</code> lines already described. You use the method
587<code>particleData.listXML(fileName)</code> to produce such an XML
588file and <code>particleData.readXML(fileName)</code> to read it back
589in after editing.
590
591<p/>
592b) Fixed/free format, using exactly the same information as illustrated
593for the <code>&lt;particle</code> and <code>&lt;channel</code> lines
594above, but now without any tags. This means that all information fields
595must be provided (if there is no antiparticle then write
596<code>void</code>), in the correct order (while the order is irrelevant
597with XML syntax), and all on one line. Information is written out in
598properly lined-up columns, but the reading is done using free format,
599so fields need only be separated by at least one blank. Each new particle
600is supposed to be separated by (at least) one blank line, whereas no
601blank lines are allowed between the particle line and the subsequent
602decay channel lines, if any. You use the method
603<code>particleData.listFF(fileName)</code> to produce such a fixed/free
604file and <code>particleData.readFF(fileName)</code> to read it back
605in after editing.
606
607<p/>
608As an alternative to the <code>readXML</code> and <code>readFF</code>
609methods you can also use the
610<code>particleData.reInit(fileName, xmlFormat)</code> method, where
611<code>xmlFormat = true</code> (default) corresponds to reading an XML
612file and <code>xmlFormat = false</code> to a fixed/free format one.
613
614<p/>
615To check that the new particle and decay tables makes sense, you can use
616the <code>particleData.checkTable()</code> method, either directly or by
617switching it on among the standard
618<aloc href="ErrorChecks">error checks</aloc>.
619</li>
620
621</ol>
622
623</chapter>
624
625<!-- Copyright (C) 2008 Torbjorn Sjostrand -->