PYTHIA  8.312
VinciaTrialGenerators.h
1 // VinciaTrialGenerators.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 #ifndef Pythia8_VinciaTrial_H
7 #define Pythia8_VinciaTrial_H
8 
9 // Pythia headers.
10 #include "Pythia8/Basics.h"
11 #include "Pythia8/PythiaStdlib.h"
12 
13 // Vincia headers.
14 #include "Pythia8/VinciaCommon.h"
15 
16 namespace Pythia8 {
17 
18 // Helpful enums.
19 enum class TrialGenType { Void = 0, FF = 1, RF = 2, IF = 3, II = 4 };
20 // (Default is used for soft, global, or splittings as appropriate.)
21 enum class BranchType { Void = -1, Emit = 0, SplitF = 1, SplitI = 2,
22  Conv = 3 };
23 enum class Sector { Void = -99, ColI = -1, Default = 0, ColK = 1 };
24 
25 // Forward declarations.
26 class ZetaGenerator;
27 class ZetaGeneratorSet;
28 
29 //==========================================================================
30 
31 // Helper struct for passing trial-alphaS information.
32 
34 
35  int runMode{};
36  double alphaSmax{}, b0{}, kMu2{}, lambda2{}, qMin{};
37  map<int, double> mass;
38 
39 };
40 
41 //==========================================================================
42 
43 // Base class for trial generators.
44 
46 
47  public:
48 
49  // Main constructor.
50  TrialGenerator(bool isSectorIn, TrialGenType trialGenTypeIn,
51  BranchType branchTypeIn, ZetaGeneratorSet* zetaGenSet)
52  : isSector(isSectorIn), trialGenTypeSav(trialGenTypeIn),
53  branchType(branchTypeIn) { setupZetaGens(zetaGenSet); }
54 
55  // Destructor.
56  virtual ~TrialGenerator() = default;
57 
58  // Set pointers to zetaGenerators.
59  void setupZetaGens(ZetaGeneratorSet* zetaGenSet);
60 
61  // Re-calculate the current zeta limits and integrals.
62  virtual void reset(double Q2min, double s, const vector<double> & masses,
63  enum AntFunType antFunType, double xA = 1., double xB = 1.);
64 
65  // Generate the next trial scale.
66  virtual double genQ2(double Q2MaxNow, Rndm* rndmPtr,
67  const EvolutionWindow* evWindowPtrIn, double colFac,
68  double wtIn, Logger* loggerPtr, int verboseIn);
69 
70  // Get the invariants.
71  virtual bool genInvariants(double sAnt, const vector<double>& masses,
72  vector<double>& invariants, Rndm* rndmPtr, Logger* loggerPtr,
73  int verboseIn);
74 
75  // Calculate the trial based on invariants and saved quantities.
76  virtual double aTrial(vector<double>& invariants,
77  const vector<double>& masses, int verboseIn);
78 
79  // Calculate the colour and coupling stripped antenna function.
80  virtual double aTrialStrip(vector<double>& invariants,
81  const vector<double>& masses, int verboseIn);
82 
83  // Delete the current trial.
84  virtual void resetTrial();
85 
86  // Mark trial as used.
87  virtual void needsNewTrial();
88 
89  // Return the sector.
90  int getSector() {return (int)sectorSav;}
91 
92  protected:
93 
94  // Calculate the Kallen factor.
95  virtual void calcKallenFac(double, const vector<double>&) {
96  kallenFacSav = 1.0;}
97 
98  // Calculate the PDF ratio.
99  virtual void calcRpdf(const vector<double>&) {Rpdf = 1.0;}
100 
101  void addGenerator(ZetaGeneratorSet* zetaGenSet,
102  Sector sector = Sector::Default);
103 
104  // True when init succeeds.
105  bool isInit{false};
106 
107  // Information set at construction.
108  const bool isSector;
109  const TrialGenType trialGenTypeSav;
110  const BranchType branchType;
111 
112  // Common prefactors to the trial integral.
113  double kallenFacSav{1.};
114  double Rpdf{1.};
115 
116  // Information about the antenna.
117  double sAntSav{};
118  vector<double> massesSav;
119 
120  // Information about the trial.
121  bool hasTrial{false};
122  double q2Sav{}, colFacSav{};
123  const EvolutionWindow* evWindowSav{};
124  Sector sectorSav;
125 
126  // Map from sector to the correct zeta generator.
127  // (note these live inside a ZetaGeneratorSet)
128  map<Sector, ZetaGeneratorPtr> zetaGenPtrs;
129 
130  // Map from sector to the corresponding zeta phase-space limits.
131  map<Sector, pair<double, double>> zetaLimits;
132 
133  // Save the zeta integrals.
134  map<Sector, double> IzSav;
135 
136  // Save which sectors are currently active.
137  map<Sector, bool> isActiveSector;
138 
139 };
140 
141 //==========================================================================
142 
143 // Trial generator for final-final branchings.
144 
146 
147  public:
148 
149  // Default constructor/destructor.
150  TrialGeneratorFF(bool isSectorIn, BranchType branchTypeIn,
151  ZetaGeneratorSet* zetaGenSet) : TrialGenerator(isSectorIn,
152  TrialGenType::FF, branchTypeIn, zetaGenSet) {;}
153  ~TrialGeneratorFF() = default;
154 
155  private:
156 
157  void calcKallenFac(double sIK, const vector<double>& masses);
158 
159 };
160 
161 //==========================================================================
162 
163 // Trial generator for resonance-final branchings.
164 
166 
167  public:
168 
169  // Default constructor/destructor.
170  TrialGeneratorRF(bool isSectorIn, BranchType branchTypeIn,
171  ZetaGeneratorSet* zetaGenSet) : TrialGenerator(isSectorIn,
172  TrialGenType::RF, branchTypeIn, zetaGenSet) {;}
173  ~TrialGeneratorRF() = default;
174 
175  private:
176 
177  void calcKallenFac(double sAK, const vector<double>& masses);
178 
179 };
180 
181 //==========================================================================
182 
183 // Trial generator for initial-final branchings.
184 
186 
187  public:
188 
189  // Default constructor/destructor.
190  TrialGeneratorIF(bool isSectorIn, BranchType branchTypeIn,
191  ZetaGeneratorSet* zetaGenSet) : TrialGenerator(isSectorIn,
192  TrialGenType::IF, branchTypeIn, zetaGenSet) {;}
193  ~TrialGeneratorIF() = default;
194 
195 };
196 
197 //==========================================================================
198 
199 // Trial generator for initial-initial branchings.
200 
202 
203  public:
204 
205  // Default constructor/destructor.
206  TrialGeneratorII(bool isSectorIn, BranchType branchTypeIn,
207  ZetaGeneratorSet* zetaGenSet) : TrialGenerator(isSectorIn,
208  TrialGenType::II, branchTypeIn, zetaGenSet) {;}
209  ~TrialGeneratorII() = default;
210 
211 };
212 
213 //==========================================================================
214 
215 // Place to store all types of zeta trial generators.
216 // To live in VinicaFSR, VinciaISR.
217 
219 
220  public:
221 
222  // Construct all zeta generators for a given type.
223  ZetaGeneratorSet(TrialGenType trialGenTypeIn);
224 
225  // Destructor.
226  ~ZetaGeneratorSet() = default;
227 
228  // Get ptr to ZetaGenerator for a sector.
229  ZetaGeneratorPtr getZetaGenPtr(BranchType branchType, Sector sectIn);
230 
231  TrialGenType getTrialGenType() {return trialGenTypeSav;}
232 
233  protected :
234 
235  const TrialGenType trialGenTypeSav;
236 
237  void addGenerator(ZetaGeneratorPtr zGenPtr);
238 
239  map<pair<BranchType, Sector>, ZetaGeneratorPtr> zetaGenPtrs;
240 
241 };
242 
243 //==========================================================================
244 
245 // Base class for zeta trial generators.
246 
248 
249  public:
250 
251  // Constructor and destructor.
252  ZetaGenerator(TrialGenType trialGenTypeIn, BranchType branchTypeIn,
253  Sector sectorIn, double globalIn) : trialGenType(trialGenTypeIn),
254  branchType(branchTypeIn), sector(sectorIn), globalFactSav(globalIn) {;}
255  virtual ~ZetaGenerator() = default;
256 
257  // Get (best/physical) limits given a set of input parameters.
258  virtual double getzMin(double Q2min,double sAnt,
259  const vector<double>& masses, double xA = 1., double xB = 1.) = 0;
260  virtual double getzMax(double Q2min,double sAnt,
261  const vector<double>& masses, double xA = 1., double xB = 1.) = 0;
262 
263  // Get hull of physical phase space in zeta.
264  virtual double getzMinHull(double Q2min,double sAnt,
265  const vector<double>& masses, double xA = 1., double xB = 1.) {
266  return getzMin(Q2min, sAnt, masses, xA, xB);}
267  virtual double getzMaxHull(double Q2min,double sAnt,
268  const vector<double>& masses, double xA = 1., double xB = 1.) {
269  return getzMax(Q2min, sAnt, masses, xA, xB);}
270 
271  // Get constant factor for zeta integral.
272  // NOTE: only used in II conversion trial.
273  virtual double getConstFactor(double,
274  const vector<double>&) {return 1.;}
275 
276  // Set the invariants for the current value of the evolution variables.
277  virtual void genInvariants(double Q2In, double zIn, double sAnt,
278  const vector<double>& masses, vector<double>& invariants,
279  Logger* loggerPtr, int verboseIn) = 0;
280 
281  // Evaluate the trial antenna given invariants and masses.
282  virtual double aTrial(const vector<double>& invariants,
283  const vector<double>& masses) = 0;
284 
285  // Check if this trial is active for specific AntFunType.
286  virtual bool isActive(enum AntFunType) {return false;}
287 
288  // Return information about this generator.
289  TrialGenType getTrialGenType() {return trialGenType;}
290  Sector getSector() {return sector;}
291  BranchType getBranchType() {return branchType;}
292 
293  // Return multiplier to convert to global.
294  double globalMultiplier() {return globalFactSav;}
295 
296  // The zeta integral.
297  // Optionally with exponent gamma for PDF overestimate.
298  double getIz(double zMinIn, double zMaxIn, double gammaPDF = 1.) {
299  return zetaIntSingleLim(zMaxIn, gammaPDF)
300  -zetaIntSingleLim(zMinIn, gammaPDF);}
301 
302  // Generate a value of zeta.
303  double genZeta(Rndm* rndmPtr, double zMinIn, double zMaxIn,
304  double gammaPDF = 1.);
305 
306  // Print the trial generator.
307  void print();
308 
309  protected:
310 
311  // The functional form of the zeta integral.
312  // Optionally with exponent gamma for PDF overestimate.
313  virtual double zetaIntSingleLim(double z, double gammaPDF = 1.) = 0;
314 
315  // The function form of the inverse of the zeta integral.
316  // Optionally with exponent gamma for PDF overestimate.
317  virtual double inverseZetaIntegral(double Iz, double gammaPDF = 1.) = 0;
318 
319  // Check if invariants are valid.
320  bool valid(const string& method, Logger* loggerPtr, int verbose, double zIn);
321  bool valid(const string& method, Logger* loggerPtr, int verbose, double zIn,
322  const double& Q2In);
323 
324  // Labels to define this trial generator (set in derived constructors).
325  const TrialGenType trialGenType{TrialGenType::Void};
326  const BranchType branchType{BranchType::Void};
327  const Sector sector{Sector::Void};
328 
329  // Multiplier to convert trial to global.
330  const double globalFactSav;
331 
332 };
333 //==========================================================================
334 
335 // Final-final trial generators.
336 
337 //==========================================================================
338 
339 // The final-final default sector generator.
340 
342 
343  public:
344 
345  // Constructor/destructor.
347  Sector::Default, 1.0) {;}
348  ~ZGenFFEmitSoft() = default;
349 
350  // Overridden methods.
351  double getzMin(double Q2,double sAnt, const vector<double>& masses,
352  double xA = 1., double xB = 1.) override;
353  double getzMax(double Q2,double sAnt, const vector<double>& masses,
354  double xA = 1., double xB = 1.) override;
355  void genInvariants(double Q2In, double zIn, double sAnt,
356  const vector<double>& masses, vector<double>& invariants,
357  Logger* loggerPtr, int verboseIn) override;
358  double aTrial(const vector<double>& invariants,
359  const vector<double>& masses) override;
360  bool isActive(enum AntFunType antFunType) override {
361  return antFunType == QQEmitFF || antFunType == QGEmitFF ||
362  antFunType == GQEmitFF || antFunType == GGEmitFF;}
363 
364  private:
365 
366  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
367  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
368 
369 };
370 
371 //==========================================================================
372 
373 // The final-final ColI sector emission generator.
374 
376 
377  public:
378 
379  // Constructor/destructor.
381  Sector::ColI,1.0) {;}
382  ~ZGenFFEmitColI() = default;
383 
384  // Overridden methods.
385  double getzMin(double Q2,double sAnt,const vector<double>& masses,
386  double xA = 1., double xB = 1.) override;
387  double getzMax(double Q2,double sAnt,const vector<double>& masses,
388  double xA = 1., double xB = 1.) override;
389  void genInvariants(double Q2In, double zIn, double sAnt,
390  const vector<double>& masses, vector<double>& invariants,
391  Logger* loggerPtr, int verboseIn) override;
392  double aTrial(const vector<double>& invariants,
393  const vector<double>& masses) override;
394  bool isActive(enum AntFunType antFunType) override {
395  return antFunType == GQEmitFF || antFunType == GGEmitFF;}
396 
397  private:
398 
399  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
400  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
401 
402 };
403 
404 //==========================================================================
405 
406 // The final-final ColK sector emission generator.
407 
409 
410  public:
411 
412  // Constructor/destructor.
414  Sector::ColK, 1.0) {;}
415  ~ZGenFFEmitColK() = default;
416 
417  // Overridden methods.
418  double getzMin(double Q2,double sAnt,const vector<double>& masses,
419  double xA = 1., double xB = 1.) override;
420  double getzMax(double Q2,double sAnt,const vector<double>& masses,
421  double xA = 1., double xB = 1.) override;
422  void genInvariants(double Q2In, double zIn, double sAnt,
423  const vector<double>& masses, vector<double>& invariants,
424  Logger* loggerPtr, int verboseIn) override;
425  double aTrial(const vector<double>& invariants,
426  const vector<double>& masses) override;
427  bool isActive(enum AntFunType antFunType) override {
428  return antFunType == QGEmitFF || antFunType == GGEmitFF;}
429 
430  private:
431 
432  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
433  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
434 
435 };
436 
437 //==========================================================================
438 
439 // The final-final default sector splitting generator.
440 
441 class ZGenFFSplit : public ZetaGenerator {
442 
443  public:
444 
445  // Constructor/destructor.
447  Sector::Default, 0.5) {;}
448  ~ZGenFFSplit() = default;
449 
450  // Overridden methods.
451  double getzMin(double Q2,double sAnt, const vector<double>& masses,
452  double xA = 1., double xB = 1.) override;
453  double getzMax(double Q2,double sAnt, const vector<double>& masses,
454  double xA = 1., double xB = 1.) override;
455  void genInvariants(double Q2In, double zIn, double sAnt,
456  const vector<double>& masses, vector<double>& invariants,
457  Logger* loggerPtr, int verboseIn) override;
458  double aTrial(const vector<double>& invariants,
459  const vector<double>& masses) override;
460  bool isActive(enum AntFunType antFunType) override {
461  return antFunType == GXSplitFF;}
462 
463  private:
464 
465  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
466  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
467 
468 };
469 
470 //==========================================================================
471 
472 // Resonance-final trial generators.
473 
474 //==========================================================================
475 
476 // The resonance-final default sector generator.
477 
479 
480  public:
481 
482  // Constructor/destructor.
484  Sector::Default, 1.0) {;}
485  ~ZGenRFEmitSoft() = default;
486 
487  // Overridden methods.
488  double getzMin(double Q2,double sAnt, const vector<double>& masses,
489  double xA = 1., double xB = 1.) override;
490  double getzMax(double Q2,double sAnt, const vector<double>& masses,
491  double xA = 1., double xB = 1.) override;
492  void genInvariants(double Q2In, double zIn, double sAnt,
493  const vector<double>& masses, vector<double>& invariants,
494  Logger* loggerPtr, int verboseIn) override;
495  double aTrial(const vector<double>& invariants,
496  const vector<double>& masses) override;
497  bool isActive(enum AntFunType antFunType) override {
498  return antFunType == QQEmitRF || antFunType == QGEmitRF;}
499 
500  private:
501 
502  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
503  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
504 };
505 
506 //==========================================================================
507 
508 // The resonance-final default sector alternate generator.
509 
511 
512  public:
513 
514  // Constructor/destructor.
516  Sector::Default, 1.0) {;}
517  ~ZGenRFEmitSoftAlt() = default;
518 
519  // Overridden methods.
520  double getzMin(double Q2,double sAnt, const vector<double>& masses,
521  double xA=1., double xB=1.) override;
522  double getzMax(double Q2,double sAnt, const vector<double>& masses,
523  double xA=1., double xB=1.) override;
524  void genInvariants(double Q2In, double zIn, double sAnt,
525  const vector<double>& masses, vector<double>& invariants,
526  Logger* loggerPtr, int verboseIn) override;
527  double aTrial(const vector<double>& invariants,
528  const vector<double>& masses ) override;
529  bool isActive(enum AntFunType antFunType) override {
530  return antFunType == QQEmitRF || antFunType == QGEmitRF;}
531 
532  private:
533 
534  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
535  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
536 
537 };
538 
539 //==========================================================================
540 
541 // The resonance-final ColK sector generator.
542 
544 
545  public:
546 
547  // Constructor/destructor.
549  Sector::ColK, 1.0) {;}
550  ~ZGenRFEmitColK() = default;
551 
552  // Overridden methods.
553  double getzMin(double Q2,double sAnt, const vector<double>& masses,
554  double xA = 1., double xB = 1.) override;
555  double getzMax(double Q2,double sAnt, const vector<double>& masses,
556  double xA = 1., double xB = 1.) override;
557  void genInvariants(double Q2In, double zIn, double sAnt,
558  const vector<double>& masses, vector<double>& invariants,
559  Logger* loggerPtr, int verboseIn) override;
560  double aTrial( const vector<double>& invariants,
561  const vector<double>& masses ) override;
562  bool isActive(enum AntFunType antFunType) override {
563  return antFunType == QGEmitRF;}
564 
565  private:
566 
567  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
568  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
569 
570 };
571 
572 //==========================================================================
573 
574 // The resonance-final default sector splitting generator.
575 
576 class ZGenRFSplit : public ZetaGenerator {
577 
578  public:
579 
580  // Constructor/destructor.
582  Sector::Default, 0.5) {;}
583  ~ZGenRFSplit() = default;
584 
585  // Overridden methods.
586  double getzMin(double Q2,double sAnt, const vector<double>& masses,
587  double xA = 1., double xB = 1.) override;
588  double getzMax(double Q2,double sAnt, const vector<double>& masses,
589  double xA = 1., double xB = 1.) override;
590  void genInvariants(double Q2In, double zIn, double sAnt,
591  const vector<double>& masses, vector<double>& invariants,
592  Logger* loggerPtr, int verboseIn) override;
593  double aTrial(const vector<double>& invariants,
594  const vector<double>& masses ) override;
595  bool isActive(enum AntFunType antFunType) override {
596  return antFunType == XGSplitRF;}
597 
598  private:
599 
600  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
601  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
602 
603 };
604 
605 //==========================================================================
606 
607 // Intial-final trial generators.
608 
609 //==========================================================================
610 
611 // The initial-final default sector generator.
612 
614 
615  public:
616 
617  // Constructor/destructor.
619  ZetaGenerator(TrialGenType::IF, BranchType::Emit, Sector::Default, 1.0) {;}
620  ~ZGenIFEmitSoft() = default;
621 
622  // Overridden methods.
623  double getzMin(double Q2,double sAnt, const vector<double>& masses,
624  double xA = 1., double xB = 1.) override;
625  double getzMax(double Q2,double sAnt, const vector<double>& masses,
626  double xA = 1., double xB = 1.) override;
627  void genInvariants(double Q2In, double zIn, double sAnt,
628  const vector<double>& masses, vector<double>& invariants,
629  Logger* loggerPtr, int verboseIn) override;
630  double aTrial(const vector<double>& invariants,
631  const vector<double>& masses) override;
632  bool isActive(enum AntFunType antFunType) override {return
633  antFunType == QQEmitIF || antFunType == QGEmitIF ||
634  antFunType == GQEmitIF || antFunType == GGEmitIF;}
635 
636  private:
637 
638  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
639  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
640 
641 };
642 
643 //==========================================================================
644 
645 // The initial-final ColI sector generator.
646 
648 
649  public:
650 
651  // Constructor/destructor.
653  ZetaGenerator(TrialGenType::IF, BranchType::Emit, Sector::ColI, 1.0) {;}
654  ~ZGenIFEmitColA() = default;
655 
656  // Overridden methods.
657  double getzMin(double Q2,double sAnt, const vector<double>& masses,
658  double xA = 1., double xB = 1.) override;
659  double getzMax(double Q2,double sAnt, const vector<double>& masses,
660  double xA = 1., double xB = 1.) override;
661  void genInvariants(double Q2In, double zIn, double sAnt,
662  const vector<double>& masses, vector<double>& invariants,
663  Logger* loggerPtr, int verboseIn) override;
664  double aTrial(const vector<double>& invariants,
665  const vector<double>& masses) override;
666  bool isActive(enum AntFunType antFunType) override {
667  return antFunType == GQEmitIF || antFunType == GGEmitIF;}
668 
669  private:
670 
671  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
672  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
673 
674 };
675 
676 //==========================================================================
677 
678 // The initial-final ColK sector generator.
679 
681 
682  public:
683 
684  // Constructor/destructor.
686  Sector::ColK, 1.0) {;}
687  ~ZGenIFEmitColK() = default;
688 
689  double getzMin(double Q2,double sAnt, const vector<double>& masses,
690  double xA=1., double xB=1.) override;
691  double getzMax(double Q2,double sAnt, const vector<double>& masses,
692  double xA=1., double xB=1.) override;
693  void genInvariants(double Q2In, double zIn, double sAnt,
694  const vector<double>& masses, vector<double>& invariants,
695  Logger* loggerPtr, int verboseIn) override;
696  double aTrial(const vector<double>& invariants,
697  const vector<double>& masses) override;
698  bool isActive(enum AntFunType antFunType) override {return
699  antFunType == QGEmitIF || antFunType == GGEmitIF;}
700 
701  private:
702 
703  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
704  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
705 
706 };
707 
708 //==========================================================================
709 
710 // The initial-final initial antenna splitting generator.
711 
713 
714  public:
715 
716  // Constructor/destructor.
718  Sector::Default, 1.) {;}
719  ~ZGenIFSplitA() = default;
720 
721  // Overridden methods.
722  double getzMin(double Q2,double sAnt, const vector<double>& masses,
723  double xA = 1., double xB = 1.) override;
724  double getzMax(double Q2,double sAnt, const vector<double>& masses,
725  double xA = 1., double xB = 1.) override;
726  void genInvariants(double Q2In, double zIn, double sAnt,
727  const vector<double>& masses, vector<double>& invariants,
728  Logger* loggerPtr, int verboseIn) override;
729  double aTrial( const vector<double>& invariants,
730  const vector<double>& masses) override;
731  bool isActive(enum AntFunType antFunType) override {
732  return antFunType == QXConvIF;}
733 
734  private:
735 
736  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
737  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
738 
739 };
740 
741 //==========================================================================
742 
743 // The initial-final final antenna splitting generator.
744 
745 class ZGenIFSplitK : public ZetaGenerator {
746 
747  public:
748 
749  // Constructor/destructor.
751  Sector::Default, .5) {;}
752  ~ZGenIFSplitK() = default;
753 
754  // Overridden methods.
755  double getzMin(double Q2,double sAnt, const vector<double>& masses,
756  double xA = 1., double xB = 1.) override;
757  double getzMax(double Q2,double sAnt, const vector<double>& masses,
758  double xA = 1., double xB = 1.) override;
759  void genInvariants(double Q2In, double zIn, double sAnt,
760  const vector<double>& masses, vector<double>& invariants,
761  Logger* loggerPtr, int verboseIn) override;
762  double aTrial(const vector<double> & invariants,
763  const vector<double>& masses) override;
764  bool isActive(enum AntFunType antFunType) override {
765  return antFunType == XGSplitIF;}
766 
767  private:
768 
769  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
770  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
771 
772 };
773 
774 //==========================================================================
775 
776 // The initial-final splitting generator.
777 
778 class ZGenIFConv : public ZetaGenerator {
779 
780  public:
781 
782  // Constructor/destructor.
784  Sector::Default, 1.) {;}
785  ~ZGenIFConv() = default;
786 
787  // Overridden methods.
788  double getzMin(double Q2,double sAnt, const vector<double>& masses,
789  double xA = 1., double xB = 1.) override;
790  double getzMax(double Q2,double sAnt, const vector<double>& masses,
791  double xA = 1., double xB = 1.) override;
792  void genInvariants(double Q2In, double zIn, double sAnt,
793  const vector<double>& masses, vector<double>& invariants,
794  Logger* loggerPtr, int verboseIn) override;
795  double aTrial(const vector<double>& invariants,
796  const vector<double>& masses) override;
797  bool isActive(enum AntFunType antFunType) override {
798  return antFunType == GXConvIF;}
799 
800  private:
801 
802  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
803  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
804 
805 };
806 
807 //==========================================================================
808 
809 // The initial-initial trial generators.
810 
811 //==========================================================================
812 
813 // The initial-initial default sector generator.
814 
816 
817  public:
818 
819  // Constructor/destructor.
821  Sector::Default, 1.0) {;}
822  ~ZGenIIEmitSoft() = default;
823 
824  // Overridden methods.
825  double getzMin(double Q2,double sAnt, const vector<double>& masses,
826  double xA = 1., double xB = 1.) override;
827  double getzMax(double Q2,double sAnt, const vector<double>& masses,
828  double xA = 1., double xB = 1.) override;
829  void genInvariants(double Q2In, double zIn, double sAnt,
830  const vector<double>& masses, vector<double>& invariants,
831  Logger* loggerPtr, int verboseIn) override;
832  double aTrial(const vector<double>& invariants,
833  const vector<double>& masses) override;
834  bool isActive(enum AntFunType antFunType) override {
835  return antFunType == QQEmitII || antFunType == GQEmitII ||
836  antFunType == GGEmitII;}
837 
838  private:
839 
840  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
841  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
842 
843 };
844 
845 //==========================================================================
846 
847 // The initial-initial ColI sector generator.
848 
849 class ZGenIIEmitCol : public ZetaGenerator {
850 
851  public:
852 
853  // Constructor/destructor.
855  Sector::ColI, 1.0) {;}
856  ~ZGenIIEmitCol() = default;
857 
858  // Overridden methods.
859  double getzMin(double Q2,double sAnt, const vector<double>& masses,
860  double xA = 1., double xB = 1.) override;
861  double getzMax(double Q2,double sAnt, const vector<double>& masses,
862  double xA = 1., double xB = 1.) override;
863  void genInvariants(double Q2In, double zIn, double sAnt,
864  const vector<double>& masses, vector<double>& invariants,
865  Logger* loggerPtr, int verboseIn) override;
866  double aTrial(const vector<double>& invariants,
867  const vector<double>& masses ) override;
868  bool isActive(enum AntFunType antFunType) override {
869  return antFunType == GQEmitII || antFunType == GGEmitII;}
870 
871  private:
872 
873  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
874  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
875 
876 };
877 
878 //==========================================================================
879 
880 // The initial-initial initial splitting generator.
881 
882 class ZGenIISplit : public ZetaGenerator {
883 
884  public:
885 
886  // Constructor/destructor.
888  Sector::Default, 1.) {;}
889  ~ZGenIISplit() = default;
890 
891  // Overridden methods.
892  double getzMin(double Q2,double sAnt, const vector<double>& masses,
893  double xA = 1., double xB = 1.) override;
894  double getzMax(double Q2,double sAnt, const vector<double>& masses,
895  double xA = 1., double xB = 1.) override;
896  void genInvariants(double Q2In, double zIn, double sAnt,
897  const vector<double>& masses, vector<double>& invariants,
898  Logger* loggerPtr, int verboseIn) override;
899  double aTrial(const vector<double>& invariants,
900  const vector<double>& masses) override;
901  bool isActive(enum AntFunType antFunType) override {
902  return antFunType == QXConvII;}
903 
904  private:
905 
906  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
907  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
908 
909 };
910 
911 //==========================================================================
912 
913 // The initial-initial splitting generator.
914 
915 class ZGenIIConv : public ZetaGenerator {
916 
917  public:
918 
919  // Constructor/destructor.
921  Sector::Default, 1.) {;}
922  ~ZGenIIConv() = default;
923 
924  // Overridden methods.
925  double getzMin(double Q2,double sAnt, const vector<double>& masses,
926  double xA = 1., double xB = 1.) override;
927  double getzMax(double Q2,double sAnt, const vector<double>& masses,
928  double xA = 1., double xB = 1.) override;
929  double getConstFactor(double sAnt, const vector<double>& masses) override;
930  void genInvariants(double Q2In, double zIn, double sAnt,
931  const vector<double>& masses, vector<double>& invariants,
932  Logger* loggerPtr, int verboseIn) override;
933  double aTrial(const vector<double>& invariants,
934  const vector<double>& masses) override;
935  bool isActive(enum AntFunType antFunType) override {
936  return antFunType == GXConvII;}
937 
938  private:
939 
940  double zetaIntSingleLim(double z, double gammaPDF = 1.) override;
941  double inverseZetaIntegral(double Iz, double gammaPDF = 1.) override;
942 
943 };
944 
945 } // end namespace Pythia8
946 
947 #endif // end Pythia8_VinciaTrial_H
The initial-final ColK sector generator.
Definition: VinciaTrialGenerators.h:680
ZGenFFEmitColK()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:413
The initial-initial ColI sector generator.
Definition: VinciaTrialGenerators.h:849
Trial generator for initial-final branchings.
Definition: VinciaTrialGenerators.h:185
The initial-initial trial generators.
Definition: VinciaTrialGenerators.h:815
double getIz(double zMinIn, double zMaxIn, double gammaPDF=1.)
Definition: VinciaTrialGenerators.h:298
Intial-final trial generators.
Definition: VinciaTrialGenerators.h:613
Base class for zeta trial generators.
Definition: VinciaTrialGenerators.h:247
ZGenFFEmitSoft()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:346
ZGenRFSplit()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:581
TrialGenerator(bool isSectorIn, TrialGenType trialGenTypeIn, BranchType branchTypeIn, ZetaGeneratorSet *zetaGenSet)
Main constructor.
Definition: VinciaTrialGenerators.h:50
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:529
ZGenRFEmitSoft()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:483
The initial-initial splitting generator.
Definition: VinciaTrialGenerators.h:915
double globalMultiplier()
Return multiplier to convert to global.
Definition: VinciaTrialGenerators.h:294
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:632
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:935
The initial-final splitting generator.
Definition: VinciaTrialGenerators.h:778
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:394
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:797
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:698
The final-final default sector splitting generator.
Definition: VinciaTrialGenerators.h:441
map< Sector, pair< double, double > > zetaLimits
Map from sector to the corresponding zeta phase-space limits.
Definition: VinciaTrialGenerators.h:131
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:360
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:427
virtual double getzMinHull(double Q2min, double sAnt, const vector< double > &masses, double xA=1., double xB=1.)
Get hull of physical phase space in zeta.
Definition: VinciaTrialGenerators.h:264
const bool isSector
Information set at construction.
Definition: VinciaTrialGenerators.h:108
The final-final ColI sector emission generator.
Definition: VinciaTrialGenerators.h:375
ZGenIFSplitK()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:750
ZGenFFEmitColI()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:380
The resonance-final ColK sector generator.
Definition: VinciaTrialGenerators.h:543
map< Sector, bool > isActiveSector
Save which sectors are currently active.
Definition: VinciaTrialGenerators.h:137
ZGenIIEmitCol()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:854
int getSector()
Return the sector.
Definition: VinciaTrialGenerators.h:90
Trial generator for final-final branchings.
Definition: VinciaTrialGenerators.h:145
virtual bool isActive(enum AntFunType)
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:286
ZGenIFConv()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:783
Definition: Logger.h:23
The initial-final final antenna splitting generator.
Definition: VinciaTrialGenerators.h:745
ZGenIISplit()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:887
ZGenIFSplitA()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:717
ZetaGenerator(TrialGenType trialGenTypeIn, BranchType branchTypeIn, Sector sectorIn, double globalIn)
Constructor and destructor.
Definition: VinciaTrialGenerators.h:252
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:497
AntFunType
Enumerator for antenna function types, with "void" member NoFun.
Definition: VinciaCommon.h:66
Base class for trial generators.
Definition: VinciaTrialGenerators.h:45
Definition: Basics.h:386
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:562
const double globalFactSav
Multiplier to convert trial to global.
Definition: VinciaTrialGenerators.h:330
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:868
The initial-final initial antenna splitting generator.
Definition: VinciaTrialGenerators.h:712
TrialGeneratorIF(bool isSectorIn, BranchType branchTypeIn, ZetaGeneratorSet *zetaGenSet)
Default constructor/destructor.
Definition: VinciaTrialGenerators.h:190
Resonance-final trial generators.
Definition: VinciaTrialGenerators.h:478
virtual void calcRpdf(const vector< double > &)
Calculate the PDF ratio.
Definition: VinciaTrialGenerators.h:99
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:731
TrialGenType
Helpful enums.
Definition: VinciaTrialGenerators.h:19
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:901
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:834
virtual void calcKallenFac(double, const vector< double > &)
Calculate the Kallen factor.
Definition: VinciaTrialGenerators.h:95
ZGenIIConv()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:920
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:460
TrialGenType getTrialGenType()
Return information about this generator.
Definition: VinciaTrialGenerators.h:289
BranchType
(Default is used for soft, global, or splittings as appropriate.)
Definition: VinciaTrialGenerators.h:21
virtual double getConstFactor(double, const vector< double > &)
Definition: VinciaTrialGenerators.h:273
Definition: VinciaTrialGenerators.h:218
Helper struct for passing trial-alphaS information.
Definition: VinciaTrialGenerators.h:33
The initial-final ColI sector generator.
Definition: VinciaTrialGenerators.h:647
ZGenRFEmitColK()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:548
The resonance-final default sector splitting generator.
Definition: VinciaTrialGenerators.h:576
The final-final ColK sector emission generator.
Definition: VinciaTrialGenerators.h:408
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:595
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
ZGenIFEmitColA()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:652
ZGenIIEmitSoft()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:820
The resonance-final default sector alternate generator.
Definition: VinciaTrialGenerators.h:510
map< Sector, ZetaGeneratorPtr > zetaGenPtrs
Definition: VinciaTrialGenerators.h:128
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:666
Final-final trial generators.
Definition: VinciaTrialGenerators.h:341
TrialGeneratorII(bool isSectorIn, BranchType branchTypeIn, ZetaGeneratorSet *zetaGenSet)
Default constructor/destructor.
Definition: VinciaTrialGenerators.h:206
Trial generator for resonance-final branchings.
Definition: VinciaTrialGenerators.h:165
bool isActive(enum AntFunType antFunType) override
Check if this trial is active for specific AntFunType.
Definition: VinciaTrialGenerators.h:764
ZGenRFEmitSoftAlt()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:515
The initial-initial initial splitting generator.
Definition: VinciaTrialGenerators.h:882
map< Sector, double > IzSav
Save the zeta integrals.
Definition: VinciaTrialGenerators.h:134
ZGenIFEmitColK()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:685
ZGenFFSplit()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:446
TrialGeneratorRF(bool isSectorIn, BranchType branchTypeIn, ZetaGeneratorSet *zetaGenSet)
Default constructor/destructor.
Definition: VinciaTrialGenerators.h:170
Trial generator for initial-initial branchings.
Definition: VinciaTrialGenerators.h:201
ZGenIFEmitSoft()
Constructor/destructor.
Definition: VinciaTrialGenerators.h:618
TrialGeneratorFF(bool isSectorIn, BranchType branchTypeIn, ZetaGeneratorSet *zetaGenSet)
Default constructor/destructor.
Definition: VinciaTrialGenerators.h:150