00001 // 00002 // $Id: SteppingAction.cc 171 2008-09-17 14:27:03Z maire $ 00003 // 00004 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00005 00006 #include "SteppingAction.hh" 00007 #include "DetectorConstruction.hh" 00008 #include "RunAction.hh" 00009 00010 #include "G4Step.hh" 00011 00012 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00013 00014 SteppingAction::SteppingAction(DetectorConstruction* det, RunAction* run) 00015 :m_detector(det),m_runAction(run) 00016 { } 00017 00018 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00019 00020 SteppingAction::~SteppingAction() 00021 { } 00022 00023 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00024 00025 void SteppingAction::UserSteppingAction(const G4Step* step) 00026 { 00027 // in which volume is the step ? 00028 G4VPhysicalVolume* volume 00029 = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume(); 00030 00031 // energy deposit in this step 00032 G4double edep = step->GetTotalEnergyDeposit(); 00033 00034 // is astronaute ? 00035 if (volume == m_detector->GetAstronaut()) { 00036 G4cout << "--> edep in astronaut : " << edep/keV << " keV" << G4endl; 00037 m_runAction->AddEdep(edep); 00038 } 00039 } 00040 00041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......