Geant4-11
Data Structures | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
G4ITNavigator1 Class Reference

#include <G4ITNavigator1.hh>

Data Structures

struct  G4SaveNavigatorState
 

Public Member Functions

void Activate (G4bool flag)
 
void CheckMode (G4bool mode)
 
G4double CheckNextStep (const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
 
virtual G4double ComputeSafety (const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
 
virtual G4double ComputeStep (const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
 
G4GRSSolidCreateGRSSolid () const
 
G4GRSVolumeCreateGRSVolume () const
 
G4TouchableHistoryCreateTouchableHistory () const
 
G4TouchableHistoryCreateTouchableHistory (const G4NavigationHistory *) const
 
virtual G4TouchableHistoryHandle CreateTouchableHistoryHandle () const
 
void EnableBestSafety (G4bool value=false)
 
G4bool EnteredDaughterVolume () const
 
G4bool ExitedMotherVolume () const
 
 G4ITNavigator1 ()
 
G4ThreeVector GetCurrentLocalCoordinate () const
 
virtual G4ThreeVector GetGlobalExitNormal (const G4ThreeVector &point, G4bool *valid)
 
const G4AffineTransformGetGlobalToLocalTransform () const
 
virtual G4ThreeVector GetLocalExitNormal (G4bool *valid)
 
virtual G4ThreeVector GetLocalExitNormalAndCheck (const G4ThreeVector &point, G4bool *valid)
 
const G4AffineTransform GetLocalToGlobalTransform () const
 
G4AffineTransform GetMotherToDaughterTransform (G4VPhysicalVolume *dVolume, G4int dReplicaNo, EVolume dVolumeType)
 
G4ITNavigatorState_Lock1GetNavigatorState ()
 
G4int GetVerboseLevel () const
 
G4VPhysicalVolumeGetWorldVolume () const
 
G4bool IsActive () const
 
G4bool IsCheckModeActive () const
 
virtual G4VPhysicalVolumeLocateGlobalPointAndSetup (const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
 
void LocateGlobalPointAndUpdateTouchable (const G4ThreeVector &position, const G4ThreeVector &direction, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
 
void LocateGlobalPointAndUpdateTouchable (const G4ThreeVector &position, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
 
void LocateGlobalPointAndUpdateTouchableHandle (const G4ThreeVector &position, const G4ThreeVector &direction, G4TouchableHandle &oldTouchableToUpdate, const G4bool RelativeSearch=true)
 
virtual void LocateGlobalPointWithinVolume (const G4ThreeVector &position)
 
G4RotationMatrix NetRotation () const
 
G4ThreeVector NetTranslation () const
 
void NewNavigatorState ()
 
void PrintState () const
 
virtual G4VPhysicalVolumeResetHierarchyAndLocate (const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
 
void ResetStackAndState ()
 
virtual void ResetState ()
 
void RestoreSavedState ()
 
void SetGeometricallyLimitedStep ()
 
void SetNavigatorState (G4ITNavigatorState_Lock1 *)
 
void SetPushVerbosity (G4bool mode)
 
void SetSavedState ()
 
void SetVerboseLevel (G4int level)
 
void SetWorldVolume (G4VPhysicalVolume *pWorld)
 
G4int SeverityOfZeroStepping (G4int *noZeroSteps) const
 
virtual ~G4ITNavigator1 ()
 

Static Public Attributes

static const G4int fMaxNav = 8
 

Protected Member Functions

EVolume CharacteriseDaughters (const G4LogicalVolume *pLog) const
 
G4ThreeVector ComputeLocalAxis (const G4ThreeVector &pVec) const
 
G4ThreeVector ComputeLocalPoint (const G4ThreeVector &rGlobPoint) const
 
G4int GetDaughtersRegularStructureId (const G4LogicalVolume *pLog) const
 
virtual void SetupHierarchy ()
 
EVolume VolumeType (const G4VPhysicalVolume *pVol) const
 

Protected Attributes

G4bool fEnteredDaughter
 
G4bool fExitedMother
 
G4NavigationHistory fHistory
 
G4ThreeVector fLastStepEndPointLocal
 
G4ThreeVector fStepEndPoint
 
G4int fVerbose
 
G4bool fWasLimitedByGeometry
 
G4double kCarTolerance
 

Private Member Functions

void ComputeStepLog (const G4ThreeVector &pGlobalpoint, G4double moveLenSq) const
 
 G4ITNavigator1 (const G4ITNavigator1 &)
 
G4ITNavigator1operator= (const G4ITNavigator1 &)
 

Private Attributes

G4int fAbandonThreshold_NoZeroSteps
 
G4int fActionThreshold_NoZeroSteps
 
G4bool fActive
 
G4VPhysicalVolumefBlockedPhysicalVolume
 
G4int fBlockedReplicaNo
 
G4bool fCalculatedExitNormal
 
G4bool fChangedGrandMotherRefFrame
 
G4bool fCheck
 
G4bool fEntering
 
G4bool fExiting
 
G4ThreeVector fExitNormal
 
G4ThreeVector fExitNormalGlobalFrame
 
G4ThreeVector fGrandMotherExitNormal
 
G4ThreeVector fLastLocatedPointLocal
 
G4bool fLastStepWasZero
 
G4bool fLastTriedStepComputation
 
G4bool fLocatedOnEdge
 
G4bool fLocatedOutsideWorld
 
G4NormalNavigation fnormalNav
 
G4int fNumberZeroSteps
 
G4ParameterisedNavigation fparamNav
 
G4double fPreviousSafety
 
G4ThreeVector fPreviousSftOrigin
 
G4SaveNavigatorStatefpSaveState
 
G4bool fPushed
 
G4VoxelSafetyfpVoxelSafety
 
G4RegularNavigation fregularNav
 
G4ReplicaNavigation freplicaNav
 
G4VPhysicalVolumefTopPhysical
 
G4bool fValidExitNormal
 
G4VoxelNavigation fvoxelNav
 
G4bool fWarnPush
 

Friends

std::ostream & operator<< (std::ostream &os, const G4ITNavigator1 &n)
 

Detailed Description

Definition at line 90 of file G4ITNavigator1.hh.

Constructor & Destructor Documentation

◆ G4ITNavigator1() [1/2]

G4ITNavigator1::G4ITNavigator1 ( )

Definition at line 59 of file G4ITNavigator1.cc.

61 fTopPhysical(0), fCheck(false), fPushed(false), fWarnPush(true)
62{
63 fActive= false;
65
67 // Initialises also all
68 // - exit / entry flags
69 // - flags & variables for exit normals
70 // - zero step counters
71 // - blocked volume
72
75
78
81
83 fpSaveState = 0;
84
85 // this->SetVerboseLevel(3);
86 // this->CheckMode(true);
87}
CLHEP::Hep3Vector G4ThreeVector
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
G4ThreeVector fStepEndPoint
G4int fActionThreshold_NoZeroSteps
void ResetStackAndState()
G4ThreeVector fLastStepEndPointLocal
G4bool fLastTriedStepComputation
G4NormalNavigation fnormalNav
G4bool fWasLimitedByGeometry
G4double kCarTolerance
G4SaveNavigatorState * fpSaveState
G4RegularNavigation fregularNav
G4int fAbandonThreshold_NoZeroSteps
G4VPhysicalVolume * fTopPhysical
G4VoxelSafety * fpVoxelSafety
void SetNormalNavigation(G4NormalNavigation *fnormnav)
static const G4double kInfinity
Definition: geomdefs.hh:41

References fAbandonThreshold_NoZeroSteps, fActionThreshold_NoZeroSteps, fActive, fLastStepEndPointLocal, fLastTriedStepComputation, fnormalNav, fpSaveState, fpVoxelSafety, fregularNav, fStepEndPoint, G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetSurfaceTolerance(), kCarTolerance, kInfinity, ResetStackAndState(), and G4RegularNavigation::SetNormalNavigation().

◆ ~G4ITNavigator1()

G4ITNavigator1::~G4ITNavigator1 ( )
virtual

Definition at line 123 of file G4ITNavigator1.cc.

124{ delete fpVoxelSafety; }

References fpVoxelSafety.

◆ G4ITNavigator1() [2/2]

G4ITNavigator1::G4ITNavigator1 ( const G4ITNavigator1 )
private

Member Function Documentation

◆ Activate()

void G4ITNavigator1::Activate ( G4bool  flag)
inline

◆ CharacteriseDaughters()

EVolume G4ITNavigator1::CharacteriseDaughters ( const G4LogicalVolume pLog) const
inlineprotected

◆ CheckMode()

void G4ITNavigator1::CheckMode ( G4bool  mode)
inline

◆ CheckNextStep()

G4double G4ITNavigator1::CheckNextStep ( const G4ThreeVector pGlobalPoint,
const G4ThreeVector pDirection,
const G4double  pCurrentProposedStepLength,
G4double pNewSafety 
)

Definition at line 1248 of file G4ITNavigator1.cc.

1252{
1253 G4double step;
1254
1255 // Save the state, for this parasitic call
1256 //
1257 SetSavedState();
1258
1259 step = ComputeStep ( pGlobalpoint,
1260 pDirection,
1261 pCurrentProposedStepLength,
1262 pNewSafety );
1263
1264 // If a parasitic call, then attempt to restore the key parts of the state
1265 //
1267
1268 return step;
1269}
double G4double
Definition: G4Types.hh:83
void RestoreSavedState()
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)

References ComputeStep(), RestoreSavedState(), and SetSavedState().

◆ ComputeLocalAxis()

G4ThreeVector G4ITNavigator1::ComputeLocalAxis ( const G4ThreeVector pVec) const
inlineprotected

Referenced by ComputeStep().

◆ ComputeLocalPoint()

G4ThreeVector G4ITNavigator1::ComputeLocalPoint ( const G4ThreeVector rGlobPoint) const
inlineprotected

◆ ComputeSafety()

G4double G4ITNavigator1::ComputeSafety ( const G4ThreeVector globalpoint,
const G4double  pProposedMaxLength = DBL_MAX,
const G4bool  keepState = true 
)
virtual

Definition at line 1721 of file G4ITNavigator1.cc.

1724{
1725 G4double newSafety = 0.0;
1726
1727#ifdef G4DEBUG_NAVIGATION
1728 G4int oldcoutPrec = G4cout.precision(8);
1729 if( fVerbose > 0 )
1730 {
1731 G4cout << "*** G4ITNavigator1::ComputeSafety: ***" << G4endl
1732 << " Called at point: " << pGlobalpoint << G4endl;
1733
1734 G4VPhysicalVolume *motherPhysical = fHistory.GetTopVolume();
1735 G4cout << " Volume = " << motherPhysical->GetName()
1736 << " - Maximum length = " << pMaxLength << G4endl;
1737 if( fVerbose >= 4 )
1738 {
1739 G4cout << " ----- Upon entering Compute Safety:" << G4endl;
1740 PrintState();
1741 }
1742 }
1743#endif
1744
1745 if (keepState) { SetSavedState(); }
1746
1747 G4double distEndpointSq = (pGlobalpoint-fStepEndPoint).mag2();
1748 G4bool stayedOnEndpoint = distEndpointSq < kCarTolerance*kCarTolerance;
1749 G4bool endpointOnSurface = fEnteredDaughter || fExitedMother;
1750
1751 if( !(endpointOnSurface && stayedOnEndpoint) )
1752 {
1753 // Pseudo-relocate to this point (updates voxel information only)
1754 //
1755 LocateGlobalPointWithinVolume( pGlobalpoint );
1756 // --->> DANGER: Side effects on sub-navigator voxel information <<---
1757 // Could be replaced again by 'granular' calls to sub-navigator
1758 // locates (similar side-effects, but faster.
1759 // Solutions:
1760 // 1) Re-locate (to where?)
1761 // 2) Insure that the methods using (G4ComputeStep?)
1762 // does a relocation (if information is disturbed only ?)
1763
1764#ifdef G4DEBUG_NAVIGATION
1765 if( fVerbose >= 2 )
1766 {
1767 G4cout << " G4ITNavigator1::ComputeSafety() relocates-in-volume to point: "
1768 << pGlobalpoint << G4endl;
1769 }
1770#endif
1771 G4VPhysicalVolume *motherPhysical = fHistory.GetTopVolume();
1772 G4LogicalVolume *motherLogical = motherPhysical->GetLogicalVolume();
1773 G4SmartVoxelHeader* pVoxelHeader = motherLogical->GetVoxelHeader();
1774 G4ThreeVector localPoint = ComputeLocalPoint(pGlobalpoint);
1775
1777 {
1778 switch(CharacteriseDaughters(motherLogical))
1779 {
1780 case kNormal:
1781 if ( pVoxelHeader )
1782 {
1783#ifdef G4NEW_SAFETY
1784 G4double safetyTwo = fpVoxelSafety->ComputeSafety(localPoint,
1785 *motherPhysical, pMaxLength);
1786 newSafety= safetyTwo; // Faster and best available
1787#else
1788 G4double safetyOldVoxel;
1789 safetyOldVoxel =
1790 fvoxelNav.ComputeSafety(localPoint,fHistory,pMaxLength);
1791 newSafety= safetyOldVoxel;
1792#endif
1793 }
1794 else
1795 {
1796 newSafety=fnormalNav.ComputeSafety(localPoint,fHistory,pMaxLength);
1797 }
1798 break;
1799 case kParameterised:
1800 if( GetDaughtersRegularStructureId(motherLogical) != 1 )
1801 {
1802 newSafety=fparamNav.ComputeSafety(localPoint,fHistory,pMaxLength);
1803 }
1804 else // Regular structure
1805 {
1806 newSafety=fregularNav.ComputeSafety(localPoint,fHistory,pMaxLength);
1807 }
1808 break;
1809 case kReplica:
1810 G4Exception("G4ITNavigator1::ComputeSafety()", "GeomNav0001",
1811 FatalException, "Not applicable for replicated volumes.");
1812 break;
1813 case kExternal:
1814 G4Exception("G4ITNavigator1::ComputeSafety()",
1815 "GeomNav0001", FatalException,
1816 "Not applicable for external volumes.");
1817 break;
1818 }
1819 }
1820 else
1821 {
1822 newSafety = freplicaNav.ComputeSafety(pGlobalpoint, localPoint,
1823 fHistory, pMaxLength);
1824 }
1825 }
1826 else // if( endpointOnSurface && stayedOnEndpoint )
1827 {
1828#ifdef G4DEBUG_NAVIGATION
1829 if( fVerbose >= 2 )
1830 {
1831 G4cout << " G4ITNavigator1::ComputeSafety() finds that point - "
1832 << pGlobalpoint << " - is on surface " << G4endl;
1833 if( fEnteredDaughter ) { G4cout << " entered new daughter volume"; }
1834 if( fExitedMother ) { G4cout << " and exited previous volume."; }
1835 G4cout << G4endl;
1836 G4cout << " EndPoint was = " << fStepEndPoint << G4endl;
1837 }
1838#endif
1839 newSafety = 0.0;
1840 }
1841
1842 // Remember last safety origin & value
1843 //
1844 fPreviousSftOrigin = pGlobalpoint;
1845 fPreviousSafety = newSafety;
1846
1847 if (keepState) { RestoreSavedState(); }
1848
1849#ifdef G4DEBUG_NAVIGATION
1850 if( fVerbose > 1 )
1851 {
1852 G4cout << " ---- Exiting ComputeSafety " << G4endl;
1853 if( fVerbose > 2 ) { PrintState(); }
1854 G4cout << " Returned value of Safety = " << newSafety << G4endl;
1855 }
1856 G4cout.precision(oldcoutPrec);
1857#endif
1858
1859 return newSafety;
1860}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
G4VoxelNavigation fvoxelNav
G4ParameterisedNavigation fparamNav
G4int GetDaughtersRegularStructureId(const G4LogicalVolume *pLog) const
G4ReplicaNavigation freplicaNav
void PrintState() const
EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const
G4NavigationHistory fHistory
G4ThreeVector fPreviousSftOrigin
G4double fPreviousSafety
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &rGlobPoint) const
G4SmartVoxelHeader * GetVoxelHeader() const
EVolume GetTopVolumeType() const
G4VPhysicalVolume * GetTopVolume() const
G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
G4double ComputeSafety(const G4ThreeVector &globalPoint, const G4ThreeVector &localPoint, G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4VPhysicalVolume &currentPhysical, G4double maxLength=DBL_MAX)
@ kNormal
Definition: geomdefs.hh:84
@ kParameterised
Definition: geomdefs.hh:86
@ kExternal
Definition: geomdefs.hh:87
@ kReplica
Definition: geomdefs.hh:85

References CharacteriseDaughters(), ComputeLocalPoint(), G4NormalNavigation::ComputeSafety(), G4VoxelNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeSafety(), G4ParameterisedNavigation::ComputeSafety(), G4RegularNavigation::ComputeSafety(), G4VoxelSafety::ComputeSafety(), FatalException, fEnteredDaughter, fExitedMother, fHistory, fnormalNav, fparamNav, fPreviousSafety, fPreviousSftOrigin, fpVoxelSafety, fregularNav, freplicaNav, fStepEndPoint, fVerbose, fvoxelNav, G4cout, G4endl, G4Exception(), GetDaughtersRegularStructureId(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4NavigationHistory::GetTopVolume(), G4NavigationHistory::GetTopVolumeType(), G4LogicalVolume::GetVoxelHeader(), kCarTolerance, kExternal, kNormal, kParameterised, kReplica, LocateGlobalPointWithinVolume(), PrintState(), RestoreSavedState(), and SetSavedState().

◆ ComputeStep()

G4double G4ITNavigator1::ComputeStep ( const G4ThreeVector pGlobalPoint,
const G4ThreeVector pDirection,
const G4double  pCurrentProposedStepLength,
G4double pNewSafety 
)
virtual

Definition at line 801 of file G4ITNavigator1.cc.

805{
806 G4ThreeVector localDirection = ComputeLocalAxis(pDirection);
807 G4double Step = kInfinity;
808 G4VPhysicalVolume *motherPhysical = fHistory.GetTopVolume();
809 G4LogicalVolume *motherLogical = motherPhysical->GetLogicalVolume();
810
811 // All state relating to exiting normals must be reset
812 //
814 // Reset value - to erase its memory
816 // Reset - used for local exit normal
818 fCalculatedExitNormal = false;
819 // Reset for new step
820
821 static G4ThreadLocal G4int sNavCScalls=0;
822 sNavCScalls++;
823
825
826#ifdef G4VERBOSE
827 if( fVerbose > 0 )
828 {
829 G4cout << "*** G4ITNavigator1::ComputeStep: ***" << G4endl;
830 G4cout << " Volume = " << motherPhysical->GetName()
831 << " - Proposed step length = " << pCurrentProposedStepLength
832 << G4endl;
833#ifdef G4DEBUG_NAVIGATION
834 if( fVerbose >= 2 )
835 {
836 G4cout << " Called with the arguments: " << G4endl
837 << " Globalpoint = " << std::setw(25) << pGlobalpoint << G4endl
838 << " Direction = " << std::setw(25) << pDirection << G4endl;
839 if( fVerbose >= 4 )
840 {
841 G4cout << " ---- Upon entering : State" << G4endl;
842 PrintState();
843 }
844 }
845#endif
846 }
847#endif
848
849 G4ThreeVector newLocalPoint = ComputeLocalPoint(pGlobalpoint);
850 if( newLocalPoint != fLastLocatedPointLocal )
851 {
852 // Check whether the relocation is within safety
853 //
855 G4double moveLenSq = (newLocalPoint-oldLocalPoint).mag2();
856
857 if ( moveLenSq >= kCarTolerance*kCarTolerance )
858 {
859#ifdef G4VERBOSE
860 ComputeStepLog(pGlobalpoint, moveLenSq);
861#endif
862 // Relocate the point within the same volume
863 //
864 LocateGlobalPointWithinVolume( pGlobalpoint );
865 fLastTriedStepComputation= true; // Ensure that this is set again !!
866 }
867 }
869 {
870 switch( CharacteriseDaughters(motherLogical) )
871 {
872 case kNormal:
873 if ( motherLogical->GetVoxelHeader() )
874 {
876 localDirection,
877 pCurrentProposedStepLength,
878 pNewSafety,
879 fHistory,
882 fExiting,
883 fEntering,
886
887 }
888 else
889 {
890 if( motherPhysical->GetRegularStructureId() == 0 )
891 {
893 localDirection,
894 pCurrentProposedStepLength,
895 pNewSafety,
896 fHistory,
899 fExiting,
900 fEntering,
903 }
904 else // Regular (non-voxelised) structure
905 {
906 LocateGlobalPointAndSetup( pGlobalpoint, &pDirection, true, true );
907 fLastTriedStepComputation= true; // Ensure that this is set again !!
908 //
909 // if physical process limits the step, the voxel will not be the
910 // one given by ComputeStepSkippingEqualMaterials() and the local
911 // point will be wrongly calculated.
912
913 // There is a problem: when msc limits the step and the point is
914 // assigned wrongly to phantom in previous step (while it is out
915 // of the container volume). Then LocateGlobalPointAndSetup() has
916 // reset the history topvolume to world.
917 //
919 {
920 G4Exception("G4ITNavigator1::ComputeStep()",
921 "GeomNav1001", JustWarning,
922 "Point is relocated in voxels, while it should be outside!");
924 localDirection,
925 pCurrentProposedStepLength,
926 pNewSafety,
927 fHistory,
930 fExiting,
931 fEntering,
934 }
935 else
936 {
937 Step = fregularNav.
938 ComputeStepSkippingEqualMaterials(fLastLocatedPointLocal,
939 localDirection,
940 pCurrentProposedStepLength,
941 pNewSafety,
942 fHistory,
945 fExiting,
946 fEntering,
949 motherPhysical);
950 }
951 }
952 }
953 break;
954 case kParameterised:
955 if( GetDaughtersRegularStructureId(motherLogical) != 1 )
956 {
958 localDirection,
959 pCurrentProposedStepLength,
960 pNewSafety,
961 fHistory,
964 fExiting,
965 fEntering,
968 }
969 else // Regular structure
970 {
972 localDirection,
973 pCurrentProposedStepLength,
974 pNewSafety,
975 fHistory,
978 fExiting,
979 fEntering,
982 }
983 break;
984 case kReplica:
985 G4Exception("G4ITNavigator1::ComputeStep()", "GeomNav0001",
986 FatalException, "Not applicable for replicated volumes.");
987 break;
988 case kExternal:
989 G4Exception("G4ITNavigator1::ComputeStep()", "GeomNav0001",
990 FatalException, "Not applicable for external volumes.");
991 break;
992 }
993 }
994 else
995 {
996 // In the case of a replica, it must handle the exiting
997 // edge/corner problem by itself
998 //
999 G4bool exitingReplica = fExitedMother;
1000 G4bool calculatedExitNormal= false;
1001
1002 Step = freplicaNav.ComputeStep(pGlobalpoint,
1003 pDirection,
1005 localDirection,
1006 pCurrentProposedStepLength,
1007 pNewSafety,
1008 fHistory,
1010 calculatedExitNormal,
1012 exitingReplica,
1013 fEntering,
1016 fExiting= exitingReplica;
1017 fCalculatedExitNormal= calculatedExitNormal;
1018 }
1019
1020 // Remember last safety origin & value.
1021 //
1022 fPreviousSftOrigin = pGlobalpoint;
1023 fPreviousSafety = pNewSafety;
1024
1025 // Count zero steps - one can occur due to changing momentum at a boundary
1026 // - one, two (or a few) can occur at common edges between
1027 // volumes
1028 // - more than two is likely a problem in the geometry
1029 // description or the Navigation
1030
1031 // Rule of thumb: likely at an Edge if two consecutive steps are zero,
1032 // because at least two candidate volumes must have been
1033 // checked
1034 //
1035 fLocatedOnEdge = fLastStepWasZero && (Step==0.0);
1036 fLastStepWasZero = (Step==0.0);
1037 if (fPushed) { fPushed = fLastStepWasZero; }
1038
1039 // Handle large number of consecutive zero steps
1040 //
1041 if ( fLastStepWasZero )
1042 {
1044#ifdef G4DEBUG_NAVIGATION
1045 if( fNumberZeroSteps > 1 )
1046 {
1047 G4cout << "G4ITNavigator1::ComputeStep(): another zero step, # "
1049 << " at " << pGlobalpoint
1050 << " in volume " << motherPhysical->GetName()
1051 << " nav-comp-step calls # " << sNavCScalls
1052 << G4endl;
1053 }
1054#endif
1056 {
1057 // Act to recover this stuck track. Pushing it along direction
1058 //
1059 Step += 100*kCarTolerance;
1060#ifdef G4VERBOSE
1061 if ((!fPushed) && (fWarnPush))
1062 {
1063 std::ostringstream message;
1064 message << "Track stuck or not moving." << G4endl
1065 << " Track stuck, not moving for "
1066 << fNumberZeroSteps << " steps" << G4endl
1067 << " in volume -" << motherPhysical->GetName()
1068 << "- at point " << pGlobalpoint << G4endl
1069 << " direction: " << pDirection << "." << G4endl
1070 << " Potential geometry or navigation problem !"
1071 << G4endl
1072 << " Trying pushing it of " << Step << " mm ...";
1073 G4Exception("G4ITNavigator1::ComputeStep()", "GeomNav1002",
1074 JustWarning, message, "Potential overlap in geometry!");
1075 }
1076#endif
1077 fPushed = true;
1078 }
1080 {
1081 // Must kill this stuck track
1082 //
1083 std::ostringstream message;
1084 message << "Stuck Track: potential geometry or navigation problem."
1085 << G4endl
1086 << " Track stuck, not moving for "
1087 << fNumberZeroSteps << " steps" << G4endl
1088 << " in volume -" << motherPhysical->GetName()
1089 << "- at point " << pGlobalpoint << G4endl
1090 << " direction: " << pDirection << ".";
1091 motherPhysical->CheckOverlaps(5000, false);
1092 G4Exception("G4ITNavigator1::ComputeStep()", "GeomNav0003",
1093 EventMustBeAborted, message);
1094 }
1095 }
1096 else
1097 {
1098 if (!fPushed) fNumberZeroSteps = 0;
1099 }
1100
1101 fEnteredDaughter = fEntering; // I expect to enter a volume in this Step
1103
1104 fStepEndPoint = pGlobalpoint + Step * pDirection;
1105 fLastStepEndPointLocal = fLastLocatedPointLocal + Step * localDirection;
1106
1107 if( fExiting )
1108 {
1109#ifdef G4DEBUG_NAVIGATION
1110 if( fVerbose > 2 )
1111 {
1112 G4cout << " At G4Nav CompStep End - if(exiting) - fExiting= " << fExiting
1113 << " fValidExitNormal = " << fValidExitNormal << G4endl;
1114 G4cout << " fExitNormal= " << fExitNormal << G4endl;
1115 }
1116#endif
1117
1119 {
1121 {
1122 // Convention: fExitNormal is in the 'grand-mother' coordinate system
1123 //
1126 }
1127 else
1128 {
1130 }
1131 }
1132 else
1133 {
1134 // We must calculate the normal anyway (in order to have it if requested)
1135 //
1136 G4ThreeVector finalLocalPoint =
1137 fLastLocatedPointLocal + localDirection*Step;
1138
1140 {
1141 // Find normal in the 'mother' coordinate system
1142 //
1143 G4ThreeVector exitNormalMotherFrame=
1144 motherLogical->GetSolid()->SurfaceNormal(finalLocalPoint);
1145
1146 // Transform it to the 'grand-mother' coordinate system
1147 //
1148 const G4RotationMatrix* mRot = motherPhysical->GetRotation();
1149 if( mRot )
1150 {
1152 fGrandMotherExitNormal = (*mRot).inverse() * exitNormalMotherFrame;
1153 }
1154 else
1155 {
1156 fGrandMotherExitNormal = exitNormalMotherFrame;
1157 }
1158
1159 // Do not set fValidExitNormal -- this signifies
1160 // that the solid is convex!
1161 //
1163 }
1164 else
1165 {
1166 fCalculatedExitNormal = false;
1167 //
1168 // Nothing can be done at this stage currently - to solve this
1169 // Replica Navigation must have calculated the normal for this case
1170 // already.
1171 // Cases: mother is not convex, and exit is at previous replica level
1172
1173#ifdef G4DEBUG_NAVIGATION
1175
1176 desc << "Problem in ComputeStep: Replica Navigation did not provide"
1177 << " valid exit Normal. " << G4endl;
1178 desc << " Do not know how calculate it in this case." << G4endl;
1179 desc << " Location = " << finalLocalPoint << G4endl;
1180 desc << " Volume name = " << motherPhysical->GetName()
1181 << " copy/replica No = " << motherPhysical->GetCopyNo() << G4endl;
1182 G4Exception("G4ITNavigator1::ComputeStep()", "GeomNav0003",
1183 JustWarning, desc, "Normal not available for exiting.");
1184#endif
1185 }
1186 }
1187
1188 // Now transform it to the global reference frame !!
1189 //
1191 {
1192 G4int depth= fHistory.GetDepth();
1193 if( depth > 0 )
1194 {
1195 G4AffineTransform GrandMotherToGlobalTransf =
1196 fHistory.GetTransform(depth-1).Inverse();
1198 GrandMotherToGlobalTransf.TransformAxis( fGrandMotherExitNormal );
1199 }
1200 else
1201 {
1203 }
1204 }
1205 else
1206 {
1208 }
1209 }
1210 fStepEndPoint= pGlobalpoint+Step*pDirection;
1211
1212 if( (Step == pCurrentProposedStepLength) && (!fExiting) && (!fEntering) )
1213 {
1214 // This if Step is not really limited by the geometry.
1215 // The Navigator is obliged to return "infinity"
1216 //
1217 Step = kInfinity;
1218 }
1219
1220#ifdef G4VERBOSE
1221 if( fVerbose > 1 )
1222 {
1223 if( fVerbose >= 4 )
1224 {
1225 G4cout << " ----- Upon exiting :" << G4endl;
1226 PrintState();
1227 }
1228 G4cout << " Returned step= " << Step;
1229 if( fVerbose > 5 ) G4cout << G4endl;
1230 if( Step == kInfinity )
1231 {
1232 G4cout << " Requested step= " << pCurrentProposedStepLength ;
1233 if( fVerbose > 5) G4cout << G4endl;
1234 }
1235 G4cout << " Safety = " << pNewSafety << G4endl;
1236 }
1237#endif
1238
1239 return Step;
1240}
@ JustWarning
@ EventMustBeAborted
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4AffineTransform Inverse() const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
void ComputeStepLog(const G4ThreeVector &pGlobalpoint, G4double moveLenSq) const
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
G4bool fCalculatedExitNormal
G4bool fChangedGrandMotherRefFrame
G4ThreeVector ComputeLocalAxis(const G4ThreeVector &pVec) const
G4VPhysicalVolume * fBlockedPhysicalVolume
G4ThreeVector fExitNormalGlobalFrame
G4ThreeVector fGrandMotherExitNormal
G4ThreeVector fLastLocatedPointLocal
G4ThreeVector fExitNormal
G4VSolid * GetSolid() const
size_t GetDepth() const
const G4AffineTransform & GetTransform(G4int n) 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)
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)
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)
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)
const G4RotationMatrix * GetRotation() const
virtual G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true, G4int errMax=1)
virtual G4int GetCopyNo() const =0
virtual G4int GetRegularStructureId() const =0
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) 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)
#define G4ThreadLocal
Definition: tls.hh:77

References CharacteriseDaughters(), G4VPhysicalVolume::CheckOverlaps(), ComputeLocalAxis(), ComputeLocalPoint(), G4ParameterisedNavigation::ComputeStep(), G4RegularNavigation::ComputeStep(), G4VoxelNavigation::ComputeStep(), G4ReplicaNavigation::ComputeStep(), G4NormalNavigation::ComputeStep(), ComputeStepLog(), EventMustBeAborted, fAbandonThreshold_NoZeroSteps, fActionThreshold_NoZeroSteps, FatalException, fBlockedPhysicalVolume, fBlockedReplicaNo, fCalculatedExitNormal, fChangedGrandMotherRefFrame, fEnteredDaughter, fEntering, fExitedMother, fExiting, fExitNormal, fExitNormalGlobalFrame, fGrandMotherExitNormal, fHistory, fLastLocatedPointLocal, fLastStepEndPointLocal, fLastStepWasZero, fLastTriedStepComputation, fLocatedOnEdge, fnormalNav, fNumberZeroSteps, fparamNav, fPreviousSafety, fPreviousSftOrigin, fPushed, fregularNav, freplicaNav, fStepEndPoint, fValidExitNormal, fVerbose, fvoxelNav, fWarnPush, G4cout, G4endl, G4Exception(), G4ThreadLocal, G4VPhysicalVolume::GetCopyNo(), GetDaughtersRegularStructureId(), G4NavigationHistory::GetDepth(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4VPhysicalVolume::GetRegularStructureId(), G4VPhysicalVolume::GetRotation(), G4LogicalVolume::GetSolid(), G4NavigationHistory::GetTopVolume(), G4NavigationHistory::GetTopVolumeType(), G4NavigationHistory::GetTransform(), G4LogicalVolume::GetVoxelHeader(), G4AffineTransform::Inverse(), JustWarning, kCarTolerance, kExternal, kInfinity, kNormal, kParameterised, kReplica, LocateGlobalPointAndSetup(), LocateGlobalPointWithinVolume(), PrintState(), G4VSolid::SurfaceNormal(), and G4AffineTransform::TransformAxis().

Referenced by CheckNextStep().

◆ ComputeStepLog()

void G4ITNavigator1::ComputeStepLog ( const G4ThreeVector pGlobalpoint,
G4double  moveLenSq 
) const
private

Definition at line 1938 of file G4ITNavigator1.cc.

1940{
1941 // The following checks only make sense if the move is larger
1942 // than the tolerance.
1943
1944 static const G4double fAccuracyForWarning = kCarTolerance,
1945 fAccuracyForException = 1000*kCarTolerance;
1946
1947 G4ThreeVector OriginalGlobalpoint = fHistory.GetTopTransform().Inverse().
1948 TransformPoint(fLastLocatedPointLocal);
1949
1950 G4double shiftOriginSafSq = (fPreviousSftOrigin-pGlobalpoint).mag2();
1951
1952 // Check that the starting point of this step is
1953 // within the isotropic safety sphere of the last point
1954 // to a accuracy/precision given by fAccuracyForWarning.
1955 // If so give warning.
1956 // If it fails by more than fAccuracyForException exit with error.
1957 //
1958 if( shiftOriginSafSq >= sqr(fPreviousSafety) )
1959 {
1960 G4double shiftOrigin = std::sqrt(shiftOriginSafSq);
1961 G4double diffShiftSaf = shiftOrigin - fPreviousSafety;
1962
1963 if( diffShiftSaf > fAccuracyForWarning )
1964 {
1965 G4int oldcoutPrec= G4cout.precision(8);
1966 G4int oldcerrPrec= G4cerr.precision(10);
1967 std::ostringstream message, suggestion;
1968 message << "Accuracy error or slightly inaccurate position shift."
1969 << G4endl
1970 << " The Step's starting point has moved "
1971 << std::sqrt(moveLenSq)/mm << " mm " << G4endl
1972 << " since the last call to a Locate method." << G4endl
1973 << " This has resulted in moving "
1974 << shiftOrigin/mm << " mm "
1975 << " from the last point at which the safety "
1976 << " was calculated " << G4endl
1977 << " which is more than the computed safety= "
1978 << fPreviousSafety/mm << " mm at that point." << G4endl
1979 << " This difference is "
1980 << diffShiftSaf/mm << " mm." << G4endl
1981 << " The tolerated accuracy is "
1982 << fAccuracyForException/mm << " mm.";
1983
1984 suggestion << " ";
1985 static G4ThreadLocal G4int warnNow = 0;
1986 if( ((++warnNow % 100) == 1) )
1987 {
1988 message << G4endl
1989 << " This problem can be due to either " << G4endl
1990 << " - a process that has proposed a displacement"
1991 << " larger than the current safety , or" << G4endl
1992 << " - inaccuracy in the computation of the safety";
1993 suggestion << "We suggest that you " << G4endl
1994 << " - find i) what particle is being tracked, and "
1995 << " ii) through what part of your geometry " << G4endl
1996 << " for example by re-running this event with "
1997 << G4endl
1998 << " /tracking/verbose 1 " << G4endl
1999 << " - check which processes you declare for"
2000 << " this particle (and look at non-standard ones)"
2001 << G4endl
2002 << " - in case, create a detailed logfile"
2003 << " of this event using:" << G4endl
2004 << " /tracking/verbose 6 ";
2005 }
2006 G4Exception("G4ITNavigator1::ComputeStep()",
2007 "GeomNav1002", JustWarning,
2008 message, G4String(suggestion.str()));
2009 G4cout.precision(oldcoutPrec);
2010 G4cerr.precision(oldcerrPrec);
2011 }
2012#ifdef G4DEBUG_NAVIGATION
2013 else
2014 {
2015 G4cerr << "WARNING - G4ITNavigator1::ComputeStep()" << G4endl
2016 << " The Step's starting point has moved "
2017 << std::sqrt(moveLenSq) << "," << G4endl
2018 << " which has taken it to the limit of"
2019 << " the current safety. " << G4endl;
2020 }
2021#endif
2022 }
2023 G4double safetyPlus = fPreviousSafety + fAccuracyForException;
2024 if ( shiftOriginSafSq > sqr(safetyPlus) )
2025 {
2026 std::ostringstream message;
2027 message << "May lead to a crash or unreliable results." << G4endl
2028 << " Position has shifted considerably without"
2029 << " notifying the navigator !" << G4endl
2030 << " Tolerated safety: " << safetyPlus << G4endl
2031 << " Computed shift : " << shiftOriginSafSq;
2032 G4Exception("G4ITNavigator1::ComputeStep()", "GeomNav1002",
2033 JustWarning, message);
2034 }
2035}
static constexpr double mm
Definition: G4SIunits.hh:95
G4GLOB_DLL std::ostream G4cerr
const G4AffineTransform & GetTopTransform() const
T sqr(const T &x)
Definition: templates.hh:128

References fHistory, fLastLocatedPointLocal, fPreviousSafety, fPreviousSftOrigin, G4cerr, G4cout, G4endl, G4Exception(), G4ThreadLocal, G4NavigationHistory::GetTopTransform(), G4AffineTransform::Inverse(), JustWarning, kCarTolerance, mm, and sqr().

Referenced by ComputeStep().

◆ CreateGRSSolid()

G4GRSSolid * G4ITNavigator1::CreateGRSSolid ( ) const
inline

◆ CreateGRSVolume()

G4GRSVolume * G4ITNavigator1::CreateGRSVolume ( ) const
inline

◆ CreateTouchableHistory() [1/2]

G4TouchableHistory * G4ITNavigator1::CreateTouchableHistory ( ) const
inline

◆ CreateTouchableHistory() [2/2]

G4TouchableHistory * G4ITNavigator1::CreateTouchableHistory ( const G4NavigationHistory ) const
inline

◆ CreateTouchableHistoryHandle()

G4TouchableHistoryHandle G4ITNavigator1::CreateTouchableHistoryHandle ( ) const
virtual

Definition at line 1866 of file G4ITNavigator1.cc.

1867{
1869}
G4ReferenceCountedHandle< G4TouchableHistory > G4TouchableHistoryHandle
G4TouchableHistory * CreateTouchableHistory() const

References CreateTouchableHistory().

◆ EnableBestSafety()

void G4ITNavigator1::EnableBestSafety ( G4bool  value = false)
inline

◆ EnteredDaughterVolume()

G4bool G4ITNavigator1::EnteredDaughterVolume ( ) const
inline

Referenced by GetLocalExitNormal().

◆ ExitedMotherVolume()

G4bool G4ITNavigator1::ExitedMotherVolume ( ) const
inline

◆ GetCurrentLocalCoordinate()

G4ThreeVector G4ITNavigator1::GetCurrentLocalCoordinate ( ) const
inline

◆ GetDaughtersRegularStructureId()

G4int G4ITNavigator1::GetDaughtersRegularStructureId ( const G4LogicalVolume pLog) const
inlineprotected

◆ GetGlobalExitNormal()

G4ThreeVector G4ITNavigator1::GetGlobalExitNormal ( const G4ThreeVector point,
G4bool valid 
)
virtual

Definition at line 1619 of file G4ITNavigator1.cc.

1621{
1622 G4bool validNormal;
1623 G4ThreeVector localNormal, globalNormal;
1624
1626 {
1627 // This was computed in ComputeStep -- and only on arrival at boundary
1628 //
1629 globalNormal = fExitNormalGlobalFrame;
1630 *pNormalCalculated = true; // ComputeStep always computes it if Exiting
1631 // (fExiting==true)
1632 }
1633 else
1634 {
1635 localNormal = GetLocalExitNormalAndCheck(IntersectPointGlobal,&validNormal);
1636 *pNormalCalculated = fCalculatedExitNormal;
1637
1638#ifdef G4DEBUG_NAVIGATION
1639 if( (!validNormal) && !fCalculatedExitNormal)
1640 {
1642 edN << " Calculated = " << fCalculatedExitNormal << G4endl;
1643 edN << " Entering= " << fEntering << G4endl;
1644 G4int oldVerbose= this->GetVerboseLevel();
1645 this->SetVerboseLevel(4);
1646 edN << " State of Navigator: " << G4endl;
1647 edN << *this << G4endl;
1648 this->SetVerboseLevel( oldVerbose );
1649
1650 G4Exception("G4ITNavigator1::GetGlobalExitNormal()",
1651 "GeomNav0003", JustWarning, edN,
1652 "LocalExitNormalAndCheck() did not calculate Normal.");
1653 }
1654#endif
1655
1656 G4double localMag2= localNormal.mag2();
1657 if( validNormal && (std::fabs(localMag2-1.0)) > CLHEP::perMillion )
1658 {
1660
1661 edN << "G4ITNavigator1::GetGlobalExitNormal: "
1662 << " Using Local Normal - from call to GetLocalExitNormalAndCheck. "
1663 << G4endl
1664 << " Local Exit Normal = " << localNormal << " || = "
1665 << std::sqrt(localMag2) << G4endl
1666 << " Global Exit Normal = " << globalNormal << " || = "
1667 << globalNormal.mag() << G4endl;
1668 edN << " Calculated It = " << fCalculatedExitNormal << G4endl;
1669
1670 G4Exception("G4ITNavigator1::GetGlobalExitNormal()",
1671 "GeomNav0003",JustWarning, edN,
1672 "Value obtained from new local *solid* is incorrect.");
1673 localNormal = localNormal.unit(); // Should we correct it ??
1674 }
1676 globalNormal = localToGlobal.TransformAxis( localNormal );
1677 }
1678
1679#ifdef G4DEBUG_NAVIGATION
1680 // Temporary extra checks
1682 {
1683 localNormal = GetLocalExitNormalAndCheck( IntersectPointGlobal, &validNormal);
1684 *pNormalCalculated = fCalculatedExitNormal;
1685
1687 globalNormal = localToGlobal.TransformAxis( localNormal );
1688
1689 // Check the value computed against fExitNormalGlobalFrame
1690 G4ThreeVector diffNorm = globalNormal - fExitNormalGlobalFrame;
1691 if( diffNorm.mag2() > perMillion*CLHEP::perMillion)
1692 {
1694 edDfn << "Found difference in normals in case of exiting mother "
1695 << "- when Get is called after ComputingStep " << G4endl;
1696 edDfn << " Magnitude of diff = " << diffNorm.mag() << G4endl;
1697 edDfn << " Normal stored (Global) = " << fExitNormalGlobalFrame
1698 << G4endl;
1699 edDfn << " Global Computed from Local = " << globalNormal << G4endl;
1700 G4Exception("G4ITNavigator1::GetGlobalExitNormal()", "GeomNav0003",
1701 JustWarning, edDfn);
1702 }
1703 }
1704#endif
1705
1706 return globalNormal;
1707}
static constexpr double perMillion
Definition: G4SIunits.hh:327
Hep3Vector unit() const
double mag2() const
double mag() const
const G4AffineTransform GetLocalToGlobalTransform() const
G4int GetVerboseLevel() const
virtual G4ThreeVector GetLocalExitNormalAndCheck(const G4ThreeVector &point, G4bool *valid)
void SetVerboseLevel(G4int level)
static constexpr double perMillion

References fCalculatedExitNormal, fEntering, fExiting, fExitNormalGlobalFrame, fLastTriedStepComputation, G4endl, G4Exception(), GetLocalExitNormalAndCheck(), GetLocalToGlobalTransform(), GetVerboseLevel(), JustWarning, CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::mag2(), CLHEP::perMillion, perMillion, SetVerboseLevel(), G4AffineTransform::TransformAxis(), and CLHEP::Hep3Vector::unit().

◆ GetGlobalToLocalTransform()

const G4AffineTransform & G4ITNavigator1::GetGlobalToLocalTransform ( ) const
inline

◆ GetLocalExitNormal()

G4ThreeVector G4ITNavigator1::GetLocalExitNormal ( G4bool valid)
virtual

Definition at line 1372 of file G4ITNavigator1.cc.

1373{
1374 G4ThreeVector ExitNormal(0.,0.,0.);
1375 G4VSolid *currentSolid=0;
1376 G4LogicalVolume *candidateLogical;
1378 {
1379 // use fLastLocatedPointLocal and next candidate volume
1380 //
1381 G4ThreeVector nextSolidExitNormal(0.,0.,0.);
1382
1383 if( fEntering && (fBlockedPhysicalVolume!=0) )
1384 {
1385 candidateLogical= fBlockedPhysicalVolume->GetLogicalVolume();
1386 if( candidateLogical )
1387 {
1388 // fLastStepEndPointLocal is in the coordinates of the mother
1389 // we need it in the daughter's coordinate system.
1390
1391 // The following code should also work in case of Replica
1392 {
1393 // First transform fLastLocatedPointLocal to the new daughter
1394 // coordinates
1395 //
1396 G4AffineTransform MotherToDaughterTransform=
1400 G4ThreeVector daughterPointOwnLocal=
1401 MotherToDaughterTransform.TransformPoint( fLastStepEndPointLocal );
1402
1403 // OK if it is a parameterised volume
1404 //
1405 EInside inSideIt;
1406 G4bool onSurface;
1407 G4double safety= -1.0;
1408 currentSolid= candidateLogical->GetSolid();
1409 inSideIt = currentSolid->Inside(daughterPointOwnLocal);
1410 onSurface = (inSideIt == kSurface);
1411 if( ! onSurface )
1412 {
1413 if( inSideIt == kOutside )
1414 {
1415 safety = (currentSolid->DistanceToIn(daughterPointOwnLocal));
1416 onSurface = safety < 100.0 * kCarTolerance;
1417 }
1418 else if (inSideIt == kInside )
1419 {
1420 safety = (currentSolid->DistanceToOut(daughterPointOwnLocal));
1421 onSurface = safety < 100.0 * kCarTolerance;
1422 }
1423 }
1424
1425 if( onSurface )
1426 {
1427 nextSolidExitNormal =
1428 currentSolid->SurfaceNormal(daughterPointOwnLocal);
1429
1430 // Entering the solid ==> opposite
1431 //
1432 ExitNormal = -nextSolidExitNormal;
1434 }
1435 else
1436 {
1437#ifdef G4VERBOSE
1438 if(( fVerbose == 1 ) && ( fCheck ))
1439 {
1440 std::ostringstream message;
1441 message << "Point not on surface ! " << G4endl
1442 << " Point = "
1443 << daughterPointOwnLocal << G4endl
1444 << " Physical volume = "
1446 << " Logical volume = "
1447 << candidateLogical->GetName() << G4endl
1448 << " Solid = " << currentSolid->GetName()
1449 << " Type = "
1450 << currentSolid->GetEntityType() << G4endl
1451 << *currentSolid << G4endl;
1452 if( inSideIt == kOutside )
1453 {
1454 message << "Point is Outside. " << G4endl
1455 << " Safety (from outside) = " << safety << G4endl;
1456 }
1457 else // if( inSideIt == kInside )
1458 {
1459 message << "Point is Inside. " << G4endl
1460 << " Safety (from inside) = " << safety << G4endl;
1461 }
1462 G4Exception("G4ITNavigator1::GetLocalExitNormal()", "GeomNav1001",
1463 JustWarning, message);
1464 }
1465#endif
1466 }
1467 *valid = onSurface; // was =true;
1468 }
1469 }
1470 }
1471 else if ( fExiting )
1472 {
1473 ExitNormal = fGrandMotherExitNormal;
1474 *valid = true;
1475 fCalculatedExitNormal= true; // Should be true already
1476 }
1477 else // i.e. ( fBlockedPhysicalVolume == 0 )
1478 {
1479 *valid = false;
1480 G4Exception("G4ITNavigator1::GetLocalExitNormal()",
1481 "GeomNav0003", JustWarning,
1482 "Incorrect call to GetLocalSurfaceNormal." );
1483 }
1484 }
1485 else // ( ! fLastTriedStepComputation ) ie. last call was to Locate
1486 {
1487 if ( EnteredDaughterVolume() )
1488 {
1489 G4VSolid* daughterSolid =fHistory.GetTopVolume()->GetLogicalVolume()
1490 ->GetSolid();
1491 ExitNormal= -(daughterSolid->SurfaceNormal(fLastLocatedPointLocal));
1492 if( std::fabs(ExitNormal.mag2()-1.0 ) > CLHEP::perMillion )
1493 {
1495 desc << " Parameters of solid: " << *daughterSolid
1496 << " Point for surface = " << fLastLocatedPointLocal << std::endl;
1497 G4Exception("G4ITNavigator1::GetLocalExitNormal()",
1498 "GeomNav0003", FatalException, desc,
1499 "Surface Normal returned by Solid is not a Unit Vector." );
1500 }
1502 *valid = true;
1503 }
1504 else
1505 {
1506 if( fExitedMother )
1507 {
1508 ExitNormal = fGrandMotherExitNormal;
1509 *valid = true;
1511 }
1512 else // We are not at a boundary. ExitNormal remains (0,0,0)
1513 {
1514 *valid = false;
1515 fCalculatedExitNormal= false;
1516 G4ExceptionDescription message;
1517 message << "Function called when *NOT* at a Boundary." << G4endl;
1518 G4Exception("G4ITNavigator1::GetLocalExitNormal()",
1519 "GeomNav0003", JustWarning, message);
1520 }
1521 }
1522 }
1523 return ExitNormal;
1524}
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4bool EnteredDaughterVolume() const
G4AffineTransform GetMotherToDaughterTransform(G4VPhysicalVolume *dVolume, G4int dReplicaNo, EVolume dVolumeType)
EVolume VolumeType(const G4VPhysicalVolume *pVol) const
const G4String & GetName() const
G4String GetName() const
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
virtual G4GeometryType GetEntityType() const =0
EInside
Definition: geomdefs.hh:67
@ kInside
Definition: geomdefs.hh:70
@ kOutside
Definition: geomdefs.hh:68
@ kSurface
Definition: geomdefs.hh:69

References G4VSolid::DistanceToIn(), G4VSolid::DistanceToOut(), EnteredDaughterVolume(), FatalException, fBlockedPhysicalVolume, fBlockedReplicaNo, fCalculatedExitNormal, fCheck, fEntering, fExitedMother, fExiting, fGrandMotherExitNormal, fHistory, fLastLocatedPointLocal, fLastStepEndPointLocal, fLastTriedStepComputation, fVerbose, G4endl, G4Exception(), G4VSolid::GetEntityType(), G4VPhysicalVolume::GetLogicalVolume(), GetMotherToDaughterTransform(), G4LogicalVolume::GetName(), G4VPhysicalVolume::GetName(), G4VSolid::GetName(), G4LogicalVolume::GetSolid(), G4NavigationHistory::GetTopVolume(), G4VSolid::Inside(), JustWarning, kCarTolerance, kInside, kOutside, kSurface, CLHEP::Hep3Vector::mag2(), CLHEP::perMillion, G4VSolid::SurfaceNormal(), G4AffineTransform::TransformPoint(), and VolumeType().

Referenced by GetLocalExitNormalAndCheck().

◆ GetLocalExitNormalAndCheck()

G4ThreeVector G4ITNavigator1::GetLocalExitNormalAndCheck ( const G4ThreeVector point,
G4bool valid 
)
virtual

Definition at line 1583 of file G4ITNavigator1.cc.

1591{
1592#ifdef G4DEBUG_NAVIGATION
1593 // Check Current point against expected 'local' value
1594 //
1596 {
1597 G4ThreeVector ExpectedBoundaryPointLocal;
1598
1599 const G4AffineTransform& GlobalToLocal= GetGlobalToLocalTransform();
1600 ExpectedBoundaryPointLocal =
1601 GlobalToLocal.TransformPoint( ExpectedBoundaryPointGlobal );
1602
1603 // Add here: Comparison against expected position,
1604 // i.e. the endpoint of ComputeStep
1605 }
1606#endif
1607
1608 return GetLocalExitNormal( pValid);
1609}
const G4AffineTransform & GetGlobalToLocalTransform() const
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)

References fLastTriedStepComputation, GetGlobalToLocalTransform(), GetLocalExitNormal(), and G4AffineTransform::TransformPoint().

Referenced by GetGlobalExitNormal().

◆ GetLocalToGlobalTransform()

const G4AffineTransform G4ITNavigator1::GetLocalToGlobalTransform ( ) const
inline

Referenced by GetGlobalExitNormal().

◆ GetMotherToDaughterTransform()

G4AffineTransform G4ITNavigator1::GetMotherToDaughterTransform ( G4VPhysicalVolume dVolume,
G4int  dReplicaNo,
EVolume  dVolumeType 
)

Definition at line 1533 of file G4ITNavigator1.cc.

1536{
1537 switch (enteringVolumeType)
1538 {
1539 case kNormal: // Nothing is needed to prepare the transformation
1540 break; // It is stored already in the physical volume (placement)
1541 case kReplica: // Sets the transform in the Replica - tbc
1542 G4Exception("G4ITNavigator1::GetMotherToDaughterTransform()",
1543 "GeomNav0001", FatalException,
1544 "Method NOT Implemented yet for replica volumes.");
1545 break;
1546 case kParameterised:
1547 if( pEnteringPhysVol->GetRegularStructureId() == 0 )
1548 {
1549 G4VPVParameterisation *pParam =
1550 pEnteringPhysVol->GetParameterisation();
1551 G4VSolid* pSolid =
1552 pParam->ComputeSolid(enteringReplicaNo, pEnteringPhysVol);
1553 pSolid->ComputeDimensions(pParam, enteringReplicaNo, pEnteringPhysVol);
1554
1555 // Sets the transform in the Parameterisation
1556 //
1557 pParam->ComputeTransformation(enteringReplicaNo, pEnteringPhysVol);
1558
1559 // Set the correct solid and material in Logical Volume
1560 //
1561 G4LogicalVolume* pLogical = pEnteringPhysVol->GetLogicalVolume();
1562 pLogical->SetSolid( pSolid );
1563 }
1564 break;
1565 case kExternal:
1566 G4Exception("G4ITNavigator1::GetMotherToDaughterTransform()",
1567 "GeomNav0001", FatalException,
1568 "Not applicable for external volumes.");
1569 break;
1570 }
1571 return G4AffineTransform(pEnteringPhysVol->GetRotation(),
1572 pEnteringPhysVol->GetTranslation()).Invert();
1573}
G4AffineTransform & Invert()
void SetSolid(G4VSolid *pSolid)
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4VSolid.cc:137

References G4VSolid::ComputeDimensions(), G4VPVParameterisation::ComputeSolid(), G4VPVParameterisation::ComputeTransformation(), FatalException, G4Exception(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetParameterisation(), G4VPhysicalVolume::GetRegularStructureId(), G4VPhysicalVolume::GetRotation(), G4VPhysicalVolume::GetTranslation(), G4AffineTransform::Invert(), kExternal, kNormal, kParameterised, kReplica, and G4LogicalVolume::SetSolid().

Referenced by GetLocalExitNormal().

◆ GetNavigatorState()

G4ITNavigatorState_Lock1 * G4ITNavigator1::GetNavigatorState ( )

Definition at line 670 of file G4ITNavigator1.cc.

671{
673 return fpSaveState;
674}

References fpSaveState, and SetSavedState().

◆ GetVerboseLevel()

G4int G4ITNavigator1::GetVerboseLevel ( ) const
inline

Referenced by GetGlobalExitNormal().

◆ GetWorldVolume()

G4VPhysicalVolume * G4ITNavigator1::GetWorldVolume ( ) const
inline

◆ IsActive()

G4bool G4ITNavigator1::IsActive ( ) const
inline

◆ IsCheckModeActive()

G4bool G4ITNavigator1::IsCheckModeActive ( ) const
inline

◆ LocateGlobalPointAndSetup()

G4VPhysicalVolume * G4ITNavigator1::LocateGlobalPointAndSetup ( const G4ThreeVector point,
const G4ThreeVector direction = 0,
const G4bool  pRelativeSearch = true,
const G4bool  ignoreDirection = true 
)
virtual

Definition at line 159 of file G4ITNavigator1.cc.

163{
164 G4bool notKnownContained=true, noResult;
165 G4VPhysicalVolume *targetPhysical;
166 G4LogicalVolume *targetLogical;
167 G4VSolid *targetSolid=0;
168 G4ThreeVector localPoint, globalDirection;
169 EInside insideCode;
170
171 G4bool considerDirection = (!ignoreDirection) || fLocatedOnEdge;
172
174 fChangedGrandMotherRefFrame= false; // For local exit normal
175
176 if( considerDirection && pGlobalDirection != 0 )
177 {
178 globalDirection=*pGlobalDirection;
179 }
180
181
182#ifdef G4VERBOSE
183 if( fVerbose > 2 )
184 {
185 G4int oldcoutPrec = G4cout.precision(8);
186 G4cout << "*** G4ITNavigator1::LocateGlobalPointAndSetup: ***" << G4endl;
187 G4cout << " Called with arguments: " << G4endl
188 << " Globalpoint = " << globalPoint << G4endl
189 << " RelativeSearch = " << relativeSearch << G4endl;
190 if( fVerbose == 4 )
191 {
192 G4cout << " ----- Upon entering:" << G4endl;
193 PrintState();
194 }
195 G4cout.precision(oldcoutPrec);
196 }
197#endif
198
199 if ( !relativeSearch )
200 {
202 }
203 else
204 {
206 {
207 fWasLimitedByGeometry = false;
208 fEnteredDaughter = fEntering; // Remember
209 fExitedMother = fExiting; // Remember
210 if ( fExiting )
211 {
212 if ( fHistory.GetDepth() )
213 {
217 }
218 else
219 {
220 fLastLocatedPointLocal = localPoint;
222 return 0; // Have exited world volume
223 }
224 // A fix for the case where a volume is "entered" at an edge
225 // and a coincident surface exists outside it.
226 // - This stops it from exiting further volumes and cycling
227 // - However ReplicaNavigator treats this case itself
228 //
230 {
231 fExiting= false;
232 }
233 }
234 else
235 if ( fEntering )
236 {
238 {
239 case kNormal:
242 break;
243 case kReplica:
249 break;
250 case kParameterised:
252 {
253 G4VSolid *pSolid;
254 G4VPVParameterisation *pParam;
255 G4TouchableHistory parentTouchable( fHistory );
257 pSolid = pParam->ComputeSolid(fBlockedReplicaNo,
259 pSolid->ComputeDimensions(pParam, fBlockedReplicaNo,
266 //
267 // Set the correct solid and material in Logical Volume
268 //
269 G4LogicalVolume *pLogical;
271 pLogical->SetSolid( pSolid );
272 pLogical->UpdateMaterial(pParam ->
273 ComputeMaterial(fBlockedReplicaNo,
275 &parentTouchable));
276 }
277 break;
278 case kExternal:
279 G4Exception("G4ITNavigator1::LocateGlobalPointAndSetup()",
280 "GeomNav0001", FatalException,
281 "Not applicable for external volumes.");
282 break;
283 }
284 fEntering = false;
286 localPoint = fHistory.GetTopTransform().TransformPoint(globalPoint);
287 notKnownContained = false;
288 }
289 }
290 else
291 {
293 fEntering = false;
294 fEnteredDaughter = false; // Full Step was not taken, did not enter
295 fExiting = false;
296 fExitedMother = false; // Full Step was not taken, did not exit
297 }
298 }
299 //
300 // Search from top of history up through geometry until
301 // containing volume found:
302 // If on
303 // o OUTSIDE - Back up level, not/no longer exiting volumes
304 // o SURFACE and EXITING - Back up level, setting new blocking no.s
305 // else
306 // o containing volume found
307 //
308 G4int noLevelsExited=0 ;
309
310 while (notKnownContained)
311 {
313 {
314 targetSolid = fHistory.GetTopVolume()->GetLogicalVolume()->GetSolid();
315 localPoint = fHistory.GetTopTransform().TransformPoint(globalPoint);
316 insideCode = targetSolid->Inside(localPoint);
317#ifdef G4VERBOSE
318 if(( fVerbose == 1 ) && ( fCheck ))
319 {
320 G4String solidResponse = "-kInside-";
321 if (insideCode == kOutside)
322 solidResponse = "-kOutside-";
323 else if (insideCode == kSurface)
324 solidResponse = "-kSurface-";
325 G4cout << "*** G4ITNavigator1::LocateGlobalPointAndSetup(): ***" << G4endl
326 << " Invoked Inside() for solid: " << targetSolid->GetName()
327 << ". Solid replied: " << solidResponse << G4endl
328 << " For local point p: " << localPoint << G4endl;
329 }
330#endif
331 }
332 else
333 {
334 insideCode = freplicaNav.BackLocate(fHistory, globalPoint, localPoint,
335 fExiting, notKnownContained);
336 // !CARE! if notKnownContained returns false then the point is within
337 // the containing placement volume of the replica(s). If insidecode
338 // will result in the history being backed up one level, then the
339 // local point returned is the point in the system of this new level
340 }
341
342
343 if ( insideCode==kOutside )
344 {
345 noLevelsExited++;
346 if ( fHistory.GetDepth() )
347 {
351 fExiting = false;
352
353 if( noLevelsExited > 1 )
354 {
355 // The first transformation was done by the sub-navigator
356 //
358 if( mRot )
359 {
360 fGrandMotherExitNormal *= (*mRot).inverse();
362 }
363 }
364 }
365 else
366 {
367 fLastLocatedPointLocal = localPoint;
369 // No extra transformation for ExitNormal - is in frame of Top Volume
370 return 0; // Have exited world volume
371 }
372 }
373 else
374 if ( insideCode==kSurface )
375 {
376 G4bool isExiting = fExiting;
377 if( (!fExiting)&&considerDirection )
378 {
379 // Figure out whether we are exiting this level's volume
380 // by using the direction
381 //
382 G4bool directionExiting = false;
383 G4ThreeVector localDirection =
384 fHistory.GetTopTransform().TransformAxis(globalDirection);
385
386 // Make sure localPoint in correct reference frame
387 // ( Was it already correct ? How ? )
388 //
389 localPoint= fHistory.GetTopTransform().TransformPoint(globalPoint);
391 {
392 G4ThreeVector normal = targetSolid->SurfaceNormal(localPoint);
393 directionExiting = normal.dot(localDirection) > 0.0;
394 isExiting = isExiting || directionExiting;
395 }
396 }
397 if( isExiting )
398 {
399 noLevelsExited++;
400 if ( fHistory.GetDepth() )
401 {
405 //
406 // Still on surface but exited volume not necessarily convex
407 //
408 fValidExitNormal = false;
409
410 if( noLevelsExited > 1 )
411 {
412 // The first transformation was done by the sub-navigator
413 //
415 if( mRot )
416 {
417 fGrandMotherExitNormal *= (*mRot).inverse();
419 }
420 }
421 }
422 else
423 {
424 fLastLocatedPointLocal = localPoint;
426 // No extra transformation for ExitNormal, is in frame of Top Vol
427 return 0; // Have exited world volume
428 }
429 }
430 else
431 {
432 notKnownContained=false;
433 }
434 }
435 else
436 {
437 notKnownContained=false;
438 }
439 } // END while (notKnownContained)
440 //
441 // Search downwards until deepest containing volume found,
442 // blocking fBlockedPhysicalVolume/BlockedReplicaNum
443 //
444 // 3 Cases:
445 //
446 // o Parameterised daughters
447 // =>Must be one G4PVParameterised daughter & voxels
448 // o Positioned daughters & voxels
449 // o Positioned daughters & no voxels
450
451 noResult = true; // noResult should be renamed to
452 // something like enteredLevel, as that is its meaning.
453 do
454 {
455 // Determine `type' of current mother volume
456 //
457 targetPhysical = fHistory.GetTopVolume();
458 if (!targetPhysical) { break; }
459 targetLogical = targetPhysical->GetLogicalVolume();
460 switch( CharacteriseDaughters(targetLogical) )
461 {
462 case kNormal:
463 if ( targetLogical->GetVoxelHeader() ) // use optimised navigation
464 {
465 noResult = fvoxelNav.LevelLocate(fHistory,
468 globalPoint,
469 pGlobalDirection,
470 considerDirection,
471 localPoint);
472 }
473 else // do not use optimised navigation
474 {
478 globalPoint,
479 pGlobalDirection,
480 considerDirection,
481 localPoint);
482 }
483 break;
484 case kReplica:
488 globalPoint,
489 pGlobalDirection,
490 considerDirection,
491 localPoint);
492 break;
493 case kParameterised:
494 if( GetDaughtersRegularStructureId(targetLogical) != 1 )
495 {
496 noResult = fparamNav.LevelLocate(fHistory,
499 globalPoint,
500 pGlobalDirection,
501 considerDirection,
502 localPoint);
503 }
504 else // Regular structure
505 {
509 globalPoint,
510 pGlobalDirection,
511 considerDirection,
512 localPoint);
513 }
514 break;
515 case kExternal:
516 G4Exception("G4ITNavigator1::LocateGlobalPointAndSetup()",
517 "GeomNav0001", FatalException,
518 "Not applicable for external volumes.");
519 break;
520 }
521
522 // LevelLocate returns true if it finds a daughter volume
523 // in which globalPoint is inside (or on the surface).
524
525 if ( noResult )
526 {
527 // Entering a daughter after ascending
528 //
529 // The blocked volume is no longer valid - it was for another level
530 //
533
534 // fEntering should be false -- else blockedVolume is assumed good.
535 // fEnteredDaughter is used for ExitNormal
536 //
537 fEntering = false;
538 fEnteredDaughter = true;
539
540 if( fExitedMother )
541 {
542 G4VPhysicalVolume* enteredPhysical = fHistory.GetTopVolume();
543 const G4RotationMatrix* mRot = enteredPhysical->GetRotation();
544 if( mRot )
545 {
546 fGrandMotherExitNormal *= (*mRot).inverse();
547 }
548 }
549
550#ifdef G4DEBUG_NAVIGATION
551 if( fVerbose > 2 )
552 {
553 G4VPhysicalVolume* enteredPhysical = fHistory.GetTopVolume();
554 G4cout << "*** G4ITNavigator1::LocateGlobalPointAndSetup() ***" << G4endl;
555 G4cout << " Entering volume: " << enteredPhysical->GetName()
556 << G4endl;
557 }
558#endif
559 }
560 } while (noResult);
561
562 fLastLocatedPointLocal = localPoint;
563
564#ifdef G4VERBOSE
565 if( fVerbose >= 4 )
566 {
567 G4int oldcoutPrec = G4cout.precision(8);
568 G4String curPhysVol_Name("None");
569 if (targetPhysical) { curPhysVol_Name = targetPhysical->GetName(); }
570 G4cout << " Return value = new volume = " << curPhysVol_Name << G4endl;
571 G4cout << " ----- Upon exiting:" << G4endl;
572 PrintState();
573 if( fVerbose == 5 )
574 {
575 G4cout << "Upon exiting LocateGlobalPointAndSetup():" << G4endl;
576 G4cout << " History = " << G4endl << fHistory << G4endl << G4endl;
577 }
578 G4cout.precision(oldcoutPrec);
579 }
580#endif
581
583
584 return targetPhysical;
585}
G4bool fLocatedOutsideWorld
void UpdateMaterial(G4Material *pMaterial)
void NewLevel(G4VPhysicalVolume *pNewMother, EVolume vType=kNormal, G4int nReplica=-1)
G4int GetTopReplicaNo() const
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
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
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 &notKnownInside) const
virtual void SetCopyNo(G4int CopyNo)=0
virtual G4VPVParameterisation * GetParameterisation() const =0
virtual G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:79

References G4NavigationHistory::BackLevel(), G4ReplicaNavigation::BackLocate(), CharacteriseDaughters(), G4VSolid::ComputeDimensions(), G4VPVParameterisation::ComputeSolid(), G4ReplicaNavigation::ComputeTransformation(), G4VPVParameterisation::ComputeTransformation(), FatalException, fBlockedPhysicalVolume, fBlockedReplicaNo, fChangedGrandMotherRefFrame, fCheck, fEnteredDaughter, fEntering, fExitedMother, fExiting, fGrandMotherExitNormal, fHistory, fLastLocatedPointLocal, fLastTriedStepComputation, fLocatedOnEdge, fLocatedOutsideWorld, fnormalNav, fparamNav, fregularNav, freplicaNav, fValidExitNormal, fVerbose, fvoxelNav, fWasLimitedByGeometry, G4cout, G4endl, G4Exception(), G4VPhysicalVolume::GetCopyNo(), GetDaughtersRegularStructureId(), G4NavigationHistory::GetDepth(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4VSolid::GetName(), G4VPhysicalVolume::GetParameterisation(), G4VPhysicalVolume::GetRegularStructureId(), G4VPhysicalVolume::GetRotation(), G4LogicalVolume::GetSolid(), G4NavigationHistory::GetTopReplicaNo(), G4NavigationHistory::GetTopTransform(), G4NavigationHistory::GetTopVolume(), G4NavigationHistory::GetTopVolumeType(), G4LogicalVolume::GetVoxelHeader(), G4VSolid::Inside(), kExternal, kNormal, kOutside, kParameterised, kReplica, kSurface, G4NormalNavigation::LevelLocate(), G4ParameterisedNavigation::LevelLocate(), G4RegularNavigation::LevelLocate(), G4ReplicaNavigation::LevelLocate(), G4VoxelNavigation::LevelLocate(), G4NavigationHistory::NewLevel(), CLHEP::normal(), PrintState(), ResetStackAndState(), G4VPhysicalVolume::SetCopyNo(), G4LogicalVolume::SetSolid(), G4VSolid::SurfaceNormal(), G4AffineTransform::TransformAxis(), G4AffineTransform::TransformPoint(), G4LogicalVolume::UpdateMaterial(), and VolumeType().

Referenced by ComputeStep(), and ResetHierarchyAndLocate().

◆ LocateGlobalPointAndUpdateTouchable() [1/2]

void G4ITNavigator1::LocateGlobalPointAndUpdateTouchable ( const G4ThreeVector position,
const G4ThreeVector direction,
G4VTouchable touchableToUpdate,
const G4bool  RelativeSearch = true 
)
inline

◆ LocateGlobalPointAndUpdateTouchable() [2/2]

void G4ITNavigator1::LocateGlobalPointAndUpdateTouchable ( const G4ThreeVector position,
G4VTouchable touchableToUpdate,
const G4bool  RelativeSearch = true 
)
inline

◆ LocateGlobalPointAndUpdateTouchableHandle()

void G4ITNavigator1::LocateGlobalPointAndUpdateTouchableHandle ( const G4ThreeVector position,
const G4ThreeVector direction,
G4TouchableHandle oldTouchableToUpdate,
const G4bool  RelativeSearch = true 
)
inline

◆ LocateGlobalPointWithinVolume()

void G4ITNavigator1::LocateGlobalPointWithinVolume ( const G4ThreeVector position)
virtual

Definition at line 601 of file G4ITNavigator1.cc.

602{
605 fChangedGrandMotherRefFrame= false; // Frame for Exit Normal
606
607#ifdef G4DEBUG_NAVIGATION
608 if( fVerbose > 2 )
609 {
610 G4cout << "Entering LocateGlobalWithinVolume(): History = " << G4endl;
611 G4cout << fHistory << G4endl;
612 }
613#endif
614
615 // For the case of Voxel (or Parameterised) volume the respective
616 // Navigator must be messaged to update its voxel information etc
617
618 // Update the state of the Sub Navigators
619 // - in particular any voxel information they store/cache
620 //
621 G4VPhysicalVolume* motherPhysical = fHistory.GetTopVolume();
622 G4LogicalVolume* motherLogical = motherPhysical->GetLogicalVolume();
623 G4SmartVoxelHeader* pVoxelHeader = motherLogical->GetVoxelHeader();
624
626 {
627 switch( CharacteriseDaughters(motherLogical) )
628 {
629 case kNormal:
630 if ( pVoxelHeader )
631 {
633 }
634 break;
635 case kParameterised:
636 if( GetDaughtersRegularStructureId(motherLogical) != 1 )
637 {
638 // Resets state & returns voxel node
639 //
641 }
642 break;
643 case kReplica:
644 G4Exception("G4ITNavigator1::LocateGlobalPointWithinVolume()",
645 "GeomNav0001", FatalException,
646 "Not applicable for replicated volumes.");
647 break;
648 case kExternal:
649 G4Exception("G4ITNavigator1::LocateGlobalPointWithinVolume()",
650 "GeomNav0001", FatalException,
651 "Not applicable for external volumes.");
652 break;
653 }
654 }
655
656 // Reset the state variables
657 // - which would have been affected
658 // by the 'equivalent' call to LocateGlobalPointAndSetup
659 // - who's values have been invalidated by the 'move'.
660 //
663 fEntering = false;
664 fEnteredDaughter = false; // Boundary not encountered, did not enter
665 fExiting = false;
666 fExitedMother = false; // Boundary not encountered, did not exit
667}
G4SmartVoxelNode * ParamVoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)
G4SmartVoxelNode * VoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)

References CharacteriseDaughters(), ComputeLocalPoint(), FatalException, fBlockedPhysicalVolume, fBlockedReplicaNo, fChangedGrandMotherRefFrame, fEnteredDaughter, fEntering, fExitedMother, fExiting, fHistory, fLastLocatedPointLocal, fLastTriedStepComputation, fparamNav, fVerbose, fvoxelNav, G4cout, G4endl, G4Exception(), GetDaughtersRegularStructureId(), G4VPhysicalVolume::GetLogicalVolume(), G4NavigationHistory::GetTopVolume(), G4NavigationHistory::GetTopVolumeType(), G4LogicalVolume::GetVoxelHeader(), kExternal, kNormal, kParameterised, kReplica, G4ParameterisedNavigation::ParamVoxelLocate(), and G4VoxelNavigation::VoxelLocate().

Referenced by ComputeSafety(), and ComputeStep().

◆ NetRotation()

G4RotationMatrix G4ITNavigator1::NetRotation ( ) const
inline

◆ NetTranslation()

G4ThreeVector G4ITNavigator1::NetTranslation ( ) const
inline

◆ NewNavigatorState()

void G4ITNavigator1::NewNavigatorState ( )

Definition at line 682 of file G4ITNavigator1.cc.

683{
684 fpSaveState = new G4SaveNavigatorState();
685 ResetState();
686}
virtual void ResetState()

References fpSaveState, and ResetState().

◆ operator=()

G4ITNavigator1 & G4ITNavigator1::operator= ( const G4ITNavigator1 )
private

◆ PrintState()

void G4ITNavigator1::PrintState ( ) const

Definition at line 1875 of file G4ITNavigator1.cc.

1876{
1877 G4int oldcoutPrec = G4cout.precision(4);
1878 if( fVerbose == 4 )
1879 {
1880 G4cout << "The current state of G4ITNavigator1 is: " << G4endl;
1881 G4cout << " ValidExitNormal= " << fValidExitNormal << G4endl
1882 << " ExitNormal = " << fExitNormal << G4endl
1883 << " Exiting = " << fExiting << G4endl
1884 << " Entering = " << fEntering << G4endl
1885 << " BlockedPhysicalVolume= " ;
1887 G4cout << "None";
1888 else
1890 G4cout << G4endl
1891 << " BlockedReplicaNo = " << fBlockedReplicaNo << G4endl
1892 << " LastStepWasZero = " << fLastStepWasZero << G4endl
1893 << G4endl;
1894 }
1895 if( ( 1 < fVerbose) && (fVerbose < 4) )
1896 {
1897 G4cout << G4endl; // Make sure to line up
1898 G4cout << std::setw(30) << " ExitNormal " << " "
1899 << std::setw( 5) << " Valid " << " "
1900 << std::setw( 9) << " Exiting " << " "
1901 << std::setw( 9) << " Entering" << " "
1902 << std::setw(15) << " Blocked:Volume " << " "
1903 << std::setw( 9) << " ReplicaNo" << " "
1904 << std::setw( 8) << " LastStepZero " << " "
1905 << G4endl;
1906 G4cout << "( " << std::setw(7) << fExitNormal.x()
1907 << ", " << std::setw(7) << fExitNormal.y()
1908 << ", " << std::setw(7) << fExitNormal.z() << " ) "
1909 << std::setw( 5) << fValidExitNormal << " "
1910 << std::setw( 9) << fExiting << " "
1911 << std::setw( 9) << fEntering << " ";
1912 if ( fBlockedPhysicalVolume==0 )
1913 {
1914 G4cout << std::setw(15) << "None";
1915 }
1916 else
1917 {
1918 G4cout << std::setw(15)<< fBlockedPhysicalVolume->GetName();
1919 }
1920 G4cout << std::setw( 9) << fBlockedReplicaNo << " "
1921 << std::setw( 8) << fLastStepWasZero << " "
1922 << G4endl;
1923 }
1924 if( fVerbose > 2 )
1925 {
1926 G4cout.precision(8);
1927 G4cout << " Current Localpoint = " << fLastLocatedPointLocal << G4endl;
1928 G4cout << " PreviousSftOrigin = " << fPreviousSftOrigin << G4endl;
1929 G4cout << " PreviousSafety = " << fPreviousSafety << G4endl;
1930 }
1931 G4cout.precision(oldcoutPrec);
1932}
double z() const
double x() const
double y() const

References fBlockedPhysicalVolume, fBlockedReplicaNo, fEntering, fExiting, fExitNormal, fLastLocatedPointLocal, fLastStepWasZero, fPreviousSafety, fPreviousSftOrigin, fValidExitNormal, fVerbose, G4cout, G4endl, G4VPhysicalVolume::GetName(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by ComputeSafety(), ComputeStep(), and LocateGlobalPointAndSetup().

◆ ResetHierarchyAndLocate()

G4VPhysicalVolume * G4ITNavigator1::ResetHierarchyAndLocate ( const G4ThreeVector point,
const G4ThreeVector direction,
const G4TouchableHistory h 
)
virtual

Definition at line 131 of file G4ITNavigator1.cc.

134{
135 ResetState();
136 fHistory = *h.GetHistory();
138 fLastTriedStepComputation= false; // Redundant, but best
139 return LocateGlobalPointAndSetup(p, &direction, true, false);
140}
virtual void SetupHierarchy()
const G4NavigationHistory * GetHistory() const

References fHistory, fLastTriedStepComputation, G4TouchableHistory::GetHistory(), LocateGlobalPointAndSetup(), ResetState(), and SetupHierarchy().

◆ ResetStackAndState()

void G4ITNavigator1::ResetStackAndState ( )
inline

◆ ResetState()

void G4ITNavigator1::ResetState ( )
virtual

◆ RestoreSavedState()

void G4ITNavigator1::RestoreSavedState ( )

Definition at line 741 of file G4ITNavigator1.cc.

742{
747
750
752
753 // !>
763
766 // <!
767}
G4VPhysicalVolume * spBlockedPhysicalVolume

References fBlockedPhysicalVolume, fBlockedReplicaNo, fEnteredDaughter, fEntering, fExitedMother, fExiting, fExitNormal, fLastLocatedPointLocal, fLastStepWasZero, fLocatedOnEdge, fLocatedOutsideWorld, fNumberZeroSteps, fPreviousSafety, fPreviousSftOrigin, fpSaveState, fPushed, fValidExitNormal, fWasLimitedByGeometry, G4ITNavigator1::G4SaveNavigatorState::sBlockedReplicaNo, G4ITNavigator1::G4SaveNavigatorState::sEnteredDaughter, G4ITNavigator1::G4SaveNavigatorState::sEntering, G4ITNavigator1::G4SaveNavigatorState::sExitedMother, G4ITNavigator1::G4SaveNavigatorState::sExiting, G4ITNavigator1::G4SaveNavigatorState::sExitNormal, G4ITNavigator1::G4SaveNavigatorState::sLastLocatedPointLocal, G4ITNavigator1::G4SaveNavigatorState::sLastStepWasZero, G4ITNavigator1::G4SaveNavigatorState::sLocatedOnEdge, G4ITNavigator1::G4SaveNavigatorState::sLocatedOutsideWorld, G4ITNavigator1::G4SaveNavigatorState::sNumberZeroSteps, G4ITNavigator1::G4SaveNavigatorState::spBlockedPhysicalVolume, G4ITNavigator1::G4SaveNavigatorState::sPreviousSafety, G4ITNavigator1::G4SaveNavigatorState::sPreviousSftOrigin, G4ITNavigator1::G4SaveNavigatorState::sPushed, G4ITNavigator1::G4SaveNavigatorState::sValidExitNormal, and G4ITNavigator1::G4SaveNavigatorState::sWasLimitedByGeometry.

Referenced by CheckNextStep(), ComputeSafety(), and SetNavigatorState().

◆ SetGeometricallyLimitedStep()

void G4ITNavigator1::SetGeometricallyLimitedStep ( )
inline

◆ SetNavigatorState()

void G4ITNavigator1::SetNavigatorState ( G4ITNavigatorState_Lock1 navState)

Definition at line 676 of file G4ITNavigator1.cc.

677{
678 fpSaveState = (G4SaveNavigatorState*) navState;
679 if(navState) RestoreSavedState();
680}

References fpSaveState, and RestoreSavedState().

◆ SetPushVerbosity()

void G4ITNavigator1::SetPushVerbosity ( G4bool  mode)
inline

◆ SetSavedState()

void G4ITNavigator1::SetSavedState ( )

Definition at line 697 of file G4ITNavigator1.cc.

698{
699 // !>
700 // This check can be avoid if instead, at every first step of a track,
701 // the IT tracking uses NewNavigatorSate
702 // The normal tracking would just call once NewNavigatorState() before tracking
703
704// if(fpSaveState == 0)
705// fpSaveState = new G4SaveNavigatorState;
706 // <!
707
708 // fSaveExitNormal = fExitNormal;
713
716
718
719 // !>
729
732 // <!
733}

References fBlockedPhysicalVolume, fBlockedReplicaNo, fEnteredDaughter, fEntering, fExitedMother, fExiting, fExitNormal, fLastLocatedPointLocal, fLastStepWasZero, fLocatedOnEdge, fLocatedOutsideWorld, fNumberZeroSteps, fPreviousSafety, fPreviousSftOrigin, fpSaveState, fPushed, fValidExitNormal, fWasLimitedByGeometry, G4ITNavigator1::G4SaveNavigatorState::sBlockedReplicaNo, G4ITNavigator1::G4SaveNavigatorState::sEnteredDaughter, G4ITNavigator1::G4SaveNavigatorState::sEntering, G4ITNavigator1::G4SaveNavigatorState::sExitedMother, G4ITNavigator1::G4SaveNavigatorState::sExiting, G4ITNavigator1::G4SaveNavigatorState::sExitNormal, G4ITNavigator1::G4SaveNavigatorState::sLastLocatedPointLocal, G4ITNavigator1::G4SaveNavigatorState::sLastStepWasZero, G4ITNavigator1::G4SaveNavigatorState::sLocatedOnEdge, G4ITNavigator1::G4SaveNavigatorState::sLocatedOutsideWorld, G4ITNavigator1::G4SaveNavigatorState::sNumberZeroSteps, G4ITNavigator1::G4SaveNavigatorState::spBlockedPhysicalVolume, G4ITNavigator1::G4SaveNavigatorState::sPreviousSafety, G4ITNavigator1::G4SaveNavigatorState::sPreviousSftOrigin, G4ITNavigator1::G4SaveNavigatorState::sPushed, G4ITNavigator1::G4SaveNavigatorState::sValidExitNormal, and G4ITNavigator1::G4SaveNavigatorState::sWasLimitedByGeometry.

Referenced by CheckNextStep(), ComputeSafety(), and GetNavigatorState().

◆ SetupHierarchy()

void G4ITNavigator1::SetupHierarchy ( )
protectedvirtual

Definition at line 1316 of file G4ITNavigator1.cc.

1317{
1318 G4int i;
1319 const G4int cdepth = fHistory.GetDepth();
1320 G4VPhysicalVolume *current;
1321 G4VSolid *pSolid;
1322 G4VPVParameterisation *pParam;
1323
1324 for ( i=1; i<=cdepth; i++ )
1325 {
1326 current = fHistory.GetVolume(i);
1327 switch ( fHistory.GetVolumeType(i) )
1328 {
1329 case kNormal:
1330 break;
1331 case kReplica:
1333 break;
1334 case kParameterised: {
1335 G4int replicaNo;
1336 pParam = current->GetParameterisation();
1337 replicaNo = fHistory.GetReplicaNo(i);
1338 pSolid = pParam->ComputeSolid(replicaNo, current);
1339
1340 // Set up dimensions & transform in solid/physical volume
1341 //
1342 pSolid->ComputeDimensions(pParam, replicaNo, current);
1343 pParam->ComputeTransformation(replicaNo, current);
1344
1345 G4TouchableHistory touchable( fHistory );
1346 touchable.MoveUpHistory(); // move up to the parent level
1347
1348 // Set up the correct solid and material in Logical Volume
1349 //
1350 G4LogicalVolume *pLogical = current->GetLogicalVolume();
1351 pLogical->SetSolid( pSolid );
1352 pLogical->UpdateMaterial( pParam ->
1353 ComputeMaterial(replicaNo, current, &touchable) );
1354 break;
1355 }
1356 case kExternal:
1357 G4Exception("G4ITNavigator1::SetupHierarchy()",
1358 "GeomNav0001", FatalException,
1359 "Not applicable for external volumes.");
1360 break;
1361 }
1362 }
1363}
G4int GetReplicaNo(G4int n) const
G4VPhysicalVolume * GetVolume(G4int n) const
EVolume GetVolumeType(G4int n) const

References G4VSolid::ComputeDimensions(), G4VPVParameterisation::ComputeSolid(), G4ReplicaNavigation::ComputeTransformation(), G4VPVParameterisation::ComputeTransformation(), FatalException, fHistory, freplicaNav, G4Exception(), G4NavigationHistory::GetDepth(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetParameterisation(), G4NavigationHistory::GetReplicaNo(), G4NavigationHistory::GetVolume(), G4NavigationHistory::GetVolumeType(), kExternal, kNormal, kParameterised, kReplica, G4TouchableHistory::MoveUpHistory(), G4LogicalVolume::SetSolid(), and G4LogicalVolume::UpdateMaterial().

Referenced by ResetHierarchyAndLocate().

◆ SetVerboseLevel()

void G4ITNavigator1::SetVerboseLevel ( G4int  level)
inline

Referenced by GetGlobalExitNormal().

◆ SetWorldVolume()

void G4ITNavigator1::SetWorldVolume ( G4VPhysicalVolume pWorld)
inline

◆ SeverityOfZeroStepping()

G4int G4ITNavigator1::SeverityOfZeroStepping ( G4int noZeroSteps) const
inline

◆ VolumeType()

EVolume G4ITNavigator1::VolumeType ( const G4VPhysicalVolume pVol) const
inlineprotected

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const G4ITNavigator1 n 
)
friend

Definition at line 2041 of file G4ITNavigator1.cc.

2042{
2043 // Old version did only the following:
2044 // os << "Current History: " << G4endl << n.fHistory;
2045 // Old behaviour is recovered for fVerbose = 0
2046
2047 // Adapted from G4ITNavigator1::PrintState() const
2048
2049 G4int oldcoutPrec = os.precision(4);
2050 if( n.fVerbose >= 4 )
2051 {
2052 os << "The current state of G4ITNavigator1 is: " << G4endl;
2053 os << " ValidExitNormal= " << n.fValidExitNormal << G4endl
2054 << " ExitNormal = " << n.fExitNormal << G4endl
2055 << " Exiting = " << n.fExiting << G4endl
2056 << " Entering = " << n.fEntering << G4endl
2057 << " BlockedPhysicalVolume= " ;
2058 if (n.fBlockedPhysicalVolume==0)
2059 os << "None";
2060 else
2061 os << n.fBlockedPhysicalVolume->GetName();
2062 os << G4endl
2063 << " BlockedReplicaNo = " << n.fBlockedReplicaNo << G4endl
2064 << " LastStepWasZero = " << n.fLastStepWasZero << G4endl
2065 << G4endl;
2066 }
2067 if( ( 1 < n.fVerbose) && (n.fVerbose < 4) )
2068 {
2069 os << G4endl; // Make sure to line up
2070 os << std::setw(30) << " ExitNormal " << " "
2071 << std::setw( 5) << " Valid " << " "
2072 << std::setw( 9) << " Exiting " << " "
2073 << std::setw( 9) << " Entering" << " "
2074 << std::setw(15) << " Blocked:Volume " << " "
2075 << std::setw( 9) << " ReplicaNo" << " "
2076 << std::setw( 8) << " LastStepZero " << " "
2077 << G4endl;
2078 os << "( " << std::setw(7) << n.fExitNormal.x()
2079 << ", " << std::setw(7) << n.fExitNormal.y()
2080 << ", " << std::setw(7) << n.fExitNormal.z() << " ) "
2081 << std::setw( 5) << n.fValidExitNormal << " "
2082 << std::setw( 9) << n.fExiting << " "
2083 << std::setw( 9) << n.fEntering << " ";
2084 if ( n.fBlockedPhysicalVolume==0 )
2085 { os << std::setw(15) << "None"; }
2086 else
2087 { os << std::setw(15)<< n.fBlockedPhysicalVolume->GetName(); }
2088 os << std::setw( 9) << n.fBlockedReplicaNo << " "
2089 << std::setw( 8) << n.fLastStepWasZero << " "
2090 << G4endl;
2091 }
2092 if( n.fVerbose > 2 )
2093 {
2094 os.precision(8);
2095 os << " Current Localpoint = " << n.fLastLocatedPointLocal << G4endl;
2096 os << " PreviousSftOrigin = " << n.fPreviousSftOrigin << G4endl;
2097 os << " PreviousSafety = " << n.fPreviousSafety << G4endl;
2098 }
2099 if( n.fVerbose > 3 || n.fVerbose == 0 )
2100 {
2101 os << "Current History: " << G4endl << n.fHistory;
2102 }
2103
2104 os.precision(oldcoutPrec);
2105 return os;
2106}

Field Documentation

◆ fAbandonThreshold_NoZeroSteps

G4int G4ITNavigator1::fAbandonThreshold_NoZeroSteps
private

Definition at line 457 of file G4ITNavigator1.hh.

Referenced by ComputeStep(), and G4ITNavigator1().

◆ fActionThreshold_NoZeroSteps

G4int G4ITNavigator1::fActionThreshold_NoZeroSteps
private

Definition at line 455 of file G4ITNavigator1.hh.

Referenced by ComputeStep(), and G4ITNavigator1().

◆ fActive

G4bool G4ITNavigator1::fActive
private

Definition at line 403 of file G4ITNavigator1.hh.

Referenced by G4ITNavigator1().

◆ fBlockedPhysicalVolume

G4VPhysicalVolume* G4ITNavigator1::fBlockedPhysicalVolume
private

◆ fBlockedReplicaNo

G4int G4ITNavigator1::fBlockedReplicaNo
private

◆ fCalculatedExitNormal

G4bool G4ITNavigator1::fCalculatedExitNormal
private

◆ fChangedGrandMotherRefFrame

G4bool G4ITNavigator1::fChangedGrandMotherRefFrame
private

◆ fCheck

G4bool G4ITNavigator1::fCheck
private

Definition at line 510 of file G4ITNavigator1.hh.

Referenced by GetLocalExitNormal(), and LocateGlobalPointAndSetup().

◆ fEnteredDaughter

G4bool G4ITNavigator1::fEnteredDaughter
protected

◆ fEntering

G4bool G4ITNavigator1::fEntering
private

◆ fExitedMother

G4bool G4ITNavigator1::fExitedMother
protected

◆ fExiting

G4bool G4ITNavigator1::fExiting
private

◆ fExitNormal

G4ThreeVector G4ITNavigator1::fExitNormal
private

◆ fExitNormalGlobalFrame

G4ThreeVector G4ITNavigator1::fExitNormalGlobalFrame
private

Definition at line 437 of file G4ITNavigator1.hh.

Referenced by ComputeStep(), GetGlobalExitNormal(), and ResetState().

◆ fGrandMotherExitNormal

G4ThreeVector G4ITNavigator1::fGrandMotherExitNormal
private

◆ fHistory

G4NavigationHistory G4ITNavigator1::fHistory
protected

◆ fLastLocatedPointLocal

G4ThreeVector G4ITNavigator1::fLastLocatedPointLocal
private

◆ fLastStepEndPointLocal

G4ThreeVector G4ITNavigator1::fLastStepEndPointLocal
protected

Definition at line 394 of file G4ITNavigator1.hh.

Referenced by ComputeStep(), G4ITNavigator1(), and GetLocalExitNormal().

◆ fLastStepWasZero

G4bool G4ITNavigator1::fLastStepWasZero
private

◆ fLastTriedStepComputation

G4bool G4ITNavigator1::fLastTriedStepComputation
private

◆ fLocatedOnEdge

G4bool G4ITNavigator1::fLocatedOnEdge
private

◆ fLocatedOutsideWorld

G4bool G4ITNavigator1::fLocatedOutsideWorld
private

◆ fMaxNav

const G4int G4ITNavigator1::fMaxNav = 8
static

Definition at line 93 of file G4ITNavigator1.hh.

◆ fnormalNav

G4NormalNavigation G4ITNavigator1::fnormalNav
private

◆ fNumberZeroSteps

G4int G4ITNavigator1::fNumberZeroSteps
private

Definition at line 453 of file G4ITNavigator1.hh.

Referenced by ComputeStep(), ResetState(), RestoreSavedState(), and SetSavedState().

◆ fparamNav

G4ParameterisedNavigation G4ITNavigator1::fparamNav
private

◆ fPreviousSafety

G4double G4ITNavigator1::fPreviousSafety
private

◆ fPreviousSftOrigin

G4ThreeVector G4ITNavigator1::fPreviousSftOrigin
private

◆ fpSaveState

G4SaveNavigatorState* G4ITNavigator1::fpSaveState
private

◆ fPushed

G4bool G4ITNavigator1::fPushed
private

Definition at line 512 of file G4ITNavigator1.hh.

Referenced by ComputeStep(), ResetState(), RestoreSavedState(), and SetSavedState().

◆ fpVoxelSafety

G4VoxelSafety* G4ITNavigator1::fpVoxelSafety
private

Definition at line 522 of file G4ITNavigator1.hh.

Referenced by ComputeSafety(), G4ITNavigator1(), and ~G4ITNavigator1().

◆ fregularNav

G4RegularNavigation G4ITNavigator1::fregularNav
private

◆ freplicaNav

G4ReplicaNavigation G4ITNavigator1::freplicaNav
private

◆ fStepEndPoint

G4ThreeVector G4ITNavigator1::fStepEndPoint
protected

Definition at line 391 of file G4ITNavigator1.hh.

Referenced by ComputeSafety(), ComputeStep(), and G4ITNavigator1().

◆ fTopPhysical

G4VPhysicalVolume* G4ITNavigator1::fTopPhysical
private

Definition at line 504 of file G4ITNavigator1.hh.

◆ fValidExitNormal

G4bool G4ITNavigator1::fValidExitNormal
private

◆ fVerbose

G4int G4ITNavigator1::fVerbose
protected

◆ fvoxelNav

G4VoxelNavigation G4ITNavigator1::fvoxelNav
private

◆ fWarnPush

G4bool G4ITNavigator1::fWarnPush
private

Definition at line 512 of file G4ITNavigator1.hh.

Referenced by ComputeStep().

◆ fWasLimitedByGeometry

G4bool G4ITNavigator1::fWasLimitedByGeometry
protected

◆ kCarTolerance

G4double G4ITNavigator1::kCarTolerance
protected

The documentation for this class was generated from the following files: