StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SpaceShower.h
1 // SpaceShower.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 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) {
47  coupSMPtr = infoPtr->coupSMPtr;
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  // Flag for failure in branch(...) that will force a retry of parton level.
90  virtual bool doRestart() const {return false;}
91 
92  // Tell if latest scattering was a gamma->qqbar.
93  virtual bool wasGamma2qqbar() { return false; }
94 
95  // Tell whether ISR has done a weak emission.
96  virtual bool getHasWeaklyRadiated() {return false;}
97 
98  // Tell which system was the last processed one.
99  virtual int system() const {return 0;}
100 
101  // Potential enhancement factor of pTmax scale for hardest emission.
102  virtual double enhancePTmax() const {return 1.;}
103 
104  // Functions to allow usage of shower kinematics, evolution variables,
105  // and splitting probabilities outside of shower.
106  // Virtual so that shower plugins can overwrite these functions.
107  // This makes it possible for another piece of the code to request
108  // these - which is very convenient for merging.
109  // Function variable names are not included to avoid compiler warnings.
110  // Please see the documentation under "Implement New Showers" for details.
111 
112  // Return clustering kinematics - as needed for merging.
113  virtual Event clustered( const Event& , int , int , int , string )
114  { return Event();}
115 
116  // Return the evolution variable(s).
117  // Important note: this map must contain the following entries
118  // - a key "t" for the value of the shower evolution variable;
119  // - a key "tRS" for the value of the shower evolution variable
120  // from which the shower would be restarted after a branching;
121  // - a key "scaleAS" for the argument of alpha_s used for the branching;
122  // - a key "scalePDF" for the argument of the PDFs used for the branching.
123  // Usage: getStateVariables( event, iRad, iEmt, iRec, name)
124  virtual map<string, double> getStateVariables (const Event& , int , int ,
125  int , string ) { return map<string,double>();}
126 
127  // Check if attempted clustering is handled by spacelike shower.
128  // Usage: isSpacelike( event, iRad, iEmt, iRec, name)
129  virtual bool isSpacelike(const Event&, int, int, int, string)
130  { return false; }
131 
132  // Return a string identifier of a splitting.
133  // Usage: getSplittingName( event, iRad, iEmt, iRec)
134  virtual vector<string> getSplittingName( const Event& , int , int , int )
135  { return vector<string>();}
136 
137  // Return the splitting probability.
138  // Usage: getSplittingProb( event, iRad, iEmt, iRec)
139  virtual double getSplittingProb( const Event& , int , int , int , string )
140  { return 0.;}
141 
142  virtual bool allowedSplitting( const Event& , int , int)
143  { return true;}
144  virtual vector<int> getRecoilers( const Event&, int, int, string)
145  { return vector<int>(); }
146 
147  // Pointer to MergingHooks object for NLO merging.
148  MergingHooksPtr mergingHooksPtr{};
149 
150  WeightContainer* weightContainerPtr{};
151 
152 protected:
153 
154  // Beam location offset in event.
155  int beamOffset{};
156 
157  // Pointer to assign space-time vertices during parton evolution.
158  PartonVertexPtr partonVertexPtr{};
159 
160  // Store uncertainty variations relevant to SpaceShower.
161  bool doUncertainties{}, uVarMuSoftCorr{}, uVarMPIshowers{};
162  int nUncertaintyVariations{}, nVarQCD{}, uVarNflavQ{};
163  double dASmax{}, cNSpTmin{}, uVarpTmin2{}, overFactor{};
164  map<int,double> varG2GGmuRfac, varQ2QGmuRfac, varQ2GQmuRfac, varG2QQmuRfac,
165  varX2XGmuRfac, varG2GGcNS, varQ2QGcNS, varQ2GQcNS, varG2QQcNS, varX2XGcNS;
166  map<int,double>* varPDFplus;
167  map<int,double>* varPDFminus;
168  map<int,double>* varPDFmember;
169 
170 };
171 
172 //==========================================================================
173 
174 } // end namespace Pythia8
175 
176 #endif // Pythia8_SpaceShower_H
Definition: AgUStep.h:26