From bc13104726e8975c0e4a62bf0d859dcca77d4213 Mon Sep 17 00:00:00 2001
From: Gabriele Cosmo <gabriele.cosmo@cern.ch>
Date: Thu, 9 Jun 2016 10:23:17 +0200
Subject: [PATCH] Import Geant4 5.1.1 source tree

---
 ReleaseNotes/Patch4.4.0-1.txt                 |  9 +-
 ReleaseNotes/Patch4.4.0-2.txt                 |  9 +-
 ReleaseNotes/Patch4.4.1-1.txt                 |  8 +-
 ReleaseNotes/Patch4.5.0-1.txt                 |  8 +-
 ReleaseNotes/Patch4.5.1-1.txt                 | 64 ++++++++++++++
 ReleaseNotes/ReleaseNotes4.0.1.txt            | 20 ++---
 ReleaseNotes/ReleaseNotes4.1.0.txt            | 14 ++-
 ReleaseNotes/ReleaseNotes4.1.1.txt            | 14 ++-
 ReleaseNotes/ReleaseNotes4.2.0.txt            | 16 ++--
 ReleaseNotes/ReleaseNotes4.3.0.txt            | 19 ++--
 ReleaseNotes/ReleaseNotes4.3.1.txt            | 19 ++--
 ReleaseNotes/ReleaseNotes4.3.2.txt            | 19 ++--
 ReleaseNotes/ReleaseNotes4.4.0.txt            | 17 ++--
 ReleaseNotes/ReleaseNotes4.4.1.txt            | 23 +++--
 ReleaseNotes/ReleaseNotes4.5.0.txt            | 23 +++--
 ReleaseNotes/ReleaseNotes4.5.1.txt            |  4 +-
 .../extended/electromagnetic/TestEm1/History  |  9 +-
 .../electromagnetic/TestEm1/TestEm1.in        |  5 +-
 .../TestEm1/src/Em1DetectorConstruction.cc    | 12 +--
 .../TestEm1/src/Em1SteppingAction.cc          | 28 +++---
 .../TestEm1/src/Em1TrackingAction.cc          | 23 +++--
 .../extended/electromagnetic/TestEm2/History  |  8 +-
 .../include/Em2DetectorConstruction.hh        | 63 +++++++-------
 .../electromagnetic/TestEm2/run05.mac         | 38 ++++++++
 .../TestEm2/src/Em2DetectorConstruction.cc    | 86 +++++++++----------
 .../TestEm2/src/Em2PhysListEmModel.cc         | 26 +++---
 .../extended/electromagnetic/TestEm2/vis.mac  |  1 -
 .../extended/electromagnetic/TestEm3/History  |  9 +-
 .../electromagnetic/TestEm3/run09.mac         | 26 ++++++
 .../TestEm3/src/Em3DetectorConstruction.cc    | 49 ++++++-----
 .../TestEm3/src/Em3EventAction.cc             | 32 +++----
 .../TestEm3/src/Em3RunActionMessenger.cc      |  8 +-
 .../extended/electromagnetic/TestEm3/vis.mac  |  4 -
 examples/novice/N04/History                   |  5 +-
 examples/novice/N04/src/ExN04HadronPhysics.cc |  6 +-
 source/geometry/solids/Boolean/History        |  5 +-
 .../Boolean/include/G4ReflectionFactory.hh    | 16 ++--
 .../solids/Boolean/src/G4ReflectionFactory.cc |  7 +-
 source/geometry/volumes/History               |  9 +-
 .../volumes/src/G4PropagatorInField.cc        | 20 +++--
 .../processes/electromagnetic/muons/History   |  8 +-
 .../muons/src/G4MuPairProduction.cc           | 32 +++++--
 .../kinetic_model/src/G4BinaryCascade.cc      |  4 +-
 source/run/History                            | 17 +++-
 source/run/include/G4RunManager.hh            | 18 ++--
 source/run/src/G4RunManager.cc                | 54 ++++++------
 46 files changed, 557 insertions(+), 357 deletions(-)
 create mode 100644 ReleaseNotes/Patch4.5.1-1.txt
 create mode 100644 examples/extended/electromagnetic/TestEm2/run05.mac
 create mode 100644 examples/extended/electromagnetic/TestEm3/run09.mac

diff --git a/ReleaseNotes/Patch4.4.0-1.txt b/ReleaseNotes/Patch4.4.0-1.txt
index 66bdfaefce..422c6b1245 100644
--- a/ReleaseNotes/Patch4.4.0-1.txt
+++ b/ReleaseNotes/Patch4.4.0-1.txt
@@ -94,9 +94,8 @@ List of fixes included in this public patch to release 4.0:
 
 The code and rebuilt binary libraries for release 4.0 are available through
 our "Source Code" Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
-
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
diff --git a/ReleaseNotes/Patch4.4.0-2.txt b/ReleaseNotes/Patch4.4.0-2.txt
index 5f10034164..da996ee4c1 100644
--- a/ReleaseNotes/Patch4.4.0-2.txt
+++ b/ReleaseNotes/Patch4.4.0-2.txt
@@ -149,9 +149,8 @@ top of patch-01:
 
 The code and rebuilt binary libraries for release 4.0 are available through
 our "Source Code" Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
-
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
diff --git a/ReleaseNotes/Patch4.4.1-1.txt b/ReleaseNotes/Patch4.4.1-1.txt
index 3b2e4e37b0..589857c05b 100644
--- a/ReleaseNotes/Patch4.4.1-1.txt
+++ b/ReleaseNotes/Patch4.4.1-1.txt
@@ -105,8 +105,8 @@ List of fixes included in this public patch to release 4.1:
 
 The code and rebuilt binary libraries for release 4.1 are available through
 our "Source Code" Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
diff --git a/ReleaseNotes/Patch4.5.0-1.txt b/ReleaseNotes/Patch4.5.0-1.txt
index 2b8a57ebd3..9264b25ce1 100644
--- a/ReleaseNotes/Patch4.5.0-1.txt
+++ b/ReleaseNotes/Patch4.5.0-1.txt
@@ -174,8 +174,8 @@ List of fixes included in this public patch to release 5.0:
 
 The code and rebuilt binary libraries for release 5.0 are available through
 our "Source Code" Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
diff --git a/ReleaseNotes/Patch4.5.1-1.txt b/ReleaseNotes/Patch4.5.1-1.txt
new file mode 100644
index 0000000000..82a2f26d6b
--- /dev/null
+++ b/ReleaseNotes/Patch4.5.1-1.txt
@@ -0,0 +1,64 @@
+
+                 Geant4 5.1 - patch-01 Release Notes
+                 -----------------------------------
+
+                                                            19 May 2003
+
+List of fixes included in this public patch to release 5.1:
+
+  o Electromagnetic processes (standard):
+    ------------------------------------
+  + muons:
+    - Commented out debug printout in G4MuPairProduction.
+
+  o Geometry:
+    --------
+  + solids/Boolean:
+    - Added set/get methods for scale precision in G4ReflectionFactory.
+  + volumes:
+    - G4PropagatorInField.cc: fix in ComputeStep() to avoid step computation
+      if proposed step length is too small. Fixes problem noticed in release
+      5.1 and occasionally appearing as "Invalid Enum in [solid-type]", also
+      registered as problem report #485.
+
+  o Hadronic processes:
+    ------------------
+  + models/generator/kinetic_model
+    o G4BinaryCascade: fix to cure infinite loop observed in inelastic
+      scattering of hydrogen.
+
+  o Run:
+    ---
+  - G4RunManager: fixed behavior of function DefineWorldVolume()
+    to properly reset navigation history and optimisation in case the
+    topology of the geometry has changed between runs. Now only a single
+    call to DefineWorldVolume() is necessary when changing the geometry.
+    Fixes also problem report #481.
+    o Added new boolean argument (default set to TRUE) to specify if
+      topology has changed.
+    o Forced open/close geometry in method ResetNavigator() to properly
+      reset G4Navigator status and remove old optimisations.
+
+  o Examples:
+    --------
+    - novice/N04
+      o Corrected printout.
+    - extended/electromagnetic - TestEm1, TestEm2, TestEm3
+      o Simplified mechanism for updating geometries between runs,
+        according to changes in G4RunManager::DefineWorldVolume().
+
+ ----------------------------------------------------------------------------
+
+                             Technical Notes
+                             --------------- 
+
+  o  This patch should be applied on top of release 5.1.
+  o  Technical notes distributed for release 5.1 are also applicable and
+     valid for this patch.
+
+The code and rebuilt binary libraries for release 5.1 are available through
+our "Source Code" Web page:  http://cern.ch/geant4
+
+Please refer to the Geant4 User Documentation:
+   http://cern.ch/geant4/G4UsersDocuments/Overview/html
+for further information about using Geant4.
diff --git a/ReleaseNotes/ReleaseNotes4.0.1.txt b/ReleaseNotes/ReleaseNotes4.0.1.txt
index 0b944faea4..e3c29c1fb8 100644
--- a/ReleaseNotes/ReleaseNotes4.0.1.txt
+++ b/ReleaseNotes/ReleaseNotes4.0.1.txt
@@ -21,13 +21,11 @@ Note that the next release, Geant4.1.0, will be offered only in the
 STL version.
 
 This code and some binary libraries are available through our "Source
-Code" Web page - see our <A
-Href="http://wwwinfo.cern.ch/asd/geant4/geant4.html">Geant4 Home
-Page</A>.
+Code" Web page - see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-Href="http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 Updates to the documentation for Geant4.0.1 are still in preparation
 and are expected to be published within three weeks.
 
@@ -68,9 +66,9 @@ Platforms also tested but giving rise to some problems - see below:
 2. CLHEP 1.4
 ------------
 
-Geant4.0.1 requires the installation of <A
-href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">CLHEP
-1.4</A>.  The following platform specific instructions apply:
+Geant4.0.1 requires the installation of CLHEP 1.4
+(http://cern.ch/clhep/INSTALLATION/clhep.html).
+The following platform specific instructions apply:
 
   DEC: Do *not* use the compiler option "-std strict_ansi".
 
@@ -84,10 +82,10 @@ href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">CLHEP
 
 The following versions of STL have been tested:
 
-   <A href="http://www.objectspace.com/">ObjectSpace</A> STL on: AIX,
+   ObjectSpace STL (http://www.objectspace.com) on: AIX,
           DEC, HP, NT and SUN.
 
-   <A href="http://www.stlport.org/">STLPORT</A> STL on: NT
+   STLPORT STL (http://www.stlport.org) on: NT
 
    "Native" STL on: Linux.
 
diff --git a/ReleaseNotes/ReleaseNotes4.1.0.txt b/ReleaseNotes/ReleaseNotes4.1.0.txt
index e3bfbcd761..9e445c5cfa 100644
--- a/ReleaseNotes/ReleaseNotes4.1.0.txt
+++ b/ReleaseNotes/ReleaseNotes4.1.0.txt
@@ -80,12 +80,11 @@ Notes:
 
 This code and some binary libraries are available through our "Source
 Code" Web page:
-- see our <A href="http://wwwinfo.cern.ch/asd/geant4/geant4.html">Geant4
-  Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 Updates to the documentation for Geant4 1.0 are still in preparation and are
 expected to be published within three weeks.
 
@@ -128,8 +127,7 @@ Platforms configured but not tested and not supported:
 
 Geant4 1.0 requires the installation of CLHEP 1.4. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP 1.4</A>.  
+See CLHEP 1.4 (http://cern.ch/clhep/INSTALLATION/clhep.html).
 
 The following platform specific instructions apply:
 
@@ -148,7 +146,7 @@ The following versions of STL have been tested:
    ObjectSpace STL on
           DEC, HP, NT and SUN.
 
-          See <A href="http://www.objectspace.com/">ObjectSpace</A>.
+          See ObjectSpace (http://www.objectspace.com).
 
    "Native" STL on: Linux, HP.
 
diff --git a/ReleaseNotes/ReleaseNotes4.1.1.txt b/ReleaseNotes/ReleaseNotes4.1.1.txt
index cb89859fe5..bb01093c60 100644
--- a/ReleaseNotes/ReleaseNotes4.1.1.txt
+++ b/ReleaseNotes/ReleaseNotes4.1.1.txt
@@ -83,12 +83,11 @@ Notes:
 
 The source code and some binary libraries are available through our "Source
 Code" Web page:
-- see our <A href="http://wwwinfo.cern.ch/asd/geant4/geant4.html">Geant4
-  Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 
 
 Contents
@@ -130,8 +129,7 @@ Platforms configured but not tested and not supported:
 
 Geant4 1.0 requires the installation of CLHEP 1.4. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP 1.4</A>.  
+See CLHEP 1.4 (http://cern.ch/clhep/INSTALLATION/clhep.html).
 
 Be aware, for the platforms listed below, the standard CLHEP installation
 will use ISO-ANSI setup:
@@ -156,7 +154,7 @@ The following versions of STL have been tested:
    ObjectSpace STL on
           DEC, HP, NT and SUN.
 
-          See <A href="http://www.objectspace.com/">ObjectSpace</A>.
+          See ObjectSpace (http://www.objectspace.com).
 
 This is selected at installation/compile time by the environment variable
 G4USE_OSPACE in the case of the latter - see documentation.
diff --git a/ReleaseNotes/ReleaseNotes4.2.0.txt b/ReleaseNotes/ReleaseNotes4.2.0.txt
index 141d9a6718..c7a701ce9f 100644
--- a/ReleaseNotes/ReleaseNotes4.2.0.txt
+++ b/ReleaseNotes/ReleaseNotes4.2.0.txt
@@ -201,11 +201,11 @@ Notes:
 
 The code and some binary libraries are available through our "Source
 Code" Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 Updates to the documentation for Geant4 2.0 are expected to be published as
 usual within three weeks from the release date.
 
@@ -253,8 +253,7 @@ Platforms configured but not tested and not supported:
 
 Geant4 2.0 requires the installation of CLHEP 1.5. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP 1.5</A>.  
+See CLHEP 1.5 (http://cern.ch/clhep/INSTALLATION/clhep.html).
 
 By default, the CLHEP installation scripts will activate ISO/ANSI C++ features
 if the compiler is capable. You need to explicitly disable CLHEP settings in
@@ -269,9 +268,6 @@ Geant4 2.0 coworks with LHC++ 2.0.0 and components included therein:
   ObjectSpace 2.1
   HepODBMS 0.3.1.3 
   CLHEP 1.5.0.0
-
-For more information about LHC++ 2.0.0, see:
-  <A href="http://wwwinfo.cern.ch/asd/lhc++/may2000.html">LHC++ 2.0.0</A>
  
 3. The Standard Template Library
 --------------------------------
@@ -281,7 +277,7 @@ The following versions of STL have been tested:
    ObjectSpace STL on
           DEC, HP and SUN.
 
-          See <A href="http://www.objectspace.com/">ObjectSpace</A>.
+          See ObjectSpace (http://www.objectspace.com).
 
    "Native" STL on: Linux, HP, DEC and SUN.
 
diff --git a/ReleaseNotes/ReleaseNotes4.3.0.txt b/ReleaseNotes/ReleaseNotes4.3.0.txt
index abbea305b7..4f08e1def0 100644
--- a/ReleaseNotes/ReleaseNotes4.3.0.txt
+++ b/ReleaseNotes/ReleaseNotes4.3.0.txt
@@ -337,11 +337,11 @@ Notes:
 
 The code and some binary libraries are available through our "Source
 Code" Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 Updates to the documentation for Geant4 3.0 are expected to be published as
 usual within three weeks from the release date.
 
@@ -385,8 +385,8 @@ Platforms configured but not tested and not supported:
 
 Geant4 3.0 requires the installation of CLHEP. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP</A>. Tests have been performed with CLHEP 1.6.0.0.
+See CLHEP (http://cern.ch/clhep/INSTALLATION/clhep.html).
+Tests have been performed with CLHEP 1.6.0.0.
 
 By default, the CLHEP installation scripts will activate ISO/ANSI C++ features
 if the compiler is capable. You need to explicitly disable CLHEP settings in
@@ -398,8 +398,7 @@ Geant4 3.0 coworks with ANAPHE 3.2.0 and components included therein:
   HepODBMS 0.3.1.4
   CLHEP 1.6.0.0
 
-For more information about ANAPHE 3.2.0, see:
-  <A href="http://wwwinfo.cern.ch/asd/lhc++/release/3.2.0/3.2.0.html">ANAPHE 3.2.0</A>
+For more information about ANAPHE see: http://cern.ch/anaphe
 
 
 3. The Standard Template Library
@@ -410,7 +409,7 @@ The following versions of STL have been tested:
    ObjectSpace STL on
           DEC, HP and SUN (CC 4.2).
 
-          See <A href="http://www.objectspace.com/">ObjectSpace</A>.
+          See ObjectSpace (http://www.objectspace.com).
 
    "Native" STL on: Windows/NT, Linux, HP, DEC and SUN (CC 5.1).
 
@@ -507,7 +506,7 @@ For a complete list of outstanding run-time problems and to submit any
 problem you may find running this version of Geant4, please refer to the
 Geant4 Problem Reporting System, available on the Web at this address:
 
-    http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
+    http://cern.ch/geant4/problemreport
 
 
 7. Compilation Warnings
diff --git a/ReleaseNotes/ReleaseNotes4.3.1.txt b/ReleaseNotes/ReleaseNotes4.3.1.txt
index 0f213e3443..9f9da20cb2 100644
--- a/ReleaseNotes/ReleaseNotes4.3.1.txt
+++ b/ReleaseNotes/ReleaseNotes4.3.1.txt
@@ -292,11 +292,11 @@ Notes:
 
 The code and some binary libraries are available through our "Source Code"
 Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 Updates to the documentation for Geant4 3.1 are expected to be published as
 usual within three weeks from the release date.
 
@@ -340,8 +340,8 @@ Platforms configured but not tested and not supported:
 
 Geant4 3.1 requires the installation of CLHEP. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP</A>. Tests have been performed with CLHEP 1.6.0.0.
+See CLHEP (http://cern.ch/clhep/INSTALLATION/clhep.html).
+Tests have been performed with CLHEP 1.6.0.0.
 
 By default, the CLHEP installation scripts will activate ISO/ANSI C++ features
 if the compiler is capable. You need to explicitly disable CLHEP settings in
@@ -353,8 +353,7 @@ Geant4 3.1 coworks with ANAPHE 3.2.0 and components included therein:
   HepODBMS 0.3.1.4
   CLHEP 1.6.0.0
 
-For more information about ANAPHE 3.2.0, see:
-  <A href="http://wwwinfo.cern.ch/asd/lhc++/release/3.2.0/3.2.0.html">ANAPHE 3.2.0</A>
+For more information about ANAPHE, see:  http://cern.ch/anaphe
 
 
 3. The Standard Template Library
@@ -364,7 +363,7 @@ The following versions of STL have been tested:
 
    ObjectSpace STL on SUN (CC 4.2).
 
-          See <A href="http://www.objectspace.com/">ObjectSpace</A>.
+          See ObjectSpace (http://www.objectspace.com).
 
    "Native" STL on: Windows/NT, Linux, HP, DEC and SUN (CC 5.2).
 
@@ -423,7 +422,7 @@ For a complete list of outstanding run-time problems and to submit any
 problem you may find running this version of Geant4, please refer to the
 Geant4 Problem Reporting System, available on the Web at this address:
 
-    http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
+    http://cern.ch/geant4/problemreport
 
 
 7. Compilation Warnings
diff --git a/ReleaseNotes/ReleaseNotes4.3.2.txt b/ReleaseNotes/ReleaseNotes4.3.2.txt
index 62db2bb461..7083662f6d 100644
--- a/ReleaseNotes/ReleaseNotes4.3.2.txt
+++ b/ReleaseNotes/ReleaseNotes4.3.2.txt
@@ -251,11 +251,11 @@ Notes:
 
 The code and some binary libraries are available through our "Source Code"
 Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 Updates to the documentation for Geant4 3.2 are expected to be published as
 usual within three weeks from the release date.
 
@@ -299,8 +299,8 @@ Platforms configured but not tested and not supported:
 
 Geant4 3.2 requires the installation of CLHEP. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP</A>. Tests have been performed with CLHEP 1.6.0.0.
+See CLHEP (http://cern.ch/clhep/INSTALLATION/clhep.html).
+Tests have been performed with CLHEP 1.6.0.0.
 
 By default, the CLHEP installation scripts will activate ISO/ANSI C++ features
 if the compiler is capable. You need to explicitly disable CLHEP settings in
@@ -312,8 +312,7 @@ Geant4 3.2 coworks with ANAPHE 3.6.0 and components included therein:
   HepODBMS 0.3.2.9
   CLHEP 1.6.0.0
 
-For more information about ANAPHE 3.6.0, see:
-  <A href="http://cern.ch/anaphe">ANAPHE</A>
+For more information about ANAPHE, see:  http://cern.ch/anaphe
 
 
 3. The Standard Template Library
@@ -323,7 +322,7 @@ The following versions of STL have been tested:
 
    ObjectSpace STL on SUN (CC 4.2).
 
-          See <A href="http://www.objectspace.com/">ObjectSpace</A>.
+          See ObjectSpace (http://www.objectspace.com).
 
    "Native" STL on: Windows/NT, Linux, HP, DEC and SUN (CC 5.2).
 
@@ -419,7 +418,7 @@ For a complete list of outstanding run-time problems and to submit any
 problem you may find running this version of Geant4, please refer to the
 Geant4 Problem Reporting System, available on the Web at this address:
 
-    http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
+    http://cern.ch/geant4/problemreport
 
 
 7. Compilation Warnings
diff --git a/ReleaseNotes/ReleaseNotes4.4.0.txt b/ReleaseNotes/ReleaseNotes4.4.0.txt
index cc10ffdd74..c22acbc3bb 100644
--- a/ReleaseNotes/ReleaseNotes4.4.0.txt
+++ b/ReleaseNotes/ReleaseNotes4.4.0.txt
@@ -468,11 +468,11 @@ to the related History files):
 
 The code and some binary libraries are available through our "Source Code"
 Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 
 
 Contents
@@ -514,8 +514,8 @@ Platforms configured but not tested and not supported:
 
 Geant4 4.0 requires the installation of CLHEP. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP</A>. Tests have been performed with CLHEP 1.7.0.0.
+See CLHEP (http://cern.ch/clhep/INSTALLATION/clhep.html).
+Tests have been performed with CLHEP 1.7.0.0.
 
 By default, the CLHEP installation scripts will activate ISO/ANSI C++ features
 if the compiler is capable. You need to explicitly disable CLHEP settings in
@@ -526,8 +526,7 @@ Geant4 4.0 coworks with ANAPHE 3.6.5 and components included therein:
   HepODBMS 0.3.3.1
   CLHEP 1.7.0.0
 
-For more information about ANAPHE 3.6.5, see:
-  <A href="http://cern.ch/anaphe">ANAPHE</A>
+For more information about ANAPHE, see:  http://cern.ch/anaphe
 
 
 3. The Standard Template Library
@@ -626,7 +625,7 @@ For a complete list of outstanding run-time problems and to submit any
 problem you may find running this version of Geant4, please refer to the
 Geant4 Problem Reporting System, available on the Web at this address:
 
-    http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
+    http://cern.ch/geant4/problemreport
 
 
 7. Compilation Warnings
diff --git a/ReleaseNotes/ReleaseNotes4.4.1.txt b/ReleaseNotes/ReleaseNotes4.4.1.txt
index c04c3beb6f..7e1919e419 100644
--- a/ReleaseNotes/ReleaseNotes4.4.1.txt
+++ b/ReleaseNotes/ReleaseNotes4.4.1.txt
@@ -247,11 +247,11 @@ to the related History files):
 
 The code and some binary libraries are available through our "Source Code"
 Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 
 
 Contents
@@ -292,8 +292,8 @@ Platforms configured but not tested and not supported:
 
 Geant4 4.1 requires the installation of CLHEP. 
 
-See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
-CLHEP</A>. Tests have been performed with CLHEP 1.7.5.0. However, first
+See CLHEP (http://cern.ch/clhep/INSTALLATION/clhep.html).
+Tests have been performed with CLHEP 1.7.5.0. However, first
 level porting has also been verified on CLHEP 1.8.0.0.
 
 By default, the CLHEP installation scripts will activate ISO/ANSI C++ features
@@ -306,14 +306,13 @@ These include:
     Objectivity 6.1.3
     HepODBMS 0.3.3.1
     CLHEP 1.7.5.0
-  (see: <A href="http://cern.ch/anaphe">ANAPHE</A>)
+  (see: http://cern.ch/anaphe)
 - JAS 2.2.5 
-  (see: <A href="http://jas.freehep.org">JAS</A>)
+  (see: http://jas.freehep.org)
 - Open Scientist v8
-  (see: <A href="http://www.lal.in2p3.fr/OpenScientist/v8/welcome.html">Open Scientist</A>)
+  (see: http://www.lal.in2p3.fr/OpenScientist/v8/welcome.html)
 
-AIDA headers can be downloaded from:
-  <A href="http://aida.freehep.org">AIDA</A>
+AIDA headers can be downloaded from:  http://aida.freehep.org
 
 
 3. The Standard Template Library
@@ -362,7 +361,7 @@ For a complete list of outstanding run-time problems and to submit any
 problem you may find running this version of Geant4, please refer to the
 Geant4 Problem Reporting System, available on the Web at this address:
 
-    http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
+    http://cern.ch/geant4/problemreport
 
 
 7. Compilation Warnings
diff --git a/ReleaseNotes/ReleaseNotes4.5.0.txt b/ReleaseNotes/ReleaseNotes4.5.0.txt
index ccdebe9974..694fd7a8a3 100644
--- a/ReleaseNotes/ReleaseNotes4.5.0.txt
+++ b/ReleaseNotes/ReleaseNotes4.5.0.txt
@@ -497,11 +497,11 @@ to the related History files):
 
 The code and some binary libraries are available through our "Source Code"
 Web page:
-- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
+- see our Geant4 Home Page (http://cern.ch/geant4).
 
-Please refer to <A
-href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
-User Documentation</A> for further information about using Geant4.
+Please refer to the Geant4 User Documentation
+(http://cern.ch/geant4/G4UsersDocuments/Overview/html)
+for further information about using Geant4.
 
 
 Contents
@@ -541,20 +541,19 @@ Platforms configured but not tested and not supported:
 
 Geant4 5.0 requires the installation of CLHEP. 
 
-See <A href="http://cern.ch/clhep/INSTALLATION/clhep.html">
-CLHEP</A>. Tests have been performed with CLHEP 1.8.0.0.
+See CLHEP (http://cern.ch/clhep/INSTALLATION/clhep.html).
+Tests have been performed with CLHEP 1.8.0.0.
 
 Geant4 5.0 examples with histogramming cowork with AIDA 3.0 implementations.
 These include:
 - ANAPHE and components included therein
-  (see: <A href="http://cern.ch/anaphe">ANAPHE</A>)
+  (see: http://cern.ch/anaphe)
 - JAS (Java Analysis Studio)
-  (see: <A href="http://jas.freehep.org">JAS</A>)
+  (see: http://jas.freehep.org)
 - Open Scientist
-  (see: <A href="http://www.lal.in2p3.fr/OpenScientist">Open Scientist</A>)
+  (see: http://www.lal.in2p3.fr/OpenScientist)
 
-AIDA headers can be downloaded from:
-  <A href="http://aida.freehep.org">AIDA</A>
+AIDA headers can be downloaded from:  http://aida.freehep.org
 
 
 3. The Standard Template Library
@@ -597,7 +596,7 @@ For a complete list of outstanding run-time problems and to submit any
 problem you may find running this version of Geant4, please refer to the
 Geant4 Problem Reporting System, available on the Web at this address:
 
-    http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
+    http://cern.ch/geant4/problemreport
 
 
 6. Compilation Warnings
diff --git a/ReleaseNotes/ReleaseNotes4.5.1.txt b/ReleaseNotes/ReleaseNotes4.5.1.txt
index bb4543fe5b..89922e2e60 100644
--- a/ReleaseNotes/ReleaseNotes4.5.1.txt
+++ b/ReleaseNotes/ReleaseNotes4.5.1.txt
@@ -51,7 +51,7 @@ Platforms configured but not tested and not supported:
 -----------------
 
 Geant4 5.1 requires the installation of CLHEP
-(href="http://cern.ch/clhep/INSTALLATION/clhep.html).
+(http://cern.ch/clhep/INSTALLATION/clhep.html).
 Tests have been performed with CLHEP 1.8.0.0.
 
 Geant4 5.1 examples with histogramming cowork with AIDA 3.0 implementations.
@@ -107,7 +107,7 @@ For a complete list of outstanding run-time problems and to submit any
 problem you may find running this version of Geant4, please refer to the
 Geant4 Problem Reporting System, available on the Web at this address:
 
-    http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
+    http://cern.ch/geant4/problemreport
 
 
 6. Compilation Warnings
diff --git a/examples/extended/electromagnetic/TestEm1/History b/examples/extended/electromagnetic/TestEm1/History
index fe4f113aad..8a1e37b023 100644
--- a/examples/extended/electromagnetic/TestEm1/History
+++ b/examples/extended/electromagnetic/TestEm1/History
@@ -1,4 +1,4 @@
-$Id: History,v 1.28 2003/03/27 11:16:16 maire Exp $
+$Id: History,v 1.29 2003/05/09 09:15:56 vnivanch Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -14,7 +14,10 @@ track of all tags.
      ----------------------------------------------------------
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
-     
+
+09-05-03 V.Ivant (testem1-V05-01-00)
+- change updated command
+
 27-03-03 mma (testem1-V05-00-05)
 - modular physics list
 
@@ -22,7 +25,7 @@ track of all tags.
 
 11-03-03 V.Ivant (testem1-V05-00-03)
 - Remove all old interfaces to cuts
-- Add definition of mean excitation energy for water 
+- Add definition of mean excitation energy for water
 
 06-03-03 mma (testem1-V05-00-02)
 - PhysicsList::SetCuts : suppress cutForProton
diff --git a/examples/extended/electromagnetic/TestEm1/TestEm1.in b/examples/extended/electromagnetic/TestEm1/TestEm1.in
index eff706ab8c..7d6e0a2022 100644
--- a/examples/extended/electromagnetic/TestEm1/TestEm1.in
+++ b/examples/extended/electromagnetic/TestEm1/TestEm1.in
@@ -1,4 +1,4 @@
-# $Id: TestEm1.in,v 1.9 2003/03/26 17:49:54 vnivanch Exp $
+# $Id: TestEm1.in,v 1.11 2003/04/11 14:31:15 vnivanch Exp $
 #
 # Macro file for "TestEm1.cc"
 # (can be run in batch, without graphic)
@@ -10,10 +10,11 @@
 #
 /testem/phys/setGCut 2.20 mm
 /testem/phys/setECut 6.05 mum
+/testem/phys/setPCut 6.05 mum
 #
 /run/initialize
 #
-/process/eLoss/StepFunction 0.183 170 micrometer
+/process/eLoss/StepFunction 0.183 1.70 micrometer
 #
 /run/verbose 2
 #
diff --git a/examples/extended/electromagnetic/TestEm1/src/Em1DetectorConstruction.cc b/examples/extended/electromagnetic/TestEm1/src/Em1DetectorConstruction.cc
index 521f9085f0..b7bd524e41 100644
--- a/examples/extended/electromagnetic/TestEm1/src/Em1DetectorConstruction.cc
+++ b/examples/extended/electromagnetic/TestEm1/src/Em1DetectorConstruction.cc
@@ -22,8 +22,8 @@
 //
 
 //
-// $Id: Em1DetectorConstruction.cc,v 1.13 2003/03/27 11:16:20 maire Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em1DetectorConstruction.cc,v 1.14 2003/05/09 09:15:57 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -251,13 +251,7 @@ void Em1DetectorConstruction::SetMagField(G4double fieldValue)
 
 void Em1DetectorConstruction::UpdateGeometry()
 {
-  G4bool first = true;
-  if (pBox) first = false;
-  G4VPhysicalVolume* v = ConstructVolumes();
-  G4RunManager* rm = G4RunManager::GetRunManager();
-  rm->GeometryHasBeenModified();
-  rm->DefineWorldVolume(v);
-  if (!first) rm->ResetNavigator();
+  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/examples/extended/electromagnetic/TestEm1/src/Em1SteppingAction.cc b/examples/extended/electromagnetic/TestEm1/src/Em1SteppingAction.cc
index 7e6d4e6180..8277d30b7d 100644
--- a/examples/extended/electromagnetic/TestEm1/src/Em1SteppingAction.cc
+++ b/examples/extended/electromagnetic/TestEm1/src/Em1SteppingAction.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: Em1SteppingAction.cc,v 1.8 2002/05/31 17:10:35 maire Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em1SteppingAction.cc,v 1.9 2003/05/09 09:15:57 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -53,18 +53,18 @@ Em1SteppingAction::~Em1SteppingAction()
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 void Em1SteppingAction::UserSteppingAction(const G4Step* aStep)
-{ 
- G4double EdepStep = aStep->GetTotalEnergyDeposit();
- if (EdepStep > 0.) eventAction->addEdep(EdepStep);
- 
- const G4VProcess* process = aStep->GetPostStepPoint()->GetProcessDefinedStep();
- if (process) runAction->CountProcesses(process->GetProcessName());
- 
- G4double charge  = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
- G4double steplen = aStep->GetStepLength();
- 
-#ifndef G4NOHIST 
- if (charge != 0.) runAction->GetHisto(2)->fill(steplen);
+{
+  G4double EdepStep = aStep->GetTotalEnergyDeposit();
+  if (EdepStep > 0.) eventAction->addEdep(EdepStep);
+
+  const G4VProcess* process = aStep->GetPostStepPoint()->GetProcessDefinedStep();
+  if (process) runAction->CountProcesses(process->GetProcessName());
+
+
+#ifndef G4NOHIST
+  G4double charge  = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
+  G4double steplen = aStep->GetStepLength();
+  if (charge != 0.) runAction->GetHisto(2)->fill(steplen);
 #endif                    
 }
 
diff --git a/examples/extended/electromagnetic/TestEm1/src/Em1TrackingAction.cc b/examples/extended/electromagnetic/TestEm1/src/Em1TrackingAction.cc
index 5ec9cdcd2e..c66fd2004f 100644
--- a/examples/extended/electromagnetic/TestEm1/src/Em1TrackingAction.cc
+++ b/examples/extended/electromagnetic/TestEm1/src/Em1TrackingAction.cc
@@ -22,8 +22,8 @@
 //
 
 //
-// $Id: Em1TrackingAction.cc,v 1.8 2002/05/31 17:10:35 maire Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em1TrackingAction.cc,v 1.9 2003/05/09 09:15:57 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -53,14 +53,19 @@ void Em1TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
   //count nb of steps of this track
   
   G4int   nbSteps = aTrack->GetCurrentStepNumber();
-  G4double Trleng = aTrack->GetTrackLength();
+
+  if (aTrack->GetDefinition()->GetPDGCharge() == 0.) {
+     runAction->CountTraks0(1); 
+     runAction->CountSteps0(nbSteps);
   
-  if (aTrack->GetDefinition()->GetPDGCharge() == 0.)
-       {runAction->CountTraks0(1); runAction->CountSteps0(nbSteps);}
-  else {runAction->CountTraks1(1); runAction->CountSteps1(nbSteps);
-#ifndef G4NOHIST  
-        runAction->GetHisto(0)->fill(Trleng);
-        runAction->GetHisto(1)->fill((float)nbSteps);
+  } else {
+     runAction->CountTraks1(1); 
+     runAction->CountSteps1(nbSteps);
+
+#ifndef G4NOHIST
+     G4double Trleng = aTrack->GetTrackLength();
+     runAction->GetHisto(0)->fill(Trleng);
+     runAction->GetHisto(1)->fill((float)nbSteps);
 #endif	
   }    
 }
diff --git a/examples/extended/electromagnetic/TestEm2/History b/examples/extended/electromagnetic/TestEm2/History
index 0cab86d469..2070631ea2 100644
--- a/examples/extended/electromagnetic/TestEm2/History
+++ b/examples/extended/electromagnetic/TestEm2/History
@@ -1,4 +1,4 @@
-$Id: History,v 1.28 2003/03/26 16:23:15 maire Exp $
+$Id: History,v 1.29 2003/05/09 08:48:33 vnivanch Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -14,7 +14,11 @@ track of all tags.
      ----------------------------------------------------------
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
-     
+
+09-05-03 V.Ivanchenko (testem2-V05-01-00)
+- Add run05.mac - several runs with different setup
+- Change update command
+
 26-03-03 mma (testem2-V05-00-03)
 - G4PVPlacement and G4PVReplica in logical mother
 
diff --git a/examples/extended/electromagnetic/TestEm2/include/Em2DetectorConstruction.hh b/examples/extended/electromagnetic/TestEm2/include/Em2DetectorConstruction.hh
index 77e0dbe5b2..ef08cf0db2 100644
--- a/examples/extended/electromagnetic/TestEm2/include/Em2DetectorConstruction.hh
+++ b/examples/extended/electromagnetic/TestEm2/include/Em2DetectorConstruction.hh
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: Em2DetectorConstruction.hh,v 1.6 2003/02/14 14:21:28 vnivanch Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em2DetectorConstruction.hh,v 1.7 2003/05/09 08:46:57 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -48,63 +48,62 @@ class Em2DetectorMessenger;
 class Em2DetectorConstruction : public G4VUserDetectorConstruction
 {
   public:
-  
+
     Em2DetectorConstruction();
    ~Em2DetectorConstruction();
 
   public:
-     
+
      void SetMaterial(const G4String&);
      void SetLBining (G4ThreeVector);
-     void SetRBining (G4ThreeVector);      
+     void SetRBining (G4ThreeVector);
      void SetMagField(G4double);
-     
+
      G4VPhysicalVolume* Construct();
 
      void UpdateGeometry();
-     
+
   public:
-  
-     const 
+
+     const
      G4VPhysicalVolume* GetEcal() {return physiEcal;};
      G4Material*    GetMaterial() {return myMaterial;};
 
-     G4int    GetnLtot()      {return nLtot;};
-     G4int    GetnRtot()      {return nRtot;};
-     G4double GetdLradl()     {return dLradl;}; 
-     G4double GetdRradl()     {return dRradl;};
-     G4double GetfullLength() {return EcalLength;};
-     G4double GetfullRadius() {return EcalRadius;};   
-                 
+     G4int    GetnLtot()          {return nLtot;};
+     G4int    GetnRtot()          {return nRtot;};
+     G4double GetdLradl()         {return dLradl;};
+     G4double GetdRradl()         {return dRradl;};
+     G4double GetfullLength()     {return EcalLength;};
+     G4double GetfullRadius()     {return EcalRadius;};
+
   private:
-     
+
+     void DefineMaterials();
+     G4VPhysicalVolume* ConstructVolumes();
+
      G4int    nLtot,  nRtot;          // nb of bins: longitudinal and radial
      G4double dLradl, dRradl;         // bin thickness (in radl unit)
-     
+
      G4Material* myMaterial;          //pointer to the material
      G4UniformMagField* magField;     //pointer to the mag field
-                                     
+
      G4double EcalLength;             //full length of the Calorimeter
      G4double EcalRadius;             //radius  of the Calorimeter
-       
-     G4Tubs*            solidEcal;    //pointer to the solid calorimeter 
+
+     G4Tubs*            solidEcal;    //pointer to the solid calorimeter
      G4LogicalVolume*   logicEcal;    //pointer to the logical calorimeter
      G4VPhysicalVolume* physiEcal;    //pointer to the physical calorimeter
-          
-     G4Tubs*            solidSlice;   //pointer to the solid  L-slice 
+
+     G4Tubs*            solidSlice;   //pointer to the solid  L-slice
      G4LogicalVolume*   logicSlice;   //pointer to the logical L-slide
      G4VPhysicalVolume* physiSlice;   //pointer to the physical L-slide
-     
-     G4Tubs*            solidRing;    //pointer to the solid  R-slice 
+
+     G4Tubs*            solidRing;    //pointer to the solid  R-slice
      G4LogicalVolume*   logicRing;    //pointer to the logical R-slide
      G4VPhysicalVolume* physiRing;    //pointer to the physical R-slide
-     
-     Em2DetectorMessenger* detectorMessenger;  //pointer to the Messenger   
-      
-  private:
-    
-     void DefineMaterials();
-     G4VPhysicalVolume* ConstructVolumes();     
+
+     Em2DetectorMessenger* detectorMessenger;  //pointer to the Messenger
+
 };
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/examples/extended/electromagnetic/TestEm2/run05.mac b/examples/extended/electromagnetic/TestEm2/run05.mac
new file mode 100644
index 0000000000..49cac7bccb
--- /dev/null
+++ b/examples/extended/electromagnetic/TestEm2/run05.mac
@@ -0,0 +1,38 @@
+#
+# Macro file for "TestEm2.cc"
+# (can be run in batch, without graphic)
+#
+# PbWO4 L = 20 radl  R = 5 radl; electron 5 GeV
+#
+/control/verbose 2
+#
+/testem/phys/addPhysics  model
+#/testem/phys/addPhysics  standard
+/testem/phys/setCuts 1 mm
+#
+/run/initialize
+#
+/gun/particle e-
+/gun/energy 100 MeV
+/run/beamOn 10
+#
+/run/particle/applyCuts
+/run/beamOn 10
+/run/dumpCouples
+#
+#
+/testem/det/setMat  Water
+/testem/det/setLbin 9 1.11
+/testem/det/setRbin 6 0.111
+/testem/det/update
+/run/initialize
+/run/beamOn 10
+/run/dumpCouples
+#
+/testem/det/setMat  lAr
+/testem/det/update
+/run/initialize
+/run/beamOn 10
+/run/dumpCouples
+#
+
diff --git a/examples/extended/electromagnetic/TestEm2/src/Em2DetectorConstruction.cc b/examples/extended/electromagnetic/TestEm2/src/Em2DetectorConstruction.cc
index 502eef8f68..16604a416f 100644
--- a/examples/extended/electromagnetic/TestEm2/src/Em2DetectorConstruction.cc
+++ b/examples/extended/electromagnetic/TestEm2/src/Em2DetectorConstruction.cc
@@ -21,8 +21,6 @@
 // ********************************************************************
 //
 //
-// $Id: Em2DetectorConstruction.cc,v 1.13 2003/03/26 16:23:17 maire Exp $
-// GEANT4 tag $Name: geant4-05-01 $
 //
 // 
 
@@ -57,7 +55,7 @@ Em2DetectorConstruction::Em2DetectorConstruction()
  EcalLength(0.),EcalRadius(0.)    ,
  solidEcal(0) ,logicEcal(0) ,physiEcal(0),
  solidSlice(0),logicSlice(0),physiSlice(0),
- solidRing(0) ,logicRing(0) ,physiRing(0) 
+ solidRing(0) ,logicRing(0) ,physiRing(0)
 {
   detectorMessenger = new Em2DetectorMessenger(this);
   DefineMaterials();
@@ -79,7 +77,7 @@ G4VPhysicalVolume* Em2DetectorConstruction::Construct()
 
 void Em2DetectorConstruction::DefineMaterials()
 {
-  G4String name, symbol; 
+  G4String name, symbol;
   G4double a, z, density;
   G4int ncomponents, natoms;
   G4double fractionmass;
@@ -87,40 +85,40 @@ void Em2DetectorConstruction::DefineMaterials()
   //
   // define few Elements
   //
-  
+
     a = 1.01*g/mole;
     G4Element* H = new G4Element(name="Hydrogen", symbol="H", z=1., a);
-      
+
     a = 14.01*g/mole;
     G4Element* N = new G4Element(name="Nitrogen", symbol="N", z=7., a);
-    
+
     a = 16.00*g/mole;
     G4Element* O = new G4Element(name="Oxygen"  , symbol="O", z=8., a);
-    
+
     a = 72.59*g/mole;
     G4Element* Ge = new G4Element(name="Germanium", symbol="Ge",z=32., a);
-         
+
     a = 183.84*g/mole;
     G4Element* W = new G4Element(name="Tungsten"  , symbol="W", z=74., a);
-    
+
     a = 207.19*g/mole;
     G4Element* Pb = new G4Element(name="Lead"     , symbol="Pb",z=82., a);
-    
+
     a = 208.98*g/mole;
     G4Element* Bi = new G4Element(name="Bismuth"  , symbol="Bi",z=83., a);
-      
-  //  
+
+  //
   // define materials
   //
 
     G4Material* ma = 0;
-       
+
   //Air
     density = 1.29*mg/cm3;
     G4Material* Air = new G4Material(name="Air", density, ncomponents=2);
     Air->AddElement(N, fractionmass=0.7);
     Air->AddElement(O, fractionmass=0.3);
-    
+
   //H2O
     density = 1.00*g/cm3;
     G4Material* H2O = new G4Material(name="Water", density, ncomponents=2);
@@ -133,41 +131,41 @@ void Em2DetectorConstruction::DefineMaterials()
     a = 39.95*g/mole;
     density = 1.390*g/cm3;
     ma = new G4Material(name="lAr", z=18., a, density);
-        
+
   //Al
     a = 26.98*g/mole;
     density = 2.7*g/cm3;
     ma = new G4Material(name="Al", z=13., a, density);
-        
+
   //Fe
     a = 55.85*g/mole;
     density = 7.87*g/cm3;
     ma = new G4Material(name="Fe", z=26., a, density);
-    
+
   //BGO
     density = 7.10*g/cm3;
     G4Material* BGO = new G4Material(name="BGO", density, ncomponents=3);
     BGO->AddElement(O , natoms=12);
     BGO->AddElement(Ge, natoms= 3);
-    BGO->AddElement(Bi, natoms= 4); 
-      
+    BGO->AddElement(Bi, natoms= 4);
+
   //PbWO4
     density = 8.28*g/cm3;
     G4Material* PbWO = new G4Material(name="PbWO4", density, ncomponents=3);
     PbWO->AddElement(O , natoms=4);
     PbWO->AddElement(Pb, natoms=1);
     PbWO->AddElement(W , natoms=1);
-    
+
   //Tungsten
     density = 19.30*g/cm3;
     G4Material* w = new G4Material(name="Tungsten", density, ncomponents=1);
     w->AddElement(W, fractionmass=1.0);
-         
+
   //Pb
     density = 11.35*g/cm3;
     G4Material* pb = new G4Material(name="Lead", density, ncomponents=1);
     pb->AddElement(Pb, fractionmass=1.0);
-     
+
     G4cout << *(G4Material::GetMaterialTable()) << G4endl;
 
   //choose material
@@ -175,15 +173,15 @@ void Em2DetectorConstruction::DefineMaterials()
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-  
+
 G4VPhysicalVolume* Em2DetectorConstruction::ConstructVolumes()
 {
   G4double Radl = myMaterial->GetRadlen();
 
-  G4double dL = dLradl*Radl, dR = dRradl*Radl;  
+  G4double dL = dLradl*Radl, dR = dRradl*Radl;
   EcalLength = nLtot*dL; EcalRadius = nRtot*dR;
-  
-  //   
+
+  //
   // Ecal
   //
   if(solidEcal) delete solidEcal;
@@ -193,7 +191,7 @@ G4VPhysicalVolume* Em2DetectorConstruction::ConstructVolumes()
   logicEcal = new G4LogicalVolume( solidEcal,myMaterial,"Ecal",0,0,0);
   physiEcal = new G4PVPlacement(0,G4ThreeVector(),
                                 logicEcal,"Ecal",0,false,0);
-				
+
   // Ring
   //
   for (G4int i=0; i<nRtot; i++)
@@ -202,7 +200,7 @@ G4VPhysicalVolume* Em2DetectorConstruction::ConstructVolumes()
       logicRing = new G4LogicalVolume(solidRing,myMaterial,"Ring",0,0,0);
       physiRing = new G4PVPlacement(0,G4ThreeVector(),logicRing,"Ring",
                                     logicEcal,false,i);
-				                   				
+
       // Slice
       solidSlice = new G4Tubs("Slice",i*dR,(i+1)*dR,0.5*dL,0.,360*deg);
       logicSlice = new G4LogicalVolume(solidSlice,myMaterial,"Slice",0,0,0);
@@ -213,17 +211,17 @@ G4VPhysicalVolume* Em2DetectorConstruction::ConstructVolumes()
       else
         physiSlice = new G4PVPlacement(0,G4ThreeVector(),logicSlice,"Slice",
                                     logicRing,false,0);
-     }				                   
+     }
 
 
-  G4cout << "Absorber is " << G4BestUnit(EcalLength,"Length") 
-       << " of " << myMaterial->GetName() << G4endl; 
+  G4cout << "Absorber is " << G4BestUnit(EcalLength,"Length")
+       << " of " << myMaterial->GetName() << G4endl;
 
 
   G4VisAttributes* VisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
   VisAtt->SetVisibility(true);
   logicEcal->SetVisAttributes(VisAtt);
-  
+
   //
   //always return the physical World
   //
@@ -234,27 +232,29 @@ G4VPhysicalVolume* Em2DetectorConstruction::ConstructVolumes()
 
 void Em2DetectorConstruction::SetMaterial(const G4String& materialChoice)
 {
-  // search the material by its name   
-  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);     
+  // search the material by its name
+  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
   if (pttoMaterial)
      {
        myMaterial = pttoMaterial;
-       if(logicEcal) logicEcal->SetMaterial(myMaterial); 
-     }             
+       if(logicEcal) logicEcal->SetMaterial(myMaterial);
+     }
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 void Em2DetectorConstruction::SetLBining(G4ThreeVector Value)
 {
-  nLtot = (G4int)Value(0); dLradl = Value(1);
+  nLtot = (G4int)Value(0);
+  dLradl = Value(1);
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 void Em2DetectorConstruction::SetRBining(G4ThreeVector Value)
 {
-  nRtot = (G4int)Value(0); dRradl = Value(1);
+  nRtot = (G4int)Value(0);
+  dRradl = Value(1);
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -281,13 +281,7 @@ void Em2DetectorConstruction::SetMagField(G4double fieldValue)
 
 void Em2DetectorConstruction::UpdateGeometry()
 {
-  G4bool first = true;
-  if (physiEcal) first = false;
-  G4VPhysicalVolume* v = ConstructVolumes();
-  G4RunManager* rm = G4RunManager::GetRunManager();
-  rm->GeometryHasBeenModified();
-  rm->DefineWorldVolume(v);
-  if (!first) rm->ResetNavigator();
+  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/examples/extended/electromagnetic/TestEm2/src/Em2PhysListEmModel.cc b/examples/extended/electromagnetic/TestEm2/src/Em2PhysListEmModel.cc
index 36b7dd3e90..129cdce408 100644
--- a/examples/extended/electromagnetic/TestEm2/src/Em2PhysListEmModel.cc
+++ b/examples/extended/electromagnetic/TestEm2/src/Em2PhysListEmModel.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: Em2PhysListEmModel.cc,v 1.3 2003/02/14 14:21:28 vnivanch Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em2PhysListEmModel.cc,v 1.4 2003/04/11 14:31:15 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -70,41 +70,41 @@ void Em2PhysListEmModel::ConstructProcess()
     G4ParticleDefinition* particle = theParticleIterator->value();
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
-     
+
     if (particleName == "gamma") {
-      // gamma         
+      // gamma
       pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
       pmanager->AddDiscreteProcess(new G4ComptonScattering);
       pmanager->AddDiscreteProcess(new G4GammaConversion);
-      
+
     } else if (particleName == "e-") {
       //electron
       pmanager->AddProcess(new G4MultipleScatteringSTD, -1, 1,1);
       pmanager->AddProcess(new G4eIonisationSTD,        -1, 2,2);
       pmanager->AddProcess(new G4eBremsstrahlungSTD,    -1,-1,3);
-	    
+
     } else if (particleName == "e+") {
       //positron
       pmanager->AddProcess(new G4MultipleScatteringSTD, -1, 1,1);
       pmanager->AddProcess(new G4eIonisationSTD,        -1, 2,2);
       pmanager->AddProcess(new G4eBremsstrahlungSTD,    -1,-1,3);
       pmanager->AddProcess(new G4eplusAnnihilation,      0,-1,4);
-      
-    } else if( particleName == "mu+" || 
+
+    } else if( particleName == "mu+" ||
                particleName == "mu-"    ) {
-      //muon  
+      //muon
       pmanager->AddProcess(new G4MultipleScatteringSTD,-1, 1,1);
       pmanager->AddProcess(new G4MuIonisationSTD,      -1, 2,2);
       pmanager->AddProcess(new G4MuBremsstrahlungSTD,  -1,-1,3);
-      pmanager->AddProcess(new G4MuPairProductionSTD,  -1,-1,4);       
-     
+      pmanager->AddProcess(new G4MuPairProductionSTD,  -1,-1,4);
+
     } else if( particleName == "GenericIon" ) {
- 
+
       pmanager->AddProcess(new G4MultipleScatteringSTD,-1,1,1);
       pmanager->AddProcess(new G4ionIonisation,      -1,2,2);
 
     } else if ((!particle->IsShortLived()) &&
-	       (particle->GetPDGCharge() != 0.0) && 
+	       (particle->GetPDGCharge() != 0.0) &&
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
       pmanager->AddProcess(new G4MultipleScatteringSTD,-1,1,1);
diff --git a/examples/extended/electromagnetic/TestEm2/vis.mac b/examples/extended/electromagnetic/TestEm2/vis.mac
index 207882a871..94da2908f6 100644
--- a/examples/extended/electromagnetic/TestEm2/vis.mac
+++ b/examples/extended/electromagnetic/TestEm2/vis.mac
@@ -7,7 +7,6 @@
 /control/verbose 2
 /run/verbose 2
 #
-/testem/phys/addPhysics standard
 /run/initialize
 #
 # Create empty scene ("world" is default)
diff --git a/examples/extended/electromagnetic/TestEm3/History b/examples/extended/electromagnetic/TestEm3/History
index 3c9bf3d47e..0ab2feaa20 100644
--- a/examples/extended/electromagnetic/TestEm3/History
+++ b/examples/extended/electromagnetic/TestEm3/History
@@ -1,4 +1,4 @@
-$Id: History,v 1.26 2003/03/28 15:16:13 maire Exp $
+$Id: History,v 1.28 2003/05/09 09:28:49 vnivanch Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -14,6 +14,13 @@ track of all tags.
      ----------------------------------------------------------
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
+
+09-05-03 V.Ivanchenko (testem3-V05-01-00)
+- Change update command
+
+10-04-03 mma (testem3-V05-00-05)
+- define material BGO
+- RunMessenger: enlarge allowed range for histos.
      
 28-03-03 mma (testem3-V05-00-04)
 - G4PVPlacement and G4PVReplica in logical mother
diff --git a/examples/extended/electromagnetic/TestEm3/run09.mac b/examples/extended/electromagnetic/TestEm3/run09.mac
new file mode 100644
index 0000000000..3dc0bed9e5
--- /dev/null
+++ b/examples/extended/electromagnetic/TestEm3/run09.mac
@@ -0,0 +1,26 @@
+# $Id: run09.mac,v 1.1 2003/04/11 14:30:33 vnivanch Exp $
+#
+# Macro file for "TestEm2.cc" 
+# (can be run in batch, without graphic)
+#
+# Gold; electron 1 MeV
+#
+/control/verbose 2
+#
+/testem/phys/addPhysics  model
+#/testem/phys/addPhysics  standard
+/testem/phys/setCuts 0.01 mm
+/testem/det/setAbsor 1 Water  1.0 mm
+/testem/det/setAbsor 0 Gold   10.0 mm
+#
+/run/initialize
+/process/eLoss/integral false
+#
+/run/verbose 1
+/tracking/verbose 0
+#
+/gun/particle e-
+/gun/energy 1 MeV
+/run/beamOn 1000
+
+
diff --git a/examples/extended/electromagnetic/TestEm3/src/Em3DetectorConstruction.cc b/examples/extended/electromagnetic/TestEm3/src/Em3DetectorConstruction.cc
index e45a6a1ef3..580276fbe8 100644
--- a/examples/extended/electromagnetic/TestEm3/src/Em3DetectorConstruction.cc
+++ b/examples/extended/electromagnetic/TestEm3/src/Em3DetectorConstruction.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: Em3DetectorConstruction.cc,v 1.12 2003/03/28 15:16:15 maire Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em3DetectorConstruction.cc,v 1.15 2003/05/09 09:28:01 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 //
 
@@ -85,7 +85,7 @@ Em3DetectorConstruction::Em3DetectorConstruction()
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 Em3DetectorConstruction::~Em3DetectorConstruction()
-{ 
+{
   delete userLimits;
   delete detectorMessenger;
 }
@@ -131,12 +131,18 @@ void Em3DetectorConstruction::DefineMaterials()
   a = 28.09*g/mole;
   G4Element* Si = new G4Element(name="Silicon",symbol="Si" , z= 14., a);
 
+  a = 72.59*g/mole;
+  G4Element* Ge = new G4Element(name="Germanium", symbol="Ge",z=32., a);
+
   a = 126.90*g/mole;
   G4Element* I  = new G4Element(name="Iodine"  ,symbol="I" , z= 53., a);
 
   a = 132.90*g/mole;
   G4Element* Cs = new G4Element(name="Cesium" ,symbol="Cs" , z= 55., a);
 
+  a = 208.98*g/mole;
+  G4Element* Bi = new G4Element(name="Bismuth"  , symbol="Bi",z=83., a);
+
   //
   // define an Element from isotopes, by relative abundance
   //
@@ -152,41 +158,44 @@ void Em3DetectorConstruction::DefineMaterials()
   // define simple materials
   //
 
+  G4Material* ma;
   density = 70.8*mg/cm3;
   a = 1.008*g/mole;
-  G4Material* lH2 = new G4Material(name="liquidH2", z=1., a, density);
+  ma = new G4Material(name="liquidH2", z=1., a, density);
 
   density = 2.700*g/cm3;
   a = 26.98*g/mole;
-  G4Material* Al = new G4Material(name="Aluminium", z=13., a, density);
+  ma = new G4Material(name="Aluminium", z=13., a, density);
 
   density = 1.390*g/cm3;
   a = 39.95*g/mole;
-  G4Material* lAr = new G4Material(name="liquidArgon", z=18., a, density);
+  ma = new G4Material(name="liquidArgon", z=18., a, density);
+  G4Material* lAr = ma;
 
   density = 7.870*g/cm3;
   a = 55.85*g/mole;
-  G4Material* Fe = new G4Material(name="Iron"     , z=26., a, density);
+  ma = new G4Material(name="Iron"     , z=26., a, density);
 
   density = 8.960*g/cm3;
   a = 63.55*g/mole;
-  G4Material* Cu = new G4Material(name="Copper"   , z=29., a, density);
+  ma = new G4Material(name="Copper"   , z=29., a, density);
 
   density = 19.30*g/cm3;
   a = 183.85*g/mole;
-  G4Material* W = new G4Material(name="Tungsten"  , z=74., a, density);
+  ma = new G4Material(name="Tungsten"  , z=74., a, density);
 
   density = 19.32*g/cm3;
   a = 196.97*g/mole;
-  G4Material* Au = new G4Material(name="Gold"     , z=79., a, density);
+  ma = new G4Material(name="Gold"     , z=79., a, density);
 
   density = 11.35*g/cm3;
   a = 207.19*g/mole;
-  G4Material* Pb = new G4Material(name="Lead"     , z=82., a, density);
+  ma = new G4Material(name="Lead"     , z=82., a, density);
+  G4Material* Pb = ma;
 
   density = 18.95*g/cm3;
   a = 238.03*g/mole;
-  G4Material* Ur = new G4Material(name="Uranium"  , z=92., a, density);
+  ma = new G4Material(name="Uranium"  , z=92., a, density);
 
   //
   // define a material from elements.   case 1: chemical molecule
@@ -224,7 +233,13 @@ void Em3DetectorConstruction::DefineMaterials()
   G4Material* CsI = new G4Material(name="CsI", density, ncomponents=2);
   CsI->AddElement(Cs, natoms=1);
   CsI->AddElement(I , natoms=1);
-  CsI->GetIonisation()->SetMeanExcitationEnergy(415.689*eV);
+  CsI->GetIonisation()->SetMeanExcitationEnergy(553.1*eV);
+
+  density = 7.10*g/cm3;
+  G4Material* BGO = new G4Material(name="BGO", density, ncomponents=3);
+  BGO->AddElement(O , natoms=12);
+  BGO->AddElement(Ge, natoms= 3);
+  BGO->AddElement(Bi, natoms= 4);
 
   //
   // define a material from elements.   case 2: mixture by fractional mass
@@ -568,13 +583,7 @@ void Em3DetectorConstruction::SetMaxStepSize(G4double val)
 
 void Em3DetectorConstruction::UpdateGeometry()
 {
-  G4bool first = true;
-  if (physiWorld) first = false;
-  G4VPhysicalVolume* v = ConstructCalorimeter();
-  G4RunManager* rm = G4RunManager::GetRunManager();
-  rm->GeometryHasBeenModified();
-  rm->DefineWorldVolume(v);
-  if (!first) rm->ResetNavigator();
+  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/examples/extended/electromagnetic/TestEm3/src/Em3EventAction.cc b/examples/extended/electromagnetic/TestEm3/src/Em3EventAction.cc
index c4cd2c6bcc..16a63836ea 100644
--- a/examples/extended/electromagnetic/TestEm3/src/Em3EventAction.cc
+++ b/examples/extended/electromagnetic/TestEm3/src/Em3EventAction.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: Em3EventAction.cc,v 1.13 2002/06/05 12:13:04 maire Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em3EventAction.cc,v 1.14 2003/05/09 09:28:01 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -74,30 +74,29 @@ Em3EventAction::~Em3EventAction()
 void Em3EventAction::BeginOfEventAction(const G4Event* evt)
 {   
  G4int evtNb = evt->GetEventID();
- 
+
  //survey printing
- if (evtNb%printModulo == 0) 
+ if (evtNb%printModulo == 0)
     G4cout << "\n---> Begin Of Event: " << evtNb << G4endl;
 
- // initialize Hits collection    
+ // initialize Hits collection
  if (calorimeterCollID==-1)
   {
     G4SDManager * SDman = G4SDManager::GetSDMpointer();
     calorimeterCollID = SDman->GetCollectionID("CalCollection");
-  } 
+  }
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 void Em3EventAction::EndOfEventAction(const G4Event* evt)
-{ 
+{
   G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
   Em3CalorHitsCollection* CHC = NULL;
   G4int NbHits=0;
   G4int NbOfAbsor=Detector->GetNbOfAbsor();
-  G4double Ebeam = Em3Kin->GetParticleGun()->GetParticleEnergy();
   G4double totEAbs, totLAbs;
-       
+
   if (HCE) CHC = (Em3CalorHitsCollection*)(HCE->GetHC(calorimeterCollID));
 
   if (CHC)
@@ -107,19 +106,20 @@ void Em3EventAction::EndOfEventAction(const G4Event* evt)
         {totEAbs=totLAbs=0.;
          for (G4int j=0;j<NbHits;j++)
             {
-	     totEAbs += (*CHC)[j]->GetEdepAbs(k); 
-             totLAbs += (*CHC)[j]->GetTrakAbs(k);     
+	     totEAbs += (*CHC)[j]->GetEdepAbs(k);
+             totLAbs += (*CHC)[j]->GetTrakAbs(k);
             }
          Em3Run->fillPerEvent(k,totEAbs,totLAbs);
-	 
-#ifndef G4NOHIST        
+
+#ifndef G4NOHIST
          //fill histo
-         //	 
+         //
+         G4double Ebeam = Em3Kin->GetParticleGun()->GetParticleEnergy();
 	 Em3Run->GetHisto(k)->fill(totEAbs/Ebeam);
-#endif  	 	 
+#endif
        }
     }
-    
+
   if (G4VVisManager::GetConcreteInstance())
     {
      G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
diff --git a/examples/extended/electromagnetic/TestEm3/src/Em3RunActionMessenger.cc b/examples/extended/electromagnetic/TestEm3/src/Em3RunActionMessenger.cc
index c124f59ede..13ae5eab7f 100644
--- a/examples/extended/electromagnetic/TestEm3/src/Em3RunActionMessenger.cc
+++ b/examples/extended/electromagnetic/TestEm3/src/Em3RunActionMessenger.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: Em3RunActionMessenger.cc,v 1.10 2002/12/12 11:19:39 maire Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: Em3RunActionMessenger.cc,v 1.11 2003/04/01 10:40:21 maire Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -59,12 +59,12 @@ Em3RunActionMessenger::Em3RunActionMessenger(Em3RunAction* run)
   //    
   G4UIparameter* VminPrm = new G4UIparameter("Vmin",'d',false);
   VminPrm->SetGuidance("Vmin=Emin/Ebeam");
-  VminPrm->SetParameterRange("Vmin>=0.&&Vmin<=1.");
+  VminPrm->SetParameterRange("Vmin>=0.&&Vmin<=1.1");
   HistoCmd->SetParameter(VminPrm);
   //    
   G4UIparameter* VmaxPrm = new G4UIparameter("Vmax",'d',false);
   VmaxPrm->SetGuidance("Vmax=Emax/Ebeam");
-  VmaxPrm->SetParameterRange("Vmax>=0.&&Vmax<=1.");
+  VmaxPrm->SetParameterRange("Vmax>=0.&&Vmax<=1.1");
   HistoCmd->SetParameter(VmaxPrm);  
   //
   HistoCmd->AvailableForStates(G4State_Idle);    
diff --git a/examples/extended/electromagnetic/TestEm3/vis.mac b/examples/extended/electromagnetic/TestEm3/vis.mac
index cb3d967a2c..fcea4d62da 100644
--- a/examples/extended/electromagnetic/TestEm3/vis.mac
+++ b/examples/extended/electromagnetic/TestEm3/vis.mac
@@ -7,10 +7,6 @@
 /control/verbose 2
 /run/verbose 2
 #
-#  select EM PhysicsList
-#
-#/testem/phys/addPhysics  model
-/testem/phys/addPhysics  standard
 /run/initialize
 #
 # Create empty scene ("world" is default)
diff --git a/examples/novice/N04/History b/examples/novice/N04/History
index 1dc1e15e29..143e7cf707 100644
--- a/examples/novice/N04/History
+++ b/examples/novice/N04/History
@@ -1,4 +1,4 @@
-$Id: History,v 1.28 2003/03/28 09:35:36 gcosmo Exp $
+$Id: History,v 1.29 2003/05/09 07:37:48 gcosmo Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -15,6 +15,9 @@ track of all tags.
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
 
+09-05-03  G.Cosmo (exampleN04-V05-01-00)
+- Still minor correction to text in warning printed from HadronPhysics list.
+
 28-03-03  G.Cosmo (exampleN04-V05-00-02)
 - Corrected text in warning printed from HadronPhysics list.
 
diff --git a/examples/novice/N04/src/ExN04HadronPhysics.cc b/examples/novice/N04/src/ExN04HadronPhysics.cc
index 5c3988a10f..f5dba22a91 100644
--- a/examples/novice/N04/src/ExN04HadronPhysics.cc
+++ b/examples/novice/N04/src/ExN04HadronPhysics.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: ExN04HadronPhysics.cc,v 1.6 2003/03/28 09:35:13 gcosmo Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: ExN04HadronPhysics.cc,v 1.7 2003/05/09 07:37:32 gcosmo Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 
 #include "ExN04HadronPhysics.hh"
@@ -77,7 +77,7 @@ void ExN04HadronPhysics::ConstructProcess()
   G4cout << "You are using the ExN04HadronPhysics" << G4endl;
   G4cout << " - Note that this hadronic physics list is not optimized for any particular usage" << G4endl;
   G4cout << " - If you wish to have a starting point tailored for a particular area of work," << G4endl;
-  G4cout << "   please one of the available physics lists by use-case." << G4endl;
+  G4cout << "   please use one of the available physics lists by use-case." << G4endl;
   G4cout << "" << G4endl;
   // Elastic Process
   theElasticModel = new G4LElastic();
diff --git a/source/geometry/solids/Boolean/History b/source/geometry/solids/Boolean/History
index df65199831..8c9e5bc42d 100644
--- a/source/geometry/solids/Boolean/History
+++ b/source/geometry/solids/Boolean/History
@@ -1,5 +1,5 @@
 
-$Id: History,v 1.36 2003/03/25 17:02:01 gcosmo Exp $
+$Id: History,v 1.37 2003/05/12 12:35:58 gcosmo Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -20,6 +20,9 @@ committal in the CVS repository !
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
 
+ May 12, 2003   G.Cosmo                   geom-bool-V05-01-00
+  - Added set/get methods for scale precision in G4ReflectionFactory.
+
  Mar 25, 2003   G.Cosmo                   geom-bool-V05-00-01
   - Fixed trivial strict pedantic warnings in G4ReflectedSolid.cc and
     G4ReflectionFactory.cc.
diff --git a/source/geometry/solids/Boolean/include/G4ReflectionFactory.hh b/source/geometry/solids/Boolean/include/G4ReflectionFactory.hh
index 50a9bc3823..c5731b07fb 100644
--- a/source/geometry/solids/Boolean/include/G4ReflectionFactory.hh
+++ b/source/geometry/solids/Boolean/include/G4ReflectionFactory.hh
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: G4ReflectionFactory.hh,v 1.2 2003/01/27 10:43:30 gcosmo Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: G4ReflectionFactory.hh,v 1.3 2003/05/12 12:35:39 gcosmo Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 // class G4Reflection
@@ -125,7 +125,12 @@ class G4ReflectionFactory
     G4String GetVolumesNameExtension() const;				  
       // Returns the name extension for the reflected solids
       // and logical volumes.
- 
+
+    void     SetScalePrecision(G4double scaleValue);
+    G4double GetScalePrecision() const;
+      // Sets/gets precision factor for the scale consistency check
+      // The default value is set to 10*kCarTolerance.
+
   protected:	  
 
     G4ReflectionFactory();
@@ -180,7 +185,7 @@ class G4ReflectionFactory
     G4bool IsReflection(const G4Scale3D& scale) const;
       // Returns true if the scale is negative, false otherwise.
 
-    void   CheckScale(const G4Scale3D& scale) const;
+    void CheckScale(const G4Scale3D& scale) const;
       // Checks if scale correspond to fScale, if not gives exception.
 
     void PrintConstituentLVMap();				  
@@ -191,7 +196,8 @@ class G4ReflectionFactory
     static G4ReflectionFactory* fInstance;
     static const G4String       fDefaultNameExtension;
     static const G4Scale3D      fScale;
-    
+    G4double                    fScalePrecision;
+
     G4int              fVerboseLevel;
     G4String           fNameExtension;
     LogicalVolumesMap  fConstituentLVMap;
diff --git a/source/geometry/solids/Boolean/src/G4ReflectionFactory.cc b/source/geometry/solids/Boolean/src/G4ReflectionFactory.cc
index 054fabd4a7..22093b9fd3 100644
--- a/source/geometry/solids/Boolean/src/G4ReflectionFactory.cc
+++ b/source/geometry/solids/Boolean/src/G4ReflectionFactory.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: G4ReflectionFactory.cc,v 1.6 2003/03/25 17:03:03 gcosmo Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: G4ReflectionFactory.cc,v 1.7 2003/05/12 12:35:39 gcosmo Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // Author: Ivana Hrivnacova, 16.10.2001  (Ivana.Hrivnacova@cern.ch)
 
@@ -82,6 +82,7 @@ G4ReflectionFactory::G4ReflectionFactory()
   // Protected singleton constructor.
   // ---
 
+  fScalePrecision = 10.*kCarTolerance;
   fInstance = this;
 }
 
@@ -571,7 +572,7 @@ void G4ReflectionFactory::CheckScale(const G4Scale3D& scale) const
     for (G4int j=0; j<4; j++) 
       diff += abs(scale(i,j) - fScale(i,j));  
 
-  if (diff > kCarTolerance*10.)
+  if (diff > fScalePrecision)
   {
     G4cout << "ERROR - G4ReflectionFactory::CheckScale()" << G4endl
            << "        Unexpected scale. Difference: " << diff << G4endl;
diff --git a/source/geometry/volumes/History b/source/geometry/volumes/History
index 15cd26f80f..5153f986d0 100644
--- a/source/geometry/volumes/History
+++ b/source/geometry/volumes/History
@@ -1,4 +1,4 @@
-$Id: History,v 1.97 2003/03/31 14:39:31 gcosmo Exp $
+$Id: History,v 1.98 2003/05/08 17:19:22 gcosmo Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -17,8 +17,15 @@ committal in the CVS repository !
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
 
+May 8th, 2003       G. Cosmo - geomvol-V05-01-00
+- G4PropagatorInField.cc: fix in ComputeStep() to avoid step computation
+  if proposed step length is too small (less than kCarTolerance).
+  Fixes problem report #485.
+- Does NOT include changes in "geomvol-V04-01-08".
+
 Mar 31st, 2003      G. Cosmo - geomvol-V05-00-03
 - Fixed trivial strict pedantic warnings.
+- Does NOT include changes in "geomvol-V04-01-08".
 
 Mar 17th, 2003      G. Cosmo - geomvol-V05-00-02
 - G4Navigator[.hh.cc]: added 'inline' specifier in declaration of
diff --git a/source/geometry/volumes/src/G4PropagatorInField.cc b/source/geometry/volumes/src/G4PropagatorInField.cc
index bd638a1b3c..d162026536 100644
--- a/source/geometry/volumes/src/G4PropagatorInField.cc
+++ b/source/geometry/volumes/src/G4PropagatorInField.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: G4PropagatorInField.cc,v 1.39.4.1 2003/03/31 14:34:27 gcosmo Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: G4PropagatorInField.cc,v 1.39.4.2 2003/05/08 17:15:56 gcosmo Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 // 
 // 
 //  This class implements an algorithm to track a particle in a
@@ -88,8 +88,18 @@ G4PropagatorInField::ComputeStep(
                 G4double&          currentSafety,                // IN/OUT
                 G4VPhysicalVolume* pPhysVol)
 {
-  // Introducing smooth trajectory display (jacek 01/11/2002)
-  if (fpTrajectoryFilter) {
+
+  // If step length is too small for finding Chords, just forget
+  //
+  if ( CurrentProposedStepLength<kCarTolerance )
+  {
+    return DBL_MAX;
+  }
+
+  // Introducing smooth trajectory display
+  //
+  if ( fpTrajectoryFilter )
+  {
     fpTrajectoryFilter->CreateNewTrajectorySegment();
   }
 
@@ -108,7 +118,7 @@ G4PropagatorInField::ComputeStep(
   // Set the field manager if the volume has one, else use the global one
   //
   fCurrentFieldMgr = fDetectorFieldMgr;
-  if( pPhysVol)
+  if( pPhysVol )
   {
     G4FieldManager *newFieldMgr = 0;
     newFieldMgr= pPhysVol->GetLogicalVolume()->GetFieldManager(); 
diff --git a/source/processes/electromagnetic/muons/History b/source/processes/electromagnetic/muons/History
index 5cce03b5e1..f9e1ff64dc 100644
--- a/source/processes/electromagnetic/muons/History
+++ b/source/processes/electromagnetic/muons/History
@@ -1,4 +1,4 @@
-$Id: History,v 1.44 2003/04/29 07:24:24 vnivanch Exp $
+$Id: History,v 1.46 2003/05/12 10:02:21 vnivanch Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -17,6 +17,12 @@ committal in the CVS repository !
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
 
+12 May 03: V.Ivant (muons-V05-01-01)
+-remove extra printout at initialisation
+
+09 May 03: V.Ivant (muons-V05-01-00)
+-remove extra printout at initialisation
+
 28 Apr 03: V.Ivant (muons-V05-00-08)
 -fix leak in retrieve tables
 
diff --git a/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc b/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc
index a60399d56e..7ff0b56a69 100644
--- a/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc
+++ b/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: G4MuPairProduction.cc,v 1.33 2003/04/29 04:58:33 kurasige Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: G4MuPairProduction.cc,v 1.35 2003/05/12 09:05:12 vnivanch Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 //--------------- G4MuPairProduction physics process ---------------------------
 //                by Laszlo Urban, May 1998
@@ -123,6 +123,12 @@ void G4MuPairProduction::BuildPhysicsTable(
                                const G4ParticleDefinition& aParticleType)
 //  just call BuildLossTable+BuildLambdaTable
 {
+  /*
+  G4cout << "G4MuPairProduction: theLossTable= " << theLossTable
+        << " for " << aParticleType.GetParticleName()
+        << " cutsWereMod= "  << CutsWhereModified()
+        << G4endl;
+  */ 
   if( !CutsWhereModified() && theLossTable) return;
 
   LowestKineticEnergy  = GetLowerBoundEloss() ;
@@ -150,6 +156,12 @@ void G4MuPairProduction::BuildPhysicsTable(
   G4VMuEnergyLoss::BuildDEDXTable(aParticleType);
 
   if(&aParticleType==G4MuonPlus::MuonPlus()) PrintInfoDefinition();
+  /*
+  G4cout << "G4MuPairProduction: theLossTable= " << theLossTable
+         << " theLambda= " << theMeanFreePathTable
+         << " for " << aParticleType.GetParticleName()
+         << G4endl;
+  */
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -288,8 +300,13 @@ G4double G4MuPairProduction::ComputePairLoss(
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 void G4MuPairProduction::BuildLambdaTable(
-                                   const G4ParticleDefinition& ParticleType)
+                                   const G4ParticleDefinition& aParticleType)
 {
+  /*
+  G4cout << "G4MuPairProduction::BuildLambdaTable= " << theMeanFreePathTable
+        << " for " << aParticleType.GetParticleName()
+        << G4endl;
+  */  
   G4double LowEdgeEnergy , Value;
   G4double FixedEnergy = (LowestKineticEnergy + HighestKineticEnergy)/2. ;
 
@@ -320,15 +337,20 @@ void G4MuPairProduction::BuildLambdaTable(
     for ( G4int i = 0 ; i < NbinLambda ; i++ )
     {
        LowEdgeEnergy = ptrVector->GetLowEdgeEnergy( i ) ;
-       Value = ComputeMeanFreePath( &ParticleType, LowEdgeEnergy, couple);
+       Value = ComputeMeanFreePath( &aParticleType, LowEdgeEnergy, couple);
        ptrVector->PutValue( i , Value ) ;
     }
 
     theMeanFreePathTable->insertAt( J , ptrVector );
 
      // Compute the PartialSumSigma table at a given fixed energy
-    ComputePartialSumSigma( &ParticleType, FixedEnergy, couple) ;
+    ComputePartialSumSigma( &aParticleType, FixedEnergy, couple) ;
   }
+  /*
+  G4cout << "Is done theTable= " << theMeanFreePathTable
+        << " for " << aParticleType.GetParticleName()
+        << G4endl;  
+  */
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/source/processes/hadronic/models/generator/kinetic_model/src/G4BinaryCascade.cc b/source/processes/hadronic/models/generator/kinetic_model/src/G4BinaryCascade.cc
index 4486a43730..24b692d0d0 100644
--- a/source/processes/hadronic/models/generator/kinetic_model/src/G4BinaryCascade.cc
+++ b/source/processes/hadronic/models/generator/kinetic_model/src/G4BinaryCascade.cc
@@ -240,6 +240,7 @@ G4ReactionProductVector * G4BinaryCascade::Propagate(
   ClearAndDestroy(&theProjectileList);
   ClearAndDestroy(&theFinalState);
   G4std::vector<G4KineticTrack *>::iterator iter, jter;
+  G4int trialcount(0);
   if(nucleus->GetMassNumber() == 1) // 1H1 is special case
   {
     G4ParticleDefinition * aHTarg = G4Proton::ProtonDefinition();
@@ -252,7 +253,7 @@ G4ReactionProductVector * G4BinaryCascade::Propagate(
     // G4cout << "the lovely "<< mom << " "<<aHTarg->GetPDGMass()<<G4endl;
     G4KineticTrack aTarget(aHTarg, 0., pos, mom);
     G4bool done(false);
-    while(!done)
+    while(!done && trialcount<1000)
     {
       if(secs)
       {
@@ -260,6 +261,7 @@ G4ReactionProductVector * G4BinaryCascade::Propagate(
        delete secs;
       }
       secs = theScatterer->Scatter(*(*secondaries).front(), aTarget);
+      trialcount++;
       for(size_t ss=0; secs && ss<secs->size(); ss++)
       {
         if((*secs)[ss]->GetDefinition()->IsShortLived()) done = true;
diff --git a/source/run/History b/source/run/History
index 9caaffb254..7323fc8497 100644
--- a/source/run/History
+++ b/source/run/History
@@ -1,4 +1,4 @@
-$Id: History,v 1.90 2003/04/29 08:29:15 gcosmo Exp $
+$Id: History,v 1.92 2003/05/16 09:12:48 gcosmo Exp $
 -------------------------------------------------------------------
 
      =========================================================
@@ -17,6 +17,21 @@ committal in the CVS repository !
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
 
+May 16, 2003, G.Cosmo (run-V05-01-01)
+- G4RunManager.cc: changed date for 5.1-patch01.
+
+May 06, 2003, G.Cosmo (run-V05-01-00)
+- G4RunManager[hh.cc]: changed behavior of function DefineWorldVolume()
+  to properly reset navigation history and optimisation in case the
+  topology of the geometry has changed between runs.
+  It requires simplification of all examples/tests where geometry setup
+  is changed between runs.
+  o Added new boolean argument (default set to TRUE) to specify if
+    topology has changed. Call to DefineWorldVolume() at initialisation
+    will use FALSE as value for this argument.
+  o Forced open/close geometry in method ResetNavigator() to properly
+    reset G4Navigator status and remove old optimisations.
+
 Apr 29, 2003, M.Asai (run-V05-00-17)
 - G4UserPhysicsListMessenger.cc: changed implementation in
   SetNewValue() for command 'setCutRCmd' to allow porting on
diff --git a/source/run/include/G4RunManager.hh b/source/run/include/G4RunManager.hh
index b8112af5aa..4ae4d660ac 100644
--- a/source/run/include/G4RunManager.hh
+++ b/source/run/include/G4RunManager.hh
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: G4RunManager.hh,v 1.32 2003/04/23 17:54:27 asaim Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: G4RunManager.hh,v 1.33 2003/05/06 16:31:58 gcosmo Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -133,12 +133,16 @@ class G4RunManager
     // If the user forget the second invokation, G4RunManager will invoke BeamOn()
     // method will invoke this method. (Note that this feature is not valid for the
     // first initialization.)
-    virtual void DefineWorldVolume(G4VPhysicalVolume * worldVol);
-    //  Usually, this method is invoked from InitializeGeometry() protected method
-    // of this class. But, in case all of geometry has already created and kept in
-    // the ODBMS, the pointer to the world physical volume can be set by this method.
+    virtual void DefineWorldVolume(G4VPhysicalVolume * worldVol,
+                                   G4bool topologyIsChanged=true);
+    //  This method must be invoked if the geometry setup has been changed between
+    // runs. The flag 'topologyIsChanged' will specify if the geometry topology is
+    // different from the original one used in the previous run; if not, it must be
+    // set to false, so that the original optimisation and navigation history is
+    // preserved. This method is invoked also at initialisation.
     virtual void ResetNavigator() const;
-    // Resets state of navigator for tracking, needed for geometry updates.
+    //  Resets the state of the navigator for tracking; needed for geometry updates.
+    // It forces the optimisation and navigation history to be reset.
     virtual void AbortRun(G4bool softAbort=false);
     //  This method safely aborts the current event loop even if an event is in progress.
     // This method is available for Geant4 states of GeomClosed and EventProc. The state
diff --git a/source/run/src/G4RunManager.cc b/source/run/src/G4RunManager.cc
index 025c834661..7e8fa43276 100644
--- a/source/run/src/G4RunManager.cc
+++ b/source/run/src/G4RunManager.cc
@@ -21,8 +21,8 @@
 // ********************************************************************
 //
 //
-// $Id: G4RunManager.cc,v 1.75 2003/04/24 17:42:06 asaim Exp $
-// GEANT4 tag $Name: geant4-05-01 $
+// $Id: G4RunManager.cc,v 1.77 2003/05/16 09:12:33 gcosmo Exp $
+// GEANT4 tag $Name: geant4-05-01-patch-01 $
 //
 // 
 
@@ -41,6 +41,7 @@
 #include "G4VUserPrimaryGeneratorAction.hh"
 #include "G4GeometryManager.hh"
 #include "G4SDManager.hh"
+#include "G4Navigator.hh"
 #include "G4TransportationManager.hh"
 #include "G4VPhysicalVolume.hh"
 #include "G4LogicalVolume.hh"
@@ -105,7 +106,7 @@ G4RunManager::G4RunManager()
   G4ParticleTable::GetParticleTable()->CreateMessenger();
   G4ProcessTable::GetProcessTable()->CreateMessenger();
   randomNumberStatusDir = "./";
-  versionString = " Geant4 version $Name: geant4-05-01 $\n                                (30-Apr-2003)";
+  versionString = " Geant4 version $Name: geant4-05-01-patch-01 $\n                                (19-May-2003)";
   G4cout 
   << "**********************************************" << G4endl
   << versionString << G4endl
@@ -395,7 +396,7 @@ void G4RunManager::InitializeGeometry()
   }
 
   if(verboseLevel>1) G4cout << "userDetector->Construct() start." << G4endl;
-  DefineWorldVolume(userDetector->Construct());
+  DefineWorldVolume(userDetector->Construct(),false);
   geometryInitialized = true;
 }
 
@@ -485,11 +486,10 @@ void G4RunManager::AbortEvent()
   }
 }
 
-void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol)
+void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol,
+                                     G4bool topologyIsChanged)
 {
-  // check if this is different from previous
-  //////if(currentWorld==worldVol) return;
-  // The world volume MUST NOT have a region defined by the user.
+  // The world volume MUST NOT have a region defined by the user
   if(worldVol->GetLogicalVolume()->GetRegion())
   {
     if(worldVol->GetLogicalVolume()->GetRegion()!=defaultRegion)
@@ -505,27 +505,22 @@ void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol)
   }
   else
   {
-  // set the default region to the world
+    // Set the default region to the world
     G4LogicalVolume* worldLog = worldVol->GetLogicalVolume();
     worldLog->SetRegion(defaultRegion);
     defaultRegion->AddRootLogicalVolume(worldLog);
   }
 
+  // Set the world volume, notify the Navigator and reset its state
   currentWorld = worldVol; 
-  //geometryNeedsToBeClosed = true;
-  GeometryHasBeenModified();
-
-  // set the world volume to the Navigator
-  //ResetNavigator();
   G4TransportationManager::GetTransportationManager()
-    ->GetNavigatorForTracking()
-    ->SetWorldVolume(worldVol);
-  //ResetNavigator();
+      ->GetNavigatorForTracking()
+      ->SetWorldVolume(worldVol);
+  if (topologyIsChanged) ResetNavigator();
 
-  // Let VisManager know it
+  // Notify the VisManager as well
   G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
   if(pVVisManager) pVVisManager->GeometryHasChanged();
-
 }
 
 void G4RunManager::ResetNavigator() const
@@ -542,12 +537,20 @@ void G4RunManager::ResetNavigator() const
     return;
   }
   
-  // We have to tweak the navigator's state in case a geometry has been modified between runs
-  // By the following call we ensure that navigator's state is reset properly
+  // We have to tweak the navigator's state in case a geometry has been
+  // modified between runs. By the following calls we ensure that navigator's
+  // state is reset properly. It is required the geometry to be closed
+  // and previous optimisations to be cleared.
+
+  G4GeometryManager* geomManager = G4GeometryManager::GetInstance();
+  if(verboseLevel>1) G4cout << "Start closing geometry." << G4endl;
+  geomManager->OpenGeometry();
+  geomManager->CloseGeometry(geometryToBeOptimized, verboseLevel>1);
+
   G4ThreeVector center(0,0,0);
-  G4TransportationManager::GetTransportationManager()
-      ->GetNavigatorForTracking()
-      ->LocateGlobalPointAndSetup(center,0,false);  
+  G4Navigator* navigator =
+      G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
+  navigator->LocateGlobalPointAndSetup(center,0,false);
 }
 
 void G4RunManager::rndmSaveThisRun()
@@ -640,6 +643,3 @@ void G4RunManager::DumpRegion(G4Region* region) const
            << G4endl;
   }
 }
-
-
-
-- 
GitLab