Import Geant4 5.0.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChordFinder.cc,v 1.27 2002/06/01 02:37:14 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4ChordFinder.cc,v 1.31 2002/11/09 02:50:48 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// 25.02.97 John Apostolakis, design and implimentation
|
||||
@@ -184,7 +184,7 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
|
||||
stepForChord = NewStep(stepTrial, dChordStep, fLastStepEstimate_Unconstrained );
|
||||
|
||||
if( ! validEndPoint ) {
|
||||
if( stepForChord <= oldStepTrial )
|
||||
if( (stepForChord <= oldStepTrial) || (stepTrial<=0.0) )
|
||||
stepTrial = stepForChord;
|
||||
else
|
||||
stepTrial *= 0.1;
|
||||
@@ -223,6 +223,7 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
|
||||
|
||||
stepOfLastGoodChord = stepTrial;
|
||||
#ifdef TEST_CHORD_PRINT
|
||||
static int dbg=0;
|
||||
if( dbg )
|
||||
G4cout << "ChordF/FindNextChord: NoTrials= " << noTrials
|
||||
<< " StepForGoodChord=" << G4std::setw(10) << stepTrial << G4endl;
|
||||
@@ -247,6 +248,11 @@ if( dbg ) {
|
||||
G4double G4ChordFinder::NewStep(G4double stepTrialOld,
|
||||
G4double dChordStep, // Current dchord achieved.
|
||||
G4double& stepEstimate_Unconstrained )
|
||||
//
|
||||
// Is called to estimate the next step size, even for successful steps,
|
||||
// in order to predict an accurate 'chord-sensitive' first step
|
||||
// which is likely to assist in more performant 'stepping'.
|
||||
//
|
||||
|
||||
{
|
||||
G4double stepTrial;
|
||||
@@ -255,15 +261,22 @@ G4double G4ChordFinder::NewStep(G4double stepTrialOld,
|
||||
#if 1
|
||||
// const G4double threshold = 1.21, multiplier = 0.9; // 0.9 < 1 / sqrt(1.21)
|
||||
|
||||
stepEstimate_Unconstrained = stepTrialOld * sqrt( fDeltaChord / dChordStep );
|
||||
stepTrial = 0.98 * stepEstimate_Unconstrained;
|
||||
if (dChordStep > 0.0)
|
||||
{
|
||||
stepEstimate_Unconstrained = stepTrialOld * sqrt( fDeltaChord / dChordStep );
|
||||
stepTrial = 0.98 * stepEstimate_Unconstrained;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Should not update the Unconstrained Step estimate: incorrect!
|
||||
stepTrial = stepTrialOld * 2.;
|
||||
}
|
||||
|
||||
// if ( dChordStep < threshold * fDeltaChord ){
|
||||
// stepTrial= stepTrialOld * multiplier;
|
||||
// }
|
||||
if( (stepTrial < 0.001 * stepTrialOld)
|
||||
|| (stepTrial > 1000.0 * stepTrialOld)
|
||||
){
|
||||
if( stepTrial <= 0.001 * stepTrialOld)
|
||||
{
|
||||
if ( dChordStep > 1000.0 * fDeltaChord ){
|
||||
stepTrial= stepTrialOld * 0.03;
|
||||
}else{
|
||||
@@ -274,6 +287,13 @@ G4double G4ChordFinder::NewStep(G4double stepTrialOld,
|
||||
stepTrial= stepTrialOld * 0.5;
|
||||
}
|
||||
}
|
||||
}else if (stepTrial > 1000.0 * stepTrialOld)
|
||||
{
|
||||
stepTrial= 1000.0 * stepTrialOld;
|
||||
}
|
||||
|
||||
if( stepTrial == 0.0 ){
|
||||
stepTrial= 0.000001;
|
||||
}
|
||||
|
||||
lastStepTrial = stepTrialOld;
|
||||
|
||||
Reference in New Issue
Block a user