Skip to content
Snippets Groups Projects
Commit 55c8ee97 authored by Andrii Verbytskyi's avatar Andrii Verbytskyi Committed by Adam Edward Barton
Browse files

Genz module const correctness

parent bc6f20e4
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,8 @@ class KineHepMcmap ...@@ -13,8 +13,8 @@ class KineHepMcmap
public: public:
KineHepMcmap(const HepMC::GenEvent* evt); KineHepMcmap(const HepMC::GenEvent* evt);
int giveParticle_getkine (HepMC::GenParticlePtr p ) const; int giveParticle_getkine (HepMC::ConstGenParticlePtr p ) const;
HepMC::GenParticlePtr givekine_getParticle ( const int ikine ) const; HepMC::ConstGenParticlePtr givekine_getParticle ( const int ikine ) const;
private: private:
const HepMC::GenEvent* m_evt; const HepMC::GenEvent* m_evt;
const int m_kine_offset; const int m_kine_offset;
......
...@@ -10,7 +10,7 @@ KineHepMcmap::KineHepMcmap ( const HepMC::GenEvent* evt ) ...@@ -10,7 +10,7 @@ KineHepMcmap::KineHepMcmap ( const HepMC::GenEvent* evt )
{} {}
int int
KineHepMcmap::giveParticle_getkine (HepMC::GenParticlePtr p ) const KineHepMcmap::giveParticle_getkine (HepMC::ConstGenParticlePtr p ) const
{ {
int barcode = HepMC::barcode(p); int barcode = HepMC::barcode(p);
if (barcode < m_kine_offset) if (barcode < m_kine_offset)
...@@ -24,11 +24,11 @@ KineHepMcmap::giveParticle_getkine (HepMC::GenParticlePtr p ) const ...@@ -24,11 +24,11 @@ KineHepMcmap::giveParticle_getkine (HepMC::GenParticlePtr p ) const
} }
} }
HepMC::GenParticlePtr HepMC::ConstGenParticlePtr
KineHepMcmap::givekine_getParticle ( const int kine ) const KineHepMcmap::givekine_getParticle ( const int kine ) const
{ {
if (kine <= 0) return nullptr; if (kine <= 0) return nullptr;
for (HepMC::GenParticlePtr part: *m_evt) for (auto part: *m_evt)
{ {
if (giveParticle_getkine(part) == kine ) return part; if (giveParticle_getkine(part) == kine ) return part;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment