Import Geant4 9.3.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.126 2008/12/11 10:53:12 gcosmo Exp $
|
||||
$Id: History,v 1.138 2009/12/11 05:48:53 japost Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -16,6 +16,102 @@ committal in the CVS repository !
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
Dec 11th, 2009 - J.Apostolakis (geomnav-V09-02-11)
|
||||
------------------------------
|
||||
- G4PropagatorInField
|
||||
* Implementation field by Region
|
||||
- with extra checking of logical volume
|
||||
|
||||
Nov 30th, 2009 - J.Apostolakis (geomnav-V09-02-10)
|
||||
------------------------------
|
||||
- G4VIntersectionLocator
|
||||
* Fix problem in ReEstimateEndPoint() behaviour for very small steps.
|
||||
|
||||
* Corrected constructor to ensure that it initialises all data members.
|
||||
* Labelled the methods (in header) to make noticable those that
|
||||
must changed at every step.
|
||||
( attributes: ChordFinder, EpsilonStep, Navigator )
|
||||
|
||||
Nov 23rd, 2009 - J.Apostolakis
|
||||
------------------------------
|
||||
- Fixed G4PropagatorInField.cc:
|
||||
* Revise condition for flagging ZeroStep to avoid fake triggering.
|
||||
Small proposed steps (from Physics) could trigger the previous
|
||||
simple condition for Tiny/Zero Problem steps.
|
||||
[ This was first commited on branch geomnav-V09-02-08_branch
|
||||
and tagged geomnav-V09-02-80 ]
|
||||
|
||||
Nov 12th, 2009 - J.Apostolakis (geomnav-V09-02-09)
|
||||
------------------------------
|
||||
- G4PropagatorInField: cleanup of minor methods:
|
||||
Added new method RefreshIntersectionLocator to update the state of
|
||||
Use this method to synchronise with IntersectionLocator.
|
||||
Deleted long obsolete methods: SetAccuraciesWithDeltaOneStep
|
||||
SetDeltaIntersection, SetDeltaOneStep
|
||||
Revised implementation to avoid using the older methods
|
||||
GetDeltaIntersection GetDeltaOneStep
|
||||
|
||||
Nov 12th, 2009 - J.Apostolakis (geomnav-V09-02-08)
|
||||
------------------------------
|
||||
- Refined G4PropagatorInField.cc:
|
||||
* Changed parameters for treating consecutive tiny/zero steps:
|
||||
- the value of default decrease factor to 0.25 (from 0.1),
|
||||
- the value is not used when the step size falls below a certain threshold.s
|
||||
This threshold is changed. It is expressed as a multiple of fZeroStepThreshold
|
||||
instead of kCarTolerance. The reasons are:
|
||||
* the threshold were meant to refer to the ZeroStepThreshold (it was kCarTolerance)
|
||||
* the values were now much larger than this ZeroStepThreshold.
|
||||
- The value given to the decrease factor after the first such thresholds is changed to 0.35
|
||||
instead of 0.25, 0.5.
|
||||
* Improved printing of Diagnostic message.
|
||||
|
||||
Nov 3rd, 2009 - J.Apostolakis (geomnav-V09-02-07)
|
||||
------------------------------
|
||||
- Refined G4PropagatorInField.cc:
|
||||
* Added new member fZeroStepThreshold, to enable tuning of threshold for Tiny/Zero steps.
|
||||
* Changed default value from 0.5 * kCarTolerance
|
||||
to max (100,000 * kCarTolerance, 0.1 * micron )
|
||||
* This is first revision to address problem seen at boundary of volumes (Reports of Atlas) .
|
||||
|
||||
June 2nd, 2009 - J.Apostolakis (geomnav-V09-02-06)
|
||||
------------------------------
|
||||
- Fix in G4PropagatorInField::SetNavigator
|
||||
* Forward new Navigator to IntersectionLocator.
|
||||
|
||||
May 20th, 2009 - P.Arce (geomnav-V09-02-05)
|
||||
-----------------------
|
||||
- Added method BuildContainerSolid() taking a solid as argument to
|
||||
G4PhantomParameterisation. Added protection to GetMaterialIndex()
|
||||
for zero index.
|
||||
|
||||
May 18th, 2009 - T.Nikitina (geomnav-V09-02-04)
|
||||
---------------------------
|
||||
- Enhanced algorithm for 'FB_intersects' in order to speedup BrentLocator.
|
||||
- Fix in the usage of the geometrical tolerance in G4VIntersectionLocator
|
||||
in method AdjustementOfFoundIntersection().
|
||||
|
||||
May 13th, 2009 - J.Apostolakis (geomnav-V09-02-03)
|
||||
------------------------------
|
||||
- Fix in G4PathFinder: A geometry is at a boundary if its step is within
|
||||
tolerance of the minimum step for any geometry.
|
||||
|
||||
May 5th, 2009 - T.Nikitina (geomnav-V09-02-02)
|
||||
--------------------------
|
||||
- Fix in G4Navigator::ComputeStep() for the computation of rotation of the
|
||||
'LocalExitNormal' in cases when DistanceToOut() returns non-valid normal
|
||||
for optical photons in rotated solids. Addresses problem report #1059.
|
||||
|
||||
February 26th, 2009 - T.Nikitina (geomnav-V09-02-01)
|
||||
--------------------------------
|
||||
- Fixed problem in G4BrentLocator::EstimateIntersectionPoint() responsible
|
||||
for rare cases of negative steps.
|
||||
|
||||
January 27th, 2009 - G.Cosmo (geomnav-V09-02-00)
|
||||
----------------------------
|
||||
- Added G4RegularNavigationHelper class, used by G4RegularNavigation for
|
||||
counting the number of step lengths in each voxel of the regular structure
|
||||
(by P.Arce).
|
||||
- Some code cleanup...
|
||||
|
||||
December 11th, 2008 - T.Nikitina (geomnav-V09-01-10)
|
||||
--------------------------------
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Navigator.hh,v 1.27 2008/10/24 14:00:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4Navigator.hh,v 1.29 2009/11/30 11:59:52 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// class G4Navigator
|
||||
@@ -37,7 +37,7 @@
|
||||
// or to find the physical volume containing a given point in the world
|
||||
// reference system. The navigator maintains a transformation history and
|
||||
// other information to optimise the tracking time performance.
|
||||
//
|
||||
|
||||
// History:
|
||||
// - Created. Paul Kent, Jul 95/96
|
||||
// - Zero step protections J.A. / G.C., Nov 2004
|
||||
@@ -236,10 +236,11 @@ class G4Navigator
|
||||
inline G4bool ExitedMotherVolume() const;
|
||||
// Verify if the step has exited the mother volume.
|
||||
|
||||
inline void CheckMode(G4bool mode);
|
||||
inline void CheckMode(G4bool mode);
|
||||
// Run navigation in "check-mode", therefore using additional
|
||||
// verifications and more strict correctness conditions.
|
||||
// Is effective only with G4VERBOSE set.
|
||||
inline G4bool IsCheckModeActive() { return fCheck; }
|
||||
|
||||
void PrintState() const;
|
||||
// Print the internal state of the Navigator (for debugging).
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhantomParameterisation.hh,v 1.4 2008/01/22 15:02:36 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4PhantomParameterisation.hh,v 1.5 2009/05/19 18:27:03 arce Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// class G4PhantomParameterisation
|
||||
@@ -112,6 +112,7 @@ class G4PhantomParameterisation : public G4VPVParameterisation
|
||||
const G4VPhysicalVolume*) const {}
|
||||
|
||||
void BuildContainerSolid( G4VPhysicalVolume *pPhysicalVol );
|
||||
void BuildContainerSolid( G4VSolid *pMotherSolid );
|
||||
// Save as container solid the parent of the voxels. Check that the
|
||||
// voxels fill it completely.
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PropagatorInField.hh,v 1.17 2008/11/13 14:28:56 tnikitin Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4PropagatorInField.hh,v 1.19 2009/11/13 17:34:26 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// Class G4PropagatorInField
|
||||
@@ -162,16 +162,13 @@ class G4PropagatorInField
|
||||
|
||||
inline G4VIntersectionLocator* GetIntersectionLocator();
|
||||
inline void SetIntersectionLocator(G4VIntersectionLocator *pLocator );
|
||||
// Change or get the object which calculates the exact
|
||||
// intersection point with the next boundary
|
||||
|
||||
public: // without description
|
||||
|
||||
inline G4double GetDeltaIntersection() const;
|
||||
inline G4double GetDeltaOneStep() const;
|
||||
inline void SetAccuraciesWithDeltaOneStep( G4double deltaOneStep );
|
||||
inline void SetDeltaIntersection( G4double deltaIntersection );
|
||||
inline void SetDeltaOneStep( G4double deltaOneStep );
|
||||
// The above 5 methods are obsolete and will not work, as they have been
|
||||
// replaced by the same methods in G4FieldManager since Geant4 4.0 ...
|
||||
|
||||
inline G4FieldManager* GetCurrentFieldManager();
|
||||
inline void SetNavigatorForPropagating( G4Navigator *SimpleOrMultiNavigator );
|
||||
@@ -182,6 +179,13 @@ class G4PropagatorInField
|
||||
G4int noAbandon );
|
||||
inline G4int GetThresholdNoZeroSteps( G4int i );
|
||||
|
||||
inline G4double GetZeroStepThreshold();
|
||||
inline void SetZeroStepThreshold( G4double newLength );
|
||||
|
||||
void RefreshIntersectionLocator();
|
||||
// Update the Locator with parameters from this class
|
||||
// and from current field manager
|
||||
|
||||
protected: // with description
|
||||
|
||||
void PrintStepLengthDiagnostic( G4double currentProposedStepLength,
|
||||
@@ -242,6 +246,8 @@ class G4PropagatorInField
|
||||
|
||||
G4double kCarTolerance;
|
||||
// Geometrical tolerance defining surface thickness
|
||||
G4double fZeroStepThreshold;
|
||||
// Threshold for counting of tiny or 'zero' steps
|
||||
|
||||
G4VIntersectionLocator *fIntersectionLocator;
|
||||
G4bool fAllocatedLocator;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PropagatorInField.icc,v 1.13 2008/10/29 14:31:55 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4PropagatorInField.icc,v 1.16 2009/11/13 17:34:26 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -109,6 +109,7 @@ void G4PropagatorInField::SetMaxLoopCount( G4int new_max )
|
||||
fMax_loop_count = new_max;
|
||||
}
|
||||
|
||||
// #if 0
|
||||
inline
|
||||
G4double G4PropagatorInField::GetDeltaIntersection() const
|
||||
{
|
||||
@@ -120,25 +121,7 @@ G4double G4PropagatorInField::GetDeltaOneStep() const
|
||||
{
|
||||
return fCurrentFieldMgr->GetDeltaOneStep();
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
G4PropagatorInField::SetAccuraciesWithDeltaOneStep( G4double valDeltaOneStep )
|
||||
{
|
||||
fDetectorFieldMgr->SetAccuraciesWithDeltaOneStep(valDeltaOneStep);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4PropagatorInField::SetDeltaOneStep( G4double valDeltaOneStep )
|
||||
{
|
||||
fDetectorFieldMgr->SetDeltaOneStep(valDeltaOneStep);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4PropagatorInField::SetDeltaIntersection( G4double valDeltaIntersection )
|
||||
{
|
||||
fDetectorFieldMgr->SetDeltaIntersection(valDeltaIntersection);
|
||||
}
|
||||
// #endif
|
||||
|
||||
inline
|
||||
G4int G4PropagatorInField::GetVerboseLevel() const
|
||||
@@ -235,6 +218,12 @@ G4int G4PropagatorInField::GetThresholdNoZeroSteps( G4int i )
|
||||
return t;
|
||||
}
|
||||
|
||||
inline G4double G4PropagatorInField::GetZeroStepThreshold(){ return fZeroStepThreshold; }
|
||||
inline void G4PropagatorInField::SetZeroStepThreshold( G4double newLength )
|
||||
{
|
||||
fZeroStepThreshold= newLength;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4PropagatorInField::SetDetectorFieldManager(G4FieldManager* newDetectorFieldManager)
|
||||
{
|
||||
@@ -258,7 +247,12 @@ inline
|
||||
void G4PropagatorInField::
|
||||
SetNavigatorForPropagating( G4Navigator *SimpleOrMultiNavigator )
|
||||
{
|
||||
if(SimpleOrMultiNavigator) { fNavigator= SimpleOrMultiNavigator; }
|
||||
if(SimpleOrMultiNavigator) {
|
||||
fNavigator= SimpleOrMultiNavigator;
|
||||
if( fIntersectionLocator ) {
|
||||
fIntersectionLocator->SetNavigatorFor( SimpleOrMultiNavigator );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -294,3 +288,4 @@ G4bool G4PropagatorInField::IntersectChord( G4ThreeVector StartPointA,
|
||||
fPreviousSafety,fPreviousSftOrigin,
|
||||
LinearStepLength,IntersectionPoint);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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.hh,v 1.1 2009/01/27 09:31:29 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4RegularNavigationHelper
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Utility class for navigation on regular structures, providing step
|
||||
// lengths counting for each regular voxel of the structure.
|
||||
|
||||
// Author: Pedro Arce, November 2008
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4RegularNavigationHelper_HH
|
||||
#define G4RegularNavigationHelper_HH
|
||||
|
||||
#include <vector>
|
||||
#include "globals.hh"
|
||||
|
||||
class G4RegularNavigationHelper
|
||||
{
|
||||
public:
|
||||
|
||||
G4RegularNavigationHelper();
|
||||
~G4RegularNavigationHelper();
|
||||
|
||||
static void ClearStepLengths();
|
||||
static void AddStepLength( G4int copyNo, G4double slen );
|
||||
|
||||
static std::vector< std::pair<G4int,G4double> > theStepLengths;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VIntersectionLocator.hh,v 1.4 2008/11/14 18:26:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VIntersectionLocator.hh,v 1.6 2009/11/30 11:39:15 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// Class G4VIntersectionLocator
|
||||
@@ -94,25 +94,36 @@ class G4VIntersectionLocator
|
||||
// Intersect the chord from StartPointA to EndPointB and return
|
||||
// whether an intersection occurred. NOTE: changes the Safety!
|
||||
|
||||
inline void SetEpsilonStepFor( G4double EpsilonStep );
|
||||
inline void SetDeltaIntersectionFor( G4double deltaIntersection );
|
||||
inline void SetNavigatorFor( G4Navigator *fNavigator );
|
||||
inline void SetChordFinderFor(G4ChordFinder *fCFinder );
|
||||
// These parameters must be set at each step, in case they were changed
|
||||
|
||||
// Note: This simple approach ensures that all scenarios are considered.
|
||||
// [ Future refinement may identify which are invariant during a
|
||||
// track, run or event ]
|
||||
|
||||
inline void SetVerboseFor(G4int fVerbose);
|
||||
inline G4int GetVerboseFor();
|
||||
// Controling verbosity enables checking of the locating of intersections
|
||||
|
||||
public: // without description
|
||||
// Additional inline Set/Get methods for parameters, dependent objects
|
||||
|
||||
// inline Set/Get methods used for IntersctionLocator
|
||||
inline G4double GetDeltaIntersectionFor();
|
||||
inline G4double GetEpsilonStepFor();
|
||||
inline G4Navigator* GetNavigatorFor();
|
||||
inline G4ChordFinder* GetChordFinderFor();
|
||||
|
||||
inline G4double GetDeltaIntersectionFor();
|
||||
inline G4double GetEpsilonStepFor();
|
||||
inline G4Navigator* GetNavigatorFor();
|
||||
inline G4ChordFinder* GetChordFinderFor();
|
||||
inline G4int GetVerboseFor();
|
||||
inline void SetSafetyParametersFor(G4bool UseSafety );
|
||||
|
||||
inline void SetEpsilonStepFor( G4double EpsilonStep );
|
||||
inline void SetDeltaIntersectionFor( G4double deltaIntersection );
|
||||
inline void SetNavigatorFor( G4Navigator *fNavigator );
|
||||
inline void SetChordFinderFor(G4ChordFinder *fCFinder );
|
||||
inline void SetSafetyParametersFor(G4bool UseSafety );
|
||||
inline void SetVerboseFor(G4int fVerbose);
|
||||
|
||||
inline void AddAdjustementOfFoundIntersection(G4bool UseCorrection);
|
||||
inline void AddAdjustementOfFoundIntersection(G4bool UseCorrection);
|
||||
inline G4bool GetAdjustementOfFoundIntersection();
|
||||
// Methods to be made Obsolete - replaced by methods below
|
||||
inline void AdjustIntersections(G4bool UseCorrection);
|
||||
inline G4bool AreIntersectionsAdjusted(){ return fUseNormalCorrection; }
|
||||
// Change adjustment flag ( New Interface )
|
||||
|
||||
protected: // with description
|
||||
|
||||
@@ -143,17 +154,19 @@ class G4VIntersectionLocator
|
||||
|
||||
protected:
|
||||
|
||||
G4double kCarTolerance;
|
||||
G4int fVerboseLevel;
|
||||
// For verbose purposes
|
||||
G4bool fUseNormalCorrection;
|
||||
G4double kCarTolerance; // Constant
|
||||
|
||||
G4int fVerboseLevel; // For debugging
|
||||
G4bool fUseNormalCorrection; // Configuration parameter
|
||||
|
||||
G4Navigator *fiNavigator;
|
||||
// Parameters set by G4PropagatorInField ( when ? )
|
||||
|
||||
G4ChordFinder *fiChordFinder;
|
||||
G4double fiEpsilonStep;
|
||||
G4double fiDeltaIntersection;
|
||||
G4Navigator *fiNavigator;
|
||||
G4ChordFinder *fiChordFinder;
|
||||
G4bool fiUseSafety;
|
||||
// For passing the parameters from G4PropagatorInField
|
||||
// Parameters set at each physical step by calling method - G4PropagatorInField
|
||||
|
||||
G4Navigator *fHelpingNavigator;
|
||||
// Helper for location
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user