697{
700
701 G4int firstNavigatorId= -1;
702 G4bool oneObtained=
false;
703
705 {
706
707 normalGlobalCrd= fpNavigator[
fIdNavLimiting ]->GetGlobalExitNormal( argPoint, &isObtained);
708 *argpObtained= isObtained;
709 }
710 else
711 {
713 {
714 std::vector<G4ITNavigator*>::iterator pNavIter=
716
717 for (
G4int num=0; num< fNoActiveNavigators ; ++pNavIter,++num )
718 {
721 {
723 if( oneObtained )
724 {
725
726 if( !isObtained && (newNormal.
mag2() != 0.0) )
727 {
728 normalGlobalCrd= newNormal;
729 isObtained = oneObtained;
730 firstNavigatorId= num;
731 }else{
732
733 G4double dotNewPrevious= newNormal.
dot( normalGlobalCrd );
734 G4double productMagSq= normalGlobalCrd.mag2() * newNormal.
mag2();
735 if( productMagSq > 0.0 )
736 {
737 G4double productMag= std::sqrt( productMagSq );
738 dotNewPrevious /= productMag;
739 if( dotNewPrevious < (1 - perThousand) )
740 {
741 *argpObtained= false;
742
743 if( fVerbose > 2 )
744 {
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(
"G4ITMultiNavigator::GetGlobalExitNormal()",
"GeomNav0002",
754 }
755 }
756 else
757 {
758
759 }
760 }
761 }
762 }
763 }
764 }
765
766
767 if( !oneObtained )
768 {
769 std::ostringstream message;
771 <<
" candidate Navigators limiting the step!" <<
G4endl;
772 G4Exception(
"G4ITMultiNavigator::GetGlobalExitNormal()",
"GeomNav0002",
774 }
775
776 }
777 }
778
779 *argpObtained= isObtained;
780 return normalGlobalCrd;
781}
double dot(const Hep3Vector &) const
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &CurrentE_Point, G4bool *obtained)
std::vector< G4ITNavigator * >::iterator GetActiveNavigatorsIterator()