PYTHIA  8.311
VinciaAntennaFunctions.h
1 // VinciaAntennaFunctions.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 AntennaFunction base
7 // class, its derived classes for FF, IF, and II antenna functions,
8 // the AntennaSetFSR and AntennaSetISR classes, and the MEC class for
9 // matrix- element corrections.
10 
11 #ifndef Pythia8_VinciaAntennaFunctions_H
12 #define Pythia8_VinciaAntennaFunctions_H
13 
14 // Pythia headers.
15 #include "Pythia8/Basics.h"
16 #include "Pythia8/Event.h"
17 #include "Pythia8/PythiaStdlib.h"
18 #include "Pythia8/ExternalMEs.h"
19 
20 // Vincia headers.
21 #include "Pythia8/VinciaCommon.h"
22 
23 namespace Pythia8 {
24 
25 //==========================================================================
26 
27 // A class containing DGLAP splitting functions for limit checking.
28 
29 class DGLAP {
30 
31 public:
32 
33  // Constructor.
34  DGLAP() {;}
35 
36  // Helicity-dependent Altarelli-Parisi kernels (mu = m/Q). Note,
37  // Pg2gg is written with standard factor 2 normalization convention.
38  double Pg2gg(double z, int hA=9, int hB=9, int hC=9);
39  double Pg2qq(double z, int hA=9, int hB=9, int hC=9, double mu=0.);
40  double Pq2qg(double z, int hA=9, int hB=9, int hC=9, double mu=0.);
41  double Pq2gq(double z, int hA=9, int hB=9, int hC=9, double mu=0.);
42 
43  // Wrappers to get unpolarized massive Altarelli-Pariis kernels (mu = m/Q).
44  double Pg2qq(double z, double mu) {return Pg2qq(z, 9, 9, 9, mu);}
45  double Pq2qg(double z, double mu) {return Pq2qg(z, 9, 9, 9, mu);}
46  double Pq2gq(double z, double mu) {return Pq2gq(z, 9, 9, 9, mu);}
47 
48  // Altarelli-Parisi kernels with linear in/out polarizations for
49  // gluons: pol = +1 for in-plane, -1 for out-of-plane.
50  double Pg2ggLin(double z, int polA = 9, int polB = 9, int polC = 9);
51  double Pg2qqLin(double z, int polA = 9, int hB = 9, int hC = 9,
52  double mu = 0.);
53  double Pq2qgLin(double z, int hA = 9, int hB=9, int polC = 9,
54  double mu = 0.);
55  double Pq2gqLin(double z, int hA = 9, int polB=9, int hC = 9,
56  double mu = 0.);
57 
58 };
59 
60 //==========================================================================
61 
62 // The AntennaFunction base class. Base class implementation for all
63 // AntennaFunction objects.
64 
66 
67 public:
68 
69  // Constructor.
70  AntennaFunction() = default;
71 
72  // Destructor.
73  virtual ~AntennaFunction() {};
74 
75  // Names of this antenna, for VINCIA, and for humans.
76  virtual string vinciaName() const = 0;
77 
78  // Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
79  virtual int idA() const = 0;
80  virtual int idB() const = 0;
81  virtual int id1() const = 0;
82 
83  // The antenna function [GeV^-2].
84  virtual double antFun(vector<double> invariants, vector<double> mNew,
85  vector<int> helBef, vector<int> helNew) = 0;
86 
87  // Optional implementation of the DGLAP kernels for collinear-limit checks
88  // Defined as PI/sij + PK/sjk, i.e. equivalent to antennae.
89  virtual double AltarelliParisi(vector<double> invariants,
90  vector<double> mNew, vector<int> helBef, vector<int> helNew) = 0;
91 
92  // Default initialization.
93  virtual bool init();
94 
95  // Construct baseName from idA, idB, and id1.
96  virtual string baseName() const {
97  return id2str(id1()) + "/" + id2str(idA()) + id2str(idB());}
98 
99  // Wrapper that can modify baseName to more human readable form if required.
100  virtual string humanName() const {return baseName();}
101 
102  // Function to check singularities, positivity, etc.
103  virtual bool check();
104 
105  // Method to intialise mass values.
106  virtual void initMasses(vector<double>* masses) {
107  if (masses->size() >= 3) {
108  mi = masses->at(0); mj = masses->at(1); mk = masses->at(2);
109  } else {mi = 0.0; mj = 0.0; mk = 0.0;}}
110 
111  // Method to initialise internal helicity variables.
112  virtual int initHel(vector<int>* helBef, vector<int>* helNew);
113 
114  // Wrapper for helicity-summed/averaged antenna function.
115  double antFun(vector<double> invariants, vector<double> masses) {
116  return antFun(invariants, masses, hDum, hDum);}
117 
118  // Wrapper for massless, helicity-summed/averaged antenna function.
119  double antFun(vector<double> invariants) {
120  return antFun(invariants, mDum, hDum, hDum);}
121 
122  // Wrapper without helicity assignments.
123  double AltarelliParisi(vector<double> invariants, vector<double> masses) {
124  return AltarelliParisi(invariants, masses, hDum, hDum);}
125 
126  // Wrapper for massless helicity-summed/averaged DGLAP kernels.
127  double AltarelliParisi(vector<double> invariants) {
128  return AltarelliParisi(invariants, mDum, hDum, hDum);}
129 
130  // Initialize pointers.
131  void initPtr(Info* infoPtrIn, DGLAP* dglapPtrIn);
132 
133  // Get parameters.
134  double chargeFac() {return chargeFacSav;}
135  int kineMap() {return kineMapSav;}
136  double alpha() {return alphaSav;}
137  double sectorDamp() {return sectorDampSav;}
138 
139  // Functions to get Altarelli-Parisi energy fractions from invariants.
140  double zA(vector<double> invariants) {
141  double yij = invariants[1]/invariants[0];
142  double yjk = invariants[2]/invariants[0];
143  return (1.-yjk)/(1.+yij);}
144  double zB(vector<double> invariants) {
145  double yij = invariants[1]/invariants[0];
146  double yjk = invariants[2]/invariants[0];
147  return (1.-yij)/(1.+yjk);}
148 
149  // Auxiliary function to translate an ID code to a string.
150  string id2str(int id) const;
151 
152 protected:
153 
154  // Is initialized.
155  bool isInitPtr{false}, isInit{false};
156 
157  // Charge factor, kinematics map, and subleading-colour treatment.
158  double chargeFacSav{0.0};
159  int kineMapSav{0}, modeSLC{-1};
160  bool sectorShower{false};
161 
162  // The alpha collinear-partitioning parameter.
163  double alphaSav{0.0};
164 
165  // The sector-shower collinear dampening parameter.
166  double sectorDampSav{0.0};
167 
168  // Shorthand for commonly used variable(s).
169  double term{}, preFacFiniteTermSav{0.0}, antMinSav{0.0};
170  bool isMinVar{};
171 
172  // Variables for internal storage of masses and helicities.
173  double mi{0.0}, mj{0.0}, mk{0.0};
174  int hA{9}, hB{9}, hi{9}, hj{9}, hk{9};
175 
176  // Map to tell whether a given helicity value maps to L- and/or
177  // R-handed. Defined by constructor and not to be changed
178  // dynamically.
179  map<int, bool> LH{{9, true}, {1, false}, {-1, true}};
180  map<int, bool> RH{{9, true}, {1, true}, {-1, false}};
181 
182  // Verbosity level.
183  int verbose{1};
184 
185  // Pointers to Pythia8 classes.
186  Info* infoPtr{};
187  ParticleData* particleDataPtr{};
188  Settings* settingsPtr{};
189  Rndm* rndmPtr{};
190  Logger* loggerPtr{};
191 
192  // Pointer to VINCIA DGLAP class.
193  DGLAP* dglapPtr{};
194 
195  // Dummy vectors.
196  vector<double> mDum{0, 0, 0, 0};
197  vector<int> hDum{9, 9, 9, 9};
198 
199 };
200 
201 //==========================================================================
202 
203 // Class AntQQEmitFF, final-final antenna function.
204 
205 class AntQQEmitFF : public AntennaFunction {
206 
207 public:
208 
209  // Names (remember to redefine both for each inherited class).
210  virtual string vinciaName() const {return "Vincia:QQEmitFF";};
211 
212  // Functions needed by soft- and collinear-limit checks (AB -> 0i 1j 2k).
213  virtual int idA() const {return 1;}
214  virtual int idB() const {return -1;}
215  virtual int id1() const {return 21;}
216 
217  // The antenna function [GeV^-2].
218  virtual double antFun(vector<double> invariants, vector<double> mNew,
219  vector<int> helBef, vector<int> helNew);
220 
221  // Function to give Altarelli-Parisi limits of this antenna.
222  // Defined as PI/sij + PK/sjk, i.e. equivalent to antennae.
223  virtual double AltarelliParisi(vector<double> invariants,
224  vector<double>, vector<int> helBef, vector<int> helNew);
225 
226 };
227 
228 //==========================================================================
229 
230 // Class AntQGEmitFF, final-final antenna function.
231 
232 class AntQGEmitFF : public AntennaFunction {
233 
234 public:
235 
236  // Names (remember to redefine both for each inherited class).
237  virtual string vinciaName() const {return "Vincia:QGEmitFF";};
238 
239  // Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
240  virtual int idA() const {return 1;}
241  virtual int idB() const {return 21;}
242  virtual int id1() const {return 21;}
243 
244  // The antenna function [GeV^-2].
245  virtual double antFun(vector<double> invariants,
246  vector<double> mNew, vector<int> helBef, vector<int> helNew);
247 
248  // Function to give Altarelli-Parisi limits of this antenna.
249  virtual double AltarelliParisi(vector<double> invariants,
250  vector<double> /* mNew */, vector<int> helBef, vector<int> helNew);
251 
252 };
253 
254 //==========================================================================
255 
256 // Class AntGQEmitFF, final-final antenna function.
257 
258 class AntGQEmitFF : public AntQGEmitFF {
259 
260 public:
261 
262  // Names (remember to redefine both for each inherited class).
263  virtual string vinciaName() const {return "Vincia:GQEmitFF";};
264 
265  // Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
266  virtual int idA() const {return 21;}
267  virtual int idB() const {return -1;}
268  virtual int id1() const {return 21;}
269 
270  // The antenna function [GeV^-2] (derived from AntQGEmit by swapping).
271  virtual double antFun(vector<double> invariants,
272  vector<double> mNew, vector<int> helBef, vector<int> helNew);
273 
274  // Function to give Altarelli-Parisi limits of this antenna.
275  virtual double AltarelliParisi(vector<double> invariants,
276  vector<double>, vector<int> helBef, vector<int> helNew);
277 
278 };
279 
280 //==========================================================================
281 
282 // Class AntGQEmitFF, final-final antenna function.
283 
284 class AntGGEmitFF : public AntennaFunction {
285 
286 public:
287 
288  // Names (remember to redefine both for each inherited class).
289  virtual string vinciaName() const {return "Vincia:GGEmitFF";};
290 
291  // Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
292  virtual int idA() const {return 21;}
293  virtual int idB() const {return 21;}
294  virtual int id1() const {return 21;}
295 
296  // The antenna function [GeV^-2].
297  virtual double antFun(vector<double> invariants,
298  vector<double> mNew, vector<int> helBef, vector<int> helNew);
299 
300  // Function to give Altarelli-Parisi limits of this antenna.
301  virtual double AltarelliParisi(vector<double> invariants,
302  vector<double>, vector<int> helBef, vector<int> helNew);
303 
304 };
305 
306 //==========================================================================
307 
308 // Class AntGXSplitFF, final-final antenna function.
309 
311 
312 public:
313 
314  // Names (remember to redefine both for each inherited class).
315  virtual string vinciaName() const {return "Vincia:GXSplitFF";};
316 
317  // Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
318  virtual int idA() const {return 21;}
319  virtual int idB() const {return 0;}
320  virtual int id1() const {return -1;}
321 
322  // The antenna function [GeV^-2].
323  virtual double antFun(vector<double> invariants,
324  vector<double> mNew, vector<int> helBef, vector<int> helNew);
325 
326  // Function to give Altarelli-Parisi limits of this antenna.
327  virtual double AltarelliParisi(vector<double> invariants,
328  vector<double>, vector<int> helBef, vector<int> helNew);
329 
330 };
331 
332 //==========================================================================
333 
334 // Class AntQQEmitFFsec, sector final-final antenna function, identical
335 // to global one.
336 
337 class AntQQEmitFFsec : public AntQQEmitFF {};
338 
339 //==========================================================================
340 
341 // Class AntQGEmitFFsec, sector final-final antenna function, explicit
342 // symmetrisation of AntQGEmitFF.
343 
344 class AntQGEmitFFsec : public AntQGEmitFF {
345 
346 public:
347 
348  // The antenna function [GeV^-2].
349  virtual double antFun(vector<double> invariants,
350  vector<double> mNew, vector<int> helBef, vector<int> helNew);
351 
352 };
353 
354 //==========================================================================
355 
356 // Class AntGQEmitFFsec, sector final-final antenna function, explicit
357 // symmetrisation of AntGQEmitFF.
358 
360 
361 public:
362 
363  // Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
364  virtual int idA() const {return 21;}
365  virtual int idB() const {return -1;}
366  virtual int id1() const {return 21;}
367 
368  // The antenna function [GeV^-2] (derived from AntQGEmitFFsec by swapping).
369  virtual double antFun(vector<double> invariants,
370  vector<double> mNew, vector<int> helBef, vector<int> helNew);
371 
372  // Function to give Altarelli-Parisi limits of this antenna.
373  virtual double AltarelliParisi(vector<double> invariants,
374  vector<double>, vector<int> helBef, vector<int> helNew);
375 
376 };
377 
378 //==========================================================================
379 
380 // Class AntGGEmitFFsec, sector final-final antenna function, explicit
381 // symmetrisation of AntGGEmitFF.
382 
383 class AntGGEmitFFsec : public AntGGEmitFF {
384 
385 public:
386 
387  // The dimensionless antenna function.
388  virtual double antFun(vector<double> invariants, vector<double> mNew,
389  vector<int> helBef, vector<int> helNew);
390 
391 };
392 
393 //==========================================================================
394 
395 // Class AntGXSplitFFsec, sector final-final antenna function, explicit
396 // symmetrisation of AntGXSplitFF.
397 
399 
400  public:
401 
402  // The antenna function [GeV^-2].
403  virtual double antFun(vector<double> invariants, vector<double> mNew,
404  vector<int> helBef, vector<int> helNew);
405 
406 };
407 
408 //==========================================================================
409 
410 // Class AntennaFunctionIX, base class for initial-initial and
411 // initial-final antenna functions which implements II. All derived
412 // classes for initial-initial antenna functions are the same for
413 // global and sector cases since even the global ones include sector
414 // terms representing "emission into the initial state".
415 
417 
418 public:
419 
420  // Method to initialise (can be different than that of the base class).
421  virtual bool init() override;
422 
423  // Names (remember to redefine both for each inherited class).
424  virtual string vinciaName() const override {
425  return "Vincia:AntennaFunctionIX";}
426 
427  // Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
428  virtual int idA() const override {return 0;}
429  virtual int idB() const override {return 0;}
430  virtual int id0() const {return 0;}
431  virtual int id1() const override {return 0;}
432  virtual int id2() const {return 0;}
433 
434  // Functions to get Altarelli-Parisi energy fractions.
435  virtual double zA(vector<double> invariants) {double sAB = invariants[0];
436  double sjb = invariants[2]; return sAB/(sAB+sjb);}
437  virtual double zB(vector<double> invariants) {double sAB = invariants[0];
438  double saj = invariants[1]; return sAB/(sAB+saj);}
439 
440  // Function to tell if this is an II antenna.
441  virtual bool isIIant() {return true;}
442 
443  // Function to check singularities, positivity, etc.
444  virtual bool check() override;
445 
446 };
447 
448 //==========================================================================
449 
450 // Class AntQQEmitII, initial-initial antenna function.
451 
453 
454 public:
455 
456  // Names (remember to redefine both for each inherited class).
457  virtual string vinciaName() const override {return "Vincia:QQEmitII";}
458 
459  // Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
460  virtual int idA() const override {return 1;}
461  virtual int idB() const override {return -1;}
462  virtual int id0() const override {return 1;}
463  virtual int id1() const override {return 21;}
464  virtual int id2() const override {return -1;}
465 
466  // The antenna function [GeV^-2].
467  virtual double antFun(vector<double> invariants, vector<double> masses,
468  vector<int> helBef, vector<int> helNew) override;
469 
470  // AP splitting kernel for collinear limit checks.
471  virtual double AltarelliParisi(vector<double> invariants,
472  vector<double>, vector<int> helBef, vector<int> helNew) override;
473 
474 };
475 
476 //==========================================================================
477 
478 // Class AntGQEmitII, initial-initial antenna function.
479 
481 
482 public:
483 
484  // Names (remember to redefine both for each inherited class).
485  virtual string vinciaName() const override {return "Vincia:GQEmitII";}
486 
487  // Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
488  virtual int idA() const override {return 21;}
489  virtual int idB() const override {return 1;}
490  virtual int id0() const override {return 21;}
491  virtual int id1() const override {return 21;}
492  virtual int id2() const override {return 1;}
493 
494  // The antenna function.
495  virtual double antFun(vector<double> invariants, vector<double> masses,
496  vector<int> helBef, vector<int> helNew) override;
497 
498  // AP splitting kernel for collinear limit checks.
499  virtual double AltarelliParisi(vector<double> invariants,
500  vector<double>, vector<int> helBef, vector<int> helNew) override;
501 
502 };
503 
504 //==========================================================================
505 
506 // Class AntGGEmitII, initial-initial antenna function.
507 
509 
510 public:
511 
512  // Names (remember to redefine both for each inherited class).
513  virtual string vinciaName() const override {return "Vincia:GGEmitII";}
514 
515  // Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
516  virtual int idA() const override {return 21;}
517  virtual int idB() const override {return 21;}
518  virtual int id0() const override {return 21;}
519  virtual int id1() const override {return 21;}
520  virtual int id2() const override {return 21;}
521 
522  // The antenna function [GeV^-2].
523  virtual double antFun(vector<double> invariants, vector<double> masses,
524  vector<int> helBef, vector<int> helNew) override;
525 
526  // AP splitting kernel, P(z)/Q2.
527  virtual double AltarelliParisi(vector<double> invariants,
528  vector<double>, vector<int> helBef, vector<int> helNew) override;
529 
530 };
531 
532 //==========================================================================
533 
534 // Class AntQXConvII, initial-initial antenna function. splitting is in
535 // the forwards sense, i.e. quark backwards evolving to a gluon and
536 // emitting an antiquark in the final state.
537 
539 
540 public:
541 
542  // Names (remember to redefine both for each inherited class).
543  virtual string vinciaName() const override { return "Vincia:QXConvII";}
544 
545  // Parton types AB -> 0a 1j 2b with A,B, a,b initial and j final.
546  virtual int idA() const override {return 1;}
547  virtual int idB() const override {return 0;}
548  virtual int id0() const override {return 21;}
549  virtual int id1() const override {return -1;}
550  virtual int id2() const override {return 0;}
551 
552  // The antenna function [GeV^-2].
553  virtual double antFun(vector<double> invariants, vector<double> masses,
554  vector<int> helBef, vector<int> helNew) override;
555 
556  // AP splitting kernel, P(z)/Q2.
557  virtual double AltarelliParisi(vector<double> invariants,
558  vector<double>, vector<int> helBef, vector<int> helNew) override;
559 
560  // Mark that this function has no zB collinear limit.
561  virtual double zB(vector<double>) override {return -1.0;}
562 
563 };
564 
565 //==========================================================================
566 
567 // Class AntGXConvII, initial-initial antenna function. Gluon evolves
568 // backwards into a quark and emits a quark in the final state.
569 
571 
572 public:
573 
574  // Names (remember to redefine both for each inherited class).
575  virtual string vinciaName() const override {return "Vincia:GXConvII";}
576 
577  // Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
578  virtual int idA() const override {return 21;}
579  virtual int idB() const override {return 0;}
580  virtual int id0() const override {return 2;}
581  virtual int id1() const override {return 2;}
582  virtual int id2() const override {return 0;}
583 
584  // The antenna function [GeV^-2].
585  virtual double antFun(vector<double> invariants, vector<double> masses,
586  vector<int> helBef, vector<int> helNew) override;
587 
588  // AP splitting kernel, P(z)/Q2.
589  virtual double AltarelliParisi(vector<double> invariants,
590  vector<double>, vector<int> helBef, vector<int> helNew) override;
591 
592  // Mark that this function has no zB collinear limit.
593  virtual double zB(vector<double>) override {return -1.0;}
594 
595 };
596 
597 //==========================================================================
598 
599 // Class AntennaFunctionIF, base class for IF/RF antenna functions
600 // which implements AntQQEmitIF. Derived classes are for global
601 // initial-final and resonance-final antenna functions. The method
602 // isRFant() distinguishes between the two.
603 
605 
606 public:
607 
608  // Method to initialise (can be different than that of the base class).
609  virtual bool init() override;
610 
611  // Function to check singularities, positivity, etc.
612  virtual bool check() override;
613 
614  // Names (remember to redefine both for each inherited class).
615  virtual string vinciaName() const override {
616  return "Vincia:AntennaFunctionIF";}
617 
618  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
619  virtual int idA() const override {return 1;}
620  virtual int idB() const override {return -1;}
621  virtual int id0() const override {return 1;}
622  virtual int id1() const override {return 21;}
623  virtual int id2() const override {return -1;}
624 
625  // Functions to get Altarelli-Parisi energy fractions.
626  virtual double zA(vector<double> invariants) override {
627  double sAK(invariants[0]), sjk(invariants[2]); return sAK/(sAK+sjk);}
628  virtual double zB(vector<double> invariants) override {
629  double sAK(invariants[0]), saj(invariants[1]); return (sAK-saj)/sAK;}
630 
631  // Methods to tell II, IF, and RF apart.
632  virtual bool isIIant() override {return false;}
633  virtual bool isRFant() {return false;}
634 
635  // Check for resonances.
636  virtual bool checkRes();
637 
638  // Create the test masses for the checkRes method.
639  virtual void getTestMasses(vector<double> &masses) {masses.resize(4, 0.0);}
640 
641  // Create the test invariants for the checkRes method.
642  virtual bool getTestInvariants(vector<double> &invariants,
643  vector<double> masses, double yaj, double yjk);
644 
645 protected:
646 
647  // Massive eikonal factor, n.b. is positive definite - proportional
648  // to gram determinant.
649  double massiveEikonal(double saj, double sjk, double sak,
650  double m_a, double m_k) {return 2.0*sak/(saj*sjk) - 2.0*m_a*m_a/(saj*saj)
651  - 2.0*m_k*m_k/(sjk*sjk);}
652 
653  // Massive eikonal factor, given invariants and masses.
654  double massiveEikonal(vector<double> invariants, vector<double> masses) {
655  return massiveEikonal(invariants[1], invariants[2], invariants[3],
656  masses[0], masses[2]);}
657 
658  // Return the Gram determinant.
659  double gramDet(vector<double> invariants, vector<double> masses) {
660  double saj(invariants[1]), sjk(invariants[2]), sak(invariants[3]),
661  mares(masses[0]), mjres(masses[1]), mkres(masses[2]);
662  return 0.25*(saj*sjk*sak - saj*saj*mkres*mkres -sak*sak*mjres*mjres
663  - sjk*sjk*mares*mares + 4.0*mares*mares*mjres*mjres*mkres*mkres);}
664 
665  // Wrapper for comparing to AP functions, sums over flipped
666  // invariants where appropriate.
667  double antFunCollLimit(vector<double> invariants,vector<double> masses);
668 
669 };
670 
671 //==========================================================================
672 
673 // Class AntQQEmitIF, initial-final antenna function.
674 
676 
677 public:
678 
679  // Names (remember to redefine both for each inherited class).
680  virtual string vinciaName() const override { return "Vincia:QQEmitIF";}
681 
682  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
683  virtual int idA() const override {return 1;}
684  virtual int idB() const override {return -1;}
685  virtual int id0() const override {return 1;}
686  virtual int id1() const override {return 21;}
687  virtual int id2() const override {return -1;}
688 
689  // The antenna function [GeV^-2].
690  virtual double antFun(vector<double> invariants, vector<double> masses,
691  vector<int> helBef, vector<int> helNew) override;
692 
693  // The AP kernel, P(z)/Q2.
694  virtual double AltarelliParisi(vector<double> invariants,
695  vector<double>, vector<int> helBef, vector<int> helNew) override;
696 
697  // Functions to get Altarelli-Parisi energy fractions.
698  virtual double zA(vector<double> invariants) override {
699  double sAK(invariants[0]), sjk(invariants[2]); return sAK/(sAK+sjk);}
700  virtual double zB(vector<double> invariants) override {
701  double sAK(invariants[0]), saj(invariants[1]); return (sAK-saj)/sAK;}
702 
703 };
704 
705 //==========================================================================
706 
707 // Class AntQGEmitIF, initial-final antenna function.
708 
710 
711 public:
712 
713  // Names (remember to redefine both for each inherited class).
714  virtual string vinciaName() const override {return "Vincia:QGEmitIF";}
715 
716  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
717  virtual int idA() const override {return 1;}
718  virtual int idB() const override {return 21;}
719  virtual int id0() const override {return 1;}
720  virtual int id1() const override {return 21;}
721  virtual int id2() const override {return 21;}
722 
723  // The antenna function [GeV^-2].
724  virtual double antFun(vector<double> invariants, vector<double> masses,
725  vector<int> helBef, vector<int> helNew) override;
726 
727  // The AP kernel, P(z)/Q2.
728  virtual double AltarelliParisi(vector<double> invariants,
729  vector<double>, vector<int> helBef, vector<int> helNew) override;
730 
731 };
732 
733 //==========================================================================
734 
735 // Class AntGQEmitIF, initial-final antenna function.
736 
738 
739 public:
740 
741  // Names (remember to redefine both for each inherited class).
742  virtual string vinciaName() const override {return "Vincia:GQEmitIF";}
743 
744  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
745  virtual int idA() const override {return 21;}
746  virtual int idB() const override {return 1;}
747  virtual int id0() const override {return 21;}
748  virtual int id1() const override {return 21;}
749  virtual int id2() const override {return 1;}
750 
751  // The antenna function [GeV^-2].
752  virtual double antFun(vector<double> invariants, vector<double> masses,
753  vector<int> helBef, vector<int> helNew) override;
754 
755  // The AP kernel, P(z)/Q2.
756  virtual double AltarelliParisi(vector<double> invariants,
757  vector<double>, vector<int> helBef, vector<int> helNew) override;
758 
759 };
760 
761 //==========================================================================
762 
763 // Class AntGGEmitIF, initial-final antenna function.
764 
766 
767 public:
768 
769  // Names (remember to redefine both for each inherited class).
770  virtual string vinciaName() const override {return "Vincia:GGEmitIF";}
771 
772  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
773  virtual int idA() const override {return 21;}
774  virtual int idB() const override {return 21;}
775  virtual int id0() const override {return 21;}
776  virtual int id1() const override {return 21;}
777  virtual int id2() const override {return 21;}
778 
779  // The antenna function [GeV^-2].
780  virtual double antFun(vector<double> invariants, vector<double> masses,
781  vector<int> helBef, vector<int> helNew) override;
782 
783  // The AP kernel, P(z)/Q2.
784  virtual double AltarelliParisi(vector<double> invariants,
785  vector<double>, vector<int> helBef, vector<int> helNew) override;
786 
787 };
788 
789 //==========================================================================
790 
791 // Class AntQXConvIF, initial-final antenna function. splitting is in
792 // the forwards sense, i.e. quark backwards evolving to a gluon and
793 // emitting an antiquark in the final state.
794 
796 
797 public:
798 
799  // Names (remember to redefine both for each inherited class).
800  virtual string vinciaName() const override {return "Vincia:QXConvIF";}
801 
802  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
803  virtual int idA() const override {return 1;}
804  virtual int idB() const override {return 0;}
805  virtual int id0() const override {return 21;}
806  virtual int id1() const override {return -1;}
807  virtual int id2() const override {return 0;}
808 
809  // The antenna function [GeV^-2].
810  virtual double antFun(vector<double> invariants, vector<double> masses,
811  vector<int> helBef, vector<int> helNew) override;
812 
813  virtual double AltarelliParisi(vector<double> invariants,
814  vector<double> /*mNew*/, vector<int> helBef, vector<int> helNew) override;
815 
816  // Mark that this function does not have a zB collinear limit.
817  virtual double zB(vector<double>) override {return -1.0;}
818 
819 };
820 
821 //==========================================================================
822 
823 // Class AntGXConvIF, initial-final antenna function. Gluon evolves
824 // backwards into a quark and emits a quark in the final state.
825 
827 
828 public:
829 
830  // Names (remember to redefine both for each inherited class).
831  virtual string vinciaName() const override {return "Vincia:GXConvIF";}
832 
833  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
834  virtual int idA() const override {return 21;}
835  virtual int idB() const override {return 0;}
836  virtual int id0() const override {return 2;}
837  virtual int id1() const override {return 2;}
838  virtual int id2() const override {return 0;}
839 
840  // The antenna function [GeV^-2].
841  virtual double antFun(vector<double> invariants, vector<double> masses,
842  vector<int> helBef, vector<int> helNew) override;
843 
844  // The AP kernel, P(z)/Q2.
845  virtual double AltarelliParisi(vector<double> invariants,
846  vector<double>, vector<int> helBef, vector<int> helNew) override;
847 
848  // Mark that this function does not have a zB collinear limit.
849  virtual double zB(vector<double>) override {return -1.0;}
850 
851 };
852 
853 //==========================================================================
854 
855 // Class AntXGSplitIF, initial-final antenna function. Gluon splitting in
856 // the final state.
857 
859 
860 public:
861 
862  // Names (remember to redefine both for each inherited class).
863  virtual string vinciaName() const override {return "Vincia:XGSplitIF";}
864 
865  // Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
866  virtual int idA() const override {return 0;}
867  virtual int idB() const override {return 21;}
868  virtual int id0() const override {return 0;}
869  virtual int id1() const override {return -1;}
870  virtual int id2() const override {return 1;}
871 
872  // The antenna function [GeV^-2].
873  virtual double antFun(vector<double> invariants, vector<double> masses,
874  vector<int> helBef, vector<int> helNew) override;
875 
876  // The AP kernel, P(z)/Q2.
877  virtual double AltarelliParisi(vector<double> invariants,
878  vector<double>, vector<int> helBef, vector<int> helNew) override;
879 
880  // Mark that this function does not have a zA collinear limit.
881  virtual double zA(vector<double>) override {return -1.0;}
882 
883 };
884 
885 //==========================================================================
886 
887 // Class AntQGEmitIFsec, derived class for sector initial-final antenna
888 // function. Note only the final-state leg needs to be symmetrised,
889 // as the global IF functions already contain sector terms on their
890 // initial-state legs to account for the absence of "emission into the
891 // initial state".
892 
893 class AntQGEmitIFsec : public AntQGEmitIF {
894 
895 public:
896 
897  // The antenna function [GeV^-2].
898  virtual double antFun(vector<double> invariants,
899  vector<double> mNew, vector<int> helBef, vector<int> helNew) override;
900 
901 };
902 
903 //==========================================================================
904 
905 // Class AntGGEmitIFsec, sector initial-final antenna function.
906 
907 class AntGGEmitIFsec : public AntGGEmitIF {
908 
909 public:
910 
911  // The antenna function [GeV^-2].
912  virtual double antFun(vector<double> invariants,
913  vector<double> mNew, vector<int> helBef, vector<int> helNew) override;
914 
915 };
916 
917 //==========================================================================
918 
919 // Class AntXGSplitIFsec, sector initial-final antenna function. Gluon
920 // splitting in the final state.
921 
923 
924 public:
925 
926  // The antenna function, just 2*global [GeV^-2].
927  virtual double antFun(vector<double> invariants, vector<double> mNew,
928  vector<int> helBef, vector<int> helNew) override;
929 
930 };
931 
932 //==========================================================================
933 
934 // Class AntQQEmitRF, resonance-final antenna function.
935 
936 class AntQQEmitRF : public AntQQEmitIF {
937 
938 public:
939 
940  // Names (remember to redefine both for each inherited class).
941  string vinciaName() const override {return "Vincia:QQEmitRF";}
942 
943  // Parton types AB -> ijk with A,i initial and B,k,j final.
944  int idA() const override {return 6;}
945  int idB() const override {return 5;}
946  int id0() const override {return 6;}
947  int id1() const override {return 21;}
948  int id2() const override {return 5;}
949 
950  // Mark that this function does not have a zA collinear limit.
951  double zA(vector<double>) override {return -1;}
952 
953  // Return this is a resonance-final antenna.
954  bool isRFant() override {return true;}
955 
956  // Test masses (top, gluon, bottom, and W mass).
957  void getTestMasses(vector<double> &masses) override {masses =
958  {particleDataPtr->m0(6), 0.0, particleDataPtr->m0(5),
959  particleDataPtr->m0(24)};}
960 
961  // AP with dummy helicities.
962  virtual double AltarelliParisi(vector<double> invariants,
963  vector<double> masses, vector<int>, vector<int>) override {
964  double sjk(invariants[2]), mkres(masses[2]), z(zB(invariants)),
965  mu2(mkres*mkres/sjk), Pz(dglapPtr->Pq2gq(z,9,9,9,mu2));
966  return Pz/sjk;};
967 
968 };
969 
970 //==========================================================================
971 
972 // Class AntQGEmitRF, resonance-final antenna function.
973 
974 class AntQGEmitRF : public AntQGEmitIF {
975 
976 public:
977 
978  // Names (remember to redefine both for each inherited class).
979  string vinciaName() const override {return "Vincia:QGEmitRF";}
980 
981  // Parton types AB -> ijk with A,i initial and B,k,j final.
982  int idA() const override {return 6;}
983  int idB() const override {return 21;}
984  int id1() const override {return 21;}
985  int ida() const {return 6;}
986  int idb() const {return 21;}
987 
988  // Mark that this function does not have a zA collinear limit.
989  double zA(vector<double>) override {return -1;}
990 
991  // Return this is a resonance-final antenna.
992  bool isRFant() override {return true;}
993 
994  // Test masses (top, gluon, gluon, X).
995  void getTestMasses(vector<double> &masses) override {masses =
996  {particleDataPtr->m0(6), 0.0, 0.0, 0.6*particleDataPtr->m0(6)};}
997 
998  // AP with dummy helicities and masses.
999  virtual double AltarelliParisi(vector<double> invariants, vector<double>,
1000  vector<int>, vector<int>) override {
1001  double sjk(invariants[2]), z(zB(invariants)),
1002  Pz(dglapPtr->Pg2gg(z, 9, 9, 9));
1003  return Pz/sjk;}
1004 
1005 };
1006 
1007 //==========================================================================
1008 
1009 // Class AntQGEmitRF, resonance-final antenna function.
1010 
1012 
1013 public:
1014 
1015  // Names (remember to redefine both for each inherited class).
1016  string vinciaName() const override {return "Vincia:QGEmitRF";}
1017 
1018  // Parton types AB -> ijk with A,i initial and B,k,j final.
1019  int idA() const override {return 6;}
1020  int idB() const override {return 21;}
1021  int id1() const override {return 21;}
1022  int ida() const {return 6;}
1023  int idb() const {return 21;}
1024 
1025  // Mark that this function does not have a zA collinear limit.
1026  double zA(vector<double>) override {return -1;}
1027 
1028  // Return this is a resonance-final antenna.
1029  bool isRFant() override {return true;}
1030 
1031  // Test masses (top, gluon, gluon, X).
1032  void getTestMasses(vector<double> &masses) override {masses =
1033  {particleDataPtr->m0(6), 0.0, 0.0, 0.6*particleDataPtr->m0(6)};}
1034 
1035  // AP with dummy helicities and masses.
1036  virtual double AltarelliParisi(vector<double> invariants, vector<double>,
1037  vector<int>, vector<int>) override {
1038  double sjk(invariants[2]), z(zB(invariants)),
1039  Pz(dglapPtr->Pg2gg(z, 9, 9, 9));
1040  return Pz/sjk;}
1041 
1042 };
1043 
1044 //==========================================================================
1045 
1046 // Class AntXGSplitRF, resonance-final antenna function.
1047 
1048 class AntXGSplitRF : public AntXGSplitIF {
1049 
1050 public:
1051 
1052  // Names (remember to redefine both for each inherited class)
1053  string vinciaName() const override {return "Vincia:XGSplitRF";}
1054 
1055  // Mark that this function does not have a zA collinear limit.
1056  double zA(vector<double>) override {return -1;}
1057 
1058  // Return this is a resonance-final antenna.
1059  bool isRFant() override {return true;}
1060 
1061  // Parton types AB -> ijk with A,i initial and B,k,j final.
1062  int idA() const override {return 6;}
1063  int idB() const override {return 21;}
1064  int id1() const override {return -2;}
1065  int ida() const {return 6;}
1066  int idb() const {return 2;}
1067 
1068  // Test masses (top, gluon, gluon, X).
1069  void getTestMasses(vector<double> &masses) override {masses =
1070  {particleDataPtr->m0(6), 0.0, 0.0, 0.6*particleDataPtr->m0(6)};}
1071 
1072  // AP with dummy helicities.
1073  double AltarelliParisi(vector<double> invariants, vector<double> masses,
1074  vector<int>, vector<int>) override {
1075  double sAK(invariants[0]), saj(invariants[1]), sjk(invariants[2]),
1076  mkres(masses[2]), m2q(mkres*mkres), Q2(sjk + 2*m2q), mu2(m2q/Q2),
1077  z((sAK+saj-Q2)/sAK), Pz(dglapPtr->Pg2qq(z, 9, 9, 9, mu2));
1078  return Pz/Q2;}
1079 
1080 };
1081 
1082 //==========================================================================
1083 
1084 // Class AntXGSplitRF, resonance-final antenna function.
1085 
1087 
1088 public:
1089 
1090  // Names (remember to redefine both for each inherited class)
1091  string vinciaName() const override {return "Vincia:XGSplitRF";}
1092 
1093  // Mark that this function does not have a zA collinear limit.
1094  double zA(vector<double>) override {return -1;}
1095 
1096  // Return this is a resonance-final antenna.
1097  bool isRFant() override {return true;}
1098 
1099  // Parton types AB -> ijk with A,i initial and B,k,j final.
1100  int idA() const override {return 6;}
1101  int idB() const override {return 21;}
1102  int id1() const override {return -2;}
1103  int ida() const {return 6;}
1104  int idb() const {return 2;}
1105 
1106  // Test masses (top, gluon, gluon, X).
1107  void getTestMasses(vector<double> &masses) override {masses =
1108  {particleDataPtr->m0(6), 0.0, 0.0, 0.6*particleDataPtr->m0(6)};}
1109 
1110  // AP with dummy helicities.
1111  double AltarelliParisi(vector<double> invariants, vector<double> masses,
1112  vector<int>, vector<int>) override {
1113  double sAK(invariants[0]), saj(invariants[1]), sjk(invariants[2]),
1114  mkres(masses[2]), m2q(mkres*mkres), Q2(sjk + 2*m2q), mu2(m2q/Q2),
1115  z((sAK+saj-Q2)/sAK), Pz(dglapPtr->Pg2qq(z, 9, 9, 9, mu2));
1116  return Pz/Q2;}
1117 
1118 };
1119 
1120 
1121 //==========================================================================
1122 
1123 // The AntennaSetFSR class. Simple container of FF and RF antenna functions.
1124 
1126 
1127 public:
1128 
1129  // Default constructor.
1130  AntennaSetFSR() = default;
1131 
1132  // Destructor, delete the antennae.
1133  virtual ~AntennaSetFSR() {
1134  for (auto it = antFunPtrs.begin(); it != antFunPtrs.end(); ++it)
1135  delete it->second;
1136  antFunPtrs.clear();}
1137 
1138  // Initialize pointers.
1139  void initPtr(Info* infoPtrIn, DGLAP* dglapPtrIn);
1140 
1141  // Initialize antenna set (optionally with min or max variation).
1142  void init();
1143 
1144  // Function to chek if an antenna with the given index exists.
1145  bool exists(enum AntFunType antFunType) {
1146  return antFunPtrs.count(antFunType);}
1147 
1148  // Gets an antenna from the AntennaSet.
1150  return (exists(antFunType)) ? antFunPtrs[antFunType] : nullptr;}
1151 
1152  // Get list of all AntFunTypes contained in this set.
1153  vector<enum AntFunType> getAntFunTypes();
1154 
1155  // Get Vincia name, e.g. "Vincia:QQEmitFF".
1156  string vinciaName(enum AntFunType antFunType) {
1157  return exists(antFunType) ? antFunPtrs[antFunType]->vinciaName() :
1158  "noVinciaName";}
1159 
1160  // Get human name, e.g. "g/qq".
1161  string humanName(enum AntFunType antFunType) {
1162  return exists(antFunType) ? antFunPtrs[antFunType]->humanName() :
1163  "noHumanName";}
1164 
1165 private:
1166 
1167  // Use a map of AntennaFunction pointers, create them with new on
1168  // initialization.
1169  map<enum AntFunType, AntennaFunction*> antFunPtrs{};
1170 
1171  // Pointers to Pythia8 classes, needed to initialise antennae.
1172  bool isInitPtr{false}, isInit{false};
1173  Info* infoPtr{};
1174  ParticleData* particleDataPtr{};
1175  Settings* settingsPtr{};
1176  Rndm* rndmPtr{};
1177  Logger* loggerPtr{};
1178 
1179  // Pointer to VINCIA DGLAP class.
1180  DGLAP* dglapPtr{};
1181 
1182  // Verbosity level
1183  int verbose{};
1184 
1185 };
1186 
1187 //==========================================================================
1188 
1189 // The AntennaSetISR class. Simple container of II and IF antenna functions.
1190 
1192 
1193  public:
1194 
1195  // Default constructor.
1196  AntennaSetISR() = default;
1197 
1198  // Destructor, delete the antennae.
1200  for (auto it = antFunPtrs.begin(); it != antFunPtrs.end(); ++it)
1201  delete it->second;
1202  antFunPtrs.clear();}
1203 
1204  // Initialize pointers.
1205  void initPtr(Info* infoPtrIn, DGLAP* dglapPtrIn);
1206 
1207  // Initialize antenna set.
1208  void init();
1209 
1210  // Function to chek if an antenna with the given index exists.
1211  bool exists(enum AntFunType antFunType) {
1212  return antFunPtrs.count(antFunType);}
1213 
1214  // Gets an antenna from the AntennaSetISR.
1216  return (exists(antFunType)) ? antFunPtrs[antFunType] : nullptr;}
1217 
1218  // Get list of all AntFunTypes contained in this set.
1219  vector<enum AntFunType> getAntFunTypes();
1220 
1221  // Get Vincia name, e.g. "Vincia:QQEmitII".
1222  string vinciaName(enum AntFunType antFunType) {
1223  return exists(antFunType) ? antFunPtrs[antFunType]->vinciaName()
1224  : "noVinciaName";}
1225 
1226  // Get human name, e.g. "g/qq".
1227  string humanName(enum AntFunType antFunType) {
1228  return exists(antFunType) ? antFunPtrs[antFunType]->humanName() :
1229  "noHumanName";}
1230 
1231 private:
1232 
1233  // Use a map of AntennaFunction pointers, create them with new on
1234  // initialization.
1235  map<enum AntFunType, AntennaFunctionIX*> antFunPtrs{};
1236 
1237  // Pointers to Pythia 8 classes, needed to initialise antennae.
1238  bool isInitPtr{false}, isInit{false};
1239  Info* infoPtr{};
1240  ParticleData* particleDataPtr{};
1241  Settings* settingsPtr{};
1242  Rndm* rndmPtr{};
1243  Logger* loggerPtr{};
1244 
1245  // Pointer to VINCIA DGLAP class
1246  DGLAP* dglapPtr{};
1247 
1248  // Verbosity level
1249  int verbose{};
1250 
1251 };
1252 
1253 //==========================================================================
1254 
1255 // Class MECs, for computing matrix-element corrections to antenna
1256 // functions.
1257 
1258 class MECs {
1259 
1260 public:
1261 
1262  // Constructor.
1263  MECs() {isInitPtr = false; isInit = false;}
1264 
1265  // Destructor.
1266  virtual ~MECs() {};
1267 
1268  // Initialize pointers.
1269  void initPtr(Info* infoPtrIn, ExternalMEsPtr mg5mesPtrIn,
1270  VinciaCommon* vinComPtrIn, Resolution* resPtrIn);
1271 
1272  // Initialize pointers to antenna sets.
1273  void initAntPtr(AntennaSetFSR* antFSRusr, AntennaSetISR* antISRusr) {
1274  antSetFSR = antFSRusr; antSetISR = antISRusr;}
1275 
1276  // Initialize.
1277  void init();
1278 
1279  // Function to return ME class (Born type) for a parton
1280  // configuration. Can be called from either of the ISR::prepare() or
1281  // FSR::prepare() functions, or from the ISR::branch() or
1282  // FSR::branch() functions. Returns >= 0 if there an ME for this
1283  // configuration, associated with the (arbitrary) integer code label
1284  // denoted by the return value. If return < 0 we don't have an ME /
1285  // no ME should be used for this system.
1286  bool prepare(const int iSys, Event& event);
1287 
1288  // Function to assign helicities to particles (using MEs).
1289  bool polarise(const int iSys, Event& event, const bool force = false);
1290  bool polarise(vector<Particle>& state, const bool force = false);
1291 
1292  // Check if state already has helicities.
1293  // checkAll = true : only return true if all particles have helicities.
1294  // checkAll = false : return true if *any* particle is polarised.
1295  bool isPolarised(int iSys, Event& event, bool checkAll = true);
1296 
1297  // Wrapper function to return a specific antenna function.
1298  AntennaFunction* getAntFunPtrFSR(const enum AntFunType antFunType) {
1299  return antSetFSR->getAntFunPtr(antFunType); }
1300  AntennaFunctionIX* getAntFunPtrISR(const enum AntFunType antFunType) {
1301  return antSetISR->getAntFunPtr(antFunType); }
1302 
1303  // Function to determine if MECs are requested at this order for this system.
1304  bool doMEC(const int iSys, const int nBranch);
1305 
1306  // Check whether we have a matrix element for this configuration.
1307  bool meAvailable(int iSys, const Event& event);
1308  bool meAvailable(const vector<Particle>& state);
1309 
1310  // Get squared matrix element.
1311  double getME2(const vector<Particle>& state, int nIn);
1312  double getME2(int iSys, const Event& event);
1313 
1314  // Get matrix element correction factor for sector shower.
1315  double getMECSector(int iSys, const vector<Particle>& stateNow,
1316  const vector<Particle>& statePost, VinciaClustering& clus);
1317  //TODO: Matrix element corrections for global shower?
1318  // double getMECGlobal(const vector<Particle>& statePost,
1319  // const VinciaClustering& clus, int nIn);
1320 
1321  // Communicate that the trial was accepted and we branched.
1322  void hasBranched(int iSys);
1323 
1324  // Set whether we need to calculate a new matrix element for
1325  // current configuration (e.g. due to an EW decay).
1326  void needsNewME2(int iSys, bool needsNewIn) {
1327  hasME2now[iSys] = !needsNewIn; }
1328 
1329  // Return number of partons added since Born (as defined by prepare).
1330  int sizeOutBorn(const int iSys) {return sizeOutBornSav[iSys];}
1331 
1332  // Function to set level of verbose output.
1333  void setVerbose(const int verboseIn) {verbose = verboseIn;}
1334 
1335  // Header.
1336  void header();
1337 
1338  // Is initalised?
1339  bool isInitialised() { return isInit; }
1340 
1341 private:
1342 
1343  // Save hard scale in current system.
1344  bool saveHardScale(int iSys, Event& /*event*/);
1345 
1346  // Regularise this correction?
1347  bool doRegMatch(int iSys, const vector<Particle>& state);
1348 
1349  // Get matching regulator.
1350  double getMatchReg(int iSys, const VinciaClustering& clus);
1351 
1352  // Get antenna approximation.
1353  double getAntApprox(const VinciaClustering& clus);
1354 
1355  // Get colour weight.
1356  double getColWeight(const vector<Particle>& state);
1357 
1358  // Verbosity level.
1359  int verbose;
1360 
1361  // Is initialised.
1362  bool isInitPtr, isInit;
1363 
1364  // Pointers to PYTHIA objects.
1365  Info* infoPtr;
1366  Rndm* rndmPtr;
1367  ParticleData* particleDataPtr;
1368  Logger* loggerPtr;
1369  PartonSystems* partonSystemsPtr;
1370  Settings* settingsPtr;
1371  ExternalMEsPtr mg5mesPtr;
1372 
1373  // Pointers to VINCIA objects.
1374  Resolution* resolutionPtr;
1375  VinciaCommon* vinComPtr;
1376 
1377  // Antenna sets.
1378  AntennaSetFSR* antSetFSR;
1379  AntennaSetISR* antSetISR;
1380 
1381  // Helicity sampler.
1382  HelicitySampler helSampler;
1383 
1384  // Matching settings.
1385  bool matchingFullColour, matchingScaleIsAbs;
1386  int modeMECs;
1387  int matchingRegOrder, matchingRegShape;
1388  int maxMECs2to1, maxMECs2to2, maxMECs2toN, maxMECsResDec, maxMECsMPI;
1389  int nFlavZeroMass;
1390  double matchingIRcutoff, matchingScale, q2Match;
1391 
1392  // Map from iSys to Born multiplicity and ME class; set in prepare().
1393  map<int,int> sizeOutBornSav;
1394 
1395  // Map from iSys to number of QCD particles in Born; set in prepare().
1396  map<int,int> sysToBornMultQCD;
1397 
1398  // Map from iSys to hard scale; set in prepare();
1399  map<int,double> sysToHardScale;
1400 
1401  // Map from iSys to matrix element of current state.
1402  map<int,double> me2now;
1403  map<int,bool> hasME2now;
1404 
1405  // Maps from iSys to matrix element of post-branching state.
1406  map<int,double> me2post;
1407  map<int,bool> hasME2post;
1408 
1409 };
1410 
1411 //==========================================================================
1412 
1413 } // end namespace Pythia8
1414 
1415 #endif // Pythia8_VinciaAntennaFunctions_H
double zA(vector< double >) override
Mark that this function does not have a zA collinear limit.
Definition: VinciaAntennaFunctions.h:1026
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:773
int idA() const override
Parton types AB -> ijk with A,i initial and B,k,j final.
Definition: VinciaAntennaFunctions.h:1019
AntennaFunction * getAntFunPtr(enum AntFunType antFunType)
Gets an antenna from the AntennaSet.
Definition: VinciaAntennaFunctions.h:1149
Definition: VinciaAntennaFunctions.h:344
Class AntGQEmitII, initial-initial antenna function.
Definition: VinciaAntennaFunctions.h:480
MECs()
Constructor.
Definition: VinciaAntennaFunctions.h:1263
void getTestMasses(vector< double > &masses) override
Test masses (top, gluon, gluon, X).
Definition: VinciaAntennaFunctions.h:1032
string humanName(enum AntFunType antFunType)
Get human name, e.g. "g/qq".
Definition: VinciaAntennaFunctions.h:1161
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:683
virtual string vinciaName() const
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:263
double Pq2gqLin(double z, int hA=9, int polB=9, int hC=9, double mu=0.)
Definition: VinciaAntennaFunctions.cc:186
virtual double zB(vector< double >) override
Mark that this function does not have a zB collinear limit.
Definition: VinciaAntennaFunctions.h:849
virtual int idA() const
Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
Definition: VinciaAntennaFunctions.h:266
Class AntQQEmitFF, final-final antenna function.
Definition: VinciaAntennaFunctions.h:205
void needsNewME2(int iSys, bool needsNewIn)
Definition: VinciaAntennaFunctions.h:1326
Definition: Info.h:45
bool exists(enum AntFunType antFunType)
Function to chek if an antenna with the given index exists.
Definition: VinciaAntennaFunctions.h:1211
Class AntGQEmitIF, initial-final antenna function.
Definition: VinciaAntennaFunctions.h:737
The Event class holds all info on the generated event.
Definition: Event.h:453
void getTestMasses(vector< double > &masses) override
Test masses (top, gluon, gluon, X).
Definition: VinciaAntennaFunctions.h:1107
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:714
Simple struct to store information about a 3 -> 2 clustering.
Definition: VinciaCommon.h:278
string vinciaName(enum AntFunType antFunType)
Get Vincia name, e.g. "Vincia:QQEmitFF".
Definition: VinciaAntennaFunctions.h:1156
A helicity sampler using external matrix elements.
Definition: ExternalMEs.h:124
Definition: VinciaAntennaFunctions.h:893
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
Definition: VinciaAntennaFunctions.h:578
string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:1016
Definition: VinciaAntennaFunctions.h:538
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:863
Definition: VinciaAntennaFunctions.h:416
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:680
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:717
virtual void initMasses(vector< double > *masses)
Method to intialise mass values.
Definition: VinciaAntennaFunctions.h:106
virtual double zA(vector< double >) override
Mark that this function does not have a zA collinear limit.
Definition: VinciaAntennaFunctions.h:881
double zA(vector< double > invariants)
Functions to get Altarelli-Parisi energy fractions from invariants.
Definition: VinciaAntennaFunctions.h:140
string humanName(enum AntFunType antFunType)
Get human name, e.g. "g/qq".
Definition: VinciaAntennaFunctions.h:1227
int idA() const override
Parton types AB -> ijk with A,i initial and B,k,j final.
Definition: VinciaAntennaFunctions.h:944
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:800
virtual ~MECs()
Destructor.
Definition: VinciaAntennaFunctions.h:1266
double zA(vector< double >) override
Mark that this function does not have a zA collinear limit.
Definition: VinciaAntennaFunctions.h:989
bool isRFant() override
Return this is a resonance-final antenna.
Definition: VinciaAntennaFunctions.h:1097
Class AntQGEmitRF, resonance-final antenna function.
Definition: VinciaAntennaFunctions.h:974
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:485
Class AntGGEmitII, initial-initial antenna function.
Definition: VinciaAntennaFunctions.h:508
virtual double zA(vector< double > invariants)
Functions to get Altarelli-Parisi energy fractions.
Definition: VinciaAntennaFunctions.h:435
virtual string vinciaName() const
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:210
Definition: Logger.h:23
Definition: VinciaAntennaFunctions.h:826
string vinciaName() const override
Names (remember to redefine both for each inherited class)
Definition: VinciaAntennaFunctions.h:1091
double AltarelliParisi(vector< double > invariants, vector< double > masses, vector< int >, vector< int >) override
AP with dummy helicities.
Definition: VinciaAntennaFunctions.h:1073
string vinciaName() const override
Names (remember to redefine both for each inherited class)
Definition: VinciaAntennaFunctions.h:1053
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:575
Class AntGQEmitFF, final-final antenna function.
Definition: VinciaAntennaFunctions.h:258
virtual double zB(vector< double >) override
Mark that this function has no zB collinear limit.
Definition: VinciaAntennaFunctions.h:561
double Pg2qqLin(double z, int polA=9, int hB=9, int hC=9, double mu=0.)
Definition: VinciaAntennaFunctions.cc:142
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:866
double AltarelliParisi(vector< double > invariants, vector< double > masses)
Wrapper without helicity assignments.
Definition: VinciaAntennaFunctions.h:123
double Pg2ggLin(double z, int polA=9, int polB=9, int polC=9)
Pg2ggLin, written without factor 2 normalization convention.
Definition: VinciaAntennaFunctions.cc:117
double massiveEikonal(vector< double > invariants, vector< double > masses)
Massive eikonal factor, given invariants and masses.
Definition: VinciaAntennaFunctions.h:654
AntFunType
Enumerator for antenna function types, with "void" member NoFun.
Definition: VinciaCommon.h:66
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:513
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:834
Class AntGXSplitFF, final-final antenna function.
Definition: VinciaAntennaFunctions.h:310
double Pg2gg(double z, int hA=9, int hB=9, int hC=9)
DGLAP splitting functions.
Definition: VinciaAntennaFunctions.cc:39
Class AntGQEmitFF, final-final antenna function.
Definition: VinciaAntennaFunctions.h:284
virtual int idA() const
Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
Definition: VinciaAntennaFunctions.h:240
virtual bool isIIant()
Function to tell if this is an II antenna.
Definition: VinciaAntennaFunctions.h:441
virtual int idA() const
Functions needed by soft- and collinear-limit checks (AB -> 0i 1j 2k).
Definition: VinciaAntennaFunctions.h:213
Definition: Basics.h:385
double antFun(vector< double > invariants)
Wrapper for massless, helicity-summed/averaged antenna function.
Definition: VinciaAntennaFunctions.h:119
Definition: VinciaCommon.h:494
virtual bool isIIant() override
Methods to tell II, IF, and RF apart.
Definition: VinciaAntennaFunctions.h:632
double zA(vector< double >) override
Mark that this function does not have a zA collinear limit.
Definition: VinciaAntennaFunctions.h:1094
virtual double AltarelliParisi(vector< double > invariants, vector< double >, vector< int >, vector< int >) override
AP with dummy helicities and masses.
Definition: VinciaAntennaFunctions.h:999
int sizeOutBorn(const int iSys)
Return number of partons added since Born (as defined by prepare).
Definition: VinciaAntennaFunctions.h:1330
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:745
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:457
int idA() const override
Parton types AB -> ijk with A,i initial and B,k,j final.
Definition: VinciaAntennaFunctions.h:1062
Class AntXGSplitRF, resonance-final antenna function.
Definition: VinciaAntennaFunctions.h:1048
double gramDet(vector< double > invariants, vector< double > masses)
Return the Gram determinant.
Definition: VinciaAntennaFunctions.h:659
Definition: VinciaAntennaFunctions.h:65
virtual ~AntennaFunction()
Destructor.
Definition: VinciaAntennaFunctions.h:73
double Pg2qq(double z, int hA=9, int hB=9, int hC=9, double mu=0.)
Definition: VinciaAntennaFunctions.cc:58
void getTestMasses(vector< double > &masses) override
Test masses (top, gluon, bottom, and W mass).
Definition: VinciaAntennaFunctions.h:957
Class AntXGSplitRF, resonance-final antenna function.
Definition: VinciaAntennaFunctions.h:1086
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:424
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:615
virtual string vinciaName() const
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:237
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,B, a,b initial and j final.
Definition: VinciaAntennaFunctions.h:546
void getTestMasses(vector< double > &masses) override
Test masses (top, gluon, gluon, X).
Definition: VinciaAntennaFunctions.h:1069
Definition: VinciaAntennaFunctions.h:858
A class containing DGLAP splitting functions for limit checking.
Definition: VinciaAntennaFunctions.h:29
bool isRFant() override
Return this is a resonance-final antenna.
Definition: VinciaAntennaFunctions.h:1059
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:619
DGLAP()
Constructor.
Definition: VinciaAntennaFunctions.h:34
Class AntQQEmitII, initial-initial antenna function.
Definition: VinciaAntennaFunctions.h:452
int idA() const override
Parton types AB -> ijk with A,i initial and B,k,j final.
Definition: VinciaAntennaFunctions.h:982
double zA(vector< double >) override
Mark that this function does not have a zA collinear limit.
Definition: VinciaAntennaFunctions.h:951
void getTestMasses(vector< double > &masses) override
Test masses (top, gluon, gluon, X).
Definition: VinciaAntennaFunctions.h:995
double chargeFac()
Get parameters.
Definition: VinciaAntennaFunctions.h:134
Class AntQGEmitIF, initial-final antenna function.
Definition: VinciaAntennaFunctions.h:709
double Pq2qg(double z, int hA=9, int hB=9, int hC=9, double mu=0.)
Definition: VinciaAntennaFunctions.cc:79
double Pq2gq(double z, int hA=9, int hB=9, int hC=9, double mu=0.)
Definition: VinciaAntennaFunctions.cc:100
double massiveEikonal(double saj, double sjk, double sak, double m_a, double m_k)
Definition: VinciaAntennaFunctions.h:649
double Pg2qq(double z, double mu)
Wrappers to get unpolarized massive Altarelli-Pariis kernels (mu = m/Q).
Definition: VinciaAntennaFunctions.h:44
virtual double AltarelliParisi(vector< double > invariants, vector< double > masses, vector< int >, vector< int >) override
AP with dummy helicities.
Definition: VinciaAntennaFunctions.h:962
string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:941
Definition: VinciaAntennaFunctions.h:922
Class AntQQEmitIF, initial-final antenna function.
Definition: VinciaAntennaFunctions.h:675
virtual double zB(vector< double >) override
Mark that this function has no zB collinear limit.
Definition: VinciaAntennaFunctions.h:593
Definition: VinciaAntennaFunctions.h:398
Class AntQQEmitRF, resonance-final antenna function.
Definition: VinciaAntennaFunctions.h:936
Class AntGGEmitIF, initial-final antenna function.
Definition: VinciaAntennaFunctions.h:765
Class AntQGEmitRF, resonance-final antenna function.
Definition: VinciaAntennaFunctions.h:1011
virtual int idA() const
Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
Definition: VinciaAntennaFunctions.h:318
virtual int idA() const
Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
Definition: VinciaAntennaFunctions.h:364
Definition: VinciaAntennaFunctions.h:570
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:742
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
Definition: VinciaAntennaFunctions.h:488
A simple class for containing evolution variable definitions.
Definition: VinciaCommon.h:382
double AltarelliParisi(vector< double > invariants, vector< double > masses, vector< int >, vector< int >) override
AP with dummy helicities.
Definition: VinciaAntennaFunctions.h:1111
void setVerbose(const int verboseIn)
Function to set level of verbose output.
Definition: VinciaAntennaFunctions.h:1333
int idA() const override
Parton types AB -> ijk with A,i initial and B,k,j final.
Definition: VinciaAntennaFunctions.h:1100
bool isInitialised()
Is initalised?
Definition: VinciaAntennaFunctions.h:1339
AntennaFunctionIX * getAntFunPtr(enum AntFunType antFunType)
Gets an antenna from the AntennaSetISR.
Definition: VinciaAntennaFunctions.h:1215
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,a initial and B,b,j final.
Definition: VinciaAntennaFunctions.h:803
Class AntQGEmitFF, final-final antenna function.
Definition: VinciaAntennaFunctions.h:232
virtual double AltarelliParisi(vector< double > invariants, vector< double >, vector< int >, vector< int >) override
AP with dummy helicities and masses.
Definition: VinciaAntennaFunctions.h:1036
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:831
Definition: VinciaAntennaFunctions.h:337
double zA(vector< double >) override
Mark that this function does not have a zA collinear limit.
Definition: VinciaAntennaFunctions.h:1056
The AntennaSetFSR class. Simple container of FF and RF antenna functions.
Definition: VinciaAntennaFunctions.h:1125
The AntennaSetISR class. Simple container of II and IF antenna functions.
Definition: VinciaAntennaFunctions.h:1191
virtual string vinciaName() const
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:315
The PartonSystems class describes the whole set of subcollisions.
Definition: PartonSystems.h:42
bool isRFant() override
Return this is a resonance-final antenna.
Definition: VinciaAntennaFunctions.h:992
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
virtual double zA(vector< double > invariants) override
Functions to get Altarelli-Parisi energy fractions.
Definition: VinciaAntennaFunctions.h:698
string vinciaName(enum AntFunType antFunType)
Get Vincia name, e.g. "Vincia:QQEmitII".
Definition: VinciaAntennaFunctions.h:1222
virtual double zB(vector< double >) override
Mark that this function does not have a zB collinear limit.
Definition: VinciaAntennaFunctions.h:817
bool isRFant() override
Return this is a resonance-final antenna.
Definition: VinciaAntennaFunctions.h:954
AntennaFunction * getAntFunPtrFSR(const enum AntFunType antFunType)
Wrapper function to return a specific antenna function.
Definition: VinciaAntennaFunctions.h:1298
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
Definition: VinciaAntennaFunctions.h:428
virtual void getTestMasses(vector< double > &masses)
Create the test masses for the checkRes method.
Definition: VinciaAntennaFunctions.h:639
virtual string humanName() const
Wrapper that can modify baseName to more human readable form if required.
Definition: VinciaAntennaFunctions.h:100
double antFun(vector< double > invariants, vector< double > masses)
Wrapper for helicity-summed/averaged antenna function.
Definition: VinciaAntennaFunctions.h:115
Definition: VinciaAntennaFunctions.h:1258
virtual string vinciaName() const
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:289
double AltarelliParisi(vector< double > invariants)
Wrapper for massless helicity-summed/averaged DGLAP kernels.
Definition: VinciaAntennaFunctions.h:127
Definition: VinciaAntennaFunctions.h:359
Definition: VinciaAntennaFunctions.h:795
Definition: VinciaAntennaFunctions.h:383
void initAntPtr(AntennaSetFSR *antFSRusr, AntennaSetISR *antISRusr)
Initialize pointers to antenna sets.
Definition: VinciaAntennaFunctions.h:1273
Definition: VinciaAntennaFunctions.h:604
bool isRFant() override
Return this is a resonance-final antenna.
Definition: VinciaAntennaFunctions.h:1029
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:543
virtual int idA() const
Parton types (AB -> 0i 1j 2k): needed by soft- and collinear-limit checks.
Definition: VinciaAntennaFunctions.h:292
bool exists(enum AntFunType antFunType)
Function to chek if an antenna with the given index exists.
Definition: VinciaAntennaFunctions.h:1145
Class AntGGEmitIFsec, sector initial-final antenna function.
Definition: VinciaAntennaFunctions.h:907
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
Definition: VinciaAntennaFunctions.h:460
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
~AntennaSetISR()
Destructor, delete the antennae.
Definition: VinciaAntennaFunctions.h:1199
virtual string baseName() const
Construct baseName from idA, idB, and id1.
Definition: VinciaAntennaFunctions.h:96
Definition: Settings.h:195
virtual int idA() const override
Parton types AB -> 0a 1j 2b with A,B,a,b initial and j final.
Definition: VinciaAntennaFunctions.h:516
double Pq2qgLin(double z, int hA=9, int hB=9, int polC=9, double mu=0.)
Definition: VinciaAntennaFunctions.cc:164
virtual double zA(vector< double > invariants) override
Functions to get Altarelli-Parisi energy fractions.
Definition: VinciaAntennaFunctions.h:626
virtual ~AntennaSetFSR()
Destructor, delete the antennae.
Definition: VinciaAntennaFunctions.h:1133
string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:979
virtual string vinciaName() const override
Names (remember to redefine both for each inherited class).
Definition: VinciaAntennaFunctions.h:770