PYTHIA  8.311
VinciaFSR.h
1 // VinciaFSR.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Peter Skands, 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 // This file contains header information for the VinciaFSR class for
7 // QCD final-state antenna showers, and auxiliary classes.
8 
9 #ifndef Pythia8_VinciaFSR_H
10 #define Pythia8_VinciaFSR_H
11 
12 #include "Pythia8/TimeShower.h"
13 #include "Pythia8/VinciaAntennaFunctions.h"
14 #include "Pythia8/VinciaCommon.h"
15 #include "Pythia8/VinciaISR.h"
16 #include "Pythia8/VinciaMergingHooks.h"
17 #include "Pythia8/VinciaTrialGenerators.h"
18 #include "Pythia8/VinciaQED.h"
19 #include "Pythia8/VinciaEW.h"
20 #include "Pythia8/VinciaWeights.h"
21 #include "Pythia8/VinciaDiagnostics.h"
22 
23 namespace Pythia8 {
24 
25 // Forward declarations.
26 class VinciaISR;
27 
28 //==========================================================================
29 
30 // Helper struct to store information about junctions that involved
31 // resonances that have now decayed.
32 
34 
35  // Number of junction in event record.
36  int iJunction;
37  // Which of the three ends of iJunction are we talking about.
38  int iEndCol;
39  // What is the colour tag of iEndCol in iJunctions.
41  // Pythia index of quark that should be on the end. Specifically it
42  // should be the quark from the decay of the resonance.
43  int iEndQuark;
44  // iEndColTag and iEnd Quark will get updated as the quark radiates.
45  // Cector of colours lines between res and end quark, needed in
46  // order to track if a gluon in chain splits to find correct
47  // junction end.
48  vector<int> colours;
49 
50 };
51 
52 //==========================================================================
53 
54 // The Brancher class, base class containing a generic set of "parent
55 // partons" as well as virtual methods for generating trial
56 // branchings.
57 
58 class Brancher {
59 
60 public:
61 
62  // Main base class constructor.
63  Brancher(int iSysIn, Event& event, bool sectorShowerIn,
64 vector<int> iIn) : sectorShower(sectorShowerIn) {
65  reset(iSysIn, event, iIn);
66  }
67 
68  // Wrapper for 2- and 3-parton parents.
69  Brancher(int iSysIn, Event& event, bool sectorShowerIn,
70  int iIn0, int iIn1, int iIn2=0) : sectorShower(sectorShowerIn) {
71  reset(iSysIn, event, iIn0, iIn1, iIn2);
72  }
73 
74  // Base class must have a virtual destructor.
75  virtual ~Brancher() {}
76 
77  // Reset (common functionality implemented in base class).
78  void reset(int iSysIn, Event& event, vector<int> iIn);
79 
80  // Wrapper for simple 2- (or 3-) parton antennae.
81  void reset(int iSysIn, Event& event, int i0In, int i1In, int i2In = 0) {
82  vector<int> iIn {i0In, i1In}; if (i2In >= 1) iIn.push_back(i2In);
83  reset(iSysIn,event,iIn);}
84 
85  // Methods to get (explicit for up to 3 parents, otherwise just use iVec).
86  int i0() const {return (iSav.size() >= 1) ? iSav[0] : -1;}
87  int i1() const {return (iSav.size() >= 2) ? iSav[1] : -1;}
88  int i2() const {return (iSav.size() >= 3) ? iSav[2] : -1;}
89  int iVec(unsigned int i) const {return (iSav.size() > i) ? iSav[i] : -1;}
90  vector<int> iVec() {return iSav;}
91  int id0() const {return (idSav.size() >= 1) ? idSav[0] : -1;}
92  int id1() const {return (idSav.size() >= 2) ? idSav[1] : -1;}
93  int id2() const {return (idSav.size() >= 3) ? idSav[2] : -1;}
94  vector<int> idVec() const {return idSav;}
95  int colType0() const {return (colTypeSav.size() >= 1) ? colTypeSav[0] : -1;}
96  int colType1() const {return (colTypeSav.size() >= 2) ? colTypeSav[1] : -1;}
97  int colType2() const {return (colTypeSav.size() >= 3) ? colTypeSav[2] : -1;}
98  vector<int> colTypeVec() const {return colTypeSav;}
99  int col0() const {return (colSav.size() >= 1) ? colSav[0] : 0;}
100  int col1() const {return (colSav.size() >= 2) ? colSav[1] : 0;}
101  int col2() const {return (colSav.size() >= 3) ? colSav[2] : 0;}
102  vector<int> colVec() const {return colSav;}
103  int acol0() const {return (acolSav.size() >= 1) ? acolSav[0] : 0;}
104  int acol1() const {return (acolSav.size() >= 2) ? acolSav[1] : 0;}
105  int acol2() const {return (acolSav.size() >= 3) ? acolSav[2] : 0;}
106  vector<int> acolVec() const {return acolSav;}
107  int h0() const {return (hSav.size() >= 1) ? hSav[0] : -1;}
108  int h1() const {return (hSav.size() >= 2) ? hSav[1] : -1;}
109  int h2() const {return (hSav.size() >= 3) ? hSav[2] : -1;}
110  vector<int> hVec() const {return hSav;}
111  double m0() const {return (mSav.size() >= 1) ? mSav[0] : -1;}
112  double m1() const {return (mSav.size() >= 2) ? mSav[1] : -1;}
113  double m2() const {return (mSav.size() >= 3) ? mSav[2] : -1;}
114  vector<double> mVec() const {return mSav;}
115  vector<double> getmPostVec() {return mPostSav;}
116  int colTag() {return colTagSav;}
117 
118  // Method to get maximum value of evolution scale for this brancher.
119  // Must be redefined in base classes.
120  virtual double getQ2Max(int) = 0;
121 
122  // Methods to return saved/derived quantities.
123  int system() const {return systemSav;}
124  double mAnt() const {return mAntSav;}
125  double m2Ant() const {return m2AntSav;}
126  double sAnt() const {return sAntSav;}
127  double kallenFac() const {return kallenFacSav;}
128  double enhanceFac() const {return enhanceSav;}
129  double q2Trial() const {return q2NewSav;}
130  enum AntFunType antFunTypePhys() const {return antFunTypeSav;}
131 
132  // Generate a new Q2 scale.
133  virtual double genQ2(int evTypeIn, double q2MaxNow, Rndm* rndmPtr,
134  Logger* loggerPtr, const EvolutionWindow* evWindowPtrIn, double colFac,
135  vector<double> headroomIn, vector<double> enhanceFacIn,
136  int verboseIn) = 0;
137 
138  // Generate complementary invariant(s) for saved trial. Return false
139  // if no physical kinematics possible. Base class returns false.
140  virtual bool genInvariants(vector<double>& invariants, Rndm*, int,
141  Logger*) {
142  invariants.clear(); return false;}
143 
144  // Compute antPhys/antTrial, given an input value for antPhys. Base
145  // class returns 0.
146  virtual double pAccept(const double, Logger* /*loggerPtr*/, int = 0) {
147  return 0.;}
148 
149  // Compute pT scale of trial branching.
150  virtual double getpTscale();
151 
152  // Return Xj.
153  virtual double getXj();
154 
155  // What kind of particle(s) are being created, e.g. return 21 for
156  // gluon emission, quark flavour for splitting, etc.
157  virtual int idNew() const {return 0;}
158  virtual double mNew() const {return 0.0;}
159 
160  // Return new particles, must be implemented by derived class.
161  virtual bool getNewParticles(Event& event, vector<Vec4> momIn,
162  vector<int> hIn, vector<Particle> &pNew,Rndm* rndmPtr,
163  VinciaColour* colourPtr) = 0;
164 
165  // Simple print utility, showing the contents of the Brancher. Base
166  // class implementation allows for up to three explicit parents.
167  virtual void list(string header="none", bool withLegend=true) const;
168 
169  // Set post-branching IDs and masses. Base class is for gluon emission.
170  virtual void setidPost();
171  virtual vector<double> setmPostVec();
172  virtual void setStatPost();
173  virtual void setMaps(int);
174 
175  // Return index of new particle (slightly arbitrary choice for splittings).
176  virtual int iNew();
177 
178  // Method returns pos of resonance if there is one participating in
179  // decay, -1 otherwise.
180  virtual int posR() const {return -1;}
181 
182  // Method returns pos of colour-connected daughter to resonance if
183  // there is one participating in decay, -1 otherwise.
184  virtual int posF() const {return -1;}
185 
186  // Return sector label.
187  virtual int getSector(){
188  return iSectorWinner;
189  };
190 
191  // Return branch type.
192  enum BranchType getBranchType() {return branchType;}
193  // Check if swapped.
194  bool isSwapped() {return swapped;}
195  // Return the saved invariants.
196  vector<double> getInvariants() {return invariantsSav;}
197 
198  // This method allows to reset enhanceFac if we do an accept/reject.
199  void resetEnhanceFac(const double enhanceIn) {enhanceSav = enhanceIn;}
200 
201  // Method to see if a saved trial has been generated, and to erase
202  // memory of it.
203  bool hasTrial() const {return hasTrialSav;}
204  // Method to mark new trial needed *without* erasing current one.
205  void needsNewTrial() {
206  hasTrialSav = false;
207  if (trialGenPtr != nullptr) {
208  trialGenPtr->needsNewTrial();
209  }
210  }
211  // Method to mark new trial needed *and* erase current one.
212  void eraseTrial() {
213  hasTrialSav = false;
214  q2NewSav = 0.;
215  if (trialGenPtr != nullptr) {
216  trialGenPtr->resetTrial();
217  }
218  }
219  // Object to perform trial generation.
220  shared_ptr<TrialGenerator> trialGenPtr = {};
221 
222  // Publicly accessible members for storing mother/daughter connections.
223  map<int, pair<int, int> > mothers2daughters;
224  map<int, pair<int, int> > daughters2mothers;
225 
226 protected:
227 
228  // Data members for storing information about parent partons.
229  int systemSav{};
230  vector<int> iSav, idSav, colTypeSav, hSav, colSav, acolSav;
231  vector<int> idPostSav, statPostSav;
232  vector<double> mSav, mPostSav;
233  int colTagSav{}, evTypeSav{};
234 
235  // All alphaS information.
236  const EvolutionWindow* evWindowSav{};
237 
238  // Saved antenna mass parameters.
239  double mAntSav{}, m2AntSav{}, kallenFacSav{}, sAntSav{};
240 
241  // Data members for storing information about generated trial branching.
242  bool hasTrialSav{false};
243  double headroomSav{1.}, enhanceSav{1.}, q2BegSav{}, q2NewSav{};
244  vector<double> invariantsSav;
245 
246  // Store which branching type we are doing.
247  enum BranchType branchType{BranchType::Void};
248 
249  // Index of FF antenna function.
250  enum AntFunType antFunTypeSav{NoFun};
251 
252  // If true, flip identities of A and B.
253  bool swapped{false};
254 
255  // Parameters for the sector shower.
256  bool sectorShower{};
257  int iSectorWinner{};
258 
259 };
260 
261 //==========================================================================
262 
263 // Class BrancherEmitFF, branch elemental for 2->3 gluon emissions.
264 
265 class BrancherEmitFF : public Brancher {
266 
267 public:
268 
269  // Create branch elemental for antenna(e) with parents in iIn.
270  BrancherEmitFF(int iSysIn, Event& event, bool sectorShowerIn,
271  vector<int> iIn, ZetaGeneratorSet* zetaGenSet) :
272  Brancher(iSysIn, event, sectorShowerIn, iIn) {
273  // Initialise derived-class members and set up trial generator.
274  initBrancher(zetaGenSet);
275  }
276 
277  // Wrapper to provide simple 2-parton systems as parents.
278  BrancherEmitFF(int iSysIn, Event& event, bool sectorShowerIn,
279  int iIn0, int iIn1, ZetaGeneratorSet* zetaGenSet) :
280  Brancher(iSysIn, event, sectorShowerIn, iIn0, iIn1) {
281  // Initialise derived-class members and set up trial generator.
282  initBrancher(zetaGenSet);
283  }
284 
285  // Method to initialise members specific to BrancherEmitFF.
286  void initBrancher(ZetaGeneratorSet* zetaGenSet);
287 
288  // Generate a new Q2 value, soft-eikonal 2/yij/yjk implementation.
289  double genQ2(int evTypeIn, double q2MaxNow, Rndm* rndmPtr,
290  Logger* loggerPtr, const EvolutionWindow* evWindowPtrIn, double colFac,
291  vector<double> headroomIn, vector<double> enhanceFacIn,int verboseIn);
292 
293  // Generate invariants. Method to generate complementary
294  // invariant(s) for saved trial scale for gluon emission. Return
295  // false if no physical kinematics possible.
296  virtual bool genInvariants(vector<double>& invariants, Rndm* rndmPtr,
297  int verboseIn, Logger* loggerPtr);
298 
299  // Compute antPhys/antTrial for gluon emissions, given
300  // antPhys. Note, antPhys should be normalised to include charge and
301  // coupling factors.
302  virtual double pAccept(const double antPhys, Logger* loggerPtr,
303  int verboseIn);
304 
305  // Return the maximum Q2.
306  double getQ2Max(int evType);
307 
308  // Method to make mothers2daughters and daughters2mothers pairs.
309  virtual void setMaps(int sizeOld);
310 
311  // Flavour and mass of emitted particle
312  virtual int idNew() const {return 21;}
313  virtual double mNew() const {return 0.0;}
314 
315  // Generic getter method. Assumes setter methods called earlier.
316  virtual bool getNewParticles(Event& event, vector<Vec4> momIn,
317  vector<int> hIn, vector<Particle> &pNew, Rndm* rndmPtr,
318  VinciaColour* colourPtr);
319 
320 private:
321 
322  // Data members to store information about generated trials.
323  double colFacSav{};
324 
325 };
326 
327 //==========================================================================
328 
329 // Class BrancherSplitFF, branch elemental for 2->3 gluon splittings.
330 
331 class BrancherSplitFF : public Brancher {
332 
333 public:
334 
335  // Create branch elemental for antenna(e) with parents in iIn.
336  BrancherSplitFF(int iSysIn, Event& event, bool sectorShowerIn,
337  vector<int> iIn, ZetaGeneratorSet* zetaGenSet) :
338  Brancher(iSysIn, event, sectorShowerIn, iIn) {
339  // Initialise derived-class members and set up trial generator.
340  initBrancher(zetaGenSet);
341  }
342 
343  // Wrapper to provide simple 2-parton systems as parents. Set if it
344  // is the anticolour or colour side of the gluon that participates
345  // in the antenna (used to decide pTj or pTi measure).
346  BrancherSplitFF(int iSysIn, Event& event, bool sectorShowerIn, int iIn0,
347  int iIn1, bool col2acol, ZetaGeneratorSet* zetaGenSet) :
348  Brancher(iSysIn, event, sectorShowerIn, iIn0, iIn1) {
349  // Initialise derived-class members and set up trial generator.
350  initBrancher(zetaGenSet, col2acol);
351  }
352 
353  // Method to initialise data members specific to BrancherSplitFF.
354  void initBrancher(ZetaGeneratorSet* zetaGenSet, bool col2acolIn=true);
355 
356  // Method to check if it is the colour (false) or anticolour (true)
357  // side of the gluon that is splitting, corresponding to the quark
358  // or antiquark being regarded as the emitted parton respectively.
359  virtual bool isXG() const {return isXGsav;}
360 
361  // Flavour and mass of emitted particle.
362  virtual int idNew() const {return idFlavSav;}
363  virtual double mNew() const {return mFlavSav;}
364 
365  // Generate a new Q2 scale (collinear 1/(2q2) implementation) with
366  // constant trial alphaS.
367  double genQ2(int evTypeIn, double q2MaxNow, Rndm* rndmPtr,
368  Logger* loggerPtr, const EvolutionWindow* evWindowPtrIn, double colFac,
369  vector<double> headroomIn, vector<double> enhanceFacIn,int verboseIn);
370 
371  // Generate complementary invariant(s) for saved trial scale for
372  // gluon splitting. Return false if no physical kinematics possible.
373  virtual bool genInvariants(vector<double>& invariants, Rndm* rnmdPtr,
374  int verboseIn, Logger* loggerPtr);
375 
376  // Compute antPhys/antTrial for gluon splittings, given antPhys.
377  // Note, antPhys should be normalised to include charge and coupling
378  // factors.
379  virtual double pAccept(const double antPhys, Logger* loggerPtr,
380  int verboseIn);
381 
382  // Getter and setter methods.
383  double getQ2Max(int evType);
384  virtual vector<double> setmPostVec();
385  virtual void setidPost();
386  virtual void setStatPost();
387  virtual void setMaps(int sizeOld);
388 
389  // Generic getter method. Assumes setter methods called earlier.
390  virtual bool getNewParticles(Event& event, vector<Vec4> momIn,
391  vector<int> hIn, vector<Particle> &pNew, Rndm*, VinciaColour*);
392 
393  private:
394 
395  // Data members for storing information on generated trials.
396  int idFlavSav{};
397  double mFlavSav{};
398 
399  // Data member to store whether this is a GXbar (false) or XG (true) antenna,
400  // i.e. if it is the colour side (false) of the gluon or the anticolour
401  // side which is participating in the LC antenna. In the former case, we
402  // use pT(q) as the measure, else pT(qbar) = pTj.
403  bool isXGsav{};
404 
405 };
406 
407 //==========================================================================
408 
409 // BrancherRF base class for resonance-final antennae.
410 
411 class BrancherRF : public Brancher {
412 
413 public:
414 
415  // Base class constructor = inherited from Brancher.
416  BrancherRF(int iSysIn, Event& event, bool sectorShowerIn,
417  vector<int> allIn) : Brancher(iSysIn, event, sectorShowerIn, allIn) {}
418 
419  // RF branchers have a different initBrancher structure.
420  virtual void initRF(Event& event, vector<int> allIn,
421  unsigned int posResIn, unsigned int posFIn, double q2cut,
422  ZetaGeneratorSet* zetaGenSet) = 0;
423 
424  // Reset the brancher.
425  void resetRF(int iSysIn, Event& event, vector<int> allIn,
426  unsigned int posResIn, unsigned int posFIn, double q2cut,
427  ZetaGeneratorSet* zetaGenSet) {
428  reset(iSysIn, event, allIn);
429  initRF(event, allIn, posResIn, posFIn, q2cut, zetaGenSet);
430  }
431 
432  // Setter methods that are common for all derived RF classes.
433  int iNew();
434  void setMaps(int sizeOld);
435 
436  // Return position of resonance and colour-connected final-state parton.
437  int posR() const {return int(posRes);}
438  int posF() const {return int(posFinal);}
439 
440  // Return maximum Q2.
441  double getQ2Max(int evType) {return evType == 1 ? q2MaxSav : 0.;}
442 
443 protected:
444 
445  // Protected helper methods for internal class use.
446  double getsAK(double mA, double mK, double mAK);
447  double calcQ2Max(double mA, double mAK, double mK);
448 
449  // Veto point if outside available phase space.
450  bool vetoPhSpPoint(const vector<double>& invariants, int verboseIn);
451 
452  // Save reference to position in vectors of resonance and colour
453  // connected parton.
454  unsigned int posRes{}, posFinal{};
455  // Mass of resonance.
456  double mRes{};
457  // Mass of final state parton in antennae.
458  double mFinal{};
459  // Collective mass of rest of downstream decay products of resonance
460  // these will just take recoil.
461  double mRecoilers{};
462  double sAK{};
463 
464  // Max Q2 for this brancher, still an overestimate.
465  double q2MaxSav{};
466  double colFacSav{};
467  // Store whether the colour flow is from R to F (e.g. t -> bW+) or F
468  // to R (e.g. tbar -> bbarW-).
469  bool colFlowRtoF{};
470  map<unsigned int,unsigned int> posNewtoOld{};
471 
472 };
473 
474 
475 //==========================================================================
476 
477 // BrancherEmitRF class for storing information on antennae between a
478 // coloured resonance and final state parton, and generating a new
479 // emission.
480 
481 class BrancherEmitRF : public BrancherRF {
482 
483 public:
484 
485  // Constructor.
486  BrancherEmitRF(int iSysIn, Event& event, bool sectorShowerIn,
487  vector<int> allIn, unsigned int posResIn, unsigned int posFIn,
488  double q2cut, ZetaGeneratorSet* zetaGenSet) :
489  BrancherRF(iSysIn, event, sectorShowerIn, allIn) {
490  // Initialise derived-class members and set up trial generator.
491  initBrancher(event, allIn, posResIn, posFIn, q2cut, zetaGenSet);
492  }
493 
494  // Method to initialise data members specific to BrancherEmitRF.
495  void initBrancher(Event& event, vector<int> allIn, unsigned int posResIn,
496  unsigned int posFIn, double q2cut, ZetaGeneratorSet* zetaGenSet);
497  void initRF(Event& event, vector<int> allIn, unsigned int posResIn,
498  unsigned int posFIn, double q2cut, ZetaGeneratorSet* zetaGenSet) override {
499  initBrancher(event, allIn, posResIn, posFIn, q2cut, zetaGenSet);}
500 
501  // Setter methods.
502  vector<double> setmPostVec() override;
503  void setidPost() override;
504  void setStatPost() override;
505 
506  // Generic method, assumes setter methods called earlier.
507  bool getNewParticles(Event& event, vector<Vec4> momIn, vector<int> hIn,
508  vector<Particle> &pNew, Rndm* rndmPtr, VinciaColour*) override;
509 
510  // Generate a new Q2 scale.
511  double genQ2(int evTypeIn, double q2MaxNow, Rndm* rndmPtr,
512  Logger* loggerPtr, const EvolutionWindow* evWindowPtrIn, double colFac,
513  vector<double> headroomIn, vector<double> enhanceFacIn,
514  int verboseIn) override;
515 
516  // Generate complementary invariant(s) for saved trial scale. Return
517  // false if no physical kinematics possible.
518  bool genInvariants(vector<double>& invariants,Rndm* rndmPtr,
519  int verboseIn, Logger* loggerPtr) override;
520 
521  // Compute antPhys/antTrial, given antPhys. Note, antPhys should be
522  // normalised to include charge and coupling factors.
523  double pAccept(const double, Logger* loggerPtr, int verboseIn) override;
524 
525 };
526 
527 //==========================================================================
528 
529 // BrancherSplitRF class for storing information on antennae between a
530 // coloured resonance and final state parton, and generating a new
531 // emission.
532 
533 class BrancherSplitRF : public BrancherRF {
534 
535 public:
536 
537  // Constructor.
538  BrancherSplitRF(int iSysIn, Event& event, bool sectorShowerIn,
539  vector<int> allIn, unsigned int posResIn, unsigned int posFIn,
540  double q2cut, ZetaGeneratorSet* zetaGenSet) :
541  BrancherRF(iSysIn, event, sectorShowerIn, allIn) {
542  // Initialise derived-class members and set up trial generator.
543  initBrancher(event, allIn, posResIn, posFIn, q2cut, zetaGenSet);
544  }
545 
546  // Method to initialise data members specific to BrancherSplitRF.
547  void initBrancher(Event& event, vector<int> allIn, unsigned int posResIn,
548  unsigned int posFIn, double q2cut, ZetaGeneratorSet* zetaGenSet);
549  void initRF(Event& event, vector<int> allIn, unsigned int posResIn,
550  unsigned int posFIn, double q2cut, ZetaGeneratorSet* zetaGenSet) override {
551  initBrancher(event, allIn, posResIn, posFIn, q2cut, zetaGenSet);}
552 
553  // Setter methods.
554  vector<double> setmPostVec() override;
555  void setidPost() override;
556  void setStatPost() override;
557 
558  // Generic method, assumes setter methods called earlier.
559  bool getNewParticles(Event& event, vector<Vec4> momIn,
560  vector<int> hIn, vector<Particle>& pNew, Rndm*, VinciaColour*) override;
561 
562  // Generate a new Q2 scale.
563  double genQ2(int evTypeIn, double q2MaxNow, Rndm* rndmPtr,
564  Logger* loggerPtr, const EvolutionWindow* evWindowPtrIn, double colFac,
565  vector<double> headroomIn, vector<double> enhanceFacIn,
566  int verboseIn) override;
567 
568 protected:
569 
570  // Members.
571  int idFlavSav{};
572  double mFlavSav{};
573 
574 };
575 
576 //==========================================================================
577 
578 // The VinciaFSR class for resonant decays. Inherits from TimeShower
579 // in Pythia 8 so can be used as alternative to TimeShower.
580 // Methods that must replace ones in TimeShower are marked with override.
581 
582 class VinciaFSR : public TimeShower {
583 
584  // Allow VinciaISR and VinciaHistory to access private information.
585  friend class VinciaISR;
586  friend class VinciaHistory;
587 
588 public:
589 
590  // Constructor.
592  zetaGenSetRF(ZetaGeneratorSet(TrialGenType::RF)),
593  zetaGenSetFF(ZetaGeneratorSet(TrialGenType::FF)) {
594  verbose = 0; headerIsPrinted = false; isInit = false;
595  isPrepared = false; diagnosticsPtr = 0;}
596 
597  // Destructor.
599 
600  // The following methods control main flow of shower and are
601  // inherited from TimeShower. Any method re-implementing a
602  // TimeShower method is appended with (TimeShower).
603 
604  // Initialize alphaStrong and related pTmin parameters (TimeShower).
605  void init(BeamParticle* beamAPtrIn = 0, BeamParticle* beamBPtrIn = 0)
606  override;
607 
608  // Force reset at beginning of each event.
609  void onBeginEvent() override { isPrepared = false; }
610 
611  // Determines if max pT limit should be imposed on first emission.
612  // Note: in Vincia, the second argument is purely dummy.
613  bool limitPTmax(Event& event, double q2Fac, double q2Ren) override;
614 
615  // Top-level routine to do a full time-like shower in resonance
616  // decay (TimeShower).
617  int shower( int iBeg, int iEnd, Event& event, double pTmax,
618  int nBranchMax = 0) override;
619 
620  // Method to add QED showers in hadron decays (TimeShower).
621  int showerQED(int iBeg, int iEnd, Event& event, double pTmax) override;
622 
623  // Method to add QED showers to partons below colour resolution
624  // scale (TimeShower).
625  int showerQEDafterRemnants(Event& event) override;
626 
627  // Prepare process-level event for shower + interleaved resonance decays.
628  // Usage: prepareProcess( process, event, iPos).
629  // iPos provides mapping from process to event entries (before showering).
630  void prepareProcess( Event& process, Event& event,
631  vector<int>& iPosBefShow) override;
632 
633  // Used for global recoil scheme (TimeShower, no Vincia implementation yet).
634  // void prepareGlobal(Event&);
635 
636  // Prepare system for evolution (TimeShower).
637  void prepare( int iSys, Event& event, bool limitPTmaxIn) override;
638 
639  // Update antenna list after a multiple interactions rescattering
640  // (TimeShower, no Vincia implementation yet).
641  // void rescatterUpdate( int iSys, Event& event);
642 
643  // Update antenna list after each ISR emission (TimeShower).
644  void update( int iSys, Event& event, bool hasWeakRad = false) override;
645 
646  // Select next pT in downwards evolution (TimeShower).
647  double pTnext( Event& event, double pTbegAll, double pTendAll,
648  bool isFirstTrial = false, bool doTrialIn = false) override;
649 
650  // Select next pT for interleaved resonance decays.
651  double pTnextResDec() override {
652  double pTresDecMax = 0.;
653  iHardResDecSav = -1 ;
654  for (size_t i=0; i<pTresDecSav.size(); ++i) {
655  if (pTresDecSav[i] > pTresDecMax) {
656  pTresDecMax = pTresDecSav[i];
657  iHardResDecSav = i;
658  }
659  }
660  return pTresDecMax;
661  }
662 
663  // Branch event, including accept/reject veto (TimeShower).
664  bool branch( Event& event, bool isInterleaved = false) override;
665 
666  // Do a resonance decay + resonance shower (including any nested decays).
667  // May be called recursively for nested decays.
668  // Usage: resonanceShower( process, event, iPos, pTmerge), where iPos
669  // maps process to event entries, and pTmerge is the scale at which this
670  // system should be merged into its parent system.
671  bool resonanceShower(Event& process, Event& event, vector<int>& iPos,
672  double qRestart) override;
673 
674  // Utility to print antenna list; for debug mainly (TimeShower).
675  void list() const override;
676 
677  // Initialize data members for calculation of uncertainty bands
678  // (TimeShower, no Vincia implementation yet).
679  // virtual bool initUncertainties();
680 
681  // Tell whether FSR has done a weak emission.
682  bool getHasWeaklyRadiated() override {return hasWeaklyRadiated;}
683 
684  // Tell which system was the last processed one (TimeShower).
685  int system() const override {return iSysWin;}
686 
687  // Potential enhancement factor of pTmax scale for hardest emission.
688  // Used if limitPTmax = true (TimeShower).
689  double enhancePTmax() override {return pTmaxFudge;}
690 
691  // Provide the pT scale of the last branching in the above shower
692  // (TimeShower).
693  double pTLastInShower() override {return pTLastAcceptedSav;}
694 
695  // The following methods for merging not yet implemented in Vincia:
696  // Event clustered()
697  // map<string, double> getStateVariables (const Event &, int, int, int,
698  // string)
699  // bool isTimelike()
700  // vector<string> getSplittingName()
701  // double getSplittingProb()
702  // bool allowedSplitting()
703  // vector<int> getRecoilers()
704 
705  // The remaining public functions Vincia only, i.e. not inherited
706  // from Pythia 8.
707 
708  // Initialise pointers to Vincia objects.
709  void initVinciaPtrs(VinciaColour* colourPtrIn,
710  shared_ptr<VinciaISR> isrPtrIn, MECs* mecsPtrIn,
711  Resolution* resolutionPtrIn, VinciaCommon* vinComPtrIn,
712  VinciaWeights* vinWeightsPtrIn);
713 
714  // Set pointer to object to use for diagnostics and profiling.
715  void setDiagnosticsPtr(shared_ptr<VinciaDiagnostics> diagnosticsPtrIn) {
716  diagnosticsPtr = diagnosticsPtrIn;
717  }
718 
719  // Set EW shower module.
720  void setEWShowerPtr(VinciaModulePtr ewShowerPtrIn) {
721  ewShowerPtr = ewShowerPtrIn;
722  }
723 
724  // Set QED shower module for hard scattering (and resonance decays).
725  void setQEDShowerHardPtr(VinciaModulePtr qedShowerPtrIn) {
726  qedShowerHardPtr = qedShowerPtrIn;
727  }
728 
729  // Set QED shower module for MPI and hadronization.
730  void setQEDShowerSoftPtr(VinciaModulePtr qedShowerPtrIn) {
731  qedShowerSoftPtr = qedShowerPtrIn;
732  }
733 
734  // Initialize pointers to antenna sets.
735  void initAntPtr(AntennaSetFSR* antSetIn) {antSetPtr = antSetIn;}
736 
737  // Wrapper function to return a specific antenna inside an antenna set.
739  return antSetPtr->getAntFunPtr(antFunType);}
740  // Wrapper to return all AntFunTypes that are contained in antSetPtr.
741  vector<enum AntFunType> getAntFunTypes() {
742  return antSetPtr->getAntFunTypes();}
743 
744  // Print header information (version, settings, parameters, etc.).
745  void header();
746 
747  // Communicate information about trial showers for merging.
748  void setIsTrialShower(bool isTrialShowerIn){
749  isTrialShower=isTrialShowerIn;
750  }
751  void setIsTrialShowerRes(bool isTrialShowerResIn){
752  isTrialShowerRes=isTrialShowerResIn;
753  }
754 
755  // Save the flavour content of system in Born state
756  // (needed for sector shower).
757  void saveBornState(int iSys, Event& born);
758  // Save the flavour content of Born for trial shower.
759  void saveBornForTrialShower(Event& born);
760 
761  // Check self-consistency, for specific iSys >= 0 or all systems (iSys < 0).
762  bool check(int iSys, Event &event);
763 
764  // Set verbosity level.
765  void setVerbose(int verboseIn) {verbose = verboseIn;}
766 
767 private:
768 
769  // Constants
770  static const int NLOOPMAX;
771 
772  // Initialize evolution windows.
773  void initEvolutionWindows(void);
774  // Return window Q2.
775  double getQ2Window(int iWindow, double q2cutoff);
776  // Return Lambda value.
777  double getLambda(int nFin, AlphaStrong* aSptr);
778  // Method to return renormalisation-scale prefactor.
779  double getkMu2(bool isEmit);
780  // Method to return renormalisation scale. Default scale is kMu *
781  // evolution scale.
782  double getMu2(bool isEmit);
783  // Reset (or clear) sizes of all containers.
784  void clearContainers();
785  // Method to set up QCD antennae, called in prepare.
786  bool setupQCDantennae(int iSys, Event& event);
787  // Set starting scale of shower (power vs wimpy) for system iSys.
788  void setStartScale(int iSys, Event& event);
789 
790  // Auxiliary method to compute scale for interleaved resonance decays
791  virtual double calcPTresDec(Particle& res) {
792  if (resDecScaleChoice == 0) return res.mWidth();
793  double virt = pow2(res.m()) - pow2(res.m0());
794  if (resDecScaleChoice == 1) return abs(virt) / res.m0();
795  else if (resDecScaleChoice == 2) return sqrt(abs(virt));
796  return 0.;
797  }
798 
799  // Template method for generating the next Q2 for a generic Brancher.
800  template <class T> bool q2NextQCD( vector<shared_ptr<T> > &brancherVec,
801  const map<double, EvolutionWindow>& evWindows, const int evType,
802  const double q2Begin, const double q2End, bool isEmit);
803 
804  // Methods to generate trial scales for each QCD shower component.
805  // Based on the generic template method above.
806  bool q2NextEmitQCD(const double q2Begin, double q2End);
807  bool q2NextSplitQCD(const double q2Begin, double q2End);
808  bool q2NextEmitResQCD(const double q2Begin, const double q2End);
809  bool q2NextSplitResQCD(const double q2Begin, const double q2End);
810  bool q2NextEmitQED(double q2Begin, const double q2End);
811  bool q2NextSplitQED(double q2Begin, const double q2End);
812 
813  // Perform a QCD branching.
814  bool branchQCD(Event& event);
815  // Perform an EW/QED branching.
816  bool branchEW(Event& event);
817 
818  // Perform an early antenna rejection.
819  bool rejectEarly(AntennaFunction* &antFunPtr,bool doMEC);
820  // Compute physical antenna function.
821  double getAntFunPhys(AntennaFunction* &antFunPtr);
822  // Calculate acceptance probability.
823  double pAcceptCalc(double antPhys);
824  // Generate the full kinematics.
825  bool genFullKinematics(int kineMap, Event event, vector<Vec4> &pPost);
826  // Check if a trial is accepted.
827  bool acceptTrial(Event& event);
828  // Generate new particles for the antenna.
829  bool getNewParticles(Event& event, AntennaFunction* antFunPtr,
830  vector<Particle> &newParts);
831 
832  // Generate new helicities for the antenna. Default is to set same
833  // as before, with a new unpolarised emission inserted. If helicity
834  // shower is off, this will correspond to all unpolarised. Do it
835  // this way because in case of resonance decays rest of vector
836  // includes whole resonance system, whose polarisations we don't
837  // want to change, i.e. they only recoil kinematically.
838  vector<int> genHelicities(AntennaFunction* antFunPtr);
839 
840  // ME corrections.
841  double getMEC(int iSys, const Event& event,
842  const vector<Particle>& statePost, VinciaClustering& thisClus);
843 
844  // Update the event.
845  bool updateEvent(Event& event,ResJunctionInfo & junctionInfoIn);
846  // Update the parton systems.
847  void updatePartonSystems();
848  // Create a new emission brancher.
849  void saveEmitterFF(int iSysIn, Event& event, int i0, int i1);
850  // Create a new resonance emission brancher.
851  void saveEmitterRF(int iSys, Event& event, vector<int> allIn,
852  unsigned int posResIn, unsigned int posFIn, bool colMode);
853  // Create a new resonance splitter.
854  void saveSplitterRF(int iSysIn, Event& event, vector<int> allIn,
855  unsigned int posResIn, unsigned int posFIn,bool colMode);
856  // Create a new splitter brancher.
857  void saveSplitterFF(int iSysIn, Event& event, int i0, int i1, bool col2acol);
858  // Update emission branchers due to a recoiled parton.
859  void updateEmittersFF(Event& event, int iOld, int iNew);
860  // Update emission brancher due to an emission.
861  void updateEmitterFF(Event& event, int iOld1, int iOld2, int iNew1,
862  int iNew2);
863  // Update splitter branchers due to a recoiled parton.
864  void updateSplittersFF(Event& event, int iOld, int iNew);
865  // Update splitter brancher due to an emission.
866  void updateSplitterFF(Event& event, int iOld1, int iOld2, int iNew1,
867  int iNew2, bool col2acol);
868  // Remove a splitter due to a gluon that has branched, assumes that
869  // iRemove is splitting gluon.
870  void removeSplitterFF(int iRemove);
871  // Update resonance emitter due to changed downstream decay products.
872  bool updateEmittersRF(int iSysRes, Event& event, int iRes);
873  // Update resonance emitter due to changed downstream decay products.
874  void updateEmittersRF(int iSysRes, Event& event, vector<int> resSysAll,
875  unsigned int posRes, unsigned int posPartner, bool isCol);
876  // Update the antennae.
877  bool updateAntennae(Event& event);
878  // Update systems of QCD antennae after an EW/QED branching.
879  bool updateAfterEW(Event& event, int sizeOld);
880  // Print a brancher lookup.
881  void printLookup(unordered_map< pair<int, bool>, unsigned int>&
882  lookupEmitter, string name);
883  // Print the brancher lookup maps.
884  void printLookup();
885  // Calculate the headroom factor.
886  vector<double> getHeadroom(int iSys, bool isEmit, double q2Next);
887  // Calculate the enhancement factor.
888  vector<double> getEnhance(int iSys, bool isEmit, double q2Next);
889 
890  // Flags if initialized and prepared.
891  bool isInit{}, isPrepared{};
892 
893  // Beam info.
894  double eCMBeamsSav{}, m2BeamsSav{};
895 
896  // Main on/off switches.
897  bool doFF{}, doRF{}, doII{}, doIF{}, doQED{}, doWeak{};
898  int ewMode{}, ewModeMPI{};
899 
900  // Parameter setting which kind of 2->4 modifications (if any) are used.
901  int mode2to4{};
902 
903  // Shower parameters.
904  bool helicityShower{}, sectorShower{};
905  int evTypeEmit{}, evTypeSplit{}, nGluonToQuark{};
906  double q2CutoffEmit{}, q2CutoffSplit{};
907  int nFlavZeroMass{};
908  map<int,int> resSystems;
909  int kMapResEmit{};
910  int kMapResSplit{};
911 
912  // Factorization scale and shower starting settings.
913  int pTmaxMatch{}, pTdampMatch{};
914  double pTmaxFudge{}, pT2maxFudge{}, pT2maxFudgeMPI{}, pTdampFudge{};
915 
916  // AlphaS parameters.
917  bool useCMW{};
918  int alphaSorder{};
919  double alphaSvalue{}, alphaSmax{}, alphaSmuFreeze{}, alphaSmuMin{};
920  double aSkMu2Emit{}, aSkMu2Split{};
921 
922  // Calculated alphaS values.
923  double mu2freeze{}, mu2min{};
924 
925  // Map of qmin evolution window.
926  map<double, EvolutionWindow> evWindowsEmit;
927  map<double, EvolutionWindow> evWindowsSplit;
928 
929  // Lists of different types of antennae.
930  vector< shared_ptr<BrancherEmitRF> > emittersRF;
931  vector< shared_ptr<BrancherEmitFF> > emittersFF;
932  vector< shared_ptr<BrancherSplitRF> > splittersRF;
933  vector< shared_ptr<BrancherSplitFF> > splittersFF;
934 
935  // Look up resonance emitter, bool switches between R (true) or F
936  // (false), n.b. multiply resonance index by sign of colour index
937  // involved in branching to avoid a multiple-valued map.
938  unordered_map< pair<int, bool>, unsigned int> lookupEmitterRF{};
939  unordered_map< pair<int, bool>, unsigned int> lookupSplitterRF{};
940  // Look up emitter, bool switches between col and anticol end
941  unordered_map< pair<int, bool>, unsigned int> lookupEmitterFF{};
942  // Lookup splitter, bool switches between splitter and recoiler.
943  unordered_map< pair<int, bool>, unsigned int> lookupSplitterFF{};
944 
945  // Current winner.
946  BrancherPtr winnerQCD{};
947  VinciaModulePtr winnerEW{};
948  double q2WinSav{}, pTLastAcceptedSav{};
949 
950  // Variables set by branch().
951  int iSysWin{};
952  enum AntFunType antFunTypeWin{AntFunType::NoFun};
953  bool hasWeaklyRadiated{false};
954 
955  // Index of latest emission (slightly arbritrary for splittings but
956  // only used to populate some internal histograms.
957  int iNewSav{};
958 
959  // Storage of the post-branching configuration while it is being built.
960  vector<Particle> pNew;
961  // Total and MEC accept probability.
962  vector<double> pAccept;
963 
964  // Colour reconnection parameters.
965  bool doCR{}, CRjunctions{};
966 
967  // Enhancement switches and parameters.
968  bool enhanceInHard{}, enhanceInResDec{}, enhanceInMPI{};
969  double enhanceAll{}, enhanceBottom{}, enhanceCharm{}, enhanceCutoff{};
970 
971  // Possibility to allow user veto of emission step.
972  bool hasUserHooks{}, canVetoEmission{}, canVetoISREmission{};
973 
974  // Flags to tell a few basic properties of each parton system.
975  map<int, bool> isHardSys{}, isResonanceSys{}, polarisedSys{}, doMECsSys{};
976  map<int, bool> stateChangeSys{};
977  bool stateChangeLast;
978 
979  // Save initial FSR starting scale system by system.
980  map<int, double> q2Hat{};
981  vector<bool> doPTlimit{}, doPTdamp{};
982  map<int, double> pT2damp{};
983 
984  // Count the number of branchings in the system.
985  map<int, int> nBranch, nBranchFSR;
986 
987  // Total mass of showering system.
988  map<int, double> mSystem;
989 
990  // Count numbers of quarks and gluons.
991  map<int, int> nG, nQ, nLep, nGam;
992 
993  // Partons present in the Born (needed in sector shower).
994  map<int, bool> savedBorn;
995  map<int, bool> resolveBorn;
996  map<int, map<int, int>> nFlavsBorn;
997 
998  // Save headroom and enhancement factors for each system for both
999  // emission and splitting branchers.
1000  unordered_map<pair<int, pair<bool,bool> >, vector<double> > headroomSav;
1001  unordered_map<pair<int, pair<bool,bool> >, vector<double> > enhanceSav;
1002 
1003  // Information about resonances that participate in junctions.
1004  map<int, bool> hasResJunction;
1005  map<int, ResJunctionInfo> junctionInfo;
1006 
1007  // Flags used in merging.
1008  bool doMerging, isTrialShower, isTrialShowerRes;
1009 
1010  // Verbose settings.
1011  int verbose{};
1012  bool headerIsPrinted{};
1013 
1014  // Diagnostics.
1015  shared_ptr<VinciaDiagnostics> diagnosticsPtr{};
1016 
1017  // Debug settings.
1018  bool allowforceQuit{}, forceQuit{};
1019  int nBranchQuit{};
1020 
1021  // Zeta generators for trial generators.
1022  ZetaGeneratorSet zetaGenSetRF;
1023  ZetaGeneratorSet zetaGenSetFF;
1024 
1025  // Pointers to VINCIA objects.
1026  AntennaSetFSR* antSetPtr{};
1027  MECs* mecsPtr{};
1028  VinciaColour* colourPtr{};
1029  Resolution* resolutionPtr{};
1030  shared_ptr<VinciaISR> isrPtr{};
1031  VinciaCommon* vinComPtr{};
1032  VinciaWeights* weightsPtr{};
1033 
1034  // Electroweak shower pointers.
1035  VinciaModulePtr ewShowerPtr{};
1036  VinciaModulePtr qedShowerHardPtr{};
1037  VinciaModulePtr qedShowerSoftPtr{};
1038  // Pointer to either ewShowerPtr or qedShowerHardPtr depending on ewMode.
1039  VinciaModulePtr ewHandlerHard{};
1040 
1041  // Pointer to AlphaS instances.
1042  AlphaStrong* aSemitPtr{};
1043  AlphaStrong* aSsplitPtr{};
1044 
1045  // Settings and member variables for interleaved resonance decays
1046  bool doFSRinResonances{true}, doInterleaveResDec{true};
1047  int resDecScaleChoice{-1}, iHardResDecSav{}, nRecurseResDec{};
1048  vector<int> idResDecSav, iPosBefSav;
1049  vector<double> pTresDecSav;
1050 
1051 };
1052 
1053 //==========================================================================
1054 
1055 } // end namespace Pythia8
1056 
1057 #endif // Pythia8_VinciaFSR_H
History class for the Vincia shower.
Definition: VinciaHistory.h:247
virtual int idNew() const
Definition: VinciaFSR.h:157
constexpr double pow2(const double &x)
Powers of small integers - for balance speed/code clarity.
Definition: PythiaStdlib.h:182
~VinciaFSR()
Destructor.
Definition: VinciaFSR.h:598
virtual int getSector()
Return sector label.
Definition: VinciaFSR.h:187
virtual ~Brancher()
Base class must have a virtual destructor.
Definition: VinciaFSR.h:75
Brancher(int iSysIn, Event &event, bool sectorShowerIn, int iIn0, int iIn1, int iIn2=0)
Wrapper for 2- and 3-parton parents.
Definition: VinciaFSR.h:69
Definition: StandardModel.h:23
bool hasTrial() const
Definition: VinciaFSR.h:203
The Event class holds all info on the generated event.
Definition: Event.h:453
The TimeShower class does timelike showers.
Definition: TimeShower.h:33
Definition: BeamParticle.h:133
Simple struct to store information about a 3 -> 2 clustering.
Definition: VinciaCommon.h:278
virtual int posF() const
Definition: VinciaFSR.h:184
BrancherSplitFF(int iSysIn, Event &event, bool sectorShowerIn, int iIn0, int iIn1, bool col2acol, ZetaGeneratorSet *zetaGenSet)
Definition: VinciaFSR.h:346
vector< enum AntFunType > getAntFunTypes()
Wrapper to return all AntFunTypes that are contained in antSetPtr.
Definition: VinciaFSR.h:741
Definition: VinciaCommon.h:211
Definition: VinciaFSR.h:481
void setIsTrialShower(bool isTrialShowerIn)
Communicate information about trial showers for merging.
Definition: VinciaFSR.h:748
int iEndCol
Which of the three ends of iJunction are we talking about.
Definition: VinciaFSR.h:38
virtual int idNew() const
Flavour and mass of emitted particle.
Definition: VinciaFSR.h:362
void eraseTrial()
Method to mark new trial needed and erase current one.
Definition: VinciaFSR.h:212
BrancherEmitRF(int iSysIn, Event &event, bool sectorShowerIn, vector< int > allIn, unsigned int posResIn, unsigned int posFIn, double q2cut, ZetaGeneratorSet *zetaGenSet)
Constructor.
Definition: VinciaFSR.h:486
int posF() const
Definition: VinciaFSR.h:438
Definition: Logger.h:23
Definition: VinciaFSR.h:33
virtual int posR() const
Definition: VinciaFSR.h:180
AntFunType
Enumerator for antenna function types, with "void" member NoFun.
Definition: VinciaCommon.h:66
BrancherEmitFF(int iSysIn, Event &event, bool sectorShowerIn, int iIn0, int iIn1, ZetaGeneratorSet *zetaGenSet)
Wrapper to provide simple 2-parton systems as parents.
Definition: VinciaFSR.h:278
virtual double pAccept(const double, Logger *, int=0)
Definition: VinciaFSR.h:146
Definition: VinciaFSR.h:582
Definition: Basics.h:385
Definition: VinciaCommon.h:494
virtual int idNew() const
Flavour and mass of emitted particle.
Definition: VinciaFSR.h:312
Definition: VinciaISR.h:1060
void initRF(Event &event, vector< int > allIn, unsigned int posResIn, unsigned int posFIn, double q2cut, ZetaGeneratorSet *zetaGenSet) override
RF branchers have a different initBrancher structure.
Definition: VinciaFSR.h:549
Definition: VinciaAntennaFunctions.h:65
double enhancePTmax() override
Definition: VinciaFSR.h:689
int system() const
Methods to return saved/derived quantities.
Definition: VinciaFSR.h:123
int iEndQuark
Definition: VinciaFSR.h:43
void setVerbose(int verboseIn)
Set verbosity level.
Definition: VinciaFSR.h:765
AntennaFunction * getAntFunPtr(enum AntFunType antFunType)
Wrapper function to return a specific antenna inside an antenna set.
Definition: VinciaFSR.h:738
Class BrancherSplitFF, branch elemental for 2->3 gluon splittings.
Definition: VinciaFSR.h:331
int system() const override
Tell which system was the last processed one (TimeShower).
Definition: VinciaFSR.h:685
VinciaFSR()
Constructor.
Definition: VinciaFSR.h:591
void setEWShowerPtr(VinciaModulePtr ewShowerPtrIn)
Set EW shower module.
Definition: VinciaFSR.h:720
void onBeginEvent() override
Force reset at beginning of each event.
Definition: VinciaFSR.h:609
vector< int > colours
Definition: VinciaFSR.h:48
Class for storing Vincia weights.
Definition: VinciaWeights.h:22
TrialGenType
Helpful enums.
Definition: VinciaTrialGenerators.h:19
Class BrancherEmitFF, branch elemental for 2->3 gluon emissions.
Definition: VinciaFSR.h:265
void resetRF(int iSysIn, Event &event, vector< int > allIn, unsigned int posResIn, unsigned int posFIn, double q2cut, ZetaGeneratorSet *zetaGenSet)
Reset the brancher.
Definition: VinciaFSR.h:425
vector< double > getInvariants()
Return the saved invariants.
Definition: VinciaFSR.h:196
Definition: Event.h:32
void initRF(Event &event, vector< int > allIn, unsigned int posResIn, unsigned int posFIn, double q2cut, ZetaGeneratorSet *zetaGenSet) override
RF branchers have a different initBrancher structure.
Definition: VinciaFSR.h:497
void setQEDShowerSoftPtr(VinciaModulePtr qedShowerPtrIn)
Set QED shower module for MPI and hadronization.
Definition: VinciaFSR.h:730
void initAntPtr(AntennaSetFSR *antSetIn)
Initialize pointers to antenna sets.
Definition: VinciaFSR.h:735
bool getHasWeaklyRadiated() override
Tell whether FSR has done a weak emission.
Definition: VinciaFSR.h:682
bool isSwapped()
Check if swapped.
Definition: VinciaFSR.h:194
void needsNewTrial()
Method to mark new trial needed without erasing current one.
Definition: VinciaFSR.h:205
A simple class for containing evolution variable definitions.
Definition: VinciaCommon.h:382
virtual bool isXG() const
Definition: VinciaFSR.h:359
Definition: VinciaFSR.h:533
BranchType
(Default is used for soft, global, or splittings as appropriate.)
Definition: VinciaTrialGenerators.h:21
Definition: VinciaTrialGenerators.h:218
double m2(const Vec4 &v1)
The squared invariant mass of one or more four-vectors.
Definition: Basics.cc:586
Helper struct for passing trial-alphaS information.
Definition: VinciaTrialGenerators.h:33
int posR() const
Return position of resonance and colour-connected final-state parton.
Definition: VinciaFSR.h:437
Definition: VinciaFSR.h:58
The AntennaSetFSR class. Simple container of FF and RF antenna functions.
Definition: VinciaAntennaFunctions.h:1125
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
map< int, pair< int, int > > mothers2daughters
Publicly accessible members for storing mother/daughter connections.
Definition: VinciaFSR.h:223
double getQ2Max(int evType)
Return maximum Q2.
Definition: VinciaFSR.h:441
double pTnextResDec() override
Select next pT for interleaved resonance decays.
Definition: VinciaFSR.h:651
Brancher(int iSysIn, Event &event, bool sectorShowerIn, vector< int > iIn)
Main base class constructor.
Definition: VinciaFSR.h:63
Definition: VinciaAntennaFunctions.h:1258
int iEndColTag
What is the colour tag of iEndCol in iJunctions.
Definition: VinciaFSR.h:40
int iJunction
Number of junction in event record.
Definition: VinciaFSR.h:36
void setQEDShowerHardPtr(VinciaModulePtr qedShowerPtrIn)
Set QED shower module for hard scattering (and resonance decays).
Definition: VinciaFSR.h:725
void setDiagnosticsPtr(shared_ptr< VinciaDiagnostics > diagnosticsPtrIn)
Set pointer to object to use for diagnostics and profiling.
Definition: VinciaFSR.h:715
BrancherEmitFF(int iSysIn, Event &event, bool sectorShowerIn, vector< int > iIn, ZetaGeneratorSet *zetaGenSet)
Create branch elemental for antenna(e) with parents in iIn.
Definition: VinciaFSR.h:270
double pTLastInShower() override
Definition: VinciaFSR.h:693
BrancherRF(int iSysIn, Event &event, bool sectorShowerIn, vector< int > allIn)
Base class constructor = inherited from Brancher.
Definition: VinciaFSR.h:416
BrancherSplitRF(int iSysIn, Event &event, bool sectorShowerIn, vector< int > allIn, unsigned int posResIn, unsigned int posFIn, double q2cut, ZetaGeneratorSet *zetaGenSet)
Constructor.
Definition: VinciaFSR.h:538
BrancherSplitFF(int iSysIn, Event &event, bool sectorShowerIn, vector< int > iIn, ZetaGeneratorSet *zetaGenSet)
Create branch elemental for antenna(e) with parents in iIn.
Definition: VinciaFSR.h:336
int i0() const
Methods to get (explicit for up to 3 parents, otherwise just use iVec).
Definition: VinciaFSR.h:86
void reset(int iSysIn, Event &event, int i0In, int i1In, int i2In=0)
Wrapper for simple 2- (or 3-) parton antennae.
Definition: VinciaFSR.h:81
BrancherRF base class for resonance-final antennae.
Definition: VinciaFSR.h:411
void resetEnhanceFac(const double enhanceIn)
This method allows to reset enhanceFac if we do an accept/reject.
Definition: VinciaFSR.h:199
virtual bool genInvariants(vector< double > &invariants, Rndm *, int, Logger *)
Definition: VinciaFSR.h:140