Skip to content

Commit

Permalink
Removing no longer needed casts
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvbrt committed Feb 29, 2024
1 parent bf49029 commit 0b375cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions k4Gen/src/components/HepMCToEDMConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ edm4hep::MutableMCParticle HepMCToEDMConverter::convert(std::shared_ptr<const He
edm_particle.setGeneratorStatus(hepmcParticle->status());
// look up charge from pdg_id
HepPDT::ParticleID particleID(hepmcParticle->pdg_id());
edm_particle.setCharge(particleID.charge());
edm_particle.setCharge(static_cast<float>(particleID.charge()));
// convert momentum
auto p = hepmcParticle->momentum();
edm_particle.setMomentum( {float(p.px()), float(p.py()), float(p.pz())} );
edm_particle.setMass( double ( hepmcParticle->generated_mass() ) );
edm_particle.setMomentum( {p.px(), p.py(), p.pz()} );
edm_particle.setMass(hepmcParticle->generated_mass());

// add spin (particle helicity) information if available
std::shared_ptr<HepMC3::VectorFloatAttribute> spin = hepmcParticle->attribute<HepMC3::VectorFloatAttribute>("spin");
Expand All @@ -31,7 +31,7 @@ edm4hep::MutableMCParticle HepMCToEDMConverter::convert(std::shared_ptr<const He

if ( prodVtx!=nullptr ) {
auto& pos = prodVtx->position();
edm_particle.setVertex( {float(pos.x()), float(pos.y()), float(pos.z())} );
edm_particle.setVertex( {pos.x(), pos.y(), pos.z()} );
}

auto endVtx = hepmcParticle->end_vertex();
Expand Down

0 comments on commit 0b375cb

Please sign in to comment.