Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
+37 -1
View File
@@ -1,4 +1,4 @@
$Id: History 87829 2015-01-14 17:19:59Z gcosmo $
$Id: History 105913 2017-08-28 08:39:12Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,42 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
August 28th 2017, G.Cosmo transport-V10-03-02
--------------------------------
- Make appropriate setting/use of verbosity from base class G4VProcess,
instead of re-defining/using local verbosity flag in G4Transportation
and G4CoupledTransportation.
Addressing problem report #1999.
August 28th 2017, G.Cosmo transport-V10-03-01
--------------------------------
- Fixed use of G4DEBUG_TRANSPORT flag in G4CoupledTransportation.
August 25th 2017, J.Apostolakis transport-V10-03-00
--------------------------------
- G4CoupledTransportation & G4Transportation: obtain equation of motion
using dedicated method of ProgatorInField.
Smaller code, and future proof.
February 12th 2015, J.Apostolakis transport-V10-01-03
--------------------------------
- G4CoupledTransportation:: Made SignifyStepInAnyVolume 'flag' static.
Stoped using IsLastStepInVolume for step limitation.
January 20th 2015, J.Apostolakis transport-V10-01-02
--------------------------------
- G4CoupledTransportation: Added ability to identify first step in a volume in either
the mass geometry or in any geometry. Also added flag for last step in a volume
in the mass geometry.
Extends fix of tag transport-V10-01-00.
Since it is not clear whether user wants/needs to identify the first/last in
any geometry or just in the mass geometry, allowing this to be a choice:
Configurable: whether the flag represents a first/last step in mass geometry
or any geometry (currently the default - what was the case for last step before).
Also depends in geomnav-V10-01-02 and track-V10-01-00.
Addresses Bugzilla issue #1032.
January 10th 2014, M.Kelsey transport-V10-01-01
---------------------------
- G4Transportation.cc, G4CoupledTransportation: In
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CoupledTransportation.hh 86964 2014-11-21 11:47:44Z gcosmo $
// $Id: G4CoupledTransportation.hh 105913 2017-08-28 08:39:12Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -101,11 +101,6 @@ class G4CoupledTransportation : public G4VProcess
void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
// Access/set the assistant class that Propagate in a Field.
inline void SetVerboseLevel( G4int verboseLevel );
inline G4int GetVerboseLevel() const;
// Level of warnings regarding eg energy conservation
// in field integration.
inline G4double GetThresholdWarningEnergy() const;
inline G4double GetThresholdImportantEnergy() const;
inline G4int GetThresholdTrials() const;
@@ -127,6 +122,18 @@ class G4CoupledTransportation : public G4VProcess
static G4bool EnableUseMagneticMoment(G4bool useMoment=true);
// Whether to deflect particles with force due to magnetic moment
static void SetSignifyStepsInAnyVolume( G4bool anyVol ) { fSignifyStepInAnyVolume = anyVol; }
static G4bool GetSignifyStepsInAnyVolume( ) { return fSignifyStepInAnyVolume; }
// Flag in step corresponds to first/last step in a volume 'any' geometry (if this is true)
// or refers to first/last step in mass geometry only (if false).
// The following methods give access to first/last step in particular geometry
// *independent* of the choice of the 'Signify' flag.
G4bool IsFirstStepInAnyVolume() { return fFirstStepInAnyVolume; }
G4bool IsLastStepInAnyVolume() { return fAnyGeometryLimitedStep; }
G4bool IsFirstStepInMassVolume() { return fFirstStepInMassVolume; }
G4bool IsLastStepInMassVolume() { return fMassGeometryLimitedStep; }
public: // without description
void StartTracking(G4Track* aTrack);
@@ -181,7 +188,7 @@ class G4CoupledTransportation : public G4VProcess
G4double fCandidateEndGlobalTime;
G4bool fParticleIsLooping;
G4bool fNewTrack;
G4ThreeVector fPreviousSftOrigin;
G4double fPreviousMassSafety;
G4double fPreviousFullSafety;
@@ -221,15 +228,18 @@ class G4CoupledTransportation : public G4VProcess
G4SafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
// Verbosity
G4int fVerboseLevel;
// Verbosity level for warnings
// eg about energy non-conservation in magnetic field.
// Whether to track state change from magnetic moment in a B-field
private:
friend class G4Transportation;
static G4bool fUseMagneticMoment;
static G4bool fUseMagneticMoment;
private:
G4bool fFirstStepInMassVolume;
G4bool fFirstStepInAnyVolume;
// G4bool fLastStepInMassVolume; => use fMassGeometryLimitedStep
// G4bool fLastStepInAnyVolume; => use fAnyGeometryLimitedStep
static G4bool fSignifyStepInAnyVolume; // True: First/Last step in any one of the geometries
// False: First/last step flag signifies step in volume of 'mass' geometry
};
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CoupledTransportation.icc 84478 2014-10-16 08:49:24Z gcosmo $
// $Id: G4CoupledTransportation.icc 105913 2017-08-28 08:39:12Z gcosmo $
//
//
@@ -59,16 +59,6 @@ inline G4bool G4CoupledTransportation::DoesGlobalFieldExist()
return transportMgr->GetFieldManager()->DoesFieldExist();
}
inline void G4CoupledTransportation::SetVerboseLevel( G4int verboseLev )
{
fVerboseLevel= verboseLev;
}
inline G4int G4CoupledTransportation::GetVerboseLevel( ) const
{
return fVerboseLevel;
}
inline G4double G4CoupledTransportation::GetThresholdWarningEnergy() const
{
return fThreshold_Warning_Energy;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Transportation.hh 87829 2015-01-14 17:19:59Z gcosmo $
// $Id: G4Transportation.hh 105913 2017-08-28 08:39:12Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -98,11 +98,6 @@ class G4Transportation : public G4VProcess
void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
// Access/set the assistant class that Propagate in a Field.
inline void SetVerboseLevel( G4int verboseLevel );
inline G4int GetVerboseLevel() const;
// Level of warnings regarding eg energy conservation
// in field integration.
inline G4double GetThresholdWarningEnergy() const;
inline G4double GetThresholdImportantEnergy() const;
inline G4int GetThresholdTrials() const;
@@ -208,13 +203,6 @@ class G4Transportation : public G4VProcess
G4SafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
// Verbosity
G4int fVerboseLevel;
// Verbosity level for warnings
// eg about energy non-conservation in magnetic field.
// Whether to track state change from magnetic moment in a B-field
private:
friend class G4CoupledTransportation;
static G4bool fUseMagneticMoment;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Transportation.icc 84478 2014-10-16 08:49:24Z gcosmo $
// $Id: G4Transportation.icc 105913 2017-08-28 08:39:12Z gcosmo $
//
//
@@ -59,16 +59,6 @@ inline G4bool G4Transportation::DoesGlobalFieldExist()
return transportMgr->GetFieldManager()->DoesFieldExist();
}
inline void G4Transportation::SetVerboseLevel( G4int verboseLev )
{
fVerboseLevel= verboseLev;
}
inline G4int G4Transportation::GetVerboseLevel( ) const
{
return fVerboseLevel;
}
inline G4double G4Transportation::GetThresholdWarningEnergy() const
{
return fThreshold_Warning_Energy;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CoupledTransportation.cc 87829 2015-01-14 17:19:59Z gcosmo $
// $Id: G4CoupledTransportation.cc 105913 2017-08-28 08:39:12Z gcosmo $
//
// ------------------------------------------------------------
// GEANT 4 class implementation
@@ -59,6 +59,9 @@
class G4VSensitiveDetector;
G4bool G4CoupledTransportation::fSignifyStepInAnyVolume= false;
// This mode must apply to all threads
G4bool G4CoupledTransportation::fUseMagneticMoment=false;
//////////////////////////////////////////////////////////////////////////
//
@@ -74,6 +77,7 @@ G4CoupledTransportation::G4CoupledTransportation( G4int verbosity )
fEndGlobalTimeComputed(false),
fCandidateEndGlobalTime(0.0),
fParticleIsLooping( false ),
fNewTrack( true ),
fPreviousSftOrigin( 0.,0.,0. ),
fPreviousMassSafety( 0.0 ),
fPreviousFullSafety( 0.0 ),
@@ -85,10 +89,12 @@ G4CoupledTransportation::G4CoupledTransportation( G4int verbosity )
fThresholdTrials( 10 ),
fNoLooperTrials( 0 ),
fSumEnergyKilled( 0.0 ), fMaxEnergyKilled( 0.0 ),
fVerboseLevel( verbosity )
fFirstStepInMassVolume( true ),
fFirstStepInAnyVolume( true )
{
// set Process Sub Type
SetProcessSubType(static_cast<G4int>(COUPLED_TRANSPORTATION));
SetVerboseLevel(verbosity);
G4TransportationManager* transportMgr ;
@@ -98,12 +104,14 @@ G4CoupledTransportation::G4CoupledTransportation( G4int verbosity )
fFieldPropagator = transportMgr->GetPropagatorInField() ;
// fGlobalFieldMgr = transportMgr->GetFieldManager() ;
fNavigatorId= transportMgr->ActivateNavigator( fMassNavigator );
if( fVerboseLevel > 0 )
if( verboseLevel > 0 )
{
G4cout << " G4CoupledTransportation constructor: ----- " << G4endl;
G4cout << " Verbose level is " << fVerboseLevel << G4endl;
G4cout << " Verbose level is " << verboseLevel << G4endl;
G4cout << " Navigator Id obtained in G4CoupledTransportation constructor "
<< fNavigatorId << G4endl;
G4cout << " Reports First/Last in "
<< (fSignifyStepInAnyVolume ? " any " : " mass " ) << " geometry " << G4endl;
}
fPathFinder= G4PathFinder::GetInstance();
fpSafetyHelper = transportMgr->GetSafetyHelper(); // New
@@ -124,7 +132,7 @@ G4CoupledTransportation::~G4CoupledTransportation()
{
// fCurrentTouchableHandle is a data member - no deletion required
if( (fVerboseLevel > 0) || (fSumEnergyKilled > 0.0 ) )
if( (verboseLevel > 0) || (fSumEnergyKilled > 0.0 ) )
{
G4cout << " G4CoupledTransportation: Statistics for looping particles " << G4endl;
G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled << G4endl;
@@ -167,6 +175,20 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
//
*selection = CandidateForSelection ;
fFirstStepInMassVolume = fNewTrack | fMassGeometryLimitedStep ;
fFirstStepInAnyVolume = fNewTrack | fAnyGeometryLimitedStep ;
#ifdef G4DEBUG_TRANSPORT
G4cout << " CoupledTransport::AlongStep GPIL: "
<< " 1st-step: any= " <<fFirstStepInAnyVolume << " ( geom= " << fAnyGeometryLimitedStep << " ) "
<< " mass= " << fFirstStepInMassVolume << " ( geom= " << fMassGeometryLimitedStep << " ) "
<< " newTrack= " << fNewTrack << G4endl;
// G4cout << " fLastStep-in-Vol= " << fLastStepInVolume << G4endl;
#endif
// fLastStepInVolume= false;
fNewTrack = false;
// Get initial Energy/Momentum of the track
//
const G4DynamicParticle* pParticle = track.GetDynamicParticle() ;
@@ -176,7 +198,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
G4VPhysicalVolume* currentVolume= track.GetVolume();
#ifdef G4DEBUG_TRANSPORT
if( fVerboseLevel > 1 )
if( verboseLevel > 1 )
{
G4cout << "G4CoupledTransportation::AlongStepGPIL> called in volume "
<< currentVolume->GetName() << G4endl;
@@ -257,33 +279,8 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
if( fieldExertsForce )
{
G4EquationOfMotion* equationOfMotion = 0;
// equationOfMotion =
// (fFieldPropagator->GetChordFinder()->GetIntegrationDriver()->GetStepper())
// ->GetEquationOfMotion();
// Consolidate into auxiliary method G4EquationOfMotion* GetEquationOfMotion()
// equationOfMotion= fFieldPropagator->GetCurrentEquationOfMotion();
G4MagIntegratorStepper* pStepper= 0;
G4ChordFinder* pChordFinder= fFieldPropagator->GetChordFinder();
if( pChordFinder )
{
G4MagInt_Driver* pIntDriver= 0;
pIntDriver= pChordFinder->GetIntegrationDriver();
if( pIntDriver )
{
pStepper= pIntDriver->GetStepper();
}
if( pStepper )
{
equationOfMotion= pStepper->GetEquationOfMotion();
}
}
// End of proto GetEquationOfMotion()
auto equationOfMotion= fFieldPropagator->GetCurrentEquationOfMotion();
G4ChargeState chargeState(particleCharge, // The charge can change (dynamic)
magneticMoment,
pParticleDef->GetPDGSpin() );
@@ -295,9 +292,15 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
equationOfMotion->SetChargeMomentumMass( chargeState,
momentumMagnitude,
restMass );
}else{
G4cerr << " ERROR > Cannot find valid Equation of motion - Unable to pass Charge, Momentum and Mass " << G4endl;
}
#ifdef G4DEBUG_TRANSPORT
else
{
G4cerr << " ERROR in G4CoupledTransportation> "
<< "Cannot find valid Equation of motion: " << G4endl;
<< " Unable to pass Charge, Momentum and Mass " << G4endl;
}
#endif
}
G4ThreeVector polarizationVec = track.GetPolarization() ;
@@ -344,26 +347,21 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
{
fMassGeometryLimitedStep = true ;
}
fAnyGeometryLimitedStep = (fPathFinder->GetNumberGeometriesLimitingStep() != 0) ;
fAnyGeometryLimitedStep = (fPathFinder->GetNumberGeometriesLimitingStep() != 0);
//#ifdef G4DEBUG_TRANSPORT
#ifdef G4DEBUG_TRANSPORT
if( fMassGeometryLimitedStep && !fAnyGeometryLimitedStep )
{
G4cerr << " Error in determining geometries limiting the step" << G4endl;
G4cerr << " Limiting: mass=" << fMassGeometryLimitedStep
<< " any= " << fAnyGeometryLimitedStep << G4endl;
std::ostringstream message;
message << " ERROR in determining geometries limiting the step" << G4endl;
message << " Limiting: mass=" << fMassGeometryLimitedStep
<< " any= " << fAnyGeometryLimitedStep << G4endl;
message << "Incompatible conditions - by which geometries was it limited ?"<<G4endl;
G4Exception("G4CoupledTransportation::AlongStepGetPhysicalInteractionLength()",
"PathFinderConfused", FatalException,
"Incompatible conditions - was limited by a geometry?");
"PathFinderConfused", FatalException, message);
}
//#endif
// Other potential
// fAnyGeometryLimitedStep = newFullStep < currentMinimumStep;
// ^^^ Not good enough;
// Must compare with maximum requested step size
// (eg in case another process requested bigger, got this!)
#endif
geometryStepLength = std::min( lengthAlongCurve, currentMinimumStep);
@@ -379,7 +377,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
// fpSafetyHelper->SetCurrentSafety( newFullSafety, startPosition);
#ifdef G4DEBUG_TRANSPORT
if( fVerboseLevel > 1 )
if( verboseLevel > 1 )
{
G4cout << "G4Transport:CompStep> "
<< " called the pathfinder for a new step at " << startPosition
@@ -432,7 +430,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
{
#ifdef G4DEBUG_TRANSPORT
if( fVerboseLevel > 1 )
if( verboseLevel > 1 )
{
G4cout << " G4CT::CS End Position = " << fTransportEndPosition << G4endl;
G4cout << " G4CT::CS End Direction = " << fTransportEndMomentumDir << G4endl;
@@ -469,10 +467,10 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
// Possible statistics keeping here ...
}
#ifdef G4VERBOSE
if( (fVerboseLevel > 1) && ( absEdiff > perThousand * endEnergy) )
if( (verboseLevel > 1) && ( absEdiff > perThousand * endEnergy) )
{
ReportInexactEnergy(startEnergy, endEnergy);
} // end of if (fVerboseLevel)
} // end of if (verboseLevel)
#endif
// Correct the energy for fields that conserve it
// This - hides the integration error
@@ -656,13 +654,13 @@ G4CoupledTransportation::AlongStepDoIt( const G4Track& track,
if( endEnergy > fMaxEnergyKilled) { fMaxEnergyKilled= endEnergy; }
#ifdef G4VERBOSE
if((fVerboseLevel > 1) && ( endEnergy > fThreshold_Warning_Energy ))
if((verboseLevel > 1) && ( endEnergy > fThreshold_Warning_Energy ))
{
G4cout << " G4CoupledTransportation is killing track that is looping or stuck " << G4endl
<< " This track has " << track.GetKineticEnergy() / MeV
<< " MeV energy." << G4endl;
}
if( fVerboseLevel > 0 )
if( verboseLevel > 0 )
{
G4cout << " Steps by this track: " << track.GetCurrentStepNumber() << G4endl;
}
@@ -673,7 +671,7 @@ G4CoupledTransportation::AlongStepDoIt( const G4Track& track,
{
fNoLooperTrials ++;
#ifdef G4VERBOSE
if( (fVerboseLevel > 2) )
if( (verboseLevel > 2) )
{
G4cout << " ** G4CoupledTransportation::AlongStepDoIt(): Particle looping - " << G4endl
<< " Number of consecutive problem step (this track) = " << fNoLooperTrials << G4endl
@@ -743,11 +741,21 @@ G4VParticleChange* G4CoupledTransportation::PostStepDoIt( const G4Track& track,
fParticleChange.ProposeTrackStatus(track.GetTrackStatus()) ;
// G4cout << " CoupledTransportation::PostStepDoIt> particleChange: addr= " << &fParticleChange;
if( fSignifyStepInAnyVolume ){
fParticleChange.ProposeFirstStepInVolume( fFirstStepInAnyVolume );
// G4cout << " First Step In Any Volume = " << fFirstStepInAnyVolume << G4endl;
}else{
fParticleChange.ProposeFirstStepInVolume( fFirstStepInMassVolume );
// G4cout << " First Step In Mass Volume = " << fFirstStepInAnyVolume << G4endl;
}
// Check that the end position and direction are preserved
// since call to AlongStepDoIt
#ifdef G4DEBUG_TRANSPORT
if( ( fVerboseLevel > 0 )
if( ( verboseLevel > 0 )
&& ((fTransportEndPosition - track.GetPosition()).mag2() >= 1.0e-16) )
{
ReportMove( track.GetPosition(), fTransportEndPosition, "End of Step Position" );
@@ -757,7 +765,7 @@ G4VParticleChange* G4CoupledTransportation::PostStepDoIt( const G4Track& track,
// If the Step was determined by the volume boundary, relocate the particle
// The pathFinder will know that the geometry limited the step (!?)
if( fVerboseLevel > 0 )
if( verboseLevel > 0 )
{
G4cout << " Calling PathFinder::Locate() from "
<< " G4CoupledTransportation::PostStepDoIt " << G4endl;
@@ -780,12 +788,12 @@ G4VParticleChange* G4CoupledTransportation::PostStepDoIt( const G4Track& track,
fPathFinder->CreateTouchableHandle( fNavigatorId );
#ifdef G4DEBUG_TRANSPORT
if( fVerboseLevel > 0 )
if( verboseLevel > 0 )
{
G4cout << "G4CoupledTransportation::PostStepDoIt --- fNavigatorId = "
<< fNavigatorId << G4endl;
}
if( fVerboseLevel > 1 )
if( verboseLevel > 1 )
{
G4VPhysicalVolume* vol= fCurrentTouchableHandle->GetVolume();
G4cout << "CHECK !!!!!!!!!!! fCurrentTouchableHandle->GetVolume() = " << vol;
@@ -803,14 +811,11 @@ G4VParticleChange* G4CoupledTransportation::PostStepDoIt( const G4Track& track,
}
retCurrentTouchable = fCurrentTouchableHandle ;
// fParticleChange.SetTouchableHandle( fCurrentTouchableHandle ) ;
// Notify particle change that this is last step in volume
fParticleChange.ProposeLastStepInVolume(true);
}
else // fAnyGeometryLimitedStep is false
{
#ifdef G4DEBUG_TRANSPORT
if( fVerboseLevel > 1 )
if( verboseLevel > 1 )
{
G4cout << "G4CoupledTransportation::PostStepDoIt -- "
<< " fAnyGeometryLimitedStep = " << fAnyGeometryLimitedStep
@@ -832,11 +837,20 @@ G4VParticleChange* G4CoupledTransportation::PostStepDoIt( const G4Track& track,
//
retCurrentTouchable = track.GetTouchableHandle() ;
// fParticleChange.SetTouchableHandle( track.GetTouchableHandle() ) ;
// Have not reached a boundary
fParticleChange.ProposeLastStepInVolume(false);
} // endif ( fAnyGeometryLimitedStep )
#ifdef G4DEBUG_NAVIGATION
G4cout << " CoupledTransport::AlongStep GPIL: "
<< " last-step: any= " << fAnyGeometryLimitedStep << " . ..... x . "
<< " mass= " << fMassGeometryLimitedStep
<< G4endl;
#endif
if( fSignifyStepInAnyVolume )
fParticleChange.ProposeLastStepInVolume(fAnyGeometryLimitedStep);
else
fParticleChange.ProposeLastStepInVolume(fMassGeometryLimitedStep);
const G4VPhysicalVolume* pNewVol = retCurrentTouchable->GetVolume() ;
const G4Material* pNewMaterial = 0 ;
const G4VSensitiveDetector* pNewSensitiveDetector = 0 ;
@@ -891,7 +905,8 @@ G4CoupledTransportation::StartTracking(G4Track* aTrack)
G4TransportationManager::GetTransportationManager();
// G4VProcess::StartTracking(aTrack);
fNewTrack= true;
// The 'initialising' actions
// once taken in AlongStepGPIL -- if ( track.GetCurrentStepNumber()==1 )
@@ -900,13 +915,13 @@ G4CoupledTransportation::StartTracking(G4Track* aTrack)
fMassNavigator = transportMgr->GetNavigatorForTracking() ;
fNavigatorId= transportMgr->ActivateNavigator( fMassNavigator ); // Confirm it!
// if( fVerboseLevel > 1 ){
// if( verboseLevel > 1 ){
// G4cout << " Navigator Id obtained in StartTracking " << fNavigatorId << G4endl;
// }
G4ThreeVector position = aTrack->GetPosition();
G4ThreeVector direction = aTrack->GetMomentumDirection();
// if( fVerboseLevel > 1 ){
// if( verboseLevel > 1 ){
// G4cout << " Calling PathFinder::PrepareNewTrack from "
// << " G4CoupledTransportation::StartTracking -- which calls Locate()" << G4endl;
// }
@@ -944,7 +959,7 @@ G4CoupledTransportation::StartTracking(G4Track* aTrack)
fieldMgrStore->ClearAllChordFindersState();
#ifdef G4DEBUG_TRANSPORT
if( fVerboseLevel > 1 )
if( verboseLevel > 1 )
{
G4cout << " Returning touchable handle " << fCurrentTouchableHandle << G4endl;
}
@@ -982,7 +997,7 @@ ReportInexactEnergy(G4double startEnergy, G4double endEnergy)
<< " Ending E= " << std::setw(12) << endEnergy / MeV << " MeV " << G4endl;
G4cout << " Energy has been corrected -- however, review"
<< " field propagation parameters for accuracy." << G4endl;
if( (fVerboseLevel > 2 ) || (no_warnings<4) || (no_large_ediff == warnModulo * moduloFactor) )
if( (verboseLevel > 2 ) || (no_warnings<4) || (no_large_ediff == warnModulo * moduloFactor) )
{
G4cout << " These include EpsilonStepMax(/Min) in G4FieldManager "
<< " which determine fractional error per step for integrated quantities. " << G4endl
@@ -104,12 +104,12 @@ G4Transportation::G4Transportation( G4int verbosity )
fThresholdTrials( 10 ),
fNoLooperTrials( 0 ),
fSumEnergyKilled( 0.0 ), fMaxEnergyKilled( 0.0 ),
fShortStepOptimisation( false ), // Old default: true (=fast short steps)
fVerboseLevel( verbosity )
fShortStepOptimisation( false ) // Old default: true (=fast short steps)
{
// set Process Sub Type
SetProcessSubType(static_cast<G4int>(TRANSPORTATION));
pParticleChange= &fParticleChange; // Required to conform to G4VProcess
SetVerboseLevel(verbosity);
G4TransportationManager* transportMgr ;
@@ -132,7 +132,7 @@ G4Transportation::G4Transportation( G4int verbosity )
// Points to (G4VTouchable*) 0
#ifdef G4VERBOSE
if( fVerboseLevel > 0)
if( verboseLevel > 0)
{
G4cout << " G4Transportation constructor> set fShortStepOptimisation to ";
if ( fShortStepOptimisation ) G4cout << "true" << G4endl;
@@ -145,7 +145,7 @@ G4Transportation::G4Transportation( G4int verbosity )
G4Transportation::~G4Transportation()
{
if( (fVerboseLevel > 0) && (fSumEnergyKilled > 0.0 ) )
if( (verboseLevel > 0) && (fSumEnergyKilled > 0.0 ) )
{
G4cout << " G4Transportation: Statistics for looping particles " << G4endl;
G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled << G4endl;
@@ -182,12 +182,9 @@ 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() ;
@@ -327,11 +324,8 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
// For insurance, could set it again
// chargeState.SetPDGSpin(pParticleDef->GetPDGSpin() ); // Provisionally in same object
G4EquationOfMotion* equationOfMotion =
(fFieldPropagator->GetChordFinder()->GetIntegrationDriver()->GetStepper())
->GetEquationOfMotion();
G4EquationOfMotion* equationOfMotion = fFieldPropagator->GetCurrentEquationOfMotion();
// equationOfMotion->SetChargeMomentumMass( particleCharge,
equationOfMotion->SetChargeMomentumMass( chargeState,
momentumMagnitude,
restMass);
@@ -418,7 +412,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
no_inexact_steps++;
// Possible statistics keeping here ...
}
if( fVerboseLevel > 1 )
if( verboseLevel > 1 )
{
if( std::fabs(startEnergy- endEnergy) > perThousand * endEnergy )
{
@@ -436,7 +430,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
<< " Ending E= " << std::setw(12) << endEnergy / MeV << " MeV " << G4endl;
G4cout << " Energy has been corrected -- however, review"
<< " field propagation parameters for accuracy." << G4endl;
if( (fVerboseLevel > 2 ) || (no_warnings<4) || (no_large_ediff == warnModulo * moduloFactor) )
if( (verboseLevel > 2 ) || (no_warnings<4) || (no_large_ediff == warnModulo * moduloFactor) )
{
G4cout << " These include EpsilonStepMax(/Min) in G4FieldManager "
<< " which determine fractional error per step for integrated quantities. " << G4endl
@@ -454,7 +448,7 @@ AlongStepGetPhysicalInteractionLength( const G4Track& track,
}
}
}
} // end of if (fVerboseLevel)
} // end of if (verboseLevel)
// Correct the energy for fields that conserve it
// This - hides the integration error
@@ -538,7 +532,7 @@ G4VParticleChange* G4Transportation::AlongStepDoIt( const G4Track& track,
fParticleChange.SetMomentumChanged(fMomentumChanged) ;
fParticleChange.ProposePolarization(fTransportEndSpin);
G4double deltaTime = 0.0 ;
// Calculate Lab Time of Flight (ONLY if field Equations used it!)
@@ -595,7 +589,7 @@ G4VParticleChange* G4Transportation::AlongStepDoIt( const G4Track& track,
if( endEnergy > fMaxEnergyKilled) { fMaxEnergyKilled= endEnergy; }
#ifdef G4VERBOSE
if( (fVerboseLevel > 1) &&
if( (verboseLevel > 1) &&
( endEnergy > fThreshold_Warning_Energy ) )
{
G4cout << " G4Transportation is killing track that is looping or stuck "
@@ -613,7 +607,7 @@ G4VParticleChange* G4Transportation::AlongStepDoIt( const G4Track& track,
{
fNoLooperTrials ++;
#ifdef G4VERBOSE
if( (fVerboseLevel > 2) )
if( (verboseLevel > 2) )
{
G4cout << " G4Transportation::AlongStepDoIt(): Particle looping - "
<< " Number of trials = " << fNoLooperTrials