source: HiSusy/trunk/Pythia8/pythia8170/htmldoc/ParticleDataScheme.html @ 1

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

first import of structure, PYTHIA8 and DELPHES

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