553 std::vector<G4Navigator*>::iterator pNavIter=
556 #ifdef G4DEBUG_PATHFINDER 581 G4double distCheckEnd_sq= ( moveLenEndPosSq - endPointSafety_Est1
582 *endPointSafety_Est1 );
586 G4bool longMoveEnd = distCheckEnd_sq > 0.0;
587 G4bool longMoveSaf = distCheckSaf_sq > 0.0;
591 if( (!
fNewTrack) && ( longMoveEnd && longMoveSaf ) )
602 G4double distCheckRevisedEnd= moveLenEndPosSq-revisedSafety*revisedSafety;
604 G4bool longMoveRevisedEnd= ( distCheckRevisedEnd > 0. ) ;
607 G4double moveLenEndPosition= std::sqrt( moveLenEndPosSq );
608 moveMinusSafety = moveLenEndPosition - revisedSafety;
610 if ( longMoveRevisedEnd && (moveMinusSafety > 0.0 )
611 && ( revisedSafety > 0.0 ) )
618 G4cout <<
" G4PF:Relocate> Ratio to revised safety is " 619 << std::fabs(moveMinusSafety)/revisedSafety <<
G4endl;
622 G4double absMoveMinusSafety= std::fabs(moveMinusSafety);
623 G4bool smallRatio= absMoveMinusSafety < kRadTolerance * revisedSafety ;
626 std::fabs(position.
y())),
627 std::fabs(position.
z()) );
628 G4bool smallValue= absMoveMinusSafety < cErrorTolerance * maxCoordPos;
629 if( ! (smallRatio || smallValue) )
631 G4cout <<
" G4PF:Relocate> Ratio to revised safety is " 632 << std::fabs(moveMinusSafety)/revisedSafety <<
G4endl;
633 G4cout <<
" Difference of move and safety is not very small." 638 moveMinusSafety = 0.0;
639 longMoveRevisedEnd =
false;
641 G4cout <<
" Difference of move & safety is very small in magnitude, " 642 << absMoveMinusSafety <<
G4endl;
645 G4cout <<
" ratio to safety " << revisedSafety
646 <<
" is " << absMoveMinusSafety / revisedSafety
647 <<
"smaller than " << kRadTolerance <<
" of safety ";
651 G4cout <<
" as fraction " << absMoveMinusSafety / maxCoordPos
652 <<
" of position vector max-coord " << maxCoordPos
653 <<
" smaller than " << cErrorTolerance ;
655 G4cout <<
" -- reset moveMinusSafety to " 656 << moveMinusSafety <<
G4endl;
660 if ( longMoveEnd && longMoveSaf
661 && longMoveRevisedEnd && (moveMinusSafety>0.0) )
664 std::ostringstream message;
665 message <<
"ReLocation is further than end-safety value." <<
G4endl 666 <<
" Moved from last endpoint by " << moveLenEndPosition
667 <<
" compared to end safety (from preStep point) = " 668 << endPointSafety_Est1 <<
G4endl 675 <<
" --> last EndStep Location was " << lastEndPosition
677 <<
" safety value = " << endPointSafety_Est1
678 <<
" raw-value = " << endPointSafety_raw <<
G4endl 679 <<
" --> Calling again at this endpoint, we get " 680 << revisedSafety <<
" as safety value." <<
G4endl 681 <<
" --> last position for safety " << fSafetyLocation
685 <<
" move from safety location = " 686 << std::sqrt(moveLenSafSq) <<
G4endl 687 <<
" again= " << moveVecSafety.
mag() <<
G4endl 688 <<
" safety - Move-from-end= " 689 << revisedSafety - moveLenEndPosition
690 <<
" (negative is Bad.)" <<
G4endl 691 <<
" Debug: distCheckRevisedEnd = " 692 << distCheckRevisedEnd;
693 ReportMove( lastEndPosition, position,
"Position" );
694 G4Exception(
"G4PathFinder::ReLocate",
"GeomNav0003",
696 G4cout.precision(oldPrec);
703 G4cout <<
" G4PathFinder::ReLocate : entered " <<
G4endl;
705 G4cout <<
" *Re*Locating at position " << position <<
G4endl;
710 G4cout <<
" lastEndPosition = " << lastEndPosition
711 <<
" moveVec from step-end = " << moveVecEndPos
716 #endif // G4DEBUG_PATHFINDER 722 (*pNavIter)->LocateGlobalPointWithinVolume( position );
734 #ifdef G4DEBUG_PATHFINDER 737 G4cout <<
" G4PathFinder::ReLocate : exiting " G4bool fLimitTruth[fMaxNav]
ELimited fLimitedStep[fMaxNav]
G4TransportationManager * fpTransportManager
G4double fMinSafety_PreStepPt
G4ThreeVector fPreStepLocation
G4double fMinSafety_atSafLocation
G4int fNoActiveNavigators
G4GLOB_DLL std::ostream G4cout
G4double GetRadialTolerance() const
void ReportMove(const G4ThreeVector &OldV, const G4ThreeVector &NewV, const G4String &Quantity) const
G4double ComputeSafety(const G4ThreeVector &globalPoint)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double fCurrentStepSize[fMaxNav]
G4ThreeVector fLastLocatedPosition
std::vector< G4Navigator * >::iterator GetActiveNavigatorsIterator()
G4ThreeVector fPreSafetyLocation
G4ThreeVector GetPosition() const
G4ThreeVector fSafetyLocation
G4double fPreSafetyMinValue
static G4GeometryTolerance * GetInstance()