59 const G4double currentProposedStepLength,
67 G4int& blockedReplicaNo)
76 history.GetTopTransform().InverseTransformPoint(localPoint);
78 history.GetTopTransform().InverseTransformAxis(localDirection);
83 globalPoint, &globalDirection,
true, localPoint2 );
90 motherPhysical =
history.GetTopVolume();
106 currentProposedStepLength,
122 const G4double currentProposedStepLength,
130 G4int& blockedReplicaNo,
142 currentProposedStepLength,
161 .InverseTransformPoint(localPoint);
165 containerPoint =
history.GetTransform(ide).InverseTransformPoint(localPoint);
169 containerPoint =
history.GetTransform(ide-1).TransformPoint(containerPoint);
174 G4ThreeVector prevVoxelTranslation = containerPoint - localPoint;
205 .InverseTransformPoint(localPoint);
206 std::ostringstream message;
207 message <<
"G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
208 <<
"Stuck Track: potential geometry or navigation problem."
210 <<
" Track stuck, moving for more than "
211 << ii <<
" steps" <<
G4endl
212 <<
"- at point " << pGlobalpoint <<
G4endl
213 <<
" local direction: " << localDirection <<
G4endl;
214 G4Exception(
"G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
219 newStep = voxelBox->
DistanceToOut( localPoint, localDirection );
224#ifdef G4DEBUG_NAVIGATION
228 .InverseTransformPoint(localPoint);
229 std::ostringstream message;
230 message.precision(16);
231 message <<
"G4RegularNavigation::ComputeStepSkippingEqualMaterials(): another 'zero' step, # "
233 <<
", at " << pGlobalpoint
234 <<
", nav-comp-step calls # " << ii
235 <<
", Step= " << newStep;
236 G4Exception(
"G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
238 "Potential overlap in geometry!");
246#ifdef G4DEBUG_NAVIGATION
248 .InverseTransformPoint(localPoint);
249 std::ostringstream message;
250 message.precision(16);
251 message <<
"Track stuck or not moving." <<
G4endl
252 <<
" Track stuck, not moving for "
254 <<
"- at point " << pGlobalpoint
255 <<
" (local point " << localPoint <<
")" <<
G4endl
256 <<
" local direction: " << localDirection
257 <<
" Potential geometry or navigation problem !"
259 <<
" Trying pushing it of " << newStep <<
" mm ...";
260 G4Exception(
"G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
262 "Potential overlap in geometry!");
270 .InverseTransformPoint(localPoint);
271 std::ostringstream message;
272 message <<
"G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
273 <<
"Stuck Track: potential geometry or navigation problem."
275 <<
" Track stuck, not moving for "
277 <<
"- at point " << pGlobalpoint <<
G4endl
278 <<
" local direction: " << localDirection <<
G4endl;
279 G4Exception(
"G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
290 if( (bFirstStep) && (newStep < currentProposedStepLength) )
298 totalNewStep += newStep;
302 if(std::fabs(totalNewStep-currentProposedStepLength) <
kCarTolerance)
304 return currentProposedStepLength;
306 if(totalNewStep > currentProposedStepLength)
309 AddStepLength(copyNo, newStep-totalNewStep+currentProposedStepLength);
310 return currentProposedStepLength;
320 containerPoint += newStep*localDirection;
328 copyNo = param->
GetReplicaNo(containerPoint, localDirection);
334 localPoint += newStep*localDirection;
335 localPoint += prevVoxelTranslation - voxelTranslation;
337 prevVoxelTranslation = voxelTranslation;
342 if( currentMate != nextMate ) {
break; }
385 motherPhysical =
history.GetTopVolume();
398 if( globalDirection )
400 localDir =
history.GetTopTransform().TransformAxis(*globalDirection);
409 replicaNo = pParam->
GetReplicaNo( localPoint, localDir );
422 localPoint =
history.GetTopTransform().TransformPoint(globalPoint);
429 pPhysical, &parentTouchable) );
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
G4VSolid * GetSolid() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
void UpdateMaterial(G4Material *pMaterial)
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)
G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX)
virtual G4int GetReplicaNo(const G4ThreeVector &localPoint, const G4ThreeVector &localDir)
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
G4VSolid * GetContainerSolid() const
G4ThreeVector GetTranslation(const G4int copyNo) const
G4bool SkipEqualMaterials() const
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const
size_t GetNoVoxels() const
static G4RegularNavigationHelper * Instance()
void AddStepLength(G4int copyNo, G4double slen)
G4int fActionThreshold_NoZeroSteps
G4int fAbandonThreshold_NoZeroSteps
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
G4double ComputeStepSkippingEqualMaterials(G4ThreeVector &localPoint, const G4ThreeVector &globalDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo, G4VPhysicalVolume *pCurrentPhysical)
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &globalDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo)
G4NormalNavigation * fnormalNav
virtual void SetCopyNo(G4int CopyNo)=0
G4LogicalVolume * GetLogicalVolume() const
virtual G4VPVParameterisation * GetParameterisation() const =0
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
T min(const T t1, const T t2)
brief Return the smallest of the two arguments