116 if ( !pNullTouchableHandle)
127 G4cout <<
" G4Transportation constructor> set fShortStepOptimisation to ";
150 outStr <<
" G4Transportation: Statistics for looping particles " <<
G4endl;
153 outStr <<
" Sum of energy of looping tracks killed: "
156 <<
" Sum of energy of non-electrons : "
164 outStr <<
" Max energy of non-electron looper killed: "
171 outStr <<
" Sum of energy of loopers 'saved': "
173 outStr <<
" Sum of energy of unstable loopers 'saved': "
179 outStr <<
" No looping tracks found or killed. " <<
G4endl;
248 if(eligibleEM || eligibleGrav)
254 fieldMgr->ConfigureForTrack(&track);
260 if(
const G4Field* ptrField = fieldMgr->GetDetectorField())
262 eligibleEM || (eligibleGrav && ptrField->IsGravityActive());
266 G4double geometryStepLength = currentMinimumStep;
268 if(currentMinimumStep == 0.0)
287 startPosition, startMomentumDir, currentMinimumStep, currentSafety);
289 if(linearStepLength <= currentMinimumStep)
291 geometryStepLength = linearStepLength;
307 startPosition + geometryStepLength * startMomentumDir;
315 const auto particlePDGSpin = pParticleDef->
GetPDGSpin();
316 const auto particlePDGMagM = pParticleDef->GetPDGMagneticMoment();
322 equationOfMotion->SetChargeMomentumMass(
323 G4ChargeState(particleCharge, magneticMoment, particlePDGSpin),
328 startMomentumDir, kineticEnergy, particleMass,
329 particleCharge, particleSpin, particlePDGMagM,
336 aFieldTrack, currentMinimumStep, currentSafety, track.
GetVolume(),
339 if(lengthAlongCurve < geometryStepLength)
340 geometryStepLength = lengthAlongCurve;
384#if defined(G4VERBOSE) || defined(G4DEBUG_TRANSPORT)
392 G4double startEnergy = kineticEnergy;
398 if(std::fabs(startEnergy - endEnergy) > perThousand * endEnergy)
403 if((no_large_ediff % warnModulo) == 0)
406 std::ostringstream message;
407 message <<
"Energy change in Step is above 1^-3 relative value. "
408 <<
G4endl <<
" Relative change in 'tracking' step = "
409 << std::setw(15) << (endEnergy - startEnergy) / startEnergy
410 <<
G4endl <<
" Starting E= " << std::setw(12)
411 << startEnergy / MeV <<
" MeV " <<
G4endl
412 <<
" Ending E= " << std::setw(12) << endEnergy / MeV
414 <<
"Energy has been corrected -- however, review"
415 <<
" field propagation parameters for accuracy." <<
G4endl;
417 (no_large_ediff == warnModulo * moduloFactor))
419 message <<
"These include EpsilonStepMax(/Min) in G4FieldManager "
421 <<
"which determine fractional error per step for "
422 "integrated quantities. "
424 <<
"Note also the influence of the permitted number of "
428 message <<
"Bad 'endpoint'. Energy change detected and corrected."
429 <<
G4endl <<
"Has occurred already " << no_large_ediff
431 G4Exception(
"G4Transportation::AlongStepGetPIL()",
"EnergyChange",
433 if(no_large_ediff == warnModulo * moduloFactor)
435 warnModulo *= moduloFactor;
449 if(particleCharge != 0.0)
453 currentSafety = endSafety;
463#ifdef G4DEBUG_TRANSPORT
465 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl;
467 <<
" and it returned safety= " << endSafety <<
G4endl;
469 <<
" to obtain pseudo-safety= " << currentSafety <<
G4endl;
473 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl;
474 G4cout <<
" Avoiding call to ComputeSafety : " <<
G4endl;
488 return geometryStepLength;
499#if defined(G4VERBOSE) || defined(G4DEBUG_TRANSPORT)
503 #define noCallsASDI 0
538 if ( initialVelocity > 0.0 ) { deltaTime = stepLength/initialVelocity; }
567 G4bool stable = particleType->GetPDGStable();
573 if( (candidateForEnd && stable) || (unstableAndKillable && unstableForEnd) )
578 G4int particlePDG= particleType->GetPDGEncoding();
579 const G4int electronPDG= 11;
590 if( particleType->GetPDGEncoding() != electronPDG )
622 <<
" Particle is looping but is saved ..." <<
G4endl
676 fParticleChange.SetSensitiveDetectorInTouchable( pNewSensitiveDetector ) ;
686 if ( pNewVol!=0 && pNewMaterialCutsCouple!=0
687 && pNewMaterialCutsCouple->
GetMaterial()!=pNewMaterial )
691 pNewMaterialCutsCouple =
696 fParticleChange.SetMaterialCutsCoupleInTouchable( pNewMaterialCutsCouple );
731 LocateGlobalPointAndUpdateTouchableHandle( track.
GetPosition(),
879 G4int maxTrials = 10;
893 G4int maxTrials = 30;
905 const char* message=
"Logger object missing from G4Transportation object";
917 fpLogger->ReportLooperThresholds(
"G4Transportation");
928 G4long oldPrec= outStr.precision(6);
932 outStr <<
" Parameters for looping particles: " <<
G4endl
936 outStr.precision(oldPrec);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
G4ReferenceCountedHandle< G4VTouchable > G4TouchableHandle
G4TouchableHandle is a type providing reference counting mechanism for any kind of touchable objects....
G4GLOB_DLL std::ostream G4cout
G4ChargeState is a container for magnetic charge and moments.
G4double GetCharge() const
const G4ParticleDefinition * GetParticleDefinition() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetMagneticMoment() const
G4double GetTotalMomentum() const
const G4ThreeVector & GetPolarization() const
G4FieldManagerStore is a container for all field managers, with functionality derived from std::vecto...
static G4FieldManagerStore * GetInstance()
void ClearAllChordFindersState()
G4FieldManager is a manager (store) for a pointer to the Field subclass that describes the field of a...
G4FieldTrack defines a data structure bringing together a magnetic track's state (position,...
const G4ThreeVector & GetMomentumDir() const
G4double GetKineticEnergy() const
G4ThreeVector GetPosition() const
G4ThreeVector GetSpin() const
G4double GetLabTimeOfFlight() const
G4Field is the abstract class for any kind of field. It allows any kind of field (vector,...
G4VSensitiveDetector * GetSensitiveDetector() const
G4Material * GetMaterial() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
const G4Material * GetMaterial() const
G4ProductionCuts * GetProductionCuts() const
G4double GetPDGSpin() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4ProductionCutsTable * GetProductionCutsTable()
G4double GetVelocity() const
void SetStepStatus(const G4StepStatus aValue)
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4TrackStatus GetTrackStatus() const
G4VPhysicalVolume * GetVolume() const
const G4ThreeVector & GetPosition() const
G4double GetGlobalTime() const
G4double GetProperTime() const
G4double GetLocalTime() const
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetStepLength() const
G4double GetTotalEnergy() const
G4TransportationManager is a singleton class which stores the navigator used by the transportation pr...
static G4TransportationManager * GetTransportationManager()
G4PropagatorInField * GetPropagatorInField() const
G4SafetyHelper * GetSafetyHelper() const
G4Navigator * GetNavigatorForTracking() const
static G4TransportationParameters * Instance()
void SetThresholdImportantEnergy(G4double newEnImp)
G4ThreeVector fPreviousSftOrigin
static void SetSilenceLooperWarnings(G4bool val)
G4double fSumEnerSqKilled
G4double fThreshold_Important_Energy
G4double fSumEnergyKilled
G4int fMaxEnergyKilledPDG
G4Transportation(G4int verbosityLevel=1, const G4String &aName="Transportation")
G4double fMaxEnergyKilled_NonElectron
G4ThreeVector fTransportEndSpin
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection)
static G4bool EnableGravity(G4bool useGravity=true)
G4double fTransportEndKineticEnergy
void PushThresholdsToLogger()
void PrintStatistics(std::ostream &outStr) const
void SetHighLooperThresholds()
unsigned long fNumLoopersKilled_NonElectron
G4bool fShortStepOptimisation
void SetTouchableInformation(const G4TouchableHandle &touchable)
static G4bool fSilenceLooperWarnings
void SetLowLooperThresholds()
G4PropagatorInField * fFieldPropagator
G4ThreeVector fTransportEndPosition
G4bool fEndGlobalTimeComputed
G4double fThreshold_Warning_Energy
G4int fMaxEnergyKilled_NonElecPDG
G4double fSumEnerSqKilled_NonElectron
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
void SetThresholdTrials(G4int newMaxTrials)
G4ParticleChangeForTransport fParticleChange
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4double fEndPointDistance
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
G4double fSumEnergyUnstableSaved
static G4bool EnableMagneticMoment(G4bool useMoment=true)
void ReportLooperThresholds()
G4TouchableHandle fCurrentTouchableHandle
G4int fAbandonUnstableTrials
void StartTracking(G4Track *aTrack)
static G4bool fUseGravity
G4double fMaxEnergyKilled
G4bool fGeometryLimitedStep
G4Navigator * fLinearNavigator
G4TransportationLogger * fpLogger
static G4bool fUseMagneticMoment
G4bool fParticleIsLooping
void SetThresholdWarningEnergy(G4double newEnWarn)
G4double fSumEnergyKilled_NonElectron
static G4bool GetSilenceLooperWarnings()
void ReportMissingLogger(const char *methodName)
G4ThreeVector fTransportEndMomentumDir
unsigned long fNumLoopersKilled
G4SafetyHelper * fpSafetyHelper
G4double fCandidateEndGlobalTime
G4bool fFieldExertedForce
virtual void ProcessDescription(std::ostream &outFile) const
G4bool fFirstStepInVolume
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4LogicalVolume * GetLogicalVolume() const
void SetVerboseLevel(G4int value)
G4VProcess(const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
void SetProcessSubType(G4int)
virtual void StartTracking(G4Track *)
G4VParticleChange * pParticleChange
const G4String & GetProcessName() const