Celeritas 0.6.0-93+develop.7a7d9941
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
celeritas::optical::PrimaryGeneratorAction Class Referencefinal

Generate optical primaries from user-configurable distributions. More...

#include <PrimaryGeneratorAction.hh>

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

Public Types

Type aliases
using Input = inp::OpticalPrimaryGenerator
 
- 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

 PrimaryGeneratorAction (ActionId, AuxId, GeneratorId, Input)
 Construct with IDs and distribution.
 
template<MemSpace M>
void queue_primaries (CoreState< M > &) const
 Set the number of pending tracks.
 
Aux interface
UPState create_state (MemSpace, StreamId, size_type) const final
 Build state data for a stream.
 
StepAction interface
void step (CoreParams const &, CoreStateHost &) const final
 Execute the action with host data.
 
void step (CoreParams const &, CoreStateDevice &) const final
 Execute the action with device data.
 
- Public Member Functions inherited from celeritas::optical::GeneratorBase
 GeneratorBase (ActionId id, AuxId aux_id, GeneratorId gen_id, std::string_view label, std::string_view description) noexcept(!CELERITAS_DEBUG)
 Construct with IDs, label, and description.
 
template<MemSpace M>
void update_counters (optical::CoreState< M > &) const
 Update the generator and state counters.
 
AuxId aux_id () const final
 Index of this class instance in its registry.
 
ActionId action_id () const final
 ID of the action.
 
std::string_view label () const final
 Short name for the action.
 
std::string_view description () const final
 Description of the action.
 
StepActionOrder order () const final
 Dependency ordering of the action.
 
GeneratorId generator_id () const final
 ID of the generator.
 
GeneratorStateBasecounters (AuxStateVec &) const final
 Get generator counters (mutable).
 
GeneratorStateBase constcounters (AuxStateVec const &) const final
 Get generator counters.
 
- 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.
 
- Public Member Functions inherited from celeritas::GeneratorInterface
virtual ~GeneratorInterface ()
 Default destructor.
 

Static Public Member Functions

static std::shared_ptr< PrimaryGeneratorActionmake_and_insert (::celeritas::CoreParams const &, CoreParams const &, Input &&)
 Construct and add to core params.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::ActionInterface
 CELER_DEFAULT_COPY_MOVE (ActionInterface)
 
- Protected Member Functions inherited from celeritas::AuxParamsInterface
 AuxParamsInterface ()=default
 
 CELER_DEFAULT_COPY_MOVE (AuxParamsInterface)
 Default destructor.
 
- Protected Member Functions inherited from celeritas::GeneratorInterface
 CELER_DEFAULT_COPY_MOVE (GeneratorInterface)
 

Detailed Description

Generate optical primaries from user-configurable distributions.

This reproducibly samples and initializes optical photons directly in track slots.

Constructor & Destructor Documentation

◆ PrimaryGeneratorAction()

celeritas::optical::PrimaryGeneratorAction::PrimaryGeneratorAction ( ActionId  id,
AuxId  aux_id,
GeneratorId  gen_id,
Input  inp 
)

Construct with IDs and distribution.

Todo:
Support multiple events and distribution types

Member Function Documentation

◆ create_state()

auto celeritas::optical::PrimaryGeneratorAction::create_state ( MemSpace  ,
StreamId  ,
size_type   
) const
finalvirtual

Build state data for a stream.

Implements celeritas::AuxParamsInterface.

◆ queue_primaries()

template<MemSpace M>
void celeritas::optical::PrimaryGeneratorAction::queue_primaries ( CoreState< M > &  state) const
inline

Set the number of pending tracks.

The number of tracks to generate must be set at the beginning of each event before the optical loop is launched.

Todo:
Currently this is only called during testing, but it must be done at the beginning of each event once this action is integrated into the stepping loop. Refactor/replace this.

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