diff --git a/Generators/GenzModuleEvent/GenzModuleEvent/KineHepMcmap.h b/Generators/GenzModuleEvent/GenzModuleEvent/KineHepMcmap.h index 8610967ce464f149a11c9b12b657d503250b5e5d..07b43e89a3fa3666b5ea7f03d3605d4543b251cf 100644 --- a/Generators/GenzModuleEvent/GenzModuleEvent/KineHepMcmap.h +++ b/Generators/GenzModuleEvent/GenzModuleEvent/KineHepMcmap.h @@ -13,8 +13,8 @@ class KineHepMcmap public: KineHepMcmap(const HepMC::GenEvent* evt); - int giveParticle_getkine (HepMC::GenParticlePtr p ) const; - HepMC::GenParticlePtr givekine_getParticle ( const int ikine ) const; + int giveParticle_getkine (HepMC::ConstGenParticlePtr p ) const; + HepMC::ConstGenParticlePtr givekine_getParticle ( const int ikine ) const; private: const HepMC::GenEvent* m_evt; const int m_kine_offset; diff --git a/Generators/GenzModuleEvent/src/KineHepMcmap.cxx b/Generators/GenzModuleEvent/src/KineHepMcmap.cxx index 00584e3d82f4de081b6d5c7cc012e501f35eb18b..9185e49c6e83e366888890592c6bdd7ddf19c29b 100644 --- a/Generators/GenzModuleEvent/src/KineHepMcmap.cxx +++ b/Generators/GenzModuleEvent/src/KineHepMcmap.cxx @@ -10,7 +10,7 @@ KineHepMcmap::KineHepMcmap ( const HepMC::GenEvent* evt ) {} int -KineHepMcmap::giveParticle_getkine (HepMC::GenParticlePtr p ) const +KineHepMcmap::giveParticle_getkine (HepMC::ConstGenParticlePtr p ) const { int barcode = HepMC::barcode(p); if (barcode < m_kine_offset) @@ -24,11 +24,11 @@ KineHepMcmap::giveParticle_getkine (HepMC::GenParticlePtr p ) const } } -HepMC::GenParticlePtr +HepMC::ConstGenParticlePtr KineHepMcmap::givekine_getParticle ( const int kine ) const { if (kine <= 0) return nullptr; - for (HepMC::GenParticlePtr part: *m_evt) + for (auto part: *m_evt) { if (giveParticle_getkine(part) == kine ) return part; }