58 #define fHistory fpNavigatorState->fHistory
59 #define fLastTriedStepComputation fpNavigatorState->fLastTriedStepComputation
60 #define fEnteredDaughter fpNavigatorState->fEnteredDaughter
61 #define fExitedMother fpNavigatorState->fExitedMother
62 #define fWasLimitedByGeometry fpNavigatorState->fWasLimitedByGeometry
63 #define fStepEndPoint fpNavigatorState->fStepEndPoint
64 #define fLastStepEndPointLocal fpNavigatorState->fLastStepEndPointLocal
65 #define fPushed fpNavigatorState->fPushed
66 #define fLastTriedStepComputation fpNavigatorState->fLastTriedStepComputation
67 #define fEntering fpNavigatorState->fEntering
68 #define fExiting fpNavigatorState->fExiting
69 #define fBlockedPhysicalVolume fpNavigatorState->fBlockedPhysicalVolume
70 #define fBlockedReplicaNo fpNavigatorState->fBlockedReplicaNo
71 #define fLastLocatedPointLocal fpNavigatorState->fLastLocatedPointLocal
72 #define fLocatedOutsideWorld fpNavigatorState->fLocatedOutsideWorld
73 #define fValidExitNormal fpNavigatorState->fValidExitNormal
74 #define fExitNormal fpNavigatorState->fExitNormal
75 #define fGrandMotherExitNormal fpNavigatorState->fGrandMotherExitNormal
76 #define fChangedGrandMotherRefFrame fpNavigatorState->fChangedGrandMotherRefFrame
77 #define fExitNormalGlobalFrame fpNavigatorState->fExitNormalGlobalFrame
78 #define fCalculatedExitNormal fpNavigatorState->fCalculatedExitNormal
79 #define fLastStepWasZero fpNavigatorState->fLastStepWasZero
80 #define fLocatedOnEdge fpNavigatorState->fLocatedOnEdge
81 #define fNumberZeroSteps fpNavigatorState->fNumberZeroSteps
82 #define fPreviousSftOrigin fpNavigatorState->fPreviousSftOrigin
83 #define fPreviousSafety fpNavigatorState->fPreviousSafety
102 fTopPhysical(0), fCheck(false),
106 fActionThreshold_NoZeroSteps = 1000;
107 fAbandonThreshold_NoZeroSteps = 2500;
161 const G4bool relativeSearch,
162 const G4bool ignoreDirection )
165 G4bool notKnownContained=
true, noResult;
177 if( considerDirection && pGlobalDirection != 0 )
179 globalDirection=*pGlobalDirection;
186 static int nCalls = 0;
188 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup: ***" <<
G4endl;
189 G4cout <<
" Called with arguments: " << G4endl
190 <<
" Globalpoint = " << globalPoint << G4endl
191 <<
" RelativeSearch = " << relativeSearch <<
G4endl;
197 G4cout.precision(oldcoutPrec);
203 G4int noLevelsExited=0 ;
204 G4int noLevelsEntered= 0;
206 if ( !relativeSearch )
305 localPoint =
fHistory.GetTopTransform().TransformPoint(globalPoint);
306 notKnownContained =
false;
328 while (notKnownContained)
332 targetSolid =
fHistory.GetTopVolume()->GetLogicalVolume()->GetSolid();
333 localPoint =
fHistory.GetTopTransform().TransformPoint(globalPoint);
334 insideCode = targetSolid->
Inside(localPoint);
338 G4String solidResponse =
"-kInside-";
340 solidResponse =
"-kOutside-";
342 solidResponse =
"-kSurface-";
343 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup(): ***" <<
G4endl
344 <<
" Invoked Inside() for solid: " << targetSolid->
GetName()
345 <<
". Solid replied: " << solidResponse <<
G4endl
346 <<
" For local point p: " << localPoint <<
G4endl;
371 if( noLevelsExited > 1 )
395 if( (!
fExiting)&&considerDirection )
400 G4bool directionExiting =
false;
402 fHistory.GetTopTransform().TransformAxis(globalDirection);
407 localPoint=
fHistory.GetTopTransform().TransformPoint(globalPoint);
411 directionExiting = normal.
dot(localDirection) > 0.0;
412 isExiting = isExiting || directionExiting;
428 if( noLevelsExited > 1 )
451 notKnownContained=
false;
456 notKnownContained=
false;
476 targetPhysical =
fHistory.GetTopVolume();
477 if (!targetPhysical) {
break; }
570 #ifdef G4DEBUG_NAVIGATION
574 G4cout <<
"*** G4ITNavigator2::LocateGlobalPointAndSetup() ***" <<
G4endl;
589 if (targetPhysical) { curPhysVol_Name = targetPhysical->
GetName(); }
590 G4cout <<
" Return value = new volume = " << curPhysVol_Name <<
G4endl;
595 G4cout <<
"Upon exiting LocateGlobalPointAndSetup():" <<
G4endl;
598 G4cout.precision(oldcoutPrec);
604 return targetPhysical;
625 #ifdef G4DEBUG_NAVIGATION
635 #ifdef G4DEBUG_NAVIGATION
638 G4cout <<
"Entering LocateGlobalWithinVolume(): History = " <<
G4endl;
672 G4Exception(
"G4ITNavigator2::LocateGlobalPointWithinVolume()",
674 "Not applicable for replicated volumes.");
699 exceptionDescription <<
"The navigator state is NULL. ";
700 exceptionDescription <<
"Either NewNavigatorStateAndLocate was not called ";
701 exceptionDescription <<
"or the provided navigator state was already NULL.";
703 G4Exception(
"G4ITNavigator::CheckNavigatorStateIsValid",
733 exceptionDescription <<
"No World Volume";
750 exceptionDescription <<
"No World Volume";
770 exceptionDescription <<
"No World Volume";
772 G4Exception(
"G4ITNavigator::NewNavigatorStateAndLocate",
912 const G4double pCurrentProposedStepLength,
939 G4cout <<
"*** G4ITNavigator2::ComputeStep: ***" <<
G4endl;
941 <<
" - Proposed step length = " << pCurrentProposedStepLength
943 #ifdef G4DEBUG_NAVIGATION
946 G4cout <<
" Called with the arguments: " << G4endl
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",
1107 G4bool calculatedExitNormal;
1112 pCurrentProposedStepLength,
1116 calculatedExitNormal,
1153 #ifdef G4DEBUG_NAVIGATION
1156 G4cout <<
"G4ITNavigator2::ComputeStep(): another zero step, # "
1158 <<
" at " << pGlobalpoint
1159 <<
" in volume " << motherPhysical->
GetName()
1160 <<
" nav-comp-step calls # " << sNavCScalls
1172 std::ostringstream message;
1173 message <<
"Track stuck or not moving." <<
G4endl
1174 <<
" Track stuck, not moving for "
1176 <<
" in volume -" << motherPhysical->
GetName()
1177 <<
"- at point " << pGlobalpoint <<
G4endl
1178 <<
" direction: " << pDirection <<
"." <<
G4endl
1179 <<
" Potential geometry or navigation problem !"
1181 <<
" Trying pushing it of " << Step <<
" mm ...";
1182 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
1183 JustWarning, message,
"Potential overlap in geometry!");
1192 std::ostringstream message;
1193 message <<
"Stuck Track: potential geometry or navigation problem."
1195 <<
" Track stuck, not moving for "
1197 <<
" in volume -" << motherPhysical->
GetName()
1198 <<
"- at point " << pGlobalpoint <<
G4endl
1199 <<
" direction: " << pDirection <<
".";
1201 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1214 +
std::min(Step,pCurrentProposedStepLength) * pDirection;
1219 #ifdef G4DEBUG_NAVIGATION
1222 G4cout <<
" At G4Nav CompStep End - if(exiting) - fExiting= " <<
fExiting
1283 #ifdef G4DEBUG_NAVIGATION
1286 desc <<
"Problem in ComputeStep: Replica Navigation did not provide"
1287 <<
" valid exit Normal. " <<
G4endl;
1288 desc <<
" Do not know how calculate it in this case." <<
G4endl;
1289 desc <<
" Location = " << finalLocalPoint <<
G4endl;
1290 desc <<
" Volume name = " << motherPhysical->
GetName()
1292 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1293 JustWarning, desc,
"Normal not available for exiting.");
1306 fHistory.GetTransform(depth-1).Inverse();
1337 G4cout <<
" Returned step= " << Step;
1341 G4cout <<
" Requested step= " << pCurrentProposedStepLength ;
1359 const G4double pCurrentProposedStepLength,
1373 pCurrentProposedStepLength,
1442 for ( i=1; i<=cdepth; i++ )
1445 switch (
fHistory.GetVolumeType(i) )
1455 replicaNo =
fHistory.GetReplicaNo(i);
1480 ComputeMaterial(replicaNo, current, pTouchable) );
1509 if( candidateLogical )
1531 currentSolid= candidateLogical->
GetSolid();
1532 inSideIt = currentSolid->
Inside(daughterPointOwnLocal);
1533 onSurface = (inSideIt ==
kSurface);
1538 safety = (currentSolid->
DistanceToIn(daughterPointOwnLocal));
1541 else if (inSideIt ==
kInside )
1543 safety = (currentSolid->
DistanceToOut(daughterPointOwnLocal));
1550 nextSolidExitNormal =
1555 ExitNormal = -nextSolidExitNormal;
1563 std::ostringstream message;
1564 message <<
"Point not on surface ! " <<
G4endl
1566 << daughterPointOwnLocal <<
G4endl
1567 <<
" Physical volume = "
1569 <<
" Logical volume = "
1571 <<
" Solid = " << currentSolid->
GetName()
1574 << *currentSolid <<
G4endl;
1577 message <<
"Point is Outside. " << G4endl
1578 <<
" Safety (from outside) = " << safety <<
G4endl;
1582 message <<
"Point is Inside. " << G4endl
1583 <<
" Safety (from inside) = " << safety <<
G4endl;
1585 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
"GeomNav1001",
1603 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1605 "Incorrect call to GetLocalSurfaceNormal." );
1618 desc <<
" Parameters of solid: " << *daughterSolid
1620 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1622 "Surface Normal returned by Solid is not a Unit Vector." );
1640 message <<
"Function called when *NOT* at a Boundary." <<
G4endl;
1641 G4Exception(
"G4ITNavigator2::GetLocalExitNormal()",
1657 G4int enteringReplicaNo,
1661 switch (enteringVolumeType)
1666 G4Exception(
"G4ITNavigator2::GetMotherToDaughterTransform()",
1668 "Method NOT Implemented yet for replica volumes.");
1676 pParam->
ComputeSolid(enteringReplicaNo, pEnteringPhysVol);
1712 #ifdef G4DEBUG_NAVIGATION
1717 G4ThreeVector ExpectedBoundaryPointLocal;
1720 ExpectedBoundaryPointLocal =
1740 G4bool* pNormalCalculated)
1764 if( std::fabs ( normMag2 - 1.0 ) <
perMillion )
1766 *pNormalCalculated =
true;
1773 message <<
" ERROR> Expected normal-global-frame to valid (unit vector) "
1774 <<
" - but |normal| = " << std::sqrt(normMag2)
1775 <<
" - and |normal|^ = " << normMag2
1776 <<
" which differs from 1.0 by " << normMag2 - 1.0 <<
G4endl
1778 message <<
"============================================================"
1782 message <<
" State of Navigator: " <<
G4endl;
1783 message << *
this <<
G4endl;
1785 message <<
"============================================================"
1788 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1790 "Value obtained from stored global-normal is not a unit vector.");
1807 #ifdef G4DEBUG_NAVIGATION
1817 edN <<
" State of Navigator: " <<
G4endl;
1821 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1823 "LocalExitNormalAndCheck() did not calculate Normal.");
1832 edN <<
"G4ITNavigator2::GetGlobalExitNormal: "
1833 <<
" Using Local Normal - from call to GetLocalExitNormalAndCheck. "
1835 <<
" Local Exit Normal : " <<
" || = " << std::sqrt(localMag2)
1836 <<
" vec = " << localNormal <<
G4endl
1837 <<
" Global Exit Normal : " <<
" || = " << globalNormal.
mag()
1838 <<
" vec = " << globalNormal <<
G4endl;
1841 G4Exception(
"G4ITNavigator2::GetGlobalExitNormal()",
1843 "Value obtained from new local *solid* is incorrect.");
1844 localNormal = localNormal.
unit();
1850 #ifdef G4DEBUG_NAVIGATION
1865 edDfn <<
"Found difference in normals in case of exiting mother "
1866 <<
"- when Get is called after ComputingStep " <<
G4endl;
1867 edDfn <<
" Magnitude of diff = " << diffNorm.
mag() <<
G4endl;
1868 edDfn <<
" Normal stored (Global) = " << fExitNormalGlobalFrame
1870 edDfn <<
" Global Computed from Local = " << globalNormAgn <<
G4endl;
1871 G4Exception(
"G4ITNavigator::GetGlobalExitNormal()",
"GeomNav0003",
1877 return globalNormal;
1881 #define G4NEW_SAFETY 1
1899 #ifdef G4DEBUG_NAVIGATION
1903 G4cout <<
"*** G4ITNavigator2::ComputeSafety: ***" <<
G4endl
1904 <<
" Called at point: " << pGlobalpoint <<
G4endl;
1908 <<
" - Maximum length = " << pMaxLength <<
G4endl;
1911 G4cout <<
" ----- Upon entering Compute Safety:" <<
G4endl;
1923 if( endpointOnSurface && stayedOnEndpoint )
1925 #ifdef G4DEBUG_NAVIGATION
1928 G4cout <<
" G4Navigator::ComputeSafety() finds that point - "
1929 << pGlobalpoint <<
" - is on surface " <<
G4endl;
1959 #ifdef G4DEBUG_NAVIGATION
1962 G4cout <<
" G4ITNavigator2::ComputeSafety() relocates-in-volume to point: "
1963 << pGlobalpoint <<
G4endl;
1980 *motherPhysical, pMaxLength);
1981 newSafety= safetyTwo;
1987 newSafety= safetyOldVoxel;
2006 G4Exception(
"G4ITNavigator2::ComputeSafety()",
"GeomNav0001",
2032 #ifdef G4DEBUG_NAVIGATION
2037 G4cout <<
" Returned value of Safety = " << newSafety <<
G4endl;
2039 G4cout.precision(oldcoutPrec);
2080 #ifdef CHECK_ORDER_OF_METHODS
2083 G4Exception(
"G4Navigator::RecheckDistanceToCurrentBoundary()",
2085 "Method must be called after ComputeStep(), before call to LocateMethod.");
2114 G4ThreeVector dgPosition= nextLevelTrf.TransformPoint(localPosition);
2115 G4ThreeVector dgDirection= nextLevelTrf.TransformAxis(localDirection);
2116 locatedDaug = candSolid->
Inside(dgPosition);
2125 true, &validExitNormal, &exitNormal);
2126 daughterStep= - distanceBackOut;
2153 daughterSafety= 0.0;
2162 *prDistance= daughterStep;
2163 if( prNewSafety ) { *prNewSafety= daughterSafety; }
2183 if( ProposedMove >= motherSafety )
2187 true, &validExitNormal, &exitNormal);
2191 motherStep= ProposedMove;
2196 motherSafety= motherSolid->
DistanceToIn(localPosition);
2197 if( ProposedMove >= motherSafety )
2207 if( prNewSafety ) { *prNewSafety= motherSafety; }
2216 *prDistance=
std::min( motherStep, daughterStep );
2219 *prNewSafety=
std::min( motherSafety, daughterSafety );
2245 G4cout <<
"The current state of G4Navigator is: " <<
G4endl;
2250 <<
" BlockedPhysicalVolume= " ;
2263 G4cout << std::setw(30) <<
" ExitNormal " <<
" "
2264 << std::setw( 5) <<
" Valid " <<
" "
2265 << std::setw( 9) <<
" Exiting " <<
" "
2266 << std::setw( 9) <<
" Entering" <<
" "
2267 << std::setw(15) <<
" Blocked:Volume " <<
" "
2268 << std::setw( 9) <<
" ReplicaNo" <<
" "
2269 << std::setw( 8) <<
" LastStepZero " <<
" "
2273 <<
", " << std::setw(7) <<
fExitNormal.z() <<
" ) "
2275 << std::setw( 9) <<
fExiting <<
" "
2279 G4cout << std::setw(15) <<
"None";
2296 G4cout.precision(oldcoutPrec);
2303 void G4ITNavigator2::ComputeStepLog(
const G4ThreeVector& pGlobalpoint,
2326 G4double shiftOrigin = std::sqrt(shiftOriginSafSq);
2329 if( diffShiftSaf > fAccuracyForWarning )
2333 std::ostringstream message, suggestion;
2334 message <<
"Accuracy error or slightly inaccurate position shift."
2336 <<
" The Step's starting point has moved "
2337 << std::sqrt(moveLenSq)/
mm <<
" mm " <<
G4endl
2338 <<
" since the last call to a Locate method." <<
G4endl
2339 <<
" This has resulted in moving "
2340 << shiftOrigin/
mm <<
" mm "
2341 <<
" from the last point at which the safety "
2342 <<
" was calculated " <<
G4endl
2343 <<
" which is more than the computed safety= "
2344 << fPreviousSafety/
mm <<
" mm at that point." <<
G4endl
2345 <<
" This difference is "
2346 << diffShiftSaf/
mm <<
" mm." <<
G4endl
2347 <<
" The tolerated accuracy is "
2348 << fAccuracyForException/
mm <<
" mm.";
2352 if( ((++warnNow % 100) == 1) )
2355 <<
" This problem can be due to either " <<
G4endl
2356 <<
" - a process that has proposed a displacement"
2357 <<
" larger than the current safety , or" <<
G4endl
2358 <<
" - inaccuracy in the computation of the safety";
2359 suggestion <<
"We suggest that you " << G4endl
2360 <<
" - find i) what particle is being tracked, and "
2361 <<
" ii) through what part of your geometry " << G4endl
2362 <<
" for example by re-running this event with "
2364 <<
" /tracking/verbose 1 " << G4endl
2365 <<
" - check which processes you declare for"
2366 <<
" this particle (and look at non-standard ones)"
2368 <<
" - in case, create a detailed logfile"
2369 <<
" of this event using:" << G4endl
2370 <<
" /tracking/verbose 6 ";
2374 message,
G4String(suggestion.str()));
2375 G4cout.precision(oldcoutPrec);
2376 G4cerr.precision(oldcerrPrec);
2378 #ifdef G4DEBUG_NAVIGATION
2381 G4cerr <<
"WARNING - G4ITNavigator2::ComputeStep()" <<
G4endl
2382 <<
" The Step's starting point has moved "
2383 << std::sqrt(moveLenSq) <<
"," <<
G4endl
2384 <<
" which has taken it to the limit of"
2385 <<
" the current safety. " <<
G4endl;
2389 G4double safetyPlus = fPreviousSafety + fAccuracyForException;
2390 if ( shiftOriginSafSq >
sqr(safetyPlus) )
2392 std::ostringstream message;
2393 message <<
"May lead to a crash or unreliable results." <<
G4endl
2394 <<
" Position has shifted considerably without"
2395 <<
" notifying the navigator !" <<
G4endl
2396 <<
" Tolerated safety: " << safetyPlus <<
G4endl
2397 <<
" Computed shift : " << shiftOriginSafSq;
2398 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
2415 G4int oldcoutPrec = os.precision(4);
2418 os <<
"The current state of G4ITNavigator2 is: " <<
G4endl;
2419 os <<
" ValidExitNormal= " << n.fValidExitNormal << G4endl
2420 <<
" ExitNormal = " << n.fExitNormal << G4endl
2421 <<
" Exiting = " << n.fExiting << G4endl
2422 <<
" Entering = " << n.fEntering << G4endl
2423 <<
" BlockedPhysicalVolume= " ;
2425 if (n.fBlockedPhysicalVolume==0)
2431 os << n.fBlockedPhysicalVolume->GetName();
2435 <<
" BlockedReplicaNo = " << n.fBlockedReplicaNo << G4endl
2436 <<
" LastStepWasZero = " << n.fLastStepWasZero << G4endl
2442 os << std::setw(30) <<
" ExitNormal " <<
" "
2443 << std::setw( 5) <<
" Valid " <<
" "
2444 << std::setw( 9) <<
" Exiting " <<
" "
2445 << std::setw( 9) <<
" Entering" <<
" "
2446 << std::setw(15) <<
" Blocked:Volume " <<
" "
2447 << std::setw( 9) <<
" ReplicaNo" <<
" "
2448 << std::setw( 8) <<
" LastStepZero " <<
" "
2450 os <<
"( " << std::setw(7) << n.fExitNormal.x()
2451 <<
", " << std::setw(7) << n.fExitNormal.y()
2452 <<
", " << std::setw(7) << n.fExitNormal.z() <<
" ) "
2453 << std::setw( 5) << n.fValidExitNormal <<
" "
2454 << std::setw( 9) << n.fExiting <<
" "
2455 << std::setw( 9) << n.fEntering <<
" ";
2457 if ( n.fBlockedPhysicalVolume==0 )
2458 { os << std::setw(15) <<
"None"; }
2460 { os << std::setw(15)<< n.fBlockedPhysicalVolume->GetName(); }
2462 os << std::setw( 9) << n.fBlockedReplicaNo <<
" "
2463 << std::setw( 8) << n.fLastStepWasZero <<
" "
2469 os <<
" Current Localpoint = " << n.fLastLocatedPointLocal <<
G4endl;
2470 os <<
" PreviousSftOrigin = " << n.fPreviousSftOrigin <<
G4endl;
2471 os <<
" PreviousSafety = " << n.fPreviousSafety <<
G4endl;
2475 os <<
"Current History: " <<
G4endl << n.fHistory;
2478 os.precision(oldcoutPrec);
2492 return solid->Inside(localPoint);
2505 std::vector<std::vector<double> > fExtend;
2523 for(
size_t i = 0 ; i < 3 ; ++i)
static constexpr double perMillion
#define fBlockedPhysicalVolume
G4SmartVoxelHeader * GetVoxelHeader() const
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
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
static constexpr double mm
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)
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
double dot(const Hep3Vector &) const
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()
G4VSolid * GetSolid() const
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)
const G4RotationMatrix * GetRotation() const
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
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)
void GetRandomInCurrentVolume(G4ThreeVector &rndmPoint) const
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
static constexpr double perMillion
#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)
const G4ThreeVector & GetTranslation() const
G4ParameterisedNavigation fparamNav
virtual G4bool RecheckDistanceToCurrentBoundary(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double CurrentProposedStepLength, G4double *prDistance, G4double *prNewSafety=0) const
#define fGrandMotherExitNormal
#define fBlockedReplicaNo
EInside InsideCurrentVolume(const G4ThreeVector &globalPoint) 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)
G4LogicalVolume * GetLogicalVolume() const
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &rGlobPoint) const
G4VoxelNavigation fvoxelNav
#define fPreviousSftOrigin
T max(const T t1, const T t2)
brief Return the largest of the two arguments
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
void SetNavigatorState(G4ITNavigatorState_Lock2 *)
virtual G4int GetCopyNo() const =0
const G4AffineTransform & GetGlobalToLocalTransform() const
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
G4int GetDaughtersRegularStructureId(const G4LogicalVolume *pLog) 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)
const G4String & GetName() const
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()
virtual G4TouchableHistoryHandle CreateTouchableHistoryHandle() const
G4GLOB_DLL std::ostream G4cerr
EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const
G4AffineTransform GetMotherToDaughterTransform(G4VPhysicalVolume *dVolume, G4int dReplicaNo, EVolume dVolumeType)