694{
697
698 G4int firstNavigatorId= -1;
699 G4bool oneObtained=
false;
700
702 {
703
704 normalGlobalCrd= fpNavigator[
fIdNavLimiting ]->GetGlobalExitNormal( argPoint, &isObtained);
705 *argpObtained= isObtained;
706 }
707 else
708 {
710 {
711 auto pNavIter=
713
714 for (
G4int num=0; num< fNoActiveNavigators ; ++pNavIter,++num )
715 {
718 {
720 if( oneObtained )
721 {
722
723 if( !isObtained && (newNormal.
mag2() != 0.0) )
724 {
725 normalGlobalCrd= newNormal;
726 isObtained = oneObtained;
727 firstNavigatorId= num;
728 }else{
729
730 G4double dotNewPrevious= newNormal.
dot( normalGlobalCrd );
731 G4double productMagSq= normalGlobalCrd.mag2() * newNormal.
mag2();
732 if( productMagSq > 0.0 )
733 {
734 G4double productMag= std::sqrt( productMagSq );
735 dotNewPrevious /= productMag;
736 if( dotNewPrevious < (1 - perThousand) )
737 {
738 *argpObtained= false;
739
740 if( fVerbose > 2 )
741 {
742 std::ostringstream message;
743 message <<
"Clash of Normal from different Navigators!" <<
G4endl
744 <<
" Previous Navigator Id = " << firstNavigatorId <<
G4endl
745 <<
" Current Navigator Id = " << num <<
G4endl;
746 message <<
" Dot product of 2 normals = " << dotNewPrevious <<
G4endl;
747 message <<
" Normal (previous) = " << normalGlobalCrd <<
G4endl;
748 message <<
" Normal (current) = " << newNormal <<
G4endl;
749 G4Exception(
"G4ITMultiNavigator::GetGlobalExitNormal()",
"GeomNav0002",
751 }
752 }
753 else
754 {
755
756 }
757 }
758 }
759 }
760 }
761 }
762
763
764 if( !oneObtained )
765 {
766 std::ostringstream message;
768 <<
" candidate Navigators limiting the step!" <<
G4endl;
769 G4Exception(
"G4ITMultiNavigator::GetGlobalExitNormal()",
"GeomNav0002",
771 }
772
773 }
774 }
775
776 *argpObtained= isObtained;
777 return normalGlobalCrd;
778}
double dot(const Hep3Vector &) const
G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &CurrentE_Point, G4bool *obtained) override
std::vector< G4ITNavigator * >::iterator GetActiveNavigatorsIterator()