109{
110 G4Track* theTrack = theStep->GetTrack();
111 auto trackInformation =
113
114 G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
115 G4StepPoint* thePostPoint = theStep->GetPostStepPoint();
116
119
122
123 if(thePostPV)
124 {
125 thePrePVname = thePrePV->GetName();
126 thePostPVname = thePostPV->GetName();
127 }
128
129
130
131 if(theTrack->GetParentID() == 0)
132 {
133
134 if(theTrack->GetCurrentStepNumber() == 1)
135 {
136
137
138
139
140
141
142 }
143 }
144
145
146 G4OpBoundaryProcessStatus theStatus = Undefined;
147
149 G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
150
151 if(OpManager)
152 {
153 G4int nproc = OpManager->GetPostStepProcessVector()->entries();
155 OpManager->GetPostStepProcessVector(typeDoIt);
156
157 for(G4int i = 0; i < nproc; ++i)
158 {
159 G4VProcess* fCurrentProcess = (*fPostStepDoItVector)[i];
162 {
164 break;
165 }
166 }
167 }
168
169
171 (theStatus == TotalInternalReflection || theStatus == FresnelReflection ||
172 theStatus == FresnelRefraction) &&
174 {
175 G4double px = theTrack->GetVertexMomentumDirection().x();
176 G4double py = theTrack->GetVertexMomentumDirection().y();
177 G4double x = theTrack->GetPosition().x();
178 G4double y = theTrack->GetPosition().y();
179
181
183 fInitGamma / std::sqrt(px * px + py * py) / std::sqrt(x * x + y * y);
184
186
188 {
190 }
191 }
192
194 {
195
197
199
200 return;
201 }
202
203
204
205 switch(theStatus)
206 {
207
208 case FresnelRefraction:
209 case SameMaterial:
211
212 if(thePostPVname == "WLSFiber" || thePostPVname == "Clad1" ||
213 thePostPVname == "Clad2")
214 {
217
218
219 }
221 {
222
224 {
228 }
229 else
230 {
232 trackInformation->SetExitPosition(theTrack->GetPosition());
233
234
238 }
239
241 trackInformation->SetExitPosition(theTrack->GetPosition());
242 }
243
244 return;
245
246
247 case TotalInternalReflection:
248
250
251
253 {
254 theTrack->SetTrackStatus(fStopAndKill);
255 trackInformation->AddStatusFlag(
murderee);
257 G4cout << "\n Bounce Limit Exceeded" << G4endl;
258 return;
259 }
260 break;
261
262 case FresnelReflection:
263
266
267 if(thePrePVname == "WLSFiber")
268 {
271 }
272 else if(thePrePVname == "Clad1")
273 {
276 }
277 else if(thePrePVname == "Clad2")
278 {
281 }
282
283
285 {
288 {
290
292 theStatus == TotalInternalReflection)
293 {
294 theTrack->SetTrackStatus(fStopAndKill);
295 trackInformation->AddStatusFlag(
murderee);
296
298 return;
299 }
300 }
301 }
302 return;
303
304
305 case LambertianReflection:
306 case LobeReflection:
307 case SpikeReflection:
308
310
311 if(thePostPVname == "Mirror")
312 {
315 }
316 return;
317
318
319 case Detection:
320
321
322
324 theTrack->SetTrackStatus(fStopAndKill);
325 return;
326
327 default:
328 break;
329 }
330
331
332 if(theTrack->GetTrackStatus() != fAlive &&
334 {
335
337 return;
338 }
339}
G4double GetWLSFiberEnd()
G4int fCounterClad1Bounce
G4int fCounterClad2Bounce
G4OpBoundaryProcess * fOpProcess