66 const G4double currentProposedStepLength,
74 G4int& blockedReplicaNo)
77 *blockedExitedVol =
nullptr;
81 G4double ourStep = currentProposedStepLength, ourSafety;
83 G4long localNoDaughters, sampleNo;
84 G4bool motherValidExitNormal =
false;
89 motherSolid = motherLogical->
GetSolid();
94 ourSafety = motherSafety;
99 if (
fCheck && ( (localNoDaughters>0) || (ourStep < motherSafety) ) )
109 if ( exiting && validExitNormal )
111 if ( localDirection.
dot(exitNormal)>=kMinExitingNormalCosine )
115 blockedExitedVol = (*pBlockedPhysical);
133 &motherValidExitNormal,
136 if( (motherStep >= kInfinity) || (motherStep < 0.0) )
141 ourStep = motherStep = 0.0;
147 validExitNormal = motherValidExitNormal;
148 exitNormal = motherExitNormal;
150 *pBlockedPhysical =
nullptr;
151 blockedReplicaNo = 0;
159 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo--)
161 samplePhysical = motherLogical->
GetDaughter(sampleNo);
162 if ( samplePhysical!=blockedExitedVol )
173 if ( sampleSafety<ourSafety )
175 ourSafety=sampleSafety;
178 if ( sampleSafety<=ourStep )
188 sampleDirection, sampleStep);
191 if ( sampleStep<=ourStep )
193 ourStep = sampleStep;
196 *pBlockedPhysical = samplePhysical;
197 blockedReplicaNo = -1;
202 sampleDirection, localDirection,
203 sampleSafety, sampleStep);
209 if(
fCheck && (sampleStep < kInfinity) && (sampleStep >= motherStep) )
214 samplePoint, sampleDirection,
216 localPoint, localDirection,
217 motherStep, sampleStep);
231 if ( currentProposedStepLength<ourSafety )
237 *pBlockedPhysical =
nullptr;
244 if ( motherSafety<=ourStep )
251 &motherValidExitNormal,
258 motherStep, motherSafety);
259 if( motherValidExitNormal )
266 "From motherSolid::DistanceToOut" );
271 if( (motherStep >= kInfinity) || (motherStep < 0.0) )
280 ourStep = motherStep = 0.0;
287 validExitNormal =
false;
288 *pBlockedPhysical =
nullptr;
289 blockedReplicaNo = 0;
294 if ( motherStep<=ourStep )
296 ourStep = motherStep;
299 validExitNormal = motherValidExitNormal;
300 exitNormal = motherExitNormal;
302 if ( motherValidExitNormal )
314 "From RotationMatrix" );
322 validExitNormal =
false;
326 newSafety = ourSafety;
342 G4long localNoDaughters, sampleNo;
346 motherSolid = motherLogical->
GetSolid();
351 ourSafety = motherSafety;
363 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo-- )
365 samplePhysical = motherLogical->
GetDaughter(sampleNo);
375 if ( sampleSafety<ourSafety )
377 ourSafety = sampleSafety;
383 sampleSafety,
false, 0);
G4VPhysicalVolume * GetTopVolume() const
G4double ComputeStep(const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo) final