File indexing completed on 2025-01-18 09:11:37
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "RunAction.hpp"
0010
0011 #include <stdexcept>
0012
0013 #include <G4Run.hh>
0014
0015 #include "EventAction.hpp"
0016
0017 namespace ActsExamples::Geant4::HepMC3 {
0018
0019 RunAction* RunAction::s_instance = nullptr;
0020
0021 RunAction* RunAction::instance() {
0022 return s_instance;
0023 }
0024
0025 RunAction::RunAction() : G4UserRunAction() {
0026 if (s_instance != nullptr) {
0027 throw std::logic_error("Attempted to duplicate the RunAction singleton");
0028 } else {
0029 s_instance = this;
0030 }
0031 }
0032
0033 RunAction::~RunAction() {
0034 s_instance = nullptr;
0035 }
0036
0037 void RunAction::BeginOfRunAction(const G4Run* ) {
0038
0039 EventAction::instance()->clear();
0040 }
0041
0042 void RunAction::EndOfRunAction(const G4Run* ) {}
0043
0044 }