64{
65 G4Track* theTrack = theStep->GetTrack();
67 G4int pdg = part->GetPDGEncoding();
68
69 if(theTrack->GetCurrentStepNumber() == 1)
71
72 auto trackInformation =
74
75 G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
77
78 G4StepPoint* thePostPoint = theStep->GetPostStepPoint();
80
81 G4OpBoundaryProcessStatus boundaryStatus = Undefined;
82
83
85 {
87 G4int nprocesses = pm->GetProcessListLength();
89 for(G4int i = 0; i < nprocesses; ++i)
90 {
91 if(nullptr != (*pv)[i] && (*pv)[i]->GetProcessName() == "OpBoundary")
92 {
94 break;
95 }
96 }
97 }
98
99 if(theTrack->GetParentID() == 0)
100 {
101
102 auto secondaries = theStep->GetSecondaryInCurrentStep();
103
104
105
106
108 {
109 if(!secondaries->empty())
110 {
111 for(auto & tr : *secondaries)
112 {
113 const G4VProcess* creator = tr->GetCreatorProcess();
114 if(nullptr != creator)
115 {
116 G4int type = creator->GetProcessSubType();
117
118
119
120 if(type >= 12 && type <= 14)
121 {
123 }
124 }
125 }
126 }
127 }
129 theTrack->SetTrackStatus(fStopAndKill);
130 }
131
132 if(nullptr == thePostPV)
133 {
135 return;
136 }
137
138
139 if(pdg == -22)
140 {
141 if(thePrePV->GetName() == "Slab")
142
143 trackInformation->SetForceDrawTrajectory(true);
144 else if(thePostPV->GetName() == "expHall")
145
146 theTrack->SetTrackStatus(fStopAndKill);
147
148
149 auto proc = thePostPoint->GetProcessDefinedStep();
150 if(nullptr != proc && proc->GetProcessName() == "OpAbsorption")
151 {
153 trackInformation->AddTrackStatusFlag(
absorbed);
154 }
157
158 if(thePostPoint->GetStepStatus() == fGeomBoundary)
159 {
160
161
163 {
164 if(boundaryStatus != StepTooSmall)
165 {
166 G4cout << "LXeSteppingAction::UserSteppingAction(): "
167 << "trackID=" << theTrack->GetTrackID()
168 << " parentID=" << theTrack->GetParentID()
169 << " " << part->GetParticleName()
170 << " E(MeV)=" << theTrack->GetKineticEnergy()
171 << "n/ at " << theTrack->GetPosition()
172 << " prePV: " << thePrePV->GetName()
173 << " postPV: " << thePostPV->GetName()
174 << G4endl;
175 G4ExceptionDescription ed;
176 ed << "LXeSteppingAction: "
177 << "No reallocation step after reflection!"
178 << "Something is wrong with the surface normal or geometry";
179 G4Exception("LXeSteppingAction:", "LXeExpl01", JustWarning, ed, "");
180 return;
181 }
182 }
184 switch(boundaryStatus)
185 {
186 case Absorption:
189 break;
190 case Detection:
191
192
193 {
194
195
199 if(pmtSD)
201 trackInformation->AddTrackStatusFlag(
hitPMT);
202 break;
203 }
204 case FresnelReflection:
205 case TotalInternalReflection:
206 case LambertianReflection:
207 case LobeReflection:
208 case SpikeReflection:
209 case BackScattering:
210 trackInformation->IncReflections();
212 break;
213 default:
214 break;
215 }
216 if(thePostPV->GetName() == "sphere")
217 trackInformation->AddTrackStatusFlag(
hitSphere);
218 }
219 }
220}
void SetConvPos(const G4ThreeVector &p)
void IncBoundaryAbsorption()
G4bool ProcessHits_boundary(const G4Step *, G4TouchableHistory *)
G4OpBoundaryProcess * fBoundary
G4OpBoundaryProcessStatus fExpectedNextStatus