Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:29

0001 // RHadrons.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 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/Basics.h"
0013 #include "Pythia8/Event.h"
0014 #include "Pythia8/FragmentationFlavZpT.h"
0015 #include "Pythia8/FragmentationSystems.h"
0016 #include "Pythia8/Info.h"
0017 #include "Pythia8/ParticleData.h"
0018 #include "Pythia8/PythiaStdlib.h"
0019 #include "Pythia8/PhysicsBase.h"
0020 #include "Pythia8/Settings.h"
0021 
0022 namespace Pythia8 {
0023 
0024 //==========================================================================
0025 
0026 // The RHadrons class contains the routines for the production and decay
0027 // of long-lived heavy coloured particles.
0028 
0029 class RHadrons : public PhysicsBase {
0030 
0031 public:
0032 
0033   // Constructor.
0034   RHadrons() : allowRH(), allowRSb(), allowRSt(), allowRGo(), allowSomeR(),
0035     setMassesRH(), idRSb(), idRSt(), idRGo(), maxWidthRH(), probGluinoballRH(),
0036     mOffsetCloudRH(), mCollapseRH(), diquarkSpin1RH(), m0Sb(), m0St(), m0Go(),
0037     nRHad(0), iRHad(), iBef(), iSys(), systemPtr(), flavSelPtr(), zSelPtr() {}
0038 
0039   // Initialization of R-hadron handling.
0040   bool init();
0041 
0042   // Pointers to flavours and z sent from HadronLevel.
0043   void fragPtrs( StringFlav* flavSelPtrIn, StringZ* zSelPtrIn)
0044     { flavSelPtr = flavSelPtrIn; zSelPtr = zSelPtrIn;}
0045 
0046   // Produce R-hadrons.
0047   bool produce( ColConfig& colConfig, Event& event);
0048 
0049   // Decay R-hadrons.
0050   bool decay( Event& event);
0051 
0052   // Tell whether a given particle is supposed to form R-hadrons.
0053   bool givesRHadron(int id);
0054 
0055   // Tell whether any R-hadrons have been formed.
0056   bool exist() {return (nRHad > 0);}
0057 
0058   // Tell whether a R-hadron production+decay happened, and trace down.
0059   int trace(int i) {
0060     for (int iR = 0; iR < nRHad; ++iR)
0061       if (iBefRHad[iR] == i || iCreRHad[iR] == i) return iAftRHad[iR];
0062     return 0;}
0063 
0064 private:
0065 
0066   // Constants: could only be changed in the code itself.
0067   static const int    IDRHADSB[14], IDRHADST[14], IDRHADGO[38], NTRYMAX;
0068   static const double MSAFETY, EGBORROWMAX;
0069 
0070   // Initialization data, mainly read from Settings.
0071   bool   allowRH, allowRSb, allowRSt, allowRGo, allowSomeR, setMassesRH;
0072   int    idRSb, idRSt, idRGo;
0073   double maxWidthRH, probGluinoballRH, mOffsetCloudRH, mCollapseRH,
0074          diquarkSpin1RH, m0Sb, m0St, m0Go;
0075 
0076   // Current event properties.
0077   vector<int>  iBefRHad, iCreRHad, iRHadron, iAftRHad;
0078   vector<bool> isTriplet;
0079   int          nRHad, iRHad, iBef, iSys;
0080   ColSinglet*  systemPtr;
0081 
0082   // Pointers to classes for flavour and z generation.
0083   StringFlav*    flavSelPtr;
0084   StringZ*       zSelPtr;
0085 
0086   // Split a system that contains both a sparticle and a junction.
0087   bool splitOffJunction( ColConfig& colConfig, Event& event);
0088 
0089   // Open up a closed gluon/gluino loop.
0090   bool openClosedLoop( ColConfig& colConfig, Event& event);
0091 
0092   // Split a single colour singlet that contains two sparticles.
0093   bool splitSystem( ColConfig& colConfig, Event& event);
0094 
0095   // Produce a R-hadron from a squark.
0096   bool produceSquark( ColConfig& colConfig, Event& event);
0097 
0098   // Produce a R-hadron from a gluino.
0099   bool produceGluino( ColConfig& colConfig, Event& event);
0100 
0101   // Construct R-hadron code from squark and (di)quark codes.
0102   int toIdWithSquark( int id1, int id2);
0103 
0104   // Construct squark and (di)quark codes from R-hadron code.
0105   pair<int,int> fromIdWithSquark( int idRHad);
0106 
0107   // Construct R-hadron code from endpoints and a gluino.
0108   int toIdWithGluino( int id1, int id2);
0109 
0110   // Construct endpoint codes from R-hadron code with a gluino.
0111   pair<int,int> fromIdWithGluino( int idRHad);
0112 
0113   // Construct modified four-vectors to match modified masses.
0114   bool newKin( Vec4 pOld1, Vec4 pOld2, double mNew1, double mNew2,
0115     Vec4& pNew1, Vec4& pNew2, bool checkMargin = true);
0116 
0117 };
0118 
0119 //==========================================================================
0120 
0121 } // end namespace Pythia8
0122 
0123 #endif // Pythia8_RHadrons_H