LDMX Software
Public Member Functions | Private Attributes | List of all members
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 (UserAction *eventAction)
 Register a user action of type EventAction with this class.
 

Private Attributes

std::vector< UserAction * > eventActions_
 

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 25 of file EventAction.cxx.

25 {
26 // Clear the global track map.
28
29 // Call user event actions
30 for (auto& eventAction : eventActions_) {
31 eventAction->BeginOfEventAction(event);
32 }
33}
void clear()
Clear the internal maps.
Definition TrackMap.cxx:126
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 35 of file EventAction.cxx.

35 {
36 // Call user event actions
37 for (auto& eventAction : eventActions_) {
38 eventAction->EndOfEventAction(event);
39 }
40}

◆ registerAction()

void simcore::g4user::EventAction::registerAction ( 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 eventActions_.push_back(eventAction);
75 }

Member Data Documentation

◆ eventActions_

std::vector<UserAction*> simcore::g4user::EventAction::eventActions_
private

Definition at line 78 of file EventAction.h.


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