LDMX Software
simcore::g4user::EventAction Class Reference

Implementation of user event action hook. More...

#include <EventAction.h>

Public Member Functions

 EventAction ()=default
 Class constructor.
 
virtual ~EventAction ()=default
 Class destructor.
 
void BeginOfEventAction (const G4Event *event) override
 Implementation of begin of event hook.
 
void EndOfEventAction (const G4Event *event) override
 Implementation of end of event hook.
 
void registerAction (std::shared_ptr< UserAction > eventAction)
 Register a user action of type EventAction with this class.
 

Private Attributes

std::vector< std::shared_ptr< UserAction > > event_actions_
 

Detailed Description

Implementation of user event action hook.

Definition at line 44 of file EventAction.h.

Member Function Documentation

◆ BeginOfEventAction()

void simcore::g4user::EventAction::BeginOfEventAction ( const G4Event * event)
override

Implementation of begin of event hook.

Parameters
eventThe Geant4 event.

Definition at line 22 of file EventAction.cxx.

22 {
23 // Clear the global track map.
25
26 // Call user event actions
27 for (auto& event_action : event_actions_) {
28 event_action->beginOfEventAction(event);
29 }
30}
void clear()
Clear the internal maps.
Definition TrackMap.cxx:128
TrackMap & getTrackMap()
Get a handle to the current TrackMap for the event.
static TrackingAction * get()
Get a pointer to the current UserTrackingAction from the G4RunManager.

References simcore::TrackMap::clear(), simcore::g4user::TrackingAction::get(), and simcore::g4user::TrackingAction::getTrackMap().

◆ EndOfEventAction()

void simcore::g4user::EventAction::EndOfEventAction ( const G4Event * event)
override

Implementation of end of event hook.

Parameters
eventThe Geant4 event.

Definition at line 32 of file EventAction.cxx.

32 {
33 // Call user event actions
34 for (auto& event_action : event_actions_) {
35 event_action->endOfEventAction(event);
36 }
37}

◆ registerAction()

void simcore::g4user::EventAction::registerAction ( std::shared_ptr< UserAction > eventAction)
inline

Register a user action of type EventAction with this class.

Parameters
actionUser action of type EventAction

Definition at line 73 of file EventAction.h.

73 {
74 event_actions_.push_back(eventAction);
75 }

Member Data Documentation

◆ event_actions_

std::vector<std::shared_ptr<UserAction> > simcore::g4user::EventAction::event_actions_
private

Definition at line 78 of file EventAction.h.


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