9 #ifndef Pythia8_Pythia_H
10 #define Pythia8_Pythia_H
13 #define PYTHIA_VERSION 8.235
14 #define PYTHIA_VERSION_INTEGER 8235
17 #include "Pythia8/Analysis.h"
18 #include "Pythia8/Basics.h"
19 #include "Pythia8/BeamParticle.h"
20 #include "Pythia8/BeamShape.h"
21 #include "Pythia8/ColourReconnection.h"
22 #include "Pythia8/Event.h"
23 #include "Pythia8/FragmentationFlavZpT.h"
24 #include "Pythia8/HadronLevel.h"
25 #include "Pythia8/History.h"
26 #include "Pythia8/Info.h"
27 #include "Pythia8/JunctionSplitting.h"
28 #include "Pythia8/LesHouches.h"
29 #include "Pythia8/Merging.h"
30 #include "Pythia8/MergingHooks.h"
31 #include "Pythia8/PartonLevel.h"
32 #include "Pythia8/ParticleData.h"
33 #include "Pythia8/PartonDistributions.h"
34 #include "Pythia8/PartonSystems.h"
35 #include "Pythia8/PartonVertex.h"
36 #include "Pythia8/ProcessLevel.h"
37 #include "Pythia8/PythiaStdlib.h"
38 #include "Pythia8/ResonanceWidths.h"
39 #include "Pythia8/RHadrons.h"
40 #include "Pythia8/Ropewalk.h"
41 #include "Pythia8/Settings.h"
42 #include "Pythia8/SigmaTotal.h"
43 #include "Pythia8/SpaceShower.h"
44 #include "Pythia8/StandardModel.h"
45 #include "Pythia8/SLHAinterface.h"
46 #include "Pythia8/TimeShower.h"
47 #include "Pythia8/UserHooks.h"
64 Pythia(
string xmlDir =
"../share/Pythia8/xmldoc",
bool printBanner =
true);
68 Pythia(Settings& settingsIn, ParticleData& particleDataIn,
69 bool printBanner =
true);
72 Pythia( istream& settingsStrings, istream& particleDataStrings,
73 bool printBanner =
true);
85 bool readString(
string,
bool warn =
true);
88 bool readFile(
string fileName,
bool warn =
true,
89 int subrun = SUBRUNDEFAULT);
90 bool readFile(
string fileName,
int subrun) {
91 return readFile(fileName,
true, subrun);}
92 bool readFile(istream& is = cin,
bool warn =
true,
93 int subrun = SUBRUNDEFAULT);
94 bool readFile(istream& is,
int subrun) {
95 return readFile(is,
true, subrun);}
98 bool setPDFPtr( PDF* pdfAPtrIn, PDF* pdfBPtrIn, PDF* pdfHardAPtrIn = 0,
99 PDF* pdfHardBPtrIn = 0, PDF* pdfPomAPtrIn = 0, PDF* pdfPomBPtrIn = 0,
100 PDF* pdfGamAPtrIn = 0, PDF* pdfGamBPtrIn = 0, PDF* pdfHardGamAPtrIn = 0,
101 PDF* pdfHardGamBPtrIn = 0, PDF* pdfUnresAPtrIn = 0,
102 PDF* pdfUnresBPtrIn = 0, PDF* pdfUnresGamAPtrIn = 0,
103 PDF* pdfUnresGamBPtrIn = 0, PDF* pdfVMDAPtrIn = 0, PDF* pdfVMDBPtrIn = 0);
106 bool setPhotonFluxPtr( PDF* photonFluxAIn, PDF* photonFluxBIn) {
107 if ( photonFluxAIn != 0 ) pdfGamFluxAPtr = photonFluxAIn;
108 if ( photonFluxBIn != 0 ) pdfGamFluxBPtr = photonFluxBIn;
112 bool setLHAupPtr( LHAup* lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;
return true;}
115 bool setDecayPtr( DecayHandler* decayHandlePtrIn,
116 vector<int> handledParticlesIn) {decayHandlePtr = decayHandlePtrIn;
117 handledParticles.resize(0);
118 for (
int i = 0; i < int(handledParticlesIn.size()); ++i)
119 handledParticles.push_back( handledParticlesIn[i] );
123 bool setRndmEnginePtr( RndmEngine* rndmEnginePtrIn)
124 {
return rndm.rndmEnginePtr( rndmEnginePtrIn);}
127 bool setUserHooksPtr( UserHooks* userHooksPtrIn) {
128 if (hasUserHooksVector)
delete userHooksPtr;
129 hasUserHooksVector =
false;
130 userHooksPtr = userHooksPtrIn;
return true;}
133 bool addUserHooksPtr( UserHooks* userHooksPtrIn) {
134 if ( !userHooksPtr )
return setUserHooksPtr(userHooksPtrIn);
135 UserHooksVector* uhv =
dynamic_cast<UserHooksVector*
>(userHooksPtr);
136 if ( !uhv ) { uhv =
new UserHooksVector();
137 uhv->hooks.push_back(userHooksPtr); userHooksPtr = uhv; }
138 uhv->hooks.push_back(userHooksPtrIn);
139 hasUserHooksVector =
true;
return true;}
142 bool setMergingPtr( Merging* mergingPtrIn)
143 { mergingPtr = mergingPtrIn;
return true;}
146 bool setMergingHooksPtr( MergingHooks* mergingHooksPtrIn)
147 { mergingHooksPtr = mergingHooksPtrIn;
return true;}
150 bool setBeamShapePtr( BeamShape* beamShapePtrIn)
151 { beamShapePtr = beamShapePtrIn;
return true;}
155 bool setSigmaPtr( SigmaProcess* sigmaPtrIn, PhaseSpace* phaseSpacePtrIn = 0)
156 { sigmaPtrs.push_back( sigmaPtrIn);
157 phaseSpacePtrs.push_back(phaseSpacePtrIn);
return true;}
160 bool setResonancePtr( ResonanceWidths* resonancePtrIn)
161 { resonancePtrs.push_back( resonancePtrIn);
return true;}
164 bool setShowerPtr( TimeShower* timesDecPtrIn,
165 TimeShower* timesPtrIn = 0, SpaceShower* spacePtrIn = 0)
166 { timesDecPtr = timesDecPtrIn; timesPtr = timesPtrIn;
167 spacePtr = spacePtrIn;
return true;}
170 bool setHeavyIonsPtr( HeavyIons* heavyIonsPtrIn)
171 { heavyIonsPtr = heavyIonsPtrIn;
return true;}
175 bool setHIHooks(HIUserHooks* hiHooksPtrIn)
176 { hiHooksPtr = hiHooksPtrIn;
return true; }
180 HeavyIons* getHeavyIonsPtr() {
return heavyIonsPtr;}
183 bool setPartonVertexPtr( PartonVertex* partonVertexPtrIn)
184 { partonVertexPtr = partonVertexPtrIn;
return true;}
193 int forceTimeShower(
int iBeg,
int iEnd,
double pTmax,
int nBranchMax = 0)
194 { partonSystems.clear(); info.setScalup( 0, pTmax);
195 return timesDecPtr->shower( iBeg, iEnd, event, pTmax, nBranchMax); }
198 bool forceHadronLevel(
bool findJunctions =
true);
201 bool moreDecays() {
return hadronLevel.moreDecays(event);}
204 bool forceRHadronDecays() {
return doRHadronDecays();}
207 void LHAeventList() {
if (lhaUpPtr != 0) lhaUpPtr->listEvent();}
210 bool LHAeventSkip(
int nSkip) {
211 if (lhaUpPtr != 0)
return lhaUpPtr->skipEvent(nSkip);
218 bool flag(
string key) {
return settings.flag(key);}
219 int mode(
string key) {
return settings.mode(key);}
220 double parm(
string key) {
return settings.parm(key);}
221 string word(
string key) {
return settings.word(key);}
224 PDF* getPDFPtr(
int idIn,
int sequence = 1,
string beam =
"",
225 bool resolved =
true);
240 ParticleData particleData;
247 Couplings* couplingsPtr;
250 SLHAinterface slhaInterface;
253 PartonSystems partonSystems;
260 MergingHooks* mergingHooksPtr;
263 HeavyIons* heavyIonsPtr;
266 HIUserHooks* hiHooksPtr;
275 Pythia(
const Pythia&);
276 Pythia& operator=(
const Pythia&);
279 static const double VERSIONNUMBERHEAD, VERSIONNUMBERCODE;
280 static const int NTRY, SUBRUNDEFAULT;
284 bool doProcessLevel, doPartonLevel, doHadronLevel, doSoftQCDall,
285 doSoftQCDinel, doCentralDiff, doDiffraction,
286 doSoftQCD, doVMDsideA, doVMDsideB, doHardDiff, doResDec,
287 doFSRinRes, decayRHadrons, abortIfVeto, checkEvent, checkHistory;
289 double epTolErr, epTolWarn, mTolErr, mTolWarn;
292 bool beamHasGamma, beamAisResGamma, beamBisResGamma, beamAhasResGamma,
297 bool isConstructed, isInit, isUnresolvedA, isUnresolvedB, showSaV,
298 showMaD, doReconnect, forceHadronLevelCR;
299 int idA, idB, frameType, boostType, nCount, nShowLHA, nShowInfo,
300 nShowProc, nShowEvt, reconnectMode;
301 double mA, mB, pxA, pxB, pyA, pyB, pzA, pzB, eA, eB,
302 pzAcm, pzBcm, eCM, betaZ, gammaZ;
303 Vec4 pAinit, pBinit, pAnow, pBnow;
304 RotBstMatrix MfromCM, MtoCM;
308 vector<int> iErrId, iErrCol, iErrEpm, iErrNan, iErrNanVtx;
333 PDF* pdfUnresGamAPtr;
334 PDF* pdfUnresGamBPtr;
345 bool useNewPdfA, useNewPdfB, useNewPdfHard, useNewPdfPomA, useNewPdfPomB,
346 useNewPdfGamA, useNewPdfGamB, useNewPdfHardGamA, useNewPdfHardGamB,
347 useNewPdfUnresA, useNewPdfUnresB, useNewPdfUnresGamA, useNewPdfUnresGamB,
348 useNewPdfVMDA, useNewPdfVMDB, hasUserHooksVector;
351 BeamParticle beamPomA;
352 BeamParticle beamPomB;
355 BeamParticle beamGamA;
356 BeamParticle beamGamB;
359 BeamParticle beamVMDA;
360 BeamParticle beamVMDB;
363 bool doLHA, useNewLHA;
367 DecayHandler* decayHandlePtr;
368 vector<int> handledParticles;
371 UserHooks* userHooksPtr;
372 bool hasUserHooks, doVetoProcess, doVetoPartons, retryPartonLevel;
375 BeamShape* beamShapePtr;
376 bool useNewBeamShape, doMomentumSpread, doVertexSpread;
379 vector<SigmaProcess*> sigmaPtrs;
383 vector<PhaseSpace*> phaseSpacePtrs;
386 vector<ResonanceWidths*> resonancePtrs;
389 TimeShower* timesDecPtr;
390 TimeShower* timesPtr;
391 SpaceShower* spacePtr;
392 bool useNewTimesDec, useNewTimes, useNewSpace;
395 PartonVertex* partonVertexPtr;
396 bool useNewPartonVertex;
399 ProcessLevel processLevel;
402 PartonLevel partonLevel;
405 PartonLevel trialPartonLevel;
408 bool hasMerging, hasOwnMerging;
409 bool hasMergingHooks, hasOwnMergingHooks, doMerging;
412 ColourReconnection colourReconnection;
415 JunctionSplitting junctionSplitting;
418 HadronLevel hadronLevel;
427 bool hasHeavyIons, hasOwnHeavyIons, doHeavyIons;
433 int readSubrun(
string line,
bool warn =
true);
436 int readCommented(
string line);
439 void checkSettings();
445 bool initKinematics();
451 void nextKinematics();
454 void boostAndVertex(
bool toLab,
bool setVertex);
457 bool doRHadronDecays();
464 stringstream particleDataBuffer;
472 #endif // Pythia8_Pythia_H