StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RHadrons.h
1 // RHadrons.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2020 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // This file contains a class for the production and decay
7 // of long-lived heavy coloured particles, for now the gluino.
8 
9 #ifndef Pythia8_RHadrons_H
10 #define Pythia8_RHadrons_H
11 
12 #include "Pythia8/Basics.h"
13 #include "Pythia8/Event.h"
14 #include "Pythia8/FragmentationFlavZpT.h"
15 #include "Pythia8/FragmentationSystems.h"
16 #include "Pythia8/Info.h"
17 #include "Pythia8/ParticleData.h"
18 #include "Pythia8/PythiaStdlib.h"
19 #include "Pythia8/PhysicsBase.h"
20 #include "Pythia8/Settings.h"
21 
22 namespace Pythia8 {
23 
24 //==========================================================================
25 
26 // The RHadrons class contains the routines for the production and decay
27 // of long-lived heavy coloured particles.
28 
29 class RHadrons : public PhysicsBase {
30 
31 public:
32 
33  // Constructor.
34  RHadrons() : allowRH(), allowRSb(), allowRSt(), allowRGo(), allowSomeR(),
35  setMassesRH(), idRSb(), idRSt(), idRGo(), maxWidthRH(), probGluinoballRH(),
36  mOffsetCloudRH(), mCollapseRH(), diquarkSpin1RH(), m0Sb(), m0St(), m0Go(),
37  nRHad(0), iRHad(), iBef(), iSys(), systemPtr(), flavSelPtr(), zSelPtr() {}
38 
39  // Initialization of R-hadron handling.
40  bool init();
41 
42  // Pointers to flavours and z sent from HadronLevel.
43  void fragPtrs( StringFlav* flavSelPtrIn, StringZ* zSelPtrIn)
44  { flavSelPtr = flavSelPtrIn; zSelPtr = zSelPtrIn;}
45 
46  // Produce R-hadrons.
47  bool produce( ColConfig& colConfig, Event& event);
48 
49  // Decay R-hadrons.
50  bool decay( Event& event);
51 
52  // Tell whether a given particle is supposed to form R-hadrons.
53  bool givesRHadron(int id);
54 
55  // Tell whether any R-hadrons have been formed.
56  bool exist() {return (nRHad > 0);}
57 
58  // Tell whether a R-hadron production+decay happened, and trace down.
59  int trace(int i) {
60  for (int iR = 0; iR < nRHad; ++iR)
61  if (iBefRHad[iR] == i || iCreRHad[iR] == i) return iAftRHad[iR];
62  return 0;}
63 
64 private:
65 
66  // Constants: could only be changed in the code itself.
67  static const int IDRHADSB[14], IDRHADST[14], IDRHADGO[38], NTRYMAX;
68  static const double MSAFETY, EGBORROWMAX;
69 
70  // Initialization data, mainly read from Settings.
71  bool allowRH, allowRSb, allowRSt, allowRGo, allowSomeR, setMassesRH;
72  int idRSb, idRSt, idRGo;
73  double maxWidthRH, probGluinoballRH, mOffsetCloudRH, mCollapseRH,
74  diquarkSpin1RH, m0Sb, m0St, m0Go;
75 
76  // Current event properties.
77  vector<int> iBefRHad, iCreRHad, iRHadron, iAftRHad;
78  vector<bool> isTriplet;
79  int nRHad, iRHad, iBef, iSys;
80  ColSinglet* systemPtr;
81 
82  // Pointers to classes for flavour and z generation.
83  StringFlav* flavSelPtr;
84  StringZ* zSelPtr;
85 
86  // Split a system that contains both a sparticle and a junction.
87  bool splitOffJunction( ColConfig& colConfig, Event& event);
88 
89  // Open up a closed gluon/gluino loop.
90  bool openClosedLoop( ColConfig& colConfig, Event& event);
91 
92  // Split a single colour singlet that contains two sparticles.
93  bool splitSystem( ColConfig& colConfig, Event& event);
94 
95  // Produce a R-hadron from a squark.
96  bool produceSquark( ColConfig& colConfig, Event& event);
97 
98  // Produce a R-hadron from a gluino.
99  bool produceGluino( ColConfig& colConfig, Event& event);
100 
101  // Construct R-hadron code from squark and (di)quark codes.
102  int toIdWithSquark( int id1, int id2);
103 
104  // Construct squark and (di)quark codes from R-hadron code.
105  pair<int,int> fromIdWithSquark( int idRHad);
106 
107  // Construct R-hadron code from endpoints and a gluino.
108  int toIdWithGluino( int id1, int id2);
109 
110  // Construct endpoint codes from R-hadron code with a gluino.
111  pair<int,int> fromIdWithGluino( int idRHad);
112 
113  // Construct modified four-vectors to match modified masses.
114  bool newKin( Vec4 pOld1, Vec4 pOld2, double mNew1, double mNew2,
115  Vec4& pNew1, Vec4& pNew2, bool checkMargin = true);
116 
117 };
118 
119 //==========================================================================
120 
121 } // end namespace Pythia8
122 
123 #endif // Pythia8_RHadrons_H
Definition: AgUStep.h:26