172 G4cout <<
"G4PropagatorInField::ComputeStep() called" <<
G4endl;
173 G4cout <<
" Starting FT: " << pFieldTrack;
174 G4cout <<
" Requested length = " << CurrentProposedStepLength <<
G4endl;
186 G4double TruePathLength = CurrentProposedStepLength;
190 G4bool first_substep =
true;
212 StartPointA = pFieldTrack.GetPosition();
213 VelocityUnit = pFieldTrack.GetMomentumDir();
215 G4double trialProposedStep = 1.e2 * ( 10.0 *
cm +
217 GetSolid()->DistanceToOut(StartPointA, VelocityUnit) );
218 CurrentProposedStepLength=
std::min( trialProposedStep,
225 if( epsilon < epsilonMin ) epsilon = epsilonMin;
226 if( epsilon > epsilonMax ) epsilon = epsilonMax;
253 decreaseFactor= 0.25;
262 decreaseFactor = 0.35;
266 decreaseFactor= 0.75;
270 stepTrial *= decreaseFactor;
273 G4cerr <<
" G4PropagatorInField::ComputeStep(): " << G4endl
274 <<
" Decreasing step - in volume " << pPhysVol;
276 G4cerr <<
" with name " << pPhysVol->GetName();
279 stepTrial, pFieldTrack);
281 if( stepTrial == 0.0 )
283 std::ostringstream message;
284 message <<
"Particle abandoned due to lack of progress in field." 286 <<
" Properties : " << pFieldTrack << G4endl
287 <<
" Attempting a zero step = " << stepTrial << G4endl
288 <<
" while attempting to progress after " <<
fNoZeroStep 289 <<
" trial steps. Will abandon step.";
290 G4Exception(
"G4PropagatorInField::ComputeStep()",
"GeomNav1002",
295 if( stepTrial < CurrentProposedStepLength )
296 CurrentProposedStepLength = stepTrial;
300 G4int do_loop_count = 0;
310 G4cout <<
" PiF: Calling Nav/Locate Global Point within-Volume " 318 h_TrialStepSize = CurrentProposedStepLength - StepTaken;
339 NewSafety, LinearStepLength,
340 InterSectionPointE );
346 currentSafety = NewSafety;
355 G4bool recalculatedEndPt=
false;
358 EstimateIntersectionPoint( SubStepStartState, CurrentState,
359 InterSectionPointE, IntersectPointVelct_G,
362 intersects = found_intersection;
363 if( found_intersection )
366 StepTaken = TruePathLength = IntersectPointVelct_G.
GetCurveLength()
374 if( recalculatedEndPt )
376 G4double endAchieved = IntersectPointVelct_G.GetCurveLength();
377 G4double endExpected = CurrentState.GetCurveLength();
380 G4bool shortEnd = endAchieved
389 CurrentState= IntersectPointVelct_G;
390 s_length_taken = stepAchieved;
400 StepTaken += s_length_taken;
406 first_substep =
false;
412 CurrentState, CurrentProposedStepLength,
413 NewSafety, do_loop_count, pPhysVol );
419 G4cout <<
" G4PropagatorInField::ComputeStep(): " << G4endl
420 <<
" Difficult track - taking many sub steps." <<
G4endl;
422 printStatus( SubStepStartState, CurrentState, CurrentProposedStepLength,
423 NewSafety, do_loop_count, pPhysVol );
429 }
while( (!intersects )
449 TruePathLength = StepTaken;
466 std::ostringstream message;
467 message <<
"Curve length mis-match between original state " 468 <<
"and proposed endpoint of propagation." << G4endl
469 <<
" The curve length of the endpoint should be: " 471 <<
" and it is instead: " 473 <<
" A difference of: " 476 <<
" Original state = " << OriginalState << G4endl
483 if( TruePathLength+
kCarTolerance >= CurrentProposedStepLength )
508 return TruePathLength;
G4FieldManager * fCurrentFieldMgr
G4double GetMinimumEpsilonStep() const
void SetEpsilonStep(G4double newEps)
G4VCurvedTrajectoryFilter * fpTrajectoryFilter
static const G4double kInfinity
virtual void TakeIntermediatePoint(G4ThreeVector newPoint)=0
G4double GetMaximumEpsilonStep() const
void PrintStepLengthDiagnostic(G4double currentProposedStepLength, G4double decreaseFactor, G4double stepTrial, const G4FieldTrack &aFieldTrack)
G4double fLast_ProposedStepLength
void RefreshIntersectionLocator()
G4ThreeVector fPreviousSftOrigin
G4double fFull_CurveLen_of_LastAttempt
G4GLOB_DLL std::ostream G4cout
void ReportLoopingParticle(G4int count, double StepTaken, G4VPhysicalVolume *pPhysVol)
G4double fZeroStepThreshold
G4double fLargestAcceptableStep
void CreateNewTrajectorySegment()
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double AdvanceChordLimited(G4FieldTrack &yCurrent, G4double stepInitial, G4double epsStep_Relative, const G4ThreeVector latestSafetyOrigin, G4double lasestSafetyRadius)
const G4String & GetName() const
G4int fSevereActionThreshold_NoZeroSteps
void ReportStuckParticle(G4int noZeroSteps, G4double proposedStep, G4double lastTriedStep, G4VPhysicalVolume *physVol)
G4ChordFinder * GetChordFinder()
G4bool fFirstStepInVolume
static const double perMillion
G4bool IntersectChord(const G4ThreeVector &StartPointA, const G4ThreeVector &EndPointB, G4double &NewSafety, G4double &LinearStepLength, G4ThreeVector &IntersectionPoint)
G4double GetDeltaOneStep() const
G4bool fParticleIsLooping
G4int fAbandonThreshold_NoZeroSteps
G4FieldTrack End_PointAndTangent
G4LogicalVolume * GetLogicalVolume() const
G4int fActionThreshold_NoZeroSteps
G4VPhysicalVolume * GetWorldVolume() const
double epsilon(double density, double temperature)
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
G4VIntersectionLocator * fIntersectionLocator
G4GLOB_DLL std::ostream G4cerr
void printStatus(const G4FieldTrack &startFT, const G4FieldTrack ¤tFT, G4double requestStep, G4double safety, G4int step, G4VPhysicalVolume *startVolume)
G4double GetCurveLength() const