140 G4double geometryStepLength, newSafety ;
141 fParticleIsLooping = false ;
166 G4ThreeVector OriginShift = startPosition - fPreviousSftOrigin ;
168 if( MagSqShift >=
sqr(fPreviousSafety) )
170 currentSafety = 0.0 ;
174 currentSafety = fPreviousSafety - std::sqrt(MagSqShift) ;
182 fGeometryLimitedStep = false ;
192 G4bool fieldExertsForce = false ;
194 if( (particleMagneticCharge != 0.0) )
214 if( !fieldExertsForce )
217 if( fShortStepOptimisation && (currentMinimumStep <= currentSafety) )
221 geometryStepLength = currentMinimumStep ;
222 fGeometryLimitedStep = false ;
228 linearStepLength = fLinearNavigator->
ComputeStep( startPosition,
234 fPreviousSftOrigin = startPosition ;
235 fPreviousSafety = newSafety ;
240 currentSafety = newSafety ;
242 fGeometryLimitedStep= (linearStepLength <= currentMinimumStep);
243 if( fGeometryLimitedStep )
246 geometryStepLength = linearStepLength ;
251 geometryStepLength = currentMinimumStep ;
254 endpointDistance = geometryStepLength ;
258 fTransportEndPosition = startPosition+geometryStepLength*startMomentumDir ;
262 fTransportEndMomentumDir = startMomentumDir ;
265 fParticleIsLooping = false ;
266 fMomentumChanged = false ;
267 fEndGlobalTimeComputed = false ;
280 particleMagneticCharge );
284 ->GetEquationOfMotion();
302 if( currentMinimumStep > 0 )
306 lengthAlongCurve = fFieldPropagator->
ComputeStep( aFieldTrack,
310 fGeometryLimitedStep= lengthAlongCurve < currentMinimumStep;
311 if( fGeometryLimitedStep ) {
312 geometryStepLength = lengthAlongCurve ;
314 geometryStepLength = currentMinimumStep ;
319 geometryStepLength = lengthAlongCurve= 0.0 ;
320 fGeometryLimitedStep = false ;
325 fPreviousSftOrigin = startPosition ;
326 fPreviousSafety = currentSafety ;
331 fTransportEndPosition = aFieldTrack.
GetPosition() ;
335 fMomentumChanged = true ;
341 fEndGlobalTimeComputed =
true;
343 fTransportEndSpin = aFieldTrack.
GetSpin();
345 endpointDistance = (fTransportEndPosition - startPosition).mag() ;
351 if( currentMinimumStep == 0.0 )
353 if( currentSafety == 0.0 ) fGeometryLimitedStep = true ;
359 if( currentSafety < endpointDistance )
364 if( particleMagneticCharge != 0.0 ) {
368 currentSafety = endSafety ;
369 fPreviousSftOrigin = fTransportEndPosition ;
370 fPreviousSafety = currentSafety ;
376 currentSafety += endpointDistance ;
378 #ifdef G4DEBUG_TRANSPORT
380 G4cout <<
"***G4MonopoleTransportation::AlongStepGPIL ** " <<
G4endl ;
381 G4cout <<
" Called Navigator->ComputeSafety at " << fTransportEndPosition
382 <<
" and it returned safety= " << endSafety <<
G4endl ;
383 G4cout <<
" Adding endpoint distance " << endpointDistance
384 <<
" to obtain pseudo-safety= " << currentSafety <<
G4endl ;
394 return geometryStepLength ;
const G4ThreeVector & GetPolarization() const
virtual void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double MassXc2)=0
G4double GetProperTime() const
G4double GetVelocity() const
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MagIntegratorStepper * GetStepper() const
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDir() const
G4ThreeVector GetSpin() const
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
G4double GetTotalMomentum() const
virtual void ConfigureForTrack(const G4Track *)
G4double GetKineticEnergy() const
G4ThreeVector GetPosition() const
G4GLOB_DLL std::ostream G4cout
G4double MagneticCharge() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetCharge() const
void ProposeTrueStepLength(G4double truePathLength)
G4double GetGlobalTime() const
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
G4double ComputeStep(G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4double &pNewSafety, G4VPhysicalVolume *pPhysVol=0)
const G4ThreeVector & GetMomentumDirection() const
void SetStepperAndChordFinder(G4int val)
G4double GetPDGMass() const
G4bool IsParticleLooping() const
G4double GetLabTimeOfFlight() const
G4ChordFinder * GetChordFinder()
G4VPhysicalVolume * GetVolume() const
G4double GetPDGSpin() const
void SetCurrentSafety(G4double val, const G4ThreeVector &pos)
const G4Field * GetDetectorField() const
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
G4MagInt_Driver * GetIntegrationDriver()