#include <RunAction.hh>
Public Member Functions | |
RunAction (DetectorConstruction *) | |
~RunAction () | |
void | BeginOfRunAction (const G4Run *) |
void | EndOfRunAction (const G4Run *) |
void | AddEdep (G4double e) |
Private Attributes | |
DetectorConstruction * | m_detector |
G4double | m_edepTotal |
Definition at line 17 of file RunAction.hh.
RunAction::RunAction | ( | DetectorConstruction * | det | ) |
RunAction::~RunAction | ( | ) |
void RunAction::BeginOfRunAction | ( | const G4Run * | run | ) |
Definition at line 30 of file RunAction.cc.
00031 { 00032 G4cout << "### Run " << run->GetRunID() << " start." << G4endl; 00033 00034 //initialize total energy deposit 00035 // 00036 m_edepTotal = 0.; 00037 }
void RunAction::EndOfRunAction | ( | const G4Run * | ) |
Definition at line 41 of file RunAction.cc.
00042 { 00043 // choose printing format 00044 std::ios::fmtflags mode = G4cout.flags(); 00045 G4cout.setf(std::ios::fixed,std::ios::floatfield); 00046 G4int prec = G4cout.precision(3); 00047 00048 //print total energy deposit 00049 // 00050 G4cout 00051 << "\n ---> Total Energy deposited = " << G4BestUnit(m_edepTotal,"Energy") 00052 << G4endl; 00053 00054 //get mass of astronaut 00055 // 00056 G4double mass = m_detector->GetAstronaut()->GetLogicalVolume()->GetMass(); 00057 G4cout << " ---> Mass = " << G4BestUnit(mass,"Mass") << G4endl; 00058 00059 //compute dose 00060 // 00061 G4double dose = m_edepTotal/mass; 00062 G4cout.setf(mode,std::ios::floatfield); 00063 G4cout.precision(5); 00064 G4cout << " ---> Dose = " << G4BestUnit(dose,"Dose") 00065 << " (" << dose/(MeV/kg) << " MeV/kg)" << G4endl; 00066 00067 00068 // restaure default formats 00069 G4cout.setf(mode,std::ios::floatfield); 00070 G4cout.precision(prec); 00071 }
void RunAction::AddEdep | ( | G4double | e | ) | [inline] |
Definition at line 27 of file RunAction.hh.
Referenced by SteppingAction::UserSteppingAction().
00027 { m_edepTotal += e;};
DetectorConstruction* RunAction::m_detector [private] |
G4double RunAction::m_edepTotal [private] |