Created Run class

This commit is contained in:
Gitea 2018-04-02 23:20:00 +02:00
parent 2cf2d6c10a
commit d4c572cdbd
2 changed files with 61 additions and 0 deletions

30
include/MedtechRun.hh Normal file
View File

@ -0,0 +1,30 @@
//
// MedtechRun.hh
// medtech
//
// Created by Baranyai David on 2018. 04. 02..
//
#ifndef MedtechRun_hh
#define MedtechRun_hh
#include <stdio.h>
#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 */

31
src/MedtechRun.cc Normal file
View File

@ -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<const MedtechRun*>(run);
fEdep += localRun->fEdep;
G4Run::Merge(run);
}
void MedtechRun::AddEdep (G4double edep)
{
fEdep += edep;
}