StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ParticleDecays.h
1 // ParticleDecays.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2014 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // This file contains the classes to perform a particle decay.
7 // DecayHandler: base class for external handling of decays.
8 // ParticleDecays: decay a particle.
9 
10 #ifndef Pythia8_ParticleDecays_H
11 #define Pythia8_ParticleDecays_H
12 
13 #include "Pythia8/Basics.h"
14 #include "Pythia8/Event.h"
15 #include "Pythia8/FragmentationFlavZpT.h"
16 #include "Pythia8/Info.h"
17 #include "Pythia8/ParticleData.h"
18 #include "Pythia8/PythiaStdlib.h"
19 #include "Pythia8/Settings.h"
20 #include "Pythia8/TimeShower.h"
21 #include "Pythia8/TauDecays.h"
22 
23 namespace Pythia8 {
24 
25 //==========================================================================
26 
27 // DecayHandler is base class for the external handling of decays.
28 // There is only one pure virtual method, that should do the decay.
29 
30 class DecayHandler {
31 
32 public:
33 
34  // Destructor.
35  virtual ~DecayHandler() {}
36 
37  // A pure virtual method, wherein the derived class method does a decay.
38  virtual bool decay(vector<int>& idProd, vector<double>& mProd,
39  vector<Vec4>& pProd, int iDec, const Event& event) = 0;
40 
41 };
42 
43 //==========================================================================
44 
45 // The ParticleDecays class contains the routines to decay a particle.
46 
47 class ParticleDecays {
48 
49 public:
50 
51  // Constructor.
52  ParticleDecays() {}
53 
54  // Initialize: store pointers and find settings
55  void init(Info* infoPtrIn, Settings& settings,
56  ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
57  Couplings* couplingsPtrIn, TimeShower* timesDecPtrIn,
58  StringFlav* flavSelPtrIn, DecayHandler* decayHandlePtrIn,
59  vector<int> handledParticles);
60 
61  // Perform a decay of a single particle.
62  bool decay(int iDec, Event& event);
63 
64  // Did decay result in new partons to hadronize?
65  bool moreToDo() const {return hasPartons && keepPartons;}
66 
67 private:
68 
69  // Constants: could only be changed in the code itself.
70  static const int NTRYDECAY, NTRYPICK, NTRYMEWT, NTRYDALITZ;
71  static const double MSAFEDALITZ, WTCORRECTION[11];
72 
73  // Pointer to various information on the generation.
74  Info* infoPtr;
75 
76  // Pointer to the particle data table.
77  ParticleData* particleDataPtr;
78 
79  // Pointer to the random number generator.
80  Rndm* rndmPtr;
81 
82  // Pointers to Standard Model couplings.
83  Couplings* couplingsPtr;
84 
85  // Pointers to timelike showers, for decays to partons (e.g. Upsilon).
86  TimeShower* timesDecPtr;
87 
88  // Pointer to class for flavour generation; needed when to pick hadrons.
89  StringFlav* flavSelPtr;
90 
91  // Pointer to a handler of external decays.
92  DecayHandler* decayHandlePtr;
93 
94  // Initialization data, read from Settings.
95  bool limitTau0, limitTau, limitRadius, limitCylinder, limitDecay,
96  mixB, doFSRinDecays, doGammaRad;
97  int sophisticatedTau;
98  double mSafety, tau0Max, tauMax, rMax, xyMax, zMax, xBdMix, xBsMix,
99  sigmaSoft, multIncrease, multIncreaseWeak, multRefMass, multGoffset,
100  colRearrange, stopMass, sRhoDal, wRhoDal;
101 
102  // Multiplicity. Decay products positions and masses.
103  bool hasPartons, keepPartons;
104  int idDec, meMode, mult;
105  double scale;
106  vector<int> iProd, idProd, cols, acols, idPartons;
107  vector<double> mProd, mInv, rndmOrd;
108  vector<Vec4> pInv, pProd;
109  vector<FlavContainer> flavEnds;
110 
111  // Pointer to particle data for currently decaying particle
112  ParticleDataEntry* decDataPtr;
113 
114  // Tau particle decayer.
115  TauDecays tauDecayer;
116 
117  // Check whether a decay is allowed, given the upcoming decay vertex.
118  bool checkVertex(Particle& decayer);
119 
120  // Check for oscillations B0 <-> B0bar or B_s0 <-> B_s0bar.
121  bool oscillateB(Particle& decayer);
122 
123  // Do a one-body decay.
124  bool oneBody(Event& event);
125 
126  // Do a two-body decay;
127  bool twoBody(Event& event);
128 
129  // Do a three-body decay;
130  bool threeBody(Event& event);
131 
132  // Do a multibody decay using the M-generator algorithm.
133  bool mGenerator(Event& event);
134 
135  // Select mass of lepton pair in a Dalitz decay.
136  bool dalitzMass();
137 
138  // Do kinematics of gamma* -> l- l+ in Dalitz decay.
139  bool dalitzKinematics(Event& event);
140 
141  // Translate a partonic content into a set of actual hadrons.
142  bool pickHadrons();
143 
144  // Set colour flow and scale in a decay explicitly to partons.
145  bool setColours(Event& event);
146 
147 };
148 
149 //==========================================================================
150 
151 } // end namespace Pythia8
152 
153 #endif // Pythia8_ParticleDecays_H
Definition: AgUStep.h:26