Celeritas
0.5.0-86+4a8eea4
|
Manage offloading of tracks to Celeritas. More...
#include <LocalTransporter.hh>
Public Types | |
Type aliases | |
using | MapStrReal = std::unordered_map< std::string, real_type > |
Public Member Functions | |
LocalTransporter (SetupOptions const &options, SharedParams ¶ms) | |
Construct with shared (MT) params. More... | |
void | Initialize (SetupOptions const &options, SharedParams ¶ms) |
Helper for making initialization more obvious from user code. More... | |
void | SetEventId (int id) |
void | InitializeEvent (int) |
Set the event ID and reseed the Celeritas RNG at the start of an event. | |
void | Push (G4Track const &) |
Convert a Geant4 track to a Celeritas primary and add to buffer. More... | |
void | Flush () |
Transport the buffered tracks and all secondaries produced. More... | |
void | Finalize () |
Clear local data. More... | |
MapStrReal | GetActionTime () const |
Get the accumulated action times. | |
size_type | GetBufferSize () const |
operator bool () const | |
Whether the class instance is initialized. | |
Manage offloading of tracks to Celeritas.
This class must be constructed locally on each worker thread/task/stream, usually as a shared pointer that's accessible to:
LocalOffload
or something? celeritas::LocalTransporter::LocalTransporter | ( | SetupOptions const & | options, |
SharedParams & | params | ||
) |
Construct with shared (MT) params.
state.ref()
.geometry.reset() on the local transporter thread due to thread-allocated navigator data. void celeritas::LocalTransporter::Finalize | ( | ) |
Clear local data.
This may need to be executed on the same thread it was created in order to safely deallocate some Geant4 objects under the hood...
void celeritas::LocalTransporter::Flush | ( | ) |
Transport the buffered tracks and all secondaries produced.
Abort cleanly for interrupt and user-defined (i.e., job manager) signals.
|
inline |
Helper for making initialization more obvious from user code.
This gives it some symmetry with Finalize, which is provided as an exception-friendly destructor.
void celeritas::LocalTransporter::Push | ( | G4Track const & | g4track | ) |