Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -25,7 +25,7 @@
//
//
// $Id: G4AuxiliaryNavServices.hh,v 1.4 2007/05/22 07:48:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4AuxiliaryNavServices
@@ -25,7 +25,7 @@
//
//
// $Id: G4AuxiliaryNavServices.icc,v 1.4 2007/05/22 07:48:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4AuxiliaryNavServices Inline implementation
@@ -25,7 +25,7 @@
//
//
// $Id: G4DrawVoxels.hh,v 1.3 2006/06/29 18:35:36 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4DrawVoxels
@@ -25,7 +25,7 @@
//
//
// $Id: G4ErrorPropagationNavigator.hh,v 1.1 2007/05/16 12:49:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// --------------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestErrorList.hh,v 1.3 2006/06/29 18:35:38 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestLogger.hh,v 1.3 2006/06/29 18:35:40 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestOverlapList.hh,v 1.3 2006/06/29 18:35:43 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestOvershootList.hh,v 1.3 2006/06/29 18:35:45 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestPoint.hh,v 1.3 2006/06/29 18:35:48 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestSegment.hh,v 1.4 2007/05/11 13:43:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestStreamLogger.hh,v 1.3 2006/06/29 18:35:52 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestVolPoint.hh,v 1.3 2006/06/29 18:35:55 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeomTestVolume.hh,v 1.3 2006/06/29 18:35:57 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GeometryMessenger.hh,v 1.4 2006/06/29 18:35:59 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4MultiNavigator.hh,v 1.3 2006/11/13 17:34:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4MultiNavigator.hh,v 1.4 2007/05/21 15:36:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4MultiNavigator
@@ -82,7 +82,7 @@ class G4MultiNavigator : public G4Navigator
// Get values for a single geometry
void PrepareNavigators();
// Find which geometries are registered for this particles - and keep info
// Find which geometries are registered for this particles, and keep info
void PrepareNewTrack( const G4ThreeVector position,
const G4ThreeVector direction );
// Prepare Navigators and locate
@@ -97,9 +97,9 @@ class G4MultiNavigator : public G4Navigator
// Important Note: In order to call this the geometries MUST be closed.
G4VPhysicalVolume* LocateGlobalPointAndSetup(const G4ThreeVector& point,
const G4ThreeVector* direction=0,
const G4bool pRelativeSearch=true,
const G4bool ignoreDirection=true);
const G4ThreeVector* direction=0,
const G4bool pRelativeSearch=true,
const G4bool ignoreDirection=true);
// Locate in all geometries.
// Return the volume in the first (mass) geometry
// Maintain vector of other volumes, to be returned separately
@@ -114,8 +114,8 @@ class G4MultiNavigator : public G4Navigator
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4double pProposedMaxLength = DBL_MAX);
// Calculate the isotropic distance to the nearest boundary
// in any geometry from the specified point in the global coordinate system.
// The geometry must be closed.
// in any geometry from the specified point in the global coordinate
// system. The geometry must be closed.
G4TouchableHistoryHandle CreateTouchableHistoryHandle() const;
// Returns a reference counted handle to a touchable history.
@@ -161,7 +161,7 @@ class G4MultiNavigator : public G4Navigator
G4double fNewSafety[ fMaxNav ]; // Safety for starting point
// Lowest values - determine step length, and safety
G4double fMinStep; // As reported by Navigators -- can be kInfinity
G4double fMinStep; // As reported by Navigators. Can be kInfinity
G4double fMinSafety;
G4double fTrueMinStep; // Corrected in case fMinStep >= proposed
@@ -175,8 +175,6 @@ class G4MultiNavigator : public G4Navigator
G4ThreeVector fPreStepLocation; // point where last ComputeStep called
G4double fMinSafety_PreStepPt; // /\ corresponding value of safety
// STATE Auxiliary variables
G4int fVerboseLevel;
G4TransportationManager* pTransportManager; // Cache for frequent use
};
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Navigator.hh,v 1.23 2007/05/11 13:43:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4Navigator.hh,v 1.26 2007/10/18 14:18:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4Navigator
@@ -65,6 +65,7 @@
#include "G4VoxelNavigation.hh"
#include "G4ParameterisedNavigation.hh"
#include "G4ReplicaNavigation.hh"
#include "G4RegularNavigation.hh"
#include <iostream>
@@ -298,6 +299,9 @@ class G4Navigator
inline EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const;
// Characterise daughter of logical volume.
inline G4int GetDaughtersRegularStructureId(const G4LogicalVolume *pLog) const;
// Get regular structure ID of first daughter
virtual void SetupHierarchy();
// Renavigate & reset hierarchy described by current history
// o Reset volumes
@@ -330,6 +334,13 @@ class G4Navigator
G4bool fWasLimitedByGeometry;
// Set true if last Step was limited by geometry.
G4ThreeVector fStepEndPoint;
// Endpoint of last ComputeStep
// - can be used for optimisation (eg when computing safety)
G4int fVerbose;
// Verbose(ness) level [if > 0, printout can occur].
private:
G4bool fActive;
@@ -422,8 +433,6 @@ class G4Navigator
// 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].
// Helpers/Utility classes
//
@@ -431,6 +440,7 @@ class G4Navigator
G4VoxelNavigation fvoxelNav;
G4ParameterisedNavigation fparamNav;
G4ReplicaNavigation freplicaNav;
G4RegularNavigation fregularNav;
};
#include "G4Navigator.icc"
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Navigator.icc,v 1.12 2006/10/27 09:13:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4Navigator.icc,v 1.15 2007/10/18 14:18:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4Navigator Inline implementation
@@ -157,7 +157,7 @@ EVolume G4Navigator::VolumeType(const G4VPhysicalVolume *pVol) const
}
// ********************************************************************
// CharacteriseDahghters
// CharacteriseDaughters
// ********************************************************************
//
inline
@@ -190,6 +190,26 @@ EVolume G4Navigator::CharacteriseDaughters(const G4LogicalVolume *pLog) const
return type;
}
// ********************************************************************
// GetDaughtersRegularStructureId
// ********************************************************************
//
inline
G4int G4Navigator::
GetDaughtersRegularStructureId(const G4LogicalVolume *pLog) const
{
G4int regId = 0;
G4VPhysicalVolume *pVol;
if ( pLog->GetNoDaughters()==1 )
{
pVol = pLog->GetDaughter(0);
regId = pVol->GetRegularStructureId();
}
return regId;
}
// ********************************************************************
// GetGlobalToLocalTransform
//
@@ -368,6 +388,7 @@ void G4Navigator::SetVerboseLevel(G4int level)
fvoxelNav.SetVerboseLevel(level);
fparamNav.SetVerboseLevel(level);
freplicaNav.SetVerboseLevel(level);
fregularNav.SetVerboseLevel(level);
}
// ********************************************************************
@@ -424,6 +445,7 @@ void G4Navigator::CheckMode(G4bool mode)
fvoxelNav.CheckMode(mode);
fparamNav.CheckMode(mode);
freplicaNav.CheckMode(mode);
fregularNav.CheckMode(mode);
}
// ********************************************************************
@@ -25,7 +25,7 @@
//
//
// $Id: G4NormalNavigation.hh,v 1.4 2006/06/29 18:36:06 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4NormalNavigation
@@ -25,7 +25,7 @@
//
//
// $Id: G4NormalNavigation.icc,v 1.4 2006/06/29 18:36:08 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// G4NormalNavigation Inline Implementation
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ParameterisedNavigation.hh,v 1.5 2006/06/29 18:36:10 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4ParameterisedNavigation.hh,v 1.6 2007/11/09 16:06:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4ParameterisedNavigation
@@ -63,8 +63,8 @@ class G4ParameterisedNavigation : public G4VoxelNavigation
G4ParameterisedNavigation();
~G4ParameterisedNavigation();
G4SmartVoxelNode* ParamVoxelLocate( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint );
inline G4SmartVoxelNode* ParamVoxelLocate( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint );
G4bool LevelLocate( G4NavigationHistory& history,
const G4VPhysicalVolume* blockedVol,
@@ -102,7 +102,7 @@ class G4ParameterisedNavigation : public G4VoxelNavigation
// Necessary to resolve cases with nested parameterisations
G4VSolid* IdentifyAndPlaceSolid( G4int num,
inline G4VSolid* IdentifyAndPlaceSolid( G4int num,
G4VPhysicalVolume* apparentPhys,
G4VPVParameterisation* curParam );
// Call virtual 'Compute' methods, and copy information if nested.
@@ -24,14 +24,33 @@
// ********************************************************************
//
//
// $Id: G4ParameterisedNavigation.icc,v 1.6 2006/06/29 18:36:12 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4ParameterisedNavigation.icc,v 1.7 2007/11/09 16:06:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4ParameterisedNavigation Inline implementation
//
// --------------------------------------------------------------------
// ********************************************************************
// IdentifyAndPlaceSolid
// ********************************************************************
//
inline
G4VSolid* G4ParameterisedNavigation::
IdentifyAndPlaceSolid( G4int num,
G4VPhysicalVolume *apparentPhys, // PhysV or PhysT
G4VPVParameterisation *curParam )
{
G4VSolid *sampleSolid;
sampleSolid = curParam->ComputeSolid(num, apparentPhys);
sampleSolid->ComputeDimensions(curParam, num, apparentPhys);
curParam->ComputeTransformation(num, apparentPhys);
return sampleSolid;
}
// ********************************************************************
// ParamVoxelLocate
// ********************************************************************
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PathFinder.hh,v 1.23 2007/05/16 15:59:06 japost Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4PathFinder.hh,v 1.34 2007/11/02 12:28:31 japost Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// class G4PathFinder
//
@@ -68,16 +68,19 @@ class G4PathFinder
//
// Retrieve singleton instance
G4double ComputeStep( const G4FieldTrack &pFieldTrack,// Or update non-c
G4double pCurrentProposedStepLength,
G4int navigatorId,
G4int stepNo, // See next step/check
G4double &pNewSafety, // for this geom
ELimited &limitedStep,
G4double ComputeStep( const G4FieldTrack &pFieldTrack,
G4double pCurrentProposedStepLength,
G4int navigatorId, // Identifies the geometry
G4int stepNo, // See next step/check
G4double &pNewSafety, // Only for this geometry
ELimited &limitedStep,
G4FieldTrack &EndState,
G4VPhysicalVolume* currentVolume );
//
// Compute the next geometric Step -- Curved or linear
// If it is called with a larger 'stepNo' it will execute a new step;
// if 'stepNo' is same as last call, then the results for
// the geometry with Id. number 'navigatorId' will be returned.
void Locate( const G4ThreeVector& position,
const G4ThreeVector& direction,
@@ -91,7 +94,9 @@ class G4PathFinder
// Make secondary relocation of global point (within safety only)
// in all navigators, and update them.
void PrepareNewTrack( G4ThreeVector position, G4ThreeVector direction);
void PrepareNewTrack( const G4ThreeVector& position,
const G4ThreeVector& direction,
G4VPhysicalVolume* massStartVol=0);
//
// Check and cache set of active navigators.
@@ -107,13 +112,20 @@ class G4PathFinder
inline G4bool IsParticleLooping() const;
inline G4double GetCurrentSafety() const;
//
// Minimum value of safety after last ComputeStep
inline G4double GetMinimumStep() const;
// Get the minimum step size from the last ComputeStep call
// - in case full step is taken, this is kInfinity
inline unsigned int GetNumberGeometriesLimitingStep() const;
G4double ComputeSafety( const G4ThreeVector& pGlobalPoint );
//
// Recompute safety for the relevant point
// the endpoint of the last step!!
G4double ComputeSafety( const G4ThreeVector& globalPoint);
// Recompute safety for the relevant point the endpoint of the last step!!
// Maintain vector of individual safety values (for next method)
G4double ObtainSafety( G4int navId, G4ThreeVector& globalCenterPoint );
// Obtain safety for navigator/geometry navId for last point 'computed'
// --> last point for which ComputeSafety was called
// Returns the point (center) for which this safety is valid
void EnableParallelNavigation( G4bool enableChoice=true );
//
@@ -137,6 +149,17 @@ class G4PathFinder
//
// Signal that location will be moved -- internal use primarily
// To provide best compatibility between Coupled and Old Transportation
// the next two methods are provided:
G4double LastPreSafety( G4int navId, G4ThreeVector& globalCenterPoint, G4double& minSafety );
// Obtain last safety needed in ComputeStep (for geometry navId)
// --> last point at which ComputeStep recalculated safety
// Returns the point (center) for which this safety is valid
// and also the minimum safety over all navigators (ie full)
void PushPostSafetyToPreSafety();
// Tell PathFinder to copy PostStep Safety to PreSafety (for use at next step)
G4String& LimitedString( ELimited lim );
// Convert ELimited to string
@@ -154,7 +177,7 @@ class G4PathFinder
//
// Print key details out - for debugging
void ClearState();
// void ClearState();
//
// Clear all the State of this class and its current associates
@@ -162,6 +185,9 @@ class G4PathFinder
//
// Whether use safety to discard unneccesary calls to navigator
void ReportMove( const G4ThreeVector& OldV, const G4ThreeVector& NewV, const G4String& Quantity ) const;
// Helper method to report movement (likely of initial point)
protected:
G4PathFinder(); // Singleton
@@ -175,8 +201,9 @@ class G4PathFinder
// DATA Members
// ----------------------------------------------------------------------
G4MultiNavigator *fpMultiNavigator;
// Object that enables G4PropagatorInField to see many geometries
G4MultiNavigator *fpMultiNavigator;
//
// Object that enables G4PropagatorInField to see many geometries
G4int fNoActiveNavigators;
G4bool fNewTrack; // Flag a new track (ensure first step)
@@ -187,13 +214,25 @@ class G4PathFinder
G4Navigator* fpNavigator[fMaxNav];
// State after a step computation
// State changed in a step computation
ELimited fLimitedStep[fMaxNav];
G4bool fLimitTruth[fMaxNav];
G4double fCurrentStepSize[fMaxNav];
G4double fNewSafety[ fMaxNav ]; // Safety for starting point
G4double fMinSafety;
G4int fNoGeometriesLimiting; // How many processes contribute to limit
G4ThreeVector fPreSafetyLocation; // last initial position for which safety evaluated
G4double fPreSafetyMinValue; // /\ corresponding value of full safety
G4double fPreSafetyValues[ fMaxNav ]; // Safeties for the above point
// This part of the state can be retained for severall calls --> CARE
G4ThreeVector fPreStepLocation; // point where last ComputeStep called
G4double fMinSafety_PreStepPt; // /\ corresponding value of full safety
G4double fCurrentPreStepSafety[ fMaxNav ]; // Safeties for the above point
// This changes at each step,
// so it can differ when steps inside min-safety are made
G4bool fPreStepCenterRenewed; // Whether PreSafety coincides with PreStep point
G4double fMinStep; // As reported by Navigators -- can be kInfinity
G4double fTrueMinStep; // Corrected in case >= proposed
@@ -203,29 +242,35 @@ class G4PathFinder
G4VPhysicalVolume* fLocatedVolume[fMaxNav];
G4ThreeVector fLastLocatedPosition;
G4FieldTrack fEndState;
// End point storage
// State after calling 'ComputeStep' (others member variables will be affected)
G4FieldTrack fEndState; // Point, velocity, ... at proposed step end
G4bool fFieldExertedForce; // In current proposed step
G4bool fRelocatedPoint; // Signals that point was or is being moved
// from the position of the last location
// or the endpoint resulting from ComputeStep
// -- invalidates fEndState
// State for 'ComputeSafety' and related methods
G4ThreeVector fSafetyLocation; // point where ComputeSafety is called
G4double fMinSafety_atSafLocation; // /\ corresponding value of safety
G4ThreeVector fPreStepLocation; // point where last ComputeStep called
G4double fMinSafety_PreStepPt; // /\ corresponding value of safety
G4double fNewSafetyComputed[ fMaxNav ]; // Safeties for last ComputeSafety
G4int fLastStepNo, fCurrentStepNo;
G4bool fParticleIsLooping;
G4int fVerboseLevel;
// For debuging purposes
G4int fMax_loop_count;
// 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;
G4double kCarTolerance;
static G4PathFinder* fpPathFinder;
};
// ********************************************************************
@@ -244,9 +289,20 @@ inline G4int G4PathFinder::SetVerboseLevel(G4int newLevel)
G4int old= fVerboseLevel; fVerboseLevel= newLevel; return old;
}
inline G4double G4PathFinder::GetMinimumStep() const
{
return fMinStep;
}
inline unsigned int G4PathFinder::GetNumberGeometriesLimitingStep() const
{
unsigned int noGeometries=fNoGeometriesLimiting;
return noGeometries;
}
inline G4double G4PathFinder::GetCurrentSafety() const
{
return fMinSafety;
return fMinSafety_PreStepPt;
}
inline void G4PathFinder::MovePoint()
@@ -260,4 +316,20 @@ inline G4Navigator* G4PathFinder::GetNavigator(G4int n) const
return fpNavigator[n];
}
inline G4double G4PathFinder::ObtainSafety( G4int navId, G4ThreeVector& globalCenterPoint )
{
globalCenterPoint= fSafetyLocation;
// navId = std::min( navId, fMaxNav-1 );
return fNewSafetyComputed[ navId ];
}
inline G4double G4PathFinder::LastPreSafety( G4int navId,
G4ThreeVector& globalCenterPoint,
G4double& minSafety )
{
globalCenterPoint= fPreSafetyLocation;
minSafety= fPreSafetyMinValue;
// navId = std::min( navId, fMaxNav-1 );
return fPreSafetyValues[ navId ];
}
#endif
@@ -0,0 +1,200 @@
//
// ********************************************************************
// * 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: G4PhantomParameterisation.hh,v 1.2 2007/10/18 14:29:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4PhantomParameterisation
//
// Class description:
//
// Describes regular parameterisations: a set of boxes of equal dimension
// in the x, y and z dimensions. The G4PVParameterised volume using this
// class must be placed inside a volume that is completely filled by these
// boxes.
// History:
// - Created. P. Arce, May 2007
// *********************************************************************
#ifndef G4PhantomParameterisation_HH
#define G4PhantomParameterisation_HH
#include <vector>
#include "G4Types.hh"
#include "G4VPVParameterisation.hh"
#include "G4AffineTransform.hh"
class G4VPhysicalVolume;
class G4VTouchable;
class G4VSolid;
class G4Material;
// Dummy forward declarations ...
class G4Box;
class G4Tubs;
class G4Trd;
class G4Trap;
class G4Cons;
class G4Orb;
class G4Sphere;
class G4Torus;
class G4Para;
class G4Hype;
class G4Polycone;
class G4Polyhedra;
class G4PhantomParameterisation : public G4VPVParameterisation
{
public: // with description
G4PhantomParameterisation();
~G4PhantomParameterisation();
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const;
virtual G4VSolid* ComputeSolid(const G4int, G4VPhysicalVolume *);
virtual G4Material* ComputeMaterial(const G4int repNo,
G4VPhysicalVolume *currentVol,
const G4VTouchable *parentTouch=0);
// Dummy declarations ...
void ComputeDimensions (G4Box &, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Tubs&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Trd&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Trap&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Cons&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Orb&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Sphere&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Torus&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Para&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Hype&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polycone&, const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polyhedra&, const G4int,
const G4VPhysicalVolume*) const {}
void BuildContainerSolid( G4VPhysicalVolume *pPhysicalVol );
// Save as container solid the parent of the voxels. Check that the
// voxels fill it completely.
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.
// Set and Get methods
inline void SetMaterials(std::vector<G4Material*>& mates );
inline void SetMaterialIndices( size_t* matInd );
void SetVoxelDimensions( G4double halfx, G4double halfy, G4double halfz );
void SetNoVoxel( size_t nx, size_t ny, size_t nz );
inline G4double GetVoxelHalfX() const;
inline G4double GetVoxelHalfY() const;
inline G4double GetVoxelHalfZ() const;
inline size_t GetNoVoxelX() const;
inline size_t GetNoVoxelY() const;
inline size_t GetNoVoxelZ() const;
inline size_t GetNoVoxel() const;
inline std::vector<G4Material*> GetMaterials() const;
inline size_t* GetMaterialIndices() const;
inline G4VSolid* GetContainerSolid() const;
G4ThreeVector GetTranslation(const G4int copyNo ) const;
G4bool SkipEqualMaterials() const;
void SetSkipEqualMaterials( G4bool skip );
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;
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 CheckVoxelsFillContainer( G4double contX, G4double contY,
G4double contZ ) const;
// Check that the voxels fill it completely.
void CheckCopyNo( const G4int copyNo ) const;
// Check that the copy number is within limits.
private:
G4double fVoxelHalfX,fVoxelHalfY,fVoxelHalfZ;
// Half dimension of voxels (assume they are boxes).
size_t fNoVoxelX,fNoVoxelY,fNoVoxelZ;
// Number of voxel in x, y and z dimensions.
size_t fNoVoxelXY;
// Number of voxels in x times number of voxels in y (for speed-up).
size_t fNoVoxel;
// Total number of voxels (for speed-up).
std::vector<G4Material*> fMaterials;
// List of materials of the voxels.
size_t* fMaterialIndices;
// Index in fMaterials that correspond to each voxel.
G4VSolid* fContainerSolid;
// Save as container solid the parent of the voxels.
// Check that the voxels fill it completely.
G4double fContainerWallX, fContainerWallY, fContainerWallZ;
// Save position of container wall for speed-up.
G4double kCarTolerance;
// Relative surface tolerance.
G4bool bSkipEqualMaterials;
// Flag to skip surface when two voxel have same material or not
};
#include "G4PhantomParameterisation.icc"
#endif
@@ -0,0 +1,148 @@
//
// ********************************************************************
// * 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: G4PhantomParameterisation.icc,v 1.1 2007/10/17 19:13:58 arce Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//--------------------------------------------------------------------
inline
void G4PhantomParameterisation::
SetVoxelDimensions( G4double halfx, G4double halfy, G4double halfz )
{
fVoxelHalfX = halfx;
fVoxelHalfY = halfy;
fVoxelHalfZ = halfz;
}
//--------------------------------------------------------------------
inline
void G4PhantomParameterisation::SetNoVoxel( size_t nx, size_t ny, size_t nz )
{
fNoVoxelX = nx;
fNoVoxelY = ny;
fNoVoxelZ = nz;
fNoVoxelXY = nx*ny;
fNoVoxel = nx*ny*nz;
}
//--------------------------------------------------------------------
inline
void G4PhantomParameterisation::SetMaterials(std::vector<G4Material*>& mates )
{
fMaterials = mates;
}
//--------------------------------------------------------------------
inline
void G4PhantomParameterisation::SetMaterialIndices( size_t* matInd )
{
fMaterialIndices = matInd;
}
//--------------------------------------------------------------------
inline
G4double G4PhantomParameterisation::GetVoxelHalfX() const
{
return fVoxelHalfX;
}
//--------------------------------------------------------------------
inline
G4double G4PhantomParameterisation::GetVoxelHalfY() const
{
return fVoxelHalfY;
}
//--------------------------------------------------------------------
inline
G4double G4PhantomParameterisation::GetVoxelHalfZ() const
{
return fVoxelHalfZ;
}
//--------------------------------------------------------------------
inline
size_t G4PhantomParameterisation::GetNoVoxelX() const
{
return fNoVoxelX;
}
//--------------------------------------------------------------------
inline
size_t G4PhantomParameterisation::GetNoVoxelY() const
{
return fNoVoxelY;
}
//--------------------------------------------------------------------
inline
size_t G4PhantomParameterisation::GetNoVoxelZ() const
{
return fNoVoxelZ;
}
//--------------------------------------------------------------------
inline
size_t G4PhantomParameterisation::GetNoVoxel() const
{
return fNoVoxel;
}
//--------------------------------------------------------------------
inline
std::vector<G4Material*> G4PhantomParameterisation::GetMaterials() const
{
return fMaterials;
}
//--------------------------------------------------------------------
inline
size_t* G4PhantomParameterisation::GetMaterialIndices() const
{
return fMaterialIndices;
}
//--------------------------------------------------------------------
inline
G4VSolid* G4PhantomParameterisation::GetContainerSolid() const
{
return fContainerSolid;
}
//--------------------------------------------------------------------
inline
G4bool G4PhantomParameterisation::SkipEqualMaterials() const
{
return bSkipEqualMaterials;
}
//--------------------------------------------------------------------
inline
void G4PhantomParameterisation::SetSkipEqualMaterials( G4bool skip )
{
bSkipEqualMaterials = skip;
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4PropagatorInField.hh,v 1.13 2007/06/08 09:49:34 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// class G4PropagatorInField
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4PropagatorInField.icc,v 1.10 2006/11/13 17:34:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// ------------------------------------------------------------------------
+132
View File
@@ -0,0 +1,132 @@
//
// ********************************************************************
// * 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: G4RegularNavigation.hh,v 1.2 2007/10/18 14:18:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4RegularNavigation
//
// Class description:
//
// Utility for fast navigation in volumes containing a regular
// parameterisation. If two contiguous voxels have the same material,
// navigation does not stop at the surface
// History:
// - Created. P. Arce, May 2007
// --------------------------------------------------------------------
#ifndef G4RegularNavigation_HH
#define G4RegularNavigation_HH
#include <vector>
#include "G4Types.hh"
#include "G4ThreeVector.hh"
class G4NormalNavigation;
class G4VPhysicalVolume;
class G4Navigator;
class G4NavigationHistory;
class G4RegularNavigation
{
public: // with description
G4RegularNavigation();
~G4RegularNavigation();
G4bool LevelLocate( G4NavigationHistory& history,
const G4VPhysicalVolume* blockedVol,
const G4int blockedNum,
const G4ThreeVector& globalPoint,
const G4ThreeVector* globalDirection,
const G4bool pLocatedOnEdge,
G4ThreeVector& localPoint );
// Locate point using its position with respect to regular
// parameterisation container volume.
G4double ComputeStep( const G4ThreeVector& globalPoint,
const G4ThreeVector& globalDirection,
const G4double currentProposedStepLength,
G4double& newSafety,
G4NavigationHistory& history,
G4bool& validExitNormal,
G4ThreeVector& exitNormal,
G4bool& exiting,
G4bool& entering,
G4VPhysicalVolume *(*pBlockedPhysical),
G4int& blockedReplicaNo );
// Method never called because to be called the daughter has to be a
// 'regular' volume. This would only happen if the track is in the
// mother of voxels volume. But the voxels fill completely their mother,
// so when a track enters the mother it automatically enters a voxel.
G4double ComputeStepSkippingEqualMaterials(
const G4ThreeVector localPoint,
const G4ThreeVector& globalDirection,
const G4double currentProposedStepLength,
G4double& newSafety,
G4NavigationHistory& history,
G4bool& validExitNormal,
G4ThreeVector& exitNormal,
G4bool& exiting,
G4bool& entering,
G4VPhysicalVolume *(*pBlockedPhysical),
G4int& blockedReplicaNo,
G4VPhysicalVolume* pCurrentPhysical);
// Compute the step skipping surfaces when they separate voxels with
// equal materials. Loop to voxels until a different material is found:
// invokes G4NormalNavigation::ComputeStep() in each voxel and move the
// point to the next voxel.
G4double ComputeSafety( const G4ThreeVector& localPoint,
const G4NavigationHistory& history,
const G4double pProposedMaxLength=DBL_MAX );
// Method never called because to be called the daughter has to be a
// 'regular' volume. This would only happen if the track is in the
// mother of voxels volume. But the voxels fill completely their mother,
// so when a track enters the mother it automatically enters a voxel.
public: // without description
// Set and Get methods
void SetVerboseLevel(G4int level) { fVerbose = level; }
void CheckMode(G4bool mode) { fCheck = mode; }
void SetNormalNavigation( G4NormalNavigation* fnormnav )
{ fnormalNav = fnormnav; }
private:
G4int fVerbose;
G4bool fCheck;
G4NormalNavigation* fnormalNav;
G4double kCarTolerance;
};
#endif
@@ -25,7 +25,7 @@
//
//
// $Id: G4ReplicaNavigation.hh,v 1.6 2007/05/18 07:31:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4ReplicaNavigation
@@ -25,7 +25,7 @@
//
//
// $Id: G4ReplicaNavigation.icc,v 1.5 2006/06/29 18:36:22 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4ReplicaNavigation Inline implementation
@@ -25,7 +25,7 @@
//
//
// $Id: G4SafetyHelper.hh,v 1.7 2007/05/02 15:32:13 japost Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4SafetyHelper
@@ -25,7 +25,7 @@
//
//
// $Id: G4TransportationManager.hh,v 1.12 2007/04/20 15:28:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// class G4TransportationManager
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4TransportationManager.icc,v 1.10 2007/04/20 15:28:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
// ------------------------------------------------------------
// GEANT 4 inlined function members implementation
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4VoxelNavigation.hh,v 1.5 2007/05/11 13:43:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4VoxelNavigation
@@ -25,7 +25,7 @@
//
//
// $Id: G4VoxelNavigation.icc,v 1.4 2006/06/29 18:36:30 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4VoxelNavigation Inline implementation