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

Registers GEMC user actions for worker and master threads. More...

#include <gaction.h>

Public Member Functions

 GAction (std::shared_ptr< GOptions > gopts, std::shared_ptr< gdynamicdigitization::dRoutinesMap > digi_map)
 Constructs the action initializer.
 
void Build () const override
 Registers user actions for worker threads (and sequential mode).
 
void BuildForMaster () const override
 Registers user actions for the master thread.
 
- 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 class (G4VUserActionInitialization) to instantiate user action objects. These action objects are typically thread-local:

  • Build() is invoked for worker threads and also for sequential mode.
  • BuildForMaster() is invoked for the master thread, and is commonly used to register only the run action.

This class holds:

  • A shared pointer to GOptions, used by the constructed actions to read runtime configuration.
  • A shared pointer to the digitization routines map, used by the run and event actions to digitize hits and publish results.

Definition at line 79 of file gaction.h.

Constructor & Destructor Documentation

◆ GAction()

GAction::GAction ( std::shared_ptr< GOptions > gopts,
std::shared_ptr< gdynamicdigitization::dRoutinesMap > digi_map )
Parameters
goptsShared configuration object used by all actions constructed by this initializer.
digi_mapShared map from sensitive detector / hit collection name to digitization routines.

Definition at line 8 of file gaction.cc.

Member Function Documentation

◆ Build()

void GAction::Build ( ) const
override

Expected registrations include:

  • The primary generator action.
  • The run action.
  • The event action.

The constructed actions receive the shared configuration and digitization map.

Definition at line 22 of file gaction.cc.

◆ BuildForMaster()

void GAction::BuildForMaster ( ) const
override

In multithreaded mode, the master thread typically registers only the run action.

Definition at line 14 of file gaction.cc.


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