Surface model navigation using scene-based navigation table
This implements a new way to handle navigation states, usable by both the solid and surface models. This works as follows:
- Some logical volumes are selected to become
scenes
. A scene has a flat representation of all the touchable objects inside, identifiable via a unique index. Scene states are stored in memory in aLUT
in a similar way as in the navigation index table. The stored information is positional (transformation of the object in the scene reference) and logical (connection to parent and children nodes). - Scenes are composable, meaning a given volume in a scene hierarchy can be a scene. So a touchable state in a two-level scene approach would be uniquely identified by a pair of indices
(n1, n2)
, while in a multi-scene approach states are preferable using a tuple (n1, n2,... ,nj). So there are two extreme cases:- using a single scene representation of the world volume creates a flattened expansion of the geometry tree, representable using the current
NavStateIndex.
This creates an entry in the table for each touchable, so it has the largest table size (memory intensive). - making all logical volumes scenes is representable via the current
NavStatePath
. This approach does not require a table, the full state can be stored in the navigation state. Each volume has a local transformation in the parent volume reference frame, so converting 3D points/directions to the touchable frame requires transforming them successively through all levels (computing and memory access intensive)
- using a single scene representation of the world volume creates a flattened expansion of the geometry tree, representable using the current
- Due to the feature of
replication
, which is intensively used in detector setups, flattening only certain volumes that are highly replicated can bring a good compromise between the above two extremes. The current approach implements an algorithm that allows constraining the maximumscene (tuple) depth
and the minimum number of touchable objects allowed per scene and finds the collection of scene volumes that minimizes the total number of states needing tabulation. The memory reduction varies very fast with the maximum scene depth for typical LHC setups
The way to use this is to compile using the VECGEOM_USE_NAVTUPLE
option and set the maximum scene depth via VECGEOM_NAVTUPLE_MAXDEPTH
. The default minimum number of touchables per scene is 1000 and this can be changed using GeoManager::Instance::SetMinPerScene
(BEFORE loading a GDML file). Then the tuple navigation table is built automatically upon closing the geometry, and the surface model will be automatically aware of it.
Edited by Andrei Gheata