Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AuxiliaryNavServices.hh,v 1.4 2007-05-22 07:48:08 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4AuxiliaryNavServices
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AuxiliaryNavServices.icc,v 1.4 2007-05-22 07:48:08 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4AuxiliaryNavServices Inline implementation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4BrentLocator.hh,v 1.2 2008-10-29 14:31:55 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// Class G4BrentLocator
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DrawVoxels.hh,v 1.3 2006-06-29 18:35:36 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4DrawVoxels
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ErrorPropagationNavigator.hh,v 1.2 2008-10-24 14:00:03 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// --------------------------------------------------------------------
@@ -64,7 +63,7 @@ class G4ErrorPropagationNavigator : public G4Navigator
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4double pProposedMaxLength = DBL_MAX,
const G4bool keepState = false);
const G4bool keepState = true);
// Calls the navigation in the detector geometry and then checks
// if the distance to surface is smaller than the proposed safety
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestErrorList.hh,v 1.3 2006-06-29 18:35:38 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestLogger.hh,v 1.3 2006-06-29 18:35:40 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestOverlapList.hh,v 1.3 2006-06-29 18:35:43 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestOvershootList.hh,v 1.3 2006-06-29 18:35:45 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestPoint.hh,v 1.3 2006-06-29 18:35:48 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestSegment.hh,v 1.4 2007-05-11 13:43:59 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestStreamLogger.hh,v 1.3 2006-06-29 18:35:52 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestVolPoint.hh,v 1.3 2006-06-29 18:35:55 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeomTestVolume.hh,v 1.3 2006-06-29 18:35:57 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -58,7 +57,7 @@ class G4GeomTestVolume
G4GeomTestVolume( const G4VPhysicalVolume *theTarget,
G4GeomTestLogger *theLogger,
G4double theTolerance=1E-4*mm );
G4double theTolerance=1E-4 ); // mm
~G4GeomTestVolume();
// Constructor and destructor
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeometryMessenger.hh,v 1.5 2010-11-10 14:06:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4MultiLevelLocator.hh,v 1.3 2010-07-13 15:59:42 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// Class G4MultiLevelLocator
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4MultiNavigator.hh,v 1.5 2008-10-24 14:00:03 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4MultiNavigator
@@ -106,7 +105,7 @@ class G4MultiNavigator : public G4Navigator
//
// Important Note: In order to call this the geometry MUST be closed.
void LocateGlobalPointWithinVolume(const G4ThreeVector& position);
void LocateGlobalPointWithinVolume(const G4ThreeVector& position);
// Relocate in all geometries for point that has not changed volume
// (ie is within safety in all geometries or is distance less that
// along the direction of a computed step.
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4NavigationLogger.hh,v 1.1 2010-11-04 08:57:56 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4NavigationLogger
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Navigator.hh,v 1.34 2010-12-15 13:46:39 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4Navigator
@@ -181,14 +180,16 @@ class G4Navigator
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4double pProposedMaxLength = DBL_MAX,
const G4bool keepState = false);
const G4bool keepState = true);
// Calculate the isotropic distance to the nearest boundary from the
// specified point in the global coordinate system.
// The globalpoint utilised must be within the current volume.
// The value returned is usually an underestimate.
// The proposed maximum length is used to avoid volume safety
// calculations. The geometry must be closed.
// calculations. The geometry must be closed.
// To ensure minimum side effects from the call, keepState
// must be true.
inline G4VPhysicalVolume* GetWorldVolume() const;
// Return the current world (`topmost') volume.
@@ -277,13 +278,6 @@ class G4Navigator
// Values: 1 (small problem), 5 (correcting),
// 9 (ready to abandon), 10 (abandoned)
void SetSavedState();
// ( fValidExitNormal, fExitNormal, fExiting, fEntering,
// fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero);
void RestoreSavedState();
// Copy aspects of the state, to enable a non-state changing
// call to ComputeStep
inline G4ThreeVector GetCurrentLocalCoordinate() const;
// Return the local coordinate of the point in the reference system
// of its containing volume that was found by LocalGlobalPointAndSetup.
@@ -298,6 +292,21 @@ class G4Navigator
protected: // with description
void SetSavedState();
// ( fValidExitNormal, fExitNormal, fExiting, fEntering,
// fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero);
// Extended to include:
// ( fLastLocatedPointLocal, fLocatedOutsideWorld;
// fEnteredDaughter, fExitedMother
// fPreviousSftOrigin, sPreviousSafety) Safety Sphere.
void RestoreSavedState();
// Copy aspects of the state, to enable a non-state changing
// call to ComputeStep().
virtual void ResetState();
// Utility method to reset the navigator state machine.
inline G4ThreeVector ComputeLocalPoint(const G4ThreeVector& rGlobPoint) const;
// Return position vector in local coordinate system, given a position
// vector in world coordinate system.
@@ -307,9 +316,6 @@ class G4Navigator
// system of the volume that was found by LocalGlobalPointAndSetup.
// The Local Coordinates of point in world coordinate system.
virtual void ResetState();
// Utility method to reset the navigator state machine.
inline EVolume VolumeType(const G4VPhysicalVolume *pVol) const;
// Characterise `type' of volume - normal/replicated/parameterised.
@@ -401,7 +407,14 @@ class G4Navigator
// volume's coordinate system
G4ThreeVector fGrandMotherExitNormal; // Leaving volume normal, in its
// own coordinate system
G4bool fChangedGrandMotherRefFrame; // Whether frame is changed
G4ThreeVector fExitNormalGlobalFrame; // Leaving volume normal, in the
// global coordinate system
G4bool fCalculatedExitNormal; // Has it been computed since
// the last call to ComputeStep
// Covers both Global and GrandMother
// 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
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Navigator.icc,v 1.18 2010-12-15 13:46:39 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4Navigator Inline implementation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4NormalNavigation.hh,v 1.6 2010-11-04 08:57:56 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4NormalNavigation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4NormalNavigation.icc,v 1.5 2010-11-04 08:57:56 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// G4NormalNavigation Inline Implementation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParameterisedNavigation.hh,v 1.6 2007-11-09 16:06:02 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4ParameterisedNavigation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParameterisedNavigation.icc,v 1.7 2007-11-09 16:06:02 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4ParameterisedNavigation Inline implementation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PartialPhantomParameterisation.hh,v 1.2 2010-11-10 11:20:45 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4PartialPhantomParameterisation
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PathFinder.hh,v 1.35 2010-07-13 15:59:42 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4PathFinder
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PhantomParameterisation.hh,v 1.6 2010-11-09 15:43:15 arce Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4PhantomParameterisation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PhantomParameterisation.icc,v 1.1 2007-10-17 19:13:58 arce Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//--------------------------------------------------------------------
inline
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PropagatorInField.hh,v 1.19 2009-11-13 17:34:26 japost Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// Class G4PropagatorInField
@@ -152,8 +151,8 @@ class G4PropagatorInField
inline G4bool GetUseSafetyForOptimization();
// Toggle & view parameter for using safety to discard
// unneccesary calls to navigator (thus 'optimising' performance)
inline G4bool IntersectChord( G4ThreeVector StartPointA,
G4ThreeVector EndPointB,
inline G4bool IntersectChord( const G4ThreeVector& StartPointA,
const G4ThreeVector& EndPointB,
G4double &NewSafety,
G4double &LinearStepLength,
G4ThreeVector &IntersectionPoint);
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PropagatorInField.icc,v 1.16 2009-11-13 17:34:26 japost Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// ------------------------------------------------------------------------
@@ -275,8 +274,8 @@ G4VIntersectionLocator* G4PropagatorInField::GetIntersectionLocator()
}
inline
G4bool G4PropagatorInField::IntersectChord( G4ThreeVector StartPointA,
G4ThreeVector EndPointB,
G4bool G4PropagatorInField::IntersectChord( const G4ThreeVector& StartPointA,
const G4ThreeVector& EndPointB,
G4double &NewSafety,
G4double &LinearStepLength,
G4ThreeVector &IntersectionPoint )
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RegularNavigation.hh,v 1.4 2010-09-03 16:29:43 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4RegularNavigation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RegularNavigationHelper.hh,v 1.1 2009-01-27 09:31:29 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -48,14 +47,18 @@
class G4RegularNavigationHelper
{
public:
G4RegularNavigationHelper();
static G4RegularNavigationHelper * Instance();
~G4RegularNavigationHelper();
static void ClearStepLengths();
static void AddStepLength( G4int copyNo, G4double slen );
void ClearStepLengths();
void AddStepLength( G4int copyNo, G4double slen );
const std::vector< std::pair<G4int,G4double> > & GetStepLengths();
static std::vector< std::pair<G4int,G4double> > theStepLengths;
std::vector< std::pair<G4int,G4double> > theStepLengths;
private:
G4RegularNavigationHelper();
static G4RegularNavigationHelper * theInstance;
};
#endif
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ReplicaNavigation.hh,v 1.6 2007-05-18 07:31:09 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4ReplicaNavigation
@@ -42,6 +41,8 @@
#ifndef G4REPLICANAVIGATION_HH
#define G4REPLICANAVIGATION_HH
#include <CLHEP/Units/SystemOfUnits.h>
#include "G4Types.hh"
#include "G4NavigationHistory.hh"
#include "G4LogicalVolume.hh"
@@ -55,97 +56,128 @@
class G4VSolid;
struct G4ExitNormal
{
// Bucket to hold value of Normal (3-vector),
// bools for calculated and leave-behind or 'validConvex',
// and exiting side.
enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPX,kMX,kPY,kMY,kPZ,kMZ,kMother};
// Identity of 'Side' of Replicas. Used by DistanceToOut methods.
G4ThreeVector exitNormal;
G4bool calculated; // Normal
G4bool validConvex; // Solid locally convex
ESide exitSide;
public:
G4ExitNormal(G4ThreeVector norm = G4ThreeVector(0.,0.,0.),
G4bool calc = false,
G4bool valid= false,
ESide side = kNull )
{ exitNormal= norm; calculated= calc; validConvex=valid; exitSide=side;}
};
class G4ReplicaNavigation
{
friend class G4ReplicaNavigationTester;
public: // with description
public: // with description
G4ReplicaNavigation();
~G4ReplicaNavigation();
G4ReplicaNavigation();
~G4ReplicaNavigation();
inline G4bool LevelLocate( G4NavigationHistory& history,
const G4VPhysicalVolume *blockedVol,
const G4int blockedNum,
const G4ThreeVector &globalPoint,
const G4ThreeVector* globalDirection,
const G4bool pLocatedOnEdge,
G4ThreeVector &localPoint );
inline G4bool LevelLocate( G4NavigationHistory& history,
const G4VPhysicalVolume *blockedVol,
const G4int blockedNum,
const G4ThreeVector &globalPoint,
const G4ThreeVector* globalDirection,
const G4bool pLocatedOnEdge,
G4ThreeVector &localPoint );
G4double ComputeStep( const G4ThreeVector &globalPoint,
const G4ThreeVector &globalDirection,
const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double currentProposedStepLength,
G4double &newSafety,
G4NavigationHistory &history,
G4bool &validExitNormal,
G4ThreeVector &exitNormal,
G4bool &exiting,
G4bool &entering,
G4VPhysicalVolume *(*pBlockedPhysical),
G4int &blockedReplicaNo );
G4double ComputeSafety( const G4ThreeVector &globalPoint,
G4double ComputeStep( const G4ThreeVector &globalPoint,
const G4ThreeVector &globalDirection,
const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double currentProposedStepLength,
G4double &newSafety,
G4NavigationHistory &history,
const G4double pProposedMaxLength=DBL_MAX );
G4bool &validExitNormal,
G4bool &calculatedExitNormal,
G4ThreeVector &exitNormal,
G4bool &exiting,
G4bool &entering,
G4VPhysicalVolume *(*pBlockedPhysical),
G4int &blockedReplicaNo );
EInside BackLocate( G4NavigationHistory &history,
const G4ThreeVector &globalPoint,
G4ThreeVector &localPoint,
const G4bool &exiting,
G4bool &notKnownInside ) const;
void ComputeTransformation( const G4int replicaNo,
G4VPhysicalVolume *pVol,
G4ThreeVector &point ) const;
void ComputeTransformation( const G4int replicaNo,
G4VPhysicalVolume *pVol ) const;
EInside Inside( const G4VPhysicalVolume *pVol,
const G4int replicaNo,
const G4ThreeVector &localPoint ) const;
G4double DistanceToOut( const G4VPhysicalVolume *pVol,
const G4int replicaNo,
const G4ThreeVector &localPoint ) const;
G4double DistanceToOut( const G4VPhysicalVolume *pVol,
const G4int replicaNo,
const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection ) const;
inline G4int GetVerboseLevel() const;
inline void SetVerboseLevel(G4int level);
// Get/Set Verbose(ness) level.
// [if level>0 && G4VERBOSE, printout can occur]
inline void CheckMode(G4bool mode);
// Run navigation in "check-mode", therefore using additional
// verifications and more strict correctness conditions.
// Is effective only with G4VERBOSE set.
private:
inline G4int VoxelLocate( const G4SmartVoxelHeader *pHead,
G4double ComputeSafety( const G4ThreeVector &globalPoint,
const G4ThreeVector &localPoint,
const G4int blocked=-1 ) const;
G4NavigationHistory &history,
const G4double pProposedMaxLength=DBL_MAX );
G4double DistanceToOutPhi( const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double width ) const;
EInside BackLocate( G4NavigationHistory &history,
const G4ThreeVector &globalPoint,
G4ThreeVector &localPoint,
const G4bool &exiting,
G4bool &notKnownInside ) const;
G4double DistanceToOutRad( const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double width,
const G4double offset,
const G4int replicaNo ) const;
inline void SetPhiTransformation( const G4double ang,
G4VPhysicalVolume *pVol=0 ) const;
private:
void ComputeTransformation( const G4int replicaNo,
G4VPhysicalVolume *pVol,
G4ThreeVector &point ) const;
void ComputeTransformation( const G4int replicaNo,
G4VPhysicalVolume *pVol ) const;
EInside Inside( const G4VPhysicalVolume *pVol,
const G4int replicaNo,
const G4ThreeVector &localPoint ) const;
G4double DistanceToOut( const G4VPhysicalVolume *pVol,
const G4int replicaNo,
const G4ThreeVector &localPoint ) const;
G4double DistanceToOut( const G4VPhysicalVolume *pVol,
const G4int replicaNo,
const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
G4ExitNormal& candidateNormal ) const;
inline G4int GetVerboseLevel() const;
inline void SetVerboseLevel(G4int level);
// Get/Set Verbose(ness) level.
// [if level>0 && G4VERBOSE, printout can occur]
inline void CheckMode(G4bool mode);
// Run navigation in "check-mode", therefore using additional
// verifications and more strict correctness conditions.
// Is effective only with G4VERBOSE set.
private:
inline G4int VoxelLocate( const G4SmartVoxelHeader *pHead,
const G4ThreeVector &localPoint,
const G4int blocked=-1 ) const;
G4double DistanceToOutPhi( const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double width,
G4ExitNormal& foundNormal ) const;
G4double DistanceToOutRad( const G4ThreeVector &localPoint,
const G4ThreeVector &localDirection,
const G4double width,
const G4double offset,
const G4int replicaNo,
G4ExitNormal& foundNormal ) const;
inline void SetPhiTransformation( const G4double ang,
G4VPhysicalVolume *pVol=0 ) const;
private:
// Invariants - unaltered during navigation
// **********
G4bool fCheck;
G4int fVerbose;
// Configuration parameters
G4double kCarTolerance, kRadTolerance, kAngTolerance;
// Local copy of constants
};
#include "G4ReplicaNavigation.icc"
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ReplicaNavigation.icc,v 1.5 2006-06-29 18:36:22 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4ReplicaNavigation Inline implementation
@@ -71,7 +70,7 @@ G4ReplicaNavigation::VoxelLocate( const G4SmartVoxelHeader* pHead,
break;
case kPhi:
coord = localPoint.phi();
if ( (coord<0) && (coord<targetHeaderMin) ) coord += 2.0*pi;
if ( (coord<0) && (coord<targetHeaderMin) ) coord += CLHEP::twopi;
break;
case kRadial3D:
default:
@@ -89,12 +88,6 @@ G4ReplicaNavigation::VoxelLocate( const G4SmartVoxelHeader* pHead,
// voxel & it is blocked => should have exited mother
// (or similar) P.Kent
// assert(targetNodeNo>=0&&targetNodeNo<targetHeaderNoSlices);
//
// The assert above fails for simulation of high energy electrons
// It is not clear what is the cause for this failure.
// The code below attempts to rectify this problem until a
// complete resolution is possible.
// J.Apostolakis, June 12, 1998
if( (targetNodeNo<0) || (targetNodeNo>=targetHeaderNoSlices) )
{
@@ -111,7 +104,7 @@ G4ReplicaNavigation::VoxelLocate( const G4SmartVoxelHeader* pHead,
// the last voxel to the zeroth and vice versa
// H.Boie, April 30, 2001
if ( (targetHeaderAxis==kPhi)
&& (targetHeaderMin==0) && (targetHeaderMax==2*pi) )
&& (targetHeaderMin==0) && (targetHeaderMax==CLHEP::twopi) )
{
if ( targetNodeNo<0 )
targetNodeNo = targetHeaderNoSlices-1;
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SafetyHelper.hh,v 1.7 2007-05-02 15:32:13 japost Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4SafetyHelper
@@ -67,9 +66,14 @@ public: // with description
//
// Return linear step for mass geometry
G4double ComputeSafety( const G4ThreeVector& pGlobalPoint );
G4double ComputeSafety( const G4ThreeVector& pGlobalPoint,
G4double maxRadius=DBL_MAX ); // Radius of interest
//
// Return safety for all geometries
// Return safety for all geometries.
//
// The 2nd argument is the radius of your interest (e.g. maximum displacement )
// Giving this you can reduce the average computational cost.
// If the second argument is not given, this is the real isotropic safety
void Locate(const G4ThreeVector& pGlobalPoint,
const G4ThreeVector& direction);
@@ -89,6 +93,8 @@ public: // with description
//
// Check for new navigator for tracking, and reinitialise pointer
G4int SetVerboseLevel( G4int lev ) { G4int oldlv= fVerbose; fVerbose= lev; return oldlv; }
inline G4VPhysicalVolume* GetWorldVolume();
inline void SetCurrentSafety(G4double val, const G4ThreeVector& pos);
@@ -106,6 +112,8 @@ private:
// Flag whether to use PathFinder or single (mass) Navigator directly
G4bool fFirstCall;
// Flag of first call
G4int fVerbose;
// Whether to print warning in case of move outside safety
// State used during tracking -- for optimisation
G4ThreeVector fLastSafetyPosition;
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SimpleLocator.hh,v 1.2 2008-10-29 14:31:55 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// Class G4SimpleLocator
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4TransportationManager.hh,v 1.12 2007-04-20 15:28:37 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4TransportationManager
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4TransportationManager.icc,v 1.10 2007-04-20 15:28:37 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
// ------------------------------------------------------------
// GEANT 4 inlined function members implementation
// ------------------------------------------------------------
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VIntersectionLocator.hh,v 1.6 2009-11-30 11:39:15 japost Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// Class G4VIntersectionLocator
@@ -84,8 +83,8 @@ class G4VIntersectionLocator
G4int step);
// Print Method, useful mostly for debugging
inline G4bool IntersectChord( G4ThreeVector StartPointA,
G4ThreeVector EndPointB,
inline G4bool IntersectChord( const G4ThreeVector& StartPointA,
const G4ThreeVector& EndPointB,
G4double &NewSafety,
G4double &PreviousSafety, // In/Out
G4ThreeVector &PreviousSftOrigin, // In/Out
@@ -179,7 +178,7 @@ class G4VIntersectionLocator
G4bool &validNormal);
// Return the SurfaceNormal of Intersecting Solid in local coordinates
G4ThreeVector GetLastSurfaceNormal( G4ThreeVector intersectPoint,
G4ThreeVector GetLastSurfaceNormal( const G4ThreeVector& intersectPoint,
G4bool &validNormal) const;
// Position *must* be the intersection point from last call
// to G4Navigator's ComputeStep (via IntersectChord )
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VIntersectionLocator.icc,v 1.3 2008-11-14 18:26:35 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// Class G4VIntersectionLocator inline methods
@@ -101,8 +100,8 @@ inline void G4VIntersectionLocator::SetVerboseFor(G4int fVerbose)
}
inline G4bool
G4VIntersectionLocator::IntersectChord( G4ThreeVector StartPointA,
G4ThreeVector EndPointB,
G4VIntersectionLocator::IntersectChord( const G4ThreeVector& StartPointA,
const G4ThreeVector& EndPointB,
G4double &NewSafety,
G4double &PreviousSafety,
G4ThreeVector &PreviousSftOrigin,
@@ -138,18 +137,23 @@ G4VIntersectionLocator::IntersectChord( G4ThreeVector StartPointA,
LinearStepLength = ChordAB_Length;
intersects = false;
NewSafety= currentSafety;
CalledNavigator= false;
CalledNavigator= false;
// G4cout << " IntersectChord> Step 'guaranteed' taken: safety= " << currentSafety << " chordAB-len= " << ChordAB_Length << G4endl;
}
else
{
// G4cout << " IntersectChord> Step asking Navigator: safety= " << currentSafety << " chordAB-len= " << ChordAB_Length << G4endl;
// Check whether any volumes are encountered by the chord AB
LinearStepLength = GetNavigatorFor()->ComputeStep( StartPointA,
ChordAB_Dir, ChordAB_Length, NewSafety );
intersects = (LinearStepLength <= ChordAB_Length);
// G4Navigator contracts to return k_infinity if len==asked
// and it did not find a surface boundary at that length
// G4cout << "G4VIntersectionLocator: intersect= " << intersects
// << " step= " << LinearStepLength << " Chord length= " << ChordAB_Length;
LinearStepLength = std::min( LinearStepLength, ChordAB_Length);
CalledNavigator = true;
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VoxelNavigation.hh,v 1.8 2010-11-04 12:13:30 japost Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4VoxelNavigation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VoxelNavigation.icc,v 1.7 2010-11-04 17:38:17 japost Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4VoxelNavigation Inline implementation
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VoxelSafety.hh,v 1.2 2010-11-04 17:32:46 japost Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4VoxelSafety
//
@@ -49,11 +48,7 @@
#include "G4BlockingList.hh"
// #include "G4AuxiliaryNavServices.hh"
// Required for voxel handling & voxel stack
//
#include <vector>
#include <vector> // Required for voxel handling & voxel stack
class G4SmartVoxelNode;
class G4SmartVoxelHeader;
@@ -74,33 +69,35 @@ class G4VoxelSafety
inline G4int GetVerboseLevel() const { return fVerbose; }
inline void SetVerboseLevel(G4int level) { fVerbose= level; }
// Get/Set Verbose(ness) level.
// [if level>0 && G4VERBOSE, printout can occur]
// inline void CheckMode(G4bool mode);
// Make extra checks
//
// If level>0 && G4VERBOSE, printout can occur
protected:
G4double SafetyForVoxelHeader( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint );
G4double SafetyForVoxelNode( G4SmartVoxelNode *curVoxelNode,
G4double SafetyForVoxelHeader( const G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint,
G4double maxLength,
const G4VPhysicalVolume& currentPhysical,
G4double distUpperDepth = 0.0,
G4double previousMinSafety= DBL_MAX
);
G4double SafetyForVoxelNode( const G4SmartVoxelNode *curVoxelNode,
const G4ThreeVector& localPoint );
G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint ) const;
private:
// BEGIN State
// - values used during computation of Safety
private:
// BEGIN State - values used during computation of Safety
//
G4BlockingList fBlockList;
// Blocked volumes
G4LogicalVolume* fpMotherLogical;
//
// BEGIN Voxel Stack information
//
G4int fVoxelDepth;
// Note: fVoxelDepth==0+ => fVoxelAxisStack(0+) contains axes of voxel
// fVoxelDepth==-1 -> not in voxel
@@ -117,7 +114,7 @@ class G4VoxelSafety
std::vector<G4int> fVoxelNodeNoStack;
// Node no point is inside at each level
std::vector<G4SmartVoxelHeader*> fVoxelHeaderStack;
std::vector<const G4SmartVoxelHeader*> fVoxelHeaderStack;
// Voxel headers at each level
G4SmartVoxelNode* fVoxelNode;
@@ -125,13 +122,10 @@ class G4VoxelSafety
//
// END Voxel Stack information
//
G4bool fCheck;
G4int fVerbose;
G4double kCarTolerance;
};
// #include "G4VoxelSafety.icc"
#endif