Celeritas 0.7.0-dev.312+develop.818ec9c1
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 LocalOffloadFromThread = std::function< TrackOffloadInterface *(int)>
 
using VecG4PD = std::vector< G4ParticleDefinition * >
 

Public Member Functions

 TrackingManagerConstructor (SharedParams const *shared, LocalOffloadFromThread 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.
 

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:143

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

auto* physics_list = new FTFP_BERT;
physics_list->RegisterPhysics(new TrackingManagerConstructor{
shared_params, [](int){ return &local_transporter; });
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,
LocalOffloadFromThread  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.

Note
When calling from a serial run manager in a threaded G4 build, the thread ID is G4Threading::MASTER_ID (-1). When calling from the run manager of a non-threaded G4 build, the thread is G4Threading::SEQUENTIAL_ID (-2).

Member Function Documentation

◆ ConstructParticle()

void celeritas::TrackingManagerConstructor::ConstructParticle ( )
override

Build list of particles to be offloaded.

Construct particles and determine which to offload.

This is called early in the application, when the physics list is passed to the run manager. It is only called once on a multithreaded run, during Geant4's Pre_Init state.


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