1 // SpaceShower.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2010 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),
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.
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 {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;}
95 // Find whether to limit maximum scale of emissions, and whether to dampen.
96 virtual bool limitPTmax( Event& event, double Q2Fac = 0.,
99 // Potential enhancement factor of pTmax scale for hardest emission.
100 virtual double enhancePTmax() const {return pTmaxFudge;}
102 // Prepare system for evolution; identify ME.
103 virtual void prepare( int iSys, Event& event, bool limitPTmaxIn = true);
105 // Update dipole list after each FSR emission. Currently superfluous.
106 // Usage: update( iSys, event).
107 virtual void update( int , Event& ) {}
109 // Select next pT in downwards evolution.
110 virtual double pTnext( Event& event, double pTbegAll, double pTendAll,
113 // ME corrections and kinematics that may give failure.
114 virtual bool branch( Event& event);
116 // Tell which system was the last processed one.
117 int system() const {return iSysSel;}
119 // Flag for failure in branch(...) that will force a retry of parton level.
120 bool doRestart() const {return rescatterFail;}
122 // Print dipole list; for debug mainly.
123 virtual void list(ostream& os = cout) const;
127 // Pointer to various information on the generation.
130 // Pointer to the settings database.
131 Settings* settingsPtr;
133 // Pointer to the particle data table.
134 ParticleData* particleDataPtr;
136 // Pointer to the random number generator.
139 // Pointers to the two incoming beams.
140 BeamParticle* beamAPtr;
141 BeamParticle* beamBPtr;
143 // Pointer to information on subcollision parton locations.
144 PartonSystems* partonSystemsPtr;
146 // Pointer to userHooks object for user interaction with program.
147 UserHooks* userHooksPtr;
149 // Store properties to be returned by methods.
156 // Constants: could only be changed in the code itself.
157 static const bool DEBUG;
158 static const int MAXLOOPTINYPDF;
159 static const double CTHRESHOLD, BTHRESHOLD, EVALPDFSTEP, TINYPDF,
160 TINYKERNELPDF, TINYPT2, HEAVYPT2EVOL, HEAVYXEVOL, EXTRASPACEQ,
161 LAMBDA3MARGIN, LEPTONXMIN, LEPTONXMAX, LEPTONPT2MIN, LEPTONFUDGE;
163 // Initialization data, normally only set once.
164 bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, useSamePTasMI,
165 doMEcorrections, doPhiPolAsym, doPhiIntAsym, doRapidityOrder,
167 int pTmaxMatch, pTdampMatch, alphaSorder, alphaEMorder, nQuarkIn,
169 double pTdampFudge, mc, mb, m2c, m2b, alphaSvalue, alphaS2pi,
170 Lambda3flav, Lambda4flav, Lambda5flav, Lambda3flav2, Lambda4flav2,
171 Lambda5flav2, pT0Ref, ecmRef, ecmPow, pTmin, sCM, eCM, pT0,
172 pTminChgQ, pTminChgL, pT20, pT2min, pT2minChgQ, pT2minChgL,
173 pTmaxFudgeMI, strengthIntAsym;
175 // alphaStrong and alphaEM calculations.
179 // Some current values.
180 bool sideA, dopTdamp;
181 int iNow, iRec, idDaughter, nRad, idResFirst, idResSecond;
182 double xDaughter, x1Now, x2Now, m2Dip, m2Rec, pT2damp, pTbegRef;
185 vector<SpaceDipoleEnd> dipEnd;
187 // Pointers to the current and hardest (so far) dipole ends.
188 int iDipNow, iSysNow;
189 SpaceDipoleEnd* dipEndNow;
191 SpaceDipoleEnd* dipEndSel;
193 // Evolve a QCD dipole end.
194 void pT2nextQCD( double pT2begDip, double pT2endDip);
196 // Evolve a QCD dipole end near heavy quark threshold region.
197 void pT2nearQCDthreshold( BeamParticle& beam, double m2Massive,
198 double m2Threshold, double xMaxAbs, double zMinAbs,
201 // Evolve a QED dipole end.
202 void pT2nextQED( double pT2begDip, double pT2endDip);
204 // Find class of ME correction.
205 int findMEtype( int iSys, Event& event);
207 // Provide maximum of expected ME weight; for preweighting of evolution.
208 double calcMEmax( int MEtype, int idMother, int idDaughterIn);
210 // Provide actual ME weight for current branching.
211 double calcMEcorr(int MEtype, int idMother, int idDaughterIn, double M2,
212 double z, double Q2);
214 // Find coefficient of azimuthal asymmetry from gluon polarization.
215 void findAsymPol( Event& event, SpaceDipoleEnd* dip);
219 //==========================================================================
221 } // end namespace Pythia8
223 #endif // Pythia8_SpaceShower_H