179 const G4Step* pStep = &aStep;
183 if (hStep) pStep = hStep;
221 G4cout <<
" Old Momentum Direction: " << OldMomentum <<
G4endl;
222 G4cout <<
" Old Polarization: " << OldPolarization <<
G4endl;
234 std::vector<G4Navigator*>::iterator iNav =
236 GetActiveNavigatorsIterator();
238 (iNav[hNavId])->GetGlobalExitNormal(theGlobalPoint,&valid);
241 theGlobalNormal = -theGlobalNormal;
246 ed <<
" G4OpBoundaryProcess/PostStepDoIt(): "
247 <<
" The Navigator reports that it returned an invalid normal"
249 G4Exception(
"G4OpBoundaryProcess::PostStepDoIt",
"OpBoun01",
251 "Invalid Surface Normal - Geometry must return valid surface normal");
254 if (OldMomentum * theGlobalNormal > 0.0) {
255 #ifdef G4OPTICAL_DEBUG
257 ed <<
" G4OpBoundaryProcess/PostStepDoIt(): "
258 <<
" theGlobalNormal points in a wrong direction. "
260 ed <<
" The momentum of the photon arriving at interface (oldMomentum)"
261 <<
" must exit the volume cross in the step. " <<
G4endl;
262 ed <<
" So it MUST have dot < 0 with the normal that Exits the new volume (globalNormal)." <<
G4endl;
263 ed <<
" >> The dot product of oldMomentum and global Normal is " << OldMomentum*theGlobalNormal <<
G4endl;
264 ed <<
" Old Momentum (during step) = " << OldMomentum <<
G4endl;
265 ed <<
" Global Normal (Exiting New Vol) = " << theGlobalNormal <<
G4endl;
267 G4Exception(
"G4OpBoundaryProcess::PostStepDoIt",
"OpBoun02",
270 "Invalid Surface Normal - Geometry must return valid surface normal pointing in the right direction");
272 theGlobalNormal = -theGlobalNormal;
280 if (aMaterialPropertiesTable) {
281 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
292 Rindex1 = Rindex->
Value(thePhotonMomentum);
302 theReflectivity = 1.;
304 theTransmittance = 0.;
306 theSurfaceRoughness = 0.;
314 OpticalSurface = NULL;
320 if (Surface == NULL){
339 if (Surface) OpticalSurface =
342 if (OpticalSurface) {
344 type = OpticalSurface->
GetType();
345 theModel = OpticalSurface->
GetModel();
348 aMaterialPropertiesTable = OpticalSurface->
349 GetMaterialPropertiesTable();
351 if (aMaterialPropertiesTable) {
355 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
357 Rindex2 = Rindex->
Value(thePhotonMomentum);
369 aMaterialPropertiesTable->
GetProperty(
"REFLECTIVITY");
371 aMaterialPropertiesTable->
GetProperty(
"REALRINDEX");
373 aMaterialPropertiesTable->
GetProperty(
"IMAGINARYRINDEX");
378 if (PropertyPointer) {
381 PropertyPointer->
Value(thePhotonMomentum);
383 }
else if (PropertyPointer1 && PropertyPointer2) {
385 CalculateReflectivity();
390 aMaterialPropertiesTable->
GetProperty(
"EFFICIENCY");
391 if (PropertyPointer) {
393 PropertyPointer->
Value(thePhotonMomentum);
397 aMaterialPropertiesTable->
GetProperty(
"TRANSMITTANCE");
398 if (PropertyPointer) {
400 PropertyPointer->
Value(thePhotonMomentum);
403 if (aMaterialPropertiesTable->
404 ConstPropertyExists(
"SURFACEROUGHNESS"))
405 theSurfaceRoughness = aMaterialPropertiesTable->
406 GetConstProperty(
"SURFACEROUGHNESS");
410 aMaterialPropertiesTable->
GetProperty(
"SPECULARLOBECONSTANT");
411 if (PropertyPointer) {
413 PropertyPointer->
Value(thePhotonMomentum);
419 aMaterialPropertiesTable->
GetProperty(
"SPECULARSPIKECONSTANT");
420 if (PropertyPointer) {
422 PropertyPointer->
Value(thePhotonMomentum);
428 aMaterialPropertiesTable->
GetProperty(
"BACKSCATTERCONSTANT");
429 if (PropertyPointer) {
431 PropertyPointer->
Value(thePhotonMomentum);
448 if (Material1 == Material2){
453 aMaterialPropertiesTable =
455 if (aMaterialPropertiesTable)
456 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
458 Rindex2 = Rindex->
Value(thePhotonMomentum);
482 DielectricDichroic();
489 DielectricDielectric();
493 if ( rand > theReflectivity ) {
494 if (rand > theReflectivity + theTransmittance) {
498 NewMomentum = OldMomentum;
499 NewPolarization = OldPolarization;
511 DielectricDielectric();
518 G4cerr <<
" Error: G4BoundaryProcess: illegal boundary type " <<
G4endl;
523 NewMomentum = NewMomentum.
unit();
524 NewPolarization = NewPolarization.
unit();
527 G4cout <<
" New Momentum Direction: " << NewMomentum <<
G4endl;
528 G4cout <<
" New Polarization: " << NewPolarization <<
G4endl;
529 BoundaryProcessVerbose();
542 if ( theStatus ==
Detection && fInvokeSD ) InvokeSD(pStep);
G4OpticalSurfaceModel GetModel() const
std::ostringstream G4ExceptionDescription
G4double GetVelocity() const
const G4DynamicParticle * GetDynamicParticle() const
G4StepStatus GetStepStatus() const
G4Material * GetMaterial() const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
const G4SurfaceType & GetType() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static G4LogicalBorderSurface * GetSurface(const G4VPhysicalVolume *vol1, const G4VPhysicalVolume *vol2)
G4double GetTotalMomentum() const
G4StepPoint * GetPreStepPoint() const
static G4int GetHypNavigatorID()
G4GLOB_DLL std::ostream G4cout
G4VPhysicalVolume * GetPhysicalVolume() const
const G4String & GetName() const
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDirection() const
G4LogicalVolume * GetMotherLogical() const
G4double Value(G4double theEnergy, size_t &lastidx) const
G4OpticalSurfaceFinish GetFinish() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
virtual void Initialize(const G4Track &)
G4LogicalVolume * GetLogicalVolume() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4StepPoint * GetPostStepPoint() const
const G4ThreeVector & GetPolarization() const
G4ParticleChange aParticleChange
G4SurfaceProperty * GetSurfaceProperty() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeVelocity(G4double finalVelocity)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4MaterialPropertyVector * GetProperty(const char *key)
G4double GetStepLength() const
static const G4Step * GetHyperStep()
G4GLOB_DLL std::ostream G4cerr
static G4LogicalSkinSurface * GetSurface(const G4LogicalVolume *vol)