120 const G4Step* pStep = &aStep;
124 if (hStep) pStep = hStep;
127 (pStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary);
145 GetMaterialPropertiesTable();
147 GetMaterialPropertiesTable();
149 G4String volnam1 = pStep->GetPreStepPoint() ->GetPhysicalVolume()->GetName();
150 G4String volnam2 = pStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
154 G4cout <<
" vol1: " << volnam1 <<
", vol2: " << volnam2 <<
G4endl;
156 G4cout <<
" MomDir: " << aTrack.GetMomentumDirection() <<
G4endl;
165 G4ThreeVector theGlobalPoint = pStep->GetPostStepPoint()->GetPosition();
174 std::vector<G4Navigator*>::iterator iNav =
176 GetActiveNavigatorsIterator();
179 (iNav[hNavId])->GetGlobalExitNormal(theGlobalPoint,&valid);
182 theGlobalNormal = -theGlobalNormal;
187 ed <<
" G4UCNBoundaryProcess/PostStepDoIt(): " 188 <<
" The Navigator reports that it returned an invalid normal" 190 G4Exception(
"G4UCNBoundaryProcess::PostStepDoIt",
"UCNBoun01",
192 "Invalid Surface Normal - Geometry must return valid surface normal");
199 if (OldMomentum * theGlobalNormal > 0.0) {
200 #ifdef G4OPTICAL_DEBUG 202 ed <<
" G4UCNBoundaryProcess/PostStepDoIt(): " 203 <<
" theGlobalNormal points in a wrong direction. " 205 ed <<
" The momentum of the photon arriving at interface (oldMomentum)" 206 <<
" must exit the volume cross in the step. " <<
G4endl;
207 ed <<
" So it MUST have dot < 0 with the normal that Exits the new volume (globalNormal)." <<
G4endl;
208 ed <<
" >> The dot product of oldMomentum and global Normal is " << OldMomentum*theGlobalNormal <<
G4endl;
209 ed <<
" Old Momentum (during step) = " << OldMomentum <<
G4endl;
210 ed <<
" Global Normal (Exiting New Vol) = " << theGlobalNormal <<
G4endl;
212 G4Exception(
"G4UCNBoundaryProcess::PostStepDoIt",
"UCNBoun02",
215 "Invalid Surface Normal - Geometry must return valid surface normal pointing in the right direction");
217 theGlobalNormal = -theGlobalNormal;
223 G4double theMomentumNormal = theNeutronMomentum*theGlobalNormal;
224 G4double theVelocityNormal = aTrack.GetVelocity() *
225 (OldMomentum * theGlobalNormal);
228 G4double Energy = aTrack.GetKineticEnergy();
246 G4double FermiPotDiff = FermiPot2 - FermiPot1;
249 G4cout <<
"UCNBoundaryProcess: new FermiPot: " << FermiPot2/
neV 250 <<
"neV, old FermiPot:" << FermiPot1/
neV <<
"neV" <<
G4endl;
279 theta_i = OldMomentum.
angle(-theGlobalNormal);
284 ConditionsValid(Energy, FermiPotDiff, theta_i)) {
304 GetMRIntProbability(theta_i, Energy);
309 GetMRIntTransProbability(theta_i, Energy);
313 G4cout <<
"Energy: " << Energy/
neV <<
"neV" 314 <<
", Enormal: " << Enormal/
neV <<
"neV" <<
G4endl;
316 G4cout <<
"Reflection_prob: " << MRpDiffuse
317 <<
", Transmission_prob: " << MRpDiffuseTrans <<
G4endl;
321 if (!
High(Enormal, FermiPotDiff)) {
329 if (
Loss(pUpScatter, theVelocityNormal, FermiPotDiff)) {
360 NewMomentum =
MRreflect(MRpDiffuse, OldMomentum, theGlobalNormal,
361 Energy, FermiPotDiff);
366 NewMomentum =
Reflect(pDiffuse, OldMomentum, theGlobalNormal);
390 theGlobalNormal, Energy, FermiPotDiff, Enew);
408 << reflectivity <<
G4endl;
414 NewMomentum =
Reflect(pDiffuse, OldMomentum, theGlobalNormal);
426 G4double mass = -std::sqrt(theMomentumNormal*theMomentumNormal -
432 theNeutronMomentum - (theMomentumNormal-mass)*theGlobalNormal;
444 G4cout <<
"Energy: " << Energy/
neV <<
"neV, Enormal: " 445 << Enormal/
neV <<
"neV, fpdiff " << FermiPotDiff/
neV 446 <<
"neV, Enew " << Enew/
neV <<
"neV" <<
G4endl;
447 G4cout <<
"UCNBoundaryProcess: Transmit and set the new Energy "
std::ostringstream G4ExceptionDescription
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4bool High(G4double, G4double)
G4double Transmit(G4double, G4double)
double angle(const Hep3Vector &) const
static G4int GetHypNavigatorID()
G4bool DoMicroRoughnessReflection
G4GLOB_DLL std::ostream G4cout
G4bool UseMicroRoughnessReflection
void BoundaryProcessVerbose() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
G4bool Loss(G4double, G4double, G4double)
G4UCNMaterialPropertiesTable * aMaterialPropertiesTable1
G4ThreeVector MRreflect(G4double, G4ThreeVector, G4ThreeVector, G4double, G4double)
G4ThreeVector MRreflectHigh(G4double, G4double, G4double, G4ThreeVector, G4ThreeVector, G4double, G4double, G4double &)
const G4ThreeVector & GetMomentumDirection() const
G4double * GetMicroRoughnessTable()
const G4ThreeVector & GetPolarization() const
G4ParticleChange aParticleChange
static const double degree
G4ThreeVector Reflect(G4double, G4ThreeVector, G4ThreeVector)
G4UCNMaterialPropertiesTable * aMaterialPropertiesTable2
G4UCNBoundaryProcessStatus theStatus
G4double GetConstProperty(const char *key)
G4double Reflectivity(G4double, G4double)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4bool SpinFlip(G4double)
static const G4Step * GetHyperStep()