Skip to content

Commit 2beea34

Browse files
sawenzelclaude
andcommitted
Clear the previous exit block when entering a daughter
This fixes a stale exit block in the relocating VecGeom navigator. - Entering a daughter adopted the state of the step, which could still carry the block of the volume the previous crossing left, so that volume stayed blocked one step longer than Geant4's rule allows. - Seven of 50000 geantino rays through the ITS outer-barrel services saw up to 9 X0 too much copper because of it; they now agree with TGeo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bc3b373 commit 2beea34

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Detectors/gconfig/src/VecGeomG4Navigator.cxx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ G4VPhysicalVolume* VecGeomG4Navigator::LocateGlobalPointAndSetup(const G4ThreeVe
315315
// Into the daughter the step hit, then down inside it.
316316
mReloScratch = mCurState;
317317
mCurState = mNextState;
318+
// mNextState is a copy of the step state and can still carry the block of the volume the previous
319+
// crossing left, which was meant for the first step after that exit only.
320+
mCurState.SetLastExited(mEmptyState.GetLastExitedState());
318321
auto const* daughter = mCurState.Top();
319322
mCurState.Pop();
320323
vecgeom::Transformation3D m;

0 commit comments

Comments
 (0)