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) 2018 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/Settings.h"
20 
21 namespace Pythia8 {
22 
23 //==========================================================================
24 
25 // The RHadrons class contains the routines for the production and decay
26 // of long-lived heavy coloured particles.
27 
28 class RHadrons {
29 
30 public:
31 
32  // Constructor.
33  RHadrons() : nRHad(0) {}
34 
35  // Initialization of R-hadron handling.
36  bool init( Info* infoPtrIn, Settings& settings,
37  ParticleData* particleDataPtrIn, Rndm* rndmPtrIn);
38 
39  // Pointers to flavours and z sent from HadronLevel.
40  void fragPtrs( StringFlav* flavSelPtrIn, StringZ* zSelPtrIn)
41  { flavSelPtr = flavSelPtrIn; zSelPtr = zSelPtrIn;}
42 
43  // Produce R-hadrons.
44  bool produce( ColConfig& colConfig, Event& event);
45 
46  // Decay R-hadrons.
47  bool decay( Event& event);
48 
49  // Tell whether a given particle is supposed to form R-hadrons.
50  bool givesRHadron(int id);
51 
52  // Tell whether any R-hadrons have been formed.
53  bool exist() {return (nRHad > 0);}
54 
55  // Tell whether a R-hadron production+decay happened, and trace down.
56  int trace(int i) {
57  for (int iR = 0; iR < nRHad; ++iR)
58  if (iBefRHad[iR] == i || iCreRHad[iR] == i) return iAftRHad[iR];
59  return 0;}
60 
61 private:
62 
63  // Constants: could only be changed in the code itself.
64  static const int IDRHADSB[14], IDRHADST[14], IDRHADGO[38], NTRYMAX;
65  static const double MSAFETY, EGBORROWMAX;
66 
67  // Initialization data, mainly read from Settings.
68  bool allowRH, allowRSb, allowRSt, allowRGo, allowSomeR, setMassesRH;
69  int idRSb, idRSt, idRGo;
70  double maxWidthRH, probGluinoballRH, mOffsetCloudRH, mCollapseRH,
71  diquarkSpin1RH, m0Sb, m0St, m0Go;
72 
73  // Current event properties.
74  vector<int> iBefRHad, iCreRHad, iRHadron, iAftRHad;
75  vector<bool> isTriplet;
76  int nRHad, iRHad, iBef, iSys;
77  ColSinglet* systemPtr;
78 
79  // Pointer to various information on the generation.
80  Info* infoPtr;
81 
82  // Pointer to the particle data table.
83  ParticleData* particleDataPtr;
84 
85  // Pointer to the random number generator.
86  Rndm* rndmPtr;
87 
88  // Pointers to classes for flavour and z generation.
89  StringFlav* flavSelPtr;
90  StringZ* zSelPtr;
91 
92  // Split a system that contains both a sparticle and a junction.
93  bool splitOffJunction( ColConfig& colConfig, Event& event);
94 
95  // Open up a closed gluon/gluino loop.
96  bool openClosedLoop( ColConfig& colConfig, Event& event);
97 
98  // Split a single colour singlet that contains two sparticles.
99  bool splitSystem( ColConfig& colConfig, Event& event);
100 
101  // Produce a R-hadron from a squark.
102  bool produceSquark( ColConfig& colConfig, Event& event);
103 
104  // Produce a R-hadron from a gluino.
105  bool produceGluino( ColConfig& colConfig, Event& event);
106 
107  // Construct R-hadron code from squark and (di)quark codes.
108  int toIdWithSquark( int id1, int id2);
109 
110  // Construct squark and (di)quark codes from R-hadron code.
111  pair<int,int> fromIdWithSquark( int idRHad);
112 
113  // Construct R-hadron code from endpoints and a gluino.
114  int toIdWithGluino( int id1, int id2);
115 
116  // Construct endpoint codes from R-hadron code with a gluino.
117  pair<int,int> fromIdWithGluino( int idRHad);
118 
119  // Construct modified four-vectors to match modified masses.
120  bool newKin( Vec4 pOld1, Vec4 pOld2, double mNew1, double mNew2,
121  Vec4& pNew1, Vec4& pNew2, bool checkMargin = true);
122 
123 };
124 
125 //==========================================================================
126 
127 } // end namespace Pythia8
128 
129 #endif // Pythia8_RHadrons_H
Definition: AgUStep.h:26