142 G4double geometryStepLength;
158 const G4DynamicParticle* pParticle =
track.GetDynamicParticle() ;
159 G4ParticleDefinition* pParticleDef = pParticle->GetDefinition() ;
160 G4ThreeVector startPosition =
track.GetPosition() ;
169 G4double MagSqShift = OriginShift.mag2() ;
172 currentSafety = 0.0 ;
181 G4double particleCharge = pParticle->GetCharge() ;
191 fieldMgr->ConfigureForTrack( &
track );
193 G4Exception(
"QuirkTransportation::AlongStepGetPhysicalInteractionLength",
"QuirkNoFieldMgr", RunMustBeAborted,
"no field manager");
197 Quirk* quirkDef =
dynamic_cast<Quirk*
>(pParticleDef);
199 G4Exception(
"QuirkTransportation::AlongStepGetPhysicalInteractionLength",
"NonQuirk", FatalErrorInArgument,
"QuirkTransportation run on non-quirk particle");
205 fieldMgr->DoesFieldExist() ? fieldMgr->GetDetectorField() : 0
209 G4ChordFinder* oldChordFinder = fieldMgr->GetChordFinder();
210 G4ChordFinder quirkChordFinder(
211 new G4MagInt_Driver(0.0, &quirkStepper, quirkStepper.GetNumberOfVariables())
213 fieldMgr->SetChordFinder(&quirkChordFinder);
215 G4double momentumMagnitude = pParticle->GetTotalMomentum() ;
216 G4ThreeVector EndUnitMomentum ;
217 G4double restMass = pParticleDef->GetPDGMass() ;
219 #if G4VERSION_NUMBER > 1009
221 G4ChargeState chargeState(particleCharge,
222 quirkDef->GetPDGSpin(),
226 G4EquationOfMotion* equationOfMotion = (
m_fieldPropagator->GetChordFinder()->GetIntegrationDriver()->GetStepper())->GetEquationOfMotion();
227 equationOfMotion->SetChargeMomentumMass( chargeState,
236 G4ThreeVector
spin =
track.GetPolarization() ;
237 G4FieldTrack aFieldTrack = G4FieldTrack( startPosition,
238 track.GetMomentumDirection(),
240 track.GetKineticEnergy(),
243 track.GetGlobalTime(),
257 quirkStepper.SetDebug(
dbg);
258 if (
dbg) G4cout <<
"QuirkTransportation: start = " << aFieldTrack.GetPosition() << G4endl;
259 if (
dbg) G4cout <<
"QuirkTransportation: currentMinimumStep = " << currentMinimumStep << G4endl;
260 if (
dbg) G4cout <<
"QuirkTransportation: maxlength = " << quirkStepper.GetMaxLength() << G4endl;
261 currentMinimumStep =
std::min(currentMinimumStep, quirkStepper.GetMaxLength());
262 if (
dbg) G4cout <<
"QuirkTransportation: currentMinimumStep = " << currentMinimumStep << G4endl;
263 if( currentMinimumStep > 0 )
269 track.GetVolume() ) ;
270 if (
dbg) G4cout <<
"QuirkTransportation: moved " << lengthAlongCurve << G4endl;
273 geometryStepLength = lengthAlongCurve ;
275 geometryStepLength = currentMinimumStep ;
282 geometryStepLength = 0.0 ;
285 if (
dbg) G4cout <<
"QuirkTransportation: moved " << aFieldTrack.GetCurveLength() << G4endl;
286 if (
dbg) G4cout <<
"QuirkTransportation: end = " << aFieldTrack.GetPosition() <<
" [" << aFieldTrack.GetProperTimeOfFlight() <<
"]" << G4endl;
295 geometryStepLength = aFieldTrack.GetCurveLength();
308 if( currentMinimumStep == 0.0 )
320 currentSafety = endSafety ;
330 #ifdef G4DEBUG_TRANSPORT
331 G4cout.precision(12) ;
332 G4cout <<
"***QuirkTransportation::AlongStepGPIL ** " << G4endl ;
334 <<
" and it returned safety= " << endSafety << G4endl ;
336 <<
" to obtain pseudo-safety= " << currentSafety << G4endl ;
343 fieldMgr->SetChordFinder(oldChordFinder);
345 return geometryStepLength ;