66 const G4double currentProposedStepLength,
74 G4int& blockedReplicaNo)
77 *blockedExitedVol =
nullptr;
81 G4double ourStep = currentProposedStepLength, ourSafety;
83 G4int localNoDaughters, sampleNo;
84 G4bool motherValidExitNormal =
false;
89 motherSolid = motherLogical->
GetSolid();
94 ourSafety = motherSafety;
99 if (
fCheck && ( (localNoDaughters>0) || (ourStep < motherSafety) ) )
109 if ( exiting && validExitNormal )
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 )
167 const G4ThreeVector samplePoint = sampleTf.TransformPoint(localPoint);
173 if ( sampleSafety<ourSafety )
175 ourSafety=sampleSafety;
178 if ( sampleSafety<=ourStep )
180 sampleDirection = sampleTf.TransformAxis(localDirection);
188 sampleDirection, sampleStep);
191 if ( sampleStep<=ourStep )
193 ourStep = sampleStep;
196 *pBlockedPhysical = samplePhysical;
197 blockedReplicaNo = -1;
202 sampleDirection, localDirection,
203 sampleSafety, sampleStep);
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 )
313 "From RotationMatrix" );
320 validExitNormal =
false;
324 newSafety = ourSafety;
340 G4int localNoDaughters, sampleNo;
344 motherSolid = motherLogical->
GetSolid();
349 ourSafety = motherSafety;
361 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo-- )
363 samplePhysical = motherLogical->
GetDaughter(sampleNo);
368 sampleTf.TransformPoint(localPoint);
373 if ( sampleSafety<ourSafety )
375 ourSafety = sampleSafety;
381 sampleSafety,
false,
false);