Skip to content

Commit

Permalink
converting Energy
Browse files Browse the repository at this point in the history
  • Loading branch information
asalzburger committed Dec 4, 2024
1 parent 751f82e commit 46ac71e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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.),
Expand Down

0 comments on commit 46ac71e

Please sign in to comment.