PYTHIA  8.311
Pythia.h
1 // Pythia.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 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 the main class for event generation.
7 // Pythia: provide the main user interface to everything else.
8 
9 #ifndef Pythia8_Pythia_H
10 #define Pythia8_Pythia_H
11 
12 // Version number defined for use in macros and for consistency checks.
13 #define PYTHIA_VERSION 8.311
14 #define PYTHIA_VERSION_INTEGER 8311
15 
16 // Header files for the Pythia class and for what else the user may need.
17 #include "Pythia8/Analysis.h"
18 #include "Pythia8/Basics.h"
19 #include "Pythia8/BeamParticle.h"
20 #include "Pythia8/BeamSetup.h"
21 #include "Pythia8/Event.h"
22 #include "Pythia8/FragmentationFlavZpT.h"
23 #include "Pythia8/HadronLevel.h"
24 #include "Pythia8/HadronWidths.h"
25 #include "Pythia8/Info.h"
26 #include "Pythia8/JunctionSplitting.h"
27 #include "Pythia8/LesHouches.h"
28 #include "Pythia8/Logger.h"
29 #include "Pythia8/SigmaLowEnergy.h"
30 #include "Pythia8/Merging.h"
31 #include "Pythia8/MergingHooks.h"
32 #include "Pythia8/PartonLevel.h"
33 #include "Pythia8/ParticleData.h"
34 #include "Pythia8/PartonDistributions.h"
35 #include "Pythia8/PartonSystems.h"
36 #include "Pythia8/PartonVertex.h"
37 #include "Pythia8/PhysicsBase.h"
38 #include "Pythia8/ProcessLevel.h"
39 #include "Pythia8/PythiaStdlib.h"
40 #include "Pythia8/ResonanceWidths.h"
41 #include "Pythia8/RHadrons.h"
42 #include "Pythia8/Ropewalk.h"
43 #include "Pythia8/Settings.h"
44 #include "Pythia8/ShowerModel.h"
45 #include "Pythia8/SigmaTotal.h"
46 #include "Pythia8/SimpleSpaceShower.h"
47 #include "Pythia8/SimpleTimeShower.h"
48 #include "Pythia8/SpaceShower.h"
49 #include "Pythia8/StandardModel.h"
50 #include "Pythia8/StringInteractions.h"
51 #include "Pythia8/SusyCouplings.h"
52 #include "Pythia8/SLHAinterface.h"
53 #include "Pythia8/TimeShower.h"
54 #include "Pythia8/UserHooks.h"
55 #include "Pythia8/VinciaCommon.h"
56 #include "Pythia8/Weights.h"
57 
58 namespace Pythia8 {
59 
60 //==========================================================================
61 
62 // Forward declaration of the HeavyIons and HIUserHooks classes.
63 class HeavyIons;
64 class HIUserHooks;
65 
66 // Forward declaration of PythiaParallel class, to be friended.
67 class PythiaParallel;
68 
69 // The Pythia class contains the top-level routines to generate an event.
70 
71 class Pythia {
72 
73 public:
74 
75  // Constructor. (See Pythia.cc file.)
76  Pythia(string xmlDir = "../share/Pythia8/xmldoc", bool printBanner = true);
77 
78  // Constructor to copy settings and particle database from another Pythia
79  // object instead of XML files (to speed up multiple initialisations).
80  Pythia(Settings& settingsIn, ParticleData& particleDataIn,
81  bool printBanner = true);
82 
83  // Constructor taking input from streams instead of files.
84  Pythia( istream& settingsStrings, istream& particleDataStrings,
85  bool printBanner = true);
86 
87  // Destructor.
88  ~Pythia() {}
89 
90  // Copy and = constructors cannot be used.
91  Pythia(const Pythia&) = delete;
92  Pythia& operator=(const Pythia&) = delete;
93 
94  // Check consistency of version numbers (called by constructors).
95  bool checkVersion();
96 
97  // Read in one update for a setting or particle data from a single line.
98  bool readString(string, bool warn = true, int subrun = SUBRUNDEFAULT);
99 
100  // Read in updates for settings or particle data from user-defined file.
101  bool readFile(string fileName, bool warn = true,
102  int subrun = SUBRUNDEFAULT);
103  bool readFile(string fileName, int subrun) {
104  return readFile(fileName, true, subrun);}
105  bool readFile(istream& is = cin, bool warn = true,
106  int subrun = SUBRUNDEFAULT);
107  bool readFile(istream& is, int subrun) {
108  return readFile(is, true, subrun);}
109 
110  // Possibility to pass in pointers to PDF's.
111  bool setPDFPtr( PDFPtr pdfAPtrIn, PDFPtr pdfBPtrIn,
112  PDFPtr pdfHardAPtrIn = nullptr, PDFPtr pdfHardBPtrIn = nullptr,
113  PDFPtr pdfPomAPtrIn = nullptr, PDFPtr pdfPomBPtrIn = nullptr,
114  PDFPtr pdfGamAPtrIn = nullptr, PDFPtr pdfGamBPtrIn = nullptr,
115  PDFPtr pdfHardGamAPtrIn = nullptr, PDFPtr pdfHardGamBPtrIn = nullptr,
116  PDFPtr pdfUnresAPtrIn = nullptr, PDFPtr pdfUnresBPtrIn = nullptr,
117  PDFPtr pdfUnresGamAPtrIn = nullptr, PDFPtr pdfUnresGamBPtrIn = nullptr,
118  PDFPtr pdfVMDAPtrIn = nullptr, PDFPtr pdfVMDBPtrIn = nullptr) {
119  return beamSetup.setPDFPtr( pdfAPtrIn, pdfBPtrIn, pdfHardAPtrIn,
120  pdfHardBPtrIn, pdfPomAPtrIn, pdfPomBPtrIn, pdfGamAPtrIn, pdfGamBPtrIn,
121  pdfHardGamAPtrIn, pdfHardGamBPtrIn, pdfUnresAPtrIn, pdfUnresBPtrIn,
122  pdfUnresGamAPtrIn, pdfUnresGamBPtrIn, pdfVMDAPtrIn, pdfVMDBPtrIn); }
123  bool setPDFAPtr( PDFPtr pdfAPtrIn ) {
124  return beamSetup.setPDFAPtr( pdfAPtrIn); }
125  bool setPDFBPtr( PDFPtr pdfBPtrIn ) {
126  return beamSetup.setPDFBPtr( pdfBPtrIn); }
127 
128  // Set photon fluxes externally. Used with option "PDF:lepton2gammaSet = 2".
129  bool setPhotonFluxPtr( PDFPtr photonFluxAIn, PDFPtr photonFluxBIn) {
130  return beamSetup.setPhotonFluxPtr( photonFluxAIn, photonFluxBIn); }
131 
132  // Possibility to pass in pointer to external LHA-interfaced generator.
133  bool setLHAupPtr( LHAupPtr lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;
134  useNewLHA = false; return beamSetup.setLHAupPtr( lhaUpPtrIn);}
135 
136  // Possibility to pass in pointer for external handling of some decays.
137  bool setDecayPtr( DecayHandlerPtr decayHandlePtrIn,
138  vector<int> handledParticlesIn = {}) {decayHandlePtr = decayHandlePtrIn;
139  handledParticles = handledParticlesIn.size() == 0 ?
140  decayHandlePtrIn->handledParticles() : handledParticlesIn; return true;}
141 
142  // Possibility to pass in pointer for external random number generation.
143  bool setRndmEnginePtr( RndmEnginePtr rndmEnginePtrIn)
144  { return rndm.rndmEnginePtr( rndmEnginePtrIn);}
145 
146  // Possibility to pass in pointer for user hooks.
147  bool setUserHooksPtr(UserHooksPtr userHooksPtrIn) {
148  userHooksPtr = userHooksPtrIn; return true;}
149 
150  // Possibility to add further pointers to allow multiple user hooks.
151  bool addUserHooksPtr( UserHooksPtr userHooksPtrIn) {
152  if ( !userHooksPtrIn ) return false;
153  if ( !userHooksPtr ) return setUserHooksPtr(userHooksPtrIn);
154  shared_ptr<UserHooksVector> uhv =
155  dynamic_pointer_cast<UserHooksVector>(userHooksPtr);
156  if ( !uhv ) { uhv = make_shared<UserHooksVector>();
157  uhv->hooks.push_back(userHooksPtr); userHooksPtr = uhv; }
158  uhv->hooks.push_back(userHooksPtrIn); return true;}
159 
160  // Possibility to pass in pointer for full merging class.
161  bool setMergingPtr( MergingPtr mergingPtrIn)
162  { mergingPtr = mergingPtrIn; return true;}
163 
164  // Possibility to pass in pointer for merging hooks.
165  bool setMergingHooksPtr( MergingHooksPtr mergingHooksPtrIn)
166  { mergingHooksPtr = mergingHooksPtrIn; return true;}
167 
168  // Possibility to pass in pointer for beam shape.
169  bool setBeamShapePtr( BeamShapePtr beamShapePtrIn)
170  { return beamSetup.setBeamShapePtr(beamShapePtrIn);}
171 
172  // Possibility to pass in pointer for external cross section,
173  // with option to include external phase-space generator.
174  bool setSigmaPtr( SigmaProcessPtr sigmaPtrIn,
175  PhaseSpacePtr phaseSpacePtrIn = nullptr)
176  { sigmaPtrs.resize(0), phaseSpacePtrs.resize(0);
177  sigmaPtrs.push_back(sigmaPtrIn);
178  phaseSpacePtrs.push_back(phaseSpacePtrIn); return true;}
179 
180  // Possibility to add further pointers to allow for multiple cross sections.
181  bool addSigmaPtr( SigmaProcessPtr sigmaPtrIn,
182  PhaseSpacePtr phaseSpacePtrIn = nullptr)
183  { sigmaPtrs.push_back(sigmaPtrIn);
184  phaseSpacePtrs.push_back(phaseSpacePtrIn); return true;}
185 
186  // Possibility to pass in pointer for external resonance.
187  bool setResonancePtr( ResonanceWidthsPtr resonancePtrIn)
188  { resonancePtrs.resize(0);
189  resonancePtrs.push_back( resonancePtrIn); return true;}
190 
191  // Possibility to add further pointers to allow for multiple resonances.
192  bool addResonancePtr( ResonanceWidthsPtr resonancePtrIn)
193  { resonancePtrs.push_back( resonancePtrIn); return true;}
194 
195  // Possibility to pass in pointer for external showers.
196  bool setShowerModelPtr( ShowerModelPtr showerModelPtrIn)
197  { showerModelPtr = showerModelPtrIn; return true;}
198 
199  // Possibility to pass in pointer for modelling of heavy ion collisions.
200  bool setHeavyIonsPtr( HeavyIonsPtr heavyIonsPtrIn)
201  { heavyIonsPtr = heavyIonsPtrIn; return true;}
202 
203  // Possibility to pass a HIUserHooks pointer for modifying the
204  // behavior of the heavy ion modelling.
205  bool setHIHooks(HIUserHooksPtr hiHooksPtrIn)
206  { hiHooksPtr = hiHooksPtrIn; return true; }
207 
208  // Possibility to get the pointer to a object modelling heavy ion
209  // collisions.
210  HeavyIonsPtr getHeavyIonsPtr() { return heavyIonsPtr;}
211 
212  // Possibility to access the pointer to the BeamShape object.
213  BeamShapePtr getBeamShapePtr() { return beamSetup.getBeamShapePtr(); }
214 
215  // Possibility to get the pointer to the parton-shower model.
216  ShowerModelPtr getShowerModelPtr() { return showerModelPtr; }
217 
218  // Possibility to get the pointer to the LHA accessor.
219  LHAupPtr getLHAupPtr() { return lhaUpPtr; }
220 
221  // Possibility to pass in pointer for setting of parton space-time vertices.
222  bool setPartonVertexPtr( PartonVertexPtr partonVertexPtrIn)
223  { partonVertexPtr = partonVertexPtrIn; return true;}
224 
225  // Initialize.
226  bool init();
227 
228  // Generate the next event.
229  bool next() { return next(0); }
230  bool next(int procTypeIn);
231 
232  // Switch to new beam particle identities; for similar hadrons only.
233  bool setBeamIDs( int idAin, int idBin = 0) {
234  if (!isInit) { logger.ERROR_MSG("Pythia is not properly initialized");
235  return false; }
236  if (!beamSetup.setBeamIDs( idAin, idBin)) return false;
237  if (beamSetup.hasSwitchedIDs) { processLevel.updateBeamIDs();
238  partonLevel.setBeamID(beamSetup.iPDFAsave); }
239  return true;}
240 
241  // Switch beam kinematics.
242  bool setKinematics(double eCMIn);
243  bool setKinematics(double eAIn, double eBIn);
244  bool setKinematics(double pxAIn, double pyAIn, double pzAIn,
245  double pxBIn, double pyBIn, double pzBIn);
246  bool setKinematics(Vec4 pAIn, Vec4 pBIn);
247 
248  // Generate only a single timelike shower as in a decay.
249  int forceTimeShower( int iBeg, int iEnd, double pTmax, int nBranchMax = 0)
250  { if (!isInit) {
251  logger.ERROR_MSG("Pythia is not properly initialized"); return 0; }
252  partonSystems.clear(); infoPrivate.setScalup( 0, pTmax);
253  return timesDecPtr->shower( iBeg, iEnd, event, pTmax, nBranchMax); }
254 
255  // Generate only the hadronization/decay stage.
256  bool forceHadronLevel( bool findJunctions = true);
257 
258  // Special routine to allow more decays if on/off switches changed.
259  bool moreDecays() {return hadronLevel.moreDecays(event);}
260  bool moreDecays(int index) {return hadronLevel.decay(index, event);}
261 
262  // Special routine to force R-hadron decay when not done before.
263  bool forceRHadronDecays() {return doRHadronDecays();}
264 
265  // Do a low-energy collision between two hadrons in the event record.
266  bool doLowEnergyProcess(int i1, int i2, int procTypeIn) {
267  if (!isInit) {
268  logger.ERROR_MSG("Pythia is not properly initialized"); return false; }
269  return hadronLevel.doLowEnergyProcess( i1, i2, procTypeIn, event); }
270 
271  // Get total cross section for two hadrons in the event record or standalone.
272  double getSigmaTotal() { return getSigmaTotal(beamSetup.idA, beamSetup.idB,
273  beamSetup.eCM, 0); }
274  double getSigmaTotal(double eCM12, int mixLoHi = 0) {
275  return getSigmaTotal(beamSetup.idA, beamSetup.idB, eCM12, mixLoHi); }
276  double getSigmaTotal(int id1, int id2, double eCM12, int mixLoHi = 0) {
277  return getSigmaTotal(id1, id2, eCM12, particleData.m0(id1),
278  particleData.m0(id2), mixLoHi); }
279  double getSigmaTotal(int id1, int id2, double eCM12, double m1, double m2,
280  int mixLoHi = 0) {
281  if (!isInit) {
282  logger.ERROR_MSG("Pythia is not properly initialized"); return 0.; }
283  return sigmaCmb.sigmaTotal(id1, id2, eCM12, m1, m2, mixLoHi); }
284 
285  // Get partial (elastic, diffractive, nondiffractive, ...) cross sections
286  // for two hadrons in the event record or standalone.
287  double getSigmaPartial(int procTypeIn) {
288  return getSigmaPartial(beamSetup.idA, beamSetup.idB, beamSetup.eCM,
289  procTypeIn, 0); }
290  double getSigmaPartial(double eCM12, int procTypeIn, int mixLoHi = 0) {
291  return getSigmaPartial(beamSetup.idA, beamSetup.idB, eCM12, procTypeIn,
292  mixLoHi); }
293  double getSigmaPartial(int id1, int id2, double eCM12, int procTypeIn,
294  int mixLoHi = 0) { return getSigmaPartial(id1, id2, eCM12,
295  particleData.m0(id1), particleData.m0(id2), procTypeIn, mixLoHi); }
296  double getSigmaPartial(int id1, int id2, double eCM12, double m1,
297  double m2, int procTypeIn, int mixLoHi = 0) {
298  if (!isInit) {
299  logger.ERROR_MSG("Pythia is not properly initialized"); return 0.; }
300  return sigmaCmb.sigmaPartial(id1, id2, eCM12, m1, m2, procTypeIn, mixLoHi);
301  }
302 
303  // Return a parton density set among list of possibilities.
304  PDFPtr getPDFPtr(int idIn, int sequence = 1, string beam = "A",
305  bool resolved = true) {
306  return beamSetup.getPDFPtr( idIn, sequence, beam, resolved); }
307 
308  // List the current Les Houches event.
309  void LHAeventList() { if (lhaUpPtr != 0) lhaUpPtr->listEvent();}
310 
311  // Skip a number of Les Houches events at input.
312  bool LHAeventSkip(int nSkip) {
313  if (lhaUpPtr != 0) return lhaUpPtr->skipEvent(nSkip);
314  return false;}
315 
316  // Main routine to provide final statistics on generation.
317  void stat();
318 
319  // Read in settings values: shorthand, not new functionality.
320  bool flag(string key) {return settings.flag(key);}
321  int mode(string key) {return settings.mode(key);}
322  double parm(string key) {return settings.parm(key);}
323  string word(string key) {return settings.word(key);}
324 
325  // The event record for the parton-level central process.
327 
328  // The event record for the complete event history.
329  Event event = {};
330 
331  // Public information and statistic on the generation.
332  const Info& info = infoPrivate;
333 
334  // Logger: for diagnostic messages, errors, statistics, etc.
336 
337  // Settings: databases of flags/modes/parms/words to control run.
339 
340  // ParticleData: the particle data table/database.
342 
343  // Random number generator.
344  Rndm rndm = {};
345 
346  // Standard Model couplings, including alphaS and alphaEM.
348 
349  // SUSY couplings.
351 
352  // SLHA Interface
354 
355  // The partonic content of each subcollision system (auxiliary to event).
357 
358  // Merging object as wrapper for matrix element merging routines.
359  MergingPtr mergingPtr = {};
360 
361  // Pointer to MergingHooks object for user interaction with the merging.
362  // MergingHooks also more generally steers the matrix element merging.
363  MergingHooksPtr mergingHooksPtr;
364 
365  // Pointer to a HeavyIons object for generating heavy ion collisions
366  HeavyIonsPtr heavyIonsPtr = {};
367 
368  // Pointer to a HIUserHooks object to modify heavy ion modelling.
369  HIUserHooksPtr hiHooksPtr = {};
370 
371  // HadronWidths: the hadron widths data table/database.
373 
374  // The two incoming beams.
375  const BeamParticle& beamA = beamSetup.beamA;
376  const BeamParticle& beamB = beamSetup.beamB;
377 
378 private:
379 
380  // Friend PythiaParallel to give full access to underlying info.
381  friend class PythiaParallel;
382 
383  // The collector of all event generation weights that should eventually
384  // be transferred to the final output.
385  WeightContainer weightContainer = {};
386 
387  // The main keeper/collector of information, accessible from all
388  // PhysicsBase objects. The information is available from the
389  // outside through the public info object.
390  Info infoPrivate = {};
391 
392  // Initialise new Pythia object (called by constructors).
393  void initPtrs();
394 
395  // Initialise user provided plugins.
396  void initPlugins();
397 
398  // Functions to be called at the beginning and end of a next() call.
399  void beginEvent();
400  void endEvent(PhysicsBase::Status status);
401 
402  // Register a PhysicsBase object and give it a pointer to the info object.
403  void registerPhysicsBase(PhysicsBase &pb) {
404  if (find(physicsPtrs.begin(), physicsPtrs.end(), &pb) != physicsPtrs.end())
405  return;
406  pb.initInfoPtr(infoPrivate);
407  physicsPtrs.push_back(&pb);
408  }
409 
410  // If new pointers are set in Info propagate this to all
411  // PhysicsBase objects.
412  void pushInfo();
413 
414  // Constants: could only be changed in the code itself.
415  static const double VERSIONNUMBERHEAD, VERSIONNUMBERCODE;
416  // Maximum number of tries to produce parton level from given input.
417  // Negative integer to denote that no subrun has been set.
418  static const int NTRY = 10;
419 
420  // Initialization data, extracted from database.
421  string xmlPath = {};
422  bool doProcessLevel = {}, doPartonLevel = {}, doHadronLevel = {},
423  doLowEnergy = {}, doSoftQCDall = {}, doSoftQCDinel = {},
424  doCentralDiff = {}, doDiffraction = {}, doSoftQCD = {},
425  doHardDiff = {}, doResDec = {}, doFSRinRes = {}, decayRHadrons = {},
426  doPartonVertex = {}, abortIfVeto = {}, checkEvent = {},
427  checkHistory = {}, doNonPert = {};
428  int nErrList = {};
429  double epTolErr = {}, epTolWarn = {}, mTolErr = {}, mTolWarn = {};
430 
431  // Initialization data, from init(...) call, plus some event-specific.
432  bool isConstructed = {}, isInit = {}, showSaV = {}, showMaD = {},
433  doReconnect = {}, forceHadronLevelCR = {};
434  int nCount = {}, nShowLHA = {}, nShowInfo = {}, nShowProc = {},
435  nShowEvt = {}, reconnectMode = {};
436 
437  // information for error checkout.
438  int nErrEvent = {};
439  vector<int> iErrId = {}, iErrCol = {}, iErrEpm = {}, iErrNan = {},
440  iErrNanVtx = {};
441 
442  // Setup of beams: flavours, kinematics and PDFs.
443  BeamSetup beamSetup = {};
444 
445  // LHAup object for generating external events.
446  bool doLHA = false;
447  bool useNewLHA = false;
448  LHAupPtr lhaUpPtr = {};
449 
450  // Pointer to external decay handler and list of particles it handles.
451  DecayHandlerPtr decayHandlePtr = {};
452  vector<int> handledParticles = {};
453 
454  // Pointer to UserHooks object for user interaction with program.
455  UserHooksPtr userHooksPtr = {};
456  bool doVetoProcess = {}, doVetoPartons = {},
457  retryPartonLevel = {}, canVetoHadronization = {};
458 
459  // Pointer to BeamShape object for beam momentum and interaction vertex.
460  BeamShapePtr beamShapePtr = {};
461  bool doVertexSpread = {};
462  double eMinPert = {}, eWidthPert = {};
463 
464  // Pointers to external processes derived from the Pythia base classes.
465  vector<SigmaProcessPtr> sigmaPtrs = {};
466 
467  // Pointers to external phase-space generators derived from Pythia
468  // base classes.
469  vector<PhaseSpacePtr> phaseSpacePtrs = {};
470 
471  // Pointers to external calculation of resonance widths.
472  vector<ResonanceWidthsPtr> resonancePtrs = {};
473 
474  // Pointers to timelike and spacelike showers, including Vincia and Dire.
475  TimeShowerPtr timesDecPtr = {};
476  TimeShowerPtr timesPtr = {};
477  SpaceShowerPtr spacePtr = {};
478  ShowerModelPtr showerModelPtr = {};
479 
480  // Pointer to assign space-time vertices during parton evolution.
481  PartonVertexPtr partonVertexPtr;
482 
483  // The main generator class to define the core process of the event.
484  ProcessLevel processLevel = {};
485 
486  // The main generator class to produce the parton level of the event.
487  PartonLevel partonLevel = {};
488 
489  // The main generator class to perform trial showers of the event.
490  PartonLevel trialPartonLevel = {};
491 
492  // Flags for defining the merging scheme.
493  bool doMerging = {};
494 
495  // The StringInteractions class.
496  StringIntPtr stringInteractionsPtr;
497 
498  // The Colour reconnection class.
499  ColRecPtr colourReconnectionPtr = {};
500 
501  // The junction splitting class.
502  JunctionSplitting junctionSplitting = {};
503 
504  // The main generator class to produce the hadron level of the event.
505  HadronLevel hadronLevel = {};
506 
507  // The total cross section classes are used both on process and parton level.
508  SigmaTotal sigmaTot = {};
509  SigmaLowEnergy sigmaLowEnergy;
510  NucleonExcitations nucleonExcitations = {};
511  SigmaCombined sigmaCmb = {};
512 
513  // The RHadrons class is used both at PartonLevel and HadronLevel.
514  RHadrons rHadrons = {};
515 
516  // Flags for handling generation of heavy ion collisons.
517  bool hasHeavyIons = {}, doHeavyIons = {};
518 
519  // Write the Pythia banner, with symbol and version information.
520  void banner();
521 
522  // Check for lines in file that mark the beginning of new subrun.
523  int readSubrun(string line, bool warn = true);
524 
525  // Check for lines that mark the beginning or end of commented section.
526  int readCommented(string line);
527 
528  // Check that combinations of settings are allowed; change if not.
529  void checkSettings();
530 
531  // Simplified treatment for low-energy nonperturbative collisions.
532  bool nextNonPert(int procTypeIn = 0);
533 
534  // Perform R-hadron decays.
535  bool doRHadronDecays();
536 
537  // Check that the final event makes sense.
538  bool check();
539 
540  // Initialization of SLHA data.
541  bool initSLHA();
542  stringstream particleDataBuffer;
543 
544  // Keep track of and initialize all pointers to PhysicsBase-derived objects.
545  vector<PhysicsBase*> physicsPtrs = {};
546 
547 };
548 
549 //==========================================================================
550 
551 } // end namespace Pythia8
552 
553 #endif // Pythia8_Pythia_H
Event process
The event record for the parton-level central process.
Definition: Pythia.h:326
HeavyIonsPtr getHeavyIonsPtr()
Definition: Pythia.h:210
bool doLowEnergyProcess(int i1, int i2, int procTypeIn)
Do a low-energy collision between two hadrons in the event record.
Definition: Pythia.h:266
bool setRndmEnginePtr(RndmEnginePtr rndmEnginePtrIn)
Possibility to pass in pointer for external random number generation.
Definition: Pythia.h:143
double sigmaPartial(int id1, int id2, double eCM12, double m1, double m2, int type, int mixLoHi=0)
Get partial cross sections.
Definition: SigmaLowEnergy.cc:1563
bool moreDecays(Event &event)
Special routine to allow more decays if on/off switches changed.
Definition: HadronLevel.cc:336
bool setPDFAPtr(PDFPtr pdfAPtrIn)
Routine to pass in pointers to PDF&#39;s. Usage optional.
Definition: BeamSetup.cc:105
LHAupPtr getLHAupPtr()
Possibility to get the pointer to the LHA accessor.
Definition: Pythia.h:219
bool flag(string keyIn)
Give back current value, with check that key exists.
Definition: Settings.cc:1473
Definition: NucleonExcitations.h:23
PDFPtr getPDFPtr(int idIn, int sequence=1, string beam="A", bool resolved=true)
Return a parton density set among list of possibilities.
Definition: Pythia.h:304
Definition: PhysicsBase.h:27
Definition: Info.h:45
bool rndmEnginePtr(RndmEnginePtr rndmEngPtrIn)
Possibility to pass in pointer for external random number generation.
Definition: Basics.cc:27
Definition: BeamSetup.h:33
Rndm rndm
Random number generator.
Definition: Pythia.h:344
bool LHAeventSkip(int nSkip)
Skip a number of Les Houches events at input.
Definition: Pythia.h:312
ParticleData particleData
ParticleData: the particle data table/database.
Definition: Pythia.h:341
The Event class holds all info on the generated event.
Definition: Event.h:453
Definition: BeamParticle.h:133
bool addResonancePtr(ResonanceWidthsPtr resonancePtrIn)
Possibility to add further pointers to allow for multiple resonances.
Definition: Pythia.h:192
Definition: Weights.h:394
Definition: SigmaLowEnergy.h:135
PDFPtr getPDFPtr(int idIn, int sequence=1, string beam="A", bool resolved=true)
Return a parton density set among list of possibilities.
Definition: BeamSetup.cc:1110
bool setResonancePtr(ResonanceWidthsPtr resonancePtrIn)
Possibility to pass in pointer for external resonance.
Definition: Pythia.h:187
Definition: SLHAinterface.h:27
vector< shared_ptr< UserHooks > > hooks
The vector of user hooks.
Definition: UserHooks.h:710
Definition: SigmaTotal.h:141
bool setDecayPtr(DecayHandlerPtr decayHandlePtrIn, vector< int > handledParticlesIn={})
Possibility to pass in pointer for external handling of some decays.
Definition: Pythia.h:137
bool setPhotonFluxPtr(PDFPtr photonFluxAIn, PDFPtr photonFluxBIn)
Set photon fluxes externally. Used with option "PDF:lepton2gammaSet = 2".
Definition: BeamSetup.h:53
Definition: JunctionSplitting.h:30
Class for doing Pythia runs in parallel.
Definition: PythiaParallel.h:18
bool checkVersion()
Check consistency of version numbers (called by constructors).
Definition: Pythia.cc:333
Settings settings
Settings: databases of flags/modes/parms/words to control run.
Definition: Pythia.h:338
bool forceRHadronDecays()
Special routine to force R-hadron decay when not done before.
Definition: Pythia.h:263
void initInfoPtr(Info &infoPtrIn)
This function is called from above for physics objects used in a run.
Definition: PhysicsBase.cc:21
Definition: ProcessLevel.h:36
Gets cross sections for hadron-hadron collisions at low energies.
Definition: SigmaLowEnergy.h:22
bool setLHAupPtr(LHAupPtr lhaUpPtrIn)
Possibility to pass in pointer to external LHA-interfaced generator.
Definition: Pythia.h:133
HIUserHooksPtr hiHooksPtr
Pointer to a HIUserHooks object to modify heavy ion modelling.
Definition: Pythia.h:369
bool setKinematics(double eCMIn)
Switch beam kinematics.
Definition: Pythia.cc:1398
Event event
The event record for the complete event history.
Definition: Pythia.h:329
bool init()
Initialize.
Definition: Pythia.cc:491
bool setPDFPtr(PDFPtr pdfAPtrIn, PDFPtr pdfBPtrIn, PDFPtr pdfHardAPtrIn=nullptr, PDFPtr pdfHardBPtrIn=nullptr, PDFPtr pdfPomAPtrIn=nullptr, PDFPtr pdfPomBPtrIn=nullptr, PDFPtr pdfGamAPtrIn=nullptr, PDFPtr pdfGamBPtrIn=nullptr, PDFPtr pdfHardGamAPtrIn=nullptr, PDFPtr pdfHardGamBPtrIn=nullptr, PDFPtr pdfUnresAPtrIn=nullptr, PDFPtr pdfUnresBPtrIn=nullptr, PDFPtr pdfUnresGamAPtrIn=nullptr, PDFPtr pdfUnresGamBPtrIn=nullptr, PDFPtr pdfVMDAPtrIn=nullptr, PDFPtr pdfVMDBPtrIn=nullptr)
Possibility to pass in pointers to PDF&#39;s.
Definition: Pythia.h:111
bool setMergingPtr(MergingPtr mergingPtrIn)
Possibility to pass in pointer for full merging class.
Definition: Pythia.h:161
bool setPDFPtr(PDFPtr pdfAPtrIn, PDFPtr pdfBPtrIn, PDFPtr pdfHardAPtrIn=nullptr, PDFPtr pdfHardBPtrIn=nullptr, PDFPtr pdfPomAPtrIn=nullptr, PDFPtr pdfPomBPtrIn=nullptr, PDFPtr pdfGamAPtrIn=nullptr, PDFPtr pdfGamBPtrIn=nullptr, PDFPtr pdfHardGamAPtrIn=nullptr, PDFPtr pdfHardGamBPtrIn=nullptr, PDFPtr pdfUnresAPtrIn=nullptr, PDFPtr pdfUnresBPtrIn=nullptr, PDFPtr pdfUnresGamAPtrIn=nullptr, PDFPtr pdfUnresGamBPtrIn=nullptr, PDFPtr pdfVMDAPtrIn=nullptr, PDFPtr pdfVMDBPtrIn=nullptr)
Possibility to pass in pointers to PDF&#39;s.
Definition: BeamSetup.cc:21
const BeamParticle & beamA
The two incoming beams.
Definition: Pythia.h:375
~Pythia()
Destructor.
Definition: Pythia.h:88
Definition: Logger.h:23
SLHAinterface slhaInterface
SLHA Interface.
Definition: Pythia.h:353
HeavyIonsPtr heavyIonsPtr
Pointer to a HeavyIons object for generating heavy ion collisions.
Definition: Pythia.h:366
Definition: RHadrons.h:29
bool setPartonVertexPtr(PartonVertexPtr partonVertexPtrIn)
Possibility to pass in pointer for setting of parton space-time vertices.
Definition: Pythia.h:222
BeamShapePtr getBeamShapePtr()
Possibility to access the pointer to the BeamShape object.
Definition: Pythia.h:213
CoupSUSY coupSUSY
SUSY couplings.
Definition: Pythia.h:350
bool setBeamIDs(int idAin, int idBin=0)
Switch to new beam particle identities; for similar hadrons only.
Definition: Pythia.h:233
CoupSM coupSM
Standard Model couplings, including alphaS and alphaEM.
Definition: Pythia.h:347
BeamParticle beamA
The two incoming beams.
Definition: BeamSetup.h:127
Definition: HadronLevel.h:45
Definition: Basics.h:385
PartonSystems partonSystems
The partonic content of each subcollision system (auxiliary to event).
Definition: Pythia.h:356
bool moreDecays()
Special routine to allow more decays if on/off switches changed.
Definition: Pythia.h:259
ShowerModelPtr getShowerModelPtr()
Possibility to get the pointer to the parton-shower model.
Definition: Pythia.h:216
bool setBeamShapePtr(BeamShapePtr beamShapePtrIn)
Possibility to pass in pointer for beam shape.
Definition: Pythia.h:169
Definition: PartonLevel.h:45
Status
Enumerate the different status codes the event generation can have.
Definition: PhysicsBase.h:32
Definition: HadronWidths.h:22
bool setMergingHooksPtr(MergingHooksPtr mergingHooksPtrIn)
Possibility to pass in pointer for merging hooks.
Definition: Pythia.h:165
MergingHooksPtr mergingHooksPtr
Definition: Pythia.h:363
void stat()
Main routine to provide final statistics on generation.
Definition: Pythia.cc:1726
bool doLowEnergyProcess(int i1, int i2, int procTypeIn, Event &event)
Special routine to do a low-energy hadron-hadron scattering.
Definition: HadronLevel.h:81
bool addSigmaPtr(SigmaProcessPtr sigmaPtrIn, PhaseSpacePtr phaseSpacePtrIn=nullptr)
Possibility to add further pointers to allow for multiple cross sections.
Definition: Pythia.h:181
bool setBeamIDs(int idAin, int idBin=0)
Switch to new beam particle identities; for similar hadrons only.
Definition: BeamSetup.cc:153
void setBeamID(int iPDFA=0)
Switch to new beam particle identities; for similar hadrons only.
Definition: PartonLevel.h:66
bool setHeavyIonsPtr(HeavyIonsPtr heavyIonsPtrIn)
Possibility to pass in pointer for modelling of heavy ion collisions.
Definition: Pythia.h:200
bool setLHAupPtr(LHAupPtr lhaUpPtrIn)
Possibility to pass in pointer to external LHA-interfaced generator.
Definition: BeamSetup.h:59
Definition: StandardModel.h:135
bool forceHadronLevel(bool findJunctions=true)
Generate only the hadronization/decay stage.
Definition: Pythia.cc:1515
bool readFile(string fileName, bool warn=true, int subrun=SUBRUNDEFAULT)
Read in updates for settings or particle data from user-defined file.
Definition: Pythia.cc:431
HadronWidths hadronWidths
HadronWidths: the hadron widths data table/database.
Definition: Pythia.h:372
double getSigmaTotal()
Get total cross section for two hadrons in the event record or standalone.
Definition: Pythia.h:272
double m2(const Vec4 &v1)
The squared invariant mass of one or more four-vectors.
Definition: Basics.cc:586
bool setUserHooksPtr(UserHooksPtr userHooksPtrIn)
Possibility to pass in pointer for user hooks.
Definition: Pythia.h:147
void updateBeamIDs()
Switch to new beam particle identities; for similar hadrons only.
Definition: ProcessLevel.cc:366
bool setPDFBPtr(PDFPtr pdfBPtrIn)
Routine to pass in pointers to PDF&#39;s. Usage optional.
Definition: BeamSetup.cc:129
bool addUserHooksPtr(UserHooksPtr userHooksPtrIn)
Possibility to add further pointers to allow multiple user hooks.
Definition: Pythia.h:151
bool setShowerModelPtr(ShowerModelPtr showerModelPtrIn)
Possibility to pass in pointer for external showers.
Definition: Pythia.h:196
The PartonSystems class describes the whole set of subcollisions.
Definition: PartonSystems.h:42
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The Pythia class contains the top-level routines to generate an event.
Definition: Pythia.h:71
double getSigmaPartial(int procTypeIn)
Definition: Pythia.h:287
UserHooksVector implements a vector of UserHooks and is itself a UserHooks.
Definition: UserHooks.h:299
const Info & info
Public information and statistic on the generation.
Definition: Pythia.h:332
Pythia(string xmlDir="../share/Pythia8/xmldoc", bool printBanner=true)
Constructor. (See Pythia.cc file.)
Definition: Pythia.cc:33
bool next()
Generate the next event.
Definition: Pythia.h:229
BeamShapePtr getBeamShapePtr()
Possibility to access the pointer to the BeamShape object.
Definition: BeamSetup.h:77
bool readString(string, bool warn=true, int subrun=SUBRUNDEFAULT)
Read in one update for a setting or particle data from a single line.
Definition: Pythia.cc:365
double sigmaTotal(int id1, int id2, double eCM12, double m1, double m2, int mixLoHi=0)
Get total cross section.
Definition: SigmaLowEnergy.cc:1526
bool setPhotonFluxPtr(PDFPtr photonFluxAIn, PDFPtr photonFluxBIn)
Set photon fluxes externally. Used with option "PDF:lepton2gammaSet = 2".
Definition: Pythia.h:129
int forceTimeShower(int iBeg, int iEnd, double pTmax, int nBranchMax=0)
Generate only a single timelike shower as in a decay.
Definition: Pythia.h:249
void LHAeventList()
List the current Les Houches event.
Definition: Pythia.h:309
MergingPtr mergingPtr
Merging object as wrapper for matrix element merging routines.
Definition: Pythia.h:359
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
bool setSigmaPtr(SigmaProcessPtr sigmaPtrIn, PhaseSpacePtr phaseSpacePtrIn=nullptr)
Definition: Pythia.h:174
bool decay(int iDec, Event &event)
Try to decay the specified particle. Returns false if decay failed.
Definition: HadronLevel.h:66
Logger logger
Logger: for diagnostic messages, errors, statistics, etc.
Definition: Pythia.h:335
bool flag(string key)
Read in settings values: shorthand, not new functionality.
Definition: Pythia.h:320
bool setBeamShapePtr(BeamShapePtr beamShapePtrIn)
Possibility to pass in pointer for beam shape.
Definition: BeamSetup.h:73
Definition: Basics.h:32
bool setHIHooks(HIUserHooksPtr hiHooksPtrIn)
Definition: Pythia.h:205
Definition: SusyCouplings.h:27
Definition: Settings.h:195
void clear()
Reset system list to empty.
Definition: PartonSystems.h:50