82 fTransportEndPosition( 0.0, 0.0, 0.0 ),
83 fTransportEndMomentumDir( 0.0, 0.0, 0.0 ),
84 fTransportEndKineticEnergy( 0.0 ),
85 fTransportEndSpin( 0.0, 0.0, 0.0 ),
86 fMomentumChanged(true),
87 fEndGlobalTimeComputed(false),
88 fCandidateEndGlobalTime(0.0),
89 fParticleIsLooping( false ),
90 fGeometryLimitedStep(true),
94 fEndPointDistance( -1.0 ),
95 fThreshold_Warning_Energy( 100 *
MeV ),
96 fThreshold_Important_Energy( 250 *
MeV ),
97 fThresholdTrials( 10 ),
99 fSumEnergyKilled( 0.0 ), fMaxEnergyKilled( 0.0 ),
100 fShortStepOptimisation( false ),
101 fVerboseLevel( verbosity )
130 G4cout <<
" G4Transportation constructor> set fShortStepOptimisation to ";
143 G4cout <<
" G4Transportation: Statistics for looping particles " <<
G4endl;
163 G4double geometryStepLength= -1.0, newSafety= -1.0;
191 G4double MagSqShift = OriginShift.mag2() ;
194 currentSafety = 0.0 ;
217 G4bool fieldExertsForce = false ;
220 G4bool fieldExists=
false;
233 fieldExists = (ptrField!=0) ;
238 if( (particleCharge != 0.0)
240 || (gravityOn && (restMass != 0.0) )
243 fieldExertsForce = fieldExists;
250 if( !fieldExertsForce )
257 geometryStepLength = currentMinimumStep ;
270 fPreviousSftOrigin = startPosition ;
274 currentSafety = newSafety ;
280 geometryStepLength = linearStepLength ;
285 geometryStepLength = currentMinimumStep ;
317 ->GetEquationOfMotion();
337 if( currentMinimumStep > 0 )
348 geometryStepLength = lengthAlongCurve ;
352 geometryStepLength = currentMinimumStep ;
357 fPreviousSftOrigin = startPosition ;
363 geometryStepLength = lengthAlongCurve= 0.0 ;
402 G4double absEdiff = std::fabs(startEnergy- endEnergy);
410 if( std::fabs(startEnergy- endEnergy) >
perThousand * endEnergy )
415 if( (no_large_ediff% warnModulo) == 0 )
418 G4cout <<
"WARNING - G4Transportation::AlongStepGetPIL() "
419 <<
" Energy change in Step is above 1^-3 relative value. " <<
G4endl
420 <<
" Relative change in 'tracking' step = "
421 << std::setw(15) << (endEnergy-startEnergy)/startEnergy <<
G4endl
422 <<
" Starting E= " << std::setw(12) << startEnergy /
MeV <<
" MeV " <<
G4endl
423 <<
" Ending E= " << std::setw(12) << endEnergy /
MeV <<
" MeV " <<
G4endl;
424 G4cout <<
" Energy has been corrected -- however, review"
425 <<
" field propagation parameters for accuracy." <<
G4endl;
426 if( (
fVerboseLevel > 2 ) || (no_warnings<4) || (no_large_ediff == warnModulo * moduloFactor) )
428 G4cout <<
" These include EpsilonStepMax(/Min) in G4FieldManager "
429 <<
" which determine fractional error per step for integrated quantities. " << G4endl
430 <<
" Note also the influence of the permitted number of integration steps."
433 G4cerr <<
"ERROR - G4Transportation::AlongStepGetPIL()" << G4endl
434 <<
" Bad 'endpoint'. Energy change detected"
435 <<
" and corrected. "
436 <<
" Has occurred already "
437 << no_large_ediff <<
" times." <<
G4endl;
438 if( no_large_ediff == warnModulo * moduloFactor )
440 warnModulo *= moduloFactor;
460 if( currentMinimumStep == 0.0 )
470 if( particleCharge != 0.0 )
474 currentSafety = endSafety ;
484 #ifdef G4DEBUG_TRANSPORT
486 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl ;
488 <<
" and it returned safety= " << endSafety <<
G4endl ;
490 <<
" to obtain pseudo-safety= " << currentSafety <<
G4endl ;
494 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl ;
495 G4cout <<
" Avoiding call to ComputeSafety : " <<
G4endl;
504 return geometryStepLength ;
545 if ( initialVelocity > 0.0 ) { deltaTime = stepLength/initialVelocity; }
588 G4cout <<
" G4Transportation is killing track that is looping or stuck "
591 <<
" MeV energy." <<
G4endl;
593 <<
" No of calls to AlongStepDoIt = " << noCalls
605 G4cout <<
" G4Transportation::AlongStepDoIt(): Particle looping - "
607 <<
" No of calls to = " << noCalls
670 LocateGlobalPointAndUpdateTouchableHandle( track.
GetPosition(),
688 #ifdef G4DEBUG_TRANSPORT
693 if( ! (exiting || entering) )
695 G4cout <<
" Transport> : Proposed isLastStep= " << isLastStep
718 #ifdef G4DEBUG_TRANSPORT
721 G4cout <<
" Transport> Proposed isLastStep= " << isLastStep
722 <<
" Geometry did not limit step. " <<
G4endl;
750 if( pNewVol!=0 && pNewMaterialCutsCouple!=0 && pNewMaterialCutsCouple->
GetMaterial()!=pNewMaterial )
754 pNewMaterialCutsCouple =
void SetMaterialInTouchable(G4Material *fMaterial)
G4bool fParticleIsLooping
void SetTouchableHandle(const G4TouchableHandle &fTouchable)
const G4ThreeVector & GetPolarization() const
G4bool fShortStepOptimisation
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4SafetyHelper * GetSafetyHelper() const
G4double GetLocalTime() const
G4PropagatorInField * fFieldPropagator
void SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple *fMaterialCutsCouple)
virtual void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double MassXc2)=0
G4double GetProperTime() const
std::vector< G4ThreeVector > * GimmeTrajectoryVectorAndForgetIt() const
CLHEP::Hep3Vector G4ThreeVector
G4double fTransportEndKineticEnergy
void StartTracking(G4Track *aTrack)
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
const G4MagIntegratorStepper * GetStepper() const
void ClearAllChordFindersState()
G4Material * GetMaterial() const
G4bool fEndGlobalTimeComputed
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDir() const
G4TrackStatus GetTrackStatus() const
G4ThreeVector GetSpin() const
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
G4Navigator * GetNavigatorForTracking() const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
G4ParticleDefinition * GetDefinition() const
static const double perThousand
G4ThreeVector fTransportEndPosition
G4double GetVelocity() const
G4SafetyHelper * fpSafetyHelper
void ProposePosition(G4double x, G4double y, G4double z)
G4ReferenceCountedHandle< G4VTouchable > G4TouchableHandle
G4double GetTotalMomentum() const
G4StepPoint * GetPreStepPoint() const
virtual void Initialize(const G4Track &)
virtual void StartTracking(G4Track *)
virtual void ConfigureForTrack(const G4Track *)
void SetGeometricallyLimitedStep()
G4double GetKineticEnergy() const
G4ThreeVector GetPosition() const
G4GLOB_DLL std::ostream G4cout
G4double fEndPointDistance
G4double fThreshold_Important_Energy
const G4ThreeVector & GetMomentumDirection() const
G4double GetCharge() const
void ProposeTrueStepLength(G4double truePathLength)
G4bool DoesGlobalFieldExist()
void SetProcessSubType(G4int)
G4bool EnteredDaughterVolume() const
G4bool DoesFieldChangeEnergy() const
G4double GetGlobalTime() const
G4ThreeVector fPreviousSftOrigin
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
G4TouchableHandle fCurrentTouchableHandle
G4Transportation(G4int verbosityLevel=1)
const G4TouchableHandle & GetTouchableHandle() const
static G4TransportationManager * GetTransportationManager()
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
G4double fMaxEnergyKilled
static const double perMillion
G4double ComputeStep(G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4double &pNewSafety, G4VPhysicalVolume *pPhysVol=0)
static G4ProductionCutsTable * GetProductionCutsTable()
const G4ThreeVector & GetMomentumDirection() const
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection)
G4LogicalVolume * GetLogicalVolume() const
void ProposeProperTime(G4double finalProperTime)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4FieldManagerStore * GetInstance()
void SetSensitiveDetectorInTouchable(G4VSensitiveDetector *fSensitiveDetector)
#define fPreviousSftOrigin
G4bool IsParticleLooping() const
G4double GetLabTimeOfFlight() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4double fThreshold_Warning_Energy
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *theNewVectorPointer)
G4bool IsGravityActive() const
void ProposeGlobalTime(G4double t)
G4ChordFinder * GetChordFinder()
G4FieldManager * GetCurrentFieldManager()
static G4bool fUseMagneticMoment
G4VParticleChange * pParticleChange
void ProposeEnergy(G4double finalEnergy)
G4VPhysicalVolume * GetVolume() const
G4double GetTotalEnergy() const
G4double GetPDGSpin() const
void SetCurrentSafety(G4double val, const G4ThreeVector &pos)
void ClearPropagatorState()
G4bool ExitedMotherVolume() const
void ProposeLastStepInVolume(G4bool flag)
G4ThreeVector fTransportEndSpin
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double GetPDGMagneticMoment() const
G4Navigator * fLinearNavigator
void ProposeTrackStatus(G4TrackStatus status)
const G4Field * GetDetectorField() const
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
G4MagInt_Driver * GetIntegrationDriver()
void SetMomentumChanged(G4bool b)
G4bool fGeometryLimitedStep
G4PropagatorInField * GetPropagatorInField() const
G4double fCandidateEndGlobalTime
G4ProductionCuts * GetProductionCuts() const
G4VSensitiveDetector * GetSensitiveDetector() const
G4double GetMagneticMoment() const
G4ParticleChangeForTransport fParticleChange
void ProposeLocalTime(G4double t)
G4double GetStepLength() const
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
const G4Material * GetMaterial() const
G4ThreeVector fTransportEndMomentumDir
G4GLOB_DLL std::ostream G4cerr
static G4bool fUseMagneticMoment
static G4bool EnableUseMagneticMoment(G4bool useMoment=true)
G4double fSumEnergyKilled