]>
Commit | Line | Data |
---|---|---|
b584e2f5 | 1 | // ParticleDecays.h is a part of the PYTHIA event generator. |
2 | // Copyright (C) 2010 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 "Basics.h" | |
14 | #include "Event.h" | |
15 | #include "FragmentationFlavZpT.h" | |
16 | #include "Info.h" | |
17 | #include "ParticleData.h" | |
18 | #include "PythiaStdlib.h" | |
19 | #include "Settings.h" | |
20 | #include "TimeShower.h" | |
21 | ||
22 | namespace Pythia8 { | |
23 | ||
24 | //========================================================================== | |
25 | ||
26 | // DecayHandler is base class for the external handling of decays. | |
27 | // There is only one pure virtual method, that should do the decay. | |
28 | ||
29 | class DecayHandler { | |
30 | ||
31 | public: | |
32 | ||
33 | // A pure virtual method, wherein the derived class method does a decay. | |
34 | virtual bool decay(vector<int>& idProd, vector<double>& mProd, | |
35 | vector<Vec4>& pProd, int iDec, const Event& event) = 0; | |
36 | ||
37 | protected: | |
38 | ||
39 | // Destructor. | |
40 | virtual ~DecayHandler() {} | |
41 | ||
42 | }; | |
43 | ||
44 | //========================================================================== | |
45 | ||
46 | // The ParticleDecays class contains the routines to decay a particle. | |
47 | ||
48 | class ParticleDecays { | |
49 | ||
50 | public: | |
51 | ||
52 | // Constructor. | |
53 | ParticleDecays() {} | |
54 | ||
55 | // Initialize: store pointers and find settings | |
56 | void init(Info* infoPtrIn, Settings& settings, | |
57 | ParticleData* particleDataPtrIn, Rndm* rndmPtrIn, | |
58 | TimeShower* timesDecPtrIn, StringFlav* flavSelPtrIn, | |
59 | DecayHandler* decayHandlePtrIn, 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 timelike showers, for decays to partons (e.g. Upsilon). | |
83 | TimeShower* timesDecPtr; | |
84 | ||
85 | // Pointer to class for flavour generation; needed when to pick hadrons. | |
86 | StringFlav* flavSelPtr; | |
87 | ||
88 | // Pointer to a handler of external decays. | |
89 | DecayHandler* decayHandlePtr; | |
90 | ||
91 | // Initialization data, read from Settings. | |
92 | bool limitTau0, limitTau, limitRadius, limitCylinder, limitDecay, | |
93 | mixB, doFSRinDecays; | |
94 | double mSafety, tau0Max, tauMax, rMax, xyMax, zMax, xBdMix, xBsMix, | |
95 | sigmaSoft, multIncrease, multRefMass, multGoffset, colRearrange, | |
96 | stopMass, sRhoDal, wRhoDal; | |
97 | ||
98 | // Multiplicity. Decay products positions and masses. | |
99 | bool hasPartons, keepPartons; | |
100 | int idDec, meMode, mult; | |
101 | double scale; | |
102 | vector<int> iProd, idProd, cols, acols, idPartons; | |
103 | vector<double> mProd, mInv, rndmOrd; | |
104 | vector<Vec4> pInv, pProd; | |
105 | vector<FlavContainer> flavEnds; | |
106 | ||
107 | // Pointer to particle data for currently decaying particle | |
108 | ParticleDataEntry* decDataPtr; | |
109 | ||
110 | // Check whether a decay is allowed, given the upcoming decay vertex. | |
111 | bool checkVertex(Particle& decayer); | |
112 | ||
113 | // Check for oscillations B0 <-> B0bar or B_s0 <-> B_s0bar. | |
114 | bool oscillateB(Particle& decayer); | |
115 | ||
116 | // Do a one-body decay. | |
117 | bool oneBody(Event& event); | |
118 | ||
119 | // Do a two-body decay; | |
120 | bool twoBody(Event& event); | |
121 | ||
122 | // Do a three-body decay; | |
123 | bool threeBody(Event& event); | |
124 | ||
125 | // Do a multibody decay using the M-generator algorithm. | |
126 | bool mGenerator(Event& event); | |
127 | ||
128 | // Select mass of lepton pair in a Dalitz decay. | |
129 | bool dalitzMass(); | |
130 | ||
131 | // Do kinematics of gamma* -> l- l+ in Dalitz decay. | |
132 | bool dalitzKinematics(Event& event); | |
133 | ||
134 | // Translate a partonic content into a set of actual hadrons. | |
135 | bool pickHadrons(); | |
136 | ||
137 | // Set colour flow and scale in a decay explicitly to partons. | |
138 | bool setColours(Event& event); | |
139 | ||
140 | }; | |
141 | ||
142 | //========================================================================== | |
143 | ||
144 | } // end namespace Pythia8 | |
145 | ||
146 | #endif // Pythia8_ParticleDecays_H |