]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8170/xmldoc/ParticleDataScheme.xml
Protection for dereferencing fTDCErrorBuffer. see ALIROOT-5749
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8170 / xmldoc / ParticleDataScheme.xml
1 <chapter name="The Particle Data Scheme">
2
3 <h2>The Particle Data Scheme</h2>
4
5 The particle data scheme may take somewhat longer to understand than
6 the settings one. In particular the set of methods to access information
7 is rather more varied, to allow better functionality for advanced usage. 
8 However, PYTHIA does come with a sensible default set of particle 
9 properties and decay tables. Thus there is no need to learn any of the
10 methods on this page to get going. Only when you perceive a specific need
11 does it make sense to learn the basics.
12
13 <p/>
14 The central section on this page is the Operation one. The preceding 
15 sections are there mainly to introduce the basic structure and the set 
16 of properties that can be accessed. The subsequent sections provide a 
17 complete listing of the existing public methods, which most users 
18 probably will have little interaction with.
19
20 <h3>Databases</h3>
21
22 The management of particle data is based on three classes:
23 <ul>
24 <li><code>ParticleData</code>, which is the top-level class, with
25 methods that can be used to interrogate all particle data. It contains
26 a map of PDG particle identity numbers <ref>Yao06</ref> onto the relevant 
27 <code>ParticleDataEntry</code> objects,</li> 
28 <li><code>ParticleDataEntry</code>, which stores the relevant information 
29 on an individual particle species, and</li>
30 <li><code>DecayChannel</code>, which stores info on one particular decay 
31 mode of a particle.</li>
32
33 </ul>
34 The objects of these classes together form a database that is 
35 continuously being used as the program has to assign particle masses, 
36 select decay modes, etc.
37
38 <p/>
39 Each <code>Pythia</code> object has a public member 
40 <code>particleData</code> of the <code>ParticleData</code> class. 
41 Therefore you access the particle data methods as 
42 <code>pythia.particleData.command(argument)</code>,
43 assuming that <code>pythia</code> is an instance of the 
44 <code>Pythia</code> class. Further, for some of the most frequent user 
45 tasks, <code>Pythia</code> methods have been defined, so that 
46 <code>pythia.command(argument)</code> 
47 would work, see further below.
48
49 <p/>
50 A fundamental difference between the particle data classes and the 
51 settings ones is that the former are accessed regularly during the 
52 event generation process, as a new particle is produced and its mass 
53 need to be set, e.g., while the latter are mainly/only used 
54 at the initialization stage. Nevertheless, it is not a good idea to 
55 change data in either of them in mid-run, since this may lead to 
56 inconsistencies. 
57
58 <h3>Stored properties for particles</h3>
59
60 The main properties stored for each particle are as follows. 
61 Different ways to set and get these properties will be described
62 further down.
63
64 <ul>
65
66 <li><code>name</code>: a character string with the name of the 
67 particle. Particle and antiparticle names are stored separately,
68 with <code>void</code> returned when no antiparticle exists.</li>
69
70 <li><code>spinType</code>: the spin type, of the form <ei>2 s + 1</ei>, 
71 with special code 0 for entries of unknown or indeterminate spin.</li> 
72
73 <li><code>chargeType</code>: three times the charge (to make it an 
74 integer).</li> 
75
76 <li><code>colType</code>: the colour type, with 0 uncoloured, 1 triplet, 
77 -1 antitriplet and 2 octet. (A preliminary implementation of colour
78   sextets, available since version 8.150, further uses 3 for a sextet
79   and -3 for an antisextet.) </li>  
80
81 <li><code>m0</code>: the nominal mass <ei>m_0</ei> (in GeV).</li> 
82
83 <li><code>mWidth</code>: the width <ei>Gamma</ei> of the Breit-Wigner 
84 distribution (in GeV).</li> 
85
86 <li><code>mMin</code>: the lower limit of the allowed mass range 
87 generated by the Breit-Wigner (in GeV). Has no meaning for particles 
88 without width, and would typically be 0 there.</li> 
89
90 <li><code>mMax</code>: the upper limit of the allowed mass range 
91 generated by the Breit-Wigner (in GeV). If <ei>mMax &lt; mMin</ei> then 
92 no upper limit is imposed. Has no meaning for particles without width, 
93 and would typically be 0 there.</li> 
94
95 <li><code>tau0</code>: the nominal proper lifetime <ei>tau_0</ei> 
96 (in mm/c).</li> 
97
98 <li><code>isResonance</code>: a flag telling whether a particle species 
99 is considered as a resonance or not. Here 
100 <aloc href="ResonanceDecays">"resonance"</aloc> is used as shorthand 
101 for any massive particle where the decay process should be counted as part 
102 of the hard process itself, and thus be performed before showers and other 
103 event aspects are added. Restrictions on allowed decay channels is also 
104 directly reflected in the cross section of simulated processes, while 
105 those of normal hadrons and other light particles are not.
106 In practice, it is reserved for states above the <ei>b bbar</ei> 
107 bound systems in mass, i.e. for <ei>W, Z, t</ei>, Higgs states, 
108 supersymmetric states and (most?) other states in any new theory. 
109 All particles with <code>m0</code> above 20 GeV are by default
110 initialized to be considered as resonances.</li> 
111
112 <li><code>mayDecay</code>: a flag telling whether a particle species 
113 may decay or not, offering the main user switch. Whether a given particle 
114 of this kind then actually will decay also depends on it having allowed 
115 decay channels, and on other flags for 
116 <aloc href="ParticleDecays">particle decays</aloc>. 
117 All particles with <code>tau0</code> below 1000 mm are 
118 by default initialized to allow decays.</li> 
119
120 <li><code>doExternalDecays</code>: a flag telling whether a particle 
121 should be handled by an external decay package or not, with the latter 
122 default. Can be manipulated as described on this page, but should 
123 normally not be. Instead the 
124 <code><aloc href="ExternalDecays">Pythia::decayPtr(...)</aloc></code> 
125 method should be provided with the list of relevant particles.</li> 
126
127 <li><code>isVisible</code>: a flag telling whether a particle species 
128 is to be considered as visible in a detector or not, as used e.g. in 
129 analysis routines. By default this includes neutrinos and a few BSM 
130 particles (gravitino, sneutrinos, neutralinos) that have neither strong 
131 nor electromagnetic charge, and are not made up of constituents that
132 have it. The value of this flag is only relevant if a particle is
133 long-lived enough actually to make it to a detector.</li> 
134
135 <li><code>doForceWidth</code>: a flag valid only for resonances where 
136 PYTHIA contains code to calculate the width of the resonance from 
137 encoded matrix-element expressions, i.e. the <ei>Z^0</ei>, <ei>W^+-</ei>, 
138 <ei>t</ei>, <ei>h^0</ei>, and a few more. The normal behaviour 
139 (<code>false</code>) is then that the width is calculated from the mass, 
140 but it is possible to <aloc href="ResonanceDecays">force</aloc> the 
141 resonance to retain the nominal width. Branching ratios and the running 
142 of the total width are unaffected.</li> 
143
144 </ul>
145
146 <h3>Stored properties for decays</h3>
147
148 An unstable particle has a decay table consisting of one or more 
149 decay channel. The following properties are stored for each such channel. 
150 Again different ways to set and get these properties will be described
151 further down.
152 <ul>
153
154 <li><code>onMode</code>: integer code for use or not of channel,<br/>
155 0 if a channel is off,<br/>
156 1 if on,<br/>
157 2 if on for a particle but off for an antiparticle,<br/>
158 3 if on for an antiparticle but off for a particle.<br/>
159 If a particle is its own antiparticle then 2 is on and 3 off 
160 but, of course, for such particles it is much simpler and safer 
161 to use only 1 and 0.<br/>
162 The 2 and 3 options can be used e.g. to encode CP violation in 
163 B decays, or to let the <ei>W</ei>'s in a <ei>q qbar -> W^+ W^-</ei> 
164 process decay in different channels. </li>
165
166 <li><code>bRatio</code>: the branching ratio of the channel.</li>
167
168 <li><code>meMode</code>: the mode of processing this channel, possibly 
169 with matrix elements; see the 
170 <aloc href="ParticleDecays">particle decays</aloc> description</li>
171 for the list of possibilities.
172
173 <li><code>multiplicity</code>: the number of decay products of the 
174 channel. Can be at most 8.</li>
175
176 <li><code>product(i)</code>: the identity code of the decay products,
177 where <code>i</code> runs between <code>0</code> and 
178 <code>multiplicity - 1</code>. Trailing positions are filled with 0.
179 </li>
180
181 </ul>
182
183 <h3>Operation</h3>
184
185 The normal flow of the particle data operations is:
186
187 <ol>
188
189 <li>
190 When a <code>Pythia</code> object <code>pythia</code> is created, the 
191 <code>pythia.particleData</code> member is asked to scan the 
192 <code>ParticleData.xml</code> file.
193
194 <p/>
195 All lines beginning with <code>&lt;particle</code> are scanned for 
196 information on a particle species, and all lines beginning with 
197 <code>&lt;channel</code> are assumed to contain a decay channel of the 
198 enclosing particle. In both cases XML syntax is used, with attributes
199 used to identify the stored properties, and with omitted properties
200 defaulting back to 0 where meaningful. The particle and channel 
201 information may be split over several lines, up to the &gt; endtoken. 
202 The format of a <code>&lt;particle</code> tag is:
203 <pre>
204     &lt;particle id="..." name="..." antiName="..." spinType="..." chargeType="..." colType="..." 
205        m0="..." mWidth="..." mMin="..." mMax="..." tau0="..."&gt;
206     &lt;/particle&gt;
207 </pre>
208 where the fields are the properties already introduced above.
209 Note that <code>isResonance</code>, <code>mayDecay</code>, 
210 <code>doExternalDecay</code>, <code>isVisible</code> and
211 <code>doForceWidth</code> are not set here, but are provided with 
212 default values by the rules described above. Once initialized, also 
213 these latter properties can be changed, see below.<br/> 
214
215 The format of  a <code>&lt;channel></code> tag is:
216 <pre>
217     &lt;channel onMode="..." bRatio="..." meMode="..." products="..." /&gt;
218 </pre>
219 again see properties above. The products are given as a blank-separated 
220 list of <code>id</code> codes.  
221 <note>Important</note>: the values in the <code>.xml</code> file should not 
222 be changed, except by the PYTHIA authors. Any changes should be done 
223 with the help of the methods described below.
224 </li> 
225
226 <li> <p/>
227 Between the creation of the <code>Pythia</code> object and the 
228 <code>init</code> call for it, you may use the methods of the 
229 <code>ParticleData</code> class to modify some of the default values. 
230 Several different approaches can be chosen for this.
231
232 <p/> 
233 a) Inside your main program you can directly set values with
234 <pre>
235     pythia.readString(string);
236 </pre>
237 where both the variable name and the value are contained inside
238 the character string, separated by blanks and/or a =, e.g. 
239 <pre>
240     pythia.readString("111:mayDecay = off"); 
241 </pre>
242 switches off the decays of the <ei>pi^0</ei>.<br/>    
243
244 The particle id (> 0) and the property to be changed must be given, 
245 separated by a colon.<br/> 
246
247 The allowed properties are: <code>name</code>, <code>antiName</code>, 
248 <code>spinType</code>, <code>chargeType</code>, <code>colType</code>, 
249 <code>m0</code>, <code>mWidth</code>, <code>mMin</code>, 
250 <code>mMax</code>, <code>tau0</code>, <code>isResonance</code>,
251 <code>mayDecay</code>, <code>doExternalDecay</code>,
252 <code>isVisible</code> and <code>doForceWidth</code>. All of these 
253 names are case-insensitive. Names that do not match an existing 
254 variable are ignored.<br/> 
255
256 Strings beginning with a non-alphanumeric character, like # or !, 
257 are assumed to be comments and are not processed at all. For 
258 <code>bool</code> values, the following notation may be used 
259 interchangeably: <code>true = on = yes = ok = 1</code>, while everything 
260 else gives <code>false</code> (including but not limited to 
261 <code>false</code>, <code>off</code>, <code>no</code> and 
262 <code>0</code>).
263
264 <p/>
265 Particle data often comes in sets of closely related information.
266 Therefore some properties expect the value to consist of several
267 numbers. These can then be separated by blanks (or by commas). 
268 A simple example is <code>names</code>, which expects both the 
269 name and antiname to be given. A more interesting one is the 
270 <code>all</code> property,
271 <pre>  
272     id:all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0
273 </pre>
274 where all the current information on the particle itself is replaced, 
275 but any decay channels are kept unchanged. Using <code>new</code> instead 
276 of <code>all</code> also removes any previous decay channels.   
277 If the string contains fewer fields than expected the trailing
278 properties are set to vanish ("void", 0 or 0.). Note that such a 
279 truncated string should not be followed by a comment, since this 
280 comment would then be read in as if it contained the missing properties.  
281 The truncation can be done anywhere, specifically a string with only 
282 <code>id:new</code> defines a new "empty" particle.
283 As before, <code>isResonance</code>, <code>mayDecay</code>,
284 <code>doExternalDecay</code>, <code>isVisible</code> and 
285 <code>doForceWidth</code> are (re)set to their default values, and 
286 would have to be changed separately if required.
287
288 <p/>
289 A further command is <code>rescaleBR</code>, which rescales each of the
290 existing branching ratios with a common factor, such that their new
291 sum is the provided value. This may be a first step towards adding 
292 new decay channels, see further below. 
293
294 <p/>
295 Alternatively the <code>id</code> code may be followed by another integer, 
296 which then gives the decay channel number. This then has to be 
297 followed by the property specific to this channel, either 
298 <code>onMode</code>, <code>bRatio</code>, <code>meMode</code> or 
299 <code>products</code>. In the latter case all the products of 
300 the channel should be given:
301 <pre>
302     id:channel:products =  product1 product2 ....  
303 </pre>
304 The line will be scanned until the end of the line, or until a
305 non-number word is encountered, or until the maximum allowed number
306 of eight products is encountered, whichever happens first. (Thus the 
307 multiplicity of a decay channel need not be input; it is automatically 
308 calculated from the products list.) It is also possible to replace all 
309 the properties of a channel in a similar way:
310 <pre>
311     id:channel:all = onMode bRatio meMode product1 product2 ....  
312 </pre>
313 To add a new channel at the end, use
314 <pre>
315     id:addChannel = onMode bRatio meMode product1 product2 ....
316 </pre>
317
318 <p/>
319 It is currently not possible to remove a channel selectively, but 
320 setting its branching ratio vanishing is as effective. If you want to
321 remove all existing channels and force decays into one new channel
322 you can use
323 <pre>
324     id:oneChannel = onMode bRatio meMode product1 product2 ....
325 </pre>
326  A first <code>oneChannel</code> command could be followed by
327 several subsequent <code>addChannel</code> ones, to build
328 up a completely new decay table for an existing particle.
329
330 <p/>
331 When adding new channels or changing branching ratios in general,
332 note that, once a particle is to be decayed, the sum of branching 
333 ratios is always rescaled to unity. Beforehand, <code>rescaleBR</code> 
334 may be used to rescale an existing branching ratio by the given factor.
335
336 <p/>
337 There are a few commands that will study all the decay channels of the
338 given particle, to switch them on or off as desired. The 
339 <pre>
340     id:onMode = onMode
341 </pre> 
342 will set the <code>onMode</code> property of all channels to the 
343 desired value. The 
344 <pre> 
345     id:offIfAny   = product1 product2 .... 
346     id:onIfAny    = product1 product2 .... 
347     id:onPosIfAny = product1 product2 .... 
348     id:onNegIfAny = product1 product2 .... 
349 </pre>
350 will set the <code>onMode</code> 0, 1, 2 or 3, respectively, for all 
351 channels which contain any of the enumerated products, where the matching 
352 to these products is done without distinction of particles and 
353 antiparticles. Note that "<code>Pos</code>" and "<code>Neg</code>" 
354 are slightly misleading since it refers to the particle and antiparticle 
355 of the <code>id</code> species rather than charge, but should still be 
356 simpler to remember and understand than alternative notations. 
357 Correspondingly
358 <pre> 
359     id:offIfAll   = product1 product2 .... 
360     id:onIfAll    = product1 product2 .... 
361     id:onPosIfAll = product1 product2 .... 
362     id:onNegIfAll = product1 product2 .... 
363 </pre>
364 will set the <code>onMode</code> 0, 1, 2 or 3, respectively, for all 
365 channels which contain all of the enumerated products, again without 
366 distinction of particles and antiparticles. If the same product appears 
367 twice in the list it must also appear twice in the decay channel, and 
368 so on. The decay channel is allowed to contain further particles, 
369 beyond the product list. By contrast,
370 <pre> 
371     id:offIfMatch   = product1 product2 .... 
372     id:onIfMatch    = product1 product2 .... 
373     id:onPosIfMatch = product1 product2 .... 
374     id:onPosIfMatch = product1 product2 .... 
375 </pre>
376 requires the decay-channel multiplicity to agree with that of the product
377 list, but otherwise works as the <code>onIfAll/offIfAll</code> methods.
378
379 <p/>
380 Note that the action of several of the commands depends on the order
381 in which they are executed, as one would logically expect. For instance, 
382 <code>id:oneChannel</code> removes all decay channels of <code>id</code>
383 and thus all previous changes in this decay table, while subsequent
384 additions or changes would still take effect. Another example would be that
385 <code>23:onMode = off</code> followed by <code>23:onIfAny = 1 2 3 4 5</code>
386 would let the <ei>Z^0</ei> decay to quarks, while no decays would be
387 allowed if the order were to be reversed.   
388
389 <p/> 
390 b) The <code>Pythia</code> <code>readString(string)</code> method actually 
391 does not do changes itself, but sends on the string either to the
392 <code>ParticleData</code> class or to the <code>Settings</code> one,
393 depending on whether the string begins with a digit or a letter. 
394 If desired, it is possible to communicate directly with the corresponding 
395 <code>ParticleData</code> method:
396 <pre>
397     pythia.particleData.readString("111:mayDecay = off"); 
398     pythia.particleData.readString("15:2:products = 16 -211"); 
399 </pre>
400 In this case, changes intended for <code>Settings</code> would not be 
401 understood.
402
403 <p/>
404 c) Underlying this are commands for all the individual properties in  
405 the <code>ParticleData</code> class, one for each. These are 
406 further described below. Thus, an example now reads 
407 <pre>
408     pythia.particleData.mayDecay(111, false);
409 </pre>
410 Boolean values should here be given as <code>true</code> or 
411 <code>false</code>. 
412
413 <p/>
414 d) A simpler and more useful way is to collect all your changes
415 in a separate file, with one line per change, e.g. 
416 <pre>
417     111:mayDecay = off
418 </pre>
419 The file can be read by the 
420 <pre>
421     pythia.readFile(fileName); 
422 </pre>
423 method, where <code>fileName</code> is a string, e.g.
424 <code>pythia.readFile("main.cmnd")</code> (or an <code>istream</code> 
425 instead of a <code>fileName</code>). Each line is processed as 
426 described for the string in 2a). This file can freely mix commands to 
427 the <code>Settings</code> and <code>ParticleData</code> classes. 
428 </li> 
429
430 <li> <p/>
431 A routine <code>reInit(fileName)</code> is provided, and can be used to 
432 zero the particle data table and reinitialize it from scratch.
433 Such a call might be useful if several subruns are to be made with 
434 widely different particle data - normally the maps are only built 
435 from scratch once, namely when the <code>Pythia()</code> object is 
436 created. Also, there is no other possibility to restore the default 
437 values, unlike for the settings.
438 </li> 
439
440 <li> <p/>
441 You may at any time obtain a listing of all the particle data by calling
442 <pre>
443     pythia.particleData.listAll();
444 </pre>
445 The listing is by increasing <code>id</code> number. It shows the basic 
446 quantities introduced above. Some are abbreviated in the header to fit on
447 the lines: <code>spn = spinType</code>, <code>chg = chargeType</code>, 
448 <code>col = colType</code>, <code>res = isResonance</code>, 
449 <code>dec = mayDecay && canDecay</code> (the latter checks that decay 
450 channels have been defined), <code>ext = doExternalDecay</code>,
451 <code>vis = isVisible</code> and <code>wid = doForceWidth</code>.<br/>
452
453 To list only those particles that were changed (one way or another, the 
454 listing will not tell what property or decay channel was changed), instead use
455 <pre>
456     pythia.particleData.listChanged();
457 </pre>
458 (This info is based on a further <code>hasChanged</code> flag of a particle
459 or a channel, set <code>true</code> whenever any of the changing methods are 
460 used. It is possible to manipulate this value, but this is not recommended.) 
461 By default the internal initialization of the widths of resonances such as 
462 <ei>gamma^*/Z^0, W^+-, t/tbar, H^0</ei> do not count as changes; if you want
463 to list also those changes instead call <code>listChanged(true)</code>.
464 <br/>
465
466 To list only one particle, give its <code>id</code> code as argument to
467 the <code>list(...)</code> function.. To list a restricted set of particles, 
468 give in their <code>id</code> codes to <code>list(...)</code> as a 
469 <code>vector&lt;int></code>.
470 </li> 
471
472 <li> <p/>
473 For wholesale changes of particle properties all available data can be 
474 written out, edited, and then read back in again. These methods are
475 mainly intended for expert users. You can choose between two alternative
476 syntaxes.
477
478 <p/>
479 a) XML syntax, using the <code>&lt;particle</code> and 
480 <code>&lt;channel</code> lines already described. You use the method
481 <code>particleData.listXML(fileName)</code> to produce such an XML
482 file and <code>particleData.readXML(fileName)</code> to read it back
483 in after editing.
484
485 <p/>
486 b) Fixed/free format, using exactly the same information as illustrated
487 for the <code>&lt;particle</code> and <code>&lt;channel</code> lines
488 above, but now without any tags. This means that all information fields
489 must be provided (if there is no antiparticle then write 
490 <code>void</code>), in the correct order (while the order is irrelevant 
491 with XML syntax), and all on one line. Information is written out in 
492 properly lined-up columns, but the reading is done using free format, 
493 so fields need only be separated by at least one blank. Each new particle 
494 is supposed to be separated by (at least) one blank line, whereas no
495 blank lines are allowed between the particle line and the subsequent 
496 decay channel lines, if any.  You use the method
497 <code>particleData.listFF(fileName)</code> to produce such a fixed/free
498 file and <code>particleData.readFF(fileName)</code> to read it back
499 in after editing.
500
501 <p/>
502 As an alternative to the <code>readXML</code> and <code>readFF</code> 
503 methods you can also use the 
504 <code>particleData.reInit(fileName, xmlFormat)</code> method, where
505 <code>xmlFormat = true</code> (default) corresponds to reading an XML
506 file and <code>xmlFormat = false</code> to a fixed/free format one.
507
508 <p/>
509 To check that the new particle and decay tables makes sense, you can use 
510 the <code>particleData.checkTable()</code> method, either directly or by 
511 switching it on among the standard 
512 <aloc href="ErrorChecks">error checks</aloc>. 
513 </li>
514
515 </ol>
516
517 <h2>The public methods</h2>
518
519 In the following we present briefly the public methods in the three 
520 classes used to build up the particle database. The order
521 is top-down, i.e from the full table of all particles to a single
522 particle to a single channel.
523 Note that these methods usually are less elegant and safe than the 
524 input methods outlined above. If you use any of these methods, it is
525 likely to be the ones in the full database, i.e. the first ones to be
526 covered in the following.
527
528 <p/>
529 For convenience, we have grouped related input and output methods
530 together. It should be obvious from the context which is which:
531 the input is of type <code>void</code> and has an extra last argument, 
532 namely is the input value, while the output method returns a
533 quantity of the expected type.
534
535 <h3>The ParticleData methods</h3>
536
537 <method name="ParticleData::ParticleData()">
538 the constructor has no arguments and does not do anything. Internal.
539 </method>
540
541 <method name="void ParticleData::initPtr(Info* infoPtr,
542 Settings* settingsPtrIn, Rndm* rndmPtrIn, CoupSM* coupSMPtrIn)">
543 initialize pointers to a few other classes. Internal.
544 </method>
545
546 <method name="bool ParticleData::init(string 
547 startFile = &quot;../xmldoc/ParticleData.xml&quot;)">
548 read in an XML-style file with particle data and initialize the
549 particle data tables accordingly. This command is executed
550 in the <code>Pythia</code> constructor, i.e. is mainly for
551 internal use.
552 <argument name="startFile" default ="../xmldoc/ParticleData.xml"> 
553 the name of the data file to be read. When called from the 
554 <code>Pythia</code> constructor the directory is provided by the 
555 <code><aloc href="ProgramFlow">PYTHIA8DATA</aloc></code> 
556 environment variable, if set, else by the argument of this constructor,
557 which has the default value &quot;../xmldoc&quot;. 
558 </argument>  
559 </method>
560
561 <method name="bool ParticleData::reInit(string startFile,
562 bool xmlFormat = true)">
563 overwrite the existing database by reading from the specified file.
564 Unlike <code>init</code> above this method is not called by the 
565 <code>Pythia</code> constructor, but is entirely intended for users
566 who want to replace the existing particle data with their own.
567 <argument name="startFile">the path and name of file to be read. 
568 </argument>  
569 <argument name="xmlFormat">if true read the same kind of XML-style file
570 as used by <code>init</code>, if not use an alternative "free format" 
571 file (i.e. without any XML tags, but with well-defined rules 
572 specifying in which order properties are stored). 
573 </argument>  
574 </method>
575
576 <method name="void ParticleData::initWidths(
577 vector&lt;ResonanceWidths*&gt; resonancePtrs)">
578 initialize Breit-Wigner shape parameters for all particles,
579 and the detailed handling of resonances, i.e. particles with 
580 perturbatively calculable partial widths, which can be used to
581 obtain a mass-dependent Breit-Wigner and a dynamic choice of
582 decay channels. Called from <code>Pythia::init()</code>.
583 </method>
584
585 <method name="bool ParticleData::readXML(string inFile, 
586 bool reset = true)">
587 </method>
588 <methodmore name="void ParticleData::listXML(string outFile)">
589 read in XML-style data from a file or write it out to a file. For the 
590 former one can also decide whether to reset all particles to scratch,
591 or only overwrite those particles in the file. The former method is 
592 used by <code>init</code> and <code>reInit</code> above.
593 </methodmore>
594
595 <method name="bool ParticleData::readFF(string inFile, 
596 bool reset = true)">
597 </method>
598 <methodmore name="void ParticleData::listFF(string outFile)">
599 read in free-format-style data from a file or write it out to a file. 
600 For the former one can also decide whether to reset all particles to 
601 scratch, or only overwrite those particles in the file. The former 
602 method is used by <code>reInit</code> above.
603 </methodmore>
604
605 <method name="bool ParticleData::readString(string line, 
606 bool warn = true, ostream& os = cout)">
607 read in a string and interpret is as a new or changed particle data.
608 The possibilities are extensively described above. It is normally 
609 used indirectly, via <code>Pythia::readString(...)</code> and
610 <code>Pythia::readFile(...)</code>.
611 <argument name="line">
612 the string to be interpreted as an instruction.
613 </argument>
614 <argument name="warn" default="true">
615 write a warning message or not whenever the instruction does not make
616 sense, e.g. if the particle does not exist in the database.
617 </argument>
618 <argument name="os" default="cout">
619 stream for error printout.  
620 </argument>
621 <note>Note:</note> the method returns false if it fails to 
622 make sense out of the input string.
623 </method>
624
625 <method name="void ParticleData::listAll(ostream& os = cout)">
626 </method>
627 <methodmore name="void ParticleData::listChanged(ostream& os = cout)">
628 </methodmore>
629 <methodmore name="void ParticleData::listChangedAndRes(ostream& os 
630 = cout)">
631 </methodmore>
632 <methodmore name="void ParticleData::list(bool changedOnly = false, 
633 bool changedRes = true, ostream& os = cout)">
634 methods intended to present a listing of particle data in a readable
635 format. The first three are special cases of the fourth. The first
636 lists all particle data, the second only data for those particles that
637 were changed after the original creation of the particle data table.
638 Resonances are a special case since they can get their data changed 
639 by being linked to an object that does the calculation of branching
640 ratios. The second method does not count such resonances as changed,
641 whereas the third does and thus lists all resonances.
642 </methodmore>
643
644 <method name="void ParticleData::list(int idList, ostream& os = cout)">
645 </method>
646 <methodmore name="void ParticleData::list(vector&lt;int&gt; idList, 
647 ostream& os = cout)">
648 list particle data for one single particle, with the identity code as
649 input, or for a set of particles, with an input vector of identity codes. 
650 </methodmore>
651
652 <method name="void ParticleData::checkTable(ostream& os = cout)">
653 </method>
654 <methodmore name="void ParticleData::checkTable(int verbosity,
655 ostream& os = cout)">
656 check that the particle decay table makes sense, especially for decays.
657 <argument name="verbosity"> level of checks. 0 is only mininal,
658 e.g. if a particle has no open decay channels. 1, which is the level
659 of the first method, provides warning if any individual channel is 
660 closed, except for resonances. 2 also prints the 
661 branching-ratio-averaged threshold mass. 11 and 12 are like 1 and 2,
662 but also include resonances in the detailed checks.  
663 </argument>
664 </methodmore>
665
666 <method name="void ParticleData::addParticle(int id, 
667 string name = &quot; &quot;, int spinType = 0, int chargeType = 0, 
668 int colType = 0, double m0 = 0., double mWidth = 0., double mMin = 0., 
669 double mMax = 0., double tau0 = 0.)">
670 </method>
671 <methodmore name="void ParticleData::addParticle(int id, 
672 string name, string antiName, int spinType = 0, int chargeType = 0, 
673 int colType = 0, double m0 = 0., double mWidth = 0., double mMin = 0., 
674 double mMax = 0., double tau0 = 0.)">
675 add a particle to the decay table; in the first form a partcle which is 
676 its own antiparticle, in the second where a separate antiparticle exists.
677 </methodmore>
678
679 <method name="void ParticleData::setAll(int id, 
680 string name, string antiName, int spinType = 0, int chargeType = 0, 
681 int colType = 0, double m0 = 0., double mWidth = 0., double mMin = 0., 
682 double mMax = 0.,double tau0 = 0.)"> 
683 change all the properties of the particle associated with a given
684 identity code.
685 </method>
686
687 <method name="bool ParticleData::isParticle(int id)">
688 query whether the particle data table contains the particle of the 
689 identity code.
690 </method>
691
692 <method name="int ParticleData::nextId(int id)">
693 return the identity code of the sequentially next particle stored in table.
694 </method>
695
696 <method name="bool ParticleData::hasAnti(int id)">
697 bool whether a distinct antiparticle exists or not. Is true if an
698 antiparticle name has been set (and is different from 
699 <code>void</code>).
700 </method>
701
702 <method name="void ParticleData::name(int id, string name)">
703 </method>
704 <methodmore name="void ParticleData::antiName(int id, string antiName)">
705 </methodmore>
706 <methodmore name="void ParticleData::names(int id, 
707 string name, string antiName)">
708 </methodmore>
709 <methodmore name="string ParticleData::name(int id)">
710 particle and antiparticle names are stored separately, the sign of 
711 <code>id</code> determines which of the two is returned, with 
712 <code>void</code> used to indicate the absence of an antiparticle. 
713 </methodmore>
714
715 <method name="void ParticleData::spinType(int id, int spinType)">
716 </method>
717 <methodmore name="int ParticleData::spinType(int id)">
718 the spin type, of the form <ei>2 s + 1</ei>, with special code 0
719 for entries of unknown or indeterminate spin.
720 </methodmore>
721
722 <method name="void ParticleData::chargeType(int id, int chargeType)">
723 </method>
724 <methodmore name="int ParticleData::chargeType(int id)"> 
725 three times the charge (to make it an integer), taking into account
726 the sign of <code>id</code>.
727 </methodmore>
728
729 <method name="double ParticleData::charge(int id)"> 
730 the electrical charge of a particle, equal to 
731 <code>chargeType(id)/3</code>.
732 </method>
733
734 <method name="void ParticleData::colType(int id, int colType)">
735 </method>
736 <methodmore name="int ParticleData::colType(int id)">
737 the colour type, with 0 uncoloured, 1 triplet, -1 antitriplet and 2 
738 octet, taking into account the sign of <code>id</code>.
739 </methodmore>
740
741 <method name="void ParticleData::m0(int id, double m0)">
742 </method>
743 <methodmore name="double ParticleData::m0(int id)">
744 the nominal mass <ei>m_0</ei> (in GeV).
745 </methodmore>
746
747 <method name="void ParticleData::mWidth(int id, double mWidth)">
748 </method>
749 <methodmore name="double ParticleData::mWidth(int id)">
750 the width <ei>Gamma</ei> of the Breit-Wigner distribution (in GeV).
751 </methodmore>
752
753 <method name="void ParticleData::mMin(int id, double mMin)">
754 </method>
755 <methodmore name="double ParticleData::mMin(int id)">
756 the lower limit of the allowed mass range generated by the Breit-Wigner 
757 (in GeV). Has no meaning for particles without width, and would 
758 typically be 0 there.
759 </methodmore>
760
761 <method name="void ParticleData::mMax(int id, double mMax)">
762 </method>
763 <methodmore name="double ParticleData::mMax(int id)">
764 the upper limit of the allowed mass range generated by the Breit-Wigner 
765 (in GeV). If <ei>mMax &lt; mMin</ei> then no upper limit is imposed. 
766 Has no meaning for particles without width, and would typically 
767 be 0 there.
768 </methodmore>
769
770 <method name="double ParticleData::m0Min(int id)">
771 similar to <code>mMin()</code> above, except that for particles with 
772 no width the <code>m0(id)</code> value is returned.
773 </method>
774
775 <method name="double ParticleData::m0Max(int id)">
776 similar to <code>mMax()</code> above, except that for particles with 
777 no width the <code>m0(id)</code> value is returned.
778 </method>
779
780 <method name="void ParticleData::tau0(int id, double tau0)">
781 </method>
782 <methodmore name="double ParticleData::tau0(int id)">
783 the nominal proper lifetime <ei>tau_0</ei> (in mm/c).
784 </methodmore>
785
786 <method name="void ParticleData::isResonance(int id, bool isResonance)">
787 </method>
788 <methodmore name="bool ParticleData::isResonance(int id)">
789 a flag telling whether a particle species are considered as a resonance 
790 or not. Here <aloc href="ResonanceDecays">"resonance"</aloc> 
791 is used as shorthand for any massive particle 
792 where the decay process should be counted as part of the hard process
793 itself, and thus be performed before showers and other event aspects 
794 are added. Restrictions on allowed decay channels is also directly
795 reflected in the cross section of simulated processes, while those of
796 normal hadrons and other light particles are not.
797 In practice, it is reserved for states above the <ei>b bbar</ei> 
798 bound systems in mass, i.e. for <ei>W, Z, t</ei>, Higgs states, 
799 supersymmetric states and (most?) other states in any new theory. 
800 All particles with <code>m0</code> above 20 GeV are by default
801 initialized to be considered as resonances. 
802 </methodmore>
803
804 <method name="void ParticleData::mayDecay(int id, bool mayDecay)">
805 </method>
806 <methodmore name="bool ParticleData::mayDecay(int id)">
807 a flag telling whether a particle species may decay or not, offering 
808 the main user switch. Whether a given particle of this kind then actually 
809 will decay also depends on it having allowed decay channels, and on
810 other flags for <aloc href="ParticleDecays">particle decays</aloc>. 
811 All particles with <code>tau0</code> below 1000 mm are 
812 by default initialized to allow decays.
813 </methodmore>
814
815 <method name="void ParticleData::doExternalDecays(int id, 
816 bool doExternalDecays)">
817 </method>
818 <methodmore name="bool ParticleData::doExternalDecay(int id)">
819 a flag telling whether a particle should be handled by an external 
820 decay package or not, with the latter default. Can be manipulated as 
821 described on this page, but should normally not be. Instead the
822 <code><aloc href="ExternalDecays">pythia.decayPtr</aloc></code> 
823 method should be provided with the list of relevant particles.
824 </methodmore>
825
826 <method name="void ParticleData::isVisible(int id, bool isVisible)">
827 </method>
828 <methodmore name="bool ParticleData::isVisible(int id)">
829 a flag telling whether a particle species is to be considered as
830 visible in a detector or not, as used e.g. in analysis routines.
831 By default this includes neutrinos and a few BSM particles
832 (gravitino, sneutrinos, neutralinos) that have neither strong nor
833 electromagnetic charge, and are not made up of constituents that
834 have it. The value of this flag is only relevant if a particle is
835 long-lived enough actually to make it to a detector.
836 </methodmore>
837
838 <method name="void ParticleData::doForceWidth(int id, bool doForceWidth)">
839 </method>
840 <methodmore name="bool ParticleData::doForceWidth(int id)">
841 a flag valid only for resonances where PYTHIA contains code to
842 calculate the width of the resonance from encoded matrix-element
843 expressions, i.e. the <ei>Z^0</ei>, <ei>W^+-</ei>, <ei>t</ei>, 
844 <ei>h^0</ei>, and a few more. The normal behaviour (<code>false</code>)
845 is then that the width is calculated from the mass, but it is 
846 possible to <aloc href="ResonanceDecays">force</aloc> the resonance 
847 to retain the nominal width. Branching ratios and the running of the 
848 total width are unaffected.
849 </methodmore>
850
851 <method name="void ParticleData::hasChanged(int id, bool hasChanged)">
852 </method>
853 <methodmore name="bool ParticleData::hasChanged(int id)">
854 keep track of whether the data for a particle has been changed
855 in any respect between initialization and the current status.
856 Is used e.g. by the <code>listChanged</code> method to determine
857 which particles to list.
858 </method>
859
860 <method name="bool ParticleData::useBreitWigner(int id)">
861 tells whether a particle will have a Breit-Wigner mass distribution or 
862 not. Is determined by an internal logic based on the particle width and
863 on the value of the 
864 <code><aloc href="ParticleData">ParticleData:modeBreitWigner</aloc></code> 
865 switch.
866 </method>
867
868 <method name="double ParticleData::constituentMass(int id)">
869 is the constituent mass for a quark, hardcoded as 
870 <ei>m_u = m_d = 0.325</ei>, <ei>m_s = 0.50</ei>, <ei>m_c = 1.60</ei> 
871 and <ei>m_b = 5.0</ei> GeV, for a diquark the sum of quark constituent 
872 masses, and for everything else the same as the ordinary mass.
873 </method>
874
875 <method name="double ParticleData::mass(int id)">
876 returns a mass distributed according to a truncated Breit-Wigner, 
877 with parameters as described here. Is equal to <code>m0(id)</code> for 
878 particles without width. 
879 </method>
880
881 <method name="double ParticleData::mRun(int id, double mH)">
882 calculate the running mass of species <code>id</code> when probed at a 
883 hard mass scale of <code>mH</code>. Only applied to obtain the 
884 running quark masses; for all other particle the normal fixed mass
885 is used.
886 </method>
887
888 <method name="bool ParticleData::canDecay(int id)">
889 true for a particle with at least one decay channel defined.
890 </method>
891
892 <method name="bool ParticleData::isLepton(int id)">
893 true for a lepton or an antilepton (including neutrinos).
894 </method>
895
896 <method name="bool ParticleData::isQuark(int id)">
897 true for a quark or an antiquark.
898 </method>
899
900 <method name="bool ParticleData::isGluon(int id)">
901 true for a gluon.
902 </method>
903
904 <method name="bool ParticleData::isDiquark(int id)">
905 true for a diquark or antidiquark.
906 </method>
907
908 <method name="bool ParticleData::isParton()">
909 true for a gluon, a quark or antiquark up to the b (but excluding top),
910 and a diquark or antidiquark consisting of quarks up to the b.
911 </method>
912
913 <method name="bool ParticleData::isHadron(int id)">
914 true for a hadron (made up out of normal quarks and gluons, 
915 i.e. not for R-hadrons and other exotic states).
916 </method>
917
918 <method name="bool ParticleData::isMeson(int id)">
919 true for a meson.
920 </method>
921
922 <method name="bool ParticleData::isBaryon(int id)">
923 true for a baryon or antibaryon.
924 </method>
925
926 <method name="bool ParticleData::isOctetHadron(int id)">
927 true for an intermediate hadron-like state with a colour octet charge
928 as used in the colour octet model for 
929 <aloc href="OniaProcesses">onia</aloc> production.
930 </method>
931
932 <method name="int ParticleData::heaviestQuark(int id)">
933 extracts the heaviest quark or antiquark, i.e. one with largest 
934 <code>id</code> number, for a hadron. 
935 </method>
936
937 <method name="int ParticleData::baryonNumberType(int id)">
938 is 1 for a quark, 2 for a diquark, 3 for a baryon, the same with a 
939 minus sign for antiparticles, and else zero.
940 </method>
941
942 <method name="void ParticleData::rescaleBR(int id, double newSumBR = 1.)">
943 rescales all partial branching ratios by a common factor, such that 
944 the sum afterward becomes <code>newSumBR</code>.
945 </method>
946
947 <method name="void setResonancePtr(int id, ResonanceWidths* resonancePtr)">
948 set a pointer for a particle kind to a <code>ResonanceWidths</code> object. 
949 This is done, from inside <code>ParticleData::initWidths</code>, only for 
950 resonances, i.e. for particles such as <ei>Z^0</ei>, <ei>W^+-</ei>, top, 
951 Higgs, and new unstable states beyond the Standard Model. The presence
952 of such an object will allow a more dynamic calculation of partial and
953 total widths, as illustrated by the following methods.
954 </method>
955
956 <method name="void ParticleData::resInit(int id)">
957 initialize the treatment of a resonance.
958 </method>
959
960 <method name="double ParticleData::resWidth(int id, double mHat, 
961 int idInFlav = 0, bool openOnly = false, bool setBR = false)">
962 calculate the total with for a resonance of a given current mass,
963 optionally including coupling to incoming flavour state (consider
964 the <ei>gamma*/Z^0</ei> combination), optionally excluding decay 
965 channels that have been closed by the user, and optionally storing 
966 the results in the normal decay table.
967 </method>
968
969 <method name="double ParticleData::resWidthOpen(int id, double mHat, 
970 int idInFlav = 0)">
971 special case of <code>resWidth</code>, where only open channels are 
972 included, but results are not stored in the normal decay table.
973 </method>
974
975 <method name="double ParticleData::resWidthStore(int id, double mHat, 
976 int idInFlav = 0)">
977 special case of <code>resWidth</code>, where only open channels are 
978 included, and results are stored in the normal decay table.
979 </method>
980
981 <method name="double ParticleData::resOpenFrac(int id1, int id2 = 0, 
982 int id3 = 0)">
983 calculate the fraction of the full branching ratio that is left
984 open by the user choice of allowed decay channels. Can be applied
985 to a final state with up to three resonances. Since the procedure 
986 is multiplicative, it would be easy to generalize also to more.
987 </method>
988
989 <method name="double ParticleData::resWidthRescaleFactor(int id)">
990 the factor used to rescale all partial widths in case the total
991 width is being forced to a specific value by the user.
992 </method>
993
994 <method name="double ParticleData::resWidthChan(int id,
995 double mHat, int idAbs1 = 0, int idAbs2 = 0)">
996 special case to calculate one final-state width; currently only used 
997 for Higgs decay to <ei>q qbar</ei>, <ei>g g</ei> or 
998 <ei>gamma gamma</ei>. 
999 </method>
1000
1001 <method name="ParticleDataEntry* 
1002 ParticleData::particleDataEntryPtr(int id)">
1003 returns a pointer to the <code>ParticleDataEntry</code> object.
1004 The methods in the next section can then be used to manipulate
1005 this object. 
1006 </method>
1007  
1008 <h3>The ParticleDataEntry methods</h3>
1009
1010 Most of the methods that can be applied to a single 
1011 <code>ParticleDataEntry</code> object are almost identical with
1012 those used above for the <code>ParticleData</code>, except
1013 that the <code>id</code> argument is no longer needed to find 
1014 the right entry in the table. By and large, this makes direct 
1015 access to the <code>ParticleDataEntry</code> methods superfluous.
1016 There are a few methods that are unique to each class, however. 
1017 Furthermore, to avoid some naming ambiguities, many methods that 
1018 set values begin with <code>set</code>. 
1019
1020 <method name="ParticleDataEntry::ParticleDataEntry(int id = 0, 
1021 string name = &quot; &quot;, int spinType = 0, int chargeType = 0, 
1022 int colType = 0, double m0 = 0., double mWidth = 0., 
1023 double mMin = 0., double mMax = 0., double tau0 = 0.)">
1024 </method>
1025 <methodmore name="ParticleDataEntry::ParticleDataEntry(int id, 
1026 string name, string antiName, int spinType = 0, int chargeType = 0, 
1027 int colType = 0, double m0 = 0., double mWidth = 0., 
1028 double mMin = 0., double mMax = 0., double tau0 = 0.)">
1029 there are two alternative constructors, that both expect the
1030 properties of a particle as input. The first assumes that there
1031 is only one particle, thet latter that there is a 
1032 particle-antiparticle pair (but if the antiparticle name is
1033 <code>void</code> one reverts back to the particle-only case).
1034 </methodmore>
1035
1036 <method name="ParticleDataEntry::~ParticleDataEntry">
1037 the destructor is needed to delete any <code>ResonanceWidths</code>
1038 objects that have been created and linked to the respective particle.
1039 </method>
1040
1041 <method name="void ParticleDataEntry::setDefaults()">
1042 initialize some particle flags with default values, e.g. whether 
1043 a particle is a resonance, may decay, or is visible. Is called from the
1044 constructors and from <code>setAll</code>.
1045 </method>
1046
1047 <method name="void ParticleDataEntry::initPtr(ParticleData* 
1048 particleDataPtrIn)">
1049 initialize pointer back to the whole database (so that masses of 
1050 decay products can be accessed, e.g.).
1051 </method>
1052
1053 <method name="void ParticleDataEntry::setAll( 
1054 string name, string antiName, int spinType = 0, int chargeType = 0, 
1055 int colType = 0, double m0 = 0., double mWidth = 0., double mMin = 0., 
1056 double mMax = 0.,double tau0 = 0.)"> 
1057 change all the properties of the particle associated with a given
1058 identity code.
1059 </method>
1060
1061 <method name="int ParticleDataEntry::id()">
1062 the PDG identity code.
1063 </method>
1064
1065 <method name="bool ParticleDataEntry::hasAnti()">
1066 tell whether a separate antiparticle exists.
1067 </method>
1068
1069 <method name="void ParticleDataEntry::setName(string name)">
1070 </method>
1071 <methodmore name="void ParticleDataEntry::setAntiName(string antiName)">
1072 </methodmore>
1073 <methodmore name="void ParticleDataEntry::setNames(string name,
1074 string antiName)">
1075 </methodmore>
1076 <methodmore name="string ParticleDataEntry::name(int id = 1)">
1077 set or get the particle or antiparticle name. Only the sign of 
1078 <code>id</code> is needed to distinguish particle/antiparticle. 
1079 </methodmore>
1080
1081 <method name="void ParticleDataEntry::setSpinType(int spinType)">
1082 </method>
1083 <methodmore name="int ParticleDataEntry::spinType()">
1084 set or get the particle spin type, i.e. <ei>2 s + 1</ei>, or 0 in some
1085 special cases.
1086 </methodmore>
1087
1088 <method name="void ParticleDataEntry::setChargeType(int chargeType)">
1089 </method>
1090 <methodmore name="int ParticleDataEntry::chargeType(int id = 1)">
1091 </methodmore>
1092 <methodmore name="double ParticleDataEntry::charge(int id = 1)">
1093 set or get the particle charge type, i.e. three times the charge, 
1094 or the charge itself. Only the sign of <code>id</code> is needed 
1095 to distinguish particle/antiparticle. 
1096 </methodmore>
1097
1098 <method name="void ParticleDataEntry::setColType(int colType)">
1099 </method>
1100 <methodmore name="int ParticleDataEntry::colType(int id = 1)">
1101 set or get the particle colour type, 0 for singlet, 1 for triplet,
1102 -1 for antitriplet, 2 for octet. Only the sign of <code>id</code> 
1103 is needed to distinguish particle/antiparticle.  
1104 </methodmore>
1105
1106 <method name="void ParticleDataEntry::setM0(double m0)">
1107 </method>
1108 <methodmore name="double ParticleDataEntry::m0()">
1109 the nominal mass <ei>m_0</ei> (in GeV).
1110 </methodmore>
1111
1112 <method name="void ParticleDataEntry::setMWidth(double mWidth)">
1113 </method>
1114 <methodmore name="double ParticleDataEntry::mWidth()">
1115 the width <ei>Gamma</ei> of the Breit-Wigner distribution (in GeV).
1116 </methodmore>
1117
1118 <method name="void ParticleDataEntry::setMMin(double mMin)">
1119 </method>
1120 <methodmore name="double ParticleDataEntry::mMin()">
1121 the lower limit of the allowed mass range generated by the Breit-Wigner 
1122 (in GeV). Has no meaning for particles without width, and would 
1123 typically be 0 there.
1124 </methodmore>
1125
1126 <method name="void ParticleDataEntry::setMMax(double mMax)">
1127 </method>
1128 <methodmore name="double ParticleDataEntry::mMax()">
1129 the upper limit of the allowed mass range generated by the Breit-Wigner 
1130 (in GeV). If <ei>mMax &lt; mMin</ei> then no upper limit is imposed. 
1131 Has no meaning for particles without width, and would typically 
1132 be 0 there.
1133 </methodmore>
1134
1135 <method name="double ParticleDataEntry::m0Min()">
1136 similar to <code>mMin()</code> above, except that for particles with 
1137 no width the <code>m0(id)</code> value is returned.
1138 </method>
1139
1140 <method name="double ParticleDataEntry::m0Max()">
1141 similar to <code>mMax()</code> above, except that for particles with 
1142 no width the <code>m0(id)</code> value is returned.
1143 </method>
1144
1145 <method name="void ParticleDataEntry::setTau0(double tau0)">
1146 </method>
1147 <methodmore name="double ParticleDataEntry::tau0()">
1148 the nominal proper lifetime <ei>tau_0</ei> (in mm/c).
1149 </methodmore>
1150
1151 <method name="void ParticleDataEntry::setIsResonance(bool isResonance)">
1152 </method>
1153 <methodmore name="bool ParticleDataEntry::isResonance()">
1154 a flag telling whether a particle species are considered as a resonance 
1155 or not. Here <aloc href="ResonanceDecays">"resonance"</aloc> 
1156 is used as shorthand for any massive particle 
1157 where the decay process should be counted as part of the hard process
1158 itself, and thus be performed before showers and other event aspects 
1159 are added. Restrictions on allowed decay channels is also directly
1160 reflected in the cross section of simulated processes, while those of
1161 normal hadrons and other light particles are not.
1162 In practice, it is reserved for states above the <ei>b bbar</ei> 
1163 bound systems in mass, i.e. for <ei>W, Z, t</ei>, Higgs states, 
1164 supersymmetric states and (most?) other states in any new theory. 
1165 All particles with <code>m0</code> above 20 GeV are by default
1166 initialized to be considered as resonances. 
1167 </methodmore>
1168
1169 <method name="void ParticleDataEntry::setMayDecay(bool mayDecay)">
1170 </method>
1171 <methodmore name="bool ParticleDataEntry::mayDecay()">
1172 a flag telling whether a particle species may decay or not, offering 
1173 the main user switch. Whether a given particle of this kind then actually 
1174 will decay also depends on it having allowed decay channels, and on
1175 other flags for <aloc href="ParticleDecays">particle decays</aloc>. 
1176 All particles with <code>tau0</code> below 1000 mm are 
1177 by default initialized to allow decays.
1178 </methodmore>
1179
1180 <method name="void ParticleDataEntry::setDoExternalDecays(bool 
1181 doExternalDecays)">
1182 </method>
1183 <methodmore name="bool ParticleDataEntry::doExternalDecay()">
1184 a flag telling whether a particle should be handled by an external 
1185 decay package or not, with the latter default. Can be manipulated as 
1186 described on this page, but should normally not be. Instead the
1187 <code><aloc href="ExternalDecays">pythia.decayPtr</aloc></code> 
1188 method should be provided with the list of relevant particles.
1189 </methodmore>
1190
1191 <method name="void ParticleDataEntry::setIsVisible(bool isVisible)">
1192 </method>
1193 <methodmore name="bool ParticleDataEntry::isVisible()">
1194 a flag telling whether a particle species is to be considered as
1195 visible in a detector or not, as used e.g. in analysis routines.
1196 By default this includes neutrinos and a few BSM particles
1197 (gravitino, sneutrinos, neutralinos) that have neither strong nor
1198 electromagnetic charge, and are not made up of constituents that
1199 have it. The value of this flag is only relevant if a particle is
1200 long-lived enough actually to make it to a detector.
1201 </methodmore>
1202
1203 <method name="void ParticleDataEntry::setDoForceWidth(bool 
1204 doForceWidth)">
1205 </method>
1206 <methodmore name="bool ParticleDataEntry::doForceWidth()">
1207 a flag valid only for resonances where PYTHIA contains code to
1208 calculate the width of the resonance from encoded matrix-element
1209 expressions, i.e. the <ei>Z^0</ei>, <ei>W^+-</ei>, <ei>t</ei>, 
1210 <ei>h^0</ei>, and a few more. The normal behaviour (<code>false</code>)
1211 is then that the width is calculated from the mass, but it is 
1212 possible to <aloc href="ResonanceDecays">force</aloc> the resonance 
1213 to retain the nominal width. Branching ratios and the running of the 
1214 total width are unaffected.
1215 </methodmore>
1216
1217 <method name="void ParticleDataEntry::setHasChanged(bool hasChanged)">
1218 </method>
1219 <method name="void ParticleDataEntry::hasChanged(bool hasChanged)">
1220 keep track of whether the data for a particle has been changed
1221 in any respect between initialization and the current status.
1222 Is used e.g. by the <code>ParticleData::listChanged</code> method 
1223 to determine which particles to list.
1224 </method>
1225
1226 <method name="void ParticleDataEntry::initBWmass()">
1227 Prepare the Breit-Wigner mass selection by precalculating 
1228 frequently-used expressions.
1229 </method>
1230
1231 <method name="double ParticleDataEntry::constituentMass()">
1232 is the constituent mass for a quark, hardcoded as 
1233 <ei>m_u = m_d = 0.325</ei>, <ei>m_s = 0.50</ei>, <ei>m_c = 1.60</ei> 
1234 and <ei>m_b = 5.0</ei> GeV, for a diquark the sum of quark constituent 
1235 masses, and for everything else the same as the ordinary mass.
1236 </method>
1237
1238 <method name="double ParticleDataEntry::mass()">
1239 give the mass of a particle, either at the nominal value
1240 or picked according to a (linear or quadratic) Breit-Wigner. 
1241 </method>
1242
1243 <method name="double ParticleDataEntry::mRun(double mH)">
1244 calculate the running quark mass at a hard scale <code>mH</code>.
1245 For other particles the on-shell mass is given.
1246 </method>
1247
1248 <method name="bool ParticleDataEntry::useBreitWigner()">
1249 tells whether a particle will have a Breit-Wigner mass distribution or 
1250 not. Is determined by an internal logic based on the particle width and
1251 on the value of the <code><aloc href="ParticleData">
1252 ParticleData:modeBreitWigner</aloc></code> switch.
1253 </method>
1254
1255 <method name="bool ParticleDataEntry::canDecay(int id)">
1256 true for a particle with at least one decay channel defined.
1257 </method>
1258
1259 <method name="bool ParticleDataEntry::isLepton()">
1260 true for a lepton or an antilepton (including neutrinos).
1261 </method>
1262
1263 <method name="bool ParticleDataEntry::isQuark()">
1264 true for a quark or an antiquark.
1265 </method>
1266
1267 <method name="bool ParticleDataEntry::isGluon()">
1268 true for a gluon.
1269 </method>
1270
1271 <method name="bool ParticleDataEntry::isDiquark()">
1272 true for a diquark or antidiquark.
1273 </method>
1274
1275 <method name="bool ParticleDataEntry::isParton()">
1276 true for a gluon, a quark or antiquark up to the b (but excluding top),
1277 and a diquark or antidiquark consisting of quarks up to the b.
1278 </method>
1279
1280 <method name="bool ParticleDataEntry::isHadron()">
1281 true for a hadron (made up out of normal quarks and gluons, 
1282 i.e. not for R-hadrons and other exotic states).
1283 </method>
1284
1285 <method name="bool ParticleDataEntry::isMeson()">
1286 true for a meson.
1287 </method>
1288
1289 <method name="bool ParticleDataEntry::isBaryon()">
1290 true for a baryon or antibaryon.
1291 </method>
1292
1293 <method name="bool ParticleDataEntry::isOctetHadron()">
1294 true for an intermediate hadron-like state with a colour octet charge
1295 as used in the colour octet model for 
1296 <aloc href="OniaProcesses">onia</aloc> production.
1297 </method>
1298
1299 <method name="int ParticleDataEntry::heaviestQuark(int id)">
1300 extracts the heaviest quark or antiquark, i.e. one with largest 
1301 <code>id</code> number, for a hadron. Only the sign of the input
1302 argument is relevant.
1303 </method>
1304
1305 <method name="int ParticleDataEntry::baryonNumberType(int id)">
1306 is 1 for a quark, 2 for a diquark, 3 for a baryon, the same with a 
1307 minus sign for antiparticles, and else zero. Only the sign of the 
1308 input argument is relevant.
1309 </method>
1310
1311 <method name="void ParticleDataEntry::clearChannels()">
1312 resets to an empty decay table.
1313 </method>
1314
1315 <method name="void ParticleDataEntry::addChannel(int onMode = 0, 
1316 double bRatio = 0., int meMode = 0, int prod0 = 0, int prod1 = 0,
1317 int prod2 = 0, int prod3 = 0, int prod4 = 0, int prod5 = 0, 
1318 int prod6 = 0,  int prod7 = 0,)"> 
1319 adds a decay channel with up to 8 products.
1320 </method>
1321
1322 <method name="int ParticleDataEntry::sizeChannels()">
1323 returns the number of decay channels for a particle.
1324 </method>
1325
1326 <method name="DecayChannel& ParticleDataEntry::channel(int i)">
1327 </method>
1328 <methodmore name="const DecayChannel& ParticleDataEntry::channel(int i)">
1329 gain access to a specified channel in the decay table.
1330 </methodmore>
1331
1332 <method name="void ParticleDataEntry::rescaleBR(double newSumBR = 1.)">
1333 rescales all partial branching ratios by a common factor, such that 
1334 the sum afterward becomes <code>newSumBR</code>.
1335 </method>
1336
1337 <method name="bool ParticleDataEntry::preparePick(int idSgn, 
1338 double mHat = 0., int idInFlav = 0)">
1339 prepare to pick a decay channel.
1340 </method>
1341
1342 <method name="DecayChannel& ParticleDataEntry::pickChannel()">
1343 pick a decay channel according to branching ratios from 
1344 <code>preparePick</code>.
1345 </method>
1346
1347 <method name="void ParticleDataEntry::setResonancePtr(ResonanceWidths* 
1348 resonancePtr)">
1349 </method>
1350 <methodmore name="ResonanceWidths* ParticleDataEntry::getResonancePtr()">
1351 set or get a pointer to an object that can be used for dynamic calculation
1352 of partial and total resonance widths. Here a resonance is a particle 
1353 such as top, <ei>Z^0</ei>, <ei>W^+-</ei>, Higgs, and new unstable states
1354 beyond the Standard Model.
1355 </methodmore>
1356
1357 <method name="void ParticleDataEntry::resInit(Info* infoPtrIn, 
1358 Settings* settingsPtrIn, ParticleData* particleDataPtrIn, 
1359 CoupSM* coupSMPtrIn)">
1360 initialize the treatment of a resonance.
1361 </method>
1362
1363 <method name="double ParticleDataEntry::resWidth(int idSgn,
1364 double mHat, int idInFlav = 0, bool openOnly = false, 
1365 bool setBR = false)">
1366 calculate the total with for a resonance of a given current mass,
1367 optionally including coupling to incoming flavour state (consider
1368 the <ei>gamma*/Z^0</ei> combination), optionally excluding decay 
1369 channels that have been closed by the user, and optionally storing 
1370 the results in the normal decay table. For the first argument only 
1371 the sign is relevant.
1372 </method>
1373
1374 <method name="double ParticleDataEntry::resWidthOpen(int idSgn,
1375 double mHat, int idInFlav = 0)">
1376 special case of <code>resWidth</code>, where only open channels are 
1377 included, but results are not stored in the normal decay table.
1378 </method>
1379
1380 <method name="double ParticleDataEntry::resWidthStore(int idSgn,
1381 double mHat, int idInFlav = 0)">
1382 special case of <code>resWidth</code>, where only open channels are 
1383 included, and results are stored in the normal decay table.
1384 </method>
1385
1386 <method name="double ParticleDataEntry::resOpenFrac(int idSgn)">
1387 calculate the fraction of the full branching ratio that is left
1388 open by the user choice of allowed decay channels.
1389 </method>
1390
1391 <method name="double ParticleDataEntry::resWidthRescaleFactor()">
1392 the factor used to rescale all partial widths in case the total
1393 width is being forced to a specific value by the user.
1394 </method>
1395
1396 <method name="double ParticleDataEntry::resWidthChan(double mHat, 
1397 int idAbs1 = 0, int idAbs2 = 0)">
1398 special case to calculate one final-state width; currently only used 
1399 for Higgs decay to <ei>q qbar</ei>, <ei>g g</ei> or 
1400 <ei>gamma gamma</ei>. 
1401 </method>
1402
1403 <h3>The DecayChannel methods</h3>
1404
1405 The properties stored in an individual decay channel can be set or get 
1406 by the methods in this section. 
1407
1408 <method name="DecayChannel::DecayChannel(int onMode = 0, 
1409 double bRatio = 0., int meMode = 0, int prod0 = 0, int prod1 = 0, 
1410 int prod2 = 0, int prod3 = 0, int prod4 = 0, int prod5 = 0, 
1411 int prod6 = 0, int prod7 = 0)">
1412 the constructor for a decay channel. Internal.
1413 </method>
1414
1415 <method name="void DecayChannel::onMode(int onMode)">
1416 </method>
1417 <methodmore name="int DecayChannel::onMode()">
1418 set or get the <code>onMode</code> of a decay channel,<br/>
1419 0 if a channel is off,<br/>
1420 1 if on,<br/>
1421 2 if on for a particle but off for an antiparticle,<br/>
1422 3 if on for an antiparticle but off for a particle.<br/>
1423 If a particle is its own antiparticle then 2 is on and 3 off 
1424 but, of course, for such particles it is much simpler and safer 
1425 to use only 1 and 0.<br/>
1426 The 2 and 3 options can be used e.g. to encode CP violation in 
1427 B decays, or to let the <ei>W</ei>'s in a <ei>q qbar -> W^+ W^-</ei> 
1428 process decay in different channels.
1429 </methodmore>
1430
1431 <method name="void DecayChannel::bRatio(double bRatio, 
1432 bool countAsChanged = true)">
1433 </method>
1434 <methodmore name="double DecayChannel::bRatio()">
1435 set or get the branching ratio of the channel. Second argument only 
1436 for internal use.
1437 </methodmore>
1438
1439 <method name="void DecayChannel::rescaleBR(double fac)">
1440 multiply the current branching ratio by <code>fac</code>.
1441 </method>
1442
1443 <method name="void DecayChannel::meMode(int meMode)">
1444 </method>
1445 <methodmore name="int DecayChannel::meMode()">
1446 set or get the mode of processing this channel, possibly with matrix 
1447 elements (see the <aloc href="ParticleDecays">particle decays</aloc> 
1448 description).
1449 </methodmore>
1450
1451 <method name="void DecayChannel::multiplicity(int multiplicity)"> 
1452 </method>
1453 <methodmore name="int DecayChannel::multiplicity()"> 
1454 set or get the number of decay products in a channel, at most 8.
1455 (Is normally not to be set by hand, since it is automatically 
1456 updated whenever the products list is changed.)
1457 </methodmore>
1458
1459 <method name="void DecayChannel::product(int i, int product)">
1460 </method>
1461 <methodmore name="int DecayChannel::product(int i)">
1462 set or get a list of the decay products, 8 products 0 &lt;= i &lt; 8,
1463 with trailing unused ones set to 0.
1464 </methodmore>
1465
1466 <method name="void DecayChannel::setHasChanged(bool hasChanged)">
1467 </method>
1468 <methodmore name="bool DecayChannel::hasChanged()">
1469 used for internal purposes, to know which decay modes have been changed.
1470 </methodmore>
1471
1472 <method name="bool DecayChannel::contains(int id1)">
1473 </method>
1474 <methodmore name="bool DecayChannel::contains(int id1, int id2)">
1475 </methodmore>
1476 <methodmore name="bool DecayChannel::contains(int id1, int id2, int id3)">
1477 find if the decay product list contains the one, two or three particle
1478 identities provided. If the same code is repeated then so must it be in 
1479 the products list. Matching also requires correct sign.
1480 </methodmore>
1481
1482 <method name="void DecayChannel::currentBR(double currentBR)">
1483 </method>
1484 <methodmore name="double DecayChannel::currentBR()">
1485 set or get the current branching ratio, taking into account on/off 
1486 switches and dynamic width for resonances. For internal use.
1487 </methodmore>
1488
1489 <method name="void DecayChannel::onShellWidth(double onShellWidth)">
1490 </method>
1491 <methodmore name="double DecayChannel::onShellWidth()">
1492 set or get the current partial width of the channel; intended for
1493 resonances where the widhts are recalculated based on the current
1494 resonance mass. For internal use.
1495 </methodmore>
1496
1497 <method name="void DecayChannel::onShellWidthFactor(double factor)">
1498 multiply the current partial width by <code>factor</code>.
1499 </method>
1500
1501 <method name="void DecayChannel::openSec(int idSgn, double openSecIn)">
1502 </method>
1503 <methodmore name="double DecayChannel::openSec(nt idSgn)">
1504 set or get the fraction of secondary open widths, separately for 
1505 positive and negative particles. For internal use.
1506 </methodmore>
1507
1508 </chapter>
1509
1510 <!-- Copyright (C) 2012 Torbjorn Sjostrand -->