From 46ac71eadd565b60098b656f2de6a332cc1f8f5e Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 4 Dec 2024 11:38:36 +0100 Subject: [PATCH] converting Energy --- Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp b/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp index b1e96c2f892..9d3121cdc44 100644 --- a/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp +++ b/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp @@ -116,6 +116,7 @@ SensitiveSteppingAction::SensitiveSteppingAction( void SensitiveSteppingAction::UserSteppingAction(const G4Step* step) { // Unit conversions G4->::ACTS static constexpr double convertLength = Acts::UnitConstants::mm / CLHEP::mm; + static constexpr double convertEnergy = Acts::UnitConstants::GeV / CLHEP::GeV; // The particle after the step G4Track* track = step->GetTrack(); @@ -215,7 +216,7 @@ void SensitiveSteppingAction::UserSteppingAction(const G4Step* step) { double xDirVtx = track->GetVertexMomentumDirection().x(); double yDirVtx = track->GetVertexMomentumDirection().y(); double zDirVtx = track->GetVertexMomentumDirection().z(); - double absMomentum = track->GetMomentum().mag(); + double absMomentum = track->GetMomentum().mag() * convertEnergy; PropagationSummary iSummary(Acts::CurvilinearTrackParameters( Acts::Vector4(xVtx, yVtx, zVtx, 0.),