1 // TimeShower.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 timelike final-state showers.
7 // TimeDipoleEnd: data on a radiating dipole end.
8 // TimeShower: handles the showering description.
10 #ifndef Pythia8_TimeShower_H
11 #define Pythia8_TimeShower_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 TimeShower class.
35 TimeDipoleEnd() : iRadiator(-1), iRecoiler(-1), pTmax(0.), colType(0),
36 chgType(0), gamType(0), isrType(0), system(0), systemRec(0), MEtype(0),
37 iMEpartner(-1), isOctetOnium(false), isHiddenValley(false), colvType(0),
38 MEmix(0.), MEorder(true), MEsplit(true), MEgluinoRec(false),
40 TimeDipoleEnd(int iRadiatorIn, int iRecoilerIn, double pTmaxIn = 0.,
41 int colIn = 0, int chgIn = 0, int gamIn = 0, int isrIn = 0,
42 int systemIn = 0, int MEtypeIn = 0, int iMEpartnerIn = -1,
43 bool isOctetOniumIn = false, bool isHiddenValleyIn = false,
44 int colvTypeIn = 0, double MEmixIn = 0., bool MEorderIn = true,
45 bool MEsplitIn = true, bool MEgluinoRecIn = false,
46 bool isFlexibleIn = false) :
47 iRadiator(iRadiatorIn), iRecoiler(iRecoilerIn), pTmax(pTmaxIn),
48 colType(colIn), chgType(chgIn), gamType(gamIn), isrType(isrIn),
49 system(systemIn), systemRec(systemIn) , MEtype(MEtypeIn),
50 iMEpartner(iMEpartnerIn), isOctetOnium(isOctetOniumIn),
51 isHiddenValley(isHiddenValleyIn), colvType(colvTypeIn), MEmix(MEmixIn),
52 MEorder (MEorderIn), MEsplit(MEsplitIn), MEgluinoRec(MEgluinoRecIn),
53 isFlexible(isFlexibleIn) { }
55 // Basic properties related to dipole and matrix element corrections.
56 int iRadiator, iRecoiler;
58 int colType, chgType, gamType, isrType, system, systemRec,
60 bool isOctetOnium, isHiddenValley;
63 bool MEorder, MEsplit, MEgluinoRec;
66 // Properties specific to current trial emission.
68 double mRad, m2Rad, mRec, m2Rec, mDip, m2Dip, m2DipCorr,
69 pT2, m2, z, mFlavour, asymPol, flexFactor;
73 //==========================================================================
75 // The TimeShower class does timelike showers.
82 TimeShower() {beamOffset = 0;}
85 virtual ~TimeShower() {}
87 // Initialize various pointers.
88 // (Separated from rest of init since not virtual.)
89 void initPtr(Info* infoPtrIn, Settings* settingsPtrIn,
90 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
91 CoupSM* coupSMPtrIn, PartonSystems* partonSystemsPtrIn,
92 UserHooks* userHooksPtrIn) { infoPtr = infoPtrIn;
93 settingsPtr = settingsPtrIn; particleDataPtr = particleDataPtrIn;
94 rndmPtr = rndmPtrIn; coupSMPtr = coupSMPtrIn;
95 partonSystemsPtr = partonSystemsPtrIn; userHooksPtr = userHooksPtrIn;}
97 // Initialize alphaStrong and related pTmin parameters.
98 virtual void init( BeamParticle* beamAPtrIn = 0,
99 BeamParticle* beamBPtrIn = 0);
101 // New beams possible for handling of hard diffraction. (Not virtual.)
102 void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
103 int beamOffsetIn = 0) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
104 beamOffset = beamOffsetIn;}
106 // Find whether to limit maximum scale of emissions, and whether to dampen.
107 virtual bool limitPTmax( Event& event, double Q2Fac = 0.,
110 // Potential enhancement factor of pTmax scale for hardest emission.
111 double enhancePTmax() {return pTmaxFudge;}
113 // Top-level routine to do a full time-like shower in resonance decay.
114 virtual int shower( int iBeg, int iEnd, Event& event, double pTmax,
117 // Provide the pT scale of the last branching in the above shower.
118 double pTLastInShower() {return pTLastBranch;}
120 // Prepare system for evolution after each new interaction; identify ME.
121 virtual void prepare( int iSys, Event& event, bool limitPTmaxIn = true);
123 // Update dipole list after a multiparton interactions rescattering.
124 virtual void rescatterUpdate( int iSys, Event& event);
126 // Update dipole list after each ISR emission.
127 virtual void update( int iSys, Event& event);
129 // Select next pT in downwards evolution.
130 virtual double pTnext( Event& event, double pTbegAll, double pTendAll);
132 // ME corrections and kinematics that may give failure.
133 virtual bool branch( Event& event, bool isInterleaved = false);
135 // Tell which system was the last processed one.
136 int system() const {return iSysSel;};
138 // Print dipole list; for debug mainly.
139 virtual void list( ostream& os = cout) const;
143 // Pointer to various information on the generation.
146 // Pointer to the settings database.
147 Settings* settingsPtr;
149 // Pointer to the particle data table.
150 ParticleData* particleDataPtr;
152 // Pointer to the random number generator.
155 // Pointer to Standard Model couplings.
158 // Pointers to the two incoming beams. Offset their location in event.
159 BeamParticle* beamAPtr;
160 BeamParticle* beamBPtr;
163 // Pointer to information on subcollision parton locations.
164 PartonSystems* partonSystemsPtr;
166 // Pointer to userHooks object for user interaction with program.
167 UserHooks* userHooksPtr;
169 // Store properties to be returned by methods.
171 double pTmaxFudge, pTLastBranch;
175 // Constants: could only be changed in the code itself.
176 static const double SIMPLIFYROOT, XMARGIN, XMARGINCOMB, TINYPDF, LARGEM2,
177 THRESHM2, LAMBDA3MARGIN;
178 // Rescatter: try to fix up recoil between systems
179 static const bool FIXRESCATTER, VETONEGENERGY;
180 static const double MAXVIRTUALITYFRACTION, MAXNEGENERGYFRACTION;
182 // Initialization data, normally only set once.
183 bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, doQEDshowerByGamma,
184 doMEcorrections, doMEafterFirst, doPhiPolAsym, doInterleave,
185 allowBeamRecoil, dampenBeamRecoil, recoilToColoured,
186 allowRescatter, canVetoEmission, doHVshower, brokenHVsym,
187 globalRecoil, useLocalRecoilNow;
188 int pTmaxMatch, pTdampMatch, alphaSorder, nGluonToQuark,
189 alphaEMorder, nGammaToQuark, nGammaToLepton, nCHV, idHV,
191 double pTdampFudge, mc, mb, m2c, m2b, renormMultFac, factorMultFac,
192 alphaSvalue, alphaS2pi, Lambda3flav, Lambda4flav, Lambda5flav,
193 Lambda3flav2, Lambda4flav2, Lambda5flav2, pTcolCutMin, pTcolCut,
194 pT2colCut, pTchgQCut, pT2chgQCut, pTchgLCut, pT2chgLCut,
195 mMaxGamma, m2MaxGamma, octetOniumFraction, octetOniumColFac,
196 mZ, gammaZ, thetaWRat, CFHV, alphaHVfix, pThvCut, pT2hvCut,
199 // alphaStrong and alphaEM calculations.
203 // Some current values.
205 double pT2damp, kRad, kEmt;
207 // All dipole ends and a pointer to the selected hardest dipole end.
208 vector<TimeDipoleEnd> dipEnd;
209 TimeDipoleEnd* dipSel;
212 // Setup a dipole end, either QCD, QED/photon or Hidden Valley one.
213 void setupQCDdip( int iSys, int i, int colTag, int colSign, Event& event,
214 bool isOctetOnium = false, bool limitPTmaxIn = true);
215 void setupQEDdip( int iSys, int i, int chgType, int gamType, Event& event,
216 bool limitPTmaxIn = true);
217 void setupHVdip( int iSys, int i, Event& event, bool limitPTmaxIn = true);
219 // Evolve a QCD dipole end.
220 void pT2nextQCD( double pT2begDip, double pT2sel, TimeDipoleEnd& dip,
223 // Evolve a QED dipole end, either charged or photon.
224 void pT2nextQED( double pT2begDip, double pT2sel, TimeDipoleEnd& dip,
227 // Evolve a Hidden Valley dipole end.
228 void pT2nextHV( double pT2begDip, double pT2sel, TimeDipoleEnd& dip,
231 // Find kind of QCD ME correction.
232 void findMEtype( Event& event, TimeDipoleEnd& dip);
234 // Find type of particle; used by findMEtype.
235 int findMEparticle( int id, bool isHiddenColour = false);
237 // Find mixture of V and A in gamma/Z: energy- and flavour-dependent.
238 double gammaZmix( Event& event, int iRes, int iDau1, int iDau2);
240 // Set up to calculate QCD ME correction with calcMEcorr.
241 double findMEcorr(TimeDipoleEnd* dip, Particle& rad, Particle& partner,
244 // Calculate value of QCD ME correction.
245 double calcMEcorr( int kind, int combiIn, double mixIn, double x1,
246 double x2, double r1, double r2, double r3 = 0.);
248 // Find coefficient of azimuthal asymmetry from gluon polarization.
249 void findAsymPol( Event& event, TimeDipoleEnd* dip);
251 // Rescatter: propagate dipole recoil to internal lines connecting systems.
252 bool rescatterPropagateRecoil( Event& event, Vec4& pNew);
256 //==========================================================================
258 } // end namespace Pythia8
260 #endif // Pythia8_TimeShower_H