diff --git a/.gitignore b/.gitignore index 38faf196d..045054eeb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *~ +spack* +Testing *.pyc *.root *.png diff --git a/Generation/src/components/PythiaInterface.cpp b/Generation/src/components/PythiaInterface.cpp index c96530dfa..3f0eeff58 100644 --- a/Generation/src/components/PythiaInterface.cpp +++ b/Generation/src/components/PythiaInterface.cpp @@ -103,7 +103,11 @@ StatusCode PythiaInterface::initialize() { } m_setting = std::unique_ptr(new Pythia8::amcnlo_unitarised_interface(scheme)); + #if PYTHIA_VERSION_INTEGER < 8300 m_pythiaSignal->setUserHooksPtr(m_setting.get()); + #else + m_pythiaSignal->setUserHooksPtr((Pythia8::UserHooksPtr) m_setting.get()); + #endif } // For jet matching, initialise the respective user hooks code. @@ -112,7 +116,11 @@ StatusCode PythiaInterface::initialize() { if (!m_matching) { return Error(" Failed to initialise jet matching structures."); } + #if PYTHIA_VERSION_INTEGER < 8300 m_pythiaSignal->setUserHooksPtr(m_matching.get()); + #else + m_pythiaSignal->setUserHooksPtr((Pythia8::UserHooksPtr) m_matching.get()); + #endif } // jet clustering needed for matching @@ -145,16 +153,25 @@ StatusCode PythiaInterface::initialize() { m_powhegHooks = std::make_shared(); + #if PYTHIA_VERSION_INTEGER < 8300 m_pythiaSignal->addUserHooksPtr(m_powhegHooks.get()); + #else + m_pythiaSignal->addUserHooksPtr((Pythia8::UserHooksPtr)m_powhegHooks.get()); + #endif } bool resonanceDecayFilter = m_pythiaSignal->settings.flag("ResonanceDecayFilter:filter"); if (resonanceDecayFilter) { m_resonanceDecayFilterHook = std::make_shared(); + #if PYTHIA_VERSION_INTEGER < 8300 m_pythiaSignal->addUserHooksPtr(m_resonanceDecayFilterHook.get()); + #else + m_pythiaSignal->addUserHooksPtr((Pythia8::UserHooksPtr)m_resonanceDecayFilterHook.get()); + #endif } // Set up evtGen if (m_doEvtGenDecays) { + #if PYTHIA_VERSION_INTEGER < 8300 m_evtgen = new EvtGenDecays( m_pythiaSignal.get(), // the pythia instance m_EvtGenDecayFile.value(), // the file name of the evtgen decay file @@ -166,6 +183,19 @@ StatusCode PythiaInterface::initialize() { true, // a flag to limit decays based on the Pythia criteria (based on the particle decay vertex) true, // a flag to use external models with EvtGen false); // a flag if an FSR model should be passed to EvtGen (pay attention to this, default is true) + #else + m_evtgen = new Pythia8::EvtGenDecays( + m_pythiaSignal.get(), // the pythia instance + m_EvtGenDecayFile.value(), // the file name of the evtgen decay file + m_EvtGenParticleDataFile.value(), // the file name of the evtgen data file + nullptr, // the optional EvtExternalGenList pointer (must be be provided if the next argument is provided to avoid double initializations) + nullptr, // the EvtAbsRadCorr pointer to pass to EvtGen + 1, // the mixing type to pass to EvtGen + false, // a flag to use XML files to pass to EvtGen + true, // a flag to limit decays based on the Pythia criteria (based on the particle decay vertex) + true, // a flag to use external models with EvtGen + false); // a flag if an FSR model should be passed to EvtGen (pay attention to this, default is true) + #endif if (!m_UserDecayFile.empty()) { m_evtgen->readDecayFile(m_UserDecayFile); } diff --git a/Generation/src/components/PythiaInterface.h b/Generation/src/components/PythiaInterface.h index 8a33ad0da..d5a7bf6ea 100644 --- a/Generation/src/components/PythiaInterface.h +++ b/Generation/src/components/PythiaInterface.h @@ -10,20 +10,31 @@ #include "Pythia8Plugins/PowhegHooks.h" #include "Pythia8Plugins/HepMC2.h" -class EvtGenDecays; // Forward HepMC namespace HepMC { class GenEvent; } // Forward Pythia +#if PYTHIA_VERSION_INTEGER < 8300 +class EvtGenDecays; +namespace Pythia8 { +class Pythia; +class SlowJet; +class JetMatchingMadgraph; +class amcnlo_unitarised_interface; +} +#else namespace Pythia8 { +class EvtGenDecays; class Pythia; class SlowJet; class JetMatchingMadgraph; class amcnlo_unitarised_interface; } +#endif + namespace fcc { class FloatValueCollection; } @@ -89,7 +100,11 @@ class PythiaInterface : public GaudiTool, virtual public IHepMCProviderTool { Gaudi::Property> m_evtGenExcludes{this, "EvtGenExcludes", {}, "Pdg IDs of particles not to decay with EvtGen"}; + #if PYTHIA_VERSION_INTEGER < 8300 EvtGenDecays* m_evtgen = nullptr; + #else + Pythia8::EvtGenDecays* m_evtgen = nullptr; + #endif }; #endif // GENERATION_PYTHIAINTERFACE_H