Import Geant4 10.3.0.beta source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4BrentLocator.cc 90451 2015-05-29 09:48:07Z gcosmo $
|
||||
// $Id: G4BrentLocator.cc 96458 2016-04-15 10:15:24Z gcosmo $
|
||||
//
|
||||
// Class G4BrentLocator implementation
|
||||
//
|
||||
@@ -187,7 +187,7 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
|
||||
G4int depth=0; // Depth counts how many subdivisions of initial step made
|
||||
|
||||
#ifdef G4DEBUG_FIELD
|
||||
static G4double tolerance= 1.0e-8;
|
||||
const G4double tolerance= 1.0e-8;
|
||||
G4ThreeVector StartPosition= CurveStartPointVelocity.GetPosition();
|
||||
if( (TrialPoint - StartPosition).mag() < tolerance * CLHEP::mm )
|
||||
{
|
||||
@@ -572,7 +572,7 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
|
||||
// tests ChordAF_Vector.mag() <= maximum_lateral_displacement
|
||||
|
||||
#ifdef G4DEBUG_LOCATE_INTERSECTION
|
||||
static G4int trigger_substepno_print= warn_substeps - 20 ;
|
||||
G4int trigger_substepno_print= warn_substeps - 20 ;
|
||||
|
||||
if( substep_no >= trigger_substepno_print )
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MultiLevelLocator.cc 94380 2015-11-13 10:14:39Z gcosmo $
|
||||
// $Id: G4MultiLevelLocator.cc 96458 2016-04-15 10:15:24Z gcosmo $
|
||||
//
|
||||
// Class G4MultiLevelLocator implementation
|
||||
//
|
||||
@@ -183,8 +183,8 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
|
||||
fNumCalls++;
|
||||
|
||||
#ifdef G4DEBUG_FIELD
|
||||
static unsigned int trigger_substepno_print=0;
|
||||
static const G4double tolerance = 1.0e-8 * CLHEP::mm;
|
||||
unsigned int trigger_substepno_print=0;
|
||||
const G4double tolerance = 1.0e-8 * CLHEP::mm;
|
||||
unsigned int biggest_depth= 0;
|
||||
|
||||
#if (G4DEBUG_FIELD>1)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NavigationLogger.cc 93289 2015-10-15 10:01:15Z gcosmo $
|
||||
// $Id: G4NavigationLogger.cc 96409 2016-04-12 08:12:10Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4NavigationLogger Implementation
|
||||
@@ -789,7 +789,7 @@ G4NavigationLogger::ReportVolumeAndIntersection( std::ostream& os,
|
||||
const G4ThreeVector& localDirection,
|
||||
const G4VPhysicalVolume* physical ) const
|
||||
{
|
||||
G4String fMethod = fId + "::ComputeStep() / output from G4NavigatorLogger::ReportVolumeAndIntersection";
|
||||
G4String fMethod = fId + "::ComputeStep()";
|
||||
const G4LogicalVolume* logicalVol = physical
|
||||
? physical->GetLogicalVolume() : 0;
|
||||
const G4VSolid* solid = logicalVol
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NormalNavigation.cc 93289 2015-10-15 10:01:15Z gcosmo $
|
||||
// $Id: G4NormalNavigation.cc 96743 2016-05-03 08:01:33Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4NormalNavigation Implementation
|
||||
@@ -273,10 +273,13 @@ G4NormalNavigation::ComputeStep(const G4ThreeVector &localPoint,
|
||||
|
||||
if( (motherStep >= kInfinity) || (motherStep < 0.0) )
|
||||
{
|
||||
// Clearly outside the mother solid!
|
||||
#ifdef G4VERBOSE
|
||||
fLogger->ReportOutsideMother(localPoint, localDirection, motherPhysical);
|
||||
#endif
|
||||
#ifdef G4VERBOSE
|
||||
if( fCheck ) // Clearly outside the mother solid!
|
||||
{
|
||||
fLogger->ReportOutsideMother(localPoint, localDirection,
|
||||
motherPhysical);
|
||||
}
|
||||
#endif
|
||||
ourStep = motherStep = 0.0;
|
||||
exiting = true;
|
||||
entering = false;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
@@ -24,7 +23,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ReplicaNavigation.cc 89897 2015-05-04 08:19:32Z gcosmo $
|
||||
// $Id: G4ReplicaNavigation.cc 96458 2016-04-15 10:15:24Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4ReplicaNavigation Implementation
|
||||
@@ -61,6 +60,10 @@ G4ReplicaNavigation::G4ReplicaNavigation()
|
||||
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
kRadTolerance = G4GeometryTolerance::GetInstance()->GetRadialTolerance();
|
||||
kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance();
|
||||
halfkCarTolerance = kCarTolerance*0.5;
|
||||
halfkRadTolerance = kRadTolerance*0.5;
|
||||
halfkAngTolerance = kAngTolerance*0.5;
|
||||
fMinStep = 0.05*kCarTolerance;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -81,7 +84,7 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
|
||||
const G4ThreeVector &localPoint) const
|
||||
{
|
||||
EInside in = kOutside;
|
||||
|
||||
|
||||
// Replication data
|
||||
//
|
||||
EAxis axis;
|
||||
@@ -99,11 +102,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
|
||||
case kYAxis:
|
||||
case kZAxis:
|
||||
coord = std::fabs(localPoint(axis))-width*0.5;
|
||||
if ( coord<=-kCarTolerance*0.5 )
|
||||
if ( coord<=-halfkCarTolerance )
|
||||
{
|
||||
in = kInside;
|
||||
}
|
||||
else if ( coord<=kCarTolerance*0.5 )
|
||||
else if ( coord<=halfkCarTolerance )
|
||||
{
|
||||
in = kSurface;
|
||||
}
|
||||
@@ -112,11 +115,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
|
||||
if ( localPoint.y()||localPoint.x() )
|
||||
{
|
||||
coord = std::fabs(std::atan2(localPoint.y(),localPoint.x()))-width*0.5;
|
||||
if ( coord<=-kAngTolerance*0.5 )
|
||||
if ( coord<=-halfkAngTolerance )
|
||||
{
|
||||
in = kInside;
|
||||
}
|
||||
else if ( coord<=kAngTolerance*0.5 )
|
||||
else if ( coord<=halfkAngTolerance )
|
||||
{
|
||||
in = kSurface;
|
||||
}
|
||||
@@ -129,11 +132,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
|
||||
case kRho:
|
||||
rad2 = localPoint.perp2();
|
||||
rmax = (replicaNo+1)*width+offset;
|
||||
tolRMax2 = rmax-kRadTolerance*0.5;
|
||||
tolRMax2 = rmax-halfkRadTolerance;
|
||||
tolRMax2 *= tolRMax2;
|
||||
if ( rad2>tolRMax2 )
|
||||
{
|
||||
tolRMax2 = rmax+kRadTolerance*0.5;
|
||||
tolRMax2 = rmax+halfkRadTolerance;
|
||||
tolRMax2 *= tolRMax2;
|
||||
if ( rad2<=tolRMax2 )
|
||||
{
|
||||
@@ -147,11 +150,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
|
||||
if ( replicaNo||offset )
|
||||
{
|
||||
rmin = rmax-width;
|
||||
tolRMin2 = rmin-kRadTolerance*0.5;
|
||||
tolRMin2 = rmin-halfkRadTolerance;
|
||||
tolRMin2 *= tolRMin2;
|
||||
if ( rad2>tolRMin2 )
|
||||
{
|
||||
tolRMin2 = rmin+kRadTolerance*0.5;
|
||||
tolRMin2 = rmin+halfkRadTolerance;
|
||||
tolRMin2 *= tolRMin2;
|
||||
if ( rad2>=tolRMin2 )
|
||||
{
|
||||
@@ -240,7 +243,7 @@ G4ReplicaNavigation::DistanceToOut(const G4VPhysicalVolume *pVol,
|
||||
FatalException, "Unknown axis!");
|
||||
break;
|
||||
}
|
||||
return (safety >= kCarTolerance) ? safety : 0;
|
||||
return (safety >= halfkCarTolerance) ? safety : 0;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -365,7 +368,7 @@ G4ReplicaNavigation::DistanceToOutPhi(const G4ThreeVector &localPoint,
|
||||
//
|
||||
if ( yi<=0 )
|
||||
{
|
||||
Dist = (pDistS<=-kCarTolerance*0.5) ? dist2 : 0;
|
||||
Dist = (pDistS<=-halfkCarTolerance) ? dist2 : 0;
|
||||
sidePhi= G4ExitNormal::kSPhi; // tbc
|
||||
}
|
||||
else
|
||||
@@ -393,7 +396,7 @@ G4ReplicaNavigation::DistanceToOutPhi(const G4ThreeVector &localPoint,
|
||||
{
|
||||
// Leaving via ending phi
|
||||
//
|
||||
Dist = (pDistE<=-kCarTolerance*0.5) ? dist2 : 0;
|
||||
Dist = (pDistE<=-halfkCarTolerance) ? dist2 : 0;
|
||||
sidePhi = G4ExitNormal::kEPhi;
|
||||
}
|
||||
}
|
||||
@@ -506,7 +509,7 @@ G4ReplicaNavigation::DistanceToOutRad(const G4ThreeVector &localPoint,
|
||||
G4double rmin, rmax, t1, t2, t3, deltaR;
|
||||
G4double b, c, d2, srd;
|
||||
G4ExitNormal::ESide sideR= G4ExitNormal::kNull;
|
||||
|
||||
|
||||
//
|
||||
// Radial Intersections
|
||||
//
|
||||
@@ -541,9 +544,9 @@ G4ReplicaNavigation::DistanceToOutRad(const G4ThreeVector &localPoint,
|
||||
deltaR = t3-rmax*rmax;
|
||||
|
||||
// NOTE: Should use
|
||||
// rho-rmax<-kRadTolerance*0.5 - [no sqrts for efficiency]
|
||||
// rho-rmax<-halfkRadTolerance - [no sqrts for efficiency]
|
||||
//
|
||||
if ( deltaR<-kRadTolerance*0.5 )
|
||||
if ( deltaR<-halfkRadTolerance )
|
||||
{
|
||||
b = t2/t1;
|
||||
c = deltaR/t1;
|
||||
@@ -573,11 +576,11 @@ G4ReplicaNavigation::DistanceToOutRad(const G4ThreeVector &localPoint,
|
||||
{
|
||||
// Leaving via rmin
|
||||
// NOTE: Should use
|
||||
// rho-rmin>kRadTolerance*0.5 - [no sqrts for efficiency]
|
||||
// rho-rmin>halfkRadTolerance - [no sqrts for efficiency]
|
||||
//
|
||||
srd = (deltaR>kRadTolerance*0.5) ? -b-std::sqrt(d2) : 0.0;
|
||||
srd = (deltaR>halfkRadTolerance) ? -b-std::sqrt(d2) : 0.0;
|
||||
// Is the following more accurate ?
|
||||
// srd = (deltaR>kRadTolerance*0.5) ? c/( -b - std::sqrt(d2)) : 0.0;
|
||||
// srd = (deltaR>halfkRadTolerance) ? c/( -b - std::sqrt(d2)) : 0.0;
|
||||
sideR= G4ExitNormal::kRMin;
|
||||
}
|
||||
else
|
||||
@@ -841,7 +844,8 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
|
||||
}
|
||||
if ( sampleSafety < ourStep )
|
||||
{
|
||||
G4ThreeVector newLocalDirection = GlobalToLocal.TransformAxis(globalDirection);
|
||||
G4ThreeVector newLocalDirection =
|
||||
GlobalToLocal.TransformAxis(globalDirection);
|
||||
sampleStep = DistanceToOut(history.GetVolume(depth),
|
||||
history.GetReplicaNo(depth),
|
||||
repPoint,
|
||||
@@ -911,16 +915,16 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
|
||||
}
|
||||
|
||||
// Push in principle no longer necessary. G4Navigator now takes care of ...
|
||||
// Removing this will however generate warnings for pushed particles from
|
||||
// G4Navigator, particularly for the case of 3D replicas (Cartesian or
|
||||
// combined Radial/Phi cases).
|
||||
// Removing this however may cause additional almost-zero steps and generate
|
||||
// warnings for pushed particles from G4Navigator, particularly for the case
|
||||
// of 3D replicas (Cartesian or combined Radial/Phi cases).
|
||||
// Requires further investigation and eventually reimplementation of
|
||||
// LevelLocate() to take into account point and direction ...
|
||||
//
|
||||
if ( ( !ourStep && (sampleSafety<0.5*kCarTolerance) )
|
||||
if ( ( (ourStep<fMinStep) && (sampleSafety<halfkCarTolerance) )
|
||||
&& ( repLogical->GetSolid()->Inside(localPoint)==kSurface ) )
|
||||
{
|
||||
ourStep += kCarTolerance;
|
||||
ourStep = 100*kCarTolerance;
|
||||
}
|
||||
|
||||
if ( motherSafety<ourSafety )
|
||||
@@ -972,7 +976,9 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
|
||||
if ( motherDeterminedStep )
|
||||
{
|
||||
exitNormalVector= motherNormalStc.exitNormal;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
G4ThreeVector exitNormalGlobal= exitNormalStc.exitNormal;
|
||||
exitNormalVector= globalToLocalTop.TransformAxis(exitNormalGlobal);
|
||||
// exitNormalVector= globalToLocal2nd.TransformAxis(exitNormalGlobal);
|
||||
@@ -1059,7 +1065,7 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
|
||||
entering = true;
|
||||
exiting = false;
|
||||
*pBlockedPhysical = samplePhysical;
|
||||
blockedReplicaNo = -1;
|
||||
blockedReplicaNo = sampleNo;
|
||||
|
||||
#ifdef DAUGHTER_NORMAL_ALSO
|
||||
// This norm can be calculated later, if needed daughter is available
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4SimpleLocator.cc 90451 2015-05-29 09:48:07Z gcosmo $
|
||||
// $Id: G4SimpleLocator.cc 96743 2016-05-03 08:01:33Z gcosmo $
|
||||
//
|
||||
// Class G4SimpleLocator implementation
|
||||
//
|
||||
@@ -120,7 +120,7 @@ G4bool G4SimpleLocator::EstimateIntersectionPoint(
|
||||
NormalAtEntry = GetSurfaceNormal( CurrentE_Point, validNormalAtE);
|
||||
|
||||
#ifdef G4DEBUG_FIELD
|
||||
static G4double tolerance = 1.0e-8;
|
||||
const G4double tolerance = 1.0e-8;
|
||||
G4ThreeVector StartPosition= CurveStartPointVelocity.GetPosition();
|
||||
if( (TrialPoint - StartPosition).mag() < tolerance * CLHEP::mm )
|
||||
{
|
||||
@@ -422,7 +422,7 @@ G4bool G4SimpleLocator::EstimateIntersectionPoint(
|
||||
// tests ChordAF_Vector.mag() <= maximum_lateral_displacement
|
||||
|
||||
#ifdef G4DEBUG_LOCATE_INTERSECTION
|
||||
static G4int trigger_substepno_print= warn_substeps - 20;
|
||||
G4int trigger_substepno_print= warn_substeps - 20;
|
||||
|
||||
if( substep_no >= trigger_substepno_print )
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VoxelNavigation.cc 93289 2015-10-15 10:01:15Z gcosmo $
|
||||
// $Id: G4VoxelNavigation.cc 96743 2016-05-03 08:01:33Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4VoxelNavigation Implementation
|
||||
@@ -40,10 +40,6 @@
|
||||
|
||||
#include "G4AuxiliaryNavServices.hh"
|
||||
|
||||
#ifdef G4DEBUG_NAVIGATION
|
||||
static int debugVerboseLevel= 5; // Reports most about daughter volumes
|
||||
#endif
|
||||
|
||||
// ********************************************************************
|
||||
// Constructor
|
||||
// ********************************************************************
|
||||
@@ -57,11 +53,12 @@ G4VoxelNavigation::G4VoxelNavigation()
|
||||
fVoxelHeaderStack(kNavigatorVoxelStackMax,(G4SmartVoxelHeader*)0),
|
||||
fVoxelNode(0), fpVoxelSafety(0), fCheck(false), fBestSafety(false)
|
||||
{
|
||||
fLogger = new G4NavigationLogger("G4VoxelNavigation");
|
||||
fpVoxelSafety = new G4VoxelSafety();
|
||||
fLogger= new G4NavigationLogger("G4VoxelNavigation");
|
||||
fpVoxelSafety= new G4VoxelSafety();
|
||||
fHalfTolerance= 0.5*G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
|
||||
#ifdef G4DEBUG_NAVIGATION
|
||||
SetVerboseLevel(debugVerboseLevel); // Reports most about daughter volumes
|
||||
SetVerboseLevel(5); // Reports most about daughter volumes
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -163,6 +160,7 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
if( (motherStep >= kInfinity) || (motherStep < 0.0) )
|
||||
{
|
||||
// Error - indication of being outside solid !!
|
||||
//
|
||||
fLogger->ReportOutsideMother(localPoint, localDirection, motherPhysical);
|
||||
|
||||
ourStep = 0.0;
|
||||
@@ -321,22 +319,25 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
{
|
||||
fLogger->CheckAndReportBadNormal(motherExitNormal,
|
||||
localPoint, localDirection,
|
||||
motherStep, motherSolid,
|
||||
motherStep, motherSolid,
|
||||
"From motherSolid::DistanceToOut" );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if( (motherStep >= kInfinity) || (motherStep < 0.0) )
|
||||
{
|
||||
// Error - indication of being outside solid !!
|
||||
//
|
||||
fLogger->ReportOutsideMother(localPoint, localDirection, motherPhysical);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if( fCheck ) // Error - indication of being outside solid !!
|
||||
{
|
||||
fLogger->ReportOutsideMother(localPoint, localDirection,
|
||||
motherPhysical);
|
||||
}
|
||||
#endif
|
||||
motherStep = 0.0;
|
||||
ourStep = 0.0;
|
||||
exiting = true;
|
||||
entering = false;
|
||||
|
||||
|
||||
// validExitNormal= motherValidExitNormal;
|
||||
// exitNormal= motherExitNormal;
|
||||
// Useful only if the point is very close to surface
|
||||
@@ -374,8 +375,7 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
*rot,
|
||||
// motherPhysical,
|
||||
"From RotationMatrix" );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,8 +510,6 @@ G4VoxelNavigation::LocateNextVoxel(const G4ThreeVector& localPoint,
|
||||
G4bool isNewVoxel=false;
|
||||
|
||||
G4double currentDistance = currentStep;
|
||||
static const G4double sigma = 0.5*G4GeometryTolerance::GetInstance()
|
||||
->GetSurfaceTolerance();
|
||||
|
||||
// Determine if end of Step within current voxel
|
||||
//
|
||||
@@ -527,10 +525,10 @@ G4VoxelNavigation::LocateNextVoxel(const G4ThreeVector& localPoint,
|
||||
workCoord = targetPoint(workHeaderAxis);
|
||||
minVal = workMinExtent+workNodeNo*workNodeWidth;
|
||||
|
||||
if ( minVal<=workCoord+sigma )
|
||||
if ( minVal<=workCoord+fHalfTolerance )
|
||||
{
|
||||
maxVal = minVal+workNodeWidth;
|
||||
if ( maxVal<=workCoord-sigma )
|
||||
if ( maxVal<=workCoord-fHalfTolerance )
|
||||
{
|
||||
// Must consider next voxel
|
||||
//
|
||||
@@ -567,11 +565,11 @@ G4VoxelNavigation::LocateNextVoxel(const G4ThreeVector& localPoint,
|
||||
workCoord = targetPoint(workHeaderAxis);
|
||||
minVal = workMinExtent+fVoxelNode->GetMinEquivalentSliceNo()*workNodeWidth;
|
||||
|
||||
if ( minVal<=workCoord+sigma )
|
||||
if ( minVal<=workCoord+fHalfTolerance )
|
||||
{
|
||||
maxVal = workMinExtent+(fVoxelNode->GetMaxEquivalentSliceNo()+1)
|
||||
*workNodeWidth;
|
||||
if ( maxVal<=workCoord-sigma )
|
||||
if ( maxVal<=workCoord-fHalfTolerance )
|
||||
{
|
||||
newNodeNo = fVoxelNode->GetMaxEquivalentSliceNo()+1;
|
||||
newHeader = workHeader;
|
||||
|
||||
Reference in New Issue
Block a user