Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-06 08:48:45

0001 // Pythia.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2025 Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // This file contains the main class for event generation.
0007 // Pythia: provide the main user interface to everything else.
0008 
0009 #ifndef Pythia8_Pythia_H
0010 #define Pythia8_Pythia_H
0011 
0012 // Version number defined for use in macros and for consistency checks.
0013 #define PYTHIA_VERSION 8.316
0014 #define PYTHIA_VERSION_INTEGER 8316
0015 
0016 // Header files for the Pythia class and for what else the user may need.
0017 #include "Pythia8/Analysis.h"
0018 #include "Pythia8/Basics.h"
0019 #include "Pythia8/BeamParticle.h"
0020 #include "Pythia8/BeamSetup.h"
0021 #include "Pythia8/Event.h"
0022 #include "Pythia8/FragmentationFlavZpT.h"
0023 #include "Pythia8/HadronLevel.h"
0024 #include "Pythia8/HadronWidths.h"
0025 #include "Pythia8/Info.h"
0026 #include "Pythia8/JunctionSplitting.h"
0027 #include "Pythia8/LesHouches.h"
0028 #include "Pythia8/Logger.h"
0029 #include "Pythia8/SigmaLowEnergy.h"
0030 #include "Pythia8/Merging.h"
0031 #include "Pythia8/MergingHooks.h"
0032 #include "Pythia8/PartonLevel.h"
0033 #include "Pythia8/ParticleData.h"
0034 #include "Pythia8/PartonDistributions.h"
0035 #include "Pythia8/PartonSystems.h"
0036 #include "Pythia8/PartonVertex.h"
0037 #include "Pythia8/PhysicsBase.h"
0038 #include "Pythia8/ProcessLevel.h"
0039 #include "Pythia8/PythiaStdlib.h"
0040 #include "Pythia8/ResonanceWidths.h"
0041 #include "Pythia8/RHadrons.h"
0042 #include "Pythia8/Ropewalk.h"
0043 #include "Pythia8/Settings.h"
0044 #include "Pythia8/ShowerModel.h"
0045 #include "Pythia8/SigmaTotal.h"
0046 #include "Pythia8/SimpleSpaceShower.h"
0047 #include "Pythia8/SimpleTimeShower.h"
0048 #include "Pythia8/SpaceShower.h"
0049 #include "Pythia8/StandardModel.h"
0050 #include "Pythia8/StringInteractions.h"
0051 #include "Pythia8/SusyCouplings.h"
0052 #include "Pythia8/SLHAinterface.h"
0053 #include "Pythia8/ThermalFragmentation.h"
0054 #include "Pythia8/TimeShower.h"
0055 #include "Pythia8/UserHooks.h"
0056 #include "Pythia8/VinciaCommon.h"
0057 #include "Pythia8/Weights.h"
0058 
0059 namespace Pythia8 {
0060 
0061 //==========================================================================
0062 
0063 // Forward declaration of the HeavyIons and HIUserHooks classes.
0064 class HeavyIons;
0065 class HIUserHooks;
0066 
0067 // Forward declaration of PythiaParallel class, to be friended.
0068 class PythiaParallel;
0069 
0070 // The Pythia class contains the top-level routines to generate an event.
0071 
0072 class Pythia {
0073 
0074 public:
0075 
0076   // Constructor. (See Pythia.cc file.)
0077   Pythia(string xmlDir = "../share/Pythia8/xmldoc", bool printBanner = true);
0078 
0079   // Constructor to copy settings and particle database from another Pythia
0080   // object instead of XML files (to speed up multiple initialisations).
0081   Pythia(Settings& settingsIn, ParticleData& particleDataIn,
0082     bool printBanner = true);
0083 
0084   // Constructor taking input from streams instead of files.
0085   Pythia( istream& settingsStrings, istream& particleDataStrings,
0086     bool printBanner = true);
0087 
0088   // Destructor.
0089   ~Pythia() {}
0090 
0091   // Copy and = constructors cannot be used.
0092   Pythia(const Pythia&) = delete;
0093   Pythia& operator=(const Pythia&) = delete;
0094 
0095   // Check consistency of version numbers (called by constructors).
0096   bool checkVersion();
0097 
0098   // Read in one update for a setting or particle data from a single line.
0099   inline bool readString(string line, bool warn = true,
0100     int subrun = SUBRUNDEFAULT) {
0101     return isConstructed ? settings.readString(line, warn, subrun) : false;}
0102 
0103   // Read in updates for settings or particle data from user-defined file.
0104   inline bool readFile(string fileName, bool warn = true,
0105     int subrun = SUBRUNDEFAULT) {
0106     return isConstructed ? settings.readFile(fileName, warn, subrun) : false;}
0107   inline bool readFile(string fileName, int subrun) {
0108     return readFile(fileName, true, subrun);}
0109   inline bool readFile(istream& is = cin, bool warn = true,
0110     int subrun = SUBRUNDEFAULT) {
0111     return isConstructed ? settings.readFile(is, warn, subrun) : false;}
0112   inline bool readFile(istream& is, int subrun) {
0113     return readFile(is, true, subrun);}
0114 
0115   // Possibility to pass in pointers to PDF's.
0116   inline bool setPDFPtr(PDFPtr pdfAPtrIn, PDFPtr pdfBPtrIn,
0117     PDFPtr pdfHardAPtrIn = nullptr, PDFPtr pdfHardBPtrIn = nullptr,
0118     PDFPtr pdfPomAPtrIn = nullptr, PDFPtr pdfPomBPtrIn = nullptr,
0119     PDFPtr pdfGamAPtrIn = nullptr, PDFPtr pdfGamBPtrIn = nullptr,
0120     PDFPtr pdfHardGamAPtrIn = nullptr, PDFPtr pdfHardGamBPtrIn = nullptr,
0121     PDFPtr pdfUnresAPtrIn = nullptr, PDFPtr pdfUnresBPtrIn = nullptr,
0122     PDFPtr pdfUnresGamAPtrIn = nullptr, PDFPtr pdfUnresGamBPtrIn = nullptr,
0123     PDFPtr pdfVMDAPtrIn = nullptr, PDFPtr pdfVMDBPtrIn = nullptr) {
0124       return beamSetup.setPDFPtr( pdfAPtrIn, pdfBPtrIn, pdfHardAPtrIn,
0125       pdfHardBPtrIn, pdfPomAPtrIn, pdfPomBPtrIn, pdfGamAPtrIn, pdfGamBPtrIn,
0126       pdfHardGamAPtrIn, pdfHardGamBPtrIn, pdfUnresAPtrIn, pdfUnresBPtrIn,
0127       pdfUnresGamAPtrIn, pdfUnresGamBPtrIn, pdfVMDAPtrIn, pdfVMDBPtrIn); }
0128   inline bool setPDFAPtr( PDFPtr pdfAPtrIn ) {
0129     return beamSetup.setPDFAPtr( pdfAPtrIn); }
0130   inline bool setPDFBPtr( PDFPtr pdfBPtrIn ) {
0131     return beamSetup.setPDFBPtr( pdfBPtrIn); }
0132 
0133   // Set photon fluxes externally. Used with option "PDF:lepton2gammaSet = 2".
0134   inline bool setPhotonFluxPtr(PDFPtr photonFluxAIn, PDFPtr photonFluxBIn) {
0135     return beamSetup.setPhotonFluxPtr( photonFluxAIn, photonFluxBIn); }
0136 
0137   // Possibility to pass in pointer to external LHA-interfaced generator.
0138   inline bool setLHAupPtr(LHAupPtr lhaUpPtrIn) {
0139     lhaUpPtr = lhaUpPtrIn;
0140     useNewLHA = false;
0141     return beamSetup.setLHAupPtr(lhaUpPtrIn);}
0142 
0143   // Possibility to pass in pointer for external handling of some decays.
0144   inline bool setDecayPtr(DecayHandlerPtr decayHandlePtrIn,
0145     vector<int> handledParticlesIn = {}) {
0146     decayHandlePtr = decayHandlePtrIn;
0147     handledParticles = handledParticlesIn.size() == 0 ?
0148       decayHandlePtrIn->handledParticles() : handledParticlesIn; return true;}
0149 
0150   // Possibility to pass in pointer for external random number generation.
0151   inline bool setRndmEnginePtr(RndmEnginePtr rndmEnginePtrIn) {
0152     return rndm.rndmEnginePtr(rndmEnginePtrIn);}
0153 
0154   // Possibility to pass in pointer for user hooks.
0155   inline bool setUserHooksPtr(UserHooksPtr userHooksPtrIn) {
0156     userHooksPtr = userHooksPtrIn; return true;}
0157 
0158   // Possibility to add further pointers to allow multiple user hooks.
0159   inline bool addUserHooksPtr(UserHooksPtr userHooksPtrIn) {
0160     if ( !userHooksPtrIn ) return false;
0161     if ( !userHooksPtr ) return setUserHooksPtr(userHooksPtrIn);
0162     shared_ptr<UserHooksVector> uhv =
0163       dynamic_pointer_cast<UserHooksVector>(userHooksPtr);
0164     if ( !uhv ) { uhv = make_shared<UserHooksVector>();
0165       uhv->hooks.push_back(userHooksPtr); userHooksPtr = uhv; }
0166     uhv->hooks.push_back(userHooksPtrIn); return true;}
0167 
0168   // Possibility to insert a user hook.
0169   inline bool insertUserHooksPtr(int idx, UserHooksPtr userHooksPtrIn) {
0170     if ( !userHooksPtrIn || !userHooksPtr ) return false;
0171     shared_ptr<UserHooksVector> uhv =
0172       dynamic_pointer_cast<UserHooksVector>(userHooksPtr);
0173     if ( !uhv || idx < 0 || idx > (int)uhv->hooks.size() ) return false;
0174     uhv->hooks.insert(uhv->hooks.begin() + idx, userHooksPtrIn); return true;}
0175 
0176   // Possibility to pass in pointer for full merging class.
0177   inline bool setMergingPtr(MergingPtr mergingPtrIn) {
0178     mergingPtr = mergingPtrIn; return true;}
0179 
0180   // Possibility to pass in pointer for merging hooks.
0181   inline bool setMergingHooksPtr(MergingHooksPtr mergingHooksPtrIn) {
0182     mergingHooksPtr = mergingHooksPtrIn; return true;}
0183 
0184   // Possibility to pass in pointer for beam shape.
0185   inline bool setBeamShapePtr(BeamShapePtr beamShapePtrIn) {
0186     return beamSetup.setBeamShapePtr(beamShapePtrIn);}
0187 
0188   // Possibility to pass in pointer for external cross section,
0189   // with option to include external phase-space generator.
0190   inline bool setSigmaPtr(SigmaProcessPtr sigmaPtrIn,
0191     PhaseSpacePtr phaseSpacePtrIn = nullptr) {
0192     sigmaPtrs.resize(0), phaseSpacePtrs.resize(0);
0193     sigmaPtrs.push_back(sigmaPtrIn);
0194     phaseSpacePtrs.push_back(phaseSpacePtrIn); return true;}
0195 
0196   // Possibility to add further pointers to allow for multiple cross sections.
0197   inline bool addSigmaPtr(SigmaProcessPtr sigmaPtrIn,
0198     PhaseSpacePtr phaseSpacePtrIn = nullptr) {
0199     sigmaPtrs.push_back(sigmaPtrIn);
0200     phaseSpacePtrs.push_back(phaseSpacePtrIn); return true;}
0201 
0202   // Possibility to insert further pointers to allow for multiple
0203   // cross sections.
0204   inline bool insertSigmaPtr(int idx, SigmaProcessPtr sigmaPtrIn,
0205     PhaseSpacePtr phaseSpacePtrIn = nullptr) {
0206     if (idx < 0 || idx > (int)sigmaPtrs.size()) return false;
0207     sigmaPtrs.insert(sigmaPtrs.begin() + idx, sigmaPtrIn);
0208     phaseSpacePtrs.insert(phaseSpacePtrs.begin() + idx, phaseSpacePtrIn);
0209     return true;}
0210 
0211   // Possibility to pass in pointer for external resonance.
0212   inline bool setResonancePtr(ResonanceWidthsPtr resonancePtrIn) {
0213     resonancePtrs.resize(0);
0214     resonancePtrs.push_back( resonancePtrIn); return true;}
0215 
0216   // Possibility to add further pointers to allow for multiple resonances.
0217   inline bool addResonancePtr(ResonanceWidthsPtr resonancePtrIn) {
0218     resonancePtrs.push_back( resonancePtrIn); return true;}
0219 
0220   // Possibility to insert further pointers to allow for multiple resonances.
0221   inline bool insertResonancePtr(int idx, ResonanceWidthsPtr resonancePtrIn) {
0222     if (idx < 0 || idx > (int)resonancePtrs.size()) return false;
0223     resonancePtrs.insert( resonancePtrs.begin() + idx, resonancePtrIn);
0224     return true;}
0225 
0226   // Possibility to pass in pointer for external showers.
0227   inline bool setShowerModelPtr(ShowerModelPtr showerModelPtrIn) {
0228     showerModelPtr = showerModelPtrIn; return true;}
0229 
0230   // Possibility to pass in pointer for external fragmentation model.
0231   inline bool setFragmentationPtr(FragmentationModelPtr fragmentationPtrIn) {
0232     fragPtrs.resize(0);
0233     fragPtrs.push_back(fragmentationPtrIn); return true;}
0234 
0235   // Possibility to allow for multiple external fragmentation models.
0236   inline bool addFragmentationPtr(FragmentationModelPtr fragmentationPtrIn) {
0237     fragPtrs.push_back(fragmentationPtrIn); return true;}
0238 
0239   // Possibility to insert external fragmentation model, in specific position.
0240   inline bool insertFragmentationPtr(int idx,
0241     FragmentationModelPtr fragmentationPtrIn) {
0242     if (idx < 0 || idx > (int)fragPtrs.size()) return false;
0243     fragPtrs.insert( fragPtrs.begin() + idx, fragmentationPtrIn);
0244     return true;}
0245 
0246   // Possibility to pass in pointer for modelling of heavy ion collisions.
0247   inline bool setHeavyIonsPtr(HeavyIonsPtr heavyIonsPtrIn) {
0248     heavyIonsPtr = heavyIonsPtrIn; return true;}
0249 
0250   // Possibility to pass a HIUserHooks pointer for modifying the
0251   // behavior of the heavy ion modelling.
0252   inline bool setHIHooks(HIUserHooksPtr hiHooksPtrIn) {
0253     hiHooksPtr = hiHooksPtrIn; return true; }
0254 
0255   // Possibility to get the pointer to a object modelling heavy ion
0256   // collisions.
0257   inline HeavyIonsPtr getHeavyIonsPtr() { return heavyIonsPtr;}
0258 
0259   // Possibility to access the pointer to the BeamShape object.
0260   inline BeamShapePtr getBeamShapePtr() { return beamSetup.getBeamShapePtr();}
0261 
0262   // Possibility to get the pointer to the parton-shower model.
0263   inline ShowerModelPtr getShowerModelPtr() { return showerModelPtr;}
0264 
0265   // Possibility to get the pointer to the LHA accessor.
0266   inline LHAupPtr getLHAupPtr() { return lhaUpPtr;}
0267 
0268   // Possibility to pass in pointer for setting of parton space-time vertices.
0269   inline bool setPartonVertexPtr( PartonVertexPtr partonVertexPtrIn) {
0270     partonVertexPtr = partonVertexPtrIn; return true;}
0271 
0272   // Initialize.
0273   bool init();
0274 
0275   // Generate the next event.
0276   inline bool next() { return next(0); }
0277   bool next(int procTypeIn);
0278 
0279   // Switch to new beam particle identities; for similar hadrons only.
0280   bool setBeamIDs( int idAin, int idBin = 0);
0281 
0282   // Switch beam kinematics.
0283   bool setKinematics(double eCMIn);
0284   bool setKinematics(double eAIn, double eBIn);
0285   bool setKinematics(double pxAIn, double pyAIn, double pzAIn,
0286                      double pxBIn, double pyBIn, double pzBIn);
0287   bool setKinematics(Vec4 pAIn, Vec4 pBIn);
0288 
0289   // Generate only a single timelike shower as in a decay.
0290   inline int forceTimeShower( int iBeg, int iEnd, double pTmax,
0291     int nBranchMax = 0) {
0292     if (!isInit) {
0293       logger.ERROR_MSG("Pythia is not properly initialized");
0294       return 0;
0295     }
0296     partonSystems.clear();
0297     infoPrivate.setScalup( 0, pTmax);
0298     return timesDecPtr->shower(iBeg, iEnd, event, pTmax, nBranchMax);}
0299 
0300   // Generate only the hadronization/decay stage.
0301   bool forceHadronLevel( bool findJunctions = true);
0302 
0303   // Special routine to allow more decays if on/off switches changed.
0304   bool moreDecays() {return hadronLevel.moreDecays(event);}
0305   bool moreDecays(int index) {return hadronLevel.decay(index, event);}
0306 
0307   // Special routine to force R-hadron decay when not done before.
0308   bool forceRHadronDecays() {return doRHadronDecays();}
0309 
0310   // Do a low-energy collision between two hadrons in the event record.
0311   inline bool doLowEnergyProcess(int i1, int i2, int procTypeIn) {
0312     if (!isInit) {
0313       logger.ERROR_MSG("Pythia is not properly initialized"); return false; }
0314     return hadronLevel.doLowEnergyProcess( i1, i2, procTypeIn, event); }
0315 
0316   // Get total cross section for two hadrons in the event record or standalone.
0317   inline double getSigmaTotal() {
0318     return getSigmaTotal(beamSetup.idA, beamSetup.idB, beamSetup.eCM, 0);}
0319   inline double getSigmaTotal(double eCM12, int mixLoHi = 0) {
0320     return getSigmaTotal(beamSetup.idA, beamSetup.idB, eCM12, mixLoHi);}
0321   inline double getSigmaTotal(int id1, int id2, double eCM12,
0322     int mixLoHi = 0) {
0323     return getSigmaTotal(id1, id2, eCM12, particleData.m0(id1),
0324       particleData.m0(id2), mixLoHi); }
0325   inline double getSigmaTotal(int id1, int id2, double eCM12, double m1,
0326     double m2, int mixLoHi = 0) {
0327     if (!isInit) {
0328       logger.ERROR_MSG("Pythia is not properly initialized"); return 0.; }
0329     return sigmaCmb.sigmaTotal(id1, id2, eCM12, m1, m2, mixLoHi); }
0330 
0331   // Get partial (elastic, diffractive, non-diffractive, ...) cross sections
0332   // for two hadrons in the event record or standalone.
0333   inline double getSigmaPartial(int procTypeIn) {
0334     return getSigmaPartial(beamSetup.idA, beamSetup.idB, beamSetup.eCM,
0335       procTypeIn, 0); }
0336   inline double getSigmaPartial(double eCM12, int procTypeIn,
0337     int mixLoHi = 0) {return getSigmaPartial(
0338       beamSetup.idA, beamSetup.idB, eCM12, procTypeIn, mixLoHi); }
0339   inline double getSigmaPartial(int id1, int id2, double eCM12, int procTypeIn,
0340     int mixLoHi = 0) {return getSigmaPartial(id1, id2, eCM12,
0341       particleData.m0(id1), particleData.m0(id2), procTypeIn, mixLoHi); }
0342   inline double getSigmaPartial(int id1, int id2, double eCM12, double m1,
0343     double m2, int procTypeIn, int mixLoHi = 0) {
0344     if (!isInit) {
0345       logger.ERROR_MSG("Pythia is not properly initialized"); return 0.;}
0346     return sigmaCmb.sigmaPartial(
0347       id1, id2, eCM12, m1, m2, procTypeIn, mixLoHi);}
0348 
0349   // Return a parton density set among list of possibilities.
0350   inline PDFPtr getPDFPtr(int idIn, int sequence = 1, string beam = "A",
0351     bool resolved = true) {
0352     return beamSetup.getPDFPtr( idIn, sequence, beam, resolved); }
0353 
0354   // List the current Les Houches event.
0355   inline void LHAeventList() { if (lhaUpPtr != 0) lhaUpPtr->listEvent();}
0356 
0357   // Skip a number of Les Houches events at input.
0358   inline bool LHAeventSkip(int nSkip) {
0359     if (lhaUpPtr != 0) return lhaUpPtr->skipEvent(nSkip);
0360     return false;}
0361 
0362   // Main routine to provide final statistics on generation.
0363   void stat();
0364 
0365   // Read in settings values: shorthand, not new functionality.
0366   bool   flag(string key) {return settings.flag(key);}
0367   int    mode(string key) {return settings.mode(key);}
0368   double parm(string key) {return settings.parm(key);}
0369   string word(string key) {return settings.word(key);}
0370 
0371   // The event record for the parton-level central process.
0372   Event           process = {};
0373 
0374   // The event record for the complete event history.
0375   Event           event = {};
0376 
0377   // Public information and statistic on the generation.
0378   const Info&     info = infoPrivate;
0379 
0380   // Logger: for diagnostic messages, errors, statistics, etc.
0381   Logger          logger = {};
0382 
0383   // Settings: databases of flags/modes/parms/words to control run.
0384   Settings        settings = {};
0385 
0386   // ParticleData: the particle data table/database.
0387   ParticleData    particleData = {};
0388 
0389   // Random number generator.
0390   Rndm            rndm = {};
0391 
0392   // Standard Model couplings, including alphaS and alphaEM.
0393   CoupSM          coupSM = {};
0394 
0395   // SUSY couplings.
0396   CoupSUSY        coupSUSY = {};
0397 
0398   // SLHA Interface
0399   SLHAinterface   slhaInterface = {};
0400 
0401   // The partonic content of each subcollision system (auxiliary to event).
0402   PartonSystems   partonSystems = {};
0403 
0404   // Merging object as wrapper for matrix element merging routines.
0405   MergingPtr      mergingPtr = {};
0406 
0407   // Pointer to MergingHooks object for user interaction with the merging.
0408   // MergingHooks also more generally steers the matrix element merging.
0409   MergingHooksPtr  mergingHooksPtr;
0410 
0411   // Pointer to a HeavyIons object for generating heavy ion collisions
0412   HeavyIonsPtr   heavyIonsPtr = {};
0413 
0414   // Pointer to a HIUserHooks object to modify heavy ion modelling.
0415   HIUserHooksPtr hiHooksPtr = {};
0416 
0417   // HadronWidths: the hadron widths data table/database.
0418   HadronWidths    hadronWidths = {};
0419 
0420   // The two incoming beams.
0421   const BeamParticle& beamA = beamSetup.beamA;
0422   const BeamParticle& beamB = beamSetup.beamB;
0423 
0424 private:
0425 
0426   // Friend PythiaParallel to give full access to underlying info.
0427   friend class PythiaParallel;
0428   friend class PhysicsBase;
0429 
0430   // The collector of all event generation weights that should eventually
0431   // be transferred to the final output.
0432   WeightContainer weightContainer = {};
0433 
0434   // The main keeper/collector of information, accessible from all
0435   // PhysicsBase objects. The information is available from the
0436   // outside through the public info object.
0437   Info infoPrivate = {};
0438 
0439   // Initialise new Pythia object (called by constructors).
0440   void initPtrs();
0441 
0442   // Initialise fragmentation model objects.
0443   void initFragPtrs();
0444 
0445   // Initialise user provided plugins.
0446   void initPlugins();
0447 
0448   // Functions to be called at the beginning and end of a next() call.
0449   void beginEvent();
0450   void endEvent(PhysicsBase::Status status);
0451 
0452   // Register a PhysicsBase object and give it a pointer to the info object.
0453   inline void registerPhysicsBase(PhysicsBase &pb) {
0454     if (find(physicsPtrs.begin(), physicsPtrs.end(), &pb) != physicsPtrs.end())
0455       return;
0456     pb.initInfoPtr(infoPrivate);
0457     physicsPtrs.push_back(&pb);
0458   }
0459 
0460   // If new pointers are set in Info propagate this to all
0461   // PhysicsBase objects.
0462   void pushInfo();
0463 
0464   // Constants: could only be changed in the code itself.
0465   static const double VERSIONNUMBERHEAD, VERSIONNUMBERCODE;
0466   // Maximum number of tries to produce parton level from given input.
0467   // Negative integer to denote that no subrun has been set.
0468   static const int    NTRY = 10;
0469 
0470   // Initialization data, extracted from database.
0471   string xmlPath = {};
0472   bool   doProcessLevel = {}, doPartonLevel = {}, doHadronLevel = {},
0473          doLowEnergy = {}, doSoftQCDall = {}, doSoftQCDinel = {},
0474          doCentralDiff = {}, doDiffraction = {}, doSoftQCD = {},
0475          doHardDiff = {}, doResDec = {}, doFSRinRes = {}, decayRHadrons = {},
0476          doPartonVertex = {}, abortIfVeto = {}, checkEvent = {},
0477          checkHistory = {}, doNonPert = {};
0478   int    nErrList = {};
0479   double epTolErr = {}, epTolWarn = {}, mTolErr = {}, mTolWarn = {};
0480 
0481   // Initialization data, from init(...) call, plus some event-specific.
0482   bool   isConstructed = {}, isInit = {}, showSaV = {}, showMaD = {},
0483          doReconnect = {}, forceHadronLevelCR = {};
0484   int    nCount = {}, nShowLHA = {}, nShowInfo = {}, nShowProc = {},
0485          nShowEvt = {}, reconnectMode = {};
0486 
0487   // information for error checkout.
0488   int    nErrEvent = {};
0489   vector<int> iErrId = {}, iErrCol = {}, iErrEpm = {}, iErrNan = {},
0490          iErrNanVtx = {};
0491 
0492   // Setup of beams: flavours, kinematics and PDFs.
0493   BeamSetup beamSetup = {};
0494 
0495   // LHAup object for generating external events.
0496   bool     doLHA = false;
0497   bool     useNewLHA = false;
0498   LHAupPtr lhaUpPtr = {};
0499 
0500   // Pointer to external decay handler and list of particles it handles.
0501   DecayHandlerPtr decayHandlePtr = {};
0502   vector<int>     handledParticles = {};
0503 
0504   // Pointer to UserHooks object for user interaction with program.
0505   UserHooksPtr userHooksPtr = {};
0506   bool doVetoProcess = {}, doVetoPartons = {},
0507        retryPartonLevel = {}, canVetoHadronization = {};
0508 
0509   // Pointer to BeamShape object for beam momentum and interaction vertex.
0510   BeamShapePtr beamShapePtr = {};
0511   bool         doVertexSpread = {};
0512   double       eMinPert = {}, eWidthPert = {};
0513 
0514   // Pointers to external processes derived from the Pythia base classes.
0515   vector<SigmaProcessPtr> sigmaPtrs = {};
0516 
0517   // Pointers to external phase-space generators derived from Pythia
0518   // base classes.
0519   vector<PhaseSpacePtr> phaseSpacePtrs = {};
0520 
0521   // Pointers to external calculation of resonance widths.
0522   vector<ResonanceWidthsPtr> resonancePtrs = {};
0523 
0524   // Pointers to timelike and spacelike showers, including Vincia.
0525   // Note, the showerModelPtr must be declared before the
0526   // individual shower pointers, partonLevel, and hadronLevel. This
0527   // ensures shared pointers that belong to showerModelPtr are
0528   // unloaded correctly.
0529   ShowerModelPtr showerModelPtr = {};
0530   TimeShowerPtr  timesDecPtr = {};
0531   TimeShowerPtr  timesPtr = {};
0532   SpaceShowerPtr spacePtr = {};
0533 
0534   // Pointers to fragmentation models.
0535   vector<FragmentationModelPtr> fragPtrs = {};
0536 
0537   // Pointer to assign space-time vertices during parton evolution.
0538   PartonVertexPtr partonVertexPtr;
0539 
0540   // The main generator class to define the core process of the event.
0541   ProcessLevel processLevel = {};
0542 
0543   // The main generator class to produce the parton level of the event.
0544   PartonLevel partonLevel = {};
0545 
0546   // The main generator class to perform trial showers of the event.
0547   PartonLevel trialPartonLevel = {};
0548 
0549   // Flags for defining the merging scheme.
0550   bool        doMerging = {};
0551 
0552   // The StringInteractions class.
0553   StringIntPtr stringInteractionsPtr;
0554 
0555   // The Colour reconnection class.
0556   ColRecPtr colourReconnectionPtr = {};
0557 
0558   // The junction splitting class.
0559   JunctionSplitting junctionSplitting = {};
0560 
0561   // The main generator class to produce the hadron level of the event.
0562   HadronLevel hadronLevel = {};
0563 
0564   // The total cross section classes are used both on process and parton level.
0565   SigmaTotal         sigmaTot = {};
0566   SigmaLowEnergy     sigmaLowEnergy;
0567   NucleonExcitations nucleonExcitations = {};
0568   SigmaCombined      sigmaCmb = {};
0569 
0570   // The fragmentation pointer is used in low energy processes and HadronLevel.
0571   LundFragmentationPtr fragPtr{};
0572 
0573   // The RHadrons class is used both at PartonLevel and HadronLevel.
0574   RHadronsPtr rHadronsPtr{};
0575 
0576   // Flags for handling generation of heavy ion collisons.
0577   bool        hasHeavyIons = {}, doHeavyIons = {};
0578 
0579   // Write the Pythia banner, with symbol and version information.
0580   void banner();
0581 
0582   // Check that combinations of settings are allowed; change if not.
0583   void checkSettings();
0584 
0585   // Simplified treatment for low-energy nonperturbative collisions.
0586   bool nextNonPert(int procTypeIn = 0);
0587 
0588   // Perform R-hadron decays.
0589   bool doRHadronDecays();
0590 
0591   // Check that the final event makes sense.
0592   bool check();
0593 
0594   // Initialization of SLHA data.
0595   bool initSLHA();
0596   stringstream particleDataBuffer;
0597 
0598   // Keep track of and initialize all pointers to PhysicsBase-derived objects.
0599   vector<PhysicsBase*> physicsPtrs = {};
0600 
0601   // Mutex that can be used by PhysicsBase-derived objects.
0602   mutex mainMutex;
0603 
0604 };
0605 
0606 //==========================================================================
0607 
0608 } // end namespace Pythia8
0609 
0610 #endif // Pythia8_Pythia_H