Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:25:35

0001 // RHadrons.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2025 Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // This file contains a class for the production and decay
0007 // of long-lived heavy coloured particles, for now the gluino.
0008 
0009 #ifndef Pythia8_RHadrons_H
0010 #define Pythia8_RHadrons_H
0011 
0012 #include "Pythia8/FragmentationModel.h"
0013 
0014 namespace Pythia8 {
0015 
0016 //==========================================================================
0017 
0018 // The RHadrons class contains the routines for the production and decay
0019 // of long-lived heavy coloured particles.
0020 
0021 class RHadrons : public FragmentationModel {
0022 
0023 public:
0024 
0025   // Constructor.
0026   RHadrons() : FragmentationModel(), allowRH(), allowRSb(), allowRSt(),
0027     allowRGo(), allowSomeR(), setMassesRH(), idRSb(), idRSt(), idRGo(),
0028     maxWidthRH(), probGluinoballRH(), mOffsetCloudRH(), mCollapseRH(),
0029     diquarkSpin1RH(), m0Sb(), m0St(), m0Go(), nRHad(0), iRHad(), iBef(),
0030     iSys(), systemPtr() {}
0031 
0032   // Initialize and save pointers.
0033   bool init(StringFlav* flavSelPtrIn = nullptr, StringPT* pTSelPtrIn = nullptr,
0034     StringZ* zSelPtrIn = nullptr, FragModPtr fragModPtrIn = nullptr) override;
0035 
0036   // Fragment the event.
0037   bool fragment(int iSub, ColConfig& colConfig, Event& event,
0038     bool isDiff = false, bool systemRecoil = true) override;
0039 
0040   // Decay R-hadrons.
0041   bool decay( Event& event);
0042 
0043   // Tell whether a given particle is supposed to form R-hadrons.
0044   bool givesRHadron(int id);
0045 
0046   // Tell whether any R-hadrons have been formed.
0047   bool exist() {return (nRHad > 0);}
0048 
0049   // Tell whether a R-hadron production+decay happened, and trace down.
0050   int trace(int i) {
0051     for (int iR = 0; iR < nRHad; ++iR)
0052       if (iBefRHad[iR] == i || iCreRHad[iR] == i) return iAftRHad[iR];
0053     return 0;}
0054 
0055 private:
0056 
0057   // Constants: could only be changed in the code itself.
0058   static const int    IDRHADSB[14], IDRHADST[14], IDRHADGO[38], NTRYMAX;
0059   static const double MSAFETY, EGBORROWMAX;
0060 
0061   // Initialization data, mainly read from Settings.
0062   bool   allowRH, allowRSb, allowRSt, allowRGo, allowSomeR, setMassesRH;
0063   int    idRSb, idRSt, idRGo;
0064   double maxWidthRH, probGluinoballRH, mOffsetCloudRH, mCollapseRH,
0065          diquarkSpin1RH, m0Sb, m0St, m0Go;
0066 
0067   // Current event properties.
0068   vector<int>  iBefRHad, iCreRHad, iRHadron, iAftRHad;
0069   vector<bool> isTriplet;
0070   int          nRHad, iRHad, iBef, iSys;
0071   ColSinglet*  systemPtr;
0072 
0073   // Split a system that contains both a sparticle and a junction.
0074   bool splitOffJunction( ColConfig& colConfig, Event& event);
0075 
0076   // Open up a closed gluon/gluino loop.
0077   bool openClosedLoop( ColConfig& colConfig, Event& event);
0078 
0079   // Split a single colour singlet that contains two sparticles.
0080   bool splitSystem( ColConfig& colConfig, Event& event);
0081 
0082   // Produce a R-hadron from a squark.
0083   bool produceSquark( ColConfig& colConfig, Event& event);
0084 
0085   // Produce a R-hadron from a gluino.
0086   bool produceGluino( ColConfig& colConfig, Event& event);
0087 
0088   // Construct R-hadron code from squark and (di)quark codes.
0089   int toIdWithSquark( int id1, int id2);
0090 
0091   // Construct squark and (di)quark codes from R-hadron code.
0092   pair<int,int> fromIdWithSquark( int idRHad);
0093 
0094   // Construct R-hadron code from endpoints and a gluino.
0095   int toIdWithGluino( int id1, int id2);
0096 
0097   // Construct endpoint codes from R-hadron code with a gluino.
0098   pair<int,int> fromIdWithGluino( int idRHad);
0099 
0100   // Construct modified four-vectors to match modified masses.
0101   bool newKin( Vec4 pOld1, Vec4 pOld2, double mNew1, double mNew2,
0102     Vec4& pNew1, Vec4& pNew2, bool checkMargin = true);
0103 
0104 };
0105 
0106 //==========================================================================
0107 
0108 } // end namespace Pythia8
0109 
0110 #endif // Pythia8_RHadrons_H