RunAction Class Reference

#include <RunAction.hh>

Inheritance diagram for RunAction:

Inheritance graph
[legend]
Collaboration diagram for RunAction:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 RunAction (DetectorConstruction *)
 ~RunAction ()
void BeginOfRunAction (const G4Run *)
void EndOfRunAction (const G4Run *)
void AddEdep (G4double e)

Private Attributes

DetectorConstructionm_detector
G4double m_edepTotal


Detailed Description

Definition at line 17 of file RunAction.hh.


Constructor & Destructor Documentation

RunAction::RunAction ( DetectorConstruction det  ) 

Definition at line 19 of file RunAction.cc.

00020 :m_detector(det)
00021 { }

RunAction::~RunAction (  ) 

Definition at line 25 of file RunAction.cc.

00026 { }


Member Function Documentation

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;};


Member Data Documentation

Definition at line 27 of file RunAction.hh.

Referenced by EndOfRunAction().

G4double RunAction::m_edepTotal [private]

Definition at line 31 of file RunAction.hh.

Referenced by BeginOfRunAction(), and EndOfRunAction().


The documentation for this class was generated from the following files:

Generated on Fri Nov 21 10:20:26 2008 for jour3b by  doxygen 1.5.7.1