StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BeamRemnants.h
1 // BeamRemnants.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2018 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/PythiaStdlib.h"
24 #include "Pythia8/Settings.h"
25 #include "Pythia8/StringLength.h"
26 
27 namespace Pythia8 {
28 
29 //==========================================================================
30 
31 // This class matches the kinematics of the hard-scattering subsystems
32 // (with primordial kT added) to that of the two beam remnants.
33 
34 class BeamRemnants {
35 
36 public:
37 
38  // Constructor.
39  BeamRemnants() : iDS(0) { }
40 
41  // Initialization.
42  bool init( Info* infoPtrIn, Settings& settings, Rndm* rndmPtrIn,
43  BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
44  PartonSystems* partonSystemsPtrIn, PartonVertex* partonVertexPtrIn,
45  ParticleData* particleDataPtrIn,
46  ColourReconnection * colourReconnectionPtrIn);
47 
48  // New beams possible for handling of hard diffraction.
49  void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
50  int iDSin) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn; iDS = iDSin;}
51 
52  // Select the flavours/kinematics/colours of the two beam remnants.
53  bool add( Event& event, int iFirst = 0, bool doDiffCR = false);
54 
55 private:
56 
57  // Constants: could only be changed in the code itself.
58  static const bool ALLOWCOLOURTWICE, CORRECTMISMATCH;
59  static const int NTRYCOLMATCH, NTRYKINMATCH;
60 
61  // Initialization data, read from Settings.
62  bool doPrimordialKT, allowRescatter, doRescatterRestoreY, doReconnect;
63  double primordialKTsoft, primordialKThard, primordialKTremnant,
64  halfScaleForKT, halfMassForKT, reducedKTatHighY;
65  int remnantMode, reconnectMode;
66 
67  // Information set for events.
68  bool isDIS, doMPI;
69  int nSys, oldSize, iDS;
70  double eCM, sCM;
71 
72  // Colour collapses (when one colour is mapped onto another).
73  vector<int> colFrom, colTo;
74 
75  // Pointer to various information on the generation.
76  Info* infoPtr;
77 
78  // Pointer to the random number generator.
79  Rndm* rndmPtr;
80 
81  // Pointers to the two incoming beams.
82  BeamParticle* beamAPtr;
83  BeamParticle* beamBPtr;
84 
85  // Pointer to the colour reconnection class.
86  ColourReconnection* colourReconnectionPtr;
87 
88  // StringLength class.
89  StringLength stringLength;
90 
91  // Junction splitting class.
92  JunctionSplitting junctionSplitting;
93 
94  // Select the flavours/kinematics/colours of the two beam remnants.
95  bool addOld( Event& event);
96 
97  // Select the flavours/kinematics/colours of the two beam remnants.
98  bool addNew( Event& event);
99 
100  // Pointer to information on subcollision parton locations.
101  PartonSystems* partonSystemsPtr;
102 
103  // Pointer to assign space-time information.
104  PartonVertex* partonVertexPtr;
105  bool doPartonVertex;
106 
107  // Pointer to the particle data table.
108  ParticleData* particleDataPtr;
109 
110  // Do the kinematics of the collision subsystems and two beam remnants.
111  bool setKinematics( Event& event);
112 
113  // Special beam remnant kinematics when only one remnant system added.
114  // This is the case e.g for Deeply Inelastic Scattering and photon
115  // collisions with other side ended up to beam photon by ISR.
116  bool setOneRemnKinematics( Event& event, int beamOffset);
117 
118  // Update colours of outgoing particles in the event.
119  void updateColEvent( Event& event, vector<pair <int,int> > colChanges);
120 
121  // Check that colours are consistent.
122  bool checkColours( Event& event);
123 
124  // Find junction chains.
125  vector <vector<int> > findJunChains(vector<vector <int> > iPartonJun,
126  vector<vector<int> > iPartonAjun);
127 
128  // Split junction configuration into smaller parts.
129  bool splitJunChains(Event& event, vector<vector<int > >& iPartonJun,
130  vector<vector< int > >& ipartonAntiJun);
131 
132  // Get junction chains.
133  vector<vector<int > > getJunChains(Event& event);
134 
135 };
136 
137 //==========================================================================
138 
139 } // end namespace Pythia8
140 
141 #endif // Pythia8_BeamRemnants_H
Definition: AgUStep.h:26