Between the creation of the Pythia
object and the
init
call for it, you may use the methods of the
ParticleDataTable
class to modify some of the default values.
Several different approaches can be chosen for this.
a) Inside your main program you can directly set values with
pythia.particleData.readString(string)
where both the variable name and the value are contained inside
the character string, separated by blanks and/or a =, e.g.
pythia.particleData.readString("111:mayDecay = off");
switches off the decays of the pi^0.
The particle id (> 0) and the property to be changed must be given,
separated by a colon.
The allowed properties are: name
, antiName
,
charge3
, colType
, m0
,
width
, range
, tau0
and
mayDecay
. All of these names
are case-insensitive. Names that do not match an existing variable
are ignored. A warning is printed, however, unless an optional
second argument false
is used. For bool
values, the following notation may be used interchangeably:
true = on = yes = ok = 1
, while everything else gives
false
(including but not limited to false
,
off
, no
and 0).
A further command is rescaleBR
, which rescales each of the
existing branching ratios with a common factor, such that their new
sum is the provided value. This may be a first step towards adding
new decay channels, see further below.
Particle data often comes in sets of closely related information.
Therefore some properties expect the value to consist of several
numbers. These can then be separated either by blanks and/or by
commas. A simple example is names
, which expects both the
name and antiname to be given. A more interesting one is the
all
property,
id:all = name antiName charge3 colType m0 width range tau0 mayDecay
where all the current information on the particle itself is replaced,
but any decay channels are kept unchanged. Using new
instead
of all
also removes any previous decay channels.
Alternatively the id
code may be followed by another integer,
which then gives the decay channel number. This then has to be
followed by the property specific to this channel, either
branchingRatio
, modeME
or products
.
In the latter case all the products of the channel should be given:
id:channel:products = product1 product2 ....
The line will be scanned until the end of the line, or until a
non-number word is encountered, or until the maximum allowed number
of eight products is encountered, whichever happens first. It is also
possible to replace all the properties of a channel in a similar way:
id:channel:all = branchingRatio modeME product1 product2 ....
To add a new channel at the end, use
id:addChannel = branchingRatio modeME product1 product2 ....
It is currently not possible to remove a channel selectively, but
setting its branching ratio vanishing is as effective.
When adding new channels or changing branching ratios is general,
note that, once a particle is to be decayed, the sum of branching
ratios is always rescaled to unity. Beforehand, rescaleBR
may
be used to rescale an existing branching ratio by the given factor.
The Pythia
class contains a readString
method
that hand on to this method, or to corresponding methods in
Settings
or Pythia6, and therefore may offer the most
convenient form, i.e. more compactly:
pythia.readString("111:mayDecay = off");
pythia.readString("15:2:products = 16 -211");
b) Underlying this are commands for all the individual properties in
the ParticleDataTable
class, one for each. Thus, an example
now reads
pythia.particleData.mayDecay(111, false);
Boolean values should here be given as true
or
false
.
c) A simpler and more useful way is to collect all your changes
in a separate file, with one line per change, e.g.
111:mayDecay = off
Each line is process as described for the string in 3a). Since names
that do not match an existing variable are ignored, you can easily
comment out lines. The recommended way would be to add a special
character like # or ! in the first column.
The file can be read by the
pythia.particleData.readFile("filename")
method, alternatively by the
pythia.readFile("filename")
method. The latter has the advantage that it allows you to freely mix
commands to the Settings
, ParticleData
and
Pythia6
classes, and so is preferable.