LDMX Software
EventAction.h
Go to the documentation of this file.
1
7#ifndef SIMCORE_G4USER_EVENTACTION_H
8#define SIMCORE_G4USER_EVENTACTION_H
9
10/*~~~~~~~~~~~~~~~~*/
11/* C++ StdLib */
12/*~~~~~~~~~~~~~~~~*/
13#include <vector>
14
15/*~~~~~~~~~~~~*/
16/* Geant4 */
17/*~~~~~~~~~~~~*/
18#include "G4UserEventAction.hh"
19
20/*~~~~~~~~~~~~~*/
21/* SimCore */
22/*~~~~~~~~~~~~~*/
23#include "SimCore/UserAction.h"
24
25// Forward declarations
26class G4Event;
27
28namespace simcore {
29
38namespace g4user {
39
44class EventAction : public G4UserEventAction {
45 public:
49 EventAction() = default;
50
54 virtual ~EventAction() = default;
55
60 void BeginOfEventAction(const G4Event* event);
61
66 void EndOfEventAction(const G4Event* event);
67
73 void registerAction(UserAction* eventAction) {
74 eventActions_.push_back(eventAction);
75 }
76
77 private:
78 std::vector<UserAction*> eventActions_;
79
80}; // EventAction
81
82} // namespace g4user
83} // namespace simcore
84
85#endif // SIMCORE_G4USER_EVENTACTION_H
Interface that defines a user action.
Definition UserAction.h:42
Implementation of user event action hook.
Definition EventAction.h:44
virtual ~EventAction()=default
Class destructor.
EventAction()=default
Class constructor.
void registerAction(UserAction *eventAction)
Register a user action of type EventAction with this class.
Definition EventAction.h:73
void BeginOfEventAction(const G4Event *event)
Implementation of begin of event hook.
void EndOfEventAction(const G4Event *event)
Implementation of end of event hook.
This namespace is meant to contain all the standard user actions that allow a Geant4 user to interfac...