65 const G4double currentProposedStepLength,
73 G4int& blockedReplicaNo)
76 *blockedExitedVol =
nullptr;
80 G4double ourStep = currentProposedStepLength, ourSafety;
82 G4long localNoDaughters, sampleNo;
83 G4bool motherValidExitNormal =
false;
88 motherSolid = motherLogical->
GetSolid();
93 ourSafety = motherSafety;
98 if (
fCheck && ( (localNoDaughters>0) || (ourStep < motherSafety) ) )
100 fLogger->PreComputeStepLog(motherPhysical, motherSafety, localPoint);
108 if ( exiting && validExitNormal )
110 if ( localDirection.
dot(exitNormal)>=kMinExitingNormalCosine )
114 blockedExitedVol = (*pBlockedPhysical);
132 &motherValidExitNormal,
135 if( (motherStep >= kInfinity) || (motherStep < 0.0) )
138 fLogger->ReportOutsideMother(localPoint, localDirection, motherPhysical);
140 ourStep = motherStep = 0.0;
146 validExitNormal = motherValidExitNormal;
147 exitNormal = motherExitNormal;
149 *pBlockedPhysical =
nullptr;
150 blockedReplicaNo = 0;
158 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo--)
160 samplePhysical = motherLogical->
GetDaughter(sampleNo);
161 if ( samplePhysical!=blockedExitedVol )
172 if ( sampleSafety<ourSafety )
174 ourSafety=sampleSafety;
177 if ( sampleSafety<=ourStep )
185 fLogger->PrintDaughterLog(sampleSolid, samplePoint,
187 sampleDirection, sampleStep);
190 if ( sampleStep<=ourStep )
192 ourStep = sampleStep;
195 *pBlockedPhysical = samplePhysical;
196 blockedReplicaNo = -1;
200 fLogger->AlongComputeStepLog(sampleSolid, samplePoint,
201 sampleDirection, localDirection,
202 sampleSafety, sampleStep);
208 if(
fCheck && (sampleStep < kInfinity) && (sampleStep >= motherStep) )
212 fLogger->CheckDaughterEntryPoint(sampleSolid,
213 samplePoint, sampleDirection,
215 localPoint, localDirection,
216 motherStep, sampleStep);
223 fLogger->PrintDaughterLog(sampleSolid, samplePoint,
230 if ( currentProposedStepLength<ourSafety )
236 *pBlockedPhysical =
nullptr;
243 if ( motherSafety<=ourStep )
250 &motherValidExitNormal,
256 fLogger->PostComputeStepLog(motherSolid, localPoint, localDirection,
257 motherStep, motherSafety);
258 if( motherValidExitNormal )
260 fLogger->CheckAndReportBadNormal(motherExitNormal,
265 "From motherSolid::DistanceToOut" );
270 if( (motherStep >= kInfinity) || (motherStep < 0.0) )
275 fLogger->ReportOutsideMother(localPoint, localDirection,
279 ourStep = motherStep = 0.0;
286 validExitNormal =
false;
287 *pBlockedPhysical =
nullptr;
288 blockedReplicaNo = 0;
293 if ( motherStep<=ourStep )
295 ourStep = motherStep;
298 validExitNormal = motherValidExitNormal;
299 exitNormal = motherExitNormal;
301 if ( motherValidExitNormal )
310 fLogger->CheckAndReportBadNormal(exitNormal,
313 "From RotationMatrix" );
321 validExitNormal =
false;
325 newSafety = ourSafety;
341 G4long localNoDaughters, sampleNo;
345 motherSolid = motherLogical->
GetSolid();
350 ourSafety = motherSafety;
355 fLogger->ComputeSafetyLog(motherSolid,localPoint,motherSafety,
true,1);
362 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo-- )
364 samplePhysical = motherLogical->
GetDaughter(sampleNo);
374 if ( sampleSafety<ourSafety )
376 ourSafety = sampleSafety;
381 fLogger->ComputeSafetyLog(sampleSolid, samplePoint,
382 sampleSafety,
false, 0);
G4NavigationHistory is a class responsible for the maintenance of the history of the path taken throu...
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