]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8145/include/ParticleDecays.h
Use Output directive instead of the old OutputFile and OUtputArchive. Save fileinfo...
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8145 / include / ParticleDecays.h
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     Couplings* couplingsPtrIn, TimeShower* timesDecPtrIn, 
59     StringFlav* flavSelPtrIn, DecayHandler* decayHandlePtrIn, 
60     vector<int> handledParticles); 
61  
62   // Perform a decay of a single particle.
63   bool decay(int iDec, Event& event); 
64
65   // Did decay result in new partons to hadronize?
66   bool moreToDo() const {return hasPartons && keepPartons;}
67
68 private: 
69
70   // Constants: could only be changed in the code itself.
71   static const int    NTRYDECAY, NTRYPICK, NTRYMEWT, NTRYDALITZ;
72   static const double MSAFEDALITZ, WTCORRECTION[11];
73
74   // Pointer to various information on the generation.
75   Info*         infoPtr;
76
77   // Pointer to the particle data table.
78   ParticleData* particleDataPtr;
79
80   // Pointer to the random number generator.
81   Rndm*         rndmPtr;
82
83   // Pointers to Standard Model couplings.
84   Couplings*    couplingsPtr;
85
86   // Pointers to timelike showers, for decays to partons (e.g. Upsilon).
87   TimeShower*   timesDecPtr;
88
89   // Pointer to class for flavour generation; needed when to pick hadrons.
90   StringFlav*   flavSelPtr;
91
92   // Pointer to a handler of external decays.
93   DecayHandler* decayHandlePtr;
94
95   // Initialization data, read from Settings.
96   bool   limitTau0, limitTau, limitRadius, limitCylinder, limitDecay, 
97          mixB, doFSRinDecays;
98   double mSafety, tau0Max, tauMax, rMax, xyMax, zMax, xBdMix, xBsMix, 
99          sigmaSoft, multIncrease, multRefMass, multGoffset, colRearrange, 
100          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   // Check whether a decay is allowed, given the upcoming decay vertex.
115   bool checkVertex(Particle& decayer);
116
117   // Check for oscillations B0 <-> B0bar or B_s0 <-> B_s0bar.
118   bool oscillateB(Particle& decayer);
119
120   // Do a one-body decay.
121   bool oneBody(Event& event);
122
123   // Do a two-body decay;
124   bool twoBody(Event& event);
125
126   // Do a three-body decay;
127   bool threeBody(Event& event);
128
129   // Do a multibody decay using the M-generator algorithm.
130   bool mGenerator(Event& event); 
131
132   // Select mass of lepton pair in a Dalitz decay.
133   bool dalitzMass();
134
135   // Do kinematics of gamma* -> l- l+ in Dalitz decay.
136   bool dalitzKinematics(Event& event);
137
138   // Translate a partonic content into a set of actual hadrons.
139   bool pickHadrons();
140
141   // Set colour flow and scale in a decay explicitly to partons.
142   bool setColours(Event& event);
143   
144 };
145  
146 //==========================================================================
147
148 } // end namespace Pythia8
149
150 #endif // Pythia8_ParticleDecays_H