#include <SensitiveDetector.hh>
Public Member Functions | |
SensitiveDetector (G4String SDname) | |
~SensitiveDetector () | |
G4bool | ProcessHits (G4Step *step, G4TouchableHistory *ROhist) |
Private Attributes | |
DetectorConstruction * | m_detector |
RunAction * | m_runAction |
Definition at line 8 of file SensitiveDetector.hh.
SensitiveDetector::SensitiveDetector | ( | G4String | SDname | ) |
Definition at line 9 of file SensitiveDetector.cc.
00010 : G4VSensitiveDetector(SDname) 00011 { 00012 // -- obtain detector construction and run action pointers through the run manager 00013 m_detector = (DetectorConstruction*)(G4RunManager::GetRunManager()->GetUserDetectorConstruction()); 00014 m_runAction = (RunAction*)(G4RunManager::GetRunManager()->GetUserRunAction()); 00015 }
SensitiveDetector::~SensitiveDetector | ( | ) |
G4bool SensitiveDetector::ProcessHits | ( | G4Step * | step, | |
G4TouchableHistory * | ROhist | |||
) |
Definition at line 20 of file SensitiveDetector.cc.
00021 { 00022 // -- step in garanteed to be is astronaut's volume : no need to check for volume 00023 00024 G4TouchableHandle touchable = step->GetPreStepPoint()->GetTouchableHandle(); 00025 // energy deposit in this step 00026 G4double edep = step->GetTotalEnergyDeposit(); 00027 00028 if (edep <= 0.) return false; 00029 00030 // get step points in world coordinate system 00031 G4ThreeVector point1 = step->GetPreStepPoint()->GetPosition(); 00032 G4ThreeVector point2 = step->GetPostStepPoint()->GetPosition(); 00033 00034 // randomize point of energy deposition 00035 G4ThreeVector pointE = point1 + G4UniformRand()*(point2 - point1); 00036 // transform it in local coordinate system 00037 G4ThreeVector localPointE 00038 = touchable->GetHistory()->GetTopTransform().TransformPoint(pointE); 00039 00040 // extract z and offset 00041 G4double zLocal = 0.5*(m_detector->GetAstronautHeight()) - localPointE.z(); 00042 00043 // sum edep in RunAction (in SD vector): 00044 m_runAction->SumDepthDoseSD(zLocal,edep); 00045 00046 return true; 00047 00048 00049 // ******************************************************************** 00050 // SteppingAction code 00051 /* --->> 00052 00053 // in which volume is the step ? 00054 G4TouchableHandle touchable = step->GetPreStepPoint()->GetTouchableHandle(); 00055 G4VPhysicalVolume* volume = touchable->GetVolume(); 00056 00057 // energy deposit in this step 00058 G4double edep = step->GetTotalEnergyDeposit(); 00059 00060 // is astronaut ? 00061 if (volume == m_detector->GetAstronaut()) { 00062 ////G4cout << "--> edep in astronaut : " << edep/keV << " keV" << G4endl; 00063 00064 // sum edep in EventAction 00065 m_eventAction->AddEdep(edep); 00066 00067 //---------for depth dose distribution--------------------------------------- 00068 00069 // get step points in world coordinate system 00070 G4ThreeVector point1 = step->GetPreStepPoint()->GetPosition(); 00071 G4ThreeVector point2 = step->GetPostStepPoint()->GetPosition(); 00072 00073 // randomize point of energy deposition 00074 G4ThreeVector pointE = point1 + G4UniformRand()*(point2 - point1); 00075 // transform it in local coordinate system 00076 G4ThreeVector localPointE 00077 = touchable->GetHistory()->GetTopTransform().TransformPoint(pointE); 00078 00079 // extract z and offset 00080 G4double zLocal = 0.5*(m_detector->GetAstronautHeight()) - localPointE.z(); 00081 00082 // sum edep in RunAction 00083 m_runAction->SumDepthDose(zLocal,edep); 00084 00085 //----------end of depth dose distribution------------------------------------- 00086 } 00087 00088 <<--- */ 00089 00090 }
Definition at line 23 of file SensitiveDetector.hh.
Referenced by ProcessHits(), and SensitiveDetector().
RunAction* SensitiveDetector::m_runAction [private] |
Definition at line 24 of file SensitiveDetector.hh.
Referenced by ProcessHits(), and SensitiveDetector().