1 // RHadrons.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2013 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.
6 // This file contains a class for the production and decay
7 // of long-lived heavy coloured particles, for now the gluino.
9 #ifndef Pythia8_RHadrons_H
10 #define Pythia8_RHadrons_H
14 #include "FragmentationFlavZpT.h"
15 #include "FragmentationSystems.h"
17 #include "ParticleData.h"
18 #include "PythiaStdlib.h"
23 //==========================================================================
25 // The RHadrons class contains the routines for the production and decay
26 // of long-lived heavy coloured particles.
33 RHadrons() : allowRH(false), allowRSb(false), allowRSt(false), allowRGo(false), allowSomeR(false), setMassesRH(false),
34 idRSb(0), idRSt(0), idRGo(0),
35 maxWidthRH(0), probGluinoballRH(0), mOffsetCloudRH(0), mCollapseRH(0),
36 diquarkSpin1RH(0), m0Sb(0), m0St(0), m0Go(0),
37 nRHad(0), iRHad(0), iBef(0), iSys(0),
45 // Initialization of R-hadron handling.
46 bool init( Info* infoPtrIn, Settings& settings,
47 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn);
49 // Pointers to flavours and z sent from HadronLevel.
50 void fragPtrs( StringFlav* flavSelPtrIn, StringZ* zSelPtrIn)
51 { flavSelPtr = flavSelPtrIn; zSelPtr = zSelPtrIn;}
54 bool produce( ColConfig& colConfig, Event& event);
57 bool decay( Event& event);
59 // Tell whether a given particle is supposed to form R-hadrons.
60 bool givesRHadron(int id);
62 // Tell whether any R-hadrons have been formed.
63 bool exist() {return (nRHad > 0);}
65 // Tell whether a R-hadron production+decay happened, and trace down.
66 int trace(int i) { for (int iR = 0; iR < nRHad; ++iR)
67 if (iBefRHad[iR] == i || iCreRHad[iR] == i) return iAftRHad[iR];
72 // Constants: could only be changed in the code itself.
73 static const int IDRHADSB[14], IDRHADST[14], IDRHADGO[38], NTRYMAX;
74 static const double MSAFETY, EGBORROWMAX;
76 // Initialization data, mainly read from Settings.
77 bool allowRH, allowRSb, allowRSt, allowRGo, allowSomeR, setMassesRH;
78 int idRSb, idRSt, idRGo;
79 double maxWidthRH, probGluinoballRH, mOffsetCloudRH, mCollapseRH,
80 diquarkSpin1RH, m0Sb, m0St, m0Go;
82 // Current event properties.
83 vector<int> iBefRHad, iCreRHad, iRHadron, iAftRHad;
84 vector<bool> isTriplet;
85 int nRHad, iRHad, iBef, iSys;
86 ColSinglet* systemPtr;
88 // Pointer to various information on the generation.
91 // Pointer to the particle data table.
92 ParticleData* particleDataPtr;
94 // Pointer to the random number generator.
97 // Pointers to classes for flavour and z generation.
98 StringFlav* flavSelPtr;
101 // Split a system that contains both a sparticle and a junction.
102 bool splitOffJunction( ColConfig& colConfig, Event& event);
104 // Open up a closed gluon/gluino loop.
105 bool openClosedLoop( ColConfig& colConfig, Event& event);
107 // Split a single colour singlet that contains two sparticles.
108 bool splitSystem( ColConfig& colConfig, Event& event);
110 // Produce a R-hadron from a squark.
111 bool produceSquark( ColConfig& colConfig, Event& event);
113 // Produce a R-hadron from a gluino.
114 bool produceGluino( ColConfig& colConfig, Event& event);
116 // Construct R-hadron code from squark and (di)quark codes.
117 int toIdWithSquark( int id1, int id2);
119 // Construct squark and (di)quark codes from R-hadron code.
120 pair<int,int> fromIdWithSquark( int idRHad);
122 // Construct R-hadron code from endpoints and a gluino.
123 int toIdWithGluino( int id1, int id2);
125 // Construct endpoint codes from R-hadron code with a gluino.
126 pair<int,int> fromIdWithGluino( int idRHad);
128 // Construct modified four-vectors to match modified masses.
129 bool newKin( Vec4 pOld1, Vec4 pOld2, double mNew1, double mNew2,
130 Vec4& pNew1, Vec4& pNew2, bool checkMargin = true);
134 //==========================================================================
136 } // end namespace Pythia8
138 #endif // Pythia8_RHadrons_H