9 #ifndef Pythia8_Pythia_H
10 #define Pythia8_Pythia_H
13 #define PYTHIA_VERSION 8.303
14 #define PYTHIA_VERSION_INTEGER 8303
17 #include "Pythia8/Analysis.h"
18 #include "Pythia8/Basics.h"
19 #include "Pythia8/BeamParticle.h"
20 #include "Pythia8/Event.h"
21 #include "Pythia8/FragmentationFlavZpT.h"
22 #include "Pythia8/HadronLevel.h"
23 #include "Pythia8/HadronWidths.h"
24 #include "Pythia8/Info.h"
25 #include "Pythia8/JunctionSplitting.h"
26 #include "Pythia8/LesHouches.h"
27 #include "Pythia8/Merging.h"
28 #include "Pythia8/MergingHooks.h"
29 #include "Pythia8/PartonLevel.h"
30 #include "Pythia8/ParticleData.h"
31 #include "Pythia8/PartonDistributions.h"
32 #include "Pythia8/PartonSystems.h"
33 #include "Pythia8/PartonVertex.h"
34 #include "Pythia8/PhysicsBase.h"
35 #include "Pythia8/ProcessLevel.h"
36 #include "Pythia8/PythiaStdlib.h"
37 #include "Pythia8/ResonanceWidths.h"
38 #include "Pythia8/RHadrons.h"
39 #include "Pythia8/Ropewalk.h"
40 #include "Pythia8/Settings.h"
41 #include "Pythia8/ShowerModel.h"
42 #include "Pythia8/SigmaTotal.h"
43 #include "Pythia8/SimpleSpaceShower.h"
44 #include "Pythia8/SimpleTimeShower.h"
45 #include "Pythia8/SpaceShower.h"
46 #include "Pythia8/StandardModel.h"
47 #include "Pythia8/StringInteractions.h"
48 #include "Pythia8/SusyCouplings.h"
49 #include "Pythia8/SLHAinterface.h"
50 #include "Pythia8/TimeShower.h"
51 #include "Pythia8/UserHooks.h"
52 #include "Pythia8/VinciaCommon.h"
53 #include "Pythia8/Weights.h"
70 Pythia(
string xmlDir =
"../share/Pythia8/xmldoc",
bool printBanner =
true);
74 Pythia(Settings& settingsIn, ParticleData& particleDataIn,
75 bool printBanner =
true);
78 Pythia( istream& settingsStrings, istream& particleDataStrings,
79 bool printBanner =
true);
85 Pythia(
const Pythia&) =
delete;
86 Pythia& operator=(
const Pythia&) =
delete;
92 bool readString(
string,
bool warn =
true);
95 bool readFile(
string fileName,
bool warn =
true,
96 int subrun = SUBRUNDEFAULT);
97 bool readFile(
string fileName,
int subrun) {
98 return readFile(fileName,
true, subrun);}
99 bool readFile(istream& is = cin,
bool warn =
true,
100 int subrun = SUBRUNDEFAULT);
101 bool readFile(istream& is,
int subrun) {
102 return readFile(is,
true, subrun);}
105 bool setPDFPtr( PDFPtr pdfAPtrIn, PDFPtr pdfBPtrIn,
106 PDFPtr pdfHardAPtrIn =
nullptr, PDFPtr pdfHardBPtrIn =
nullptr,
107 PDFPtr pdfPomAPtrIn =
nullptr, PDFPtr pdfPomBPtrIn =
nullptr,
108 PDFPtr pdfGamAPtrIn =
nullptr, PDFPtr pdfGamBPtrIn =
nullptr,
109 PDFPtr pdfHardGamAPtrIn =
nullptr, PDFPtr pdfHardGamBPtrIn =
nullptr,
110 PDFPtr pdfUnresAPtrIn =
nullptr, PDFPtr pdfUnresBPtrIn =
nullptr,
111 PDFPtr pdfUnresGamAPtrIn =
nullptr, PDFPtr pdfUnresGamBPtrIn =
nullptr,
112 PDFPtr pdfVMDAPtrIn =
nullptr, PDFPtr pdfVMDBPtrIn =
nullptr);
113 bool setPDFAPtr( PDFPtr pdfAPtrIn );
114 bool setPDFBPtr( PDFPtr pdfBPtrIn );
117 bool setPhotonFluxPtr( PDFPtr photonFluxAIn, PDFPtr photonFluxBIn) {
118 if ( photonFluxAIn ) pdfGamFluxAPtr = photonFluxAIn;
119 if ( photonFluxBIn ) pdfGamFluxBPtr = photonFluxBIn;
123 bool setLHAupPtr( LHAupPtr lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;
124 useNewLHA =
false;
return true;}
127 bool setDecayPtr( DecayHandlerPtr decayHandlePtrIn,
128 vector<int> handledParticlesIn) {decayHandlePtr = decayHandlePtrIn;
129 handledParticles = handledParticlesIn;
return true;}
132 bool setRndmEnginePtr( RndmEngine* rndmEnginePtrIn)
133 {
return rndm.rndmEnginePtr( rndmEnginePtrIn);}
136 bool setUserHooksPtr(UserHooksPtr userHooksPtrIn) {
137 userHooksPtr = userHooksPtrIn;
return true;}
140 bool addUserHooksPtr( UserHooksPtr userHooksPtrIn) {
141 if ( !userHooksPtrIn )
return false;
142 if ( !userHooksPtr )
return setUserHooksPtr(userHooksPtrIn);
143 shared_ptr<UserHooksVector> uhv =
144 dynamic_pointer_cast<UserHooksVector>(userHooksPtr);
145 if ( !uhv ) { uhv = make_shared<UserHooksVector>();
146 uhv->hooks.push_back(userHooksPtr); userHooksPtr = uhv; }
147 uhv->hooks.push_back(userHooksPtrIn);
return true;}
150 bool setMergingPtr( MergingPtr mergingPtrIn)
151 { mergingPtr = mergingPtrIn;
return true;}
154 bool setMergingHooksPtr( MergingHooksPtr mergingHooksPtrIn)
155 { mergingHooksPtr = mergingHooksPtrIn;
return true;}
158 bool setBeamShapePtr( BeamShapePtr beamShapePtrIn)
159 { beamShapePtr = beamShapePtrIn;
return true;}
163 bool setSigmaPtr( SigmaProcess* sigmaPtrIn, PhaseSpace* phaseSpacePtrIn = 0)
164 { sigmaPtrs.push_back( sigmaPtrIn);
165 phaseSpacePtrs.push_back(phaseSpacePtrIn);
return true;}
168 bool setResonancePtr( ResonanceWidths* resonancePtrIn)
169 { resonancePtrs.push_back( resonancePtrIn);
return true;}
172 bool setShowerModelPtr( ShowerModelPtr showerModelPtrIn)
173 { showerModelPtr = showerModelPtrIn;
return true;}
176 bool setHeavyIonsPtr( HeavyIonsPtr heavyIonsPtrIn)
177 { heavyIonsPtr = heavyIonsPtrIn;
return true;}
181 bool setHIHooks(HIUserHooksPtr hiHooksPtrIn)
182 { hiHooksPtr = hiHooksPtrIn;
return true; }
186 HeavyIonsPtr getHeavyIonsPtr() {
return heavyIonsPtr;}
189 ShowerModelPtr getShowerModelPtr() {
return showerModelPtr; }
192 bool setPartonVertexPtr( PartonVertexPtr partonVertexPtrIn)
193 { partonVertexPtr = partonVertexPtrIn;
return true;}
202 bool next(
double eCMin);
203 bool next(
double eAin,
double eBin);
204 bool next(
double pxAin,
double pyAin,
double pzAin,
205 double pxBin,
double pyBin,
double pzBin);
208 int forceTimeShower(
int iBeg,
int iEnd,
double pTmax,
int nBranchMax = 0)
209 { partonSystems.clear(); infoPrivate.setScalup( 0, pTmax);
210 return timesDecPtr->shower( iBeg, iEnd, event, pTmax, nBranchMax); }
213 bool forceHadronLevel(
bool findJunctions =
true);
216 bool moreDecays() {
return hadronLevel.moreDecays(event);}
219 bool forceRHadronDecays() {
return doRHadronDecays();}
222 bool doLowEnergyProcess(
int i1,
int i2,
int type) {
223 return hadronLevel.doLowEnergyProcess( i1, i2, type, event); }
226 double getLowEnergySigma(
int i1,
int i2,
int type = 0) {
227 double eCM12 = (
event[i1].p() +
event[i2].p()).mCalc();
228 return getLowEnergySigma( event[i1].
id(), event[i2].
id(), eCM12,
229 event[i1].m(), event[i2].m(), type); }
232 double getLowEnergySigma(
int id1,
int id2,
double eCM12,
double m1,
233 double m2,
int type = 0) {
234 return hadronLevel.getLowEnergySigma(id1, id2, eCM12, m1, m2, type); }
236 double getLowEnergySigma(
int id1,
int id2,
double eCM12,
int type = 0) {
237 return getLowEnergySigma(id1, id2, eCM12,
238 particleData.m0(id1), particleData.m0(id2), type); }
241 double getLowEnergySlope(
int id1,
int id2,
double eCM12,
double m1,
242 double m2,
int type = 2) {
if (type < 2 || type > 5)
return 0.;
243 return hadronLevel.getLowEnergySlope( id1, id2, eCM12, m1, m2, type); }
246 void LHAeventList() {
if (lhaUpPtr != 0) lhaUpPtr->listEvent();}
249 bool LHAeventSkip(
int nSkip) {
250 if (lhaUpPtr != 0)
return lhaUpPtr->skipEvent(nSkip);
257 bool flag(
string key) {
return settings.flag(key);}
258 int mode(
string key) {
return settings.mode(key);}
259 double parm(
string key) {
return settings.parm(key);}
260 string word(
string key) {
return settings.word(key);}
263 PDFPtr getPDFPtr(
int idIn,
int sequence = 1,
string beam =
"A",
264 bool resolved =
true);
273 const Info& info = infoPrivate;
276 Settings settings = {};
279 ParticleData particleData = {};
288 CoupSUSY coupSUSY = {};
291 SLHAinterface slhaInterface = {};
294 PartonSystems partonSystems = {};
297 MergingPtr mergingPtr = {};
301 MergingHooksPtr mergingHooksPtr;
304 HeavyIonsPtr heavyIonsPtr = {};
307 HIUserHooksPtr hiHooksPtr = {};
310 HadronWidths hadronWidths = {};
313 BeamParticle beamA = {};
314 BeamParticle beamB = {};
320 WeightContainer weightContainer = {};
325 Info infoPrivate = {};
332 void endEvent(PhysicsBase::Status status);
335 void registerPhysicsBase(PhysicsBase & pb) { pb.initInfoPtr(infoPrivate);
336 physicsPtrs.push_back(&pb); }
343 static const double VERSIONNUMBERHEAD, VERSIONNUMBERCODE;
346 static const int NTRY = 10, SUBRUNDEFAULT = -999;
350 bool doProcessLevel = {}, doPartonLevel = {}, doHadronLevel = {},
351 doSoftQCDall = {}, doSoftQCDinel = {}, doCentralDiff = {},
352 doDiffraction = {}, doSoftQCD = {}, doVMDsideA = {}, doVMDsideB = {},
353 doHardDiff = {}, doResDec = {}, doFSRinRes = {}, decayRHadrons = {},
354 doPartonVertex = {}, doVertexPlane = {}, abortIfVeto = {},
355 checkEvent = {}, checkHistory = {}, doNonPert = {};
357 double epTolErr = {}, epTolWarn = {}, mTolErr = {}, mTolWarn = {};
361 bool beamA2gamma = {}, beamB2gamma = {};
362 bool beamAResGamma = {}, beamBResGamma = {};
363 bool beamAUnresGamma = {}, beamBUnresGamma = {};
366 bool isConstructed = {}, isInit = {}, isUnresolvedA = {},
367 isUnresolvedB = {}, showSaV = {}, showMaD = {}, doReconnect = {},
368 forceHadronLevelCR = {};
369 int idA = {}, idB = {}, frameType = {}, boostType = {}, nCount = {},
370 nShowLHA = {}, nShowInfo = {}, nShowProc = {}, nShowEvt = {},
372 double mA = {}, mB = {}, pxA = {}, pxB = {}, pyA = {}, pyB = {}, pzA = {},
373 pzB = {}, eA = {}, eB = {}, pzAcm = {}, pzBcm = {}, eCM = {},
374 betaZ = {}, gammaZ = {};
375 Vec4 pAinit = {}, pBinit = {}, pAnow = {}, pBnow = {};
376 RotBstMatrix MfromCM = {}, MtoCM = {};
380 vector<int> iErrId = {}, iErrCol = {}, iErrEpm = {}, iErrNan = {},
388 PDFPtr pdfHardAPtr = {};
389 PDFPtr pdfHardBPtr = {};
392 PDFPtr pdfPomAPtr = {};
393 PDFPtr pdfPomBPtr = {};
396 PDFPtr pdfGamAPtr = {};
397 PDFPtr pdfGamBPtr = {};
400 PDFPtr pdfHardGamAPtr = {};
401 PDFPtr pdfHardGamBPtr = {};
404 PDFPtr pdfUnresAPtr = {};
405 PDFPtr pdfUnresBPtr = {};
406 PDFPtr pdfUnresGamAPtr = {};
407 PDFPtr pdfUnresGamBPtr = {};
410 PDFPtr pdfGamFluxAPtr = {};
411 PDFPtr pdfGamFluxBPtr = {};
414 PDFPtr pdfVMDAPtr = {};
415 PDFPtr pdfVMDBPtr = {};
418 BeamParticle beamPomA = {};
419 BeamParticle beamPomB = {};
422 BeamParticle beamGamA = {};
423 BeamParticle beamGamB = {};
426 BeamParticle beamVMDA = {};
427 BeamParticle beamVMDB = {};
431 bool useNewLHA =
false;
432 LHAupPtr lhaUpPtr = {};
435 DecayHandlerPtr decayHandlePtr = {};
436 vector<int> handledParticles = {};
439 UserHooksPtr userHooksPtr = {};
440 bool doVetoProcess = {}, doVetoPartons = {}, retryPartonLevel = {};
443 BeamShapePtr beamShapePtr = {};
444 bool doMomentumSpread = {}, doVertexSpread = {}, doVarEcm = {};
445 double eMinPert = {}, eWidthPert = {};
448 vector<SigmaProcess*> sigmaPtrs = {};
452 vector<PhaseSpace*> phaseSpacePtrs = {};
455 vector<ResonanceWidths*> resonancePtrs = {};
458 TimeShowerPtr timesDecPtr = {};
459 TimeShowerPtr timesPtr = {};
460 SpaceShowerPtr spacePtr = {};
461 ShowerModelPtr showerModelPtr = {};
464 PartonVertexPtr partonVertexPtr;
467 ProcessLevel processLevel = {};
470 PartonLevel partonLevel = {};
473 PartonLevel trialPartonLevel = {};
479 StringIntPtr stringInteractionsPtr;
482 ColRecPtr colourReconnectionPtr = {};
485 JunctionSplitting junctionSplitting = {};
488 HadronLevel hadronLevel = {};
491 SigmaTotal sigmaTot = {};
494 RHadrons rHadrons = {};
497 bool hasHeavyIons = {}, doHeavyIons = {};
503 int readSubrun(
string line,
bool warn =
true);
506 int readCommented(
string line);
509 void checkSettings();
515 bool initKinematics();
521 void nextKinematics();
527 void boostAndVertex(
bool toLab,
bool setVertex);
530 bool doRHadronDecays();
537 stringstream particleDataBuffer;
540 vector<PhysicsBase*> physicsPtrs = {};
548 #endif // Pythia8_Pythia_H