Skip to content

Commit

Permalink
Remove the explicit mentioning of momentum types (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored Dec 14, 2023
1 parent 26e669e commit cb50525
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SimG4Components/src/SimG4PrimariesFromEdmTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ G4Event* SimG4PrimariesFromEdmTool::g4Event() {
auto theEvent = new G4Event();
const edm4hep::MCParticleCollection* mcparticles = m_genParticles.get();
for (auto mcparticle : *mcparticles) {
const edm4hep::Vector3d v = mcparticle.getVertex();
G4PrimaryVertex* g4Vertex = new G4PrimaryVertex(v.x * sim::edm2g4::length,
const auto& v = mcparticle.getVertex();
auto* g4Vertex = new G4PrimaryVertex(v.x * sim::edm2g4::length,
v.y * sim::edm2g4::length,
v.z * sim::edm2g4::length,
mcparticle.getTime() / Gaudi::Units::c_light * sim::edm2g4::length);
const edm4hep::Vector3f mom = mcparticle.getMomentum();
G4PrimaryParticle* g4Particle = new G4PrimaryParticle(mcparticle.getPDG(),
const auto& mom = mcparticle.getMomentum();
auto* g4Particle = new G4PrimaryParticle(mcparticle.getPDG(),
mom.x * sim::edm2g4::energy,
mom.y * sim::edm2g4::energy,
mom.z * sim::edm2g4::energy);
Expand Down

0 comments on commit cb50525

Please sign in to comment.