Celeritas 0.7.0-dev.79+develop.b3dc2e108
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::TrackingManagerConstructor Class Referencefinal

Construct a Celeritas tracking manager that offloads EM tracks. More...

#include <TrackingManagerConstructor.hh>

Inheritance diagram for celeritas::TrackingManagerConstructor:
Inheritance graph
[legend]

Public Types

Type aliases
using LocalTransporterFromThread = std::function< LocalTransporter *(int)>
 
using VecG4PD = SetupOptions::VecG4PD
 

Public Member Functions

 TrackingManagerConstructor (SharedParams const *shared, LocalTransporterFromThread get_local)
 Construct name and mode.
 
 TrackingManagerConstructor (TrackingManagerIntegration *tmi)
 Construct from tracking manager integration.
 
void ConstructParticle () override
 Build list of particles to be offloaded.
 
void ConstructProcess () override
 Build and attach tracking manager.
 
SharedParams constshared_params () const
 Get the shared params associated with this TM.
 
LocalTransporterget_local_transporter () const
 Get the local transporter associated with the current thread ID.
 

Detailed Description

Construct a Celeritas tracking manager that offloads EM tracks.

This should be composed with your physics list after it is constructed, before the simulation begins. By default this uses the celeritas::TrackingManagerIntegration helper:

auto* physics_list = new FTFP_BERT;
physics_list->RegisterPhysics(new TrackingManagerConstructor{
Construct a Celeritas tracking manager that offloads EM tracks.
Definition TrackingManagerConstructor.hh:50
static TrackingManagerIntegration & Instance()
Access the public-facing integration singleton.
Definition TrackingManagerIntegration.cc:146

but for manual integration it can be constructed with a function to get a reference to the thread-local LocalTransporter from the Geant4 thread ID:

auto* physics_list = new FTFP_BERT;
physics_list->RegisterPhysics(new TrackingManagerConstructor{
shared_params, [](int){ return &local_transporter; });
SharedParams const * shared_params() const
Get the shared params associated with this TM.
Definition TrackingManagerConstructor.hh:75
Note
If Celeritas is globally disabled, it will not add the track manager. If Celeritas is configured to "kill offload" mode (for testing maximum theoretical performance) then the tracking manager will be added but will not send the tracks to Celeritas: it will simply kill them.

Constructor & Destructor Documentation

◆ TrackingManagerConstructor() [1/2]

celeritas::TrackingManagerConstructor::TrackingManagerConstructor ( SharedParams const shared,
LocalTransporterFromThread  get_local 
)

Construct name and mode.

Error checking is deferred until ConstructProcess.

◆ TrackingManagerConstructor() [2/2]

celeritas::TrackingManagerConstructor::TrackingManagerConstructor ( TrackingManagerIntegration tmi)
explicit

Construct from tracking manager integration.

Since there's only ever one tracking manager integration, we can just use the behind-the-hood objects.

Member Function Documentation

◆ ConstructParticle()

void celeritas::TrackingManagerConstructor::ConstructParticle ( )
override

Build list of particles to be offloaded.

Construct particles before ConstructProcess since any G4ParticleDefinition other than ions and shortlived must be created during Geant4's Pre_Init state.


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