1 // SpaceShower.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2013 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
6 // Header file for the spacelike initial-state showers.
7 // SpaceDipoleEnd: radiating dipole end in ISR.
8 // SpaceShower: handles the showering description.
10 #ifndef Pythia8_SpaceShower_H
11 #define Pythia8_SpaceShower_H
14 #include "BeamParticle.h"
17 #include "ParticleData.h"
18 #include "PartonSystems.h"
19 #include "PythiaStdlib.h"
21 #include "StandardModel.h"
22 #include "UserHooks.h"
23 #include "MergingHooks.h"
27 //==========================================================================
29 // Data on radiating dipole ends, only used inside SpaceShower.
31 class SpaceDipoleEnd {
36 SpaceDipoleEnd( int systemIn = 0, int sideIn = 0, int iRadiatorIn = 0,
37 int iRecoilerIn = 0, double pTmaxIn = 0., int colTypeIn = 0,
38 int chgTypeIn = 0, int MEtypeIn = 0, bool normalRecoilIn = true) :
39 system(systemIn), side(sideIn), iRadiator(iRadiatorIn),
40 iRecoiler(iRecoilerIn), pTmax(pTmaxIn), colType(colTypeIn),
41 chgType(chgTypeIn), MEtype(MEtypeIn), normalRecoil(normalRecoilIn),
42 nBranch(0), pT2Old(0.), zOld(0.5) { }
44 // Store values for trial emission.
45 void store( int idDaughterIn, int idMotherIn, int idSisterIn,
46 double x1In, double x2In, double m2DipIn, double pT2In, double zIn,
47 double xMoIn, double Q2In, double mSisterIn, double m2SisterIn,
48 double pT2corrIn) {idDaughter = idDaughterIn; idMother = idMotherIn;
49 idSister = idSisterIn; x1 = x1In; x2 = x2In; m2Dip = m2DipIn;
50 pT2 = pT2In; z = zIn; xMo = xMoIn; Q2 = Q2In; mSister = mSisterIn;
51 m2Sister = m2SisterIn; pT2corr = pT2corrIn;}
53 // Basic properties related to evolution and matrix element corrections.
54 int system, side, iRadiator, iRecoiler;
56 int colType, chgType, MEtype;
59 // Properties specific to current trial emission.
60 int nBranch, idDaughter, idMother, idSister, iFinPol;
61 double x1, x2, m2Dip, pT2, z, xMo, Q2, mSister, m2Sister, pT2corr,
62 pT2Old, zOld, asymPol;
66 //==========================================================================
68 // The SpaceShower class does spacelike showers.
75 SpaceShower() {beamOffset = 0;}
78 virtual ~SpaceShower() {}
80 // Initialize various pointers.
81 // (Separated from rest of init since not virtual.)
82 void initPtr(Info* infoPtrIn, Settings* settingsPtrIn,
83 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
84 PartonSystems* partonSystemsPtrIn, UserHooks* userHooksPtrIn,
85 MergingHooks* mergingHooksPtrIn = 0) {
86 infoPtr = infoPtrIn; settingsPtr = settingsPtrIn;
87 particleDataPtr = particleDataPtrIn; rndmPtr = rndmPtrIn;
88 partonSystemsPtr = partonSystemsPtrIn; userHooksPtr = userHooksPtrIn;
89 mergingHooksPtr = mergingHooksPtrIn;}
91 // Initialize generation. Possibility to force re-initialization by hand.
92 virtual void init(BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn);
94 // New beams possible for handling of hard diffraction. (Not virtual.)
95 void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
96 int beamOffsetIn = 0) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
97 beamOffset = beamOffsetIn;}
99 // Find whether to limit maximum scale of emissions, and whether to dampen.
100 virtual bool limitPTmax( Event& event, double Q2Fac = 0.,
103 // Potential enhancement factor of pTmax scale for hardest emission.
104 virtual double enhancePTmax() const {return pTmaxFudge;}
106 // Prepare system for evolution; identify ME.
107 virtual void prepare( int iSys, Event& event, bool limitPTmaxIn = true);
109 // Update dipole list after each FSR emission. Currently superfluous.
110 // Usage: update( iSys, event).
111 virtual void update( int , Event& ) {}
113 // Select next pT in downwards evolution.
114 virtual double pTnext( Event& event, double pTbegAll, double pTendAll,
117 // ME corrections and kinematics that may give failure.
118 virtual bool branch( Event& event);
120 // Tell which system was the last processed one.
121 int system() const {return iSysSel;}
123 // Flag for failure in branch(...) that will force a retry of parton level.
124 bool doRestart() const {return rescatterFail;}
126 // Print dipole list; for debug mainly.
127 virtual void list(ostream& os = cout) const;
131 // Pointer to various information on the generation.
134 // Pointer to the settings database.
135 Settings* settingsPtr;
137 // Pointer to the particle data table.
138 ParticleData* particleDataPtr;
140 // Pointer to the random number generator.
143 // Pointers to the two incoming beams. Offset their location in event.
144 BeamParticle* beamAPtr;
145 BeamParticle* beamBPtr;
148 // Pointer to information on subcollision parton locations.
149 PartonSystems* partonSystemsPtr;
151 // Pointer to userHooks object for user interaction with program.
152 UserHooks* userHooksPtr;
154 // Store properties to be returned by methods.
161 // Constants: could only be changed in the code itself.
162 static const int MAXLOOPTINYPDF;
163 static const double CTHRESHOLD, BTHRESHOLD, EVALPDFSTEP, TINYPDF,
164 TINYKERNELPDF, TINYPT2, HEAVYPT2EVOL, HEAVYXEVOL, EXTRASPACEQ,
165 LAMBDA3MARGIN, PT2MINWARN, LEPTONXMIN, LEPTONXMAX, LEPTONPT2MIN,
168 // Initialization data, normally only set once.
169 bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, useSamePTasMPI,
170 doMEcorrections, doMEafterFirst, doPhiPolAsym, doPhiIntAsym,
171 doRapidityOrder, doSecondHard, canVetoEmission;
172 int pTmaxMatch, pTdampMatch, alphaSorder, alphaEMorder, nQuarkIn,
174 double pTdampFudge, mc, mb, m2c, m2b, renormMultFac, factorMultFac,
175 alphaSvalue, alphaS2pi, Lambda3flav, Lambda4flav, Lambda5flav,
176 Lambda3flav2, Lambda4flav2, Lambda5flav2, pT0Ref, ecmRef, ecmPow,
177 pTmin, sCM, eCM, pT0, pTminChgQ, pTminChgL, pT20, pT2min,
178 pT2minChgQ, pT2minChgL, pTmaxFudgeMPI, strengthIntAsym;
180 // alphaStrong and alphaEM calculations.
184 // Some current values.
185 bool sideA, dopTlimit1, dopTlimit2, dopTdamp;
186 int iNow, iRec, idDaughter, nRad, idResFirst, idResSecond;
187 double xDaughter, x1Now, x2Now, m2Dip, m2Rec, pT2damp, pTbegRef;
190 vector<SpaceDipoleEnd> dipEnd;
192 // Pointers to the current and hardest (so far) dipole ends.
193 int iDipNow, iSysNow;
194 SpaceDipoleEnd* dipEndNow;
196 SpaceDipoleEnd* dipEndSel;
198 // Evolve a QCD dipole end.
199 void pT2nextQCD( double pT2begDip, double pT2endDip);
201 // Evolve a QCD dipole end near heavy quark threshold region.
202 void pT2nearQCDthreshold( BeamParticle& beam, double m2Massive,
203 double m2Threshold, double xMaxAbs, double zMinAbs,
206 // Evolve a QED dipole end.
207 void pT2nextQED( double pT2begDip, double pT2endDip);
209 // Find class of ME correction.
210 int findMEtype( int iSys, Event& event);
212 // Provide maximum of expected ME weight; for preweighting of evolution.
213 double calcMEmax( int MEtype, int idMother, int idDaughterIn);
215 // Provide actual ME weight for current branching.
216 double calcMEcorr(int MEtype, int idMother, int idDaughterIn, double M2,
217 double z, double Q2);
219 // Find coefficient of azimuthal asymmetry from gluon polarization.
220 void findAsymPol( Event& event, SpaceDipoleEnd* dip);
222 // Pointer to MergingHooks object for NLO merging.
223 MergingHooks* mergingHooksPtr;
227 //==========================================================================
229 } // end namespace Pythia8
231 #endif // Pythia8_SpaceShower_H