67 G4cout <<
"G4ChordFinderSaf statistics report: " <<
G4endl;
100 if( MagSqShift <
sqr(safetyRadius) ){
101 pointSafety = safetyRadius - std::sqrt(MagSqShift) ;
114 return ( OriginShift.
mag2() < safetyRadius*safetyRadius );
131 G4double stepTrial, stepForAccuracy;
138 G4bool validEndPoint=
false;
139 G4double dChordStep, lastStepLength;
153 likelyGood = std::max( startSafety ,
156 stepTrial = std::min( stepMax, likelyGood );
167 dChordStep, dyErrPos);
171 G4bool endPointInSafetySphere=
176 || endPointInSafetySphere;
179 lastStepLength = stepTrial;
182 stepForChord =
NewStep(stepTrial, dChordStep, newStepEst_Uncons );
184 if( ! validEndPoint ) {
186 stepTrial = stepForChord;
187 else if (stepForChord <= stepTrial)
189 stepTrial = std::min( stepForChord,
202 while( ! validEndPoint );
207 if( newStepEst_Uncons > 0.0 ){
213 if( pStepForAccuracy ){
215 G4double dyErr_relative = dyErrPos/(epsStep*lastStepLength);
216 if( dyErr_relative > 1.0 ) {
221 stepForAccuracy = 0.0;
223 *pStepForAccuracy = stepForAccuracy;
226#ifdef TEST_CHORD_PRINT
229 G4cout <<
"ChordF/FindNextChord: NoTrials= " << noTrials
230 <<
" StepForGoodChord=" << std::setw(10) << stepTrial <<
G4endl;
G4double CalculatePointSafety(G4ThreeVector safetyOrigin, G4double safetyRadius, G4ThreeVector point)
G4bool CalculatePointInside(G4ThreeVector safetyOrigin, G4double safetyRadius, G4ThreeVector point)
G4DLLIMPORT std::ostream G4cout
G4ChordFinderSaf(G4MagInt_Driver *pIntegrationDriver)
G4double FindNextChord(const G4FieldTrack &yStart, G4double stepMax, G4FieldTrack &yEnd, G4double &dyErrPos, G4double epsStep, G4double *pStepForAccuracy, const G4ThreeVector latestSafetyOrigin, G4double latestSafetyRadius)
void SetLastStepEstimateUnc(G4double stepEst)
G4bool AcceptableMissDist(G4double dChordStep) const
G4double NewStep(G4double stepTrialOld, G4double dChordStep, G4double &stepEstimate_Unconstrained)
G4double GetLastStepEstimateUnc()
G4int SetVerbose(G4int newvalue=1)
void AccumulateStatistics(G4int noTrials)
G4double GetFractionLast()
virtual void PrintStatistics()
G4MagInt_Driver * GetIntegrationDriver()
G4double GetFirstFraction()
G4ThreeVector GetPosition() const
G4double ComputeNewStepSize(G4double errMaxNorm, G4double hstepCurrent)
G4bool QuickAdvance(G4FieldTrack &y_val, const G4double dydx[], G4double hstep, G4double &dchord_step, G4double &dyerr)