Celeritas 0.7.0-dev.242+develop.62c3034b
Loading...
Searching...
No Matches
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

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

Detailed Description

Helper class to create views from core track data.

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

Constructor & Destructor Documentation

◆ CoreTrackView()

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()

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()

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()

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()

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()

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: