StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StringInteractions.h
1 // StringInteraction.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2020 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 the classes involved in the modelling interactions
7 // between strings. This includes standard colour reconnections,
8 // perturbative swing, string shoving and rope hadronisation. The
9 // StringInterations base class is an interface to all of these, and
10 // can be used both during and after PartonLevel, as well as before,
11 // during and after string fragmentation.
12 
13 #ifndef Pythia8_StringInteractions_H
14 #define Pythia8_StringInteractions_H
15 
16 #include "Pythia8/SharedPointers.h"
17 #include "Pythia8/PhysicsBase.h"
18 #include "Pythia8/FragmentationSystems.h"
19 
20 namespace Pythia8 {
21 
22 //==========================================================================
23 
24 // StringInteractions is the base class for handling colour
25 // reconnection, swing, shoving, and rope-type models for modifying
26 // string fragmentation.
27 
29 
30 public:
31 
32  // Empty constructor.
33  StringInteractions() = default;
34 
35  // Empty virtual destructor
36  virtual ~StringInteractions() {}
37 
38  // Function called from Pythia after the basic pointers. The base
39  // class will setup the standard behaviour of Pythia 8.2 according
40  // to the given Settings. Derived classes should create objects of
41  // the specific model objects to be used.
42  virtual bool init();
43 
44  // Access the pointers to the different models.
45  ColRecPtr getColourReconnections() const { return colrecPtr; }
46  DipSwingPtr getDipoleSwing() const { return dipswingPtr; }
47  StringRepPtr getStringRepulsion() const { return stringrepPtr; }
48  FragModPtr getFragmentationModifier() const { return fragmodPtr; }
49 
50 protected:
51 
52  // The object responsible for colour reconections in the end of
53  // PartonLevel or in the beginning of HadronLevel.
54  ColRecPtr colrecPtr{};
55 
56  // The object responsible for the perturbative swing which is always
57  // active together with the TimeShower.
58  DipSwingPtr dipswingPtr{};
59 
60  // The object responsible for repulsion between strings before
61  // hadronisation (or calculating the repulsion before but actually
62  // pushing the hadrons after fragmentation).
63  StringRepPtr stringrepPtr{};
64 
65  // The object responsible for modifying fragmentation parameters due
66  // to string interactions in each break-up (eg. in rope
67  // hadronisation).
68  FragModPtr fragmodPtr{};
69 
70 };
71 
72 //==========================================================================
73 
74 // ColourReconnectionBase is responsible for doing standard colour
75 // reconnection in the end of the PartonLevel or in the beginning of
76 // HadronLevel.
77 
79 
80 public:
81 
82  // Empty default constructor.
83  ColourReconnectionBase() = default;
84 
85  // Empty virtual destructor.
86  virtual ~ColourReconnectionBase() {}
87 
88  // Called after PhysicsBase initHbPtrs has been called.
89  virtual bool init() { return true; }
90 
91  // New beams possible for handling of hard diffraction.
92  virtual void reassignBeamPtrs( BeamParticle* beamAPtrIn,
93  BeamParticle* beamBPtrIn) {beamAPtr = beamAPtrIn;
94  beamBPtr = beamBPtrIn;}
95 
96  // Do colour reconnection for current event.
97  virtual bool next( Event & event, int oldSize) = 0;
98 
99 };
100 
101 //==========================================================================
102 
103 // DipoleSwingBase is responsible for the perturbative swing and is active
104 // anytime the TimeShower is active.
105 
106 class DipoleSwingBase : public PhysicsBase {
107 
108 public:
109 
110  // Empty default constructor.
111  DipoleSwingBase() = default;
112 
113  // Empty virtual destructor.
114  virtual ~DipoleSwingBase() {}
115 
116  // Called after PhysicsBase initInfoPtr has been called.
117  virtual bool init() { return true; }
118 
119  // New beams possible for handling of hard diffraction.
120  virtual void reassignBeamPtrs( BeamParticle* beamAPtrIn,
121  BeamParticle* beamBPtrIn, int beamOffsetIn = 0) {beamAPtr = beamAPtrIn;
122  beamBPtr = beamBPtrIn; beamOffset = beamOffsetIn;}
123 
124  // Prepare system for evolution after each new interaction; identify ME.
125  // Usage: prepare( iSys, event, limitPTmax).
126  virtual void prepare( int , Event& , bool = true) = 0;
127 
128  // Update dipole list after a multiparton interactions rescattering.
129  // Usage: rescatterUpdate( iSys, event).
130  virtual void rescatterUpdate( int , Event& ) = 0;
131 
132  // Update dipole list after each ISR emission.
133  // Usage: update( iSys, event, hasWeakRad).
134  virtual void update( int , Event& , bool = false) = 0;
135 
136  // Select next pT in downwards evolution.
137  // Usage: pTnext( event, pTbegAll, pTendAll, isFirstTrial, doTrialIn).
138  virtual double pTnext( Event& , double , double ,
139  bool = false, bool = false) = 0;
140 
141  // Perform the swing previousl generated in pTnext.
142  virtual bool swing( Event& event) = 0;
143 
144 protected:
145 
146  // Offset the location of the beam pointers in an event.
147  int beamOffset{};
148 
149 };
150 
151 //==========================================================================
152 
153 // StringRepulsionBase is responsible for calculating and performing
154 // the repulsion between strings before the hadronisation.
155 
157 
158 public:
159 
160  // Empty default constructor.
161  StringRepulsionBase() = default;
162 
163  // Empty virtual destructor.
164  virtual ~StringRepulsionBase() {}
165 
166  // Called after PhysicsBase initInfoPtr has been called.
167  virtual bool init() { return true; }
168 
169  // Main virtual function, called before the hadronisation.
170  virtual bool stringRepulsion(Event & event, ColConfig & colConfig) = 0;
171 
172  // Additional functionality for implementing repulsion post-factum
173  // after the actual hadronisation has been done.
174  virtual bool hadronRepulsion(Event &) { return true; }
175 };
176 
177 //==========================================================================
178 
179 // FragmentationModifierBase can change the parameters of the string
180 // fragmentation in each break-up.
181 
183 
184 public:
185 
186  // Empty default constructor.
187  FragmentationModifierBase() = default;
188 
189  // Empty virtual destructor.
190  virtual ~FragmentationModifierBase() {};
191 
192  // Called after PhysicsBase initInfoPtr has been called.
193  virtual bool init() { return true; }
194 
195  // Called just before hadronisation starts.
196  virtual bool initEvent(Event& event, ColConfig& colConfig) = 0;
197 
198  // The main virtual function for chaning the fragmentation
199  // parameters.
200  virtual bool doChangeFragPar(StringFlav* flavPtr, StringZ* zPtr,
201  StringPT * pTPtr, double m2Had, vector<int> iParton, int endId) = 0;
202 
203 };
204 
205 } // end namespace Pythia8
206 
207 #endif // Pythia8_StringInteractions_H