56 #define fHistory fpNavigatorState->fHistory
57 #define fLastTriedStepComputation fpNavigatorState->fLastTriedStepComputation
58 #define fEnteredDaughter fpNavigatorState->fEnteredDaughter
59 #define fExitedMother fpNavigatorState->fExitedMother
60 #define fWasLimitedByGeometry fpNavigatorState->fWasLimitedByGeometry
61 #define fStepEndPoint fpNavigatorState->fStepEndPoint
62 #define fLastStepEndPointLocal fpNavigatorState->fLastStepEndPointLocal
63 #define fPushed fpNavigatorState->fPushed
64 #define fLastTriedStepComputation fpNavigatorState->fLastTriedStepComputation
65 #define fEntering fpNavigatorState->fEntering
66 #define fExiting fpNavigatorState->fExiting
67 #define fBlockedPhysicalVolume fpNavigatorState->fBlockedPhysicalVolume
68 #define fBlockedReplicaNo fpNavigatorState->fBlockedReplicaNo
69 #define fLastLocatedPointLocal fpNavigatorState->fLastLocatedPointLocal
70 #define fLocatedOutsideWorld fpNavigatorState->fLocatedOutsideWorld
71 #define fValidExitNormal fpNavigatorState->fValidExitNormal
72 #define fExitNormal fpNavigatorState->fExitNormal
73 #define fGrandMotherExitNormal fpNavigatorState->fGrandMotherExitNormal
74 #define fChangedGrandMotherRefFrame fpNavigatorState->fChangedGrandMotherRefFrame
75 #define fExitNormalGlobalFrame fpNavigatorState->fExitNormalGlobalFrame
76 #define fCalculatedExitNormal fpNavigatorState->fCalculatedExitNormal
77 #define fLastStepWasZero fpNavigatorState->fLastStepWasZero
78 #define fLocatedOnEdge fpNavigatorState->fLocatedOnEdge
79 #define fNumberZeroSteps fpNavigatorState->fNumberZeroSteps
80 #define fPreviousSftOrigin fpNavigatorState->fPreviousSftOrigin
81 #define fPreviousSafety fpNavigatorState->fPreviousSafety
89 fTopPhysical(0), fCheck(false),
148 const G4bool relativeSearch,
149 const G4bool ignoreDirection )
152 G4bool notKnownContained=
true, noResult;
164 if( considerDirection && pGlobalDirection != 0 )
166 globalDirection=*pGlobalDirection;
173 static int nCalls = 0;
175 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup: ***" <<
G4endl;
176 G4cout <<
" Called with arguments: " << G4endl
177 <<
" Globalpoint = " << globalPoint << G4endl
178 <<
" RelativeSearch = " << relativeSearch <<
G4endl;
184 G4cout.precision(oldcoutPrec);
190 G4int noLevelsExited=0 ;
191 G4int noLevelsEntered= 0;
193 if ( !relativeSearch )
292 localPoint =
fHistory.GetTopTransform().TransformPoint(globalPoint);
293 notKnownContained =
false;
315 while (notKnownContained)
319 targetSolid =
fHistory.GetTopVolume()->GetLogicalVolume()->GetSolid();
320 localPoint =
fHistory.GetTopTransform().TransformPoint(globalPoint);
321 insideCode = targetSolid->
Inside(localPoint);
325 G4String solidResponse =
"-kInside-";
327 solidResponse =
"-kOutside-";
329 solidResponse =
"-kSurface-";
330 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup(): ***" <<
G4endl
331 <<
" Invoked Inside() for solid: " << targetSolid->
GetName()
332 <<
". Solid replied: " << solidResponse <<
G4endl
333 <<
" For local point p: " << localPoint <<
G4endl;
358 if( noLevelsExited > 1 )
382 if( (!
fExiting)&&considerDirection )
387 G4bool directionExiting =
false;
389 fHistory.GetTopTransform().TransformAxis(globalDirection);
394 localPoint=
fHistory.GetTopTransform().TransformPoint(globalPoint);
398 directionExiting = normal.dot(localDirection) > 0.0;
399 isExiting = isExiting || directionExiting;
415 if( noLevelsExited > 1 )
438 notKnownContained=
false;
443 notKnownContained=
false;
463 targetPhysical =
fHistory.GetTopVolume();
464 if (!targetPhysical) {
break; }
557 #ifdef G4DEBUG_NAVIGATION
561 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup() ***" <<
G4endl;
576 if (targetPhysical) { curPhysVol_Name = targetPhysical->
GetName(); }
577 G4cout <<
" Return value = new volume = " << curPhysVol_Name <<
G4endl;
582 G4cout <<
"Upon exiting LocateGlobalPointAndSetup():" <<
G4endl;
585 G4cout.precision(oldcoutPrec);
591 return targetPhysical;
612 #ifdef G4DEBUG_NAVIGATION
622 #ifdef G4DEBUG_NAVIGATION
625 G4cout <<
"Entering LocateGlobalWithinVolume(): History = " <<
G4endl;
659 G4Exception(
"G4ITNavigator2::LocateGlobalPointWithinVolume()",
661 "Not applicable for replicated volumes.");
686 exceptionDescription <<
"The navigator state is NULL. ";
687 exceptionDescription <<
"Either NewNavigatorStateAndLocate was not called ";
688 exceptionDescription <<
"or the provided navigator state was already NULL.";
690 G4Exception(
"G4ITNavigator::CheckNavigatorStateIsValid",
720 exceptionDescription <<
"No World Volume";
737 exceptionDescription <<
"No World Volume";
757 exceptionDescription <<
"No World Volume";
759 G4Exception(
"G4ITNavigator::NewNavigatorStateAndLocate",
899 const G4double pCurrentProposedStepLength,
926 G4cout <<
"*** G4ITNavigator2::ComputeStep: ***" <<
G4endl;
928 <<
" - Proposed step length = " << pCurrentProposedStepLength
930 #ifdef G4DEBUG_NAVIGATION
933 G4cout <<
" Called with the arguments: " << G4endl
934 <<
" Globalpoint = " << std::setw(25) << pGlobalpoint << G4endl
935 <<
" Direction = " << std::setw(25) << pDirection <<
G4endl;
952 G4double moveLenSq = (newLocalPoint-oldLocalPoint).mag2();
974 pCurrentProposedStepLength,
991 pCurrentProposedStepLength,
1015 if(
fHistory.GetTopVolume()->GetRegularStructureId() == 0 )
1019 "Point is relocated in voxels, while it should be outside!");
1022 pCurrentProposedStepLength,
1037 pCurrentProposedStepLength,
1056 pCurrentProposedStepLength,
1070 pCurrentProposedStepLength,
1082 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1093 G4bool calculatedExitNormal;
1098 pCurrentProposedStepLength,
1102 calculatedExitNormal,
1139 #ifdef G4DEBUG_NAVIGATION
1142 G4cout <<
"G4ITNavigator2::ComputeStep(): another zero step, # "
1144 <<
" at " << pGlobalpoint
1145 <<
" in volume " << motherPhysical->
GetName()
1146 <<
" nav-comp-step calls # " << sNavCScalls
1158 std::ostringstream message;
1159 message <<
"Track stuck or not moving." <<
G4endl
1160 <<
" Track stuck, not moving for "
1162 <<
" in volume -" << motherPhysical->
GetName()
1163 <<
"- at point " << pGlobalpoint <<
G4endl
1164 <<
" direction: " << pDirection <<
"." <<
G4endl
1165 <<
" Potential geometry or navigation problem !"
1167 <<
" Trying pushing it of " << Step <<
" mm ...";
1168 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
1169 JustWarning, message,
"Potential overlap in geometry!");
1178 std::ostringstream message;
1179 message <<
"Stuck Track: potential geometry or navigation problem."
1181 <<
" Track stuck, not moving for "
1183 <<
" in volume -" << motherPhysical->
GetName()
1184 <<
"- at point " << pGlobalpoint <<
G4endl
1185 <<
" direction: " << pDirection <<
".";
1187 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1200 +
std::min(Step,pCurrentProposedStepLength) * pDirection;
1205 #ifdef G4DEBUG_NAVIGATION
1208 G4cout <<
" At G4Nav CompStep End - if(exiting) - fExiting= " <<
fExiting
1269 #ifdef G4DEBUG_NAVIGATION
1272 desc <<
"Problem in ComputeStep: Replica Navigation did not provide"
1273 <<
" valid exit Normal. " <<
G4endl;
1274 desc <<
" Do not know how calculate it in this case." <<
G4endl;
1275 desc <<
" Location = " << finalLocalPoint <<
G4endl;
1276 desc <<
" Volume name = " << motherPhysical->
GetName()
1278 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1279 JustWarning, desc,
"Normal not available for exiting.");
1292 fHistory.GetTransform(depth-1).Inverse();
1323 G4cout <<
" Returned step= " << Step;
1327 G4cout <<
" Requested step= " << pCurrentProposedStepLength ;
1345 const G4double pCurrentProposedStepLength,
1358 pCurrentProposedStepLength,
1427 for ( i=1; i<=cdepth; i++ )
1430 switch (
fHistory.GetVolumeType(i) )
1440 replicaNo =
fHistory.GetReplicaNo(i);
1465 ComputeMaterial(replicaNo, current, pTouchable) );
1494 if( candidateLogical )
1516 currentSolid= candidateLogical->
GetSolid();
1517 inSideIt = currentSolid->
Inside(daughterPointOwnLocal);
1518 onSurface = (inSideIt ==
kSurface);
1523 safety = (currentSolid->
DistanceToIn(daughterPointOwnLocal));
1526 else if (inSideIt ==
kInside )
1528 safety = (currentSolid->
DistanceToOut(daughterPointOwnLocal));
1535 nextSolidExitNormal =
1540 ExitNormal = -nextSolidExitNormal;
1548 std::ostringstream message;
1549 message <<
"Point not on surface ! " <<
G4endl
1551 << daughterPointOwnLocal <<
G4endl
1552 <<
" Physical volume = "
1554 <<
" Logical volume = "
1556 <<
" Solid = " << currentSolid->
GetName()
1559 << *currentSolid <<
G4endl;
1562 message <<
"Point is Outside. " << G4endl
1563 <<
" Safety (from outside) = " << safety <<
G4endl;
1567 message <<
"Point is Inside. " << G4endl
1568 <<
" Safety (from inside) = " << safety <<
G4endl;
1570 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
"GeomNav1001",
1588 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1590 "Incorrect call to GetLocalSurfaceNormal." );
1603 desc <<
" Parameters of solid: " << *daughterSolid
1605 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1607 "Surface Normal returned by Solid is not a Unit Vector." );
1625 message <<
"Function called when *NOT* at a Boundary." <<
G4endl;
1626 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1642 G4int enteringReplicaNo,
1646 switch (enteringVolumeType)
1651 G4Exception(
"G4ITNavigator2::GetMotherToDaughterTransform()",
1653 "Method NOT Implemented yet for replica volumes.");
1661 pParam->
ComputeSolid(enteringReplicaNo, pEnteringPhysVol);
1697 #ifdef G4DEBUG_NAVIGATION
1702 G4ThreeVector ExpectedBoundaryPointLocal;
1705 ExpectedBoundaryPointLocal =
1725 G4bool* pNormalCalculated)
1748 G4double normMag2 = globalNormal.mag2();
1749 if( std::fabs ( normMag2 - 1.0 ) <
perMillion )
1751 *pNormalCalculated =
true;
1758 message <<
" ERROR> Expected normal-global-frame to valid (unit vector) "
1759 <<
" - but |normal| = " << std::sqrt(normMag2)
1760 <<
" - and |normal|^ = " << normMag2
1761 <<
" which differs from 1.0 by " << normMag2 - 1.0 <<
G4endl
1763 message <<
"============================================================"
1767 message <<
" State of Navigator: " <<
G4endl;
1768 message << *
this <<
G4endl;
1770 message <<
"============================================================"
1773 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1775 "Value obtained from stored global-normal is not a unit vector.");
1792 #ifdef G4DEBUG_NAVIGATION
1802 edN <<
" State of Navigator: " <<
G4endl;
1806 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1808 "LocalExitNormalAndCheck() did not calculate Normal.");
1812 G4double localMag2= localNormal.mag2();
1817 edN <<
"G4ITNavigator2::GetGlobalExitNormal: "
1818 <<
" Using Local Normal - from call to GetLocalExitNormalAndCheck. "
1820 <<
" Local Exit Normal : " <<
" || = " << std::sqrt(localMag2)
1821 <<
" vec = " << localNormal <<
G4endl
1822 <<
" Global Exit Normal : " <<
" || = " << globalNormal.mag()
1823 <<
" vec = " << globalNormal <<
G4endl;
1826 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1828 "Value obtained from new local *solid* is incorrect.");
1829 localNormal = localNormal.unit();
1835 #ifdef G4DEBUG_NAVIGATION
1850 edDfn <<
"Found difference in normals in case of exiting mother "
1851 <<
"- when Get is called after ComputingStep " <<
G4endl;
1852 edDfn <<
" Magnitude of diff = " << diffNorm.mag() <<
G4endl;
1853 edDfn <<
" Normal stored (Global) = " << fExitNormalGlobalFrame
1855 edDfn <<
" Global Computed from Local = " << globalNormAgn <<
G4endl;
1856 G4Exception(
"G4ITNavigator::GetGlobalExitNormal()",
"GeomNav0003",
1862 return globalNormal;
1866 #define G4NEW_SAFETY 1
1884 #ifdef G4DEBUG_NAVIGATION
1888 G4cout <<
"*** G4ITNavigator2::ComputeSafety: ***" <<
G4endl
1889 <<
" Called at point: " << pGlobalpoint <<
G4endl;
1893 <<
" - Maximum length = " << pMaxLength <<
G4endl;
1896 G4cout <<
" ----- Upon entering Compute Safety:" <<
G4endl;
1908 if( endpointOnSurface && stayedOnEndpoint )
1910 #ifdef G4DEBUG_NAVIGATION
1913 G4cout <<
" G4Navigator::ComputeSafety() finds that point - "
1914 << pGlobalpoint <<
" - is on surface " <<
G4endl;
1944 #ifdef G4DEBUG_NAVIGATION
1947 G4cout <<
" G4ITNavigator2::ComputeSafety() relocates-in-volume to point: "
1948 << pGlobalpoint <<
G4endl;
1965 *motherPhysical, pMaxLength);
1966 newSafety= safetyTwo;
1971 newSafety= safetyOldVoxel;
1990 G4Exception(
"G4ITNavigator2::ComputeSafety()",
"GeomNav0001",
2016 #ifdef G4DEBUG_NAVIGATION
2021 G4cout <<
" Returned value of Safety = " << newSafety <<
G4endl;
2023 G4cout.precision(oldcoutPrec);
2064 #ifdef CHECK_ORDER_OF_METHODS
2067 G4Exception(
"G4Navigator::RecheckDistanceToCurrentBoundary()",
2069 "Method must be called after ComputeStep(), before call to LocateMethod.");
2099 G4ThreeVector dgDirection= nextLevelTrf.TransformAxis(localDirection);
2100 locatedDaug = candSolid->
Inside(dgPosition);
2109 true, &validExitNormal, &exitNormal);
2110 daughterStep= - distanceBackOut;
2137 daughterSafety= 0.0;
2146 *prDistance= daughterStep;
2147 if( prNewSafety ) { *prNewSafety= daughterSafety; }
2167 if( ProposedMove >= motherSafety )
2171 true, &validExitNormal, &exitNormal);
2175 motherStep= ProposedMove;
2180 motherSafety= motherSolid->
DistanceToIn(localPosition);
2181 if( ProposedMove >= motherSafety )
2191 if( prNewSafety ) { *prNewSafety= motherSafety; }
2200 *prDistance=
std::min( motherStep, daughterStep );
2203 *prNewSafety=
std::min( motherSafety, daughterSafety );
2229 G4cout <<
"The current state of G4Navigator is: " <<
G4endl;
2234 <<
" BlockedPhysicalVolume= " ;
2247 G4cout << std::setw(30) <<
" ExitNormal " <<
" "
2248 << std::setw( 5) <<
" Valid " <<
" "
2249 << std::setw( 9) <<
" Exiting " <<
" "
2250 << std::setw( 9) <<
" Entering" <<
" "
2251 << std::setw(15) <<
" Blocked:Volume " <<
" "
2252 << std::setw( 9) <<
" ReplicaNo" <<
" "
2253 << std::setw( 8) <<
" LastStepZero " <<
" "
2257 <<
", " << std::setw(7) <<
fExitNormal.z() <<
" ) "
2259 << std::setw( 9) <<
fExiting <<
" "
2262 G4cout << std::setw(15) <<
"None";
2276 G4cout.precision(oldcoutPrec);
2306 G4double shiftOrigin = std::sqrt(shiftOriginSafSq);
2309 if( diffShiftSaf > fAccuracyForWarning )
2313 std::ostringstream message, suggestion;
2314 message <<
"Accuracy error or slightly inaccurate position shift."
2316 <<
" The Step's starting point has moved "
2317 << std::sqrt(moveLenSq)/
mm <<
" mm " <<
G4endl
2318 <<
" since the last call to a Locate method." <<
G4endl
2319 <<
" This has resulted in moving "
2320 << shiftOrigin/
mm <<
" mm "
2321 <<
" from the last point at which the safety "
2322 <<
" was calculated " <<
G4endl
2323 <<
" which is more than the computed safety= "
2324 << fPreviousSafety/
mm <<
" mm at that point." <<
G4endl
2325 <<
" This difference is "
2326 << diffShiftSaf/
mm <<
" mm." <<
G4endl
2327 <<
" The tolerated accuracy is "
2328 << fAccuracyForException/
mm <<
" mm.";
2332 if( ((++warnNow % 100) == 1) )
2335 <<
" This problem can be due to either " <<
G4endl
2336 <<
" - a process that has proposed a displacement"
2337 <<
" larger than the current safety , or" <<
G4endl
2338 <<
" - inaccuracy in the computation of the safety";
2339 suggestion <<
"We suggest that you " << G4endl
2340 <<
" - find i) what particle is being tracked, and "
2341 <<
" ii) through what part of your geometry " << G4endl
2342 <<
" for example by re-running this event with "
2344 <<
" /tracking/verbose 1 " << G4endl
2345 <<
" - check which processes you declare for"
2346 <<
" this particle (and look at non-standard ones)"
2348 <<
" - in case, create a detailed logfile"
2349 <<
" of this event using:" << G4endl
2350 <<
" /tracking/verbose 6 ";
2354 message,
G4String(suggestion.str()));
2355 G4cout.precision(oldcoutPrec);
2356 G4cerr.precision(oldcerrPrec);
2358 #ifdef G4DEBUG_NAVIGATION
2361 G4cerr <<
"WARNING - G4ITNavigator2::ComputeStep()" <<
G4endl
2362 <<
" The Step's starting point has moved "
2363 << std::sqrt(moveLenSq) <<
"," <<
G4endl
2364 <<
" which has taken it to the limit of"
2365 <<
" the current safety. " <<
G4endl;
2370 if ( shiftOriginSafSq >
sqr(safetyPlus) )
2372 std::ostringstream message;
2373 message <<
"May lead to a crash or unreliable results." <<
G4endl
2374 <<
" Position has shifted considerably without"
2375 <<
" notifying the navigator !" <<
G4endl
2376 <<
" Tolerated safety: " << safetyPlus <<
G4endl
2377 <<
" Computed shift : " << shiftOriginSafSq;
2378 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
2395 G4int oldcoutPrec = os.precision(4);
2398 os <<
"The current state of G4ITNavigator2 is: " <<
G4endl;
2399 os <<
" ValidExitNormal= " << n.fValidExitNormal << G4endl
2400 <<
" ExitNormal = " << n.fExitNormal << G4endl
2401 <<
" Exiting = " << n.fExiting << G4endl
2402 <<
" Entering = " << n.fEntering << G4endl
2403 <<
" BlockedPhysicalVolume= " ;
2404 if (n.fBlockedPhysicalVolume==0)
2407 os << n.fBlockedPhysicalVolume->GetName();
2409 <<
" BlockedReplicaNo = " << n.fBlockedReplicaNo << G4endl
2410 <<
" LastStepWasZero = " << n.fLastStepWasZero << G4endl
2416 os << std::setw(30) <<
" ExitNormal " <<
" "
2417 << std::setw( 5) <<
" Valid " <<
" "
2418 << std::setw( 9) <<
" Exiting " <<
" "
2419 << std::setw( 9) <<
" Entering" <<
" "
2420 << std::setw(15) <<
" Blocked:Volume " <<
" "
2421 << std::setw( 9) <<
" ReplicaNo" <<
" "
2422 << std::setw( 8) <<
" LastStepZero " <<
" "
2424 os <<
"( " << std::setw(7) << n.fExitNormal.x()
2425 <<
", " << std::setw(7) << n.fExitNormal.y()
2426 <<
", " << std::setw(7) << n.fExitNormal.z() <<
" ) "
2427 << std::setw( 5) << n.fValidExitNormal <<
" "
2428 << std::setw( 9) << n.fExiting <<
" "
2429 << std::setw( 9) << n.fEntering <<
" ";
2430 if ( n.fBlockedPhysicalVolume==0 )
2431 { os << std::setw(15) <<
"None"; }
2433 { os << std::setw(15)<< n.fBlockedPhysicalVolume->GetName(); }
2434 os << std::setw( 9) << n.fBlockedReplicaNo <<
" "
2435 << std::setw( 8) << n.fLastStepWasZero <<
" "
2441 os <<
" Current Localpoint = " << n.fLastLocatedPointLocal <<
G4endl;
2442 os <<
" PreviousSftOrigin = " << n.fPreviousSftOrigin <<
G4endl;
2443 os <<
" PreviousSafety = " << n.fPreviousSafety <<
G4endl;
2447 os <<
"Current History: " <<
G4endl << n.fHistory;
2450 os.precision(oldcoutPrec);
#define fBlockedPhysicalVolume
G4SmartVoxelHeader * GetVoxelHeader() const
G4ITNavigatorState_Lock2 * GetNavigatorState()
virtual G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
#define fLastStepEndPointLocal
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)
const G4ThreeVector & GetTranslation() const
static const G4double kInfinity
virtual G4bool IsNested() const
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
virtual void SetupHierarchy()
std::ostringstream G4ExceptionDescription
void UpdateMaterial(G4Material *pMaterial)
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
void CheckNavigatorState() const
G4VoxelSafety * fpVoxelSafety
G4double GetSurfaceTolerance() const
void ResetNavigatorState()
void ResetStackAndState()
std::ostream & operator<<(std::ostream &os, const G4ITNavigator2 &n)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4VPhysicalVolume ¤tPhysical, G4double maxLength=DBL_MAX)
G4TouchableHistory * CreateTouchableHistory() const
G4VPhysicalVolume * fTopPhysical
G4double CheckNextStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
#define fLastTriedStepComputation
void SetSolid(G4VSolid *pSolid)
G4NavigatorState * fpNavigatorState
G4SmartVoxelNode * ParamVoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &globalDirection, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4bool &calculatedExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo)
virtual G4GeometryType GetEntityType() const =0
#define fWasLimitedByGeometry
G4VPhysicalVolume * NewNavigatorStateAndLocate(const G4ThreeVector &p, const G4ThreeVector &direction)
#define fExitNormalGlobalFrame
virtual ~G4ITNavigator2()
G4ReferenceCountedHandle< G4TouchableHistory > G4TouchableHistoryHandle
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
void ComputeTransformation(const G4int replicaNo, G4VPhysicalVolume *pVol, G4ThreeVector &point) const
G4int fAbandonThreshold_NoZeroSteps
G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX)
static double normal(HepRandomEngine *eptr)
G4ThreeVector ComputeLocalAxis(const G4ThreeVector &pVec) const
void SetNormalNavigation(G4NormalNavigation *fnormnav)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
virtual EInside Inside(const G4ThreeVector &p) const =0
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)
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
virtual G4int GetRegularStructureId() const =0
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX)
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
virtual G4VPVParameterisation * GetParameterisation() const =0
#define fChangedGrandMotherRefFrame
G4RegularNavigation fregularNav
G4NormalNavigation fnormalNav
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
EVolume CharacteriseDaughters() const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
#define fCalculatedExitNormal
EVolume VolumeType(const G4VPhysicalVolume *pVol) const
G4ReplicaNavigation freplicaNav
#define G4DEBUG_NAVIGATION
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid)
#define CheckNavigatorStateIsValid()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4ParameterisedNavigation fparamNav
virtual G4bool RecheckDistanceToCurrentBoundary(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double CurrentProposedStepLength, G4double *prDistance, G4double *prNewSafety=0) const
#define fGrandMotherExitNormal
static const double perMillion
#define fBlockedReplicaNo
G4int fActionThreshold_NoZeroSteps
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)
G4LogicalVolume * GetLogicalVolume() const
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &rGlobPoint) const
G4VoxelNavigation fvoxelNav
#define fPreviousSftOrigin
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
void SetNavigatorState(G4ITNavigatorState_Lock2 *)
virtual G4int GetCopyNo() const =0
void ComputeStepLog(const G4ThreeVector &pGlobalpoint, G4double moveLenSq) const
const G4AffineTransform & GetGlobalToLocalTransform() const
G4int GetDaughtersRegularStructureId(const G4LogicalVolume *pLog) const
const G4RotationMatrix * GetRotation() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4SmartVoxelNode * VoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
G4int GetVerboseLevel() const
G4bool EnteredDaughterVolume() const
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
#define fLocatedOutsideWorld
virtual G4ThreeVector GetLocalExitNormalAndCheck(const G4ThreeVector &point, G4bool *valid)
const G4NavigationHistory * GetHistory() const
virtual void ResetState()
G4int MoveUpHistory(G4int num_levels=1)
virtual G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
G4double ComputeSafety(const G4ThreeVector &globalPoint, const G4ThreeVector &localPoint, G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
#define fLastLocatedPointLocal
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
virtual 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)
void SetVerboseLevel(G4int level)
EInside BackLocate(G4NavigationHistory &history, const G4ThreeVector &globalPoint, G4ThreeVector &localPoint, const G4bool &exiting, G4bool ¬KnownInside) const
const G4AffineTransform GetLocalToGlobalTransform() const
virtual G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true, G4int errMax=1)
static G4GeometryTolerance * GetInstance()
G4VSolid * GetSolid() const
virtual G4TouchableHistoryHandle CreateTouchableHistoryHandle() const
G4GLOB_DLL std::ostream G4cerr
EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const
G4AffineTransform GetMotherToDaughterTransform(G4VPhysicalVolume *dVolume, G4int dReplicaNo, EVolume dVolumeType)