File indexing completed on 2026-08-06 09:20:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifdef EVTGEN_PYTHIA
0022
0023 #ifndef EVTPYTHIAENGINE_HH
0024 #define EVTPYTHIAENGINE_HH
0025
0026 #include "EvtGenBase/EvtDecayBase.hh"
0027 #include "EvtGenBase/EvtId.hh"
0028 #include "EvtGenBase/EvtParticle.hh"
0029 #include "EvtGenBase/EvtVector4R.hh"
0030
0031 #include "EvtGenModels/EvtAbsExternalGen.hh"
0032
0033 #include "EvtGenExternal/EvtPythiaRandom.hh"
0034
0035 #include "Pythia8/ParticleData.h"
0036 #include "Pythia8/Pythia.h"
0037
0038 #include <map>
0039 #include <memory>
0040 #include <string>
0041 #include <vector>
0042
0043
0044
0045 class EvtPythiaEngine : public EvtAbsExternalGen {
0046 public:
0047 EvtPythiaEngine( std::string xmlDir = "./xmldoc",
0048 bool convertPhysCodes = false, bool useEvtGenRandom = true );
0049
0050 virtual ~EvtPythiaEngine();
0051
0052 bool doDecay( EvtParticle* theMother ) override;
0053
0054 void initialise() override;
0055
0056 protected:
0057 private:
0058 void updateParticleLists();
0059 void updatePhysicsParameters();
0060
0061 void createPythiaParticle( EvtId& particleId, int PDGCode );
0062 bool validPDGCode( int PDGCode );
0063 void updatePythiaDecayTable( EvtId& particleId, int aliasInt, int PDGCode );
0064 void storeDaughterInfo( EvtParticle* theParticle, int startInt );
0065
0066 void clearDaughterVectors();
0067 void clearPythiaModeMap();
0068
0069 void createDaughterEvtParticles( EvtParticle* theParent );
0070
0071 int getModeInt( EvtDecayBase* decayModel );
0072
0073 std::unique_ptr<Pythia8::Pythia> _genericPythiaGen;
0074 std::unique_ptr<Pythia8::Pythia> _aliasPythiaGen;
0075 Pythia8::Pythia* _thePythiaGenerator;
0076
0077 std::vector<int> _daugPDGVector;
0078 std::vector<EvtVector4R> _daugP4Vector;
0079
0080 typedef std::map<int, std::vector<int>> PythiaModeMap;
0081 PythiaModeMap _pythiaModeMap;
0082
0083 bool _convertPhysCodes, _initialised, _useEvtGenRandom;
0084
0085 std::shared_ptr<EvtPythiaRandom> _evtgenRandom;
0086
0087 std::map<int, int> _addedPDGCodes;
0088 };
0089
0090 #endif
0091
0092 #endif