#include <SteppingAction.hh>
Public Member Functions | |
SteppingAction (DetectorConstruction *, RunAction *, EventAction *) | |
~SteppingAction () | |
void | UserSteppingAction (const G4Step *) |
Private Attributes | |
DetectorConstruction * | m_detector |
RunAction * | m_runAction |
EventAction * | m_eventAction |
Definition at line 17 of file SteppingAction.hh.
SteppingAction::SteppingAction | ( | DetectorConstruction * | det, | |
RunAction * | run, | |||
EventAction * | event | |||
) |
Definition at line 17 of file SteppingAction.cc.
00019 :m_detector(det),m_runAction(run),m_eventAction(event) 00020 { }
SteppingAction::~SteppingAction | ( | ) |
void SteppingAction::UserSteppingAction | ( | const G4Step * | step | ) |
Definition at line 29 of file SteppingAction.cc.
00030 { 00031 // in which volume is the step ? 00032 G4TouchableHandle touchable = step->GetPreStepPoint()->GetTouchableHandle(); 00033 G4VPhysicalVolume* volume = touchable->GetVolume(); 00034 00035 // energy deposit in this step 00036 G4double edep = step->GetTotalEnergyDeposit(); 00037 00038 // is astronaut ? 00039 if (volume == m_detector->GetAstronaut()) { 00040 00041 // sum edep in EventAction 00042 m_eventAction->AddEdep(edep); 00043 00044 // get step points in world coordinate system 00045 G4ThreeVector point1 = step->GetPreStepPoint()->GetPosition(); 00046 G4ThreeVector point2 = step->GetPostStepPoint()->GetPosition(); 00047 00048 // randomize point of energy deposition 00049 G4ThreeVector pointE = point1 + G4UniformRand()*(point2 - point1); 00050 // transform it in local coordinate system 00051 G4ThreeVector localPointE 00052 = touchable->GetHistory()->GetTopTransform().TransformPoint(pointE); 00053 00054 // extract z and offset 00055 G4double zLocal = 0.5*(m_detector->GetAstronautHeight()) - localPointE.z(); 00056 00057 // sum edep in RunAction 00058 m_runAction->SumDepthDose(zLocal,edep); 00059 } 00060 }
DetectorConstruction* SteppingAction::m_detector [private] |
RunAction* SteppingAction::m_runAction [private] |
EventAction* SteppingAction::m_eventAction [private] |