PYTHIA  8.312
Public Member Functions | Public Attributes | Friends | List of all members
Pythia Class Reference

The Pythia class contains the top-level routines to generate an event. More...

#include <Pythia.h>

Public Member Functions

 Pythia (string xmlDir="../share/Pythia8/xmldoc", bool printBanner=true)
 Constructor. (See Pythia.cc file.) More...
 
 Pythia (Settings &settingsIn, ParticleData &particleDataIn, bool printBanner=true)
 Constructor from pre-initialised ParticleData and Settings objects. More...
 
 Pythia (istream &settingsStrings, istream &particleDataStrings, bool printBanner=true)
 Constructor taking input from streams instead of files. More...
 
 ~Pythia ()
 Destructor.
 
 Pythia (const Pythia &)=delete
 Copy and = constructors cannot be used.
 
Pythiaoperator= (const Pythia &)=delete
 
bool checkVersion ()
 Check consistency of version numbers (called by constructors). More...
 
bool readString (string, bool warn=true, int subrun=SUBRUNDEFAULT)
 Read in one update for a setting or particle data from a single line. More...
 
bool readFile (string fileName, bool warn=true, int subrun=SUBRUNDEFAULT)
 Read in updates for settings or particle data from user-defined file. More...
 
bool readFile (string fileName, int subrun)
 
bool readFile (istream &is=cin, bool warn=true, int subrun=SUBRUNDEFAULT)
 
bool readFile (istream &is, int subrun)
 
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's.
 
bool setPDFAPtr (PDFPtr pdfAPtrIn)
 
bool setPDFBPtr (PDFPtr pdfBPtrIn)
 
bool setPhotonFluxPtr (PDFPtr photonFluxAIn, PDFPtr photonFluxBIn)
 Set photon fluxes externally. Used with option "PDF:lepton2gammaSet = 2".
 
bool setLHAupPtr (LHAupPtr lhaUpPtrIn)
 Possibility to pass in pointer to external LHA-interfaced generator.
 
bool setDecayPtr (DecayHandlerPtr decayHandlePtrIn, vector< int > handledParticlesIn={})
 Possibility to pass in pointer for external handling of some decays.
 
bool setRndmEnginePtr (RndmEnginePtr rndmEnginePtrIn)
 Possibility to pass in pointer for external random number generation.
 
bool setUserHooksPtr (UserHooksPtr userHooksPtrIn)
 Possibility to pass in pointer for user hooks.
 
bool addUserHooksPtr (UserHooksPtr userHooksPtrIn)
 Possibility to add further pointers to allow multiple user hooks.
 
bool setMergingPtr (MergingPtr mergingPtrIn)
 Possibility to pass in pointer for full merging class.
 
bool setMergingHooksPtr (MergingHooksPtr mergingHooksPtrIn)
 Possibility to pass in pointer for merging hooks.
 
bool setBeamShapePtr (BeamShapePtr beamShapePtrIn)
 Possibility to pass in pointer for beam shape.
 
bool setSigmaPtr (SigmaProcessPtr sigmaPtrIn, PhaseSpacePtr phaseSpacePtrIn=nullptr)
 
bool addSigmaPtr (SigmaProcessPtr sigmaPtrIn, PhaseSpacePtr phaseSpacePtrIn=nullptr)
 Possibility to add further pointers to allow for multiple cross sections.
 
bool setResonancePtr (ResonanceWidthsPtr resonancePtrIn)
 Possibility to pass in pointer for external resonance.
 
bool addResonancePtr (ResonanceWidthsPtr resonancePtrIn)
 Possibility to add further pointers to allow for multiple resonances.
 
bool setShowerModelPtr (ShowerModelPtr showerModelPtrIn)
 Possibility to pass in pointer for external showers.
 
bool setHeavyIonsPtr (HeavyIonsPtr heavyIonsPtrIn)
 Possibility to pass in pointer for modelling of heavy ion collisions.
 
bool setHIHooks (HIUserHooksPtr hiHooksPtrIn)
 
HeavyIonsPtr getHeavyIonsPtr ()
 
BeamShapePtr getBeamShapePtr ()
 Possibility to access the pointer to the BeamShape object.
 
ShowerModelPtr getShowerModelPtr ()
 Possibility to get the pointer to the parton-shower model.
 
LHAupPtr getLHAupPtr ()
 Possibility to get the pointer to the LHA accessor.
 
bool setPartonVertexPtr (PartonVertexPtr partonVertexPtrIn)
 Possibility to pass in pointer for setting of parton space-time vertices.
 
bool init ()
 Initialize. More...
 
bool next ()
 Generate the next event.
 
bool next (int procTypeIn)
 Main routine to generate the next event, using internal machinery. More...
 
bool setBeamIDs (int idAin, int idBin=0)
 Switch to new beam particle identities; for similar hadrons only. More...
 
bool setKinematics (double eCMIn)
 Switch beam kinematics. More...
 
bool setKinematics (double eAIn, double eBIn)
 Set beam energies. More...
 
bool setKinematics (double pxAIn, double pyAIn, double pzAIn, double pxBIn, double pyBIn, double pzBIn)
 Set beam momenta. More...
 
bool setKinematics (Vec4 pAIn, Vec4 pBIn)
 Set beam momenta. More...
 
int forceTimeShower (int iBeg, int iEnd, double pTmax, int nBranchMax=0)
 Generate only a single timelike shower as in a decay.
 
bool forceHadronLevel (bool findJunctions=true)
 Generate only the hadronization/decay stage. More...
 
bool moreDecays ()
 Special routine to allow more decays if on/off switches changed.
 
bool moreDecays (int index)
 
bool forceRHadronDecays ()
 Special routine to force R-hadron decay when not done before.
 
bool doLowEnergyProcess (int i1, int i2, int procTypeIn)
 Do a low-energy collision between two hadrons in the event record.
 
double getSigmaTotal ()
 Get total cross section for two hadrons in the event record or standalone.
 
double getSigmaTotal (double eCM12, int mixLoHi=0)
 
double getSigmaTotal (int id1, int id2, double eCM12, int mixLoHi=0)
 
double getSigmaTotal (int id1, int id2, double eCM12, double m1, double m2, int mixLoHi=0)
 
double getSigmaPartial (int procTypeIn)
 
double getSigmaPartial (double eCM12, int procTypeIn, int mixLoHi=0)
 
double getSigmaPartial (int id1, int id2, double eCM12, int procTypeIn, int mixLoHi=0)
 
double getSigmaPartial (int id1, int id2, double eCM12, double m1, double m2, int procTypeIn, int mixLoHi=0)
 
PDFPtr getPDFPtr (int idIn, int sequence=1, string beam="A", bool resolved=true)
 Return a parton density set among list of possibilities.
 
void LHAeventList ()
 List the current Les Houches event.
 
bool LHAeventSkip (int nSkip)
 Skip a number of Les Houches events at input.
 
void stat ()
 Main routine to provide final statistics on generation. More...
 
bool flag (string key)
 Read in settings values: shorthand, not new functionality.
 
int mode (string key)
 
double parm (string key)
 
string word (string key)
 

Public Attributes

Event process = {}
 The event record for the parton-level central process.
 
Event event = {}
 The event record for the complete event history.
 
const Infoinfo = infoPrivate
 Public information and statistic on the generation.
 
Logger logger = {}
 Logger: for diagnostic messages, errors, statistics, etc.
 
Settings settings = {}
 Settings: databases of flags/modes/parms/words to control run.
 
ParticleData particleData = {}
 ParticleData: the particle data table/database.
 
Rndm rndm = {}
 Random number generator.
 
CoupSM coupSM = {}
 Standard Model couplings, including alphaS and alphaEM.
 
CoupSUSY coupSUSY = {}
 SUSY couplings.
 
SLHAinterface slhaInterface = {}
 SLHA Interface.
 
PartonSystems partonSystems = {}
 The partonic content of each subcollision system (auxiliary to event).
 
MergingPtr mergingPtr = {}
 Merging object as wrapper for matrix element merging routines.
 
MergingHooksPtr mergingHooksPtr
 
HeavyIonsPtr heavyIonsPtr = {}
 Pointer to a HeavyIons object for generating heavy ion collisions.
 
HIUserHooksPtr hiHooksPtr = {}
 Pointer to a HIUserHooks object to modify heavy ion modelling.
 
HadronWidths hadronWidths = {}
 HadronWidths: the hadron widths data table/database.
 
const BeamParticlebeamA = beamSetup.beamA
 The two incoming beams.
 
const BeamParticlebeamB = beamSetup.beamB
 

Friends

class PythiaParallel
 Friend PythiaParallel to give full access to underlying info.
 

Detailed Description

The Pythia class contains the top-level routines to generate an event.

Constructor & Destructor Documentation

Pythia ( string  xmlDir = "../share/Pythia8/xmldoc",
bool  printBanner = true 
)

Constructor. (See Pythia.cc file.)

Constructor.

Initialise / reset pointers and global variables.

Find path to data files, i.e. xmldoc directory location. Environment variable takes precedence, then constructor input, and finally the pre-processor constant XMLDIR.

Read in files with all flags, modes, parms and words.

Save XML path in settings.

Allow include files to be saved to settings.

Check that XML and header version numbers match code version number.

Read in files with all particle data.

Write the Pythia banner to output.

Not initialized until at the end of the init() call.

Special settings needed for heavy ion setup.

Pythia ( Settings settingsIn,
ParticleData particleDataIn,
bool  printBanner = true 
)

Constructor from pre-initialised ParticleData and Settings objects.

Constructor to copy settings and particle database from another Pythia object instead of XML files (to speed up multiple initialisations).

Initialise / reset pointers and global variables.

Copy XML path from existing Settings database.

Copy settings database and redirect pointers.

Check XML and header version numbers match code version number.

Copy particleData database and redirect pointers.

Write the Pythia banner to output.

Not initialized until at the end of the init() call.

Pythia ( istream &  settingsStrings,
istream &  particleDataStrings,
bool  printBanner = true 
)

Constructor taking input from streams instead of files.

Constructor from string streams.

Initialise / reset pointers and global variables.

Copy settings database

Reset pointers to pertain to this PYTHIA object.

Check XML and header version numbers match code version number.

Read in files with all particle data.

Write the Pythia banner to output.

Not initialized until at the end of the init() call.

Member Function Documentation

bool checkVersion ( )

Check consistency of version numbers (called by constructors).

Check for consistency of version numbers (called by constructors).

Check that XML version number matches code version number.

Check that header version number matches code version number.

All is well that ends well.

bool forceHadronLevel ( bool  findJunctions = true)

Generate only the hadronization/decay stage.

Generate only the hadronization/decay stage, using internal machinery. The "event" instance should already contain a parton-level configuration.

Can only generate event if initialization worked.

Check whether any junctions in system. (Normally done in ProcessLevel.) Avoid it if there are no final-state coloured partons.

Allow for CR before the hadronization.

Setup parton system for SK-I and SK-II colour reconnection. Require all final state particles to have the Ws as mothers.

save spare copy of event in case of failure.

Allow up to ten tries for CR.

Save spare copy of event in case of failure.

Allow up to ten tries for hadron-level processing.

Check whether any resonances need to be handled at process level.

Allow for showers if decays happened at process level.

Hadron-level: hadronization, decays.

Failure might be by user intervention. Then we should not try again.

If failure then warn, restore original configuration and try again.

Done for simpler option.

Optionally check final event for problems.

Done.

HeavyIonsPtr getHeavyIonsPtr ( )
inline

Possibility to get the pointer to a object modelling heavy ion collisions.

double getSigmaPartial ( int  procTypeIn)
inline

Get partial (elastic, diffractive, nondiffractive, ...) cross sections for two hadrons in the event record or standalone.

bool init ( )

Initialize.

Routine to initialize with the variable values of the Beams kind.

Check that constructor worked.

Check if this is the first call to init.

Only create plugins the first time.

Early catching of heavy ion mode.

Early readout, if return false or changed when no beams.

Check that changes in Settings and ParticleData have worked.

Initialize error printing settings.

Initialize the random number generator.

Count up number of initializations.

Master choice of shower model.

Set up values related to CKKW-L merging.

Set up values related to unitarised CKKW merging

Set up values related to NL3 NLO merging

Set up values related to unitarised NLO merging

If not using Vincia, Merging:Process must not be enclosed in {}.

Set/Reset the weights

Set up MergingHooks object for simple shower model.

Set up Merging object for simple shower model.

Set up beams and kinematics.

Spread LHA information generated in initFrame.

Done if only new LHA file.

Store the name of the input LHEF for merging.

Set up values related to user hooks.

Setup objects for string interactions (swing, colour reconnection, shoving and rope hadronisation).

Back to common initialization. Reset error counters.

Initialize data members extracted from database.

Warn/abort for unallowed process and beam combinations.

Check that combinations of settings are allowed; change if not.

Initialize the SM couplings (needed to initialize resonances).

Initialize SLHA interface (including SLHA/BSM couplings).

Reset couplingsPtr to the correct memory address.

Set headers to distinguish the two event listing kinds.

Final setup stage of particle data, notably resonance widths.

Read in files with particle widths.

Set up R-hadrons particle data, where relevant.

Set up and initialize setting of parton production vertices.

Prepare for variable-beam and -energy cross sections.

Prepare for low-energy QCD processes.

Initialise merging hooks for simple shower model.

Set up and initialize the ShowerModel (if not provided by user).

Register shower model as physicsBase object (also sets pointers)

Initialise shower model

Vincia adds a userhook -> need to push this to all physics objects.

Get relevant pointers from shower models.

Initialize pointers in showers.

At this point, the mergingPtr should be set. If that is not the case, then the initialization should be aborted.

Set up the beams.

Spread information on beam switching from beamSetup.

Turn off central diffraction for VMD processes.

Send info/pointers to process level for initialization.

Initialize shower handlers using initialized beams.

Initialize timelike showers already here, since needed in decays. The pointers to the beams are needed by some external plugin showers.

Alternatively only initialize resonance decays.

Send info/pointers to parton level for initialization.

Make pointer to shower available for merging machinery.

Alternatively only initialize final-state showers in resonance decays.

Set up shower variation groups if enabled

Send info/pointers to parton level for trial shower initialization.

Initialise the merging wrapper class.

Send info/pointers to hadron level for initialization. Note: forceHadronLevel() can come, so we must always initialize.

Optionally check particle data table for inconsistencies.

Optionally show settings and particle data, changed or all.

Listing options for the next() routine.

Init junction splitting.

Flags for colour reconnection.

Succeeded.

bool next ( int  procTypeIn)

Main routine to generate the next event, using internal machinery.

Check that constructor worked.

Check that initialization worked.

Flexible-use call at the beginning of each new event.

Check if the generation is taken over by the HeavyIons object. Allows HeavyIons::next to call next for this Pythia object without going into a loop.

Regularly print how many events have been generated.

Set/reset info counters specific to each event. Also procType.

Simpler option when no hard process, i.e. mainly hadron level.

Optionally fetch in resonance decays from LHA interface.

Reset info and partonSystems arrays (while event record contains data).

Set correct energy for system.

Generate parton showers where appropriate.

Generate hadronization and decays.

Reset arrays.

Pick current beam valence flavours (for pi0, K0S, K0L, Pomeron).

Recalculate kinematics when beam momentum spread.

Simplified special treatment for low-energy nonperturbative collisions.

Optionally check final event for problems.

Outer loop over hard processes; only relevant for user-set vetoes.

Provide the hard process that starts it off. Only one try.

Reset the event information. Necessary if the previous event was read from LHEF, while the current event is not read from LHEF.

Update tried and selected events immediately after next event was generated. Note: This does not accumulate cross section.

Possibility for a user veto of the process-level event.

Possibility to perform matrix element merging for this event.

Apply possible merging scale cut.

Exit because of vanishing no-emission probability.

Redo resonance decays after the merging, in case the resonance structure has been changed because of reclusterings.

Possibility to stop the generation at this stage.

Save spare copy of process record in case of problems.

Allow up to ten tries for parton- and hadron-level processing.

Restore original process record if problems.

Reset event record and (extracted partons from) beam remnants.

Parton-level evolution: ISR, FSR, MPI.

Abort event generation if parton level is set to abort.

Skip to next hard process for failure owing to veto in merging.

Skip to next hard process for failure owing to deliberate veto, or alternatively retry for the same hard process.

If hard diffractive event has been discarded retry partonLevel.

Else make a new try for other failures.

Possibility for a user veto of the parton-level event.

Boost to lab frame (before decays, for vertices).

Possibility to stop the generation at this stage.

Optionally check final event for problems.

Hadron-level: hadronization, decays.

Check if we aborted due to user intervention.

If R-hadrons have been formed, then (optionally) let them decay.

Optionally check final event for problems.

Stop parton- and hadron-level looping if you got this far.

If event vetoed then to make a new try.

If event failed any other way (after ten tries) then give up.

Process- and parton-level statistics. Event scale.

End of outer loop over hard processes. Done with normal option.

List events.

Done.

bool readFile ( string  fileName,
bool  warn = true,
int  subrun = SUBRUNDEFAULT 
)

Read in updates for settings or particle data from user-defined file.

Check that constructor worked.

Open file for reading.

Hand over real work to next method.

bool readFile ( istream &  is = cin,
bool  warn = true,
int  subrun = SUBRUNDEFAULT 
)

Read in updates for settings or particle data from user-defined stream (or file).

Check that constructor worked.

Read in one line at a time.

Check whether entering, leaving or inside commented-commands section.

Check whether entered new subrun.

Process the line if in correct subrun.

Reached end of input file.

bool readString ( string  line,
bool  warn = true,
int  subrun = SUBRUNDEFAULT 
)

Read in one update for a setting or particle data from a single line.

Check that constructor worked.

If empty line then done.

If Settings input stretches over several lines then continue with it.

If first character is not a letter/digit, then taken to be a comment.

Send on particle data to the ParticleData database.

Include statements.

Try normal path first.

Split the paths from PYTHIA8CMND.

Add the Pythia settings directory.

Try the different paths.

Everything else sent on to Settings.

bool setBeamIDs ( int  idAin,
int  idBin = 0 
)

Switch to new beam particle identities; for similar hadrons only.

Switch to new beam particle identities.

bool setHIHooks ( HIUserHooksPtr  hiHooksPtrIn)
inline

Possibility to pass a HIUserHooks pointer for modifying the behavior of the heavy ion modelling.

bool setKinematics ( double  eCMIn)

Switch beam kinematics.

Set beam CM energy.

Update heavy ions if necessary.

Pass to BeamSetup object.

bool setKinematics ( double  eAIn,
double  eBIn 
)

Set beam energies.

Update heavy ions if necessary.

Pass to BeamSetup object.

bool setKinematics ( double  pxAIn,
double  pyAIn,
double  pzAIn,
double  pxBIn,
double  pyBIn,
double  pzBIn 
)

Set beam momenta.

Update heavy ions if necessary.

Pass to BeamSetup object.

bool setKinematics ( Vec4  pAIn,
Vec4  pBIn 
)

Set beam momenta.

Update heavy ions if necessary.

Pass to BeamSetup object.

bool setSigmaPtr ( SigmaProcessPtr  sigmaPtrIn,
PhaseSpacePtr  phaseSpacePtrIn = nullptr 
)
inline

Possibility to pass in pointer for external cross section, with option to include external phase-space generator.

void stat ( )

Main routine to provide final statistics on generation.

Print statistics on event generation.

Read out settings for what to include.

Statistics on cross section and number of events.

Statistics from other classes, currently multiparton interactions.

Merging statistics.

Summary of which and how many warnings/errors encountered.

Loop through all PhysicsBase-derived objects.

Member Data Documentation

MergingHooksPtr mergingHooksPtr

Pointer to MergingHooks object for user interaction with the merging. MergingHooks also more generally steers the matrix element merging.


The documentation for this class was generated from the following files: