701 G4int firstNavigatorId= -1;
702 G4bool oneObtained=
false;
704 if( fNoLimitingStep==1 )
707 normalGlobalCrd= fpNavigator[ fIdNavLimiting ]->
GetGlobalExitNormal( argPoint, &isObtained);
708 *argpObtained= isObtained;
712 if( fNoLimitingStep > 1 )
714 std::vector<G4Navigator*>::iterator pNavIter=
717 for (
G4int num=0; num< fNoActiveNavigators ; ++pNavIter,++num )
720 if( fLimitTruth[ num ] )
726 if( !isObtained && (newNormal.
mag2() != 0.0) )
728 normalGlobalCrd= newNormal;
729 isObtained = oneObtained;
730 firstNavigatorId= num;
733 G4double dotNewPrevious= newNormal.
dot( normalGlobalCrd );
734 G4double productMagSq= normalGlobalCrd.mag2() * newNormal.
mag2();
735 if( productMagSq > 0.0 )
737 G4double productMag= std::sqrt( productMagSq );
738 dotNewPrevious /= productMag;
741 *argpObtained=
false;
745 std::ostringstream message;
746 message <<
"Clash of Normal from different Navigators!" <<
G4endl
747 <<
" Previous Navigator Id = " << firstNavigatorId <<
G4endl
748 <<
" Current Navigator Id = " << num <<
G4endl;
749 message <<
" Dot product of 2 normals = " << dotNewPrevious <<
G4endl;
750 message <<
" Normal (previous) = " << normalGlobalCrd <<
G4endl;
751 message <<
" Normal (current) = " << newNormal <<
G4endl;
752 G4Exception(
"G4MultiNavigator::GetGlobalExitNormal()",
"GeomNav0002",
769 std::ostringstream message;
770 message <<
"No Normal obtained despite having " << fNoLimitingStep
771 <<
" candidate Navigators limiting the step!" <<
G4endl;
772 G4Exception(
"G4MultiNavigator::GetGlobalExitNormal()",
"GeomNav0002",
779 *argpObtained= isObtained;
780 return normalGlobalCrd;
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &CurrentE_Point, G4bool *obtained)
double dot(const Hep3Vector &) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid)
std::vector< G4Navigator * >::iterator GetActiveNavigatorsIterator()
static constexpr double perThousand