]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8130/include/ParticleDecays.h
0530094f0bb3ba31af5579d91c1abe545c0f706d
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8130 / include / ParticleDecays.h
1 // ParticleDecays.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2008 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, TimeShower* timesDecPtrIn, 
57     StringFlav* flavSelPtrIn, DecayHandler* decayHandlePtrIn, 
58     vector<int> handledParticles); 
59  
60   // Perform a decay of a single particle.
61   bool decay(int iDec, Event& event); 
62
63   // Did decay result in new partons to hadronize?
64   bool moreToDo() const {return hasPartons && keepPartons;}
65
66 private: 
67
68   // Constants: could only be changed in the code itself.
69   static const int    NTRYDECAY, NTRYPICK;
70   static const double MSAFEDALITZ, WTCORRECTION[11];
71
72   // Pointer to various information on the generation.
73   Info* infoPtr;
74
75   // Pointers to timelike showers, for decays to partons (e.g. Upsilon).
76   TimeShower* timesDecPtr;
77
78   // Pointer to class for flavour generation; needed when to pick hadrons.
79   StringFlav* flavSelPtr;
80
81   // Pointer to a handler of external decays.
82   DecayHandler* decayHandlePtr;
83
84   // Initialization data, read from Settings..
85   bool   limitTau0, limitTau, limitRadius, limitCylinder, limitDecay, 
86          mixB, doFSRinDecays;
87   double mSafety, tau0Max, tauMax, rMax, xyMax, zMax, xBdMix, xBsMix, 
88          sigmaSoft, multIncrease, multRefMass, multGoffset, colRearrange, 
89          stopMass, sRhoDal, wRhoDal;
90
91   // Multiplicity. Decay products positions and masses.
92   bool   hasPartons, keepPartons;    
93   int    idDec, meMode, mult;
94   vector<int>    iProd, idProd, cols, acols, idPartons;
95   vector<double> mProd, mInv, rndmOrd;
96   vector<Vec4>   pInv, pProd;
97   vector<FlavContainer> flavEnds;
98
99   // Pointer to particle data for currently decaying particle
100   ParticleDataEntry* decDataPtr;
101
102   // Check whether a decay is allowed, given the upcoming decay vertex.
103   bool checkVertex(Particle& decayer);
104
105   // Check for oscillations B0 <-> B0bar or B_s0 <-> B_s0bar.
106   bool oscillateB(Particle& decayer);
107
108   // Do a one-body decay.
109   bool oneBody(Event& event);
110
111   // Do a two-body decay;
112   bool twoBody(Event& event);
113
114   // Do a three-body decay;
115   bool threeBody(Event& event);
116
117   // Do a multibody decay using the M-generator algorithm.
118   bool mGenerator(Event& event); 
119
120   // Select mass of lepton pair in a Dalitz decay.
121   bool dalitzMass();
122
123   // Do kinematics of gamma* -> l- l+ in Dalitz decay.
124   bool dalitzKinematics(Event& event);
125
126   // Translate a partonic content into a set of actual hadrons.
127   bool pickHadrons();
128
129   // Set colour flow and scale in a decay explicitly to partons.
130   bool setColours(Event& event);
131   
132 };
133  
134 //**************************************************************************
135
136 } // end namespace Pythia8
137
138 #endif // Pythia8_ParticleDecays_H