Skip to content

Commit

Permalink
Revert "Remove the explicit mentioning of momentum types (#59)"
Browse files Browse the repository at this point in the history
This reverts commit cb50525.
  • Loading branch information
kjvbrt authored Feb 8, 2024
1 parent 5c3826d commit d2c7a1f
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 auto& v = mcparticle.getVertex();
auto* g4Vertex = new G4PrimaryVertex(v.x * sim::edm2g4::length,
const edm4hep::Vector3d v = mcparticle.getVertex();
G4PrimaryVertex* 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 auto& mom = mcparticle.getMomentum();
auto* g4Particle = new G4PrimaryParticle(mcparticle.getPDG(),
const edm4hep::Vector3f mom = mcparticle.getMomentum();
G4PrimaryParticle* 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 d2c7a1f

Please sign in to comment.