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