Medtech/src/MedtechRunAction.cc

65 lines
1.3 KiB
C++

//
// MedtechRunAction.cc
// medtech
//
// Created by Baranyai David on 2018. 04. 01..
//
#include "MedtechRunAction.hh"
MedtechRunAction::MedtechRunAction() : G4UserRunAction(), fEdep(0.), fEdep2(0.)
{
}
MedtechRunAction::~MedtechRunAction()
{
}
void MedtechRunAction::BeginOfRunAction(const G4Run*)
{
MedtechAnalysis *man = MedtechAnalysis::getInstance();
}
void MedtechRunAction::EndOfRunAction(const G4Run* run)
{
G4int nofEvents = run->GetNumberOfEvent();
if (nofEvents == 0) return;
const MedtechRun* medRun = static_cast<const MedtechRun*>(run);
G4double edepInRuns = medRun->GetEdep();
// Print
//
if (IsMaster()) {
G4cout
<< G4endl
<< "--------------------End of Global Run-----------------------";
MedtechAnalysis *man = MedtechAnalysis::getInstance();
man -> Close();
}
else {
G4cout
<< G4endl
<< "--------------------End of Local Run------------------------";
}
G4cout
<< G4endl
<< " The run consists of " << nofEvents << " edep: "<< edepInRuns/keV
<< G4endl;
}
G4Run* MedtechRunAction::GenerateRun()
{
return new MedtechRun;
}
void MedtechRunAction::AddEdep(G4double edep)
{
fEdep += edep;
fEdep2 += edep*edep;
}