Import Geant4 9.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:25:56 +02:00
parent 74cad5e589
commit 89a9605df1
4440 changed files with 379508 additions and 189225 deletions
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4GeometryMessenger.hh,v 1.4 2006/06/29 18:35:59 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4GeometryMessenger.hh,v 1.5 2010/11/10 14:06:40 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -77,6 +77,7 @@ class G4GeometryMessenger : public G4UImessenger
void ResetNavigator();
void SetVerbosity(G4String newValue);
void SetCheckMode(G4String newValue);
void SetPushFlag(G4String newValue);
void LineTest();
void RecursiveLineTest();
void GridTest();
@@ -87,7 +88,8 @@ class G4GeometryMessenger : public G4UImessenger
G4UIdirectory *geodir, *navdir, *testdir;
G4UIcmdWith3VectorAndUnit *posCmd, *dirCmd;
G4UIcmdWith3Vector *grzCmd, *cyzCmd;
G4UIcmdWithABool *chkCmd, *linCmd, *grdCmd, *cylCmd, *runCmd;
G4UIcmdWithABool *chkCmd, *pchkCmd, *linCmd,
*grdCmd, *cylCmd, *runCmd;
G4UIcmdWithoutParameter *recCmd, *resCmd;
G4UIcmdWithADoubleAndUnit *tolCmd;
G4UIcmdWithAnInteger *verbCmd, *rcsCmd, *rcdCmd;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4MultiLevelLocator.hh,v 1.2 2008/10/29 14:31:55 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4MultiLevelLocator.hh,v 1.3 2010/07/13 15:59:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// Class G4MultiLevelLocator
@@ -77,11 +77,6 @@ class G4MultiLevelLocator : public G4VIntersectionLocator
G4FieldTrack* ptrInterMedFT[max_depth+1];
// Used to store intermediate tracks values in case of too slow progress
G4int maxNumberOfStepsForIntersection;
G4int maxNumberOfCallsToReIntegration;
G4int maxNumberOfCallsToReIntegration_depth;
// Counters for Statistics about Location and ReIntegrations
};
#endif
@@ -0,0 +1,90 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4NavigationLogger.hh,v 1.1 2010/11/04 08:57:56 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4NavigationLogger
//
// Class description:
//
// Simple utility class for use by navigation systems
// for verbosity and check-mode.
// History:
// - Created. Gabriele Cosmo, November 2010
// --------------------------------------------------------------------
#ifndef G4NAVIGATIONLOGGER_HH
#define G4NAVIGATIONLOGGER_HH
#include "G4NavigationHistory.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
#include "G4ThreeVector.hh"
class G4NavigationLogger
{
public: // with description
G4NavigationLogger(const G4String& id);
~G4NavigationLogger();
void PreComputeStepLog (const G4VPhysicalVolume* motherPhysical,
G4double motherSafety,
const G4ThreeVector& localPoint) const;
void AlongComputeStepLog(const G4VSolid* sampleSolid,
const G4ThreeVector& samplePoint,
const G4ThreeVector& sampleDirection,
const G4ThreeVector& localDirection,
G4double sampleSafety,
G4double sampleStep) const;
void PostComputeStepLog (const G4VSolid* motherSolid,
const G4ThreeVector& localPoint,
const G4ThreeVector& localDirection,
G4double motherStep,
G4double motherSafety) const;
void ComputeSafetyLog (const G4VSolid* solid,
const G4ThreeVector& point,
G4double safety,
G4bool banner) const;
void PrintDaughterLog (const G4VSolid* sampleSolid,
const G4ThreeVector& samplePoint,
G4double sampleSafety,
G4double sampleStep) const;
public: // without description
inline G4int GetVerboseLevel() const { return fVerbose; }
inline void SetVerboseLevel(G4int level) { fVerbose = level; }
private:
G4String fId; // Navigation type
G4int fVerbose; // Verbosity level
};
#endif
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Navigator.hh,v 1.29 2009/11/30 11:59:52 japost Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4Navigator.hh,v 1.34 2010/12/15 13:46:39 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4Navigator
@@ -199,6 +199,7 @@ class G4Navigator
inline G4GRSVolume* CreateGRSVolume() const;
inline G4GRSSolid* CreateGRSSolid() const;
inline G4TouchableHistory* CreateTouchableHistory() const;
inline G4TouchableHistory* CreateTouchableHistory(const G4NavigationHistory*) const;
// `Touchable' creation methods: caller has deletion responsibility.
virtual G4TouchableHistoryHandle CreateTouchableHistoryHandle() const;
@@ -240,7 +241,9 @@ class G4Navigator
// Run navigation in "check-mode", therefore using additional
// verifications and more strict correctness conditions.
// Is effective only with G4VERBOSE set.
inline G4bool IsCheckModeActive() { return fCheck; }
inline G4bool IsCheckModeActive() const;
inline void SetPushVerbosity(G4bool mode);
// Set/unset verbosity for pushed tracks (default is true).
void PrintState() const;
// Print the internal state of the Navigator (for debugging).
@@ -262,17 +265,13 @@ class G4Navigator
// Values: 1 (small problem), 5 (correcting),
// 9 (ready to abandon), 10 (abandoned)
// inline
void SetSavedState();
// ( fValidExitNormal, fExitNormal, fExiting, fEntering,
// fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero);
// inline
// ( fValidExitNormal, fExitNormal, fExiting, fEntering,
// fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero);
void RestoreSavedState();
// Copy aspects of the state, to enable a non-state changing
// call to ComputeStep
public: // with description
inline G4ThreeVector GetCurrentLocalCoordinate() const;
// Return the local coordinate of the point in the reference system
// of its containing volume that was found by LocalGlobalPointAndSetup.
@@ -282,7 +281,11 @@ class G4Navigator
inline G4RotationMatrix NetRotation() const;
// Compute+return the local->global translation/rotation of current volume.
inline void EnableBestSafety( G4bool value= false );
// Enable best-possible evaluation of isotropic safety
protected: // with description
inline G4ThreeVector ComputeLocalPoint(const G4ThreeVector& rGlobPoint) const;
// Return position vector in local coordinate system, given a position
// vector in world coordinate system.
@@ -310,6 +313,12 @@ class G4Navigator
// o Recompute transforms and/or solids of replicated/parameterised
// volumes.
private:
void ComputeStepLog(const G4ThreeVector& pGlobalpoint,
G4double moveLenSq) const;
// Log and checks for steps larger than the tolerance
protected: // without description
G4double kCarTolerance;
@@ -433,8 +442,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].
G4bool fPushed, fWarnPush;
// Push flags [if true, means a stuck particle has been pushed].
// Helpers/Utility classes
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Navigator.icc,v 1.15 2007/10/18 14:18:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4Navigator.icc,v 1.18 2010/12/15 13:46:39 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4Navigator Inline implementation
@@ -306,6 +306,19 @@ G4TouchableHistory* G4Navigator::CreateTouchableHistory() const
return new G4TouchableHistory(fHistory);
}
// ********************************************************************
// CreateTouchableHistory(history)
//
// `Touchable' creation method: caller has deletion responsibility
// ********************************************************************
//
inline
G4TouchableHistory*
G4Navigator::CreateTouchableHistory(const G4NavigationHistory* history) const
{
return new G4TouchableHistory(*history);
}
// ********************************************************************
// LocateGlobalPointAndUpdateTouchableHandle
// ********************************************************************
@@ -448,6 +461,26 @@ void G4Navigator::CheckMode(G4bool mode)
fregularNav.CheckMode(mode);
}
// ********************************************************************
// IsCheckModeActive
// ********************************************************************
//
inline
G4bool G4Navigator::IsCheckModeActive() const
{
return fCheck;
}
// ********************************************************************
// SetPushVerbosity
// ********************************************************************
//
inline
void G4Navigator::SetPushVerbosity(G4bool mode)
{
fWarnPush = mode;
}
// ********************************************************************
// SeverityOfZeroStepping
//
@@ -484,3 +517,12 @@ G4int G4Navigator::SeverityOfZeroStepping( G4int* noZeroSteps ) const
}
return severity;
}
// ********************************************************************
// EnableBestSafety
// ********************************************************************
//
inline void G4Navigator::EnableBestSafety( G4bool value )
{
fvoxelNav.EnableBestSafety( value );
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4NormalNavigation.hh,v 1.4 2006/06/29 18:36:06 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4NormalNavigation.hh,v 1.6 2010/11/04 08:57:56 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4NormalNavigation
@@ -41,7 +41,10 @@
#ifndef G4NORMALNAVIGATION_HH
#define G4NORMALNAVIGATION_HH
#include <iomanip>
#include "G4NavigationHistory.hh"
#include "G4NavigationLogger.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
@@ -88,7 +91,7 @@ class G4NormalNavigation
const G4NavigationHistory &history,
const G4double pMaxLength=DBL_MAX );
inline G4int GetVerboseLevel();
inline G4int GetVerboseLevel() const;
inline void SetVerboseLevel(G4int level);
// Get/Set Verbose(ness) level.
// [if level>0 && G4VERBOSE, printout can occur]
@@ -101,7 +104,7 @@ class G4NormalNavigation
private:
G4bool fCheck;
G4int fVerbose;
G4NavigationLogger* fLogger;
};
#include "G4NormalNavigation.icc"
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4NormalNavigation.icc,v 1.4 2006/06/29 18:36:08 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4NormalNavigation.icc,v 1.5 2010/11/04 08:57:56 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// G4NormalNavigation Inline Implementation
@@ -93,18 +93,30 @@ G4NormalNavigation::LevelLocate( G4NavigationHistory& history,
return found;
}
// ********************************************************************
// GetVerboseLevel
// ********************************************************************
//
inline
G4int G4NormalNavigation::GetVerboseLevel()
G4int G4NormalNavigation::GetVerboseLevel() const
{
return fVerbose;
return fLogger->GetVerboseLevel();
}
// ********************************************************************
// SetVerboseLevel
// ********************************************************************
//
inline
void G4NormalNavigation::SetVerboseLevel(G4int level)
{
fVerbose = level;
fLogger->SetVerboseLevel(level);
}
// ********************************************************************
// CheckMode
// ********************************************************************
//
inline
void G4NormalNavigation::CheckMode(G4bool mode)
{
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PartialPhantomParameterisation.hh,v 1.2 2010/11/10 11:20:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4PartialPhantomParameterisation
//
// Class description:
//
// Describes partial regular parameterisations, i.e. the voxels do not
// completely fill the container in the three dimensions
// History:
// - Created. P. Arce, September 2010
// *********************************************************************
#ifndef G4PartialPhantomParameterisation_HH
#define G4PartialPhantomParameterisation_HH
#include <vector>
#include <set>
#include <map>
#include "G4Types.hh"
#include "G4PhantomParameterisation.hh"
#include "G4AffineTransform.hh"
class G4VPhysicalVolume;
class G4VTouchable;
class G4VSolid;
class G4Material;
class G4PartialPhantomParameterisation : public G4PhantomParameterisation
{
public: // with description
G4PartialPhantomParameterisation();
~G4PartialPhantomParameterisation();
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const;
G4Material* ComputeMaterial(const G4int repNo,
G4VPhysicalVolume *currentVol,
const G4VTouchable *parentTouch=0);
G4int GetReplicaNo( const G4ThreeVector& localPoint,
const G4ThreeVector& localDir );
// Get the voxel number corresponding to the point in the container
// frame. Use 'localDir' to avoid precision problems at the surfaces.
G4ThreeVector GetTranslation(const G4int copyNo ) const;
size_t GetMaterialIndex( size_t nx, size_t ny, size_t nz) const;
size_t GetMaterialIndex( size_t copyNo) const;
G4Material* GetMaterial( size_t nx, size_t ny, size_t nz) const;
G4Material* GetMaterial( size_t copyNo ) const;
void SetFilledIDs( std::multimap<G4int,G4int> fid ){
fFilledIDs = fid;
}
void SetFilledMins( std::map< G4int, std::map<G4int,G4int> > fmins ) {
fFilledMins = fmins;
}
void BuildContainerWalls();
private:
void ComputeVoxelIndices(const G4int copyNo, size_t& nx,
size_t& ny, size_t& nz ) const;
// Convert the copyNo to voxel numbers in x, y and z.
void CheckCopyNo( const G4int copyNo ) const;
// Check that the copy number is within limits.
private:
std::multimap<G4int,G4int> fFilledIDs;
std::map< G4int, std::map<G4int,G4int> > fFilledMins;
};
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PathFinder.hh,v 1.34 2007/11/02 12:28:31 japost Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4PathFinder.hh,v 1.35 2010/07/13 15:59:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// class G4PathFinder
//
@@ -258,13 +258,9 @@ class G4PathFinder
// State for Step numbers
G4int fLastStepNo, fCurrentStepNo;
G4bool fParticleIsLooping;
G4int fVerboseLevel; // For debuging purposes
G4int fMax_loop_count;
// Limit for the number of sub-steps taken in one call to ComputeStep
G4TransportationManager* fpTransportManager; // Cache for frequent use
G4PropagatorInField* fpFieldPropagator;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PhantomParameterisation.hh,v 1.5 2009/05/19 18:27:03 arce Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4PhantomParameterisation.hh,v 1.6 2010/11/09 15:43:15 arce Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4PhantomParameterisation
@@ -116,7 +116,7 @@ class G4PhantomParameterisation : public G4VPVParameterisation
// Save as container solid the parent of the voxels. Check that the
// voxels fill it completely.
G4int GetReplicaNo( const G4ThreeVector& localPoint,
virtual G4int GetReplicaNo( const G4ThreeVector& localPoint,
const G4ThreeVector& localDir );
// Get the voxel number corresponding to the point in the container
// frame. Use 'localDir' to avoid precision problems at the surfaces.
@@ -166,7 +166,7 @@ class G4PhantomParameterisation : public G4VPVParameterisation
void CheckCopyNo( const G4int copyNo ) const;
// Check that the copy number is within limits.
private:
protected:
G4double fVoxelHalfX,fVoxelHalfY,fVoxelHalfZ;
// Half dimension of voxels (assume they are boxes).
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4RegularNavigation.hh,v 1.2 2007/10/18 14:18:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4RegularNavigation.hh,v 1.4 2010/09/03 16:29:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4RegularNavigation
@@ -86,7 +86,7 @@ class G4RegularNavigation
// so when a track enters the mother it automatically enters a voxel.
G4double ComputeStepSkippingEqualMaterials(
const G4ThreeVector localPoint,
G4ThreeVector& localPoint,
const G4ThreeVector& globalDirection,
const G4double currentProposedStepLength,
G4double& newSafety,
@@ -115,15 +115,15 @@ class G4RegularNavigation
// Set and Get methods
void SetVerboseLevel(G4int level) { fVerbose = level; }
void CheckMode(G4bool mode) { fCheck = mode; }
void SetVerboseLevel(G4int level) { fverbose = level; }
void CheckMode(G4bool mode) { fcheck = mode; }
void SetNormalNavigation( G4NormalNavigation* fnormnav )
{ fnormalNav = fnormnav; }
private:
G4int fVerbose;
G4bool fCheck;
G4int fverbose;
G4bool fcheck;
G4NormalNavigation* fnormalNav;
G4double kCarTolerance;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VoxelNavigation.hh,v 1.5 2007/05/11 13:43:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VoxelNavigation.hh,v 1.8 2010/11/04 12:13:30 japost Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4VoxelNavigation
@@ -43,6 +43,7 @@
#include "geomdefs.hh"
#include "G4NavigationHistory.hh"
#include "G4NavigationLogger.hh"
#include "G4AffineTransform.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
@@ -51,6 +52,8 @@
#include "G4BlockingList.hh"
class G4VoxelSafety;
// Required for inline implementation
//
#include "G4AuxiliaryNavServices.hh"
@@ -97,7 +100,7 @@ class G4VoxelNavigation
const G4double pMaxLength=DBL_MAX );
inline G4int GetVerboseLevel() const;
inline void SetVerboseLevel(G4int level);
void SetVerboseLevel(G4int level);
// Get/Set Verbose(ness) level.
// [if level>0 && G4VERBOSE, printout can occur]
@@ -106,6 +109,9 @@ class G4VoxelNavigation
// verifications and more strict correctness conditions.
// Is effective only with G4VERBOSE set.
inline void EnableBestSafety( G4bool flag= false );
// Enable best-possible evaluation of isotropic safety
protected:
G4double ComputeVoxelSafety( const G4ThreeVector& localPoint ) const;
@@ -113,6 +119,35 @@ class G4VoxelNavigation
const G4ThreeVector& localDirection,
const G4double currentStep );
G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint ) const;
private: // Logging functions
void PreComputeStepLog (const G4VPhysicalVolume* motherPhysical,
G4double motherSafety,
const G4ThreeVector& localPoint);
void AlongComputeStepLog(const G4VSolid* sampleSolid,
const G4ThreeVector& samplePoint,
const G4ThreeVector& sampleDirection,
const G4ThreeVector& localDirection,
G4double sampleSafety,
G4double sampleStep);
void PostComputeStepLog (const G4VSolid* motherSolid,
const G4ThreeVector& localPoint,
const G4ThreeVector& localDirection,
G4double motherStep,
G4double motherSafety);
void ComputeSafetyLog (const G4VSolid* solid,
const G4ThreeVector& point,
G4double safety,
G4bool banner);
inline void PrintDaughterLog (const G4VSolid* sampleSolid,
const G4ThreeVector& samplePoint,
G4double sampleSafety,
G4double sampleStep);
protected:
G4BlockingList fBList;
// Blocked volumes
@@ -146,9 +181,14 @@ class G4VoxelNavigation
// END Voxel Stack information
//
G4VoxelSafety *fpVoxelSafety;
// Helper object for Voxel Safety
G4bool fCheck;
G4int fVerbose;
G4double kCarTolerance;
G4bool fBestSafety;
G4NavigationLogger* fLogger;
// Verbosity logger
};
#include "G4VoxelNavigation.icc"
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VoxelNavigation.icc,v 1.4 2006/06/29 18:36:30 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VoxelNavigation.icc,v 1.7 2010/11/04 17:38:17 japost Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
//
// class G4VoxelNavigation Inline implementation
@@ -66,9 +66,9 @@ G4VoxelNavigation::VoxelLocate( G4SmartVoxelHeader* pHead,
targetNodeNo = 0;
}
else if ( targetNodeNo>=targetHeaderNoSlices )
{
targetNodeNo = targetHeaderNoSlices-1;
}
{
targetNodeNo = targetHeaderNoSlices-1;
}
// Stack info for stepping
//
fVoxelAxisStack[fVoxelDepth] = targetHeaderAxis;
@@ -168,17 +168,7 @@ G4VoxelNavigation::LevelLocate( G4NavigationHistory& history,
inline
G4int G4VoxelNavigation::GetVerboseLevel() const
{
return fVerbose;
}
// ********************************************************************
// SetVerboseLevel
// ********************************************************************
//
inline
void G4VoxelNavigation::SetVerboseLevel(G4int level)
{
fVerbose = level;
return fLogger->GetVerboseLevel();
}
// ********************************************************************
@@ -190,3 +180,13 @@ void G4VoxelNavigation::CheckMode(G4bool mode)
{
fCheck = mode;
}
// ********************************************************************
// EnableBestSafety
// ********************************************************************
//
inline
void G4VoxelNavigation::EnableBestSafety(G4bool flag)
{
fBestSafety = flag;
}
@@ -0,0 +1,137 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * 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: geant4-09-04 $
//
// class G4VoxelSafety
//
// Class description:
//
// Utility for isotropic safety in volumes containing only G4PVPlacement
// daughter volumes for which voxels have been constructed.
// History:
// - Created. John Apostolakis, 30 April 2010
// --------------------------------------------------------------------
#ifndef G4VOXELSAFETY_HH
#define G4VOXELSAFETY_HH
#include "geomdefs.hh"
#include "G4NavigationHistory.hh"
#include "G4AffineTransform.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
#include "G4ThreeVector.hh"
#include "G4BlockingList.hh"
// #include "G4AuxiliaryNavServices.hh"
// Required for voxel handling & voxel stack
//
#include <vector>
class G4SmartVoxelNode;
class G4SmartVoxelHeader;
class G4VoxelSafety
{
public: // with description
G4VoxelSafety();
~G4VoxelSafety();
G4SmartVoxelNode* VoxelLocate( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint );
G4double ComputeSafety( const G4ThreeVector& localPoint,
const G4VPhysicalVolume& currentPhysical,
G4double maxLength=DBL_MAX );
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
protected:
G4double SafetyForVoxelHeader( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint );
G4double SafetyForVoxelNode( G4SmartVoxelNode *curVoxelNode,
const G4ThreeVector& localPoint );
G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint ) const;
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
std::vector<EAxis> fVoxelAxisStack;
// Voxel axes
std::vector<G4int> fVoxelNoSlicesStack;
// No slices per voxel at each level
std::vector<G4double> fVoxelSliceWidthStack;
// Width of voxels at each level
std::vector<G4int> fVoxelNodeNoStack;
// Node no point is inside at each level
std::vector<G4SmartVoxelHeader*> fVoxelHeaderStack;
// Voxel headers at each level
G4SmartVoxelNode* fVoxelNode;
// Node containing last located point
//
// END Voxel Stack information
//
G4bool fCheck;
G4int fVerbose;
G4double kCarTolerance;
};
// #include "G4VoxelSafety.icc"
#endif