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

Helper class to create views from core track data. More...

#include <CoreTrackView.hh>

Public Types

Type aliases
using ParamsRef = NativeCRef< CoreParamsData >
 
using StateRef = NativeRef< CoreStateData >
 

Public Member Functions

CELER_FUNCTION CoreTrackView (ParamsRef const &params, StateRef const &states, ThreadId thread)
 Construct with comprehensive param/state data and thread.
 
CELER_FUNCTION CoreTrackView (ParamsRef const &params, StateRef const &states, TrackSlotId slot)
 Construct with comprehensive param/state data and track slot. More...
 
CELER_FUNCTION SimTrackView make_sim_view () const
 Return a simulation management view.
 
CELER_FUNCTION GeoTrackView make_geo_view () const
 Return a geometry view.
 
CELER_FUNCTION GeoMaterialView make_geo_material_view () const
 Return a geometry-material view.
 
CELER_FUNCTION MaterialTrackView make_material_view () const
 Return a material view.
 
CELER_FUNCTION ParticleTrackView make_particle_view () const
 Return a particle view.
 
CELER_FUNCTION ParticleView make_particle_view (ParticleId) const
 Return a particle view of another particle type.
 
CELER_FUNCTION CutoffView make_cutoff_view () const
 Return a cutoff view.
 
CELER_FUNCTION PhysicsTrackView make_physics_view () const
 Return a physics view.
 
CELER_FUNCTION PhysicsStepView make_physics_step_view () const
 Return a physics view.
 
CELER_FUNCTION RngEngine make_rng_engine () const
 Return the RNG engine.
 
CELER_FUNCTION ThreadId thread_id () const
 Get the index of the current thread in the current kernel. More...
 
CELER_FUNCTION TrackSlotId track_slot_id () const
 Get the track's index among the states.
 
CELER_FUNCTION ActionId boundary_action () const
 Get the action ID for encountering a geometry boundary.
 
CELER_FUNCTION ActionId propagation_limit_action () const
 Get the action ID for having to pause the step during propagation. More...
 
CELER_FUNCTION ActionId tracking_cut_action () const
 Get the action ID for killing a track prematurely. More...
 
CELER_FUNCTION CoreScalars const & core_scalars () const
 Get access to all the core scalars. More...
 
CELER_FUNCTION void apply_errored ()
 Set the 'errored' flag and tracking cut post-step action. More...
 

Detailed Description

Helper class to create views from core track data.

TODO: const correctness? (Maybe have to wait till C++23's "deducing this"?)

Todo:
Rename make_sim_view -> sim, etc.

Constructor & Destructor Documentation

◆ CoreTrackView()

CELER_FUNCTION celeritas::CoreTrackView::CoreTrackView ( ParamsRef const &  params,
StateRef const &  states,
TrackSlotId  track_slot 
)
inline

Construct with comprehensive param/state data and track slot.

This signature is used for creating a view of a second track in a kernel for initialization.

Member Function Documentation

◆ apply_errored()

CELER_FUNCTION void celeritas::CoreTrackView::apply_errored ( )
inline

Set the 'errored' flag and tracking cut post-step action.

Precondition
This cannot be applied if the current action is after post-step. (You can't guarantee for example that sensitive detectors will pick up the energy deposition.)

◆ core_scalars()

CELER_FUNCTION CoreScalars const & celeritas::CoreTrackView::core_scalars ( ) const
inline

Get access to all the core scalars.

TODO: maybe have a struct for all actions to simplify the class? (Action view?)

◆ propagation_limit_action()

CELER_FUNCTION ActionId celeritas::CoreTrackView::propagation_limit_action ( ) const
inline

Get the action ID for having to pause the step during propagation.

This could be from an internal limiter (number of substeps during field propagation) or from having to "bump" the track position for some reason (geometry issue). The volume must not change as a result of the propagation, and this should be an extremely rare case.

◆ thread_id()

CELER_FORCEINLINE_FUNCTION ThreadId celeritas::CoreTrackView::thread_id ( ) const
inline

Get the index of the current thread in the current kernel.

Warning
If the kernel calling this function is not applied to all tracks, then comparing against a particular thread ID (e.g. zero for a once-per-kernel initialization) may result in an error.
Precondition
The thread ID is only set if the class is initialized with the thread ID (e.g. from TrackExecutor ), which is not the case in track initialization (where the "core track" is constructed from a vacancy).

◆ tracking_cut_action()

CELER_FUNCTION ActionId celeritas::CoreTrackView::tracking_cut_action ( ) const
inline

Get the action ID for killing a track prematurely.

This unphysical local energy deposition can happen due to:

  • Initialization in an invalid region
  • Looping in a magnetic field
  • A tracking error due to an invalid user geometry or a bug
  • User tracking cuts

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