149{
153
154
155
156
157 const G4Step* pStep = &aStep;
159 if(hStep)
160 pStep = hStep;
161
164 if(isOnBoundary)
165 {
168 }
169 else
170 {
173 BoundaryProcessVerbose();
175 }
176
179
181 {
183 if(thePrePV)
185 if(thePostPV)
187 }
188
190 {
193 BoundaryProcessVerbose();
195 }
196
198
202
204 {
205 G4cout <<
" Old Momentum Direction: " << OldMomentum <<
G4endl
206 <<
" Old Polarization: " << OldPolarization <<
G4endl;
207 }
208
211
212
216 theGlobalNormal = (iNav[hNavId])->GetGlobalExitNormal(theGlobalPoint, &valid);
217
218 if(valid)
219 {
220 theGlobalNormal = -theGlobalNormal;
221 }
222 else
223 {
225 ed << " G4OpBoundaryProcess/PostStepDoIt(): "
226 <<
" The Navigator reports that it returned an invalid normal" <<
G4endl;
229 "Invalid Surface Normal - Geometry must return valid surface normal");
230 }
231
232 if(OldMomentum * theGlobalNormal > 0.0)
233 {
234#ifdef G4OPTICAL_DEBUG
236 ed << " G4OpBoundaryProcess/PostStepDoIt(): theGlobalNormal points in a "
237 "wrong direction. "
239 << " The momentum of the photon arriving at interface (oldMomentum)"
240 <<
" must exit the volume cross in the step. " <<
G4endl
241 << " So it MUST have dot < 0 with the normal that Exits the new "
242 "volume (globalNormal)."
243 <<
G4endl <<
" >> The dot product of oldMomentum and global Normal is "
244 << OldMomentum * theGlobalNormal <<
G4endl
245 <<
" Old Momentum (during step) = " << OldMomentum <<
G4endl
246 <<
" Global Normal (Exiting New Vol) = " << theGlobalNormal <<
G4endl
248 G4Exception(
"G4OpBoundaryProcess::PostStepDoIt",
"OpBoun02",
250
251 ed,
252 "Invalid Surface Normal - Geometry must return valid surface "
253 "normal pointing in the right direction");
254#else
255 theGlobalNormal = -theGlobalNormal;
256#endif
257 }
258
261 if(MPT)
262 {
264 }
265 else
266 {
269 BoundaryProcessVerbose();
273 }
274
275 if(RindexMPV)
276 {
277 Rindex1 = RindexMPV->
Value(thePhotonMomentum, idx_rindex1);
278 }
279 else
280 {
283 BoundaryProcessVerbose();
287 }
288
289 theReflectivity = 1.;
290 theEfficiency = 0.;
291 theTransmittance = 0.;
292 theSurfaceRoughness = 0.;
296
297 RindexMPV = nullptr;
298 OpticalSurface = nullptr;
301
302 if(Surface == nullptr)
303 {
305 {
307 if(Surface == nullptr)
308 {
309 Surface =
311 }
312 }
313 else
314 {
316 if(Surface == nullptr)
317 {
318 Surface =
320 }
321 }
322 }
323
324 if(Surface)
325 {
326 OpticalSurface =
328 }
329 if(OpticalSurface)
330 {
331 type = OpticalSurface->
GetType();
332 theModel = OpticalSurface->
GetModel();
334
337 if(sMPT)
338 {
340 {
342 if(RindexMPV)
343 {
344 Rindex2 = RindexMPV->
Value(thePhotonMomentum, idx_rindex_surface);
345 }
346 else
347 {
350 BoundaryProcessVerbose();
354 }
355 }
356
359 iTE = iTM = 1;
360
363 {
364 theReflectivity =
pp->Value(thePhotonMomentum, idx_reflect);
365 }
366 else if(fRealRIndexMPV && fImagRIndexMPV)
367 {
368 CalculateReflectivity();
369 }
370
372 {
373 theEfficiency =
pp->Value(thePhotonMomentum, idx_eff);
374 }
376 {
377 theTransmittance =
pp->Value(thePhotonMomentum, idx_trans);
378 }
380 {
382 }
383
385 {
387 ?
pp->Value(thePhotonMomentum, idx_lobe)
388 : 0.;
390 ?
pp->Value(thePhotonMomentum, idx_spike)
391 : 0.;
393 ?
pp->Value(thePhotonMomentum, idx_back)
394 : 0.;
395 }
396 }
398 {
402 }
403 }
404
405
407 {
409 {
410 if(Material1 == Material2)
411 {
414 BoundaryProcessVerbose();
416 }
418 if(MPT)
419 {
421 }
422 if(RindexMPV)
423 {
424 Rindex2 = RindexMPV->
Value(thePhotonMomentum, idx_rindex2);
425 }
426 else
427 {
430 BoundaryProcessVerbose();
434 }
435 }
437 {
438 DielectricDielectric();
439 }
440 else
441 {
443 if(rand > theReflectivity + theTransmittance)
444 {
445 DoAbsorption();
446 }
447 else if(rand > theReflectivity)
448 {
450 NewMomentum = OldMomentum;
451 NewPolarization = OldPolarization;
452 }
453 else
454 {
456 {
457 DoReflection();
458 }
460 {
462 DoReflection();
463 }
464 else
465 {
466 DielectricDielectric();
467 }
468 }
469 }
470 }
472 {
473 DielectricMetal();
474 }
476 {
477 DielectricLUT();
478 }
480 {
481 DielectricLUTDAVIS();
482 }
484 {
485 DielectricDichroic();
486 }
487 else
488 {
490 ed <<
" PostStepDoIt(): Illegal boundary type." <<
G4endl;
493 }
494
495 NewMomentum = NewMomentum.
unit();
496 NewPolarization = NewPolarization.
unit();
497
499 {
500 G4cout <<
" New Momentum Direction: " << NewMomentum <<
G4endl
501 <<
" New Polarization: " << NewPolarization <<
G4endl;
502 BoundaryProcessVerbose();
503 }
504
507
509 {
512 if(groupvel)
513 {
515 groupvel->
Value(thePhotonMomentum, idx_groupvel));
516 }
517 }
518
520 InvokeSD(pStep);
522}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const G4ThreeVector & GetMomentumDirection() const
G4double GetTotalMomentum() const
const G4ThreeVector & GetPolarization() const
static G4LogicalBorderSurface * GetSurface(const G4VPhysicalVolume *vol1, const G4VPhysicalVolume *vol2)
static G4LogicalSkinSurface * GetSurface(const G4LogicalVolume *vol)
G4SurfaceProperty * GetSurfaceProperty() const
G4MaterialPropertyVector * GetProperty(const char *key, G4bool warning=false)
G4bool ConstPropertyExists(const G4String &key) const
G4double GetConstProperty(const G4String &key) const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4OpticalSurfaceModel GetModel() const
G4OpticalSurfaceFinish GetFinish() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static const G4Step * GetHyperStep()
static G4int GetHypNavigatorID()
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
void ProposeVelocity(G4double finalVelocity)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual void Initialize(const G4Track &)
G4double Value(G4double theEnergy, std::size_t &lastidx) const
G4StepStatus GetStepStatus() const
G4Material * GetMaterial() const
const G4ThreeVector & GetPosition() const
G4VPhysicalVolume * GetPhysicalVolume() const
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
const G4SurfaceType & GetType() const
G4double GetVelocity() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetStepLength() const
std::vector< G4Navigator * >::iterator GetActiveNavigatorsIterator()
static G4TransportationManager * GetTransportationManager()
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4LogicalVolume * GetMotherLogical() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
G4ParticleChange aParticleChange