Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // BeamRemnants.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 // Header file for beam-remnants handling.
0007 // BeamRemnants: matches the remnants between the two beams.
0008 
0009 #ifndef Pythia8_BeamRemnants_H
0010 #define Pythia8_BeamRemnants_H
0011 
0012 #include "Pythia8/Basics.h"
0013 #include "Pythia8/BeamParticle.h"
0014 #include "Pythia8/ColourReconnection.h"
0015 #include "Pythia8/Event.h"
0016 #include "Pythia8/FragmentationFlavZpT.h"
0017 #include "Pythia8/Info.h"
0018 #include "Pythia8/JunctionSplitting.h"
0019 #include "Pythia8/ParticleData.h"
0020 #include "Pythia8/PartonDistributions.h"
0021 #include "Pythia8/PartonSystems.h"
0022 #include "Pythia8/PartonVertex.h"
0023 #include "Pythia8/PhysicsBase.h"
0024 #include "Pythia8/PythiaStdlib.h"
0025 #include "Pythia8/Settings.h"
0026 #include "Pythia8/StringLength.h"
0027 
0028 namespace Pythia8 {
0029 
0030 //==========================================================================
0031 
0032 // This class matches the kinematics of the hard-scattering subsystems
0033 // (with primordial kT added) to that of the two beam remnants.
0034 
0035 class BeamRemnants : public PhysicsBase {
0036 
0037 public:
0038 
0039   // Constructor.
0040   BeamRemnants() : doPrimordialKT(), allowRescatter(), doRescatterRestoreY(),
0041     doReconnect(), primordialKTsoft(), primordialKThard(),
0042     primordialKTremnant(), halfScaleForKT(), halfMassForKT(),
0043     reducedKTatHighY(), remnantMode(), reconnectMode(), isDIS(), doMPI(),
0044     beamA2gamma(), beamB2gamma(), nSys(), oldSize(), iDS(0), eCM(), sCM(),
0045     colourReconnectionPtr(), partonVertexPtr(), doPartonVertex() { }
0046 
0047   // Initialization.
0048   bool init( PartonVertexPtr partonVertexPtrIn,
0049     ColRecPtr colourReconnectionPtrIn);
0050 
0051   // New beams possible for handling of hard diffraction.
0052   void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
0053     int iDSin) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn; iDS = iDSin;}
0054 
0055   // Select the flavours/kinematics/colours of the two beam remnants.
0056   bool add( Event& event, int iFirst = 0, bool doDiffCR = false);
0057 
0058 protected:
0059 
0060   virtual void onInitInfoPtr() override {
0061     registerSubObject(junctionSplitting); }
0062 
0063 private:
0064 
0065   // Constants: could only be changed in the code itself.
0066   static const bool   ALLOWCOLOURTWICE, CORRECTMISMATCH;
0067   static const int    NTRYCOLMATCH, NTRYKINMATCH;
0068 
0069   // Initialization data, read from Settings.
0070   bool   doPrimordialKT, allowRescatter, doRescatterRestoreY, doReconnect;
0071   double primordialKTsoft, primordialKThard, primordialKTremnant,
0072          halfScaleForKT, halfMassForKT, reducedKTatHighY;
0073   int    remnantMode, reconnectMode;
0074 
0075   // Information set for events.
0076   bool   isDIS, doMPI, beamA2gamma, beamB2gamma;
0077   int    nSys, oldSize, iDS;
0078   double eCM, sCM;
0079 
0080   // Colour collapses (when one colour is mapped onto another).
0081   vector<int> colFrom, colTo;
0082 
0083   // Pointer to the colour reconnection class.
0084   ColRecPtr colourReconnectionPtr;
0085 
0086   // StringLength class.
0087   StringLength stringLength;
0088 
0089   // Junction splitting class.
0090   JunctionSplitting junctionSplitting;
0091 
0092   // Select the flavours/kinematics/colours of the two beam remnants.
0093   bool addOld( Event& event);
0094 
0095   // Select the flavours/kinematics/colours of the two beam remnants.
0096   bool addNew( Event& event);
0097 
0098   // Pointer to assign space-time information.
0099   PartonVertexPtr partonVertexPtr;
0100   bool doPartonVertex;
0101 
0102   // Do the kinematics of the collision subsystems and two beam remnants.
0103   bool setKinematics( Event& event);
0104 
0105   // Special beam remnant kinematics when only one remnant system added.
0106   // This is the case e.g for Deeply Inelastic Scattering and photon
0107   // collisions with other side ended up to beam photon by ISR.
0108   bool setOneRemnKinematics( Event& event);
0109 
0110   // Update colours of outgoing particles in the event.
0111   void updateColEvent( Event& event, vector<pair <int,int> > colChanges);
0112 
0113   // Check that colours are consistent.
0114   bool checkColours( Event& event);
0115 
0116   // Find junction chains.
0117   vector <vector<int> > findJunChains(vector<vector <int> > iPartonJun,
0118     vector<vector<int> > iPartonAjun);
0119 
0120   // Split junction configuration into smaller parts.
0121   bool splitJunChains(Event& event, vector<vector<int > >& iPartonJun,
0122     vector<vector< int > >& ipartonAntiJun);
0123 
0124   // Get junction chains.
0125   vector<vector<int > > getJunChains(Event& event);
0126 
0127 };
0128 
0129 //==========================================================================
0130 
0131 } // end namespace Pythia8
0132 
0133 #endif // Pythia8_BeamRemnants_H