153{
155
158
161
168 }
169
174 }
179 }
180
181 Material1 = pPreStepPoint -> GetMaterial();
182 Material2 = pPostStepPoint -> GetMaterial();
183
185
189
191 G4cout <<
" Old Momentum Direction: " << OldMomentum <<
G4endl;
192 G4cout <<
" Old Polarization: " << OldPolarization <<
G4endl;
193 }
194
196
199 GetNavigatorForTracking();
200
202
203
204 theGlobalNormal =
206
207 if (valid) {
208 theGlobalNormal = -theGlobalNormal;
209 }
210 else
211 {
213 ed << " G4OpBoundaryProcess/PostStepDoIt(): "
214 << " The Navigator reports that it returned an invalid normal"
216 G4Exception(
"G4OpBoundaryProcess::PostStepDoIt",
"OpBoun01",
218 "Invalid Surface Normal - Geometry must return valid surface normal");
219 }
220
221 if (OldMomentum * theGlobalNormal > 0.0) {
222#ifdef G4OPTICAL_DEBUG
224 ed << " G4OpBoundaryProcess/PostStepDoIt(): "
225 << " theGlobalNormal points in a wrong direction. "
227 ed << " The momentum of the photon arriving at interface (oldMomentum)"
228 <<
" must exit the volume cross in the step. " <<
G4endl;
229 ed <<
" So it MUST have dot < 0 with the normal that Exits the new volume (globalNormal)." <<
G4endl;
230 ed <<
" >> The dot product of oldMomentum and global Normal is " << OldMomentum*theGlobalNormal <<
G4endl;
231 ed <<
" Old Momentum (during step) = " << OldMomentum <<
G4endl;
232 ed <<
" Global Normal (Exiting New Vol) = " << theGlobalNormal <<
G4endl;
234 G4Exception(
"G4OpBoundaryProcess::PostStepDoIt",
"OpBoun02",
236 ed,
237 "Invalid Surface Normal - Geometry must return valid surface normal pointing in the right direction");
238#else
239 theGlobalNormal = -theGlobalNormal;
240#endif
241 }
242
245
247 if (aMaterialPropertiesTable) {
248 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
249 }
250 else {
256 }
257
258 if (Rindex) {
259 Rindex1 = Rindex->
Value(thePhotonMomentum);
260 }
261 else {
267 }
268
269 theReflectivity = 1.;
270 theEfficiency = 0.;
271 theTransmittance = 0.;
272
275
277
278 Rindex = NULL;
279 OpticalSurface = NULL;
280
282
284 (pPreStepPoint ->GetPhysicalVolume(),
286
287 if (Surface == NULL){
292 if(enteredDaughter){
295 GetLogicalVolume());
296 if(Surface == NULL)
299 GetLogicalVolume());
300 }
301 else {
304 GetLogicalVolume());
305 if(Surface == NULL)
308 GetLogicalVolume());
309 }
310 }
311
312 if (Surface) OpticalSurface =
314
315 if (OpticalSurface) {
316
317 type = OpticalSurface->
GetType();
318 theModel = OpticalSurface->
GetModel();
320
321 aMaterialPropertiesTable = OpticalSurface->
322 GetMaterialPropertiesTable();
323
324 if (aMaterialPropertiesTable) {
325
328 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
329 if (Rindex) {
330 Rindex2 = Rindex->
Value(thePhotonMomentum);
331 }
332 else {
338 }
339 }
340
341 PropertyPointer =
342 aMaterialPropertiesTable->
GetProperty(
"REFLECTIVITY");
343 PropertyPointer1 =
344 aMaterialPropertiesTable->
GetProperty(
"REALRINDEX");
345 PropertyPointer2 =
346 aMaterialPropertiesTable->
GetProperty(
"IMAGINARYRINDEX");
347
348 iTE = 1;
349 iTM = 1;
350
351 if (PropertyPointer) {
352
353 theReflectivity =
354 PropertyPointer->
Value(thePhotonMomentum);
355
356 } else if (PropertyPointer1 && PropertyPointer2) {
357
358 CalculateReflectivity();
359
360 }
361
362 PropertyPointer =
363 aMaterialPropertiesTable->
GetProperty(
"EFFICIENCY");
364 if (PropertyPointer) {
365 theEfficiency =
366 PropertyPointer->
Value(thePhotonMomentum);
367 }
368
369 PropertyPointer =
370 aMaterialPropertiesTable->
GetProperty(
"TRANSMITTANCE");
371 if (PropertyPointer) {
372 theTransmittance =
373 PropertyPointer->
Value(thePhotonMomentum);
374 }
375
377 PropertyPointer =
378 aMaterialPropertiesTable->
GetProperty(
"SPECULARLOBECONSTANT");
379 if (PropertyPointer) {
380 prob_sl =
381 PropertyPointer->
Value(thePhotonMomentum);
382 } else {
383 prob_sl = 0.0;
384 }
385
386 PropertyPointer =
387 aMaterialPropertiesTable->
GetProperty(
"SPECULARSPIKECONSTANT");
388 if (PropertyPointer) {
389 prob_ss =
390 PropertyPointer->
Value(thePhotonMomentum);
391 } else {
392 prob_ss = 0.0;
393 }
394
395 PropertyPointer =
396 aMaterialPropertiesTable->
GetProperty(
"BACKSCATTERCONSTANT");
397 if (PropertyPointer) {
398 prob_bs =
399 PropertyPointer->
Value(thePhotonMomentum);
400 } else {
401 prob_bs = 0.0;
402 }
403 }
404 }
410 }
411 }
412
415
416 if (Material1 == Material2){
420 }
421 aMaterialPropertiesTable =
423 if (aMaterialPropertiesTable)
424 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
425 if (Rindex) {
426 Rindex2 = Rindex->
Value(thePhotonMomentum);
427 }
428 else {
434 }
435 }
436 }
437
439
440 DielectricMetal();
441
442
443
444
445
446
447
448 }
450
451 DielectricLUT();
452
453 }
455
458 DielectricDielectric();
459 }
460 else {
461 if ( !G4BooleanRand(theReflectivity) ) {
462 DoAbsorption();
463 }
464 else {
466 DoReflection();
467 }
470 DoReflection();
471 }
472 else {
473 DielectricDielectric();
474 }
475 }
476 }
477 }
478 else {
479
480 G4cerr <<
" Error: G4BoundaryProcess: illegal boundary type " <<
G4endl;
482
483 }
484
485 NewMomentum = NewMomentum.
unit();
486 NewPolarization = NewPolarization.
unit();
487
489 G4cout <<
" New Momentum Direction: " << NewMomentum <<
G4endl;
490 G4cout <<
" New Polarization: " << NewPolarization <<
G4endl;
491 BoundaryProcessVerbose();
492 }
493
496
502 }
503
505}
G4DLLIMPORT std::ostream G4cerr
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)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid)
G4OpticalSurfaceModel GetModel() const
G4OpticalSurfaceFinish GetFinish() const
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)
G4StepStatus GetStepStatus() 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
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
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription