Skip to content
Snippets Groups Projects
Commit 69d6a19b authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'hepmc3_GenzModuleEvent' into 'master'

Migration of GenzModuleEvent  to HepMC3

See merge request atlas/athena!34343
parents a4816d9b 7f914918
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef KINEHEPMCMAP_H #ifndef KINEHEPMCMAP_H
...@@ -17,10 +17,7 @@ public: ...@@ -17,10 +17,7 @@ public:
HepMC::GenParticlePtr givekine_getParticle ( const int ikine ) const; HepMC::GenParticlePtr givekine_getParticle ( const int ikine ) const;
private: private:
const HepMC::GenEvent* m_evt; const HepMC::GenEvent* m_evt;
//const int m_vertex_offset;
const int m_kine_offset; const int m_kine_offset;
//const int m_mbias_int_kine_offset;
//const int m_mbias_noint_kine_offset;
}; };
......
...@@ -27,22 +27,12 @@ KineHepMcmap::giveParticle_getkine (HepMC::GenParticlePtr p ) const ...@@ -27,22 +27,12 @@ KineHepMcmap::giveParticle_getkine (HepMC::GenParticlePtr p ) const
HepMC::GenParticlePtr HepMC::GenParticlePtr
KineHepMcmap::givekine_getParticle ( const int kine ) const KineHepMcmap::givekine_getParticle ( const int kine ) const
{ {
if (kine <= 0) return 0; if (kine <= 0) return nullptr;
HepMC::GenParticlePtr part = nullptr; for (HepMC::GenParticlePtr part: *m_evt)
bool not_found = true;
HepMC::GenEvent::particle_const_iterator p = m_evt->particles_begin();
do
{ {
int pkine = giveParticle_getkine(*p); if (giveParticle_getkine(part) == kine ) return part;
if (pkine == kine) }
{ return nullptr;
not_found = false;
part = *p;
}
++p;
} while (p != m_evt->particles_end() && not_found);
return part;
} }
...@@ -57,7 +47,7 @@ KineHepMcmap::givekine_getParticle ( const int kine ) const ...@@ -57,7 +47,7 @@ KineHepMcmap::givekine_getParticle ( const int kine ) const
// int kine = 120; // int kine = 120;
// HepMC::KineHepMcmap kinm(evt ) ; // HepMC::KineHepMcmap kinm(evt ) ;
// HepMC::GenParticle* myparticle = kinm.givekine_getParticle( kine); // HepMC::GenParticlePtr myparticle = kinm.givekine_getParticle( kine);
// int mykine = kinm.giveParticle_getkine( myparticle); // int mykine = kinm.giveParticle_getkine( myparticle);
// cout << "KineHepMcmap geant particle 120 = " << mykine << endl; // cout << "KineHepMcmap geant particle 120 = " << mykine << endl;
// if (myparticle) myparticle->print(); // if (myparticle) myparticle->print();
......
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