StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TimeShower.h
1 // TimeShower.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 timelike final-state showers.
7 // TimeShower: handles the showering description.
8 
9 #ifndef Pythia8_TimeShower_H
10 #define Pythia8_TimeShower_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/PhysicsBase.h"
19 #include "Pythia8/PythiaStdlib.h"
20 #include "Pythia8/PartonVertex.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 TimeShower class does timelike showers.
32 
33 class TimeShower : public PhysicsBase {
34 
35 public:
36 
37  // Constructor.
38  TimeShower() = default;
39 
40  // Destructor.
41  virtual ~TimeShower() {}
42 
43  // Initialize various pointers.
44  // (Separated from rest of init since not virtual.)
45  void initPtrs(MergingHooksPtr mergingHooksPtrIn,
46  PartonVertexPtr partonVertexPtrIn,
47  WeightContainer* weightContainerPtrIn) {
48  coupSMPtr = infoPtr->coupSMPtr;
49  mergingHooksPtr = mergingHooksPtrIn;
50  partonVertexPtr = partonVertexPtrIn;
51  weightContainerPtr = weightContainerPtrIn;
52  }
53 
54  // New beams possible for handling of hard diffraction. (Not virtual.)
55  void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
56  int beamOffsetIn = 0) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
57  beamOffset = beamOffsetIn;}
58 
59  // Initialize alphaStrong and related pTmin parameters.
60  // Usage: init( beamAPtr, beamBPtr).
61  virtual void init( BeamParticle* = 0, BeamParticle* = 0) {}
62 
63  // Find whether to limit maximum scale of emissions, and whether to dampen.
64  // Usage: limitPTmax( event, Q2Fac, double Q2Ren).
65  virtual bool limitPTmax( Event& , double = 0., double = 0.) {return true;}
66 
67  // Top-level routine to do a full time-like shower in resonance decay.
68  // Usage: shower( iBeg, iEnd, event, pTmax, nBranchMax).
69  virtual int shower( int , int , Event& , double , int = 0) {return 0;}
70 
71  // Top-level routine for QED radiation in hadronic decay to two leptons.
72  // Usage: showerQED( i1, i2, event, pTmax).
73  virtual int showerQED( int , int , Event& , double ) {return 0;}
74 
75  // Optional method to add QED showers after remnants have been added
76  // but before hadronisation. (Called from PartonLevel.)
77  virtual int showerQEDafterRemnants(Event&) { return 0; }
78 
79  // Global recoil: reset counters and store locations of outgoing partons.
80  // Usage: prepareGlobal( event).
81  virtual void prepareGlobal( Event& ) {}
82 
83  // Prepare system for evolution after each new interaction; identify ME.
84  // Usage: prepare( iSys, event, limitPTmax).
85  virtual void prepare( int , Event& , bool = true) {}
86 
87  // Update dipole list after a multiparton interactions rescattering.
88  // Usage: rescatterUpdate( iSys, event).
89  virtual void rescatterUpdate( int , Event& ) {}
90 
91  // Update dipole list after each ISR emission.
92  // Usage: update( iSys, event, hasWeakRad).
93  virtual void update( int , Event& , bool = false) {}
94 
95  // Select next pT in downwards evolution.
96  // Usage: pTnext( event, pTbegAll, pTendAll, isFirstTrial, doTrialIn).
97  virtual double pTnext( Event& , double , double , bool = false, bool = false)
98  { return 0.;}
99 
100  // ME corrections and kinematics that may give failure.
101  // Usage: branch( event, isInterleaved).
102  virtual bool branch( Event& , bool = false) {return true;}
103 
104  // Print dipole list; for debug mainly.
105  virtual void list() const {}
106 
107  // Initialize data members for calculation of uncertainty bands.
108  virtual bool initUncertainties() {return false;}
109 
110  // Tell whether FSR has done a weak emission.
111  virtual bool getHasWeaklyRadiated() {return false;}
112 
113  // Tell which system was the last processed one.
114  virtual int system() const {return 0;}
115 
116  // Potential enhancement factor of pTmax scale for hardest emission.
117  virtual double enhancePTmax() {return 1.;}
118 
119  // Provide the pT scale of the last branching in the above shower.
120  virtual double pTLastInShower() {return 0.;}
121 
122  // Functions to allow usage of shower kinematics, evolution variables,
123  // and splitting probabilities outside of shower.
124  // Virtual so that shower plugins can overwrite these functions.
125  // This makes it possible for another piece of the code to request
126  // these - which is very convenient for merging.
127  // Function variable names are not included to avoid compiler warnings.
128  // Please see the documentation under "Implement New Showers" for details.
129 
130  // Return clustering kinematics - as needed for merging.
131  virtual Event clustered( const Event& , int , int , int , string )
132  { return Event();}
133 
134  // Return the evolution variable(s).
135  // Important note: this map must contain the following entries
136  // - a key "t" for the value of the shower evolution variable;
137  // - a key "tRS" for the value of the shower evolution variable
138  // from which the shower would be restarted after a branching;
139  // - a key "scaleAS" for the argument of alpha_s used for the branching;
140  // - a key "scalePDF" for the argument of the PDFs used for the branching.
141  // Usage: getStateVariables( event, iRad, iEmt, iRec, name)
142  virtual map<string, double> getStateVariables (const Event& , int , int ,
143  int , string ) { return map<string,double>();}
144 
145  // Check if attempted clustering is handled by timelike shower
146  // Usage: isTimelike( event, iRad, iEmt, iRec, name)
147  virtual bool isTimelike(const Event& , int , int , int , string )
148  { return false; }
149 
150  // Return a string identifier of a splitting.
151  // Usage: getSplittingName( event, iRad, iEmt, iRec)
152  virtual vector<string> getSplittingName( const Event& , int, int , int)
153  { return vector<string>();}
154 
155  // Return the splitting probability.
156  // Usage: getSplittingProb( event, iRad, iEmt, iRec)
157  virtual double getSplittingProb( const Event& , int , int , int , string )
158  { return 0.;}
159  virtual bool allowedSplitting( const Event& , int , int)
160  { return true; }
161  virtual vector<int> getRecoilers( const Event&, int, int, string)
162  { return vector<int>(); }
163 
164  // Pointer to MergingHooks object for NLO merging.
165  MergingHooksPtr mergingHooksPtr{};
166 
167  WeightContainer* weightContainerPtr{};
168 
169 protected:
170 
171  // Beam location offset in event.
172  int beamOffset{};
173 
174  // Pointer to assign space-time vertices during parton evolution.
175  PartonVertexPtr partonVertexPtr{};
176 
177  // Store uncertainty variations relevant to TimeShower.
178  bool doUncertainties{}, uVarMuSoftCorr{}, uVarMPIshowers{},
179  noResVariations{}, noProcVariations{};
180  int nUncertaintyVariations{}, nVarQCD{}, uVarNflavQ{};
181  double dASmax{}, cNSpTmin{}, uVarpTmin2{}, overFactor{};
182  map<int,double> varG2GGmuRfac, varQ2QGmuRfac, varG2QQmuRfac, varX2XGmuRfac,
183  varG2GGcNS, varQ2QGcNS, varG2QQcNS, varX2XGcNS;
184  map<int,double>* varPDFplus;
185  map<int,double>* varPDFminus;
186  map<int,double>* varPDFmember;
187 
188 };
189 
190 //==========================================================================
191 
192 } // end namespace Pythia8
193 
194 #endif // Pythia8_TimeShower_H
Definition: AgUStep.h:26