Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BrentLocator.cc,v 1.5 2008/12/11 10:13:41 tnikitin Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4BrentLocator.cc,v 1.8 2009/05/15 12:55:48 tnikitin Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// Class G4BrentLocator implementation
//
@@ -153,6 +153,10 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
static G4int max_no_seen= -1;
static G4int trigger_substepno_print= warn_substeps - 20 ;
// Counter for restarting Bintermed
//
G4int restartB = 0;
//--------------------------------------------------------------------------
// Algorithm for the case if progress in founding intersection is too slow.
// Process is defined too slow if after N=param_substeps advances on the
@@ -163,7 +167,7 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
// until 'max_depth'.
//--------------------------------------------------------------------------
const G4int param_substeps=100; // Test value for the maximum number
const G4int param_substeps=50; // Test value for the maximum number
// of substeps
const G4double fraction_done=0.3;
@@ -370,11 +374,12 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
// A <- F
// E <- H
//
CurrentA_PointVelocity = ApproxIntersecPointV;
G4FieldTrack InterMed=ApproxIntersecPointV;
ApproxIntersecPointV = GetChordFinderFor()->ApproxCurvePointS(
CurrentA_PointVelocity,CurrentB_PointVelocity,
CurrentA_PointVelocity,CurrentE_Point,Point_A,PointH,
InterMed,CurrentE_Point,CurrentF_Point,PointH,
false,GetEpsilonStepFor());
CurrentA_PointVelocity = InterMed;
CurrentE_Point = PointH;
}
else // not Intersects_FB
@@ -418,7 +423,14 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
CurrentA_PointVelocity = CurrentB_PointVelocity; // Got to B
CurrentB_PointVelocity = CurveEndPointVelocity;
SubStart_PointVelocity = CurrentA_PointVelocity;
ApproxIntersecPointV = GetChordFinderFor()
->ApproxCurvePointV( CurrentA_PointVelocity,
CurrentB_PointVelocity,
CurrentE_Point,
GetEpsilonStepFor());
restoredFullEndpoint = true;
restartB++; // counter
}
else
{
@@ -427,7 +439,13 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
CurrentA_PointVelocity = CurrentB_PointVelocity; // Got to B
CurrentB_PointVelocity = *ptrInterMedFT[depth];
SubStart_PointVelocity = CurrentA_PointVelocity;
ApproxIntersecPointV = GetChordFinderFor()
->ApproxCurvePointV( CurrentA_PointVelocity,
CurrentB_PointVelocity,
CurrentE_Point,
GetEpsilonStepFor());
restoredFullEndpoint = true;
restartB++; // counter
}
}
} // Endif (Intersects_FB)
@@ -487,24 +505,29 @@ G4bool G4BrentLocator::EstimateIntersectionPoint(
<< GetEpsilonStepFor() << G4endl;
}
G4cerr.precision(20);
G4cerr << " Point A (Curve start) is " << CurveStartPointVelocity
G4cerr << " Point A (Curve start) is " << CurveStartPointVelocity
<< G4endl;
G4cerr << " Point B (Curve end) is " << CurveEndPointVelocity
G4cerr << " Point B (Curve end) is " << CurveEndPointVelocity
<< G4endl;
G4cerr << " Point A (Current start) is " << CurrentA_PointVelocity
G4cerr << " Point A (Current start) is " << CurrentA_PointVelocity
<< G4endl;
G4cerr << " Point B (Current end) is " << CurrentB_PointVelocity
G4cerr << " Point B (Current end) is " << CurrentB_PointVelocity
<< G4endl;
G4cerr << " Point S (Sub start) is " << SubStart_PointVelocity
G4cerr << " Point S (Sub start) is " << SubStart_PointVelocity
<< G4endl;
G4cerr << " Point E (Trial Point) is " << CurrentE_Point
G4cerr << " Point E (Trial Point) is " << CurrentE_Point
<< G4endl;
G4cerr << " Point F (Intersection) is " << ApproxIntersecPointV
G4cerr << " Old Point F(Intersection) is " << CurrentF_Point
<< G4endl;
G4cerr << " New Point F(Intersection) is " << ApproxIntersecPointV
<< G4endl;
G4cerr << " LocateIntersection parameters are : Substep no= "
<< substep_no << G4endl;
G4cerr << " Substep depth no= "<< substep_no_p << " Depth= "
<< depth << G4endl;
G4cerr << " Restarted no= "<< restartB << " Epsilon= "
<< GetEpsilonStepFor() <<" DeltaInters= "
<< GetDeltaIntersectionFor() << G4endl;
G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
"FatalError", FatalException,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Navigator.cc,v 1.38 2008/10/24 14:00:03 gcosmo Exp $
// $Id: G4Navigator.cc,v 1.39 2009/05/08 06:47:32 tnikitin Exp $
// GEANT4 tag $ Name: $
//
// class G4Navigator Implementation
@@ -1017,7 +1017,7 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
const G4RotationMatrix* mRot = motherPhysical->GetRotation();
if( mRot )
{
fGrandMotherExitNormal *= (*mRot);
fGrandMotherExitNormal *= (*mRot).inverse();
}
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PathFinder.cc,v 1.61 2008/11/13 12:59:26 gcosmo Exp $
// $Id: G4PathFinder.cc,v 1.62 2009/05/13 23:20:54 japost Exp $
// GEANT4 tag $ Name: $
//
// class G4PathFinder Implementation
@@ -1051,8 +1051,9 @@ void G4PathFinder::WhichLimited()
G4double step= fCurrentStepSize[num];
limitedStep = ( step == fMinStep ) && ( step != kInfinity);
limitedStep = ( std::fabs(step - fMinStep) < kCarTolerance )
&& ( step != kInfinity);
fLimitTruth[ num ] = limitedStep;
if( limitedStep )
{
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PhantomParameterisation.cc,v 1.4 2008/01/22 15:02:36 gcosmo Exp $
// $Id: G4PhantomParameterisation.cc,v 1.6 2009/05/20 08:27:10 gcosmo Exp $
// GEANT4 tag $ Name:$
//
// class G4PhantomParameterisation implementation
@@ -76,6 +76,18 @@ BuildContainerSolid( G4VPhysicalVolume *pMotherPhysical )
// CheckVoxelsFillContainer();
}
//------------------------------------------------------------------
void G4PhantomParameterisation::
BuildContainerSolid( G4VSolid *pMotherSolid )
{
fContainerSolid = pMotherSolid;
fContainerWallX = fNoVoxelX * fVoxelHalfX;
fContainerWallY = fNoVoxelY * fVoxelHalfY;
fContainerWallZ = fNoVoxelZ * fVoxelHalfZ;
// CheckVoxelsFillContainer();
}
//------------------------------------------------------------------
void G4PhantomParameterisation::
@@ -133,6 +145,7 @@ GetMaterialIndex( size_t copyNo ) const
{
CheckCopyNo( copyNo );
if( !fMaterialIndices ) { return 0; }
return *(fMaterialIndices+copyNo);
}
@@ -35,6 +35,8 @@
// 14.10.96 John Apostolakis, design and implementation
// 17.03.97 John Apostolakis, renaming new set functions being added
//
// $Id: G4PropagatorInField.cc,v 1.50 2009/12/10 08:41:54 japost Exp $
// GEANT4 tag $ Name: $
// ---------------------------------------------------------------------------
#include "G4PropagatorInField.hh"
@@ -68,6 +70,7 @@ G4PropagatorInField::G4PropagatorInField( G4Navigator *theNavigator,
fCharge(0.0), fInitialMomentumModulus(0.0), fMass(0.0),
fUseSafetyForOptimisation(true), // (false) is less sensitive to incorrect safety
fSetFieldMgr(false),
fZeroStepThreshold( 0.0 ),
fpTrajectoryFilter( 0 )
{
if(fDetectorFieldMgr) { fEpsilonStep = fDetectorFieldMgr->GetMaximumEpsilonStep();}
@@ -82,6 +85,13 @@ G4PropagatorInField::G4PropagatorInField( G4Navigator *theNavigator,
fPreviousSftOrigin= G4ThreeVector(0.,0.,0.);
fPreviousSafety= 0.0;
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
fZeroStepThreshold= std::max( 1.0e5 * kCarTolerance, 1.0e-1 * micrometer ) ;
#ifdef G4DEBUG_FIELD
G4cout << " PiF: Zero Step Threshold set to " << fZeroStepThreshold / millimeter
<< " mm." << G4endl;
G4cout << " PiF: Value of kCarTolerance = " << kCarTolerance / millimeter
<< " mm. " << G4endl;
#endif
// Definding Intersection Locator and his parameters
if(vLocator==0){
@@ -91,10 +101,7 @@ G4PropagatorInField::G4PropagatorInField( G4Navigator *theNavigator,
fIntersectionLocator=vLocator;
fAllocatedLocator=false;
}
fIntersectionLocator->SetEpsilonStepFor(fEpsilonStep);
fIntersectionLocator->SetDeltaIntersectionFor(GetDeltaIntersection());
fIntersectionLocator->SetChordFinderFor(GetChordFinder());
fIntersectionLocator->SetSafetyParametersFor( fUseSafetyForOptimisation);
RefreshIntersectionLocator(); // Copy all relevant parameters
}
G4PropagatorInField::~G4PropagatorInField()
@@ -102,6 +109,15 @@ G4PropagatorInField::~G4PropagatorInField()
if(fAllocatedLocator)delete fIntersectionLocator;
}
// Update the IntersectionLocator with current parameters
void
G4PropagatorInField::RefreshIntersectionLocator()
{
fIntersectionLocator->SetEpsilonStepFor(fEpsilonStep);
fIntersectionLocator->SetDeltaIntersectionFor(fCurrentFieldMgr->GetDeltaIntersection());
fIntersectionLocator->SetChordFinderFor(GetChordFinder());
fIntersectionLocator->SetSafetyParametersFor( fUseSafetyForOptimisation);
}
///////////////////////////////////////////////////////////////////////////
//
// Compute the next geometric Step
@@ -113,7 +129,8 @@ G4PropagatorInField::ComputeStep(
G4double& currentSafety, // IN/OUT
G4VPhysicalVolume* pPhysVol)
{
const G4String MethodName("G4PropagatorInField::ComputeStep");
// If CurrentProposedStepLength is too small for finding Chords
// then return with no action (for now - TODO: some action)
//
@@ -151,12 +168,9 @@ G4PropagatorInField::ComputeStep(
GetChordFinder()->SetChargeMomentumMass(fCharge, fInitialMomentumModulus, fMass);
// Values for Intersection Locator has to be updated on each call
// because the CurrentFieldManager changes
fIntersectionLocator->SetChordFinderFor(GetChordFinder());
fIntersectionLocator->SetSafetyParametersFor( fUseSafetyForOptimisation);
fIntersectionLocator->SetEpsilonStepFor(fEpsilonStep);
fIntersectionLocator->SetDeltaIntersectionFor(GetDeltaIntersection());
// Values for Intersection Locator has to be updated on each call for the
// case that CurrentFieldManager has changed from the one of previous step
RefreshIntersectionLocator();
G4FieldTrack CurrentState(pFieldTrack);
G4FieldTrack OriginalState = CurrentState;
@@ -176,7 +190,7 @@ G4PropagatorInField::ComputeStep(
CurrentProposedStepLength= std::min( trialProposedStep,
fLargestAcceptableStep );
}
epsilon = GetDeltaOneStep() / CurrentProposedStepLength;
epsilon = fCurrentFieldMgr->GetDeltaOneStep() / CurrentProposedStepLength;
// G4double raw_epsilon= epsilon;
G4double epsilonMin= fCurrentFieldMgr->GetMinimumEpsilonStep();
G4double epsilonMax= fCurrentFieldMgr->GetMaximumEpsilonStep();;
@@ -199,11 +213,11 @@ G4PropagatorInField::ComputeStep(
G4double decreaseFactor = 0.9; // Unused default
if( (fNoZeroStep < fSevereActionThreshold_NoZeroSteps)
&& (stepTrial > 1000.0*kCarTolerance) )
&& (stepTrial > 100.0*fZeroStepThreshold) )
{
// Ensure quicker convergence
// Attempt quick convergence
//
decreaseFactor= 0.1;
decreaseFactor= 0.25;
}
else
{
@@ -211,11 +225,11 @@ G4PropagatorInField::ComputeStep(
// is either geometrically sharp or between very different materials.
// Careful decreases to cope with tolerance are required.
//
if( stepTrial > 1000.0*kCarTolerance )
decreaseFactor = 0.25; // Try slow decreases
else if( stepTrial > 100.0*kCarTolerance )
decreaseFactor= 0.5; // Try slower decreases
else if( stepTrial > 10.0*kCarTolerance )
if( stepTrial > 100.0*fZeroStepThreshold )
decreaseFactor = 0.35; // Try decreasing slower
else if( stepTrial > 100.0*fZeroStepThreshold )
decreaseFactor= 0.5; // Try yet slower decreases
else if( stepTrial > 10.0*fZeroStepThreshold )
decreaseFactor= 0.75; // Try even slower decreases
else
decreaseFactor= 0.9; // Try very slow decreases
@@ -223,10 +237,15 @@ G4PropagatorInField::ComputeStep(
stepTrial *= decreaseFactor;
#ifdef G4DEBUG_FIELD
G4cout << MethodName << ": "
<< " Decreasing step - "
<< " decreaseFactor= " << std::setw(8) << decreaseFactor
<< " stepTrial = " << std::setw(18) << stepTrial << " "
<< " fZeroStepThreshold = " << fZeroStepThreshold << G4endl;
PrintStepLengthDiagnostic(CurrentProposedStepLength, decreaseFactor,
stepTrial, pFieldTrack);
#endif
if( stepTrial == 0.0 )
if( stepTrial == 0.0 ) // Change to make it < 0.1 * kCarTolerance ??
{
G4cout << " G4PropagatorInField::ComputeStep "
<< " Particle abandoned due to lack of progress in field."
@@ -402,10 +421,17 @@ G4PropagatorInField::ComputeStep(
// In order to correct this efficiently, we identify these cases
// and only take corrective action when they occur.
//
if( TruePathLength < 0.5*kCarTolerance )
if( ( (TruePathLength < fZeroStepThreshold)
&& ( TruePathLength+kCarTolerance < CurrentProposedStepLength )
)
|| ( TruePathLength < 0.5*kCarTolerance )
)
{
fNoZeroStep++;
else
}
else{
fNoZeroStep = 0;
}
if( fNoZeroStep > fAbandonThreshold_NoZeroSteps ) {
fParticleIsLooping = true;
@@ -551,13 +577,33 @@ G4PropagatorInField::PrintStepLengthDiagnostic(
G4double stepTrial,
const G4FieldTrack& )
{
#if 0
G4cout << " PiF: NoZeroStep= " << fNoZeroStep
<< " CurrentProposedStepLength= " << CurrentProposedStepLength
<< " Full_curvelen_last=" << fFull_CurveLen_of_LastAttempt
<< " last proposed step-length= " << fLast_ProposedStepLength
<< " decreate factor = " << decreaseFactor
<< " decrease factor = " << decreaseFactor
<< " step trial = " << stepTrial
<< G4endl;
#endif
int iprec= G4cout.precision(8);
G4cout << " " << std::setw(12) << " PiF: NoZeroStep "
<< " " << std::setw(20) << " CurrentProposed len "
<< " " << std::setw(18) << " Full_curvelen_last"
<< " " << std::setw(18) << " last proposed len "
<< " " << std::setw(18) << " decrease factor "
<< " " << std::setw(15) << " step trial "
<< G4endl;
G4cout << " " << std::setw(10) << fNoZeroStep << " "
<< " " << std::setw(20) << CurrentProposedStepLength
<< " " << std::setw(18) << fFull_CurveLen_of_LastAttempt
<< " " << std::setw(18) << fLast_ProposedStepLength
<< " " << std::setw(18) << decreaseFactor
<< " " << std::setw(15) << stepTrial
<< G4endl;
G4cout.precision( iprec );
}
// Access the points which have passed through the filter. The
@@ -616,10 +662,23 @@ FindAndSetFieldManager( G4VPhysicalVolume* pCurrentPhysicalVolume)
currentFieldMgr = fDetectorFieldMgr;
if( pCurrentPhysicalVolume)
{
G4FieldManager *newFieldMgr = 0;
newFieldMgr= pCurrentPhysicalVolume->GetLogicalVolume()->GetFieldManager();
if ( newFieldMgr )
currentFieldMgr = newFieldMgr;
G4FieldManager *pRegionFieldMgr= 0, *localFieldMgr = 0;
G4LogicalVolume* pLogicalVol= pCurrentPhysicalVolume->GetLogicalVolume();
if( pLogicalVol ) {
// Value for Region, if any, Overrides
G4Region* pRegion= pLogicalVol->GetRegion();
if( pRegion ) {
pRegionFieldMgr= pRegion->GetFieldManager();
if( pRegionFieldMgr )
currentFieldMgr= pRegionFieldMgr;
}
// 'Local' Value from logical volume, if any, Overrides
localFieldMgr= pLogicalVol->GetFieldManager();
if ( localFieldMgr )
currentFieldMgr = localFieldMgr;
}
}
fCurrentFieldMgr= currentFieldMgr;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RegularNavigation.cc,v 1.7 2007/12/10 16:30:01 gunter Exp $
// $Id: G4RegularNavigation.cc,v 1.9 2009/01/27 09:31:29 gcosmo Exp $
// GEANT4 tag $ Name:$
//
// class G4RegularNavigation implementation
@@ -40,6 +40,7 @@
#include "G4NormalNavigation.hh"
#include "G4Navigator.hh"
#include "G4GeometryTolerance.hh"
#include "G4RegularNavigationHelper.hh"
//------------------------------------------------------------------
G4RegularNavigation::G4RegularNavigation()
@@ -133,21 +134,24 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
G4int& blockedReplicaNo,
G4VPhysicalVolume* pCurrentPhysical)
{
G4RegularNavigationHelper::ClearStepLengths();
G4PhantomParameterisation *param =
(G4PhantomParameterisation*)(pCurrentPhysical->GetParameterisation());
if( !param->SkipEqualMaterials() ) {
if( !param->SkipEqualMaterials() )
{
return fnormalNav->ComputeStep(localPoint,
localDirection,
currentProposedStepLength,
newSafety,
history,
validExitNormal,
exitNormal,
exiting,
entering,
pBlockedPhysical,
blockedReplicaNo);
localDirection,
currentProposedStepLength,
newSafety,
history,
validExitNormal,
exitNormal,
exiting,
entering,
pBlockedPhysical,
blockedReplicaNo);
}
@@ -197,6 +201,7 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
for( ;; )
{
newStep = voxelBox->DistanceToOut( localPoint, localDirection );
if( (bFirstStep) && (newStep < currentProposedStepLength) )
{
exiting = true;
@@ -213,6 +218,17 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
{
return currentProposedStepLength;
}
if(totalNewStep > currentProposedStepLength)
{
G4RegularNavigationHelper::
AddStepLength(copyNo, newStep-totalNewStep+currentProposedStepLength);
return currentProposedStepLength;
}
else
{
G4RegularNavigationHelper::AddStepLength( copyNo, newStep );
}
// Move container point until wall of voxel
//
@@ -228,6 +244,7 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
copyNo = param->GetReplicaNo(containerPoint,localDirection);
G4ThreeVector voxelTranslation = param->GetTranslation( copyNo );
// G4cout << " copyNo " << copyNo << " = " << pCurrentPhysical->GetCopyNo() << G4endl;
// Move local point until wall of voxel and then put it in the new voxel
// local coordinates
//
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4RegularNavigationHelper.cc,v 1.1 2009/01/27 09:31:29 gcosmo Exp $
// GEANT4 tag $ Name:$
//
// class G4RegularNavigationHelper implementation
//
// Author: Pedro Arce, November 2008
//
// --------------------------------------------------------------------
#include "G4RegularNavigationHelper.hh"
std::vector< std::pair<G4int,G4double> >
G4RegularNavigationHelper::theStepLengths;
// --------------------------------------------------------------------
//
G4RegularNavigationHelper::G4RegularNavigationHelper()
{
}
// --------------------------------------------------------------------
//
G4RegularNavigationHelper::~G4RegularNavigationHelper()
{
}
// --------------------------------------------------------------------
//
void G4RegularNavigationHelper::ClearStepLengths()
{
theStepLengths.clear();
}
// --------------------------------------------------------------------
//
void G4RegularNavigationHelper::AddStepLength( G4int copyNo, G4double slen )
{
theStepLengths.push_back( std::pair<G4int,G4double>(copyNo,slen) );
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VIntersectionLocator.cc,v 1.4 2008/11/14 18:26:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VIntersectionLocator.cc,v 1.7 2009/11/27 15:21:59 japost Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// Class G4VIntersectionLocator implementation
//
@@ -42,12 +42,16 @@
//
// Constructor
//
G4VIntersectionLocator:: G4VIntersectionLocator(G4Navigator *theNavigator)
G4VIntersectionLocator:: G4VIntersectionLocator(G4Navigator *theNavigator):
fUseNormalCorrection(false),
fiNavigator( theNavigator ),
fiChordFinder( 0 ), // Not set - overridden at each step
fiEpsilonStep( -1.0 ), // Out of range - overridden at each step
fiDeltaIntersection( -1.0 ), // Out of range - overridden at each step
fiUseSafety(false) // Default - overridden at each step
{
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
fiNavigator = theNavigator;
fVerboseLevel = 0;
fUseNormalCorrection = false;
fHelpingNavigator = new G4Navigator();
}
@@ -190,12 +194,13 @@ ReEstimateEndpoint( const G4FieldTrack &CurrentStateA,
G4double advanceLength= endCurveLen - currentCurveLen ;
if (std::abs(advanceLength)<kCarTolerance)
{
advanceLength=(EstimatedEndStateB.GetPosition()
-newEndPoint.GetPosition()).mag();
goodAdvance=true;
}
else{
goodAdvance=
integrDriver->AccurateAdvance(newEndPoint, advanceLength,
GetEpsilonStepFor());
}
}
while( !goodAdvance && (++itrial < no_trials) );
@@ -341,7 +346,7 @@ AdjustmentOfFoundIntersection( const G4ThreeVector &CurrentA_Point,
// Intersection between Line and Plane
//
G4double n_d_m = Normal.dot(MomentumDir);
if ( std::abs(n_d_m)<kCarTolerance )
if ( std::abs(n_d_m)>kCarTolerance )
{
if ( fVerboseLevel>1 )
{