Index: trunk/source/geometry/navigation/GNUmakefile
===================================================================
--- trunk/source/geometry/navigation/GNUmakefile	(revision 1337)
+++ trunk/source/geometry/navigation/GNUmakefile	(revision 1347)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.5 2007/11/23 13:30:47 gcosmo Exp $
+# $Id: GNUmakefile,v 1.7 2010/10/27 07:34:32 gcosmo Exp $
 # --------------------------------------------------------------------
 # GNUmakefile for geometry/volumes library.  Gabriele Cosmo, 16/11/96.
Index: trunk/source/geometry/navigation/History
===================================================================
--- trunk/source/geometry/navigation/History	(revision 1337)
+++ trunk/source/geometry/navigation/History	(revision 1347)
@@ -1,3 +1,3 @@
-$Id: History,v 1.139 2010/03/08 13:57:48 gcosmo Exp $
+$Id: History,v 1.152 2010/12/15 13:47:10 gcosmo Exp $
 -------------------------------------------------------------------
 
@@ -17,4 +17,80 @@
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
+
+December 15th, 2010 - G.Cosmo (geomnav-V09-03-10)
+-----------------------------
+- Added inline method for creation of a touchable-history given a navigation
+  history as argument. Required for clients like G4ScoreSplittingProcess, to
+  avoid external symbols exporting on generation of DLLs.
+
+November 19th, 2010 - G.Cosmo (geomnav-V09-03-09)
+-----------------------------
+- Removed unused variable in G4RegularNavigation.
+
+November 15th, 2010 - G.Cosmo (geomnav-V09-03-08)
+-----------------------------
+- Restored trials for zero steps to 10 in G4Navigator, as originally.
+
+November 12th, 2010 - G.Cosmo (geomnav-V09-03-07)
+-----------------------------
+- Cleared compilation warnings for unused parameters; temporarily commented out.
+
+November 11th, 2010 - G.Cosmo (geomnav-V09-03-06)
+-----------------------------
+- Set trials for zero steps to 5 before activating push in G4Navigator;
+  increased unit value to 100 times kCarTolerance to make push more effective.
+
+November 10th, 2010 - G.Cosmo (geomnav-V09-03-05)
+-----------------------------
+- Reduced trials for zero steps from 10 to 3 for activating tolerance push
+  in G4Navigator.
+- Added possibility to switch off push notifications in G4Navigator; also
+  added related UI command.
+
+November 9th, 2010 - P.Arce
+---------------------------
+- Added new class G4PartialPhantomParameterisation allowing for envelopes
+  of different types other than box for regular geometries, so that relaxing
+  the restriction for voxels to completely fill the envelope container.
+  Adapted G4PhantomParameterisation, G4RegularNavigation and G4Navigator
+  accordingly.
+
+November 4th, 2010 - G.Cosmo
+----------------------------
+- Added new class G4NavigationLogger for "check-mode" verbosity. Reorganised
+  verbosity formatting for voxel and normal navigation.
+
+November 3rd, 2010 - J.Apostolakis
+----------------------------------
+- Added prototype class G4VoxelSafety for computation of exact safety.
+
+September 6th, 2010 - G.Cosmo (geomnav-V09-03-04)
+-----------------------------
+- Added missing initialization for 'fNewSafety' and 'fTrueMinStep' in
+  G4MultiNavigator constructor.
+
+September 3rd, 2010 - G.Cosmo (geomnav-V09-03-03)
+-----------------------------
+- Fixed typo in signature of ComputeStepSkippingEqualMaterials() in
+  G4RegularNavigation.
+
+August 19th, 2010 - T.Nikitina (geomnav-V09-03-02)
+------------------------------
+- Fix in G4GeomTestSegment::FindSomePoints(), to address problem report #980.
+
+July 12th, 2010 - G.Cosmo (geomnav-V09-03-01)
+-------------------------
+- Fixed array out of bound error in G4MultipleNavigator and G4PathFinder
+  constructors (J.Apostolakis).
+- Fixed cout precision restoring in G4BrentLocator, G4PropagatorInField,
+  G4SimpleLocator, G4VIntersectionLocator and G4MultiLevelLocator.
+- Removed unused private data members in G4MultiLevelLocator.
+- Replaced use of DBL_MAX for distances with kInfinity in G4MultiNavigator
+  and G4Navigator internals.
+- Exchanged conditions for initialization of members in G4TransportationManager
+  constructor.
+- Added dummy initialisation of members in constructors in G4MultiNavigator,
+  G4ParameterisedNavigation, G4PathFinder, G4PhantomParameterisation,
+  G4RegularNavigation.
 
 March 8th, 2010 - G.Cosmo (geomnav-V09-03-00)
Index: trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4AuxiliaryNavServices.hh,v 1.4 2007/05/22 07:48:08 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.icc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4AuxiliaryNavServices.icc,v 1.4 2007/05/22 07:48:08 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4BrentLocator.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4BrentLocator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4BrentLocator.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BrentLocator.hh,v 1.2 2008/10/29 14:31:55 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // Class G4BrentLocator
Index: trunk/source/geometry/navigation/include/G4DrawVoxels.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4DrawVoxels.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4DrawVoxels.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4DrawVoxels.hh,v 1.3 2006/06/29 18:35:36 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/include/G4ErrorPropagationNavigator.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4ErrorPropagationNavigator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4ErrorPropagationNavigator.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4ErrorPropagationNavigator.hh,v 1.2 2008/10/24 14:00:03 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4GeomTestErrorList.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestErrorList.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestErrorList.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestErrorList.hh,v 1.3 2006/06/29 18:35:38 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestLogger.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestLogger.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestLogger.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestLogger.hh,v 1.3 2006/06/29 18:35:40 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestOverlapList.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestOverlapList.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestOverlapList.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestOverlapList.hh,v 1.3 2006/06/29 18:35:43 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestOvershootList.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestOvershootList.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestOvershootList.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestOvershootList.hh,v 1.3 2006/06/29 18:35:45 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestPoint.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestPoint.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestPoint.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestPoint.hh,v 1.3 2006/06/29 18:35:48 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestSegment.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestSegment.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestSegment.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestSegment.hh,v 1.4 2007/05/11 13:43:59 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestStreamLogger.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestStreamLogger.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestStreamLogger.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestStreamLogger.hh,v 1.3 2006/06/29 18:35:52 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestVolPoint.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestVolPoint.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestVolPoint.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestVolPoint.hh,v 1.3 2006/06/29 18:35:55 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeomTestVolume.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeomTestVolume.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeomTestVolume.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestVolume.hh,v 1.3 2006/06/29 18:35:57 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4GeometryMessenger.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4GeometryMessenger.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4GeometryMessenger.hh	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4GeometryMessenger.hh,v 1.4 2006/06/29 18:35:59 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4GeometryMessenger.hh,v 1.5 2010/11/10 14:06:40 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
@@ -78,4 +78,5 @@
     void SetVerbosity(G4String newValue);
     void SetCheckMode(G4String newValue);
+    void SetPushFlag(G4String newValue);
     void LineTest();
     void RecursiveLineTest();
@@ -88,5 +89,6 @@
     G4UIcmdWith3VectorAndUnit *posCmd, *dirCmd;
     G4UIcmdWith3Vector        *grzCmd, *cyzCmd;
-    G4UIcmdWithABool          *chkCmd, *linCmd, *grdCmd, *cylCmd, *runCmd;
+    G4UIcmdWithABool          *chkCmd, *pchkCmd, *linCmd,
+                              *grdCmd, *cylCmd, *runCmd;
     G4UIcmdWithoutParameter   *recCmd, *resCmd;
     G4UIcmdWithADoubleAndUnit *tolCmd;
Index: trunk/source/geometry/navigation/include/G4MultiLevelLocator.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4MultiLevelLocator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4MultiLevelLocator.hh	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4MultiLevelLocator.hh,v 1.2 2008/10/29 14:31:55 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4MultiLevelLocator.hh,v 1.3 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -78,9 +78,4 @@
      G4FieldTrack* ptrInterMedFT[max_depth+1];
        // Used to store intermediate tracks values in case of too slow progress
-
-     G4int maxNumberOfStepsForIntersection;
-     G4int maxNumberOfCallsToReIntegration;
-     G4int maxNumberOfCallsToReIntegration_depth;
-       //  Counters for Statistics about Location and ReIntegrations
 };
 
Index: trunk/source/geometry/navigation/include/G4MultiNavigator.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4MultiNavigator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4MultiNavigator.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4MultiNavigator.hh,v 1.5 2008/10/24 14:00:03 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4Navigator.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4Navigator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4Navigator.hh	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4Navigator.hh,v 1.29 2009/11/30 11:59:52 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4Navigator.hh,v 1.34 2010/12/15 13:46:39 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -200,4 +200,5 @@
   inline G4GRSSolid* CreateGRSSolid() const; 
   inline G4TouchableHistory* CreateTouchableHistory() const;
+  inline G4TouchableHistory* CreateTouchableHistory(const G4NavigationHistory*) const;
     // `Touchable' creation methods: caller has deletion responsibility.
 
@@ -241,5 +242,7 @@
     // verifications and more strict correctness conditions.
     // Is effective only with G4VERBOSE set.
-  inline G4bool IsCheckModeActive() { return fCheck; } 
+  inline G4bool IsCheckModeActive() const;
+  inline void   SetPushVerbosity(G4bool mode);
+    // Set/unset verbosity for pushed tracks (default is true).
 
   void PrintState() const;
@@ -263,14 +266,10 @@
     //         9 (ready to abandon), 10 (abandoned)
 
-  // inline 
   void SetSavedState(); 
-  // ( fValidExitNormal, fExitNormal, fExiting, fEntering, 
-  //   fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero); 
-  // inline 
+    // ( fValidExitNormal, fExitNormal, fExiting, fEntering, 
+    //   fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero); 
   void RestoreSavedState(); 
     // Copy aspects of the state, to enable a non-state changing
     //  call to ComputeStep
-
- public:  // with description
 
   inline G4ThreeVector GetCurrentLocalCoordinate() const;
@@ -283,5 +282,9 @@
     // Compute+return the local->global translation/rotation of current volume.
 
+  inline void EnableBestSafety( G4bool value= false );
+    // Enable best-possible evaluation of isotropic safety
+
  protected:  // with description
+
   inline G4ThreeVector ComputeLocalPoint(const G4ThreeVector& rGlobPoint) const;
     // Return position vector in local coordinate system, given a position
@@ -310,4 +313,10 @@
     // o Recompute transforms and/or solids of replicated/parameterised
     //   volumes.
+
+ private:
+
+  void ComputeStepLog(const G4ThreeVector& pGlobalpoint,
+                            G4double moveLenSq) const;
+    // Log and checks for steps larger than the tolerance
 
  protected:  // without description
@@ -434,6 +443,6 @@
   G4bool fCheck;
     // Check-mode flag  [if true, more strict checks are performed].
-  G4bool fPushed;
-    // Push flag  [if true, means a stuck particle has been pushed].
+  G4bool fPushed, fWarnPush;
+    // Push flags  [if true, means a stuck particle has been pushed].
 
   // Helpers/Utility classes
Index: trunk/source/geometry/navigation/include/G4Navigator.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4Navigator.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4Navigator.icc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4Navigator.icc,v 1.15 2007/10/18 14:18:36 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4Navigator.icc,v 1.18 2010/12/15 13:46:39 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
@@ -308,4 +308,17 @@
 
 // ********************************************************************
+// CreateTouchableHistory(history)
+//
+// `Touchable' creation method: caller has deletion responsibility
+// ********************************************************************
+//
+inline
+G4TouchableHistory*
+G4Navigator::CreateTouchableHistory(const G4NavigationHistory* history) const
+{
+  return new G4TouchableHistory(*history);
+}
+
+// ********************************************************************
 // LocateGlobalPointAndUpdateTouchableHandle
 // ********************************************************************
@@ -450,4 +463,24 @@
 
 // ********************************************************************
+// IsCheckModeActive
+// ********************************************************************
+//
+inline
+G4bool G4Navigator::IsCheckModeActive() const
+{
+  return fCheck;
+}
+
+// ********************************************************************
+// SetPushVerbosity
+// ********************************************************************
+//
+inline
+void G4Navigator::SetPushVerbosity(G4bool mode)
+{
+  fWarnPush = mode;
+}
+
+// ********************************************************************
 // SeverityOfZeroStepping
 //
@@ -485,2 +518,11 @@
   return severity;
 }
+
+// ********************************************************************
+// EnableBestSafety
+// ********************************************************************
+//
+inline void G4Navigator::EnableBestSafety( G4bool value )
+{
+  fvoxelNav.EnableBestSafety( value );
+}
Index: trunk/source/geometry/navigation/include/G4NormalNavigation.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4NormalNavigation.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4NormalNavigation.hh	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4NormalNavigation.hh,v 1.4 2006/06/29 18:36:06 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NormalNavigation.hh,v 1.6 2010/11/04 08:57:56 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
@@ -42,5 +42,8 @@
 #define G4NORMALNAVIGATION_HH
 
+#include <iomanip>
+
 #include "G4NavigationHistory.hh"
+#include "G4NavigationLogger.hh"
 #include "G4VPhysicalVolume.hh"
 #include "G4LogicalVolume.hh"
@@ -89,5 +92,5 @@
                             const G4double pMaxLength=DBL_MAX );
 
-    inline G4int GetVerboseLevel();
+    inline G4int GetVerboseLevel() const;
     inline void  SetVerboseLevel(G4int level);
       // Get/Set Verbose(ness) level.
@@ -102,5 +105,5 @@
 
     G4bool fCheck; 
-    G4int  fVerbose; 
+    G4NavigationLogger* fLogger;
 };
 
Index: trunk/source/geometry/navigation/include/G4NormalNavigation.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4NormalNavigation.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4NormalNavigation.icc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4NormalNavigation.icc,v 1.4 2006/06/29 18:36:08 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NormalNavigation.icc,v 1.5 2010/11/04 08:57:56 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
@@ -94,16 +94,28 @@
 }
 
+// ********************************************************************
+// GetVerboseLevel
+// ********************************************************************
+//
 inline
-G4int G4NormalNavigation::GetVerboseLevel()
+G4int G4NormalNavigation::GetVerboseLevel() const
 {
-  return fVerbose;
+  return fLogger->GetVerboseLevel();
 }
 
+// ********************************************************************
+// SetVerboseLevel
+// ********************************************************************
+//
 inline
 void G4NormalNavigation::SetVerboseLevel(G4int level)
 {
-  fVerbose = level;
+  fLogger->SetVerboseLevel(level);
 }
 
+// ********************************************************************
+// CheckMode
+// ********************************************************************
+//
 inline
 void G4NormalNavigation::CheckMode(G4bool mode)
Index: trunk/source/geometry/navigation/include/G4ParameterisedNavigation.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4ParameterisedNavigation.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4ParameterisedNavigation.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4ParameterisedNavigation.hh,v 1.6 2007/11/09 16:06:02 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/include/G4ParameterisedNavigation.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4ParameterisedNavigation.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4ParameterisedNavigation.icc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4ParameterisedNavigation.icc,v 1.7 2007/11/09 16:06:02 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/include/G4PathFinder.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4PathFinder.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4PathFinder.hh	(revision 1347)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4PathFinder.hh,v 1.34 2007/11/02 12:28:31 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4PathFinder.hh,v 1.35 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 // 
 // class G4PathFinder 
@@ -259,10 +259,6 @@
    // State for Step numbers 
    G4int         fLastStepNo, fCurrentStepNo; 
-   G4bool        fParticleIsLooping;
 
    G4int         fVerboseLevel;            // For debuging purposes
-
-   G4int         fMax_loop_count;
-     // Limit for the number of sub-steps taken in one call to ComputeStep
 
    G4TransportationManager* fpTransportManager; // Cache for frequent use
Index: trunk/source/geometry/navigation/include/G4PhantomParameterisation.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4PhantomParameterisation.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4PhantomParameterisation.hh	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4PhantomParameterisation.hh,v 1.5 2009/05/19 18:27:03 arce Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4PhantomParameterisation.hh,v 1.6 2010/11/09 15:43:15 arce Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -117,5 +117,5 @@
       // voxels fill it completely.
 
-    G4int GetReplicaNo( const G4ThreeVector& localPoint,
+    virtual G4int GetReplicaNo( const G4ThreeVector& localPoint,
                         const G4ThreeVector& localDir );
       // Get the voxel number corresponding to the point in the container
@@ -167,5 +167,5 @@
       // Check that the copy number is within limits.
 
-  private:
+  protected:
 
     G4double fVoxelHalfX,fVoxelHalfY,fVoxelHalfZ;
Index: trunk/source/geometry/navigation/include/G4PhantomParameterisation.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4PhantomParameterisation.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4PhantomParameterisation.icc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4PhantomParameterisation.icc,v 1.1 2007/10/17 19:13:58 arce Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //--------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4PropagatorInField.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4PropagatorInField.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4PropagatorInField.hh	(revision 1347)
@@ -26,5 +26,5 @@
 // 
 // $Id: G4PropagatorInField.hh,v 1.19 2009/11/13 17:34:26 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4PropagatorInField.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4PropagatorInField.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4PropagatorInField.icc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4PropagatorInField.icc,v 1.16 2009/11/13 17:34:26 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/include/G4RegularNavigation.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4RegularNavigation.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4RegularNavigation.hh	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4RegularNavigation.hh,v 1.2 2007/10/18 14:18:36 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4RegularNavigation.hh,v 1.4 2010/09/03 16:29:43 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -87,5 +87,5 @@
   
     G4double ComputeStepSkippingEqualMaterials( 
-                          const G4ThreeVector localPoint,
+                                G4ThreeVector& localPoint,
                           const G4ThreeVector& globalDirection,
                           const G4double currentProposedStepLength,
@@ -116,6 +116,6 @@
     // Set and Get methods
 
-    void SetVerboseLevel(G4int level) { fVerbose = level; }
-    void CheckMode(G4bool mode) { fCheck = mode; }
+    void SetVerboseLevel(G4int level) { fverbose = level; }
+    void CheckMode(G4bool mode) { fcheck = mode; }
     void SetNormalNavigation( G4NormalNavigation* fnormnav )
       { fnormalNav = fnormnav; }
@@ -123,6 +123,6 @@
   private:
 
-    G4int fVerbose;
-    G4bool fCheck;
+    G4int fverbose;
+    G4bool fcheck;
 
     G4NormalNavigation* fnormalNav;
Index: trunk/source/geometry/navigation/include/G4RegularNavigationHelper.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4RegularNavigationHelper.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4RegularNavigationHelper.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4RegularNavigationHelper.hh,v 1.1 2009/01/27 09:31:29 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/include/G4ReplicaNavigation.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4ReplicaNavigation.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4ReplicaNavigation.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4ReplicaNavigation.hh,v 1.6 2007/05/18 07:31:09 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/include/G4ReplicaNavigation.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4ReplicaNavigation.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4ReplicaNavigation.icc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4ReplicaNavigation.icc,v 1.5 2006/06/29 18:36:22 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/include/G4SafetyHelper.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4SafetyHelper.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4SafetyHelper.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4SafetyHelper.hh,v 1.7 2007/05/02 15:32:13 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4SimpleLocator.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4SimpleLocator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4SimpleLocator.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4SimpleLocator.hh,v 1.2 2008/10/29 14:31:55 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4TransportationManager.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4TransportationManager.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4TransportationManager.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4TransportationManager.hh,v 1.12 2007/04/20 15:28:37 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // class G4TransportationManager
Index: trunk/source/geometry/navigation/include/G4TransportationManager.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4TransportationManager.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4TransportationManager.icc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4TransportationManager.icc,v 1.10 2007/04/20 15:28:37 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 // ------------------------------------------------------------
 //  GEANT 4  inlined function members implementation
Index: trunk/source/geometry/navigation/include/G4VIntersectionLocator.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4VIntersectionLocator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4VIntersectionLocator.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4VIntersectionLocator.hh,v 1.6 2009/11/30 11:39:15 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4VIntersectionLocator.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4VIntersectionLocator.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4VIntersectionLocator.icc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4VIntersectionLocator.icc,v 1.3 2008/11/14 18:26:35 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/include/G4VoxelNavigation.hh
===================================================================
--- trunk/source/geometry/navigation/include/G4VoxelNavigation.hh	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4VoxelNavigation.hh	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4VoxelNavigation.hh,v 1.5 2007/05/11 13:43:59 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4VoxelNavigation.hh,v 1.8 2010/11/04 12:13:30 japost Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
@@ -44,4 +44,5 @@
 #include "geomdefs.hh"
 #include "G4NavigationHistory.hh"
+#include "G4NavigationLogger.hh"
 #include "G4AffineTransform.hh"
 #include "G4VPhysicalVolume.hh"
@@ -51,4 +52,6 @@
 
 #include "G4BlockingList.hh"
+
+class G4VoxelSafety; 
 
 // Required for inline implementation
@@ -98,5 +101,5 @@
 
     inline G4int GetVerboseLevel() const;
-    inline void  SetVerboseLevel(G4int level);
+    void  SetVerboseLevel(G4int level);
       // Get/Set Verbose(ness) level.
       // [if level>0 && G4VERBOSE, printout can occur]
@@ -107,4 +110,7 @@
       // Is effective only with G4VERBOSE set.
 
+    inline void  EnableBestSafety( G4bool flag= false );
+      // Enable best-possible evaluation of isotropic safety
+
   protected:
 
@@ -113,4 +119,33 @@
                             const G4ThreeVector& localDirection,
                             const G4double currentStep );
+
+    G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
+					const G4ThreeVector& localPoint ) const;
+
+  private:  // Logging functions
+
+    void PreComputeStepLog  (const G4VPhysicalVolume* motherPhysical,
+                                   G4double motherSafety,
+                             const G4ThreeVector& localPoint);
+    void AlongComputeStepLog(const G4VSolid* sampleSolid,
+                             const G4ThreeVector& samplePoint,
+                             const G4ThreeVector& sampleDirection,
+                             const G4ThreeVector& localDirection,
+                                   G4double sampleSafety,
+                                   G4double sampleStep);
+    void PostComputeStepLog (const G4VSolid* motherSolid,
+                             const G4ThreeVector& localPoint,
+                             const G4ThreeVector& localDirection,
+                                   G4double motherStep,
+                                   G4double motherSafety);
+    void ComputeSafetyLog   (const G4VSolid* solid,
+                             const G4ThreeVector& point,
+                                   G4double safety,
+                                   G4bool banner);
+    inline void PrintDaughterLog (const G4VSolid* sampleSolid,
+                                  const G4ThreeVector& samplePoint,
+                                        G4double sampleSafety,
+                                        G4double sampleStep);   
+  protected:
 
     G4BlockingList fBList;
@@ -147,7 +182,12 @@
     //
 
+    G4VoxelSafety  *fpVoxelSafety;
+    //  Helper object for Voxel Safety
+
     G4bool fCheck;
-    G4int  fVerbose;
-    G4double kCarTolerance;
+    G4bool fBestSafety; 
+
+    G4NavigationLogger* fLogger;
+      // Verbosity logger
 };
 
Index: trunk/source/geometry/navigation/include/G4VoxelNavigation.icc
===================================================================
--- trunk/source/geometry/navigation/include/G4VoxelNavigation.icc	(revision 1337)
+++ trunk/source/geometry/navigation/include/G4VoxelNavigation.icc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4VoxelNavigation.icc,v 1.4 2006/06/29 18:36:30 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4VoxelNavigation.icc,v 1.7 2010/11/04 17:38:17 japost Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
@@ -67,7 +67,7 @@
     }
     else if ( targetNodeNo>=targetHeaderNoSlices )
-         {
-           targetNodeNo = targetHeaderNoSlices-1;
-         }
+    {
+      targetNodeNo = targetHeaderNoSlices-1;
+    }
     // Stack info for stepping
     //
@@ -169,15 +169,5 @@
 G4int G4VoxelNavigation::GetVerboseLevel() const
 {
-  return fVerbose;
-}
-
-// ********************************************************************
-// SetVerboseLevel
-// ********************************************************************
-//
-inline
-void  G4VoxelNavigation::SetVerboseLevel(G4int level)
-{
-  fVerbose = level;
+  return fLogger->GetVerboseLevel();
 }
 
@@ -191,2 +181,12 @@
   fCheck = mode;
 }
+
+// ********************************************************************
+// EnableBestSafety
+// ********************************************************************
+//
+inline
+void  G4VoxelNavigation::EnableBestSafety(G4bool flag)
+{
+  fBestSafety = flag;
+}
Index: trunk/source/geometry/navigation/src/G4AuxiliaryNavServices.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4AuxiliaryNavServices.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4AuxiliaryNavServices.cc	(revision 1347)
@@ -25,5 +25,5 @@
 //
 // $Id: G4AuxiliaryNavServices.cc,v 1.3 2006/06/29 18:36:32 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4BrentLocator.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4BrentLocator.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4BrentLocator.cc	(revision 1347)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BrentLocator.cc,v 1.8 2009/05/15 12:55:48 tnikitin Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BrentLocator.cc,v 1.9 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // Class G4BrentLocator implementation
@@ -142,4 +142,5 @@
   G4bool restoredFullEndpoint = false;
 
+  G4int oldprc;  // cout, cerr precision
   G4int substep_no = 0;
    
@@ -505,5 +506,5 @@
                    << GetEpsilonStepFor() << G4endl;
           }
-          G4cerr.precision(20);
+          oldprc = G4cerr.precision(20);
           G4cerr << " Point A (Curve start)     is " << CurveStartPointVelocity
                  << G4endl;
@@ -529,4 +530,5 @@
                  << GetEpsilonStepFor() <<" DeltaInters= "
                  << GetDeltaIntersectionFor() << G4endl;
+          G4cerr.precision( oldprc ); 
 
           G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
@@ -728,5 +730,5 @@
                  -1.0, NewSafety, substep_no);
     G4cout << G4endl;
-    G4cout.precision( 10 ); 
+    oldprc = G4cout.precision( 10 ); 
     G4double done_len = CurrentA_PointVelocity.GetCurveLength(); 
     G4double full_len = CurveEndPointVelocity.GetCurveLength();
@@ -736,4 +738,5 @@
            << " out of " << full_len << " required." << G4endl;
     G4cout << "        Remaining length = " << full_len - done_len << G4endl; 
+    G4cout.precision( oldprc ); 
 
     G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
@@ -743,5 +746,5 @@
   else if( substep_no >= warn_substeps )
   {  
-    G4int oldprc= G4cout.precision( 10 ); 
+    oldprc= G4cout.precision( 10 ); 
     G4cout << "WARNING - G4BrentLocator::EstimateIntersectionPoint()"
            << G4endl
Index: trunk/source/geometry/navigation/src/G4DrawVoxels.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4DrawVoxels.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4DrawVoxels.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4DrawVoxels.cc,v 1.4 2006/06/29 18:36:34 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/src/G4ErrorPropagationNavigator.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4ErrorPropagationNavigator.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4ErrorPropagationNavigator.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4ErrorPropagationNavigator.cc,v 1.2 2008/10/24 14:00:03 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/geometry/navigation/src/G4GeomTestErrorList.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestErrorList.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestErrorList.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestErrorList.cc,v 1.3 2006/06/29 18:36:36 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4GeomTestOverlapList.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestOverlapList.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestOverlapList.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestOverlapList.cc,v 1.3 2006/06/29 18:36:39 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4GeomTestOvershootList.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestOvershootList.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestOvershootList.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestOvershootList.cc,v 1.3 2006/06/29 18:36:41 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4GeomTestPoint.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestPoint.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestPoint.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestPoint.cc,v 1.3 2006/06/29 18:36:44 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4GeomTestSegment.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestSegment.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestSegment.cc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4GeomTestSegment.cc,v 1.11 2007/11/16 09:39:14 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4GeomTestSegment.cc,v 1.13 2010/08/20 09:03:54 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
@@ -275,6 +275,5 @@
   G4bool entering;
   G4double vSurfN;
-  // G4cout<<"Entering Find Some Points vSearch="<<vSearch<<" p="<<p<<G4endl;
-  //
+ 
   // Look for nearest intersection point in the specified
   // direction and return if there isn't one
@@ -283,6 +282,5 @@
   switch(solid->Inside(p)) {
     case kInside:
-       dist = solid->DistanceToOut(p,vSearch);
-       // G4cout<<"Inside DistToOut="<<dist<<G4endl;
+      dist = solid->DistanceToOut(p,vSearch);
       if (dist >= kInfinity) {
         logger->SolidProblem( solid,
@@ -290,5 +288,4 @@
         return;
       }
-      
       s += sign*dist;
       entering = false;
@@ -296,15 +293,12 @@
     case kOutside:
       dist = solid->DistanceToIn(p,vSearch);
-      //G4cout<<"Outside DistToIn="<<dist<<G4endl;
       if (dist >= kInfinity) return;
-      
       s += sign*dist;
       entering = true;
       break;
     case kSurface:
-      vSurfN=vSearch.dot(solid->SurfaceNormal(p));
-      if(std::abs(vSurfN)<kCarTolerance)vSurfN=0;
+      vSurfN=v.dot(solid->SurfaceNormal(p));
+      if(std::fabs(vSurfN)<kCarTolerance)vSurfN=0;
       entering = (vSurfN < 0);
-      //G4cout<<"Surface SurfN="<<solid->SurfaceNormal(p)<<" v.dotN="<<vSurfN<<" entering="<<entering<<G4endl;
       break;
     default:
@@ -361,5 +355,5 @@
       //
       points.push_back( G4GeomTestPoint( p, s, entering==forward ) );
-      //G4cout<<"Add point p"<<p<<" s="<<s<<" entering="<<entering<<G4endl;
+      
     }
     
@@ -369,5 +363,4 @@
     if (entering) {
       dist = solid->DistanceToOut(p,vSearch);
-      //G4cout<<"if entering distToOut="<<dist<<G4endl;
       if (dist >= kInfinity) {
         logger->SolidProblem( solid,
@@ -389,22 +382,9 @@
         return;
       }
-
-       if(std::abs(dist)<=kCarTolerance){
-          G4double push = 1E-6;
-          s += sign*push;
-          p = p0 + s*v;
-          EInside inside = solid->Inside(p); 
-          if (inside == kOutside) {
-          entering = false;
-          break;
-        }
-      }
-
-      
+            
       entering = false;
     }
     else {
       dist = solid->DistanceToIn(p,vSearch);
-      //G4cout<<"if exiting distToIn="<<dist<<G4endl;
       if (dist >= kInfinity) return;
       
Index: trunk/source/geometry/navigation/src/G4GeomTestStreamLogger.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestStreamLogger.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestStreamLogger.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestStreamLogger.cc,v 1.3 2006/06/29 18:36:49 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4GeomTestVolPoint.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestVolPoint.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestVolPoint.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestVolPoint.cc,v 1.3 2006/06/29 18:36:52 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4GeomTestVolume.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeomTestVolume.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeomTestVolume.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeomTestVolume.cc,v 1.6 2007/11/16 09:39:14 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
Index: trunk/source/geometry/navigation/src/G4GeometryMessenger.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4GeometryMessenger.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4GeometryMessenger.cc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4GeometryMessenger.cc,v 1.5 2006/06/29 18:36:57 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4GeometryMessenger.cc,v 1.6 2010/11/10 14:06:40 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // --------------------------------------------------------------------
@@ -106,4 +106,16 @@
   chkCmd->AvailableForStates(G4State_Idle);
 
+  pchkCmd = new G4UIcmdWithABool( "/geometry/navigator/push_notify", this );
+  pchkCmd->SetGuidance( "Set navigator verbosity push notifications." );
+  pchkCmd->SetGuidance( "This allows to disable/re-enable verbosity in" );
+  pchkCmd->SetGuidance( "navigation, when tracks may get stuck and require" );
+  pchkCmd->SetGuidance( "one artificial push along the direction by the" );
+  pchkCmd->SetGuidance( "navigator. Notification is active by default." );
+  pchkCmd->SetGuidance( "NOTE: this command has effect -only- if Geant4 has" );
+  pchkCmd->SetGuidance( "      been installed with the G4VERBOSE flag set!" );
+  pchkCmd->SetParameterName("pushFlag",true);
+  pchkCmd->SetDefaultValue(true);
+  pchkCmd->AvailableForStates(G4State_Idle);
+
   //
   // Geometry verification test commands
@@ -244,5 +256,5 @@
   delete cyzCmd; delete cfzCmd; delete cfrCmd; delete cylCmd;
   delete tolCmd;
-  delete resCmd; delete verbCmd; delete chkCmd;
+  delete resCmd; delete verbCmd; delete pchkCmd; delete chkCmd;
   delete geodir; delete navdir; delete testdir;
   delete tvolume; delete tlogger;
@@ -423,4 +435,15 @@
   G4Navigator* navigator = tmanager->GetNavigatorForTracking();
   navigator->CheckMode(mode);
+}
+
+//
+// Set navigator verbosity for push notifications
+//
+void
+G4GeometryMessenger::SetPushFlag(G4String input)
+{
+  G4bool mode = pchkCmd->GetNewBoolValue(input);
+  G4Navigator* navigator = tmanager->GetNavigatorForTracking();
+  navigator->SetPushVerbosity(mode);
 }
 
Index: trunk/source/geometry/navigation/src/G4MultiLevelLocator.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4MultiLevelLocator.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4MultiLevelLocator.cc	(revision 1347)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4MultiLevelLocator.cc,v 1.5 2008/12/11 10:01:02 tnikitin Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4MultiLevelLocator.cc,v 1.6 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // Class G4MultiLevelLocator implementation
@@ -120,5 +120,7 @@
 
   G4int substep_no = 0;
-   
+
+  G4int oldprc;   // cout/cerr precision settings
+
   // Limits for substep number
   //
@@ -156,7 +158,7 @@
 
 #ifdef G4DEBUG_FIELD
-  static G4double tolerance= 1.0e-8; 
+  static const G4double tolerance = 1.0e-8 * mm; 
   G4ThreeVector  StartPosition= CurveStartPointVelocity.GetPosition(); 
-  if( (TrialPoint - StartPosition).mag() < tolerance * mm ) 
+  if( (TrialPoint - StartPosition).mag() < tolerance) 
   {
      G4cerr << "WARNING - G4MultiLevelLocator::EstimateIntersectionPoint()"
@@ -455,5 +457,5 @@
                    << GetEpsilonStepFor() << G4endl;
           }
-          G4cerr.precision(20);
+          oldprc = G4cerr.precision(20);
           G4cerr << " Point A (Curve start)   is " << CurveStartPointVelocity
                  << G4endl;
@@ -474,4 +476,5 @@
           G4cerr << "        Substep depth no= "<< substep_no_p  << " Depth= "
                  << depth << G4endl;
+          G4cerr.precision(oldprc);
 
           G4Exception("G4MultiLevelLocator::EstimateIntersectionPoint()",
@@ -691,5 +694,5 @@
 #endif
 
-    G4cout.precision( 10 ); 
+    oldprc = G4cout.precision( 10 ); 
     G4double done_len = CurrentA_PointVelocity.GetCurveLength(); 
     G4double full_len = CurveEndPointVelocity.GetCurveLength();
@@ -699,4 +702,5 @@
            << " out of " << full_len << " required." << G4endl;
     G4cout << "        Remaining length = " << full_len - done_len << G4endl; 
+    G4cout.precision( oldprc ); 
 
     G4Exception("G4MultiLevelLocator::EstimateIntersectionPoint()",
@@ -706,5 +710,5 @@
   else if( substep_no >= warn_substeps )
   {  
-    G4int oldprc= G4cout.precision( 10 ); 
+    oldprc = G4cout.precision( 10 ); 
     G4cout << "WARNING - G4MultiLevelLocator::EstimateIntersectionPoint()"
            << G4endl
Index: trunk/source/geometry/navigation/src/G4MultiNavigator.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4MultiNavigator.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4MultiNavigator.cc	(revision 1347)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4MultiNavigator.cc,v 1.8 2008/10/24 14:00:03 gcosmo Exp $
+// $Id: G4MultiNavigator.cc,v 1.11 2010/09/06 09:49:15 gcosmo Exp $
 // GEANT4 tag $ Name:  $
 // 
@@ -48,8 +48,8 @@
 //
 G4MultiNavigator::G4MultiNavigator() 
-  : G4Navigator()
+  : G4Navigator(), fLastMassWorld(0)
 {
   fNoActiveNavigators= 0; 
-  G4ThreeVector Big3Vector( DBL_MAX, DBL_MAX, DBL_MAX ); 
+  G4ThreeVector Big3Vector( kInfinity, kInfinity, kInfinity ); 
   fLastLocatedPosition = Big3Vector;
   fSafetyLocation  = Big3Vector;
@@ -58,13 +58,13 @@
   fMinSafety_PreStepPt=  -1.0; 
   fMinSafety_atSafLocation= -1.0; 
-  fMinSafety= -DBL_MAX;  
-  fMinStep=   -DBL_MAX;  
-
-  for(register int num=0; num<= fMaxNav; ++num )
+  fMinSafety= -kInfinity;  
+  fTrueMinStep= fMinStep= -kInfinity;  
+
+  for(register int num=0; num< fMaxNav; ++num )
   {
     fpNavigator[num] =  0;   
     fLimitTruth[num] = false;
     fLimitedStep[num] = kUndefLimited;
-    fCurrentStepSize[num] = -1.0; 
+    fCurrentStepSize[num] = fNewSafety[num] = -1.0; 
     fLocatedVolume[num] = 0; 
   }
@@ -94,5 +94,5 @@
 {
   G4double safety= 0.0, step=0.0;
-  G4double minSafety= DBL_MAX, minStep= DBL_MAX;
+  G4double minSafety= kInfinity, minStep= kInfinity;
 
 #ifdef G4DEBUG_NAVIGATION
@@ -115,5 +115,5 @@
   for( register int num=0; num< fNoActiveNavigators; ++pNavigatorIter,++num )
   {
-     safety= DBL_MAX;
+     safety= kInfinity;
 
      step= (*pNavigatorIter)->ComputeStep( initialPosition, 
@@ -189,11 +189,5 @@
                                    ELimited &limitedStep) 
 {
-  G4int navigatorNo=-1; 
-
-  if( navigatorId <= fNoActiveNavigators )
-  {
-     navigatorNo= navigatorId;
-  }
-  else
+  if( navigatorId > fNoActiveNavigators )
   { 
      G4cerr << "ERROR - G4MultiNavigator::ObtainFinalStep()"
@@ -206,18 +200,21 @@
 
   // Prepare the information to return
-  pNewSafety  = fNewSafety[ navigatorNo ]; 
-  limitedStep = fLimitedStep[ navigatorNo ];
+  //
+  pNewSafety  = fNewSafety[ navigatorId ]; 
+  limitedStep = fLimitedStep[ navigatorId ];
   minStep= fMinStep; 
 
-  // if( (minStep==kInfinity) || (fVerbose > 1) ){ 
-#ifdef G4DEBUG_NAVIGATION
-  if( fVerbose > 1 ){ 
-     G4cout << " G4MultiNavigator::ComputeStep returns " << fCurrentStepSize[ navigatorNo ]
-            << " for Navigator " << navigatorNo << " Limited step = " << limitedStep 
+#ifdef G4DEBUG_NAVIGATION
+  if( fVerbose > 1 )
+  { 
+     G4cout << " G4MultiNavigator::ComputeStep returns "
+            << fCurrentStepSize[ navigatorId ]
+            << " for Navigator " << navigatorId
+            << " Limited step = " << limitedStep 
             << " Safety(mm) = " << pNewSafety / mm << G4endl; 
   }
 #endif
 
-  return fCurrentStepSize[ navigatorNo ];
+  return fCurrentStepSize[ navigatorId ];
 }
 
@@ -428,5 +425,5 @@
     // Recompute safety for the relevant point
 
-    G4double minSafety = DBL_MAX, safety = DBL_MAX;
+    G4double minSafety = kInfinity, safety = kInfinity;
   
     std::vector<G4Navigator*>::iterator pNavigatorIter;
Index: trunk/source/geometry/navigation/src/G4Navigator.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4Navigator.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4Navigator.cc	(revision 1347)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4Navigator.cc,v 1.39 2009/05/08 06:47:32 tnikitin Exp $
+// $Id: G4Navigator.cc,v 1.46 2010/11/15 14:03:27 gcosmo Exp $
 // GEANT4 tag $ Name:  $
 // 
@@ -47,5 +47,5 @@
 G4Navigator::G4Navigator()
   : fWasLimitedByGeometry(false), fVerbose(0),
-    fTopPhysical(0), fCheck(false), fPushed(false)
+    fTopPhysical(0), fCheck(false), fPushed(false), fWarnPush(true)
 {
   fActive= false; 
@@ -128,7 +128,7 @@
 
 #ifdef G4VERBOSE
-  G4int oldcoutPrec = G4cout.precision(8);
   if( fVerbose > 2 )
   {
+    G4int oldcoutPrec = G4cout.precision(8);
     G4cout << "*** G4Navigator::LocateGlobalPointAndSetup: ***" << G4endl; 
     G4cout << "    Called with arguments: " << G4endl
@@ -140,4 +140,5 @@
       PrintState();
     }
+    G4cout.precision(oldcoutPrec);
   }
 #endif
@@ -195,5 +196,5 @@
               break;
             case kParameterised:
-              if( fBlockedPhysicalVolume->GetRegularStructureId() != 1 )
+              if( fBlockedPhysicalVolume->GetRegularStructureId() == 0 )
               {
                 G4VSolid *pSolid;
@@ -360,4 +361,5 @@
     //
     targetPhysical = fHistory.GetTopVolume();
+    if (!targetPhysical) { break; }
     targetLogical = targetPhysical->GetLogicalVolume();
     switch( CharacteriseDaughters(targetLogical) )
@@ -452,10 +454,7 @@
   if( fVerbose == 4 )
   {
-    G4cout.precision(6);
+    G4int oldcoutPrec = G4cout.precision(8);
     G4String curPhysVol_Name("None");
-    if (targetPhysical!=0)
-    {
-      curPhysVol_Name = targetPhysical->GetName();
-    }
+    if (targetPhysical)  { curPhysVol_Name = targetPhysical->GetName(); }
     G4cout << "    Return value = new volume = " << curPhysVol_Name << G4endl;
     G4cout << "    ----- Upon exiting:" << G4endl;
@@ -465,6 +464,6 @@
     G4cout << "    History = " << G4endl << fHistory << G4endl << G4endl;
 #endif
-  }
-  G4cout.precision(oldcoutPrec);
+    G4cout.precision(oldcoutPrec);
+  }
 #endif
 
@@ -627,5 +626,5 @@
 {
   G4ThreeVector localDirection = ComputeLocalAxis(pDirection);
-  G4double Step = DBL_MAX;
+  G4double Step = kInfinity;
   G4VPhysicalVolume  *motherPhysical = fHistory.GetTopVolume();
   G4LogicalVolume *motherLogical = motherPhysical->GetLogicalVolume();
@@ -635,6 +634,4 @@
 
 #ifdef G4VERBOSE
-  G4int oldcoutPrec= G4cout.precision(8);
-  G4int oldcerrPrec= G4cerr.precision(10);
   if( fVerbose > 0 )
   {
@@ -654,7 +651,4 @@
 #endif
   }
-
-  static G4double fAccuracyForWarning   = kCarTolerance,
-                  fAccuracyForException = 1000*kCarTolerance;
 #endif
 
@@ -670,91 +664,6 @@
     {
 #ifdef G4VERBOSE
-      //  The following checks only make sense if the move is larger
-      //  than the tolerance.
-      // 
-      G4ThreeVector OriginalGlobalpoint =
-                    fHistory.GetTopTransform().Inverse().
-                    TransformPoint(fLastLocatedPointLocal); 
-
-      G4double shiftOriginSafSq = (fPreviousSftOrigin-pGlobalpoint).mag2();
-
-      // Check that the starting point of this step is 
-      // within the isotropic safety sphere of the last point
-      // to a accuracy/precision  given by fAccuracyForWarning.
-      //   If so give warning.
-      //   If it fails by more than fAccuracyForException exit with error.
-      //
-      if( shiftOriginSafSq >= sqr(fPreviousSafety) )
-      {
-        G4double shiftOrigin = std::sqrt(shiftOriginSafSq);
-        G4double diffShiftSaf = shiftOrigin - fPreviousSafety;
-
-        if( diffShiftSaf > fAccuracyForWarning )
-        {
-          G4Exception("G4Navigator::ComputeStep()",
-                      "UnexpectedPositionShift", JustWarning,
-                      "Accuracy ERROR or slightly inaccurate position shift.");
-          G4cerr << "     The Step's starting point has moved " 
-                 << std::sqrt(moveLenSq)/mm << " mm " << G4endl
-                 << "     since the last call to a Locate method." << G4endl;
-          G4cerr << "     This has resulted in moving " 
-                 << shiftOrigin/mm << " mm " 
-                 << " from the last point at which the safety " 
-                 << "     was calculated " << G4endl;
-          G4cerr << "     which is more than the computed safety= " 
-                 << fPreviousSafety/mm << " mm  at that point." << G4endl;
-          G4cerr << "     This difference is " 
-                 << diffShiftSaf/mm << " mm." << G4endl
-                 << "     The tolerated accuracy is "
-                 << fAccuracyForException/mm << " mm." << G4endl;
-
-          static G4int warnNow = 0;
-          if( ((++warnNow % 100) == 1) )
-          {
-            G4cerr << "  This problem can be due to either " << G4endl;
-            G4cerr << "    - a process that has proposed a displacement"
-                   << " larger than the current safety , or" << G4endl;
-            G4cerr << "    - inaccuracy in the computation of the safety"
-                   << G4endl;
-            G4cerr << "  We suggest that you " << G4endl
-                   << "   - find i) what particle is being tracked, and "
-                   << " ii) through what part of your geometry " << G4endl
-                   << "      for example by re-running this event with "
-                   << G4endl
-                   << "         /tracking/verbose 1 "  << G4endl
-                   << "    - check which processes you declare for"
-                   << " this particle (and look at non-standard ones)"
-                   << G4endl
-                   << "   - in case, create a detailed logfile"
-                   << " of this event using:" << G4endl
-                   << "         /tracking/verbose 6 "
-                   << G4endl;
-          }
-        }
-#ifdef G4DEBUG_NAVIGATION
-        else
-        {
-          G4cerr << "WARNING - G4Navigator::ComputeStep()" << G4endl
-                 << "          The Step's starting point has moved "
-                 << std::sqrt(moveLenSq) << "," << G4endl
-                 << "          which has taken it to the limit of"
-                 << " the current safety. " << G4endl;
-        }
-#endif
-      }
-      G4double safetyPlus = fPreviousSafety + fAccuracyForException;
-      if ( shiftOriginSafSq > sqr(safetyPlus) )
-      {
-        G4cerr << "ERROR - G4Navigator::ComputeStep()" << G4endl
-               << "        Position has shifted considerably without"
-               << " notifying the navigator !" << G4endl
-               << "        Tolerated safety: " << safetyPlus << G4endl
-               << "        Computed shift  : " << shiftOriginSafSq << G4endl;
-        G4Exception("G4Navigator::ComputeStep()",
-                    "SignificantPositionShift", JustWarning,
-                    "May lead to a crash or unreliable results.");
-      }
-#endif  // end G4VERBOSE
-
+      ComputeStepLog(pGlobalpoint, moveLenSq);
+#endif
       // Relocate the point within the same volume
       //
@@ -784,5 +693,5 @@
         else
         {
-          if( motherPhysical->GetRegularStructureId() != 1 )
+          if( motherPhysical->GetRegularStructureId() == 0 )
           {
             Step = fnormalNav.ComputeStep(fLastLocatedPointLocal,
@@ -811,5 +720,5 @@
             // reset the history topvolume to world.
             //
-            if(fHistory.GetTopVolume()->GetRegularStructureId() != 1 )
+            if(fHistory.GetTopVolume()->GetRegularStructureId() == 0 )
             { 
               G4Exception("G4Navigator::ComputeStep()",
@@ -944,7 +853,7 @@
        // Act to recover this stuck track. Pushing it along direction
        //
-       Step += 0.9*kCarTolerance;
+       Step += 100*kCarTolerance;
 #ifdef G4VERBOSE
-       if (!fPushed)
+       if ((!fPushed) && (fWarnPush))
        {
          G4cerr << "WARNING - G4Navigator::ComputeStep()" << G4endl
@@ -1048,6 +957,4 @@
     G4cout << "    Safety = " << pNewSafety << G4endl;
   }
-  G4cout.precision(oldcoutPrec);
-  G4cerr.precision(oldcerrPrec);
 #endif
 
@@ -1112,5 +1019,5 @@
   fBlockedReplicaNo      = -1;
 
-  fLastLocatedPointLocal = G4ThreeVector( DBL_MAX, -DBL_MAX, 0.0 ); 
+  fLastLocatedPointLocal = G4ThreeVector( kInfinity, -kInfinity, 0.0 ); 
   fLocatedOutsideWorld   = false;
 }
@@ -1132,5 +1039,4 @@
   G4VPVParameterisation *pParam;
 
-  mother = fHistory.GetVolume(0);
   for ( i=1; i<=cdepth; i++ )
   {
@@ -1408,4 +1314,104 @@
 
 // ********************************************************************
+// ComputeStepLog
+// ********************************************************************
+//
+void G4Navigator::ComputeStepLog(const G4ThreeVector& pGlobalpoint,
+                                       G4double moveLenSq) const
+{
+  //  The following checks only make sense if the move is larger
+  //  than the tolerance.
+
+  static const G4double fAccuracyForWarning   = kCarTolerance,
+                        fAccuracyForException = 1000*kCarTolerance;
+
+  G4ThreeVector OriginalGlobalpoint = fHistory.GetTopTransform().Inverse().
+                                      TransformPoint(fLastLocatedPointLocal); 
+
+  G4double shiftOriginSafSq = (fPreviousSftOrigin-pGlobalpoint).mag2();
+
+  // Check that the starting point of this step is 
+  // within the isotropic safety sphere of the last point
+  // to a accuracy/precision  given by fAccuracyForWarning.
+  //   If so give warning.
+  //   If it fails by more than fAccuracyForException exit with error.
+  //
+  if( shiftOriginSafSq >= sqr(fPreviousSafety) )
+  {
+    G4double shiftOrigin = std::sqrt(shiftOriginSafSq);
+    G4double diffShiftSaf = shiftOrigin - fPreviousSafety;
+
+    if( diffShiftSaf > fAccuracyForWarning )
+    {
+      G4int oldcoutPrec= G4cout.precision(8);
+      G4int oldcerrPrec= G4cerr.precision(10);
+      G4Exception("G4Navigator::ComputeStep()",
+                  "UnexpectedPositionShift", JustWarning,
+                  "Accuracy error or slightly inaccurate position shift.");
+      G4cerr << "     The Step's starting point has moved " 
+             << std::sqrt(moveLenSq)/mm << " mm " << G4endl
+             << "     since the last call to a Locate method." << G4endl;
+      G4cerr << "     This has resulted in moving " 
+             << shiftOrigin/mm << " mm " 
+             << " from the last point at which the safety " 
+             << "     was calculated " << G4endl;
+      G4cerr << "     which is more than the computed safety= " 
+             << fPreviousSafety/mm << " mm  at that point." << G4endl;
+      G4cerr << "     This difference is " 
+             << diffShiftSaf/mm << " mm." << G4endl
+             << "     The tolerated accuracy is "
+             << fAccuracyForException/mm << " mm." << G4endl;
+
+      static G4int warnNow = 0;
+      if( ((++warnNow % 100) == 1) )
+      {
+        G4cerr << "  This problem can be due to either " << G4endl;
+        G4cerr << "    - a process that has proposed a displacement"
+               << " larger than the current safety , or" << G4endl;
+        G4cerr << "    - inaccuracy in the computation of the safety"
+                   << G4endl;
+        G4cerr << "  We suggest that you " << G4endl
+               << "   - find i) what particle is being tracked, and "
+               << " ii) through what part of your geometry " << G4endl
+               << "      for example by re-running this event with "
+               << G4endl
+               << "         /tracking/verbose 1 "  << G4endl
+               << "    - check which processes you declare for"
+               << " this particle (and look at non-standard ones)"
+               << G4endl
+               << "   - in case, create a detailed logfile"
+               << " of this event using:" << G4endl
+               << "         /tracking/verbose 6 "
+               << G4endl;
+      }
+      G4cout.precision(oldcoutPrec);
+      G4cerr.precision(oldcerrPrec);
+    }
+#ifdef G4DEBUG_NAVIGATION
+    else
+    {
+      G4cerr << "WARNING - G4Navigator::ComputeStep()" << G4endl
+             << "          The Step's starting point has moved "
+             << std::sqrt(moveLenSq) << "," << G4endl
+             << "          which has taken it to the limit of"
+             << " the current safety. " << G4endl;
+    }
+#endif
+  }
+  G4double safetyPlus = fPreviousSafety + fAccuracyForException;
+  if ( shiftOriginSafSq > sqr(safetyPlus) )
+  {
+    G4cerr << "ERROR - G4Navigator::ComputeStep()" << G4endl
+           << "        Position has shifted considerably without"
+           << " notifying the navigator !" << G4endl
+           << "        Tolerated safety: " << safetyPlus << G4endl
+           << "        Computed shift  : " << shiftOriginSafSq << G4endl;
+    G4Exception("G4Navigator::ComputeStep()",
+                "SignificantPositionShift", JustWarning,
+                "May lead to a crash or unreliable results.");
+  }
+}
+
+// ********************************************************************
 // Operator <<
 // ********************************************************************
Index: trunk/source/geometry/navigation/src/G4NormalNavigation.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4NormalNavigation.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4NormalNavigation.cc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4NormalNavigation.cc,v 1.9 2007/05/11 13:43:59 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NormalNavigation.cc,v 1.11 2010/11/04 08:57:56 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -38,6 +38,4 @@
 #include "G4AffineTransform.hh"
 
-#include <iomanip>
-
 // ********************************************************************
 // Constructor
@@ -45,6 +43,7 @@
 //
 G4NormalNavigation::G4NormalNavigation()
-  : fCheck(false), fVerbose(0)
-{
+  : fCheck(false)
+{
+  fLogger = new G4NavigationLogger("G4NormalNavigation");
 }
 
@@ -54,5 +53,7 @@
 //
 G4NormalNavigation::~G4NormalNavigation()
-{;}
+{
+  delete fLogger;
+}
 
 // ********************************************************************
@@ -90,70 +91,7 @@
   
 #ifdef G4VERBOSE
-  static G4int precVerf= 20;  // Precision 
   if ( fCheck )
   {
-    if( fVerbose == 1 )
-    {
-      G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
-             << "    Invoked DistanceToOut(p) for mother solid: "
-             << motherSolid->GetName()
-             << ". Solid replied: " << motherSafety << G4endl
-             << "    For local point p: " << localPoint << G4endl
-             << "    To be considered as 'mother safety'." << G4endl;
-    }
-    if ( motherSafety < 0.0 )
-    {
-      G4cerr << "ERROR - G4NormalNavigation::ComputeStep()" << G4endl
-             << "        Current solid " << motherSolid->GetName()
-             << " gave negative safety: " << motherSafety << G4endl
-             << "        for the current (local) point " << localPoint
-             << G4endl;
-      motherSolid->DumpInfo();
-      G4Exception("G4NormalNavigation::ComputeStep()",
-                  "NegativeSafetyMotherVol", FatalException,
-                  "Negative Safety In Voxel Navigation !" );
-    }
-    if( motherSolid->Inside(localPoint)==kOutside )
-    {
-      G4cout << "WARNING - G4NormalNavigation::ComputeStep()" << G4endl
-             << "          Point " << localPoint
-             << " is outside current volume " << motherPhysical->GetName()
-             << G4endl;
-      G4double estDistToSolid= motherSolid->DistanceToIn(localPoint); 
-      G4cout << "          Estimated isotropic distance to solid (distToIn)= " 
-             << estDistToSolid << G4endl;
-      if( estDistToSolid > 100.0 * motherSolid->GetTolerance() )
-      {
-        motherSolid->DumpInfo();
-        G4Exception("G4NormalNavigation::ComputeStep()",
-                    "FarOutsideCurrentVolume", FatalException,
-                    "Point is far outside Current Volume !" ); 
-      }
-      else
-        G4Exception("G4NormalNavigation::ComputeStep()", "OutsideCurrentVolume", 
-                    JustWarning, "Point is a little outside Current Volume."); 
-    }
-
-    // Verification / verbosity
-    //
-    if ( fVerbose > 1 )
-    {
-      G4int oldprec = G4cout.precision(precVerf);
-      G4cout << " G4NormalNavigation::ComputeStep()"
-             << " - Information on mother / key daughters ..." << G4endl;
-      G4cout << " Type   " << std::setw(12) << "Solid-Name"   << " " 
-             << std::setw(3*(6+precVerf))   << " local point" << " "
-             << std::setw(4+precVerf)       << "solid-Safety" << " "
-             << std::setw(4+precVerf)       << "solid-Step"   << " "
-             << std::setw(17)               << "distance Method "
-             << std::setw(3*(6+precVerf))   << " local direction" << " "
-             << G4endl;
-      G4cout << " Mother " << std::setw(12) << motherSolid->GetName() << " "
-             << std::setw(4+precVerf)       << localPoint   << " "
-             << std::setw(4+precVerf)       << motherSafety << " "
-             << G4endl;
-      G4cout.precision(oldprec);
-    }
-
+    fLogger->PreComputeStepLog(motherPhysical, motherSafety, localPoint);
   }
 #endif
@@ -193,4 +131,10 @@
       const G4double sampleSafety =
               sampleSolid->DistanceToIn(samplePoint);
+#ifdef G4VERBOSE
+      if( fCheck )
+      {
+        fLogger->PrintDaughterLog(sampleSolid, samplePoint, sampleSafety, 0);
+      }
+#endif
       if ( sampleSafety<ourSafety )
       {
@@ -202,14 +146,10 @@
         const G4double sampleStep =
                 sampleSolid->DistanceToIn(samplePoint,sampleDirection);
-#ifdef G4VERBOSE
-        if(( fCheck ) && ( fVerbose == 1 ))
+
+#ifdef G4VERBOSE
+        if( fCheck )
         {
-          G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
-                 << "    Invoked DistanceToIn(p,v) for daughter solid: "
-                 << sampleSolid->GetName()
-                 << ". Solid replied: " << sampleStep << G4endl
-                 << "    For local point p: " << samplePoint << G4endl
-                 << "    Direction v: " << sampleDirection
-                 << ", to be considered as 'daughter step'." << G4endl;
+          fLogger->PrintDaughterLog(sampleSolid, samplePoint,
+                                    sampleSafety, sampleStep);
         }
 #endif
@@ -221,67 +161,9 @@
           *pBlockedPhysical = samplePhysical;
           blockedReplicaNo  = -1;
-
-#ifdef G4VERBOSE
-          // Check to see that the resulting point is indeed in/on volume.
-          // This check could eventually be made only for successful candidate.
-
-          if ( ( fCheck ) && ( sampleStep < kInfinity ) )
+#ifdef G4VERBOSE
+          if( fCheck )
           {
-            G4ThreeVector intersectionPoint;
-            intersectionPoint= samplePoint + sampleStep * sampleDirection;
-            EInside insideIntPt= sampleSolid->Inside(intersectionPoint); 
-            G4String solidResponse = "-kInside-";
-            if (insideIntPt == kOutside)
-              solidResponse = "-kOutside-";
-            else if (insideIntPt == kSurface)
-              solidResponse = "-kSurface-";
-            if( fVerbose == 1 )
-            {
-              G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
-                     << "    Invoked Inside() for solid: "
-                     << sampleSolid->GetName()
-                     << ". Solid replied: " << solidResponse << G4endl
-                     << "    For point p: " << intersectionPoint
-                     << ", considered as 'intersection' point." << G4endl;
-            }
-            if ( insideIntPt != kSurface )
-            {
-              G4int oldcoutPrec = G4cout.precision(16); 
-              G4cout << "WARNING - G4NormalNavigation::ComputeStep()" << G4endl
-                     << "          Inaccurate DistanceToIn for solid "
-                     << sampleSolid->GetName() << G4endl;
-              G4cout << "          Solid gave DistanceToIn = " << sampleStep
-                     << " yet returns " << solidResponse
-                     << " for this point !" << G4endl; 
-              G4cout << "          Point = " << intersectionPoint << G4endl;
-              if ( insideIntPt != kInside )
-                G4cout << "        DistanceToIn(p) = " 
-                       << sampleSolid->DistanceToIn(intersectionPoint)
-                       << G4endl;
-              if ( insideIntPt != kOutside ) 
-                G4cout << "        DistanceToOut(p) = " 
-                       << sampleSolid->DistanceToOut(intersectionPoint)
-                       << G4endl;
-              G4Exception("G4NormalNavigation::ComputeStep()", 
-                          "InaccurateDistanceToIn", JustWarning,
-                          "Navigator gets conflicting response from Solid."); 
-              G4cout.precision(oldcoutPrec);
-            }
-          }
-
-          // Verification / verbosity
-          //
-          if ( fVerbose > 1 )
-          {
-            G4int oldprec = G4cout.precision(precVerf);
-            G4cout << " Daught "
-                   << std::setw(12)         << sampleSolid->GetName() << " "
-                   << std::setw(4+precVerf) << samplePoint  << " "
-                   << std::setw(4+precVerf) << sampleSafety << " "
-                   << std::setw(4+precVerf) << sampleStep   << " "
-                   << std::setw(16)         << "distanceToIn" << " "
-                   << std::setw(4+precVerf) << localDirection << " "
-                   << G4endl;
-            G4cout.precision(oldprec);
+            fLogger->AlongComputeStepLog(sampleSolid, samplePoint,
+              sampleDirection, localDirection, sampleSafety, sampleStep);
           }
 #endif
@@ -313,39 +195,6 @@
       if ( fCheck )
       {
-        if( fVerbose == 1 )
-        {
-          G4cout << "*** G4NormalNavigation::ComputeStep(): ***" << G4endl
-                 << "    Invoked DistanceToOut(p,v,...) for mother solid: "
-                 << motherSolid->GetName()
-                 << ". Solid replied: " << motherStep << G4endl
-                 << "    For local point p: " << localPoint << G4endl
-                 << "    Direction v: " << localDirection
-                 << ", to be considered as 'mother step'." << G4endl;
-        }
-        if( ( motherStep < 0.0 ) || ( motherStep >= kInfinity) )
-        {
-          G4cerr << "ERROR - G4NormalNavigation::ComputeStep()" << G4endl
-                 << "        Problem in Navigation"  << G4endl
-                 << "        Point (local coordinates): "
-                 << localPoint << G4endl
-                 << "        Local Direction: " << localDirection << G4endl
-                 << "        Solid: " << motherSolid->GetName() << G4endl; 
-          motherSolid->DumpInfo();
-          G4Exception("G4NormalNavigation::ComputeStep()",
-                      "PointDistOutInvalid", FatalException,
-                      "Current point is outside the current solid !");
-        }
-      }
-      if ( fVerbose > 1 )
-      {
-        G4int oldprec = G4cout.precision(precVerf);
-        G4cout << " Mother " << std::setw(12) << motherSolid->GetName() << " "
-               << std::setw(4+precVerf)       << localPoint   << " "
-               << std::setw(4+precVerf)       << motherSafety << " "
-               << std::setw(4+precVerf)       << motherStep   << " "
-               << std::setw(16)               << "distanceToOut" << " "
-               << std::setw(4+precVerf)       << localDirection << " "
-               << G4endl;
-        G4cout.precision(oldprec);      
+        fLogger->PostComputeStepLog(motherSolid, localPoint, localDirection,
+                                    motherStep, motherSafety);
       }
 #endif
@@ -399,12 +248,7 @@
 
 #ifdef G4VERBOSE
-  if(( fCheck ) && ( fVerbose == 1 ))
-  {
-    G4cout << "*** G4NormalNavigation::ComputeSafety(): ***" << G4endl
-           << "    Invoked DistanceToOut(p) for mother solid: "
-           << motherSolid->GetName()
-           << ". Solid replied: " << motherSafety << G4endl
-           << "    For local point p: " << localPoint
-           << ", to be considered as 'mother safety'." << G4endl;
+  if( fCheck )
+  {
+    fLogger->ComputeSafetyLog(motherSolid, localPoint, motherSafety, true);
   }
 #endif
@@ -430,12 +274,7 @@
     }
 #ifdef G4VERBOSE
-    if(( fCheck ) && ( fVerbose == 1 ))
-    {
-      G4cout << "*** G4NormalNavigation::ComputeSafety(): ***" << G4endl
-             << "    Invoked DistanceToIn(p) for daughter solid: "
-             << sampleSolid->GetName()
-             << ". Solid replied: " << sampleSafety << G4endl
-             << "    For local point p: " << samplePoint
-             << ", to be considered as 'daughter safety'." << G4endl;
+    if(fCheck)
+    {
+      fLogger->ComputeSafetyLog(sampleSolid, samplePoint, sampleSafety, false);
     }
 #endif
Index: trunk/source/geometry/navigation/src/G4ParameterisedNavigation.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4ParameterisedNavigation.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4ParameterisedNavigation.cc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4ParameterisedNavigation.cc,v 1.12 2007/11/09 16:06:02 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4ParameterisedNavigation.cc,v 1.13 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -58,5 +58,6 @@
 //
 G4ParameterisedNavigation::G4ParameterisedNavigation()
-  : fVoxelHeader(0)
+  : fVoxelAxis(kUndefined), fVoxelNoSlices(0), fVoxelSliceWidth(0.),
+    fVoxelNodeNo(0), fVoxelHeader(0)
 {
 }
Index: trunk/source/geometry/navigation/src/G4PathFinder.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4PathFinder.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4PathFinder.cc	(revision 1347)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4PathFinder.cc,v 1.62 2009/05/13 23:20:54 japost Exp $
+// $Id: G4PathFinder.cc,v 1.64 2010/07/13 15:59:42 gcosmo Exp $
 // GEANT4 tag $ Name:  $
 // 
@@ -69,6 +69,7 @@
 G4PathFinder::G4PathFinder() 
   : fEndState( G4ThreeVector(), G4ThreeVector(), 0., 0., 0., 0., 0.),
+    fFieldExertedForce(false),
     fRelocatedPoint(true),
-    fLastStepNo(-1), 
+    fLastStepNo(-1), fCurrentStepNo(-1),
     fVerboseLevel(0)
 {
@@ -91,8 +92,10 @@
    fMinSafety_atSafLocation= -1.0; 
    fMinStep=   -1.0;
+   fTrueMinStep= -1.0;
+   fPreStepCenterRenewed= false;
    fNewTrack= false; 
    fNoGeometriesLimiting= 0; 
 
-   for( register int num=0; num<= fMaxNav; ++num )
+   for( register int num=0; num< fMaxNav; ++num )
    {
       fpNavigator[num] =  0;   
Index: trunk/source/geometry/navigation/src/G4PhantomParameterisation.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4PhantomParameterisation.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4PhantomParameterisation.cc	(revision 1347)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4PhantomParameterisation.cc,v 1.6 2009/05/20 08:27:10 gcosmo Exp $
+// $Id: G4PhantomParameterisation.cc,v 1.7 2010/07/13 15:59:42 gcosmo Exp $
 // GEANT4 tag $ Name:$
 //
@@ -45,15 +45,11 @@
 //------------------------------------------------------------------
 G4PhantomParameterisation::G4PhantomParameterisation()
-{
-  // Initialise data
-  //
-  fMaterialIndices = 0;
-  fContainerWallX = 0.;
-  fContainerWallY = 0.;
-  fContainerWallZ = 0.;
-
+  : fVoxelHalfX(0.), fVoxelHalfY(0.), fVoxelHalfZ(0.),
+    fNoVoxelX(0), fNoVoxelY(0), fNoVoxelZ(0), fNoVoxelXY(0), fNoVoxel(0),
+    fMaterialIndices(0), fContainerSolid(0),
+    fContainerWallX(0.), fContainerWallY(0.), fContainerWallZ(0.),
+    bSkipEqualMaterials(true)
+{
   kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
-
-  bSkipEqualMaterials = 1;
 }
 
Index: trunk/source/geometry/navigation/src/G4PropagatorInField.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4PropagatorInField.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4PropagatorInField.cc	(revision 1347)
@@ -36,5 +36,5 @@
 // 17.03.97 John Apostolakis,   renaming new set functions being added
 //
-// $Id: G4PropagatorInField.cc,v 1.51 2010/03/08 13:57:34 gcosmo Exp $
+// $Id: G4PropagatorInField.cc,v 1.52 2010/07/13 15:59:42 gcosmo Exp $
 // GEANT4 tag $ Name:  $
 // ---------------------------------------------------------------------------
@@ -470,5 +470,5 @@
                                         G4VPhysicalVolume*   startVolume)
 {
-  const G4int verboseLevel= fVerboseLevel;
+  const G4int verboseLevel=fVerboseLevel;
   const G4ThreeVector StartPosition       = StartFT.GetPosition();
   const G4ThreeVector StartUnitVelocity   = StartFT.GetMomentumDir();
@@ -477,11 +477,10 @@
 
   G4double step_len = CurrentFT.GetCurveLength() - StartFT.GetCurveLength();
+
+  G4int oldprec;   // cout/cerr precision settings
       
-  if( ((stepNo == 0) && (verboseLevel <3))
-      || (verboseLevel >= 3) )
-  {
-    static G4int noPrecision= 4;
-    G4cout.precision(noPrecision);
-    // G4cout.setf(ios_base::fixed,ios_base::floatfield);
+  if( ((stepNo == 0) && (verboseLevel <3)) || (verboseLevel >= 3) )
+  {
+    oldprec = G4cout.precision(4);
     G4cout << std::setw( 6)  << " " 
            << std::setw( 25) << " Current Position  and  Direction" << " "
@@ -495,77 +494,60 @@
            << std::setw( 7) << " N_y " << " "
            << std::setw( 7) << " N_z " << " " ;
-    //            << G4endl; 
-    G4cout     // << " >>> "
-           << std::setw( 7) << " Delta|N|" << " "
-      //   << std::setw( 7) << " Delta(N_z) " << " "
+    G4cout << std::setw( 7) << " Delta|N|" << " "
            << std::setw( 9) << "StepLen" << " "  
            << std::setw(12) << "StartSafety" << " "  
            << std::setw( 9) << "PhsStep" << " ";  
-    if( startVolume ) {
-      G4cout << std::setw(18) << "NextVolume" << " "; 
-    }
+    if( startVolume )
+      { G4cout << std::setw(18) << "NextVolume" << " "; }
+    G4cout.precision(oldprec);
     G4cout << G4endl;
   }
-  if((stepNo == 0) && (verboseLevel <=3)){
-     // Recurse to print the start values
-     //
-     printStatus( StartFT, StartFT, -1.0, safety, -1, startVolume);
-   }
-   if( verboseLevel <= 3 )
-   {
-     if( stepNo >= 0)
-       G4cout << std::setw( 4) << stepNo << " ";
-     else
-       G4cout << std::setw( 5) << "Start" ;
-     G4cout.precision(8);
-     G4cout << std::setw(10) << CurrentFT.GetCurveLength() << " "; 
-     G4cout.precision(8);
-     G4cout << std::setw(10) << CurrentPosition.x() << " "
-            << std::setw(10) << CurrentPosition.y() << " "
-            << std::setw(10) << CurrentPosition.z() << " ";
-     G4cout.precision(4);
-     G4cout << std::setw( 7) << CurrentUnitVelocity.x() << " "
-            << std::setw( 7) << CurrentUnitVelocity.y() << " "
-            << std::setw( 7) << CurrentUnitVelocity.z() << " ";
-     //  G4cout << G4endl; 
-     //     G4cout << " >>> " ; 
-     G4cout.precision(3); 
-     G4cout << std::setw( 7) << CurrentFT.GetMomentum().mag()- StartFT.GetMomentum().mag() << " "; 
-     //   << std::setw( 7) << CurrentUnitVelocity.z() - InitialUnitVelocity.z() << " ";
-     G4cout << std::setw( 9) << step_len << " "; 
-     G4cout << std::setw(12) << safety << " ";
-     if( requestStep != -1.0 ) 
-       G4cout << std::setw( 9) << requestStep << " ";
-     else
-       G4cout << std::setw( 9) << "Init/NotKnown" << " "; 
-
-     if( startVolume != 0)
-     {
-       G4cout << std::setw(12) << startVolume->GetName() << " ";
-     }
-#if 0
-     else
-     {
-       if( step_len != -1 )
-         G4cout << std::setw(12) << "OutOfWorld" << " ";
-       else
-         G4cout << std::setw(12) << "NotGiven" << " ";
-     }
-#endif
-
-     G4cout << G4endl;
-   }
-   else // if( verboseLevel > 3 )
-   {
-     //  Multi-line output
-       
-     G4cout << "Step taken was " << step_len  
-            << " out of PhysicalStep = " <<  requestStep << G4endl;
-     G4cout << "Final safety is: " << safety << G4endl;
-
-     G4cout << "Chord length = " << (CurrentPosition-StartPosition).mag()
-            << G4endl;
-     G4cout << G4endl; 
-   }
+  if((stepNo == 0) && (verboseLevel <=3))
+  {
+    // Recurse to print the start values
+    //
+    printStatus( StartFT, StartFT, -1.0, safety, -1, startVolume);
+  }
+  if( verboseLevel <= 3 )
+  {
+    if( stepNo >= 0)
+      { G4cout << std::setw( 4) << stepNo << " "; }
+    else
+      { G4cout << std::setw( 5) << "Start" ; }
+    oldprec = G4cout.precision(8);
+    G4cout << std::setw(10) << CurrentFT.GetCurveLength() << " "; 
+    G4cout.precision(8);
+    G4cout << std::setw(10) << CurrentPosition.x() << " "
+           << std::setw(10) << CurrentPosition.y() << " "
+           << std::setw(10) << CurrentPosition.z() << " ";
+    G4cout.precision(4);
+    G4cout << std::setw( 7) << CurrentUnitVelocity.x() << " "
+           << std::setw( 7) << CurrentUnitVelocity.y() << " "
+           << std::setw( 7) << CurrentUnitVelocity.z() << " ";
+    G4cout.precision(3); 
+    G4cout << std::setw( 7)
+           << CurrentFT.GetMomentum().mag()-StartFT.GetMomentum().mag() << " "; 
+    G4cout << std::setw( 9) << step_len << " "; 
+    G4cout << std::setw(12) << safety << " ";
+    if( requestStep != -1.0 ) 
+      { G4cout << std::setw( 9) << requestStep << " "; }
+    else
+      { G4cout << std::setw( 9) << "Init/NotKnown" << " "; }
+    if( startVolume != 0)
+      { G4cout << std::setw(12) << startVolume->GetName() << " "; }
+    G4cout.precision(oldprec);
+    G4cout << G4endl;
+  }
+  else // if( verboseLevel > 3 )
+  {
+    //  Multi-line output
+      
+    G4cout << "Step taken was " << step_len  
+           << " out of PhysicalStep = " <<  requestStep << G4endl;
+    G4cout << "Final safety is: " << safety << G4endl;
+    G4cout << "Chord length = " << (CurrentPosition-StartPosition).mag()
+           << G4endl;
+    G4cout << G4endl; 
+  }
 }
 
Index: trunk/source/geometry/navigation/src/G4RegularNavigation.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4RegularNavigation.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4RegularNavigation.cc	(revision 1347)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4RegularNavigation.cc,v 1.9 2009/01/27 09:31:29 gcosmo Exp $
+// $Id: G4RegularNavigation.cc,v 1.15 2010/11/19 15:13:39 gcosmo Exp $
 // GEANT4 tag $ Name:$
 //
@@ -45,5 +45,5 @@
 //------------------------------------------------------------------
 G4RegularNavigation::G4RegularNavigation()
-  : fVerbose(1), fCheck(true)
+  : fverbose(false), fcheck(false), fnormalNav(0)
 {
   kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
@@ -122,5 +122,5 @@
 //------------------------------------------------------------------
 G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
-                                G4ThreeVector localPoint,
+                                      G4ThreeVector& localPoint,
                                 const G4ThreeVector& localDirection,
                                 const G4double currentProposedStepLength,
@@ -291,12 +291,10 @@
                                   const G4ThreeVector& globalPoint,
                                   const G4ThreeVector* globalDirection,
-                                  const G4bool pLocatedOnEdge, 
+                                  const G4bool, // pLocatedOnEdge, 
                                   G4ThreeVector& localPoint )
 {
-  G4SmartVoxelHeader *motherVoxelHeader;
   G4VPhysicalVolume *motherPhysical, *pPhysical;
   G4PhantomParameterisation *pParam;
   G4LogicalVolume *motherLogical;
-  G4VSolid *pSolid;
   G4ThreeVector localDir;
   G4int replicaNo;
@@ -304,11 +302,8 @@
   motherPhysical = history.GetTopVolume();
   motherLogical = motherPhysical->GetLogicalVolume();
-  motherVoxelHeader = motherLogical->GetVoxelHeader();
   
   pPhysical = motherLogical->GetDaughter(0);
   pParam = (G4PhantomParameterisation*)(pPhysical->GetParameterisation());
   
-  pSolid = pParam->GetContainerSolid();
-  
   // Save parent history in touchable history
   // ... for use as parent t-h in ComputeMaterial method of param
@@ -327,41 +322,27 @@
   }
 
-  // Check that track is not on the surface and check that track is not
-  // exiting the voxel parent volume
-  //
-  if ( !G4AuxiliaryNavServices::CheckPointOnSurface(pSolid, localPoint,
-          globalDirection, history.GetTopTransform(), pLocatedOnEdge) 
-     || G4AuxiliaryNavServices::CheckPointExiting(pSolid, localPoint,
-          globalDirection, history.GetTopTransform() ) )
-  {
-  }
-  else
-  {
-    // Enter this daughter
-    //
-    replicaNo = pParam->GetReplicaNo( localPoint, localDir );
-
-    if( replicaNo < 0 || replicaNo >= G4int(pParam->GetNoVoxel()) )
-    {
-      return false;
-    }
-
-    // Set the correct copy number in physical
-    //
-    pPhysical->SetCopyNo(replicaNo);
-    pParam->ComputeTransformation(replicaNo,pPhysical);
-
-    history.NewLevel(pPhysical, kParameterised, replicaNo );
-    localPoint = history.GetTopTransform().TransformPoint(globalPoint);
-
-    // Set the correct solid and material in Logical Volume
-    //
-    G4LogicalVolume *pLogical = pPhysical->GetLogicalVolume();
+  // Enter this daughter
+  //
+  replicaNo = pParam->GetReplicaNo( localPoint, localDir );
+
+  if( replicaNo < 0 || replicaNo >= G4int(pParam->GetNoVoxel()) )
+  {
+    return false;
+  }
+
+  // Set the correct copy number in physical
+  //
+  pPhysical->SetCopyNo(replicaNo);
+  pParam->ComputeTransformation(replicaNo,pPhysical);
+
+  history.NewLevel(pPhysical, kParameterised, replicaNo );
+  localPoint = history.GetTopTransform().TransformPoint(globalPoint);
+
+  // Set the correct solid and material in Logical Volume
+  //
+  G4LogicalVolume *pLogical = pPhysical->GetLogicalVolume();
       
-    pLogical->UpdateMaterial(pParam->ComputeMaterial(replicaNo,
-                             pPhysical, &parentTouchable) );
-    return true;
-  }
-
-  return false;
-}
+  pLogical->UpdateMaterial(pParam->ComputeMaterial(replicaNo,
+                           pPhysical, &parentTouchable) );
+  return true;
+}
Index: trunk/source/geometry/navigation/src/G4ReplicaNavigation.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4ReplicaNavigation.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4ReplicaNavigation.cc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4ReplicaNavigation.cc,v 1.19 2008/04/28 15:39:55 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4ReplicaNavigation.cc,v 1.20 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -1039,4 +1039,5 @@
     G4Exception("G4ReplicaNavigation::BackLocate()", "InvalidSetup",
                 FatalException, "The World volume must be a Placement!");
+    return kInside;
   }
 
Index: trunk/source/geometry/navigation/src/G4SimpleLocator.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4SimpleLocator.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4SimpleLocator.cc	(revision 1347)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4SimpleLocator.cc,v 1.5 2008/12/11 10:27:58 tnikitin Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4SimpleLocator.cc,v 1.6 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // Class G4SimpleLocator implementation
@@ -105,4 +105,6 @@
 
   G4int substep_no = 0;
+
+  G4int oldprc;  // cout/cerr precision settings
 
   // Limits for substep number
@@ -358,5 +360,5 @@
                   << GetEpsilonStepFor() << G4endl;
          }
-         G4cerr.precision(20);
+         oldprc = G4cerr.precision(20);
          G4cerr << " Point A (Curve start)   is " << CurveStartPointVelocity
                 << G4endl;
@@ -373,4 +375,5 @@
          G4cerr << "        LocateIntersection parameters are : Substep no= "
                 << substep_no << G4endl;
+         G4cerr.precision(oldprc);
 
          G4Exception("G4SimpleLocator::EstimateIntersectionPoint()",
@@ -452,5 +455,5 @@
                  -1.0, NewSafety, substep_no);
     G4cout << G4endl;
-    G4cout.precision( 10 ); 
+    oldprc = G4cout.precision(10); 
     G4double done_len = CurrentA_PointVelocity.GetCurveLength(); 
     G4double full_len = CurveEndPointVelocity.GetCurveLength();
@@ -460,4 +463,5 @@
            << " out of " << full_len << " required." << G4endl;
     G4cout << "        Remaining length = " << full_len - done_len << G4endl; 
+    G4cout.precision(oldprc); 
 
     G4Exception("G4SimpleLocator::EstimateIntersectionPoint()",
@@ -467,5 +471,5 @@
   else if( substep_no >= warn_substeps )
   {  
-    G4int oldprc= G4cout.precision( 10 ); 
+    oldprc= G4cout.precision(10); 
     G4cout << "WARNING - G4SimpleLocator::EstimateIntersectionPoint()"
            << G4endl
@@ -475,8 +479,8 @@
            << "          Warning level = " << warn_substeps
            << " and maximum substeps = " << max_substeps << G4endl;
+    G4cout.precision(oldprc); 
     G4Exception("G4SimpleLocator::EstimateIntersectionPoint()",
                 "DifficultyToLocateIntersection", JustWarning,
                 "Many substeps while trying to locate intersection.");
-    G4cout.precision( oldprc ); 
   }
   return  !there_is_no_intersection; //  Success or failure
Index: trunk/source/geometry/navigation/src/G4TransportationManager.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4TransportationManager.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4TransportationManager.cc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4TransportationManager.cc,v 1.15 2007/04/12 11:51:48 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4TransportationManager.cc,v 1.16 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -56,21 +56,5 @@
 G4TransportationManager::G4TransportationManager() 
 { 
-  if (!fTransportationManager)
-  {
-    // Create the navigator for tracking and activate it; add to collections
-    //
-    G4Navigator* trackingNavigator = new G4Navigator();
-    trackingNavigator->Activate(true);
-    fNavigators.push_back(trackingNavigator);
-    fActiveNavigators.push_back(trackingNavigator);
-    fWorlds.push_back(trackingNavigator->GetWorldVolume()); // NULL registered
-
-    fGeomMessenger     = new G4GeometryMessenger(this);
-    fFieldManager      = new G4FieldManager();
-    fPropagatorInField = new G4PropagatorInField(trackingNavigator,
-                                                 fFieldManager);
-    fSafetyHelper      = new G4SafetyHelper();
-  }
-  else
+  if (fTransportationManager)
   {
     G4cerr << "Only ONE instance of G4TransportationManager is allowed!"
@@ -80,4 +64,17 @@
                 "Only ONE instance of G4TransportationManager is allowed!");
   }
+
+  // Create the navigator for tracking and activate it; add to collections
+  //
+  G4Navigator* trackingNavigator = new G4Navigator();
+  trackingNavigator->Activate(true);
+  fNavigators.push_back(trackingNavigator);
+  fActiveNavigators.push_back(trackingNavigator);
+  fWorlds.push_back(trackingNavigator->GetWorldVolume()); // NULL registered
+
+  fGeomMessenger    = new G4GeometryMessenger(this);
+  fFieldManager     = new G4FieldManager();
+  fPropagatorInField= new G4PropagatorInField(trackingNavigator,fFieldManager);
+  fSafetyHelper     = new G4SafetyHelper();
 } 
 
@@ -329,5 +326,9 @@
    std::vector<G4Navigator*>::iterator pNav =
      std::find(fNavigators.begin(), fNavigators.end(), aNavigator);
-   if (pNav == fNavigators.end())
+   if (pNav != fNavigators.end())
+   {
+      (*pNav)->Activate(false);
+   }
+   else
    {
       G4String message
@@ -337,8 +338,5 @@
                   "NoEffect", JustWarning, message);
    }
-   else
-   {
-      (*pNav)->Activate(false);
-   }
+
    std::vector<G4Navigator*>::iterator pActiveNav =
      std::find(fActiveNavigators.begin(), fActiveNavigators.end(), aNavigator);
Index: trunk/source/geometry/navigation/src/G4VIntersectionLocator.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4VIntersectionLocator.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4VIntersectionLocator.cc	(revision 1347)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4VIntersectionLocator.cc,v 1.7 2009/11/27 15:21:59 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4VIntersectionLocator.cc,v 1.8 2010/07/13 15:59:42 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // Class G4VIntersectionLocator implementation
@@ -83,10 +83,9 @@
 
   G4double step_len = CurrentFT.GetCurveLength() - StartFT.GetCurveLength();
-      
+  G4int oldprc;  // cout/cerr precision settings
+
   if( ((stepNo == 0) && (verboseLevel <3)) || (verboseLevel >= 3) )
   {
-    static G4int noPrecision= 4;
-    G4cout.precision(noPrecision);
-    // G4cout.setf(ios_base::fixed,ios_base::floatfield);
+    oldprc = G4cout.precision(4);
     G4cout << std::setw( 6)  << " " 
            << std::setw( 25) << " Current Position  and  Direction" << " "
@@ -100,13 +99,10 @@
            << std::setw( 7) << " N_y " << " "
            << std::setw( 7) << " N_z " << " " ;
-    //            << G4endl; 
-    G4cout     // << " >>> "
-           << std::setw( 7) << " Delta|N|" << " "
-      //   << std::setw( 7) << " Delta(N_z) " << " "
+    G4cout << std::setw( 7) << " Delta|N|" << " "
            << std::setw( 9) << "StepLen" << " "  
            << std::setw(12) << "StartSafety" << " "  
            << std::setw( 9) << "PhsStep" << " ";  
-  
     G4cout << G4endl;
+    G4cout.precision(oldprc);
   }
   if((stepNo == 0) && (verboseLevel <=3))
@@ -126,7 +122,6 @@
        G4cout << std::setw( 5) << "Start" ;
     }
-    G4cout.precision(8);
+    oldprc = G4cout.precision(8);
     G4cout << std::setw(10) << CurrentFT.GetCurveLength() << " "; 
-    G4cout.precision(8);
     G4cout << std::setw(10) << CurrentPosition.x() << " "
            << std::setw(10) << CurrentPosition.y() << " "
@@ -136,36 +131,32 @@
            << std::setw( 7) << CurrentUnitVelocity.y() << " "
            << std::setw( 7) << CurrentUnitVelocity.z() << " ";
-     //  G4cout << G4endl; 
-     //     G4cout << " >>> " ; 
-     G4cout.precision(3); 
-     G4cout << std::setw( 7)
-            << CurrentFT.GetMomentum().mag()- StartFT.GetMomentum().mag()
-            << " "; 
-     //   << std::setw( 7)
-     //   << CurrentUnitVelocity.z() - InitialUnitVelocity.z() << " ";
-     G4cout << std::setw( 9) << step_len << " "; 
-     G4cout << std::setw(12) << safety << " ";
-     if( requestStep != -1.0 )
-     {
-       G4cout << std::setw( 9) << requestStep << " ";
-     }
-     else
-     {
-       G4cout << std::setw( 9) << "Init/NotKnown" << " "; 
-     }
-     G4cout << G4endl;
-   }
-   else // if( verboseLevel > 3 )
-   {
-     //  Multi-line output
+    G4cout.precision(3); 
+    G4cout << std::setw( 7)
+           << CurrentFT.GetMomentum().mag()- StartFT.GetMomentum().mag()
+           << " "; 
+    G4cout << std::setw( 9) << step_len << " "; 
+    G4cout << std::setw(12) << safety << " ";
+    if( requestStep != -1.0 )
+    {
+      G4cout << std::setw( 9) << requestStep << " ";
+    }
+    else
+    {
+      G4cout << std::setw( 9) << "Init/NotKnown" << " "; 
+    }
+    G4cout << G4endl;
+    G4cout.precision(oldprc);
+  }
+  else // if( verboseLevel > 3 )
+  {
+    //  Multi-line output
        
-     G4cout << "Step taken was " << step_len  
-            << " out of PhysicalStep= " <<  requestStep << G4endl;
-     G4cout << "Final safety is: " << safety << G4endl;
-
-     G4cout << "Chord length = " << (CurrentPosition-StartPosition).mag()
-            << G4endl;
-     G4cout << G4endl; 
-   }
+    G4cout << "Step taken was " << step_len  
+           << " out of PhysicalStep= " <<  requestStep << G4endl;
+    G4cout << "Final safety is: " << safety << G4endl;
+    G4cout << "Chord length = " << (CurrentPosition-StartPosition).mag()
+           << G4endl;
+    G4cout << G4endl; 
+  }
 }
 
Index: trunk/source/geometry/navigation/src/G4VoxelNavigation.cc
===================================================================
--- trunk/source/geometry/navigation/src/G4VoxelNavigation.cc	(revision 1337)
+++ trunk/source/geometry/navigation/src/G4VoxelNavigation.cc	(revision 1347)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4VoxelNavigation.cc,v 1.9 2008/11/14 18:26:35 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4VoxelNavigation.cc,v 1.13 2010/11/04 18:18:00 japost Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
@@ -37,4 +37,5 @@
 #include "G4VoxelNavigation.hh"
 #include "G4GeometryTolerance.hh"
+#include "G4VoxelSafety.hh"
 
 // ********************************************************************
@@ -43,5 +44,5 @@
 //
 G4VoxelNavigation::G4VoxelNavigation()
-  : fVoxelDepth(-1),
+  : fBList(), fVoxelDepth(-1),
     fVoxelAxisStack(kNavigatorVoxelStackMax,kXAxis),
     fVoxelNoSlicesStack(kNavigatorVoxelStackMax,0),
@@ -49,9 +50,8 @@
     fVoxelNodeNoStack(kNavigatorVoxelStackMax,0),
     fVoxelHeaderStack(kNavigatorVoxelStackMax,(G4SmartVoxelHeader*)0),
-    fVoxelNode(0),
-    fCheck(false),
-    fVerbose(0)
+    fVoxelNode(0), fpVoxelSafety(0), fCheck(false), fBestSafety(false)
 {
-  kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
+  fLogger = new G4NavigationLogger("G4VoxelNavigation");
+  fpVoxelSafety = new G4VoxelSafety (); 
 }
 
@@ -62,7 +62,6 @@
 G4VoxelNavigation::~G4VoxelNavigation()
 {
-#ifdef G4DEBUG_NAVIGATION
-  G4cout << "G4VoxelNavigation::~G4VoxelNavigation() called." << G4endl;
-#endif
+  delete fpVoxelSafety;
+  delete fLogger;
 }
 
@@ -110,45 +109,5 @@
   if ( fCheck )
   {
-    if(fVerbose == 1 )
-    {
-      G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
-             << "    Invoked DistanceToOut(p) for mother solid: "
-             << motherSolid->GetName()
-             << ". Solid replied: " << motherSafety << G4endl
-             << "    For local point p: " << localPoint
-             << ", to be considered as 'mother safety'." << G4endl;
-    }
-    if( motherSafety < 0.0 )
-    {
-      G4cout << "ERROR - G4VoxelNavigation::ComputeStep()" << G4endl
-             << "        Current solid " << motherSolid->GetName()
-             << " gave negative safety: " << motherSafety << G4endl
-             << "        for the current (local) point " << localPoint
-             << G4endl;
-      motherSolid->DumpInfo();
-      G4Exception("G4VoxelNavigation::ComputeStep()",
-                  "NegativeSafetyMotherVol", FatalException,
-                  "Negative Safety In Voxel Navigation !" ); 
-    }
-    if( motherSolid->Inside(localPoint)==kOutside )
-    { 
-      G4cout << "WARNING - G4VoxelNavigation::ComputeStep()" << G4endl
-             << "          Point " << localPoint
-             << " is outside current volume " << motherPhysical->GetName()
-             << G4endl;
-      G4double  estDistToSolid= motherSolid->DistanceToIn(localPoint); 
-      G4cout << "          Estimated isotropic distance to solid (distToIn)= " 
-             << estDistToSolid << G4endl;
-      if( estDistToSolid > 100.0 * kCarTolerance )
-      {
-        motherSolid->DumpInfo();
-        G4Exception("G4VoxelNavigation::ComputeStep()",
-                    "FarOutsideCurrentVolume", FatalException,
-                    "Point is far outside Current Volume !"); 
-      }
-      else
-        G4Exception("G4VoxelNavigation::ComputeStep()", "OutsideCurrentVolume", 
-                    JustWarning, "Point is a little outside Current Volume."); 
-    }
+    fLogger->PreComputeStepLog (motherPhysical, motherSafety, localPoint);
   }
 #endif
@@ -204,12 +163,7 @@
                      sampleSolid->DistanceToIn(samplePoint);
 #ifdef G4VERBOSE
-          if(( fCheck ) && ( fVerbose == 1 ))
+          if( fCheck )
           {
-            G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
-                   << "    Invoked DistanceToIn(p) for daughter solid: "
-                   << sampleSolid->GetName()
-                   << ". Solid replied: " << sampleSafety << G4endl
-                   << "    For local point p: " << samplePoint
-                   << ", to be considered as 'daughter safety'." << G4endl;
+            fLogger->PrintDaughterLog(sampleSolid,samplePoint,sampleSafety,0);
           }
 #endif
@@ -224,13 +178,8 @@
                      sampleSolid->DistanceToIn(samplePoint, sampleDirection);
 #ifdef G4VERBOSE
-            if(( fCheck ) && ( fVerbose == 1 ))
+            if( fCheck )
             {
-              G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
-                     << "    Invoked DistanceToIn(p,v) for daughter solid: "
-                     << sampleSolid->GetName()
-                     << ". Solid replied: " << sampleStep << G4endl
-                     << "    For local point p: " << samplePoint << G4endl
-                     << "    Direction v: " << sampleDirection
-                     << ", to be considered as 'daughter step'." << G4endl;
+              fLogger->PrintDaughterLog(sampleSolid, samplePoint,
+                                        sampleSafety, sampleStep);
             }
 #endif
@@ -247,96 +196,8 @@
               // candidate.
 
-              if ( ( fCheck ) && ( sampleStep < kInfinity ) )
+              if ( fCheck )
               {
-                G4ThreeVector intersectionPoint;
-                intersectionPoint= samplePoint + sampleStep * sampleDirection;
-                EInside insideIntPt= sampleSolid->Inside(intersectionPoint); 
-                G4String solidResponse = "-kInside-";
-                if (insideIntPt == kOutside)
-                  { solidResponse = "-kOutside-"; }
-                else if (insideIntPt == kSurface)
-                  { solidResponse = "-kSurface-"; }
-                if( fVerbose == 1 )
-                {
-                  G4cout << "*** G4VoxelNavigation::ComputeStep(): ***"<<G4endl
-                         << "    Invoked Inside() for solid: "
-                         << sampleSolid->GetName()
-                         << ". Solid replied: " << solidResponse << G4endl
-                         << "    For point p: " << intersectionPoint
-                         << ", considered as 'intersection' point." << G4endl;
-                }
-                G4double safetyIn= -1, safetyOut= -1;  //  Set to invalid values
-                G4double newDistIn= -1,  newDistOut= -1;
-                if( insideIntPt != kInside )
-                {
-                  safetyIn= sampleSolid->DistanceToIn(intersectionPoint);
-                  newDistIn= sampleSolid->DistanceToIn(intersectionPoint,
-                                                       sampleDirection);
-                }
-                if( insideIntPt != kOutside )
-                {
-                  safetyOut= sampleSolid->DistanceToOut(intersectionPoint);
-                  newDistOut= sampleSolid->DistanceToOut(intersectionPoint,
-                                                         sampleDirection);
-                }
-                if( insideIntPt != kSurface )
-                {
-                  G4int oldcoutPrec = G4cout.precision(16); 
-                  G4cout << "WARNING - G4VoxelNavigation::ComputeStep()"
-                         << G4endl
-                         << "          Inaccurate solid DistanceToIn"
-                         << " for solid " << sampleSolid->GetName() << G4endl;
-                  G4cout << "          Solid gave DistanceToIn = "
-                         << sampleStep << " yet returns " << solidResponse
-                         << " for this point !" << G4endl; 
-                  G4cout << "          Point = " << intersectionPoint << G4endl;
-                  G4cout << "          Safety values: " << G4endl;
-                  if ( insideIntPt != kInside )
-                  {
-                    G4cout << "          DistanceToIn(p)  = " << safetyIn
-                           << G4endl;
-                  }
-                  if ( insideIntPt != kOutside )
-                  {
-                    G4cout << "          DistanceToOut(p) = " << safetyOut
-                           << G4endl;
-                  }
-                  G4Exception("G4VoxelNavigation::ComputeStep()", 
-                              "InaccurateDistanceToIn", JustWarning,
-                              "Conflicting response from Solid.");
-                  G4cout.precision(oldcoutPrec);
-                }
-                else
-                {  
-                  // If it is on the surface, *ensure* that either DistanceToIn
-                  // or DistanceToOut returns a finite value ( >= Tolerance).
-                  //
-                  if( std::max( newDistIn, newDistOut ) <= kCarTolerance )
-                  { 
-                    G4cout << "ERROR - G4VoxelNavigation::ComputeStep()"
-                       << G4endl
-                       << "  Identified point for which the solid " 
-                       << sampleSolid->GetName() << G4endl
-                       << "  has MAJOR problem:  " << G4endl
-                       << "  --> Both DistanceToIn(p,v) and DistanceToOut(p,v) "
-                       << "return Zero, an equivalent value or negative value."
-                       << G4endl; 
-                    G4cout << "    Solid: " << sampleSolid << G4endl;
-                    G4cout << "    Point p= " << intersectionPoint << G4endl;
-                    G4cout << "    Direction v= " << sampleDirection << G4endl;
-                    G4cout << "    DistanceToIn(p,v)     = " << newDistIn
-                           << G4endl;
-                    G4cout << "    DistanceToOut(p,v,..) = " << newDistOut
-                           << G4endl;
-                    G4cout << "    Safety values: " << G4endl;
-                    G4cout << "      DistanceToIn(p)  = " << safetyIn
-                           << G4endl;
-                    G4cout << "      DistanceToOut(p) = " << safetyOut
-                           << G4endl;
-                    G4Exception("G4VoxelNavigation::ComputeStep()", 
-                              "DistanceToInAndOutAreZero", FatalException,
-                              "Zero from both Solid DistanceIn and Out(p,v).");
-                  }
-                }
+                fLogger->AlongComputeStepLog (sampleSolid, samplePoint,
+                  sampleDirection, localDirection, sampleSafety, sampleStep);
               }
 #endif
@@ -378,31 +239,6 @@
           if ( fCheck )
           {
-            if(fVerbose == 1)
-            {
-              G4cout << "*** G4VoxelNavigation::ComputeStep(): ***" << G4endl
-                     << "    Invoked DistanceToOut(p,v,...) for mother solid: "
-                     << motherSolid->GetName()
-                     << ". Solid replied: " << motherStep << G4endl
-                     << "    For local point p: " << localPoint << G4endl
-                     << "    Direction v: " << localDirection
-                     << ", to be considered as 'mother step'." << G4endl;
-            }
-            if( ( motherStep < 0.0 ) || ( motherStep >= kInfinity) )
-            {
-              G4int oldPrOut= G4cout.precision(16); 
-              G4int oldPrErr= G4cerr.precision(16);
-              G4cerr << "ERROR - G4VoxelNavigation::ComputeStep()" << G4endl
-                     << "        Problem in Navigation"  << G4endl
-                     << "        Point (local coordinates): "
-                     << localPoint << G4endl
-                     << "        Local Direction: " << localDirection << G4endl
-                     << "        Solid: " << motherSolid->GetName() << G4endl; 
-              motherSolid->DumpInfo();
-              G4Exception("G4VoxelNavigation::ComputeStep()",
-                          "PointOutsideCurrentVolume", FatalException,
-                          "Current point is outside the current solid !");
-              G4cout.precision(oldPrOut);
-              G4cerr.precision(oldPrErr);
-            }
+            fLogger->PostComputeStepLog(motherSolid, localPoint, localDirection,
+                                        motherStep, motherSafety);
           }
 #endif
@@ -480,13 +316,13 @@
   }
   else if (maxCurNodeNoDelta < minCurNodeNoDelta)
-       {
-         voxelSafety = maxCurNodeNoDelta*curNodeWidth;
-         voxelSafety += maxCurCommonDelta;
-        }
-        else    // (maxCurNodeNoDelta == minCurNodeNoDelta)
-        {
-          voxelSafety = minCurNodeNoDelta*curNodeWidth;
-          voxelSafety += std::min(minCurCommonDelta,maxCurCommonDelta);
-        }
+  {
+    voxelSafety = maxCurNodeNoDelta*curNodeWidth;
+    voxelSafety += maxCurCommonDelta;
+  }
+  else    // (maxCurNodeNoDelta == minCurNodeNoDelta)
+  {
+    voxelSafety = minCurNodeNoDelta*curNodeWidth;
+    voxelSafety += std::min(minCurCommonDelta,maxCurCommonDelta);
+  }
 
   // Compute isotropic safety to boundaries of previous levels
@@ -552,4 +388,6 @@
   
   G4double currentDistance = currentStep;
+  static const G4double sigma = 0.5*G4GeometryTolerance::GetInstance()
+                                    ->GetSurfaceTolerance();
 
   // Determine if end of Step within current voxel
@@ -567,8 +405,8 @@
     minVal = workMinExtent+workNodeNo*workNodeWidth;
 
-    if ( minVal<=workCoord+kCarTolerance*0.5 )
+    if ( minVal<=workCoord+sigma )
     {
       maxVal = minVal+workNodeWidth;
-      if ( maxVal<=workCoord-kCarTolerance*0.5 )
+      if ( maxVal<=workCoord-sigma )
       {
         // Must consider next voxel
@@ -607,9 +445,9 @@
     minVal = workMinExtent+fVoxelNode->GetMinEquivalentSliceNo()*workNodeWidth;
 
-    if ( minVal<=workCoord+kCarTolerance*0.5 )
+    if ( minVal<=workCoord+sigma )
     {
       maxVal = workMinExtent+(fVoxelNode->GetMaxEquivalentSliceNo()+1)
                             *workNodeWidth;
-      if ( maxVal<=workCoord-kCarTolerance*0.5 )
+      if ( maxVal<=workCoord-sigma )
       {
         newNodeNo = fVoxelNode->GetMaxEquivalentSliceNo()+1;
@@ -710,5 +548,5 @@
 G4VoxelNavigation::ComputeSafety(const G4ThreeVector& localPoint,
                                  const G4NavigationHistory& history,
-                                 const G4double )
+                                 const G4double       maxLength)
 {
   G4VPhysicalVolume *motherPhysical, *samplePhysical;
@@ -725,4 +563,9 @@
   motherSolid = motherLogical->GetSolid();
 
+  if( fBestSafety )
+  { 
+    return fpVoxelSafety->ComputeSafety( localPoint,*motherPhysical,maxLength );
+  }
+
   //
   // Compute mother safety
@@ -733,12 +576,7 @@
 
 #ifdef G4VERBOSE
-  if(( fCheck ) && ( fVerbose == 1 ))
-  {
-    G4cout << "*** G4VoxelNavigation::ComputeSafety(): ***" << G4endl
-           << "    Invoked DistanceToOut(p) for mother solid: "
-           << motherSolid->GetName()
-           << ". Solid replied: " << motherSafety << G4endl
-           << "    For local point p: " << localPoint
-           << ", to be considered as 'mother safety'." << G4endl;
+  if( fCheck )
+  {
+    fLogger->ComputeSafetyLog (motherSolid, localPoint, motherSafety, true);
   }
 #endif
@@ -772,12 +610,7 @@
     }
 #ifdef G4VERBOSE
-    if(( fCheck ) && ( fVerbose == 1 ))
-    {
-      G4cout << "*** G4VoxelNavigation::ComputeSafety(): ***" << G4endl
-             << "    Invoked DistanceToIn(p) for daughter solid: "
-             << sampleSolid->GetName()
-             << ". Solid replied: " << sampleSafety << G4endl
-             << "    For local point p: " << samplePoint
-             << ", to be considered as 'daughter safety'." << G4endl;
+    if( fCheck )
+    {
+      fLogger->ComputeSafetyLog (sampleSolid,samplePoint,sampleSafety,false);
     }
 #endif
@@ -790,2 +623,12 @@
   return ourSafety;
 }
+
+// ********************************************************************
+// SetVerboseLevel
+// ********************************************************************
+//
+void  G4VoxelNavigation::SetVerboseLevel(G4int level)
+{
+  if( fLogger )       fLogger->SetVerboseLevel(level);
+  if( fpVoxelSafety)  fpVoxelSafety->SetVerboseLevel( level ); 
+}
Index: trunk/source/geometry/navigation/test/ApproxEqual.hh
===================================================================
--- trunk/source/geometry/navigation/test/ApproxEqual.hh	(revision 1337)
+++ trunk/source/geometry/navigation/test/ApproxEqual.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: ApproxEqual.hh,v 1.4 2006/06/29 18:37:15 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 
Index: trunk/source/geometry/navigation/test/MyMultiNavigator.hh
===================================================================
--- trunk/source/geometry/navigation/test/MyMultiNavigator.hh	(revision 1337)
+++ trunk/source/geometry/navigation/test/MyMultiNavigator.hh	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: MyMultiNavigator.hh,v 1.1 2006/11/11 01:35:38 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // Class to help test Multi-navigator geometry 
Index: trunk/source/geometry/navigation/test/testG4MultiNavigator1.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4MultiNavigator1.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4MultiNavigator1.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4MultiNavigator1.cc,v 1.1 2006/11/11 01:35:38 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4Navigator1.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4Navigator1.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4Navigator1.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4Navigator1.cc,v 1.5 2006/06/29 18:37:17 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4Navigator2.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4Navigator2.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4Navigator2.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4Navigator2.cc,v 1.6 2007/03/23 18:33:08 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4Navigator3.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4Navigator3.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4Navigator3.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4Navigator3.cc,v 1.5 2006/06/29 18:37:21 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4Navigator4.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4Navigator4.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4Navigator4.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4Navigator4.cc,v 1.5 2006/06/29 18:37:23 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4Navigator5.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4Navigator5.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4Navigator5.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4Navigator5.cc,v 1.6 2006/06/29 18:37:26 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4Navigator6.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4Navigator6.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4Navigator6.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4Navigator6.cc,v 1.5 2006/06/29 18:37:28 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4NestedParameterisedNav.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4NestedParameterisedNav.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4NestedParameterisedNav.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4NestedParameterisedNav.cc,v 1.6 2006/06/29 18:37:30 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/geometry/navigation/test/testG4PathFinder.cc
===================================================================
--- trunk/source/geometry/navigation/test/testG4PathFinder.cc	(revision 1337)
+++ trunk/source/geometry/navigation/test/testG4PathFinder.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4PathFinder.cc,v 1.8 2007/02/13 16:15:34 japost Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 
+// GEANT4 tag $Name: geant4-09-04-ref-00 $ 
 //
 // 
