|
Celeritas 0.7-develop+980877a
|
Navigate through a VecGeom geometry on a single thread. More...
#include <VecgeomTrackView.hh>
Public Types | |
Type aliases | |
| using | Initializer_t = GeoTrackInitializer |
| using | ParamsRef = NativeCRef< VecgeomParamsData > |
| using | StateRef = NativeRef< VecgeomStateData > |
| using | Navigator = celeritas::detail::BVHNavigator |
| using | ImplVolInstanceId = VgVolumeInstanceId |
| using | real_type = vg_real_type |
Public Member Functions | |
| VecgeomTrackView (ParamsRef const &data, StateRef const &stateview, TrackSlotId tid) | |
| Construct from persistent and state data. | |
| VecgeomTrackView & | operator= (Initializer_t const &init) |
| Construct the state. | |
| VolumeId | volume_id () const |
| Get the volume ID in the current cell. | |
| VolumeInstanceId | volume_instance_id () const |
| Get the physical volume ID in the current cell. | |
| VolumeLevelId | volume_level () const |
| Get the depth in the geometry hierarchy. | |
| void | volume_instance_id (Span< VolumeInstanceId > levels) const |
| Get the volume instance ID at each volume level. | |
| template<class F > | |
| void | foreach_volume_path (F &&visit) const |
| Apply the function with the volume instance ID and level. | |
| ImplVolumeId | impl_volume_id () const |
| Get the volume ID in the current cell. | |
| ImplSurfaceId | impl_surface_id () const |
| The current surface frame ID. | |
| ImplSurfaceId | next_impl_surface_id () const |
| After 'find_next_step', the next straight-line surface. | |
| bool | is_outside () const |
| Whether the track is outside the valid geometry region. | |
| bool | is_on_boundary () const |
| Whether the track is on the boundary of a volume. | |
| bool | failed () const |
| Whether the last operation resulted in an error. | |
| Real3 | normal () const |
| Get the surface normal of the boundary the track is currently on. | |
| real_type | push_distance () const |
| Minimum boundary step that is resolvable at the current position. | |
| Propagation | find_next_step (real_type max_step) |
| Find the distance to the next geometric boundary. | |
| real_type | find_safety () |
| Find the safety at the current position. | |
| real_type | find_safety (real_type max_step) |
| Find the safety at the current position up to a maximum distance. | |
| void | move_to_boundary () |
| Move to the next boundary but don't cross yet. | |
| void | move_internal (real_type step) |
| Move within the current volume. | |
| void | move_internal (Real3 const &pos) |
| Move within the current volume to a nearby point. | |
| void | cross_boundary () |
| Cross from one side of the current surface to the other. | |
| void | set_dir (Real3 const &newdir) |
| Change the track's direction. | |
| Real3 const & | pos () const |
| Real3 const & | dir () const |
Static Public Member Functions | |
| static constexpr real_type | extra_push () |
| Minimum push to make sure tracks do not get stuck at boundaries (a physical length, so that it is resolvable in any unit system) | |
| static constexpr real_type | rel_extra_push () |
| Push relative to the largest position component, so that it is not truncated by floating point roundoff far from the origin. | |
| static constexpr real_type | max_extra_push () |
| Maximum push: VecGeom's own boundary push on each step. | |
Navigate through a VecGeom geometry on a single thread.
For a description of ordering requirements, see:
The "next distance" is cached as part of find_next_step, but it is only used when the immediate next call is move_to_boundary.
|
inline |
Cross from one side of the current surface to the other.
The position must be on the boundary following a move-to-boundary.
|
inline |
Find the safety at the current position up to a maximum distance.
The safety within a step is only needed up to the end of the physics step length.
Apply the function with the volume instance ID and level.
This can be used to construct a unique volume instance ID or fill a vector with volume levels. It is performed in global-to-local order.
Move within the current volume to a nearby point.
|
inline |
Move within the current volume.
The straight-line distance must be less than the distance to the boundary.
|
inline |
Construct the state.
If a valid parent ID is provided, the state is constructed from a direction and a copy of the parent state. This is a faster method of creating secondaries from a parent that has just been absorbed, or when filling in an empty track from a parent that is still alive.
Otherwise, the state is initialized from a starting location and direction, which is expensive.
|
inline |
Minimum boundary step that is resolvable at the current position.
A fixed push is lost to roundoff far from the origin (e.g., 1e-13 cm is below one ULP for coordinates beyond ~512 cm), so a zero-length boundary step would not move the track and it could be relocated into the same state forever. The relative push is at least a few machine epsilons so that it is resolvable in single precision, and the push is capped at VecGeom's own boundary push for its precision.
Change the track's direction.
This happens after a scattering event or movement inside a magnetic field. It resets the calculated distance-to-boundary.
|
inline |
Get the physical volume ID in the current cell.
If built with Geant4, this is the canonical volume instance ID. If built with VGDML, this is an "implementation" instance ID.