|
Celeritas 0.7-develop+fa62b79
|
Record sensitive detector data for optical photons at the end of every step. More...
#include <DetectorAction.hh>

Public Types | |
Type aliases | |
| using | SPActionRegistry = std::shared_ptr< ActionRegistry > |
| using | SPAuxParamsRegistry = std::shared_ptr< AuxParamsRegistry > |
| using | CallbackFunc = inp::OpticalDetector::HitCallbackFunc |
| using | Hits = AsyncCompactedCopy< DetectorHit > |
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. | |
| void | end_transport (CoreParams const &, CoreStateHost &) const final |
| Host hits are processed during the step. | |
| void | end_transport (CoreParams const &, CoreStateDevice &) const final |
| Process the hits remaining from device in step order. | |
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::EndTransportActionInterface< P, S > | |
| virtual void | end_transport (P const &, S< MemSpace::host > &) const =0 |
| Complete buffered work with host data. | |
| virtual void | end_transport (P const &, S< MemSpace::device > &) const =0 |
| Complete buffered work with device data. | |
Public Member Functions inherited from celeritas::AuxParamsInterface | |
| virtual | ~AuxParamsInterface () |
| Default destructor. | |
Static Public Member Functions | |
| static std::shared_ptr< DetectorAction > | make_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 | |
| ActionInterface & | operator= (ActionInterface const &)=default |
| ActionInterface (ActionInterface &&)=default | |
| ActionInterface & | operator= (ActionInterface &&)=default |
Protected Member Functions inherited from celeritas::AuxParamsInterface | |
| AuxParamsInterface ()=default | |
| AuxParamsInterface (AuxParamsInterface const &)=default | |
| Default destructor. | |
| AuxParamsInterface & | operator= (AuxParamsInterface const &)=default |
| Default destructor. | |
| AuxParamsInterface (AuxParamsInterface &&)=default | |
| Default destructor. | |
| AuxParamsInterface & | operator= (AuxParamsInterface &&)=default |
| Default destructor. | |
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. On the host, the invalid hits are pruned in place, and a span of only valid hits is then passed into the user provided callback function.
On device, the valid hits are compacted into device scratch space and only those are copied to pinned host memory on the memcpy stream, using AsyncCompactedCopy . Since the optical transport loop waits for each step before starting the next, the hits of a step are copied while the next step runs and processed during the step after. The remaining hits are processed by end_transport , so the callback is called for every step, in order, before transport returns.
|
inlinefinalvirtual |
ID of the action.
Implements celeritas::ActionInterface.
|
inlinefinalvirtual |
Index of this class instance in its registry.
Implements celeritas::AuxParamsInterface.
|
finalvirtual |
Build auxiliary state data for a stream.
The device scratch and pinned hit buffers are allocated and sized here once per stream so that step never needs to reallocate.
Implements celeritas::AuxParamsInterface.
|
inlinefinalvirtual |
Description of the action.
Implements celeritas::ActionInterface.
|
inlinefinalvirtual |
Short name for the action (also satisfies AuxParamsInterface::label)
Implements celeritas::ActionInterface.
|
inlinefinalvirtual |
Dependency ordering of the action.
Implements celeritas::StepActionInterface< P, S >.