actions
Loading...
Searching...
No Matches
GAction Class Reference

Registers GEMC user actions for worker threads, sequential execution, and the master thread. More...

#include <gaction.h>

Public Member Functions

 GAction (std::shared_ptr< GOptions > gopts, std::shared_ptr< gdynamicdigitization::dRoutinesMap > digi_map)
 Constructs the action initializer used by the Geant4 run manager.
 
 ~GAction () override=default
 
 GAction (const GAction &)=delete
 
GActionoperator= (const GAction &)=delete
 
 GAction (GAction &&)=delete
 
GActionoperator= (GAction &&)=delete
 
void Build () const override
 Registers the user actions required by worker threads and sequential execution.
 
void BuildForMaster () const override
 Registers the user actions required by the master thread.
 
std::shared_ptr< std::vector< GparticlePtr > > getSharedParticles () const
 Returns the shared particle list so the pmaker GUI can wire its tabs to the same objects.
 
- Public Member Functions inherited from GBase< GAction >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from GBase< GAction >
std::shared_ptr< GLoggerlog
 

Detailed Description

Geant4 uses an action-initialization object derived from G4VUserActionInitialization to obtain the user actions that will participate in a simulation.

In this module, GAction applies that lifecycle as follows:

This split mirrors the Geant4 execution model:

  • The master thread coordinates the run and can execute run-level hooks.
  • Worker threads execute event processing and therefore require generator and event actions, plus the optional tracking action, in addition to the run action.

Internally, this class stores the shared configuration object and the shared digitization-routine map so that every action created by this initializer receives a consistent view of the runtime configuration.

Definition at line 94 of file gaction.h.

Constructor & Destructor Documentation

◆ GAction() [1/3]

GAction::GAction ( std::shared_ptr< GOptions > gopts,
std::shared_ptr< gdynamicdigitization::dRoutinesMap > digi_map )
explicit
Parameters
goptsShared configuration object used by all actions constructed by this initializer.
digi_mapShared map associating collection names with digitization routines.

Definition at line 12 of file gaction.cc.

◆ ~GAction()

GAction::~GAction ( )
overridedefault

◆ GAction() [2/3]

GAction::GAction ( const GAction & )
delete

◆ GAction() [3/3]

GAction::GAction ( GAction && )
delete

Member Function Documentation

◆ Build()

void GAction::Build ( ) const
override

This method is called by Geant4 when action objects must be created for an execution context that processes events.

The registration order used here is:

The event action receives the run-action instance created in this method so it can access thread-local run services such as digitization-routine lookup and streamer access.

Definition at line 37 of file gaction.cc.

◆ BuildForMaster()

void GAction::BuildForMaster ( ) const
override

In multithreaded execution, the master thread does not process individual events. For that reason, only GRunAction is registered here. That action handles the master-side run lifecycle, including merged run-data publication when needed.

Definition at line 28 of file gaction.cc.

◆ getSharedParticles()

std::shared_ptr< std::vector< GparticlePtr > > GAction::getSharedParticles ( ) const
inline

Definition at line 168 of file gaction.h.

◆ operator=() [1/2]

GAction & GAction::operator= ( const GAction & )
delete

◆ operator=() [2/2]

GAction & GAction::operator= ( GAction && )
delete

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