Celeritas  0.5.0-86+4a8eea4
Classes | Public Member Functions | Static Public Member Functions | List of all members
celeritas::VecgeomTrackView Class Reference

Navigate through a VecGeom geometry on a single thread. More...

#include <VecgeomTrackView.hh>

Classes

struct  DetailedInitializer
 Helper struct for initializing from an existing geometry state. More...
 

Public Types

Type aliases
using Initializer_t = GeoTrackInitializer
 
using ParamsRef = NativeCRef< VecgeomParamsData >
 
using StateRef = NativeRef< VecgeomStateData >
 
using Navigator = celeritas::detail::BVHNavigator
 

Public Member Functions

CELER_FUNCTION VecgeomTrackView (ParamsRef const &data, StateRef const &stateview, TrackSlotId tid)
 Construct from persistent and state data.
 
CELER_FUNCTION VecgeomTrackViewoperator= (Initializer_t const &init)
 Construct the state. More...
 
CELER_FUNCTION VecgeomTrackViewoperator= (DetailedInitializer const &init)
 Construct the state from a direction and a copy of the parent state. More...
 
CELER_FUNCTION VolumeId volume_id () const
 Get the volume ID in the current cell.
 
CELER_FUNCTION VolumeInstanceId volume_instance_id () const
 Get the physical volume ID in the current cell.
 
CELER_FUNCTION LevelId level () const
 Get the depth in the geometry hierarchy.
 
CELER_FUNCTION void volume_instance_id (Span< VolumeInstanceId > levels) const
 Get the volume instance ID for all levels>
 
CELER_FORCEINLINE_FUNCTION bool is_outside () const
 Whether the track is outside the valid geometry region.
 
CELER_FORCEINLINE_FUNCTION bool is_on_boundary () const
 Whether the track is on the boundary of a volume.
 
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. More...
 
CELER_FUNCTION Propagation find_next_step (real_type max_step)
 Find the distance to the next geometric boundary.
 
CELER_FUNCTION real_type find_safety ()
 Find the safety at the current position.
 
CELER_FUNCTION real_type find_safety (real_type max_step)
 Find the safety at the current position up to a maximum distance. More...
 
CELER_FUNCTION void move_to_boundary ()
 Move to the next boundary but don't cross yet.
 
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...
 
CELER_FORCEINLINE_FUNCTION Real3 const & pos () const
 
CELER_FORCEINLINE_FUNCTION Real3 const & dir () const
 
CELER_FUNCTION SurfaceId surface_id () const
 

Static Public Member Functions

static CELER_CONSTEXPR_FUNCTION real_type extra_push ()
 A tiny push to make sure tracks do not get stuck at boundaries.
 

Detailed Description

Navigate through a VecGeom geometry on a single thread.

For a description of ordering requirements, see:

See also
OrangeTrackView
VecgeomTrackView geom(vg_params_ref, vg_state_ref, trackslot_id);
CELER_FUNCTION VecgeomTrackView(ParamsRef const &data, StateRef const &stateview, TrackSlotId tid)
Construct from persistent and state data.
Definition: VecgeomTrackView.hh:194

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.

Member Function Documentation

◆ cross_boundary()

CELER_FUNCTION void celeritas::VecgeomTrackView::cross_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.

◆ dir()

CELER_FORCEINLINE_FUNCTION Real3 const& celeritas::VecgeomTrackView::dir ( ) const
inline

State accessors

◆ find_next_step()

CELER_FUNCTION Propagation celeritas::VecgeomTrackView::find_next_step ( )
inline

Find the distance to the next geometric boundary.

This function is allowed to be allowed to be called from the exterior for ray tracing.

◆ find_safety()

CELER_FUNCTION real_type celeritas::VecgeomTrackView::find_safety ( real_type  max_radius)
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.

◆ move_internal() [1/2]

CELER_FUNCTION void celeritas::VecgeomTrackView::move_internal ( Real3 const &  pos)
inline

Move within the current volume to a nearby point.

Warning
It's up to the caller to make sure that the position is "nearby" and within the same volume.

◆ move_internal() [2/2]

CELER_FUNCTION void celeritas::VecgeomTrackView::move_internal ( real_type  dist)
inline

Move within the current volume.

The straight-line distance must be less than the distance to the boundary.

◆ operator=() [1/2]

CELER_FUNCTION VecgeomTrackView & celeritas::VecgeomTrackView::operator= ( DetailedInitializer const &  init)
inline

Construct the state 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.

◆ operator=() [2/2]

CELER_FUNCTION VecgeomTrackView & celeritas::VecgeomTrackView::operator= ( Initializer_t const &  init)
inline

Construct the state.

Expensive. This function should only be called to initialize an event from a starting location and direction, but excess secondaries will also be initialized this way.

◆ pos()

CELER_FORCEINLINE_FUNCTION Real3 const& celeritas::VecgeomTrackView::pos ( ) const
inline

State accessors

◆ set_dir()

CELER_FUNCTION void celeritas::VecgeomTrackView::set_dir ( Real3 const &  newdir)
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.

◆ surface_id()

CELER_FUNCTION SurfaceId celeritas::VecgeomTrackView::surface_id ( ) const
inline

VecGeom states are never "on" a surface


The documentation for this class was generated from the following file: