Conversation
This lets VecGeom's BooleanFactory rewrite Boolean solids of at least 8 components into MultiUnions in the kVecGeom mode. - In the ALICE geometry 170 composite shapes are rewritten, among them the MFT disk supports and the ITS end wheels. - G4.vecgeomBooleanThreshold sets the threshold; 0 keeps the solids as converted. - Other users of buildVecGeomGeometry keep the solids as converted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This makes the stand-alone ComputeSafety of both VecGeom navigators cheaper, as Geant4's own navigator does. - The caller's proposedMaxLength now limits the BVH search: the value is exact below it and a valid lower bound above it, as in G4VoxelSafety. - A query at distance d from the last safety origin returns s0 - d when that covers the bound, without a computation. Every locate drops this cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
sawenzel
force-pushed
the
swenzel/o2sim-vecgeom-safety-boolean
branch
from
October 2, 2026 10:21
6dc8313 to
2beea34
Compare
sawenzel
marked this pull request as ready for review
October 2, 2026 10:21
Collaborator
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 PR speeds up the
G4.navmode=kVecGeommode introduced in #15865 and fixes a stale exit block in its relocating navigator. It ports findings of a study done on the G4VecGeomNav plugin (https://gitlab.cern.ch/VecGeom/g4vecgeomnav/-/merge_requests/27).Two changes reduce the cost per step. The stand-alone safety now honours the bound Geant4 passes with the query and reuses the last safety within its sphere, as Geant4's own voxel safety does. In addition, VecGeom's BooleanFactory rewrites Boolean solids of 8 or more components into MultiUnions; in ALICE this concerns 170 composite shapes, among them the MFT disk supports and the ITS end wheels. The third commit clears an exit block that entering a daughter carried over from the previous crossing; it made seven of 50000 geantino rays through the ITS outer-barrel services see too much copper.
Transport time per event, same events in every mode (Run 3 detector without ZDC, no alignment, VecGeom master, serial, 160–200 pp and 20 minimum-bias Pb-Pb events per mode, 95 % intervals):
* measured with three further locate changes that leave every hit unchanged and are not part of this PR; they made kRelocating about 1 % faster in pp.
Note that the changes are not intended to alter the physics. With up to 2000 paired pp events, hits and energy deposits per detector agree with the previous VecGeom navigation within 2σ, and the ray and location cross-checks against TGeo are unchanged by the MultiUnions. Two differences to kTGeo that exist already before this PR remain under study: about 2 % fewer EMCAL hits with the same energy deposit, and a few per cent more TOF energy.
G4.vecgeomBooleanThreshold=0restores the converted solids.Overall, VecGeom navigation now saves about 18 % of the transport time compared with TGeo, for pp and Pb-Pb alike.
Assisted by Claude Code.