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() : nRHad(0) {}
35 // Initialization of R-hadron handling.
36 bool init( Info* infoPtrIn, Settings& settings,
37 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn);
39 // Pointers to flavours and z sent from HadronLevel.
40 void fragPtrs( StringFlav* flavSelPtrIn, StringZ* zSelPtrIn)
41 { flavSelPtr = flavSelPtrIn; zSelPtr = zSelPtrIn;}
44 bool produce( ColConfig& colConfig, Event& event);
47 bool decay( Event& event);
49 // Tell whether a given particle is supposed to form R-hadrons.
50 bool givesRHadron(int id);
52 // Tell whether any R-hadrons have been formed.
53 bool exist() {return (nRHad > 0);}
55 // Tell whether a R-hadron production+decay happened, and trace down.
56 int trace(int i) { for (int iR = 0; iR < nRHad; ++iR)
57 if (iBefRHad[iR] == i || iCreRHad[iR] == i) return iAftRHad[iR];
62 // Constants: could only be changed in the code itself.
63 static const int IDRHADSB[14], IDRHADST[14], IDRHADGO[38], NTRYMAX;
64 static const double MSAFETY, EGBORROWMAX;
66 // Initialization data, mainly read from Settings.
67 bool allowRH, allowRSb, allowRSt, allowRGo, allowSomeR, setMassesRH;
68 int idRSb, idRSt, idRGo;
69 double maxWidthRH, probGluinoballRH, mOffsetCloudRH, mCollapseRH,
70 diquarkSpin1RH, m0Sb, m0St, m0Go;
72 // Current event properties.
73 vector<int> iBefRHad, iCreRHad, iRHadron, iAftRHad;
74 vector<bool> isTriplet;
75 int nRHad, iRHad, iBef, iSys;
76 ColSinglet* systemPtr;
78 // Pointer to various information on the generation.
81 // Pointer to the particle data table.
82 ParticleData* particleDataPtr;
84 // Pointer to the random number generator.
87 // Pointers to classes for flavour and z generation.
88 StringFlav* flavSelPtr;
91 // Split a system that contains both a sparticle and a junction.
92 bool splitOffJunction( ColConfig& colConfig, Event& event);
94 // Open up a closed gluon/gluino loop.
95 bool openClosedLoop( ColConfig& colConfig, Event& event);
97 // Split a single colour singlet that contains two sparticles.
98 bool splitSystem( ColConfig& colConfig, Event& event);
100 // Produce a R-hadron from a squark.
101 bool produceSquark( ColConfig& colConfig, Event& event);
103 // Produce a R-hadron from a gluino.
104 bool produceGluino( ColConfig& colConfig, Event& event);
106 // Construct R-hadron code from squark and (di)quark codes.
107 int toIdWithSquark( int id1, int id2);
109 // Construct squark and (di)quark codes from R-hadron code.
110 pair<int,int> fromIdWithSquark( int idRHad);
112 // Construct R-hadron code from endpoints and a gluino.
113 int toIdWithGluino( int id1, int id2);
115 // Construct endpoint codes from R-hadron code with a gluino.
116 pair<int,int> fromIdWithGluino( int idRHad);
118 // Construct modified four-vectors to match modified masses.
119 bool newKin( Vec4 pOld1, Vec4 pOld2, double mNew1, double mNew2,
120 Vec4& pNew1, Vec4& pNew2, bool checkMargin = true);
124 //==========================================================================
126 } // end namespace Pythia8
128 #endif // Pythia8_RHadrons_H