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

Handles event begin/end callbacks, hit digitization, and event-level publication. More...

#include <gEventAction.h>

Public Member Functions

 GEventAction (const std::shared_ptr< GOptions > &gopt, GRunAction *run_a, std::shared_ptr< GTrackProvenance > provenance=nullptr)
 Constructs the event action.
 
 ~GEventAction () override=default
 
 GEventAction (const GEventAction &)=delete
 
GEventActionoperator= (const GEventAction &)=delete
 
 GEventAction (GEventAction &&)=delete
 
GEventActionoperator= (GEventAction &&)=delete
 
void BeginOfEventAction (const G4Event *event) override
 Called by Geant4 at the beginning of an event.
 
void EndOfEventAction (const G4Event *event) override
 Called by Geant4 at the end of an event.
 
- Public Member Functions inherited from GBase< GEventAction >
 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< GEventAction >
std::shared_ptr< GLoggerlog
 

Detailed Description

This class is the worker-side event action used by GEMC. It participates in the per-event lifecycle driven by Geant4 and is responsible for transforming hit collections into GEMC data products.

The event processing workflow implemented here is:

  • begin-of-event logging and lightweight tracing;
  • retrieval of the event hit collections at end of event;
  • lookup of the digitization routine associated with each collection name;
  • conversion of hits into digitized payload and true-information payload;
  • storage of event-mode output in the event data collection;
  • storage of run-mode output in the run-level collection owned by GRunAction;
  • publication of completed event data through the worker-thread streamers.

Ownership:

  • The shared configuration object is retained by shared ownership.
  • The run_action pointer is non-owning and is expected to remain valid for the lifetime of the worker-thread action set created by GAction.

Definition at line 108 of file gEventAction.h.

Constructor & Destructor Documentation

◆ GEventAction() [1/3]

GEventAction::GEventAction ( const std::shared_ptr< GOptions > & gopt,
GRunAction * run_a,
std::shared_ptr< GTrackProvenance > provenance = nullptr )
explicit
Parameters
goptShared configuration object used for event-product construction and logging.
run_aNon-owning pointer to the thread-local GRunAction instance that provides access to digitization routines, run-level accumulation, and streamers.
provenanceWorker-local track registry shared with the tracking action, or null when disabled.

Definition at line 88 of file gEventAction.cc.

◆ ~GEventAction()

GEventAction::~GEventAction ( )
overridedefault

◆ GEventAction() [2/3]

GEventAction::GEventAction ( const GEventAction & )
delete

◆ GEventAction() [3/3]

GEventAction::GEventAction ( GEventAction && )
delete

Member Function Documentation

◆ BeginOfEventAction()

void GEventAction::BeginOfEventAction ( const G4Event * event)
override

In this implementation, the method is mainly used for event/thread tracing and lightweight diagnostics.

Parameters
eventGeant4 event descriptor for the event being started.

Definition at line 158 of file gEventAction.cc.

◆ EndOfEventAction()

void GEventAction::EndOfEventAction ( const G4Event * event)
override

This method performs the main event-processing logic of the module:

  • count the event in the run-level bookkeeping;
  • retrieve the hit collections associated with the event;
  • resolve the proper digitization routine for each collection;
  • digitize each hit and collect its truth information;
  • route produced payload to event-mode or run-mode accumulation depending on the digitizer collection mode;
  • publish the event data once all event-mode collections have been processed.
Parameters
eventGeant4 event descriptor for the event being completed.

Definition at line 170 of file gEventAction.cc.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

GEventAction & GEventAction::operator= ( GEventAction && )
delete

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