LDMX Software
RunAction.h
1
7#ifndef SIMCORE_G4USER_RUNACTION_H
8#define SIMCORE_G4USER_RUNACTION_H
9
10/*~~~~~~~~~~~~~~~~*/
11/* C++ StdLib */
12/*~~~~~~~~~~~~~~~~*/
13#include <vector>
14
15/*~~~~~~~~~~~~*/
16/* Geant4 */
17/*~~~~~~~~~~~~*/
18#include "G4UserRunAction.hh"
19
20/*~~~~~~~~~~~~~*/
21/* SimCore */
22/*~~~~~~~~~~~~~*/
23#include "SimCore/UserAction.h"
24
25// Forward declarations
26class G4Run;
27
28namespace simcore {
29namespace g4user {
34class RunAction : public G4UserRunAction {
35 public:
39 RunAction() = default;
40
44 virtual ~RunAction() = default;
45
50 void BeginOfRunAction(const G4Run* run);
51
56 void EndOfRunAction(const G4Run* run);
57
63 void registerAction(UserAction* runAction) {
64 runActions_.push_back(runAction);
65 }
66
67 private:
68 std::vector<UserAction*> runActions_;
69
70}; // RunAction
71
72} // namespace g4user
73} // namespace simcore
74
75#endif // SIMCORE_G4USER_RUNACTION_H
Interface that defines a user action.
Definition UserAction.h:42
Implementation of user run action hook.
Definition RunAction.h:34
RunAction()=default
Class constructor.
void registerAction(UserAction *runAction)
Register a user action of type RunAction with this class.
Definition RunAction.h:63
void EndOfRunAction(const G4Run *run)
Implementation of end run hook.
Definition RunAction.cxx:24
void BeginOfRunAction(const G4Run *run)
Implementation of begin run hook.
Definition RunAction.cxx:17
virtual ~RunAction()=default
Class destructor.
This namespace is meant to contain all the standard user actions that allow a Geant4 user to interfac...