1919#include < G4TouchableHandle.hh>
2020#include < G4PVReplica.hh>
2121#include < G4ReplicaNavigation.hh>
22+ #include < G4StepStatus.hh>
2223
2324#include < G4HepEmState.hh>
2425#include < G4HepEmData.hh>
@@ -351,6 +352,17 @@ void AdePTGeant4Integration::ProcessGPUStep(GPUHit const &hit, bool const callUs
351352 &fScoringObjects ->fPostG4NavigationHistory );
352353 }
353354
355+ // Get step status
356+ // NOTE: Currently, we only check for the geometrical boundary, other statuses are set as unknown for now
357+ G4StepStatus preStepStatus{G4StepStatus::fUndefined };
358+ G4StepStatus postStepStatus{G4StepStatus::fUndefined };
359+ if (preNavState.IsOnBoundary ()) {
360+ preStepStatus = G4StepStatus::fGeomBoundary ;
361+ }
362+ if (postNavState.IsOnBoundary ()) {
363+ postStepStatus = G4StepStatus::fGeomBoundary ;
364+ }
365+
354366 // Reconstruct G4Step
355367 switch (hit.fParticleType ) {
356368 case 0 :
@@ -364,7 +376,7 @@ void AdePTGeant4Integration::ProcessGPUStep(GPUHit const &hit, bool const callUs
364376 break ;
365377 }
366378 FillG4Step (&hit, fScoringObjects ->fG4Step , *fScoringObjects ->fPreG4TouchableHistoryHandle ,
367- *fScoringObjects ->fPostG4TouchableHistoryHandle );
379+ *fScoringObjects ->fPostG4TouchableHistoryHandle , preStepStatus, postStepStatus );
368380
369381 // Call SD code
370382 G4VSensitiveDetector *aSensitiveDetector =
@@ -445,7 +457,8 @@ void AdePTGeant4Integration::FillG4NavigationHistory(vecgeom::NavigationState aN
445457
446458void AdePTGeant4Integration::FillG4Step (GPUHit const *aGPUHit, G4Step *aG4Step,
447459 G4TouchableHandle &aPreG4TouchableHandle,
448- G4TouchableHandle &aPostG4TouchableHandle) const
460+ G4TouchableHandle &aPostG4TouchableHandle, G4StepStatus aPreStepStatus,
461+ G4StepStatus aPostStepStatus) const
449462{
450463 const G4ThreeVector aPostStepPointMomentumDirection (aGPUHit->fPostStepPoint .fMomentumDirection .x (),
451464 aGPUHit->fPostStepPoint .fMomentumDirection .y (),
@@ -519,7 +532,7 @@ void AdePTGeant4Integration::FillG4Step(GPUHit const *aGPUHit, G4Step *aG4Step,
519532 aPreStepPoint->SetPolarization (G4ThreeVector (aGPUHit->fPreStepPoint .fPolarization .x (),
520533 aGPUHit->fPreStepPoint .fPolarization .y (),
521534 aGPUHit->fPreStepPoint .fPolarization .z ())); // Real data
522- // aPreStepPoint->SetStepStatus(G4StepStatus::fUndefined); // Missing data
535+ aPreStepPoint->SetStepStatus (aPreStepStatus); // Missing data
523536 // aPreStepPoint->SetProcessDefinedStep(nullptr); // Missing data
524537 // aPreStepPoint->SetMass(0); // Missing data
525538 aPreStepPoint->SetCharge (aGPUHit->fPreStepPoint .fCharge ); // Real data
@@ -544,7 +557,7 @@ void AdePTGeant4Integration::FillG4Step(GPUHit const *aGPUHit, G4Step *aG4Step,
544557 // aPostStepPoint->SetSensitiveDetector(nullptr); // Missing data
545558 // aPostStepPoint->SetSafety(0); // Missing data
546559 aPostStepPoint->SetPolarization (aPostStepPointPolarization); // Real data
547- // aPostStepPoint->SetStepStatus(G4StepStatus::fUndefined); // Missing data
560+ aPostStepPoint->SetStepStatus (aPostStepStatus); // Missing data
548561 // aPostStepPoint->SetProcessDefinedStep(nullptr); // Missing data
549562 // aPostStepPoint->SetMass(0); // Missing data
550563 aPostStepPoint->SetCharge (aGPUHit->fPostStepPoint .fCharge ); // Real data
0 commit comments