Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
@@ -23,23 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// ------------------------------------------------------------------------
// GEANT 4 inline implementation
//
// ------------------------------------------------------------------------
//
// 25.10.96 John Apostolakis, design and implementation
// 25.03.97 John Apostolakis, adaptation for G4Transportation and cleanup
// class G4PropagatorInField Inline implementation
//
// To create an object of this type, must have:
// - an object that calculates the Curved paths
// - the navigator to find (linear) intersections
// - and ?? also must know the value of the maximum displacement allowed
// - and also must know the value of the maximum displacement allowed
//
// 25.10.96 John Apostolakis, design and implementation
// 25.03.97 John Apostolakis, adaptation for G4Transportation and cleanup
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
//
inline
G4ChordFinder* G4PropagatorInField::GetChordFinder()
{
@@ -49,107 +45,155 @@ G4ChordFinder* G4PropagatorInField::GetChordFinder()
return fCurrentFieldMgr->GetChordFinder();
}
// Obtain the final space-point and velocity (normal) at the end of the Step
// ------------------------------------------------------------------------
// Obtain the final space-point and velocity (normal) at the end of the Step
//
inline
G4ThreeVector G4PropagatorInField::EndPosition() const
G4ThreeVector G4PropagatorInField::EndPosition() const
{
return End_PointAndTangent.GetPosition();
return End_PointAndTangent.GetPosition();
}
// ------------------------------------------------------------------------
//
inline
G4ThreeVector G4PropagatorInField::EndMomentumDir() const
{
return End_PointAndTangent.GetMomentumDir();
return End_PointAndTangent.GetMomentumDir();
}
// ------------------------------------------------------------------------
//
inline
G4double G4PropagatorInField::GetEpsilonStep() const
{
return fEpsilonStep;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetEpsilonStep( G4double newEps )
void G4PropagatorInField::SetEpsilonStep( G4double newEps )
{
fEpsilonStep=newEps;
fEpsilonStep = newEps;
}
// ------------------------------------------------------------------------
//
inline
G4bool G4PropagatorInField::IsParticleLooping() const
G4bool G4PropagatorInField::IsParticleLooping() const
{
return fParticleIsLooping;
}
// ------------------------------------------------------------------------
//
inline
G4int G4PropagatorInField::GetMaxLoopCount() const
G4int G4PropagatorInField::GetMaxLoopCount() const
{
return fMax_loop_count;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetMaxLoopCount( G4int new_max )
void G4PropagatorInField::SetMaxLoopCount( G4int new_max )
{
fMax_loop_count = new_max;
}
// #if 0
// ------------------------------------------------------------------------
//
inline
G4double G4PropagatorInField::GetDeltaIntersection() const
{
return fCurrentFieldMgr->GetDeltaIntersection();
}
// ------------------------------------------------------------------------
//
inline
G4double G4PropagatorInField::GetDeltaOneStep() const
{
return fCurrentFieldMgr->GetDeltaOneStep();
}
// #endif
// ------------------------------------------------------------------------
//
inline
G4int G4PropagatorInField::GetVerboseLevel() const
{
return fVerboseLevel;
}
// ------------------------------------------------------------------------
//
inline
G4int G4PropagatorInField::Verbose() const // Obsolete
G4int G4PropagatorInField::Verbose() const // Obsolete
{
return GetVerboseLevel();
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetVerboseTrace( G4bool enable )
{
fVerbTracePiF = enable;
}
// ------------------------------------------------------------------------
//
inline
G4bool G4PropagatorInField::GetVerboseTrace()
{
return fVerbTracePiF;
}
// ------------------------------------------------------------------------
//
inline
G4FieldTrack G4PropagatorInField::GetEndState() const
{
return End_PointAndTangent;
}
// ------------------------------------------------------------------------
// Minimum for Relative accuracy of a Step in volumes of global field
//
inline
G4double G4PropagatorInField::GetMinimumEpsilonStep() const
{
return fDetectorFieldMgr->GetMinimumEpsilonStep();
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetMinimumEpsilonStep( G4double newEpsMin )
void G4PropagatorInField::SetMinimumEpsilonStep( G4double newEpsMin )
{
fDetectorFieldMgr->SetMinimumEpsilonStep(newEpsMin);
}
// ------------------------------------------------------------------------
// Maximum for Relative accuracy of any Step
//
inline
G4double G4PropagatorInField::GetMaximumEpsilonStep() const
{
return fDetectorFieldMgr->GetMaximumEpsilonStep();
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetMaximumEpsilonStep( G4double newEpsMax )
void G4PropagatorInField::SetMaximumEpsilonStep( G4double newEpsMax )
{
fDetectorFieldMgr->SetMaximumEpsilonStep( newEpsMax );
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetLargestAcceptableStep( G4double newBigDist )
{
@@ -159,18 +203,24 @@ void G4PropagatorInField::SetLargestAcceptableStep( G4double newBigDist )
}
}
// ------------------------------------------------------------------------
//
inline
G4double G4PropagatorInField::GetLargestAcceptableStep()
{
return fLargestAcceptableStep;
}
// ------------------------------------------------------------------------
//
inline
G4FieldManager* G4PropagatorInField::GetCurrentFieldManager()
G4FieldManager* G4PropagatorInField::GetCurrentFieldManager()
{
return fCurrentFieldMgr;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetThresholdNoZeroStep( G4int noAct,
G4int noHarsh,
@@ -190,6 +240,8 @@ void G4PropagatorInField::SetThresholdNoZeroStep( G4int noAct,
fAbandonThreshold_NoZeroSteps = 2*(fSevereActionThreshold_NoZeroSteps+3);
}
// ------------------------------------------------------------------------
//
inline
G4int G4PropagatorInField::GetThresholdNoZeroSteps( G4int i )
{
@@ -202,77 +254,100 @@ G4int G4PropagatorInField::GetThresholdNoZeroSteps( G4int i )
return t;
}
// ------------------------------------------------------------------------
//
inline G4double G4PropagatorInField::GetZeroStepThreshold()
{
return fZeroStepThreshold;
}
inline void G4PropagatorInField::SetZeroStepThreshold( G4double newLength )
// ------------------------------------------------------------------------
//
inline void G4PropagatorInField::SetZeroStepThreshold( G4double newLength )
{
fZeroStepThreshold= newLength;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::SetDetectorFieldManager(G4FieldManager* newDetectorFieldManager)
void G4PropagatorInField::SetDetectorFieldManager(G4FieldManager* newDFMan)
{
fDetectorFieldMgr = newDetectorFieldManager;
fDetectorFieldMgr = newDFMan;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField:: SetUseSafetyForOptimization( G4bool value )
{
fUseSafetyForOptimisation= value;
fUseSafetyForOptimisation = value;
}
// ------------------------------------------------------------------------
//
inline
G4bool G4PropagatorInField::GetUseSafetyForOptimization()
{
return fUseSafetyForOptimisation;
return fUseSafetyForOptimisation;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::
SetNavigatorForPropagating( G4Navigator *SimpleOrMultiNavigator )
SetNavigatorForPropagating( G4Navigator* SimpleOrMultiNavigator )
{
if(SimpleOrMultiNavigator) {
fNavigator= SimpleOrMultiNavigator;
if( fIntersectionLocator ) {
fIntersectionLocator->SetNavigatorFor( SimpleOrMultiNavigator );
}
if (SimpleOrMultiNavigator != nullptr)
{
fNavigator = SimpleOrMultiNavigator;
if( fIntersectionLocator )
{
fIntersectionLocator->SetNavigatorFor( SimpleOrMultiNavigator );
}
}
}
// ------------------------------------------------------------------------
//
inline
G4Navigator* G4PropagatorInField::GetNavigatorForPropagating()
{
return fNavigator;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::
SetIntersectionLocator( G4VIntersectionLocator *pIntLoc )
SetIntersectionLocator( G4VIntersectionLocator* pIntLoc )
{
if(pIntLoc) {
fIntersectionLocator= pIntLoc;
if (pIntLoc != nullptr)
{
fIntersectionLocator= pIntLoc;
// Ensure that the Intersection Locator uses the correct Navigator
pIntLoc->SetNavigatorFor( fNavigator );
// Ensure that the Intersection Locator uses the correct Navigator
//
pIntLoc->SetNavigatorFor( fNavigator );
}
}
// ------------------------------------------------------------------------
//
inline
G4VIntersectionLocator* G4PropagatorInField::GetIntersectionLocator()
{
return fIntersectionLocator;
}
// ------------------------------------------------------------------------
//
inline
G4bool G4PropagatorInField::IntersectChord( const G4ThreeVector& StartPointA,
const G4ThreeVector& EndPointB,
G4double &NewSafety,
G4double &LinearStepLength,
G4ThreeVector &IntersectionPoint )
G4bool G4PropagatorInField::IntersectChord( const G4ThreeVector& StartPointA,
const G4ThreeVector& EndPointB,
G4double& NewSafety,
G4double& LinearStepLength,
G4ThreeVector& IntersectionPoint )
{
// Calculate the direction and length of the chord AB
//
@@ -286,8 +361,7 @@ G4bool G4PropagatorInField::IntersectChord( const G4ThreeVector& StartPointA,
<< G4endl;
#endif
G4bool retVal=
fIntersectionLocator
G4bool retVal= fIntersectionLocator
->IntersectChord(StartPointA,EndPointB,NewSafety,
fPreviousSafety,fPreviousSftOrigin,
LinearStepLength,IntersectionPoint);
@@ -304,12 +378,62 @@ G4bool G4PropagatorInField::IntersectChord( const G4ThreeVector& StartPointA,
return retVal;
}
// ------------------------------------------------------------------------
//
inline G4bool G4PropagatorInField::IsFirstStepInVolume()
{
return fFirstStepInVolume;
}
// ------------------------------------------------------------------------
//
inline G4bool G4PropagatorInField::IsLastStepInVolume()
{
return fLastStepInVolume;
}
// ------------------------------------------------------------------------
//
inline void G4PropagatorInField::PrepareNewTrack()
{
fNewTrack = true;
fFirstStepInVolume = false;
fLastStepInVolume = false;
}
// ------------------------------------------------------------------------
//
inline G4EquationOfMotion* G4PropagatorInField::GetCurrentEquationOfMotion()
{
if(auto pChordFinder = GetChordFinder()) {
if(auto pIntDriver = pChordFinder->GetIntegrationDriver()) {
if (auto pChordFinder = GetChordFinder())
{
if (auto pIntDriver = pChordFinder->GetIntegrationDriver())
{
return pIntDriver->GetEquationOfMotion();
}
}
return nullptr;
}
// ------------------------------------------------------------------------
//
G4int G4PropagatorInField::GetIterationsToIncreaseChordDistance() const
{
return fIncreaseChordDistanceThreshold;
}
// ------------------------------------------------------------------------
//
void G4PropagatorInField::SetIterationsToIncreaseChordDistance(G4int numIters)
{
fIncreaseChordDistanceThreshold = numIters;
if(numIters <= 0)
{
// Disables relaxation
if( fVerboseLevel ){
G4cout << "G4PropagatorInField: Turned OFF the Relaxation of chord "
<< "finder as iteration threshold = " << numIters
<< " is not positive." << G4endl;
}
}
}