Celeritas 0.7+ef734374e
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
celeritas::optical::DetectorAction Class Referencefinal

Record sensitive detector data for optical photons at the end of every step. More...

#include <DetectorAction.hh>

Inheritance diagram for celeritas::optical::DetectorAction:
Inheritance graph
[legend]

Public Types

Type aliases
using SPActionRegistry = std::shared_ptr< ActionRegistry >
 
using SPAuxParamsRegistry = std::shared_ptr< AuxParamsRegistry >
 
using CallbackFunc = inp::OpticalDetector::HitCallbackFunc
 
- Public Types inherited from celeritas::ActionTypeTraits< P, S >
using CoreParams = P
 
using CoreStateHost = S< MemSpace::host >
 
using CoreStateDevice = S< MemSpace::device >
 
using SpanCoreStateHost = Span< S< MemSpace::host > *const >
 
using SpanCoreStateDevice = Span< S< MemSpace::device > *const >
 
- Public Types inherited from celeritas::AuxParamsInterface
using UPState = std::unique_ptr< AuxStateInterface >
 Default destructor.
 

Public Member Functions

 DetectorAction (ActionId, AuxId, CallbackFunc const &)
 Construct with action ID, aux ID, and callback function.
 
void step (CoreParams const &, CoreStateHost &) const final
 Launch the detector action on host.
 
void step (CoreParams const &, CoreStateDevice &) const final
 Launch the detector action on device.
 
StepActionOrder order () const final
 Dependency ordering of the action.
 
Action interface
ActionId action_id () const final
 ID of the action.
 
std::string_view label () const final
 Short name for the action (also satisfies AuxParamsInterface::label)
 
std::string_view description () const final
 Description of the action.
 
Aux interface
AuxId aux_id () const final
 Index of this class instance in its registry.
 
UPState create_state (MemSpace, StreamId, size_type) const final
 Build auxiliary state data for a stream.
 
- Public Member Functions inherited from celeritas::StepActionInterface< P, S >
virtual void step (P const &, S< MemSpace::host > &) const =0
 Execute the action with host data.
 
virtual void step (P const &, S< MemSpace::device > &) const =0
 Execute the action with device data.
 
- Public Member Functions inherited from celeritas::ActionInterface
virtual ~ActionInterface () noexcept=0
 Default destructor.
 
- Public Member Functions inherited from celeritas::AuxParamsInterface
virtual ~AuxParamsInterface ()
 Default destructor.
 

Static Public Member Functions

static std::shared_ptr< DetectorActionmake_and_insert (SPActionRegistry const &, SPAuxParamsRegistry const &, CallbackFunc const &)
 Create and add to optical params.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::ActionInterface
 ActionInterface (ActionInterface const &)=default
 
ActionInterfaceoperator= (ActionInterface const &)=default
 
 ActionInterface (ActionInterface &&)=default
 
ActionInterfaceoperator= (ActionInterface &&)=default
 
- Protected Member Functions inherited from celeritas::AuxParamsInterface
 AuxParamsInterface ()=default
 
 AuxParamsInterface (AuxParamsInterface const &)=default
 Default destructor.
 
AuxParamsInterfaceoperator= (AuxParamsInterface const &)=default
 Default destructor.
 
 AuxParamsInterface (AuxParamsInterface &&)=default
 Default destructor.
 
AuxParamsInterfaceoperator= (AuxParamsInterface &&)=default
 Default destructor.
 

Detailed Description

Record sensitive detector data for optical photons at the end of every step.

The DetectorExecutor is responsible for copying hit data for every photon into the state buffer at the end of every step on a kernel level. Even if a track was not in a detector, it is still copied into the state buffer with an invalid detector ID. All hits are copied into a persistent pinned-memory buffer (allocated once as auxiliary state, sized to the number of track slots), where invalid hits are pruned by slicing a span over the valid prefix. A span of only valid hits is then passed into the user provided callback function.

Member Function Documentation

◆ action_id()

ActionId celeritas::optical::DetectorAction::action_id ( ) const
inlinefinalvirtual

ID of the action.

Implements celeritas::ActionInterface.

◆ aux_id()

AuxId celeritas::optical::DetectorAction::aux_id ( ) const
inlinefinalvirtual

Index of this class instance in its registry.

Implements celeritas::AuxParamsInterface.

◆ create_state()

auto celeritas::optical::DetectorAction::create_state ( MemSpace  m,
StreamId  ,
size_type  size 
) const
finalvirtual

Build auxiliary state data for a stream.

The pinned hit buffer is allocated and sized here once per stream so that step and load_hits_sync never need to reallocate.

Implements celeritas::AuxParamsInterface.

◆ description()

std::string_view celeritas::optical::DetectorAction::description ( ) const
inlinefinalvirtual

Description of the action.

Implements celeritas::ActionInterface.

◆ label()

std::string_view celeritas::optical::DetectorAction::label ( ) const
inlinefinalvirtual

Short name for the action (also satisfies AuxParamsInterface::label)

Implements celeritas::ActionInterface.

◆ order()

StepActionOrder celeritas::optical::DetectorAction::order ( ) const
inlinefinalvirtual

Dependency ordering of the action.

Implements celeritas::StepActionInterface< P, S >.


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