Import Geant4 10.3.0.beta source tree
This commit is contained in:
@@ -67,6 +67,9 @@ G4Navigator::G4Navigator()
|
||||
fAbandonThreshold_NoZeroSteps = 25;
|
||||
|
||||
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
fMinStep = 0.05*kCarTolerance;
|
||||
fSqTol = kCarTolerance*kCarTolerance;
|
||||
|
||||
fregularNav.SetNormalNavigation( &fnormalNav );
|
||||
|
||||
fStepEndPoint = G4ThreeVector( kInfinity, kInfinity, kInfinity );
|
||||
@@ -727,7 +730,7 @@ void G4Navigator::RestoreSavedState()
|
||||
//
|
||||
// fBlockedPhysicalVolume - Ptr to exited volume (or 0)
|
||||
// fBlockedReplicaNo - Replication no of exited volume
|
||||
// fLastStepWasZero - True if last Step size was zero.
|
||||
// fLastStepWasZero - True if last Step size was almost zero.
|
||||
//
|
||||
// Flags on exit:
|
||||
// -------------
|
||||
@@ -738,7 +741,7 @@ void G4Navigator::RestoreSavedState()
|
||||
// fEntering - True if entering `daughter' volume (or replica)
|
||||
// fBlockedPhysicalVolume - Ptr to candidate (entered) volume
|
||||
// fBlockedReplicaNo - Replication no of candidate (entered) volume
|
||||
// fLastStepWasZero - True if this Step size was zero.
|
||||
// fLastStepWasZero - True if this Step size was almost zero.
|
||||
// ********************************************************************
|
||||
//
|
||||
G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
@@ -797,7 +800,7 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
G4ThreeVector oldLocalPoint = fLastLocatedPointLocal;
|
||||
G4double moveLenSq = (newLocalPoint-oldLocalPoint).mag2();
|
||||
|
||||
if ( moveLenSq >= kCarTolerance*kCarTolerance )
|
||||
if ( moveLenSq >= fSqTol )
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
ComputeStepLog(pGlobalpoint, moveLenSq);
|
||||
@@ -971,7 +974,7 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
// checked
|
||||
//
|
||||
fLocatedOnEdge = fLastStepWasZero && (Step==0.0);
|
||||
fLastStepWasZero = (Step==0.0);
|
||||
fLastStepWasZero = (Step<fMinStep);
|
||||
if (fPushed) { fPushed = fLastStepWasZero; }
|
||||
|
||||
// Handle large number of consecutive zero steps
|
||||
@@ -982,11 +985,12 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
#ifdef G4DEBUG_NAVIGATION
|
||||
if( fNumberZeroSteps > 1 )
|
||||
{
|
||||
G4cout << "G4Navigator::ComputeStep(): another zero step, # "
|
||||
G4cout << "G4Navigator::ComputeStep(): another 'zero' step, # "
|
||||
<< fNumberZeroSteps
|
||||
<< " at " << pGlobalpoint
|
||||
<< " in volume " << motherPhysical->GetName()
|
||||
<< " nav-comp-step calls # " << sNavCScalls
|
||||
<< ", at " << pGlobalpoint
|
||||
<< ", in volume " << motherPhysical->GetName()
|
||||
<< ", nav-comp-step calls # " << sNavCScalls
|
||||
<< ", Step= " << Step
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
@@ -1026,7 +1030,9 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
<< " in volume -" << motherPhysical->GetName()
|
||||
<< "- at point " << pGlobalpoint << G4endl
|
||||
<< " direction: " << pDirection << ".";
|
||||
#ifdef G4VERBOSE
|
||||
motherPhysical->CheckOverlaps(5000, false);
|
||||
#endif
|
||||
G4Exception("G4Navigator::ComputeStep()", "GeomNav0003",
|
||||
EventMustBeAborted, message);
|
||||
}
|
||||
@@ -1565,18 +1571,14 @@ G4Navigator::GetGlobalExitNormal(const G4ThreeVector& IntersectPointGlobal,
|
||||
{
|
||||
G4bool validNormal;
|
||||
G4ThreeVector localNormal, globalNormal;
|
||||
G4bool usingStored;
|
||||
|
||||
usingStored=
|
||||
fCalculatedExitNormal &&
|
||||
( ( fLastTriedStepComputation && fExiting) // Just calculated it
|
||||
|| // No locate in between
|
||||
(!fLastTriedStepComputation
|
||||
&& (IntersectPointGlobal-fStepEndPoint).mag2()
|
||||
< (10.0*kCarTolerance*kCarTolerance)
|
||||
) // Calculated it 'just' before & then called locate
|
||||
G4bool usingStored = fCalculatedExitNormal && (
|
||||
( fLastTriedStepComputation && fExiting ) // Just calculated it
|
||||
|| // No locate in between
|
||||
( !fLastTriedStepComputation
|
||||
&& (IntersectPointGlobal-fStepEndPoint).mag2() < 10.0*fSqTol ) );
|
||||
// Calculated it 'just' before & then called locate
|
||||
// but it did not move position
|
||||
);
|
||||
|
||||
if( usingStored )
|
||||
{
|
||||
@@ -1599,7 +1601,18 @@ G4Navigator::GetGlobalExitNormal(const G4ThreeVector& IntersectPointGlobal,
|
||||
<< " - but |normal| = " << std::sqrt(normMag2)
|
||||
<< " - and |normal|^2 = " << normMag2 << G4endl
|
||||
<< " which differs from 1.0 by " << normMag2 - 1.0 << G4endl
|
||||
<< " n = " << fExitNormalGlobalFrame << G4endl;
|
||||
<< " n = " << fExitNormalGlobalFrame << G4endl
|
||||
<< " Global point: " << IntersectPointGlobal << G4endl
|
||||
<< " Volume: " << fHistory.GetTopVolume()->GetName() << G4endl;
|
||||
#ifdef G4VERBOSE
|
||||
G4LogicalVolume* candLog = fHistory.GetTopVolume()->GetLogicalVolume();
|
||||
if ( candLog )
|
||||
{
|
||||
message << " Solid: " << candLog->GetSolid()->GetName()
|
||||
<< ", Type: " << candLog->GetSolid()->GetEntityType() << G4endl
|
||||
<< *candLog->GetSolid() << G4endl;
|
||||
}
|
||||
#endif
|
||||
message << "============================================================"
|
||||
<< G4endl;
|
||||
G4int oldVerbose = fVerbose;
|
||||
@@ -1632,7 +1645,7 @@ G4Navigator::GetGlobalExitNormal(const G4ThreeVector& IntersectPointGlobal,
|
||||
#ifdef G4DEBUG_NAVIGATION
|
||||
usingStored= false;
|
||||
|
||||
if( (!validNormal) && !fCalculatedExitNormal)
|
||||
if( (!validNormal) && !fCalculatedExitNormal )
|
||||
{
|
||||
G4ExceptionDescription edN;
|
||||
edN << " Calculated = " << fCalculatedExitNormal << G4endl;
|
||||
@@ -1906,7 +1919,7 @@ G4bool G4Navigator::RecheckDistanceToCurrentBoundary(
|
||||
|
||||
if( fEnteredDaughter )
|
||||
{
|
||||
if( motherLogical->CharacteriseDaughters() ==kReplica ) { return false; }
|
||||
if( motherLogical->CharacteriseDaughters() == kReplica ) { return false; }
|
||||
|
||||
// Track arrived at boundary of a daughter volume at
|
||||
// the last call of ComputeStep().
|
||||
@@ -2061,9 +2074,13 @@ void G4Navigator::PrintState() const
|
||||
<< " Entering = " << fEntering // << G4endl
|
||||
<< " BlockedPhysicalVolume= " ;
|
||||
if (fBlockedPhysicalVolume==0)
|
||||
{
|
||||
G4cout << "None";
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << fBlockedPhysicalVolume->GetName();
|
||||
}
|
||||
G4cout << G4endl
|
||||
<< " BlockedReplicaNo = " << fBlockedReplicaNo // << G4endl
|
||||
<< " LastStepWasZero = " << fLastStepWasZero // << G4endl
|
||||
@@ -2087,12 +2104,12 @@ void G4Navigator::PrintState() const
|
||||
<< std::setw( 9) << fExiting << " "
|
||||
<< std::setw( 9) << fEntering << " ";
|
||||
if ( fBlockedPhysicalVolume==0 )
|
||||
G4cout << std::setw(15) << "None";
|
||||
{ G4cout << std::setw(15) << "None"; }
|
||||
else
|
||||
G4cout << std::setw(15)<< fBlockedPhysicalVolume->GetName();
|
||||
G4cout << std::setw( 9) << fBlockedReplicaNo << " "
|
||||
<< std::setw( 8) << fLastStepWasZero << " "
|
||||
<< G4endl;
|
||||
{ G4cout << std::setw(15)<< fBlockedPhysicalVolume->GetName(); }
|
||||
G4cout << std::setw( 9) << fBlockedReplicaNo << " "
|
||||
<< std::setw( 8) << fLastStepWasZero << " "
|
||||
<< G4endl;
|
||||
}
|
||||
if( fVerbose > 2 )
|
||||
{
|
||||
@@ -2114,8 +2131,8 @@ void G4Navigator::ComputeStepLog(const G4ThreeVector& pGlobalpoint,
|
||||
// The following checks only make sense if the move is larger
|
||||
// than the tolerance.
|
||||
|
||||
static const G4double fAccuracyForWarning = kCarTolerance,
|
||||
fAccuracyForException = 1000*kCarTolerance;
|
||||
const G4double fAccuracyForWarning = kCarTolerance,
|
||||
fAccuracyForException = 1000*kCarTolerance;
|
||||
|
||||
G4ThreeVector OriginalGlobalpoint = fHistory.GetTopTransform().Inverse().
|
||||
TransformPoint(fLastLocatedPointLocal);
|
||||
|
||||
Reference in New Issue
Block a user