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)
 Implementation of begin of event hook.
 
void EndOfEventAction (const G4Event *event)
 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)

Implementation of begin of event hook.

Parameters
eventThe Geant4 event.

Definition at line 23 of file EventAction.cxx.

23 {
24 // Clear the global track map.
26
27 // Call user event actions
28 for (auto& event_action : event_actions_) {
29 event_action->BeginOfEventAction(event);
30 }
31}
void clear()
Clear the internal maps.
Definition TrackMap.cxx:127
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)

Implementation of end of event hook.

Parameters
eventThe Geant4 event.

Definition at line 33 of file EventAction.cxx.

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

◆ 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: