Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.1 2003/10/01 14:51:38 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.2 2004/06/11 14:17:15 gcosmo Exp $
|
||||
# --------------------------------------------------------------------
|
||||
# GNUmakefile for geometry/volumes library. Gabriele Cosmo, 16/11/96.
|
||||
# --------------------------------------------------------------------
|
||||
@@ -11,6 +11,7 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -DG4GEOM_ALLOC_EXPORT
|
||||
CPPFLAGS += -I$(G4BASE)/graphics_reps/include \
|
||||
-I$(G4BASE)/intercoms/include \
|
||||
-I$(G4BASE)/global/management/include \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.22 2004/03/11 13:17:42 gcosmo Exp $
|
||||
$Id: History,v 1.28 2004/06/18 12:45:10 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,29 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Jun 18th, 2004 - G.Cosmo (geomnav-V06-01-03)
|
||||
------------------------
|
||||
- Enhanced check for null step in G4Navigator::ComputeStep().
|
||||
Now attempting a corrective action after 10 consecutive zero steps.
|
||||
Event gets aborted after 25 zero steps.
|
||||
|
||||
Jun 15th, 2004 - G.Cosmo (geomnav-V06-01-02)
|
||||
------------------------
|
||||
- Relax exception in G4Navigator::ComputeStep() for stuck tracks.
|
||||
Event gets aborted after 25 zero steps.
|
||||
|
||||
Jun 11th, 2004 - G.Cosmo (geomnav-V06-01-01)
|
||||
------------------------
|
||||
- Added check to G4Navigator to count the number of steps with zero length
|
||||
and issue an exception for tracks that get stuck in a loop (J.Apostolakis).
|
||||
- Modified GNUmakefile to define G4GEOMETRY_ALLOC_EXPORT flag for DLLs
|
||||
build on Windows.
|
||||
|
||||
May 17th, 2004 - G.Cosmo (geomnav-V06-01-00)
|
||||
------------------------
|
||||
- Added more verbosity on solids response for navigators (optimised/not
|
||||
optimised) if "check_mode" state is combined with verbose level-1.
|
||||
|
||||
Mar 11th, 2004 - G.Cosmo (geomnav-V06-00-02)
|
||||
------------------------
|
||||
- Added "check_mode" state for navigators. The state can be activated by
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Navigator.hh,v 1.5 2004/03/10 18:21:15 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4Navigator.hh,v 1.8 2004/06/18 12:47:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// class G4Navigator
|
||||
@@ -355,22 +355,32 @@ class G4Navigator
|
||||
G4ThreeVector fGrandMotherExitNormal; // Leaving volume normal, in its
|
||||
// own coordinate system
|
||||
G4NavigationHistory fHistory;
|
||||
// Transformation & `path' history
|
||||
// of current path through geomtrical
|
||||
// hierarchy
|
||||
// Transformation & `path' history of current path
|
||||
// through geomtrical hierarchy
|
||||
|
||||
G4bool fLastStepWasZero;
|
||||
// Whether the last ComputeStep moved Zero
|
||||
// Used to check for edges.
|
||||
G4bool fLocatedOnEdge;
|
||||
// Whether the Navigator has detected an edge
|
||||
// Count zero steps - as one or two can occur due to changing momentum at
|
||||
// a boundary or at an edge common between volumes
|
||||
// - several are likely a problem in the geometry
|
||||
// description or in the navigation
|
||||
//
|
||||
G4bool fLastStepWasZero;
|
||||
// Whether the last ComputeStep moved Zero. Used to check for edges.
|
||||
|
||||
G4bool fLocatedOnEdge;
|
||||
// Whether the Navigator has detected an edge
|
||||
G4int fNumberZeroSteps;
|
||||
// Number of preceding moves that were Zero. Reset to 0 after finite step
|
||||
G4int fActionThreshold_NoZeroSteps;
|
||||
// After this many failed/zero steps, act (push etc)
|
||||
G4int fAbandonThreshold_NoZeroSteps;
|
||||
// After this many failed/zero steps, abandon track
|
||||
|
||||
G4ThreeVector fPreviousSftOrigin;
|
||||
G4double fPreviousSafety;
|
||||
// Memory of last safety origin & value.
|
||||
// Used in ComputeStep to ensure that
|
||||
// origin of current Step is in the same
|
||||
// volume as the point of the last relocation.
|
||||
// Memory of last safety origin & value. Used in ComputeStep to ensure
|
||||
// that origin of current Step is in the same volume as the point of the
|
||||
// last relocation
|
||||
|
||||
//
|
||||
// END State information
|
||||
//
|
||||
@@ -393,6 +403,8 @@ class G4Navigator
|
||||
|
||||
G4bool fCheck;
|
||||
// Check-mode flag [if true, more strict checks are performed].
|
||||
G4bool fPushed;
|
||||
// Push flag [if true, means a stuck particle has been pushed].
|
||||
G4int fVerbose;
|
||||
// Verbose(ness) level [if > 0, printout can occur].
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Navigator.cc,v 1.8 2004/03/11 13:09:29 gcosmo Exp $
|
||||
// $Id: G4Navigator.cc,v 1.13 2004/06/18 12:47:05 gcosmo Exp $
|
||||
// GEANT4 tag $ Name: $
|
||||
//
|
||||
// class G4Navigator Implementation
|
||||
@@ -42,9 +42,12 @@
|
||||
//
|
||||
G4Navigator::G4Navigator()
|
||||
: fWasLimitedByGeometry(false), fTopPhysical(0),
|
||||
fCheck(false), fVerbose(0)
|
||||
fCheck(false), fPushed(false), fVerbose(0)
|
||||
{
|
||||
ResetStackAndState();
|
||||
|
||||
fActionThreshold_NoZeroSteps = 10;
|
||||
fAbandonThreshold_NoZeroSteps = 25;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -230,6 +233,20 @@ G4Navigator::LocateGlobalPointAndSetup( const G4ThreeVector& globalPoint,
|
||||
targetSolid = fHistory.GetTopVolume()->GetLogicalVolume()->GetSolid();
|
||||
localPoint = fHistory.GetTopTransform().TransformPoint(globalPoint);
|
||||
insideCode = targetSolid->Inside(localPoint);
|
||||
#ifdef G4VERBOSE
|
||||
if(( fVerbose == 1 ) && ( fCheck ))
|
||||
{
|
||||
G4String solidResponse = "-kInside-";
|
||||
if (insideCode == kOutside)
|
||||
solidResponse = "-kOutside-";
|
||||
else if (insideCode == kSurface)
|
||||
solidResponse = "-kSurface-";
|
||||
G4cout << "*** G4Navigator::LocateGlobalPointAndSetup(): ***" << G4endl
|
||||
<< " Invoked Inside() for solid: " << targetSolid->GetName()
|
||||
<< ". Solid replied: " << solidResponse << G4endl
|
||||
<< " For local point p: " << localPoint << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -464,8 +481,9 @@ G4Navigator::LocateGlobalPointWithinVolume(const G4ThreeVector& pGlobalpoint)
|
||||
break;
|
||||
|
||||
case kReplica:
|
||||
G4Exception("G4Navigator::LocateGlobalPointWithinVolume()", "NotApplicable",
|
||||
FatalException, "Not applicable for replicated volumes.");
|
||||
G4Exception("G4Navigator::LocateGlobalPointWithinVolume()",
|
||||
"NotApplicable", FatalException,
|
||||
"Not applicable for replicated volumes.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -550,6 +568,9 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
G4VPhysicalVolume *motherPhysical = fHistory.GetTopVolume();
|
||||
G4LogicalVolume *motherLogical = motherPhysical->GetLogicalVolume();
|
||||
|
||||
static G4int sNavCScalls=0;
|
||||
sNavCScalls++;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
G4int oldcoutPrec= G4cout.precision(8);
|
||||
G4int oldcerrPrec= G4cerr.precision(10);
|
||||
@@ -759,11 +780,73 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
fPreviousSftOrigin = pGlobalpoint;
|
||||
fPreviousSafety = pNewSafety;
|
||||
|
||||
// Edge if two consecutive steps are zero, because
|
||||
// at least two candidate volumes must have been checked
|
||||
// Count zero steps - one can occur due to changing momentum at a boundary
|
||||
// - one, two (or a few) can occur at common edges between
|
||||
// volumes
|
||||
// - more than two is likely a problem in the geometry
|
||||
// description or the Navigation
|
||||
|
||||
// Rule of thumb: likely at an Edge if two consecutive steps are zero,
|
||||
// because at least two candidate volumes must have been
|
||||
// checked
|
||||
//
|
||||
fLocatedOnEdge = fLastStepWasZero && (Step==0);
|
||||
fLastStepWasZero = (Step==0);
|
||||
fLocatedOnEdge = fLastStepWasZero && (Step==0.0);
|
||||
fLastStepWasZero = (Step==0.0);
|
||||
if (fPushed) fPushed = fLastStepWasZero;
|
||||
|
||||
// Handle large number of consecutive zero steps
|
||||
//
|
||||
if ( fLastStepWasZero )
|
||||
{
|
||||
fNumberZeroSteps++;
|
||||
#ifdef G4DEBUG_NAVIGATION
|
||||
if( fNumberZeroSteps > 1 )
|
||||
{
|
||||
G4cout << "G4Nav - CompStep: another zero step, # " << fNumberZeroSteps
|
||||
<< " at " << pGlobalpoint
|
||||
<< " in volume " << motherPhysical->GetName()
|
||||
<< " nav-comp-step calls # " << sNavCScalls
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
if( (fNumberZeroSteps > fActionThreshold_NoZeroSteps-1) && (!fPushed) )
|
||||
{
|
||||
// Act to recover this stuck track. Pushing it once along direction
|
||||
//
|
||||
Step += 0.9*kCarTolerance;
|
||||
fPushed = true;
|
||||
#ifdef G4VERBOSE
|
||||
G4cerr << "WARNING - G4Navigator::ComputeStep()" << G4endl
|
||||
<< " Track stuck, not moving for "
|
||||
<< fNumberZeroSteps << " steps" << G4endl
|
||||
<< " in volume -" << motherPhysical->GetName()
|
||||
<< "- at point " << pGlobalpoint << G4endl
|
||||
<< " direction: " << pDirection << "." << G4endl
|
||||
<< " Potential geometry or navigation problem !"
|
||||
<< G4endl
|
||||
<< " Trying pushing it of " << Step << " mm ..."
|
||||
<< G4endl;
|
||||
#endif
|
||||
}
|
||||
if( fNumberZeroSteps > fAbandonThreshold_NoZeroSteps-1 )
|
||||
{
|
||||
// Must kill this stuck track
|
||||
//
|
||||
G4cerr << "ERROR - G4Navigator::ComputeStep()" << G4endl
|
||||
<< " Track stuck, not moving for "
|
||||
<< fNumberZeroSteps << " steps" << G4endl
|
||||
<< " in volume -" << motherPhysical->GetName()
|
||||
<< "- at point " << pGlobalpoint << G4endl
|
||||
<< " direction: " << pDirection << "." << G4endl;
|
||||
G4Exception("G4Navigator::ComputeStep()",
|
||||
"StuckTrack", EventMustBeAborted,
|
||||
"Stuck Track: potential geometry or navigation problem.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!fPushed) fNumberZeroSteps = 0;
|
||||
}
|
||||
|
||||
fEnteredDaughter = fEntering; // I expect to enter a volume in this Step
|
||||
fExitedMother = fExiting;
|
||||
@@ -857,22 +940,25 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
|
||||
//
|
||||
void G4Navigator::ResetState()
|
||||
{
|
||||
fWasLimitedByGeometry=false;
|
||||
fEntering=false;
|
||||
fExiting=false;
|
||||
fLocatedOnEdge = false;
|
||||
fLastStepWasZero= false;
|
||||
fEnteredDaughter = false;
|
||||
fExitedMother = false;
|
||||
|
||||
fValidExitNormal = false;
|
||||
fExitNormal = G4ThreeVector(0,0,0);
|
||||
fWasLimitedByGeometry = false;
|
||||
fEntering = false;
|
||||
fExiting = false;
|
||||
fLocatedOnEdge = false;
|
||||
fLastStepWasZero = false;
|
||||
fEnteredDaughter = false;
|
||||
fExitedMother = false;
|
||||
fPushed = false;
|
||||
|
||||
fPreviousSftOrigin = G4ThreeVector(0,0,0);
|
||||
fPreviousSafety = 0.0;
|
||||
fValidExitNormal = false;
|
||||
fExitNormal = G4ThreeVector(0,0,0);
|
||||
|
||||
fPreviousSftOrigin = G4ThreeVector(0,0,0);
|
||||
fPreviousSafety = 0.0;
|
||||
|
||||
fNumberZeroSteps = 0;
|
||||
|
||||
fBlockedPhysicalVolume=0;
|
||||
fBlockedReplicaNo=-1;
|
||||
fBlockedPhysicalVolume = 0;
|
||||
fBlockedReplicaNo = -1;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NormalNavigation.cc,v 1.3 2004/03/10 18:21:20 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4NormalNavigation.cc,v 1.4 2004/05/17 13:30:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// class G4NormalNavigation Implementation
|
||||
@@ -86,6 +86,15 @@ G4NormalNavigation::ComputeStep(const G4ThreeVector &localPoint,
|
||||
#ifdef G4VERBOSE
|
||||
if ( fCheck )
|
||||
{
|
||||
if( fVerbose == 1 )
|
||||
{
|
||||
G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked DistanceToOut(p) for mother solid: "
|
||||
<< motherSolid->GetName()
|
||||
<< ". Solid replied: " << motherSafety << G4endl
|
||||
<< " For local point p: " << localPoint << G4endl
|
||||
<< " To be considered as 'mother safety'." << G4endl;
|
||||
}
|
||||
if ( motherSafety < 0.0 )
|
||||
{
|
||||
G4cerr << "ERROR - G4NormalNavigation::ComputeStep()" << G4endl
|
||||
@@ -160,6 +169,18 @@ G4NormalNavigation::ComputeStep(const G4ThreeVector &localPoint,
|
||||
sampleDirection = sampleTf.TransformAxis(localDirection);
|
||||
const G4double sampleStep =
|
||||
sampleSolid->DistanceToIn(samplePoint,sampleDirection);
|
||||
#ifdef G4VERBOSE
|
||||
if(( fCheck ) && ( fVerbose == 1 ))
|
||||
{
|
||||
G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked DistanceToIn(p,v) for daughter solid: "
|
||||
<< sampleSolid->GetName()
|
||||
<< ". Solid replied: " << sampleStep << G4endl
|
||||
<< " For local point p: " << samplePoint << G4endl
|
||||
<< " Direction v: " << sampleDirection
|
||||
<< ", to be considered as 'daughter step'." << G4endl;
|
||||
}
|
||||
#endif
|
||||
if ( sampleStep<=ourStep )
|
||||
{
|
||||
ourStep = sampleStep;
|
||||
@@ -177,6 +198,20 @@ G4NormalNavigation::ComputeStep(const G4ThreeVector &localPoint,
|
||||
G4ThreeVector intersectionPoint;
|
||||
intersectionPoint= samplePoint + sampleStep * sampleDirection;
|
||||
EInside insideIntPt= sampleSolid->Inside(intersectionPoint);
|
||||
G4String solidResponse = "-kInside-";
|
||||
if (insideIntPt == kOutside)
|
||||
solidResponse = "-kOutside-";
|
||||
else if (insideIntPt == kSurface)
|
||||
solidResponse = "-kSurface-";
|
||||
if( fVerbose == 1 )
|
||||
{
|
||||
G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked Inside() for solid: "
|
||||
<< sampleSolid->GetName()
|
||||
<< ". Solid replied: " << solidResponse << G4endl
|
||||
<< " For point p: " << intersectionPoint
|
||||
<< ", considered as 'intersection' point." << G4endl;
|
||||
}
|
||||
if ( insideIntPt != kSurface )
|
||||
{
|
||||
G4int oldcoutPrec = G4cout.precision(16);
|
||||
@@ -184,14 +219,8 @@ G4NormalNavigation::ComputeStep(const G4ThreeVector &localPoint,
|
||||
<< " Inaccurate DistanceToIn for solid "
|
||||
<< sampleSolid->GetName() << G4endl;
|
||||
G4cout << " Solid gave DistanceToIn = " << sampleStep
|
||||
<< " yet returns " ;
|
||||
if ( insideIntPt == kInside )
|
||||
G4cout << "-kInside-";
|
||||
else if ( insideIntPt == kOutside )
|
||||
G4cout << "-kOutside-";
|
||||
else
|
||||
G4cout << "-kSurface-";
|
||||
G4cout << " for this point !" << G4endl;
|
||||
<< " yet returns " << solidResponse
|
||||
<< " for this point !" << G4endl;
|
||||
G4cout << " Point = " << intersectionPoint << G4endl;
|
||||
if ( insideIntPt != kInside )
|
||||
G4cout << " DistanceToIn(p) = "
|
||||
@@ -233,7 +262,18 @@ G4NormalNavigation::ComputeStep(const G4ThreeVector &localPoint,
|
||||
&validExitNormal,
|
||||
&exitNormal);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fCheck )
|
||||
if ( fCheck )
|
||||
{
|
||||
if( fVerbose == 1 )
|
||||
{
|
||||
G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked DistanceToOut(p,v,...) for mother solid: "
|
||||
<< motherSolid->GetName()
|
||||
<< ". Solid replied: " << motherStep << G4endl
|
||||
<< " For local point p: " << localPoint << G4endl
|
||||
<< " Direction v: " << localDirection
|
||||
<< ", to be considered as 'mother step'." << G4endl;
|
||||
}
|
||||
if( ( motherStep < 0.0 ) || ( motherStep >= kInfinity) )
|
||||
{
|
||||
G4cerr << "ERROR - G4NormalNavigation::ComputeStep()" << G4endl
|
||||
@@ -246,6 +286,7 @@ G4NormalNavigation::ComputeStep(const G4ThreeVector &localPoint,
|
||||
"PointDistOutInvalid", FatalException,
|
||||
"Current point is outside the current solid !");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( motherStep<=ourStep )
|
||||
@@ -295,6 +336,18 @@ G4double G4NormalNavigation::ComputeSafety(const G4ThreeVector &localPoint,
|
||||
motherSafety = motherSolid->DistanceToOut(localPoint);
|
||||
ourSafety = motherSafety; // Working isotropic safety
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if(( fCheck ) && ( fVerbose == 1 ))
|
||||
{
|
||||
G4cout << "*** G4NormalNavigation::ComputeSafety(): ***" << G4endl
|
||||
<< " Invoked DistanceToOut(p) for mother solid: "
|
||||
<< motherSolid->GetName()
|
||||
<< ". Solid replied: " << motherSafety << G4endl
|
||||
<< " For local point p: " << localPoint
|
||||
<< ", to be considered as 'mother safety'." << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Compute daughter safeties
|
||||
//
|
||||
localNoDaughters = motherLogical->GetNoDaughters();
|
||||
@@ -314,6 +367,17 @@ G4double G4NormalNavigation::ComputeSafety(const G4ThreeVector &localPoint,
|
||||
{
|
||||
ourSafety = sampleSafety;
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if(( fCheck ) && ( fVerbose == 1 ))
|
||||
{
|
||||
G4cout << "*** G4NormalNavigation::ComputeSafety(): ***" << G4endl
|
||||
<< " Invoked DistanceToIn(p) for daughter solid: "
|
||||
<< sampleSolid->GetName()
|
||||
<< ". Solid replied: " << sampleSafety << G4endl
|
||||
<< " For local point p: " << samplePoint
|
||||
<< ", to be considered as 'daughter safety'." << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return ourSafety;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VoxelNavigation.cc,v 1.3 2004/03/10 18:21:20 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4VoxelNavigation.cc,v 1.4 2004/05/17 13:30:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// class G4VoxelNavigation Implementation
|
||||
@@ -104,6 +104,15 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
#ifdef G4VERBOSE
|
||||
if ( fCheck )
|
||||
{
|
||||
if(fVerbose == 1 )
|
||||
{
|
||||
G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked DistanceToOut(p) for mother solid: "
|
||||
<< motherSolid->GetName()
|
||||
<< ". Solid replied: " << motherSafety << G4endl
|
||||
<< " For local point p: " << localPoint
|
||||
<< ", to be considered as 'mother safety'." << G4endl;
|
||||
}
|
||||
if( motherSafety < 0.0 )
|
||||
{
|
||||
G4cout << "ERROR - G4VoxelNavigation::ComputeStep()" << G4endl
|
||||
@@ -184,6 +193,17 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
samplePhysical->GetLogicalVolume()->GetSolid();
|
||||
const G4double sampleSafety =
|
||||
sampleSolid->DistanceToIn(samplePoint);
|
||||
#ifdef G4VERBOSE
|
||||
if(( fCheck ) && ( fVerbose == 1 ))
|
||||
{
|
||||
G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked DistanceToIn(p) for daughter solid: "
|
||||
<< sampleSolid->GetName()
|
||||
<< ". Solid replied: " << sampleSafety << G4endl
|
||||
<< " For local point p: " << samplePoint
|
||||
<< ", to be considered as 'daughter safety'." << G4endl;
|
||||
}
|
||||
#endif
|
||||
if ( sampleSafety<ourSafety )
|
||||
{
|
||||
ourSafety = sampleSafety;
|
||||
@@ -193,6 +213,18 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
sampleDirection = sampleTf.TransformAxis(localDirection);
|
||||
G4double sampleStep =
|
||||
sampleSolid->DistanceToIn(samplePoint, sampleDirection);
|
||||
#ifdef G4VERBOSE
|
||||
if(( fCheck ) && ( fVerbose == 1 ))
|
||||
{
|
||||
G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked DistanceToIn(p,v) for daughter solid: "
|
||||
<< sampleSolid->GetName()
|
||||
<< ". Solid replied: " << sampleStep << G4endl
|
||||
<< " For local point p: " << samplePoint << G4endl
|
||||
<< " Direction v: " << sampleDirection
|
||||
<< ", to be considered as 'daughter step'." << G4endl;
|
||||
}
|
||||
#endif
|
||||
if ( sampleStep<=ourStep )
|
||||
{
|
||||
ourStep = sampleStep;
|
||||
@@ -210,6 +242,20 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
G4ThreeVector intersectionPoint;
|
||||
intersectionPoint= samplePoint + sampleStep * sampleDirection;
|
||||
EInside insideIntPt= sampleSolid->Inside(intersectionPoint);
|
||||
G4String solidResponse = "-kInside-";
|
||||
if (insideIntPt == kOutside)
|
||||
solidResponse = "-kOutside-";
|
||||
else if (insideIntPt == kSurface)
|
||||
solidResponse = "-kSurface-";
|
||||
if( fVerbose == 1 )
|
||||
{
|
||||
G4cout << "*** G4VoxelNavigation::ComputeStep(): ***"<<G4endl
|
||||
<< " Invoked Inside() for solid: "
|
||||
<< sampleSolid->GetName()
|
||||
<< ". Solid replied: " << solidResponse << G4endl
|
||||
<< " For point p: " << intersectionPoint
|
||||
<< ", considered as 'intersection' point." << G4endl;
|
||||
}
|
||||
if( insideIntPt != kSurface )
|
||||
{
|
||||
G4int oldcoutPrec = G4cout.precision(16);
|
||||
@@ -218,14 +264,8 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
<< " Inaccurate solid DistanceToIn"
|
||||
<< " for solid " << sampleSolid->GetName() << G4endl;
|
||||
G4cout << " Solid gave DistanceToIn = "
|
||||
<< sampleStep << " yet returns " ;
|
||||
if( insideIntPt == kInside )
|
||||
G4cout << "-kInside-";
|
||||
else if( insideIntPt == kOutside )
|
||||
G4cout << "-kOutside-";
|
||||
else
|
||||
G4cout << "-kSurface-";
|
||||
G4cout << " for this point !" << G4endl;
|
||||
<< sampleStep << " yet returns " << solidResponse
|
||||
<< " for this point !" << G4endl;
|
||||
G4cout << " Point = " << intersectionPoint << G4endl;
|
||||
if ( insideIntPt != kInside )
|
||||
G4cout << " DistanceToIn(p) = "
|
||||
@@ -277,7 +317,18 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
localDirection,
|
||||
true, &validExitNormal, &exitNormal);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fCheck )
|
||||
if ( fCheck )
|
||||
{
|
||||
if(fVerbose == 1)
|
||||
{
|
||||
G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
|
||||
<< " Invoked DistanceToOut(p,v,...) for mother solid: "
|
||||
<< motherSolid->GetName()
|
||||
<< ". Solid replied: " << motherStep << G4endl
|
||||
<< " For local point p: " << localPoint << G4endl
|
||||
<< " Direction v: " << localDirection
|
||||
<< ", to be considered as 'mother step'." << G4endl;
|
||||
}
|
||||
if( ( motherStep < 0.0 ) || ( motherStep >= kInfinity) )
|
||||
{
|
||||
G4int oldPrOut= G4cout.precision(16);
|
||||
@@ -294,6 +345,7 @@ G4VoxelNavigation::ComputeStep( const G4ThreeVector& localPoint,
|
||||
G4cout.precision(oldPrOut);
|
||||
G4cerr.precision(oldPrErr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if ( motherStep<=ourStep )
|
||||
{
|
||||
@@ -620,6 +672,17 @@ G4VoxelNavigation::ComputeSafety(const G4ThreeVector& localPoint,
|
||||
motherSafety = motherSolid->DistanceToOut(localPoint);
|
||||
ourSafety = motherSafety; // Working isotropic safety
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if(( fCheck ) && ( fVerbose == 1 ))
|
||||
{
|
||||
G4cout << "*** G4VoxelNavigation::ComputeSafety(): ***" << G4endl
|
||||
<< " Invoked DistanceToOut(p) for mother solid: "
|
||||
<< motherSolid->GetName()
|
||||
<< ". Solid replied: " << motherSafety << G4endl
|
||||
<< " For local point p: " << localPoint
|
||||
<< ", to be considered as 'mother safety'." << G4endl;
|
||||
}
|
||||
#endif
|
||||
//
|
||||
// Compute daughter safeties
|
||||
//
|
||||
@@ -648,6 +711,17 @@ G4VoxelNavigation::ComputeSafety(const G4ThreeVector& localPoint,
|
||||
{
|
||||
ourSafety = sampleSafety;
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if(( fCheck ) && ( fVerbose == 1 ))
|
||||
{
|
||||
G4cout << "*** G4VoxelNavigation::ComputeSafety(): ***" << G4endl
|
||||
<< " Invoked DistanceToIn(p) for daughter solid: "
|
||||
<< sampleSolid->GetName()
|
||||
<< ". Solid replied: " << sampleSafety << G4endl
|
||||
<< " For local point p: " << samplePoint
|
||||
<< ", to be considered as 'daughter safety'." << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
voxelSafety = ComputeVoxelSafety(localPoint);
|
||||
if ( voxelSafety<ourSafety )
|
||||
|
||||
Reference in New Issue
Block a user