37 G4StepPoint* preStep = aStep->GetPreStepPoint();
38 const G4VTouchable* preTouchable = preStep->GetTouchable();
39 G4StepPoint* postStep = aStep->GetPostStepPoint();
40 const G4VTouchable* postTouchable = postStep->GetTouchable();
41 int preDepth = preTouchable->GetHistoryDepth();
42 int postDepth = postTouchable->GetHistoryDepth();
45 bool preInStation =
false;
46 for (
int i = 0; i < preDepth+1; i++) {
47 preName = preTouchable->GetVolume(i)->GetName();
48 if (preName.find(
"station") != std::string::npos ||
49 preName.find(
"av_") != std::string::npos) {
56 bool postOutofStation =
true;
57 bool outOfMother =
false;
58 for (
int i = 0; i < postDepth+1; i++) {
59 if (postTouchable->GetVolume(i) != 0) {
60 postName = postTouchable->GetVolume(i)->GetName();
65 if (postName.find(
"station") != std::string::npos ||
66 postName.find(
"av_") != std::string::npos) {
68 postOutofStation =
false;
72 if ( (preInStation && postOutofStation) || outOfMother ) {
73 aStep->GetTrack()->SetTrackStatus(fStopAndKill);