Celeritas
0.5.0-56+6b053cd
|
Navigate through an ORANGE geometry on a single thread. More...
#include <OrangeTrackView.hh>
Classes | |
struct | DetailedInitializer |
Helper struct for initializing from an existing geometry state. More... | |
Public Types | |
Type aliases | |
using | ParamsRef = NativeCRef< OrangeParamsData > |
using | StateRef = NativeRef< OrangeStateData > |
using | Initializer_t = GeoTrackInitializer |
Public Member Functions | |
CELER_FUNCTION | OrangeTrackView (ParamsRef const ¶ms, StateRef const &states, TrackSlotId tid) |
Construct from persistent and state data. | |
CELER_FUNCTION OrangeTrackView & | operator= (Initializer_t const &init) |
Construct the state. More... | |
CELER_FUNCTION OrangeTrackView & | operator= (DetailedInitializer const &init) |
Construct the state from a direction and a copy of the parent state. | |
CELER_FUNCTION Real3 const & | pos () const |
The current position. | |
CELER_FUNCTION Real3 const & | dir () const |
The current direction. | |
CELER_FUNCTION VolumeId | volume_id () const |
The current volume ID. More... | |
CELER_FUNCTION VolumeInstanceId | volume_instance_id () const |
The current volume instance. More... | |
CELER_FUNCTION LevelId const & | level () const |
The current level. | |
CELER_FUNCTION void | volume_instance_id (Span< VolumeInstanceId >) const |
Get the volume instance ID at every level. More... | |
CELER_FUNCTION SurfaceId | surface_id () const |
The current surface ID. | |
CELER_FUNCTION SurfaceId | next_surface_id () const |
After 'find_next_step', the next straight-line surface. | |
CELER_FUNCTION bool | is_outside () const |
Whether the track is outside the valid geometry region. | |
CELER_FUNCTION bool | is_on_boundary () const |
Whether the track is exactly on a surface. | |
CELER_FORCEINLINE_FUNCTION bool | failed () const |
Whether the last operation resulted in an error. | |
CELER_FUNCTION Propagation | find_next_step () |
Find the distance to the next geometric boundary. | |
CELER_FUNCTION Propagation | find_next_step (real_type max_step) |
Find a nearby distance to the next geometric boundary up to a distance. More... | |
CELER_FUNCTION real_type | find_safety () |
Find the distance to the nearest boundary in any direction. More... | |
CELER_FUNCTION real_type | find_safety (real_type max_step) |
Find the distance to the nearest nearby boundary. More... | |
CELER_FUNCTION void | move_to_boundary () |
Move to the next straight-line boundary but do not change volume. | |
CELER_FUNCTION void | move_internal (real_type step) |
Move within the current volume. More... | |
CELER_FUNCTION void | move_internal (Real3 const &pos) |
Move within the current volume to a nearby point. More... | |
CELER_FUNCTION void | cross_boundary () |
Cross from one side of the current surface to the other. More... | |
CELER_FUNCTION void | set_dir (Real3 const &newdir) |
Change the track's direction. More... | |
Navigate through an ORANGE geometry on a single thread.
Ordering requirements:
find_next_step
find_safety
or move_internal
or move_to_boundary
cross_boundary
set_dir
, but then must do find_next_step
before any move
or cross
action aboveThe main point is that find_next_step
depends on the current straight-line direction, move_to_boundary
and move_internal
(with a step length) depends on that distance, and cross_boundary
depends on being on the boundary with a knowledge of the post-boundary state.
move_internal
with a position should depend on the safety distance but that's not yet implemented.
|
inline |
Cross from one side of the current surface to the other.
The position must be on the boundary following a move-to-boundary. This should only be called once per boundary crossing.
|
inline |
Find a nearby distance to the next geometric boundary up to a distance.
This may reduce the number of surfaces needed to check, sort, or write to temporary memory, thereby speeding up transport.
|
inline |
Find the distance to the nearest boundary in any direction.
The safety distance at a given point is the minimum safety distance over all levels, since surface deduplication can potentionally elide bounding surfaces at more deeply embedded levels.
|
inline |
Find the distance to the nearest nearby boundary.
Since we currently support only "simple" safety distances, we can't eliminate anything by checking only nearby surfaces.
|
inline |
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.
Expensive. This function should only be called to initialize an event from a starting location and direction. Secondaries will initialize their states from a copy of the parent.
|
inline |
Change the track's direction.
This happens after a scattering event or movement inside a magnetic field. It resets the calculated distance-to-boundary. It is allowed to happen on the boundary, but changing direction so that it goes from pointing outward to inward (or vice versa) will mean that cross_boundary
will be a null-op.
TODO: This needs to be updated to handle reflections through levels
|
inline |
The current volume ID.
|
inline |
The current volume instance.
|
inline |
Get the volume instance ID at every level.
The input span size must be equal to the value of "level" plus one. The top-most level ("world" or level zero) starts at index zero and moves downward. Note that Geant4 uses the reverse nomenclature.