44{
45 G4Track* theTrack = theStep->GetTrack();
46
47
50 = G4LogicalVolumeStore::GetInstance()->GetVolume("Target");
52 = G4LogicalVolumeStore::GetInstance()->GetVolume("TestPlane");
53 }
54
55 if (theTrack->GetParentID()==0) {
56
58 = theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
60 theTrack->SetTrackStatus(fStopAndKill);
61 return;
62 }
63 }
64
65
66
67
68 G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
71
73 G4StepPoint* thePostPoint = theStep->GetPostStepPoint();
74
75 if (thePostPoint) {
77 if (thePostPV) thePostLV = thePostPV->GetLogicalVolume();
78 }
79
82
83
84
85
86 G4ThreeVector theMomentumDirection = theTrack->
87 GetDynamicParticle()->GetMomentumDirection();
88
89
90
91
92 theTrack->SetTrackStatus(fStopAndKill);
93 return;
94
95 }
96
97
98
99 auto trackInformation =
101
102 if (trackInformation->GetTrackStatusFlag() !=
reverse) {
104 if ( theTrack-> GetMomentumDirection().z()>0.0 &&
105 theTrack->GetVertexMomentumDirection().z()<0.0 )
106 {
107 trackInformation->SetTrackStatusFlag(
reverse);
108 }
109 }
110 }
111
112
113 if (theTrack->GetTrackStatus() == fAlive) { return; }
114
115 if (thePostPoint->GetProcessDefinedStep() != nullptr) {
116 if (thePostPoint->GetProcessDefinedStep()->GetProcessName() != "Decay")
117 return;
118 }
119
120}
G4LogicalVolume * fTargetVolume
G4LogicalVolume * fTestPlaneVolume