PYTHIA  8.312
RHadrons.h
1 // RHadrons.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 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: PhysicsBase.h:27
The Event class holds all info on the generated event.
Definition: Event.h:453
bool produce(ColConfig &colConfig, Event &event)
Produce R-hadrons.
Definition: RHadrons.cc:165
bool exist()
Tell whether any R-hadrons have been formed.
Definition: RHadrons.h:56
Definition: RHadrons.h:29
The StringZ class is used to sample the fragmentation function f(z).
Definition: FragmentationFlavZpT.h:264
bool decay(Event &event)
Decay R-hadrons.
Definition: RHadrons.cc:286
bool givesRHadron(int id)
Tell whether a given particle is supposed to form R-hadrons.
Definition: RHadrons.cc:153
void fragPtrs(StringFlav *flavSelPtrIn, StringZ *zSelPtrIn)
Pointers to flavours and z sent from HadronLevel.
Definition: RHadrons.h:43
The ColConfig class describes the colour configuration of the whole event.
Definition: FragmentationSystems.h:60
int trace(int i)
Tell whether a R-hadron production+decay happened, and trace down.
Definition: RHadrons.h:59
bool init()
Initialization of R-hadron handling.
Definition: RHadrons.cc:50
RHadrons()
Constructor.
Definition: RHadrons.h:34
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The StringFlav class is used to select quark and hadron flavours.
Definition: FragmentationFlavZpT.h:84
Definition: FragmentationSystems.h:31
Definition: Basics.h:32