From d4c572cdbd809012f27e601dc64c857de07486fa Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 2 Apr 2018 23:20:00 +0200 Subject: [PATCH] Created Run class --- include/MedtechRun.hh | 30 ++++++++++++++++++++++++++++++ src/MedtechRun.cc | 31 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 include/MedtechRun.hh create mode 100644 src/MedtechRun.cc diff --git a/include/MedtechRun.hh b/include/MedtechRun.hh new file mode 100644 index 0000000..d592b3c --- /dev/null +++ b/include/MedtechRun.hh @@ -0,0 +1,30 @@ +// +// MedtechRun.hh +// medtech +// +// Created by Baranyai David on 2018. 04. 02.. +// + +#ifndef MedtechRun_hh +#define MedtechRun_hh + +#include +#include "G4Run.hh" + +class MedtechRun : public G4Run +{ +public: + MedtechRun(); + virtual ~MedtechRun(); + + virtual void Merge(const G4Run*); + + void AddEdep (G4double edep); + + G4double GetEdep() const { return fEdep; } + +private: + G4double fEdep; +}; + +#endif /* MedtechRun_hh */ diff --git a/src/MedtechRun.cc b/src/MedtechRun.cc new file mode 100644 index 0000000..2d4f5d1 --- /dev/null +++ b/src/MedtechRun.cc @@ -0,0 +1,31 @@ +// +// MedtechRun.cc +// medtech +// +// Created by Baranyai David on 2018. 04. 02.. +// + +#include "MedtechRun.hh" + +MedtechRun::MedtechRun() : G4Run() +{ + fEdep = 0.0; +} + +MedtechRun::~MedtechRun() +{ + +} + +void MedtechRun::Merge(const G4Run* run) +{ + const MedtechRun* localRun = static_cast(run); + fEdep += localRun->fEdep; + + G4Run::Merge(run); +} + +void MedtechRun::AddEdep (G4double edep) +{ + fEdep += edep; +}