Add BVH-based navigation functions to TGeoTessellated (Improved version 2)#21409
Open
sawenzel wants to merge 1 commit intoroot-project:masterfrom
Open
Add BVH-based navigation functions to TGeoTessellated (Improved version 2)#21409sawenzel wants to merge 1 commit intoroot-project:masterfrom
sawenzel wants to merge 1 commit intoroot-project:masterfrom
Conversation
Contributor
Author
Member
|
Waiting for @agheata , I am starting the builds. |
Test Results 15 files 15 suites 1d 16h 9m 43s ⏱️ Results for commit e2ee0ea. |
e2ee0ea to
0aff1de
Compare
Contributor
Author
|
Updated commit to fix compile error on some platforms + clang-format. |
This commit adds implementations of the navigation interfaces required by TGeoNavigator to TGeoTessellated. As a result, TGeoTessellated can now be used in applications that rely on this navigator, such as VMC-based GEANT simulations. The implementation is based on fast Bounding Volume Hierarchy (BVH) queries introduced in a recent TGeoParallelWorld rewrite. The BVH is only exposed to the internal implementation. It is not streamed to disk for now and therefore needs to be reinitialized when reading from TBuffer. For this reason, a custom streamer for TGeoTessellated is proposed. The implementation shows very good performance, being multiple times faster than comparable implementations in Geant4 or VecGeom. The latter were also used to validate the algorithms. Navigation functionality has additionally been tested at a high level using VecGeom’s XRayNavigationBenchmarker. Note that this is an initial implementation and should be considered beta quality. The following limitations and remarks apply: - DistFromInside and DistFromOutside do not implement all `iact=` cases. Only `iact == 3` is supported, which is the case actually used by TGeoNavigator. - Only triangular faces supported at this stage but generalization is straightforward. (Users can also make sure to only add triangles). - The algorithms have not yet been validated in large-scale production environments. - Further optimization seem possible and will be done in future commits. This work is motivated by the need to GEANT-simulate detector prototypes from CAD models in ALICE. ALICE is using TGeo. Finally, the commit also fixes some minor bugs in the TGeoChecker with respect to bounding box origins, previously not taken into account. Slight refactoring of TGeoParallelWorld to make use of utility functions used both in TGeoTessellated as well as in TGeoParallelWorld.
0aff1de to
483cc04
Compare
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 commit adds implementations of the navigation interfaces required by TGeoNavigator to TGeoTessellated.
As a result, TGeoTessellated can now be used in applications that rely on this navigator, such as VMC-based GEANT simulations.
The implementation is based on fast Bounding Volume Hierarchy (BVH) queries introduced in a recent TGeoParallelWorld rewrite.
The BVH is only exposed to the internal implementation. It is not streamed to disk for now and therefore needs to be reinitialized when reading from TBuffer. For this reason, a custom streamer for TGeoTessellated is proposed.
The implementation shows very good performance, being multiple times faster than comparable implementations in Geant4 or VecGeom. The latter were also used to validate the algorithms. Navigation functionality has additionally been tested at a high level using VecGeom’s XRayNavigationBenchmarker.
Note that this is an initial implementation and should be considered beta quality. The following limitations and remarks apply:
DistFromInside and DistFromOutside do not implement all
iact=cases. Onlyiact == 3is supported, which is the case actually used by TGeoNavigator.Only triangular faces supported at this stage but generalization is straightforward. (Users can also make sure to only add triangles).
The algorithms have not yet been validated in large-scale production environments.
Further optimization seem possible and will be done in future commits.
This work is motivated by the need to GEANT-simulate detector prototypes from CAD models in ALICE. ALICE is using TGeo.
Finally, the commit also fixes some minor bugs in the TGeoChecker with respect to bounding box origins, previously not taken into account.
Slight refactoring of TGeoParallelWorld to make use of utility functions used both in TGeoTessellated as well as in TGeoParallelWorld.