![]() |
|
|||
File indexing completed on 2025-09-17 09:08:33
0001 // TimeShower.h is a part of the PYTHIA event generator. 0002 // Copyright (C) 2025 Torbjorn Sjostrand. 0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details. 0004 // Please respect the MCnet Guidelines, see GUIDELINES for details. 0005 0006 // Header file for the base class of timelike final-state showers. 0007 // TimeShower: handles the showering description. 0008 0009 #ifndef Pythia8_TimeShower_H 0010 #define Pythia8_TimeShower_H 0011 0012 #include "Pythia8/Basics.h" 0013 #include "Pythia8/BeamParticle.h" 0014 #include "Pythia8/Event.h" 0015 #include "Pythia8/Info.h" 0016 #include "Pythia8/ParticleData.h" 0017 #include "Pythia8/PartonSystems.h" 0018 #include "Pythia8/PhysicsBase.h" 0019 #include "Pythia8/PythiaStdlib.h" 0020 #include "Pythia8/PartonVertex.h" 0021 #include "Pythia8/Settings.h" 0022 #include "Pythia8/StandardModel.h" 0023 #include "Pythia8/UserHooks.h" 0024 #include "Pythia8/MergingHooks.h" 0025 #include "Pythia8/Weights.h" 0026 0027 namespace Pythia8 { 0028 0029 //========================================================================== 0030 0031 // The TimeShower class does timelike showers. 0032 0033 class TimeShower : public PhysicsBase { 0034 0035 public: 0036 0037 // Constructor. 0038 TimeShower() = default; 0039 0040 // Destructor. 0041 virtual ~TimeShower() {} 0042 0043 // Initialize various pointers. 0044 // (Separated from rest of init since not virtual.) 0045 void initPtrs(MergingHooksPtr mergingHooksPtrIn, 0046 PartonVertexPtr partonVertexPtrIn, 0047 WeightContainer* weightContainerPtrIn) { 0048 coupSMPtr = infoPtr->coupSMPtr; 0049 mergingHooksPtr = mergingHooksPtrIn; 0050 partonVertexPtr = partonVertexPtrIn; 0051 weightContainerPtr = weightContainerPtrIn; 0052 } 0053 0054 // New beams possible for handling of hard diffraction. (Not virtual.) 0055 void reassignBeamPtrs( BeamParticle* beamAPtrIn, 0056 BeamParticle* beamBPtrIn, int beamOffsetIn = 0) { 0057 beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn; beamOffset = beamOffsetIn;} 0058 0059 // Initialize alphaStrong and related pTmin parameters. 0060 // Usage: init( beamAPtr, beamBPtr). 0061 virtual void init( BeamParticle* = nullptr, BeamParticle* = nullptr) {} 0062 0063 // Find whether to limit maximum scale of emissions, and whether to dampen. 0064 // Usage: limitPTmax( event, Q2Fac, double Q2Ren). 0065 virtual bool limitPTmax( Event& , double = 0., double = 0.) {return true;} 0066 0067 // Top-level routine to do a full time-like shower in resonance decay. 0068 // Usage: shower( iBeg, iEnd, event, pTmax, nBranchMax). 0069 virtual int shower( int , int , Event& , double , int = 0) {return 0;} 0070 0071 // Top-level routine for QED radiation in hadronic decays. 0072 // Usage: showerQED( i1, i2, event, pTmax). 0073 virtual int showerQED( int , int , Event& , double = -1.) {return 0;} 0074 0075 // Optional method to add QED showers after remnants have been added 0076 // but before hadronisation. (Called from PartonLevel.) 0077 virtual int showerQEDafterRemnants(Event&) { return 0; } 0078 0079 // Optional method to add QED showers after all hadron decays have been 0080 // treated, as an alternative to handling QED showers inside each decay. 0081 virtual int showerQEDafterDecays( int , int , Event&) { return 0; } 0082 0083 // Prepare process-level event for shower + interleaved resonance decays. 0084 // Usage: prepareProcess( process, event, iPos). 0085 // iPos provides mapping from process to event entries (before showering). 0086 virtual void prepareProcess( Event&, Event&, vector<int>&) {}; 0087 0088 // Global recoil: reset counters and store locations of outgoing partons. 0089 // Usage: prepareGlobal( event). 0090 virtual void prepareGlobal( Event& ) {} 0091 0092 // Prepare system for evolution after each new interaction; identify ME. 0093 // Usage: prepare( iSys, event, limitPTmax). 0094 virtual void prepare( int , Event& , bool = true) {} 0095 0096 // Update dipole list after a multiparton interactions rescattering. 0097 // Usage: rescatterUpdate( iSys, event). 0098 virtual void rescatterUpdate( int , Event& ) {} 0099 0100 // Update dipole list after each ISR emission. 0101 // Usage: update( iSys, event, hasWeakRad). 0102 virtual void update( int , Event& , bool = false) {} 0103 0104 // Select next pT in downwards evolution. 0105 // Usage: pTnext( event, pTbegAll, pTendAll, isFirstTrial, doTrialIn). 0106 virtual double pTnext( Event& , double , double , bool = false, bool = false) 0107 { return 0.;} 0108 0109 // Select next pT for interleaved resonance decays. 0110 virtual double pTnextResDec() { return 0.; } 0111 0112 // ME corrections and kinematics that may give failure. 0113 // Usage: branch( event, isInterleaved). 0114 virtual bool branch( Event& , bool = false) {return true;} 0115 0116 // Handle a resonance decay + resonance shower (including any nested decays). 0117 // Assumes decay channel and kinematics already selected and present in 0118 // either the process or event record. 0119 // May be called recursively for nested decays. 0120 // Usage: resonanceShower( process, event, iPos, pTmerge), where iPos 0121 // maps process to event entries, and pTmerge is the scale at which this 0122 // system should be merged into its parent system. 0123 virtual bool resonanceShower( Event&, Event&, vector<int>&, double = 0.) 0124 { return false;} 0125 0126 // Print dipole list; for debug mainly. 0127 virtual void list() const {} 0128 0129 // Initialize data members for calculation of uncertainty bands. 0130 virtual bool initUncertainties() {return false;} 0131 0132 // Initialize data members for application of enhancements. 0133 virtual bool initEnhancements() {return false;} 0134 0135 // Tell whether FSR has done a weak emission. 0136 virtual bool getHasWeaklyRadiated() {return false;} 0137 0138 // Tell which system was the last processed one. 0139 virtual int system() const {return 0;} 0140 0141 // Potential enhancement factor of pTmax scale for hardest emission. 0142 virtual double enhancePTmax() {return 1.;} 0143 0144 // Provide the pT scale of the last branching in the above shower. 0145 virtual double pTLastInShower() {return 0.;} 0146 0147 // Functions to allow usage of shower kinematics, evolution variables, 0148 // and splitting probabilities outside of shower. 0149 // Virtual so that shower plugins can overwrite these functions. 0150 // This makes it possible for another piece of the code to request 0151 // these - which is very convenient for merging. 0152 // Function variable names are not included to avoid compiler warnings. 0153 // Please see the documentation under "Implement New Showers" for details. 0154 0155 // Return clustering kinematics - as needed for merging. 0156 virtual Event clustered( const Event& , int , int , int , string ) 0157 { return Event();} 0158 0159 // Return the evolution variable(s). 0160 // Important note: this map must contain the following entries 0161 // - a key "t" for the value of the shower evolution variable; 0162 // - a key "tRS" for the value of the shower evolution variable 0163 // from which the shower would be restarted after a branching; 0164 // - a key "scaleAS" for the argument of alpha_s used for the branching; 0165 // - a key "scalePDF" for the argument of the PDFs used for the branching. 0166 // Usage: getStateVariables( event, iRad, iEmt, iRec, name) 0167 virtual map<string, double> getStateVariables (const Event& , int , int , 0168 int , string ) { return map<string,double>();} 0169 0170 // Check if attempted clustering is handled by timelike shower 0171 // Usage: isTimelike( event, iRad, iEmt, iRec, name) 0172 virtual bool isTimelike(const Event& , int , int , int , string ) 0173 { return false; } 0174 0175 // Return a string identifier of a splitting. 0176 // Usage: getSplittingName( event, iRad, iEmt, iRec) 0177 virtual vector<string> getSplittingName( const Event& , int, int , int) 0178 { return vector<string>();} 0179 0180 // Return the splitting probability. 0181 // Usage: getSplittingProb( event, iRad, iEmt, iRec) 0182 virtual double getSplittingProb( const Event& , int , int , int , string ) 0183 { return 0.;} 0184 virtual bool allowedSplitting( const Event& , int , int) 0185 { return true; } 0186 virtual vector<int> getRecoilers( const Event&, int, int, string) 0187 { return vector<int>(); } 0188 0189 virtual double enhanceFactor(const string& name) { 0190 unordered_map<string, double>::iterator it = enhanceFSR.find(name); 0191 if ( it == enhanceFSR.end() ) return 1.; 0192 return it->second; 0193 } 0194 0195 // Functions to directly extract the probability of no emission between two 0196 // scales. This functions is not used in the Pythia core code, but can be 0197 // used by external programs to interface with the shower directly. 0198 virtual double noEmissionProbability( double, double, double, int, int, 0199 double, double) { return 1.; } 0200 0201 // Pointer to MergingHooks object for NLO merging. 0202 MergingHooksPtr mergingHooksPtr{}; 0203 0204 WeightContainer* weightContainerPtr{}; 0205 0206 protected: 0207 0208 // Beam location offset in event. 0209 int beamOffset{}; 0210 0211 // Pointer to assign space-time vertices during parton evolution. 0212 PartonVertexPtr partonVertexPtr{}; 0213 0214 // Store uncertainty variations relevant to TimeShower. 0215 bool doUncertainties{}, uVarMuSoftCorr{}, uVarMPIshowers{}, 0216 noResVariations{}, noProcVariations{}; 0217 int nUncertaintyVariations{}, nVarQCD{}, uVarNflavQ{}; 0218 double dASmax{}, cNSpTmin{}, uVarpTmin2{}, overFactor{}, overFactorEnhance{}; 0219 map<int,double> varG2GGmuRfac, varQ2QGmuRfac, varG2QQmuRfac, varX2XGmuRfac, 0220 varG2GGcNS, varQ2QGcNS, varG2QQcNS, varX2XGcNS; 0221 map<int,double>* varPDFplus; 0222 map<int,double>* varPDFminus; 0223 map<int,double>* varPDFmember; 0224 unordered_map<string,double> enhanceFSR; 0225 0226 }; 0227 0228 //========================================================================== 0229 0230 } // end namespace Pythia8 0231 0232 #endif // Pythia8_TimeShower_H
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |