10 #ifndef Pythia8_TimeShower_H
11 #define Pythia8_TimeShower_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/PythiaStdlib.h"
20 #include "Pythia8/PartonVertex.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"
38 TimeDipoleEnd() : iRadiator(-1), iRecoiler(-1), pTmax(0.), colType(0),
39 chgType(0), gamType(0), weakType(0), isrType(0), system(0), systemRec(0),
40 MEtype(0), iMEpartner(-1), weakPol(0), isOctetOnium(false),
41 isHiddenValley(false), colvType(0), MEmix(0.), MEorder(true),
42 MEsplit(true), MEgluinoRec(false), isFlexible(false) { }
43 TimeDipoleEnd(
int iRadiatorIn,
int iRecoilerIn,
double pTmaxIn = 0.,
44 int colIn = 0,
int chgIn = 0,
int gamIn = 0,
int weakTypeIn = 0,
45 int isrIn = 0,
int systemIn = 0,
int MEtypeIn = 0,
int iMEpartnerIn = -1,
46 int weakPolIn = 0,
bool isOctetOniumIn =
false,
47 bool isHiddenValleyIn =
false,
int colvTypeIn = 0,
double MEmixIn = 0.,
48 bool MEorderIn =
true,
bool MEsplitIn =
true,
bool MEgluinoRecIn =
false,
49 bool isFlexibleIn =
false) :
50 iRadiator(iRadiatorIn), iRecoiler(iRecoilerIn), pTmax(pTmaxIn),
51 colType(colIn), chgType(chgIn), gamType(gamIn), weakType(weakTypeIn),
52 isrType(isrIn), system(systemIn), systemRec(systemIn), MEtype(MEtypeIn),
53 iMEpartner(iMEpartnerIn), weakPol(weakPolIn), isOctetOnium(isOctetOniumIn),
54 isHiddenValley(isHiddenValleyIn), colvType(colvTypeIn), MEmix(MEmixIn),
55 MEorder (MEorderIn), MEsplit(MEsplitIn), MEgluinoRec(MEgluinoRecIn),
56 isFlexible(isFlexibleIn) { }
59 int iRadiator, iRecoiler;
61 int colType, chgType, gamType, weakType, isrType, system, systemRec,
62 MEtype, iMEpartner, weakPol;
63 bool isOctetOnium, isHiddenValley;
66 bool MEorder, MEsplit, MEgluinoRec, isFlexible;
70 double mRad, m2Rad, mRec, m2Rec, mDip, m2Dip, m2DipCorr,
71 pT2, m2, z, mFlavour, asymPol, flexFactor, pAccept;
84 TimeShower() {beamOffset = 0;}
87 virtual ~TimeShower() {}
91 void initPtr(Info* infoPtrIn, Settings* settingsPtrIn,
92 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
93 CoupSM* coupSMPtrIn, PartonSystems* partonSystemsPtrIn,
94 UserHooks* userHooksPtrIn, MergingHooks* mergingHooksPtrIn,
95 PartonVertex* partonVertexPtrIn) { infoPtr = infoPtrIn;
96 settingsPtr = settingsPtrIn; particleDataPtr = particleDataPtrIn;
97 rndmPtr = rndmPtrIn; coupSMPtr = coupSMPtrIn;
98 partonSystemsPtr = partonSystemsPtrIn; userHooksPtr = userHooksPtrIn;
99 mergingHooksPtr = mergingHooksPtrIn; partonVertexPtr = partonVertexPtrIn;
103 virtual void init( BeamParticle* beamAPtrIn = 0,
104 BeamParticle* beamBPtrIn = 0);
107 void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
108 int beamOffsetIn = 0) {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
109 beamOffset = beamOffsetIn;}
112 virtual bool limitPTmax(
Event& event,
double Q2Fac = 0.,
116 virtual double enhancePTmax() {
return pTmaxFudge;}
119 virtual int shower(
int iBeg,
int iEnd,
Event& event,
double pTmax,
123 virtual int showerQED(
int i1,
int i2,
Event& event,
double pTmax);
126 double pTLastInShower() {
return pTLastBranch;}
129 virtual void prepareGlobal(
Event& event);
132 virtual void prepare(
int iSys,
Event& event,
bool limitPTmaxIn =
true);
135 virtual void rescatterUpdate(
int iSys,
Event& event);
138 virtual void update(
int iSys,
Event& event,
bool hasWeakRad =
false);
141 virtual double pTnext(
Event& event,
double pTbegAll,
double pTendAll,
142 bool isFirstTrial =
false,
bool doTrialIn =
false);
145 virtual bool branch(
Event& event,
bool isInterleaved =
false);
148 bool initUncertainties();
151 void calcUncertainties(
bool accept,
double pAccept,
double enhance,
152 double vp, TimeDipoleEnd* dip, Particle* radPtr, Particle* emtPtr,
156 virtual int system()
const {
return iSysSel;};
159 bool getHasWeaklyRadiated() {
return hasWeaklyRadiated;}
162 virtual void list()
const;
173 virtual Event clustered(
const Event& ,
int ,
int ,
int ,
string )
184 virtual map<string, double> getStateVariables (
const Event& ,
int ,
int ,
185 int ,
string ) {
return map<string,double>();}
189 virtual bool isTimelike(
const Event& ,
int ,
int ,
int ,
string )
194 virtual vector<string> getSplittingName(
const Event& ,
int,
int ,
int)
195 {
return vector<string>();}
199 virtual double getSplittingProb(
const Event& ,
int ,
int ,
int ,
string )
202 virtual bool allowedSplitting(
const Event& ,
int ,
int)
204 virtual vector<int> getRecoilers(
const Event&,
int,
int,
string)
205 {
return vector<int>(); }
208 MergingHooks* mergingHooksPtr;
216 Settings* settingsPtr;
219 ParticleData* particleDataPtr;
228 BeamParticle* beamAPtr;
229 BeamParticle* beamBPtr;
233 PartonSystems* partonSystemsPtr;
236 UserHooks* userHooksPtr;
239 PartonVertex* partonVertexPtr;
242 WeakShowerMEs weakShowerMEs;
246 double pTmaxFudge, pTLastBranch;
251 static const double MCMIN, MBMIN, SIMPLIFYROOT, XMARGIN, XMARGINCOMB,
252 TINYPDF, LARGEM2, THRESHM2, LAMBDA3MARGIN, WEAKPSWEIGHT, WG2QEXTRA,
253 REJECTFACTOR, PROBLIMIT;
255 static const bool FIXRESCATTER, VETONEGENERGY;
256 static const double MAXVIRTUALITYFRACTION, MAXNEGENERGYFRACTION;
259 bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, doQEDshowerByOther,
260 doQEDshowerByGamma, doWeakShower, doMEcorrections, doMEextended,
261 doMEafterFirst, doPhiPolAsym, doPhiPolAsymHard, doInterleave,
262 allowBeamRecoil, dampenBeamRecoil, recoilToColoured, useFixedFacScale,
263 allowRescatter, canVetoEmission, doHVshower, brokenHVsym,
264 globalRecoil, useLocalRecoilNow, doSecondHard, hasUserHooks,
265 singleWeakEmission, alphaSuseCMW, vetoWeakJets, allowMPIdipole,
266 weakExternal, recoilDeadCone, doUncertainties, uVarMuSoftCorr,
267 uVarMPIshowers, doDipoleRecoil, doPartonVertex, noResVariations,
269 int pTmaxMatch, pTdampMatch, alphaSorder, alphaSnfmax, nGluonToQuark,
270 weightGluonToQuark, alphaEMorder, nGammaToQuark, nGammaToLepton,
271 nCHV, idHV, alphaHVorder, nMaxGlobalRecoil, weakMode;
272 double pTdampFudge, mc, mb, m2c, m2b, renormMultFac, factorMultFac,
273 fixedFacScale2, alphaSvalue, alphaS2pi, Lambda3flav, Lambda4flav,
274 Lambda5flav, Lambda3flav2, Lambda4flav2, Lambda5flav2,
275 scaleGluonToQuark, extraGluonToQuark, pTcolCutMin, pTcolCut,
276 pT2colCut, pTchgQCut, pT2chgQCut, pTchgLCut, pT2chgLCut,
277 pTweakCut, pT2weakCut, mMaxGamma, m2MaxGamma, octetOniumFraction,
278 octetOniumColFac, mZ, gammaZ, thetaWRat, mW, gammaW, CFHV, nFlavHV,
279 alphaHVfix, LambdaHV, pThvCut, pT2hvCut, mHV, pTmaxFudgeMPI,
280 weakEnhancement, vetoWeakDeltaR2, dASmax, cNSpTmin, uVarpTmin2,
288 bool dopTlimit1, dopTlimit2, dopTdamp, hasWeaklyRadiated;
289 double pT2damp, kRad, kEmt, pdfScale2;
292 bool doTrialNow, canEnhanceEmission, canEnhanceTrial, canEnhanceET,
294 string splittingNameNow, splittingNameSel;
295 map< double, pair<string,double> > enhanceFactors;
296 void storeEnhanceFactor(
double pT2,
string name,
double enhanceFactorIn)
297 { enhanceFactors.insert(make_pair(pT2,make_pair(name,enhanceFactorIn)));}
300 vector<TimeDipoleEnd> dipEnd;
301 TimeDipoleEnd* dipSel;
305 void setupQCDdip(
int iSys,
int i,
int colTag,
int colSign,
Event& event,
306 bool isOctetOnium =
false,
bool limitPTmaxIn =
true);
307 void setupQEDdip(
int iSys,
int i,
int chgType,
int gamType,
Event& event,
308 bool limitPTmaxIn =
true);
309 void setupWeakdip(
int iSys,
int i,
int weakType,
Event& event,
310 bool limitPTmaxIn =
true);
312 void setupWeakdipExternal(
Event& event,
bool limitPTmaxIn =
true);
313 void setupHVdip(
int iSys,
int i,
Event& event,
bool limitPTmaxIn =
true);
316 void pT2nextQCD(
double pT2begDip,
double pT2sel, TimeDipoleEnd& dip,
320 void pT2nextQED(
double pT2begDip,
double pT2sel, TimeDipoleEnd& dip,
324 void pT2nextWeak(
double pT2begDip,
double pT2sel, TimeDipoleEnd& dip,
328 void pT2nextHV(
double pT2begDip,
double pT2sel, TimeDipoleEnd& dip,
332 void findMEtype(
Event& event, TimeDipoleEnd& dip);
335 int findMEparticle(
int id,
bool isHiddenColour =
false);
338 double gammaZmix(
Event& event,
int iRes,
int iDau1,
int iDau2);
341 double findMEcorr(TimeDipoleEnd* dip, Particle& rad, Particle& partner,
342 Particle& emt,
bool cutEdge =
true);
345 double findMEcorrWeak(TimeDipoleEnd* dip, Vec4 rad, Vec4 rec,
346 Vec4 emt, Vec4 p3, Vec4 p4, Vec4 radBef, Vec4 recBef);
349 double calcMEcorr(
int kind,
int combiIn,
double mixIn,
double x1,
350 double x2,
double r1,
double r2,
double r3 = 0.,
bool cutEdge =
true);
353 void findAsymPol(
Event& event, TimeDipoleEnd* dip);
356 bool rescatterPropagateRecoil(
Event& event, Vec4& pNew);
360 vector<int> hardPartons;
364 int nHard, nFinalBorn, nMaxGlobalBranch;
366 map<int,int> nProposed;
368 int nGlobal, globalRecoilMode;
373 vector<Vec4> weakMomenta;
374 vector<int> weak2to2lines;
378 int nUncertaintyVariations, nVarQCD, uVarNflavQ;
379 map<int,double> varG2GGmuRfac;
380 map<int,double> varQ2QGmuRfac, varG2QQmuRfac, varX2XGmuRfac;
381 map<int,double> varG2GGcNS, varQ2QGcNS, varG2QQcNS, varX2XGcNS;
382 map<int,double>* varPDFplus;
383 map<int,double>* varPDFminus;
384 map<int,double>* varPDFmember;
392 #endif // Pythia8_TimeShower_H