917{
923
924
925
927
929
932
933
935
936#ifdef G4VERBOSE
937 if( fVerbose > 0 )
938 {
939 G4cout <<
"*** G4ITNavigator2::ComputeStep: ***" <<
G4endl;
941 << " - Proposed step length = " << pCurrentProposedStepLength
943#ifdef G4DEBUG_NAVIGATION
944 if( fVerbose >= 2 )
945 {
947 <<
" Globalpoint = " << std::setw(25) << pGlobalpoint <<
G4endl
948 <<
" Direction = " << std::setw(25) << pDirection <<
G4endl;
949 if( fVerbose >= 4 )
950 {
953 }
954 }
955#endif
956 }
957#endif
958
961 {
962
963
965 G4double moveLenSq = (newLocalPoint-oldLocalPoint).mag2();
966
968 {
969#ifdef G4VERBOSE
970 ComputeStepLog(pGlobalpoint, moveLenSq);
971#endif
972
973
976 }
977 }
979 {
981 {
984 {
987 localDirection,
988 pCurrentProposedStepLength,
989 pNewSafety,
997
998 }
999 else
1000 {
1002 {
1004 localDirection,
1005 pCurrentProposedStepLength,
1006 pNewSafety,
1014 }
1015 else
1016 {
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029 if(
fHistory.GetTopVolume()->GetRegularStructureId() == 0 )
1030 {
1033 "Point is relocated in voxels, while it should be outside!");
1035 localDirection,
1036 pCurrentProposedStepLength,
1037 pNewSafety,
1045 }
1046 else
1047 {
1050 localDirection,
1051 pCurrentProposedStepLength,
1052 pNewSafety,
1060 motherPhysical);
1061 }
1062 }
1063 }
1064 break;
1067 {
1069 localDirection,
1070 pCurrentProposedStepLength,
1071 pNewSafety,
1079 }
1080 else
1081 {
1083 localDirection,
1084 pCurrentProposedStepLength,
1085 pNewSafety,
1093 }
1094 break;
1096 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1098 break;
1100 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1102 break;
1103 }
1104 }
1105 else
1106 {
1107
1108
1109
1111 G4bool calculatedExitNormal;
1113 pDirection,
1115 localDirection,
1116 pCurrentProposedStepLength,
1117 pNewSafety,
1120 calculatedExitNormal,
1122 exitingReplica,
1128 }
1129
1130
1131
1132
1133
1134
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1151
1152
1153
1155 {
1157#ifdef G4DEBUG_NAVIGATION
1159 {
1160 G4cout <<
"G4ITNavigator2::ComputeStep(): another zero step, # "
1162 << " at " << pGlobalpoint
1163 <<
" in volume " << motherPhysical->
GetName()
1165 }
1166#endif
1168 {
1169
1170
1172#ifdef G4VERBOSE
1173 if ((!
fPushed) && (fWarnPush))
1174 {
1175 std::ostringstream message;
1176 message <<
"Track stuck or not moving." <<
G4endl
1177 << " Track stuck, not moving for "
1179 <<
" in volume -" << motherPhysical->
GetName()
1180 <<
"- at point " << pGlobalpoint <<
G4endl
1181 <<
" direction: " << pDirection <<
"." <<
G4endl
1182 << " Potential geometry or navigation problem !"
1184 << " Trying pushing it of " << Step << " mm ...";
1185 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
1186 JustWarning, message,
"Potential overlap in geometry!");
1187 }
1188#endif
1190 }
1192 {
1193
1194
1195 std::ostringstream message;
1196 message << "Stuck Track: potential geometry or navigation problem."
1198 << " Track stuck, not moving for "
1200 <<
" in volume -" << motherPhysical->
GetName()
1201 <<
"- at point " << pGlobalpoint <<
G4endl
1202 << " direction: " << pDirection << ".";
1204 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1206 }
1207 }
1208 else
1209 {
1211 }
1212
1215
1217 + std::min(Step,pCurrentProposedStepLength) * pDirection;
1219
1221 {
1222#ifdef G4DEBUG_NAVIGATION
1223 if( fVerbose > 2 )
1224 {
1225 G4cout <<
" At G4Nav CompStep End - if(exiting) - fExiting= " <<
fExiting
1228 }
1229#endif
1230
1232 {
1234 {
1235
1236
1239 }
1240 else
1241 {
1243 }
1244 }
1245 else
1246 {
1247
1248
1251
1253 {
1254
1255
1258
1259
1260
1262 if( mRot != nullptr )
1263 {
1266 }
1267 else
1268 {
1270 }
1271
1272
1273
1274
1276 }
1277 else
1278 {
1280
1281
1282
1283
1284
1285
1286#ifdef G4DEBUG_NAVIGATION
1288
1289 desc << "Problem in ComputeStep: Replica Navigation did not provide"
1290 <<
" valid exit Normal. " <<
G4endl;
1291 desc <<
" Do not know how calculate it in this case." <<
G4endl;
1292 desc <<
" Location = " << finalLocalPoint <<
G4endl;
1293 desc <<
" Volume name = " << motherPhysical->
GetName()
1295 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1296 JustWarning, desc,
"Normal not available for exiting.");
1297#endif
1298 }
1299 }
1300
1301
1302
1304 {
1306 if( depth > 0 )
1307 {
1312 }
1313 else
1314 {
1316 }
1317 }
1318 else
1319 {
1321 }
1322 }
1323
1325 {
1326
1327
1328
1329 Step = kInfinity;
1330 }
1331
1332#ifdef G4VERBOSE
1333 if( fVerbose > 1 )
1334 {
1335 if( fVerbose >= 4 )
1336 {
1339 }
1340 G4cout <<
" Returned step= " << Step;
1342 if( Step == kInfinity )
1343 {
1344 G4cout <<
" Requested step= " << pCurrentProposedStepLength ;
1346 }
1348 }
1349#endif
1350
1351 return Step;
1352}
#define fLastStepEndPointLocal
#define fExitNormalGlobalFrame
#define fBlockedReplicaNo
#define fGrandMotherExitNormal
#define fLastLocatedPointLocal
#define fChangedGrandMotherRefFrame
#define fBlockedPhysicalVolume
#define fCalculatedExitNormal
#define fLastTriedStepComputation
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector ComputeLocalAxis(const G4ThreeVector &pVec) const
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=nullptr, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
G4VSolid * GetSolid() 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) final
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &globalDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo) override
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &globalDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo) final
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) override