Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the explicit mentioning of momentum types #59

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading