From 92aa2e01998205ab1c63ff23e2fe61cf20cf3c41 Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 2 Apr 2018 23:03:35 +0200 Subject: [PATCH] Created basic ActionInitialization class --- include/MedtechActionInitialization.hh | 29 ++++++++++++++++++++ src/MedtechActionInitialization.cc | 37 ++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 include/MedtechActionInitialization.hh create mode 100644 src/MedtechActionInitialization.cc diff --git a/include/MedtechActionInitialization.hh b/include/MedtechActionInitialization.hh new file mode 100644 index 0000000..6f9c785 --- /dev/null +++ b/include/MedtechActionInitialization.hh @@ -0,0 +1,29 @@ +// +// MedtechActionInitialization.hh +// medtech +// +// Created by Baranyai David on 2018. 04. 01.. +// + +#ifndef MedtechActionInitialization_hh +#define MedtechActionInitialization_hh + +#include +#include "G4VUserActionInitialization.hh" +#include "MedtechPrimaryGeneratorAction.hh" +#include "MedtechRunAction.hh" +#include "MedtechEventAction.hh" +#include "MedtechSteppingAction.hh" + + +class MedtechActionInitialization : public G4VUserActionInitialization +{ +public: + MedtechActionInitialization(); + virtual ~MedtechActionInitialization(); + + virtual void BuildForMaster() const; + virtual void Build() const; +}; + +#endif /* MedtechActionInitialization_hh */ diff --git a/src/MedtechActionInitialization.cc b/src/MedtechActionInitialization.cc new file mode 100644 index 0000000..29d506a --- /dev/null +++ b/src/MedtechActionInitialization.cc @@ -0,0 +1,37 @@ +// +// MedtechActionInitialization.cc +// medtech +// +// Created by Baranyai David on 2018. 04. 01.. +// + +#include "MedtechActionInitialization.hh" + +MedtechActionInitialization::MedtechActionInitialization() : G4VUserActionInitialization() +{ + +} + +MedtechActionInitialization::~MedtechActionInitialization() +{ + +} + +void MedtechActionInitialization::BuildForMaster() const +{ + MedtechRunAction* runAction = new MedtechRunAction; + SetUserAction(runAction); +} + +void MedtechActionInitialization::Build() const +{ + SetUserAction(new MedtechPrimaryGeneratorAction); + + MedtechRunAction* runAction = new MedtechRunAction; + SetUserAction(runAction); + + MedtechEventAction* eventAction = new MedtechEventAction(runAction); + SetUserAction(eventAction); + + SetUserAction(new MedtechSteppingAction(eventAction)); +}