9 #ifndef Pythia8_Pythia_H 10 #define Pythia8_Pythia_H 13 #define PYTHIA_VERSION 8.312 14 #define PYTHIA_VERSION_INTEGER 8312 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" 76 Pythia(
string xmlDir =
"../share/Pythia8/xmldoc",
bool printBanner =
true);
81 bool printBanner =
true);
84 Pythia( istream& settingsStrings, istream& particleDataStrings,
85 bool printBanner =
true);
98 bool readString(
string,
bool warn =
true,
int subrun = SUBRUNDEFAULT);
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) {
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 ) {
125 bool setPDFBPtr( PDFPtr pdfBPtrIn ) {
134 useNewLHA =
false;
return beamSetup.
setLHAupPtr( lhaUpPtrIn);}
138 vector<int> handledParticlesIn = {}) {decayHandlePtr = decayHandlePtrIn;
139 handledParticles = handledParticlesIn.size() == 0 ?
140 decayHandlePtrIn->handledParticles() : handledParticlesIn;
return true;}
148 userHooksPtr = userHooksPtrIn;
return true;}
152 if ( !userHooksPtrIn )
return false;
154 shared_ptr<UserHooksVector> uhv =
156 if ( !uhv ) { uhv = make_shared<UserHooksVector>();
157 uhv->
hooks.push_back(userHooksPtr); userHooksPtr = uhv; }
158 uhv->hooks.push_back(userHooksPtrIn);
return true;}
175 PhaseSpacePtr phaseSpacePtrIn =
nullptr)
176 { sigmaPtrs.resize(0), phaseSpacePtrs.resize(0);
177 sigmaPtrs.push_back(sigmaPtrIn);
178 phaseSpacePtrs.push_back(phaseSpacePtrIn);
return true;}
182 PhaseSpacePtr phaseSpacePtrIn =
nullptr)
183 { sigmaPtrs.push_back(sigmaPtrIn);
184 phaseSpacePtrs.push_back(phaseSpacePtrIn);
return true;}
188 { resonancePtrs.resize(0);
189 resonancePtrs.push_back( resonancePtrIn);
return true;}
193 { resonancePtrs.push_back( resonancePtrIn);
return true;}
197 { showerModelPtr = showerModelPtrIn;
return true;}
223 { partonVertexPtr = partonVertexPtrIn;
return true;}
230 bool next(
int procTypeIn);
239 double pxBIn,
double pyBIn,
double pzBIn);
245 logger.ERROR_MSG(
"Pythia is not properly initialized");
return 0; }
247 return timesDecPtr->shower( iBeg, iEnd,
event, pTmax, nBranchMax); }
262 logger.ERROR_MSG(
"Pythia is not properly initialized");
return false; }
269 return getSigmaTotal(beamSetup.idA, beamSetup.idB, eCM12, mixLoHi); }
270 double getSigmaTotal(
int id1,
int id2,
double eCM12,
int mixLoHi = 0) {
273 double getSigmaTotal(
int id1,
int id2,
double eCM12,
double m1,
double m2,
276 logger.ERROR_MSG(
"Pythia is not properly initialized");
return 0.; }
277 return sigmaCmb.
sigmaTotal(id1, id2, eCM12, m1, m2, mixLoHi); }
284 double getSigmaPartial(
double eCM12,
int procTypeIn,
int mixLoHi = 0) {
285 return getSigmaPartial(beamSetup.idA, beamSetup.idB, eCM12, procTypeIn,
291 double m2,
int procTypeIn,
int mixLoHi = 0) {
293 logger.ERROR_MSG(
"Pythia is not properly initialized");
return 0.; }
294 return sigmaCmb.
sigmaPartial(id1, id2, eCM12, m1, m2, procTypeIn, mixLoHi);
298 PDFPtr
getPDFPtr(
int idIn,
int sequence = 1,
string beam =
"A",
299 bool resolved =
true) {
300 return beamSetup.
getPDFPtr( idIn, sequence, beam, resolved); }
307 if (lhaUpPtr != 0)
return lhaUpPtr->skipEvent(nSkip);
315 int mode(
string key) {
return settings.mode(key);}
316 double parm(
string key) {
return settings.parm(key);}
317 string word(
string key) {
return settings.word(key);}
384 Info infoPrivate = {};
398 if (find(physicsPtrs.begin(), physicsPtrs.end(), &pb) != physicsPtrs.end())
401 physicsPtrs.push_back(&pb);
409 static const double VERSIONNUMBERHEAD, VERSIONNUMBERCODE;
412 static const int NTRY = 10;
416 bool doProcessLevel = {}, doPartonLevel = {}, doHadronLevel = {},
417 doLowEnergy = {}, doSoftQCDall = {}, doSoftQCDinel = {},
418 doCentralDiff = {}, doDiffraction = {}, doSoftQCD = {},
419 doHardDiff = {}, doResDec = {}, doFSRinRes = {}, decayRHadrons = {},
420 doPartonVertex = {}, abortIfVeto = {}, checkEvent = {},
421 checkHistory = {}, doNonPert = {};
423 double epTolErr = {}, epTolWarn = {}, mTolErr = {}, mTolWarn = {};
426 bool isConstructed = {}, isInit = {}, showSaV = {}, showMaD = {},
427 doReconnect = {}, forceHadronLevelCR = {};
428 int nCount = {}, nShowLHA = {}, nShowInfo = {}, nShowProc = {},
429 nShowEvt = {}, reconnectMode = {};
433 vector<int> iErrId = {}, iErrCol = {}, iErrEpm = {}, iErrNan = {},
441 bool useNewLHA =
false;
442 LHAupPtr lhaUpPtr = {};
445 DecayHandlerPtr decayHandlePtr = {};
446 vector<int> handledParticles = {};
449 UserHooksPtr userHooksPtr = {};
450 bool doVetoProcess = {}, doVetoPartons = {},
451 retryPartonLevel = {}, canVetoHadronization = {};
454 BeamShapePtr beamShapePtr = {};
455 bool doVertexSpread = {};
456 double eMinPert = {}, eWidthPert = {};
459 vector<SigmaProcessPtr> sigmaPtrs = {};
463 vector<PhaseSpacePtr> phaseSpacePtrs = {};
466 vector<ResonanceWidthsPtr> resonancePtrs = {};
473 ShowerModelPtr showerModelPtr = {};
474 TimeShowerPtr timesDecPtr = {};
475 TimeShowerPtr timesPtr = {};
476 SpaceShowerPtr spacePtr = {};
479 PartonVertexPtr partonVertexPtr;
494 StringIntPtr stringInteractionsPtr;
497 ColRecPtr colourReconnectionPtr = {};
515 bool hasHeavyIons = {}, doHeavyIons = {};
521 int readSubrun(
string line,
bool warn =
true);
524 int readCommented(
string line);
527 void checkSettings();
530 bool nextNonPert(
int procTypeIn = 0);
533 bool doRHadronDecays();
540 stringstream particleDataBuffer;
543 vector<PhysicsBase*> physicsPtrs = {};
Event process
The event record for the parton-level central process.
Definition: Pythia.h:320
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:260
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'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:1478
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:298
Definition: PhysicsBase.h:27
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:338
bool LHAeventSkip(int nSkip)
Skip a number of Les Houches events at input.
Definition: Pythia.h:306
ParticleData particleData
ParticleData: the particle data table/database.
Definition: Pythia.h:335
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:1145
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:332
bool forceRHadronDecays()
Special routine to force R-hadron decay when not done before.
Definition: Pythia.h:257
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:363
bool setKinematics(double eCMIn)
Switch beam kinematics.
Definition: Pythia.cc:1420
Event event
The event record for the complete event history.
Definition: Pythia.h:323
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'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's.
Definition: BeamSetup.cc:21
const BeamParticle & beamA
The two incoming beams.
Definition: Pythia.h:369
~Pythia()
Destructor.
Definition: Pythia.h:88
SLHAinterface slhaInterface
SLHA Interface.
Definition: Pythia.h:347
HeavyIonsPtr heavyIonsPtr
Pointer to a HeavyIons object for generating heavy ion collisions.
Definition: Pythia.h:360
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:344
bool setBeamIDs(int idAin, int idBin=0)
Switch to new beam particle identities; for similar hadrons only.
Definition: Pythia.cc:1398
CoupSM coupSM
Standard Model couplings, including alphaS and alphaEM.
Definition: Pythia.h:341
BeamParticle beamA
The two incoming beams.
Definition: BeamSetup.h:131
Definition: HadronLevel.h:45
PartonSystems partonSystems
The partonic content of each subcollision system (auxiliary to event).
Definition: Pythia.h:350
bool moreDecays()
Special routine to allow more decays if on/off switches changed.
Definition: Pythia.h:253
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:357
void stat()
Main routine to provide final statistics on generation.
Definition: Pythia.cc:1748
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 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:1537
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:366
double getSigmaTotal()
Get total cross section for two hadrons in the event record or standalone.
Definition: Pythia.h:266
double m2(const Vec4 &v1)
The squared invariant mass of one or more four-vectors.
Definition: Basics.cc:605
bool setUserHooksPtr(UserHooksPtr userHooksPtrIn)
Possibility to pass in pointer for user hooks.
Definition: Pythia.h:147
bool setPDFBPtr(PDFPtr pdfBPtrIn)
Routine to pass in pointers to PDF'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:281
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:326
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:81
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:243
void LHAeventList()
List the current Les Houches event.
Definition: Pythia.h:303
MergingPtr mergingPtr
Merging object as wrapper for matrix element merging routines.
Definition: Pythia.h:353
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:329
bool flag(string key)
Read in settings values: shorthand, not new functionality.
Definition: Pythia.h:314
bool setBeamShapePtr(BeamShapePtr beamShapePtrIn)
Possibility to pass in pointer for beam shape.
Definition: BeamSetup.h:77
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