File indexing completed on 2025-01-18 10:06:28
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef Pythia8_Pythia_H
0010 #define Pythia8_Pythia_H
0011
0012
0013 #define PYTHIA_VERSION 8.312
0014 #define PYTHIA_VERSION_INTEGER 8312
0015
0016
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/TimeShower.h"
0054 #include "Pythia8/UserHooks.h"
0055 #include "Pythia8/VinciaCommon.h"
0056 #include "Pythia8/Weights.h"
0057
0058 namespace Pythia8 {
0059
0060
0061
0062
0063 class HeavyIons;
0064 class HIUserHooks;
0065
0066
0067 class PythiaParallel;
0068
0069
0070
0071 class Pythia {
0072
0073 public:
0074
0075
0076 Pythia(string xmlDir = "../share/Pythia8/xmldoc", bool printBanner = true);
0077
0078
0079
0080 Pythia(Settings& settingsIn, ParticleData& particleDataIn,
0081 bool printBanner = true);
0082
0083
0084 Pythia( istream& settingsStrings, istream& particleDataStrings,
0085 bool printBanner = true);
0086
0087
0088 ~Pythia() {}
0089
0090
0091 Pythia(const Pythia&) = delete;
0092 Pythia& operator=(const Pythia&) = delete;
0093
0094
0095 bool checkVersion();
0096
0097
0098 bool readString(string, bool warn = true, int subrun = SUBRUNDEFAULT);
0099
0100
0101 bool readFile(string fileName, bool warn = true,
0102 int subrun = SUBRUNDEFAULT);
0103 bool readFile(string fileName, int subrun) {
0104 return readFile(fileName, true, subrun);}
0105 bool readFile(istream& is = cin, bool warn = true,
0106 int subrun = SUBRUNDEFAULT);
0107 bool readFile(istream& is, int subrun) {
0108 return readFile(is, true, subrun);}
0109
0110
0111 bool setPDFPtr( PDFPtr pdfAPtrIn, PDFPtr pdfBPtrIn,
0112 PDFPtr pdfHardAPtrIn = nullptr, PDFPtr pdfHardBPtrIn = nullptr,
0113 PDFPtr pdfPomAPtrIn = nullptr, PDFPtr pdfPomBPtrIn = nullptr,
0114 PDFPtr pdfGamAPtrIn = nullptr, PDFPtr pdfGamBPtrIn = nullptr,
0115 PDFPtr pdfHardGamAPtrIn = nullptr, PDFPtr pdfHardGamBPtrIn = nullptr,
0116 PDFPtr pdfUnresAPtrIn = nullptr, PDFPtr pdfUnresBPtrIn = nullptr,
0117 PDFPtr pdfUnresGamAPtrIn = nullptr, PDFPtr pdfUnresGamBPtrIn = nullptr,
0118 PDFPtr pdfVMDAPtrIn = nullptr, PDFPtr pdfVMDBPtrIn = nullptr) {
0119 return beamSetup.setPDFPtr( pdfAPtrIn, pdfBPtrIn, pdfHardAPtrIn,
0120 pdfHardBPtrIn, pdfPomAPtrIn, pdfPomBPtrIn, pdfGamAPtrIn, pdfGamBPtrIn,
0121 pdfHardGamAPtrIn, pdfHardGamBPtrIn, pdfUnresAPtrIn, pdfUnresBPtrIn,
0122 pdfUnresGamAPtrIn, pdfUnresGamBPtrIn, pdfVMDAPtrIn, pdfVMDBPtrIn); }
0123 bool setPDFAPtr( PDFPtr pdfAPtrIn ) {
0124 return beamSetup.setPDFAPtr( pdfAPtrIn); }
0125 bool setPDFBPtr( PDFPtr pdfBPtrIn ) {
0126 return beamSetup.setPDFBPtr( pdfBPtrIn); }
0127
0128
0129 bool setPhotonFluxPtr( PDFPtr photonFluxAIn, PDFPtr photonFluxBIn) {
0130 return beamSetup.setPhotonFluxPtr( photonFluxAIn, photonFluxBIn); }
0131
0132
0133 bool setLHAupPtr( LHAupPtr lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;
0134 useNewLHA = false; return beamSetup.setLHAupPtr( lhaUpPtrIn);}
0135
0136
0137 bool setDecayPtr( DecayHandlerPtr decayHandlePtrIn,
0138 vector<int> handledParticlesIn = {}) {decayHandlePtr = decayHandlePtrIn;
0139 handledParticles = handledParticlesIn.size() == 0 ?
0140 decayHandlePtrIn->handledParticles() : handledParticlesIn; return true;}
0141
0142
0143 bool setRndmEnginePtr( RndmEnginePtr rndmEnginePtrIn)
0144 { return rndm.rndmEnginePtr( rndmEnginePtrIn);}
0145
0146
0147 bool setUserHooksPtr(UserHooksPtr userHooksPtrIn) {
0148 userHooksPtr = userHooksPtrIn; return true;}
0149
0150
0151 bool addUserHooksPtr( UserHooksPtr userHooksPtrIn) {
0152 if ( !userHooksPtrIn ) return false;
0153 if ( !userHooksPtr ) return setUserHooksPtr(userHooksPtrIn);
0154 shared_ptr<UserHooksVector> uhv =
0155 dynamic_pointer_cast<UserHooksVector>(userHooksPtr);
0156 if ( !uhv ) { uhv = make_shared<UserHooksVector>();
0157 uhv->hooks.push_back(userHooksPtr); userHooksPtr = uhv; }
0158 uhv->hooks.push_back(userHooksPtrIn); return true;}
0159
0160
0161 bool setMergingPtr( MergingPtr mergingPtrIn)
0162 { mergingPtr = mergingPtrIn; return true;}
0163
0164
0165 bool setMergingHooksPtr( MergingHooksPtr mergingHooksPtrIn)
0166 { mergingHooksPtr = mergingHooksPtrIn; return true;}
0167
0168
0169 bool setBeamShapePtr( BeamShapePtr beamShapePtrIn)
0170 { return beamSetup.setBeamShapePtr(beamShapePtrIn);}
0171
0172
0173
0174 bool setSigmaPtr( SigmaProcessPtr sigmaPtrIn,
0175 PhaseSpacePtr phaseSpacePtrIn = nullptr)
0176 { sigmaPtrs.resize(0), phaseSpacePtrs.resize(0);
0177 sigmaPtrs.push_back(sigmaPtrIn);
0178 phaseSpacePtrs.push_back(phaseSpacePtrIn); return true;}
0179
0180
0181 bool addSigmaPtr( SigmaProcessPtr sigmaPtrIn,
0182 PhaseSpacePtr phaseSpacePtrIn = nullptr)
0183 { sigmaPtrs.push_back(sigmaPtrIn);
0184 phaseSpacePtrs.push_back(phaseSpacePtrIn); return true;}
0185
0186
0187 bool setResonancePtr( ResonanceWidthsPtr resonancePtrIn)
0188 { resonancePtrs.resize(0);
0189 resonancePtrs.push_back( resonancePtrIn); return true;}
0190
0191
0192 bool addResonancePtr( ResonanceWidthsPtr resonancePtrIn)
0193 { resonancePtrs.push_back( resonancePtrIn); return true;}
0194
0195
0196 bool setShowerModelPtr( ShowerModelPtr showerModelPtrIn)
0197 { showerModelPtr = showerModelPtrIn; return true;}
0198
0199
0200 bool setHeavyIonsPtr( HeavyIonsPtr heavyIonsPtrIn)
0201 { heavyIonsPtr = heavyIonsPtrIn; return true;}
0202
0203
0204
0205 bool setHIHooks(HIUserHooksPtr hiHooksPtrIn)
0206 { hiHooksPtr = hiHooksPtrIn; return true; }
0207
0208
0209
0210 HeavyIonsPtr getHeavyIonsPtr() { return heavyIonsPtr;}
0211
0212
0213 BeamShapePtr getBeamShapePtr() { return beamSetup.getBeamShapePtr(); }
0214
0215
0216 ShowerModelPtr getShowerModelPtr() { return showerModelPtr; }
0217
0218
0219 LHAupPtr getLHAupPtr() { return lhaUpPtr; }
0220
0221
0222 bool setPartonVertexPtr( PartonVertexPtr partonVertexPtrIn)
0223 { partonVertexPtr = partonVertexPtrIn; return true;}
0224
0225
0226 bool init();
0227
0228
0229 bool next() { return next(0); }
0230 bool next(int procTypeIn);
0231
0232
0233 bool setBeamIDs( int idAin, int idBin = 0);
0234
0235
0236 bool setKinematics(double eCMIn);
0237 bool setKinematics(double eAIn, double eBIn);
0238 bool setKinematics(double pxAIn, double pyAIn, double pzAIn,
0239 double pxBIn, double pyBIn, double pzBIn);
0240 bool setKinematics(Vec4 pAIn, Vec4 pBIn);
0241
0242
0243 int forceTimeShower( int iBeg, int iEnd, double pTmax, int nBranchMax = 0)
0244 { if (!isInit) {
0245 logger.ERROR_MSG("Pythia is not properly initialized"); return 0; }
0246 partonSystems.clear(); infoPrivate.setScalup( 0, pTmax);
0247 return timesDecPtr->shower( iBeg, iEnd, event, pTmax, nBranchMax); }
0248
0249
0250 bool forceHadronLevel( bool findJunctions = true);
0251
0252
0253 bool moreDecays() {return hadronLevel.moreDecays(event);}
0254 bool moreDecays(int index) {return hadronLevel.decay(index, event);}
0255
0256
0257 bool forceRHadronDecays() {return doRHadronDecays();}
0258
0259
0260 bool doLowEnergyProcess(int i1, int i2, int procTypeIn) {
0261 if (!isInit) {
0262 logger.ERROR_MSG("Pythia is not properly initialized"); return false; }
0263 return hadronLevel.doLowEnergyProcess( i1, i2, procTypeIn, event); }
0264
0265
0266 double getSigmaTotal() { return getSigmaTotal(beamSetup.idA, beamSetup.idB,
0267 beamSetup.eCM, 0); }
0268 double getSigmaTotal(double eCM12, int mixLoHi = 0) {
0269 return getSigmaTotal(beamSetup.idA, beamSetup.idB, eCM12, mixLoHi); }
0270 double getSigmaTotal(int id1, int id2, double eCM12, int mixLoHi = 0) {
0271 return getSigmaTotal(id1, id2, eCM12, particleData.m0(id1),
0272 particleData.m0(id2), mixLoHi); }
0273 double getSigmaTotal(int id1, int id2, double eCM12, double m1, double m2,
0274 int mixLoHi = 0) {
0275 if (!isInit) {
0276 logger.ERROR_MSG("Pythia is not properly initialized"); return 0.; }
0277 return sigmaCmb.sigmaTotal(id1, id2, eCM12, m1, m2, mixLoHi); }
0278
0279
0280
0281 double getSigmaPartial(int procTypeIn) {
0282 return getSigmaPartial(beamSetup.idA, beamSetup.idB, beamSetup.eCM,
0283 procTypeIn, 0); }
0284 double getSigmaPartial(double eCM12, int procTypeIn, int mixLoHi = 0) {
0285 return getSigmaPartial(beamSetup.idA, beamSetup.idB, eCM12, procTypeIn,
0286 mixLoHi); }
0287 double getSigmaPartial(int id1, int id2, double eCM12, int procTypeIn,
0288 int mixLoHi = 0) { return getSigmaPartial(id1, id2, eCM12,
0289 particleData.m0(id1), particleData.m0(id2), procTypeIn, mixLoHi); }
0290 double getSigmaPartial(int id1, int id2, double eCM12, double m1,
0291 double m2, int procTypeIn, int mixLoHi = 0) {
0292 if (!isInit) {
0293 logger.ERROR_MSG("Pythia is not properly initialized"); return 0.; }
0294 return sigmaCmb.sigmaPartial(id1, id2, eCM12, m1, m2, procTypeIn, mixLoHi);
0295 }
0296
0297
0298 PDFPtr getPDFPtr(int idIn, int sequence = 1, string beam = "A",
0299 bool resolved = true) {
0300 return beamSetup.getPDFPtr( idIn, sequence, beam, resolved); }
0301
0302
0303 void LHAeventList() { if (lhaUpPtr != 0) lhaUpPtr->listEvent();}
0304
0305
0306 bool LHAeventSkip(int nSkip) {
0307 if (lhaUpPtr != 0) return lhaUpPtr->skipEvent(nSkip);
0308 return false;}
0309
0310
0311 void stat();
0312
0313
0314 bool flag(string key) {return settings.flag(key);}
0315 int mode(string key) {return settings.mode(key);}
0316 double parm(string key) {return settings.parm(key);}
0317 string word(string key) {return settings.word(key);}
0318
0319
0320 Event process = {};
0321
0322
0323 Event event = {};
0324
0325
0326 const Info& info = infoPrivate;
0327
0328
0329 Logger logger = {};
0330
0331
0332 Settings settings = {};
0333
0334
0335 ParticleData particleData = {};
0336
0337
0338 Rndm rndm = {};
0339
0340
0341 CoupSM coupSM = {};
0342
0343
0344 CoupSUSY coupSUSY = {};
0345
0346
0347 SLHAinterface slhaInterface = {};
0348
0349
0350 PartonSystems partonSystems = {};
0351
0352
0353 MergingPtr mergingPtr = {};
0354
0355
0356
0357 MergingHooksPtr mergingHooksPtr;
0358
0359
0360 HeavyIonsPtr heavyIonsPtr = {};
0361
0362
0363 HIUserHooksPtr hiHooksPtr = {};
0364
0365
0366 HadronWidths hadronWidths = {};
0367
0368
0369 const BeamParticle& beamA = beamSetup.beamA;
0370 const BeamParticle& beamB = beamSetup.beamB;
0371
0372 private:
0373
0374
0375 friend class PythiaParallel;
0376
0377
0378
0379 WeightContainer weightContainer = {};
0380
0381
0382
0383
0384 Info infoPrivate = {};
0385
0386
0387 void initPtrs();
0388
0389
0390 void initPlugins();
0391
0392
0393 void beginEvent();
0394 void endEvent(PhysicsBase::Status status);
0395
0396
0397 void registerPhysicsBase(PhysicsBase &pb) {
0398 if (find(physicsPtrs.begin(), physicsPtrs.end(), &pb) != physicsPtrs.end())
0399 return;
0400 pb.initInfoPtr(infoPrivate);
0401 physicsPtrs.push_back(&pb);
0402 }
0403
0404
0405
0406 void pushInfo();
0407
0408
0409 static const double VERSIONNUMBERHEAD, VERSIONNUMBERCODE;
0410
0411
0412 static const int NTRY = 10;
0413
0414
0415 string xmlPath = {};
0416 bool doProcessLevel = {}, doPartonLevel = {}, doHadronLevel = {},
0417 doLowEnergy = {}, doSoftQCDall = {}, doSoftQCDinel = {},
0418 doCentralDiff = {}, doDiffraction = {}, doSoftQCD = {},
0419 doHardDiff = {}, doResDec = {}, doFSRinRes = {}, decayRHadrons = {},
0420 doPartonVertex = {}, abortIfVeto = {}, checkEvent = {},
0421 checkHistory = {}, doNonPert = {};
0422 int nErrList = {};
0423 double epTolErr = {}, epTolWarn = {}, mTolErr = {}, mTolWarn = {};
0424
0425
0426 bool isConstructed = {}, isInit = {}, showSaV = {}, showMaD = {},
0427 doReconnect = {}, forceHadronLevelCR = {};
0428 int nCount = {}, nShowLHA = {}, nShowInfo = {}, nShowProc = {},
0429 nShowEvt = {}, reconnectMode = {};
0430
0431
0432 int nErrEvent = {};
0433 vector<int> iErrId = {}, iErrCol = {}, iErrEpm = {}, iErrNan = {},
0434 iErrNanVtx = {};
0435
0436
0437 BeamSetup beamSetup = {};
0438
0439
0440 bool doLHA = false;
0441 bool useNewLHA = false;
0442 LHAupPtr lhaUpPtr = {};
0443
0444
0445 DecayHandlerPtr decayHandlePtr = {};
0446 vector<int> handledParticles = {};
0447
0448
0449 UserHooksPtr userHooksPtr = {};
0450 bool doVetoProcess = {}, doVetoPartons = {},
0451 retryPartonLevel = {}, canVetoHadronization = {};
0452
0453
0454 BeamShapePtr beamShapePtr = {};
0455 bool doVertexSpread = {};
0456 double eMinPert = {}, eWidthPert = {};
0457
0458
0459 vector<SigmaProcessPtr> sigmaPtrs = {};
0460
0461
0462
0463 vector<PhaseSpacePtr> phaseSpacePtrs = {};
0464
0465
0466 vector<ResonanceWidthsPtr> resonancePtrs = {};
0467
0468
0469
0470
0471
0472
0473 ShowerModelPtr showerModelPtr = {};
0474 TimeShowerPtr timesDecPtr = {};
0475 TimeShowerPtr timesPtr = {};
0476 SpaceShowerPtr spacePtr = {};
0477
0478
0479 PartonVertexPtr partonVertexPtr;
0480
0481
0482 ProcessLevel processLevel = {};
0483
0484
0485 PartonLevel partonLevel = {};
0486
0487
0488 PartonLevel trialPartonLevel = {};
0489
0490
0491 bool doMerging = {};
0492
0493
0494 StringIntPtr stringInteractionsPtr;
0495
0496
0497 ColRecPtr colourReconnectionPtr = {};
0498
0499
0500 JunctionSplitting junctionSplitting = {};
0501
0502
0503 HadronLevel hadronLevel = {};
0504
0505
0506 SigmaTotal sigmaTot = {};
0507 SigmaLowEnergy sigmaLowEnergy;
0508 NucleonExcitations nucleonExcitations = {};
0509 SigmaCombined sigmaCmb = {};
0510
0511
0512 RHadrons rHadrons = {};
0513
0514
0515 bool hasHeavyIons = {}, doHeavyIons = {};
0516
0517
0518 void banner();
0519
0520
0521 int readSubrun(string line, bool warn = true);
0522
0523
0524 int readCommented(string line);
0525
0526
0527 void checkSettings();
0528
0529
0530 bool nextNonPert(int procTypeIn = 0);
0531
0532
0533 bool doRHadronDecays();
0534
0535
0536 bool check();
0537
0538
0539 bool initSLHA();
0540 stringstream particleDataBuffer;
0541
0542
0543 vector<PhysicsBase*> physicsPtrs = {};
0544
0545 };
0546
0547
0548
0549 }
0550
0551 #endif