PYTHIA  8.314
BeamRemnants.h
1 // BeamRemnants.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 // Header file for beam-remnants handling.
7 // BeamRemnants: matches the remnants between the two beams.
8 
9 #ifndef Pythia8_BeamRemnants_H
10 #define Pythia8_BeamRemnants_H
11 
12 #include "Pythia8/Basics.h"
13 #include "Pythia8/BeamParticle.h"
14 #include "Pythia8/ColourReconnection.h"
15 #include "Pythia8/Event.h"
16 #include "Pythia8/FragmentationFlavZpT.h"
17 #include "Pythia8/Info.h"
18 #include "Pythia8/JunctionSplitting.h"
19 #include "Pythia8/ParticleData.h"
20 #include "Pythia8/PartonDistributions.h"
21 #include "Pythia8/PartonSystems.h"
22 #include "Pythia8/PartonVertex.h"
23 #include "Pythia8/PhysicsBase.h"
24 #include "Pythia8/PythiaStdlib.h"
25 #include "Pythia8/Settings.h"
26 #include "Pythia8/StringLength.h"
27 
28 namespace Pythia8 {
29 
30 //==========================================================================
31 
32 // This class matches the kinematics of the hard-scattering subsystems
33 // (with primordial kT added) to that of the two beam remnants.
34 
35 class BeamRemnants : public PhysicsBase {
36 
37 public:
38 
39  // Constructor.
40  BeamRemnants() : doPrimordialKT(), allowRescatter(), doRescatterRestoreY(),
41  doReconnect(), primordialKTsoft(), primordialKThard(),
42  primordialKTremnant(), halfScaleForKT(), halfMassForKT(),
43  reducedKTatHighY(), remnantMode(), reconnectMode(), isDIS(), doMPI(),
44  beamA2gamma(), beamB2gamma(), nSys(), oldSize(), iDS(0), eCM(), sCM(),
45  colourReconnectionPtr(), partonVertexPtr(), doPartonVertex() { }
46 
47  // Initialization.
48  bool init( PartonVertexPtr partonVertexPtrIn,
49  ColRecPtr colourReconnectionPtrIn);
50 
51  // New beams possible for handling of hard diffraction.
52  void reassignBeamPtrs( BeamParticlePtr beamAPtrIn,
53  BeamParticlePtr beamBPtrIn, int iDSin) {
54  beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn; iDS = iDSin;}
55 
56  // Select the flavours/kinematics/colours of the two beam remnants.
57  bool add( Event& event, int iFirst = 0, bool doDiffCR = false);
58 
59 protected:
60 
61  virtual void onInitInfoPtr() override {
62  registerSubObject(junctionSplitting); }
63 
64 private:
65 
66  // Constants: could only be changed in the code itself.
67  static const bool ALLOWCOLOURTWICE, CORRECTMISMATCH;
68  static const int NTRYCOLMATCH, NTRYKINMATCH;
69 
70  // Initialization data, read from Settings.
71  bool doPrimordialKT, allowRescatter, doRescatterRestoreY, doReconnect;
72  double primordialKTsoft, primordialKThard, primordialKTremnant,
73  halfScaleForKT, halfMassForKT, reducedKTatHighY;
74  int remnantMode, reconnectMode;
75 
76  // Information set for events.
77  bool isDIS, doMPI, beamA2gamma, beamB2gamma;
78  int nSys, oldSize, iDS;
79  double eCM, sCM;
80 
81  // Colour collapses (when one colour is mapped onto another).
82  vector<int> colFrom, colTo;
83 
84  // Pointer to the colour reconnection class.
85  ColRecPtr colourReconnectionPtr;
86 
87  // StringLength class.
88  StringLength stringLength;
89 
90  // Junction splitting class.
91  JunctionSplitting junctionSplitting;
92 
93  // Select the flavours/kinematics/colours of the two beam remnants.
94  bool addOld( Event& event);
95 
96  // Select the flavours/kinematics/colours of the two beam remnants.
97  bool addNew( Event& event);
98 
99  // Pointer to assign space-time information.
100  PartonVertexPtr partonVertexPtr;
101  bool doPartonVertex;
102 
103  // Do the kinematics of the collision subsystems and two beam remnants.
104  bool setKinematics( Event& event);
105 
106  // Special beam remnant kinematics when only one remnant system added.
107  // This is the case e.g for Deeply Inelastic Scattering and photon
108  // collisions with other side ended up to beam photon by ISR.
109  bool setOneRemnKinematics( Event& event);
110 
111  // Update colours of outgoing particles in the event.
112  void updateColEvent( Event& event, vector<pair <int,int> > colChanges);
113 
114  // Check that colours are consistent.
115  bool checkColours( Event& event);
116 
117  // Find junction chains.
118  vector <vector<int> > findJunChains(vector<vector <int> > iPartonJun,
119  vector<vector<int> > iPartonAjun);
120 
121  // Split junction configuration into smaller parts.
122  bool splitJunChains(Event& event, vector<vector<int > >& iPartonJun,
123  vector<vector< int > >& ipartonAntiJun);
124 
125  // Get junction chains.
126  vector<vector<int > > getJunChains(Event& event);
127 
128 };
129 
130 //==========================================================================
131 
132 } // end namespace Pythia8
133 
134 #endif // Pythia8_BeamRemnants_H
Definition: PhysicsBase.h:27
void registerSubObject(PhysicsBase &pb)
Register a sub object that should have its information in sync with this.
Definition: PhysicsBase.cc:56
The Event class holds all info on the generated event.
Definition: Event.h:408
Definition: JunctionSplitting.h:30
BeamRemnants()
Constructor.
Definition: BeamRemnants.h:40
StringLength class. It is used to calculate the lambda measure.
Definition: StringLength.h:23
virtual void onInitInfoPtr() override
Definition: BeamRemnants.h:61
void reassignBeamPtrs(BeamParticlePtr beamAPtrIn, BeamParticlePtr beamBPtrIn, int iDSin)
New beams possible for handling of hard diffraction.
Definition: BeamRemnants.h:52
bool init(PartonVertexPtr partonVertexPtrIn, ColRecPtr colourReconnectionPtrIn)
Initialization.
Definition: BeamRemnants.cc:38
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
Definition: BeamRemnants.h:35
bool add(Event &event, int iFirst=0, bool doDiffCR=false)
Select the flavours/kinematics/colours of the two beam remnants.
Definition: BeamRemnants.cc:99