Import Geant4 11.2.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2023-06-30 09:09:57 +02:00
parent aef78ca386
commit dd1f179cda
3780 changed files with 212808 additions and 142780 deletions
@@ -41,7 +41,7 @@ CheckPointOnSurface( const G4VSolid* sampleSolid,
EInside insideSolid = sampleSolid->Inside(localPoint);
if ( insideSolid!=kOutside )
{
G4bool checkDirection = locatedOnEdge && (globalDirection!=0);
G4bool checkDirection = locatedOnEdge && (globalDirection!=nullptr);
if( (insideSolid==kSurface) && checkDirection)
{
// We are probably located on an edge.
@@ -109,7 +109,7 @@ CheckPointExiting( const G4VSolid* sampleSolid,
const G4ThreeVector* globalDirection,
const G4AffineTransform& sampleTransform )
{
if( !globalDirection ) { return false; }
if( globalDirection == nullptr ) { return false; }
G4ThreeVector localDirection, sampleNormal;
G4bool exiting = false;
@@ -50,17 +50,17 @@ class G4BrentLocator : public G4VIntersectionLocator
G4BrentLocator(G4Navigator *theNavigator);
// Constructor
~G4BrentLocator();
~G4BrentLocator() override;
// Default destructor
G4bool EstimateIntersectionPoint(
const G4FieldTrack& curveStartPointTangent, // A
const G4FieldTrack& curveEndPointTangent, // B
const G4ThreeVector& trialPoint, // E
G4FieldTrack& intersectPointTangent, // Output
G4bool& recalculatedEndPoint, // Out
G4double& fPreviousSafety, // In/Out
G4ThreeVector& fPreviousSftOrigin); // In/Out
const G4FieldTrack& curveStartPointTangent, // A
const G4FieldTrack& curveEndPointTangent, // B
const G4ThreeVector& trialPoint, // E
G4FieldTrack& intersectPointTangent, // Output
G4bool& recalculatedEndPoint, // Out
G4double& fPreviousSafety, // In/Out
G4ThreeVector& fPreviousSftOrigin) override; // In/Out
// If such an intersection exists, this function calculates the
// intersection point of the true path of the particle with the surface
// of the current volume (or of one of its daughters).
@@ -46,23 +46,23 @@ class G4ErrorPropagationNavigator : public G4Navigator
public: // with description
G4ErrorPropagationNavigator();
~G4ErrorPropagationNavigator();
~G4ErrorPropagationNavigator() override;
G4double ComputeStep (const G4ThreeVector &pGlobalPoint,
const G4ThreeVector &pDirection,
const G4double pCurrentProposedStepLength,
G4double &pNewSafety);
G4double &pNewSafety) override;
// Calls the navigation in the detector geometry and then checks
// if the distance to surface is smaller than the proposed step
G4double ComputeSafety(const G4ThreeVector &globalpoint,
const G4double pProposedMaxLength = DBL_MAX,
const G4bool keepState = true);
const G4bool keepState = true) override;
// Calls the navigation in the detector geometry and then checks
// if the distance to surface is smaller than the proposed safety
G4ThreeVector GetGlobalExitNormal(const G4ThreeVector& point,
G4bool* valid);
G4bool* valid) override;
// Return Exit Surface Normal and validity too. Can only be called if
// the Navigator's last Step has crossed a volume geometrical boundary.
// Normal points out of the volume exited and/or into the volume entered.
@@ -55,20 +55,20 @@ class G4GeometryMessenger : public G4UImessenger
public: // with description
G4GeometryMessenger(G4TransportationManager* tman);
~G4GeometryMessenger();
~G4GeometryMessenger() override;
// Constructor and destructor
void SetNewValue( G4UIcommand* command, G4String newValues );
G4String GetCurrentValue( G4UIcommand* command );
void SetNewValue( G4UIcommand* command, G4String newValues ) override;
G4String GetCurrentValue( G4UIcommand* command ) override;
private:
void Init();
void CheckGeometry();
void ResetNavigator();
void SetVerbosity(G4String newValue);
void SetCheckMode(G4String newValue);
void SetPushFlag(G4String newValue);
void SetVerbosity(const G4String& newValue);
void SetCheckMode(const G4String& newValue);
void SetPushFlag(const G4String& newValue);
void RecursiveOverlapTest();
G4UIdirectory *geodir, *navdir, *testdir;
@@ -56,9 +56,9 @@ class G4GlobalMagFieldMessenger : public G4UImessenger
public: // with description
G4GlobalMagFieldMessenger(const G4ThreeVector& value = G4ThreeVector());
virtual ~G4GlobalMagFieldMessenger();
~G4GlobalMagFieldMessenger() override;
virtual void SetNewValue(G4UIcommand*, G4String);
void SetNewValue(G4UIcommand*, G4String) override;
void SetFieldValue(const G4ThreeVector& value);
G4ThreeVector GetFieldValue() const;
@@ -43,7 +43,7 @@ class G4LocatorChangeLogger : public std::vector<G4LocatorChangeRecord>
{
public:
G4LocatorChangeLogger( const std::string name ) : fName(name) {}
G4LocatorChangeLogger( const std::string& name ) : fName(name) {}
void AddRecord( G4LocatorChangeRecord && chngRecord );
void AddRecord( const G4LocatorChangeRecord & chngRecord );
@@ -50,17 +50,17 @@ class G4MultiLevelLocator : public G4VIntersectionLocator
G4MultiLevelLocator(G4Navigator *theNavigator);
// Constructor
~G4MultiLevelLocator();
~G4MultiLevelLocator() override;
// Default destructor
G4bool EstimateIntersectionPoint(
const G4FieldTrack& curveStartPointTangent, // A
const G4FieldTrack& curveEndPointTangent, // B
const G4ThreeVector& trialPoint, // E
G4FieldTrack& intersectPointTangent, // Output
G4bool& recalculatedEndPoint, // Out
G4double& fPreviousSafety, // In/Out
G4ThreeVector& fPreviousSftOrigin); // In/Out
const G4FieldTrack& curveStartPointTangent, // A
const G4FieldTrack& curveEndPointTangent, // B
const G4ThreeVector& trialPoint, // E
G4FieldTrack& intersectPointTangent, // Output
G4bool& recalculatedEndPoint, // Out
G4double& fPreviousSafety, // In/Out
G4ThreeVector& fPreviousSftOrigin) override; // In/Out
// If such an intersection exists, this function calculates the
// intersection point of the true path of the particle with the surface
// of the current volume (or of one of its daughters).
@@ -60,13 +60,13 @@ class G4MultiNavigator : public G4Navigator
G4MultiNavigator();
// Constructor - initialisers and setup.
~G4MultiNavigator();
~G4MultiNavigator() override;
// Destructor. No actions.
G4double ComputeStep( const G4ThreeVector& pGlobalPoint,
const G4ThreeVector& pDirection,
const G4double pCurrentProposedStepLength,
G4double& pNewSafety );
G4double& pNewSafety ) override;
// Return the distance to the next boundary of any geometry
G4double ObtainFinalStep( G4int navigatorId,
@@ -77,13 +77,13 @@ class G4MultiNavigator : public G4Navigator
void PrepareNavigators();
// Find which geometries are registered for this particles, and keep info
void PrepareNewTrack( const G4ThreeVector position,
void PrepareNewTrack( const G4ThreeVector& position,
const G4ThreeVector direction );
// Prepare Navigators and locate
G4VPhysicalVolume* ResetHierarchyAndLocate( const G4ThreeVector& point,
const G4ThreeVector& direction,
const G4TouchableHistory& h );
const G4ThreeVector& direction,
const G4TouchableHistory& h ) override;
// Reset the geometrical hierarchy for all geometries.
// Use the touchable history for the first (mass) geometry.
// Return the volume in the first (mass) geometry.
@@ -91,35 +91,35 @@ class G4MultiNavigator : public G4Navigator
// Important Note: In order to call this the geometries MUST be closed.
G4VPhysicalVolume* LocateGlobalPointAndSetup( const G4ThreeVector& point,
const G4ThreeVector* direction = nullptr,
const G4bool pRelativeSearch = true,
const G4bool ignoreDirection = true);
const G4ThreeVector* direction = nullptr,
const G4bool pRelativeSearch = true,
const G4bool ignoreDirection = true) override;
// Locate in all geometries.
// Return the volume in the first (mass) geometry
// Maintain vector of other volumes, to be returned separately
//
// Important Note: In order to call this the geometry MUST be closed.
void LocateGlobalPointWithinVolume( const G4ThreeVector& position );
void LocateGlobalPointWithinVolume( const G4ThreeVector& position ) override;
// 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.
G4double ComputeSafety( const G4ThreeVector& globalpoint,
const G4double pProposedMaxLength = DBL_MAX,
const G4bool keepState = false );
const G4bool keepState = false ) override;
// 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.
G4TouchableHistoryHandle CreateTouchableHistoryHandle() const;
G4TouchableHistoryHandle CreateTouchableHistoryHandle() const override;
// Returns a reference counted handle to a touchable history.
virtual G4ThreeVector GetLocalExitNormal( G4bool* obtained ); // const
virtual G4ThreeVector GetLocalExitNormalAndCheck( const G4ThreeVector &E_Pt,
G4bool* obtained ); // const
virtual G4ThreeVector GetGlobalExitNormal( const G4ThreeVector &E_Pt,
G4bool* obtained ); // const
G4ThreeVector GetLocalExitNormal( G4bool* obtained ) override; // const
G4ThreeVector GetLocalExitNormalAndCheck( const G4ThreeVector &E_Pt,
G4bool* obtained ) override; // const
G4ThreeVector GetGlobalExitNormal( const G4ThreeVector &E_Pt,
G4bool* obtained ) override; // const
// Return Exit Surface Normal and validity too.
// Can only be called if the Navigator's last Step either
// - has just crossed a volume geometrical boundary and relocated, or
@@ -141,10 +141,10 @@ class G4MultiNavigator : public G4Navigator
protected: // with description
void ResetState();
void ResetState() override;
// Utility method to reset the navigator state machine.
void SetupHierarchy();
void SetupHierarchy() override;
// Renavigate & reset hierarchy described by current history
// o Reset volumes
// o Recompute transforms and/or solids of replicated/parameterised
@@ -91,7 +91,7 @@ void G4Navigator::SetWorldVolume(G4VPhysicalVolume* pWorld)
FatalException, "Volume must be centered on the origin.");
}
const G4RotationMatrix* rm = pWorld->GetRotation();
if ( rm && (!rm->isIdentity()) )
if ( (rm != nullptr) && (!rm->isIdentity()) )
{
G4Exception ("G4Navigator::SetWorldVolume()", "GeomNav0002",
FatalException, "Volume must not be rotated.");
@@ -326,7 +326,7 @@ void G4Navigator::LocateGlobalPointAndUpdateTouchable(
const G4bool RelativeSearch )
{
G4VPhysicalVolume* pPhysVol;
pPhysVol = LocateGlobalPointAndSetup( position, 0, RelativeSearch);
pPhysVol = LocateGlobalPointAndSetup( position, nullptr, RelativeSearch);
touchableToUpdate->UpdateYourself( pPhysVol, &fHistory );
}
@@ -353,7 +353,7 @@ void G4Navigator::SetVerboseLevel(G4int level)
fparamNav.SetVerboseLevel(level);
freplicaNav.SetVerboseLevel(level);
fregularNav.SetVerboseLevel(level);
if (fpExternalNav != nullptr) fpExternalNav->SetVerboseLevel(level);
if (fpExternalNav != nullptr) { fpExternalNav->SetVerboseLevel(level); }
}
// ********************************************************************
@@ -411,7 +411,7 @@ void G4Navigator::CheckMode(G4bool mode)
fparamNav.CheckMode(mode);
freplicaNav.CheckMode(mode);
fregularNav.CheckMode(mode);
if (fpExternalNav != nullptr) fpExternalNav->CheckMode(mode);
if (fpExternalNav != nullptr) { fpExternalNav->CheckMode(mode); }
}
// ********************************************************************
@@ -445,7 +445,7 @@ inline
G4int G4Navigator::SeverityOfZeroStepping( G4int* noZeroSteps ) const
{
G4int severity = 0, noZeros = fNumberZeroSteps;
if( noZeroSteps )
if( noZeroSteps != nullptr )
{
*noZeroSteps = fNumberZeroSteps;
}
@@ -522,7 +522,7 @@ void G4Navigator::SetExternalNavigation(G4VExternalNavigation* externalNav)
inline
G4Navigator* G4Navigator::Clone() const
{
G4Navigator* clone_nav = new G4Navigator();
auto clone_nav = new G4Navigator();
clone_nav->SetWorldVolume(fTopPhysical);
if( fpExternalNav != nullptr )
{
@@ -88,10 +88,7 @@ G4NormalNavigation::LevelLocate( G4NavigationHistory& history,
found = true;
break;
}
else
{
history.BackLevel();
}
history.BackLevel();
}
}
}
@@ -56,7 +56,7 @@ class G4ParameterisedNavigation : public G4VoxelNavigation
public: // with description
G4ParameterisedNavigation();
~G4ParameterisedNavigation();
~G4ParameterisedNavigation() override;
inline G4SmartVoxelNode* ParamVoxelLocate( G4SmartVoxelHeader* pHead,
const G4ThreeVector& localPoint );
@@ -67,7 +67,7 @@ class G4ParameterisedNavigation : public G4VoxelNavigation
const G4ThreeVector& globalPoint,
const G4ThreeVector* globalDirection,
const G4bool pLocatedOnEdge,
G4ThreeVector& localPoint );
G4ThreeVector& localPoint ) override;
G4double ComputeStep( const G4ThreeVector& globalPoint,
const G4ThreeVector& globalDirection,
@@ -79,11 +79,11 @@ class G4ParameterisedNavigation : public G4VoxelNavigation
G4bool& exiting,
G4bool& entering,
G4VPhysicalVolume *(*pBlockedPhysical),
G4int& blockedReplicaNo );
G4int& blockedReplicaNo ) override;
G4double ComputeSafety( const G4ThreeVector& localPoint,
const G4NavigationHistory& history,
const G4double pProposedMaxLength=DBL_MAX );
const G4double pProposedMaxLength=DBL_MAX ) override;
private:
@@ -36,9 +36,10 @@
#ifndef G4PartialPhantomParameterisation_HH
#define G4PartialPhantomParameterisation_HH
#include <vector>
#include <set>
#include <map>
#include <set>
#include <utility>
#include <vector>
#include "G4Types.hh"
#include "G4PhantomParameterisation.hh"
@@ -54,16 +55,16 @@ class G4PartialPhantomParameterisation : public G4PhantomParameterisation
public: // with description
G4PartialPhantomParameterisation();
~G4PartialPhantomParameterisation();
~G4PartialPhantomParameterisation() override;
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const;
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override;
G4Material* ComputeMaterial(const G4int repNo,
G4VPhysicalVolume *currentVol,
const G4VTouchable *parentTouch = nullptr);
const G4VTouchable *parentTouch = nullptr) override;
G4int GetReplicaNo( const G4ThreeVector& localPoint,
const G4ThreeVector& localDir );
const G4ThreeVector& localDir ) override;
// Get the voxel number corresponding to the point in the container
// frame. Use 'localDir' to avoid precision problems at the surfaces.
@@ -77,12 +78,12 @@ class G4PartialPhantomParameterisation : public G4PhantomParameterisation
void SetFilledIDs( std::multimap<G4int,G4int> fid )
{
fFilledIDs = fid;
fFilledIDs = std::move(fid);
}
void SetFilledMins( std::map< G4int, std::map<G4int,G4int> > fmins )
{
fFilledMins = fmins;
fFilledMins = std::move(fmins);
}
void BuildContainerWalls();
@@ -50,9 +50,8 @@
class G4TransportationManager;
class G4Navigator;
#include "G4TouchableHandle.hh"
#include "G4FieldTrack.hh"
#include "G4MultiNavigator.hh"
#include "G4TouchableHandle.hh"
class G4PropagatorInField;
@@ -70,43 +70,43 @@ class G4PhantomParameterisation : public G4VPVParameterisation
public:
G4PhantomParameterisation();
~G4PhantomParameterisation();
~G4PhantomParameterisation() override;
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const;
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override;
virtual G4VSolid* ComputeSolid(const G4int, G4VPhysicalVolume *);
G4VSolid* ComputeSolid(const G4int, G4VPhysicalVolume *) override;
virtual G4Material* ComputeMaterial(const G4int repNo,
G4Material* ComputeMaterial(const G4int repNo,
G4VPhysicalVolume* currentVol,
const G4VTouchable* parentTouch=nullptr);
const G4VTouchable* parentTouch=nullptr) override;
// Dummy declarations ...
void ComputeDimensions (G4Box &, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Tubs&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Trd&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Trap&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Cons&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Orb&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Sphere&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Ellipsoid&,const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Torus&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Para&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Hype&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Polycone&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void ComputeDimensions (G4Polyhedra&, const G4int,
const G4VPhysicalVolume*) const {}
const G4VPhysicalVolume*) const override {}
void BuildContainerSolid( G4VPhysicalVolume* pPhysicalVol );
void BuildContainerSolid( G4VSolid* pMotherSolid );
@@ -123,8 +123,18 @@ class G4PropagatorInField
// Their new behaviour is to change the values for the global field
// manager
inline void SetLargestAcceptableStep( G4double newBigDist );
inline G4double GetLargestAcceptableStep();
void SetLargestAcceptableStep( G4double newBigDist );
G4double GetLargestAcceptableStep();
void ResetLargestAcceptableStep();
// Obtain / change the size of the largest step the method will undertake
// Reset method uses the world volume's
G4double GetMaxStepSizeMultiplier();
void SetMaxStepSizeMultiplier(G4double vm);
// Control extra Multiplier parameter for limiting long steps.
G4double GetMinBigDistance();
void SetMinBigDistance(G4double val);
// Control minimum 'directional' distance in case of too-large step
void SetTrajectoryFilter(G4VCurvedTrajectoryFilter* filter);
// Set the filter that examines & stores 'intermediate'
@@ -210,7 +220,7 @@ class G4PropagatorInField
void ReportLoopingParticle( G4int count, G4double StepTaken,
G4double stepRequest, const char* methodName,
G4ThreeVector momentumVec,
const G4ThreeVector& momentumVec,
G4VPhysicalVolume* physVol);
void ReportStuckParticle(G4int noZeroSteps, G4double proposedStep,
G4double lastTriedStep, G4VPhysicalVolume* physVol);
@@ -238,9 +248,15 @@ class G4PropagatorInField
G4int fAbandonThreshold_NoZeroSteps = 50; // Threshold # to abandon
G4double fZeroStepThreshold = 0.0;
// Threshold *length* for counting of tiny or 'zero' steps
// Parameters related to handling of very large steps which
// occur typically in large volumes with vacuum or very thin gas
G4double fLargestAcceptableStep;
// Maximum size of a step - for optimization (and to avoid problems)
G4double fMaxStepSizeMultiplier = 3;
// Multiplier for directional exit distance used as extra long-step limit
G4double fMinBigDistance= 100. ; // * CLHEP::mm
// Minimum distance added to directional exit distance
// ** End of PARAMETERS -----
G4double kCarTolerance;
@@ -204,25 +204,6 @@ void G4PropagatorInField::SetMaximumEpsilonStep( G4double newEpsMax )
fDetectorFieldMgr->SetMaximumEpsilonStep( newEpsMax );
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetLargestAcceptableStep( G4double newBigDist )
{
if( fLargestAcceptableStep>0.0 )
{
fLargestAcceptableStep = newBigDist;
}
}
// ------------------------------------------------------------------------
//
inline
G4double G4PropagatorInField::GetLargestAcceptableStep()
{
return fLargestAcceptableStep;
}
// ------------------------------------------------------------------------
//
inline
@@ -238,18 +219,28 @@ void G4PropagatorInField::SetThresholdNoZeroStep( G4int noAct,
G4int noHarsh,
G4int noAbandon )
{
if( noAct>0 )
if( noAct>0 )
{
fActionThreshold_NoZeroSteps = noAct;
}
if( noHarsh > fActionThreshold_NoZeroSteps )
{
fSevereActionThreshold_NoZeroSteps = noHarsh;
}
else
{
fSevereActionThreshold_NoZeroSteps = 2*(fActionThreshold_NoZeroSteps+1);
}
if( noAbandon > fSevereActionThreshold_NoZeroSteps+5 )
{
fAbandonThreshold_NoZeroSteps = noAbandon;
}
else
{
fAbandonThreshold_NoZeroSteps = 2*(fSevereActionThreshold_NoZeroSteps+3);
}
}
// ------------------------------------------------------------------------
@@ -313,7 +304,7 @@ SetNavigatorForPropagating( G4Navigator* SimpleOrMultiNavigator )
if (SimpleOrMultiNavigator != nullptr)
{
fNavigator = SimpleOrMultiNavigator;
if( fIntersectionLocator )
if( fIntersectionLocator != nullptr )
{
fIntersectionLocator->SetNavigatorFor( SimpleOrMultiNavigator );
}
@@ -442,7 +433,7 @@ void G4PropagatorInField::SetIterationsToIncreaseChordDistance(G4int numIters)
if(numIters <= 0)
{
// Disables relaxation
if( fVerboseLevel ){
if( fVerboseLevel != 0 ){
G4cout << "G4PropagatorInField: Turned OFF the Relaxation of chord "
<< "finder as iteration threshold = " << numIters
<< " is not positive." << G4endl;
@@ -117,7 +117,7 @@ class G4RegularNavigation
private:
G4int fverbose = false;
G4int fverbose = 0;
G4bool fcheck = false;
G4NormalNavigation* fnormalNav = nullptr;
@@ -68,7 +68,7 @@ struct G4ExitNormal
public:
G4ExitNormal(G4ThreeVector norm = G4ThreeVector(0.,0.,0.),
G4ExitNormal(const G4ThreeVector& norm = G4ThreeVector(0.,0.,0.),
G4bool calc = false,
G4bool valid= false,
ESide side = kNull )
@@ -162,7 +162,7 @@ class G4ReplicaNavigation
const G4int replicaNo,
G4ExitNormal& foundNormal ) const;
inline void SetPhiTransformation( const G4double ang,
G4VPhysicalVolume* pVol=0 ) const;
G4VPhysicalVolume* pVol=nullptr ) const;
private:
// Invariants - unaltered during navigation
@@ -66,7 +66,7 @@ G4ReplicaNavigation::VoxelLocate( const G4SmartVoxelHeader* pHead,
break;
case kPhi:
coord = localPoint.phi();
if ( (coord<0) && (coord<targetHeaderMin) ) coord += CLHEP::twopi;
if ( (coord<0) && (coord<targetHeaderMin) ) { coord += CLHEP::twopi; }
break;
case kRadial3D:
default:
@@ -105,17 +105,25 @@ G4ReplicaNavigation::VoxelLocate( const G4SmartVoxelHeader* pHead,
if ( (targetHeaderAxis==kPhi)
&& (targetHeaderMin==0) && (targetHeaderMax==CLHEP::twopi) )
{
if ( targetNodeNo<0 )
if ( targetNodeNo<0 )
{
targetNodeNo = targetHeaderNoSlices-1;
}
else if ( targetNodeNo>=targetHeaderNoSlices )
{
targetNodeNo = 0;
}
}
else
{
if( targetNodeNo<0 )
{
targetNodeNo = 0;
}
else if ( targetNodeNo>=targetHeaderNoSlices )
{
targetNodeNo = targetHeaderNoSlices-1;
}
}
}
}
@@ -49,17 +49,17 @@ class G4SimpleLocator : public G4VIntersectionLocator
G4SimpleLocator(G4Navigator* aNavigator);
// Constructor
~G4SimpleLocator();
~G4SimpleLocator() override;
// Default destructor
G4bool EstimateIntersectionPoint(
const G4FieldTrack& curveStartPointTangent, // A
const G4FieldTrack& curveEndPointTangent, // B
const G4ThreeVector& trialPoint, // E
G4FieldTrack& intersectPointTangent, // Output
G4bool& recalculatedEndPoint, // Out
G4double& fPreviousSafety, // In/Out
G4ThreeVector& fPreviousSftOrigin); // In/Out
const G4FieldTrack& curveStartPointTangent, // A
const G4FieldTrack& curveEndPointTangent, // B
const G4ThreeVector& trialPoint, // E
G4FieldTrack& intersectPointTangent, // Output
G4bool& recalculatedEndPoint, // Out
G4double& fPreviousSafety, // In/Out
G4ThreeVector& fPreviousSftOrigin) override; // In/Out
// If such an intersection exists, this function calculates the
// intersection point of the true path of the particle with the surface
// of the current volume (or of one of its daughters).
@@ -108,9 +108,8 @@ inline
std::vector<G4Navigator*>::iterator
G4TransportationManager::GetActiveNavigatorsIterator()
{
std::vector<G4Navigator*>::iterator iterator
= std::vector<G4Navigator*>::iterator(fActiveNavigators.begin());
return iterator;
auto iter = std::vector<G4Navigator*>::iterator(fActiveNavigators.begin());
return iter;
}
// ----------------------------------------------------------------------------
@@ -133,9 +132,8 @@ inline
std::vector<G4VPhysicalVolume*>::iterator
G4TransportationManager::GetWorldsIterator()
{
std::vector<G4VPhysicalVolume*>::iterator iterator
= std::vector<G4VPhysicalVolume*>::iterator(fWorlds.begin());
return iterator;
auto iter = std::vector<G4VPhysicalVolume*>::iterator(fWorlds.begin());
return iter;
}
// ----------------------------------------------------------------------------
@@ -160,7 +160,7 @@ G4VIntersectionLocator::IntersectChord( const G4ThreeVector& StartPointA,
IntersectionPoint = StartPointA + LinearStepLength * ChordAB_Dir;
}
}
if( ptrCalledNavigator )
if( ptrCalledNavigator != nullptr )
{
*ptrCalledNavigator = CalledNavigator;
}
@@ -118,7 +118,7 @@ G4VoxelNavigation::LevelLocate( G4NavigationHistory& history,
targetVoxelNode = VoxelLocate(targetVoxelHeader,localPoint);
targetNoDaughters = G4int(targetVoxelNode->GetNoContained());
if ( targetNoDaughters==0 ) return false;
if ( targetNoDaughters==0 ) { return false; }
//
// Search daughters in volume
@@ -147,10 +147,7 @@ G4VoxelNavigation::LevelLocate( G4NavigationHistory& history,
localPoint = samplePoint;
return true;
}
else
{
history.BackLevel();
}
history.BackLevel();
}
}
return false;