19
19
#include < G4TouchableHandle.hh>
20
20
#include < G4PVReplica.hh>
21
21
#include < G4ReplicaNavigation.hh>
22
+ #include < G4StepStatus.hh>
22
23
23
24
#include < G4HepEmState.hh>
24
25
#include < G4HepEmData.hh>
@@ -351,6 +352,17 @@ void AdePTGeant4Integration::ProcessGPUStep(GPUHit const &hit, bool const callUs
351
352
&fScoringObjects ->fPostG4NavigationHistory );
352
353
}
353
354
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
+
354
366
// Reconstruct G4Step
355
367
switch (hit.fParticleType ) {
356
368
case 0 :
@@ -364,7 +376,7 @@ void AdePTGeant4Integration::ProcessGPUStep(GPUHit const &hit, bool const callUs
364
376
break ;
365
377
}
366
378
FillG4Step (&hit, fScoringObjects ->fG4Step , *fScoringObjects ->fPreG4TouchableHistoryHandle ,
367
- *fScoringObjects ->fPostG4TouchableHistoryHandle );
379
+ *fScoringObjects ->fPostG4TouchableHistoryHandle , preStepStatus, postStepStatus );
368
380
369
381
// Call SD code
370
382
G4VSensitiveDetector *aSensitiveDetector =
@@ -445,7 +457,8 @@ void AdePTGeant4Integration::FillG4NavigationHistory(vecgeom::NavigationState aN
445
457
446
458
void AdePTGeant4Integration::FillG4Step (GPUHit const *aGPUHit, G4Step *aG4Step,
447
459
G4TouchableHandle &aPreG4TouchableHandle,
448
- G4TouchableHandle &aPostG4TouchableHandle) const
460
+ G4TouchableHandle &aPostG4TouchableHandle, G4StepStatus aPreStepStatus,
461
+ G4StepStatus aPostStepStatus) const
449
462
{
450
463
const G4ThreeVector aPostStepPointMomentumDirection (aGPUHit->fPostStepPoint .fMomentumDirection .x (),
451
464
aGPUHit->fPostStepPoint .fMomentumDirection .y (),
@@ -519,7 +532,7 @@ void AdePTGeant4Integration::FillG4Step(GPUHit const *aGPUHit, G4Step *aG4Step,
519
532
aPreStepPoint->SetPolarization (G4ThreeVector (aGPUHit->fPreStepPoint .fPolarization .x (),
520
533
aGPUHit->fPreStepPoint .fPolarization .y (),
521
534
aGPUHit->fPreStepPoint .fPolarization .z ())); // Real data
522
- // aPreStepPoint->SetStepStatus(G4StepStatus::fUndefined); // Missing data
535
+ aPreStepPoint->SetStepStatus (aPreStepStatus); // Missing data
523
536
// aPreStepPoint->SetProcessDefinedStep(nullptr); // Missing data
524
537
// aPreStepPoint->SetMass(0); // Missing data
525
538
aPreStepPoint->SetCharge (aGPUHit->fPreStepPoint .fCharge ); // Real data
@@ -544,7 +557,7 @@ void AdePTGeant4Integration::FillG4Step(GPUHit const *aGPUHit, G4Step *aG4Step,
544
557
// aPostStepPoint->SetSensitiveDetector(nullptr); // Missing data
545
558
// aPostStepPoint->SetSafety(0); // Missing data
546
559
aPostStepPoint->SetPolarization (aPostStepPointPolarization); // Real data
547
- // aPostStepPoint->SetStepStatus(G4StepStatus::fUndefined); // Missing data
560
+ aPostStepPoint->SetStepStatus (aPostStepStatus); // Missing data
548
561
// aPostStepPoint->SetProcessDefinedStep(nullptr); // Missing data
549
562
// aPostStepPoint->SetMass(0); // Missing data
550
563
aPostStepPoint->SetCharge (aGPUHit->fPostStepPoint .fCharge ); // Real data
0 commit comments