Skip to content

Commit

Permalink
Remove a few explicit types and use auto
Browse files Browse the repository at this point in the history
Makes it easier to switch the exact type later on
  • Loading branch information
tmadlener committed Dec 11, 2023
1 parent a88e2b7 commit 0e22f39
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions k4Gen/src/components/EDMToHepMCConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ StatusCode EDMToHepMCConverter::execute() {

auto particles = m_genphandle.get();
// ownership of event given to data service at the end of execute
HepMC3::GenEvent* event = new HepMC3::GenEvent;
auto* event = new HepMC3::GenEvent;
event->set_units(HepMC3::Units::GEV, HepMC3::Units::MM);


for (auto p : *(particles)) {
if (p.getGeneratorStatus() == 1) { // only final state particles
edm4hep::Vector3f mom = p.getMomentum();
GenParticle* pHepMC =
const auto& mom = p.getMomentum();
auto* pHepMC =
new GenParticle(HepMC3::FourVector(mom.x, mom.y, mom.z, p.getMass()),
p.getPDG(),
p.getGeneratorStatus()); // hepmc status code for final state particle

edm4hep::Vector3d pos = p.getVertex();
HepMC3::GenVertex* v =
const auto& pos = p.getVertex();
auto* v =
new HepMC3::GenVertex(HepMC3::FourVector(pos.x,
pos.y,
pos.z,
Expand Down

0 comments on commit 0e22f39

Please sign in to comment.