Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -39,7 +39,8 @@
// which will be used to update the post-step point's safety.
//
// =======================================================================
// Modified:
// Modified:
// 10 Jan 2015, M.Kelsey: Use G4DynamicParticle mass, NOT PDGMass
// 28 Oct 2011, P.Gumpl./J.Ap: Detect gravity field, use magnetic moment
// 20 Nov 2008, J.Apostolakis: Push safety to helper - after ComputeSafety
// 9 Nov 2007, J.Apostolakis: Flag for short steps, push safety to helper
@@ -72,6 +73,9 @@
class G4VSensitiveDetector;
G4bool G4Transportation::fUseMagneticMoment=false;
// #define G4DEBUG_TRANSPORT 1
//////////////////////////////////////////////////////////////////////////
//
// Constructor
@@ -86,7 +90,11 @@ G4Transportation::G4Transportation( G4int verbosity )
fEndGlobalTimeComputed(false),
fCandidateEndGlobalTime(0.0),
fParticleIsLooping( false ),
fNewTrack( true ),
fFirstStepInVolume( true ),
fLastStepInVolume( false ),
fGeometryLimitedStep(true),
fFieldExertedForce( false ),
fPreviousSftOrigin( 0.,0.,0. ),
fPreviousSafety( 0.0 ),
// fParticleChange(),
@@ -173,6 +181,13 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
//
*selection = CandidateForSelection ;
fFirstStepInVolume= fNewTrack || fLastStepInVolume;
// G4cout << " Transport::AlongStep GPIL: 1st-step= " << fFirstStepInVolume << " newTrack= " << fNewTrack << " fLastStep-in-Vol= " << fLastStepInVolume << G4endl;
fLastStepInVolume= false;
fNewTrack = false;
fParticleChange.ProposeFirstStepInVolume(fFirstStepInVolume);
// Get initial Energy/Momentum of the track
//
const G4DynamicParticle* pParticle = track.GetDynamicParticle() ;
@@ -201,7 +216,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
//
G4double particleCharge = pParticle->GetCharge() ;
G4double magneticMoment = pParticle->GetMagneticMoment() ;
G4double restMass = pParticleDef->GetPDGMass() ;
G4double restMass = pParticle->GetMass() ;
fGeometryLimitedStep = false ;
// fEndGlobalTimeComputed = false ;
@@ -245,6 +260,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
}
// G4cout << " G4Transport: field exerts force= " << fieldExertsForce
// << " fieldMgr= " << fieldMgr << G4endl;
fFieldExertedForce = fieldExertsForce;
if( !fieldExertsForce )
{
@@ -341,16 +357,14 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
currentMinimumStep,
currentSafety,
track.GetVolume() ) ;
fGeometryLimitedStep= lengthAlongCurve < currentMinimumStep;
if( fGeometryLimitedStep )
{
geometryStepLength = lengthAlongCurve ;
}
else
{
geometryStepLength = currentMinimumStep ;
}
fGeometryLimitedStep= fFieldPropagator->IsLastStepInVolume();
// It is possible that step was reduced in PropagatorInField due to previous zero steps
// To cope with case that reduced step is taken in full, we must rely on PiF to obtain this
// value.
geometryStepLength = std::min( lengthAlongCurve, currentMinimumStep );
// Remember last safety origin & value.
//
fPreviousSftOrigin = startPosition ;
@@ -635,7 +649,8 @@ G4double G4Transportation::
PostStepGetPhysicalInteractionLength( const G4Track&,
G4double, // previousStepSize
G4ForceCondition* pForceCond )
{
{
fFieldExertedForce = false; // Not known
*pForceCond = Forced ;
return DBL_MAX ; // was kInfinity ; but convention now is DBL_MAX
}
@@ -681,22 +696,11 @@ G4VParticleChange* G4Transportation::PostStepDoIt( const G4Track& track,
fParticleChange.SetTouchableHandle( fCurrentTouchableHandle ) ;
// Update the Step flag which identifies the Last Step in a volume
isLastStep = fLinearNavigator->ExitedMotherVolume()
| fLinearNavigator->EnteredDaughterVolume() ;
#ifdef G4DEBUG_TRANSPORT
// Checking first implementation of flagging Last Step in Volume
//
G4bool exiting = fLinearNavigator->ExitedMotherVolume();
G4bool entering = fLinearNavigator->EnteredDaughterVolume();
if( ! (exiting || entering) )
{
G4cout << " Transport> : Proposed isLastStep= " << isLastStep
<< " Exiting " << fLinearNavigator->ExitedMotherVolume()
<< " Entering " << fLinearNavigator->EnteredDaughterVolume()
<< G4endl;
}
#endif
if( !fFieldExertedForce )
isLastStep = fLinearNavigator->ExitedMotherVolume()
| fLinearNavigator->EnteredDaughterVolume() ;
else
isLastStep = fFieldPropagator->IsLastStepInVolume();
}
else // fGeometryLimitedStep is false
{
@@ -713,15 +717,10 @@ G4VParticleChange* G4Transportation::PostStepDoIt( const G4Track& track,
retCurrentTouchable = track.GetTouchableHandle() ;
isLastStep= false;
#ifdef G4DEBUG_TRANSPORT
// Checking first implementation of flagging Last Step in Volume
//
G4cout << " Transport> Proposed isLastStep= " << isLastStep
<< " Geometry did not limit step. " << G4endl;
#endif
} // endif ( fGeometryLimitedStep )
fLastStepInVolume= isLastStep;
fParticleChange.ProposeFirstStepInVolume(fFirstStepInVolume);
fParticleChange.ProposeLastStepInVolume(isLastStep);
const G4VPhysicalVolume* pNewVol = retCurrentTouchable->GetVolume() ;
@@ -775,7 +774,10 @@ void
G4Transportation::StartTracking(G4Track* aTrack)
{
G4VProcess::StartTracking(aTrack);
fNewTrack= true;
fFirstStepInVolume= true;
fLastStepInVolume= false;
// The actions here are those that were taken in AlongStepGPIL
// when track.GetCurrentStepNumber()==1
@@ -810,6 +812,9 @@ G4Transportation::StartTracking(G4Track* aTrack)
// Update the current touchable handle (from the track's)
//
fCurrentTouchableHandle = aTrack->GetTouchableHandle();
// Inform field propagator of new track
fFieldPropagator->PrepareNewTrack();
}
#include "G4CoupledTransportation.hh"