1 <chapter name="External Decays">
3 <h2>External Decays</h2>
5 <code>DecayHandler</code> is a base class for the external handling of
6 decays. It is intended for normal particle decays, primarily
7 <ei>B</ei> mesons and <ei>tau</ei>, and cannot be used to redirect
8 decays of heavy resonances like <ei>t</ei> or <ei>Z^0</ei>.
9 The user-written derived class is called if a pointer to it has
11 <code><aloc href="ProgramFlow">pythia.decayPtr()</aloc></code>
12 method, where it also is specified which particles it will be called for.
13 This particle information is accessible with the
14 <code><aloc href="ParticleDataScheme">doExternalDecay()</aloc></code>
18 There is only one pure virtual method in <code>DecayHandler</code>,
20 <method name="virtual bool DecayHandler::decay(vector<int>& idProd, v
21 ector<double>& mProd, vector<Vec4>& pProd, int iDec,
22 const Event& event)">
24 <argument name="idProd"> is a list of particle PDG identity codes,
26 <argument name="mProd"> is a list of their respective masses (in GeV), and
28 <argument name="pProd"> is a list of their respective four-momenta.
33 At input, these vectors each have size one, so that <code>idProd[0]</code>,
34 <code>mProd[0]</code> and <code>pProd[0]</code> contain information on the
35 particle that is to be decayed. At output, the vectors should have
36 increased by the addition of all the decay products. Even if initially
37 defined in the rest frame of the mother, the products should have been
38 boosted so that their four-momenta add up to the <code>pProd[0]</code> of
39 the decaying particle.
42 Should it be of interest to know the prehistory of the decaying
43 particle, e.g. to set some helicity information affecting the
44 decay angular distribution, the full event record is available
45 read-only, with info in which slot <code>iDec</code> the decaying particle
49 The routine should return <code>true</code> if it managed the decay and
50 <code>false</code> otherwise, in which case <code>Pythia</code> will try
51 to do the decay itself. This e.g. means you can choose to do some decay
52 channels yourself, and leave others to <code>Pythia</code>. To avoid
53 doublecounting, the channels you want to handle should be switched off
54 in the <code>Pythia</code> particle database. In the beginning of the
55 external <code>decay</code> method you should then return
56 <code>false</code> with a probability given by the sum of the branching
57 ratios for those channels you do not want to handle yourself.
60 Note that the decay vertex is always set by <code>Pythia</code>, and that
61 <ei>B-Bbar</ei> oscillations have already been taken into account,
62 if they were switched on. Thus <code>idProd[0]</code> may be the opposite
63 of <code>event[iDec].id()</code>, where the latter provides the code at
67 A sample test program is available in <code>main23.cc</code>, providing
68 a simple example of how to use this facility.
72 <!-- Copyright (C) 2010 Torbjorn Sjostrand -->