|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4Navigator is a class for use by the tracking management, able to obtain/calculate dynamic tracking time information such as the distance to the next volume, or to find the physical volume containing a given point in the world reference system. The navigator maintains a transformation history and other information to optimise the tracking time performance. More...
#include <G4Navigator.hh>
Protected Member Functions | |
| void | SetSavedState () |
| void | RestoreSavedState () |
| virtual void | ResetState () |
| G4ThreeVector | ComputeLocalPoint (const G4ThreeVector &rGlobP) const |
| G4ThreeVector | ComputeLocalAxis (const G4ThreeVector &pVec) const |
| EVolume | VolumeType (const G4VPhysicalVolume *pVol) const |
| EVolume | CharacteriseDaughters (const G4LogicalVolume *pLog) const |
| G4int | GetDaughtersRegularStructureId (const G4LogicalVolume *pLv) const |
| virtual void | SetupHierarchy () |
| G4bool | CheckOverlapsIterative (G4VPhysicalVolume *vol) |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const G4Navigator &n) |
G4Navigator is a class for use by the tracking management, able to obtain/calculate dynamic tracking time information such as the distance to the next volume, or to find the physical volume containing a given point in the world reference system. The navigator maintains a transformation history and other information to optimise the tracking time performance.
Definition at line 75 of file G4Navigator.hh.
| G4Navigator::G4Navigator | ( | ) |
Constructor - initialisers and setup.
Definition at line 54 of file G4Navigator.cc.
Referenced by Clone(), G4MultiNavigator::G4MultiNavigator(), G4Navigator(), G4MultiNavigator::GetNavigator(), G4MultiNavigator::operator<<, operator=(), G4MultiNavigator::PrintLimited(), G4MultiNavigator::ResetHierarchyAndLocate(), and G4MultiNavigator::~G4MultiNavigator().
|
delete |
Copy constructor & assignment operator not allowed.
|
virtual |
Destructor.
Definition at line 89 of file G4Navigator.cc.
|
inline |
Activate/inactivate the navigator.
Referenced by G4TransportationManager::ActivateNavigator().
|
inlineprotected |
Characterises the daughters of given logical volume.
Referenced by ComputeStep(), LocateGlobalPointAndSetup(), and LocateGlobalPointWithinVolume().
|
inline |
Run navigation in "check-mode", therefore using additional verifications and more strict correctness conditions.
Referenced by G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck().
| G4double G4Navigator::CheckNextStep | ( | const G4ThreeVector & | pGlobalPoint, |
| const G4ThreeVector & | pDirection, | ||
| const G4double | pCurrentProposedStepLength, | ||
| G4double & | pNewSafety ) |
Same as ComputeStep() above, but does not affect/modify the state of the Navigator.
Definition at line 1228 of file G4Navigator.cc.
|
protected |
Utility method to trigger overlaps check on a volume with reported overlaps ordered by relevance. Used in ComputeStep() when loopings with zero step are detected.
Definition at line 1986 of file G4Navigator.cc.
Referenced by ComputeStep().
|
inline |
Cloning feature for use in MT applications to clone the navigator, including external sub-navigator.
|
inlineprotected |
Returns the local direction of the specified vector in the reference system of the volume that was found by LocalGlobalPointAndSetup(). The Local Coordinates of point in world coordinate system.
Referenced by ComputeStep().
|
inlineprotected |
Returns position vector in local coordinate system, given a position vector in world coordinate system.
Referenced by ComputeStep(), and LocateGlobalPointWithinVolume().
|
virtual |
Calculates the isotropic distance to the nearest boundary from the specified point in the global coordinate system.
| [in] | globalpoint | The point in global coordinates system. The point must be within the current volume. |
| [in] | pProposedMaxLength | The proposed maximum length is used to avoid volume safety calculations. |
| [in] | keepState | Flag to instruct keeping the state (default true) to ensure minimum side effects from the call. |
Reimplemented in G4ErrorPropagationNavigator, and G4MultiNavigator.
Definition at line 1780 of file G4Navigator.cc.
Referenced by G4ErrorPropagationNavigator::ComputeSafety().
|
virtual |
Calculates the distance to the next boundary intersected along the specified NORMALISED vector direction and from the specified point in the global coordinate system. LocateGlobalPointAndSetup() or LocateGlobalPointWithinVolume() must have been called with the same global point prior to this call. The isotropic distance to the nearest boundary is also calculated (usually an underestimate). The current proposed Step length is used to avoid intersection calculations: if it can be determined that the nearest boundary is >pCurrentProposedStepLength away, kInfinity is returned together with the computed isotropic safety distance.
| [in] | pGlobalPoint | The point in global coordinates system. |
| [in] | pDirection | The normalised vector direction. |
| [in] | pCurrentProposedStepLength | Current proposed step length. |
| [in,out] | newSafety | New safety. |
pDirection. Reimplemented in G4ErrorPropagationNavigator, and G4MultiNavigator.
Definition at line 751 of file G4Navigator.cc.
Referenced by CheckNextStep(), and G4ErrorPropagationNavigator::ComputeStep().
|
inline |
Touchable creation method.
Referenced by G4MultiNavigator::CreateTouchableHistoryHandle(), and CreateTouchableHistoryHandle().
|
inline |
Touchable creation method, given a history.
| [in] | h | Pointer to a navigation history to copy from. |
|
virtual |
Returns a reference counted handle to a touchable history.
Reimplemented in G4MultiNavigator.
Definition at line 1811 of file G4Navigator.cc.
Referenced by G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck().
|
inline |
Enables best-possible evaluation of isotropic safety.
|
inline |
The purpose of this function is to inform the caller if the track is entering a daughter volume while exiting from the current volume.
Referenced by GetLocalExitNormal().
|
inline |
Verify if the step has exited the mother volume.
|
inline |
Returns the local coordinate of the point in the reference system of its containing volume that was found by LocalGlobalPointAndSetup(). The local coordinate of the last located track.
|
inlineprotected |
Gets regular structure ID of first daughter.
Referenced by ComputeStep(), and LocateGlobalPointAndSetup().
|
inline |
Accessor & modifier for custom external navigation.
|
virtual |
Obtains the Normal vector to a surface (in global coordinates) pointing out of previous volume and into current volume The method takes full care about how to calculate the normal, but if the surfaces are not convex it will return valid=false.
| [in] | point | Point in global coordinates system to compare to. |
| [in,out] | valid | Flag indicating if normal is valid. |
Reimplemented in G4ErrorPropagationNavigator, and G4MultiNavigator.
Definition at line 1609 of file G4Navigator.cc.
Referenced by G4ErrorPropagationNavigator::GetGlobalExitNormal(), G4XrayReflection::GetMeanFreePath(), and G4MicroElecSurface::PostStepDoIt().
|
inline |
Obtains the transformations Global/Local (and inverse).
Referenced by GetLocalExitNormalAndCheck(), and G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck().
|
inline |
Gets endpoint of last step.
|
virtual |
Obtains the Normal vector to a surface (in local coordinates) pointing out of previous volume and into current volume Convention: the local normal is in the coordinate system of the final volume. The method takes full care about how to calculate this normal, but if the surfaces are not convex it will return valid=false.
| [in,out] | valid | Flag indicating if normal is valid. |
Reimplemented in G4MultiNavigator.
Definition at line 1357 of file G4Navigator.cc.
Referenced by G4RayTrajectory::AppendStep(), GetLocalExitNormalAndCheck(), and G4VTransitionRadiation::PostStepDoIt().
|
virtual |
Obtains the Normal vector to a surface (in local coordinates) pointing out of previous volume and into current volume, and checks the current point against expected 'local' value. Convention: the local normal is in the coordinate system of the final volume. The method takes full care about how to calculate this normal, but if the surfaces are not convex it will return valid=false.
| [in] | point | Point in global coordinates system to compare to. |
| [in,out] | valid | Flag indicating if normal is valid. |
Reimplemented in G4MultiNavigator.
Definition at line 1574 of file G4Navigator.cc.
Referenced by GetGlobalExitNormal().
|
inline |
Referenced by G4RayTrajectory::AppendStep().
| G4AffineTransform G4Navigator::GetMotherToDaughterTransform | ( | G4VPhysicalVolume * | dVolume, |
| G4int | dReplicaNo, | ||
| EVolume | dVolumeType ) |
Obtains mother to daughter transformation.
Definition at line 1523 of file G4Navigator.cc.
Referenced by GetLocalExitNormal().
|
inline |
Verbosity control.
Referenced by GetGlobalExitNormal().
|
inline |
Gets/sets alternative navigator for voxel volumes.
Referenced by ComputeStep(), LocateGlobalPointAndSetup(), and LocateGlobalPointWithinVolume().
|
inline |
Returns the current world (topmost) volume.
Referenced by G4TransportationManager::ActivateNavigator(), G4TransportationManager::DeActivateNavigator(), G4TransportationManager::DeRegisterNavigator(), G4GeometrySampler::G4GeometrySampler(), G4ImportanceConfigurator::G4ImportanceConfigurator(), G4MultiNavigator::G4MultiNavigator(), G4TransportationManager::GetParallelWorld(), G4TDNAOneStepThermalizationModel< MODEL >::Initialise(), G4FastSimHitMaker::make(), GFlashHitMaker::make(), G4MultiNavigator::PrepareNavigators(), G4MultiNavigator::PrintLimited(), G4IStore::SetWorldVolume(), and G4WeightWindowStore::SetWorldVolume().
| void G4Navigator::InformLastStep | ( | G4double | lastStep, |
| G4bool | entersDaughtVol, | ||
| G4bool | exitsMotherVol ) |
Derived navigators which rely on LocateGlobalPointAndSetup() need to inform size of step, to maintain logic about arriving on boundary for challenging cases. Required in order to cope with multiple trials at boundaries => Locate with use direction rather than simple, fast logic.
Definition at line 2098 of file G4Navigator.cc.
|
inline |
Verify if the navigator is active.
|
inline |
Set/unset verbosity for pushed tracks (default is true).
Referenced by G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck().
|
virtual |
Searches the geometrical hierarchy for the volumes deepest in hierarchy containing the point in the global coordinate space. Two main cases are: i) If pRelativeSearch=false it makes use of no previous/state information. Returns the physical volume containing the point, with all previous mothers correctly set up. ii) If pRelativeSearch is set to true, the search begin is the geometrical hierarchy at the location of the last located point, or the endpoint of previous Step if SetGeometricallyLimitedStep() has been called immediately before. The direction is used (to check if a volume is entered) if either
| [in] | point | The point in global coordinates system. |
| [in] | direction | The normalised vector direction. |
| [in] | pRelativeSearch | Flag to specify where search starts from. |
| [in] | ignoreDirection | Flag to specify if to use direction or not. |
Reimplemented in G4MultiNavigator.
Definition at line 132 of file G4Navigator.cc.
Referenced by ComputeStep(), G4TheRayTracer::CreateBitMap(), G4VFieldModel::DescribeYourselfTo(), G4TrajectoryDrawByOriginVolume::Draw(), G4TrajectoryOriginVolumeFilter::Evaluate(), G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck(), and ResetHierarchyAndLocate().
|
inline |
Same as the method above LocateGlobalPointAndUpdateTouchableHandle(), except that a pointer to G4VTouchable is used for updating the touchable.
|
inline |
Same as the method above LocateGlobalPointAndUpdateTouchable(), except that direction is not specified.
|
inline |
It first searches the geometrical hierarchy like the above method LocateGlobalPointAndSetup(), then it uses the volume found and its navigation history to update the touchable handle.
| [in] | position | The point in global coordinates system. |
| [in] | direction | The normalised vector direction. |
| [in,out] | oldTouchableToUpdate | Touchable handle to update. |
| [in] | RelativeSearch | Flag to specify where search starts from. |
|
virtual |
Notifies the Navigator that a track has moved to the new Global point 'position', that is known to be within the current safety. No check is performed to ensure that it is within the volume. This method can be called instead of LocateGlobalPointAndSetup() ONLY if the caller is certain that the new global point (position) is inside the same volume as the previous position. Usually this can be guaranteed only if the point is within safety.
| [in] | position | The position point in global coordinates system. |
Reimplemented in G4MultiNavigator.
Definition at line 602 of file G4Navigator.cc.
Referenced by G4VIntersectionLocator::AdjustmentOfFoundIntersection(), ComputeStep(), G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), G4SimpleLocator::EstimateIntersectionPoint(), and G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck().
|
inline |
|
inline |
Computes and returns the local->global translation/rotation of current volume.
|
delete |
| void G4Navigator::PrintState | ( | ) | const |
Prints the internal state of the Navigator (for debugging). The level of detail is according to the verbosity.
Definition at line 1820 of file G4Navigator.cc.
Referenced by ComputeStep(), and LocateGlobalPointAndSetup().
|
virtual |
Resets the geometrical hierarchy and searches for the volumes deepest in the hierarchy containing the point in the global coordinates space. The direction is used to check if a volume is entered. The search begin is the geometrical hierarchy at the location of the last located point, or the endpoint of the previous Step if SetGeometricallyLimitedStep() has been called immediately before.
| [in] | point | The point in global coordinates system. |
| [in] | direction | The normalised vector direction. |
| [in] | h | The touchable history to be used for initialisation. |
Reimplemented in G4MultiNavigator.
Definition at line 102 of file G4Navigator.cc.
Referenced by G4MultiNavigator::ResetHierarchyAndLocate().
|
inline |
Resets stack and minimum or navigator state machine necessary for reset as needed by LocalGlobalPointAndSetup().
Referenced by G4Navigator(), and LocateGlobalPointAndSetup().
|
protectedvirtual |
Utility method to reset the navigator state machine.
Reimplemented in G4MultiNavigator.
Definition at line 1261 of file G4Navigator.cc.
Referenced by ResetHierarchyAndLocate().
|
protected |
Copy aspects of the state, to enable a non-state changing call to ComputeStep().
Definition at line 697 of file G4Navigator.cc.
Referenced by CheckNextStep().
| void G4Navigator::SetExternalNavigation | ( | G4VExternalNavigation * | externalNav | ) |
Definition at line 2113 of file G4Navigator.cc.
|
inline |
Informs the navigator that the previous Step calculated by the geometry was taken in its entirety.
|
inline |
|
protected |
Saves the state: fValidExitNormal, fExitNormal, fExiting, fEntering, fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero, fLastLocatedPointLocal, fLocatedOutsideWorld, fEnteredDaughter, fExitedMother, fPreviousSftOrigin, fPreviousSafety.
Definition at line 663 of file G4Navigator.cc.
Referenced by CheckNextStep().
|
protectedvirtual |
Renavigates & resets hierarchy described by the current history: Resets volumes and recomputes transforms and/or solids of replicated/parameterised volumes.
Reimplemented in G4MultiNavigator.
Definition at line 1302 of file G4Navigator.cc.
Referenced by ResetHierarchyAndLocate().
|
inline |
Referenced by GetGlobalExitNormal().
| void G4Navigator::SetVoxelNavigation | ( | G4VoxelNavigation * | voxelNav | ) |
Definition at line 2088 of file G4Navigator.cc.
|
inline |
Sets the world (topmost) volume. This must be positioned at the origin (0,0,0) and unrotated.
Referenced by G4MultiNavigator::G4MultiNavigator(), G4VisManager::G4VisSubThread(), G4TransportationManager::GetNavigator(), G4TransportationManager::GetNavigator(), and G4MultiNavigator::PrepareNavigators().
Reports on severity of error and number of zero steps, in case Navigator is stuck and is returning zero steps. Values: 1 (small problem), 5 (correcting), 9 (ready to abandon), 10 (abandoned)
| [in,out] | noZeroSteps | Returns the number of zero steps in case pointer is not null. |
|
inlineprotected |
Characterises the type of volume - normal/replicated/parameterised.
|
friend |
Definition at line 2013 of file G4Navigator.cc.
|
protected |
A memory of whether in this Step a daughter volume is entered (set in Compute & Locate). After Compute: it expects to enter a daughter After Locate: it has entered a daughter.
Definition at line 560 of file G4Navigator.hh.
Referenced by ComputeSafety(), ComputeStep(), LocateGlobalPointAndSetup(), LocateGlobalPointWithinVolume(), ResetState(), RestoreSavedState(), and SetSavedState().
|
protected |
A similar memory whether the Step exited current "mother" volume completely, not entering daughter.
Definition at line 564 of file G4Navigator.hh.
Referenced by ComputeSafety(), ComputeStep(), GetLocalExitNormal(), LocateGlobalPointAndSetup(), LocateGlobalPointWithinVolume(), ResetState(), RestoreSavedState(), and SetSavedState().
|
protected |
Transformation and history of the current path through the geometrical hierarchy.
Definition at line 543 of file G4Navigator.hh.
Referenced by ComputeSafety(), ComputeStep(), G4Navigator(), GetGlobalExitNormal(), GetLocalExitNormal(), LocateGlobalPointAndSetup(), LocateGlobalPointWithinVolume(), ResetHierarchyAndLocate(), and SetupHierarchy().
|
protected |
Position of the end-point of the last call to ComputeStep() in last local coordinates.
Definition at line 551 of file G4Navigator.hh.
Referenced by ComputeStep(), G4Navigator(), and GetLocalExitNormal().
|
protected |
Definition at line 536 of file G4Navigator.hh.
Referenced by ComputeStep(), and G4Navigator().
|
protected |
Definition at line 536 of file G4Navigator.hh.
Referenced by ComputeStep(), G4Navigator(), and GetGlobalExitNormal().
|
protected |
Endpoint of last ComputeStep(). Can be used for optimisation (e.g. when computing safety).
Definition at line 547 of file G4Navigator.hh.
Referenced by ComputeSafety(), ComputeStep(), G4Navigator(), and GetGlobalExitNormal().
|
protected |
Verbosity level [if > 0, printout can occur].
Definition at line 554 of file G4Navigator.hh.
Referenced by CheckOverlapsIterative(), G4MultiNavigator::ComputeSafety(), G4MultiNavigator::ComputeStep(), ComputeStep(), G4Navigator(), G4MultiNavigator::GetGlobalExitNormal(), GetGlobalExitNormal(), GetLocalExitNormal(), G4MultiNavigator::LocateGlobalPointAndSetup(), LocateGlobalPointAndSetup(), G4MultiNavigator::LocateGlobalPointWithinVolume(), G4MultiNavigator::ObtainFinalStep(), G4MultiNavigator::PrepareNavigators(), G4MultiNavigator::PrepareNewTrack(), G4MultiNavigator::PrintLimited(), PrintState(), and G4MultiNavigator::WhichLimited().
|
protected |
Set true if last Step was limited by geometry.
Definition at line 567 of file G4Navigator.hh.
Referenced by G4MultiNavigator::LocateGlobalPointAndSetup(), LocateGlobalPointAndSetup(), G4MultiNavigator::LocateGlobalPointWithinVolume(), LocateGlobalPointWithinVolume(), G4MultiNavigator::PrepareNavigators(), G4MultiNavigator::ResetState(), ResetState(), RestoreSavedState(), and SetSavedState().
|
protected |
Definition at line 536 of file G4Navigator.hh.
Referenced by ComputeSafety(), ComputeStep(), G4Navigator(), G4ErrorPropagationNavigator::GetGlobalExitNormal(), and GetLocalExitNormal().