1 // SpaceShower.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2012 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"
26 //==========================================================================
28 // Data on radiating dipole ends, only used inside SpaceShower.
30 class SpaceDipoleEnd {
35 SpaceDipoleEnd( int systemIn = 0, int sideIn = 0, int iRadiatorIn = 0,
36 int iRecoilerIn = 0, double pTmaxIn = 0., int colTypeIn = 0,
37 int chgTypeIn = 0, int MEtypeIn = 0, bool normalRecoilIn = true) :
38 system(systemIn), side(sideIn), iRadiator(iRadiatorIn),
39 iRecoiler(iRecoilerIn), pTmax(pTmaxIn), colType(colTypeIn),
40 chgType(chgTypeIn), MEtype(MEtypeIn), normalRecoil(normalRecoilIn),
41 nBranch(0), pT2Old(0.), zOld(0.5) { }
43 // Store values for trial emission.
44 void store( int idDaughterIn, int idMotherIn, int idSisterIn,
45 double x1In, double x2In, double m2DipIn, double pT2In, double zIn,
46 double xMoIn, double Q2In, double mSisterIn, double m2SisterIn,
47 double pT2corrIn) {idDaughter = idDaughterIn; idMother = idMotherIn;
48 idSister = idSisterIn; x1 = x1In; x2 = x2In; m2Dip = m2DipIn;
49 pT2 = pT2In; z = zIn; xMo = xMoIn; Q2 = Q2In; mSister = mSisterIn;
50 m2Sister = m2SisterIn; pT2corr = pT2corrIn;}
52 // Basic properties related to evolution and matrix element corrections.
53 int system, side, iRadiator, iRecoiler;
55 int colType, chgType, MEtype;
58 // Properties specific to current trial emission.
59 int nBranch, idDaughter, idMother, idSister, iFinPol;
60 double x1, x2, m2Dip, pT2, z, xMo, Q2, mSister, m2Sister, pT2corr,
61 pT2Old, zOld, asymPol;
65 //==========================================================================
67 // The SpaceShower class does spacelike showers.
74 SpaceShower() {beamOffset = 0;}
77 virtual ~SpaceShower() {}
79 // Initialize various pointers.
80 // (Separated from rest of init since not virtual.)
81 void initPtr(Info* infoPtrIn, Settings* settingsPtrIn,
82 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
83 PartonSystems* partonSystemsPtrIn, UserHooks* userHooksPtrIn) {
84 infoPtr = infoPtrIn; settingsPtr = settingsPtrIn;
85 particleDataPtr = particleDataPtrIn; rndmPtr = rndmPtrIn;
86 partonSystemsPtr = partonSystemsPtrIn; userHooksPtr = userHooksPtrIn;}
88 // Initialize generation. Possibility to force re-initialization by hand.
89 virtual void init(BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn);
91 // New beams possible for handling of hard diffraction. (Not virtual.)
92 void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
93 int beamOffsetIn = 0) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
94 beamOffset = beamOffsetIn;}
96 // Find whether to limit maximum scale of emissions, and whether to dampen.
97 virtual bool limitPTmax( Event& event, double Q2Fac = 0.,
100 // Potential enhancement factor of pTmax scale for hardest emission.
101 virtual double enhancePTmax() const {return pTmaxFudge;}
103 // Prepare system for evolution; identify ME.
104 virtual void prepare( int iSys, Event& event, bool limitPTmaxIn = true);
106 // Update dipole list after each FSR emission. Currently superfluous.
107 // Usage: update( iSys, event).
108 virtual void update( int , Event& ) {}
110 // Select next pT in downwards evolution.
111 virtual double pTnext( Event& event, double pTbegAll, double pTendAll,
114 // ME corrections and kinematics that may give failure.
115 virtual bool branch( Event& event);
117 // Tell which system was the last processed one.
118 int system() const {return iSysSel;}
120 // Flag for failure in branch(...) that will force a retry of parton level.
121 bool doRestart() const {return rescatterFail;}
123 // Print dipole list; for debug mainly.
124 virtual void list(ostream& os = cout) const;
128 // Pointer to various information on the generation.
131 // Pointer to the settings database.
132 Settings* settingsPtr;
134 // Pointer to the particle data table.
135 ParticleData* particleDataPtr;
137 // Pointer to the random number generator.
140 // Pointers to the two incoming beams. Offset their location in event.
141 BeamParticle* beamAPtr;
142 BeamParticle* beamBPtr;
145 // Pointer to information on subcollision parton locations.
146 PartonSystems* partonSystemsPtr;
148 // Pointer to userHooks object for user interaction with program.
149 UserHooks* userHooksPtr;
151 // Store properties to be returned by methods.
158 // Constants: could only be changed in the code itself.
159 static const int MAXLOOPTINYPDF;
160 static const double CTHRESHOLD, BTHRESHOLD, EVALPDFSTEP, TINYPDF,
161 TINYKERNELPDF, TINYPT2, HEAVYPT2EVOL, HEAVYXEVOL, EXTRASPACEQ,
162 LAMBDA3MARGIN, PT2MINWARN, LEPTONXMIN, LEPTONXMAX, LEPTONPT2MIN,
165 // Initialization data, normally only set once.
166 bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, useSamePTasMPI,
167 doMEcorrections, doMEafterFirst, doPhiPolAsym, doPhiIntAsym,
168 doRapidityOrder, canVetoEmission;
169 int pTmaxMatch, pTdampMatch, alphaSorder, alphaEMorder, nQuarkIn,
171 double pTdampFudge, mc, mb, m2c, m2b, renormMultFac, factorMultFac,
172 alphaSvalue, alphaS2pi, Lambda3flav, Lambda4flav, Lambda5flav,
173 Lambda3flav2, Lambda4flav2, Lambda5flav2, pT0Ref, ecmRef, ecmPow,
174 pTmin, sCM, eCM, pT0, pTminChgQ, pTminChgL, pT20, pT2min,
175 pT2minChgQ, pT2minChgL, pTmaxFudgeMPI, strengthIntAsym;
177 // alphaStrong and alphaEM calculations.
181 // Some current values.
182 bool sideA, dopTdamp;
183 int iNow, iRec, idDaughter, nRad, idResFirst, idResSecond;
184 double xDaughter, x1Now, x2Now, m2Dip, m2Rec, pT2damp, pTbegRef;
187 vector<SpaceDipoleEnd> dipEnd;
189 // Pointers to the current and hardest (so far) dipole ends.
190 int iDipNow, iSysNow;
191 SpaceDipoleEnd* dipEndNow;
193 SpaceDipoleEnd* dipEndSel;
195 // Evolve a QCD dipole end.
196 void pT2nextQCD( double pT2begDip, double pT2endDip);
198 // Evolve a QCD dipole end near heavy quark threshold region.
199 void pT2nearQCDthreshold( BeamParticle& beam, double m2Massive,
200 double m2Threshold, double xMaxAbs, double zMinAbs,
203 // Evolve a QED dipole end.
204 void pT2nextQED( double pT2begDip, double pT2endDip);
206 // Find class of ME correction.
207 int findMEtype( int iSys, Event& event);
209 // Provide maximum of expected ME weight; for preweighting of evolution.
210 double calcMEmax( int MEtype, int idMother, int idDaughterIn);
212 // Provide actual ME weight for current branching.
213 double calcMEcorr(int MEtype, int idMother, int idDaughterIn, double M2,
214 double z, double Q2);
216 // Find coefficient of azimuthal asymmetry from gluon polarization.
217 void findAsymPol( Event& event, SpaceDipoleEnd* dip);
221 //==========================================================================
223 } // end namespace Pythia8
225 #endif // Pythia8_SpaceShower_H