PYTHIA  8.311
BeamRemnants.h
1 // BeamRemnants.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 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( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
53  int iDSin) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn; iDS = iDSin;}
54 
55  // Select the flavours/kinematics/colours of the two beam remnants.
56  bool add( Event& event, int iFirst = 0, bool doDiffCR = false);
57 
58 protected:
59 
60  virtual void onInitInfoPtr() override {
61  registerSubObject(junctionSplitting); }
62 
63 private:
64 
65  // Constants: could only be changed in the code itself.
66  static const bool ALLOWCOLOURTWICE, CORRECTMISMATCH;
67  static const int NTRYCOLMATCH, NTRYKINMATCH;
68 
69  // Initialization data, read from Settings.
70  bool doPrimordialKT, allowRescatter, doRescatterRestoreY, doReconnect;
71  double primordialKTsoft, primordialKThard, primordialKTremnant,
72  halfScaleForKT, halfMassForKT, reducedKTatHighY;
73  int remnantMode, reconnectMode;
74 
75  // Information set for events.
76  bool isDIS, doMPI, beamA2gamma, beamB2gamma;
77  int nSys, oldSize, iDS;
78  double eCM, sCM;
79 
80  // Colour collapses (when one colour is mapped onto another).
81  vector<int> colFrom, colTo;
82 
83  // Pointer to the colour reconnection class.
84  ColRecPtr colourReconnectionPtr;
85 
86  // StringLength class.
87  StringLength stringLength;
88 
89  // Junction splitting class.
90  JunctionSplitting junctionSplitting;
91 
92  // Select the flavours/kinematics/colours of the two beam remnants.
93  bool addOld( Event& event);
94 
95  // Select the flavours/kinematics/colours of the two beam remnants.
96  bool addNew( Event& event);
97 
98  // Pointer to assign space-time information.
99  PartonVertexPtr partonVertexPtr;
100  bool doPartonVertex;
101 
102  // Do the kinematics of the collision subsystems and two beam remnants.
103  bool setKinematics( Event& event);
104 
105  // Special beam remnant kinematics when only one remnant system added.
106  // This is the case e.g for Deeply Inelastic Scattering and photon
107  // collisions with other side ended up to beam photon by ISR.
108  bool setOneRemnKinematics( Event& event);
109 
110  // Update colours of outgoing particles in the event.
111  void updateColEvent( Event& event, vector<pair <int,int> > colChanges);
112 
113  // Check that colours are consistent.
114  bool checkColours( Event& event);
115 
116  // Find junction chains.
117  vector <vector<int> > findJunChains(vector<vector <int> > iPartonJun,
118  vector<vector<int> > iPartonAjun);
119 
120  // Split junction configuration into smaller parts.
121  bool splitJunChains(Event& event, vector<vector<int > >& iPartonJun,
122  vector<vector< int > >& ipartonAntiJun);
123 
124  // Get junction chains.
125  vector<vector<int > > getJunChains(Event& event);
126 
127 };
128 
129 //==========================================================================
130 
131 } // end namespace Pythia8
132 
133 #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:453
Definition: BeamParticle.h:133
Definition: JunctionSplitting.h:30
void reassignBeamPtrs(BeamParticle *beamAPtrIn, BeamParticle *beamBPtrIn, int iDSin)
New beams possible for handling of hard diffraction.
Definition: BeamRemnants.h:52
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:60
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