10 #ifndef Pythia8_SpaceShower_H
11 #define Pythia8_SpaceShower_H
13 #include "Pythia8/Basics.h"
14 #include "Pythia8/BeamParticle.h"
15 #include "Pythia8/Event.h"
16 #include "Pythia8/Info.h"
17 #include "Pythia8/ParticleData.h"
18 #include "Pythia8/PartonSystems.h"
19 #include "Pythia8/PartonVertex.h"
20 #include "Pythia8/PythiaStdlib.h"
21 #include "Pythia8/Settings.h"
22 #include "Pythia8/StandardModel.h"
23 #include "Pythia8/UserHooks.h"
24 #include "Pythia8/MergingHooks.h"
25 #include "Pythia8/WeakShowerMEs.h"
34 class SpaceDipoleEnd {
39 SpaceDipoleEnd(
int systemIn = 0,
int sideIn = 0,
int iRadiatorIn = 0,
40 int iRecoilerIn = 0,
double pTmaxIn = 0.,
int colTypeIn = 0,
41 int chgTypeIn = 0,
int weakTypeIn = 0,
int MEtypeIn = 0,
42 bool normalRecoilIn =
true,
int weakPolIn = 0,
43 int iColPartnerIn = 0,
int idColPartnerIn = 0) :
44 system(systemIn), side(sideIn), iRadiator(iRadiatorIn),
45 iRecoiler(iRecoilerIn), pTmax(pTmaxIn), colType(colTypeIn),
46 chgType(chgTypeIn), weakType(weakTypeIn), MEtype(MEtypeIn),
47 normalRecoil(normalRecoilIn), weakPol(weakPolIn),
48 iColPartner(iColPartnerIn), idColPartner(idColPartnerIn),
49 nBranch(0), pT2Old(0.), zOld(0.5) { }
52 void store(
int idDaughterIn,
int idMotherIn,
int idSisterIn,
53 double x1In,
double x2In,
double m2DipIn,
double pT2In,
double zIn,
54 double xMoIn,
double Q2In,
double mSisterIn,
double m2SisterIn,
55 double pT2corrIn,
int iColPartnerIn,
double m2IFIn,
double mColPartnerIn)
56 {idDaughter = idDaughterIn; idMother = idMotherIn;
57 idSister = idSisterIn; x1 = x1In; x2 = x2In; m2Dip = m2DipIn;
58 pT2 = pT2In; z = zIn; xMo = xMoIn; Q2 = Q2In; mSister = mSisterIn;
59 m2Sister = m2SisterIn; pT2corr = pT2corrIn; iColPartner = iColPartnerIn;
60 m2IF = m2IFIn; mColPartner = mColPartnerIn;}
63 int system, side, iRadiator, iRecoiler;
65 int colType, chgType, weakType, MEtype;
67 int weakPol, iColPartner, idColPartner;
70 int nBranch, idDaughter, idMother, idSister, iFinPol;
71 double x1, x2, m2Dip, pT2, z, xMo, Q2, mSister, m2Sister, pT2corr,
72 pT2Old, zOld, asymPol, m2IF, mColPartner;
88 SpaceShower() {beamOffset = 0;}
91 virtual ~SpaceShower() {}
95 void initPtr(Info* infoPtrIn, Settings* settingsPtrIn,
96 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn, CoupSM* coupSMPtrIn,
97 PartonSystems* partonSystemsPtrIn, UserHooks* userHooksPtrIn,
98 MergingHooks* mergingHooksPtrIn, PartonVertex* partonVertexPtrIn) {
99 infoPtr = infoPtrIn; settingsPtr = settingsPtrIn;
100 particleDataPtr = particleDataPtrIn; rndmPtr = rndmPtrIn;
101 coupSMPtr = coupSMPtrIn; partonSystemsPtr = partonSystemsPtrIn;
102 userHooksPtr = userHooksPtrIn; mergingHooksPtr = mergingHooksPtrIn;
103 partonVertexPtr = partonVertexPtrIn; }
106 virtual void init(BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn);
109 void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
110 int beamOffsetIn = 0) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
111 beamOffset = beamOffsetIn;}
114 virtual bool limitPTmax(
Event& event,
double Q2Fac = 0.,
118 virtual double enhancePTmax()
const {
return pTmaxFudge;}
121 virtual void prepare(
int iSys,
Event& event,
bool limitPTmaxIn =
true);
125 virtual void update(
int ,
Event&,
bool hasWeakRad =
false);
128 virtual double pTnext(
Event& event,
double pTbegAll,
double pTendAll,
129 int nRadIn = -1,
bool doTrialIn =
false);
132 virtual bool branch(
Event& event);
135 bool initUncertainties();
138 void calcUncertainties(
bool accept,
double pAcceptIn,
double pT20in,
139 double enhance,
double vp, SpaceDipoleEnd* dip, Particle* motherPtr,
140 Particle* sisterPtr);
143 bool wasGamma2qqbar() {
return gamma2qqbar; }
146 virtual int system()
const {
return iSysSel;}
149 bool doRestart()
const {
return rescatterFail;}
152 bool getHasWeaklyRadiated() {
return hasWeaklyRadiated;}
155 virtual void list()
const;
166 virtual Event clustered(
const Event& ,
int ,
int ,
int ,
string )
177 virtual map<string, double> getStateVariables (
const Event& ,
int ,
int ,
178 int ,
string ) {
return map<string,double>();}
182 virtual bool isSpacelike(
const Event&,
int,
int,
int,
string)
187 virtual vector<string> getSplittingName(
const Event& ,
int ,
int ,
int )
188 {
return vector<string>();}
192 virtual double getSplittingProb(
const Event& ,
int ,
int ,
int ,
string )
195 virtual bool allowedSplitting(
const Event& ,
int ,
int)
197 virtual vector<int> getRecoilers(
const Event&,
int,
int,
string)
198 {
return vector<int>(); }
201 MergingHooks* mergingHooksPtr;
209 Settings* settingsPtr;
212 ParticleData* particleDataPtr;
221 BeamParticle* beamAPtr;
222 BeamParticle* beamBPtr;
226 PartonSystems* partonSystemsPtr;
229 UserHooks* userHooksPtr;
232 PartonVertex* partonVertexPtr;
235 WeakShowerMEs weakShowerMEs;
245 static const int MAXLOOPTINYPDF;
246 static const double MCMIN, MBMIN, CTHRESHOLD, BTHRESHOLD, EVALPDFSTEP,
247 TINYPDF, TINYKERNELPDF, TINYPT2, HEAVYPT2EVOL, HEAVYXEVOL,
248 EXTRASPACEQ, LAMBDA3MARGIN, PT2MINWARN, LEPTONXMIN, LEPTONXMAX,
249 LEPTONPT2MIN, LEPTONFUDGE, WEAKPSWEIGHT, HEADROOMQ2Q, HEADROOMQ2G,
250 HEADROOMG2G, HEADROOMG2Q, HEADROOMHQG, REJECTFACTOR, PROBLIMIT;
253 bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, useSamePTasMPI,
254 doWeakShower, doMEcorrections, doMEafterFirst, doPhiPolAsym,
255 doPhiPolAsymHard, doPhiIntAsym, doRapidityOrder, useFixedFacScale,
256 doSecondHard, canVetoEmission, hasUserHooks, alphaSuseCMW,
257 singleWeakEmission, vetoWeakJets, weakExternal, doRapidityOrderMPI,
258 doUncertainties, uVarMuSoftCorr, uVarMPIshowers, doMPI, gamma2qqbar,
259 doDipoleRecoil, doPartonVertex;
260 int pTmaxMatch, pTdampMatch, alphaSorder, alphaSnfmax, alphaEMorder,
261 nQuarkIn, enhanceScreening, weakMode, pT0paramMode;
262 double pTdampFudge, mc, mb, m2c, m2b, renormMultFac, factorMultFac,
263 fixedFacScale2, alphaSvalue, alphaS2pi, Lambda3flav, Lambda4flav,
264 Lambda5flav, Lambda3flav2, Lambda4flav2, Lambda5flav2, pT0Ref,
265 ecmRef, ecmPow, pTmin, sCM, eCM, pT0, pTminChgQ, pTminChgL, pT20,
266 pT2min, pT2minChgQ, pT2minChgL, pTweakCut, pT2weakCut, pTmaxFudgeMPI,
267 strengthIntAsym, weakEnhancement, mZ, gammaZ, thetaWRat, mW, gammaW,
268 weakMaxWt, vetoWeakDeltaR2, dASmax, cNSpTmin, uVarpTmin2, overFactor;
275 bool sideA, dopTlimit1, dopTlimit2, dopTdamp, hasWeaklyRadiated, tChannel,
277 int iNow, iRec, idDaughter, nRad, idResFirst, idResSecond;
278 double xDaughter, x1Now, x2Now, m2ColPair, mColPartner, m2ColPartner,
279 m2Dip, m2Rec, pT2damp, pTbegRef, pdfScale2;
282 bool doTrialNow, canEnhanceEmission, canEnhanceTrial, canEnhanceET;
283 string splittingNameNow, splittingNameSel;
284 map< double, pair<string,double> > enhanceFactors;
285 void storeEnhanceFactor(
double pT2,
string name,
double enhanceFactorIn)
286 { enhanceFactors.insert(make_pair(pT2,make_pair(name,enhanceFactorIn)));}
289 vector<int> nRadA,nRadB;
292 vector<SpaceDipoleEnd> dipEnd;
295 vector<Vec4> weakMomenta;
298 int iDipNow, iSysNow;
299 SpaceDipoleEnd* dipEndNow;
301 SpaceDipoleEnd* dipEndSel;
304 void pT2nextQCD(
double pT2begDip,
double pT2endDip);
307 void pT2nearThreshold( BeamParticle&
beam,
double m2Massive,
308 double m2Threshold,
double xMaxAbs,
double zMinAbs,
309 double zMaxMassive,
int iColPartner);
312 void pT2nextQED(
double pT2begDip,
double pT2endDip);
315 void pT2nextWeak(
double pT2begDip,
double pT2endDip);
318 int findMEtype(
int iSys,
Event& event,
bool weakRadiation =
false);
321 double calcMEmax(
int MEtype,
int idMother,
int idDaughterIn);
324 double calcMEcorr(
int MEtype,
int idMother,
int idDaughterIn,
double M2,
325 double z,
double Q2,
double m2Sister);
328 double calcMEcorrWeak(
int MEtype,
double m2,
double z,
329 double pT2, Vec4 pMother, Vec4 pB, Vec4 pDaughter,
330 Vec4 pB0, Vec4 p1, Vec4 p2, Vec4 pSister);
333 void findAsymPol(
Event& event, SpaceDipoleEnd* dip);
336 int nUncertaintyVariations, nVarQCD, uVarNflavQ;
337 map<int,double> varG2GGmuRfac, varQ2QGmuRfac, varQ2GQmuRfac, varG2QQmuRfac,
339 map<int,double> varG2GGcNS, varQ2QGcNS, varQ2GQcNS, varG2QQcNS, varX2XGcNS;
340 map<int,double>* varPDFplus;
341 map<int,double>* varPDFminus;
342 map<int,double>* varPDFmember;
345 int findColPartner(
Event& event,
int iSideA,
int iSideB,
int iSystem);
353 #endif // Pythia8_SpaceShower_H