StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SimpleTimeShower.h
1 // SimpleTimeShower.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2020 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // Header file for the original simple timelike final-state showers.
7 // TimeDipoleEnd: data on a radiating dipole end in FSR.
8 // SimpleTimeShower: handles the showering description.
9 
10 #ifndef Pythia8_SimpleTimeShower_H
11 #define Pythia8_SimpleTimeShower_H
12 
13 #include "Pythia8/TimeShower.h"
14 #include "Pythia8/SimpleWeakShowerMEs.h"
15 
16 namespace Pythia8 {
17 
18 //==========================================================================
19 
20 // Data on radiating dipole ends; only used inside SimpleTimeShower class.
21 
22 class TimeDipoleEnd {
23 
24 public:
25 
26  // Constructors.
27  TimeDipoleEnd() : iRadiator(-1), iRecoiler(-1), pTmax(0.), colType(0),
28  chgType(0), gamType(0), weakType(0), isrType(0), system(0), systemRec(0),
29  MEtype(0), iMEpartner(-1), weakPol(0), isOctetOnium(false),
30  isHiddenValley(false), colvType(0), MEmix(0.), MEorder(true),
31  MEsplit(true), MEgluinoRec(false), isFlexible(false), flavour(), iAunt(),
32  mRad(), m2Rad(), mRec(), m2Rec(), mDip(), m2Dip(), m2DipCorr(), pT2(),
33  m2(), z(), mFlavour(), asymPol(), flexFactor(), pAccept() { }
34  TimeDipoleEnd(int iRadiatorIn, int iRecoilerIn, double pTmaxIn = 0.,
35  int colIn = 0, int chgIn = 0, int gamIn = 0, int weakTypeIn = 0,
36  int isrIn = 0, int systemIn = 0, int MEtypeIn = 0, int iMEpartnerIn = -1,
37  int weakPolIn = 0, bool isOctetOniumIn = false,
38  bool isHiddenValleyIn = false, int colvTypeIn = 0, double MEmixIn = 0.,
39  bool MEorderIn = true, bool MEsplitIn = true, bool MEgluinoRecIn = false,
40  bool isFlexibleIn = false) :
41  iRadiator(iRadiatorIn), iRecoiler(iRecoilerIn), pTmax(pTmaxIn),
42  colType(colIn), chgType(chgIn), gamType(gamIn), weakType(weakTypeIn),
43  isrType(isrIn), system(systemIn), systemRec(systemIn), MEtype(MEtypeIn),
44  iMEpartner(iMEpartnerIn), weakPol(weakPolIn), isOctetOnium(isOctetOniumIn),
45  isHiddenValley(isHiddenValleyIn), colvType(colvTypeIn), MEmix(MEmixIn),
46  MEorder (MEorderIn), MEsplit(MEsplitIn), MEgluinoRec(MEgluinoRecIn),
47  isFlexible(isFlexibleIn), hasJunction(false), flavour(), iAunt(), mRad(),
48  m2Rad(), mRec(), m2Rec(), mDip(), m2Dip(), m2DipCorr(), pT2(), m2(), z(),
49  mFlavour(), asymPol(), flexFactor(), pAccept() { }
50 
51  // Basic properties related to dipole and matrix element corrections.
52  int iRadiator, iRecoiler;
53  double pTmax;
54  int colType, chgType, gamType, weakType, isrType, system, systemRec,
55  MEtype, iMEpartner, weakPol;
56  bool isOctetOnium, isHiddenValley;
57  int colvType;
58  double MEmix;
59  bool MEorder, MEsplit, MEgluinoRec, isFlexible;
60  bool hasJunction;
61 
62  // Properties specific to current trial emission.
63  int flavour, iAunt;
64  double mRad, m2Rad, mRec, m2Rec, mDip, m2Dip, m2DipCorr,
65  pT2, m2, z, mFlavour, asymPol, flexFactor, pAccept;
66 
67 };
68 
69 //==========================================================================
70 
71 // The SimpleTimeShower class does timelike showers.
72 
73 class SimpleTimeShower : public TimeShower {
74 
75 public:
76 
77  // Constructor.
78  SimpleTimeShower() : hasWeaklyRadiated(), iSysSel(), pTmaxFudge(),
79  pTLastBranch(), doQCDshower(), doQEDshowerByQ(), doQEDshowerByL(),
80  doQEDshowerByOther(), doQEDshowerByGamma(), doWeakShower(),
81  doMEcorrections(), doMEextended(), doMEafterFirst(), doPhiPolAsym(),
82  doPhiPolAsymHard(), doInterleave(), allowBeamRecoil(), dampenBeamRecoil(),
83  recoilToColoured(), useFixedFacScale(), allowRescatter(),
84  canVetoEmission(), doHVshower(), brokenHVsym(), globalRecoil(),
85  useLocalRecoilNow(), doSecondHard(), hasUserHooks(), singleWeakEmission(),
86  alphaSuseCMW(), vetoWeakJets(), allowMPIdipole(), weakExternal(),
87  recoilDeadCone(), doDipoleRecoil(), doPartonVertex(), pTmaxMatch(),
88  pTdampMatch(), alphaSorder(), alphaSnfmax(), nGluonToQuark(),
89  weightGluonToQuark(), alphaEMorder(), nGammaToQuark(), nGammaToLepton(),
90  nCHV(), idHV(), alphaHVorder(), nMaxGlobalRecoil(), weakMode(),
91  pTdampFudge(), mc(), mb(), m2c(), m2b(), renormMultFac(), factorMultFac(),
92  fixedFacScale2(), alphaSvalue(), alphaS2pi(), Lambda3flav(), Lambda4flav(),
93  Lambda5flav(), Lambda3flav2(), Lambda4flav2(), Lambda5flav2(),
94  scaleGluonToQuark(), extraGluonToQuark(), pTcolCutMin(), pTcolCut(),
95  pT2colCut(), pTchgQCut(), pT2chgQCut(), pTchgLCut(), pT2chgLCut(),
96  pTweakCut(), pT2weakCut(), mMaxGamma(), m2MaxGamma(), octetOniumFraction(),
97  octetOniumColFac(), mZ(), gammaZ(), thetaWRat(), mW(), gammaW(), CFHV(),
98  nFlavHV(), alphaHVfix(), LambdaHV(), pThvCut(), pT2hvCut(), mHV(),
99  pTmaxFudgeMPI(), weakEnhancement(), vetoWeakDeltaR2(), twoHard(),
100  dopTlimit1(), dopTlimit2(), dopTdamp(), pT2damp(), kRad(), kEmt(),
101  pdfScale2(), doTrialNow(), canEnhanceEmission(), canEnhanceTrial(),
102  canEnhanceET(), doUncertaintiesNow(), dipSel(), iDipSel(), nHard(),
103  nFinalBorn(), nMaxGlobalBranch(), nGlobal(), globalRecoilMode(),
104  limitMUQ(), weakHardSize() { beamOffset = 0;}
105 
106  // Destructor.
107  virtual ~SimpleTimeShower() {}
108 
109  // Initialize alphaStrong and related pTmin parameters.
110  virtual void init( BeamParticle* beamAPtrIn = 0,
111  BeamParticle* beamBPtrIn = 0);
112 
113  // Find whether to limit maximum scale of emissions, and whether to dampen.
114  virtual bool limitPTmax( Event& event, double Q2Fac = 0.,
115  double Q2Ren = 0.);
116 
117  // Top-level routine to do a full time-like shower in resonance decay.
118  virtual int shower( int iBeg, int iEnd, Event& event, double pTmax,
119  int nBranchMax = 0);
120 
121  // Top-level routine for QED radiation in hadronic decay to two leptons.
122  virtual int showerQED( int i1, int i2, Event& event, double pTmax);
123 
124  // Global recoil: reset counters and store locations of outgoing partons.
125  virtual void prepareGlobal( Event& event);
126 
127  // Prepare system for evolution after each new interaction; identify ME.
128  virtual void prepare( int iSys, Event& event, bool limitPTmaxIn = true);
129 
130  // Update dipole list after a multiparton interactions rescattering.
131  virtual void rescatterUpdate( int iSys, Event& event);
132 
133  // Update dipole list after each ISR emission.
134  virtual void update( int iSys, Event& event, bool hasWeakRad = false);
135 
136  // Select next pT in downwards evolution.
137  virtual double pTnext( Event& event, double pTbegAll, double pTendAll,
138  bool isFirstTrial = false, bool doTrialIn = false);
139 
140  // ME corrections and kinematics that may give failure.
141  virtual bool branch( Event& event, bool isInterleaved = false);
142 
143  // Print dipole list; for debug mainly.
144  virtual void list() const;
145 
146  // Initialize data members for calculation of uncertainty bands.
147  virtual bool initUncertainties();
148 
149  // Tell whether FSR has done a weak emission.
150  virtual bool getHasWeaklyRadiated() {return hasWeaklyRadiated;}
151 
152  // Tell which system was the last processed one.
153  virtual int system() const {return iSysSel;}
154 
155  // Potential enhancement factor of pTmax scale for hardest emission.
156  virtual double enhancePTmax() {return pTmaxFudge;}
157 
158  // Provide the pT scale of the last branching in the above shower.
159  virtual double pTLastInShower() {return pTLastBranch;}
160 
161 private:
162 
163  // Constants: could only be changed in the code itself.
164  static const double MCMIN, MBMIN, SIMPLIFYROOT, XMARGIN, XMARGINCOMB,
165  TINYPDF, LARGEM2, THRESHM2, LAMBDA3MARGIN, WEAKPSWEIGHT, WG2QEXTRA,
166  REJECTFACTOR, PROBLIMIT;
167  // Rescatter: try to fix up recoil between systems
168  static const bool FIXRESCATTER, VETONEGENERGY;
169  static const double MAXVIRTUALITYFRACTION, MAXNEGENERGYFRACTION;
170 
171  // Store properties to be returned by methods.
172  bool hasWeaklyRadiated;
173  int iSysSel;
174  double pTmaxFudge, pTLastBranch;
175 
176  // Initialization data, normally only set once.
177  bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, doQEDshowerByOther,
178  doQEDshowerByGamma, doWeakShower, doMEcorrections, doMEextended,
179  doMEafterFirst, doPhiPolAsym, doPhiPolAsymHard, doInterleave,
180  allowBeamRecoil, dampenBeamRecoil, recoilToColoured, useFixedFacScale,
181  allowRescatter, canVetoEmission, doHVshower, brokenHVsym,
182  globalRecoil, useLocalRecoilNow, doSecondHard, hasUserHooks,
183  singleWeakEmission, alphaSuseCMW, vetoWeakJets, allowMPIdipole,
184  weakExternal, recoilDeadCone, doDipoleRecoil, doPartonVertex;
185  int pTmaxMatch, pTdampMatch, alphaSorder, alphaSnfmax, nGluonToQuark,
186  weightGluonToQuark, alphaEMorder, nGammaToQuark, nGammaToLepton,
187  nCHV, idHV, alphaHVorder, nMaxGlobalRecoil, weakMode;
188  double pTdampFudge, mc, mb, m2c, m2b, renormMultFac, factorMultFac,
189  fixedFacScale2, alphaSvalue, alphaS2pi, Lambda3flav, Lambda4flav,
190  Lambda5flav, Lambda3flav2, Lambda4flav2, Lambda5flav2,
191  scaleGluonToQuark, extraGluonToQuark, pTcolCutMin, pTcolCut,
192  pT2colCut, pTchgQCut, pT2chgQCut, pTchgLCut, pT2chgLCut,
193  pTweakCut, pT2weakCut, mMaxGamma, m2MaxGamma, octetOniumFraction,
194  octetOniumColFac, mZ, gammaZ, thetaWRat, mW, gammaW, CFHV, nFlavHV,
195  alphaHVfix, LambdaHV, pThvCut, pT2hvCut, mHV, pTmaxFudgeMPI,
196  weakEnhancement, vetoWeakDeltaR2;
197 
198  // alphaStrong and alphaEM calculations.
199  AlphaStrong alphaS;
200  AlphaEM alphaEM;
201 
202  // Weak matrix elements used for corrections both of ISR and FSR.
203  SimpleWeakShowerMEs simpleWeakShowerMEs;
204 
205  // Some current values.
206  bool twoHard, dopTlimit1, dopTlimit2, dopTdamp;
207  double pT2damp, kRad, kEmt, pdfScale2;
208 
209  // Bookkeeping of enhanced actual or trial emissions (see EPJC (2013) 73).
210  bool doTrialNow, canEnhanceEmission, canEnhanceTrial, canEnhanceET,
211  doUncertaintiesNow;
212  string splittingNameNow, splittingNameSel;
213  map< double, pair<string,double> > enhanceFactors;
214  void storeEnhanceFactor(double pT2, string name, double enhanceFactorIn)
215  { enhanceFactors.insert(make_pair(pT2,make_pair(name,enhanceFactorIn)));}
216 
217  // All dipole ends and a pointer to the selected hardest dipole end.
218  vector<TimeDipoleEnd> dipEnd;
219  TimeDipoleEnd* dipSel;
220  int iDipSel;
221 
222  // Setup a dipole end, either QCD, QED/photon, weak or Hidden Valley one.
223  void setupQCDdip( int iSys, int i, int colTag, int colSign, Event& event,
224  bool isOctetOnium = false, bool limitPTmaxIn = true);
225  void setupQEDdip( int iSys, int i, int chgType, int gamType, Event& event,
226  bool limitPTmaxIn = true);
227  void setupWeakdip( int iSys, int i,int weakType, Event& event,
228  bool limitPTmaxIn = true);
229  // Special setup for weak dipoles if already specified in info ptr.
230  void setupWeakdipExternal(Event& event, bool limitPTmaxIn = true);
231  void setupHVdip( int iSys, int i, Event& event, bool limitPTmaxIn = true);
232 
233  // Evolve a QCD dipole end.
234  void pT2nextQCD( double pT2begDip, double pT2sel, TimeDipoleEnd& dip,
235  Event& event);
236 
237  // Evolve a QED dipole end, either charged or photon.
238  void pT2nextQED( double pT2begDip, double pT2sel, TimeDipoleEnd& dip,
239  Event& event);
240 
241  // Evolve a weak dipole end.
242  void pT2nextWeak( double pT2begDip, double pT2sel, TimeDipoleEnd& dip,
243  Event& event);
244 
245  // Evolve a Hidden Valley dipole end.
246  void pT2nextHV( double pT2begDip, double pT2sel, TimeDipoleEnd& dip,
247  Event& );
248 
249  // Find kind of QCD ME correction.
250  void findMEtype( Event& event, TimeDipoleEnd& dip);
251 
252  // Find type of particle; used by findMEtype.
253  int findMEparticle( int id, bool isHiddenColour = false);
254 
255  // Find mixture of V and A in gamma/Z: energy- and flavour-dependent.
256  double gammaZmix( Event& event, int iRes, int iDau1, int iDau2);
257 
258  // Set up to calculate QCD ME correction with calcMEcorr.
259  double findMEcorr(TimeDipoleEnd* dip, Particle& rad, Particle& partner,
260  Particle& emt, bool cutEdge = true);
261 
262  // Set up to calculate weak ME corrections for t-channel processes.
263  double findMEcorrWeak(TimeDipoleEnd* dip, Vec4 rad, Vec4 rec,
264  Vec4 emt, Vec4 p3, Vec4 p4, Vec4 radBef, Vec4 recBef);
265 
266  // Calculate value of QCD ME correction.
267  double calcMEcorr( int kind, int combiIn, double mixIn, double x1,
268  double x2, double r1, double r2, double r3 = 0., bool cutEdge = true);
269 
270  // Find coefficient of azimuthal asymmetry from gluon polarization.
271  void findAsymPol( Event& event, TimeDipoleEnd* dip);
272 
273  // Rescatter: propagate dipole recoil to internal lines connecting systems.
274  bool rescatterPropagateRecoil( Event& event, Vec4& pNew);
275 
276  // Properties stored for (some) global recoil schemes.
277  // Vectors of event indices defining the hard process.
278  vector<int> hardPartons;
279  // Number of partons in current hard event, number of partons in Born-type
280  // hard event (to distinguish between S and H), maximally allowed number of
281  // global recoil branchings.
282  int nHard, nFinalBorn, nMaxGlobalBranch;
283  // Number of proposed splittings in hard scattering systems.
284  map<int,int> nProposed;
285  // Number of splittings with global recoil (currently only 1).
286  int nGlobal, globalRecoilMode;
287  // Switch to constrain recoiling system.
288  bool limitMUQ;
289 
290  // Calculate uncertainty-band weights for accepted/rejected trial branching.
291  // Usage: calcUncertainties( accept, pAccept, enhance, vp, dip,
292  // radPtr, emtPtr, recPtr).
293  void calcUncertainties(bool , double , double , double ,
295 
296  // 2 -> 2 information needed for the external weak setup.
297  vector<Vec4> weakMomenta;
298  vector<int> weak2to2lines;
299  int weakHardSize;
300 
301 };
302 
303 //==========================================================================
304 
305 } // end namespace Pythia8
306 
307 #endif // Pythia8_SimpleTimeShower_H