928{
934
935
936
938
940
943
944
946 sNavCScalls++;
947
949
950#ifdef G4VERBOSE
951 if( fVerbose > 0 )
952 {
953 G4cout <<
"*** G4ITNavigator2::ComputeStep: ***" <<
G4endl;
955 << " - Proposed step length = " << pCurrentProposedStepLength
957#ifdef G4DEBUG_NAVIGATION
958 if( fVerbose >= 2 )
959 {
961 <<
" Globalpoint = " << std::setw(25) << pGlobalpoint <<
G4endl
962 <<
" Direction = " << std::setw(25) << pDirection <<
G4endl;
963 if( fVerbose >= 4 )
964 {
967 }
968 }
969#endif
970 }
971#endif
972
975 {
976
977
979 G4double moveLenSq = (newLocalPoint-oldLocalPoint).mag2();
980
982 {
983#ifdef G4VERBOSE
984 ComputeStepLog(pGlobalpoint, moveLenSq);
985#endif
986
987
990 }
991 }
993 {
995 {
998 {
1001 localDirection,
1002 pCurrentProposedStepLength,
1003 pNewSafety,
1011
1012 }
1013 else
1014 {
1016 {
1018 localDirection,
1019 pCurrentProposedStepLength,
1020 pNewSafety,
1028 }
1029 else
1030 {
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043 if(
fHistory.GetTopVolume()->GetRegularStructureId() == 0 )
1044 {
1047 "Point is relocated in voxels, while it should be outside!");
1049 localDirection,
1050 pCurrentProposedStepLength,
1051 pNewSafety,
1059 }
1060 else
1061 {
1064 localDirection,
1065 pCurrentProposedStepLength,
1066 pNewSafety,
1074 motherPhysical);
1075 }
1076 }
1077 }
1078 break;
1081 {
1083 localDirection,
1084 pCurrentProposedStepLength,
1085 pNewSafety,
1093 }
1094 else
1095 {
1097 localDirection,
1098 pCurrentProposedStepLength,
1099 pNewSafety,
1107 }
1108 break;
1110 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1112 break;
1114 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1116 break;
1117 }
1118 }
1119 else
1120 {
1121
1122
1123
1125 G4bool calculatedExitNormal;
1127 pDirection,
1129 localDirection,
1130 pCurrentProposedStepLength,
1131 pNewSafety,
1134 calculatedExitNormal,
1136 exitingReplica,
1142 }
1143
1144
1145
1146
1147
1148
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1165
1166
1167
1169 {
1171#ifdef G4DEBUG_NAVIGATION
1173 {
1174 G4cout <<
"G4ITNavigator2::ComputeStep(): another zero step, # "
1176 << " at " << pGlobalpoint
1177 <<
" in volume " << motherPhysical->
GetName()
1178 << " nav-comp-step calls # " << sNavCScalls
1180 }
1181#endif
1183 {
1184
1185
1187#ifdef G4VERBOSE
1189 {
1190 std::ostringstream message;
1191 message <<
"Track stuck or not moving." <<
G4endl
1192 << " Track stuck, not moving for "
1194 <<
" in volume -" << motherPhysical->
GetName()
1195 <<
"- at point " << pGlobalpoint <<
G4endl
1196 <<
" direction: " << pDirection <<
"." <<
G4endl
1197 << " Potential geometry or navigation problem !"
1199 << " Trying pushing it of " << Step << " mm ...";
1200 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
1201 JustWarning, message,
"Potential overlap in geometry!");
1202 }
1203#endif
1205 }
1207 {
1208
1209
1210 std::ostringstream message;
1211 message << "Stuck Track: potential geometry or navigation problem."
1213 << " Track stuck, not moving for "
1215 <<
" in volume -" << motherPhysical->
GetName()
1216 <<
"- at point " << pGlobalpoint <<
G4endl
1217 << " direction: " << pDirection << ".";
1219 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1221 }
1222 }
1223 else
1224 {
1226 }
1227
1230
1232 + std::min(Step,pCurrentProposedStepLength) * pDirection;
1234
1236 {
1237#ifdef G4DEBUG_NAVIGATION
1238 if( fVerbose > 2 )
1239 {
1240 G4cout <<
" At G4Nav CompStep End - if(exiting) - fExiting= " <<
fExiting
1243 }
1244#endif
1245
1247 {
1249 {
1250
1251
1254 }
1255 else
1256 {
1258 }
1259 }
1260 else
1261 {
1262
1263
1266
1268 {
1269
1270
1273
1274
1275
1277 if( mRot )
1278 {
1281 }
1282 else
1283 {
1285 }
1286
1287
1288
1289
1291 }
1292 else
1293 {
1295
1296
1297
1298
1299
1300
1301#ifdef G4DEBUG_NAVIGATION
1303
1304 desc << "Problem in ComputeStep: Replica Navigation did not provide"
1305 <<
" valid exit Normal. " <<
G4endl;
1306 desc <<
" Do not know how calculate it in this case." <<
G4endl;
1307 desc <<
" Location = " << finalLocalPoint <<
G4endl;
1308 desc <<
" Volume name = " << motherPhysical->
GetName()
1310 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1311 JustWarning, desc,
"Normal not available for exiting.");
1312#endif
1313 }
1314 }
1315
1316
1317
1319 {
1321 if( depth > 0 )
1322 {
1324 fHistory.GetTransform(depth-1).Inverse();
1327 }
1328 else
1329 {
1331 }
1332 }
1333 else
1334 {
1336 }
1337 }
1338
1340 {
1341
1342
1343
1344 Step = kInfinity;
1345 }
1346
1347#ifdef G4VERBOSE
1348 if( fVerbose > 1 )
1349 {
1350 if( fVerbose >= 4 )
1351 {
1354 }
1355 G4cout <<
" Returned step= " << Step;
1357 if( Step == kInfinity )
1358 {
1359 G4cout <<
" Requested step= " << pCurrentProposedStepLength ;
1361 }
1363 }
1364#endif
1365
1366 return Step;
1367}
#define fLastStepEndPointLocal
#define fExitNormalGlobalFrame
#define fBlockedReplicaNo
#define fGrandMotherExitNormal
#define fLastLocatedPointLocal
#define fChangedGrandMotherRefFrame
#define fBlockedPhysicalVolume
#define fCalculatedExitNormal
#define fLastTriedStepComputation
CLHEP::Hep3Vector G4ThreeVector
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
G4ThreeVector ComputeLocalAxis(const G4ThreeVector &pVec) const
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)
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)