From d2c7a1ff86085224f8350254e67417cfa518c5ef Mon Sep 17 00:00:00 2001 From: Juraj Smiesko <34742917+kjvbrt@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:42:35 +0100 Subject: [PATCH] Revert "Remove the explicit mentioning of momentum types (#59)" This reverts commit cb50525bb21f2088567aa4dabb6276fbffcc3803. --- SimG4Components/src/SimG4PrimariesFromEdmTool.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp b/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp index be21535..6473a72 100644 --- a/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp +++ b/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp @@ -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);