PYTHIA  8.313
RHadrons.h
1 // RHadrons.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2025 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/FragmentationModel.h"
13 
14 namespace Pythia8 {
15 
16 //==========================================================================
17 
18 // The RHadrons class contains the routines for the production and decay
19 // of long-lived heavy coloured particles.
20 
21 class RHadrons : public FragmentationModel {
22 
23 public:
24 
25  // Constructor.
26  RHadrons() : FragmentationModel(), allowRH(), allowRSb(), allowRSt(),
27  allowRGo(), allowSomeR(), setMassesRH(), idRSb(), idRSt(), idRGo(),
28  maxWidthRH(), probGluinoballRH(), mOffsetCloudRH(), mCollapseRH(),
29  diquarkSpin1RH(), m0Sb(), m0St(), m0Go(), nRHad(0), iRHad(), iBef(),
30  iSys(), systemPtr() {}
31 
32  // Initialize and save pointers.
33  bool init(StringFlav* flavSelPtrIn = nullptr, StringPT* pTSelPtrIn = nullptr,
34  StringZ* zSelPtrIn = nullptr, FragModPtr fragModPtrIn = nullptr) override;
35 
36  // Fragment the event.
37  bool fragment(int iSub, ColConfig& colConfig, Event& event,
38  bool isDiff = false, bool systemRecoil = true) override;
39 
40  // Decay R-hadrons.
41  bool decay( Event& event);
42 
43  // Tell whether a given particle is supposed to form R-hadrons.
44  bool givesRHadron(int id);
45 
46  // Tell whether any R-hadrons have been formed.
47  bool exist() {return (nRHad > 0);}
48 
49  // Tell whether a R-hadron production+decay happened, and trace down.
50  int trace(int i) {
51  for (int iR = 0; iR < nRHad; ++iR)
52  if (iBefRHad[iR] == i || iCreRHad[iR] == i) return iAftRHad[iR];
53  return 0;}
54 
55 private:
56 
57  // Constants: could only be changed in the code itself.
58  static const int IDRHADSB[14], IDRHADST[14], IDRHADGO[38], NTRYMAX;
59  static const double MSAFETY, EGBORROWMAX;
60 
61  // Initialization data, mainly read from Settings.
62  bool allowRH, allowRSb, allowRSt, allowRGo, allowSomeR, setMassesRH;
63  int idRSb, idRSt, idRGo;
64  double maxWidthRH, probGluinoballRH, mOffsetCloudRH, mCollapseRH,
65  diquarkSpin1RH, m0Sb, m0St, m0Go;
66 
67  // Current event properties.
68  vector<int> iBefRHad, iCreRHad, iRHadron, iAftRHad;
69  vector<bool> isTriplet;
70  int nRHad, iRHad, iBef, iSys;
71  ColSinglet* systemPtr;
72 
73  // Split a system that contains both a sparticle and a junction.
74  bool splitOffJunction( ColConfig& colConfig, Event& event);
75 
76  // Open up a closed gluon/gluino loop.
77  bool openClosedLoop( ColConfig& colConfig, Event& event);
78 
79  // Split a single colour singlet that contains two sparticles.
80  bool splitSystem( ColConfig& colConfig, Event& event);
81 
82  // Produce a R-hadron from a squark.
83  bool produceSquark( ColConfig& colConfig, Event& event);
84 
85  // Produce a R-hadron from a gluino.
86  bool produceGluino( ColConfig& colConfig, Event& event);
87 
88  // Construct R-hadron code from squark and (di)quark codes.
89  int toIdWithSquark( int id1, int id2);
90 
91  // Construct squark and (di)quark codes from R-hadron code.
92  pair<int,int> fromIdWithSquark( int idRHad);
93 
94  // Construct R-hadron code from endpoints and a gluino.
95  int toIdWithGluino( int id1, int id2);
96 
97  // Construct endpoint codes from R-hadron code with a gluino.
98  pair<int,int> fromIdWithGluino( int idRHad);
99 
100  // Construct modified four-vectors to match modified masses.
101  bool newKin( Vec4 pOld1, Vec4 pOld2, double mNew1, double mNew2,
102  Vec4& pNew1, Vec4& pNew2, bool checkMargin = true);
103 
104 };
105 
106 //==========================================================================
107 
108 } // end namespace Pythia8
109 
110 #endif // Pythia8_RHadrons_H
bool init(StringFlav *flavSelPtrIn=nullptr, StringPT *pTSelPtrIn=nullptr, StringZ *zSelPtrIn=nullptr, FragModPtr fragModPtrIn=nullptr) override
Initialize and save pointers.
Definition: RHadrons.cc:50
The Event class holds all info on the generated event.
Definition: Event.h:408
The StringPT class is used to select select transverse momenta.
Definition: FragmentationFlavZpT.h:326
bool exist()
Tell whether any R-hadrons have been formed.
Definition: RHadrons.h:47
Definition: RHadrons.h:21
The StringZ class is used to sample the fragmentation function f(z).
Definition: FragmentationFlavZpT.h:265
bool decay(Event &event)
Decay R-hadrons.
Definition: RHadrons.cc:298
bool fragment(int iSub, ColConfig &colConfig, Event &event, bool isDiff=false, bool systemRecoil=true) override
Fragment the event.
Definition: RHadrons.cc:173
bool givesRHadron(int id)
Tell whether a given particle is supposed to form R-hadrons.
Definition: RHadrons.cc:161
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:50
FragmentationModel is the base class for handling fragmentation algorithms.
Definition: FragmentationModel.h:28
RHadrons()
Constructor.
Definition: RHadrons.h:26
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