920{
926
927
928
930
932
935
936
938
939#ifdef G4VERBOSE
940 if( fVerbose > 0 )
941 {
942 G4cout <<
"*** G4ITNavigator2::ComputeStep: ***" <<
G4endl;
944 << " - Proposed step length = " << pCurrentProposedStepLength
946#ifdef G4DEBUG_NAVIGATION
947 if( fVerbose >= 2 )
948 {
950 <<
" Globalpoint = " << std::setw(25) << pGlobalpoint <<
G4endl
951 <<
" Direction = " << std::setw(25) << pDirection <<
G4endl;
952 if( fVerbose >= 4 )
953 {
956 }
957 }
958#endif
959 }
960#endif
961
964 {
965
966
968 G4double moveLenSq = (newLocalPoint-oldLocalPoint).mag2();
969
971 {
972#ifdef G4VERBOSE
973 ComputeStepLog(pGlobalpoint, moveLenSq);
974#endif
975
976
979 }
980 }
982 {
984 {
987 {
990 localDirection,
991 pCurrentProposedStepLength,
992 pNewSafety,
1000
1001 }
1002 else
1003 {
1005 {
1007 localDirection,
1008 pCurrentProposedStepLength,
1009 pNewSafety,
1017 }
1018 else
1019 {
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032 if(
fHistory.GetTopVolume()->GetRegularStructureId() == 0 )
1033 {
1036 "Point is relocated in voxels, while it should be outside!");
1038 localDirection,
1039 pCurrentProposedStepLength,
1040 pNewSafety,
1048 }
1049 else
1050 {
1053 localDirection,
1054 pCurrentProposedStepLength,
1055 pNewSafety,
1063 motherPhysical);
1064 }
1065 }
1066 }
1067 break;
1070 {
1072 localDirection,
1073 pCurrentProposedStepLength,
1074 pNewSafety,
1082 }
1083 else
1084 {
1086 localDirection,
1087 pCurrentProposedStepLength,
1088 pNewSafety,
1096 }
1097 break;
1099 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1101 break;
1103 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0001",
1105 break;
1106 }
1107 }
1108 else
1109 {
1110
1111
1112
1114 G4bool calculatedExitNormal;
1116 pDirection,
1118 localDirection,
1119 pCurrentProposedStepLength,
1120 pNewSafety,
1123 calculatedExitNormal,
1125 exitingReplica,
1131 }
1132
1133
1134
1135
1136
1137
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1154
1155
1156
1158 {
1160#ifdef G4DEBUG_NAVIGATION
1162 {
1163 G4cout <<
"G4ITNavigator2::ComputeStep(): another zero step, # "
1165 << " at " << pGlobalpoint
1166 <<
" in volume " << motherPhysical->
GetName()
1168 }
1169#endif
1171 {
1172
1173
1175#ifdef G4VERBOSE
1177 {
1178 std::ostringstream message;
1179 message <<
"Track stuck or not moving." <<
G4endl
1180 << " Track stuck, not moving for "
1182 <<
" in volume -" << motherPhysical->
GetName()
1183 <<
"- at point " << pGlobalpoint <<
G4endl
1184 <<
" direction: " << pDirection <<
"." <<
G4endl
1185 << " Potential geometry or navigation problem !"
1187 << " Trying pushing it of " << Step << " mm ...";
1188 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav1002",
1189 JustWarning, message,
"Potential overlap in geometry!");
1190 }
1191#endif
1193 }
1195 {
1196
1197
1198 std::ostringstream message;
1199 message << "Stuck Track: potential geometry or navigation problem."
1201 << " Track stuck, not moving for "
1203 <<
" in volume -" << motherPhysical->
GetName()
1204 <<
"- at point " << pGlobalpoint <<
G4endl
1205 << " direction: " << pDirection << ".";
1207 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1209 }
1210 }
1211 else
1212 {
1214 }
1215
1218
1220 + std::min(Step,pCurrentProposedStepLength) * pDirection;
1222
1224 {
1225#ifdef G4DEBUG_NAVIGATION
1226 if( fVerbose > 2 )
1227 {
1228 G4cout <<
" At G4Nav CompStep End - if(exiting) - fExiting= " <<
fExiting
1231 }
1232#endif
1233
1235 {
1237 {
1238
1239
1242 }
1243 else
1244 {
1246 }
1247 }
1248 else
1249 {
1250
1251
1254
1256 {
1257
1258
1261
1262
1263
1265 if( mRot )
1266 {
1269 }
1270 else
1271 {
1273 }
1274
1275
1276
1277
1279 }
1280 else
1281 {
1283
1284
1285
1286
1287
1288
1289#ifdef G4DEBUG_NAVIGATION
1291
1292 desc << "Problem in ComputeStep: Replica Navigation did not provide"
1293 <<
" valid exit Normal. " <<
G4endl;
1294 desc <<
" Do not know how calculate it in this case." <<
G4endl;
1295 desc <<
" Location = " << finalLocalPoint <<
G4endl;
1296 desc <<
" Volume name = " << motherPhysical->
GetName()
1298 G4Exception(
"G4ITNavigator2::ComputeStep()",
"GeomNav0003",
1299 JustWarning, desc,
"Normal not available for exiting.");
1300#endif
1301 }
1302 }
1303
1304
1305
1307 {
1309 if( depth > 0 )
1310 {
1312 fHistory.GetTransform(depth-1).Inverse();
1315 }
1316 else
1317 {
1319 }
1320 }
1321 else
1322 {
1324 }
1325 }
1326
1328 {
1329
1330
1331
1332 Step = kInfinity;
1333 }
1334
1335#ifdef G4VERBOSE
1336 if( fVerbose > 1 )
1337 {
1338 if( fVerbose >= 4 )
1339 {
1342 }
1343 G4cout <<
" Returned step= " << Step;
1345 if( Step == kInfinity )
1346 {
1347 G4cout <<
" Requested step= " << pCurrentProposedStepLength ;
1349 }
1351 }
1352#endif
1353
1354 return Step;
1355}
#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)