|
Celeritas 0.7-develop+ecfda7e
|
Track a particle in a universe of well-connected volumes. More...
#include <SimpleUnitTracker.hh>
Public Types | |
Type aliases | |
| using | ParamsRef = NativeCRef< OrangeParamsData > |
| using | Initialization = detail::Initialization |
| using | Intersection = detail::Intersection |
| using | LocalState = detail::LocalState |
| using | LogicEvaluator = std::conditional_t< orange_tracking_logic==LogicNotation::infix, detail::InfixEvaluator, detail::PostfixEvaluator > |
| using | VolumeView = detail::LocalVolumeView |
Public Member Functions | |
| SimpleUnitTracker (ParamsRef const ¶ms, SimpleUnitId id) | |
| Construct with reference to persistent parameter data. | |
| LocalVolumeId::size_type | num_volumes () const |
| Number of local volumes. | |
| LocalSurfaceId::size_type | num_surfaces () const |
| Number of local surfaces. | |
| SimpleUnitRecord const & | unit_record () const |
| SimpleUnitRecord for this tracker. | |
| DaughterId | daughter (LocalVolumeId vol) const |
| DaughterId of universe embedded in a given volume. | |
| vol_level_uint | local_vol_level (LocalVolumeId vol) const |
| Volume level relative to the "top" canonical volume in the universe. | |
| LocalVolumeId | local_parent (LocalVolumeId vol) const |
| Local volume ID of the parent canonical volume, if any. | |
| Initialization | initialize (LocalState const &state) const |
| Find the local volume from a position and direction. | |
| Initialization | cross_boundary (LocalState const &state) const |
| Find the local volume on the opposite side of a surface. | |
| Intersection | intersect (LocalState const &state) const |
| Search for an intersection without a distance limit. | |
| Intersection | intersect (LocalState const &state, real_type max_dist) const |
| Calculate distance-to-intercept for the next local surface. | |
| real_type | safety (Real3 const &pos, LocalVolumeId vol, real_type max_dist) const |
| Calculate a lower bound on the distance to a surface in any direction. | |
| Real3 | normal (Real3 const &pos, LocalSurfaceId surf) const |
| Calculate the local surface normal. | |
Track a particle in a universe of well-connected volumes.
The simple unit tracker is based on a set of non-overlapping volumes comprised of surfaces. It is a faster but less "user-friendly" version of the masked unit tracker because it requires all volumes to be exactly defined by their connected surfaces. It does not check for overlaps.
All IDs inside the simple unit tracker are local and implementation-specific, with the exception that daughter IDs are global (but also implementation-specific).
|
inline |
Construct with reference to persistent parameter data.
Find the local volume from a position and direction.
If the position is exactly on one of a volume's faces, the sense of that face is taken to be the side of the surface the track is moving toward, determined by the sign of the dot product of the local direction with the local outward surface normal. The resulting state is logically on that surface, as though it had just crossed into the volume.
To avoid inconsistent logical/physical states, initialization is still prohibited if the track is on a surface and moving exactly tangent to it, since the side of the surface is undefined.
Search for an intersection without a distance limit.
|
inline |
Calculate distance-to-intercept for the next local surface.
The algorithm is:
background_intersect (equivalent of DistanceToIn for Geant4)simple_intersect.complex_intersect.
|
inline |
Local volume ID of the parent canonical volume, if any.
This gives the within-universe implementation volume ID of the canonical volume that "encloses" (i.e., has a level one less than) the given local volume. If the local parent volume is null, then the parent is the placement of the current ORANGE universe as a daughter.
|
inline |
Volume level relative to the "top" canonical volume in the universe.
When representing a Geant4 geometry, this will be zero for the top-level volume, one if it's a volume instance that's been "inlined" into this universe as a volume, two if it's a volume inlined inside that one, etc.
|
inline |
Calculate a lower bound on the distance to a surface in any direction.
For an implicit background volume, search nearby volumes using background_safety, limited by max_dist. Otherwise, calculate simple_safety for the given volume. The result is no larger than max_dist.