57#define fHistory fpNavigatorState->fHistory
58#define fLastTriedStepComputation fpNavigatorState->fLastTriedStepComputation
59#define fEnteredDaughter fpNavigatorState->fEnteredDaughter
60#define fExitedMother fpNavigatorState->fExitedMother
61#define fWasLimitedByGeometry fpNavigatorState->fWasLimitedByGeometry
62#define fStepEndPoint fpNavigatorState->fStepEndPoint
63#define fLastStepEndPointLocal fpNavigatorState->fLastStepEndPointLocal
64#define fPushed fpNavigatorState->fPushed
65#define fLastTriedStepComputation fpNavigatorState->fLastTriedStepComputation
66#define fEntering fpNavigatorState->fEntering
67#define fExiting fpNavigatorState->fExiting
68#define fBlockedPhysicalVolume fpNavigatorState->fBlockedPhysicalVolume
69#define fBlockedReplicaNo fpNavigatorState->fBlockedReplicaNo
70#define fLastLocatedPointLocal fpNavigatorState->fLastLocatedPointLocal
71#define fLocatedOutsideWorld fpNavigatorState->fLocatedOutsideWorld
72#define fValidExitNormal fpNavigatorState->fValidExitNormal
73#define fExitNormal fpNavigatorState->fExitNormal
74#define fGrandMotherExitNormal fpNavigatorState->fGrandMotherExitNormal
75#define fChangedGrandMotherRefFrame fpNavigatorState->fChangedGrandMotherRefFrame
76#define fExitNormalGlobalFrame fpNavigatorState->fExitNormalGlobalFrame
77#define fCalculatedExitNormal fpNavigatorState->fCalculatedExitNormal
78#define fLastStepWasZero fpNavigatorState->fLastStepWasZero
79#define fLocatedOnEdge fpNavigatorState->fLocatedOnEdge
80#define fNumberZeroSteps fpNavigatorState->fNumberZeroSteps
81#define fPreviousSftOrigin fpNavigatorState->fPreviousSftOrigin
82#define fPreviousSafety fpNavigatorState->fPreviousSafety
102 fActionThreshold_NoZeroSteps = 1000;
103 fAbandonThreshold_NoZeroSteps = 2500;
157 const G4bool relativeSearch,
158 const G4bool ignoreDirection )
161 G4bool notKnownContained=
true, noResult;
173 if( considerDirection && pGlobalDirection !=
nullptr )
175 globalDirection=*pGlobalDirection;
183 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup: ***" <<
G4endl;
185 <<
" Globalpoint = " << globalPoint <<
G4endl
186 <<
" RelativeSearch = " << relativeSearch <<
G4endl;
192 G4cout.precision(oldcoutPrec);
196 G4int noLevelsExited=0 ;
198 if ( !relativeSearch )
293 G4Exception(
"G4ITNavigator2::LocateGlobalPointAndSetup()",
295 "Not applicable for external volumes.");
300 localPoint =
fHistory.GetTopTransform().TransformPoint(globalPoint);
301 notKnownContained =
false;
323 while (notKnownContained)
327 targetSolid =
fHistory.GetTopVolume()->GetLogicalVolume()->GetSolid();
328 localPoint =
fHistory.GetTopTransform().TransformPoint(globalPoint);
329 insideCode = targetSolid->
Inside(localPoint);
333 G4String solidResponse =
"-kInside-";
335 solidResponse =
"-kOutside-";
337 solidResponse =
"-kSurface-";
338 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup(): ***" <<
G4endl
339 <<
" Invoked Inside() for solid: " << targetSolid->
GetName()
340 <<
". Solid replied: " << solidResponse <<
G4endl
341 <<
" For local point p: " << localPoint <<
G4endl;
366 if( noLevelsExited > 1 )
371 if( mRot !=
nullptr )
390 if( (!
fExiting)&&considerDirection )
395 G4bool directionExiting =
false;
397 fHistory.GetTopTransform().TransformAxis(globalDirection);
402 localPoint=
fHistory.GetTopTransform().TransformPoint(globalPoint);
406 directionExiting = normal.
dot(localDirection) > 0.0;
407 isExiting = isExiting || directionExiting;
423 if( noLevelsExited > 1 )
429 if( mRot !=
nullptr )
446 notKnownContained=
false;
451 notKnownContained=
false;
471 targetPhysical =
fHistory.GetTopVolume();
472 if (targetPhysical ==
nullptr) {
break; }
530 G4Exception(
"G4ITNavigator2::LocateGlobalPointAndSetup()",
532 "Not applicable for external volumes.");
558 if( mRot !=
nullptr )
568#ifdef G4DEBUG_NAVIGATION
572 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup() ***" <<
G4endl;
587 if (targetPhysical !=
nullptr) { curPhysVol_Name = targetPhysical->
GetName(); }
588 G4cout <<
" Return value = new volume = " << curPhysVol_Name <<
G4endl;
593 G4cout <<
"Upon exiting LocateGlobalPointAndSetup():" <<
G4endl;
596 G4cout.precision(oldcoutPrec);
602 return targetPhysical;
623#ifdef G4DEBUG_NAVIGATION
633#ifdef G4DEBUG_NAVIGATION
636 G4cout <<
"Entering LocateGlobalWithinVolume(): History = " <<
G4endl;
656 if ( pVoxelHeader !=
nullptr )
670 G4Exception(
"G4ITNavigator2::LocateGlobalPointWithinVolume()",
672 "Not applicable for replicated volumes.");
675 G4Exception(
"G4ITNavigator2::LocateGlobalPointWithinVolume()",
677 "Not applicable for external volumes.");
702 exceptionDescription <<
"The navigator state is NULL. ";
703 exceptionDescription <<
"Either NewNavigatorStateAndLocate was not called ";
704 exceptionDescription <<
"or the provided navigator state was already NULL.";
706 G4Exception(
"G4ITNavigator::CheckNavigatorStateIsValid",
736 exceptionDescription <<
"No World Volume";
753 exceptionDescription <<
"No World Volume";
773 exceptionDescription <<
"No World Volume";
775 G4Exception(
"G4ITNavigator::NewNavigatorStateAndLocate",
915 const G4double pCurrentProposedStepLength,
939 G4cout <<
"*** G4ITNavigator2::ComputeStep: ***" <<
G4endl;
941 <<
" - Proposed step length = " << pCurrentProposedStepLength
943#ifdef G4DEBUG_NAVIGATION
947 <<
" Globalpoint = " << std::setw(25) << pGlobalpoint <<
G4endl
948 <<
" Direction = " << std::setw(25) << pDirection <<
G4endl;
965 G4double moveLenSq = (newLocalPoint-oldLocalPoint).mag2();
970 ComputeStepLog(pGlobalpoint, moveLenSq);
988 pCurrentProposedStepLength,
1005 pCurrentProposedStepLength,
1029 if(
fHistory.GetTopVolume()->GetRegularStructureId() == 0 )
1033 "Point is relocated in voxels, while it should be outside!");
1036 pCurrentProposedStepLength,
1051 pCurrentProposedStepLength,
1070 pCurrentProposedStepLength,
1084 pCurrentProposedStepLength,
1096 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1100 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1111 G4bool calculatedExitNormal;
1116 pCurrentProposedStepLength,
1120 calculatedExitNormal,
1157#ifdef G4DEBUG_NAVIGATION
1160 G4cout <<
"G4ITNavigator2::ComputeStep(): another zero step, # "
1162 <<
" at " << pGlobalpoint
1163 <<
" in volume " << motherPhysical->
GetName()
1175 std::ostringstream message;
1176 message <<
"Track stuck or not moving." <<
G4endl
1177 <<
" Track stuck, not moving for "
1179 <<
" in volume -" << motherPhysical->
GetName()
1180 <<
"- at point " << pGlobalpoint <<
G4endl
1181 <<
" direction: " << pDirection <<
"." <<
G4endl
1182 <<
" Potential geometry or navigation problem !"
1184 <<
" Trying pushing it of " << Step <<
" mm ...";
1185 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
1186 JustWarning, message,
"Potential overlap in geometry!");
1195 std::ostringstream message;
1196 message <<
"Stuck Track: potential geometry or navigation problem."
1198 <<
" Track stuck, not moving for "
1200 <<
" in volume -" << motherPhysical->
GetName()
1201 <<
"- at point " << pGlobalpoint <<
G4endl
1202 <<
" direction: " << pDirection <<
".";
1204 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1217 + std::min(Step,pCurrentProposedStepLength) * pDirection;
1222#ifdef G4DEBUG_NAVIGATION
1225 G4cout <<
" At G4Nav CompStep End - if(exiting) - fExiting= " <<
fExiting
1262 if( mRot !=
nullptr )
1286#ifdef G4DEBUG_NAVIGATION
1289 desc <<
"Problem in ComputeStep: Replica Navigation did not provide"
1290 <<
" valid exit Normal. " <<
G4endl;
1291 desc <<
" Do not know how calculate it in this case." <<
G4endl;
1292 desc <<
" Location = " << finalLocalPoint <<
G4endl;
1293 desc <<
" Volume name = " << motherPhysical->
GetName()
1295 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1296 JustWarning, desc,
"Normal not available for exiting.");
1340 G4cout <<
" Returned step= " << Step;
1342 if( Step == kInfinity )
1344 G4cout <<
" Requested step= " << pCurrentProposedStepLength ;
1362 const G4double pCurrentProposedStepLength,
1376 pCurrentProposedStepLength,
1445 for ( i=1; i<=cdepth; i++ )
1448 switch (
fHistory.GetVolumeType(i) )
1459 replicaNo =
fHistory.GetReplicaNo(i);
1484 ComputeMaterial(replicaNo, current, pTouchable) );
1492 "Not applicable for external volumes.");
1521 if( candidateLogical !=
nullptr )
1543 currentSolid= candidateLogical->
GetSolid();
1544 inSideIt = currentSolid->
Inside(daughterPointOwnLocal);
1545 onSurface = (inSideIt ==
kSurface);
1550 safety = (currentSolid->
DistanceToIn(daughterPointOwnLocal));
1553 else if (inSideIt ==
kInside )
1555 safety = (currentSolid->
DistanceToOut(daughterPointOwnLocal));
1562 nextSolidExitNormal =
1567 ExitNormal = -nextSolidExitNormal;
1575 std::ostringstream message;
1576 message <<
"Point not on surface ! " <<
G4endl
1578 << daughterPointOwnLocal <<
G4endl
1579 <<
" Physical volume = "
1581 <<
" Logical volume = "
1583 <<
" Solid = " << currentSolid->
GetName()
1586 << *currentSolid <<
G4endl;
1589 message <<
"Point is Outside. " <<
G4endl
1590 <<
" Safety (from outside) = " << safety <<
G4endl;
1594 message <<
"Point is Inside. " <<
G4endl
1595 <<
" Safety (from inside) = " << safety <<
G4endl;
1597 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
"GeomNav1001",
1615 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1617 "Incorrect call to GetLocalSurfaceNormal." );
1627 if( std::fabs(ExitNormal.
mag2()-1.0 ) > CLHEP::perMillion )
1630 desc <<
" Parameters of solid: " << *daughterSolid
1632 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1634 "Surface Normal returned by Solid is not a Unit Vector." );
1652 message <<
"Function called when *NOT* at a Boundary." <<
G4endl;
1653 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1669 G4int enteringReplicaNo,
1673 switch (enteringVolumeType)
1678 G4Exception(
"G4ITNavigator2::GetMotherToDaughterTransform()",
1680 "Method NOT Implemented yet for replica volumes.");
1688 pParam->
ComputeSolid(enteringReplicaNo, pEnteringPhysVol);
1702 G4Exception(
"G4ITNavigator2::GetMotherToDaughterTransform()",
1704 "Not applicable for external volumes.");
1720GetLocalExitNormalAndCheck(
1729#ifdef G4DEBUG_NAVIGATION
1737 ExpectedBoundaryPointLocal =
1757 G4bool* pNormalCalculated)
1781 if( std::fabs ( normMag2 - 1.0 ) < perMillion )
1783 *pNormalCalculated =
true;
1790 message <<
" ERROR> Expected normal-global-frame to valid (unit vector) "
1791 <<
" - but |normal| = " << std::sqrt(normMag2)
1792 <<
" - and |normal|^ = " << normMag2
1793 <<
" which differs from 1.0 by " << normMag2 - 1.0 <<
G4endl
1795 message <<
"============================================================"
1799 message <<
" State of Navigator: " <<
G4endl;
1800 message << *
this <<
G4endl;
1802 message <<
"============================================================"
1805 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1807 "Value obtained from stored global-normal is not a unit vector.");
1824#ifdef G4DEBUG_NAVIGATION
1834 edN <<
" State of Navigator: " <<
G4endl;
1838 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1840 "LocalExitNormalAndCheck() did not calculate Normal.");
1845 if( validNormal && (std::fabs(localMag2-1.0)) > CLHEP::perMillion )
1849 edN <<
"G4ITNavigator2::GetGlobalExitNormal: "
1850 <<
" Using Local Normal - from call to GetLocalExitNormalAndCheck. "
1852 <<
" Local Exit Normal : " <<
" || = " << std::sqrt(localMag2)
1853 <<
" vec = " << localNormal <<
G4endl
1854 <<
" Global Exit Normal : " <<
" || = " << globalNormal.
mag()
1855 <<
" vec = " << globalNormal <<
G4endl;
1858 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1860 "Value obtained from new local *solid* is incorrect.");
1861 localNormal = localNormal.
unit();
1867#ifdef G4DEBUG_NAVIGATION
1879 if( diffNorm.
mag2() > perMillion*CLHEP::perMillion)
1882 edDfn <<
"Found difference in normals in case of exiting mother "
1883 <<
"- when Get is called after ComputingStep " <<
G4endl;
1884 edDfn <<
" Magnitude of diff = " << diffNorm.
mag() <<
G4endl;
1887 edDfn <<
" Global Computed from Local = " << globalNormAgn <<
G4endl;
1888 G4Exception(
"G4ITNavigator::GetGlobalExitNormal()",
"GeomNav0003",
1894 return globalNormal;
1898#define G4NEW_SAFETY 1
1916#ifdef G4DEBUG_NAVIGATION
1920 G4cout <<
"*** G4ITNavigator2::ComputeSafety: ***" <<
G4endl
1921 <<
" Called at point: " << pGlobalpoint <<
G4endl;
1925 <<
" - Maximum length = " << pMaxLength <<
G4endl;
1928 G4cout <<
" ----- Upon entering Compute Safety:" <<
G4endl;
1940 if( endpointOnSurface && stayedOnEndpoint )
1942#ifdef G4DEBUG_NAVIGATION
1945 G4cout <<
" G4Navigator::ComputeSafety() finds that point - "
1946 << pGlobalpoint <<
" - is on surface " <<
G4endl;
1976#ifdef G4DEBUG_NAVIGATION
1979 G4cout <<
" G4ITNavigator2::ComputeSafety() relocates-in-volume to point: "
1980 << pGlobalpoint <<
G4endl;
1993 if ( pVoxelHeader !=
nullptr )
1997 *motherPhysical, pMaxLength);
1998 newSafety= safetyTwo;
2004 newSafety= safetyOldVoxel;
2023 G4Exception(
"G4ITNavigator2::ComputeSafety()",
"GeomNav0001",
2029 "Not applicable for external volumes.");
2054#ifdef G4DEBUG_NAVIGATION
2059 G4cout <<
" Returned value of Safety = " << newSafety <<
G4endl;
2061 G4cout.precision(oldcoutPrec);
2102#ifdef CHECK_ORDER_OF_METHODS
2105 G4Exception(
"G4Navigator::RecheckDistanceToCurrentBoundary()",
2107 "Method must be called after ComputeStep(), before call to LocateMethod.");
2138 locatedDaug = candSolid->
Inside(dgPosition);
2147 true, &validExitNormal, &exitNormal);
2148 daughterStep= - distanceBackOut;
2152 if( prNewSafety !=
nullptr )
2165 if( prNewSafety !=
nullptr )
2175 daughterSafety= 0.0;
2184 *prDistance= daughterStep;
2185 if( prNewSafety !=
nullptr ) { *prNewSafety= daughterSafety; }
2205 if( ProposedMove >= motherSafety )
2209 true, &validExitNormal, &exitNormal);
2213 motherStep= ProposedMove;
2218 motherSafety= motherSolid->
DistanceToIn(localPosition);
2219 if( ProposedMove >= motherSafety )
2229 if( prNewSafety !=
nullptr ) { *prNewSafety= motherSafety; }
2238 *prDistance= std::min( motherStep, daughterStep );
2239 if( prNewSafety !=
nullptr )
2241 *prNewSafety= std::min( motherSafety, daughterSafety );
2267 G4cout <<
"The current state of G4Navigator is: " <<
G4endl;
2272 <<
" BlockedPhysicalVolume= " ;
2285 G4cout << std::setw(30) <<
" ExitNormal " <<
" "
2286 << std::setw( 5) <<
" Valid " <<
" "
2287 << std::setw( 9) <<
" Exiting " <<
" "
2288 << std::setw( 9) <<
" Entering" <<
" "
2289 << std::setw(15) <<
" Blocked:Volume " <<
" "
2290 << std::setw( 9) <<
" ReplicaNo" <<
" "
2291 << std::setw( 8) <<
" LastStepZero " <<
" "
2295 <<
", " << std::setw(7) <<
fExitNormal.z() <<
" ) "
2297 << std::setw( 9) <<
fExiting <<
" "
2301 G4cout << std::setw(15) <<
"None";
2318 G4cout.precision(oldcoutPrec);
2325void G4ITNavigator2::ComputeStepLog(
const G4ThreeVector& pGlobalpoint,
2348 G4double shiftOrigin = std::sqrt(shiftOriginSafSq);
2351 if( diffShiftSaf > fAccuracyForWarning )
2355 std::ostringstream message, suggestion;
2356 message <<
"Accuracy error or slightly inaccurate position shift."
2358 <<
" The Step's starting point has moved "
2359 << std::sqrt(moveLenSq)/mm <<
" mm " <<
G4endl
2360 <<
" since the last call to a Locate method." <<
G4endl
2361 <<
" This has resulted in moving "
2362 << shiftOrigin/mm <<
" mm "
2363 <<
" from the last point at which the safety "
2364 <<
" was calculated " <<
G4endl
2365 <<
" which is more than the computed safety= "
2367 <<
" This difference is "
2368 << diffShiftSaf/mm <<
" mm." <<
G4endl
2369 <<
" The tolerated accuracy is "
2370 << fAccuracyForException/mm <<
" mm.";
2374 if( ((++warnNow % 100) == 1) )
2377 <<
" This problem can be due to either " <<
G4endl
2378 <<
" - a process that has proposed a displacement"
2379 <<
" larger than the current safety , or" <<
G4endl
2380 <<
" - inaccuracy in the computation of the safety";
2381 suggestion <<
"We suggest that you " <<
G4endl
2382 <<
" - find i) what particle is being tracked, and "
2383 <<
" ii) through what part of your geometry " <<
G4endl
2384 <<
" for example by re-running this event with "
2386 <<
" /tracking/verbose 1 " <<
G4endl
2387 <<
" - check which processes you declare for"
2388 <<
" this particle (and look at non-standard ones)"
2390 <<
" - in case, create a detailed logfile"
2391 <<
" of this event using:" <<
G4endl
2392 <<
" /tracking/verbose 6 ";
2396 message,
G4String(suggestion.str()));
2397 G4cout.precision(oldcoutPrec);
2398 G4cerr.precision(oldcerrPrec);
2400#ifdef G4DEBUG_NAVIGATION
2403 G4cerr <<
"WARNING - G4ITNavigator2::ComputeStep()" <<
G4endl
2404 <<
" The Step's starting point has moved "
2405 << std::sqrt(moveLenSq) <<
"," <<
G4endl
2406 <<
" which has taken it to the limit of"
2407 <<
" the current safety. " <<
G4endl;
2412 if ( shiftOriginSafSq >
sqr(safetyPlus) )
2414 std::ostringstream message;
2415 message <<
"May lead to a crash or unreliable results." <<
G4endl
2416 <<
" Position has shifted considerably without"
2417 <<
" notifying the navigator !" <<
G4endl
2418 <<
" Tolerated safety: " << safetyPlus <<
G4endl
2419 <<
" Computed shift : " << shiftOriginSafSq;
2420 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
2437 G4long oldcoutPrec = os.precision(4);
2438 if( n.fVerbose >= 4 )
2440 os <<
"The current state of G4ITNavigator2 is: " <<
G4endl;
2441 os <<
" ValidExitNormal= " << n.fValidExitNormal <<
G4endl
2442 <<
" ExitNormal = " << n.fExitNormal <<
G4endl
2443 <<
" Exiting = " << n.fExiting <<
G4endl
2444 <<
" Entering = " << n.fEntering <<
G4endl
2445 <<
" BlockedPhysicalVolume= " ;
2447 if (n.fBlockedPhysicalVolume==
nullptr)
2453 os << n.fBlockedPhysicalVolume->GetName();
2457 <<
" BlockedReplicaNo = " << n.fBlockedReplicaNo <<
G4endl
2458 <<
" LastStepWasZero = " << n.fLastStepWasZero <<
G4endl
2461 if( ( 1 < n.fVerbose) && (n.fVerbose < 4) )
2464 os << std::setw(30) <<
" ExitNormal " <<
" "
2465 << std::setw( 5) <<
" Valid " <<
" "
2466 << std::setw( 9) <<
" Exiting " <<
" "
2467 << std::setw( 9) <<
" Entering" <<
" "
2468 << std::setw(15) <<
" Blocked:Volume " <<
" "
2469 << std::setw( 9) <<
" ReplicaNo" <<
" "
2470 << std::setw( 8) <<
" LastStepZero " <<
" "
2472 os <<
"( " << std::setw(7) << n.fExitNormal.x()
2473 <<
", " << std::setw(7) << n.fExitNormal.y()
2474 <<
", " << std::setw(7) << n.fExitNormal.z() <<
" ) "
2475 << std::setw( 5) << n.fValidExitNormal <<
" "
2476 << std::setw( 9) << n.fExiting <<
" "
2477 << std::setw( 9) << n.fEntering <<
" ";
2479 if ( n.fBlockedPhysicalVolume==
nullptr )
2480 { os << std::setw(15) <<
"None"; }
2482 { os << std::setw(15)<< n.fBlockedPhysicalVolume->GetName(); }
2484 os << std::setw( 9) << n.fBlockedReplicaNo <<
" "
2485 << std::setw( 8) << n.fLastStepWasZero <<
" "
2488 if( n.fVerbose > 2 )
2491 os <<
" Current Localpoint = " << n.fLastLocatedPointLocal <<
G4endl;
2492 os <<
" PreviousSftOrigin = " << n.fPreviousSftOrigin <<
G4endl;
2493 os <<
" PreviousSafety = " << n.fPreviousSafety <<
G4endl;
2495 if( n.fVerbose > 3 || n.fVerbose == 0 )
2497 os <<
"Current History: " <<
G4endl << n.fHistory;
2500 os.precision(oldcoutPrec);
2514 return solid->
Inside(localPoint);
2527 std::vector<std::vector<G4double> > fExtend;
2545 for(
G4int i = 0 ; i < 3 ; ++i)
const G4double kCarTolerance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define fWasLimitedByGeometry
#define G4DEBUG_NAVIGATION
#define fLastStepEndPointLocal
#define fLocatedOutsideWorld
#define fExitNormalGlobalFrame
#define fBlockedReplicaNo
#define fGrandMotherExitNormal
#define fLastLocatedPointLocal
#define fChangedGrandMotherRefFrame
#define fBlockedPhysicalVolume
#define fCalculatedExitNormal
std::ostream & operator<<(std::ostream &os, const G4ITNavigator2 &n)
#define fPreviousSftOrigin
#define fLastTriedStepComputation
#define CheckNavigatorStateIsValid()
CLHEP::Hep3Vector G4ThreeVector
G4ReferenceCountedHandle< G4VTouchable > G4TouchableHandle
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
double dot(const Hep3Vector &) const
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
G4ReplicaNavigation freplicaNav
void GetRandomInCurrentVolume(G4ThreeVector &rndmPoint) const
void SetVerboseLevel(G4int level)
virtual G4ThreeVector GetLocalExitNormalAndCheck(const G4ThreeVector &point, G4bool *valid)
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &rGlobPoint) const
virtual void ResetState()
void SetNavigatorState(G4ITNavigatorState_Lock2 *)
G4VPhysicalVolume * NewNavigatorStateAndLocate(const G4ThreeVector &p, const G4ThreeVector &direction)
G4TouchableHistory * CreateTouchableHistory() const
G4VoxelNavigation fvoxelNav
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
G4NormalNavigation fnormalNav
void CheckNavigatorState() const
G4double CheckNextStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
const G4AffineTransform & GetGlobalToLocalTransform() const
G4AffineTransform GetMotherToDaughterTransform(G4VPhysicalVolume *dVolume, G4int dReplicaNo, EVolume dVolumeType)
virtual void SetupHierarchy()
G4int GetDaughtersRegularStructureId(const G4LogicalVolume *pLog) const
virtual G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const
const G4AffineTransform GetLocalToGlobalTransform() const
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid)
G4ITNavigatorState_Lock2 * GetNavigatorState()
G4RegularNavigation fregularNav
G4ParameterisedNavigation fparamNav
G4VoxelSafety * fpVoxelSafety
G4int GetVerboseLevel() const
void ResetStackAndState()
EVolume VolumeType(const G4VPhysicalVolume *pVol) const
G4NavigatorState * fpNavigatorState
G4VPhysicalVolume * fTopPhysical
EInside InsideCurrentVolume(const G4ThreeVector &globalPoint) const
virtual G4TouchableHandle CreateTouchableHistoryHandle() const
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
virtual G4bool RecheckDistanceToCurrentBoundary(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double CurrentProposedStepLength, G4double *prDistance, G4double *prNewSafety=nullptr) const
void ResetNavigatorState()
virtual ~G4ITNavigator2()
G4ThreeVector ComputeLocalAxis(const G4ThreeVector &pVec) const
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=nullptr, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
G4bool EnteredDaughterVolume() const
G4VSolid * GetSolid() const
EVolume CharacteriseDaughters() const
const G4String & GetName() const
void SetSolid(G4VSolid *pSolid)
G4SmartVoxelHeader * GetVoxelHeader() const
void UpdateMaterial(G4Material *pMaterial)
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint) final
G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX) final
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
G4SmartVoxelNode * ParamVoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)
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) override
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX) override
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint) override
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) final
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint) final
void SetNormalNavigation(G4NormalNavigation *fnormnav)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX) final
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)
G4double ComputeSafety(const G4ThreeVector &globalPoint, const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX) const
void ComputeTransformation(const G4int replicaNo, G4VPhysicalVolume *pVol, G4ThreeVector &point) const
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
EInside BackLocate(G4NavigationHistory &history, const G4ThreeVector &globalPoint, G4ThreeVector &localPoint, const G4bool &exiting, G4bool ¬KnownInside) const
virtual G4int MoveUpHistory(G4int num_levels=1)
virtual const G4NavigationHistory * GetHistory() const
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
virtual G4bool IsNested() const
const G4RotationMatrix * GetRotation() const
const G4ThreeVector GetTranslation() const
virtual G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true, G4int errMax=1)
G4LogicalVolume * GetLogicalVolume() const
virtual G4int GetCopyNo() const =0
const G4String & GetName() const
virtual G4int GetRegularStructureId() const =0
virtual G4VPVParameterisation * GetParameterisation() const =0
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
virtual G4GeometryType GetEntityType() const =0
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX) override
virtual G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint) override
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) override
G4SmartVoxelNode * VoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4VPhysicalVolume ¤tPhysical, G4double maxLength=DBL_MAX)