Use scalar touchable rather than vector of physical volume stack
Related to #1353, #1351 , #1746 , #1390 , replacing the implementation from #1461 . A Geant4 detector geometry can be visualized as a graph where "logical volumes" are nodes and "physical volumes" are edges. A Geant4 detector geometry can be visualized as a rooted directed acyclic graph (DAG) where "logical volumes" are nodes and "physical volumes" are edges, and a "touchable history" is a directed trail from the root "world" geometry to a node that, in simulation, describes all the enclosing volumes and their locations. Thus a "touchable" is a unique volume of space in the detector.
We should be able to uniquely and efficiently be able to map a navigation path to and from a single touchable history IDs by storing:
- For each logical volume ID (node) the physical volume daughter IDs (edges below)
- For each physical volume (edge) the logical volume it's placing (node below)
- For each daughter (outgoing edge) of each LV (node), the accumulated number of touchables below it
We can probably use 32-bit integers for logical/physical volumes, but we certainly want 64-bit for touchables. As a side note, FCC wants 64-bit logical but I think they're really asking for 64-bit touchables. I don't think they can fit more than 4B geant4 logical volumes in memory...
Discussion of how to construct and use
Note on IDs
VolumeIddirectly corresponds with logical volumesVolumeInstanceIdis a combination of physical + replica/placement (see #1649) so make sure in the above procedure to expand+map thoseUniqueVolumeIdcorresponds to a touchable history (nav history/nav path)
I don't think this will help https://github.com/celeritas-project/celeritas/issues/1351 ; we can't determine from the graph alone what pairs of nodes will connect.
@amandalund this is what I was talking about over coffee