58{
61
63
64 G4double distEndpointSq = (pGlobalpoint-stepEndPoint).mag2();
65 G4bool stayedOnEndpoint = distEndpointSq <
sqr(fkCarTolerance);
68
70 if( motherPhysical != physicalVolume )
71 {
72 std::ostringstream msg;
73 msg << " Current (navigation) phys-volume: " << motherPhysical
75 << " Request made for phys-volume: " << physicalVolume
77 G4Exception(
"G4SafetyCalculator::SafetyInCurrentVolume",
"GeomNav0001",
79 "This method must be called only in the Current volume.");
80 }
81
82 if( !(endpointOnSurface && stayedOnEndpoint) )
83 {
86
87
88
90
91
92
94 switch(dtype)
95 {
97 if ( pVoxelHeader )
98 {
99
101 *motherPhysical, pMaxLength);
102 }
103 else
104 {
105 safety=fnormalNav.
ComputeSafety(localPoint,fNavHistory,pMaxLength);
106 }
107 break;
110 {
111 safety=fparamNav.
ComputeSafety(localPoint,fNavHistory,pMaxLength);
112 }
113 else
114 {
115 safety=fregularNav.
ComputeSafety(localPoint,fNavHistory,pMaxLength);
116 }
117 break;
120 fNavHistory, pMaxLength);
121 break;
123 safety = fpExternalNav->
ComputeSafety(localPoint, fNavHistory,
124 pMaxLength);
125 break;
126 }
127
128
129
130 fPreviousSftOrigin = pGlobalpoint;
131 fPreviousSafety = safety;
132 }
133
134 return safety;
135}
G4VPhysicalVolume * GetTopVolume() const
G4bool EnteredDaughterVolume() const
G4bool ExitedMotherVolume() const
G4ThreeVector GetLastStepEndPoint() const
G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX) final
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX) override
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX) final
G4double ComputeSafety(const G4ThreeVector &globalPoint, const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX) const
void QuickLocateWithinVolume(const G4ThreeVector &pointLocal, G4VPhysicalVolume *motherPhysical)
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &rGlobPoint) const
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX)=0
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4VPhysicalVolume ¤tPhysical, G4double maxLength=DBL_MAX)