PYTHIA  8.312
SpaceShower.h
1 // SpaceShower.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 the base class of spacelike initial-state showers.
7 // SpaceShower: handles the showering description.
8 
9 #ifndef Pythia8_SpaceShower_H
10 #define Pythia8_SpaceShower_H
11 
12 #include "Pythia8/Basics.h"
13 #include "Pythia8/BeamParticle.h"
14 #include "Pythia8/Event.h"
15 #include "Pythia8/Info.h"
16 #include "Pythia8/ParticleData.h"
17 #include "Pythia8/PartonSystems.h"
18 #include "Pythia8/PartonVertex.h"
19 #include "Pythia8/PhysicsBase.h"
20 #include "Pythia8/PythiaStdlib.h"
21 #include "Pythia8/Settings.h"
22 #include "Pythia8/StandardModel.h"
23 #include "Pythia8/UserHooks.h"
24 #include "Pythia8/MergingHooks.h"
25 #include "Pythia8/Weights.h"
26 
27 namespace Pythia8 {
28 
29 //==========================================================================
30 
31 // The SpaceShower class does spacelike showers.
32 
33 class SpaceShower : public PhysicsBase {
34 
35 public:
36  // Constructor.
37  SpaceShower() = default;
38 
39  // Destructor.
40  virtual ~SpaceShower() {}
41 
42  // Initialize various pointers.
43  // (Separated from rest of init since not virtual.)
44  void initPtrs(MergingHooksPtr mergingHooksPtrIn,
45  PartonVertexPtr partonVertexPtrIn,
46  WeightContainer* weightContainerPtrIn) {
48  mergingHooksPtr = mergingHooksPtrIn;
49  partonVertexPtr = partonVertexPtrIn;
50  weightContainerPtr = weightContainerPtrIn;
51  }
52 
53  // New beams possible for handling of hard diffraction. (Not virtual.)
54  void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
55  int beamOffsetIn = 0) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
56  beamOffset = beamOffsetIn;}
57 
58  // Initialize generation. Possibility to force re-initialization by hand.
59  // Usage: init( beamAPtr, beamBPtr).
60  virtual void init(BeamParticle* , BeamParticle* ) {}
61 
62  // Find whether to limit maximum scale of emissions, and whether to dampen.
63  // Usage: limitPTmax( event, Q2Fac, double Q2Ren).
64  virtual bool limitPTmax( Event& , double = 0., double = 0.) {return true;}
65 
66  // Prepare system for evolution; identify ME.
67  // Usage: prepare( iSys, event, limitPTmax).
68  virtual void prepare( int , Event& , bool = true) {}
69 
70  // Update dipole list after each FSR emission.
71  // Usage: update( iSys, event, hasWeakRad).
72  virtual void update( int , Event&, bool = false) {}
73 
74  // Select next pT in downwards evolution.
75  // Usage: pTnext( event, pTbegAll, pTendAll, nRadIn, doTrialIn).
76  virtual double pTnext( Event& , double , double , int = -1, bool = false)
77  { return 0.;}
78 
79  // ME corrections and kinematics that may give failure.
80  // Usage: branch( event).
81  virtual bool branch( Event& ) {return true;}
82 
83  // Print dipole list; for debug mainly.
84  virtual void list() const {}
85 
86  // Initialize data members for calculation of uncertainty bands.
87  virtual bool initUncertainties() {return false;}
88 
89  // Initialize data members for application of enhancements.
90  virtual bool initEnhancements() {return false;}
91 
92  // Flag for failure in branch(...) that will force a retry of parton level.
93  virtual bool doRestart() const {return false;}
94 
95  // Tell if latest scattering was a gamma->qqbar.
96  virtual bool wasGamma2qqbar() { return false; }
97 
98  // Tell whether ISR has done a weak emission.
99  virtual bool getHasWeaklyRadiated() {return false;}
100 
101  // Tell which system was the last processed one.
102  virtual int system() const {return 0;}
103 
104  // Potential enhancement factor of pTmax scale for hardest emission.
105  virtual double enhancePTmax() const {return 1.;}
106 
107  // Functions to allow usage of shower kinematics, evolution variables,
108  // and splitting probabilities outside of shower.
109  // Virtual so that shower plugins can overwrite these functions.
110  // This makes it possible for another piece of the code to request
111  // these - which is very convenient for merging.
112  // Function variable names are not included to avoid compiler warnings.
113  // Please see the documentation under "Implement New Showers" for details.
114 
115  // Return clustering kinematics - as needed for merging.
116  virtual Event clustered( const Event& , int , int , int , string )
117  { return Event();}
118 
119  // Return the evolution variable(s).
120  // Important note: this map must contain the following entries
121  // - a key "t" for the value of the shower evolution variable;
122  // - a key "tRS" for the value of the shower evolution variable
123  // from which the shower would be restarted after a branching;
124  // - a key "scaleAS" for the argument of alpha_s used for the branching;
125  // - a key "scalePDF" for the argument of the PDFs used for the branching.
126  // Usage: getStateVariables( event, iRad, iEmt, iRec, name)
127  virtual map<string, double> getStateVariables (const Event& , int , int ,
128  int , string ) { return map<string,double>();}
129 
130  // Check if attempted clustering is handled by spacelike shower.
131  // Usage: isSpacelike( event, iRad, iEmt, iRec, name)
132  virtual bool isSpacelike(const Event&, int, int, int, string)
133  { return false; }
134 
135  // Return a string identifier of a splitting.
136  // Usage: getSplittingName( event, iRad, iEmt, iRec)
137  virtual vector<string> getSplittingName( const Event& , int , int , int )
138  { return vector<string>();}
139 
140  // Return the splitting probability.
141  // Usage: getSplittingProb( event, iRad, iEmt, iRec)
142  virtual double getSplittingProb( const Event& , int , int , int , string )
143  { return 0.;}
144 
145  virtual bool allowedSplitting( const Event& , int , int)
146  { return true;}
147  virtual vector<int> getRecoilers( const Event&, int, int, string)
148  { return vector<int>(); }
149 
150  virtual double enhanceFactor(const string& name) {
151  unordered_map<string, double>::iterator it = enhanceISR.find(name);
152  if ( it == enhanceISR.end() ) return 1.;
153  return it->second;
154  }
155 
156  // Functions to directly extract the probability of no emission between two
157  // scales. This functions is not used in the Pythia core code, but can be
158  // used by external programs to interface with the shower directly.
159  virtual double noEmissionProbability( double, double, double, int, int,
160  double, double) { return 1.; }
161 
162  // Pointer to MergingHooks object for NLO merging.
163  MergingHooksPtr mergingHooksPtr{};
164 
165  WeightContainer* weightContainerPtr{};
166 
167 protected:
168 
169  // Beam location offset in event.
170  int beamOffset{};
171 
172  // Pointer to assign space-time vertices during parton evolution.
173  PartonVertexPtr partonVertexPtr{};
174 
175  // Store uncertainty variations relevant to SpaceShower.
176  bool doUncertainties{}, uVarMuSoftCorr{}, uVarMPIshowers{};
177  int nUncertaintyVariations{}, nVarQCD{}, uVarNflavQ{};
178  double dASmax{}, cNSpTmin{}, uVarpTmin2{}, overFactor{};
179  map<int,double> varG2GGmuRfac, varQ2QGmuRfac, varQ2GQmuRfac, varG2QQmuRfac,
180  varX2XGmuRfac, varG2GGcNS, varQ2QGcNS, varQ2GQcNS, varG2QQcNS, varX2XGcNS;
181  map<int,double>* varPDFplus;
182  map<int,double>* varPDFminus;
183  map<int,double>* varPDFmember;
184  unordered_map<string,double> enhanceISR;
185 
186 };
187 
188 //==========================================================================
189 
190 } // end namespace Pythia8
191 
192 #endif // Pythia8_SpaceShower_H
PartonVertexPtr partonVertexPtr
Pointer to assign space-time vertices during parton evolution.
Definition: SpaceShower.h:173
void initPtrs(MergingHooksPtr mergingHooksPtrIn, PartonVertexPtr partonVertexPtrIn, WeightContainer *weightContainerPtrIn)
Definition: SpaceShower.h:44
virtual vector< string > getSplittingName(const Event &, int, int, int)
Definition: SpaceShower.h:137
virtual bool isSpacelike(const Event &, int, int, int, string)
Definition: SpaceShower.h:132
virtual double pTnext(Event &, double, double, int=-1, bool=false)
Definition: SpaceShower.h:76
Definition: PhysicsBase.h:27
virtual bool wasGamma2qqbar()
Tell if latest scattering was a gamma->qqbar.
Definition: SpaceShower.h:96
int beamOffset
Beam location offset in event.
Definition: SpaceShower.h:170
The Event class holds all info on the generated event.
Definition: Event.h:453
Definition: BeamParticle.h:133
Definition: Weights.h:394
virtual double noEmissionProbability(double, double, double, int, int, double, double)
Definition: SpaceShower.h:159
CoupSM * coupSMPtr
Pointers to Standard Model and Beyond SM couplings.
Definition: Info.h:95
virtual map< string, double > getStateVariables(const Event &, int, int, int, string)
Definition: SpaceShower.h:127
bool doUncertainties
Store uncertainty variations relevant to SpaceShower.
Definition: SpaceShower.h:176
virtual int system() const
Tell which system was the last processed one.
Definition: SpaceShower.h:102
virtual bool getHasWeaklyRadiated()
Tell whether ISR has done a weak emission.
Definition: SpaceShower.h:99
virtual bool branch(Event &)
Definition: SpaceShower.h:81
MergingHooksPtr mergingHooksPtr
Pointer to MergingHooks object for NLO merging.
Definition: SpaceShower.h:163
virtual void init(BeamParticle *, BeamParticle *)
Definition: SpaceShower.h:60
virtual void update(int, Event &, bool=false)
Definition: SpaceShower.h:72
virtual double enhancePTmax() const
Potential enhancement factor of pTmax scale for hardest emission.
Definition: SpaceShower.h:105
virtual bool initEnhancements()
Initialize data members for application of enhancements.
Definition: SpaceShower.h:90
virtual Event clustered(const Event &, int, int, int, string)
Return clustering kinematics - as needed for merging.
Definition: SpaceShower.h:116
virtual void prepare(int, Event &, bool=true)
Definition: SpaceShower.h:68
CoupSM * coupSMPtr
Pointers to SM and SUSY couplings.
Definition: PhysicsBase.h:96
void reassignBeamPtrs(BeamParticle *beamAPtrIn, BeamParticle *beamBPtrIn, int beamOffsetIn=0)
New beams possible for handling of hard diffraction. (Not virtual.)
Definition: SpaceShower.h:54
virtual bool initUncertainties()
Initialize data members for calculation of uncertainty bands.
Definition: SpaceShower.h:87
virtual double getSplittingProb(const Event &, int, int, int, string)
Definition: SpaceShower.h:142
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
virtual void list() const
Print dipole list; for debug mainly.
Definition: SpaceShower.h:84
Info * infoPtr
Definition: PhysicsBase.h:78
virtual bool doRestart() const
Flag for failure in branch(...) that will force a retry of parton level.
Definition: SpaceShower.h:93
SpaceShower()=default
Constructor.
The SpaceShower class does spacelike showers.
Definition: SpaceShower.h:33
virtual bool limitPTmax(Event &, double=0., double=0.)
Definition: SpaceShower.h:64
virtual ~SpaceShower()
Destructor.
Definition: SpaceShower.h:40