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

Handles event begin/end callbacks and triggers digitization + streaming. More...

#include <gEventAction.h>

Public Member Functions

 GEventAction (const std::shared_ptr< GOptions > &gopt, GRunAction *run_a)
 Constructs the event action.
 
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

Responsibilities:

  • At event begin: optionally log event/thread identification.
  • At event end:
    • Retrieve the hit collections for the event.
    • For each hit collection:
      • Resolve the digitization routine associated with the collection name.
      • Convert hits into digitized data and true-information data.
      • Add these products to the event data container.
    • Publish the completed event data to all configured streamers for the thread.

Ownership:

  • The run_action pointer is non-owning; it is expected to remain valid for the lifetime of the thread actions (it is created and registered by GAction).

Definition at line 54 of file gEventAction.h.

Constructor & Destructor Documentation

◆ GEventAction()

GEventAction::GEventAction ( const std::shared_ptr< GOptions > & gopt,
GRunAction * run_a )
Parameters
goptShared configuration used to construct event data containers and control logging.
run_aNon-owning pointer to the thread's GRunAction instance, used to access digitization routines and the streamer map.

Definition at line 11 of file gEventAction.cc.

Member Function Documentation

◆ BeginOfEventAction()

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

Typical usage in this module is logging and lightweight per-event bookkeeping.

Parameters
eventThe Geant4 event descriptor.

Definition at line 20 of file gEventAction.cc.

◆ EndOfEventAction()

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

This method performs the event-level workflow:

  • Collect hit collections.
  • Digitize hits and collect truth information.
  • Publish the resulting event data to streamers.
Parameters
eventThe Geant4 event descriptor.

Definition at line 28 of file gEventAction.cc.


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