Repository navigation
Conversation
This makes the VecGeom navigator start a new run of zero steps when a stuck-track push moved the track into a volume the run did not alternate between. - The new run counts from zero and decides again between chords and momentum steps. - A run restarts only if the track moved by at least half the push, and at most three times until the next finite step, so a track cannot be held forever. - The volumes of a run are recorded from its eighth zero step only. - The 10 um cap and the chord/momentum rule are unchanged. - This changes the output of the current locate too. - Two unit test cases cover the restart, the two conditions that prevent it, and the abort after the fourth run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This makes both VecGeom navigators update the Geant4 history incrementally for the three common transitions. - Entering a daughter of the current volume adds that placement's chain of Geant4 levels. - Leaving to the mother removes it, and moving into a sibling replaces it. - Every other change still goes through historyFromState, which walked every level on every crossing. - The update lives in the base class, so the relocating and the propagating navigator share it. - The history is the same as before: the levels and their transforms are made by the same NewLevel calls. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This adds a run-time switch G4.vecgeomLeanLocate (default off) that locates a boundary crossing of the relocating VecGeom navigator the way VecGeom relocates. - The point is pushed 1e-6 cm along the step direction, VecGeom's own push, instead of one tolerance across the face. - No face normal is computed for the push, and the flush-volume loop is not run: at that depth containment pops every flush mother. - An exit no longer records a block for the next step. Every mother with daughters is stepped with BVHNavigatorV, which refuses at zero distance a daughter the ray leaves. - A parallel world node just left is still refused while the direction leaves it, with the normal computed only for that node. - The navigator unit test runs every case with both locates. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This fixes the safety of the propagating VecGeom navigator (G4.vecgeomNavigator=kPropagated) and adds unit tests. - ComputeSafety answered 0 at every point until the next within-volume locate after a crossing, so the end point of the first step in a new volume had no safety. - It now answers 0 only at the point where the crossing was located and at the end point of a step that ends on a boundary, as VecGeomG4Navigator does. - The locate now consumes fWasLimitedByGeometry as G4Navigator does, so a new track is no longer taken for a crossing with the previous track's flags. - ResetHierarchyAndLocate now clears the crossing state left by the previous track. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This prepares a faster crossing locate for the VecGeom navigator (
G4.navmode=kVecGeom) and fixes two problems found while comparing it with the propagating navigator.The relocating navigator spent most of its extra time per boundary crossing on a push along the face normal and on a loop over flush volumes. A new locate, switched on with
G4.vecgeomLeanLocate=true(off by default in this PR), relocates the way VecGeom does: it pushes 1e-6 cm along the step and lets containment and the BVH navigator's leaving rule decide. This cuts the crossing locate from about 4000 to 1800 instructions. Both navigators also update the Geant4 history incrementally now.The fixes:
G4.vecgeomNavigator=kPropagated) answered safety 0 for the whole first step in every new volume and for every new track. This removed the multiple-scattering displacement and cost 0.43 % of the visible energy of 1 GeV photons in EMCAL. With the fix it agrees with TGeo (1.0003 ± 0.0007). This fix is independent of the rest.With the switch off, the output is the same as before apart from the restart above. Unit tests cover every case with both locates.
Assisted by Claude Code.