Index: trunk/examples/extended/analysis/A01/A01app.cc
===================================================================
--- trunk/examples/extended/analysis/A01/A01app.cc	(revision 1187)
+++ trunk/examples/extended/analysis/A01/A01app.cc	(revision 1230)
@@ -24,5 +24,5 @@
 // ********************************************************************
 //
-// $Id: A01app.cc,v 1.8 2006/11/06 19:46:06 allison Exp $
+// $Id: A01app.cc,v 1.9 2009/11/14 14:41:13 allison Exp $
 // --------------------------------------------------------------
 //
@@ -37,8 +37,4 @@
 #include "G4RunManager.hh"
 #include "G4UImanager.hh"
-#include "G4UIterminal.hh"
-#ifdef G4UI_USE_TCSH
-#include "G4UItcsh.hh"
-#endif
 
 #include "A01DetectorConstruction.hh"
@@ -52,9 +48,7 @@
 #endif
 
-//OSC:begin
-#include <G4Lab/UIOnX.h>
-#include "A01AnalysisManager.hh"
-#include <AIDA/IAnalysisFactory.h>
-//OSC:end
+#ifdef G4UI_USE
+#include "G4UIExecutive.hh"
+#endif
 
 int main(int argc,char** argv)
@@ -62,21 +56,4 @@
   // RunManager construction
   G4RunManager* runManager = new G4RunManager;
-
-//OSC:begin
-  G4UIsession* session = 0;
-  if (argc!=1) {   // batch mode
-  A01AnalysisManager::setAIDA(AIDA_createAnalysisFactory());
-  } else {
-  std::string GUI_onx = "main.onx";
-  //std::string GUI_onx = "simple_main.onx";
-  G4Lab::UIOnX* uiOnX = new G4Lab::UIOnX(*runManager,GUI_onx,argc,argv);
-  // Enforce the creation of the GUI here, else
-  // the AIDA plotter factory will create its own
-  // that will interfer with the G4Lab::UIOnX one.
-  uiOnX->createUI();
-  A01AnalysisManager::setAIDA(uiOnX->findAIDA());
-  session = uiOnX;
-  }
-//OSC:end
 
 #ifdef G4VIS_USE
@@ -110,15 +87,9 @@
   // start interactive session
   {
-#ifdef G4UI_USE_TCSH
-    G4UIsession* session = new G4UIterminal(new G4UItcsh);
-#else
-//OSC:begin
-//    G4UIsession* session = new G4UIterminal();
-//OSC:end
+#ifdef G4UI_USE
+    G4UIExecutive* ui = new G4UIExecutive(argc, argv);
+    ui->SessionStart();
+    delete ui;
 #endif
-    session->SessionStart();
-//OSC:begin
-//    delete session;
-//OSC:end
   }
 
@@ -129,15 +100,4 @@
   delete runManager;
 
-//OSC:begin
-  // The delete of the run manager may induce,
-  // through the user action classes,
-  // a delete / closing of the AIDA resources
-  // as AIDA trees and various factories.
-  // Then we delete the UIOnX that manages the
-  // AIDA implementation after the delete
-  // of the G4 run manager.
-  delete session;
-//OSC:end
-
   return 0;
 }
Index: trunk/examples/extended/analysis/A01/GNUmakefile
===================================================================
--- trunk/examples/extended/analysis/A01/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/analysis/A01/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.10 2006/11/10 21:04:51 duns Exp $
+# $Id: GNUmakefile,v 1.11 2009/03/05 09:21:30 gbarrand Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module
@@ -18,33 +18,4 @@
 # A01 uses its own physics lists. 
 #
-
-#OSC:begin
-# OpenScientist compilation and link flags :
-# Disconnect the usage of other GUIs :
-G4UI_USE_TERMINAL :=
-G4UI_USE_XM :=
-G4UI_USE_XAW :=
-G4UI_USE_QT :=
-G4UI_USE_WIN32 :=
-G4UI_USE_TCSH :=
-G4UI_USE_GAG :=
-G4UI_USE_OSC :=
-# Disconnect the usage of vis drivers that may interfer :
-G4VIS_USE_OPENGLX :=
-G4VIS_USE_OPENGLXM :=
-G4VIS_USE_OPENGLWIN32 :=
-G4VIS_USE_OIX :=
-G4VIS_USE_OIWIN32 :=
-G4VIS_USE_OPACS :=
-CPPFLAGS += `osc-config --g4lab_incs`
-INTYLIBS += $(shell osc-config --g4lab_libs)
-INTYLIBS += `osc-config --iv_libs`
-
-# Enable OpenScientist AIDA implementation :
-G4ANALYSIS_USE := 1
-G4ANALYSIS_AIDA_CONFIG_CFLAGS = `aida-config --include`
-G4ANALYSIS_AIDA_CONFIG_LIBS = `OnXLab_aida_config --libs`
-#G4ANALYSIS_AIDA_CONFIG_LIBS = `OnXLab_aida_config --libs`
-#OSC:end
 
 include $(G4INSTALL)/config/binmake.gmk
@@ -82,6 +53,2 @@
 endif
 
-ifdef G4ANALYSIS_USE
-   CPPFLAGS += `aida-config --include`
-   LDLIBS += `aida-config --lib`
-endif
Index: trunk/examples/extended/analysis/A01/include/A01AnalysisManager.hh
===================================================================
--- trunk/examples/extended/analysis/A01/include/A01AnalysisManager.hh	(revision 1187)
+++ trunk/examples/extended/analysis/A01/include/A01AnalysisManager.hh	(revision 1230)
@@ -65,13 +65,4 @@
 public:
 
-
-//OSC:begin
-public:
-  static AIDA::IAnalysisFactory* m_AIDA;
-  static void setAIDA(AIDA::IAnalysisFactory*);
-  static AIDA::IAnalysisFactory* getAIDA();
-public:
-//OSC:begin
-
   virtual ~A01AnalysisManager();
   static A01AnalysisManager* getInstance();
Index: trunk/examples/extended/analysis/A01/src/A01AnalysisManager.cc
===================================================================
--- trunk/examples/extended/analysis/A01/src/A01AnalysisManager.cc	(revision 1187)
+++ trunk/examples/extended/analysis/A01/src/A01AnalysisManager.cc	(revision 1230)
@@ -60,11 +60,4 @@
 #include "A01AnalysisManager.hh"
 
-//OSC:begin
-AIDA::IAnalysisFactory* A01AnalysisManager::m_AIDA = 0;
-void A01AnalysisManager::setAIDA(AIDA::IAnalysisFactory* a_AIDA) {m_AIDA = a_AIDA;}
-AIDA::IAnalysisFactory* A01AnalysisManager::getAIDA(){return m_AIDA;}
-//OSC:end
-
-
 A01AnalysisManager* A01AnalysisManager::instance = 0;
 
@@ -73,7 +66,5 @@
 {
   // Hooking an AIDA compliant analysis system.
-//OSC:begin
-  analysisFactory = getAIDA();
-//OSC:end
+  analysisFactory = AIDA_createAnalysisFactory();
   if(analysisFactory)
   {
@@ -101,9 +92,5 @@
     delete plotter;
     G4cout << "Warning: In case of working with JAS-AIDA, Geant4 will NOT exit unless you close the JAS-AIDA window." << G4endl;
-//OSC:begin
-// AIDA analysis factory is managed by
-// G4Lab::UIOnX, it can't be delete here.
-//    delete analysisFactory;
-//OSC:end
+    delete analysisFactory;
   }
 }
Index: trunk/examples/extended/analysis/AnaEx01/AnaEx01.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/AnaEx01.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/AnaEx01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01.cc,v 1.14 2006/06/29 16:33:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/GNUmakefile
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.2 2003/12/03 10:34:02 gcosmo Exp $
+# $Id: GNUmakefile,v 1.3 2009/03/05 09:20:52 gbarrand Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -16,9 +16,2 @@
 
 include $(G4INSTALL)/config/binmake.gmk
-
-ifdef G4ANALYSIS_USE
- CPPFLAGS += `aida-config --include`
- LDFLAGS  += `aida-config --lib`
- LOADLIBS += `aida-config --lib`
-endif
-
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01AnalysisManager.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01AnalysisManager.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01AnalysisManager.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01AnalysisManager.hh,v 1.9 2006/06/29 16:33:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorHit.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorHit.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorHit.hh,v 1.4 2006/06/29 16:33:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorimeterSD.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorimeterSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorimeterSD.hh,v 1.4 2006/06/29 16:33:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorConstruction.hh,v 1.4 2006/06/29 16:33:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorMessenger.hh,v 1.4 2006/06/29 16:33:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01EventAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01EventAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01EventAction.hh,v 1.6 2006/06/29 16:33:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PhysicsList.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PhysicsList.hh,v 1.4 2006/06/29 16:33:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:33:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorMessenger.hh,v 1.4 2006/06/29 16:33:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01RunAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01RunAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01RunAction.hh,v 1.6 2006/06/29 16:33:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingAction.hh,v 1.6 2006/06/29 16:33:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingVerbose.hh,v 1.4 2006/06/29 16:33:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01AnalysisManager.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01AnalysisManager.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01AnalysisManager.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: AnaEx01AnalysisManager.cc,v 1.16 2006/06/29 16:33:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: AnaEx01AnalysisManager.cc,v 1.18 2009/05/13 08:33:17 gbarrand Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -70,10 +70,47 @@
 
   // Create a tree-like container to handle histograms.
-  // This tree is associated to a AnaEx01.aida file.  
-  //std::string opts = "compress=yes";
-  std::string opts = "compress=no";
-  fTree = treeFactory->create("AnaEx01.aida","xml",false,true,opts);
-  //std::string opts = "export=root";
-  //fTree = treeFactory->create("AnaEx01.root","ROOT",false,true,opts);
+  // This tree is associated to a AnaEx01.<format> file.  
+
+  std::string h_name_EAbs("EAbs");
+  std::string h_name_LAbs("LAbs");
+  std::string h_name_EGap("EGap");
+  std::string h_name_LGap("LGap");
+  std::string t_name("AnaEx01");
+
+  // File format :
+  std::string format("xml");
+  //std::string format("hbook");
+  //std::string format("root");
+
+  std::string file("AnaEx01");
+  std::string ext;
+  ext = "."+format;
+
+  std::string opts;
+  if(format=="hbook") {
+    opts = "compress=no";
+
+    h_name_EAbs = "1";
+    h_name_LAbs = "2";
+    h_name_EGap = "3";
+    h_name_LGap = "4";
+    t_name = "101";
+
+  } else if(format=="root") {
+    opts = "compress=yes";
+
+  } else if(format=="xml") {
+    ext = ".aida";
+    opts = "compress=no";
+
+  } else {
+    G4cout << "storage format \"" << format << "\""
+           << " not handled in this example."
+           << G4endl;
+    return;
+  }
+
+  file += ext;
+  fTree = treeFactory->create(file,format,false,true,opts);
 
   // Factories are not "managed" by an AIDA analysis system.
@@ -81,5 +118,9 @@
   delete treeFactory; 
 
-  if(!fTree) return;
+  if(!fTree) {
+    G4cout << "can't create tree associated to file \"" << file << "\"."
+           << G4endl;
+    return;
+  }
 
   fTree->mkdir("histograms");
@@ -90,8 +131,12 @@
     fAIDA->createHistogramFactory(*fTree);
   if(histoFactory) {
-    fEAbs = histoFactory->createHistogram1D("EAbs",100,0,100);
-    fLAbs = histoFactory->createHistogram1D("LAbs",100,0,100);
-    fEGap = histoFactory->createHistogram1D("EGap",100,0,10);
-    fLGap = histoFactory->createHistogram1D("LGap",100,0,100);
+    fEAbs = histoFactory->createHistogram1D(h_name_EAbs,"EAbs",100,0,100);
+    if(!fEAbs) G4cout << "can't create histo EAbs." << G4endl;
+    fLAbs = histoFactory->createHistogram1D(h_name_LAbs,"LAbs",100,0,100);
+    if(!fLAbs) G4cout << "can't create histo LAbs." << G4endl;
+    fEGap = histoFactory->createHistogram1D(h_name_EGap,"EGap",100,0,10);
+    if(!fEGap) G4cout << "can't create histo EGap." << G4endl;
+    fLGap = histoFactory->createHistogram1D(h_name_LGap,"LGap",100,0,100);
+    if(!fLGap) G4cout << "can't create histo LGap." << G4endl;
     delete histoFactory;
   }
@@ -106,10 +151,12 @@
     
     // Create a tuple :
-    fTuple = tupleFactory->create("AnaEx01","AnaEx01",
+    fTuple = tupleFactory->create(t_name,"AnaEx01",
       "double EAbs,double LAbs,double EGap,double LGap");
+    if(!fTuple) G4cout << "can't create tuple." << G4endl;
     
     delete tupleFactory;
   }
 
+  fTree->cd("..");
 }
 AnaEx01AnalysisManager::~AnaEx01AnalysisManager() {
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorHit.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorHit.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorHit.cc,v 1.6 2006/06/29 16:33:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorimeterSD.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorimeterSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorimeterSD.cc,v 1.5 2006/06/29 16:33:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorConstruction.cc,v 1.5 2006/06/29 16:33:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorMessenger.cc,v 1.5 2006/06/29 16:33:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01EventAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01EventAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01EventAction.cc,v 1.6 2006/06/29 16:33:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PhysicsList.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PhysicsList.cc,v 1.5 2006/06/29 16:33:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorAction.cc,v 1.5 2006/06/29 16:33:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 16:33:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01RunAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01RunAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01RunAction.cc,v 1.7 2006/06/29 16:34:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingAction.cc,v 1.7 2006/06/29 16:34:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingVerbose.cc,v 1.7 2006/06/29 16:34:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/analysis/N03Con/exampleN03Con.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/exampleN03Con.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/exampleN03Con.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: exampleN03Con.cc,v 1.2 2007/05/26 00:24:09 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/analysis/N03Con/include/ExN03DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03DetectorConstruction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03DetectorMessenger.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03EventAction.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03EventAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03EventAction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03EventActionMessenger.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03PhysicsList.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03PhysicsList.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03PrimaryGeneratorAction.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03PrimaryGeneratorMessenger.hh,v 1.1 2007/05/26 00:18:27 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03RunAction.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03RunAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03RunAction.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03SteppingAction.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03SteppingAction.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/include/ExN03SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/analysis/N03Con/include/ExN03SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/include/ExN03SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03SteppingVerbose.hh,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/analysis/N03Con/src/ExN03DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03DetectorConstruction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03DetectorMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03EventAction.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03EventAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03EventAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03EventActionMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03PhysicsList.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03PhysicsList.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03PrimaryGeneratorAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03PrimaryGeneratorMessenger.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03RunAction.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03RunAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03RunAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/analysis/N03Con/src/ExN03SteppingAction.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03SteppingAction.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/N03Con/src/ExN03SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/analysis/N03Con/src/ExN03SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/analysis/N03Con/src/ExN03SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN03SteppingVerbose.cc,v 1.1 2007/05/26 00:18:28 tkoi Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/biasing/B01/exampleB01.cc
===================================================================
--- trunk/examples/extended/biasing/B01/exampleB01.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B01/exampleB01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: exampleB01.cc,v 1.27 2007/06/22 13:22:09 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/biasing/B01/include/B01DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/biasing/B01/include/B01DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B01/include/B01DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01DetectorConstruction.hh,v 1.9 2007/06/22 13:15:29 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B01/include/B01Run.hh
===================================================================
--- trunk/examples/extended/biasing/B01/include/B01Run.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B01/include/B01Run.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01Run.hh,v 1.4 2007/06/21 15:03:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //---------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B01/include/B01RunAction.hh
===================================================================
--- trunk/examples/extended/biasing/B01/include/B01RunAction.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B01/include/B01RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01RunAction.hh,v 1.2 2007/06/21 15:03:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/biasing/B01/include/B01ScoreTable.hh
===================================================================
--- trunk/examples/extended/biasing/B01/include/B01ScoreTable.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B01/include/B01ScoreTable.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: B01ScoreTable.hh,v 1.1 2007/06/05 18:20:09 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B01/src/B01DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/biasing/B01/src/B01DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B01/src/B01DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01DetectorConstruction.cc,v 1.20 2007/06/22 13:15:29 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B01/src/B01PhysicsList.cc
===================================================================
--- trunk/examples/extended/biasing/B01/src/B01PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B01/src/B01PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01PhysicsList.cc,v 1.8 2007/06/05 18:20:09 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B01/src/B01PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/biasing/B01/src/B01PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B01/src/B01PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01PrimaryGeneratorAction.cc,v 1.8 2006/06/29 16:34:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B01/src/B01Run.cc
===================================================================
--- trunk/examples/extended/biasing/B01/src/B01Run.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B01/src/B01Run.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01Run.cc,v 1.4 2007/06/21 15:03:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B01/src/B01RunAction.cc
===================================================================
--- trunk/examples/extended/biasing/B01/src/B01RunAction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B01/src/B01RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01RunAction.cc,v 1.4 2007/06/22 13:29:45 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 #include "B01RunAction.hh"
Index: trunk/examples/extended/biasing/B01/src/B01ScoreTable.cc
===================================================================
--- trunk/examples/extended/biasing/B01/src/B01ScoreTable.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B01/src/B01ScoreTable.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B01ScoreTable.cc,v 1.2 2007/06/22 13:15:29 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/GNUmakefile
===================================================================
--- trunk/examples/extended/biasing/B02/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/biasing/B02/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.9 2004/06/18 15:59:39 daquinog Exp $
+# $Id: GNUmakefile,v 1.10 2009/03/06 09:49:18 gbarrand Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -24,6 +24,2 @@
 include $(G4INSTALL)/config/binmake.gmk
 
-ifdef G4ANALYSIS_USE
- CPPFLAGS += `aida-config --include`
- LDFLAGS += `aida-config --lib`
-endif 
Index: trunk/examples/extended/biasing/B02/exampleB02.cc
===================================================================
--- trunk/examples/extended/biasing/B02/exampleB02.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/exampleB02.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: exampleB02.cc,v 1.22 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/biasing/B02/include/B02CellScorer.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02CellScorer.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02CellScorer.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02CellScorer.hh,v 1.3 2006/06/29 16:34:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/include/B02CellScorerStore.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02CellScorerStore.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02CellScorerStore.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02CellScorerStore.hh,v 1.3 2006/06/29 16:34:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/include/B02DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02DetectorConstruction.hh,v 1.6 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/include/B02ImportanceDetectorConstruction.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02ImportanceDetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02ImportanceDetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02ImportanceDetectorConstruction.hh,v 1.7 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/include/B02PSScoringDetectorConstruction.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02PSScoringDetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02PSScoringDetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02PSScoringDetectorConstruction.hh,v 1.2 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/include/B02Run.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02Run.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02Run.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02Run.hh,v 1.2 2007/06/21 15:03:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //---------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/include/B02RunAction.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02RunAction.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02RunAction.hh,v 1.2 2007/06/21 15:03:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/biasing/B02/include/B02ScoreTable.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02ScoreTable.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02ScoreTable.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: B02ScoreTable.hh,v 1.1 2007/06/13 13:31:41 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/include/B02ScoringDetectorConstruction.hh
===================================================================
--- trunk/examples/extended/biasing/B02/include/B02ScoringDetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/biasing/B02/include/B02ScoringDetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02ScoringDetectorConstruction.hh,v 1.3 2006/06/29 16:34:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/src/B02CellScorer.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02CellScorer.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02CellScorer.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02CellScorer.cc,v 1.2 2006/06/29 16:34:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/src/B02CellScorerStore.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02CellScorerStore.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02CellScorerStore.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02CellScorerStore.cc,v 1.3 2006/06/29 16:34:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/src/B02DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02DetectorConstruction.cc,v 1.13 2007/06/13 13:31:41 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "G4Types.hh"
Index: trunk/examples/extended/biasing/B02/src/B02ImportanceDetectorConstruction.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02ImportanceDetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02ImportanceDetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02ImportanceDetectorConstruction.cc,v 1.11 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/src/B02PSScoringDetectorConstruction.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02PSScoringDetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02PSScoringDetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02PSScoringDetectorConstruction.cc,v 1.2 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/src/B02PhysicsList.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02PhysicsList.cc,v 1.7 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/src/B02PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02PrimaryGeneratorAction.cc,v 1.6 2006/06/29 16:34:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/src/B02Run.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02Run.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02Run.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02Run.cc,v 1.2 2007/06/21 15:03:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/biasing/B02/src/B02RunAction.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02RunAction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02RunAction.cc,v 1.3 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 #include "B02RunAction.hh"
Index: trunk/examples/extended/biasing/B02/src/B02ScoreTable.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02ScoreTable.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02ScoreTable.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02ScoreTable.cc,v 1.2 2007/06/22 13:38:55 ahoward Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // ----------------------------------------------------------------------
Index: trunk/examples/extended/biasing/B02/src/B02ScoringDetectorConstruction.cc
===================================================================
--- trunk/examples/extended/biasing/B02/src/B02ScoringDetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/biasing/B02/src/B02ScoringDetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: B02ScoringDetectorConstruction.cc,v 1.7 2006/06/29 16:34:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm0/DirectAccess.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/DirectAccess.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/DirectAccess.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DirectAccess.cc,v 1.2 2006/06/29 16:35:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 // ------------------------------------------------------------
Index: trunk/examples/extended/electromagnetic/TestEm0/TestEm0.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/TestEm0.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/TestEm0.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: TestEm0.cc,v 1.4 2007/06/21 17:30:53 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: TestEm0.cc,v 1.5 2009/11/17 22:48:26 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -57,7 +57,4 @@
   // set user action classes
   runManager->SetUserAction(new RunAction(det,prim));
-   
-  //Initialize G4 kernel
-  runManager->Initialize();
   
   if (argc!=1)   // batch mode   
Index: trunk/examples/extended/electromagnetic/TestEm0/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/include/DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:35:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm0/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:35:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:35:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:35:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:35:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:35:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.3 2006/06/29 16:35:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/src/DetectorConstruction.cc	(revision 1230)
@@ -26,6 +26,6 @@
 
 //
-// $Id: DetectorConstruction.cc,v 1.9 2006/12/08 16:38:38 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: DetectorConstruction.cc,v 1.10 2009/11/14 18:04:20 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -83,7 +83,9 @@
   
   G4Element* H  = new G4Element("Hydrogen" ,"H" , z= 1., a=   1.01*g/mole);
+  G4Element* C  = new G4Element("Carbon"   ,"C" , z= 6., a=  12.01*g/mole);  
   G4Element* N  = new G4Element("Nitrogen" ,"N" , z= 7., a=  14.01*g/mole);
   G4Element* O  = new G4Element("Oxygen"   ,"O" , z= 8., a=  16.00*g/mole);
   G4Element* Ge = new G4Element("Germanium","Ge", z=32., a=  72.59*g/mole);
+  G4Element* Pb = new G4Element("Lead"     ,"Pb", z=82., a= 207.19*g/mole);  
   G4Element* Bi = new G4Element("Bismuth"  ,"Bi", z=83., a= 208.98*g/mole);
   
@@ -110,5 +112,5 @@
   ///H2O->SetChemicalFormula("H_2O");
   H2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV);
-  
+        
   G4Material* steam = 
   new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1);
@@ -132,6 +134,11 @@
   new G4Material("Lead"       , z=82., a=207.19*g/mole, density= 11.35*g/cm3);
   new G4Material("Uranium"    , z=92., a=238.03*g/mole, density= 18.95*g/cm3);
-  
-
+    
+  G4Material* ams = 
+  new G4Material("ams", density= 7.409*g/cm3, ncomponents=3);
+  ams->AddElement(Pb, fractionmass = 94.81*perCent);
+  ams->AddElement(C , fractionmass =  4.79*perCent);
+  ams->AddElement(H , fractionmass =  0.40*perCent);    
+    
   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
 }
Index: trunk/examples/extended/electromagnetic/TestEm0/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:35:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/src/PhysListEmStandard.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmStandard.cc,v 1.2 2006/06/29 16:35:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.3 2009/11/14 18:04:20 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,14 +39,15 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
 
+#include "G4hMultipleScattering.hh"
 #include "G4hIonisation.hh"
 #include "G4ionIonisation.hh"
@@ -83,26 +84,26 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2,2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3,3);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2,2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3,3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1,4);
       
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
+      pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1);
+      pmanager->AddProcess(new G4MuIonisation,        -1, 2,2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,    -1, 3,3);
+      pmanager->AddProcess(new G4MuPairProduction,    -1, 4,4);       
      
     } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,     -1, 2,2);
+      pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
+      pmanager->AddProcess(new G4ionIonisation,      -1, 2,2);
 
     } else if ((!particle->IsShortLived()) &&
@@ -110,6 +111,6 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering,-1,1,1);
-      pmanager->AddProcess(new G4hIonisation,       -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering,-1,1,1);
+      pmanager->AddProcess(new G4hIonisation,        -1,2,2);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsList.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 // 
-// $Id: PhysicsList.cc,v 1.5 2006/08/17 13:50:45 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: PhysicsList.cc,v 1.8 2009/11/17 22:48:26 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,4 +35,6 @@
  
 #include "PhysListEmStandard.hh"
+#include "G4EmLivermorePhysics.hh"
+#include "G4EmPenelopePhysics.hh"
 
 #include "G4LossTableManager.hh"
@@ -180,8 +182,22 @@
   // Em options
   //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
   G4EmProcessOptions emOptions;
-  emOptions.SetBuildCSDARange(true);
+  
+  //physics tables
+  //
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+
+  emOptions.SetBuildCSDARange(true);     
   emOptions.SetMaxEnergyForCSDARange(100*TeV);
-  emOptions.SetDEDXBinningForCSDARange(120);
+  emOptions.SetDEDXBinningForCSDARange(12*20);
+  
+  emOptions.SetSplineFlag(true);	//default
+     
   emOptions.SetVerbose(0);  
 }
@@ -202,4 +218,14 @@
     delete emPhysicsList;
     emPhysicsList = new PhysListEmStandard(name);
+
+  } else if (name == "penelope"){
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmPenelopePhysics();
+
+  } else if (name == "livermore"){
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmLivermorePhysics();
         
   } else {
@@ -218,5 +244,8 @@
 
 void PhysicsList::SetCuts()
-{    
+{ 
+  // fixe lower limit for cut
+  G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100*eV, 1*GeV);
+  
   // set cut values for gamma at first and for e- second and next for e+,
   // because some processes for e+/e- need cut values for gamma
Index: trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:35:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm0/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:35:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm0/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm0/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm0/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.9 2006/12/08 16:38:38 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: RunAction.cc,v 1.10 2007/12/17 17:22:44 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -59,5 +59,9 @@
   //set precision for printing
   G4int prec = G4cout.precision(6);
-   
+  
+  //instanciate EmCalculator
+  G4EmCalculator emCal;
+  //  emCal.SetVerbose(2);
+     
   // get particle 
   G4ParticleDefinition* particle = primary->GetParticleGun()
@@ -77,5 +81,5 @@
 	 << material->GetName() << " (density: " 
 	 << G4BestUnit(density,"Volumic Mass") << ";   radiation length: "
-	 << G4BestUnit(radl,   "Length")       << ")" << G4endl;	 
+	 << G4BestUnit(radl,   "Length")       << ")" << G4endl;
 
   // get cuts	 
@@ -90,5 +94,18 @@
 	  << G4endl;
    }
-   	  
+   
+  // max energy transfert
+  if (charge != 0.) {
+  G4double Mass_c2 = particle->GetPDGMass();
+  G4double moverM = electron_mass_c2/Mass_c2;
+  G4double gamM1 = energy/Mass_c2, gam = gamM1 + 1., gamP1 = gam + 1.;
+  G4double Tmax = 
+            (2*electron_mass_c2*gamM1*gamP1)/(1.+2*gam*moverM+moverM*moverM);
+  G4double range = emCal.GetCSDARange(Tmax,G4Electron::Electron(),material);
+  
+  G4cout << "\n Max_energy _transferable : " << G4BestUnit(Tmax,"Energy")
+         << " (" << G4BestUnit(range,"Length") << ")" << G4endl;   	    
+  }
+     	  
   // get processList and extract EM processes (but not MultipleScattering)
   G4ProcessVector* plist = particle->GetProcessManager()->GetProcessList();
@@ -114,8 +131,4 @@
     G4cout << "\t" << std::setw(13) << emName[j] << "\t";
   G4cout << "\t" << std::setw(13) <<"total";
-      
-  //instanciate EmCalculator
-  G4EmCalculator emCal;
-  //  emCal.SetVerbose(2);
   
   //compute cross section per atom (only for single material)
Index: trunk/examples/extended/electromagnetic/TestEm1/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.13 2006/10/19 17:24:12 maire Exp $
+# $Id: GNUmakefile,v 1.14 2008/06/11 22:06:28 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`  
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm1/TestEm1.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/TestEm1.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/TestEm1.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm1.cc,v 1.15 2007/06/21 17:10:11 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/annihil.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/annihil.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/annihil.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: annihil.mac,v 1.1 2006/01/25 13:56:40 maire Exp $
+# $Id: annihil.mac,v 1.2 2009/09/15 12:51:49 maire Exp $
 #
 # Macro file for "TestEm1.cc"
@@ -12,5 +12,5 @@
 /testem/det/setSize 20 cm
 #
-/testem/phys/addPhysics standard
+/testem/phys/addPhysics local
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm1/brems.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/brems.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/brems.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: brems.mac,v 1.3 2006/04/10 10:22:41 vnivanch Exp $
+# $Id: brems.mac,v 1.4 2009/09/15 12:51:49 maire Exp $
 #
 # Macro file for "TestEm1.cc"
@@ -12,5 +12,5 @@
 /testem/det/setSize 50 cm
 #
-/testem/phys/addPhysics standard
+/testem/phys/addPhysics local
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm1/erange.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/erange.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/erange.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: erange.mac,v 1.1 2007/06/20 15:26:33 maire Exp $
+# $Id: erange.mac,v 1.2 2009/09/15 12:51:49 maire Exp $
 #
 # Macro file for "TestEm1.cc"
@@ -10,7 +10,7 @@
 /testem/det/setMat Water
 #
-/testem/phys/addPhysics  standard
-###/testem/phys/addPhysics  penelope
-###/testem/phys/addPhysics  livermore
+/testem/phys/addPhysics  local
+###/testem/phys/addPhysics  empenelope
+###/testem/phys/addPhysics  emlivermore
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm1/gammaconversion.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/gammaconversion.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/gammaconversion.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: gammaconversion.mac,v 1.1 2006/01/25 13:56:40 maire Exp $
+# $Id: gammaconversion.mac,v 1.2 2009/09/15 12:51:49 maire Exp $
 #
 # Macro file for "TestEm1.cc"
@@ -12,5 +12,5 @@
 /testem/det/setSize 1 m
 #
-/testem/phys/addPhysics standard
+/testem/phys/addPhysics local
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm1/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:36:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm1/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.3 2006/06/29 16:36:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EventAction.hh,v 1.3 2006/06/29 16:36:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm1/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:36:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.6 2007/11/12 15:48:58 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.4 2007/11/12 15:48:58 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.5 2007/11/12 15:48:58 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.4 2006/06/29 16:36:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:36:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:36:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:36:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/ProcessesCount.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.10 2006/06/29 16:36:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.8 2006/06/29 16:36:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.2 2006/06/29 16:36:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:36:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:36:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:36:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm1/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.4 2006/06/29 16:36:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/ionis.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/ionis.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/ionis.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: ionis.mac,v 1.2 2006/01/25 13:56:40 maire Exp $
+# $Id: ionis.mac,v 1.3 2009/09/15 12:51:49 maire Exp $
 #
 # Macro file for "TestEm1.cc"
@@ -12,5 +12,5 @@
 /testem/det/setSize 50 cm
 #
-/testem/phys/addPhysics standard
+/testem/phys/addPhysics local
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm1/range.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/range.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/range.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: range.mac,v 1.11 2007/06/20 15:26:33 maire Exp $
+# $Id: range.mac,v 1.12 2009/09/15 12:51:49 maire Exp $
 #
 # Macro file for "TestEm1.cc"
@@ -12,7 +12,7 @@
 /testem/det/setSize 10 cm
 #
-/testem/phys/addPhysics  standard
-###/testem/phys/addPhysics  penelope
-###/testem/phys/addPhysics  livermore
+/testem/phys/addPhysics  local
+###/testem/phys/addPhysics  empenelope
+###/testem/phys/addPhysics  emlivermore
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm1/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/DetectorConstruction.cc	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.8 2007/11/12 15:48:58 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm1/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:36:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EventAction.cc,v 1.7 2007/11/12 15:48:58 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm1/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:37:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.10 2007/11/12 15:48:58 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.13 2008/09/12 16:32:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem1";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";
+  fileType    = "root";
+  fileOption  = "export=root";
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -215,5 +215,5 @@
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -228,4 +228,6 @@
 {
 #ifdef G4ANALYSIS_USE
+
+ if (!ascii[0]) return;
  
  G4String name = fileName[0] + ".ascii";
@@ -241,5 +243,6 @@
       for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
          File << "  " << iBin << "\t" 
-              << histo[ih]->binMean(iBin) << "\t"
+	      << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
+	              histo[ih]->axis().binUpperEdge(iBin)) << "\t"
 	      << histo[ih]->binHeight(iBin) 
 	      << G4endl;
Index: trunk/examples/extended/electromagnetic/TestEm1/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.6 2007/11/12 15:48:58 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/PhysListEmStandard.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmStandard.cc,v 1.14 2007/06/20 15:26:33 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.21 2009/11/13 15:44:28 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,15 +39,20 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
+#include "G4UrbanMscModel93.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
 
+#include "G4hMultipleScattering.hh"
 #include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
+
 #include "G4ionIonisation.hh"
 
@@ -86,28 +91,42 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2, 2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3, 3);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2, 2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3, 3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 4);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);      
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
       
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1, 1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2, 2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3, 3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4, 4);       
-     
-    } else if( particleName == "alpha" || particleName == "He3" 
-	       || particleName == "GenericIon" ) { 
+      pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,        -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,    -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,    -1, 4, 4);       
+             
+    } else if( particleName == "proton" ||
+               particleName == "pi-" ||
+               particleName == "pi+"    ) {
+      //proton  
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
+          
+    } else if( particleName == "alpha" ||
+               particleName == "He3" ||
+	       particleName == "GenericIon" ) { 
 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1, 1);
-      pmanager->AddProcess(new G4ionIonisation,     -1, 2, 2);
+      pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,      -1, 2, 2);
 
     } else if ((!particle->IsShortLived()) &&
@@ -115,30 +134,39 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1, 1);
-      pmanager->AddProcess(new G4hIonisation,       -1, 2, 2);
+      pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,        -1, 2, 2);
     }
   }
-  
+
   // Em options
   //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
   G4EmProcessOptions emOptions;
-    
-  //coulomb scattering
+  
+  //physics tables
   //
-  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);   
-  emOptions.SetSkin(2.);
-  
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //multiple coulomb scattering
+  //
+  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
+  emOptions.SetMscRangeFactor(0.04);	//default
+  emOptions.SetMscGeomFactor (2.5);	//default       
+  emOptions.SetSkin(3.);		//default
+      
   //energy loss
   //
-  emOptions.SetLinearLossLimit(1.e-6);
-  emOptions.SetStepFunction(0.2, 100*um); 
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);		//default
    
   //ionization
   //
-  emOptions.SetSubCutoff(true);
-    
-  // define high energy threshold for bremstrahlung 
-  //
-  emOptions.SetBremsstrahlungTh(10.*GeV);
+  emOptions.SetSubCutoff(false);		//default=false  
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsList.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 // 
-// $Id: PhysicsList.cc,v 1.10 2006/10/19 17:24:13 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.12 2009/09/15 12:51:49 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,6 +35,11 @@
  
 #include "PhysListEmStandard.hh"
-#include "PhysListEmLivermore.hh"
-#include "PhysListEmPenelope.hh"
+
+#include "G4EmStandardPhysics.hh"
+#include "G4EmStandardPhysics_option1.hh"
+#include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
+#include "G4EmLivermorePhysics.hh"
+#include "G4EmPenelopePhysics.hh"
 
 #include "DetectorConstruction.hh"
@@ -61,5 +66,5 @@
 
   // EM physics
-  emName = G4String("standard");
+  emName = G4String("local");
   emPhysicsList = new PhysListEmStandard(emName);
 
@@ -189,5 +194,6 @@
   G4EmProcessOptions emOptions;
   emOptions.SetBuildCSDARange(true);
-  
+  emOptions.SetDEDXBinningForCSDARange(8*20);
+    
   // Decay Process
   //
@@ -209,22 +215,44 @@
   if (name == emName) return;
 
-  if (name == "standard") {
+  if (name == "local") {
 
     emName = name;
     delete emPhysicsList;
     emPhysicsList = new PhysListEmStandard(name);
- 
-  } else if (name == "livermore") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmLivermore(name);
     
-  } else if (name == "penelope") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmPenelope(name);
-        
+  } else if (name == "emstandard_opt0") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics();
+
+  } else if (name == "emstandard_opt1") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option1();
+
+  } else if (name == "emstandard_opt2") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option2();
+
+  } else if (name == "emstandard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
+
+  } else if (name == "emlivermore") {
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmLivermorePhysics();
+    
+  } else if (name == "empenelope") {
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmPenelopePhysics();
+            
   } else {
 
Index: trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:37:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.4 2006/06/29 16:37:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:37:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.19 2006/06/29 16:37:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.2 2006/06/29 16:37:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 16:37:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.8 2006/06/29 16:37:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:37:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm1/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm1/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm1/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.10 2006/06/29 16:37:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm10/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.4 2006/10/26 15:19:21 maire Exp $
+# $Id: GNUmakefile,v 1.5 2008/06/11 22:34:04 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -15,15 +15,7 @@
 all: lib bin
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
+#### G4ANALYSIS_USE := true
 
 include $(G4INSTALL)/config/architecture.gmk
-
-# for the aida-config command see the README file
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm10/TestEm10.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/TestEm10.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/TestEm10.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm10.cc,v 1.9 2007/07/27 17:52:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorHit.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorHit.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10CalorHit.hh,v 1.4 2006/06/29 16:37:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorimeterSD.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorimeterSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10CalorimeterSD.hh,v 1.3 2006/06/29 16:37:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10DetectorConstruction.hh,v 1.19 2006/06/29 16:37:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10DetectorMessenger.hh,v 1.7 2006/06/29 16:37:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10EventAction.hh,v 1.3 2006/06/29 16:37:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10EventActionMessenger.hh,v 1.3 2006/06/29 16:37:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PhysicsList.hh,v 1.11 2006/06/29 16:37:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsListMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PhysicsListMessenger.hh,v 1.7 2006/06/29 16:37:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:38:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:38:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10RunAction.hh,v 1.5 2006/06/29 16:38:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunMessenger.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: Em10RunMessenger.hh,v 1.3 2006/06/29 16:38:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10StepCut.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10StepCut.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10StepCut.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10StepCut.hh,v 1.5 2006/06/29 16:38:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10SteppingAction.hh,v 1.3 2006/06/29 16:38:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10SteppingMessenger.hh,v 1.3 2006/06/29 16:38:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10SteppingVerbose.hh,v 1.3 2006/06/29 16:38:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/electromagnetic/TestEm10/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.2 2006/06/29 16:38:24 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm10/include/TRTDetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/TRTDetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/TRTDetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TRTDetectorConstruction.hh,v 1.3 2006/06/29 16:38:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/include/TRTMaterials.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/include/TRTMaterials.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/include/TRTMaterials.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TRTMaterials.hh,v 1.3 2006/06/29 16:38:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorHit.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorHit.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10CalorHit.cc,v 1.4 2006/06/29 16:38:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorimeterSD.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorimeterSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10CalorimeterSD.cc,v 1.4 2006/06/29 16:38:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10DetectorConstruction.cc,v 1.32 2007/07/27 17:52:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10DetectorMessenger.cc,v 1.11 2006/06/29 16:38:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10EventAction.cc,v 1.6 2006/06/29 16:38:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10EventActionMessenger.cc,v 1.4 2006/06/29 16:38:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PhysicsList.cc,v 1.24 2006/06/29 16:38:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsListMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PhysicsListMessenger.cc,v 1.9 2006/06/29 16:38:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PrimaryGeneratorAction.cc,v 1.6 2006/06/29 16:38:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:38:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10RunAction.cc,v 1.9 2006/06/29 16:38:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10RunMessenger.cc,v 1.5 2006/06/29 16:39:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10StepCut.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10StepCut.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10StepCut.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10StepCut.cc,v 1.3 2006/06/29 16:39:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10SteppingAction.cc,v 1.6 2006/06/29 16:39:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10SteppingMessenger.cc,v 1.4 2006/06/29 16:39:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em10SteppingVerbose.cc,v 1.6 2006/06/29 16:39:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
Index: trunk/examples/extended/electromagnetic/TestEm10/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm10/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm10/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.2 2006/06/29 16:39:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 ///////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/electromagnetic/TestEm11/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.5 2006/09/20 09:29:37 maire Exp $
+# $Id: GNUmakefile,v 1.10 2008/06/11 22:37:54 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm11/TestEm11.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/TestEm11.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/TestEm11.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm11.cc,v 1.3 2006/06/29 16:39:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:39:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:39:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:39:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:39:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.5 2007/11/07 17:22:15 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/HistoMessenger.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoMessenger.hh,v 1.4 2007/11/07 17:22:16 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoMessenger.hh,v 1.5 2008/01/11 13:01:57 jjacquem Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -63,8 +63,10 @@
    G4UIcmdWithAString*        factoryCmd;
    G4UIcmdWithAString*        typeCmd;
+   G4UIcmdWithAString*        optionCmd;
    G4UIcommand*               histoCmd;
    G4UIcmdWithAnInteger*      prhistoCmd;
    G4UIcmdWithAnInteger*      rmhistoCmd;   
    G4UIcmdWithADoubleAndUnit* csdaCmd;
+  
 };
 
Index: trunk/examples/extended/electromagnetic/TestEm11/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:39:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:39:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:39:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:39:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.2 2006/06/29 16:39:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.3 2007/08/19 20:52:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.3 2006/06/29 16:39:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 16:40:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:40:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:40:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:40:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/range.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/range.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/range.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: range.mac,v 1.4 2007/08/19 20:52:53 maire Exp $
+# $Id: range.mac,v 1.5 2009/09/22 14:20:31 maire Exp $
 #
 # Macro file for "TestEm11.cc"
@@ -13,7 +13,7 @@
 /testem/det/setSizeYZ 5 mm
 #
-/testem/phys/addPhysics  standard
-###/testem/phys/addPhysics  penelope
-###/testem/phys/addPhysics  livermore
+/testem/phys/addPhysics  local
+###/testem/phys/addPhysics  empenelope
+###/testem/phys/addPhysics  emlivermore
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm11/run01.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/run01.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/run01.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run01.mac,v 1.5 2006/07/06 15:56:38 maire Exp $
+# $Id: run01.mac,v 1.6 2009/09/22 14:20:31 maire Exp $
 #
 # limit the step size from histo 1
@@ -10,6 +10,6 @@
 /testem/det/setSizeYZ 1 mm
 #
-/testem/phys/addPhysics  standard	# em physics
-###/testem/phys/addPhysics  penelope  	# em physics 
+/testem/phys/addPhysics  local	# em physics
+###/testem/phys/addPhysics  empenelope  	# em physics 
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm11/run02.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/run02.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/run02.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run02.mac,v 1.4 2006/10/26 10:18:59 maire Exp $
+# $Id: run02.mac,v 1.5 2009/09/22 14:20:31 maire Exp $
 #
 # limit the step size by geometry
@@ -11,6 +11,6 @@
 /testem/det/setNbOfLayers 100
 #
-/testem/phys/addPhysics  standard	# em physics
-###/testem/phys/addPhysics  penelope  	# em physics 
+/testem/phys/addPhysics  local	# em physics
+###/testem/phys/addPhysics  empenelope  	# em physics 
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm11/sandia.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/sandia.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/sandia.mac	(revision 1230)
@@ -1,7 +1,8 @@
-# $Id: sandia.mac,v 1.1 2007/08/19 20:52:53 maire Exp $
+# $Id: sandia.mac,v 1.9 2009/09/22 14:20:31 maire Exp $
 #
 # limit the step size from histo 8
 #
-# G.J.Lockwood et al. Sandia report SAND79-0414.UC-34a, February 1987
+# G.J.Lockwood et al.
+#     Sandia report SAND79-0414.UC-34a, February 1987
 # O.Kadri et al. NIM B 258 (2007) 381
 #
@@ -10,19 +11,21 @@
 #
 /testem/det/setMat G4_Al
+###/testem/det/setMat G4_Mo
 ###/testem/det/setMat G4_Ta
 /testem/det/setSizeX  1 cm
 /testem/det/setSizeYZ 1 cm
 #
-/testem/phys/addPhysics  standard	# em physics
+/testem/phys/addPhysics  local	# em physics
 #
 /run/initialize
 #
 /gun/particle e-
-/gun/energy 500 keV
+/gun/energy 314 keV
 #
-/testem/histo/setFileType hbook
-/testem/histo/setFileName Al.500keV
+###/testem/histo/setFileType hbook
+/testem/histo/setFileType root
+/testem/histo/setFileName sandia/Al.314keV
 /testem/histo/setHisto 8 100 0.  1.0 none	#normalized Edep profile
-###/testem/histo/setHisto 8 100 0.  0.5 none
+###/testem/histo/setHisto 8 100 0.  0.5 none	#for Ta
 #
 /testem/event/printModulo 10000
Index: trunk/examples/extended/electromagnetic/TestEm11/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/DetectorConstruction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: DetectorConstruction.cc,v 1.8 2007/11/07 17:22:16 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: DetectorConstruction.cc,v 1.9 2009/11/16 15:09:10 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 //
@@ -91,4 +91,5 @@
   man->FindOrBuildMaterial("G4_Si", isotopes);
   man->FindOrBuildMaterial("G4_Fe", isotopes);
+  man->FindOrBuildMaterial("G4_Cu", isotopes);  
   man->FindOrBuildMaterial("G4_Ge", isotopes);
   man->FindOrBuildMaterial("G4_Mo", isotopes);
Index: trunk/examples/extended/electromagnetic/TestEm11/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:40:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.2 2006/06/29 16:40:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:40:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.6 2007/11/07 17:22:16 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.10 2008/09/22 15:11:34 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "dummy";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -223,6 +223,6 @@
 {
  if (ih > MaxHisto) {
-    G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih
-           << "does not exist" << G4endl;
+    G4cout << "---> warning from HistoManager::Scale() : histo " << ih
+           << "does not exist  (fac = " << fac << ")"  << G4endl;
     return;
   }
@@ -236,5 +236,5 @@
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -249,4 +249,6 @@
 {
 #ifdef G4ANALYSIS_USE
+
+ if (!ascii[0]) return;
  
  G4String name = fileName[0] + ".ascii";
@@ -262,5 +264,6 @@
       for (G4int iBin=0; iBin<Nbins[ih]; ++iBin) {
          File << "  " << iBin << "\t" 
-              << histo[ih]->binMean(iBin) << "\t"
+              << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
+	              histo[ih]->axis().binUpperEdge(iBin)) << "\t"	      
 	      << histo[ih]->binHeight(iBin) 
 	      << G4endl;
Index: trunk/examples/extended/electromagnetic/TestEm11/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/HistoMessenger.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoMessenger.cc,v 1.5 2007/11/07 17:22:16 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoMessenger.cc,v 1.6 2008/01/11 13:01:57 jjacquem Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,4 +56,7 @@
   typeCmd->SetGuidance("set histograms file type: hbook, root, XML");
   typeCmd->SetCandidates("hbook root XML");
+
+  optionCmd = new G4UIcmdWithAString("/testem/histo/setFileOption",this);
+  optionCmd->SetGuidance("set option for the histograms file");
 
   histoCmd = new G4UIcommand("/testem/histo/setHisto",this);
@@ -112,4 +115,5 @@
   delete factoryCmd;
   delete histoDir;
+  delete optionCmd;
 }
 
@@ -123,4 +127,7 @@
   if (command == typeCmd)
     histoManager->SetFileType(newValues);
+
+  if (command == optionCmd)
+    histoManager->SetFileOption(newValues);
 
   if (command == histoCmd)
Index: trunk/examples/extended/electromagnetic/TestEm11/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/PhysListEmStandard.cc	(revision 1230)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: PhysListEmStandard.cc,v 1.3 2006/06/29 16:40:34 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: PhysListEmStandard.cc,v 1.11 2009/11/16 15:09:10 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,16 +38,26 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
+#include "G4UrbanMscModel93.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
 
+#include "G4hMultipleScattering.hh"
 #include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
+
 #include "G4ionIonisation.hh"
+#include "G4IonParametrisedLossModel.hh"
+#include "G4NuclearStopping.hh"
+
+#include "G4EmProcessOptions.hh"
+#include "G4MscStepLimitType.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -68,5 +77,6 @@
 {
   // Add standard EM Processes
-  
+  //
+
   theParticleIterator->reset();
   while( (*theParticleIterator)() ){
@@ -76,5 +86,5 @@
      
     if (particleName == "gamma") {
-      // gamma         
+      // gamma
       pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
       pmanager->AddDiscreteProcess(new G4ComptonScattering);
@@ -83,35 +93,90 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      	    
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);      
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);            
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
             
-    } else if( particleName == "mu+" || 
+    } else if (particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
+      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);
+             
+    } else if( particleName == "proton" ||
+               particleName == "pi-" ||
+               particleName == "pi+"    ) {
+      //proton  
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
      
-    } else if( particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,     -1, 2,2);
-
+    } else if( particleName == "alpha" || 
+	       particleName == "He3"    ) {
+      //alpha 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
+      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);
+            
+    } else if( particleName == "GenericIon" ) {
+      //Ions 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      G4ionIonisation* ionIoni = new G4ionIonisation();
+      ionIoni->SetEmModel(new G4IonParametrisedLossModel());
+      pmanager->AddProcess(ionIoni,                   -1, 2, 2);      
+      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);      
+      
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering,-1,1,1);
-      pmanager->AddProcess(new G4hIonisation,       -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     }
   }
+
+  // Em options
+  //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
+  G4EmProcessOptions emOptions;
+  
+  //physics tables
+  //
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //multiple coulomb scattering
+  //
+  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
+  emOptions.SetMscRangeFactor(0.04);	//default
+  emOptions.SetMscGeomFactor (2.5);	//default       
+  emOptions.SetSkin(3.);		//default
+      
+  //energy loss
+  //
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);		//default
+   
+  //ionization
+  //
+  emOptions.SetSubCutoff(false);	//default
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.5 2006/10/26 10:18:59 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.7 2009/09/22 14:20:31 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,6 +34,11 @@
 
 #include "PhysListEmStandard.hh"
-#include "PhysListEmLivermore.hh"
-#include "PhysListEmPenelope.hh"
+
+#include "G4EmStandardPhysics.hh"
+#include "G4EmStandardPhysics_option1.hh"
+#include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
+#include "G4EmLivermorePhysics.hh"
+#include "G4EmPenelopePhysics.hh"
 
 #include "G4LossTableManager.hh"
@@ -57,5 +62,5 @@
 
   // EM physics
-  emPhysicsList = new PhysListEmStandard(emName = "standard");
+  emPhysicsList = new PhysListEmStandard(emName = "local");
 
 }
@@ -186,5 +191,6 @@
   G4EmProcessOptions emOptions;
   emOptions.SetBuildCSDARange(true);
-  
+  emOptions.SetDEDXBinningForCSDARange(8*20);
+    
   // decay process
   //
@@ -206,21 +212,43 @@
   if (name == emName) return;
 
-  if (name == "standard") {
+  if (name == "local") {
 
     emName = name;
     delete emPhysicsList;
     emPhysicsList = new PhysListEmStandard(name);
+
+  } else if (name == "emstandard_opt0") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics();
     
-  } else if (name == "livermore") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmLivermore(name);
+  } else if (name == "emstandard_opt1") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option1();
+
+  } else if (name == "emstandard_opt2") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option2();
+        
+  } else if (name == "emstandard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
+            
+  } else if (name == "emlivermore") {
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmLivermorePhysics();
     
-  } else if (name == "penelope") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmPenelope(name);
+  } else if (name == "empenelope") {
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmPenelopePhysics();
         
   } else {
Index: trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:40:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:40:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.2 2006/06/29 16:40:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.7 2007/08/19 20:52:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.3 2006/06/29 16:40:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:40:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.5 2007/08/19 20:52:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:41:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.2 2006/06/29 16:41:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm11/water.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm11/water.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm11/water.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: water.mac,v 1.4 2006/09/18 17:26:20 maire Exp $
+# $Id: water.mac,v 1.5 2009/09/22 14:20:31 maire Exp $
 #
 # no constraint on tracking step
@@ -10,6 +10,5 @@
 /testem/det/setSizeYZ 3 cm
 #
-/testem/phys/addPhysics  standard	# em physics
-###/testem/phys/addPhysics  g4v52  	# em physics 
+/testem/phys/addPhysics  local	# em physics
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm12/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.2 2006/10/25 17:27:01 maire Exp $
+# $Id: GNUmakefile,v 1.5 2008/06/11 22:40:49 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm12/TestEm12.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/TestEm12.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/TestEm12.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm12.cc,v 1.4 2006/06/29 16:41:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:42:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:42:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:42:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:42:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.6 2007/11/09 17:35:06 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/HistoMessenger.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoMessenger.hh,v 1.3 2007/11/09 17:35:06 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoMessenger.hh,v 1.4 2008/01/11 13:11:31 jjacquem Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -63,4 +63,5 @@
    G4UIcmdWithAString*        factoryCmd;
    G4UIcmdWithAString*        typeCmd;
+   G4UIcmdWithAString*        optionCmd;
    G4UIcommand*               histoCmd;
    G4UIcmdWithAnInteger*      prhistoCmd;   
Index: trunk/examples/extended/electromagnetic/TestEm12/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:42:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:42:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:42:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:42:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.2 2006/06/29 16:42:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.4 2007/04/27 10:38:11 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.3 2006/06/29 16:42:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 16:42:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:42:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:42:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:42:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/run01.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/run01.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/run01.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run01.mac,v 1.6 2007/04/27 10:38:11 maire Exp $
+# $Id: run01.mac,v 1.7 2009/09/22 15:18:20 maire Exp $
 #
 # limit the step size from histos 1 and 8
@@ -9,7 +9,7 @@
 /testem/det/setRadius  3 cm
 #
-/testem/phys/addPhysics  standard	# em physics
-###/testem/phys/addPhysics  livermore	# em physics
-###/testem/phys/addPhysics  penelope	# em physics
+/testem/phys/addPhysics  local	# em physics
+###/testem/phys/addPhysics  emlivermore	# em physics
+###/testem/phys/addPhysics  empenelope	# em physics
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm12/run02.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/run02.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/run02.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run02.mac,v 1.5 2007/04/27 10:38:11 maire Exp $
+# $Id: run02.mac,v 1.6 2009/09/22 15:18:20 maire Exp $
 #
 # limit the step size by geometry
@@ -10,7 +10,7 @@
 /testem/det/setNbOfLayers 150
 #
-/testem/phys/addPhysics  standard	# em physics
-###/testem/phys/addPhysics  livermore  	# em physics
-###/testem/phys/addPhysics  penelope  	# em physics 
+/testem/phys/addPhysics  local	# em physics
+###/testem/phys/addPhysics  emlivermore  	# em physics
+###/testem/phys/addPhysics  empenelope  	# em physics 
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm12/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.2 2006/06/29 16:43:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:43:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.2 2006/06/29 16:43:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:43:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.6 2007/11/09 17:35:06 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.11 2008/09/23 20:48:12 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem12";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -224,5 +224,5 @@
  if (ih > MaxHisto) {
     G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih
-           << "does not exist" << G4endl;
+           << "does not exist  (fac = " << fac << ")"  << G4endl;
     return;
   }
@@ -236,5 +236,5 @@
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -249,5 +249,7 @@
 {
 #ifdef G4ANALYSIS_USE
- 
+
+ if (!ascii[0] ) return;
+  
  G4String name = fileName[0] + ".ascii";
  std::ofstream File(name, std::ios::out);
@@ -262,5 +264,6 @@
       for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
          File << "  " << iBin << "\t" 
-              << histo[ih]->binMean(iBin) << "\t"
+              << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
+	              histo[ih]->axis().binUpperEdge(iBin)) << "\t"	      
 	      << histo[ih]->binHeight(iBin) 
 	      << G4endl;
Index: trunk/examples/extended/electromagnetic/TestEm12/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/HistoMessenger.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoMessenger.cc,v 1.4 2007/11/09 17:35:06 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoMessenger.cc,v 1.5 2008/01/11 13:11:31 jjacquem Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,4 +56,8 @@
   typeCmd->SetGuidance("set histograms file type: hbook, root, XML");
   typeCmd->SetCandidates("hbook root XML");
+
+  optionCmd = new G4UIcmdWithAString("/testem/histo/setFileOption",this);
+  optionCmd->SetGuidance("set option for the histograms file");
+
 
   histoCmd = new G4UIcommand("/testem/histo/setHisto",this);
@@ -112,4 +116,5 @@
   delete factoryCmd;
   delete histoDir;
+  delete optionCmd;
 }
 
@@ -123,4 +128,9 @@
   if (command == typeCmd)
     histoManager->SetFileType(newValues);
+
+  if (command == optionCmd)
+    histoManager->SetFileOption(newValues);
+
+
 
   if (command == histoCmd)
Index: trunk/examples/extended/electromagnetic/TestEm12/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/PhysListEmStandard.cc	(revision 1230)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: PhysListEmStandard.cc,v 1.2 2006/06/29 16:43:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.8 2009/11/16 16:18:27 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,16 +38,26 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
+#include "G4UrbanMscModel93.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
 
+#include "G4hMultipleScattering.hh"
 #include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
+
 #include "G4ionIonisation.hh"
+#include "G4IonParametrisedLossModel.hh"
+#include "G4NuclearStopping.hh"
+
+#include "G4EmProcessOptions.hh"
+#include "G4MscStepLimitType.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -68,4 +77,5 @@
 {
   // Add standard EM Processes
+  //
 
   theParticleIterator->reset();
@@ -76,5 +86,5 @@
      
     if (particleName == "gamma") {
-      // gamma         
+      // gamma
       pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
       pmanager->AddDiscreteProcess(new G4ComptonScattering);
@@ -83,35 +93,90 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);      
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
-      
-    } else if( particleName == "mu+" || 
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);            
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
+            
+    } else if (particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
+      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);
+             
+    } else if( particleName == "proton" ||
+               particleName == "pi-" ||
+               particleName == "pi+"    ) {
+      //proton  
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
      
-    } else if( particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,     -1, 2,2);
-
+    } else if( particleName == "alpha" || 
+	       particleName == "He3"    ) {
+      //alpha 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
+      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);
+            
+    } else if( particleName == "GenericIon" ) {
+      //Ions 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      G4ionIonisation* ionIoni = new G4ionIonisation();
+      ionIoni->SetEmModel(new G4IonParametrisedLossModel());
+      pmanager->AddProcess(ionIoni,                   -1, 2, 2);      
+      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);      
+      
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering,-1,1,1);
-      pmanager->AddProcess(new G4hIonisation,       -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     }
   }
+
+  // Em options
+  //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
+  G4EmProcessOptions emOptions;
+  
+  //physics tables
+  //
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //multiple coulomb scattering
+  //
+  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
+  emOptions.SetMscRangeFactor(0.04);	//default
+  emOptions.SetMscGeomFactor (2.5);	//default       
+  emOptions.SetSkin(3.);		//default
+      
+  //energy loss
+  //
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);		//default
+   
+  //ionization
+  //
+  emOptions.SetSubCutoff(false);	//default
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.6 2007/08/19 20:57:28 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.8 2009/09/22 15:18:20 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,6 +34,11 @@
 
 #include "PhysListEmStandard.hh"
-#include "PhysListEmLivermore.hh"
-#include "PhysListEmPenelope.hh"
+
+#include "G4EmStandardPhysics.hh"
+#include "G4EmStandardPhysics_option1.hh"
+#include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
+#include "G4EmLivermorePhysics.hh"
+#include "G4EmPenelopePhysics.hh"
 
 #include "G4LossTableManager.hh"
@@ -57,5 +62,5 @@
 
   // EM physics
-  emPhysicsList = new PhysListEmStandard(emName = "standard");
+  emPhysicsList = new PhysListEmStandard(emName = "local");
 
 }
@@ -186,5 +191,6 @@
   G4EmProcessOptions emOptions;
   emOptions.SetBuildCSDARange(true);
-  
+  emOptions.SetDEDXBinningForCSDARange(8*20);
+    
   // decay process
   //
@@ -206,5 +212,5 @@
   if (name == emName) return;
 
-  if (name == "standard") {
+  if (name == "local") {
 
     emName = name;
@@ -212,15 +218,38 @@
     emPhysicsList = new PhysListEmStandard(name);
     
-  } else if (name == "livermore") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmLivermore(name);
+  } else if (name == "emstandard_opt0") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics();
     
-  } else if (name == "penelope") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmPenelope(name);
+  } else if (name == "emstandard_opt1") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option1();
+
+  } else if (name == "emstandard_opt2") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option2();
+        
+  } else if (name == "emstandard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
+            
+  } else if (name == "emlivermore") {
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmLivermorePhysics();
+    
+  } else if (name == "empenelope") {
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmPenelopePhysics();
+
      
   } else {
Index: trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:43:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:43:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.2 2006/06/29 16:43:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.8 2007/08/19 20:57:29 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.3 2006/06/29 16:43:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:43:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.4 2007/04/27 10:38:11 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:43:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm12/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm12/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm12/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.2 2006/06/29 16:43:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.3 2006/10/24 16:04:29 maire Exp $
+# $Id: GNUmakefile,v 1.4 2008/06/11 22:44:24 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,10 +17,4 @@
 include $(G4INSTALL)/config/architecture.gmk
 
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`  
-endif
-
 include $(G4INSTALL)/config/binmake.gmk
 
Index: trunk/examples/extended/electromagnetic/TestEm13/TestEm13.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/TestEm13.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/TestEm13.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm13.cc,v 1.5 2007/06/24 22:26:54 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/gamma.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/gamma.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/gamma.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: gamma.mac,v 1.4 2007/06/24 22:26:54 maire Exp $
+# $Id: gamma.mac,v 1.5 2009/09/25 11:27:13 maire Exp $
 #
 # Macro file for "TestEm13.cc"
@@ -12,6 +12,4 @@
 /testem/det/setSize 1 cm
 #
-/testem/phys/addPhysics standard
-#
 /run/initialize
 #
Index: trunk/examples/extended/electromagnetic/TestEm13/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:43:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:43:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:43:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:44:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmLivermore.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmLivermore.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmLivermore.hh	(revision 1230)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: PhysListEmLivermore.hh,v 1.2 2006/06/29 16:44:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmLivermore.hh,v 1.4 2009/11/19 17:30:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,5 +41,5 @@
 {
   public: 
-    PhysListEmLivermore(const G4String& name = "Livermore");
+    PhysListEmLivermore(const G4String& name = "livermore");
    ~PhysListEmLivermore();
 
Index: trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmPenelope.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmPenelope.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmPenelope.hh	(revision 1230)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: PhysListEmPenelope.hh,v 1.2 2006/06/29 16:44:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmPenelope.hh,v 1.4 2009/11/19 17:30:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,5 +41,5 @@
 {
   public: 
-    PhysListEmPenelope(const G4String& name = "Penelope");
+    PhysListEmPenelope(const G4String& name = "penelope");
    ~PhysListEmPenelope();
 
Index: trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmStandard.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:44:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:44:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:44:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:44:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/ProcessesCount.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.2 2006/06/29 16:44:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.3 2006/06/29 16:44:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:44:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:44:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm13/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.5 2006/06/29 16:44:24 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:44:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.2 2006/06/29 16:44:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:44:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmLivermore.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmLivermore.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmLivermore.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmLivermore.cc,v 1.3 2006/06/29 16:44:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmLivermore.cc,v 1.5 2009/11/19 17:30:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,14 +35,32 @@
 #include "G4ProcessManager.hh"
 
-#include "G4LowEnergyCompton.hh"
-#include "G4LowEnergyGammaConversion.hh"
-#include "G4LowEnergyPhotoElectric.hh"
-#include "G4LowEnergyRayleigh.hh"
+// gamma
 
-#include "G4LowEnergyIonisation.hh"
-#include "G4LowEnergyBremsstrahlung.hh"
+#include "G4PhotoElectricEffect.hh"
+#include "G4LivermorePhotoElectricModel.hh"
+
+#include "G4ComptonScattering.hh"
+#include "G4LivermoreComptonModel.hh"
+
+#include "G4GammaConversion.hh"
+#include "G4LivermoreGammaConversionModel.hh"
+
+#include "G4RayleighScattering.hh" 
+#include "G4LivermoreRayleighModel.hh"
+
+// e-
+
 #include "G4eIonisation.hh"
+#include "G4LivermoreIonisationModel.hh"
+#include "G4UniversalFluctuation.hh"
+
 #include "G4eBremsstrahlung.hh"
+#include "G4LivermoreBremsstrahlungModel.hh"
+
+// e+
+
 #include "G4eplusAnnihilation.hh"
+
+// mu
 
 #include "G4MuIonisation.hh"
@@ -50,5 +68,9 @@
 #include "G4MuPairProduction.hh"
 
-#include "G4hLowEnergyIonisation.hh"
+// hadrons, ions
+
+#include "G4hIonisation.hh"
+#include "G4ionIonisation.hh"
+
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -67,5 +89,5 @@
 void PhysListEmLivermore::ConstructProcess()
 {
-  // Add LowEn or standard EM Processes
+  // Add standard EM Processes
 
   theParticleIterator->reset();
@@ -74,35 +96,78 @@
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
-     
+
+    //Applicability range for Livermore models
+    //for higher energies, the Standard models are used   
+    G4double highEnergyLimit = 1*GeV;
+         
     if (particleName == "gamma") {
       // gamma         
-      pmanager->AddDiscreteProcess(new G4LowEnergyPhotoElectric);
-      pmanager->AddDiscreteProcess(new G4LowEnergyCompton);
-      pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion);
-      pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh);
+
+      G4PhotoElectricEffect* phot = new G4PhotoElectricEffect();
+      G4LivermorePhotoElectricModel* 
+      photModel = new G4LivermorePhotoElectricModel();
+      photModel->SetHighEnergyLimit(highEnergyLimit);
+      phot->AddEmModel(0, photModel);
+      pmanager->AddDiscreteProcess(phot);
+
+      G4ComptonScattering* compt = new G4ComptonScattering();
+      G4LivermoreComptonModel* 
+      comptModel = new G4LivermoreComptonModel();
+      comptModel->SetHighEnergyLimit(highEnergyLimit);
+      compt->AddEmModel(0, comptModel);
+      pmanager->AddDiscreteProcess(compt);
+
+      G4GammaConversion* conv = new G4GammaConversion();
+      G4LivermoreGammaConversionModel* 
+      convModel = new G4LivermoreGammaConversionModel();
+      convModel->SetHighEnergyLimit(highEnergyLimit);
+      conv->AddEmModel(0, convModel);
+      pmanager->AddDiscreteProcess(conv);
+
+      G4RayleighScattering* rayl = new G4RayleighScattering();
+      G4LivermoreRayleighModel* 
+      raylModel = new G4LivermoreRayleighModel();
+      raylModel->SetHighEnergyLimit(highEnergyLimit);
+      rayl->AddEmModel(0, raylModel);
+      pmanager->AddDiscreteProcess(rayl);
       
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4LowEnergyIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4LowEnergyBremsstrahlung, -1,-1, 2);
-	    
+
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4LivermoreIonisationModel* 
+      eIoniModel = new G4LivermoreIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
+      
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4LivermoreBremsstrahlungModel* 
+      eBremModel = new G4LivermoreBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);
+      	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 3);
+      pmanager->AddProcess(new G4eIonisation,       -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 2, 2);
+      pmanager->AddProcess(new G4eplusAnnihilation,  0,-1, 3);
       
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);       
+      pmanager->AddProcess(new G4MuIonisation,      -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,  -1, 3, 3);       
      
+    } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
+      pmanager->AddProcess(new G4ionIonisation,     -1, 1, 1);
+
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hLowEnergyIonisation, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,       -1, 1, 1);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmPenelope.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmPenelope.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmPenelope.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmPenelope.cc,v 1.3 2006/06/29 16:44:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmPenelope.cc,v 1.6 2009/11/19 17:30:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,12 +35,33 @@
 #include "G4ProcessManager.hh"
 
-#include "G4PenelopeCompton.hh"
-#include "G4PenelopeGammaConversion.hh"
-#include "G4PenelopePhotoElectric.hh"
-#include "G4PenelopeRayleigh.hh"
+// gamma
 
-#include "G4PenelopeIonisation.hh"
-#include "G4PenelopeBremsstrahlung.hh"
-#include "G4PenelopeAnnihilation.hh"
+#include "G4PhotoElectricEffect.hh"
+#include "G4PenelopePhotoElectricModel.hh"
+
+#include "G4ComptonScattering.hh"
+#include "G4PenelopeComptonModel.hh"
+
+#include "G4GammaConversion.hh"
+#include "G4PenelopeGammaConversionModel.hh"
+
+#include "G4RayleighScattering.hh" 
+#include "G4PenelopeRayleighModel.hh"
+
+// e-
+
+#include "G4eIonisation.hh"
+#include "G4PenelopeIonisationModel.hh"
+#include "G4UniversalFluctuation.hh"
+
+#include "G4eBremsstrahlung.hh"
+#include "G4PenelopeBremsstrahlungModel.hh"
+
+// e+
+
+#include "G4eplusAnnihilation.hh"
+#include "G4PenelopeAnnihilationModel.hh"
+
+// mu
 
 #include "G4MuIonisation.hh"
@@ -48,6 +69,9 @@
 #include "G4MuPairProduction.hh"
 
+// hadrons, ions
+
 #include "G4hIonisation.hh"
 #include "G4ionIonisation.hh"
+
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,5 +90,5 @@
 void PhysListEmPenelope::ConstructProcess()
 {
-  // Add Penelope or standard EM Processes
+  // Add standard EM Processes
 
   theParticleIterator->reset();
@@ -73,38 +97,95 @@
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
-     
+
+    //Applicability range for Penelope models
+    //for higher energies, the Standard models are used   
+    G4double highEnergyLimit = 1*GeV;
+         
     if (particleName == "gamma") {
       // gamma         
-      pmanager->AddDiscreteProcess(new G4PenelopePhotoElectric);
-      pmanager->AddDiscreteProcess(new G4PenelopeCompton);
-      pmanager->AddDiscreteProcess(new G4PenelopeGammaConversion);
-      pmanager->AddDiscreteProcess(new G4PenelopeRayleigh);
+
+      G4PhotoElectricEffect* phot = new G4PhotoElectricEffect();
+      G4PenelopePhotoElectricModel* 
+      photModel = new G4PenelopePhotoElectricModel();
+      photModel->SetHighEnergyLimit(highEnergyLimit);
+      phot->AddEmModel(0, photModel);
+      pmanager->AddDiscreteProcess(phot);
+
+      G4ComptonScattering* compt = new G4ComptonScattering();
+      G4PenelopeComptonModel* 
+      comptModel = new G4PenelopeComptonModel();
+      comptModel->SetHighEnergyLimit(highEnergyLimit);
+      compt->AddEmModel(0, comptModel);
+      pmanager->AddDiscreteProcess(compt);
+
+      G4GammaConversion* conv = new G4GammaConversion();
+      G4PenelopeGammaConversionModel* 
+      convModel = new G4PenelopeGammaConversionModel();
+      convModel->SetHighEnergyLimit(highEnergyLimit);
+      conv->AddEmModel(0, convModel);
+      pmanager->AddDiscreteProcess(conv);
+
+      G4RayleighScattering* rayl = new G4RayleighScattering();
+      G4PenelopeRayleighModel* 
+      raylModel = new G4PenelopeRayleighModel();
+      raylModel->SetHighEnergyLimit(highEnergyLimit);
+      rayl->AddEmModel(0, raylModel);
+      pmanager->AddDiscreteProcess(rayl);
       
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4PenelopeIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2);
-	    
+
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4PenelopeIonisationModel* 
+      eIoniModel = new G4PenelopeIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
+      
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4PenelopeBremsstrahlungModel* 
+      eBremModel = new G4PenelopeBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);
+      	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4PenelopeIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2);      
-      pmanager->AddProcess(new G4PenelopeAnnihilation,    0,-1, 3);
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4PenelopeIonisationModel* 
+      eIoniModel = new G4PenelopeIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
       
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4PenelopeBremsstrahlungModel* 
+      eBremModel = new G4PenelopeBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);      
+
+      G4eplusAnnihilation* eAnni = new G4eplusAnnihilation();
+      G4PenelopeAnnihilationModel* 
+      eAnniModel = new G4PenelopeAnnihilationModel();
+      eAnniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eAnni->AddEmModel(0, eAnniModel);
+      pmanager->AddProcess(eAnni,                    0,-1, 3);
+            
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);       
+      pmanager->AddProcess(new G4MuIonisation,      -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,  -1, 3, 3);       
      
     } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);
-     
+      pmanager->AddProcess(new G4ionIonisation,     -1, 1, 1);
+
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,       -1, 1, 1);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmStandard.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.cc,v 1.3 2006/06/29 16:44:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsList.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 // 
-// $Id: PhysicsList.cc,v 1.5 2006/06/29 16:44:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.7 2009/11/19 17:30:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -199,9 +199,8 @@
 
   if (name == "standard") {
-
     emName = name;
     delete emPhysicsList;
     emPhysicsList = new PhysListEmStandard(name);
-      
+   
   } else if (name == "livermore") {
     emName = name;
@@ -213,5 +212,5 @@
     delete emPhysicsList;
     emPhysicsList = new PhysListEmPenelope(name);
-            
+                         
   } else {
     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
Index: trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:44:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:44:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.6 2006/06/29 16:44:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/SteppingAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: SteppingAction.cc,v 1.6 2007/06/24 22:26:54 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: SteppingAction.cc,v 1.7 2009/09/25 11:27:13 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm13/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm13/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm13/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:44:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.3 2006/10/24 16:54:16 maire Exp $
+# $Id: GNUmakefile,v 1.4 2008/06/11 22:47:10 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`  
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm14/TestEm14.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/TestEm14.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/TestEm14.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm14.cc,v 1.4 2007/06/23 22:23:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/compton.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/compton.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/compton.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: compton.mac,v 1.3 2006/09/06 09:56:06 maire Exp $
+# $Id: compton.mac,v 1.4 2009/09/25 11:43:33 maire Exp $
 #
 # Macro file for "TestEm14.cc"
@@ -12,6 +12,4 @@
 #
 /testem/phys/addPhysics standard
-####/testem/phys/addPhysics livermore
-####/testem/phys/addPhysics penelope
 #
 /run/initialize
@@ -24,6 +22,6 @@
 /gun/energy 300 keV
 #
-/testem/histo/setFileName compton
-/testem/histo/setFileType hbook
+/testem/histo/setFileName testem14
+/testem/histo/setFileType root
 /testem/histo/setHisto 1  100 0. 300. keV	#energy  of primary  
 /testem/histo/setHisto 2  200 -1. +1. none	#costeta of primary
Index: trunk/examples/extended/electromagnetic/TestEm14/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.3 2006/06/29 16:44:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.3 2006/06/29 16:44:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.3 2006/06/29 16:45:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:45:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.4 2007/11/13 12:13:32 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.4 2007/11/13 12:13:32 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmLivermore.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmLivermore.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmLivermore.hh	(revision 1230)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: PhysListEmLivermore.hh,v 1.2 2006/06/29 16:45:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmLivermore.hh,v 1.4 2009/11/19 10:36:37 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,5 +41,5 @@
 {
   public: 
-    PhysListEmLivermore(const G4String& name = "Livermore");
+    PhysListEmLivermore(const G4String& name = "livermore");
    ~PhysListEmLivermore();
 
Index: trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmPenelope.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmPenelope.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmPenelope.hh	(revision 1230)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: PhysListEmPenelope.hh,v 1.2 2006/06/29 16:45:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmPenelope.hh,v 1.4 2009/11/19 10:36:37 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,5 +41,5 @@
 {
   public: 
-    PhysListEmPenelope(const G4String& name = "Penelope");
+    PhysListEmPenelope(const G4String& name = "penelope");
    ~PhysListEmPenelope();
 
Index: trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmStandard.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.3 2006/06/29 16:45:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:45:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:45:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:45:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/ProcessesCount.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.3 2006/06/29 16:45:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.4 2006/09/06 09:56:06 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.4 2006/09/06 09:56:06 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/SteppingMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/SteppingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/SteppingMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingMessenger.hh,v 1.2 2006/06/29 16:45:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:45:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm14/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.4 2006/06/29 16:45:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:45:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.3 2006/06/29 16:45:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:45:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.5 2007/11/13 12:13:32 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.7 2008/09/24 18:53:56 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem14";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -218,5 +218,5 @@
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -231,4 +231,6 @@
 {
 #ifdef G4ANALYSIS_USE
+ 
+ if (!ascii[0]) return;
  
  G4String name = fileName[0] + ".ascii";
Index: trunk/examples/extended/electromagnetic/TestEm14/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.4 2007/11/13 12:17:07 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmLivermore.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmLivermore.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmLivermore.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmLivermore.cc,v 1.2 2006/06/29 16:45:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmLivermore.cc,v 1.4 2009/11/19 10:36:37 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,14 +35,32 @@
 #include "G4ProcessManager.hh"
 
-#include "G4LowEnergyCompton.hh"
-#include "G4LowEnergyGammaConversion.hh"
-#include "G4LowEnergyPhotoElectric.hh"
-#include "G4LowEnergyRayleigh.hh"
+// gamma
 
-#include "G4LowEnergyIonisation.hh"
-#include "G4LowEnergyBremsstrahlung.hh"
+#include "G4PhotoElectricEffect.hh"
+#include "G4LivermorePhotoElectricModel.hh"
+
+#include "G4ComptonScattering.hh"
+#include "G4LivermoreComptonModel.hh"
+
+#include "G4GammaConversion.hh"
+#include "G4LivermoreGammaConversionModel.hh"
+
+#include "G4RayleighScattering.hh" 
+#include "G4LivermoreRayleighModel.hh"
+
+// e-
+
 #include "G4eIonisation.hh"
+#include "G4LivermoreIonisationModel.hh"
+#include "G4UniversalFluctuation.hh"
+
 #include "G4eBremsstrahlung.hh"
+#include "G4LivermoreBremsstrahlungModel.hh"
+
+// e+
+
 #include "G4eplusAnnihilation.hh"
+
+// mu
 
 #include "G4MuIonisation.hh"
@@ -50,5 +68,9 @@
 #include "G4MuPairProduction.hh"
 
-#include "G4hLowEnergyIonisation.hh"
+// hadrons, ions
+
+#include "G4hIonisation.hh"
+#include "G4ionIonisation.hh"
+
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -67,5 +89,5 @@
 void PhysListEmLivermore::ConstructProcess()
 {
-  // Add LowEn or standard EM Processes
+  // Add standard EM Processes
 
   theParticleIterator->reset();
@@ -74,35 +96,78 @@
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
-     
+
+    //Applicability range for Livermore models
+    //for higher energies, the Standard models are used   
+    G4double highEnergyLimit = 1*GeV;
+         
     if (particleName == "gamma") {
       // gamma         
-      pmanager->AddDiscreteProcess(new G4LowEnergyPhotoElectric);
-      pmanager->AddDiscreteProcess(new G4LowEnergyCompton);
-      pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion);
-      pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh);
+
+      G4PhotoElectricEffect* phot = new G4PhotoElectricEffect();
+      G4LivermorePhotoElectricModel* 
+      photModel = new G4LivermorePhotoElectricModel();
+      photModel->SetHighEnergyLimit(highEnergyLimit);
+      phot->AddEmModel(0, photModel);
+      pmanager->AddDiscreteProcess(phot);
+
+      G4ComptonScattering* compt = new G4ComptonScattering();
+      G4LivermoreComptonModel* 
+      comptModel = new G4LivermoreComptonModel();
+      comptModel->SetHighEnergyLimit(highEnergyLimit);
+      compt->AddEmModel(0, comptModel);
+      pmanager->AddDiscreteProcess(compt);
+
+      G4GammaConversion* conv = new G4GammaConversion();
+      G4LivermoreGammaConversionModel* 
+      convModel = new G4LivermoreGammaConversionModel();
+      convModel->SetHighEnergyLimit(highEnergyLimit);
+      conv->AddEmModel(0, convModel);
+      pmanager->AddDiscreteProcess(conv);
+
+      G4RayleighScattering* rayl = new G4RayleighScattering();
+      G4LivermoreRayleighModel* 
+      raylModel = new G4LivermoreRayleighModel();
+      raylModel->SetHighEnergyLimit(highEnergyLimit);
+      rayl->AddEmModel(0, raylModel);
+      pmanager->AddDiscreteProcess(rayl);
       
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4LowEnergyIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4LowEnergyBremsstrahlung, -1,-1, 2);
-	    
+
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4LivermoreIonisationModel* 
+      eIoniModel = new G4LivermoreIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
+      
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4LivermoreBremsstrahlungModel* 
+      eBremModel = new G4LivermoreBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);
+      	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 3);
+      pmanager->AddProcess(new G4eIonisation,       -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 2, 2);
+      pmanager->AddProcess(new G4eplusAnnihilation,  0,-1, 3);
       
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);       
+      pmanager->AddProcess(new G4MuIonisation,      -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,  -1, 3, 3);       
      
+    } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
+      pmanager->AddProcess(new G4ionIonisation,     -1, 1, 1);
+
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hLowEnergyIonisation, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,       -1, 1, 1);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmPenelope.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmPenelope.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmPenelope.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmPenelope.cc,v 1.2 2006/06/29 16:45:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmPenelope.cc,v 1.4 2009/11/19 10:36:37 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,12 +35,33 @@
 #include "G4ProcessManager.hh"
 
-#include "G4PenelopeCompton.hh"
-#include "G4PenelopeGammaConversion.hh"
-#include "G4PenelopePhotoElectric.hh"
-#include "G4PenelopeRayleigh.hh"
+// gamma
 
-#include "G4PenelopeIonisation.hh"
-#include "G4PenelopeBremsstrahlung.hh"
-#include "G4PenelopeAnnihilation.hh"
+#include "G4PhotoElectricEffect.hh"
+#include "G4PenelopePhotoElectricModel.hh"
+
+#include "G4ComptonScattering.hh"
+#include "G4PenelopeComptonModel.hh"
+
+#include "G4GammaConversion.hh"
+#include "G4PenelopeGammaConversionModel.hh"
+
+#include "G4RayleighScattering.hh" 
+#include "G4PenelopeRayleighModel.hh"
+
+// e-
+
+#include "G4eIonisation.hh"
+#include "G4PenelopeIonisationModel.hh"
+#include "G4UniversalFluctuation.hh"
+
+#include "G4eBremsstrahlung.hh"
+#include "G4PenelopeBremsstrahlungModel.hh"
+
+// e+
+
+#include "G4eplusAnnihilation.hh"
+#include "G4PenelopeAnnihilationModel.hh"
+
+// mu
 
 #include "G4MuIonisation.hh"
@@ -48,6 +69,9 @@
 #include "G4MuPairProduction.hh"
 
+// hadrons, ions
+
 #include "G4hIonisation.hh"
 #include "G4ionIonisation.hh"
+
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,5 +90,5 @@
 void PhysListEmPenelope::ConstructProcess()
 {
-  // Add Penelope or standard EM Processes
+  // Add standard EM Processes
 
   theParticleIterator->reset();
@@ -73,38 +97,95 @@
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
-     
+
+    //Applicability range for Penelope models
+    //for higher energies, the Standard models are used   
+    G4double highEnergyLimit = 1*GeV;
+         
     if (particleName == "gamma") {
       // gamma         
-      pmanager->AddDiscreteProcess(new G4PenelopePhotoElectric);
-      pmanager->AddDiscreteProcess(new G4PenelopeCompton);
-      pmanager->AddDiscreteProcess(new G4PenelopeGammaConversion);
-      pmanager->AddDiscreteProcess(new G4PenelopeRayleigh);
+
+      G4PhotoElectricEffect* phot = new G4PhotoElectricEffect();
+      G4PenelopePhotoElectricModel* 
+      photModel = new G4PenelopePhotoElectricModel();
+      photModel->SetHighEnergyLimit(highEnergyLimit);
+      phot->AddEmModel(0, photModel);
+      pmanager->AddDiscreteProcess(phot);
+
+      G4ComptonScattering* compt = new G4ComptonScattering();
+      G4PenelopeComptonModel* 
+      comptModel = new G4PenelopeComptonModel();
+      comptModel->SetHighEnergyLimit(highEnergyLimit);
+      compt->AddEmModel(0, comptModel);
+      pmanager->AddDiscreteProcess(compt);
+
+      G4GammaConversion* conv = new G4GammaConversion();
+      G4PenelopeGammaConversionModel* 
+      convModel = new G4PenelopeGammaConversionModel();
+      convModel->SetHighEnergyLimit(highEnergyLimit);
+      conv->AddEmModel(0, convModel);
+      pmanager->AddDiscreteProcess(conv);
+
+      G4RayleighScattering* rayl = new G4RayleighScattering();
+      G4PenelopeRayleighModel* 
+      raylModel = new G4PenelopeRayleighModel();
+      raylModel->SetHighEnergyLimit(highEnergyLimit);
+      rayl->AddEmModel(0, raylModel);
+      pmanager->AddDiscreteProcess(rayl);
       
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4PenelopeIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2);
-	    
+
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4PenelopeIonisationModel* 
+      eIoniModel = new G4PenelopeIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
+      
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4PenelopeBremsstrahlungModel* 
+      eBremModel = new G4PenelopeBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);
+      	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4PenelopeIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2);      
-      pmanager->AddProcess(new G4PenelopeAnnihilation,    0,-1, 3);
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4PenelopeIonisationModel* 
+      eIoniModel = new G4PenelopeIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
       
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4PenelopeBremsstrahlungModel* 
+      eBremModel = new G4PenelopeBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);      
+
+      G4eplusAnnihilation* eAnni = new G4eplusAnnihilation();
+      G4PenelopeAnnihilationModel* 
+      eAnniModel = new G4PenelopeAnnihilationModel();
+      eAnniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eAnni->AddEmModel(0, eAnniModel);
+      pmanager->AddProcess(eAnni,                    0,-1, 3);
+            
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);       
+      pmanager->AddProcess(new G4MuIonisation,      -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,  -1, 3, 3);       
      
     } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);
-     
+      pmanager->AddProcess(new G4ionIonisation,     -1, 1, 1);
+
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,       -1, 1, 1);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmStandard.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.cc,v 1.4 2006/10/24 16:54:16 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsList.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 // 
-// $Id: PhysicsList.cc,v 1.4 2006/10/24 16:54:16 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.6 2009/11/19 10:36:37 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,5 +35,4 @@
  
 #include "PhysListEmStandard.hh"
-
 #include "PhysListEmLivermore.hh"
 #include "PhysListEmPenelope.hh"
@@ -200,9 +199,8 @@
 
   if (name == "standard") {
-
     emName = name;
     delete emPhysicsList;
     emPhysicsList = new PhysListEmStandard(name);
-       
+   
   } else if (name == "livermore") {
     emName = name;
@@ -214,5 +212,5 @@
     delete emPhysicsList;
     emPhysicsList = new PhysListEmPenelope(name);
-            
+                    
   } else {
     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
Index: trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:45:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:45:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.4 2006/09/06 09:56:06 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.5 2007/06/23 22:23:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/SteppingMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/SteppingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/SteppingMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingMessenger.cc,v 1.2 2006/06/29 16:46:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm14/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm14/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm14/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:46:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.2 2006/10/24 10:28:10 maire Exp $
+# $Id: GNUmakefile,v 1.3 2008/06/11 22:50:19 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`  
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm15/TestEm15.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/TestEm15.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/TestEm15.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm15.cc,v 1.2 2006/06/29 16:46:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:46:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:46:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:46:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:46:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.4 2007/11/13 14:13:31 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.3 2007/11/13 14:13:31 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:46:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:46:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:46:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:46:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/ProcessesCount.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.2 2006/06/29 16:46:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.3 2006/06/29 16:46:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.2 2006/06/29 16:46:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:46:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:46:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:46:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm15/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.3 2006/06/29 16:46:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:46:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.2 2006/06/29 16:46:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:46:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.5 2007/11/13 14:13:31 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.8 2008/09/26 19:47:51 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem15";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -221,5 +221,5 @@
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -234,4 +234,6 @@
 {
 #ifdef G4ANALYSIS_USE
+
+ if (!ascii[0]) return;
  
  G4String name = fileName[0] + ".ascii";
@@ -247,5 +249,6 @@
       for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
          File << "  " << iBin << "\t" 
-              << histo[ih]->binMean(iBin) << "\t"
+              << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
+	              histo[ih]->axis().binUpperEdge(iBin)) << "\t"	      
 	      << histo[ih]->binHeight(iBin) 
 	      << G4endl;
Index: trunk/examples/extended/electromagnetic/TestEm15/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.3 2007/11/13 14:13:31 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/PhysListEmStandard.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmStandard.cc,v 1.2 2006/06/29 16:47:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.4 2009/11/19 17:58:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,5 +39,7 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
+#include "G4eMultipleScattering.hh"
+#include "G4hMultipleScattering.hh"
+#include "G4MuMultipleScattering.hh"
 
 #include "G4eIonisation.hh"
@@ -83,26 +85,26 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2,2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3,3);
       	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2,2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3,3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1,4);
             
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
+      pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1);
+      pmanager->AddProcess(new G4MuIonisation,       -1, 2,2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 3,3);
+      pmanager->AddProcess(new G4MuPairProduction,   -1, 4,4);       
      
     } else if( particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,     -1, 2,2);
+      pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
+      pmanager->AddProcess(new G4ionIonisation,      -1, 2,2);
 
     } else if ((!particle->IsShortLived()) &&
@@ -110,6 +112,6 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering,-1,1,1);
-      pmanager->AddProcess(new G4hIonisation,       -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering,-1,1,1);
+      pmanager->AddProcess(new G4hIonisation,        -1,2,2);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 // 
 // $Id: PhysicsList.cc,v 1.2 2006/06/29 16:47:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:47:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:47:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.5 2006/06/29 16:47:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.2 2006/06/29 16:47:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 16:47:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.6 2007/03/15 15:52:39 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm15/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm15/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm15/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:47:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.5 2007/01/18 10:24:35 vnivanch Exp $
+# $Id: GNUmakefile,v 1.6 2008/06/11 22:52:28 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,16 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # add -v to see what is going on. 
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm16/TestEm16.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/TestEm16.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/TestEm16.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm16.cc,v 1.3 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.4 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.4 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:47:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:47:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsList.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsList.hh,v 1.4 2006/06/29 16:47:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.4 2006/06/29 16:47:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:47:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.5 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.3 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:47:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager.
Index: trunk/examples/extended/electromagnetic/TestEm16/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.4 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.3 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.2 2006/06/29 16:47:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:47:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/HistoManager.cc	(revision 1230)
@@ -52,6 +52,6 @@
  
   fileName[0] = "testem16";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
Index: trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.4 2006/06/29 16:47:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.5 2009/11/19 18:12:32 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,10 +42,10 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
@@ -143,32 +143,32 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering,        -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,               -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,           -1, 3,3);
+      pmanager->AddProcess(new G4eMultipleScattering,       -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation,               -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,           -1, 3, 3);
       if (SRType)
-      pmanager->AddProcess(new G4SynchrotronRadiation,      -1,-1,4);
+      pmanager->AddProcess(new G4SynchrotronRadiation,      -1,-1, 4);
       else
-      pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1,4); 
-      pmanager->AddProcess(new G4StepLimiter,               -1,-1,5);
+      pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 4); 
+      pmanager->AddProcess(new G4StepLimiter,               -1,-1, 5);
      
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering,        -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,               -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,           -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,          0,-1,4);
+      pmanager->AddProcess(new G4eMultipleScattering,       -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation,               -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,           -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,          0,-1, 4);
       if (SRType)
-      pmanager->AddProcess(new G4SynchrotronRadiation,      -1,-1,5);
+      pmanager->AddProcess(new G4SynchrotronRadiation,      -1,-1, 5);
       else
-      pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1,5);       
-      pmanager->AddProcess(new G4StepLimiter,               -1,-1,6);
+      pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 5);       
+      pmanager->AddProcess(new G4StepLimiter,               -1,-1, 6);
       
     } else if( particleName == "mu+" ||
                particleName == "mu-"    ) {
       //muon
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);
+      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);
       
     }
Index: trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.4 2006/06/29 16:47:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:48:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.8 2007/01/18 10:24:35 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.5 2007/01/18 09:07:20 hbu Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm16/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm16/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm16/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:48:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.2 2006/10/24 10:06:21 maire Exp $
+# $Id: GNUmakefile,v 1.3 2008/06/11 22:55:02 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`  
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm17/TestEm17.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/TestEm17.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/TestEm17.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm17.cc,v 1.2 2006/06/29 16:48:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:48:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm17/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:48:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm17/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:48:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:48:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/HistoManager.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.hh,v 1.2 2006/06/29 16:48:19 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.hh,v 1.3 2008/03/18 15:30:33 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,5 +46,5 @@
 class HistoMessenger;
 
-const G4int MaxHisto = 5;
+const G4int MaxHisto = 8;
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.2 2006/06/29 16:48:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/MuCrossSections.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/MuCrossSections.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/MuCrossSections.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: MuCrossSections.hh,v 1.2 2006/06/29 16:48:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/MuNuclearBuilder.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/MuNuclearBuilder.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/MuNuclearBuilder.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: MuNuclearBuilder.hh,v 1.2 2006/06/29 16:48:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/PhysListEmStandard.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:48:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsList.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:48:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:48:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:48:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/ProcessesCount.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.2 2006/06/29 16:48:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.2 2006/06/29 16:48:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/StackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/StackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/StackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.hh,v 1.2 2006/06/29 16:48:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:48:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:48:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm17/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.3 2007/05/12 16:33:53 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:48:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm17/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.2 2006/06/29 16:48:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:48:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.2 2006/06/29 16:48:58 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.4 2008/09/26 20:15:04 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem17";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";    
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";    
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -164,5 +164,5 @@
   }
   
-  const G4String id[] = { "0", "1", "2", "3", "4"};
+  const G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7"};
   const G4String title[] = 
                 { "dummy",						//0
@@ -170,5 +170,8 @@
                   "log10(Etransfert/Emu) Pair",				//2
                   "log10(Etransfert/Emu) Brems",			//3
-                  "log10(Etransfert/Emu) Nuclear"			//4
+                  "log10(Etransfert/Emu) Nuclear",			//4
+                  "log10(Etransfert/Emu) Ionization",			//5
+                  "log10(Etransfert/Emu) Pair",				//6
+                  "log10(Etransfert/Emu) Brems" 			//7
                  };
 
Index: trunk/examples/extended/electromagnetic/TestEm17/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.2 2006/06/29 16:49:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/MuCrossSections.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/MuCrossSections.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/MuCrossSections.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: MuCrossSections.cc,v 1.2 2006/06/29 16:49:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/MuNuclearBuilder.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/MuNuclearBuilder.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/MuNuclearBuilder.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: MuNuclearBuilder.cc,v 1.2 2006/06/29 16:49:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/PhysListEmStandard.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysListEmStandard.cc,v 1.2 2006/06/29 16:49:09 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: PhysListEmStandard.cc,v 1.4 2008/05/07 13:57:56 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,4 +35,7 @@
 #include "G4MuonPlus.hh"
 #include "G4MuonMinus.hh"
+#include "G4PionPlus.hh"
+#include "G4PionMinus.hh"
+#include "G4Proton.hh"
 
 #include "G4ProcessManager.hh"
@@ -40,4 +43,7 @@
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
+#include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
 #include "G4LossTableManager.hh"
 
@@ -57,30 +63,47 @@
 void PhysListEmStandard::ConstructProcess()
 {
-  // Common processes for mu+ and mu-
-  //
-  G4MuIonisation*       muioni = new G4MuIonisation();
-  G4MuBremsstrahlung*   mubrem = new G4MuBremsstrahlung();
-  G4MuPairProduction*   mupair = new G4MuPairProduction();
-
+  // mu+
   G4ParticleDefinition* particle = G4MuonPlus::MuonPlus();
   G4ProcessManager* pmanager = particle->GetProcessManager();    
-  //
-  pmanager->AddProcess(muioni, -1, 2,2);
-  pmanager->AddProcess(mubrem, -1,-1,3);
-  pmanager->AddProcess(mupair, -1,-1,4);
+  pmanager->AddProcess(new G4MuIonisation(),     -1, 2, 2);
+  pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
+  pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
 
+  // mu-
   particle = G4MuonMinus::MuonMinus();
   pmanager = particle->GetProcessManager();    
-  //
-  pmanager->AddProcess(muioni, -1, 2,2);
-  pmanager->AddProcess(mubrem, -1,-1,3);
-  pmanager->AddProcess(mupair, -1,-1,4);
-    
+  pmanager->AddProcess(new G4MuIonisation(),     -1, 2, 2);
+  pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
+  pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
+
+  // pi+
+  particle = G4PionPlus::PionPlus();
+  pmanager = particle->GetProcessManager();    
+  pmanager->AddProcess(new G4hIonisation(),     -1, 2, 2);
+  pmanager->AddProcess(new G4hBremsstrahlung(), -1, 3, 3);
+  pmanager->AddProcess(new G4hPairProduction(), -1, 4, 4);
+
+  // pi-
+  particle = G4PionMinus::PionMinus();
+  pmanager = particle->GetProcessManager();    
+  pmanager->AddProcess(new G4hIonisation(),     -1, 2, 2);
+  pmanager->AddProcess(new G4hBremsstrahlung(), -1, 3, 3);
+  pmanager->AddProcess(new G4hPairProduction(), -1, 4, 4);
+
+  // proton
+  particle = G4Proton::Proton();
+  pmanager = particle->GetProcessManager();    
+  pmanager->AddProcess(new G4hIonisation(),     -1, 2, 2);
+  pmanager->AddProcess(new G4hBremsstrahlung(), -1, 3, 3);
+  pmanager->AddProcess(new G4hPairProduction(), -1, 4, 4);
+
   //extend binning of PhysicsTables
   //
-  G4LossTableManager::Instance()->SetMaxEnergy(1000.0*PeV);
-  G4LossTableManager::Instance()->SetDEDXBinning(220);
-  G4LossTableManager::Instance()->SetLambdaBinning(220);
-  G4LossTableManager::Instance()->SetVerbose(0);
+  G4LossTableManager::Instance()->SetMinEnergy(100*eV);  
+  G4LossTableManager::Instance()->SetMaxEnergy(1000*PeV);
+  G4LossTableManager::Instance()->SetDEDXBinning(160);
+  G4LossTableManager::Instance()->SetLambdaBinning(160);
+  G4LossTableManager::Instance()->SetSplineFlag(true);  
+  G4LossTableManager::Instance()->SetVerbose(1);
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.cc,v 1.4 2006/10/24 10:06:21 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:49:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:49:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.2 2006/06/29 16:49:17 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: RunAction.cc,v 1.4 2008/03/31 10:22:59 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -139,20 +139,21 @@
   //compute theoritical predictions
   //
-  totalCrossSection = 0.;
-  for (size_t i=0; i< ProcCounter->size();i++) {
-     G4String procName = (*ProcCounter)[i]->GetName();
-     if (procName != "Transportation")
-       totalCrossSection += ComputeTheory(procName, NbOfEvents);
-  }
-  
-  MeanFreePath     = 1./totalCrossSection;
-  massCrossSection = totalCrossSection/density;
-  
-  G4cout << " Theory:     "
-         <<    "total CrossSection = " << totalCrossSection*cm << " /cm"
-         << "\t MeanFreePath = "       << G4BestUnit(MeanFreePath,"Length")
-         << "\t massicCrossSection = " << massCrossSection*g/cm2 << " cm2/g"
-         << G4endl;
-	 	 
+  if(particle == "mu+" || particle == "mu-") { 
+    totalCrossSection = 0.;
+    for (size_t i=0; i< ProcCounter->size();i++) {
+      G4String procName = (*ProcCounter)[i]->GetName();
+      if (procName != "Transportation")
+	totalCrossSection += ComputeTheory(procName, NbOfEvents);
+    }
+  
+    MeanFreePath     = 1./totalCrossSection;
+    massCrossSection = totalCrossSection/density;
+  
+    G4cout << " Theory:     "
+	   <<    "total CrossSection = " << totalCrossSection*cm << " /cm"
+	   << "\t MeanFreePath = "       << G4BestUnit(MeanFreePath,"Length")
+	   << "\t massicCrossSection = " << massCrossSection*g/cm2 << " cm2/g"
+	   << G4endl;
+  }
 	 	 	               	                           
   G4cout.setf(mode,std::ios::floatfield);
@@ -183,9 +184,13 @@
 
   G4int id = 0; G4double cut = 0.;
-  if (process == "muIoni")     {id = 1; cut =    GetEnergyCut(material,1); }
-  if (process == "muPairProd") {id = 2; cut = 2*(GetEnergyCut(material,1) 
+  if (process == "muIoni")          {id = 1; cut =    GetEnergyCut(material,1);}
+  else if (process == "muPairProd") {id = 2; cut = 2*(GetEnergyCut(material,1) 
                                                       + electron_mass_c2); }
-  if (process == "muBrems")    {id = 3; cut =    GetEnergyCut(material,0); }
-  if (process == "muNucl")      id = 4;
+  else if (process == "muBrems")    {id = 3; cut =    GetEnergyCut(material,0);}
+  else if (process == "muNucl")      id = 4;
+  else if (process == "hIoni")      {id = 5; cut =    GetEnergyCut(material,1);}
+  else if (process == "hPairProd")  {id = 6; cut = 2*(GetEnergyCut(material,1) 
+                                                      + electron_mass_c2); }
+  else if (process == "hBrems")     {id = 7; cut =    GetEnergyCut(material,0);}
   if (id == 0) return 0.;
   
Index: trunk/examples/extended/electromagnetic/TestEm17/src/StackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/StackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/StackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.cc,v 1.2 2006/06/29 16:49:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm17/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/SteppingAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: SteppingAction.cc,v 1.2 2006/06/29 16:49:22 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: SteppingAction.cc,v 1.4 2008/03/31 10:22:59 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -70,8 +70,11 @@
 
   G4int id = 0;
-  if (procName == "muIoni")     id = 1; 
-  if (procName == "muPairProd") id = 2;
-  if (procName == "muBrems")    id = 3;
-  if (procName == "muNucl")     id = 4;    
+  if (procName == "muIoni")          id = 1; 
+  else if (procName == "muPairProd") id = 2;
+  else if (procName == "muBrems")    id = 3;
+  else if (procName == "muNucl")     id = 4;    
+  else if (procName == "hIoni")      id = 5; 
+  else if (procName == "hPairProd")  id = 6;
+  else if (procName == "hBrems")     id = 7;
   histoManager->FillHisto(id,lgepsE);		       
 }
Index: trunk/examples/extended/electromagnetic/TestEm17/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm17/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm17/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:49:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.1 2007/02/13 17:57:19 maire Exp $
+# $Id: GNUmakefile,v 1.2 2008/06/11 22:57:25 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm18/TestEm18.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/TestEm18.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/TestEm18.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm18.cc,v 1.1 2007/02/13 17:57:19 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/electron.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/electron.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/electron.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: electron.mac,v 1.1 2007/02/13 17:57:20 maire Exp $
+# $Id: electron.mac,v 1.2 2009/10/12 21:47:57 maire Exp $
 #
 # macro file for TestEm18.cc
@@ -8,4 +8,6 @@
 /testem/det/setMat Water
 /testem/det/setSize 1 cm
+#
+/testem/phys/addPhysics standard
 #
 /testem/phys/setCuts 100 um
Index: trunk/examples/extended/electromagnetic/TestEm18/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/EventMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/EventMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/EventMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventMessenger.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.2 2007/11/13 16:43:59 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.2 2007/11/13 16:43:59 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmLivermore.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmLivermore.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmLivermore.hh	(revision 1230)
@@ -25,9 +25,6 @@
 //
 //
-// $Id: PhysListEmLivermore.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
-//
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+// $Id: PhysListEmLivermore.hh,v 1.2 2009/10/12 21:47:57 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef PhysListEmLivermore_h
@@ -41,16 +38,11 @@
 class PhysListEmLivermore : public G4VPhysicsConstructor
 {
-public: 
+public:
   PhysListEmLivermore(const G4String& name = "Livermore");
+
   virtual ~PhysListEmLivermore();
 
-public: 
-  // This method is dummy for physics
-  void ConstructParticle() {};
- 
-  // This method will be invoked in the Construct() method.
-  // each physics process will be instantiated and
-  // registered to the process manager of each particle type 
-  void ConstructProcess();
+  virtual void ConstructParticle() { };
+  virtual void ConstructProcess();
 };
 
@@ -64,4 +56,2 @@
 
 
-
-
Index: trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmPenelope.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmPenelope.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmPenelope.hh	(revision 1230)
@@ -24,9 +24,7 @@
 // ********************************************************************
 //
-// $Id: PhysListEmPenelope.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
 //
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+// $Id: PhysListEmPenelope.hh,v 1.2 2009/10/12 21:47:57 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef PhysListEmPenelope_h
@@ -40,16 +38,11 @@
 class PhysListEmPenelope : public G4VPhysicsConstructor
 {
-public: 
-  PhysListEmPenelope(const G4String& name = "penelope");
+public:
+  PhysListEmPenelope(const G4String& name = "Penelope");
+
   virtual ~PhysListEmPenelope();
 
-public: 
-  // This method is dummy for physics
-  void ConstructParticle() {};
- 
-  // This method will be invoked in the Construct() method.
-  // each physics process will be instantiated and
-  // registered to the process manager of each particle type 
-  void ConstructProcess();
+  virtual void ConstructParticle() { };
+  virtual void ConstructProcess();
 };
 
@@ -63,4 +56,2 @@
 
 
-
-
Index: trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmStandard.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsList.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.hh,v 1.3 2009/03/06 18:24:07 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -57,5 +57,5 @@
     void SetCutForElectron(G4double);
     void SetCutForPositron(G4double);
-    
+      
   private:
   
Index: trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsListMessenger.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.hh,v 1.3 2009/03/06 18:24:07 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -60,5 +60,5 @@
     G4UIcmdWithADoubleAndUnit* gammaCutCmd;
     G4UIcmdWithADoubleAndUnit* electCutCmd;
-    G4UIcmdWithADoubleAndUnit* allCutCmd;        
+    G4UIcmdWithADoubleAndUnit* allCutCmd;
 };
 
Index: trunk/examples/extended/electromagnetic/TestEm18/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/StackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/StackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/StackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm18/proton.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/proton.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/proton.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: proton.mac,v 1.1 2007/02/13 17:57:20 maire Exp $
+# $Id: proton.mac,v 1.2 2009/02/22 17:48:53 maire Exp $
 #
 # macro file for TestEm18.cc
@@ -16,5 +16,7 @@
 /gun/energy 100 MeV
 #
-/testem/histo/setFileName proton 
+/testem/histo/setFileName proton
+/testem/histo/setFileType hbook
+# 
 /testem/histo/setHisto 1 100 0 10 MeV	#continuous eLoss 
 /testem/histo/setHisto 2 100 0 10 MeV	#secondary  eLoss
Index: trunk/examples/extended/electromagnetic/TestEm18/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/DetectorConstruction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: DetectorConstruction.cc,v 1.2 2007/02/16 11:59:47 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: DetectorConstruction.cc,v 1.3 2009/03/06 18:24:07 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -113,5 +113,8 @@
   new G4Material("Tungsten"   , z=74., a=183.85*g/mole, density= 19.30*g/cm3);
   new G4Material("Lead"       , z=82., a=207.19*g/mole, density= 11.35*g/cm3);
-
+  
+  new G4Material("ArgonGas"   , z=18., a=39.948*g/mole, density= 1.782*mg/cm3,
+		 kStateGas, 273.15*kelvin, 1*atmosphere);
+		 
   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
 }
Index: trunk/examples/extended/electromagnetic/TestEm18/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/EventMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/EventMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/EventMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventMessenger.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.2 2007/11/13 16:43:59 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.5 2008/09/26 20:26:01 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem18";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -217,5 +217,5 @@
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -230,5 +230,7 @@
 {
 #ifdef G4ANALYSIS_USE
- 
+
+ if (!ascii[0]) return;
+  
  G4String name = fileName[0] + ".ascii";
  std::ofstream File(name, std::ios::out);
@@ -243,5 +245,6 @@
       for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
          File << "  " << iBin << "\t" 
-              << histo[ih]->binMean(iBin) << "\t"
+	      << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
+	              histo[ih]->axis().binUpperEdge(iBin)) << "\t"
 	      << histo[ih]->binHeight(iBin) 
 	      << G4endl;
Index: trunk/examples/extended/electromagnetic/TestEm18/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.2 2007/11/13 16:43:59 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmLivermore.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmLivermore.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmLivermore.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmLivermore.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmLivermore.cc,v 1.3 2009/11/19 18:46:04 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,14 +35,32 @@
 #include "G4ProcessManager.hh"
 
-#include "G4LowEnergyCompton.hh"
-#include "G4LowEnergyGammaConversion.hh"
-#include "G4LowEnergyPhotoElectric.hh"
-#include "G4LowEnergyRayleigh.hh"
+// gamma
 
-#include "G4LowEnergyIonisation.hh"
-#include "G4LowEnergyBremsstrahlung.hh"
+#include "G4PhotoElectricEffect.hh"
+#include "G4LivermorePhotoElectricModel.hh"
+
+#include "G4ComptonScattering.hh"
+#include "G4LivermoreComptonModel.hh"
+
+#include "G4GammaConversion.hh"
+#include "G4LivermoreGammaConversionModel.hh"
+
+#include "G4RayleighScattering.hh" 
+#include "G4LivermoreRayleighModel.hh"
+
+// e-
+
 #include "G4eIonisation.hh"
+#include "G4LivermoreIonisationModel.hh"
+#include "G4UniversalFluctuation.hh"
+
 #include "G4eBremsstrahlung.hh"
+#include "G4LivermoreBremsstrahlungModel.hh"
+
+// e+
+
 #include "G4eplusAnnihilation.hh"
+
+// mu
 
 #include "G4MuIonisation.hh"
@@ -50,5 +68,9 @@
 #include "G4MuPairProduction.hh"
 
-#include "G4hLowEnergyIonisation.hh"
+// hadrons, ions
+
+#include "G4hIonisation.hh"
+#include "G4ionIonisation.hh"
+
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -67,5 +89,5 @@
 void PhysListEmLivermore::ConstructProcess()
 {
-  // Add LowEn or standard EM Processes
+  // Add standard EM Processes
 
   theParticleIterator->reset();
@@ -74,35 +96,78 @@
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
-     
+
+    //Applicability range for Livermore models
+    //for higher energies, the Standard models are used   
+    G4double highEnergyLimit = 1*GeV;
+         
     if (particleName == "gamma") {
       // gamma         
-      pmanager->AddDiscreteProcess(new G4LowEnergyPhotoElectric);
-      pmanager->AddDiscreteProcess(new G4LowEnergyCompton);
-      pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion);
-      pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh);
+
+      G4PhotoElectricEffect* phot = new G4PhotoElectricEffect();
+      G4LivermorePhotoElectricModel* 
+      photModel = new G4LivermorePhotoElectricModel();
+      photModel->SetHighEnergyLimit(highEnergyLimit);
+      phot->AddEmModel(0, photModel);
+      pmanager->AddDiscreteProcess(phot);
+
+      G4ComptonScattering* compt = new G4ComptonScattering();
+      G4LivermoreComptonModel* 
+      comptModel = new G4LivermoreComptonModel();
+      comptModel->SetHighEnergyLimit(highEnergyLimit);
+      compt->AddEmModel(0, comptModel);
+      pmanager->AddDiscreteProcess(compt);
+
+      G4GammaConversion* conv = new G4GammaConversion();
+      G4LivermoreGammaConversionModel* 
+      convModel = new G4LivermoreGammaConversionModel();
+      convModel->SetHighEnergyLimit(highEnergyLimit);
+      conv->AddEmModel(0, convModel);
+      pmanager->AddDiscreteProcess(conv);
+
+      G4RayleighScattering* rayl = new G4RayleighScattering();
+      G4LivermoreRayleighModel* 
+      raylModel = new G4LivermoreRayleighModel();
+      raylModel->SetHighEnergyLimit(highEnergyLimit);
+      rayl->AddEmModel(0, raylModel);
+      pmanager->AddDiscreteProcess(rayl);
       
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4LowEnergyIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4LowEnergyBremsstrahlung, -1,-1, 2);
-	    
+
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4LivermoreIonisationModel* 
+      eIoniModel = new G4LivermoreIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
+      
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4LivermoreBremsstrahlungModel* 
+      eBremModel = new G4LivermoreBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);
+      	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 3);
+      pmanager->AddProcess(new G4eIonisation,       -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 2, 2);
+      pmanager->AddProcess(new G4eplusAnnihilation,  0,-1, 3);
       
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);       
+      pmanager->AddProcess(new G4MuIonisation,      -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,  -1, 3, 3);       
      
+    } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
+      pmanager->AddProcess(new G4ionIonisation,     -1, 1, 1);
+
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hLowEnergyIonisation, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,       -1, 1, 1);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmPenelope.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmPenelope.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmPenelope.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmPenelope.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmPenelope.cc,v 1.3 2009/11/19 18:46:04 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,12 +35,33 @@
 #include "G4ProcessManager.hh"
 
-#include "G4PenelopeCompton.hh"
-#include "G4PenelopeGammaConversion.hh"
-#include "G4PenelopePhotoElectric.hh"
-#include "G4PenelopeRayleigh.hh"
+// gamma
 
-#include "G4PenelopeIonisation.hh"
-#include "G4PenelopeBremsstrahlung.hh"
-#include "G4PenelopeAnnihilation.hh"
+#include "G4PhotoElectricEffect.hh"
+#include "G4PenelopePhotoElectricModel.hh"
+
+#include "G4ComptonScattering.hh"
+#include "G4PenelopeComptonModel.hh"
+
+#include "G4GammaConversion.hh"
+#include "G4PenelopeGammaConversionModel.hh"
+
+#include "G4RayleighScattering.hh" 
+#include "G4PenelopeRayleighModel.hh"
+
+// e-
+
+#include "G4eIonisation.hh"
+#include "G4PenelopeIonisationModel.hh"
+#include "G4UniversalFluctuation.hh"
+
+#include "G4eBremsstrahlung.hh"
+#include "G4PenelopeBremsstrahlungModel.hh"
+
+// e+
+
+#include "G4eplusAnnihilation.hh"
+#include "G4PenelopeAnnihilationModel.hh"
+
+// mu
 
 #include "G4MuIonisation.hh"
@@ -48,6 +69,9 @@
 #include "G4MuPairProduction.hh"
 
+// hadrons, ions
+
 #include "G4hIonisation.hh"
 #include "G4ionIonisation.hh"
+
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,5 +90,5 @@
 void PhysListEmPenelope::ConstructProcess()
 {
-  // Add Penelope or standard EM Processes
+  // Add standard EM Processes
 
   theParticleIterator->reset();
@@ -73,38 +97,95 @@
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
-     
+
+    //Applicability range for Penelope models
+    //for higher energies, the Standard models are used   
+    G4double highEnergyLimit = 1*GeV;
+         
     if (particleName == "gamma") {
       // gamma         
-      pmanager->AddDiscreteProcess(new G4PenelopePhotoElectric);
-      pmanager->AddDiscreteProcess(new G4PenelopeCompton);
-      pmanager->AddDiscreteProcess(new G4PenelopeGammaConversion);
-      pmanager->AddDiscreteProcess(new G4PenelopeRayleigh);
+
+      G4PhotoElectricEffect* phot = new G4PhotoElectricEffect();
+      G4PenelopePhotoElectricModel* 
+      photModel = new G4PenelopePhotoElectricModel();
+      photModel->SetHighEnergyLimit(highEnergyLimit);
+      phot->AddEmModel(0, photModel);
+      pmanager->AddDiscreteProcess(phot);
+
+      G4ComptonScattering* compt = new G4ComptonScattering();
+      G4PenelopeComptonModel* 
+      comptModel = new G4PenelopeComptonModel();
+      comptModel->SetHighEnergyLimit(highEnergyLimit);
+      compt->AddEmModel(0, comptModel);
+      pmanager->AddDiscreteProcess(compt);
+
+      G4GammaConversion* conv = new G4GammaConversion();
+      G4PenelopeGammaConversionModel* 
+      convModel = new G4PenelopeGammaConversionModel();
+      convModel->SetHighEnergyLimit(highEnergyLimit);
+      conv->AddEmModel(0, convModel);
+      pmanager->AddDiscreteProcess(conv);
+
+      G4RayleighScattering* rayl = new G4RayleighScattering();
+      G4PenelopeRayleighModel* 
+      raylModel = new G4PenelopeRayleighModel();
+      raylModel->SetHighEnergyLimit(highEnergyLimit);
+      rayl->AddEmModel(0, raylModel);
+      pmanager->AddDiscreteProcess(rayl);
       
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4PenelopeIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2);
-	    
+
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4PenelopeIonisationModel* 
+      eIoniModel = new G4PenelopeIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
+      
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4PenelopeBremsstrahlungModel* 
+      eBremModel = new G4PenelopeBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);
+      	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4PenelopeIonisation,     -1, 1, 1);
-      pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2);      
-      pmanager->AddProcess(new G4PenelopeAnnihilation,    0,-1, 3);
+      G4eIonisation* eIoni = new G4eIonisation();
+      G4PenelopeIonisationModel* 
+      eIoniModel = new G4PenelopeIonisationModel();
+      eIoniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() );
+      pmanager->AddProcess(eIoni,                   -1, 1, 1);
       
+      G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
+      G4PenelopeBremsstrahlungModel* 
+      eBremModel = new G4PenelopeBremsstrahlungModel();
+      eBremModel->SetHighEnergyLimit(highEnergyLimit);
+      eBrem->AddEmModel(0, eBremModel);
+      pmanager->AddProcess(eBrem,                   -1, 2, 2);      
+
+      G4eplusAnnihilation* eAnni = new G4eplusAnnihilation();
+      G4PenelopeAnnihilationModel* 
+      eAnniModel = new G4PenelopeAnnihilationModel();
+      eAnniModel->SetHighEnergyLimit(highEnergyLimit); 
+      eAnni->AddEmModel(0, eAnniModel);
+      pmanager->AddProcess(eAnni,                    0,-1, 3);
+            
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);       
+      pmanager->AddProcess(new G4MuIonisation,      -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,  -1, 3, 3);       
      
     } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4ionIonisation,      -1, 1,1);
-     
+      pmanager->AddProcess(new G4ionIonisation,     -1, 1, 1);
+
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,       -1, 1, 1);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmStandard.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysListEmStandard.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.2 2009/11/19 18:46:04 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -81,22 +81,22 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1,1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2,2);
+      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1,1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2,2);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,3);
+      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
+      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 3);
             
     } else if (particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1,1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2,2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3,3);
+      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);
              
     } else if (particleName == "alpha" || particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4ionIonisation,      -1, 1,1);
+      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);
      
     } else if ((!particle->IsShortLived()) &&
@@ -104,5 +104,5 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hIonisation,        -1,1,1);
+      pmanager->AddProcess(new G4hIonisation,        -1, 1, 1);
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.2 2007/11/20 14:15:18 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.5 2009/03/06 18:24:07 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,5 +54,5 @@
   cutForGamma     = defaultCutValue;
   cutForElectron  = defaultCutValue;
-  
+    
   SetVerboseLevel(1);
 }
@@ -185,13 +185,14 @@
   //physics tables
   //
-  emOptions.SetMinEnergy(100*eV);    
-  emOptions.SetMaxEnergy(100*TeV);  
-  emOptions.SetDEDXBinning(1200);  
-  emOptions.SetLambdaBinning(1200);
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);  
   
   //energy loss
   //  
-  emOptions.SetStepFunction(0.2, 10*um);
-  emOptions.SetLinearLossLimit(1.e-6);
+  emOptions.SetStepFunction(0.2, 10*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);		//default
           
   //build CSDA range
@@ -199,5 +200,9 @@
   emOptions.SetBuildCSDARange(true);
   emOptions.SetMaxEnergyForCSDARange(100*TeV);  
-  emOptions.SetDEDXBinningForCSDARange(1200);
+  emOptions.SetDEDXBinningForCSDARange(12*20);
+   
+  //ionization
+  //
+  emOptions.SetSubCutoff(false);	//default  
 }
 
@@ -228,5 +233,4 @@
 void PhysicsList::SetCuts()
 {
-
   if (verboseLevel >0){
     G4cout << "PhysicsList::SetCuts:";
Index: trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsListMessenger.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.cc,v 1.3 2009/03/06 18:24:07 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -69,5 +69,5 @@
   allCutCmd->SetUnitCategory("Length");
   allCutCmd->SetRange("cut>0.0");
-  allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
+  allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
 }
 
@@ -101,5 +101,5 @@
      pPhysicsList->SetCutForGamma(cut);
      pPhysicsList->SetCutForElectron(cut);
-    } 
+    }
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm18/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.2 2007/02/16 11:59:47 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/StackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/StackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/StackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm18/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm18/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm18/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.1 2007/02/13 17:57:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.21 2006/10/20 16:03:39 maire Exp $
+# $Id: GNUmakefile,v 1.23 2008/06/10 09:33:05 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm2/TestEm2.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/TestEm2.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/TestEm2.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm2.cc,v 1.14 2007/06/21 17:47:08 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.9 2006/06/29 16:49:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.6 2006/06/29 16:49:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/EmAcceptance.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/EmAcceptance.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/EmAcceptance.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EmAcceptance.hh,v 1.3 2006/06/29 16:49:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.3 2006/06/29 16:49:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:49:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.4 2006/06/29 16:49:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.8 2006/06/29 16:49:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.5 2006/06/29 16:49:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.5 2006/06/29 16:49:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.9 2006/06/29 16:49:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/RunActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/RunActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/RunActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunActionMessenger.hh,v 1.4 2006/06/29 16:50:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.2 2006/06/29 16:50:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:50:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:50:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:50:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm2/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.4 2006/06/29 16:50:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/run01.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/run01.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/run01.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run01.mac,v 1.25 2007/06/21 14:21:46 maire Exp $
+# $Id: run01.mac,v 1.27 2009/09/16 18:07:30 maire Exp $
 #
 # Macro file for "TestEm2.cc" 
@@ -9,14 +9,14 @@
 /run/verbose 2
 #
-/testem/det/setMat PbWO4
+/testem/det/setMat G4_PbWO4
 /testem/det/setLbin 40 0.5
 /testem/det/setRbin 50 0.1
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  emstandard_opt0
 #
 /testem/phys/setCuts 1 mm
 #
 # histogram file
-/testem/histo/setFileName stand
+/testem/histo/setFileName run01
 /testem/histo/setFileType hbook
 #
Index: trunk/examples/extended/electromagnetic/TestEm2/run02.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/run02.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/run02.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run02.mac,v 1.10 2006/10/20 16:03:39 maire Exp $
+# $Id: run02.mac,v 1.12 2009/09/16 18:07:30 maire Exp $
 #
 # Macro file for "TestEm2.cc" 
@@ -12,9 +12,9 @@
 /run/verbose 2
 #
-/testem/det/setMat Aluminium
+/testem/det/setMat G4_Al
 /testem/det/setLbin 12 1.1245
 /testem/det/setRbin 12 0.11245
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  emstandard_opt0
 #
 /testem/phys/setCuts 2.0 mm
Index: trunk/examples/extended/electromagnetic/TestEm2/run03.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/run03.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/run03.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run03.mac,v 1.11 2006/10/20 16:03:40 maire Exp $
+# $Id: run03.mac,v 1.13 2009/09/16 18:07:30 maire Exp $
 #
 # Macro file for "TestEm2.cc" 
@@ -16,5 +16,5 @@
 /testem/det/setRbin 6 0.111
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  emstandard_opt0
 #
 /testem/phys/setCuts 5.0 mm
Index: trunk/examples/extended/electromagnetic/TestEm2/run05.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/run05.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/run05.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run05.mac,v 1.5 2006/10/20 16:03:40 maire Exp $
+# $Id: run05.mac,v 1.7 2009/09/16 18:07:30 maire Exp $
 #
 #
@@ -10,5 +10,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/phys/setCuts 1 mm
@@ -20,5 +20,5 @@
 /run/beamOn 10
 #
-/run/particle/applyCuts
+/process/em/applyCuts true 
 /run/beamOn 10
 /run/dumpCouples
Index: trunk/examples/extended/electromagnetic/TestEm2/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/DetectorConstruction.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 // 
-// $Id: DetectorConstruction.cc,v 1.12 2006/10/20 16:03:40 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: DetectorConstruction.cc,v 1.14 2009/09/16 18:07:30 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -43,4 +43,10 @@
 #include "G4LogicalVolumeStore.hh"
 #include "G4SolidStore.hh"
+
+#include "G4FieldManager.hh"
+#include "G4TransportationManager.hh"
+
+#include "G4NistManager.hh"
+#include "G4RunManager.hh"
 
 #include "G4UnitsTable.hh"
@@ -56,5 +62,5 @@
 {
   DefineMaterials();
-  SetMaterial("PbWO4");
+  SetMaterial("G4_PbWO4");
   detectorMessenger = new DetectorMessenger(this);
 }
@@ -77,14 +83,11 @@
 {
   //
-  // define few Elements
+  // define few Elements by hand
   //
   G4double a, z;
     
   G4Element* H  = new G4Element("Hydrogen",  "H", z= 1., a=   1.01*g/mole);
-  G4Element* N  = new G4Element("Nitrogen",  "N", z= 7., a=  14.01*g/mole);
   G4Element* O  = new G4Element("Oxygen"  ,  "O", z= 8., a=  16.00*g/mole);
   G4Element* Ge = new G4Element("Germanium", "Ge",z=32., a=  72.59*g/mole);
-  G4Element* W  = new G4Element("Tungsten",  "W", z=74., a= 183.84*g/mole);
-  G4Element* Pb = new G4Element("Lead",      "Pb",z=82., a= 207.19*g/mole);
   G4Element* Bi = new G4Element("Bismuth",   "Bi",z=83., a= 208.98*g/mole);
 
@@ -93,11 +96,7 @@
   //
   G4double density;
-  G4double fractionmass;  G4int ncomponents, natoms;
-
-  G4Material* Air = 
-  new G4Material("Air", density= 1.29*mg/cm3, ncomponents=2);
-  Air->AddElement(N, fractionmass=0.7);
-  Air->AddElement(O, fractionmass=0.3);
-
+  G4int ncomponents, natoms;
+
+  // water with ionisation potential 75 eV
   G4Material* H2O = 
   new G4Material("Water", density= 1.00*g/cm3, ncomponents=2);
@@ -106,16 +105,14 @@
   H2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV);
 
+  // pure materails
   new G4Material("liquidArgon", z=18., a= 39.95*g/mole, density= 1.390*g/cm3);
-
   new G4Material("Aluminium",   z=13., a= 26.98*g/mole, density= 2.7*g/cm3);
-
-  new G4Material("Iron",        z=26., a= 55.85*g/mole, density= 7.87*g/cm3);
-  
-  new G4Material("Copper"     , z=29., a= 63.55*g/mole, density= 8.960*g/cm3);
-  
-  new G4Material("Lead",        z=82., a=207.19*g/mole, density=11.35*g/cm3);
-  
+  new G4Material("Iron",        z=26., a= 55.85*g/mole, density= 7.87*g/cm3);  
+  new G4Material("Copper",      z=29., a= 63.55*g/mole, density= 8.960*g/cm3); 
+  new G4Material("Tungsten",    z=74., a=183.84*g/mole, density=19.35*g/cm3);    
+  new G4Material("Lead",        z=82., a=207.19*g/mole, density=11.35*g/cm3);  
   new G4Material("Uranium"    , z=92., a=238.03*g/mole, density= 18.95*g/cm3);
-    
+
+  // compound material
   G4Material* BGO = 
   new G4Material("BGO", density= 7.10*g/cm3, ncomponents=3);
@@ -124,10 +121,4 @@
   BGO->AddElement(Bi, natoms= 4);
 
-  G4Material* PbWO = 
-  new G4Material("PbWO4", density= 8.28*g/cm3, ncomponents=3);
-  PbWO->AddElement(O , natoms=4);
-  PbWO->AddElement(Pb, natoms=1);
-  PbWO->AddElement(W , natoms=1);
-
   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
 }
@@ -171,6 +162,12 @@
 {
   // search the material by its name
-  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
-  if (pttoMaterial) myMaterial = pttoMaterial;
+  G4Material* pttoMaterial =
+    G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
+
+  if (pttoMaterial) {
+    myMaterial = pttoMaterial;
+    if(logicEcal) logicEcal->SetMaterial(myMaterial);
+    G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+  }
 }
 
@@ -202,7 +199,4 @@
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4FieldManager.hh"
-#include "G4TransportationManager.hh"
 
 void DetectorConstruction::SetMagField(G4double fieldValue)
@@ -226,6 +220,4 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-#include "G4RunManager.hh"
-
 void DetectorConstruction::UpdateGeometry()
 {
Index: trunk/examples/extended/electromagnetic/TestEm2/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.8 2006/06/29 16:50:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/EmAcceptance.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/EmAcceptance.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/EmAcceptance.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EmAcceptance.cc,v 1.5 2006/06/29 16:50:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.3 2006/06/29 16:50:24 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:50:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm2/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/PhysListEmStandard.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmStandard.cc,v 1.6 2007/06/21 14:21:46 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.13 2009/11/13 16:01:10 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,15 +39,20 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
+#include "G4UrbanMscModel93.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
 
+#include "G4hMultipleScattering.hh"
 #include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
+
 #include "G4ionIonisation.hh"
 
@@ -87,26 +92,42 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
       	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
             
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
+      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);       
+             
+    } else if( particleName == "proton" ||
+               particleName == "pi-" ||
+               particleName == "pi+"    ) {
+      //proton  
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
      
-    } else if( particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,     -1, 2,2);
+    } else if( particleName == "alpha" || 
+	       particleName == "He3" || 
+	       particleName == "GenericIon" ) {
+      //Ions 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
 
     } else if ((!particle->IsShortLived()) &&
@@ -114,30 +135,39 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering,-1,1,1);
-      pmanager->AddProcess(new G4hIonisation,       -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     }
   }
-   
+
   // Em options
   //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
   G4EmProcessOptions emOptions;
-    
-  //coulomb scattering
+  
+  //physics tables
   //
-  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);   
-  emOptions.SetSkin(2.);
-  
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //multiple coulomb scattering
+  //
+  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
+  emOptions.SetMscRangeFactor(0.04);	//default
+  emOptions.SetMscGeomFactor (2.5);	//default       
+  emOptions.SetSkin(3.);		//default
+      
   //energy loss
   //
-  emOptions.SetLinearLossLimit(1.e-6);
-  emOptions.SetStepFunction(0.2, 100*um); 
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);		//default
    
   //ionization
   //
-  emOptions.SetSubCutoff(true);
-    
-  // define high energy threshold for bremstrahlung 
-  //
-  emOptions.SetBremsstrahlungTh(10.*GeV); 
+  emOptions.SetSubCutoff(false);		//default=false   
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.13 2007/06/22 16:35:07 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.16 2009/09/16 18:07:30 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,42 +34,19 @@
 
 #include "PhysListEmStandard.hh"
-#include "PhysListEmLivermore.hh"
-#include "PhysListEmPenelope.hh"
 
 #include "G4EmStandardPhysics.hh"
 #include "G4EmStandardPhysics_option1.hh"
 #include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
+#include "G4EmLivermorePhysics.hh"
+#include "G4EmPenelopePhysics.hh"
+
+#include "G4Decay.hh"
+#include "StepMax.hh"
 
 #include "G4LossTableManager.hh"
+#include "G4ProcessManager.hh"
+
 #include "G4UnitsTable.hh"
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-PhysicsList::PhysicsList() : G4VModularPhysicsList()
-{
-  G4LossTableManager::Instance();
-  defaultCutValue = 1.*mm;
-  cutForGamma     = defaultCutValue;
-  cutForElectron  = defaultCutValue;
-  cutForPositron  = defaultCutValue;
-
-  pMessenger = new PhysicsListMessenger(this);
-
-  SetVerboseLevel(1);
-
-  // EM physics
-  emPhysicsList = new PhysListEmStandard(emName = "standard");
-
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-PhysicsList::~PhysicsList()
-{
-  delete pMessenger;
-  delete emPhysicsList;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 // Bosons
@@ -77,7 +54,8 @@
 #include "G4Geantino.hh"
 #include "G4Gamma.hh"
-#include "G4OpticalPhoton.hh"
 
 // leptons
+#include "G4Electron.hh"
+#include "G4Positron.hh"
 #include "G4MuonPlus.hh"
 #include "G4MuonMinus.hh"
@@ -119,17 +97,43 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
+PhysicsList::PhysicsList() : G4VModularPhysicsList()
+{
+  G4LossTableManager::Instance();
+  defaultCutValue = 1.*mm;
+  cutForGamma     = defaultCutValue;
+  cutForElectron  = defaultCutValue;
+  cutForPositron  = defaultCutValue;
+
+  pMessenger = new PhysicsListMessenger(this);
+
+  SetVerboseLevel(1);
+
+  // EM physics
+  ///emName = "emstandard_opt0";  
+  ///emPhysicsList = new G4EmStandardPhysics();
+  emName = "local";    
+  emPhysicsList = new PhysListEmStandard(emName);    
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+PhysicsList::~PhysicsList()
+{
+  delete pMessenger;
+  delete emPhysicsList;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
 void PhysicsList::ConstructParticle()
 {
-// pseudo-particles
+  // pseudo-particles
   G4Geantino::GeantinoDefinition();
   G4ChargedGeantino::ChargedGeantinoDefinition();
   
-// gamma
+  // gamma
   G4Gamma::GammaDefinition();
   
-// optical photon
-  G4OpticalPhoton::OpticalPhotonDefinition();
-
-// leptons
+  // leptons
   G4Electron::ElectronDefinition();
   G4Positron::PositronDefinition();
@@ -142,5 +146,5 @@
   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();  
 
-// mesons
+  // mesons
   G4PionPlus::PionPlusDefinition();
   G4PionMinus::PionMinusDefinition();
@@ -155,5 +159,5 @@
   G4KaonZeroShort::KaonZeroShortDefinition();
 
-// barions
+  // barions
   G4Proton::ProtonDefinition();
   G4AntiProton::AntiProtonDefinition();
@@ -161,5 +165,5 @@
   G4AntiNeutron::AntiNeutronDefinition();
 
-// ions
+  // ions
   G4Deuteron::DeuteronDefinition();
   G4Triton::TritonDefinition();
@@ -170,6 +174,4 @@
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4ProcessManager.hh"
 
 void PhysicsList::ConstructProcess()
@@ -202,5 +204,5 @@
   if (name == emName) return;
 
-  if (name == "standard") {
+  if (name == "local") {
 
     emName = name;
@@ -208,5 +210,5 @@
     emPhysicsList = new PhysListEmStandard(name);
     
-  } else if (name == "emstandard") {
+  } else if (name == "emstandard_opt0") {
 
     emName = name;
@@ -226,16 +228,20 @@
     emPhysicsList = new G4EmStandardPhysics_option2();
 
-  } else if (name == "livermore") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmLivermore(name);
+  } else if (name == "emstandard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
     
-  } else if (name == "penelope") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmPenelope(name);
-        
+  } else if (name == "empenelope"){
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmPenelopePhysics();
+
+  } else if (name == "emlivermore"){
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmLivermorePhysics();
+
   } else {
 
@@ -247,6 +253,4 @@
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4Decay.hh"
 
 void PhysicsList::AddDecay()
@@ -275,6 +279,4 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-#include "StepMax.hh"
-
 void PhysicsList::AddStepMax()
 {
@@ -295,8 +297,4 @@
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4Gamma.hh"
-#include "G4Electron.hh"
-#include "G4Positron.hh"
 
 void PhysicsList::SetCuts()
Index: trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.5 2006/06/29 16:50:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.6 2006/06/29 16:50:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.21 2006/06/29 16:50:47 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: RunAction.cc,v 1.24 2009/09/16 18:07:30 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -87,5 +87,5 @@
     
   histoName[0] = "testem2";
-  histoType    = "hbook";  
+  histoType    = "root";
 }
 
@@ -112,5 +112,5 @@
   G4bool readOnly  = false;
   G4bool createNew = true;
-  G4String options = "--noErrors uncompress";
+  G4String options = "--noErrors export=root uncompress";
   AIDA::ITreeFactory* tf  = af->createTreeFactory();  
   tree = tf->create(histoName[1], histoType, readOnly, createNew, options);
@@ -291,5 +291,5 @@
 #ifdef G4ANALYSIS_USE
     if(tree) {
-      G4double bin = i*dLradl;
+      G4double bin = (i+0.5)*dLradl;
       histo[3]->fill(bin,MeanELongit[i]/dLradl);
       bin = (i+1)*dLradl;
@@ -319,5 +319,5 @@
 #ifdef G4ANALYSIS_USE
     if(tree) {
-      G4double bin = i*dRradl;
+      G4double bin = (i+0.5)*dRradl;
       histo[6]->fill(bin,MeanERadial[i]/dRradl);
       bin = (i+1)*dRradl;
Index: trunk/examples/extended/electromagnetic/TestEm2/src/RunActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/RunActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/RunActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunActionMessenger.cc,v 1.4 2006/06/29 16:50:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.2 2006/06/29 16:50:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 16:50:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.6 2006/06/29 16:50:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:50:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm2/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm2/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm2/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.3 2006/06/29 16:51:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.20 2006/10/31 12:53:48 maire Exp $
+# $Id: GNUmakefile,v 1.21 2008/06/11 22:12:32 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm3/TestEm3.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/TestEm3.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/TestEm3.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm3.cc,v 1.23 2007/06/22 09:22:05 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/atlashec.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/atlashec.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/atlashec.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: atlashec.mac,v 1.7 2007/05/18 19:00:43 vnivanch Exp $
+# $Id: atlashec.mac,v 1.8 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -14,5 +14,5 @@
 /testem/det/setSizeYZ             17 cm
 #
-/testem/phys/addPhysics  emstandard
+/testem/phys/addPhysics  emstandard_opt0
 /testem/phys/setCuts 0.7 mm
 #
Index: trunk/examples/extended/electromagnetic/TestEm3/dedx.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/dedx.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/dedx.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: dedx.mac,v 1.4 2006/03/20 12:26:03 maire Exp $
+# $Id: dedx.mac,v 1.5 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -15,5 +15,5 @@
 /testem/det/setSizeYZ 1 cm
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 /testem/phys/setCuts 1 km
 #
Index: trunk/examples/extended/electromagnetic/TestEm3/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.13 2006/06/29 16:51:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.8 2006/06/29 16:51:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/EmAcceptance.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/EmAcceptance.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/EmAcceptance.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EmAcceptance.hh,v 1.4 2006/06/29 16:51:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.10 2006/06/29 16:51:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:51:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.8 2007/11/12 17:04:55 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.5 2007/11/12 17:04:55 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/PhysListEmStandard.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.4 2006/06/29 16:51:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsList.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.hh,v 1.6 2006/06/29 16:51:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.hh,v 1.8 2009/11/13 17:01:44 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,7 +44,7 @@
 class PhysicsList: public G4VModularPhysicsList
 {
-  public:
+public:
     PhysicsList();
-   ~PhysicsList();
+    virtual ~PhysicsList();
 
     void ConstructParticle();
Index: trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:52:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:52:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:52:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/RunAction.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.hh,v 1.18 2007/04/22 16:25:21 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: RunAction.hh,v 1.19 2008/05/29 16:59:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,5 +56,5 @@
 
   RunAction(DetectorConstruction*, PrimaryGeneratorAction*, HistoManager*);
-  virtual ~RunAction();
+  ~RunAction();
 
   void BeginOfRunAction(const G4Run*);
@@ -64,7 +64,7 @@
     
   void sumEnergyFlow(G4int plane, G4double Eflow)
-                                                 {EnergyFlow[plane]  += Eflow;};
+                                            {EnergyFlow[plane]  += Eflow;};
   void sumLateralEleak(G4int cell, G4double Eflow)
-                                                 {lateralEleak[cell] += Eflow;};
+                                            {lateralEleak[cell] += Eflow;};
     
   void PrintDedxTables();
Index: trunk/examples/extended/electromagnetic/TestEm3/include/RunActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/RunActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/RunActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunActionMessenger.hh,v 1.10 2007/04/22 16:25:21 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.7 2006/06/29 16:52:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:52:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/SteppingAction.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: SteppingAction.hh,v 1.8 2006/06/29 16:52:16 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: SteppingAction.hh,v 1.9 2008/03/14 15:40:03 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -52,5 +52,5 @@
     void UserSteppingAction(const G4Step*);
     
-    G4double BirkAttenuation(const G4Step*);
+    G4double BirksAttenuation(const G4Step*);
     
   private:
Index: trunk/examples/extended/electromagnetic/TestEm3/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.5 2006/06/29 16:52:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm3/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:52:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/ionC12.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/ionC12.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/ionC12.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: ionC12.mac,v 1.10 2006/10/31 12:53:48 maire Exp $
+# $Id: ionC12.mac,v 1.11 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc"
@@ -12,5 +12,5 @@
 #  select EM PhysicsList
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/phys/setCuts 1 mm
Index: trunk/examples/extended/electromagnetic/TestEm3/lhcb.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/lhcb.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/lhcb.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: lhcb.mac,v 1.3 2007/05/18 19:00:44 vnivanch Exp $
+# $Id: lhcb.mac,v 1.4 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -14,5 +14,5 @@
 /testem/det/setSizeYZ 20 cm
 #
-/testem/phys/addPhysics  emstandard
+/testem/phys/addPhysics  emstandard_opt0
 #
 /gun/particle e-
Index: trunk/examples/extended/electromagnetic/TestEm3/linac.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/linac.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/linac.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: linac.mac,v 1.5 2006/11/08 10:27:18 maire Exp $
+# $Id: linac.mac,v 1.6 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3" 
@@ -16,5 +16,5 @@
 /testem/det/setSizeYZ  30 cm
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 /testem/phys/setCuts 10 um
 #
Index: trunk/examples/extended/electromagnetic/TestEm3/lockwood.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/lockwood.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/lockwood.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: lockwood.mac,v 1.5 2006/03/20 12:26:03 maire Exp $
+# $Id: lockwood.mac,v 1.6 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -11,6 +11,5 @@
 /run/verbose 2
 #
-###/testem/phys/addPhysics  g4v52
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/det/setNbOfLayers 1
Index: trunk/examples/extended/electromagnetic/TestEm3/retrieveTables.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/retrieveTables.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/retrieveTables.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: retrieveTables.mac,v 1.4 2007/05/18 19:00:44 vnivanch Exp $
+# $Id: retrieveTables.mac,v 1.6 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "exampleN03.cc"
@@ -10,8 +10,10 @@
 #  select EM PhysicsList
 #
-/testem/phys/addPhysics  emstandard
+/testem/phys/addPhysics  emstandard_opt0
 #
 /run/particle/retrievePhysicsTable physdata
 /run/initialize
+/process/eLoss/verbose 1
+/process/eLoss/CSDARange true
 #
 /gun/particle e-
Index: trunk/examples/extended/electromagnetic/TestEm3/run01.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/run01.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/run01.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run01.mac,v 1.17 2006/10/31 12:53:48 maire Exp $
+# $Id: run01.mac,v 1.19 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "exampleN03.cc" 
@@ -9,7 +9,7 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
-/testem/phys/setCuts 0.1 um
+/testem/phys/setCuts 100 um
 #
 /run/initialize
Index: trunk/examples/extended/electromagnetic/TestEm3/run02.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/run02.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/run02.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run02.mac,v 1.15 2006/10/31 12:53:48 maire Exp $
+# $Id: run02.mac,v 1.16 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -9,5 +9,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/det/setNbOfLayers 50
Index: trunk/examples/extended/electromagnetic/TestEm3/run07.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/run07.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/run07.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run07.mac,v 1.12 2006/10/31 12:53:48 maire Exp $
+# $Id: run07.mac,v 1.13 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -9,5 +9,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/det/setNbOfLayers 2
Index: trunk/examples/extended/electromagnetic/TestEm3/run08.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/run08.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/run08.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run08.mac,v 1.9 2006/10/31 12:53:48 maire Exp $
+# $Id: run08.mac,v 1.10 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -9,5 +9,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/phys/setCuts 1 mm
Index: trunk/examples/extended/electromagnetic/TestEm3/run15.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/run15.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/run15.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: run15.mac,v 1.15 2006/10/31 12:53:48 maire Exp $
+# $Id: run15.mac,v 1.16 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -9,5 +9,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/det/setNbOfLayers 20
Index: trunk/examples/extended/electromagnetic/TestEm3/sicapo1.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/sicapo1.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/sicapo1.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: sicapo1.mac,v 1.4 2006/10/31 12:53:48 maire Exp $
+# $Id: sicapo1.mac,v 1.5 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -12,5 +12,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/det/setNbOfLayers 15
Index: trunk/examples/extended/electromagnetic/TestEm3/sicapo2.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/sicapo2.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/sicapo2.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: sicapo2.mac,v 1.4 2006/10/31 12:53:48 maire Exp $
+# $Id: sicapo2.mac,v 1.5 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -12,5 +12,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/det/setNbOfLayers 15
Index: trunk/examples/extended/electromagnetic/TestEm3/sicapo3.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/sicapo3.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/sicapo3.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: sicapo3.mac,v 1.5 2006/10/31 12:53:48 maire Exp $
+# $Id: sicapo3.mac,v 1.6 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "TestEm3.cc" 
@@ -11,5 +11,5 @@
 /run/verbose 2
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #
 /testem/det/setNbOfLayers 10
Index: trunk/examples/extended/electromagnetic/TestEm3/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/DetectorConstruction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: DetectorConstruction.cc,v 1.20 2007/03/19 20:10:38 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: DetectorConstruction.cc,v 1.23 2009/03/04 18:49:17 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -105,4 +105,5 @@
   G4Element* H  = manager->FindOrBuildElement(1);
   G4Element* C  = manager->FindOrBuildElement(6);
+  G4Element* N  = manager->FindOrBuildElement(7);
   G4Element* O  = manager->FindOrBuildElement(8);
   G4Element* Si = manager->FindOrBuildElement(14);
@@ -164,4 +165,6 @@
   Sci->AddElement(C, natoms=9);
   Sci->AddElement(H, natoms=10);
+  
+  Sci->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
 
   G4Material* Lct =
@@ -199,4 +202,11 @@
   BGO->AddElement(Bi, natoms= 4);
 
+  //SiNx
+  density= 3.1 *g/cm3;
+  G4Material* SiNx= new G4Material("SiNx", density, ncomponents=3);
+  SiNx-> AddElement(Si, 300);
+  SiNx-> AddElement(N, 310);
+  SiNx-> AddElement(H, 6);
+
   //
   // define gaseous materials using G4 NIST database 
@@ -205,5 +215,5 @@
   
   G4Material* Air = manager->FindOrBuildMaterial("G4_AIR");
-  manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin, 1.*atmosphere);
+  manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin,1.*atmosphere);
 
   G4Material* lAr = manager->FindOrBuildMaterial("G4_lAr");
@@ -242,5 +252,7 @@
                   kStateGas, temperature= 273*kelvin, pressure= 1*atmosphere);
   steam->AddMaterial(H2O, fractionmass=1.);
-
+  
+  new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3,
+		 kStateGas, 273.15*kelvin, 1*atmosphere);
   //
   // examples of vacuum
Index: trunk/examples/extended/electromagnetic/TestEm3/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.11 2006/06/29 16:52:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/EmAcceptance.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/EmAcceptance.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/EmAcceptance.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EmAcceptance.cc,v 1.6 2006/06/29 16:52:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/EventAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: EventAction.cc,v 1.15 2007/04/22 16:25:21 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: EventAction.cc,v 1.16 2008/05/29 16:59:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -71,6 +71,7 @@
   //initialize EnergyDeposit per event
   //
-  for (G4int k=0; k<MaxAbsor; k++)
+  for (G4int k=0; k<MaxAbsor; k++) {
     energyDeposit[k] = trackLengthCh[k] = 0.0;   
+  }
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm3/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.4 2006/06/29 16:52:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.14 2007/11/12 17:04:55 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: HistoManager.cc,v 1.17 2009/03/04 18:49:17 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem3";
-  fileType    = "hbook";  
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";  
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) { 
@@ -241,5 +241,5 @@
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -254,5 +254,7 @@
 {
 #ifdef G4ANALYSIS_USE
- 
+
+ if (!ascii[0]) return;
+  
  G4String name = fileName[0] + ".ascii";
  std::ofstream File(name, std::ios::out);
@@ -267,5 +269,6 @@
       for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
          File << "  " << iBin << "\t" 
-              << histo[ih]->binMean(iBin) << "\t"
+              << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
+	              histo[ih]->axis().binUpperEdge(iBin)) << "\t"
 	      << histo[ih]->binHeight(iBin) 
 	      << G4endl;
Index: trunk/examples/extended/electromagnetic/TestEm3/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.9 2007/11/12 17:04:55 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/PhysListEmStandard.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysListEmStandard.cc,v 1.14 2007/06/22 09:22:05 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.23 2009/11/13 17:01:44 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,15 +38,20 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
+#include "G4UrbanMscModel93.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
 
+#include "G4hMultipleScattering.hh"
 #include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
+
 #include "G4ionIonisation.hh"
 
@@ -85,28 +90,42 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2, 2);
-      pmanager->AddProcess(new G4eBremsstrahlung(),  -1, 3, 3);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);      
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung(),   -1, 3, 3);
       
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2, 2);
-      pmanager->AddProcess(new G4eBremsstrahlung(),  -1, 3, 3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 4);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);      
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung(),   -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
       
-    } else if( particleName == "mu+" || 
-               particleName == "mu-"    ) {
+    } else if( particleName == "mu-" || 
+               particleName == "mu+"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
-      pmanager->AddProcess(new G4MuIonisation,       -1, 2, 2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 3, 3);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 4, 4);       
+      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);
+             
+    } else if( particleName == "proton" ||
+               particleName == "pi-" ||
+               particleName == "pi+"    ) {
+      //proton  
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
      
     } else if( particleName == "alpha" || 
 	       particleName == "He3" || 
-	       particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
-      pmanager->AddProcess(new G4ionIonisation,      -1, 2, 2);
+	       particleName == "GenericIon" ) {
+      //Ions 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
 
     } else if ((!particle->IsShortLived()) &&
@@ -114,6 +133,6 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
-      pmanager->AddProcess(new G4hIonisation,        -1, 2, 2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     }
   }
@@ -121,19 +140,32 @@
   // Em options
   //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
   G4EmProcessOptions emOptions;
-    
-  //coulomb scattering
+  
+  //physics tables
   //
-  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);   
-  emOptions.SetSkin(2.);
-  
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //multiple coulomb scattering
+  //
+  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
+  emOptions.SetMscRangeFactor(0.04);	//default
+  emOptions.SetMscGeomFactor (2.5);	//default       
+  emOptions.SetSkin(3.);		//default
+      
   //energy loss
   //
-  emOptions.SetLinearLossLimit(1.e-6);
-  emOptions.SetStepFunction(0.2, 100*um); 
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)      
+  emOptions.SetLinearLossLimit(1.e-2);		//default
    
   //ionization
   //
-  emOptions.SetSubCutoff(true);
+  emOptions.SetSubCutoff(false);		//default=false
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.20 2007/11/13 14:37:05 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.30 2009/11/13 17:01:44 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,14 +34,14 @@
 
 #include "PhysListEmStandard.hh"
-#include "PhysListEmStandardIG.hh"
-#include "PhysListEmLivermore.hh"
-#include "PhysListEmPenelope.hh"
 
 #include "G4EmStandardPhysics.hh"
 #include "G4EmStandardPhysics_option1.hh"
 #include "G4EmStandardPhysics_option2.hh"
-
-#include "G4LossTableManager.hh"
+#include "G4EmStandardPhysics_option3.hh"
+#include "G4EmLivermorePhysics.hh"
+#include "G4EmPenelopePhysics.hh"
+
 #include "G4UnitsTable.hh"
+#include "G4UrbanMscModel.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -49,5 +49,4 @@
 PhysicsList::PhysicsList() : G4VModularPhysicsList()
 {
-  G4LossTableManager::Instance();
   currentDefaultCut   = 1.0*mm;
   cutForGamma         = currentDefaultCut;
@@ -60,5 +59,5 @@
 
   // EM physics
-  emName = G4String("standard");
+  emName = G4String("local");
   emPhysicsList = new PhysListEmStandard(emName);
 
@@ -214,5 +213,5 @@
   if (name == emName) return;
 
-  if (name == "standard") {
+  if (name == "local") {
 
     emName = name;
@@ -220,5 +219,5 @@
     emPhysicsList = new PhysListEmStandard(name);
 
-  } else if (name == "emstandard") {
+  } else if (name == "emstandard_opt0") {
 
     emName = name;
@@ -237,22 +236,22 @@
     delete emPhysicsList;
     emPhysicsList = new G4EmStandardPhysics_option2();
-
-  } else if (name == "standardIG") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmStandardIG(name);
-
-  } else if (name == "livermore") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmLivermore(name);
-
-  } else if (name == "penelope") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmPenelope(name);
+    
+  } else if (name == "emstandard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
+    
+  } else if (name == "emlivermore") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmLivermorePhysics();
+
+  } else if (name == "empenelope") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmPenelopePhysics();
 
   } else {
@@ -288,6 +287,5 @@
 
 void PhysicsList::SetCuts()
-{
-     
+{     
   if (verboseLevel >0){
     G4cout << "PhysicsList::SetCuts:";
@@ -306,8 +304,4 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-#include "G4Gamma.hh"
-#include "G4Electron.hh"
-#include "G4Positron.hh"
-
 void PhysicsList::SetCutForGamma(G4double cut)
 {
Index: trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:52:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.7 2006/06/29 16:53:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.3 2006/06/29 16:53:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.34 2007/04/24 13:05:14 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: RunAction.cc,v 1.37 2008/05/29 16:59:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -131,5 +131,5 @@
   G4cout << "\n------------------------------------------------------------\n";
   G4cout << std::setw(14) << "material"
-         << std::setw(17) << "Total Edep"
+         << std::setw(17) << "Edep       RMS"
 	 << std::setw(33) << "sqrt(E0(GeV))*rmsE/Emean"
 	 << std::setw(23) << "total tracklen \n \n";
@@ -139,6 +139,7 @@
       MeanEAbs  = sumEAbs[k]*norm;
       MeanEAbs2 = sum2EAbs[k]*norm;
-      rmsEAbs  = std::sqrt(std::fabs(MeanEAbs2 - MeanEAbs*MeanEAbs));
-
+      rmsEAbs  = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs));
+      //G4cout << "k= " << k << "  RMS= " <<  rmsEAbs 
+      //     << "  applyLimit: " << applyLimit << G4endl;
       if(applyLimit) {
         G4int    nn    = 0;
@@ -159,5 +160,5 @@
 	MeanEAbs  = sume*norm1;
 	MeanEAbs2 = sume2*norm1;
-	rmsEAbs  = std::sqrt(std::fabs(MeanEAbs2 - MeanEAbs*MeanEAbs));
+	rmsEAbs  = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs));
       }
 
@@ -171,5 +172,5 @@
       MeanLAbs  = sumLAbs[k]*norm;
       MeanLAbs2 = sum2LAbs[k]*norm;
-      rmsLAbs  = std::sqrt(std::fabs(MeanLAbs2 - MeanLAbs*MeanLAbs));
+      rmsLAbs  = std::sqrt(std::abs(MeanLAbs2 - MeanLAbs*MeanLAbs));
 
       //print
@@ -178,5 +179,5 @@
        << std::setw(14) << Detector->GetAbsorMaterial(k)->GetName() << ": "
        << std::setprecision(5)
-       << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " +- "
+       << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " :  "
        << std::setprecision(4)
        << std::setw(5) << G4BestUnit( rmsEAbs,"Energy")  
@@ -189,4 +190,9 @@
     }
   G4cout << "\n------------------------------------------------------------\n";
+
+  G4cout << " Beam particle " 
+	 << Primary->GetParticleGun()->
+    GetParticleDefinition()->GetParticleName()
+	 << "  E = " << G4BestUnit(beamEnergy,"Energy") << G4endl;
   
   //Energy flow
Index: trunk/examples/extended/electromagnetic/TestEm3/src/RunActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/RunActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/RunActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunActionMessenger.cc,v 1.13 2007/04/25 10:07:27 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.4 2006/06/29 16:53:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:53:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/SteppingAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: SteppingAction.cc,v 1.25 2006/06/29 16:53:23 gunter Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: SteppingAction.cc,v 1.28 2008/05/29 16:59:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -47,5 +47,5 @@
 :G4UserSteppingAction(),detector(det),runAct(run),eventAct(evt),
  histoManager(hist) 
-{}
+{ }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -81,10 +81,13 @@
   G4double stepl = 0.;
   if (particle->GetPDGCharge() != 0.) stepl = aStep->GetStepLength();
-    
+  
+  //  G4cout << "Nabs= " << absorNum << "   edep(keV)= " << edep << G4endl;
+  
   // sum up per event
   eventAct->SumEnergy(absorNum,edep,stepl);
   
   //longitudinal profile of edep per absorber
-  if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum, layerNum+1., edep);
+  if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum, 
+				       G4double(layerNum+1), edep);
   
   //energy flow
@@ -108,30 +111,27 @@
 
 ////  example of Birk attenuation
-////  G4double destep   = aStep->GetTotalEnergyDeposit();
-////  G4double response = BirkAttenuation(aStep);
-////  G4cout << " Destep: " << destep/keV << " keV"
-////         << " response after Birk: "  << response/keV << " keV" << G4endl;
+///G4double destep   = aStep->GetTotalEnergyDeposit();
+///G4double response = BirksAttenuation(aStep);
+///G4cout << " Destep: " << destep/keV << " keV"
+///       << " response after Birks: " << response/keV << " keV" << G4endl;
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4double SteppingAction::BirkAttenuation(const G4Step* aStep)
+G4double SteppingAction::BirksAttenuation(const G4Step* aStep)
 {
  //Example of Birk attenuation law in organic scintillators.
  //adapted from Geant3 PHYS337. See MIN 80 (1970) 239-244
  //
- const G4String myMaterial = "Scintillator";
- const G4double birk1 = 0.013*g/(MeV*cm2);
- //
+ G4Material* material = aStep->GetTrack()->GetMaterial();
+ G4double birk1       = material->GetIonisation()->GetBirksConstant();
  G4double destep      = aStep->GetTotalEnergyDeposit();
- G4Material* material = aStep->GetTrack()->GetMaterial();
+ G4double stepl       = aStep->GetStepLength();  
  G4double charge      = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
  //
  G4double response = destep;
- if ((material->GetName()==myMaterial)&&(charge!=0.))
+ if (birk1*destep*stepl*charge != 0.)
    {
-     G4double correction =
-     birk1*destep/((material->GetDensity())*(aStep->GetStepLength()));
-     response = destep/(1. + correction);
+     response = destep/(1. + birk1*destep/stepl);
    }
  return response;
Index: trunk/examples/extended/electromagnetic/TestEm3/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.4 2006/06/29 16:53:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/src/TrackingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TrackingAction.cc,v 1.2 2006/06/29 16:53:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm3/storeTables.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm3/storeTables.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm3/storeTables.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: storeTables.mac,v 1.8 2007/05/18 19:00:44 vnivanch Exp $
+# $Id: storeTables.mac,v 1.10 2009/09/17 20:06:26 maire Exp $
 #
 # Macro file for "testEm3.cc"
@@ -8,7 +8,9 @@
 /control/verbose 2
 #
-/testem/phys/addPhysics  emstandard
+/testem/phys/addPhysics  emstandard_opt0
 #
 /run/initialize
+/process/eLoss/verbose 1
+/process/eLoss/CSDARange true
 /run/beamOn 3
 #
Index: trunk/examples/extended/electromagnetic/TestEm4/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.14 2006/10/20 16:38:15 maire Exp $
+# $Id: GNUmakefile,v 1.15 2008/06/11 22:15:20 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm4/TestEm4.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/TestEm4.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/TestEm4.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm4.cc,v 1.12 2007/06/22 09:55:22 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
Index: trunk/examples/extended/electromagnetic/TestEm4/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.3 2006/06/29 16:53:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/electromagnetic/TestEm4/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:53:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm4/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:53:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm4/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:53:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm4/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:53:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm4/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.7 2006/06/29 16:53:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm4/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:53:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm4/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/include/SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:53:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm4/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.3 2006/06/29 16:53:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/electromagnetic/TestEm4/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.7 2006/06/29 16:53:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm4/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:54:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm4/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/PhysicsList.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysicsList.cc,v 1.6 2006/06/29 16:54:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.7 2008/04/07 13:09:43 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
@@ -95,5 +95,5 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
+#include "G4eMultipleScattering.hh"
 
 #include "G4eIonisation.hh"
@@ -121,15 +121,15 @@
     //electron
 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);      
+      pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
+      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);      
 
     } else if (particleName == "e+") {
     //positron
 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,  0,-1,4);      
+      pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
+      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);      
     }
   }
Index: trunk/examples/extended/electromagnetic/TestEm4/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:54:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm4/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.10 2006/06/29 16:54:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: RunAction.cc,v 1.11 2008/09/12 18:46:14 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -59,7 +59,7 @@
    G4bool readOnly  = false;
    G4bool createNew = true;
-   G4String options =  "--noErrors uncompress";
-   tree = tf->create("testem4.hbook","hbook",readOnly,createNew, options);
-   //tree = tf->create("testem4.root","root",readOnly,createNew, options);
+   G4String options =  "--noErrors export=root uncompress";
+   //tree = tf->create("testem4.hbook","hbook",readOnly,createNew, options);
+   tree = tf->create("testem4.root","root",readOnly,createNew, options);
    //tree = tf->create("testem4.XML" ,"XML" ,readOnly,createNew, options);
    delete tf;
Index: trunk/examples/extended/electromagnetic/TestEm4/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingAction.cc,v 1.2 2006/06/29 16:54:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm4/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm4/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm4/src/SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:54:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.19 2006/09/25 17:06:28 maire Exp $
+# $Id: GNUmakefile,v 1.22 2008/06/11 22:17:58 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm5/TestEm5.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/TestEm5.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/TestEm5.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm5.cc,v 1.17 2007/06/22 10:48:00 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/air.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/air.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/air.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: air.mac,v 1.2 2007/07/31 16:51:29 maire Exp $
+# $Id: air.mac,v 1.3 2009/09/18 14:03:24 maire Exp $
 #
 # macro file for TestEm5.cc
@@ -11,5 +11,5 @@
 /testem/det/setAbsYZ    15 cm
 #
-/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  local
 #### /testem/phys/addPhysics  standardSS
 #
Index: trunk/examples/extended/electromagnetic/TestEm5/berger.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/berger.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/berger.mac	(revision 1230)
@@ -1,8 +1,8 @@
-# $Id: berger.mac,v 1.3 2006/03/20 11:41:46 maire Exp $
+# $Id: berger.mac,v 1.7 2009/01/21 17:49:59 maire Exp $
 #
 # macro file for TestEm5.cc    
 #
 # energy deposit by 1 MeV electrons in silicon counters.
-# M.J.Berger et al. NIM 69 (1969) page 181.
+# M.J.Berger et al. NIM 69 (1969) page 181
 #     		    
 /control/verbose 2
@@ -10,15 +10,13 @@
 #
 /testem/det/setAbsMat Silicon      
-/testem/det/setAbsThick 61 um
+###/testem/det/setAbsThick 61 um
 ###/testem/det/setAbsThick 105 um
 ###/testem/det/setAbsThick 191 um
-###/testem/det/setAbsThick 530 um
+/testem/det/setAbsThick 530 um
 ###/testem/det/setAbsThick   1 mm
 ###/testem/det/setAbsThick   3 mm
 /testem/det/setAbsYZ      1 cm
 #
-/testem/phys/setGCut 2.13 mm   
-/testem/phys/setECut 7 um
-/testem/phys/setPCut 7 um
+/testem/phys/setCuts 10 um   
 #
 /run/initialize
@@ -28,8 +26,9 @@
 /gun/energy 1 MeV
 #
-/testem/histo/setFileName berger
-/testem/histo/setFileType hbook
-/testem/histo/setHisto 1  55 0.0 1.1 MeV	#energy deposit  
+/testem/histo/setFileName berger/Si530um
+/testem/histo/setFileType root
+/testem/histo/setHisto 1 105  0  1.05 MeV	#energy deposit  
 #
-/testem/event/printModulo 100000 
+/testem/event/printModulo 100000
+# 
 /run/beamOn 1000000
Index: trunk/examples/extended/electromagnetic/TestEm5/dedx1.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/dedx1.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/dedx1.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: dedx1.mac,v 1.4 2006/03/28 15:03:08 maire Exp $
+# $Id: dedx1.mac,v 1.6 2009/09/18 14:03:24 maire Exp $
 #
 # macro file for TestEm5.cc
@@ -8,11 +8,9 @@
 /run/verbose 2
 #
-/testem/det/setAbsMat Silicon   
-/testem/det/setAbsThick 1 mm  
-/testem/det/setAbsYZ    1 mm
+/testem/det/setAbsMat Air   
+/testem/det/setAbsThick 1 cm  
+/testem/det/setAbsYZ    1 cm
 #
-/testem/phys/addPhysics standard
-###/testem/phys/addPhysics livermore
-###/testem/phys/addPhysics penelope
+/testem/phys/addPhysics local
 #
 /testem/phys/setCuts 1 km
@@ -24,6 +22,6 @@
 #
 /testem/gun/setDefault
-/gun/particle e- 
-/gun/energy 1 MeV
+/gun/particle proton 
+/gun/energy 10 MeV
 #
 /tracking/verbose 1
Index: trunk/examples/extended/electromagnetic/TestEm5/dedx2.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/dedx2.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/dedx2.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: dedx2.mac,v 1.5 2006/03/28 15:03:08 maire Exp $
+# $Id: dedx2.mac,v 1.6 2009/09/18 14:03:24 maire Exp $
 #
 # macro file for TestEm5.cc
@@ -12,7 +12,7 @@
 /testem/det/setAbsYZ    10 um
 #
-/testem/phys/addPhysics standard
-###/testem/phys/addPhysics livermore
-###/testem/phys/addPhysics penelope
+/testem/phys/addPhysics local
+###/testem/phys/addPhysics emlivermore
+###/testem/phys/addPhysics empenelope
 #
 /testem/phys/setCuts 1 km
Index: trunk/examples/extended/electromagnetic/TestEm5/hadron.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/hadron.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/hadron.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: hadron.mac,v 1.2 2004/11/22 15:43:39 maire Exp $
+# $Id: hadron.mac,v 1.4 2009/09/18 14:03:24 maire Exp $
 #
 # macro file for TestEm5.cc
@@ -11,8 +11,5 @@
 /testem/det/setAbsYZ    1 m
 #
-/testem/phys/addPhysics  standard
-/testem/phys/addPhysics  binary
-/testem/phys/addPhysics  binary_ion
-/testem/phys/addPhysics  elastic
+/testem/phys/addPhysics  local
 #
 /testem/phys/setCuts 1 km
@@ -27,4 +24,2 @@
 #
 /run/beamOn 1
-
-
Index: trunk/examples/extended/electromagnetic/TestEm5/hanson.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/hanson.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/hanson.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: hanson.mac,v 1.4 2007/07/31 16:51:29 maire Exp $
+# $Id: hanson.mac,v 1.5 2009/06/19 12:42:04 vnivanch Exp $
 #
 # macro file for TestEm5.cc    
@@ -19,4 +19,7 @@
 /testem/phys/setPCut 1.12 um
 #
+/testem/phys/addPhysics  emstandard_opt3
+#/testem/phys/addPhysics  standardGS
+#
 /run/initialize
 #
Index: trunk/examples/extended/electromagnetic/TestEm5/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.6 2006/06/29 16:54:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.5 2006/06/29 16:54:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.3 2006/06/29 16:54:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/EventMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/EventMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/EventMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventMessenger.hh,v 1.5 2006/06/29 16:54:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/HistoManager.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.hh,v 1.13 2007/11/12 17:48:16 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.hh,v 1.14 2007/11/30 11:46:25 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -64,4 +64,5 @@
     void FillHisto(G4int id, G4double e, G4double weight = 1.0);
     void RemoveHisto (G4int);
+    void Scale (G4int, G4double);    
     void PrintHisto  (G4int);
     
Index: trunk/examples/extended/electromagnetic/TestEm5/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.8 2007/11/12 17:48:16 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandard.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.6 2006/08/10 08:44:39 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandardSS.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandardSS.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandardSS.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandardSS.hh,v 1.1 2006/08/10 08:45:14 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsList.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.hh,v 1.6 2007/03/20 18:50:53 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.hh,v 1.11 2009/03/06 18:04:23 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -37,5 +37,4 @@
 
 class G4VPhysicsConstructor;
-class StepMax;
 class PhysicsListMessenger;
 
@@ -55,6 +54,4 @@
   void AddDecay();
   void AddStepMax();       
-  
-  StepMax* GetStepMaxProcess() {return stepMaxProcess;};
     
   void SetCuts();
@@ -64,20 +61,13 @@
     
 private:
-  
+
   PhysicsListMessenger* pMessenger; 
 
   G4String emName;
   G4VPhysicsConstructor*  emPhysicsList;
-  std::vector<G4VPhysicsConstructor*>  hadronPhys;
-    
-  StepMax* stepMaxProcess;
     
   G4double cutForGamma;
   G4double cutForElectron;
   G4double cutForPositron;    
-
-  G4bool helIsRegisted;
-  G4bool bicIsRegisted;
-  G4bool biciIsRegisted;
 
 };
Index: trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsListMessenger.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.hh,v 1.7 2006/06/29 16:55:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.hh,v 1.9 2009/03/06 18:04:23 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,21 +45,21 @@
 class PhysicsListMessenger: public G4UImessenger
 {
-  public:
+public:
   
-    PhysicsListMessenger(PhysicsList* );
-   ~PhysicsListMessenger();
+  PhysicsListMessenger(PhysicsList* );
+  ~PhysicsListMessenger();
     
-    void SetNewValue(G4UIcommand*, G4String);
+  void SetNewValue(G4UIcommand*, G4String);
     
-  private:
+private:
   
-    PhysicsList* pPhysicsList;
+  PhysicsList* pPhysicsList;
     
-    G4UIdirectory*             physDir;    
-    G4UIcmdWithAString*        pListCmd;    
-    G4UIcmdWithADoubleAndUnit* gammaCutCmd;
-    G4UIcmdWithADoubleAndUnit* electCutCmd;
-    G4UIcmdWithADoubleAndUnit* protoCutCmd;    
-    G4UIcmdWithADoubleAndUnit* allCutCmd;        
+  G4UIdirectory*             physDir;    
+  G4UIcmdWithAString*        pListCmd;    
+  G4UIcmdWithADoubleAndUnit* gammaCutCmd;
+  G4UIcmdWithADoubleAndUnit* electCutCmd;
+  G4UIcmdWithADoubleAndUnit* protoCutCmd;    
+  G4UIcmdWithADoubleAndUnit* allCutCmd;        
 };
 
Index: trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:55:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.4 2006/06/29 16:55:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/RunAction.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.hh,v 1.8 2007/11/21 17:41:19 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: RunAction.hh,v 1.9 2009/01/22 17:41:43 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -52,14 +52,15 @@
 class RunAction : public G4UserRunAction
 {
-  public:
+
+public:
+
     RunAction(DetectorConstruction*, PrimaryGeneratorAction*, HistoManager*);
-   ~RunAction();
+    virtual ~RunAction();
 
-  public:
     void BeginOfRunAction(const G4Run*);
     void   EndOfRunAction(const G4Run*);
 
     void AddEnergy (G4double edep)
-                   {EnergyDeposit += edep; EnergyDeposit2 += edep*edep;};
+                 {EnergyDeposit += edep; EnergyDeposit2 += edep*edep;};
 
     void AddTrakLenCharg (G4double length)
Index: trunk/examples/extended/electromagnetic/TestEm5/include/StackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/StackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/StackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.hh,v 1.4 2006/09/25 17:06:29 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/StackingMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/StackingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/StackingMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingMessenger.hh,v 1.6 2006/09/25 17:06:29 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.3 2006/06/29 16:55:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 16:55:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/SteppingAction.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: SteppingAction.hh,v 1.3 2006/06/29 16:55:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: SteppingAction.hh,v 1.4 2009/03/06 18:04:23 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:55:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm5/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.4 2006/06/29 16:55:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/mumsc.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/mumsc.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/mumsc.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: mumsc.mac,v 1.8 2007/07/31 16:51:29 maire Exp $
+# $Id: mumsc.mac,v 1.20 2009/11/15 22:10:03 maire Exp $
 #
 # macro file for TestEm5.cc
@@ -14,5 +14,7 @@
 /testem/det/setWorldYZ  1 m
 #
-/testem/phys/setCuts 0.1 mm
+/testem/phys/addPhysics local
+#
+/testem/phys/setCuts 1 mm
 #
 /run/initialize
@@ -20,13 +22,13 @@
 /testem/gun/setDefault
 /gun/particle mu+
-/gun/energy 50 GeV
+/gun/energy 100 GeV
 #
-/testem/histo/setFileName mumsc
+/testem/histo/setFileName mumsc/ref09.local
 /testem/histo/setFileType hbook
-/testem/histo/setHisto 13  200  -20.0  +20.0 mrad	#projected angle
-/testem/histo/setHisto 14  200  -10.0  +10.0 mm		#projected deviation  
+/testem/histo/setHisto 14  100 -5.0  +5.0 mm		#x-position at exit  
+/testem/histo/setHisto 15  100  0.  +10.0 mm		#radius at exit  
 #
 /testem/stack/killSecondaries
 #
-/testem/event/printModulo 1000
-/run/beamOn 10000
+/testem/event/printModulo 4000
+/run/beamOn 40000
Index: trunk/examples/extended/electromagnetic/TestEm5/neutron.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/neutron.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/neutron.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: neutron.mac,v 1.4 2007/07/31 16:51:29 maire Exp $
+# $Id: neutron.mac,v 1.5 2009/09/18 14:03:24 maire Exp $
 #
 # macro file for TestEm5.cc
@@ -14,6 +14,5 @@
 /testem/det/setAbsYZ    20 cm
 #
-/testem/phys/addPhysics  standard
-/testem/phys/addPhysics  elastic
+/testem/phys/addPhysics  local
 #
 /testem/phys/setCuts 1 km
Index: trunk/examples/extended/electromagnetic/TestEm5/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/DetectorConstruction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: DetectorConstruction.cc,v 1.13 2006/09/25 17:06:29 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: DetectorConstruction.cc,v 1.15 2009/01/22 17:41:43 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,4 +46,5 @@
 #include "G4UnitsTable.hh"
 #include "G4NistManager.hh"
+#include "G4RunManager.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -88,153 +89,154 @@
 void DetectorConstruction::DefineMaterials()
 { 
- //This function illustrates the possible ways to define materials
+  //This function illustrates the possible ways to define materials
  
-G4String symbol;             //a=mass of a mole;
-G4double a, z, density;      //z=mean number of protons;  
-
-G4int ncomponents, natoms;
-G4double fractionmass;
-G4double temperature, pressure;
-
-//
-// define Elements
-//
-
-G4Element* H  = new G4Element("Hydrogen",symbol="H",  z= 1, a=   1.01*g/mole);
-G4Element* C  = new G4Element("Carbon",  symbol="C",  z= 6, a=  12.01*g/mole);
-G4Element* N  = new G4Element("Nitrogen",symbol="N",  z= 7, a=  14.01*g/mole);
-G4Element* O  = new G4Element("Oxygen",  symbol="O",  z= 8, a=  16.00*g/mole);
-G4Element* Na = new G4Element("Sodium",  symbol="Na", z=11, a=  22.99*g/mole);
-G4Element* Ar = new G4Element("Argon",   symbol="Ar", z=18, a=  39.95*g/mole);
-G4Element* I  = new G4Element("Iodine",  symbol="I" , z=53, a= 126.90*g/mole);
-G4Element* Xe = new G4Element("Xenon",   symbol="Xe", z=54, a= 131.29*g/mole);
-
-//
-// define simple materials
-//
-
-new G4Material("H2Liq"    , z= 1, a= 1.01*g/mole, density= 70.8*mg/cm3);
-new G4Material("Beryllium", z= 4, a= 9.01*g/mole, density= 1.848*g/cm3);
-new G4Material("Aluminium", z=13, a=26.98*g/mole, density= 2.700*g/cm3);
-new G4Material("Silicon"  , z=14, a=28.09*g/mole, density= 2.330*g/cm3);
-
-G4Material* lAr = 
-new G4Material("liquidArgon", density= 1.390*g/cm3, ncomponents=1);
-lAr->AddElement(Ar, natoms=1);
-
-new G4Material("Iron",     z=26, a= 55.85*g/mole, density= 7.870*g/cm3);
-new G4Material("Copper",   z=29, a= 63.55*g/mole, density= 8.960*g/cm3);
-new G4Material("Silver",   z=47, a=107.87*g/mole, density= 10.50*g/cm3);
-new G4Material("Tungsten", z=74, a=183.85*g/mole, density= 19.30*g/cm3);
-new G4Material("Gold",     z=79, a=196.97*g/mole, density= 19.32*g/cm3);
-new G4Material("Lead",     z=82, a=207.19*g/mole, density= 11.35*g/cm3);
-
-//
-// define a material from elements.   case 1: chemical molecule
-//
-
-G4Material* H2O = new G4Material("Water", density= 1.000*g/cm3, ncomponents=2);
-H2O->AddElement(H, natoms=2);
-H2O->AddElement(O, natoms=1);
-H2O->GetIonisation()->SetMeanExcitationEnergy(75*eV);
-
-G4Material* CH = new G4Material("Plastic", density= 1.04*g/cm3, ncomponents=2);
-CH->AddElement(C, natoms=1);
-CH->AddElement(H, natoms=1);
-
-G4Material* NaI = new G4Material("NaI", density= 3.67*g/cm3, ncomponents=2);
-NaI->AddElement(Na, natoms=1);
-NaI->AddElement(I , natoms=1);
-NaI->GetIonisation()->SetMeanExcitationEnergy(452*eV);
-
-//
-// define a material from elements.   case 2: mixture by fractional mass
-//
-
-G4Material* Air = new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2);
-Air->AddElement(N, fractionmass=0.7);
-Air->AddElement(O, fractionmass=0.3);
-
-G4Material* Air20 = 
-new G4Material("Air20", density= 1.205*mg/cm3, ncomponents=2,
-                        kStateGas, 293.*kelvin, 1.*atmosphere);
-Air20->AddElement(N, fractionmass=0.7);
-Air20->AddElement(O, fractionmass=0.3);
-
-//Graphite
-//
-G4Material* Graphite = 
-new G4Material("Graphite", density= 1.7*g/cm3, ncomponents=1);
-Graphite->AddElement(C, fractionmass=1.);
-
-//Havar
-//
-G4Element* Cr = new G4Element("Chrome", "Cr", z=25, a=  51.996*g/mole);
-G4Element* Fe = new G4Element("Iron"  , "Fe", z=26, a=  55.845*g/mole);
-G4Element* Co = new G4Element("Cobalt", "Co", z=27, a=  58.933*g/mole);
-G4Element* Ni = new G4Element("Nickel", "Ni", z=28, a=  58.693*g/mole);
-G4Element* W  = new G4Element("Tungsten","W", z=74, a= 183.850*g/mole);
-
-G4Material* Havar = 
-new G4Material("Havar", density= 8.3*g/cm3, ncomponents=5);
-Havar->AddElement(Cr, fractionmass=0.1785);
-Havar->AddElement(Fe, fractionmass=0.1822);
-Havar->AddElement(Co, fractionmass=0.4452);
-Havar->AddElement(Ni, fractionmass=0.1310);
-Havar->AddElement(W , fractionmass=0.0631);
-
-//
-// examples of gas
-//  
-new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3,
-                           kStateGas, 273.15*kelvin, 1*atmosphere);
+  G4String symbol;             //a=mass of a mole;
+  G4double a, z, density;      //z=mean number of protons;  
+
+  G4int ncomponents, natoms;
+  G4double fractionmass;
+  G4double temperature, pressure;
+  
+  //
+  // define Elements
+  //
+
+  G4Element* H  = new G4Element("Hydrogen",symbol="H",  z= 1, a=   1.01*g/mole);
+  G4Element* C  = new G4Element("Carbon",  symbol="C",  z= 6, a=  12.01*g/mole);
+  G4Element* N  = new G4Element("Nitrogen",symbol="N",  z= 7, a=  14.01*g/mole);
+  G4Element* O  = new G4Element("Oxygen",  symbol="O",  z= 8, a=  16.00*g/mole);
+  G4Element* Na = new G4Element("Sodium",  symbol="Na", z=11, a=  22.99*g/mole);
+  G4Element* Ar = new G4Element("Argon",   symbol="Ar", z=18, a=  39.95*g/mole);
+  G4Element* I  = new G4Element("Iodine",  symbol="I" , z=53, a= 126.90*g/mole);
+  G4Element* Xe = new G4Element("Xenon",   symbol="Xe", z=54, a= 131.29*g/mole);
+
+  //
+  // define simple materials
+  //
+
+  new G4Material("H2Liq"    , z= 1, a= 1.01*g/mole, density= 70.8*mg/cm3);
+  new G4Material("Beryllium", z= 4, a= 9.01*g/mole, density= 1.848*g/cm3);
+  new G4Material("Aluminium", z=13, a=26.98*g/mole, density= 2.700*g/cm3);
+  new G4Material("Silicon"  , z=14, a=28.09*g/mole, density= 2.330*g/cm3);
+
+  G4Material* lAr = 
+    new G4Material("liquidArgon", density= 1.390*g/cm3, ncomponents=1);
+  lAr->AddElement(Ar, natoms=1);
+
+  new G4Material("Iron",     z=26, a= 55.85*g/mole, density= 7.870*g/cm3);
+  new G4Material("Copper",   z=29, a= 63.55*g/mole, density= 8.960*g/cm3);
+  new G4Material("Germanium",z=32, a= 72.61*g/mole, density= 5.323*g/cm3);
+  new G4Material("Silver",   z=47, a=107.87*g/mole, density= 10.50*g/cm3);
+  new G4Material("Tungsten", z=74, a=183.85*g/mole, density= 19.30*g/cm3);
+  new G4Material("Gold",     z=79, a=196.97*g/mole, density= 19.32*g/cm3);
+  new G4Material("Lead",     z=82, a=207.19*g/mole, density= 11.35*g/cm3);
+
+  //
+  // define a material from elements.   case 1: chemical molecule
+  //
+
+  G4Material* H2O = new G4Material("Water", density= 1.000*g/cm3, ncomponents=2);
+  H2O->AddElement(H, natoms=2);
+  H2O->AddElement(O, natoms=1);
+  H2O->GetIonisation()->SetMeanExcitationEnergy(75*eV);
+
+  G4Material* CH = new G4Material("Plastic", density= 1.04*g/cm3, ncomponents=2);
+  CH->AddElement(C, natoms=1);
+  CH->AddElement(H, natoms=1);
+
+  G4Material* NaI = new G4Material("NaI", density= 3.67*g/cm3, ncomponents=2);
+  NaI->AddElement(Na, natoms=1);
+  NaI->AddElement(I , natoms=1);
+  NaI->GetIonisation()->SetMeanExcitationEnergy(452*eV);
+
+  //
+  // define a material from elements.   case 2: mixture by fractional mass
+  //
+
+  G4Material* Air = new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2);
+  Air->AddElement(N, fractionmass=0.7);
+  Air->AddElement(O, fractionmass=0.3);
+
+  G4Material* Air20 = 
+    new G4Material("Air20", density= 1.205*mg/cm3, ncomponents=2,
+		   kStateGas, 293.*kelvin, 1.*atmosphere);
+  Air20->AddElement(N, fractionmass=0.7);
+  Air20->AddElement(O, fractionmass=0.3);
+
+  //Graphite
+  //
+  G4Material* Graphite = 
+    new G4Material("Graphite", density= 1.7*g/cm3, ncomponents=1);
+  Graphite->AddElement(C, fractionmass=1.);
+
+  //Havar
+  //
+  G4Element* Cr = new G4Element("Chrome", "Cr", z=25, a=  51.996*g/mole);
+  G4Element* Fe = new G4Element("Iron"  , "Fe", z=26, a=  55.845*g/mole);
+  G4Element* Co = new G4Element("Cobalt", "Co", z=27, a=  58.933*g/mole);
+  G4Element* Ni = new G4Element("Nickel", "Ni", z=28, a=  58.693*g/mole);
+  G4Element* W  = new G4Element("Tungsten","W", z=74, a= 183.850*g/mole);
+
+  G4Material* Havar = 
+    new G4Material("Havar", density= 8.3*g/cm3, ncomponents=5);
+  Havar->AddElement(Cr, fractionmass=0.1785);
+  Havar->AddElement(Fe, fractionmass=0.1822);
+  Havar->AddElement(Co, fractionmass=0.4452);
+  Havar->AddElement(Ni, fractionmass=0.1310);
+  Havar->AddElement(W , fractionmass=0.0631);
+
+  //
+  // examples of gas
+  //  
+  new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3,
+		 kStateGas, 273.15*kelvin, 1*atmosphere);
 			   
-new G4Material("XenonGas", z=54, a=131.29*g/mole, density= 5.458*mg/cm3,
-                           kStateGas, 293.15*kelvin, 1*atmosphere);
+  new G4Material("XenonGas", z=54, a=131.29*g/mole, density= 5.458*mg/cm3,
+		 kStateGas, 293.15*kelvin, 1*atmosphere);
 			   
-G4Material* CO2 =
-new G4Material("CarbonicGas", density= 1.977*mg/cm3, ncomponents=2);
-CO2->AddElement(C, natoms=1);
-CO2->AddElement(O, natoms=2);
-
-G4Material* ArCO2 =
-new G4Material("ArgonCO2",   density= 1.8223*mg/cm3, ncomponents=2);
-ArCO2->AddElement (Ar,  fractionmass=0.7844);
-ArCO2->AddMaterial(CO2, fractionmass=0.2156);
-
-//another way to define mixture of gas per volume
-G4Material* NewArCO2 =
-new G4Material("NewArgonCO2", density= 1.8223*mg/cm3, ncomponents=3);
-NewArCO2->AddElement (Ar, natoms=8);
-NewArCO2->AddElement (C,  natoms=2);
-NewArCO2->AddElement (O,  natoms=4);
-
-G4Material* ArCH4 = 
-new G4Material("ArgonCH4",    density= 1.709*mg/cm3,  ncomponents=3);
-ArCH4->AddElement (Ar, natoms=93);
-ArCH4->AddElement (C,  natoms=7);
-ArCH4->AddElement (H,  natoms=28);
-
-G4Material* XeCH = 
-new G4Material("XenonMethanePropane", density= 4.9196*mg/cm3, ncomponents=3,
-                                      kStateGas, 293.15*kelvin, 1*atmosphere);
-XeCH->AddElement (Xe, natoms=875);
-XeCH->AddElement (C,  natoms=225);
-XeCH->AddElement (H,  natoms=700);
-
-G4Material* steam = 
-new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1);
-steam->AddMaterial(H2O, fractionmass=1.);
-steam->GetIonisation()->SetMeanExcitationEnergy(71.6*eV);  
-
-//
-// example of vacuum
-//
-
-density     = universe_mean_density;    //from PhysicalConstants.h
-pressure    = 3.e-18*pascal;
-temperature = 2.73*kelvin;
-new G4Material("Galactic", z=1, a=1.01*g/mole,density,
-                                              kStateGas,temperature,pressure);
+  G4Material* CO2 =
+    new G4Material("CarbonicGas", density= 1.977*mg/cm3, ncomponents=2);
+  CO2->AddElement(C, natoms=1);
+  CO2->AddElement(O, natoms=2);
+
+  G4Material* ArCO2 =
+    new G4Material("ArgonCO2",   density= 1.8223*mg/cm3, ncomponents=2);
+  ArCO2->AddElement (Ar,  fractionmass=0.7844);
+  ArCO2->AddMaterial(CO2, fractionmass=0.2156);
+
+  //another way to define mixture of gas per volume
+  G4Material* NewArCO2 =
+    new G4Material("NewArgonCO2", density= 1.8223*mg/cm3, ncomponents=3);
+  NewArCO2->AddElement (Ar, natoms=8);
+  NewArCO2->AddElement (C,  natoms=2);
+  NewArCO2->AddElement (O,  natoms=4);
+
+  G4Material* ArCH4 = 
+    new G4Material("ArgonCH4",    density= 1.709*mg/cm3,  ncomponents=3);
+  ArCH4->AddElement (Ar, natoms=93);
+  ArCH4->AddElement (C,  natoms=7);
+  ArCH4->AddElement (H,  natoms=28);
+
+  G4Material* XeCH = 
+    new G4Material("XenonMethanePropane", density= 4.9196*mg/cm3, ncomponents=3,
+		   kStateGas, 293.15*kelvin, 1*atmosphere);
+  XeCH->AddElement (Xe, natoms=875);
+  XeCH->AddElement (C,  natoms=225);
+  XeCH->AddElement (H,  natoms=700);
+
+  G4Material* steam = 
+    new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1);
+  steam->AddMaterial(H2O, fractionmass=1.);
+  steam->GetIonisation()->SetMeanExcitationEnergy(71.6*eV);  
+
+  //
+  // example of vacuum
+  //
+
+  density     = universe_mean_density;    //from PhysicalConstants.h
+  pressure    = 3.e-18*pascal;
+  temperature = 2.73*kelvin;
+  new G4Material("Galactic", z=1, a=1.01*g/mole,density,
+		 kStateGas,temperature,pressure);
 }
 
@@ -300,5 +302,5 @@
                                 0);                //copy number
                                         
-   PrintCalorParameters();         
+  PrintCalorParameters();         
   
   //always return the physical World
@@ -336,5 +338,9 @@
     G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
 
-  if (pttoMaterial) AbsorberMaterial = pttoMaterial;                  
+  if (pttoMaterial && AbsorberMaterial != pttoMaterial) {
+    AbsorberMaterial = pttoMaterial;                  
+    if(logicAbsorber) logicAbsorber->SetMaterial(AbsorberMaterial);
+    G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+  }
 }
 
@@ -347,5 +353,9 @@
     G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
 
-  if (pttoMaterial) WorldMaterial = pttoMaterial;
+  if (pttoMaterial && WorldMaterial != pttoMaterial) {
+    WorldMaterial = pttoMaterial;                  
+    if(logicWorld) logicWorld->SetMaterial(WorldMaterial);
+    G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+  }
 }
     
@@ -355,4 +365,5 @@
 {
   AbsorberThickness = val;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
@@ -362,4 +373,5 @@
 {
   AbsorberSizeYZ = val;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
@@ -370,4 +382,5 @@
   WorldSizeX = val;
   defaultWorld = false;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
@@ -378,4 +391,5 @@
   WorldSizeYZ = val;
   defaultWorld = false;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
@@ -385,4 +399,5 @@
 {
   XposAbs  = val;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
@@ -412,8 +427,7 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
 
-#include "G4RunManager.hh" 
- 
 void DetectorConstruction::UpdateGeometry()
 {
+  G4RunManager::GetRunManager()->PhysicsHasBeenModified();
   G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
 }
Index: trunk/examples/extended/electromagnetic/TestEm5/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.4 2006/06/29 16:55:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/EventAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: EventAction.cc,v 1.6 2006/06/29 16:55:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: EventAction.cc,v 1.7 2009/03/06 18:04:23 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/EventMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/EventMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/EventMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventMessenger.cc,v 1.5 2006/06/29 16:55:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.21 2007/11/28 12:37:56 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: HistoManager.cc,v 1.26 2008/09/13 17:05:40 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "testem5";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -199,5 +199,5 @@
 		  "dummy","dummy","dummy","dummy","dummy","dummy",	//34-39
 		  "(reflect , neutral) : kinetic energy at exit",	//40
-		  "(reflect , neutral) : ener fluence: dE(MeV)/dOmega"	//41
+		  "(reflect , neutral) : ener fluence: dE(MeV)/dOmega",	//41
 		  "(reflect , neutral) : space angle: dN/dOmega",	//42
 		  "(reflect , neutral) : projected angle at exit",	//43
@@ -245,7 +245,21 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
+void HistoManager::Scale(G4int ih, G4double fac)
+{
+ if (ih > MaxHisto) {
+    G4cout << "---> warning from HistoManager::Scale() : histo " << ih
+           << "does not exist.  (fac = " << fac << ")" << G4endl;
+    return;
+  }
+#ifdef G4ANALYSIS_USE
+  if(exist[ih]) histo[ih]->scale(fac);
+#endif
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
 void HistoManager::PrintHisto(G4int ih)
 {
- if (ih < MaxHisto) ascii[ih] = true;
+ if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
  else
     G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
@@ -260,4 +274,6 @@
 {
 #ifdef G4ANALYSIS_USE
+
+ if (!ascii[0]) return;
  
  G4String name = fileName[0] + ".ascii";
@@ -273,5 +289,6 @@
       for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
          File << "  " << iBin << "\t" 
-              << histo[ih]->binMean(iBin) << "\t"
+              << 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
+	              histo[ih]->axis().binUpperEdge(iBin)) << "\t"	      
 	      << histo[ih]->binHeight(iBin) 
 	      << G4endl;
Index: trunk/examples/extended/electromagnetic/TestEm5/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.8 2007/11/12 17:48:16 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandard.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysListEmStandard.cc,v 1.14 2007/11/21 17:41:19 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: PhysListEmStandard.cc,v 1.24 2009/11/15 22:10:03 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,16 +38,23 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
-
+#include "G4eMultipleScattering.hh"
+#include "G4UrbanMscModel93.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
 #include "G4eplusAnnihilation.hh"
 
+#include "G4MuMultipleScattering.hh"
 #include "G4MuIonisation.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
 
+#include "G4hMultipleScattering.hh"
 #include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
+
 #include "G4ionIonisation.hh"
+#include "G4IonParametrisedLossModel.hh"
+#include "G4NuclearStopping.hh"
 
 #include "G4EmProcessOptions.hh"
@@ -86,33 +93,57 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);      
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
+      G4eMultipleScattering* msc = new G4eMultipleScattering();
+      msc->AddEmModel(0, new G4UrbanMscModel93());
+      pmanager->AddProcess(msc,                       -1, 1, 1);            
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
             
     } else if (particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,       -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 4,4);
+      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);
              
-    } else if (particleName == "alpha" || particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,      -1, 2,2);
+    } else if( particleName == "proton" ||
+               particleName == "pi-" ||
+               particleName == "pi+"    ) {
+      //proton  
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
      
+    } else if( particleName == "alpha" || 
+	       particleName == "He3"    ) {
+      //alpha 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
+      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);
+            
+    } else if( particleName == "GenericIon" ) {
+      //Ions 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      G4ionIonisation* ionIoni = new G4ionIonisation();
+      ionIoni->SetEmModel(new G4IonParametrisedLossModel());
+      pmanager->AddProcess(ionIoni,                   -1, 2, 2);      
+      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);      
+      
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4MultipleScattering, -1,1,1);
-      pmanager->AddProcess(new G4hIonisation,        -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     }
   }
@@ -120,26 +151,32 @@
   // Em options
   //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
   G4EmProcessOptions emOptions;
-    
-  //coulomb scattering
-  //
-  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);   
-  emOptions.SetSkin(4.);
   
   //physics tables
   //
-  emOptions.SetMinEnergy(100*eV);    
-  emOptions.SetMaxEnergy(100*TeV);  
-  emOptions.SetDEDXBinning(1200);  
-  emOptions.SetLambdaBinning(1200);  
-  
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //multiple coulomb scattering
+  //
+  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
+  emOptions.SetMscRangeFactor(0.04);	//default
+  emOptions.SetMscGeomFactor (2.5);	//default       
+  emOptions.SetSkin(3.);		//default
+      
   //energy loss
   //
-  emOptions.SetLinearLossLimit(1.e-6);
-  emOptions.SetStepFunction(0.2, 100*um); 
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);		//default
    
   //ionization
   //
-  emOptions.SetSubCutoff(false);  
+  emOptions.SetSubCutoff(false);	//default
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandardSS.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandardSS.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandardSS.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysListEmStandardSS.cc,v 1.3 2007/07/31 16:51:29 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandardSS.cc,v 1.6 2008/11/16 18:51:42 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -31,4 +31,5 @@
 
 #include "PhysListEmStandardSS.hh"
+
 #include "G4ParticleDefinition.hh"
 #include "G4ProcessManager.hh"
@@ -38,5 +39,5 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
+#include "G4CoulombScattering.hh"
 
 #include "G4eIonisation.hh"
@@ -50,5 +51,6 @@
 #include "G4hIonisation.hh"
 #include "G4ionIonisation.hh"
-#include "G4CoulombScattering.hh"
+
+#include "G4EmProcessOptions.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -83,33 +85,32 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1,1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2,2);
-      pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      pmanager->AddDiscreteProcess(new G4CoulombScattering);            
+      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1,1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2,2);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,3);
-      pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      pmanager->AddDiscreteProcess(new G4CoulombScattering);            
+      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
+      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 3);
             
     } else if (particleName == "mu+" || 
                particleName == "mu-"    ) {
-      //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1,1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2,2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3,3);
-      pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      //muon
+      pmanager->AddDiscreteProcess(new G4CoulombScattering);              
+      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);
              
     } else if (particleName == "alpha" || particleName == "He3") {
-      pmanager->AddProcess(new G4ionIonisation,      -1, 1,1);
-      pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      pmanager->AddDiscreteProcess(new G4CoulombScattering);          
+      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);
 
     } else if (particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4ionIonisation,      -1, 1,1);
       G4CoulombScattering* cs = new G4CoulombScattering();
       cs->SetBuildTableFlag(false);
       pmanager->AddDiscreteProcess(cs);
-      
+      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);      
      
     } else if ((!particle->IsShortLived()) &&
@@ -117,8 +118,32 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hIonisation,        -1,1,1);
-      pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      pmanager->AddDiscreteProcess(new G4CoulombScattering);            
+      pmanager->AddProcess(new G4hIonisation,        -1, 1, 1);
     }
   }
+  
+  // Em options
+  //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
+  G4EmProcessOptions emOptions;
+  
+  //physics tables
+  //
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //energy loss
+  //
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)      
+  emOptions.SetLinearLossLimit(1.e-2);		//default
+   
+  //ionization
+  //
+  emOptions.SetSubCutoff(false);	//default  
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.21 2007/11/19 14:57:07 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: PhysicsList.cc,v 1.40 2009/11/15 22:10:03 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,26 +35,20 @@
 #include "PhysListEmStandard.hh"
 #include "PhysListEmStandardSS.hh"
-#include "PhysListEmStandardIG.hh"
-#include "PhysListEmLivermore.hh"
-#include "PhysListEmPenelope.hh"
+#include "PhysListEmStandardGS.hh"
 
 #include "G4EmStandardPhysics.hh"
 #include "G4EmStandardPhysics_option1.hh"
 #include "G4EmStandardPhysics_option2.hh"
-
-#include "G4HadronElasticPhysics.hh"
-#include "G4HadronDElasticPhysics.hh"
-#include "G4HadronHElasticPhysics.hh"
-#include "G4HadronQElasticPhysics.hh"
-#include "G4HadronInelasticQBBC.hh"
-#include "G4IonBinaryCascadePhysics.hh"
-
-#include "G4LossTableManager.hh"
+#include "G4EmStandardPhysics_option3.hh"
+#include "G4EmLivermorePhysics.hh"
+#include "G4EmPenelopePhysics.hh"
+
+#include "G4Decay.hh"
+#include "StepMax.hh"
+
 #include "G4UnitsTable.hh"
 
 #include "G4ParticleDefinition.hh"
 #include "G4ProcessManager.hh"
-#include "G4Decay.hh"
-#include "StepMax.hh"
 
 // Bosons
@@ -84,18 +78,12 @@
 PhysicsList::PhysicsList() : G4VModularPhysicsList()
 {
-  G4LossTableManager::Instance();
   pMessenger = new PhysicsListMessenger(this); 
    
   // EM physics
-  emName = G4String("standard");
+  emName = G4String("local");
   emPhysicsList = new PhysListEmStandard(emName);
-
-  helIsRegisted  = false;
-  bicIsRegisted  = false;
-  biciIsRegisted = false;
-  
-  stepMaxProcess  = 0;
-    
+      
   defaultCutValue = 1.*mm;
+
   cutForGamma     = defaultCutValue;
   cutForElectron  = defaultCutValue;
@@ -110,5 +98,4 @@
 {
   delete emPhysicsList;
-  for(size_t i=0; i<hadronPhys.size(); i++) delete hadronPhys[i];
   delete pMessenger;  
 }
@@ -118,15 +105,12 @@
 void PhysicsList::ConstructParticle()
 {
-// pseudo-particles
+  // pseudo-particles
   G4Geantino::GeantinoDefinition();
   G4ChargedGeantino::ChargedGeantinoDefinition();
   
-// gamma
+  // gamma
   G4Gamma::GammaDefinition();
   
-// optical photon
-  G4OpticalPhoton::OpticalPhotonDefinition();
-
-// leptons
+  // leptons
   G4Electron::ElectronDefinition();
   G4Positron::PositronDefinition();
@@ -139,13 +123,13 @@
   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();  
 
-// mesons
+  // mesons
   G4MesonConstructor mConstructor;
   mConstructor.ConstructParticle();
 
-// barions
+  // barions
   G4BaryonConstructor bConstructor;
   bConstructor.ConstructParticle();
 
-// ions
+  // ions
   G4IonConstructor iConstructor;
   iConstructor.ConstructParticle();
@@ -158,5 +142,4 @@
   AddTransportation();
   emPhysicsList->ConstructProcess();
-  for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();
   AddDecay();  
   AddStepMax();
@@ -193,5 +176,5 @@
 {
   // Step limitation seen as a process
-  stepMaxProcess = new StepMax();
+  StepMax* stepMaxProcess = new StepMax();
 
   theParticleIterator->reset();
@@ -217,5 +200,5 @@
   if (name == emName) return;
 
-  if (name == "standard") {
+  if (name == "local") {
 
     emName = name;
@@ -223,5 +206,5 @@
     emPhysicsList = new PhysListEmStandard(name);
 
-  } else if (name == "emstandard") {
+  } else if (name == "emstandard_opt0") {
 
     emName = name;
@@ -240,5 +223,11 @@
     delete emPhysicsList;
     emPhysicsList = new G4EmStandardPhysics_option2();
-
+    
+  } else if (name == "emstandard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
+    
   } else if (name == "standardSS") {
 
@@ -246,47 +235,21 @@
     delete emPhysicsList;
     emPhysicsList = new PhysListEmStandardSS(name);
-        
-  } else if (name == "standardIG") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmStandardIG(name);
-        
-  } else if (name == "livermore") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmLivermore(name);
-    
-  } else if (name == "penelope") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmPenelope(name);
-
-  } else if (name == "elastic" && !helIsRegisted) {
-    hadronPhys.push_back( new G4HadronElasticPhysics());
-    helIsRegisted = true;
-
-  } else if (name == "DElastic" && !helIsRegisted) {
-    hadronPhys.push_back( new G4HadronDElasticPhysics());
-    helIsRegisted = true;
-
-  } else if (name == "HElastic" && !helIsRegisted) {
-    hadronPhys.push_back( new G4HadronHElasticPhysics());
-    helIsRegisted = true;
-
-  } else if (name == "QElastic" && !helIsRegisted) {
-    hadronPhys.push_back( new G4HadronQElasticPhysics());
-    helIsRegisted = true;
-
-  } else if (name == "binary" && !bicIsRegisted) {
-    hadronPhys.push_back(new G4HadronInelasticQBBC());
-    bicIsRegisted = true;
-
-  } else if (name == "binary_ion" && !biciIsRegisted) {
-    hadronPhys.push_back(new G4IonBinaryCascadePhysics());
-    biciIsRegisted = true;
-        
+
+  } else if (name == "standardGS") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandardGS(name);
+
+  } else if (name == "empenelope"){
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmPenelopePhysics();
+
+  } else if (name == "emlivermore"){
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmLivermorePhysics();
+                        
   } else {
 
@@ -301,5 +264,4 @@
 void PhysicsList::SetCuts()
 {
-
   if (verboseLevel >0){
     G4cout << "PhysicsList::SetCuts:";
@@ -341,3 +303,2 @@
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
Index: trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsListMessenger.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.cc,v 1.6 2006/06/29 16:56:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.cc,v 1.8 2009/03/06 18:04:23 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -77,4 +77,5 @@
   allCutCmd->SetRange("cut>0.0");
   allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
+
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.4 2006/06/29 16:56:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:56:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.25 2007/11/21 17:41:19 maire Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: RunAction.cc,v 1.29 2009/06/18 19:08:18 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -122,7 +122,7 @@
   else            rmsStNe = 0.;
 
-  G4double Gamma = (double)nbGamma/TotNbofEvents;
-  G4double Elect = (double)nbElect/TotNbofEvents;
-  G4double Posit = (double)nbPosit/TotNbofEvents;
+  G4double Gamma = (G4double)nbGamma/TotNbofEvents;
+  G4double Elect = (G4double)nbElect/TotNbofEvents;
+  G4double Posit = (G4double)nbPosit/TotNbofEvents;
 
   G4double transmit[2];
@@ -252,19 +252,32 @@
   // compute width of the Gaussian central part of the MultipleScattering
   //
-  if (histoManager->HistoExist(13)) {
-    G4cout << "\n MultipleScattering:" 
-           << "\n  rms proj angle of transmit primary particle = "
-           << rmsMsc/mrad << " mrad (central part only)" << G4endl;
-
-    G4cout << "  computed theta0 (Highland formula)          = "
- 	   << ComputeMscHighland()/mrad << " mrad" << G4endl;
+  G4cout << "\n MultipleScattering:" 
+	 << "\n  rms proj angle of transmit primary particle = "
+	 << rmsMsc/mrad << " mrad (central part only)" << G4endl;
+
+  G4cout << "  computed theta0 (Highland formula)          = "
+	 << ComputeMscHighland()/mrad << " mrad" << G4endl;
 	   
-    G4cout << "  central part defined as +- "
- 	   << MscThetaCentral/mrad << " mrad; " 
-	   << "  Tail ratio = " << tailMsc << " %" << G4endl;	   
-  }
+  G4cout << "  central part defined as +- "
+	 << MscThetaCentral/mrad << " mrad; " 
+	 << "  Tail ratio = " << tailMsc << " %" << G4endl;	   
 
   G4cout.precision(prec);
-
+  
+  // normalize histograms
+  //
+  G4int ih = 1;
+  G4double binWidth = histoManager->GetBinWidth(ih);
+  G4double unit     = histoManager->GetHistoUnit(ih);  
+  G4double fac = unit/(TotNbofEvents*binWidth);
+  histoManager->Scale(ih,fac);
+    
+  ih = 10;
+  binWidth = histoManager->GetBinWidth(ih);
+  unit     = histoManager->GetHistoUnit(ih);  
+  fac = unit/(TotNbofEvents*binWidth);
+  histoManager->Scale(ih,fac);
+    
+  // save histograms
   histoManager->save();
 
Index: trunk/examples/extended/electromagnetic/TestEm5/src/StackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/StackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/StackingAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: StackingAction.cc,v 1.7 2006/09/25 17:06:29 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: StackingAction.cc,v 1.8 2009/03/06 18:04:23 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -79,7 +79,10 @@
   //stack or delete secondaries
   G4ClassificationOfNewTrack status = fUrgent;
-  if (killSecondary) 
-    {if (killSecondary == 1) eventaction->AddEnergy(energy);  
-     status = fKill;}
+  if (killSecondary) {
+    if (killSecondary == 1) {
+     eventaction->AddEnergy(energy);
+    }  
+     status = fKill;
+  }
     
   return status;
Index: trunk/examples/extended/electromagnetic/TestEm5/src/StackingMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/StackingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/StackingMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingMessenger.cc,v 1.5 2006/09/25 17:06:29 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.2 2006/06/29 16:56:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:56:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/SteppingAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: SteppingAction.cc,v 1.7 2006/06/29 16:56:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: SteppingAction.cc,v 1.8 2009/03/06 18:04:23 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -57,5 +57,5 @@
  if (aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume() 
      != detector->GetAbsorber()) return;
- 
+
  eventaction->AddEnergy (aStep->GetTotalEnergyDeposit());
    
@@ -67,5 +67,5 @@
    eventaction->AddTrakLenNeutr(aStep->GetStepLength());
    eventaction->CountStepsNeutr();   
- }     
+ }
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm5/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:56:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm5/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/src/TrackingAction.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: TrackingAction.cc,v 1.16 2007/11/28 12:37:57 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: TrackingAction.cc,v 1.18 2008/08/28 15:28:04 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -65,8 +65,9 @@
 {
   G4ThreeVector position = aTrack->GetPosition();
-  G4double charge    = aTrack->GetDefinition()->GetPDGCharge();
+  G4ThreeVector vertex   = aTrack->GetVertexPosition();  
+  G4double charge        = aTrack->GetDefinition()->GetPDGCharge();
 
-  G4bool transmit = (position.x() >= xendAbs);
-  G4bool reflect  = (position.x() <= xstartAbs);
+  G4bool transmit = ((position.x() >= xendAbs) && (vertex.x() < xendAbs));
+  G4bool reflect  =  (position.x() <= xstartAbs);
   G4bool notabsor = (transmit || reflect);
 
@@ -82,5 +83,4 @@
   //histograms
   //
-  G4int id = 0;
   G4bool charged  = (charge != 0.);
   G4bool neutral = !charged;
@@ -88,9 +88,11 @@
   //energy spectrum at exit
   //
+  G4int id = 0;  
        if (transmit && charged) id = 10;
   else if (transmit && neutral) id = 20;
   else if (reflect  && charged) id = 30;
   else if (reflect  && neutral) id = 40;
-  
+
+  if (id>0)   
   histoManager->FillHisto(id, aTrack->GetKineticEnergy());
     
@@ -108,4 +110,6 @@
   //space angle distribution at exit : dN/dOmega
   //
+  G4ThreeVector direction = aTrack->GetMomentumDirection();    
+  id = 0;   
        if (transmit && charged) id = 12;
   else if (transmit && neutral) id = 22;
@@ -113,6 +117,5 @@
   else if (reflect  && neutral) id = 42;
 
-  G4ThreeVector direction = aTrack->GetMomentumDirection();  
-  if (histoManager->HistoExist(id)) {
+  if (id>0) {
     G4double theta  = std::acos(direction.x());
     G4double dteta  = histoManager->GetBinWidth(id);
@@ -124,4 +127,5 @@
   //energy fluence at exit : dE(MeV)/dOmega
   //
+  id = 0;  
        if (transmit && charged) id = 11;
   else if (transmit && neutral) id = 21;
@@ -129,5 +133,5 @@
   else if (reflect  && neutral) id = 41;
 
-  if (histoManager->HistoExist(id)) {
+  if (id>0) {
     G4double theta  = std::acos(direction.x());
     G4double dteta  = histoManager->GetBinWidth(id);
@@ -140,4 +144,5 @@
   //projected angles distribution at exit
   //
+  id = 0;   
        if (transmit && charged) id = 13;
   else if (transmit && neutral) id = 23;
@@ -157,4 +162,5 @@
   //projected position and radius at exit
   //
+  id = 0;   
   if (transmit && charged) id = 14;
   
Index: trunk/examples/extended/electromagnetic/TestEm5/tramu.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm5/tramu.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm5/tramu.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: tramu.mac,v 1.7 2007/07/31 16:51:29 maire Exp $
+# $Id: tramu.mac,v 1.13 2008/10/31 11:36:46 maire Exp $
 #
 # macro file for TestEm5.cc
@@ -14,6 +14,4 @@
 /testem/det/setAbsYZ    3 m
 #
-##/testem/phys/addPhysics g4v52
-#
 /testem/phys/setCuts 1 mm
 #    
@@ -24,10 +22,11 @@
 /gun/energy 1 TeV
 #
-/testem/histo/setFileName tramu
-/testem/histo/setFileType hbook
-/testem/histo/setHisto 10  50  950 1000 GeV	#energy at exit  
+/testem/histo/setFileName tramu/tramu
+/testem/histo/setFileType root
+/testem/histo/setHisto 10  100  950 1000 GeV	#energy at exit  
 #
 /testem/stack/killSecondaries
 #
-/testem/event/printModulo 1000
-/run/beamOn 10000
+/testem/event/printModulo 10000
+#
+/run/beamOn 100000
Index: trunk/examples/extended/electromagnetic/TestEm6/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.13 2006/10/20 16:47:47 maire Exp $
+# $Id: GNUmakefile,v 1.14 2008/09/18 16:42:07 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm6/TestEm6.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/TestEm6.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/TestEm6.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm6.cc,v 1.15 2006/06/29 16:56:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.3 2006/06/29 16:56:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.4 2006/06/29 16:56:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.3 2006/06/29 16:56:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:56:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsList.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsList.hh,v 1.7 2006/06/29 16:56:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.5 2006/06/29 16:56:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:56:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:56:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.9 2006/06/29 16:56:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:56:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:56:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/electromagnetic/TestEm6/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.10 2006/06/29 16:57:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.5 2006/06/29 16:57:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.6 2006/06/29 16:57:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.6 2006/06/29 16:57:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.12 2006/06/29 16:57:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.13 2009/05/13 17:25:33 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -190,8 +190,8 @@
       // to make the process of e+e- annihilation more visible,
       // do not enable the other standard processes:
-      // pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      // pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
-      // pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);
-      // pmanager->AddProcess(new G4eplusAnnihilation,  0,-1,4);
+      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
+      pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
+      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);
+      pmanager->AddProcess(new G4eplusAnnihilation,  0,-1,4);
       
       theAnnihiToMuPairProcess = new G4AnnihiToMuPair();
@@ -230,4 +230,8 @@
   G4EmProcessOptions opt;
   opt.SetVerbose(1);
+  opt.SetMinEnergy(100*eV);       
+  opt.SetMaxEnergy(1000*TeV);      
+  opt.SetDEDXBinning(13*7);      
+  opt.SetLambdaBinning(13*7);    
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.8 2006/06/29 16:57:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:57:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 16:57:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.12 2006/06/29 16:57:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: RunAction.cc,v 1.13 2008/09/18 16:42:07 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -59,7 +59,7 @@
    G4bool readOnly  = false;
    G4bool createNew = true;
-   G4String options = "--noErrors uncompress";
-   tree = tf->create("testem6.hbook","hbook",readOnly,createNew,options);
-   //tree = tf->create("testem6.root", "root",readOnly,createNew,options);
+   G4String options = "--noErrors export=root uncompress";
+   //tree = tf->create("testem6.hbook","hbook",readOnly,createNew,options);
+   tree = tf->create("testem6.root", "root",readOnly,createNew,options);
    //tree = tf->create("testem6.XML" ,"XML"  ,readOnly,createNew,options);
    delete tf;
Index: trunk/examples/extended/electromagnetic/TestEm6/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.9 2006/06/29 16:57:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm6/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm6/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm6/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.5 2006/06/29 16:57:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.9 2007/06/22 12:44:42 maire Exp $
+# $Id: GNUmakefile,v 1.11 2008/09/21 16:03:10 vnivanch Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
@@ -36,3 +26,3 @@
 
 histclean:
-	rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/RunAction.o
+	rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/Histo.o
Index: trunk/examples/extended/electromagnetic/TestEm7/TestEm7.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/TestEm7.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/TestEm7.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TestEm7.cc,v 1.8 2007/06/22 12:44:42 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:57:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.3 2006/06/29 16:57:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.2 2006/06/29 16:57:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:57:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/G4ScreenedNuclearRecoil.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/G4ScreenedNuclearRecoil.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/G4ScreenedNuclearRecoil.hh	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4ScreenedNuclearRecoil.hh,v 1.3 2007/12/07 17:51:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp
+// GEANT4 tag 
 //
 //
@@ -45,4 +45,5 @@
 //
 // First version, April 2004, Marcus H. Mendenhall, Vanderbilt University
+// May 1, 2008 -- Added code to allow process to have zero cross section above max energy, to coordinate with G4MSC.  -- mhm
 //
 // Class Description - End
@@ -54,4 +55,5 @@
 #include "globals.hh"
 #include "G4VDiscreteProcess.hh"
+#include "G4ParticleChange.hh"
 #include "c2_function.hh"
 
@@ -59,9 +61,13 @@
 #include <vector>
 
-class G4VParticleChange;
+class G4VNIELPartition;
+
+typedef c2_const_ptr<G4double> G4_c2_const_ptr;
+typedef c2_ptr<G4double> G4_c2_ptr;
+typedef c2_function<G4double> G4_c2_function;
 
 typedef struct G4ScreeningTables { 
 	G4double z1, z2, m1, m2, au, emin;
-	c2_function<G4double> *EMphiData; 
+	G4_c2_const_ptr EMphiData; 
 } G4ScreeningTables;
 
@@ -70,12 +76,11 @@
 {
 public:
-        G4ScreenedCoulombCrossSectionInfo() { }
-        ~G4ScreenedCoulombCrossSectionInfo() { }
-
-        const char *CVSHeaderVers() { return
-                "";
-        }
-
-        const char *CVSFileVers() { return ""; }
+	G4ScreenedCoulombCrossSectionInfo() { }
+	~G4ScreenedCoulombCrossSectionInfo() { }
+	
+	static const char* CVSHeaderVers() { return 
+		"G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp GEANT4 tag ";
+	}
+	static const char* CVSFileVers();
 };
 
@@ -114,6 +119,6 @@
 	
 	// get the mean-free-path table for the indexed material 
-	c2_function<G4double> * operator [] (G4int materialIndex) { 
-			return MFPTables.find(materialIndex)!=MFPTables.end() ? MFPTables[materialIndex] : (c2_function<G4double> *)0;
+	const G4_c2_function * operator [] (G4int materialIndex) { 
+			return MFPTables.find(materialIndex)!=MFPTables.end() ? &(MFPTables[materialIndex].get()) : (G4_c2_function *)0;
 		}
 	
@@ -122,6 +127,6 @@
 	ParticleCache targetMap;
 	G4int verbosity;
-	std::map<G4int, c2_function<G4double> *> sigmaMap; // total cross section for each element
-	std::map<G4int, c2_function<G4double> *> MFPTables; // MFP for each material
+	std::map<G4int, G4_c2_const_ptr > sigmaMap; // total cross section for each element
+	std::map<G4int, G4_c2_const_ptr > MFPTables; // MFP for each material
 	
 private:
@@ -134,5 +139,7 @@
 	G4ScreenedCoulombCrossSection *crossSection;
 	G4double a1, a2, sinTheta, cosTheta, sinZeta, cosZeta, eRecoil;
-	G4ParticleDefinition *recoilIon;	} G4CoulombKinematicsInfo;
+	G4ParticleDefinition *recoilIon;	
+	const G4Material *targetMaterial;
+} G4CoulombKinematicsInfo;
 
 class G4ScreenedCollisionStage {
@@ -146,5 +153,5 @@
 
 public:
-	G4ScreenedCoulombClassicalKinematics() { }
+	G4ScreenedCoulombClassicalKinematics();
 	virtual void DoCollisionStep(class G4ScreenedNuclearRecoil *master,
 		const class G4Track& aTrack, const class G4Step& aStep);
@@ -153,5 +160,11 @@
 		const G4ScreeningTables *screen, 
 		G4double eps, G4double beta);
-	virtual ~G4ScreenedCoulombClassicalKinematics() {}
+	virtual ~G4ScreenedCoulombClassicalKinematics() { }
+protected:
+	// the c2_functions we need to do the work.
+	c2_const_plugin_function_p<G4double> &phifunc;
+	c2_linear_p<G4double> &xovereps;
+	G4_c2_ptr diff;
+	
 };
 
@@ -165,4 +178,9 @@
 };
 
+/**
+	\brief A process which handles screened Coulomb collisions between nuclei
+ 
+*/
+
 class G4ScreenedNuclearRecoil : public G4ScreenedCoulombCrossSectionInfo, public G4VDiscreteProcess
 {
@@ -171,54 +189,120 @@
 	friend class G4ScreenedCollisionStage;
 
+	/// \brief Construct the process and set some physics parameters for it.
+	/// \param processName the name to assign the process
+	/// \param ScreeningKey the name of a screening function to use.  
+	/// The default functions are "zbl" (recommended for soft scattering),
+	/// "lj" (recommended for backscattering) and "mol" (Moliere potential)
+	/// \param GenerateRecoils if frue, ions struck by primary are converted into new moving particles.
+	/// If false, energy is deposited, but no new moving ions are created.
+	/// \param RecoilCutoff energy below which no new moving particles will be created, 
+	/// even if \a GenerateRecoils is true.
+	/// Also, a moving primary particle will be stopped if its energy falls below this limit.
+	/// \param PhysicsCutoff the energy transfer to which screening tables are calucalted.  
+	/// There is no really
+	/// compelling reason to change it from the 10.0 eV default.  However, see the paper on running this
+	/// in thin targets for further discussion, and its interaction with SetMFPScaling()
 	G4ScreenedNuclearRecoil(const G4String& processName = "ScreenedElastic",
 			const G4String &ScreeningKey="zbl", G4bool GenerateRecoils=1, 
 			G4double RecoilCutoff=100.0*eV, G4double PhysicsCutoff=10.0*eV);
-	
+	/// \brief destructor
 	virtual ~G4ScreenedNuclearRecoil();
-	
+	/// \brief used internally by Geant4 machinery
 	virtual G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition* );
-	
+	/// \brief used internally by Geant4 machinery
 	virtual G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
-	
+	/// \brief test if a prticle of type \a aParticleType can use this process
+	/// \param aParticleType the particle to test
 	virtual G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
-	
+	/// \brief Build physics tables in advance.  Not Implemented.
+	/// \param aParticleType the type of particle to build tables for 
 	virtual void BuildPhysicsTable(const G4ParticleDefinition&) { }
-	
+	/// \brief Export physics tables for persistency.  Not Implemented.
+	/// \param aParticleType the type of particle to build tables for 
 	virtual void DumpPhysicsTable(const G4ParticleDefinition& aParticleType);
-	
+	/// \brief deterine if the moving particle is within  the strong force range of the selected nucleus
+	/// \param A the nucleon number of the beam
+	/// \param A1 the nucleon number of the target
+	/// \param apsis the distance of closest approach
 	virtual G4bool CheckNuclearCollision(G4double A, G4double A1, G4double apsis); // return true if hard collision
 
 	virtual G4ScreenedCoulombCrossSection *GetNewCrossSectionHandler(void);
 	
-	G4double GetNIEL() const { return NIEL; } // Get non-ionizing energy loss for last step
-	
+	/// \brief Get non-ionizing energy loss for last step
+	G4double GetNIEL() const { return NIEL; } 
+	
+	/// \brief clear precomputed screening tables
 	void ResetTables(); // clear all data tables to allow changing energy cutoff, materials, etc.
-	
+
+	/// \brief set the upper energy beyond which this process has no cross section
+	///
+	/// This funciton is used to coordinate this process with G4MSC.  Typically, G4MSC should 
+	///  not be allowed to operate in a range which overlaps that of this process.  The criterion which is most reasonable
+	/// is that the transition should be somewhere in the modestly relativistic regime (500 MeV/u for example).
+	/// \param energy energy per nucleon for the cutoff
+	void SetMaxEnergyForScattering(G4double energy) { processMaxEnergy=energy; }
+	/// \brief find out what screening funciton we are using
 	std::string GetScreeningKey() const { return screeningKey; }
+	/// \brief enable or disable all energy deposition by this process
+	/// \param flag if true, enable deposition of energy (the default).  If false, disable deposition.
 	void AllowEnergyDeposition(G4bool flag) { registerDepositedEnergy=flag; }
+	/// \brief get flag indicating whether deposition is enabled
 	G4bool GetAllowEnergyDeposition() const { return registerDepositedEnergy; }
+	/// \brief enable or disable the generation of recoils.  
+	/// If recoils are disabled, the energy they would have received is just deposited.
+	/// \param flag if true, create recoil ions in cases in which the energy is above the recoilCutoff.  
+	/// If false, just deposit the energy.
 	void EnableRecoils(G4bool flag) { generateRecoils=flag; }
+	/// \brief find out if generation of recoils is enabled.
 	G4bool GetEnableRecoils() const { return generateRecoils; }
+	/// \brief set the mean free path scaling as specified
+	/// \param scale the factor by which the default MFP will be scaled.  
+	/// Set to less than 1 for very thin films, typically, to sample multiple scattering,
+	/// or to greater than 1 for quick simulaitons with a very long flight path.
 	void SetMFPScaling(G4double scale) { MFPScale=scale; }
+	/// \brief get the MFPScaling parameter
 	G4double GetMFPScaling() const { return MFPScale; }
+	/// \brief enable or disable whether this process will skip collisions 
+	/// which are close enough they need hadronic phsyics. Default is true (skip close collisions).
+	/// Disabling this results in excess nuclear stopping power.
+	/// \param flag true results in hard collisions being skipped.  false allows hard collisions.
 	void AvoidNuclearReactions(G4bool flag) { avoidReactions=flag; }
+	/// \brief get the flag indicating whether hadronic collisions are ignored.
 	G4bool GetAvoidNuclearReactions() const { return avoidReactions; }
+	/// \brief set the minimum energy (per nucleon) at which recoils can be generated, 
+	/// and the energy (per nucleon) below which all ions are stopped. 
+	/// \param energy energy per nucleon 
 	void SetRecoilCutoff(G4double energy) { recoilCutoff=energy; }
+	/// \brief get the recoil cutoff
 	G4double GetRecoilCutoff() const { return recoilCutoff; }
+	/// \brief set the energy to which screening tables are computed.  Typically, this is 10 eV or so, and not often changed.
+	/// \param energy the cutoff energy 
 	void SetPhysicsCutoff(G4double energy) { physicsCutoff=energy; ResetTables(); }
+	/// \brief get the physics cutoff energy.
 	G4double GetPhysicsCutoff() const { return physicsCutoff; }
-	class G4ParticleChange &GetParticleChange() { return aParticleChange; }
-	void AddToNIEL(G4double energy) { NIEL+=energy; }
+	/// \brief set the pointer to a class for paritioning energy into NIEL
+	/// \brief part the pointer to the class.
+	void SetNIELPartitionFunction(const G4VNIELPartition *part);
+	/// \brief set the cross section boost to provide faster computation of backscattering
+	/// \param fraction the fraction of particles to have their cross section boosted.
+	/// \param HardeningFactor the factor by which to boost the scattering cross section.
 	void SetCrossSectionHardening(G4double fraction, G4double HardeningFactor) {
 		hardeningFraction=fraction;
 		hardeningFactor=HardeningFactor;
 	}
+	/// \brief get the fraction of particles which will have boosted scattering
 	G4double GetHardeningFraction() const { return hardeningFraction; }
+	/// \brief get the boost factor in use.
 	G4double GetHardeningFactor() const { return hardeningFactor; }
+	/// \brief the the interaciton length used in the last scattering.
 	G4double GetCurrentInteractionLength() const { return currentInteractionLength; }
+	/// \brief set a function to compute screening tables, if the user needs non-standard behavior.
+	/// \param cs a class which constructs the screening tables.
 	void SetExternalCrossSectionHandler(G4ScreenedCoulombCrossSection *cs) { 
 		externalCrossSectionConstructor=cs; 
 	}
+	/// \brief get the verbosity.
 	G4int GetVerboseLevel() const { return verboseLevel; }
+
 	std::map<G4int, G4ScreenedCoulombCrossSection*> &GetCrossSectionHandlers() 
 		{ return crossSectionHandlers; }
@@ -228,12 +312,22 @@
 	void SetValidCollision(G4bool flag) { validCollision=flag; }
 	G4bool GetValidCollision() const { return validCollision; }
+
+	/// \brief get the pointer to our ParticleChange object.  for internal use, primarily.
+	class G4ParticleChange &GetParticleChange() { return static_cast<G4ParticleChange &>(*pParticleChange); }
+	/// \brief take the given energy, and use the material information to partition it into NIEL and ionizing energy.
+	void DepositEnergy(G4int z1, G4double a1, const G4Material *material, G4double energy);
 	
 protected:
-	G4double highEnergyLimit, lowEnergyLimit;
+	/// \brief the energy per nucleon above which the MFP is constant 
+	G4double highEnergyLimit;
+	/// \brief the energy per nucleon below which the MFP is zero
+	G4double lowEnergyLimit;
+	/// \brief the energy per nucleon beyond which the cross section is zero, to cross over to G4MSC
+	G4double processMaxEnergy;
 	G4String screeningKey;
 	G4bool generateRecoils, avoidReactions;
 	G4double recoilCutoff, physicsCutoff;
 	G4bool registerDepositedEnergy;
-	G4double NIEL;
+	G4double IonizingLoss, NIEL;
 	G4double MFPScale;
 	G4double hardeningFraction, hardeningFactor;
@@ -243,9 +337,8 @@
 	
 	std::map<G4int, G4ScreenedCoulombCrossSection*> crossSectionHandlers;		
-	std::map<G4int, c2_function<G4double>*> meanFreePathTables;
 	
 	G4bool validCollision;
 	G4CoulombKinematicsInfo kinematics;
-
+	const G4VNIELPartition *NIELPartitionFunction;
 };
 
@@ -268,5 +361,5 @@
 	std::vector<G4String> GetScreeningKeys() const;
 	
-	typedef c2_function<G4double> &(*ScreeningFunc)(G4int z1, G4int z2, size_t nPoints, G4double rMax, G4double *au);
+	typedef G4_c2_function &(*ScreeningFunc)(G4int z1, G4int z2, size_t nPoints, G4double rMax, G4double *au);
 	
 	void AddScreeningFunction(G4String name, ScreeningFunc fn) {
@@ -279,5 +372,8 @@
 };
 
-
+G4_c2_function &ZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
+G4_c2_function &MoliereScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
+G4_c2_function &LJScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
+G4_c2_function &LJZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
 
 #endif
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmLivermore.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmLivermore.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmLivermore.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmLivermore.hh,v 1.1 2006/11/22 18:56:20 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmPenelope.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmPenelope.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmPenelope.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPenelope.hh,v 1.1 2006/11/22 18:56:21 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.3 2006/06/29 16:57:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardNR.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardNR.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardNR.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandardNR.hh,v 1.1 2008/01/14 12:11:38 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardSS.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardSS.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardSS.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandardSS.hh,v 1.1 2006/10/24 11:37:56 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsList.hh	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysicsList.hh,v 1.6 2006/11/22 18:56:21 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.hh,v 1.8 2008/11/20 20:34:50 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,4 +39,5 @@
 
 #include "G4VModularPhysicsList.hh"
+#include "G4EmConfigurator.hh"
 #include "globals.hh"
 
@@ -50,4 +51,5 @@
 {
 public:
+
   PhysicsList();
   virtual ~PhysicsList();
@@ -67,4 +69,7 @@
 
 private:
+
+  G4EmConfigurator em_config; 
+
   G4double cutForGamma;
   G4double cutForElectron;
@@ -77,4 +82,5 @@
   G4String                             emName;
   G4VPhysicsConstructor*               emPhysicsList;
+  G4VPhysicsConstructor*               decPhysicsList;
   std::vector<G4VPhysicsConstructor*>  hadronPhys;
     
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:57:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:57:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:57:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/RunAction.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.hh,v 1.12 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: RunAction.hh,v 1.14 2008/08/22 18:30:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -40,10 +40,5 @@
 class PrimaryGeneratorAction;
 class G4Run;
-
-namespace AIDA {
- class IAnalysisFactory;
- class ITree;
- class IHistogram1D;
-} 
+class Histo;
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -52,5 +47,6 @@
 {
 public:
-  RunAction(DetectorConstruction*, PhysicsList*,PrimaryGeneratorAction*);
+  RunAction(DetectorConstruction*, PhysicsList*,
+	    PrimaryGeneratorAction*);
   virtual ~RunAction();
 
@@ -58,20 +54,19 @@
   void   EndOfRunAction(const G4Run*);
     
-  void FillTallyEdep(G4int n, G4double e) {tallyEdep[n] += e;};
+  void FillTallyEdep(G4int n, G4double e)  {tallyEdep[n] += e;};
   void FillEdep(G4double de, G4double eni) {edeptot += de; eniel += eni;};
        
   G4double GetBinLength() {return binLength;};
   G4double GetLength()    {return length;};
-  G4double GetOffsetX()   {return offsetX;} 
-  void     FillHisto(G4int id, G4double x, G4double weight = 1.0);
+  G4double GetOffsetX()   {return offsetX;}
+ 
+  void FillHisto(G4int id, G4double x, G4double weight = 1.0);
     
-  void AddProjRange (G4double x) {projRange += x; projRange2 += x*x;};
+  void AddProjRange (G4double x) 
+  {projRange += x; projRange2 += x*x; nRange++;};
   void AddPrimaryStep() {nPrimarySteps++;};
                    
 private:  
-  void bookHisto();
-  void cleanHisto();
     
-private:
   DetectorConstruction*   detector;
   PhysicsList*            physics;
@@ -84,8 +79,7 @@
   G4double                edeptot, eniel;
   G4int                   nPrimarySteps;
-           
-  AIDA::IAnalysisFactory* af;  
-  AIDA::ITree*            tree;
-  AIDA::IHistogram1D*     histo[1];        
+  G4int                   nRange;
+
+  Histo*                  histo;
 };
 
Index: trunk/examples/extended/electromagnetic/TestEm7/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.3 2006/06/29 16:58:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:58:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:58:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:58:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:58:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.hh	(revision 1230)
@@ -1,2 +1,28 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
 /**
  *  \file 
@@ -7,13 +33,29 @@
  *  \author Copyright 2005 __Vanderbilt University__. All rights reserved.
  *
- * 	\version c2_function.hh,v 1.53 2007/11/12 13:58:57 marcus Exp
+ * 	\version c2_function.hh,v 1.238 2008/05/22 12:45:19 marcus Exp
+ *  \see \ref c2_factory "Factory Functions" for information on constructing things in here  
  */
 
-#ifndef __has_C2Functions_c2_h
-#define __has_C2Functions_c2_h 1
+#ifndef __has_c2_function_hh
+#define __has_c2_function_hh 1
+
+// MSVC does not automatically define numerical constants such as M_PI without this.
+// this came from the msdn website, so it should be right...
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES
+#define c2_isnan _isnan
+#define c2_isfinite _finite
+#else
+#define c2_isnan std::isnan
+#define c2_isfinite std::isfinite
+#endif
 
 #include <cmath>
 #include <vector>
+#include <utility>
 #include <string>
+#include <stdexcept>
+#include <typeinfo>
+#include <sstream>
 
 /// \brief the exception class for c2_function operations.
@@ -32,16 +74,49 @@
 
 // put these forward references here, and with a bogus typename to make swig happy.
-template <typename float_type> class c2_composed_function;
-template <typename float_type> class c2_sum;
-template <typename float_type> class c2_diff;
-template <typename float_type> class c2_product;
-template <typename float_type> class c2_ratio;
+template <typename float_type> class c2_composed_function_p;
+template <typename float_type> class c2_sum_p;
+template <typename float_type> class c2_diff_p;
+template <typename float_type> class c2_product_p;
+template <typename float_type> class c2_ratio_p;
+template <typename float_type> class c2_piecewise_function_p;
+template <typename float_type> class c2_quadratic_p;
+template <typename float_type> class c2_ptr;
+/**
+	\defgroup abstract_classes Abstract Classes
+	\defgroup arithmetic_functions Arithmetic Functions
+	\defgroup math_functions Mathemetical Functions
+	\defgroup parametric_functions Parametric Families of Functions
+	\defgroup interpolators Interpolating Functions
+	\defgroup containers Functions which are containers for, or functions of, other functions
+	\defgroup factories Factory classes which reduce silly template typing
+	\defgroup transforms Classes which provide coordinate system transformations, wih derivatives
+*/
+
+/// \brief structure used to hold evaluated function data at a point.  
+///
+/// Contains all the information for the function at one point. 
+template <typename float_type> class c2_fblock 
+{	
+public:
+	/// \brief the abscissa
+	float_type x;
+	/// \brief the value of the function at \a x
+	float_type y;
+	/// \brief the derivative at \a x
+	float_type yp;
+	/// \brief the second derivative at \a x
+	float_type ypp; 
+	/// flag, filled in by c2_function::fill_fblock(), indicating the derivative is NaN of Inf
+	bool ypbad;
+	/// flag, filled in by c2_function::fill_fblock(), indicating the second derivative is NaN of Inf
+	bool yppbad; 
+};
 
 /**
  \brief the parent class for all c2_functions.
-
+ \ingroup abstract_classes
   c2_functions know their value, first, and second derivative at almost every point.
   They can be efficiently combined with binary operators, via c2_binary_function, 
-  composed via c2_composed_function,
+  composed via c2_composed_function_,
   have their roots found via find_root(),
   and be adaptively integrated via partial_integrals() or integral().
@@ -53,15 +128,7 @@
     log_log_interpolating_function, and arrhenius_interpolating_function,
     as well as the template functions
-    inverse_integrated_density().
+    inverse_integrated_density_function().
  
- \warning
- The composite flavors of c2_functions (c2_sum, c2_composed_function, c2_binary_function, e.g.) make no effort to manage 
- deletion of their component functions.
- These are just container classes, and the user (along with normal automatic variable semantics) 
- is responsible for the lifetime of components.
- Inappropriate attention to this can cause massive memory leaks.  
- However, in most cases these do exactly what is intended.
- The classes will be left this way since the only other option is to use copy constructors on everything, 
- which would make this all very slow.
+ For a discussion of memory management, see \ref memory_management
  
  */
@@ -71,5 +138,5 @@
     /// \return the CVS Id string
 	const std::string cvs_header_vers() const { return 
-		"c2_function.hh,v 1.53 2007/11/12 13:58:57 marcus Exp";
+		"c2_function.hh,v 1.238 2008/05/22 12:45:19 marcus Exp";
 	}
 	
@@ -80,5 +147,14 @@
 public:
     /// \brief destructor
-	virtual ~c2_function() { if(sampling_grid && !no_overwrite_grid) delete sampling_grid; }
+	virtual ~c2_function() { 
+		if(sampling_grid && !no_overwrite_grid) delete sampling_grid; 	
+		if(root_info) delete root_info; 
+		if(owner_count) {
+			std::ostringstream outstr;
+			outstr << "attempt to delete an object with non-zero ownership in class ";
+			outstr << typeid(*this).name() << std::endl;
+			throw c2_exception(outstr.str().c_str());
+		}
+	}
 	
 	/// \brief get the value and derivatives. 
@@ -97,10 +173,4 @@
 	inline float_type operator () (float_type x) const throw(c2_exception) 
         { return value_with_derivatives(x, (float_type *)0, (float_type *)0); } 
-
-    /// \brief compose this function outside another.
-    /// \param inner the inner function
-    /// \return the composed function
-	c2_composed_function<float_type> & operator ()(const c2_function<float_type> &inner) const 
-		{ return *new c2_composed_function<float_type>((*this), inner); }
 
 	/// \brief get the value and derivatives. 
@@ -130,4 +200,5 @@
     /// \param[out] final_yprime2 If pointer is not zero, return second derivative of function at root
     /// \return the position of the root.
+	/// \see \ref rootfinder_subsec "Root finding sample" 
 	float_type find_root(float_type lower_bracket, float_type upper_bracket, float_type start, 
         float_type value, int *error=0, 
@@ -151,7 +222,8 @@
     /// with no error checking.
     /// \param extrapolate if true, use simple Richardson extrapolation on the final 2 steps to reduce the error.
-    /// \return sum of partial integrals, whcih is the definite integral from the first value in \a xgrid to the last.
+    /// \return sum of partial integrals, which is the definite integral from the first value in \a xgrid to the last.
 	float_type partial_integrals(std::vector<float_type> xgrid, std::vector<float_type> *partials = 0,
-          float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) const;
+          float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) 
+		const throw(c2_exception);
 	
     /// \brief a fully-automated integrator which uses the information provided by the get_sampling_grid() function
@@ -164,5 +236,5 @@
 	/// \param xmax upper bound of the domain for integration
     /// \param partials if non-NULL, a vector in which to receive the partial integrals.
-	/// It will automatically be sized apprpropriately, if provided, to contain \a n - 1 elements where \a n is the length of \a xgrid  
+	/// It will automatically be sized appropriately, if provided, to contain \a n - 1 elements where \a n is the length of \a xgrid  
     /// \param abs_tol the absolute error bound for each segment
     /// \param rel_tol the fractional error bound for each segment.  
@@ -173,8 +245,50 @@
     /// with no error checking.
     /// \param extrapolate if true, use simple Richardson extrapolation on the final 2 steps to reduce the error.
-    /// \return sum of partial integrals, whcih is the definite integral from the first value in \a xgrid to the last.
+    /// \return sum of partial integrals, which is the definite integral from the first value in \a xgrid to the last.
 	float_type integral(float_type xmin, float_type xmax, std::vector<float_type> *partials = 0,
-             float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) const;
-
+             float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) 
+		const throw(c2_exception);
+
+	/// \brief create a c2_piecewise_function_p from c2_connector_function_p segments which 
+	/// is a representation of the parent function to the specified accuracy, but maybe much cheaper to evaluate
+	///
+	/// This method has three modes, depending on the \a derivs flag. 
+	///
+	/// If \a derivs is 2,
+	/// it computes a c2_piecewise_function_p representation of its parent function, which may be a much faster 
+	/// function to use in codes if the parent function is expensive.  If \a xvals and \a yvals are non-null,
+	/// it will also fill them in with the function values at each grid point the adaptive algorithm chooses.
+	///
+	/// If \a derivs is 1, this does not create the connectors, 
+	/// and returns an null pointer, but will fill in the \a xvals and \a yvals 
+	/// vectors with values of the function at points such that the linear interpolation error between the points
+	/// is bounded by the tolerance values given.  Because it uses derivative information from the function to manage the 
+	/// error control, it is almost completely free of issues with missing periods of oscillatory functions,
+	/// even with no information provided in the sampling grid.
+	/// This is typically useful for sampling a function for plotting.
+	///
+	/// If \a derivs is 0, this does something very like what it does if \a derivs = 1, but without derivatives.  
+	/// Instead, to compute the intermediate value of the function for error control, it just uses 
+	/// 3-point parabolic interpolation.  This is useful amost exclusively for converting a non-c2_function,
+	/// with no derivatives, but wrapped in a c2_classic_function wrapper, into a table of values to seed an interpolating_function_p.
+	/// Note, however, that without derivatives, this is very susceptible to missing periods of oscillatory 
+	/// functions, so it is important to set a sampling grid which isn't too much coarser than the typical oscillations.
+	///
+	/// \note the \a sampling_grid of the returned function matches the \a sampling_grid of its parent.
+	/// \see \ref sample_function_for_plotting "Adaptive Sampling Examples"
+    /// \param xmin lower bound of the domain for sampling
+	/// \param xmax upper bound of the domain for sampling
+    /// \param abs_tol the absolute error bound for each segment
+    /// \param rel_tol the fractional error bound for each segment. 
+	/// \param derivs if 0 or 1, return a useless function, but fill in the \a xvals and \a yvals vectors (if non-null).
+	/// Also, if 0 or 1, tolerances refer to linear interpolation, not high-order interpolation. 
+	/// If 2, return a full piecewise collection of c2_connector_function_p segments.  See discussion above.
+	/// \param [in,out] xvals vector of abscissas at which the function was actually sampled (if non-null)
+	/// \param [in,out] yvals vector of function values corresponding to \a xvals (if non-null)
+	/// \return a new, sampled representation, if \a derivs is 2.  A null pointer if \a derivs is 0 or 1.
+	c2_piecewise_function_p<float_type> *adaptively_sample(float_type xmin, float_type xmax,
+		 float_type abs_tol=1e-12, float_type rel_tol=1e-12,
+		 int derivs=2, std::vector<float_type> *xvals=0, std::vector<float_type> *yvals=0) const throw(c2_exception);
+	
 	/// \brief return the lower bound of the domain for this function as set by set_domain()
 	inline float_type xmin() const { return fXMin; }
@@ -186,8 +300,7 @@
 	/// \brief this is a counter owned by the function but which can be used to monitor efficiency of algorithms.
 	///
-	/// It is not maintained automatically in general!  
-	/// The adaptive integrator and root finder do clear it at the start and update it for performance checking.
+	/// It is not maintained automatically in general!  The root finder, integrator, and sampler do increment it.
 	/// \return number of evaluations logged since last reset.
-	volatile int get_evaluations() const { return evaluations; }
+	volatile size_t get_evaluations() const { return evaluations; }
 	/// \brief reset the counter
 	void reset_evaluations()  const { evaluations=0; } // evaluations are 'invisible' to constant
@@ -200,5 +313,5 @@
 	/// \param message an informative string to include in an exception if this throws c2_exception
 	/// \return true if in decreasing order, false if increasing 
-	bool check_monotonicity(const std::vector<float_type> &data, const char message[]) throw(c2_exception);
+	bool check_monotonicity(const std::vector<float_type> &data, const char message[]) const throw(c2_exception);
 	
 	/// \brief establish a grid of 'interesting' points on the function.
@@ -212,4 +325,8 @@
 	virtual void set_sampling_grid(const std::vector<float_type> &grid) throw(c2_exception); 
 	
+	/// \brief get the sampling grid, which may be a null pointer
+	/// \return pointer to the sampling grid
+	std::vector<float_type> *get_sampling_grid_pointer() const { return sampling_grid; } 
+	
     /// \brief return the grid of 'interesting' points along this function which lie in the region requested
 	///
@@ -217,17 +334,15 @@
 	/// \param xmin the lower bound for which the function is to be sampled
 	/// \param xmax the upper bound for which the function is to be sampled
-	/// \return a new vector containing the samplng grid.
-	virtual std::vector<float_type> &get_sampling_grid(float_type xmin, float_type xmax) const ;
+	/// \param [in,out] grid filled vector containing the samplng grid.
+	virtual void get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const ;
 	
 	/// \brief clean up endpoints on a grid of points
-	///
 	/// \param[in,out] result the sampling grid with excessively closely space endpoints removed.
 	/// The grid is modified in place.
 	void preen_sampling_grid(std::vector<float_type> *result) const;		
 	/// \brief refine a grid by splitting each interval into more intervals
-	/// \param grid the grid to refine
+	/// \param [in,out] grid the grid to refine in place
 	/// \param refinement the number of new steps for each old step
-	/// \return a new sampling grid with more points.
-	std::vector<float_type> & refine_sampling_grid(const std::vector<float_type> &grid, size_t refinement) const;		
+	void refine_sampling_grid(std::vector<float_type> &grid, size_t refinement) const;		
 	
 	/// \brief create a new c2_function from this one which is normalized on the interval 
@@ -236,5 +351,5 @@
 	/// \param norm the desired integral for the function over the region
 	/// \return a new c2_function with the desired \a norm.
-	c2_function<float_type> &normalized_function(float_type xmin, float_type xmax, float_type norm=1.0);
+	c2_function<float_type> &normalized_function(float_type xmin, float_type xmax, float_type norm=1.0) const throw(c2_exception);
 	/// \brief create a new c2_function from this one which is square-normalized on the interval 
     /// \param xmin lower bound of the domain for integration
@@ -242,5 +357,5 @@
 	/// \param norm the desired integral for the function over the region
 	/// \return a new c2_function with the desired \a norm.
-	c2_function<float_type> &square_normalized_function(float_type xmin, float_type xmax, float_type norm=1.0);
+	c2_function<float_type> &square_normalized_function(float_type xmin, float_type xmax, float_type norm=1.0) const throw(c2_exception);
 	/// \brief create a new c2_function from this one which is square-normalized with the provided \a weight on the interval 
     /// \param xmin lower bound of the domain for integration
@@ -249,38 +364,71 @@
 	/// \param norm the desired integral for the function over the region
 	/// \return a new c2_function with the desired \a norm.
-	c2_function<float_type> &square_normalized_function(float_type xmin, float_type xmax, const c2_function<float_type> &weight, float_type norm=1.0);
-
-	/// \brief factory function to create a c2_sum from an regular algebraic expression.
-	/// \note
-	/// be very wary of ownership issues if this is used in a complex expression.
-	c2_sum<float_type> &operator + (const c2_function<float_type> &rhs)  { return *new c2_sum<float_type>(*this, rhs); }
-	/// \brief factory function to create a c2_diff from an regular algebraic expression.
-	/// \note
-	/// be very wary of ownership issues if this is used in a complex expression.
-	c2_diff<float_type> &operator - (const c2_function<float_type> &rhs)  { return *new c2_diff<float_type>(*this, rhs); }
-	/// \brief factory function to create a c2_product from an regular algebraic expression.
-	/// \note
-	/// be very wary of ownership issues if this is used in a complex expression.
-	c2_product<float_type> &operator * (const c2_function<float_type> &rhs)  { return *new c2_product<float_type>(*this, rhs); }
-	/// \brief factory function to create a c2_ratio from an regular algebraic expression.
-	/// \note
-	/// be very wary of ownership issues if this is used in a complex expression.
-	c2_ratio<float_type> &operator / (const c2_function<float_type> &rhs)  { return *new c2_ratio<float_type>(*this, rhs); }
-	
-
-	
-	std::vector<float_type> *sampling_grid;
-	bool no_overwrite_grid;
-	    
+	c2_function<float_type> &square_normalized_function(
+		float_type xmin, float_type xmax, const c2_function<float_type> &weight, float_type norm=1.0)
+		const throw(c2_exception);
+
+	/// \brief factory function to create a c2_sum_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the sum
+	/// \return a new c2_function
+	c2_sum_p<float_type> &operator + (const c2_function<float_type> &rhs)  const 
+		{ return *new c2_sum_p<float_type>(*this, rhs); }
+	/// \brief factory function to create a c2_diff_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the difference
+	/// \return a new c2_function
+	c2_diff_p<float_type> &operator - (const c2_function<float_type> &rhs)  const 
+		{ return *new c2_diff_p<float_type>(*this, rhs); }
+	/// \brief factory function to create a c2_product_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the product
+	/// \return a new c2_function
+	c2_product_p<float_type> &operator * (const c2_function<float_type> &rhs) const 
+		{ return *new c2_product_p<float_type>(*this, rhs); }
+	/// \brief factory function to create a c2_ratio_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the ratio (the denominator)
+	/// \return a new c2_function
+	c2_ratio_p<float_type> &operator / (const c2_function<float_type> &rhs)  const 
+		{ return *new c2_ratio_p<float_type>(*this, rhs); }
+    /// \brief compose this function outside another.
+    /// \param inner the inner function
+    /// \return the composed function
+	/// \anchor compose_operator
+	c2_composed_function_p<float_type> & operator ()(const c2_function<float_type> &inner) const 
+		{ return *new c2_composed_function_p<float_type>((*this), inner); }
+
+	/// \brief Find out where a calculation ran into trouble, if it got a nan.
+	/// If the most recent computation did not return a nan, this is undefined.
+	/// \return \a x value of point at which something went wrong, if integrator (or otherwise) returned a nan.
+	float_type get_trouble_point() const { return bad_x_point; }
+	
+	/// \brief increment our reference count.  Destruction is only legal if the count is zero.
+	void claim_ownership() const { owner_count++; }
+	/// \brief decrement our reference count. Do not destroy at zero.
+	/// \return final owner count, to check whether object should disappear.
+	size_t release_ownership_for_return() const throw(c2_exception) { 
+		if(!owner_count) {
+			std::ostringstream outstr;
+			outstr << "attempt to release ownership of an unowned function in class ";
+			outstr << typeid(*this).name() << std::endl;
+			throw c2_exception(outstr.str().c_str());
+		}
+		owner_count--; 
+		return owner_count;
+	}
+	/// \brief decrement our reference count. If the count reaches zero, destroy ourself.
+	void release_ownership() const throw(c2_exception) { 
+		if(!release_ownership_for_return()) delete this;
+	}
+	/// \brief get the reference count, mostly for debugging
+	/// \return the count
+	size_t count_owners() const { return owner_count; }
+
 protected:
 	c2_function(const c2_function<float_type>  &src) : sampling_grid(0),
 		no_overwrite_grid(false),
-        fXMin(src.fXMin), fXMax(src.fXMax), rootInitialized(false)
+        fXMin(src.fXMin), fXMax(src.fXMax), root_info(0), owner_count(0)
         {} // copy constructor only copies domain, and is only for internal use
 	c2_function() : 
 			sampling_grid(0), no_overwrite_grid(0), 
         fXMin(-std::numeric_limits<float_type>::max()), 
-        fXMax(std::numeric_limits<float_type>::max()),
-        rootInitialized(false)
+        fXMax(std::numeric_limits<float_type>::max()), root_info(0), owner_count(0)
 		{} // prevent accidental naked construction (impossible any since this has pure virtual methods)
 	
@@ -293,20 +441,61 @@
 		}
 	
+	std::vector<float_type> * sampling_grid;
+	bool no_overwrite_grid;
+	
 	float_type fXMin, fXMax;
-	mutable int evaluations;
-	
+	mutable size_t evaluations;
+	/// \brief this point may be used to record where a calculation ran into trouble
+	mutable float_type bad_x_point;
+public: 
+	/// \brief fill in a c2_fblock<float_type>... a shortcut for the integrator & sampler
+	/// \param [in,out] fb the block to fill in with information
+	inline void fill_fblock(c2_fblock<float_type> &fb) const throw(c2_exception) 
+	{
+		fb.y=value_with_derivatives(fb.x, &fb.yp, &fb.ypp);
+		fb.ypbad=c2_isnan(fb.yp) || !c2_isfinite(fb.yp);
+		fb.yppbad=c2_isnan(fb.ypp) || !c2_isfinite(fb.ypp);
+		increment_evaluations();
+	}
+
 private:
-	/// \brief structure used for recursion in adaptive integrator.  
-	///
-	/// Contains all the information for the function at one point. 
-	struct c2_integrate_fblock {	float_type x, y, yp, ypp; };
-	/// \brief structure used to pass information recursively.
+	/// \brief the data element for the internal recursion stack for the sampler and integrator
+	struct recur_item { 
+		c2_fblock<float_type> f1; size_t depth; 
+		float_type previous_estimate, abs_tol, step_sum; 
+		bool done; 
+		size_t f0index, f2index;
+	};
+	
+
+	/// \brief structure used to pass information recursively in integrator.
 	///
 	/// the \a abs_tol is scaled by a factor of two at each division.  
 	/// Everything else is just passed down.
-	struct c2_integrate_recur { struct c2_integrate_fblock *f0, *f1, *f2;
-		float_type abs_tol, rel_tol, *lr, eps_scale, extrap_coef, extrap2;
-		int depth, derivs;
-		bool adapt, extrapolate;
+	struct c2_integrate_recur { 
+		c2_fblock<float_type> *f0, *f1;
+		float_type abs_tol, rel_tol, eps_scale, extrap_coef, extrap2, dx_tolerance, abs_tol_min;
+		std::vector< recur_item > *rb_stack;
+		int  derivs;
+		bool adapt, extrapolate, inited;
+	};
+
+	/// \brief structure used to pass information recursively in sampler.
+	///
+	struct c2_sample_recur { 
+		c2_fblock<float_type> *f0, *f1;
+		float_type abs_tol, rel_tol, dx_tolerance, abs_tol_min;
+		int derivs;
+		c2_piecewise_function_p<float_type> *out;
+		std::vector<float_type> *xvals, *yvals;
+		std::vector< recur_item > *rb_stack;
+		bool inited;
+	};
+
+	/// \brief structure used to hold root bracketing information
+	///
+	struct c2_root_info {
+		c2_fblock<float_type> lower, upper;
+		bool inited;
 	};
 	
@@ -316,17 +505,265 @@
     /// to allow very efficient recursion.
     /// \param rb a pointer to the recur struct.
-	float_type integrate_step(struct c2_integrate_recur &rb) const;
+	float_type integrate_step(struct c2_integrate_recur &rb) const throw(c2_exception);
     
-    /// these carry a memory of the last root bracketing,
+    /// \brief Carry out the recursive subdivision for sampling.
+    ///
+    /// This passes information recursively through the \a recur block pointer
+    /// to allow very efficient recursion.
+    /// \param rb a pointer to the recur struct.
+	void sample_step(struct c2_sample_recur &rb) const throw(c2_exception);
+
+    /// this carry a memory of the last root bracketing,
     /// to avoid the necessity of evaluating the function on the brackets every time
     /// if the brackets have not been changed. 
-    mutable float_type lastRootLowerX, lastRootUpperX, lastRootLowerY, lastRootUpperY;
-    mutable int rootInitialized;
-	
-};
-
+	/// it is declared as a pointer, since many c2_functions may never need one allocated
+    mutable struct  c2_root_info *root_info;
+	
+	mutable size_t owner_count;
+};
+
+/// \brief a container into which any conventional c-style function can be dropped,
+/// to create a degenerate c2_function without derivatives. 
+/// Mostly useful for sampling into interpolating functions.
+/// construct a reference to this with c2_classic_function()
+/// \ingroup containers
+/// The factory function c2_factory::classic_function() creates *new c2_classic_function_p()
+template <typename float_type=double> class c2_classic_function_p : public c2_function<float_type> {
+public:
+	/// \brief construct the container 
+	/// \param c_func a pointer to a conventional c-style function
+	c2_classic_function_p(const float_type (*c_func)(float_type)) : c2_function<float_type>(), func(c_func)  {}
+
+	/// \copydoc c2_function::value_with_derivatives
+	/// Uses the internal function pointer set by set_function().
+	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 
+	{
+		if(!func) throw c2_exception("c2_classic_function called with null function");
+		if(yprime) *yprime=0;
+		if(yprime2) *yprime2=0;
+		return func(x); 
+	}
+	~c2_classic_function_p() { }
+	
+protected:
+	/// \brief pointer to our function
+	const float_type (*func)(float_type);
+};
+
+/// \brief create a container for a c2_function which handles the reference counting.
+/// \ingroup containers
+/// It is useful as a smart container to hold a c2_function and keep the reference count correct.  
+/// The recommended way for a class to store a c2_function which is handed in from the outside 
+/// is for it to have a c2_ptr member into which the passed-in function is stored.
+/// This way, when the class instance is deleted, it will automatically dereference any function
+/// which it was handed.
+///
+/// This class contains a copy constructor and operator=, to make it fairly easy to make 
+/// a std::vector of these objects, and have it work as expected.
+template <typename float_type> class c2_const_ptr {
+public:
+	/// \brief construct the container with no function
+	c2_const_ptr() : func(0)  {}
+	/// \brief construct the container with a pre-defined function
+	/// \param f the function to store
+	c2_const_ptr(const c2_function<float_type> &f) : func(0) 
+		{ set_function(&f); }
+	/// \brief copy constructor
+	/// \param src the container to copy
+	c2_const_ptr(const c2_const_ptr<float_type> &src) : func(0)
+		{ set_function(src.get_ptr()); }
+	/// \brief fill the container with a new function, or clear it with a null pointer
+	/// \param f the function to store, releasing any previously held function
+	void set_function(const c2_function<float_type> *f) 
+	{ 
+		if(func) func->release_ownership();
+		func=f; 
+		if(func) func->claim_ownership();
+	}
+	
+	/// \brief fill the container from another container
+	/// \param f the container to copy
+	void operator =(const c2_const_ptr<float_type> &f) 
+		{ set_function(f.get_ptr()); }
+	/// \brief fill the container with a function
+	/// \param f the function
+	void operator =(const c2_function<float_type> &f) 
+		{ set_function(&f); }
+	/// \brief release the function without destroying it, so it can be returned from a function
+	///
+	/// This is usually the very last line of a function before the return statement, so that 
+	/// any exceptions that happen during execution of the function will cause proper cleanup.
+	/// Once the function has been released from its container this way, it is an orhpaned object
+	/// until the caller claims it, so it could get lost if an exception happens.
+	void release_for_return() throw(c2_exception)
+		{	
+			if(func) func->release_ownership_for_return();
+			func=0;
+		}
+	/// \brief clear the function
+	///
+	/// Any attempt to use this c2_plugin_function_p throws an exception if the saved function is cleared.
+	void unset_function(void) { set_function(0);  }
+	/// \brief destructor
+	~c2_const_ptr() { set_function(0); }
+	
+	/// \brief get a reference to our owned function
+	inline const c2_function<float_type> &get() const throw(c2_exception) 
+	{ 
+		if(!func) throw c2_exception("c2_ptr accessed uninitialized");
+		return *func;
+	}
+	/// \brief get an unchecked pointer to our owned function
+	inline const c2_function<float_type> *get_ptr() const { return func; }
+	/// \brief get a checked pointer to our owned function
+	inline const c2_function<float_type> *operator -> () const 
+		{ return &get(); }
+	/// \brief check if we have a valid function
+	bool valid() const { return func != 0; }
+	
+	/// \brief type coercion operator which lets us use a pointer as if it were a const c2_function
+	operator const c2_function<float_type>& () const { return this->get(); }
+	
+	/// \brief convenience operator to make us look like a function
+	/// \param x the value at which to evaluate the contained function
+	/// \return the evaluated function
+	/// \note If you using this repeatedly, do const c2_function<float_type> &func=ptr;
+	/// and use func(x).  Calling this operator wastes some time, since it checks the validity of the
+	/// pointer every time.
+	float_type operator()(float_type x) const throw(c2_exception) { return get()(x); }
+	/// \brief convenience operator to make us look like a function
+	/// \param x the value at which to evaluate the contained function
+	/// \param yprime the derivative
+	/// \param yprime2 the second derivative
+	/// \return the evaluated function
+	/// \note If you using this repeatedly, do const c2_function<float_type> &func=ptr;
+	/// and use func(x).  Calling this operator wastes some time, since it checks the validity of the
+	/// pointer every time.
+	float_type operator()(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 
+		{ return get().value_with_derivatives(x, yprime, yprime2); }
+	/// \brief factory function to create a c2_sum_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the sum
+	/// \return a new c2_function
+	c2_sum_p<float_type> &operator + (const c2_function<float_type> &rhs)  const throw(c2_exception)
+		{ return *new c2_sum_p<float_type>(get(), rhs); }
+	/// \brief factory function to create a c2_diff_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the difference
+	/// \return a new c2_function
+	c2_diff_p<float_type> &operator - (const c2_function<float_type> &rhs)  const throw(c2_exception)
+		{ return *new c2_diff_p<float_type>(get(), rhs); }
+	/// \brief factory function to create a c2_product_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the product
+	/// \return a new c2_function
+	c2_product_p<float_type> &operator * (const c2_function<float_type> &rhs) const throw(c2_exception)
+		{ return *new c2_product_p<float_type>(get(), rhs); }
+	/// \brief factory function to create a c2_ratio_p from a regular algebraic expression.
+	/// \param rhs the right-hand term of the ratio (the denominator)
+	/// \return a new c2_function
+	c2_ratio_p<float_type> &operator / (const c2_function<float_type> &rhs)  const throw(c2_exception)
+		{ return *new c2_ratio_p<float_type>(get(), rhs); }
+    /// \brief compose this function outside another.
+    /// \param inner the inner function
+    /// \return the composed function
+	c2_composed_function_p<float_type> & operator ()(const c2_function<float_type> &inner) const throw(c2_exception)
+		{ return *new c2_composed_function_p<float_type>(get(), inner); }
+	
+protected:
+	const c2_function<float_type> * func;
+};
+
+/// \brief create a container for a c2_function which handles the reference counting.
+/// \ingroup containers
+///
+/// \see  c2_const_ptr and \ref memory_management "Use of c2_ptr for memory management"
+
+template <typename float_type> class c2_ptr : public c2_const_ptr<float_type >
+{
+public:
+	/// \brief construct the container with no function
+	c2_ptr() : c2_const_ptr<float_type>()  {}
+	/// \brief construct the container with a pre-defined function
+	/// \param f the function to store
+	c2_ptr(c2_function<float_type> &f) : 
+		c2_const_ptr<float_type>() { set_function(&f); } 
+	/// \brief copy constructor
+	/// \param src the container to copy
+	c2_ptr(const c2_ptr<float_type> &src) : 
+		c2_const_ptr<float_type>() { set_function(src.get_ptr()); }
+	/// \brief get a checked pointer to our owned function
+	inline c2_function<float_type> &get() const throw(c2_exception) 
+		{ return *const_cast<c2_function<float_type>*>(&c2_const_ptr<float_type>::get()); }
+	/// \brief get an unchecked pointer to our owned function
+	inline c2_function<float_type> *get_ptr() const 
+		{ return const_cast<c2_function<float_type>*>(this->func); }
+	/// \brief get a checked pointer to our owned function
+	inline c2_function<float_type> *operator -> () const 
+		{ return &get(); }
+	/// \brief fill the container from another container
+	/// \param f the container to copy
+	void operator =(const c2_ptr<float_type> &f) 
+		{ set_function(f.get_ptr()); }
+	/// \brief fill the container with a function
+	/// \param f the function
+	void operator =(c2_function<float_type> &f) 
+		{ set_function(&f); }
+private:
+	/// \brief hidden non-const-safe version of operator=
+	void operator =(const c2_const_ptr<float_type> &f) { }
+	/// \brief hidden non-const-safe version of operator=
+	void operator =(const c2_function<float_type> &f) { }
+};
+
+/// \brief create a non-generic container for a c2_function which handles the reference counting.
+/// \ingroup containers
+///
+/// \see  c2_const_ptr and \ref memory_management "Use of c2_ptr for memory management"
+///
+/// \note Overuse of this class will generate massive bloat.  Use c2_ptr and c2_const_ptr if you don't _really_ need specific pointer types.
+/// \see  \ref memory_management "Use of c2_ptr for memory management"
+/*
+template <typename float_type, template <typename> class c2_class > class c2_typed_ptr : public c2_const_ptr<float_type> {
+public:
+	/// \brief construct the container with no function
+	c2_typed_ptr() : c2_ptr<float_type>()  {}
+	/// \brief construct the container with a pre-defined function
+	/// \param f the function to store
+	c2_typed_ptr(c2_class<float_type> &f)
+		: c2_const_ptr<float_type>() { this->set_function(&f); }
+	/// \brief copy constructor
+	/// \param src the container to copy
+	c2_typed_ptr(const c2_typed_ptr<float_type, c2_class> &src) 
+		: c2_const_ptr<float_type>() { this->set_function(src.get_ptr()); }
+	
+	/// \brief get a reference to our owned function
+	inline c2_class<float_type> &get() const throw(c2_exception) 
+		{ 
+			return *static_cast<c2_class<float_type> *>(const_cast<c2_function<float_type>*>(&c2_const_ptr<float_type>::get()));
+		}
+	/// \brief get a checked pointer to our owned function
+	inline c2_class<float_type> *operator -> () const 
+		{ return &get(); }
+	/// \brief get an unchecked pointer to our owned function
+	inline c2_class<float_type> *get_ptr() const 
+		{ return static_cast<c2_class<float_type> *>(const_cast<c2_function<float_type>*>(this->func)); }
+	/// \brief type coercion operator which lets us use a pointer as if it were a c2_function
+	operator c2_class<float_type>&() const { return get(); }
+	/// \brief fill the container from another container
+	/// \param f the container to copy
+	void operator =(const c2_typed_ptr<float_type, c2_class> &f) 
+		{ set_function(f.get_ptr()); }
+	/// \brief fill the container with a function
+	/// \param f the function
+	void operator =(c2_class<float_type> &f) 
+		{ set_function(&f); }
+private:
+	/// \brief hidden downcasting version of operator=
+	void operator =(const c2_const_ptr<float_type> &f) { }
+	/// \brief hidden downcasting version of operator=. Use an explicit dynamic_cast<c2_class<float_type>&>(f) if you need to try this.
+	void operator =(const c2_function<float_type> &f) { }
+};
+*/
 /// \brief a container into which any other c2_function can be dropped, to allow expressions
 /// with replacable components.  
-///
+/// \ingroup containers
 ///It is useful for plugging different InterpolatingFunctions into a c2_function expression.
 ///It saves a lot of effort in other places with casting away const declarations.
@@ -334,20 +771,26 @@
 /// It is also useful as a wrapper for a function if it is necessary to have a copy of a function
 /// which has a different domain or sampling grid than the parent function.  This can be
-/// be used, for example, to patch badly-behaved functions with c2_piecewise_function by 
+/// be used, for example, to patch badly-behaved functions with c2_piecewise_function_p by 
 /// taking the parent function, creating two plugins of it with domains on each side of the 
 /// nasty bit, and then inserting a nice function in the hole.
-template <typename float_type=double> class c2_plugin_function : public c2_function<float_type> {
+///
+/// This can also be used as a fancier c2_ptr which allows direct evaluation
+/// instead of having to dereference the container first.
+///
+/// The factory function c2_factory::plugin_function() creates *new c2_plugin_function_p()
+template <typename float_type=double> class c2_plugin_function_p : 
+	public c2_function<float_type> {
 public:
 	/// \brief construct the container with no function
-	c2_plugin_function() : c2_function<float_type>(), func(0), owns(false)  {}
+	c2_plugin_function_p() : c2_function<float_type>(), func()  {}
 	/// \brief construct the container with a pre-defined function
-	c2_plugin_function(const c2_function<float_type> &f) : c2_function<float_type>(), func(0), owns(false) { set_function(f); }
-	/// \brief fill the container with a new function
-	void set_function(const c2_function<float_type> &f) 
-		{ 
-			if(owns && func) delete func;
-			func=&f; set_domain(f.xmin(), f.xmax()); 
-			set_sampling_grid_pointer(*f.sampling_grid); 
-			owns=false;
+	c2_plugin_function_p(c2_function<float_type> &f) : 
+		c2_function<float_type>(),func(f)  { }
+	/// \brief fill the container with a new function, or clear it with a null pointer
+	/// and copy our domain
+	void set_function(c2_function<float_type> *f) 
+		{
+			func.set_function(f);
+			if(f) set_domain(f->xmin(), f->xmax());
 		}
 	/// \copydoc c2_function::value_with_derivatives
@@ -355,100 +798,103 @@
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 
 		{
-			if(!func) throw c2_exception("c2_plugin_function<float_type> called uninitialized");
-			return this->func->value_with_derivatives(x, yprime, yprime2); 
+			if(!func.valid()) throw c2_exception("c2_plugin_function_p called uninitialized");
+			return func->value_with_derivatives(x, yprime, yprime2); 
 		}
-	/// \brief clear the function
-	///
-	/// Any attempt to use this c2_plugin_function throws an exception if the saved function is cleared.
-	void unset_function(void) { if(owns && func) delete func; func=0; owns=false; }
 	/// \brief destructor
-	~c2_plugin_function() { if(owns && func) delete func; }
-	/// \brief tell us we should delete the function at destruction.  NOT sticky when function is reset
-	void set_ownership() { this->owns=true; }
-	
+	~c2_plugin_function_p() { }
+	
+	/// \brief clear our function
+	void unset_function() { func.unset_function(); }
+	
+	virtual void get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const 
+	{	
+		if(!func.valid()) throw c2_exception("c2_plugin_function_p called uninitialized");
+		if(this->sampling_grid) c2_function<float_type>::get_sampling_grid(xmin, xmax, grid);
+		else  func->get_sampling_grid(xmin, xmax, grid);
+	}
 protected:
-	const c2_function<float_type> *func;
-	bool owns;
-	
+	c2_ptr<float_type> func;
+};
+
+/// \brief a c2_plugin_function_p which promises not to fiddle with the plugged function.
+/// \ingroup containers
+///
+/// The factory function c2_factory::const_plugin_function() creates *new c2_const_plugin_function_p()
+template <typename float_type=double> class c2_const_plugin_function_p : public c2_plugin_function_p<float_type> {
+public:
+	/// \brief construct the container with no function
+	c2_const_plugin_function_p() : c2_plugin_function_p<float_type>()  {}
+	/// \brief construct the container with a pre-defined function
+	c2_const_plugin_function_p(const c2_function<float_type> &f) : 
+		c2_plugin_function_p<float_type>()  { set_function(&f); }
+	/// \brief fill the container with a new function, or clear it with a null pointer
+	void set_function(const c2_function<float_type> *f) 
+		{ c2_plugin_function_p<float_type>::set_function(const_cast<c2_function<float_type>*>(f)); }
+	/// \brief destructor
+	~c2_const_plugin_function_p() { }
+	
+	/// \brief get a const reference to our owned function, for direct access
+	const c2_function<float_type> &get() const throw(c2_exception) 
+		{ return this->func.get(); }
 };
 
 /// \brief Provides support for c2_function objects which are constructed from two other c2_function
 /// objects.  
-///
-/// It provides a very primitive ownership concept, so that the creator can tag a function
-/// as being owned by this function, so that when this function is deleted, the owned function will be deleted, too.
-/// This allows a piece of code to create various c2_function objects, combine them with binary operators,
-/// appropriately mark wich ones have no other possible owners, and return the final function with
-/// reasonable faith that everything will get cleaned up when the final function is deleted.  Note that
-/// none of this marking is automatic, to keep this class very lightweight.
+/// \ingroup abstract_classes
 template <typename float_type=double> class c2_binary_function : public c2_function<float_type> {
 public:
-	
-	
 	///  \brief function to manage the binary operation, used by c2_binary_function::value_with_derivatives() 
     /// 
-    /// Normally not used alone, but can be used to combine functions in other contexts. 
-	/// See interpolating_function::binary_operator() for an example.
-	/// \param left the function on the left of the binary operator or outside the composition
-	/// \param right the function to the right of the operator or inside the composition
-    /// \param[in] x the point at which to evaluate the function
-    /// \param[out] yprime the first derivative (if pointer is non-null)
-    /// \param[out] yprime2 the second derivative (if pointer is non-null)
-    /// \return the value of the function
-	virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
-					   float_type x, float_type *yprime, float_type *yprime2) const =0;
 	
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw (c2_exception) 
     { 
-		return this->combine(this->Left, this->Right, x, yprime, yprime2);
+		if(stub) throw c2_exception("attempt to evaluate a c2_binary_function stub");
+		return this->combine(*Left.get_ptr(), *Right.get_ptr(), x, yprime, yprime2);
     }
 
-	/// \brief allow c2_binary_function to remember ownership of contained functions for automatic cleanup
+	/// \brief destructor releases ownership of member functions
 	///
-	/// upon destruction, this will cause disposal of the left member function
-	void set_left_ownership(void) { leftown=true; }
-	/// \brief allow c2_binary_function to remember ownership of contained functions for automatic cleanup
-	///
-	/// upon destruction, this will cause disposal of the right member function
-	void set_right_ownership(void) { rightown=true; }
-	/// \brief allow c2_binary_function to remember ownership of contained functions for automatic cleanup
-	///
-	/// upon destruction, this will cause disposal of both member functions
-	void set_ownership(void) { leftown=rightown=true; }
-	/// \brief destructor executes disposal of member functions if flagged
-	///
-	/// depends on judicious use of set_ownership(), set_right_ownership(), or set_left_ownership()
-	virtual ~c2_binary_function() {
-		if(leftown) delete &Left;
-		if(rightown) delete &Right;
-	}
-		
+	virtual ~c2_binary_function() { }
+
 protected:
 	/// \brief construct the binary function
+	/// \param combiner pointer to the function which actualy knows how to execute the binary
 	/// \param left the c2_function to be used in the left side of the binary relation
 	/// \param right the c2_function to be used in the right side of the binary relation
-	c2_binary_function( const c2_function<float_type> &left,  const c2_function<float_type> &right) : 
-	c2_function<float_type>(), 
-	Left(left), Right(right), leftown(false), rightown(false) 
+	c2_binary_function( 
+			float_type (*combiner)(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+				   float_type x, float_type *yprime, float_type *yprime2),						
+			const c2_function<float_type> &left,  const c2_function<float_type> &right) : 
+			c2_function<float_type>(), combine(combiner), Left(left), Right(right), stub(false)
 	{ 
-			set_domain(
-					   (left.xmin() > right.xmin()) ? left.xmin() : right.xmin(), 
-					   (left.xmax() < right.xmax()) ? left.xmax() : right.xmax()
-					   );
+		set_domain(
+				   (left.xmin() > right.xmin()) ? left.xmin() : right.xmin(), 
+				   (left.xmax() < right.xmax()) ? left.xmax() : right.xmax()
+				   );
 	} 
 	
 	/// \brief construct a 'stub' c2_binary_function, which provides access to the combine() function
 	/// \note Do not evaluate a 'stub' ever.  It is only used so that combine() can be called
-    c2_binary_function() : c2_function<float_type>(), 
-		Left(*((c2_function<float_type> *)0)), Right(*((c2_function<float_type> *)0)) {}
-	
-	const c2_function<float_type> &Left,  &Right;
-	bool leftown, rightown;
-		
+    c2_binary_function(
+	   float_type (*combiner)(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+							  float_type x, float_type *yprime, float_type *yprime2)
+		) : c2_function<float_type>(), combine(combiner), Left(), Right(), stub(true) { }
+	
+public:
+	float_type (* const combine)(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+								 float_type x, float_type *yprime, float_type *yprime2);
+	
+protected:	
+	const c2_const_ptr<float_type> Left,  Right;
+	/// \brief if true, we don't own any functions, we are just a source of a combining function.
+	bool stub;
+	
 };
 
 /// \brief Create a very lightweight method to return a scalar multiple of another function.
-/// 
-template <typename float_type=double> class c2_scaled_function : public c2_plugin_function<float_type> {
+/// \ingroup containers \ingroup arithmetic_functions \ingroup parametric_functions
+///
+/// The factory function c2_factory::scaled_function() creates *new c2_scaled_function_p
+template <typename float_type=double> class c2_scaled_function_p : public c2_function<float_type> {
 public:
 	/// \brief construct the function with its scale factor.
@@ -456,6 +902,6 @@
 	/// \param outer the function to be scaled
 	/// \param scale the multiplicative scale factor
-	c2_scaled_function(const c2_function<float_type> &outer, float_type scale) : 
-		c2_plugin_function<float_type>(outer), yscale(scale) { }
+	c2_scaled_function_p(const c2_function<float_type> &outer, float_type scale) : 
+		c2_function<float_type>(), func(outer), yscale(scale) { }
 	
 	/// \brief set a new scale factor
@@ -475,20 +921,24 @@
 
 protected:
-    c2_scaled_function<float_type>() {} // hide default constructor, since its use is almost always an error.
+    c2_scaled_function_p<float_type>() : func() {} // hide default constructor, since its use is almost always an error.
+	/// \brief the scaling factor for the function
+	const c2_const_ptr<float_type> func;
 	float_type yscale;
 };
 
 /// \brief A container into which any other c2_function can be dropped.
-///
+/// \ingroup containers
 /// It allows a function to be pre-evaluated at a point, and used at multiple places in an expression
 /// efficiently. If it is re-evaluated at the previous point, it returns the remembered values;
 /// otherwise, it re-evauates the function at the new point.
 ///
-template <typename float_type=double> class c2_cached_function : public c2_plugin_function<float_type> {
+/// The factory function c2_factory::cached_function() creates *new c2_cached_function_p
+template <typename float_type=double> class c2_cached_function_p : public c2_function<float_type> {
 public:
 	/// \brief construct the container
 	///
 	/// \param f the function to be cached
-	c2_cached_function(const c2_function<float_type> &f) : c2_plugin_function<float_type>(f), init(false)  {}
+	c2_cached_function_p(const c2_function<float_type> &f) : c2_function<float_type>(),
+		func(f), init(false)  {}
 	/// \copydoc c2_function::value_with_derivatives
 	///
@@ -508,5 +958,6 @@
 
 protected:
-    c2_cached_function() {} // hide default constructor, since its use is almost always an error.
+    c2_cached_function_p() : func() {} // hide default constructor, since its use is almost always an error.
+	const c2_const_ptr<float_type> func;
 	mutable bool init;
 	mutable float_type x0, y, yp, ypp;
@@ -515,9 +966,9 @@
 
 /// \brief Provides function composition (nesting)
-///
+/// \ingroup arithmetic_functions 
 /// This allows evaluation of \a f(g(x)) where \a f and \a g are c2_function objects.
 ///
-/// \note See c2_binary_function for discussion of ownership.
-template <typename float_type=double> class  c2_composed_function : public c2_binary_function<float_type> {
+/// This should always be constructed using \ref compose_operator "c2_function::operator()"
+template <typename float_type=double> class  c2_composed_function_p : public c2_binary_function<float_type> {
 public:
 	
@@ -526,23 +977,24 @@
 	/// \param outer the outer function 
 	/// \param inner the inner function
-	c2_composed_function(const c2_function<float_type> &outer, const c2_function<float_type> &inner) : c2_binary_function<float_type>(outer, inner) {}
+	c2_composed_function_p(const c2_function<float_type> &outer, const c2_function<float_type> &inner) : 
+		c2_binary_function<float_type>(combine, outer, inner) { this->set_domain(inner.xmin(), inner.xmax()); }
 	/// \brief Create a stub just for the combiner to avoid statics. 
-	c2_composed_function() : c2_binary_function<float_type>() {} ;
-
-	virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
-						  float_type x, float_type *yprime, float_type *yprime2) const
+	c2_composed_function_p() : c2_binary_function<float_type>(combine) {} 
+
+	/// \brief execute math necessary to do composition
+	static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+						  float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception)
     {
-		float_type y0, yp0, ypp0, y1, yp1, ypp1;
-		float_type *yp0p, *ypp0p, *yp1p, *ypp1p;
+		float_type y0, y1;
 		if(yprime || yprime2) {
-			yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1;
+			float_type yp0, ypp0, yp1, ypp1;
+			y0=right.value_with_derivatives(x, &yp0, &ypp0);
+			y1=left.value_with_derivatives(y0, &yp1, &ypp1);
+			if(yprime) *yprime=yp1*yp0;
+			if(yprime2) *yprime2=ypp0*yp1+yp0*yp0*ypp1;
 		} else {
-			yp0p=ypp0p=yp1p=ypp1p=0;
+			y0=right(x);
+			y1=left(y0);
 		}
-		
-		y0=right.value_with_derivatives(x, yp0p, ypp0p);
-		y1=left.value_with_derivatives(y0, yp1p, ypp1p);
-		if(yprime) *yprime=yp1*yp0;
-		if(yprime2) *yprime2=ypp0*yp1+yp0*yp0*ypp1;
 		return y1;
 	}	
@@ -550,128 +1002,126 @@
 
 /// \brief create a c2_function which is the sum of two other c2_function objects.
-///
-/// \note See c2_binary_function for discussion of ownership.
-template <typename float_type=double> class c2_sum : public c2_binary_function<float_type> {
+/// \ingroup arithmetic_functions
+/// This should always be constructed using c2_function::operator+()
+template <typename float_type=double> class c2_sum_p : public c2_binary_function<float_type> {
 public:	
 	/// \brief construct \a left + \a right
-    /// \note See c2_binary_function for discussion of ownership.
+ 	/// \param left the left function 
+	/// \param right the right function
+	c2_sum_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {}
+	/// \brief Create a stub just for the combiner to avoid statics. 
+	c2_sum_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics
+
+	/// \brief execute math necessary to do addition
+	static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+						  float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception)
+    {
+		float_type y0, y1;
+		if(yprime || yprime2) {
+			float_type yp0, ypp0, yp1, ypp1;
+			y0=left.value_with_derivatives(x, &yp0, &ypp0);
+			y1=right.value_with_derivatives(x, &yp1, &ypp1);
+			if(yprime) *yprime=yp0+yp1;
+			if(yprime2) *yprime2=ypp0+ypp1;
+		} else {
+			y0=left(x);
+			y1=right(x);
+		}
+		return y0+y1;
+	}
+};
+
+
+/// \brief create a c2_function which is the difference of two other c2_functions.
+/// \ingroup arithmetic_functions
+/// This should always be constructed using c2_function::operator-()
+template <typename float_type=double> class c2_diff_p : public c2_binary_function<float_type> {
+public:	
+	/// \brief construct \a left - \a right
 	/// \param left the left function 
 	/// \param right the right function
-	c2_sum(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}
+	c2_diff_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {}
 	/// \brief Create a stub just for the combiner to avoid statics. 
-	c2_sum() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics
-
-	// function to do derivative arithmetic for sums
-	virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
-						  float_type x, float_type *yprime, float_type *yprime2) const
+	c2_diff_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics
+
+	/// \brief execute math necessary to do subtraction
+	static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+							  float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception)
     {
-		float_type y0, yp0, ypp0, y1, yp1, ypp1;
-		float_type *yp0p, *ypp0p, *yp1p, *ypp1p;
+		float_type y0, y1;
 		if(yprime || yprime2) {
-			yp0p=&yp0; ypp0p=& ypp0; yp1p=&yp1; ypp1p=&ypp1;
+			float_type yp0, ypp0, yp1, ypp1;
+			y0=left.value_with_derivatives(x, &yp0, &ypp0);
+			y1=right.value_with_derivatives(x, &yp1, &ypp1);
+			if(yprime) *yprime=yp0-yp1;
+			if(yprime2) *yprime2=ypp0-ypp1;
 		} else {
-			yp0p=ypp0p=yp1p=ypp1p=0;
+			y0=left(x);
+			y1=right(x);
 		}
-		y0=left.value_with_derivatives(x, yp0p, ypp0p);
-		y1=right.value_with_derivatives(x, yp1p, ypp1p);
-		if(yprime) *yprime=yp0+yp1;
-		if(yprime2) *yprime2=ypp0+ypp1;
-		return y0+y1;
+		return y0-y1;
 	}
 };
 
 
-/// \brief create a c2_function which is the difference of two other c2_functions.
-///
-/// \note See c2_binary_function for discussion of ownership.
-template <typename float_type=double> class c2_diff : public c2_binary_function<float_type> {
+/// \brief create a c2_function which is the product of two other c2_functions.
+/// \ingroup arithmetic_functions
+/// This should always be constructed using c2_function::operator*()
+template <typename float_type=double> class c2_product_p : public c2_binary_function<float_type> {
 public:	
-	/// \brief construct \a left - \a right
-    /// \note See c2_binary_function for discussion of ownership.
+	/// \brief construct \a left * \a right
 	/// \param left the left function 
 	/// \param right the right function
-	c2_diff(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}
+	c2_product_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {}
 	/// \brief Create a stub just for the combiner to avoid statics. 
-	c2_diff() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics
-
-	// function to do derivative arithmetic for diffs
-	virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
-							  float_type x, float_type *yprime, float_type *yprime2) const
+	c2_product_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics
+
+	/// \brief execute math necessary to do multiplication
+	static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+							   float_type x, float_type *yprime, float_type *yprime2)  throw(c2_exception)
     {
-		float_type y0, yp0, ypp0, y1, yp1, ypp1;
-		float_type *yp0p, *ypp0p, *yp1p, *ypp1p;
+		float_type y0, y1;
 		if(yprime || yprime2) {
-			yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1;
+			float_type yp0, ypp0, yp1, ypp1;
+			y0=left.value_with_derivatives(x, &yp0, &ypp0);
+			y1=right.value_with_derivatives(x, &yp1, &ypp1);
+			if(yprime) *yprime=y1*yp0+y0*yp1;
+			if(yprime2) *yprime2=ypp0*y1+2.0*yp0*yp1+ypp1*y0;
 		} else {
-			yp0p=ypp0p=yp1p=ypp1p=0;
+			y0=left(x);
+			y1=right(x);
 		}
-		y0=left.value_with_derivatives(x, yp0p, ypp0p);
-		y1=right.value_with_derivatives(x, yp1p, ypp1p);
-		if(yprime) *yprime=yp0-yp1;
-		if(yprime2) *yprime2=ypp0-ypp1;
-		return y0-y1;
+		return y0*y1;
 	}
 };
 
 
-/// \brief create a c2_function which is the product of two other c2_functions.
-///
-/// \note See c2_binary_function for discussion of ownership.
-template <typename float_type=double> class c2_product : public c2_binary_function<float_type> {
+/// \brief create a c2_function which is the ratio of two other c2_functions.
+/// \ingroup arithmetic_functions
+/// This should always be constructed using c2_function::operator/()
+template <typename float_type=double> class c2_ratio_p : public c2_binary_function<float_type> {
 public:	
-	/// \brief construct \a left * \a right
-    /// \note See c2_binary_function for discussion of ownership.
+	/// \brief construct \a left / \a right
 	/// \param left the left function 
 	/// \param right the right function
-	c2_product(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}
+	c2_ratio_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {}
 	/// \brief Create a stub just for the combiner to avoid statics. 
-	c2_product() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics
-
-	virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
-							   float_type x, float_type *yprime, float_type *yprime2) const
+	c2_ratio_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics
+	
+	/// \brief execute math necessary to do division
+	static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
+							  float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception)
     {
-		float_type y0, yp0, ypp0, y1, yp1, ypp1;
-		float_type *yp0p, *ypp0p, *yp1p, *ypp1p;
+		float_type y0, y1;
 		if(yprime || yprime2) {
-			yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1;
+			float_type yp0, ypp0, yp1, ypp1;
+			y0=left.value_with_derivatives(x, &yp0, &ypp0);
+			y1=right.value_with_derivatives(x, &yp1, &ypp1);
+			if(yprime) *yprime=(yp0*y1-y0*yp1)/(y1*y1); // first deriv of ratio
+			if(yprime2) *yprime2=(y1*y1*ypp0+y0*(2*yp1*yp1-y1*ypp1)-2*y1*yp0*yp1)/(y1*y1*y1); 
 		} else {
-			yp0p=ypp0p=yp1p=ypp1p=0;
+			y0=left(x);
+			y1=right(x);
 		}
-		y0=left.value_with_derivatives(x, yp0p, ypp0p);
-		y1=right.value_with_derivatives(x, yp1p, ypp1p);
-		if(yprime) *yprime=y1*yp0+y0*yp1;
-		if(yprime2) *yprime2=ypp0*y1+2.0*yp0*yp1+ypp1*y0;
-		return y0*y1;
-	}
-};
-
-
-/// \brief create a c2_function which is the ratio of two other c2_functions.
-///
-/// \note See c2_binary_function for discussion of ownership.
-template <typename float_type=double> class c2_ratio : public c2_binary_function<float_type> {
-public:	
-	/// \brief construct \a left / \a right
-    /// \note See c2_binary_function for discussion of ownership.
-	/// \param left the left function 
-	/// \param right the right function
-	c2_ratio(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}
-	/// \brief Create a stub just for the combiner to avoid statics. 
-	c2_ratio() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics
-	
-	virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 
-							  float_type x, float_type *yprime, float_type *yprime2) const
-    {
-		float_type y0, yp0, ypp0, y1, yp1, ypp1;
-		float_type *yp0p, *ypp0p, *yp1p, *ypp1p;
-		if(yprime || yprime2) {
-			yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1;
-		} else {
-			yp0p=ypp0p=yp1p=ypp1p=0;
-		}
-		y0=left.value_with_derivatives(x, yp0p, ypp0p);
-		y1=right.value_with_derivatives(x, yp1p, ypp1p);
-		if(yprime) *yprime=(yp0*y1-y0*yp1)/(y1*y1); // first deriv of ratio
-		if(yprime2) *yprime2=(y1*y1*ypp0+y0*(2*yp1*yp1-y1*ypp1)-2*y1*yp0*yp1)/(y1*y1*y1); // second deriv of ratio 
 		return y0/y1;
 	}
@@ -679,8 +1129,11 @@
 };
 
-/// \brief a c2_function which is constant : can do interpolating_function  f2=f1 + c2_constant(11.3)
-template <typename float_type> class c2_constant : public c2_function<float_type> {
-public:
-	c2_constant(float_type x=0.0) : c2_function<float_type>(), value(x) {}
+/// \brief a c2_function which is constant 
+/// \ingroup parametric_functions
+///
+/// The factory function c2_factory::constant() creates *new c2_constant_p()
+template <typename float_type> class c2_constant_p : public c2_function<float_type> {
+public:
+	c2_constant_p(float_type x) : c2_function<float_type>(), value(x) {}
 	void reset(float_type val) { value=val; }
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 
@@ -691,7 +1144,206 @@
 };
 
+/// \brief a transformation of a coordinate, including an inverse
+/// \ingroup transforms
+template <typename float_type> class c2_transformation {
+public:
+	/// \brief initialize all our function pointers
+	/// \param transformed true if this function is not the identity
+	/// \param xin input X transform
+	/// \param xinp input X transform derivative
+	/// \param xinpp input X transform second derivative
+	/// \param xout output X transform, which MUST be the inverse of \a xin
+	c2_transformation(bool transformed,
+		   float_type (*xin)(float_type), float_type (*xinp)(float_type), float_type (*xinpp)(float_type), float_type (*xout)(float_type)
+	   ) :
+			fTransformed(transformed), fHasStaticTransforms(true),
+			pIn(xin), pInPrime(xinp), pInDPrime(xinpp), pOut(xout) { }
+
+	/// \brief initialize all our function pointers so that only the (overridden) virtual functions can be called without an error
+	/// \param transformed true if this function is nonlinear
+	c2_transformation(bool transformed) :
+			fTransformed(transformed), fHasStaticTransforms(false),
+			pIn(report_error), pInPrime(report_error), pInDPrime(report_error), pOut(report_error) { }
+	/// \brief the destructor
+	virtual ~c2_transformation() { }
+	/// \brief flag to indicate if this transform is not the identity
+	const bool fTransformed;
+	/// \brief flag to indicate if the static function pointers can be used for efficiency
+	const bool fHasStaticTransforms;
+
+	/// \note the pointers to functions allow highly optimized access when static functions are available.
+	/// They are only used inside value_with_derivatives(), which is assumed to be the most critical routine.
+	/// \brief non-virtual pointer to input X transform
+	float_type (* const pIn)(float_type);
+	/// \brief non-virtual pointer to input X transform derivative
+	float_type (* const pInPrime)(float_type);
+	/// \brief non-virtual pointer to input X transform second derivative
+	float_type (* const pInDPrime)(float_type);
+	/// \brief non-virtual pointer to output X transform 
+	float_type (* const pOut)(float_type);
+	
+	/// \brief virtual input X transform
+	virtual float_type fIn(float_type x) const { return pIn(x); }
+	/// \brief virtual input X transform derivative
+	virtual float_type fInPrime(float_type x) const { return pInPrime(x); }
+	/// \brief virtual input X transform second derivative
+	virtual float_type fInDPrime(float_type x) const { return pInDPrime(x); }
+	/// \brief virtual output X transform 
+	virtual float_type fOut(float_type x) const { return pOut(x); }
+
+protected:
+	/// \brief utility function for unimplemented conversion
+	static float_type report_error(float_type x)  { throw c2_exception("use of improperly constructed axis transform"); return x; }
+	/// \brief utility function f(x)=x useful in axis transforms
+	static float_type ident(float_type x)  { return x; }
+	/// \brief utility function f(x)=1 useful in axis transforms
+	static float_type one(float_type)  { return 1; }
+	/// \brief utility function f(x)=0 useful in axis transforms
+	static float_type zero(float_type)  { return 0; }
+	/// \brief utility function f(x)=1/x useful in axis transforms
+	static float_type recip(float_type x)  { return 1.0/x; }
+	/// \brief utility function f(x)=-1/x**2 useful in axis transforms
+	static float_type recip_prime(float_type x)  { return -1/(x*x); }
+	/// \brief utility function f(x)=2/x**3 useful in axis transforms
+	static float_type recip_prime2(float_type x)  { return 2/(x*x*x); }
+
+};
+
+/// \brief the identity transform
+/// \ingroup transforms
+template <typename float_type> class c2_transformation_linear : public c2_transformation<float_type> {
+public:
+	/// \brief constructor
+	c2_transformation_linear() : c2_transformation<float_type>(false, this->ident, this->one, this->zero, this->ident) { }
+	/// \brief destructor
+	~c2_transformation_linear() { }
+};
+/// \brief log axis transform
+/// \ingroup transforms
+template <typename float_type> class c2_transformation_log : public c2_transformation<float_type> {
+public:
+	/// \brief constructor
+	c2_transformation_log() : c2_transformation<float_type>(true, std::log, this->recip, this->recip_prime, std::exp) { }
+	/// \brief destructor
+	~c2_transformation_log() { }
+};
+/// \brief reciprocal axis transform
+/// \ingroup transforms
+template <typename float_type> class c2_transformation_recip : public c2_transformation<float_type> {
+public:
+	/// \brief constructor
+	c2_transformation_recip() : c2_transformation<float_type>(true, this->recip, this->recip_prime, this->recip_prime2, this->recip) { }
+	/// \brief destructor
+	~c2_transformation_recip() { }
+};
+
+/// \brief a transformation of a function in and out of a coordinate space, using 2 c2_transformations
+///
+/// This class is a container for two axis transforms, but also provides the critical evaluate()
+/// function which converts a result in internal coordinates (with derivatives) into the external representation
+/// \ingroup transforms
+template <typename float_type> 
+	class c2_function_transformation {
+public:
+	/// \brief construct this from two c2_transformation instances
+	/// \param xx the X axis transform
+	/// \param yy the Y axis transform  
+	c2_function_transformation(
+		const c2_transformation<float_type> &xx, const c2_transformation<float_type> &yy) :
+		isIdentity(!(xx.fTransformed || yy.fTransformed)), X(xx), Y(yy) { }
+	/// \brief destructor
+	virtual ~c2_function_transformation() { delete &X; delete &Y; }
+	/// \brief evaluate the transformation from internal coordinates to external coordinates
+	/// \param xraw the value of \a x in external cordinates at which the transform is taking place
+	/// \param y the value of the function in internal coordinates
+	/// \param yp0 the derivative in internal coordinates
+	/// \param ypp0 the second derivative in internal coordinates
+	/// \param [out] yprime pointer to the derivative, or NULL, in external coordinates
+	/// \param [out] yprime2 pointer to the second derivative, or NULL, in external coordinates
+	/// \return the value of the function in external coordinates
+	virtual float_type evaluate(float_type xraw, 
+		float_type y, float_type yp0, float_type ypp0,
+		float_type *yprime, float_type *yprime2) const;
+	/// \brief flag indicating of the transform is the identity, and can be skipped for efficiency
+	const bool isIdentity;
+	/// \brief the X axis transform
+	const c2_transformation<float_type> &X;
+	/// \brief the Y axis transform 
+	const c2_transformation<float_type> &Y;
+};
+
+/// \brief a transformation of a function in and out of lin-lin space
+///
+/// \ingroup transforms
+template <typename float_type> class c2_lin_lin_function_transformation : 
+	public c2_function_transformation<float_type> {
+public:
+	c2_lin_lin_function_transformation() : 
+		c2_function_transformation<float_type>(
+			*new c2_transformation_linear<float_type>, 
+			*new c2_transformation_linear<float_type>
+		) { }
+	virtual ~c2_lin_lin_function_transformation() { }
+};
+
+/// \brief a transformation of a function in and out of log-log space
+///
+/// \ingroup transforms
+template <typename float_type> class c2_log_log_function_transformation : 
+	public c2_function_transformation<float_type> {
+public:
+	c2_log_log_function_transformation() : 
+		c2_function_transformation<float_type>(
+			*new c2_transformation_log<float_type>, 
+			*new c2_transformation_log<float_type>
+		) { }
+	virtual ~c2_log_log_function_transformation() { }
+};
+
+/// \brief a transformation of a function in and out of lin-log space
+///
+/// \ingroup transforms
+template <typename float_type> class c2_lin_log_function_transformation : 
+	public c2_function_transformation<float_type> {
+public:
+	c2_lin_log_function_transformation() : 
+		c2_function_transformation<float_type>(
+			*new c2_transformation_linear<float_type>, 
+			*new c2_transformation_log<float_type>
+		) { }
+	virtual ~c2_lin_log_function_transformation() { }
+};
+
+/// \brief a transformation of a function in and out of log-lin space
+///
+/// \ingroup transforms
+template <typename float_type> class c2_log_lin_function_transformation : 
+	public c2_function_transformation<float_type> {
+public:
+	c2_log_lin_function_transformation() : 
+		c2_function_transformation<float_type>(
+			*new c2_transformation_log<float_type>, 
+			*new c2_transformation_linear<float_type>
+		) { }
+	virtual ~c2_log_lin_function_transformation() { }
+};
+
+/// \brief a transformation of a function in and out of Arrhenuis (1/x vs. log(y)) space
+///
+/// \ingroup transforms
+template <typename float_type> class c2_arrhenius_function_transformation : 
+	public c2_function_transformation<float_type> {
+public:
+	c2_arrhenius_function_transformation() : 
+		c2_function_transformation<float_type>(
+			*new c2_transformation_recip<float_type>, 
+			*new c2_transformation_log<float_type>
+		) { }
+	virtual ~c2_arrhenius_function_transformation() { }
+};
+
 /**
     \brief create a cubic spline interpolation of a set of (x,y) pairs
-
+	\ingroup interpolators
     This is one of the main reasons for c2_function objects to exist.
 
@@ -707,7 +1359,9 @@
     (vanishing second derivative), is created as: \n
     \code 
+	c2_ptr<double> c2p;
+	c2_factory<double> c2;
     std::vector<double> xvals(10), yvals(10); 
     // < fill in xvals and yvals >
-    interpolating_function<double>  myfunc(xvals, yvals);
+    c2p myfunc=c2.interpolating_function().load(xvals, yvals,true,0,true,0);
     // and it can be evaluated at a point for its value only by: 
     double y=myfunc(x); 
@@ -716,11 +1370,23 @@
     double y=myfunc(x,&yprime, &yprime2);
     \endcode
+	
+	The factory function c2_factory::interpolating_function() creates *new interpolating_function_p()
 */
 
-template <typename float_type=double> class interpolating_function  : public c2_function<float_type> {
-public:
-    /// \brief create the most general interpolating_function which defaults to linear-linear space
+template <typename float_type=double> class interpolating_function_p  : public c2_function<float_type> {
+public:
+    /// \brief an empty linear-linear cubic-spline interpolating_function_p
     ///
     /// lots to say here, but see Numerical Recipes for a discussion of cubic splines.
+	///
+	interpolating_function_p() : c2_function<float_type>(), 
+		fTransform(*new  c2_lin_lin_function_transformation<float_type>) { } 
+
+    /// \brief an empty cubic-spline interpolating_function_p with a specific transform
+    ///
+	interpolating_function_p(const c2_function_transformation<float_type> &transform) : c2_function<float_type>(), 
+		fTransform(transform) { } 
+
+    /// \brief do the dirty work of constructing the spline from a function. 
     /// \param x the list of abscissas.  Must be either strictly increasing or strictly decreasing.
 	/// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid.
@@ -730,47 +1396,98 @@
     /// \param upperSlopeNatural if true, set y''(last point)=0, otherwise compute it from \a upperSope
     /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false
-    /// \param inputXConversion a function (not a c2_function) which converts \a x into the internal space. \n
-	/// If this is NULL, use linear space and ignore inputXConversionPrime, inputXConversionDPrime 
-    /// \param inputYConversion a function (not a c2_function) which converts \a y into the internal space. \n
-	/// If this is NULL, use linear space and ignore inputYConversionPrime, inputYConversionDPrime, outputYConversion 
-    /// \param outputYConversion a function (not a c2_function) which converts \a y out of the internal space
-    /// \param inputXConversionPrime the derivative of \a inputXConversion
-    /// \param inputYConversionPrime the derivative of \a inputYConversion
-    /// \param inputXConversionDPrime the second derivative of \a inputXConversion
-    /// \param inputYConversionDPrime the second derivative of \a inputYConversion
-    interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 
-						  bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 
-						  bool upperSlopeNatural=true, float_type upperSlope=0.0,
-						  float_type (*inputXConversion)(float_type)=0, 
-						  float_type (*inputYConversion)(float_type)=0, 
-						  float_type (*outputYConversion)(float_type)=0, 
-						  float_type (*inputXConversionPrime)(float_type)=0, 
-						  float_type (*inputYConversionPrime)(float_type)=0, 
-						  float_type (*inputXConversionDPrime)(float_type)=0, 
-						  float_type (*inputYConversionDPrime)(float_type)=0 
-						   ) throw(c2_exception) : c2_function<float_type>()
-        { init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, 
-               inputXConversion, inputYConversion, outputYConversion,
-               inputXConversionPrime, inputYConversionPrime, 
-               inputXConversionDPrime, inputYConversionDPrime 
-               );
-        }
-	
-    /// \brief copy constructor
-    /// \param rhs interpolating_function  to copy from
-	interpolating_function(const interpolating_function <float_type> &rhs) : c2_function<float_type>(rhs), 
-		Xraw(rhs.Xraw), X(rhs.X), F(rhs.F), y2(rhs.y2),
-		fXin(rhs.fXin), fYin(rhs.fYin), fYout(rhs.fYout), 
-		fXinPrime(rhs.fXinPrime), fYinPrime(rhs.fYinPrime), 
-		fXinDPrime(rhs.fXinDPrime), fYinDPrime(rhs.fYinDPrime) ,
-		xInverted(rhs.xInverted), lastKLow(-1)
-	{	set_sampling_grid_pointer(Xraw); }
-	
-	virtual ~interpolating_function() { } // just to suppress warnings about no virtual destructor
+	/// \param splined if true (default), use cubic spline, if false, use linear interpolation.
+	/// \return the same interpolating function, filled
+	interpolating_function_p<float_type> & load(const std::vector<float_type> &x, const std::vector<float_type> &f, 
+			  bool lowerSlopeNatural, float_type lowerSlope, 
+			  bool upperSlopeNatural, float_type upperSlope, bool splined=true
+	) throw(c2_exception);
+
+    /// \brief do the dirty work of constructing the spline from a function. 
+    /// \param data std::vector of std::pairs of x,y.  Will be sorted into x increasing order in place.
+    /// \param lowerSlopeNatural if true, set y''(first point)=0, otherwise compute it from \a lowerSope
+    /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false
+    /// \param upperSlopeNatural if true, set y''(last point)=0, otherwise compute it from \a upperSope
+    /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false
+	/// \param splined if true (default), use cubic spline, if false, use linear interpolation.
+	/// \return the same interpolating function, filled
+	interpolating_function_p<float_type> & load_pairs(
+			  std::vector<std::pair<float_type, float_type> > &data,  
+			  bool lowerSlopeNatural, float_type lowerSlope, 
+			  bool upperSlopeNatural, float_type upperSlope, bool splined=true
+	) throw(c2_exception);
+
+    /// \brief do the dirty work of constructing the spline from a function.
+    /// \param func a function without any requirement of valid derivatives to sample into an interpolating function.
+	/// Very probably a c2_classic_function.
+    /// \param xmin the lower bound of the region to sample
+    /// \param xmax the upper bound of the region to sample
+	/// \param abs_tol the maximum absolute error permitted when linearly interpolating the points.
+	/// the real error will be much smaller, since this uses cubic splines at the end.
+	/// \param rel_tol the maximum relative error permitted when linearly interpolating the points.
+	/// the real error will be much smaller, since this uses cubic splines at the end.
+    /// \param lowerSlopeNatural if true, set y'(first point) from 3-point parabola, otherwise compute it from \a lowerSope
+    /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false
+    /// \param upperSlopeNatural if true, set y'(last point) from 3-point parabola, otherwise compute it from \a upperSope
+    /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false
+	/// \return the same interpolating function, filled
+	/// \note If the interpolator being filled has a log vertical axis, put the desired relative error in 
+	/// \a abs_tol, and 0 in \a rel_tol since the absolute error on the log of a function is the relative error
+	/// on the function itself. 
+	interpolating_function_p<float_type> &  sample_function(const c2_function<float_type> &func, 
+			  float_type xmin, float_type xmax, float_type abs_tol, float_type rel_tol,
+			  bool lowerSlopeNatural, float_type lowerSlope, 
+			  bool upperSlopeNatural, float_type upperSlope
+			  ) throw(c2_exception);
+	
+
+	/// \brief initialize from a grid of points and a c2_function (un-normalized) to an 
+	/// interpolator which, when evaluated with a uniform random variate on [0,1] returns random numbers
+	/// distributed as the input function.
+	/// \see  \ref random_subsec "Arbitrary random generation"
+	/// inverse_integrated_density starts with a probability density  std::vector, generates the integral, 
+	/// and generates an interpolating_function_p  of the inverse function which, when evaluated using a uniform random on [0,1] returns values
+	/// with a density distribution equal to the input distribution
+	/// If the data are passed in reverse order (large X first), the integral is carried out from the big end.
+	/// \param bincenters the positions at which to sample the function \a binheights
+	/// \param binheights a function which describes the density of the random number distribution to be produced.
+	/// \return an initialized interpolator, which 
+	/// if evaluated randomly with a uniform variate on [0,1] produces numbers
+	/// distributed according to \a binheights
+	interpolating_function_p<float_type> & load_random_generator_function(
+		const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights)
+		throw(c2_exception);
+
+	/// \brief initialize from a grid of points and an std::vector of probability densities (un-normalized) to an
+	/// interpolator which, when evaluated with a uniform random variate on [0,1] returns random numbers
+	/// distributed as the input histogram.
+	/// \see  \ref random_subsec "Arbitrary random generation"
+	/// inverse_integrated_density starts with a probability density  std::vector, generates the integral, 
+	/// and generates an interpolating_function_p  of the inverse function which, when evaluated using a uniform random on [0,1] returns values
+	/// with a density distribution equal to the input distribution
+	/// If the data are passed in reverse order (large X first), the integral is carried out from the big end.
+	/// \param bins if \a bins .size()==\a binheights .size(), the centers of the bins.  \n
+	/// if \a bins .size()==\a binheights .size()+1, the edges of the bins
+	/// \param binheights a vector which describes the density of the random number distribution to be produced.
+	/// Note density... the numbers in the bins are not counts, but counts/unit bin width.
+	/// \return an initialized interpolator, which 
+	/// if evaluated randomly with a uniform variate on [0,1] produces numbers
+	/// distributed according to \a binheights
+	interpolating_function_p<float_type> & load_random_generator_bins(
+		const std::vector<float_type> &bins, const std::vector<float_type> &binheights)
+		throw(c2_exception);
+	
+	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception);
+	
+	/// \brief destructor
+	virtual ~interpolating_function_p() { delete &fTransform; } 
+	
+	/// \brief create a new, empty interpolating function of this type (virtual constructor)
+	virtual interpolating_function_p<float_type> &clone() const throw(c2_exception)
+	{	return *new interpolating_function_p<float_type>(); }
 	
     /// \brief retrieve copies of the x & y tables from which this was built
     ///
 	/// This is often useful in the creation of new interpolating functions with transformed data.
-	/// The vectorswill have their sizes set correctly on return.
+	/// The vectors will have their sizes set correctly on return.
 	/// \param [in, out] xvals the abscissas 
 	/// \param [in, out] yvals the ordinates
@@ -793,13 +1510,13 @@
 	// preserving the X bounds and mapping functions of the host (left hand) function.
 	
-    /// \brief create a new interpolating_function  which is the \a source 
+    /// \brief create a new interpolating_function_p  which is the \a source 
     /// function applied to every point in the interpolating tables
     ///
     /// This carefully manages the derivative of the composed function at the two ends.
     /// \param source the function to apply
-    /// \return a new interpolating_function  with the same mappings for x and y
-	interpolating_function <float_type> & unary_operator(const c2_function<float_type> &source) const;
-
-    /// \brief create a new interpolating_function  which is the parent interpolating_function  
+    /// \return a new interpolating_function_p  with the same mappings for x and y
+	interpolating_function_p <float_type> & unary_operator(const c2_function<float_type> &source) const;
+
+    /// \brief create a new interpolating_function_p  which is the parent interpolating_function_p  
     /// combined with \a rhs using \a combiner at every point in the interpolating tables
     ///
@@ -807,248 +1524,131 @@
     /// \param rhs the function to apply
     /// \param combining_stub a function which defines which binary operation to use.
-    /// \return a new interpolating_function  with the same mappings for x and y
-	interpolating_function <float_type> & binary_operator(const c2_function<float_type> &rhs,
-           c2_binary_function<float_type> *combining_stub
+    /// \return a new interpolating_function_p  with the same mappings for x and y
+	interpolating_function_p <float_type> & binary_operator(const c2_function<float_type> &rhs,
+           const c2_binary_function<float_type> *combining_stub
            ) const;
-	
-	// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	// can be upcast back to a c2_function to produce unprocessed binaries.
-
-	/// \brief produce a newly resampled interpolating_function  which is the specified sum.
+	/// \brief produce a newly resampled interpolating_function_p  which is the specified sum.
     /// \param rhs the function to add, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-    interpolating_function <float_type> & operator + (const c2_function<float_type> &rhs) const { 
-		return binary_operator(rhs, new c2_sum<float_type>()); }
-	/// \brief produce a newly resampled interpolating_function  which is the specified difference.
+    /// \return a new interpolating_function_p 
+    interpolating_function_p <float_type> & add_pointwise (const c2_function<float_type> &rhs) const { 
+		return binary_operator(rhs, new c2_sum_p<float_type>()); }
+	/// \brief produce a newly resampled interpolating_function_p  which is the specified difference.
     /// \param rhs the function to subtract, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-	interpolating_function <float_type> & operator - (const c2_function<float_type> &rhs) const {
-		return binary_operator(rhs, new c2_diff<float_type>()); }
-	/// \brief produce a newly resampled interpolating_function  which is the specified product.
+    /// \return a new interpolating_function_p 
+	interpolating_function_p <float_type> & subtract_pointwise (const c2_function<float_type> &rhs) const {
+		return binary_operator(rhs, new c2_diff_p<float_type>()); }
+	/// \brief produce a newly resampled interpolating_function_p  which is the specified product.
     /// \param rhs the function to multiply, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-	interpolating_function <float_type> & operator * (const c2_function<float_type> &rhs) const { 
-		return binary_operator(rhs, new c2_product<float_type>()); }
-	/// \brief produce a newly resampled interpolating_function  which is the specified ratio.
+    /// \return a new interpolating_function_p 
+	interpolating_function_p <float_type> & multiply_pointwise (const c2_function<float_type> &rhs) const { 
+		return binary_operator(rhs, new c2_product_p<float_type>()); }
+	/// \brief produce a newly resampled interpolating_function_p  which is the specified ratio.
     /// \param rhs the function to divide, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-	interpolating_function <float_type> & operator / (const c2_function<float_type> &rhs) const { 
-		return binary_operator(rhs, new c2_ratio<float_type>()); }
-	/// \brief produce a newly resampled interpolating_function  which is the specified sum.
-    /// \param rhs a constant to add, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-	interpolating_function <float_type> & operator + (float_type rhs) const { return (*this)+c2_constant<float_type>(rhs); }
-	/// \brief produce a newly resampled interpolating_function  which is the specified difference.
-    /// \param rhs a constant to subtract, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-	interpolating_function <float_type> & operator - (float_type rhs) const { return (*this)-c2_constant<float_type>(rhs); }
-	/// \brief produce a newly resampled interpolating_function  which is the specified product.
-    /// \param rhs a constant to multiply, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-	interpolating_function <float_type> & operator * (float_type rhs) const { return (*this)*c2_constant<float_type>(rhs); }
-	/// \brief produce a newly resampled interpolating_function  which is the specified ratio.
-    /// \param rhs a constant to divide, pointwise
-    /// \return a new interpolating_function 
-    /// \note
-	/// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table
-	/// when they are applied.  If this is not desired, these operators are not virtual, so the interpolating_function 
-	/// can be upcast back to a c2_function to produce unprocessed binaries.
-	interpolating_function <float_type> & operator / (float_type rhs) const { return (*this)/c2_constant<float_type>(rhs); }
-        
-	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception);
-	
-	/// \brief move value & derivatives into our internal coordinates (use splint to go the other way!)
-    /// \note why?
-	void localize_derivatives(float_type xraw, float_type y, float_type yprime, float_type yprime2, float_type *y0, float_type *yp0, float_type *ypp0) const;
-	
-protected:
-		
-	interpolating_function() : c2_function<float_type>() { } // default constructor is never used, prevent accidents by protecting it.
-    
-    /// \brief do the dirty work of constructing the spline.  See interpolating_function  constructor for details.
-	void init(const std::vector<float_type> &, const std::vector<float_type> &, 
+    /// \return a new interpolating_function_p 
+	interpolating_function_p <float_type> & divide_pointwise (const c2_function<float_type> &rhs) const { 
+		return binary_operator(rhs, new c2_ratio_p<float_type>()); }
+    /// \brief copy data from another interpolating function.  This only makes sense if the source
+	/// function has the same transforms as the destination.
+    /// \param rhs interpolating_function_p  to copy from
+	void clone_data(const interpolating_function_p <float_type> &rhs) {
+		Xraw=rhs.Xraw; X=rhs.X; F=rhs.F; y2=rhs.y2;
+		set_sampling_grid_pointer(Xraw);
+	}
+
+	const c2_function_transformation<float_type> &fTransform;
+	
+protected:    
+    /// \brief create the spline coefficients
+	void spline(
 			  bool lowerSlopeNatural, float_type lowerSlope, 
-			  bool upperSlopeNatural, float_type upperSlope,
-			  float_type (*inputXConversion)(float_type)=0, 
-			  float_type (*inputXConversionPrime)(float_type)=0, 
-			  float_type (*inputXConversionDPrime)(float_type)=0, 
-			  float_type (*inputYConversion)(float_type)=0, 
-			  float_type (*inputYConversionPrime)(float_type)=0, 
-			  float_type (*inputYConversionDPrime)(float_type)=0, 
-			  float_type (*outputYConversion)(float_type)=0
-			  ) throw(c2_exception) ;
+			  bool upperSlopeNatural, float_type upperSlope
+			  ) throw(c2_exception);
+
+	// This is for sorting the data. It must be static if it's going to be a class member.
+	static bool comp_pair(std::pair<float_type,float_type> const &i, std::pair<float_type,float_type> const &j) {return i.first<j.first;}
 
     std::vector<float_type> Xraw, X, F, y2;
-	
-	float_type (*fXin)(float_type), (*fYin)(float_type), (*fYout)(float_type);
-	float_type (*fXinPrime)(float_type), (*fYinPrime)(float_type);
-	float_type (*fXinDPrime)(float_type), (*fYinDPrime)(float_type);
-	
-	int xInverted;
-    mutable int lastKLow;
-};
-
-/// \brief An interpolatingFunction with X transformed into log space.  
-///
+	c2_const_ptr<float_type> sampler_function;
+	bool xInverted;
+    mutable size_t lastKLow;
+};
+
+/// \brief A spline with X transformed into log space.  
+/// \ingroup interpolators
 /// Most useful for functions looking like y=log(x) or any other function with a huge X dynamic range,
 /// and a slowly varying Y.
-template <typename float_type=double> class log_lin_interpolating_function : public interpolating_function <float_type> {
-public:
-    /// \brief Construct the function.
-    /// \param x the list of abscissas.  Must be either strictly increasing or strictly decreasing.
-	/// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid.
-    /// \param f the list of function values.
-    /// \param lowerSlopeNatural if true, set y''(first point)=0 in LogLin space, otherwise compute it from \a lowerSope
-    /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false
-    /// \param upperSlopeNatural if true, set y''(last point)=0 in LogLin space, otherwise compute it from \a upperSope
-    /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false
-    log_lin_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 
-								bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 
-								bool upperSlopeNatural=true, float_type upperSlope=0.0);
-protected:
-	log_lin_interpolating_function() {} // do not allow naked construction... it is usually an accident.
-};
-
-
-/// \brief An interpolatingFunction with Y transformed into log space.  
-///
+///
+///	The factory function c2_factory::log_lin_interpolating_function() creates *new log_lin_interpolating_function_p()
+template <typename float_type=double> class log_lin_interpolating_function_p : public interpolating_function_p <float_type> {
+public:
+    /// \brief an empty log-linear cubic-spline interpolating_function_p
+    ///
+	log_lin_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_log_lin_function_transformation<float_type>)
+		{ }
+	/// \brief create a new, empty interpolating function of this type (virtual constructor)
+	virtual interpolating_function_p<float_type> &clone() const throw(c2_exception)
+		{	return *new log_lin_interpolating_function_p<float_type>(); }
+};
+
+
+/// \brief A spline with Y transformed into log space.  
+/// \ingroup interpolators
 /// Most useful for functions looking like y=exp(x)
-template <typename float_type=double> class lin_log_interpolating_function : public interpolating_function <float_type> {
-public:
-    /// \brief Construct the function.
-    /// \param x the list of abscissas.  Must be either strictly increasing or strictly decreasing.
-	/// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid.
-    /// \param f the list of function values.
-    /// \param lowerSlopeNatural if true, set y''(first point)=0 in LinLog space, otherwise compute it from \a lowerSope
-    /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false
-    /// \param upperSlopeNatural if true, set y''(last point)=0 in LinLog space, otherwise compute it from \a upperSope
-    /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false
-    lin_log_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 
-								bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 
-								bool upperSlopeNatural=true, float_type upperSlope=0.0);
-protected:
-	lin_log_interpolating_function() {} // do not allow naked construction... it is usually an accident.
-};
-
-
-/// \brief An interpolatingFunction with X and Y transformed into log space.  
-///
+///
+///	The factory function c2_factory::lin_log_interpolating_function() creates *new lin_log_interpolating_function_p()
+template <typename float_type=double> class lin_log_interpolating_function_p : public interpolating_function_p <float_type> {
+public:
+    /// \brief an empty linear-log cubic-spline interpolating_function_p
+    ///
+	lin_log_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_lin_log_function_transformation<float_type>)
+		{ } 
+	/// \brief create a new, empty interpolating function of this type (virtual constructor)
+	virtual interpolating_function_p<float_type> &clone() const throw(c2_exception)
+		{	return *new lin_log_interpolating_function_p<float_type>(); }
+};
+
+
+/// \brief A spline with X and Y transformed into log space.  
+/// \ingroup interpolators
 /// Most useful for functions looking like y=x^n or any other function with a huge X and Y dynamic range.
-template <typename float_type=double> class log_log_interpolating_function : public interpolating_function <float_type> {
-public:
-    /// \brief Construct the function.
-    /// \param x the list of abscissas.  Must be either strictly increasing or strictly decreasing.
-	/// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid.
-    /// \param f the list of function values.
-    /// \param lowerSlopeNatural if true, set y''(first point)=0 in LogLog space, otherwise compute it from \a lowerSope
-    /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false
-    /// \param upperSlopeNatural if true, set y''(last point)=0 in LogLog space, otherwise compute it from \a upperSope
-    /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false
-    log_log_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 
-								bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 
-								bool upperSlopeNatural=true, float_type upperSlope=0.0);
-protected:
-	log_log_interpolating_function() {} // do not allow naked construction... it is usually an accident.
-};
-
-
-/// \brief An interpolating_function  with X in reciprocal space and Y transformed in log space.  
-///
+///
+///	The factory function c2_factory::log_log_interpolating_function() creates *new log_log_interpolating_function_p()
+template <typename float_type=double> class log_log_interpolating_function_p : public interpolating_function_p <float_type> {
+public:	
+    /// \brief an empty log-log cubic-spline interpolating_function_p
+    ///
+	log_log_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_log_log_function_transformation<float_type>)
+		{ } 
+	/// \brief create a new, empty interpolating function of this type (virtual constructor)
+	virtual interpolating_function_p<float_type> &clone() const throw(c2_exception)
+	{	return *new log_log_interpolating_function_p<float_type>(); }
+};
+
+
+/// \brief A spline with X in reciprocal space and Y transformed in log space.  
+/// \ingroup interpolators
 /// Most useful for thermodynamic types of data where Y is roughly A*exp(-B/x). 
 /// Typical examples are reaction rate data, and thermistor calibration data.
-template <typename float_type=double> class arrhenius_interpolating_function : public interpolating_function <float_type> {
-public:
-    /// \brief Construct the function.
-    /// \param x the list of abscissas.  Must be either strictly increasing or strictly decreasing.
-	/// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid.
-    /// \param f the list of function values.
-    /// \param lowerSlopeNatural if true, set y''(first point)=0 in Arrhenius space, otherwise compute it from \a lowerSope
-    /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false
-    /// \param upperSlopeNatural if true, set y''(last point)=0 in Arrhenius space, otherwise compute it from \a upperSope
-    /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false
-    arrhenius_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 
-								bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 
-								bool upperSlopeNatural=true, float_type upperSlope=0.0);
-protected:
-	arrhenius_interpolating_function() {} // do not allow naked construction... it is usually an accident.
-};
-
-/**
- \brief create a linear-linear interpolating grid with both x & y set to 
- (xmin, xmin+dx, ... xmin + (count-1)*dx )
-
- very useful for transformaiton with other functions e.g. 
- \code
- f=c2_sin<double>::sin(LinearInterpolatingGrid(-0.1,0.1, 65)) 
- \endcode
- creates a spline table of sin(x) slightly beyond the first period
- \param xmin the starting point for the grid
- \param dx the step size for the grid
- \param count the number of points in the  grid
- \return an identity interpolating_function  with the requested grid 
- */
-template <typename float_type> interpolating_function <float_type> &linear_interpolating_grid(float_type xmin, float_type dx, int count) {
-	std::vector<float_type> x(count);
-	for(int i=0; i<count; i++) x[i]=xmin + i * dx;
-	return *new interpolating_function <float_type>(x,x);
-}
-
-/**
- \brief create a log-log interpolating grid with both x & y set to 
- (xmin, xmin*dx, ... xmin * dx^(count-1) )
-
- very useful for transformaiton with other functions e.g. 
- \code
- f=c2_log<double>::log(LogLogInterpolatingGrid(2, 1.1, 65)) 
- \endcode
- creates a spline table of log(x)
- \param xmin the starting point for the grid
- \param dx the ratio between points
- \param count the number of points in the  grid
- \return an identity log_log_interpolating_function with the requested grid 
-*/
-template <typename float_type> log_log_interpolating_function <float_type> &log_log_interpolating_grid(float_type xmin, float_type dx, int count) {
-	std::vector<float_type> x(count);
-	x[0]=xmin;
-	for(int i=1; i<count; i++) x[i]=dx*x[i-1];
-	return *new log_log_interpolating_function<float_type>(x,x);
-}
+///
+///	The factory function c2_factory::arrhenius_interpolating_function() creates *new arrhenius_interpolating_function_p()
+template <typename float_type=double> class arrhenius_interpolating_function_p : public interpolating_function_p <float_type> {
+public:
+    /// \brief an empty arrhenius cubic-spline interpolating_function_p
+    ///
+	arrhenius_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_arrhenius_function_transformation<float_type>)
+		{ } 
+	/// \brief create a new, empty interpolating function of this type (virtual constructor)
+	virtual interpolating_function_p<float_type> &clone() const throw(c2_exception)
+	{	return *new arrhenius_interpolating_function_p<float_type>(); }	
+};
 
 /// \brief compute sin(x) with its derivatives.
-///
-/// Creates a singleton instance c2_sin::sin of itself for convenient access.
-template <typename float_type=double> class c2_sin : public c2_function<float_type> {
-public:
-	/// \brief constructor.  There is alread a singleton c2_sin::sin, which usually suffices.
-	c2_sin() {}
+/// \ingroup math_functions
+///
+/// The factory function c2_factory::sin() creates *new c2_sin_p
+template <typename float_type=double> class c2_sin_p : public c2_function<float_type> {
+public:
+	/// \brief constructor.
+	c2_sin_p() : c2_function<float_type>() {}
 	
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
@@ -1058,29 +1658,29 @@
     /// \param xmin the lower bound for the grid
     /// \param xmax upper bound for the grid
-    /// \return a new sampling grid.
-	virtual std::vector<float_type> &get_sampling_grid(float_type xmin, float_type xmax); 
-    /// \brief the static singleton 
-	static const c2_sin sin;
-};
+    /// \param [in, out] grid the sampling grid.
+	virtual void get_sampling_grid(float_type xmin, float_type xmax,  std::vector<float_type> &grid) const; 
+};
+
 /// \brief compute cos(x) with its derivatives.
-///
-/// Creates a singleton instance c2_cos::cos of itself for convenient access.
-template <typename float_type=double> class c2_cos : public c2_sin<float_type> {
-public:
-	/// \brief constructor.  There is already a singleton c2_cos::cos, which usually suffices.
-	c2_cos() {}
+/// \ingroup math_functions
+///
+/// The factory function c2_factory::cos() creates *new c2_cos_p
+template <typename float_type=double> class c2_cos_p : public c2_sin_p<float_type> {
+public:
+	/// \brief constructor.
+	c2_cos_p() : c2_sin_p<float_type>() {}
 	
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
 	{ float_type q=std::cos(x); if(yprime) *yprime=-std::sin(x); if(yprime2) *yprime2=-q; return q; }	
-    /// \brief the static singleton 
-	static const c2_cos cos;
-};
+};
+
 /// \brief compute tan(x) with its derivatives.
-///
-/// Creates a singleton instance c2_tan::tan of itself for convenient access.
-template <typename float_type=double> class c2_tan : public c2_function<float_type> {
-public:
-	/// \brief constructor.  There is already a singleton c2_tan::tan, which usually suffices.
-	c2_tan() {}
+/// \ingroup math_functions
+///
+/// The factory function c2_factory::tan() creates *new c2_tan_p
+template <typename float_type=double> class c2_tan_p : public c2_function<float_type> {
+public:
+	/// \brief constructor.
+	c2_tan_p() : c2_function<float_type>() {}
 	
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
@@ -1092,53 +1692,53 @@
 		return t; 
 	}	
-    /// \brief the static singleton 
-	static const c2_tan tan;
-};
+};
+
 /// \brief compute log(x) with its derivatives.
-///
-/// Creates a singleton instance c2_log::log of itself for convenient access.
-template <typename float_type=double> class c2_log : public c2_function<float_type> {
-public:
-	/// \brief constructor.  There is already a singleton c2_log::log, which usually suffices.
-	c2_log() {}
+/// \ingroup math_functions
+///
+/// The factory function c2_factory::log() creates *new c2_log_p
+template <typename float_type=double> class c2_log_p : public c2_function<float_type> {
+public:
+	/// \brief constructor.
+	c2_log_p() : c2_function<float_type>() {}
 
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
 	{ if(yprime) *yprime=1.0/x; if(yprime2) *yprime2=-1.0/(x*x); return std::log(x); }	
-    /// \brief the static singleton 
-	static const c2_log log;
-};
+};
+
 /// \brief compute exp(x) with its derivatives.
-///
-/// Creates a singleton instance c2_exp::exp of itself for convenient access.
-template <typename float_type=double>  class c2_exp : public c2_function<float_type> {
-public:
-	/// \brief constructor.  There is already a singleton c2_exp::exp, which usually suffices.
-	c2_exp() {}
+/// \ingroup math_functions
+///
+/// The factory function c2_factory::exp() creates *new c2_exp_p
+template <typename float_type=double>  class c2_exp_p : public c2_function<float_type> {
+public:
+	/// \brief constructor.
+	c2_exp_p() : c2_function<float_type>() {}
 
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
 	{ float_type q=std::exp(x); if(yprime) *yprime=q; if(yprime2) *yprime2=q; return q; }
-    /// \ brief the static singleton 
-	static const c2_exp exp;
-};
+};
+
 /// \brief compute sqrt(x) with its derivatives.
-///
-/// Creates a singleton instance c2_sqrt::sqrt of itself for convenient access.
-template <typename float_type=double> class c2_sqrt : public c2_function<float_type> {
-public:
-	/// \brief constructor.  There is already a singleton c2_sqrt::sqrt, which usually suffices.
-	c2_sqrt() {}
+/// \ingroup math_functions
+///
+/// The factory function c2_factory::sqrt() creates *new c2_sqrt_p()
+template <typename float_type=double> class c2_sqrt_p : public c2_function<float_type> {
+public:
+	/// \brief constructor.
+	c2_sqrt_p() : c2_function<float_type>() {}
 	
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
 	{ float_type q=std::sqrt(x); if(yprime) *yprime=0.5/q; if(yprime2) *yprime2=-0.25/(x*q); return q; }
-    /// \brief the static singleton 
-	static const c2_sqrt sqrt;
-};
+};
+
 /// \brief compute scale/x with its derivatives.
-///
-/// Creates a singleton instance c2_recip:recip of itself for convenient access.
-template <typename float_type=double> class c2_recip : public c2_function<float_type> {
-public:
-	/// \brief constructor.  There is already a singleton c2_recip::recip, which usually suffices.
-	c2_recip(float_type scale) : rscale(scale) {}
+/// \ingroup parametric_functions
+///
+/// The factory function c2_factory::recip() creates *new c2_recip_p
+template <typename float_type=double> class c2_recip_p : public c2_function<float_type> {
+public:
+	/// \brief constructor.
+	c2_recip_p(float_type scale) : c2_function<float_type>(), rscale(scale) {}
 	
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
@@ -1153,34 +1753,33 @@
 	/// \param scale the new numerator
 	void reset(float_type scale) { rscale=scale; } 
-    /// \brief the static singleton 
-	static const c2_recip recip;
 private:
 	float_type rscale;
 };
+
 /// \brief compute x with its derivatives.
-///
-/// Creates a singleton instance c2_identity::identity of itself for convenient access.
-template <typename float_type=double> class c2_identity : public c2_function<float_type> {
-public:
-	/// \brief constructor.  There is already a singleton c2_identity::identity, which usually suffices.
-	c2_identity() {}
+/// \ingroup math_functions
+///
+/// The factory function c2_factory::identity() creates *new c2_identity_p
+template <typename float_type=double> class c2_identity_p : public c2_function<float_type> {
+public:
+	/// \brief constructor.
+	c2_identity_p() : c2_function<float_type>() {}
 	
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
 	{ if(yprime) *yprime=1.0; if(yprime2) *yprime2=0; return x; }
-    /// \brief the static singleton 
-	static const c2_identity identity;
 };
 
 /**
  \brief create a linear mapping of another function 
- 
+ \ingroup parametric_functions
  for example, given a c2_function \a f 
  \code 
- c2_linear<double> L(1.2, 2.0, 3.0);
- c2_composed_function<double> &F=L(f); 
+ c2_function<double> &F=c2_linear<double>(1.2, 2.0, 3.0)(f);
  \endcode
  produces a new c2_function F=2.0+3.0*(\a f - 1.2) 
+ 
+ The factory function c2_factory::linear() creates *new c2_linear_p
 */
-template <typename float_type=double> class c2_linear : public c2_function<float_type> {
+template <typename float_type=double> class c2_linear_p : public c2_function<float_type> {
 public:
     /// \brief Construct the operator f=y0 + slope * (x-x0)
@@ -1188,5 +1787,6 @@
     /// \param y0 the y-intercept i.e. f(x0)
     /// \param slope the slope of the mapping
-	c2_linear(float_type x0, float_type y0, float_type slope) : xint(x0), intercept(y0), m(slope) {}
+	c2_linear_p(float_type x0, float_type y0, float_type slope) : 
+		c2_function<float_type>(), xint(x0), intercept(y0), m(slope) {}
     /// \brief Change the slope and intercepts after construction.
 	/// \param x0 the x offset
@@ -1200,14 +1800,13 @@
 		float_type xint, intercept, m;
 protected:
-		c2_linear() {} // do not allow naked construction... it is usually an accident.
+		c2_linear_p() {} // do not allow naked construction... it is usually an accident.
 };
 
 /**
 \brief create a quadratic mapping of another function 
- 
+ \ingroup parametric_functions
  for example, given a c2_function \a f 
  \code 
- c2_quadratic<double> Q(1.2, 2.0, 3.0, 4.0);
- c2_composed_function<double> &F=Q(f); 
+ c2_function<double> &F=c2_quadratic<double>(1.2, 2.0, 3.0, 4.0)(f);
  \endcode
  produces a new c2_function F=2.0 + 3.0*(f-1.2) + 4.0*(f-1.2)^2 
@@ -1215,6 +1814,7 @@
  note that the parameters are overdetermined, but allows the flexibility of two different representations
 
+ The factory function c2_factory::quadratic() creates *new c2_quadratic_p
  */
-template <typename float_type=double> class c2_quadratic : public c2_function<float_type> {
+template <typename float_type=double> class c2_quadratic_p : public c2_function<float_type> {
 public:
     /// \brief Construct the operator
@@ -1223,6 +1823,7 @@
     /// \param xcoef the scale on the (\a x - \a x0) term
     /// \param x2coef the scale on the (\a x - \a x0)^2 term
-	c2_quadratic(float_type x0, float_type y0, float_type xcoef, float_type x2coef) : intercept(y0), center(x0), a(x2coef), b(xcoef) {}
-    /// Modify the mapping after construction
+	c2_quadratic_p(float_type x0, float_type y0, float_type xcoef, float_type x2coef) : 
+		c2_function<float_type>(), intercept(y0), center(x0), a(x2coef), b(xcoef) {}
+    /// \brief Modify the coefficients after construction
     /// \param x0 the new center around which the powers are computed
     /// \param y0 the new value of the function at \a x = \a x0
@@ -1236,24 +1837,26 @@
 		float_type intercept, center, a, b;
 protected:
-		c2_quadratic() {} // do not allow naked construction... it is usually an accident.
+		c2_quadratic_p() {} // do not allow naked construction... it is usually an accident.
 };
 
 /**
 \brief create a power law mapping of another function 
- 
+ \ingroup parametric_functions
  for example, given a c2_function \a f 
  \code 
- c2_power_law<double> PLaw(1.2, 2.5);
- c2_composed_function<double> &F=PLaw(f); 
+ c2_power_law_p<double> PLaw(1.2, 2.5);
+ c2_composed_function_p<double> &F=PLaw(f); 
  \endcode
  produces a new c2_function F=1.2 * f^2.5 
  
+ The factory function c2_factory::power_law() creates *new c2_power_law_p
  */
-template <typename float_type=double> class c2_power_law : public c2_function<float_type> {
+template <typename float_type=double> class c2_power_law_p : public c2_function<float_type> {
 public:
     /// \brief Construct the operator
     /// \param scale the multipler
     /// \param power the exponent
-	c2_power_law(float_type scale, float_type power) : a(scale), b(power) {}
+	c2_power_law_p(float_type scale, float_type power) :
+		c2_function<float_type>(), a(scale), b(power) {}
     /// \brief Modify the mapping after construction
     /// \param scale the new multipler
@@ -1266,10 +1869,10 @@
 		float_type a, b;
 protected:
-		c2_power_law() {} // do not allow naked construction... it is usually an accident.
+		c2_power_law_p() {} // do not allow naked construction... it is usually an accident.
 };
 
 /**
 \brief create the formal inverse function of another function 
- 
+ \ingroup containers
  for example, given a c2_function \a f 
  \code 
@@ -1282,12 +1885,14 @@
  derivatives, too, unlike the case of a simple root-finding inverse.  This means
  it can be integrated (for example) quite efficiently.
- 
- Note that it is a subclass of c2_scaled_function only to manage ownership of another c2_function.
- */
-template <typename float_type=double> class c2_inverse_function : public c2_plugin_function<float_type> {
+
+ \see \ref combined_inversion_hinting_sampling
+
+ The factory function c2_factory::inverse_function() creates *new c2_inverse_function_p
+*/
+template <typename float_type=double> class c2_inverse_function_p : public c2_function<float_type> {
 public:
     /// \brief Construct the operator
     /// \param source the function to be inverted
-	c2_inverse_function(const c2_function<float_type> &source);  
+	c2_inverse_function_p(const c2_function<float_type> &source);  
     virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception);
     
@@ -1301,15 +1906,43 @@
     ///  It is used in value_with_derivatives() to guess where to start the root finder.
     /// \param x the abscissa for which an estimate is needed
-    virtual float_type get_start_hint(float_type x) const { return start_hint; } 
-    
+    virtual float_type get_start_hint(float_type x) const 
+		{ return hinting_function.valid()? hinting_function(x) : start_hint; } 
+
+	/// \brief set or unset the approximate function used to start the root finder
+	/// \anchor set_hinting_function_discussion
+	/// A hinting function is mostly useful if the evaluation of this inverse is
+	/// going to be carried out in very non-local order, so the root finder has to start over 
+	/// for each step.  If most evaluations are going to be made in fairly localized clusters (scanning
+	/// through the function, for example), the default mechanism used (which just remembers the last point)
+	/// is almost certainly faster.
+	/// 
+	/// Typically, the hinting function is likely to be set up by creating the inverse function,
+	/// and then adaptively sampling an interpolating function from it, and then using the result
+	/// to hint it.  Another way, if the parent function is already an interpolating function, is just to create
+	/// a version of the parent with the x & y coordinates reversed.
+	/// 
+	/// \see \ref combined_inversion_hinting_sampling
+	///
+	/// \param hint_func the function that is an approximate inverse of the parent of this inverse_function
+	void set_hinting_function(const c2_function<float_type> *hint_func) 
+		{ hinting_function.set_function(hint_func); }
+    /// \brief set the hinting function from a pointer.
+	/// 
+	/// See \ref set_hinting_function_discussion "discussion"
+	/// \param hint_func the container holding the function
+	void set_hinting_function(const c2_const_ptr<float_type> hint_func) 
+		{ hinting_function=hint_func; }
+	
 protected:
-    c2_inverse_function() {} // do not allow naked construction... it is usually an accident.
-    mutable float_type start_hint;
+	c2_inverse_function_p() {} // do not allow naked construction... it is usually an accident.
+	mutable float_type start_hint;
+	const c2_const_ptr<float_type> func;
+	c2_const_ptr<float_type> hinting_function;
 };
 
 /** 
   \brief
-    An interpolating_function  which is the cumulative integral of a histogram.
-
+    An interpolating_function_p  which is the cumulative integral of a histogram.
+	\ingroup interpolators
     Note than binedges should be one element longer than binheights, since the lower & upper edges are specified. 
     Note that this is a malformed spline, since the second derivatives are all zero, so it has less continuity.
@@ -1318,5 +1951,5 @@
 */
 
-template <typename float_type=double>  class accumulated_histogram : public interpolating_function <float_type> {
+template <typename float_type=double>  class accumulated_histogram : public interpolating_function_p <float_type> {
 public:
     /// \brief Construct the integrated histogram
@@ -1332,79 +1965,50 @@
 
 /**
-  \brief Construct a function useful for generation of random numbers from the given distribution
-  
-  inverse_integrated_density<InterpolatingFunctionFlavor>() starts with a probability density c2_function, generates the integral, 
-  and generates an interpolating_function  which, when evaluated using a uniform random on [0,1] returns values
-  with a density distribution equal to the input distribution
-  If the data are passed in reverse order (large X first), the integral is carried out from the big end.
+	\anchor inverse_integrated_density_bins
+	\brief construct from a grid of points and an std::vector of probability densities (un-normalized)
+	\see  \ref random_subsec "Arbitrary random generation"
+	\ingroup interpolators
+	 inverse_integrated_density starts with a probability density  std::vector, generates the integral, 
+	 and generates an interpolating_function_p  of the inverse function which, when evaluated using a uniform random on [0,1] returns values
+	 with a density distribution equal to the input distribution
+	 If the data are passed in reverse order (large X first), the integral is carried out from the big end.
+	 
+	\param bins if \a bins .size()==\a binheights .size(), the centers of the bins.  \n
+	if \a bins .size()==\a binheights .size()+1, the edges of the bins
+	\param binheights a vector which describes the density of the random number distribution to be produced.
+	Note density... the numbers in the bins are not counts, but counts/unit bin width.
+	\return an interpolating_function_p  of the type requested in the template which,
+	if evaluated randomly with a uniform variate on [0,1] produces numbers
+	distributed according to \a binheights
+*/
+
+template <typename float_type, typename Final> 
+interpolating_function_p<float_type> & inverse_integrated_density_bins(
+		const std::vector<float_type> &bins, const std::vector<float_type> &binheights) 
+		throw(c2_exception);
+
+/**
+\anchor inverse_integrated_density_function
+	\brief construct from a grid of points and a c2_function of probability densities (un-normalized)
+	\see  \ref random_subsec "Arbitrary random generation"
+	\ingroup interpolators 
+ inverse_integrated_density starts with a probability density  std::vector, generates the integral, 
+ and generates an interpolating_function_p  of the inverse function which, when evaluated using a uniform random on [0,1] returns values
+ with a density distribution equal to the input distribution
+ If the data are passed in reverse order (large X first), the integral is carried out from the big end.
  
-  \sa  template <typename Intermediate, typename Final> Final inverse_integrated_density(const std::vector, c2_function &)
- 
-  \param bincenters points at which to sample the c2_function \a binheights
-  \param binheights a c2_function which describes the random number distribution to be produced.
-  \return an interpolating_function  of the type requested in the template which,
-     if evaluated randomly with a uniform variate on [0,1) produces numbers
-     distributed according to \a binheights
-*/
-
-template <typename float_type, typename Final > 
-	Final &inverse_integrated_density(const std::vector<float_type> &bincenters, c2_function<float_type> &binheights)
-{	
-	std::vector<float_type> integral;
-	
-	// integrate from first to last bin in original order, leaving results in integral
-	// ask for relative error of 1e-6 on each bin, with absolute error set to 0 (since we don't know the data scale).
-	float_type sum=binheights.partial_integrals(bincenters, &integral, 0.0, 1e-6); 
-	// the integral vector now has partial integrals... it must be accumulated by summing
-	integral.insert(integral.begin(), 0.0); // integral from start to start is 0
-	float_type scale=1.0/sum;
-	for(size_t i=1; i<integral.size(); i++) integral[i]=integral[i]*scale + integral[i-1];
-	integral.back()=1.0; // force exact value on boundary
-	
-	return  *new Final(integral, bincenters, 
-					   false, 1.0/(scale*binheights(bincenters.front() )), 
-					   false, 1.0/(scale*binheights(bincenters.back() ))
-					   ); // use integral as x axis in inverse function
-}
-
-/**
- \brief Construct a function useful for generation of random numbers from the given distribution
-
- \code
- template <typename Intermediate, typename Final> 
-     Final & inverse_integrated_density(const std::vector &bincenters, const std::vector &binheights) 
- \endcode
- is a variant of \code
- template <typename Final> 
-     Final & inverse_integrated_density(const std::vector &bincenters, c2_function &binheights)
- \endcode
- which takes two std::vectors and generates the intermediate interpolating_function  required for 
- inverse_integrated_density(), and then calls it.
-
- \param bincenters points at which \a binheights are defined
- \param binheights an std::vector which describes the random number distribution to be produced.
- \return an interpolating_function  of the type requested in the template which,
- if evaluated randomly with a uniform variate on [0,1) produces numbers
-  distributed according to \a binheights
-*/
-
-template <typename float_type, typename Intermediate, typename Final> Final
-    &inverse_integrated_density(const std::vector<float_type> &bincenters, const std::vector<float_type> &binheights) 
-{	
-	std::vector<float_type> be(bincenters), bh(binheights);
-	
-	if(be[1] < be[0]) { // reverse data for interpolator if x axis passed in backwards
-		std::reverse(be.begin(), be.end());
-		std::reverse(bh.begin(), bh.end());
-	}
-	
-	Intermediate temp(be, bh); // create a temporary interpolating_function  to integrate
-	Final &result=inverse_integrated_density<Final>(bincenters, temp);
-	
-	return result;
-}
+	\param bincenters the centers of the bins. 
+	\param binheights a c2_function which describes the density of the random number distribution to be produced.
+	\return an interpolating_function_p  of the type requested in the template which,
+	if evaluated randomly with a uniform variate on [0,1] produces numbers
+	distributed according to \a binheights
+ */
+template <typename float_type, typename Final> 
+interpolating_function_p<float_type>  & inverse_integrated_density_function(
+		const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights)
+		throw(c2_exception);
 
 /// \brief create a c2_function which smoothly connects two other c2_functions.
-///
+/// \ingroup parametric_functions
 /// This takes two points and generates a polynomial which matches two c2_function arguments 
 /// at those two points, with two derivatives at each point, and an arbitrary value at the center of the 
@@ -1414,40 +2018,88 @@
 /// of order 5.  If \a auto_center is false, the value \a y1 is used at the midpoint, resulting in a 
 /// polynomial of order 6.
-template <typename float_type=double> class c2_connector_function : public c2_function<float_type> {
+///
+/// This is usually used in conjunction with c2_piecewise_function_p to assemble an apparently seamless 
+/// function from a series of segments. 
+/// \see \ref piecewise_applications_subsec "Sample Applications" and \ref c2_function::adaptively_sample() "Adaptive sampling"
+///
+/// The factory function c2_factory::connector_function() creates *new c2_connector_function_p
+template <typename float_type=double> class c2_connector_function_p : public c2_function<float_type> {
 public:	
-	/// \brief construct the container
-	/// \param f1 the function on the left side to be connected 
+	/// \brief construct the container from two functions
+	/// \param x0 the point at which to match \a f1 and its derivatives
+	/// \param f0 the function on the left side to be connected 
+	/// \param x2 the point at which to match \a f2 and its derivatives
 	/// \param f2 the function on the right side to be connected
-	/// \param x0 the point at which to match \a f1 and its derivatives
-	/// \param x2 the point at which to match \a f2 and its derivatives
 	/// \param auto_center if true, no midpoint value is specified.  If false, match the value \a y1 at the midpoint
 	/// \param y1 the value to match at the midpoint, if \a auto_center is false
-	/// \return a c2_function with domain (\a x0,\a x2) which smoothly connects \a f1 and \a f2
-	c2_connector_function(const c2_function<float_type> &f1, const c2_function<float_type> &f2, float_type x0, float_type x2, 
+	/// \return a c2_function with domain (\a x0,\a x2) which smoothly connects \a f0(x0) and \a f2(x2)
+	c2_connector_function_p(float_type x0, const c2_function<float_type> &f0, float_type x2, const c2_function<float_type> &f2, 
 			bool auto_center, float_type y1);
+	/// \brief construct the container from numerical values
+	/// \param x0 the position of the left edge
+	/// \param y0 the function derivative on the left boundary
+	/// \param yp0 the function second derivative on the left boundary
+	/// \param ypp0 the function value on the left boundary
+	/// \param x2 the position of the right edge
+	/// \param y2 the function derivative on the right boundary
+	/// \param yp2 the function second derivative on the right boundary
+	/// \param ypp2 the function value on the right boundary
+	/// \param auto_center if true, no midpoint value is specified.  If false, match the value \a y1 at the midpoint
+	/// \param y1 the value to match at the midpoint, if \a auto_center is false
+	/// \return a c2_function with domain (\a x0,\a x2) which smoothly connects the points described
+	/// \anchor c2_connector_raw_init_docs
+	c2_connector_function_p(
+		float_type x0, float_type y0, float_type yp0, float_type ypp0, 
+		float_type x2, float_type y2, float_type yp2, float_type ypp2, 
+		bool auto_center, float_type y1);
+	/// \brief construct the container from c2_fblock<float_type> objects
+	/// \param fb0 the left edge
+	/// \param fb2 the right edge
+	/// \param auto_center if true, no midpoint value is specified.  If false, match the value \a y1 at the midpoint
+	/// \param y1 the value to match at the midpoint, if \a auto_center is false
+	/// \return a c2_function with domain (\a fb0.x,\a fb2.x) which smoothly connects \a fb0 and \a fb2
+	c2_connector_function_p(
+		const c2_fblock<float_type> &fb0, 
+		const c2_fblock<float_type> &fb2, 
+		bool auto_center, float_type y1);
+
 	/// \brief destructor
-	virtual ~c2_connector_function();
+	virtual ~c2_connector_function_p();
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw (c2_exception);
 protected:
-	float_type fx1, fhinv, fdx, fy1, fa, fb, fc, fd, fe, ff;
-};
-
-
+	/// \brief fill container numerically
+	void init(
+		const c2_fblock<float_type> &fb0, 
+		const c2_fblock<float_type> &fb2, 
+		bool auto_center, float_type y1);
+
+	float_type fhinv, fy1, fa, fb, fc, fd, fe, ff;
+};
 
 /// \brief create a c2_function which is a piecewise assembly of other c2_functions.
-///
+/// \ingroup containers
 /// The functions must have increasing, non-overlapping domains.  Any empty space
 /// between functions will be filled with a linear interpolation.
+///
+/// \note If you want a smooth connection, instead of the default linear interpolation,
+/// create a c2_connector_function_p to bridge the gap.  The linear interpolation is intended 
+/// to be a barely intelligent bridge, and may never get used by anyone.
+///
 /// \note The creation of the container results in the creation of an explicit sampling grid.  
 /// If this is used with functions with a large domain, or which generate very dense sampling grids,
 /// it could eat a lot of memory.  Do not abuse this by using functions which can generate gigantic grids.
 /// 
-/// See c2_plugin_function for a discussion of how this might be used.
-template <typename float_type=double> class c2_piecewise_function : public c2_function<float_type> {
+/// \see \ref piecewise_applications_subsec "Sample Applications" \n
+/// c2_plugin_function_p page \n
+/// c2_connector_function_p page \n
+/// \ref c2_function::adaptively_sample() "Adaptive sampling"
+///
+/// The factory function c2_factory::piecewise_function() creates *new c2_piecewise_function_p
+template <typename float_type=double> class c2_piecewise_function_p : public c2_function<float_type> {
 public:	
 	/// \brief construct the container
-	c2_piecewise_function();
+	c2_piecewise_function_p();
 	/// \brief destructor
-	virtual ~c2_piecewise_function();
+	virtual ~c2_piecewise_function_p();
 	virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw (c2_exception);
 	/// \brief append a new function to the sequence
@@ -1457,11 +2109,8 @@
 	/// the final function.  If the domain exactly abuts the domain of the previous function, it
 	/// will be directly attached.  If there is a gap, the gap will be filled in by linear interpolation.
-	/// If the function being appended is to be deleted automatically when this container is deleted, set the pass_ownership flag.
 	/// \param func a c2_function with a defined domain to be appended to the collection
-	/// \param pass_ownership if set, \a func will be deleted when the container is destroyed
-	void append_function(c2_function<float_type> &func, bool pass_ownership) throw (c2_exception);
+	void append_function(const c2_function<float_type> &func) throw (c2_exception);
 protected:
-	std::vector<c2_function<float_type> *> functions;
-	std::vector<bool> owns;
+	std::vector<c2_const_ptr<float_type> > functions;
 	mutable int lastKLow;
 };
Index: trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.icc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.icc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.icc	(revision 1230)
@@ -1,2 +1,28 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
 /**
  *  \file 
@@ -7,5 +33,5 @@
  *  \author Copyright 2005 __Vanderbilt University__. All rights reserved.
  *
- *	\version c2_function.cc,v 1.43 2007/11/12 20:22:54 marcus Exp
+ *	\version c2_function.cc,v 1.169 2008/05/22 12:45:19 marcus Exp
  */
 
@@ -22,5 +48,5 @@
 
 template <typename float_type> const std::string c2_function<float_type>::cvs_file_vers() const 
-{ return "c2_function.cc,v 1.43 2007/11/12 20:22:54 marcus Exp"; }
+{ return "c2_function.cc,v 1.169 2008/05/22 12:45:19 marcus Exp"; }
 
 // find a pre-bracketed root of a c2_function, which is a MUCH easier job than general root finding
@@ -33,5 +59,4 @@
 	// find f(x)=value within the brackets, using the guarantees of smoothness associated with a c2_function
 	// can use local f(x)=a*x**2 + b*x + c and solve quadratic to find root, then iterate
-	reset_evaluations();
 	
 	float_type yp, yp2; // we will make unused pointers point here, to save null checks later
@@ -47,22 +72,36 @@
 	float_type c, b;
 	
+	if(!root_info) {
+		root_info=new struct c2_root_info;
+		root_info->inited=false;
+	}
 	// this new logic is to keep track of where we were before, and lower the number of 
 	// function evaluations if we are searching inside the same bracket as before.
 	// Since this root finder has, very often, the bracket of the entire domain of the function,
 	// this makes a big difference, especially to c2_inverse_function
-	if(!rootInitialized || upper_bracket != lastRootUpperX || lower_bracket != lastRootLowerX) {
-		lastRootUpperY=value_with_derivatives(upper_bracket, final_yprime, final_yprime2);
-		increment_evaluations();
-		lastRootUpperX=upper_bracket;
-	
-		lastRootLowerY=value_with_derivatives(lower_bracket, final_yprime, final_yprime2);
-		increment_evaluations();
-		lastRootLowerX=lower_bracket;
-		rootInitialized=true;
-	}
-	
-	float_type clower=lastRootLowerY-value;
-	float_type cupper=lastRootUpperY-value;
-	if(clower*cupper >0) { 
+	if(!root_info->inited || upper_bracket != root_info->upper.x || lower_bracket != root_info->lower.x) {
+		root_info->upper.x=upper_bracket;
+		fill_fblock(root_info->upper);		
+		root_info->lower.x=lower_bracket;
+		fill_fblock(root_info->lower);
+		root_info->inited=true;
+	}
+	
+	float_type clower=root_info->lower.y-value;
+	if(!clower) {
+		*final_yprime=root_info->lower.yp;
+		*final_yprime2=root_info->lower.ypp;
+		return lower_bracket;
+	}
+	
+	float_type cupper=root_info->upper.y-value;
+	if(!cupper) {
+		*final_yprime=root_info->upper.yp;
+		*final_yprime2=root_info->upper.ypp;
+		return upper_bracket;
+	}
+	const float_type lower_sign = (clower < 0) ? -1 : 1;
+	
+	if(lower_sign*cupper >0) { 
 		// argh, no sign change in here!
 		if(error) { *error=1; return 0.0; }
@@ -104,9 +143,13 @@
 	   }
 	   c=value_with_derivatives(root, final_yprime, final_yprime2)-value; // compute initial values
+	   if(c2_isnan(c)) {
+		   bad_x_point=root;
+		   return c; // return the nan if a computation failed
+	   }
 	   b=*final_yprime; // make a local copy for readability
 	   increment_evaluations();
 
 	   // now, close in bracket on whichever side this still brackets
-	   if(c*clower < 0.0) {
+	   if(c*lower_sign < 0.0) {
 		   cupper=c;
 		   upper_bracket=root;
@@ -131,18 +174,22 @@
 
 // the recursive part of the integrator is agressively designed to minimize copying of data... lots of pointers
-template <typename float_type> float_type c2_function<float_type>::integrate_step(c2_integrate_recur &rb) const
-{
-	struct c2_integrate_fblock *fbl[3]={rb.f0, rb.f1, rb.f2}; 
-	struct c2_integrate_fblock f1; // will hold new middle values
-	float_type retvals[2]={0.0,0.0};
-	float_type lr[2];
-
-	// std::cout << "entering with " << rb.f0->x << " " << rb.f1->x << " " << rb.f2->x << std::endl;
-	
-	int depth=rb.depth; // save this from the recursion block
-	float_type abs_tol=rb.abs_tol;  // this is the value we will pass down
-	float_type *rblr=rb.lr; // save pointer to our parent's lr[2] array since it will get trampled in recursion
-	
-	if(!depth) {
+template <typename float_type> float_type c2_function<float_type>::integrate_step(c2_integrate_recur &rb) const throw(c2_exception)
+{
+	std::vector< recur_item > &rb_stack=*rb.rb_stack; // heap-based stack of data for recursion
+	rb_stack.clear();
+
+	recur_item top;
+	top.depth=0; top.done=false; top.f0index=0; top.f2index=0; top.step_sum=0;
+	
+	// push storage for our initial elements
+	rb_stack.push_back(top);
+	rb_stack.back().f1=*rb.f0;
+	rb_stack.back().done=true; // this element will never be evaluated further
+	
+	rb_stack.push_back(top);
+	rb_stack.back().f1=*rb.f1;
+	rb_stack.back().done=true; // this element will never be evaluated further
+		
+	if(!rb.inited) {
 		switch(rb.derivs) {
 			case 0:
@@ -157,57 +204,97 @@
 		
 		rb.extrap2=1.0/(rb.extrap_coef-1.0);
-	}
-	
-	for (int i=0; i<(depth==0?1:2); i++) { // handle left and right intervals, but only left one for depth=0
-		struct c2_integrate_fblock *f0=fbl[i], *f2=fbl[i+1];
-		f1.x=0.5*(f0->x + f2->x); // center of interval
-		float_type dx=f2->x - f0->x;
-		float_type dx2 = 0.5*dx;
-		float_type total;
-		
-		f1.y=value_with_derivatives(f1.x, &(f1.yp), &(f1.ypp));
-		increment_evaluations(); 
-		
+		rb.dx_tolerance=10.0*std::numeric_limits<float_type>::epsilon();
+		rb.abs_tol_min=10.0*std::numeric_limits<float_type>::min();
+		rb.inited=true;
+	}
+	
+	// now, push our first real element
+	top.f0index=0; // left element is stack[0]
+	top.f2index=1; // right element is stack[1]
+	top.abs_tol=rb.abs_tol;
+	rb_stack.push_back(top);
+		
+	while(rb_stack.size() > 2) {
+		recur_item &back=rb_stack.back();
+		if(back.done) {
+			float_type sum=back.step_sum;
+			rb_stack.pop_back();
+			rb_stack.back().step_sum+=sum; // bump our sum up to the parent
+			continue;
+		}
+		back.done=true;
+		
+		c2_fblock<float_type> &f0=rb_stack[back.f0index].f1, &f2=rb_stack[back.f2index].f1; 
+		c2_fblock<float_type> &f1=back.f1; // will hold new middle values
+		size_t f1index=rb_stack.size()-1; // our current offset
+		float_type abs_tol=back.abs_tol;
+		
+		f1.x=0.5*(f0.x + f2.x); // center of interval
+		float_type dx2=0.5*(f2.x - f0.x);
+
 		// check for underflow on step size, which prevents us from achieving specified accuracy. 
-		if(std::abs(dx) < std::abs(f1.x)*rb.rel_tol) {
+		if(std::abs(dx2) < std::abs(f1.x)*rb.dx_tolerance || std::abs(dx2) < rb.abs_tol_min) {
 			std::ostringstream outstr;
-			outstr << "Step size underflow in adaptive_partial_integrals at depth=" << depth << ", x= " << f1.x;
+			outstr << "Step size underflow in adaptive_partial_integrals at depth=" << back.depth << ", x= " << f1.x;
 			throw c2_exception(outstr.str().c_str());
 		}
 		
-		if(!depth) { // top level, total has not been initialized yet
-			switch(rb.derivs) { // create estimate of next lower order for first try
+		fill_fblock(f1);
+		if(c2_isnan(f1.y)) {
+			bad_x_point=f1.x;
+			return f1.y; // can't go any further if a nan has appeared
+		}
+		
+		bool yptrouble=f0.ypbad || f2.ypbad || f1.ypbad;
+		bool ypptrouble=f0.yppbad || f2.yppbad || f1.yppbad;
+		
+		// select the real derivative count based on whether we are at a point where derivatives exist
+		int derivs = std::min(rb.derivs, (yptrouble||ypptrouble)?(yptrouble?0:1):2);
+				
+		if(!back.depth) { // top level, total has not been initialized yet
+			switch(derivs) { // create estimate of next lower order for first try
 				case 0:
-					total=0.5*(f0->y+f2->y)*dx; break;
+					back.previous_estimate=(f0.y+f2.y)*dx2; break;
 				case 1:
-					total=(f0->y+4.0*f1.y+f2->y)*dx/6.0; break;
+					back.previous_estimate=(f0.y+4.0*f1.y+f2.y)*dx2/3.0; break;
 				case 2:
-					total=( (14*f0->y + 32*f1.y + 14*f2->y) +  dx * (f0->yp - f2->yp) ) * dx /60.; break;
+					back.previous_estimate=( (14*f0.y + 32*f1.y + 14*f2.y) +  2*dx2 * (f0.yp - f2.yp) ) * dx2 /30.; break;
 				default:
-					total=0.0; // just to suppress missing default warnings
+					back.previous_estimate=0.0; // just to suppress missing default warnings
 			}
-		} else total=rblr[i]; // otherwise, get it from previous level
+		} 
 		
 		float_type left, right;
 		
-		switch(rb.derivs) {
+		// pre-compute constants so all multiplies use a small dynamic range
+		// constants for 0 derivative integrator
+		static const float_type c0c1=5./12., c0c2=8./12., c0c3=-1./12.;
+		// constants for 1 derivative integrator
+		static const float_type c1c1=101./240., c1c2=128./240., c1c3=11./240.,
+			c1c4=13./240., c1c5=-40./240., c1c6=-3./240.;
+		// constants for 2 derivative integrator
+		static const float_type c2c1=169./40320., c2c2=1024./ 40320., c2c3=-41./40320.,
+			c2c4=2727./40320., c2c5=-5040./40320., c2c6=423./40320.,
+			c2c7=17007./40320., c2c8=24576./40320., c2c9=-1263./40320.;
+		
+		switch(derivs) {
 			case 2:
 				// use ninth-order estimates for each side, from full set of all values (!) (Thanks, Mathematica!)
-				left=	( ( (169*f0->ypp + 1024*f1.ypp -  41*f2->ypp)*dx2 + 
-							(2727*f0->yp - 5040*f1.yp +  423*f2->yp) )*dx2 + 
-						  (17007*f0->y + 24576*f1.y -  1263*f2->y) )* (dx2/40320.0);
-				right=	( ( (169*f2->ypp + 1024*f1.ypp -  41*f0->ypp)*dx2 - 
-							(2727*f2->yp - 5040*f1.yp +  423*f0->yp) )*dx2 + 
-						  (17007*f2->y + 24576*f1.y -  1263*f0->y) )* (dx2/40320.0);
-				// std::cout << f0->x << " " << f1.x << " " << f2->x <<  std::endl ;
-				// std::cout << f0->y << " " << f1.y << " " << f2->y << " " << left << " " << right << " " << total << std::endl ;
+				left=	( ( (c2c1*f0.ypp + c2c2*f1.ypp +  c2c3*f2.ypp)*dx2 + 
+							(c2c4*f0.yp + c2c5*f1.yp +  c2c6*f2.yp) )*dx2 + 
+						  (c2c7*f0.y + c2c8*f1.y +  c2c9*f2.y) )* dx2;
+				right=	( ( (c2c1*f2.ypp + c2c2*f1.ypp +  c2c3*f0.ypp)*dx2 - 
+							(c2c4*f2.yp + c2c5*f1.yp +  c2c6*f0.yp) )*dx2 + 
+						  (c2c7*f2.y + c2c8*f1.y +  c2c9*f0.y) )* dx2;
+				// std::cout << f0.x << " " << f1.x << " " << f2.x <<  std::endl ;
+				// std::cout << f0.y << " " << f1.y << " " << f2.y << " " << left << " " << right << " " << total << std::endl ;
 				break;
 			case 1:
-				left= 	( (202*f0->y + 256*f1.y + 22*f2->y) + dx*(13*f0->yp - 40*f1.yp - 3*f2->yp) ) * dx /960.;
-				right= 	( (202*f2->y + 256*f1.y + 22*f0->y) - dx*(13*f2->yp - 40*f1.yp - 3*f0->yp) ) * dx /960.;
+				left= 	( (c1c1*f0.y + c1c2*f1.y + c1c3*f2.y) + dx2*(c1c4*f0.yp + c1c5*f1.yp + c1c6*f2.yp) ) * dx2 ;
+				right= 	( (c1c1*f2.y + c1c2*f1.y + c1c3*f0.y) - dx2*(c1c4*f2.yp + c1c5*f1.yp + c1c6*f0.yp) ) * dx2 ;
 				break;
 			case 0:
-				left=	(5*f0->y + 8*f1.y - f2->y)*dx/24.;
-				right=	(5*f2->y + 8*f1.y - f0->y)*dx/24.;
+				left=	(c0c1*f0.y + c0c2*f1.y + c0c3*f2.y)*dx2;
+				right=	(c0c1*f2.y + c0c2*f1.y + c0c3*f0.y)*dx2;
 				break;
 			default:
@@ -216,32 +303,40 @@
 		}
 		
-		lr[0]= left; // left interval
-		lr[1]= right; // right interval
 		float_type lrsum=left+right;
 
-		float_type eps=std::abs(total-lrsum)*rb.eps_scale; 
-		if(rb.extrapolate) eps*=rb.eps_scale; 
-		
-		if(!rb.adapt || eps < abs_tol ||  eps < std::abs(total)*rb.rel_tol) {
-			if(depth==0 || !rb.extrapolate) retvals[i]=lrsum;
-			else {
-				retvals[i]=(rb.extrap_coef*lrsum - total)*rb.extrap2; 	
-				// std::cout << "extrapolating " << lrsum << " " << total << " " << retvals[i] << std::endl;
-				
-			}
+		bool extrapolate=back.depth && rb.extrapolate && (derivs==rb.derivs); // only extrapolate if no trouble with derivs
+		float_type eps=std::abs(back.previous_estimate-lrsum)*rb.eps_scale; 
+		if(extrapolate) eps*=rb.eps_scale; 
+		
+		if(rb.adapt && eps > abs_tol &&  eps > std::abs(lrsum)*rb.rel_tol) {
+			// tolerance not met, subdivide & recur
+			if(abs_tol > rb.abs_tol_min) abs_tol=abs_tol*0.5; // each half has half the error budget
+			top.abs_tol=abs_tol;
+			top.depth=back.depth+1;
+			
+			// save the last things we need from back before a push happens, in case 
+			// the push causes a reallocation and moves the whole stack.
+			size_t f0index=back.f0index, f2index=back.f2index;
+			
+			top.f0index=f1index; top.f2index=f2index; // insert pointers to right side data into our recursion block
+			top.previous_estimate=right;
+			rb_stack.push_back(top);
+
+			top.f0index=f0index; top.f2index=f1index; // insert pointers to left side data into our recursion block
+			top.previous_estimate=left;
+			rb_stack.push_back(top);
+
+		} else if(extrapolate) {
+			// extrapolation only happens on leaf nodes, where the tolerance was met.
+			back.step_sum+=(rb.extrap_coef*lrsum - back.previous_estimate)*rb.extrap2; 
 		} else {
-			rb.depth=depth+1; // increment depth counter
-			rb.lr=lr;  // point to our left-right values array for recursion
-			rb.abs_tol=abs_tol*0.5; // each half has half the error budget
-			rb.f0=f0; rb.f1=&f1; rb.f2=f2; // insert pointers to data into our recursion block
-			// std::cout << "recurring with " << f0->x << " " << f1.x << " " << f2->x <<  std::endl ;
-			retvals[i]=integrate_step(rb); // and recur
-		}
-	}	
-	return retvals[0]+retvals[1];
+			back.step_sum+=lrsum; 
+		}
+	}
+	return rb_stack.back().step_sum; // last element on the stack holds the sum
 }
 
 template <typename float_type> bool c2_function<float_type>::check_monotonicity(
-	const std::vector<float_type> &data, const char message[]) throw(c2_exception)
+	const std::vector<float_type> &data, const char message[]) const throw(c2_exception)
 {
 	size_t np=data.size();
@@ -269,7 +364,9 @@
 }
 
-template <typename float_type> std::vector<float_type> &c2_function<float_type>::get_sampling_grid(float_type xmin, float_type xmax) const 
-{
-	std::vector<float_type> *result=new std::vector<float_type>;
+template <typename float_type> void c2_function<float_type>::
+	get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const 
+{
+	std::vector<float_type> *result=&grid;
+	result->clear();
 	
 	if( !(sampling_grid) || !(sampling_grid->size()) || (xmax <= sampling_grid->front()) || (xmin >= sampling_grid->back()) ) { 
@@ -313,9 +410,8 @@
 		std::copy(sg.begin()+firstindex, sg.begin()+lastindex+1, result->begin()+initsize);
 		result->back()=xmax;
-		
+
 		//  this is the unrefined sampling grid... now check for very close points on front & back and fix if needed.
 		preen_sampling_grid(result);
 	}
-	return *result;
 }
 
@@ -351,6 +447,6 @@
 }
 
-template <typename float_type> std::vector<float_type> &c2_function<float_type>::
-	refine_sampling_grid(const std::vector<float_type> &grid, size_t refinement) const
+template <typename float_type> void c2_function<float_type>::
+	refine_sampling_grid(std::vector<float_type> &grid, size_t refinement) const
 {
 	size_t np=grid.size();
@@ -358,61 +454,68 @@
 	float_type dxscale=1.0/refinement;
 	
-	std::vector<float_type> *result=new std::vector<float_type>(count);
+	std::vector<float_type> result(count);
 	
 	for(size_t i=0; i<(np-1); i++) {
 		float_type x=grid[i];
 		float_type dx=(grid[i+1]-x)*dxscale;
-		for(size_t j=0; j<refinement; j++, x+=dx) (*result)[i*refinement+j]=x;
-	}
-	(*result)[count-1]=grid.back();
-	return *result;
+		for(size_t j=0; j<refinement; j++, x+=dx) result[i*refinement+j]=x;
+	}
+	result.back()=grid.back();
+	grid=result; // copy the expanded grid back to the input
 }
 
 template <typename float_type> float_type c2_function<float_type>::integral(float_type xmin, float_type xmax, std::vector<float_type> *partials,
-	 float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) const
-{
-	std::vector<float_type> &grid=get_sampling_grid(xmin, xmax);
-	float_type intg=partial_integrals(grid, partials, abs_tol, rel_tol, adapt, extrapolate);
-	delete &grid;
+	 float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) const throw(c2_exception)
+{
+	if(xmin==xmax) {
+		if(partials) partials->clear();
+		return 0.0;
+	}
+	std::vector<float_type> grid;
+	get_sampling_grid(xmin, xmax, grid);
+	float_type intg=partial_integrals(grid, partials, abs_tol, rel_tol, derivs, adapt, extrapolate);
 	return intg;
 }
 
 template <typename float_type> c2_function<float_type> &c2_function<float_type>::normalized_function(float_type xmin, float_type xmax, float_type norm) 
+	const throw(c2_exception)
 {
 	float_type intg=integral(xmin, xmax);
-	return *new c2_scaled_function<float_type>(*this, norm/intg);
-}
-
-template <typename float_type> c2_function<float_type> &c2_function<float_type>::square_normalized_function(float_type xmin, float_type xmax, float_type norm) 
-{
-	c2_quadratic<float_type> q(0., 0., 0., 1.);
-	c2_composed_function<float_type> mesquared(q,*this);
-	
-	std::vector<float_type> grid(get_sampling_grid(xmin, xmax));		
-	float_type intg=mesquared.partial_integrals(grid);
-	
-	return *new c2_scaled_function<float_type>(*this, std::sqrt(norm/intg));
+	return *new c2_scaled_function_p<float_type>(*this, norm/intg);
+}
+
+template <typename float_type> c2_function<float_type> &c2_function<float_type>::square_normalized_function(float_type xmin, float_type xmax, float_type norm)
+	const throw(c2_exception)
+{
+	c2_ptr<float_type> mesquared((*new c2_quadratic_p<float_type>(0., 0., 0., 1.))(*this));
+	
+	std::vector<float_type> grid;
+	get_sampling_grid(xmin, xmax, grid);		
+	float_type intg=mesquared->partial_integrals(grid);
+	
+	return *new c2_scaled_function_p<float_type>(*this, std::sqrt(norm/intg));
 }
 
 template <typename float_type> c2_function<float_type> &c2_function<float_type>::square_normalized_function(
 		float_type xmin, float_type xmax, const c2_function<float_type> &weight, float_type norm) 
-{
-	c2_quadratic<float_type> q(0., 0., 0., 1.);
-	c2_composed_function<float_type> mesquared(q,*this);
-	c2_product<float_type> weighted(mesquared, weight); 
-
-	std::vector<float_type> grid(get_sampling_grid(xmin, xmax));	
-	float_type intg=weighted.partial_integrals(grid);
-
-	return *new c2_scaled_function<float_type>(*this, std::sqrt(norm/intg));
+	const throw(c2_exception)
+{
+	c2_ptr<float_type> weighted((*new c2_quadratic_p<float_type>(0., 0., 0., 1.))(*this) * weight);
+
+	std::vector<float_type> grid;
+	get_sampling_grid(xmin, xmax, grid);	
+	float_type intg=weighted->partial_integrals(grid);
+
+	return *new c2_scaled_function_p<float_type>(*this, std::sqrt(norm/intg));
 }
 
 template <typename float_type> float_type c2_function<float_type>::partial_integrals(
 	std::vector<float_type> xgrid, std::vector<float_type> *partials,
-	float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) const
+	float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) 
+	const throw(c2_exception)
 {
 	int np=xgrid.size();
 	
-	struct c2_integrate_fblock f0, f2;
+	c2_fblock<float_type> f0, f2;
 	struct c2_integrate_recur rb;
 	rb.rel_tol=rel_tol;
@@ -420,6 +523,9 @@
 	rb.adapt=adapt;
 	rb.derivs=derivs;
-	
-	reset_evaluations(); // counter returns with total evaluations needed for this integral
+	std::vector< recur_item > rb_stack;
+	rb_stack.reserve(20); // enough for most operations
+	rb.rb_stack=&rb_stack;
+	rb.inited=false;
+	float_type dx_inv=1.0/std::abs(xgrid.back()-xgrid.front());
 	
 	if(partials) partials->resize(np-1);
@@ -428,6 +534,9 @@
 	
 	f2.x=xgrid[0];
-	f2.y=value_with_derivatives(f2.x, &f2.yp, &f2.ypp);
-	increment_evaluations();
+	fill_fblock(f2);
+	if(c2_isnan(f2.y)) {
+		bad_x_point=f2.x;
+		return f2.y; // can't go any further if a nan has appeared
+	}
 	
 	for(int i=0; i<np-1; i++) {
@@ -435,63 +544,69 @@
 		
 		f2.x=xgrid[i+1];
-		f2.y=value_with_derivatives(f2.x, &f2.yp, &f2.ypp);
-		increment_evaluations();
-		
-		rb.depth=0;
-		rb.abs_tol=abs_tol;
-		rb.f0=&f0; rb.f1=&f2; rb.f2=&f2; // we are really only using the left half for the top level
-		rb.lr=0; // pointer is meaningless; will be filled in in recursion
+		fill_fblock(f2);
+		if(c2_isnan(f2.y)) {
+			bad_x_point=f2.x;
+			return f2.y; // can't go any further if a nan has appeared
+		}
+		
+		rb.abs_tol=abs_tol*std::abs(f2.x-f0.x)*dx_inv; // distribute error tolerance over whole domain
+		rb.f0=&f0; rb.f1=&f2; 
 		float_type ps=integrate_step(rb);
 		sum+=ps;
 		if(partials) (*partials)[i]=ps;
+		if(c2_isnan(ps)) break; // NaN stops integration
 	}
 	return sum;
 }
-
-// declare singleton functions for most common c2_function instances
-#define c2_singleton(X) template <typename float_type> const c2_##X<float_type> c2_##X<float_type>::X=c2_##X();
-c2_singleton(sin)
-c2_singleton(cos)
-c2_singleton(tan)
-c2_singleton(log)
-c2_singleton(exp)
-c2_singleton(sqrt)
-c2_singleton(identity)
-
-// reciprocal is actually parametric (a/x), but make singleton 1/x
-template <typename float_type> const c2_recip<float_type> c2_recip<float_type>::recip=c2_recip(1.0);
-
-#undef c2_singleton
 
 // generate a sampling grid at points separated by dx=5, which is intentionally
 // incommensurate with pi and 2*pi so grid errors are somewhat randomized
-template <typename float_type> std::vector<float_type> &c2_sin<float_type>::get_sampling_grid(float_type xmin, float_type xmax)
-{
-	std::vector<float_type> *result=new std::vector<float_type>;
-	
-	for(; xmin < xmax; xmin+=5.0) result->push_back(xmin);
-	result->push_back(xmax);
-	this->preen_sampling_grid(result);
-	return *result;
-}
-
-template <typename float_type> float_type Identity(float_type x) { return x; } // a useful function
-template <typename float_type> float_type f_one(float_type) { return 1.0; } // the first derivative of identity
-template <typename float_type> float_type f_zero(float_type) { return 0.0; } // the second derivative of identity
+template <typename float_type> void c2_sin_p<float_type>::
+	get_sampling_grid(float_type xmin, float_type xmax,  std::vector<float_type> &grid) const
+{
+	grid.clear();	
+	for(; xmin < xmax; xmin+=5.0) grid.push_back(xmin);
+	grid.push_back(xmax);
+	this->preen_sampling_grid(&grid);
+}
+
+template <typename float_type> float_type c2_function_transformation<float_type>::evaluate(
+		float_type xraw, 
+		float_type y, float_type yp0, float_type ypp0,
+		float_type *yprime, float_type *yprime2) const
+{
+	y=Y.fHasStaticTransforms ? Y.pOut(y) : Y.fOut(y); 
+		
+	if(yprime || yprime2) {
+
+		float_type yp, yp2;
+		if(X.fHasStaticTransforms && Y.fHasStaticTransforms) {
+			float_type fpi=1.0/Y.pInPrime(y);
+			float_type gp=X.pInPrime(xraw);
+			// from Mathematica Dt[InverseFunction[f][y[g[x]]], x]
+			yp=gp*yp0*fpi; // transformed derivative
+			yp2=(gp*gp*ypp0 + X.pInDPrime(xraw)*yp0  - Y.pInDPrime(y)*yp*yp )*fpi; 
+		} else {
+			float_type fpi=1.0/Y.fInPrime(y);
+			float_type gp=X.fInPrime(xraw);
+			// from Mathematica Dt[InverseFunction[f][y[g[x]]], x]
+			yp=gp*yp0*fpi; // transformed derivative
+			yp2=(gp*gp*ypp0 + X.fInDPrime(xraw)*yp0  - Y.fInDPrime(y)*yp*yp )*fpi; 
+		} 
+		if(yprime) *yprime=yp;
+		if(yprime2) *yprime2=yp2;
+	}	
+	return y;
+}
 
 //  The constructor
-template <typename float_type> void interpolating_function<float_type>::init(
+template <typename float_type> interpolating_function_p<float_type> & interpolating_function_p<float_type>::load(
 								const std::vector<float_type> &x, const std::vector<float_type> &f, 
 								bool lowerSlopeNatural, float_type lowerSlope, 
 								bool upperSlopeNatural, float_type upperSlope,
-								float_type (*inputXConversion)(float_type), 
-								float_type (*inputXConversionPrime)(float_type), 
-								float_type (*inputXConversionDPrime)(float_type), 
-								float_type (*inputYConversion)(float_type), 
-								float_type (*inputYConversionPrime)(float_type), 
-								float_type (*inputYConversionDPrime)(float_type), 
-								float_type (*outputYConversion)(float_type)
-					) throw(c2_exception) 
-{
+								bool splined
+		) throw(c2_exception) 
+{
+	c2_ptr<float_type> keepme(*this);
 	X= x;
 	F= f;
@@ -501,13 +616,5 @@
 
 	set_domain(std::min(Xraw.front(), Xraw.back()),std::max(Xraw.front(), Xraw.back()));
-	
-	fXin=inputXConversion;
-	fXinPrime=inputXConversionPrime;
-	fXinDPrime=inputXConversionDPrime;
-	fYin=inputYConversion;
-	fYinPrime=inputYConversionPrime;
-	fYinDPrime=inputYConversionDPrime;
-	fYout=outputYConversion;
-	
+		
 	if(x.size() != f.size()) {
 		throw c2_exception("interpolating_function::init() -- x & y inputs are of different size");
@@ -529,23 +636,13 @@
 	}
 	
-	if(fXin) { // check if X scale is nonlinear, and if so, do transform
-		if(!lowerSlopeNatural) lowerSlope /= fXinPrime(X[0]);
-		if(!upperSlopeNatural) upperSlope /= fXinPrime(X[np-1]);
-		for(size_t i=0; i<np; i++) X[i]=fXin(X[i]);
-	} else {
-		fXin=Identity<float_type>;
-		fXinPrime=f_one<float_type>;
-		fXinDPrime=f_zero<float_type>;
-	}
-	
-	if(inputYConversion) {  // check if Y scale is nonlinear, and if so, do transform
-		if(!lowerSlopeNatural) lowerSlope *= fYinPrime(F[0]);
-		if(!upperSlopeNatural) upperSlope *= fYinPrime(F[np-1]);
-		for(size_t i=0; i<np; i++) F[i]=inputYConversion(F[i]);
-	} else {
-		fYin=Identity<float_type>;
-		fYinPrime=f_one<float_type>;
-		fYinDPrime=f_zero<float_type>;
-		fYout=Identity<float_type>;
+	if(fTransform.X.fTransformed) { // check if X scale is nonlinear, and if so, do transform
+		if(!lowerSlopeNatural) lowerSlope /= fTransform.X.fInPrime(X[0]);
+		if(!upperSlopeNatural) upperSlope /= fTransform.X.fInPrime(X[np-1]);
+		for(size_t i=0; i<np; i++) X[i]=fTransform.X.fIn(X[i]);
+	}	
+	if(fTransform.Y.fTransformed) {  // check if Y scale is nonlinear, and if so, do transform
+		if(!lowerSlopeNatural) lowerSlope *= fTransform.Y.fInPrime(F[0]);
+		if(!upperSlopeNatural) upperSlope *= fTransform.Y.fInPrime(F[np-1]);
+		for(size_t i=0; i<np; i++) F[i]=fTransform.Y.fIn(F[i]);
 	}
 		  
@@ -553,7 +650,126 @@
 		"interpolating_function::init() non-monotonic transformed x input"); 
 	
-	// construct spline tables here.  
+	if(splined) spline(lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope);
+	else y2.assign(np,0.0);
+	
+	lastKLow=0; 
+	keepme.release_for_return();
+	return *this;
+}
+
+/*
+//  The constructor
+template <typename float_type> interpolating_function_p<float_type> & interpolating_function_p<float_type>::load_pairs(
+								std::vector<std::pair<float_type, float_type> > &data, 
+								bool lowerSlopeNatural, float_type lowerSlope, 
+								bool upperSlopeNatural, float_type upperSlope,
+								bool splined
+		) throw(c2_exception) 
+{
+	c2_ptr<float_type> keepme(*this);
+	
+	size_t np=data.size();
+	if(np < 2) {
+		throw c2_exception("interpolating_function::init() -- input < 2 elements ");
+	}
+	
+	// sort into ascending order
+	std::sort(data.begin(), data.end(), comp_pair);	
+	
+	std::vector<float_type> xtmp, ytmp;
+	xtmp.reserve(np);
+	ytmp.reserve(np);
+	for (size_t i=0; i<np; i++) {
+		xtmp.push_back(data[i].first);
+		ytmp.push_back(data[i].second);
+	}
+	this->load(xtmp, ytmp, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, splined);
+	
+	keepme.release_for_return();
+	return *this;
+}
+
+template <typename float_type> interpolating_function_p<float_type> & 
+	interpolating_function_p<float_type>::load_random_generator_function(
+	const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights)
+	throw(c2_exception)
+{	
+	c2_ptr<float_type> keepme(*this);
+
+	std::vector<float_type> integral;
+	c2_const_ptr<float_type> keepit(binheights); // manage function... not really needed here, but always safe.
+	// integrate from first to last bin in original order, leaving results in integral
+	// ask for relative error of 1e-6 on each bin, with absolute error set to 0 (since we don't know the data scale).
+	float_type sum=binheights.partial_integrals(bincenters, &integral, 0.0, 1e-6); 
+	// the integral vector now has partial integrals... it must be accumulated by summing
+	integral.insert(integral.begin(), 0.0); // integral from start to start is 0
+	float_type scale=1.0/sum;
+	for(size_t i=1; i<integral.size(); i++) integral[i]=integral[i]*scale + integral[i-1];
+	integral.back()=1.0; // force exact value on boundary
+	
+	this->load(integral, bincenters, 
+					   false, 1.0/(scale*binheights(bincenters.front() )), 
+					   false, 1.0/(scale*binheights(bincenters.back() ))
+					   ); // use integral as x axis in inverse function
+	keepme.release_for_return();
+	return *this;
+}
+
+template <typename float_type> interpolating_function_p<float_type> & 
+	interpolating_function_p<float_type>::load_random_generator_bins(
+	const std::vector<float_type> &bins, const std::vector<float_type> &binheights)
+	throw(c2_exception)
+{	
+	c2_ptr<float_type> keepme(*this);
+
+	size_t np=binheights.size();
+	std::vector<float_type> integral(np+1), bin_edges(np+1);
+	
+	// compute the integral based on estimates of the bin edges from the given bin centers...
+	// except for bin 0 & final bin, the edge of a bin is halfway between then center of the 
+	// bin and the center of the previous/next bin.
+	// This gives width[n] = (center[n+1]+center[n])/2 - (center[n]+center[n-1])/2 = (center[n+1]-center[n-1])/2
+	// for the edges, assume a bin of width (center[1]-center[0]) or (center[np-1]-center[np-2])
+	// be careful that absolute values are used in case data are reversed.
+
+	if(bins.size() == binheights.size()+1) {
+		bin_edges=bins; // edges array was passed in
+	} else if (bins.size() == binheights.size()) {
+		bin_edges.front()=bins[0] - (bins[1]-bins[0])*0.5; // edge bin
+		for(size_t i=1; i<np; i++) {
+			bin_edges[i]=(bins[i]+bins[i-1])*0.5;
+		}
+		bin_edges.back()=bins[np-1] + (bins[np-1]-bins[np-2])*0.5; // edge bin
+	} else {
+		throw c2_exception("inconsistent bin vectors passed to load_random_generator_bins");
+	}
+	
+	float_type running_sum=0.0;
+	for(size_t i=0; i<np; i++) {
+		integral[i]=running_sum;
+		if(!binheights[i]) throw c2_exception("empty bin passed to load_random_generator_bins");
+		running_sum+=binheights[i]*std::abs(bin_edges[i+1]-bin_edges[i]);
+	}
+	float_type scale=1.0/running_sum;
+	for(size_t i=0; i<np; i++) integral[i]*=scale;
+	integral.back()=1.0; // force exactly correct value on boundary
+	this->load(integral, bin_edges, 
+		  false, 1.0/(scale*binheights.front()), 
+		  false, 1.0/(scale*binheights.back())
+		  ); // use integral as x axis in inverse function
+	keepme.release_for_return();
+	return *this;
+}
+*/
+
+//  The spline table generator
+template <typename float_type> void interpolating_function_p<float_type>::spline(
+	 bool lowerSlopeNatural, float_type lowerSlope, 
+	 bool upperSlopeNatural, float_type upperSlope
+	 ) throw(c2_exception) 
+{
+// construct spline tables here.  
 	// this code is a re-translation of the pythonlabtools spline algorithm from pythonlabtools.sourceforge.net
-	
+	size_t np=X.size();
 	std::vector<float_type> u(np),  dy(np-1), dx(np-1), dxi(np-1), dx2i(np-2), siga(np-2), dydx(np-1);
 	
@@ -596,13 +812,102 @@
 	y2[np-1]=(un-qn*u[np-2])/(qn*y2[np-2]+1.0);
 	for (size_t k=np-1; k != 0; k--) y2[k-1]=y2[k-1]*y2[k]+u[k-1];
-	
-	lastKLow=-1; // flag  new X search required for next evaluation
+}
+
+template <typename float_type> interpolating_function_p<float_type> &interpolating_function_p<float_type>::sample_function(
+			const c2_function<float_type> &func,
+			float_type xmin, float_type xmax, float_type abs_tol, float_type rel_tol, 
+			bool lowerSlopeNatural, float_type lowerSlope, 
+			bool upperSlopeNatural, float_type upperSlope
+ ) throw(c2_exception) 
+{ 
+	c2_ptr<float_type> keepme(*this);
+	
+	const c2_transformation<float_type> &XX=fTransform.X, &YY=fTransform.Y; // shortcuts
+	
+	 // set up our params to look like the samplng function for now
+	 sampler_function=func;
+	 std::vector<float_type> grid;
+	 func.get_sampling_grid(xmin, xmax, grid);
+	 size_t gsize=grid.size();
+	 if(XX.fTransformed) for(size_t i=0; i<gsize; i++) grid[i]=XX.fIn(grid[i]);
+	 set_sampling_grid_pointer(grid);
+	 
+	// float_type xmin1=fXin(xmin), xmax1=fXin(xmax); // bounds in transformed space
+	 // get a list of points needed in transformed space, directly into our tables
+	 this->adaptively_sample(grid.front(), grid.back(), 8*abs_tol, 8*rel_tol, 0, &X, &F);
+	 // clear the sampler function now, since otherwise our value_with_derivatives is broken
+	 sampler_function.unset_function();
+	 
+	 xInverted=check_monotonicity(X, 
+		  "interpolating_function::init() non-monotonic transformed x input"); 
+	 
+	 size_t np=X.size();
+	 
+	 // Xraw is useful in some of the arithmetic operations between interpolating functions
+	 if(!XX.fTransformed) Xraw=X;
+	 else {
+		 Xraw.resize(np);
+		 for (size_t i=1; i<np-1; i++) Xraw[i]=XX.fOut(X[i]);
+		 Xraw.front()=xmin;
+		 Xraw.back()=xmax;
+	 }
+	 	 
+	 bool xraw_rev=check_monotonicity(Xraw, 
+		  "interpolating_function::init() non-monotonic raw x input"); 
+		  // which way does raw X point?  sampling grid MUST be increasing
+	 
+	 if(!xraw_rev) { // we can use pointer to raw X values if they are in the right order
+		 set_sampling_grid_pointer(Xraw); 
+		 // our intial grid of x values is certainly a good guess for 'interesting' points
+	 } else {
+		 set_sampling_grid(Xraw); // make a copy of it, and assure it is in right order
+	 }
+	 
+	 if(XX.fTransformed) { // check if X scale is nonlinear, and if so, do transform
+		 if(!lowerSlopeNatural) lowerSlope /= XX.fInPrime(xmin);
+		 if(!upperSlopeNatural) upperSlope /= XX.fInPrime(xmax);
+	 }	
+	 if(YY.fTransformed) {  // check if Y scale is nonlinear, and if so, do transform
+		 if(!lowerSlopeNatural) lowerSlope *= YY.fInPrime(func(xmin));
+		 if(!upperSlopeNatural) upperSlope *= YY.fInPrime(func(xmax));
+	 }
+	 // note that each of ends has 3 points with two equal gaps, since they were obtained by bisection
+	 // so the step sizes are easy to get
+	 // the 'natural slope' option for sampled functions has a different meaning than 
+	 // for normal splines.  In this case, the derivative is adjusted to make the
+	 // second derivative constant on the last two points at each end
+	 // which is consistent with the error sampling technique we used to get here
+	 if(lowerSlopeNatural) {
+		 float_type hlower=X[1]-X[0];
+		 lowerSlope=0.5*(-F[2]-3*F[0]+4*F[1])/hlower;
+		 lowerSlopeNatural=false; // it's not the usual meaning of natural any more 
+	 }
+	 if(upperSlopeNatural) {
+		 float_type hupper=X[np-1]-X[np-2];
+		 upperSlope=0.5*(F[np-3]+3*F[np-1]-4*F[np-2])/hupper;
+		 upperSlopeNatural=false; // it's not the usual meaning of natural any more 
+	 }
+	 this->set_domain(xmin, xmax);
+	 
+	 spline(lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope);
+	 lastKLow=0;
+	 keepme.release_for_return();
+	 return *this;
 }
 
 //  This function is the reason for this class to exist
 // it computes the interpolated function, and (if requested) its proper first and second derivatives including all coordinate transforms
-template <typename float_type> float_type interpolating_function<float_type>::value_with_derivatives(
+template <typename float_type> float_type interpolating_function_p<float_type>::value_with_derivatives(
 				float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception)
 {
+	if(sampler_function.valid()) { 
+		// if this is non-null, we are sampling data for later, so just return raw function
+		// however, transform it into our sampling space, first.
+		if(yprime) *yprime=0;
+		if(yprime2) *yprime2=0;
+		sampler_function->increment_evaluations();
+		return fTransform.Y.fIn(sampler_function(fTransform.X.fOut(x))); // derivatives are completely undefined
+	}
+					
 	if(x < this->xmin() || x > this->xmax()) {
 		std::ostringstream outstr;
@@ -613,15 +918,19 @@
 	float_type xraw=x;
 	
-	// template here is impossible! if(fXin && fXin != (Identity<float_type>) ) 
-	x=fXin(x); // save time by explicitly testing for identity function here
+	if(fTransform.X.fTransformed) x=fTransform.X.fHasStaticTransforms? 
+		fTransform.X.pIn(x) : fTransform.X.fIn(x); // save time by explicitly testing for identity function here
 	
 	int klo=0, khi=X.size()-1;
+
+	if(khi < 0) throw c2_exception("Uninitialized interpolating function being evaluated");	
+	
+	const float_type *XX=&X[lastKLow]; // make all fast checks short offsets from here
 	
 	if(!xInverted) { // select search depending on whether transformed X is increasing or decreasing
-		if(lastKLow >=0 && (X[lastKLow] <= x) && (X[lastKLow+1] >= x) ) { // already bracketed
+		if((XX[0] <= x) && (XX[1] >= x) ) { // already bracketed
 			klo=lastKLow;
-		} else if(lastKLow >=0 && (X[lastKLow+1] <= x) && (X[lastKLow+2] > x)) { // in next bracket to the right
+		} else if((XX[1] <= x) && (XX[2] >= x)) { // in next bracket to the right
 			klo=lastKLow+1;		
-		} else if(lastKLow > 0 && (X[lastKLow-1] <= x) && (X[lastKLow] > x)) { // in next bracket to the left
+		} else if(lastKLow > 0 && (XX[-1] <= x) && (XX[0] >= x)) { // in next bracket to the left
 			klo=lastKLow-1;		
 		} else { // not bracketed, not close, start over
@@ -634,9 +943,9 @@
 		}
 	} else {
-		if(lastKLow >=0 && (X[lastKLow] >= x) && (X[lastKLow+1] <= x) ) { // already bracketed
+		if((XX[0] >= x) && (XX[1] <= x) ) { // already bracketed
 			klo=lastKLow;
-		} else if(lastKLow >=0 && (X[lastKLow+1] >= x) && (X[lastKLow+2] < x)) { // in next bracket to the right
+		} else if((XX[1] >= x) && (XX[2] <= x)) { // in next bracket to the right
 			klo=lastKLow+1;		
-		} else if(lastKLow > 0 && (X[lastKLow-1] >= x) && (X[lastKLow] < x)) { // in next bracket to the left
+		} else if(lastKLow > 0 && (XX[-1] >= x) && (XX[0] <= x)) { // in next bracket to the left
 			klo=lastKLow-1;		
 		} else { // not bracketed, not close, start over
@@ -659,32 +968,25 @@
 	float_type ylo=F[klo], yhi=F[khi], y2lo=y2[klo], y2hi=y2[khi];
 	float_type y=a*ylo+b*yhi+((a*a*a-a)*y2lo+(b*b*b-b)*y2hi)*(h*h)/6.0;
-	
-	// template here is impossible! if(fYin && fYin != Identity) 
-	y=fYout(y); // save time by explicitly testing for identity function here
+
+	float_type yp0=0; // the derivative in interpolating table coordinates
+	float_type ypp0=0; // second derivative
 	
 	if(yprime || yprime2) {
-		float_type fpi=1.0/fYinPrime(y);
-		float_type gp=fXinPrime(xraw);
-		float_type yp0=(yhi-ylo)/h+((3*b*b-1)*y2hi-(3*a*a-1)*y2lo)*h/6.0; // the derivative in interpolating table coordinates
-		
-		// from Mathematica Dt[InverseFunction[f][y[g[x]]], x]
-		if(yprime) *yprime=gp*yp0*fpi; // the real derivative of the inverse transformed output 
-		if(yprime2) {
-			float_type ypp0=b*y2hi+a*y2lo;
-			float_type fpp=fYinDPrime(y);
-			float_type gpp=fXinDPrime(xraw);
-			// also from Mathematica Dt[InverseFunction[f][y[g[x]]], {x,2}]
-			if(yprime2) *yprime2=(gp*gp*ypp0 + yp0*gpp - gp*gp*yp0*yp0*fpp*fpi*fpi)*fpi; 
-		}
-	}
-	
-	return y;
-}
-
-template <typename float_type> void interpolating_function<float_type>::set_lower_extrapolation(float_type bound) 
+		yp0=(yhi-ylo)/h+((3*b*b-1)*y2hi-(3*a*a-1)*y2lo)*h/6.0; // the derivative in interpolating table coordinates
+		ypp0=b*y2hi+a*y2lo; // second derivative
+	}
+	
+	if(fTransform.isIdentity) {
+		if(yprime) *yprime=yp0;
+		if(yprime2) *yprime2=ypp0;
+		return y;	
+	} else return fTransform.evaluate(xraw, y, yp0, ypp0, yprime, yprime2);
+}
+
+template <typename float_type> void interpolating_function_p<float_type>::set_lower_extrapolation(float_type bound) 
 {
 	int kl = 0 ;
 	int kh=kl+1;
-	float_type xx=fXin(bound);
+	float_type xx=fTransform.X.fIn(bound);
 	float_type h0=X[kh]-X[kl];
 	float_type h1=xx-X[kl];
@@ -702,9 +1004,9 @@
 }
 
-template <typename float_type> void interpolating_function<float_type>::set_upper_extrapolation(float_type bound) 
+template <typename float_type> void interpolating_function_p<float_type>::set_upper_extrapolation(float_type bound) 
 {
 	int kl = X.size()-2 ;
 	int kh=kl+1;
-	float_type xx=fXin(bound);
+	float_type xx=fTransform.X.fIn(bound);
 	float_type h0=X[kh]-X[kl];
 	float_type h1=xx-X[kl];
@@ -721,18 +1023,4 @@
 }
 
-// move derivatives into our internal coordinates (use splint to go the other way!)
-template <typename float_type> void interpolating_function<float_type>::localize_derivatives(
-   float_type xraw, float_type y, float_type yp, float_type ypp, float_type *y0, float_type *yprime, float_type *yprime2) const 
-{
-	float_type fp=fYinPrime(y);
-	float_type gp=fXinPrime(xraw);
-	float_type fpp=fYinDPrime(y);
-	float_type gpp=fXinDPrime(xraw);
-	
-	if(y0) *y0=fYin(y);
-	if(yprime) *yprime=yp*fp/gp; // Mathematica Dt[f[y[InverseFunction[g][x]]], x]
-	if(yprime2) *yprime2=( yp*yp*fpp - fp*yp*gpp/gp + fp*ypp )/(gp*gp) ; // Mathematica Dt[f[y[InverseFunction[g][x]]], {x,2}]
-}
-
 // return a new interpolating_function which is the unary function of an existing interpolating_function
 // can also be used to generate a resampling of another c2_function on a different grid
@@ -740,26 +1028,27 @@
 // and doing b=a.unary_operator(c) where c is a c2_function (probably another interpolating_function)
 
-template <typename float_type> interpolating_function<float_type>& 
-	interpolating_function<float_type>::unary_operator(const c2_function<float_type> &source) const 
+template <typename float_type> interpolating_function_p<float_type>& 
+	interpolating_function_p<float_type>::unary_operator(const c2_function<float_type> &source) const 
 {
 	size_t np=X.size();
 	std::vector<float_type>yv(np);
-	c2_composed_function<float_type> comp(source, *this);
+	c2_ptr<float_type> comp(source(*this));
 	float_type yp0, yp1, ypp;
 	
-	for(size_t i=0; i<np; i++) { 
-		yv[i]=source(fYout(F[i])); // copy pointwise the function of our data values
-	}
-		
-	comp(Xraw.front(), &yp0, &ypp); // get derivative at front
-	comp(Xraw.back(), &yp1, &ypp); // get derivative at back
-	
-	return  *new interpolating_function(Xraw, yv, false, yp0, false, yp1,
-									   fXin, fXinPrime, fXinDPrime,
-									   fYin, fYinPrime, fYinDPrime, fYout);
+	for(size_t i=1; i<np-1; i++) { 
+		yv[i]=source(fTransform.Y.fOut(F[i])); // copy pointwise the function of our data values
+	}
+		
+	yv.front()=comp(Xraw.front(), &yp0, &ypp); // get derivative at front
+	yv.back()= comp(Xraw.back(), &yp1, &ypp); // get derivative at back
+	
+	interpolating_function_p &copy=clone();
+	copy.load(this->Xraw, yv, false, yp0, false, yp1);
+	
+	return copy;
 }
 
 template <typename float_type> void 
-interpolating_function<float_type>::get_data(std::vector<float_type> &xvals, std::vector<float_type> &yvals) const throw()
+interpolating_function_p<float_type>::get_data(std::vector<float_type> &xvals, std::vector<float_type> &yvals) const throw()
 {
 	
@@ -767,88 +1056,34 @@
 	yvals.resize(F.size());
 	
-	for(size_t i=0; i<F.size(); i++) yvals[i]=fYout(F[i]);
-}
-
-template <typename float_type> interpolating_function<float_type> & 
-	interpolating_function<float_type>::binary_operator(const c2_function<float_type> &rhs,
-		c2_binary_function<float_type> *combining_stub) const
+	for(size_t i=0; i<F.size(); i++) yvals[i]=fTransform.Y.fOut(F[i]);
+}
+
+template <typename float_type> interpolating_function_p<float_type> & 
+	interpolating_function_p<float_type>::binary_operator(const c2_function<float_type> &rhs,
+		const c2_binary_function<float_type> *combining_stub) const
 {	
 	size_t np=X.size();	
 	std::vector<float_type> yv(np);
-	c2_constant<float_type> fval;
-	c2_constant<float_type> yval;
+	c2_constant_p<float_type> fval(0);
 	float_type yp0, yp1, ypp;
 	
-	for(size_t i=0; i<np; i++) { 
-		fval.reset(fYout(F[i])); // update the constant function pointwise
-		yval.reset(rhs(Xraw[i])); 
-		yv[i]=(*combining_stub).combine(fval, yval, Xraw[i], (float_type *)0, (float_type *)0); // compute rhs & combine without derivatives
-	}
-	
-	(*combining_stub).combine(*this, rhs, Xraw.front(), &yp0, &ypp); // get derivative at front
-	(*combining_stub).combine(*this, rhs, Xraw.back(),  &yp1, &ypp); // get derivative at back
-
-	delete combining_stub;
-	
-	return  *new interpolating_function(Xraw, yv, false, yp0, false, yp1,
-									   fXin, fXinPrime, fXinDPrime,
-									   fYin, fYinPrime, fYinDPrime, fYout);	
-}
-
-template <typename float_type>  float_type c2_f_logprime(float_type x) { return 1.0/x; } // the derivative of log(x)
-template <typename float_type>  float_type c2_f_logprime2(float_type x) { return -1.0/(x*x); } // the second derivative of log(x)
-
-template <typename float_type> log_lin_interpolating_function<float_type>::log_lin_interpolating_function(
-										const std::vector<float_type> &x, const std::vector<float_type> &f, 
-										bool lowerSlopeNatural, float_type lowerSlope, 
-										bool upperSlopeNatural, float_type upperSlope) 
-										: interpolating_function<float_type>()
-{
-	init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope,
-		 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 0, 0, 0, 0);
-}
-
-template <typename float_type> lin_log_interpolating_function<float_type>::lin_log_interpolating_function(
-										const std::vector<float_type> &x, const std::vector<float_type> &f, 
-										bool lowerSlopeNatural, float_type lowerSlope, 
-										bool upperSlopeNatural, float_type upperSlope)
-										: interpolating_function<float_type>()
-{
-	init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope,
-		 0, 0, 0, 
-		 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 
-		 (float_type (*)(float_type)) (std::exp) );
-}
-
-template <typename float_type> log_log_interpolating_function<float_type>::log_log_interpolating_function(
-										const std::vector<float_type> &x, const std::vector<float_type> &f, 
-										bool lowerSlopeNatural, float_type lowerSlope, 
-										bool upperSlopeNatural, float_type upperSlope) 
-										: interpolating_function<float_type>()
-{
-	init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope,
-		 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 
-		 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 
-		 (float_type (*)(float_type)) (std::exp) );
-}
-
-template <typename float_type> float_type c2_f_recip(float_type x) { return 1.0/x; }
-template <typename float_type> float_type c2_f_recipprime(float_type x) { return -1.0/(x*x); } // the derivative of 1/x
-template <typename float_type> float_type c2_f_recipprime2(float_type x) { return 2.0/(x*x*x); } // the second derivative of 1/x
-
-template <typename float_type> arrhenius_interpolating_function<float_type>::arrhenius_interpolating_function(
-										const std::vector<float_type> &x, const std::vector<float_type> &f, 
-										bool lowerSlopeNatural, float_type lowerSlope, 
-										bool upperSlopeNatural, float_type upperSlope) 
-										: interpolating_function<float_type>()
-{
-	init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope,
-		c2_f_recip, c2_f_recipprime, c2_f_recipprime2, 
-		(float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 
-		(float_type (*)(float_type)) (std::exp) );
-}
-
-template <typename float_type> c2_inverse_function<float_type>::c2_inverse_function(const c2_function<float_type> &source) 
-	: c2_plugin_function<float_type>(source) 
+	c2_const_ptr<float_type> stub(*combining_stub);  // manage ownership
+	
+	for(size_t i=1; i<np-1; i++) { 
+		fval.reset(fTransform.Y.fOut(F[i])); // update the constant function pointwise
+		yv[i]=combining_stub->combine(fval, rhs, Xraw[i], (float_type *)0, (float_type *)0); // compute rhs & combine without derivatives
+	}
+	
+	yv.front()=combining_stub->combine(*this, rhs, Xraw.front(), &yp0, &ypp); // get derivative at front
+	yv.back()= combining_stub->combine(*this, rhs, Xraw.back(),  &yp1, &ypp); // get derivative at back
+	
+	interpolating_function_p &copy=clone();
+	copy.load(this->Xraw, yv, false, yp0, false, yp1);
+	
+	return copy;
+}
+
+template <typename float_type> c2_inverse_function_p<float_type>::c2_inverse_function_p(const c2_function<float_type> &source) 
+	: c2_function<float_type>(), func(source)
 {
 	float_type l=source.xmin();
@@ -864,5 +1099,5 @@
 }
 
-template <typename float_type> float_type c2_inverse_function<float_type>::value_with_derivatives(
+template <typename float_type> float_type c2_inverse_function_p<float_type>::value_with_derivatives(
 					float_type x, float_type *yprime, float_type *yprime2
 			) const throw(c2_exception)
@@ -927,10 +1162,10 @@
 		for(int i=0; i<=np; i++) cum[i]*=m;
 	}
-	if(inverse_function) interpolating_function<float_type>(cum, be); // use cum as x axis in inverse function
-	else interpolating_function<float_type>(be, cum); // else use lower bin edge as x axis
+	if(inverse_function) interpolating_function_p<float_type>(cum, be); // use cum as x axis in inverse function
+	else interpolating_function_p<float_type>(be, cum); // else use lower bin edge as x axis
 	std::fill(this->y2.begin(), this->y2.end(), 0.0); // clear second derivatives, to we are piecewise linear
 }
 
-template <typename float_type> c2_piecewise_function<float_type>::c2_piecewise_function() 
+template <typename float_type> c2_piecewise_function_p<float_type>::c2_piecewise_function_p() 
 : c2_function<float_type>(), lastKLow(-1)
 {
@@ -938,11 +1173,9 @@
 }
 
-template <typename float_type> c2_piecewise_function<float_type>::~c2_piecewise_function() 
-{
-	size_t np=functions.size();
-	for(size_t i=0; i<np; i++) if(owns[i]) delete functions[i];
-}
-
-template <typename float_type> float_type c2_piecewise_function<float_type>::value_with_derivatives(
+template <typename float_type> c2_piecewise_function_p<float_type>::~c2_piecewise_function_p() 
+{
+}
+
+template <typename float_type> float_type c2_piecewise_function_p<float_type>::value_with_derivatives(
 		  float_type x, float_type *yprime, float_type *yprime2
 		  ) const throw(c2_exception)
@@ -974,9 +1207,10 @@
 }
 
-template <typename float_type> void c2_piecewise_function<float_type>::append_function(
-	c2_function<float_type> &func, bool pass_ownership) throw(c2_exception)
-{
+template <typename float_type> void c2_piecewise_function_p<float_type>::append_function(
+	const c2_function<float_type> &func) throw(c2_exception)
+{
+	c2_const_ptr<float_type> keepfunc(func);  //  manage function before we can throw any exceptions
 	if(functions.size()) { // check whether there are any gaps to fill, etc.
-		c2_function<float_type> &tail=*(functions.back());
+		const c2_function<float_type> &tail=functions.back();
 		float_type x0=tail.xmax();
 		float_type x1=func.xmin();
@@ -985,78 +1219,333 @@
 			float_type y0=tail(x0);
 			float_type y1=func(x1);
-			c2_function<float_type> *connector=new c2_linear<float_type>(x0, y0, (y1-y0)/(x1-x0));
-			connector->set_domain(x0,x1);
-			functions.push_back(connector);
-			owns.push_back(true);
+			c2_function<float_type> &connector=*new c2_linear_p<float_type>(x0, y0, (y1-y0)/(x1-x0));
+			connector.set_domain(x0,x1);
+			functions.push_back(c2_const_ptr<float_type>(connector));
 			this->sampling_grid->push_back(x1);
 		} else if(x0>x1) throw c2_exception("function domains not increasing in c2_piecewise_function");
 	}
-	functions.push_back(&func);
-	owns.push_back(pass_ownership);
+	functions.push_back(keepfunc);
 	// extend our domain to include all known functions
 	this->set_domain(functions.front()->xmin(), functions.back()->xmax());
 	// extend our sampling grid with the new function's grid, with the first point dropped to avoid duplicates
-	std::vector<float_type> &newgrid=func.get_sampling_grid(func.xmin(), func.xmax());
+	std::vector<float_type> newgrid;
+	func.get_sampling_grid(func.xmin(), func.xmax(), newgrid);
 	this->sampling_grid->insert(this->sampling_grid->end(), newgrid.begin()+1, newgrid.end());
-	delete &newgrid;
-}
-
-template <typename float_type> c2_connector_function<float_type>::c2_connector_function(
-	const c2_function<float_type> &f1, const c2_function<float_type> &f2, float_type x0, float_type x2, 
+}
+
+template <typename float_type> c2_connector_function_p<float_type>::c2_connector_function_p(
+	float_type x0, const c2_function<float_type> &f0, float_type x2, const c2_function<float_type> &f2, 
 	bool auto_center, float_type y1)
-
-: c2_function<float_type>()
-{
-	float_type y0, yp0, ypp0, y2, yp2, ypp2;
-	fdx=(x2-x0)/2.0;
-	fhinv=1.0/fdx;
-	fx1=(x0+x2)/2.0;
-	
-	y0=f1.value_with_derivatives(x0, &yp0, &ypp0); // get left wall values from conventional computation
-	y2=f2.value_with_derivatives(x2, &yp2, &ypp2); // get right wall values from conventional computation
+	: c2_function<float_type>()
+{
+	c2_const_ptr<float_type> left(f0), right(f2); // make sure if these are unowned, they get deleted
+	c2_fblock<float_type> fb0, fb2;
+	fb0.x=x0;
+	f0.fill_fblock(fb0);
+	fb2.x=x2;
+	f2.fill_fblock(fb2);
+	init(fb0, fb2, auto_center, y1);
+}
+
+template <typename float_type> c2_connector_function_p<float_type>::c2_connector_function_p(
+	float_type x0, float_type y0, float_type yp0, float_type ypp0, 
+	float_type x2, float_type y2, float_type yp2, float_type ypp2, 
+	bool auto_center, float_type y1)
+	: c2_function<float_type>()
+{
+	c2_fblock<float_type> fb0, fb2;
+	fb0.x=x0; fb0.y=y0; fb0.yp=yp0; fb0.ypp=ypp0;
+	fb2.x=x2; fb2.y=y2; fb2.yp=yp2; fb2.ypp=ypp2;	
+	init(fb0, fb2, auto_center, y1);
+}
+
+template <typename float_type> c2_connector_function_p<float_type>::c2_connector_function_p(
+	const c2_fblock<float_type> &fb0,
+	const c2_fblock<float_type> &fb2,
+	bool auto_center, float_type y1)
+	: c2_function<float_type>()
+{
+	init(fb0, fb2, auto_center, y1);
+}
+
+template <typename float_type> void c2_connector_function_p<float_type>::init(
+	const c2_fblock<float_type> &fb0,
+	const c2_fblock<float_type> &fb2,
+	bool auto_center, float_type y1)
+{
+	float_type dx=(fb2.x-fb0.x)/2.0;
+	fhinv=1.0/dx;
 
 	// scale derivs to put function on [-1,1] since mma  solution is done this way
-	yp0*=fdx;
-	yp2*=fdx;
-	ypp0*=fdx*fdx;
-	ypp2*=fdx*fdx;
-	
-	float_type ff0=(8*(y0 + y2) + 5*(yp0 - yp2) + ypp0 + ypp2)/16.0;
+	float_type yp0=fb0.yp*dx;
+	float_type yp2=fb2.yp*dx;
+	float_type ypp0=fb0.ypp*dx*dx;
+	float_type ypp2=fb2.ypp*dx*dx;
+	
+	float_type ff0=(8*(fb0.y + fb2.y) + 5*(yp0 - yp2) + ypp0 + ypp2)*0.0625;
 	if(auto_center) y1=ff0; // forces ff to be 0 if we are auto-centering
 	
-	// y[x_] = y1 + x (a + b x) + (x-1) x (x+1) (c + d x + e x^2 + f x^3)
+	// y[x_] = y1 + x (a + b x) + x [(x-1) (x+1)] (c + d x) + x (x-1)^2 (x+1)^2 (e + f x)
+	// y' = a + 2 b x + d x [(x+1)(x-1)] + (c + d x)(3x^2-1) + f x [(x+1)(x-1)]^2 + (e + f x)[(x+1)(x-1)](5x^2-1)  
+	// y'' = 2 b + 6x(c + d x) + 2d(3x^2-1) + 4x(e + f x)(5x^2-3) + 2f(x^2-1)(5x^2-1)
 	fy1=y1; 
-	fa=-(y0 - y2)/2.;
-	fb=(y0 - 2*y1 + y2)/2.;
-	fc=(7*(y0 - y2 + yp0 + yp2) + ypp0 - ypp2)/16.;
-	fd=(32*y1 - 16*(y2 + y0) + 9*(yp2 - yp0) - ypp0 - ypp2)/16.;
-	fe=(3*(y2 - y0 - yp0 - yp2) - ypp0 + ypp2)/16.;
+	fa=(fb2.y - fb0.y)*0.5;
+	fb=(fb0.y + fb2.y)*0.5 - y1;
+	fc=(yp2+yp0-2.*fa)*0.25;
+	fd=(yp2-yp0-4.*fb)*0.25;
+	fe=(ypp2-ypp0-12.*fc)*0.0625;
 	ff=(ff0 - y1);
-	// y'[x] = a + 2 b x + (3x^2 - 1)   (c + d x + e x^2 + f x^3) + (x-1) x (x+1) (d + 2 e x + 3 f x^2 )
-	// y''[x] = 2b + (x-1) x (x+1) (2 e + 6 f x) + 2 (3 x^2 -1) (d + 2 e x + 3 f x^2 ) + 6 x (c + d x + e x^2 + f x^3)
-	this->set_domain(x0,x2); // this is where the function is valid
-}
-
-template <typename float_type> c2_connector_function<float_type>::~c2_connector_function() 
-{
-}
-
-template <typename float_type> float_type c2_connector_function<float_type>::value_with_derivatives(
+	this->set_domain(fb0.x, fb2.x); // this is where the function is valid
+}
+
+template <typename float_type> c2_connector_function_p<float_type>::~c2_connector_function_p() 
+{
+}
+
+template <typename float_type> float_type c2_connector_function_p<float_type>::value_with_derivatives(
 	float_type x, float_type *yprime, float_type *yprime2
 	) const throw(c2_exception)
 {
-																									
-	float_type dx=(x-fx1)*fhinv;
-	float_type q1=fc + dx*(fd + dx*(fe + dx*ff));
-	float_type xp1=(dx-1)*(dx+1)*dx;
-	
-	float_type y= fy1 + dx*(fa+fb*dx) + xp1*q1;
+	float_type x0=this->xmin(), x2=this->xmax();
+	float_type dx=(x-(x0+x2)*0.5)*fhinv;
+	float_type q1=(x-x0)*(x-x2)*fhinv*fhinv; // exactly vanish all bits at both ends
+	float_type q2=dx*q1;
+	
+	float_type r1=fa+fb*dx;
+	float_type r2=fc+fd*dx;
+	float_type r3=fe+ff*dx;
+	
+	float_type y=fy1+dx*r1+q2*r2+q1*q2*r3;
+	
 	if(yprime || yprime2) {
-		float_type q2 =fd + dx*(2*fe + dx*3*ff);	
-		float_type q3=2*fe+6*ff*dx;
-		float_type xp2=(3*dx*dx-1);
-		if(yprime) *yprime=(fa + 2*fb*dx + xp2*q1 + xp1*q2)*fhinv;
-		if(yprime2) *yprime2=(2*fb+xp1*q3+2*xp2*q2+6*dx*q1)*fhinv*fhinv;
+		float_type q3=3*q1+2;
+		float_type q4=5*q1+4;
+		if(yprime) *yprime=(fa+2*fb*dx+fd*q2+r2*q3+ff*q1*q2+q1*q4*r3)*fhinv;
+		if(yprime2) *yprime2=2*(fb+fd*q3+3*dx*r2+ff*q1*q4+r3*(2*dx*(5*q1+2)))*fhinv*fhinv;
 	}
 	return y;
 }
+
+// the recursive part of the sampler is agressively designed to minimize copying of data... lots of pointers
+template <typename float_type> void c2_function<float_type>::sample_step(c2_sample_recur &rb) const throw(c2_exception)
+{
+	std::vector< recur_item > &rb_stack=*rb.rb_stack; // heap-based stack of data for recursion
+	rb_stack.clear();
+	
+	recur_item top;
+	top.depth=0; top.done=false; top.f0index=0; top.f2index=0;
+	
+	// push storage for our initial elements
+	rb_stack.push_back(top);
+	rb_stack.back().f1=*rb.f0;
+	rb_stack.back().done=true;
+
+	rb_stack.push_back(top);
+	rb_stack.back().f1=*rb.f1;
+	rb_stack.back().done=true;
+	
+	if(!rb.inited) {
+		rb.dx_tolerance=10.0*std::numeric_limits<float_type>::epsilon();
+		rb.abs_tol_min=10.0*std::numeric_limits<float_type>::min();
+		rb.inited=true;
+	}
+
+	// now, push our first real element
+	top.f0index=0; // left element is stack[0]
+	top.f2index=1; // right element is stack[1]
+	rb_stack.push_back(top);
+
+	while(rb_stack.size() > 2) {
+		recur_item &back=rb_stack.back();
+		if(back.done) {
+			rb_stack.pop_back();
+			continue;
+		}
+		back.done=true;
+
+		c2_fblock<float_type> &f0=rb_stack[back.f0index].f1, &f2=rb_stack[back.f2index].f1; 
+		c2_fblock<float_type> &f1=back.f1; // will hold new middle values
+		size_t f1index=rb_stack.size()-1; // our current offset
+
+		// std::cout << "processing: " << rb_stack.size() << " " << 
+		// (&back-&rb_stack.front())  << " " << back.depth << " " << f0.x << " " << f2.x << std::endl;
+
+		f1.x=0.5*(f0.x + f2.x); // center of interval
+		float_type dx2=0.5*(f2.x - f0.x);
+			
+		// check for underflow on step size, which prevents us from achieving specified accuracy. 
+		if(std::abs(dx2) < std::abs(f1.x)*rb.dx_tolerance || std::abs(dx2) < rb.abs_tol_min) {
+			std::ostringstream outstr;
+			outstr << "Step size underflow in adaptive_sampling at depth=" << back.depth << ", x= " << f1.x;
+			throw c2_exception(outstr.str().c_str());
+		}
+		
+		fill_fblock(f1);
+		
+		if(c2_isnan(f1.y) || f1.ypbad || f1.yppbad) {
+			// can't go any further if a nan has appeared
+			bad_x_point=f1.x;
+			throw c2_exception("NaN encountered while sampling function"); 
+		}
+
+		float_type eps; 
+		if(rb.derivs==2) {
+			// this is code from connector_function to compute the value at the midpoint
+			// it is re-included here to avoid constructing a complete c2connector
+			// just to find out if we are close enough
+			float_type ff0=(8*(f0.y + f2.y) + 5*(f0.yp - f2.yp)*dx2 + (f0.ypp+f2.ypp)*dx2*dx2)*0.0625;
+			// we are converging as at least x**5 and bisecting, so real error on final step is smaller
+			eps=std::abs(ff0-f1.y)/32.0;   
+		} else {
+			// there are two tolerances to meet... the shift in the estimate of the actual point,
+			// and the difference between the current points and the extremum
+			// build all the coefficients needed to construct the local parabola
+			float_type ypcenter, ypp;
+			if (rb.derivs==1) {
+				// linear extrapolation error using exact derivs
+				eps = (std::abs(f0.y+f0.yp*dx2-f1.y)+std::abs(f2.y-f2.yp*dx2-f1.y))*0.125; 
+				ypcenter=2*f1.yp*dx2; // first deriv scaled so this interval is on [-1,1]
+				ypp=2*(f2.yp-f0.yp)*dx2*dx2; // second deriv estimate scaled so this interval is on [-1,1]
+			} else {
+				// linear interpolation error without derivs if we are at top level
+				//  or 3-point parabolic interpolation estimates from previous level, if available
+				ypcenter=(f2.y-f0.y)*0.5; // derivative estimate at center
+				ypp=(f2.y+f0.y-2*f1.y); // second deriv estimate
+				if(back.depth==0) eps=std::abs((f0.y+f2.y)*0.5 - f1.y)*2; // penalize first step
+				else eps=std::abs(f1.y-back.previous_estimate)*0.25; 
+			}
+			float_type ypleft=ypcenter-ypp; // derivative at left edge
+			float_type ypright=ypcenter+ypp; // derivative at right edge
+			float_type extremum_eps=0;
+			if((ypleft*ypright) <=0) // y' changes sign if we have an extremum
+			{
+				// compute position and value of the extremum this way
+				float_type xext=-ypcenter/ypp;
+				float_type yext=f1.y + xext*ypcenter + 0.5*xext*xext*ypp;
+				// and then find the the smallest offset of it from a point, looking in the left or right side
+				if(xext <=0) extremum_eps=std::min(std::abs(f0.y-yext), std::abs(f1.y-yext));
+				else extremum_eps=std::min(std::abs(f2.y-yext), std::abs(f1.y-yext));
+			}
+			eps=std::max(eps, extremum_eps); // if previous shot was really bad, keep trying
+		}
+		
+		if(eps < rb.abs_tol ||  eps < std::abs(f1.y)*rb.rel_tol) {
+			if(rb.out) {
+				// we've met the tolerance, and are building a function, append two connectors
+				rb.out->append_function(
+					*new c2_connector_function_p<float_type>(f0, f1, true, 0.0)
+				);
+				rb.out->append_function(
+					*new c2_connector_function_p<float_type>(f1, f2, true, 0.0)
+				);
+			}
+			if(rb.xvals && rb.yvals) {
+				rb.xvals->push_back(f0.x);
+				rb.xvals->push_back(f1.x);
+				rb.yvals->push_back(f0.y);
+				rb.yvals->push_back(f1.y);
+				// the value at f2 will get pushed in the next segment... it is not forgotten
+			}
+		} else {
+			top.depth=back.depth+1; // increment depth counter
+
+			// save the last things we need from back before a push happens, in case 
+			// the push causes a reallocation and moves the whole stack.
+			size_t f0index=back.f0index, f2index=back.f2index;
+			float_type left=0, right=0;
+			if(rb.derivs==0) {
+				// compute three-point parabolic interpolation estimate of right-hand and left-hand midpoint
+				left=(6*f1.y + 3*f0.y - f2.y) * 0.125;
+				right=(6*f1.y + 3*f2.y - f0.y) * 0.125; 
+			}
+			
+			top.f0index=f1index; top.f2index=f2index; // insert pointers to right side data into our recursion block			
+			top.previous_estimate=right; 
+			rb_stack.push_back(top);
+
+			top.f0index=f0index; top.f2index=f1index; // insert pointers to left side data into our recursion block
+			top.previous_estimate=left; 
+			rb_stack.push_back(top);
+		}
+	}
+}
+
+template <typename float_type>  c2_piecewise_function_p<float_type> *
+	c2_function<float_type>::adaptively_sample(
+		float_type xmin, float_type xmax,
+		float_type abs_tol, float_type rel_tol,
+		int derivs, std::vector<float_type> *xvals, std::vector<float_type> *yvals) const throw(c2_exception)
+{
+	c2_fblock<float_type> f0, f2;
+	c2_sample_recur rb;
+	std::vector< recur_item > rb_stack;
+	rb_stack.reserve(20); // enough for most operations
+	rb.rb_stack=&rb_stack;
+	rb.out=0;
+	if(derivs==2) rb.out=new c2_piecewise_function_p<float_type>();
+	c2_ptr<float_type> pieces(*rb.out); // manage this function, if any, so it deletes on an exception
+	rb.rel_tol=rel_tol;
+	rb.abs_tol=abs_tol;
+	rb.xvals=xvals;
+	rb.yvals=yvals;
+	rb.derivs=derivs;
+	rb.inited=false;
+	
+	if(xvals && yvals) {
+		xvals->clear();
+		yvals->clear();
+	}
+	 
+	// create xgrid as a automatic-variable copy of the sampling grid so the exception handler correctly 
+	// disposes of it.
+	std::vector<float_type> xgrid;
+	get_sampling_grid(xmin, xmax, xgrid);
+	int np=xgrid.size();	 
+
+	f2.x=xgrid[0];
+	fill_fblock(f2);
+	if(c2_isnan(f2.y) || f2.ypbad || f2.yppbad) {
+		// can't go any further if a nan has appeared
+		bad_x_point=f2.x;
+		throw c2_exception("NaN encountered while sampling function"); 
+	}
+
+	for(int i=0; i<np-1; i++) {
+		f0=f2; // copy upper bound to lower before computing new upper bound
+
+		f2.x=xgrid[i+1];
+		fill_fblock(f2);
+		if(c2_isnan(f2.y) || f2.ypbad || f2.yppbad) {
+			// can't go any further if a nan has appeared
+			bad_x_point=f2.x;
+			throw c2_exception("NaN encountered while sampling function"); 
+		}
+
+		rb.f0=&f0; rb.f1=&f2;
+		sample_step(rb);
+	}
+	if(xvals && yvals) { // push final point in vector
+		xvals->push_back(f2.x);
+		yvals->push_back(f2.y);
+	}
+	
+	if(rb.out) rb.out->set_sampling_grid(xgrid); // reflect old sampling grid, which still should be right
+	pieces.release_for_return(); // unmanage the piecewise_function so we can return it
+	return rb.out;
+}
+
+template <typename float_type, typename Final> 
+ interpolating_function_p<float_type> & inverse_integrated_density_function(
+	const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights)
+	throw(c2_exception)
+{	
+	return (new Final())->load_random_generator_function(bincenters, binheights);
+}
+
+template <typename float_type, typename Final> 
+	interpolating_function_p<float_type> & inverse_integrated_density_bins(
+	const std::vector<float_type> &bins, const std::vector<float_type> &binheights)
+	throw(c2_exception)
+{	
+	return (new Final())->load_random_generator_bins(bins, binheights);
+}
Index: trunk/examples/extended/electromagnetic/TestEm7/ionC12.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/ionC12.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/ionC12.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: ionC12.mac,v 1.19 2007/11/07 19:41:32 vnivanch Exp $
+# $Id: ionC12.mac,v 1.22 2008/10/24 15:36:24 maire Exp $
 #
 # Macro file for "TestEm7.cc"
@@ -7,11 +7,11 @@
 /control/verbose 2
 /run/verbose 2
-/tracking/verbose 1
+/tracking/verbose 0
 #
-/testem/det/setMat Water
+/testem/det/setMat G4_WATER
 /testem/det/setSizeX  20 cm
 /testem/det/setSizeYZ 20 cm
 #
-/testem/det/tallyMat Water
+/testem/det/tallyMat G4_WATER
 /testem/det/tallySize 2. 2. 2. mm
 /testem/det/tallyPosition -9.9 0. 0. cm
@@ -20,7 +20,7 @@
 /testem/det/tallyPosition  5.  0. 0. cm
 #
-/testem/phys/addPhysics  standardNR	
-#/testem/phys/addPhysics  emstandard
-#/testem/phys/addPhysics  standard_opt2
+#/testem/phys/addPhysics  standardNR	
+/testem/phys/addPhysics  emstandard
+#/testem/phys/addPhysics  emstandard_opt2
 #
 /run/initialize
@@ -29,13 +29,19 @@
 /gun/ion 6 12 6
 #/gun/ion 6 12 1
-/gun/energy 3.5 GeV
+/gun/energy 2.4 GeV
 #
 # beam size
-/testem/gun/rndm 2 mm
+#/testem/gun/rndm 2 mm
 #
 # step limit
-/testem/stepMax 1 mm
+/testem/phys/setCuts 0.5 mm
+#/testem/stepMax 0.1 mm
 #
 /testem/event/printModulo 1000
 #
+/testem/histo/fileName c12
+/testem/histo/fileType root
+/testem/histo/setHisto 1 100 80 90
+/testem/histo/setHisto 2 100 80 90
+#
 /run/beamOn 1000
Index: trunk/examples/extended/electromagnetic/TestEm7/proton.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/proton.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/proton.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: proton.mac,v 1.10 2007/07/28 16:39:31 vnivanch Exp $
+# $Id: proton.mac,v 1.17 2008/10/24 15:36:24 maire Exp $
 #
 # Macro file for "TestEm7.cc"
@@ -8,9 +8,11 @@
 /run/verbose 2
 #
-/testem/det/setMat Water
+/testem/det/setMat G4_WATER
 /testem/det/setSizeX  10 cm
 /testem/det/setSizeYZ 10 cm
+/testem/det/tallyMat G4_WATER
 #
-/testem/phys/addPhysics  standard	#em physics
+#/testem/phys/addPhysics  standard
+/testem/phys/addPhysics  emstandard_opt3
 #
 /run/initialize
@@ -20,7 +22,15 @@
 #
 # step limit
-/testem/stepMax 0.5 mm
+#/testem/phys/setCuts 0.5 mm
+/testem/phys/setCuts 1 mm
+#/testem/stepMax 0.5 mm
 #
 /testem/event/printModulo 1000
 #
+/testem/histo/fileName p100opt3cut1
+/testem/histo/fileType root
+/testem/histo/setHisto 1 100 70 80
+/testem/histo/setHisto 2 100 70 80
+#
 /run/beamOn 10000
+#
Index: trunk/examples/extended/electromagnetic/TestEm7/snr.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/snr.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/snr.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: snr.mac,v 1.1 2007/12/19 19:21:41 vnivanch Exp $
+# $Id: snr.mac,v 1.3 2008/05/08 11:20:50 vnivanch Exp $
 #
 # Macro file for "TestEm7.cc"
@@ -19,6 +19,10 @@
 /testem/det/tallyPosition  5.  0. 0. cm
 #
-/testem/phys/addPhysics  standardNR	# use screened nuclear recoil  
-###/testem/phys/addPhysics  binary	# hadronic physics
+#/testem/phys/addPhysics  emstandard
+#/testem/phys/addPhysics  emstandard_opt2
+#/testem/phys/addPhysics  emstandard_opt3  
+/testem/phys/addPhysics  standardNR	  
+#/testem/phys/addPhysics  standardIG  
+###/testem/phys/addPhysics  binary
 #
 /run/initialize
@@ -40,7 +44,2 @@
 /run/beamOn 1000
 #
-/testem/det/setMat G4_Cu
-/testem/det/update
-/gun/particle kaon+
-/gun/energy 100 MeV
-/run/beamOn 1000
Index: trunk/examples/extended/electromagnetic/TestEm7/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/DetectorConstruction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: DetectorConstruction.cc,v 1.8 2007/01/11 15:41:46 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: DetectorConstruction.cc,v 1.10 2008/04/21 13:13:30 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,6 +45,9 @@
 
 #include "G4NistManager.hh"
-
 #include "G4UnitsTable.hh"
+
+#include "G4FieldManager.hh"
+#include "G4TransportationManager.hh"
+#include "G4RunManager.hh" 
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -117,4 +120,11 @@
   Air->AddElement(N, fractionmass=0.7);
   Air->AddElement(O, fractionmass=0.3);
+
+  density     = 1.e-5*g/cm3;
+  pressure    = 2.e-2*bar;
+  temperature = STP_Temperature;  // From PhysicalConstants.h .
+  G4Material* vac = new G4Material( "TechVacuum", density, 1,
+                           kStateGas, temperature, pressure );
+  vac->AddMaterial( Air, 1. );
 
   density     = universe_mean_density;    //from PhysicalConstants.h
@@ -235,4 +245,5 @@
 {
   absorSizeX = value; worldSizeX = 1.2*absorSizeX;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }
   
@@ -243,4 +254,5 @@
   absorSizeYZ = value; 
   worldSizeYZ = 1.2*absorSizeYZ;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
@@ -252,11 +264,14 @@
   G4Material* pttoMaterial =
     G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
-  if (pttoMaterial) absorMaterial = pttoMaterial;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4FieldManager.hh"
-#include "G4TransportationManager.hh"
+  if (pttoMaterial) {
+    absorMaterial = pttoMaterial;
+    if(lAbsor) {
+      lAbsor->SetMaterial(absorMaterial);
+      G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+    }
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 void DetectorConstruction::SetMagField(G4double fieldValue)
@@ -285,4 +300,5 @@
 {
   tallySize = value;
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
@@ -294,5 +310,11 @@
   G4Material* pttoMaterial =
     G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
-  if (pttoMaterial) tallyMaterial = pttoMaterial;
+  if (pttoMaterial) {
+    tallyMaterial = pttoMaterial;
+    if(lTally) {
+      lTally->SetMaterial(tallyMaterial);
+      G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+    }
+  }
 }
 
@@ -305,14 +327,14 @@
     tallyNumber++;
   }
+  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }  
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4RunManager.hh" 
  
 void DetectorConstruction::UpdateGeometry()
 {
-G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+  G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:58:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.4 2006/06/29 16:58:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.4 2006/06/29 16:58:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/G4ScreenedNuclearRecoil.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/G4ScreenedNuclearRecoil.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/G4ScreenedNuclearRecoil.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4ScreenedNuclearRecoil.cc,v 1.5 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// G4ScreenedNuclearRecoil.cc,v 1.57 2008/05/07 11:51:26 marcus Exp
+// GEANT4 tag 
 //
 //
@@ -84,8 +84,12 @@
 #include "G4ScreenedNuclearRecoil.hh"
 
+const char* G4ScreenedCoulombCrossSectionInfo::CVSFileVers() { return 
+	"G4ScreenedNuclearRecoil.cc,v 1.57 2008/05/07 11:51:26 marcus Exp GEANT4 tag ";
+}
+
 #include "G4ParticleTypes.hh"
 #include "G4ParticleTable.hh"
 #include "G4VParticleChange.hh"
-#include "G4ParticleChange.hh"
+#include "G4ParticleChangeForLoss.hh"
 #include "G4DataVector.hh"
 #include "G4Track.hh"
@@ -99,4 +103,6 @@
 #include "G4IsotopeVector.hh"
 
+#include "G4EmProcessSubType.hh"
+
 #include "G4RangeTest.hh"
 #include "G4ParticleDefinition.hh"
@@ -104,4 +110,5 @@
 #include "G4ProcessManager.hh"
 #include "G4StableIsotopes.hh"
+#include "G4LindhardPartition.hh"
 
 #include "Randomize.hh"
@@ -112,18 +119,12 @@
 #include <iomanip>
 
+#include "c2_factory.hh"
+static c2_factory<G4double> c2; // this makes a lot of notation shorter
+typedef c2_ptr<G4double> c2p;
+
 G4ScreenedCoulombCrossSection::~G4ScreenedCoulombCrossSection()
 {
-	ScreeningMap::iterator tables=screeningData.begin();
-	for (;tables != screeningData.end(); tables++) {
-		delete (*tables).second.EMphiData;
-	}
 	screeningData.clear();
-	
-	std::map<G4int, c2_function<G4double> *>::iterator mfpit=MFPTables.begin();
-	for (;mfpit != MFPTables.end(); mfpit++) {
-		delete (*mfpit).second;
-	}
-	MFPTables.clear();
-	
+	MFPTables.clear();	
 }
 
@@ -248,5 +249,5 @@
 			element=elementVector[kel];
 			G4int Z=(G4int)std::floor(element->GetZ()+0.5);
-			c2_function<G4double> &ifunc=*sigmaMap[Z];
+			const G4_c2_function &ifunc=sigmaMap[Z];
 			if(!kel || ifunc.xmin() > emin) emin=ifunc.xmin();
 			if(!kel || ifunc.xmax() < emax) emax=ifunc.xmax();			
@@ -268,5 +269,5 @@
 			element=elementVector[kel];
 			G4int Z=(G4int)std::floor(element->GetZ()+0.5);
-			c2_function<G4double> &sigma=*sigmaMap[Z];
+			const G4_c2_function &sigma=sigmaMap[Z];
 			G4double ndens = atomDensities[kel]; // compute atom fraction for this element in this material
 						
@@ -281,15 +282,6 @@
 		}
 		// and make a new interpolating function out of the sum
-		MFPTables[matidx] = static_cast<c2_function<G4double> *>(new log_log_interpolating_function<G4double>(
-				evals, mfpvals));
+		MFPTables[matidx] = c2.log_log_interpolating_function().load(evals, mfpvals,true,0,true,0);
     }
-	
-#ifdef DEBUG	
-	for (G4int matidx=0; matidx < nMaterials; matidx++) {
-		const G4Material* material= (*materialTable)[matidx];
-		G4cout << "***** MFP (1MeV) ***** " << material->GetName() << "  " << (*MFPTables[matidx])(1.0) << G4endl; 
-	}
-#endif
-	
 }
 
@@ -304,6 +296,12 @@
 	recoilCutoff(RecoilCutoff), physicsCutoff(PhysicsCutoff),
 	hardeningFraction(0.0), hardeningFactor(1.0),
-	externalCrossSectionConstructor(0)
-{
+	externalCrossSectionConstructor(0),
+	NIELPartitionFunction(new G4LindhardRobinsonPartition)
+{
+		// for now, point to class instance of this. Doing it by creating a new one fails
+		// to correctly update NIEL
+		// not even this is needed... done in G4VProcess().
+		// pParticleChange=&aParticleChange; 
+		processMaxEnergy=50000.0*MeV;
 		highEnergyLimit=100.0*MeV;
 		lowEnergyLimit=physicsCutoff;
@@ -313,13 +311,9 @@
 		AddStage(new G4ScreenedCoulombClassicalKinematics);
 		AddStage(new G4SingleScatter); 
+		SetProcessSubType(fCoulombScattering);
 }
 
 void G4ScreenedNuclearRecoil::ResetTables()
 {
-	std::map<G4int, c2_function<G4double>*>::iterator xh=meanFreePathTables.begin();
-	for(;xh != meanFreePathTables.end(); xh++) {
-		delete (*xh).second;
-	}
-	meanFreePathTables.clear();
 	
 	std::map<G4int, G4ScreenedCoulombCrossSection*>::iterator xt=crossSectionHandlers.begin();
@@ -338,4 +332,21 @@
 
 	collisionStages.clear();
+}
+
+void G4ScreenedNuclearRecoil::SetNIELPartitionFunction(const G4VNIELPartition *part)
+{
+	if(NIELPartitionFunction) delete NIELPartitionFunction;
+	NIELPartitionFunction=part;
+}
+
+void G4ScreenedNuclearRecoil::DepositEnergy(G4int z1, G4double a1, const G4Material *material, G4double energy)
+{
+	if(!NIELPartitionFunction) {
+		IonizingLoss+=energy;
+	} else {
+		G4double part=NIELPartitionFunction->PartitionNIEL(z1, a1, material, energy);
+		IonizingLoss+=energy*(1-part);
+		NIEL += energy*part;
+	}
 }
 
@@ -363,5 +374,5 @@
 G4double G4ScreenedNuclearRecoil::GetMeanFreePath(const G4Track& track,
 						  G4double, 
-						  G4ForceCondition*)
+						  G4ForceCondition* cond)
 {
 	const G4DynamicParticle* incoming = track.GetDynamicParticle();
@@ -370,7 +381,12 @@
 	
 	G4double meanFreePath;
-	
-	if (energy < lowEnergyLimit || energy < recoilCutoff) return 1.0*nanometer; /* stop slow particles! */
-	else if (energy > highEnergyLimit*a1) energy=highEnergyLimit*a1; /* constant MFP at high energy */
+	*cond=NotForced;
+	
+	if (energy < lowEnergyLimit || energy < recoilCutoff*a1) {
+		*cond=Forced;
+		return 1.0*nm; /* catch and stop slow particles to collect their NIEL! */
+	} else if (energy > processMaxEnergy*a1) {
+		return DBL_MAX; // infinite mean free path
+	} else if (energy > highEnergyLimit*a1) energy=highEnergyLimit*a1; /* constant MFP at high energy */
 
 	G4double fz1=incoming->GetDefinition()->GetPDGCharge();
@@ -390,5 +406,5 @@
 	size_t materialIndex = materialCouple->GetMaterial()->GetIndex();
 
-	c2_function<G4double> &mfp=*(*xs)[materialIndex];
+	const G4_c2_function &mfp=*(*xs)[materialIndex];
 	
 	// make absolutely certain we don't get an out-of-range energy
@@ -403,6 +419,7 @@
 {
 	validCollision=1;
-	aParticleChange.Initialize(aTrack);
+	pParticleChange->Initialize(aTrack);
 	NIEL=0.0; // default is no NIEL deposited
+	IonizingLoss=0.0;
 	
 	// do universal setup
@@ -413,4 +430,5 @@
 	G4double fz1=baseParticle->GetPDGCharge()/eplus;
 	G4int z1=(G4int)(fz1+0.5);
+	G4double a1=baseParticle->GetPDGMass()/amu_c2;
 	G4double incidentEnergy = incidentParticle->GetKineticEnergy();
 		
@@ -418,56 +436,56 @@
 	const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
 	
-	if(incidentEnergy < GetRecoilCutoff()) { // check energy sanity on entry
-		if(!baseParticle->GetProcessManager()->
-		   GetAtRestProcessVector()->size())
-			aParticleChange.ProposeTrackStatus(fStopAndKill);
-		else
-			aParticleChange.ProposeTrackStatus(fStopButAlive);
-
-		AddToNIEL(incidentEnergy);
-		aParticleChange.ProposeEnergy(0.0);
+	const G4Material* mat = couple->GetMaterial();
+
+	G4double P=0.0; // the impact parameter of this collision
+
+	if(incidentEnergy < GetRecoilCutoff()*a1) { // check energy sanity on entry
+		DepositEnergy(z1, baseParticle->GetPDGMass()/amu_c2, mat, incidentEnergy);
+		GetParticleChange().ProposeEnergy(0.0);
 		// stop the particle and bail out
 		validCollision=0;
-	} 	
-	
-	const G4Material* mat = couple->GetMaterial();
-	G4double numberDensity=mat->GetTotNbOfAtomsPerVolume();
-	G4double lattice=0.5/std::pow(numberDensity,1.0/3.0); // typical lattice half-spacing
-	G4double length=GetCurrentInteractionLength();
-	G4double sigopi=1.0/(CLHEP::pi*numberDensity*length);  // this is sigma0/pi
-	
-	// compute the impact parameter very early, so if is rejected as too far away, little effort is wasted
-	// this is the TRIM method for determining an impact parameter based on the flight path
-	// this gives a cumulative distribution of N(P)= 1-exp(-pi P^2 n l)
-	// which says the probability of NOT hitting a disk of area sigma= pi P^2 =exp(-sigma N l) 
-	// which may be reasonable
-	G4double P;
-	if(sigopi < lattice*lattice) { 
-		// normal long-flight approximation
-		P = std::sqrt(-std::log(G4UniformRand()) *sigopi);
 	} else {
-		// short-flight limit
-		P = std::sqrt(G4UniformRand())*lattice;
-	}
-		
-	G4double fraction=GetHardeningFraction();
-	if(fraction && G4UniformRand() < fraction) { 
-		// pick out some events, and increase the central cross section
-		// by reducing the impact parameter
-		P /= std::sqrt(GetHardeningFactor());
-	}
-	
-	
-	// check if we are far enough away that the energy transfer must be below cutoff, 
-	// and leave everything alone if so, saving a lot of time.
-	if(P*P > sigopi) {
-		if(GetVerboseLevel() > 1) 
-			printf("ScreenedNuclear impact reject: length=%.3f P=%.4f limit=%.4f\n",
-				   length/angstrom, P/angstrom,std::sqrt(sigopi)/angstrom);
-		// no collision, don't follow up with anything
-		validCollision=0;
+		
+		G4double numberDensity=mat->GetTotNbOfAtomsPerVolume();
+		G4double lattice=0.5/std::pow(numberDensity,1.0/3.0); // typical lattice half-spacing
+		G4double length=GetCurrentInteractionLength();
+		G4double sigopi=1.0/(CLHEP::pi*numberDensity*length);  // this is sigma0/pi
+		
+		// compute the impact parameter very early, so if is rejected as too far away, little effort is wasted
+		// this is the TRIM method for determining an impact parameter based on the flight path
+		// this gives a cumulative distribution of N(P)= 1-exp(-pi P^2 n l)
+		// which says the probability of NOT hitting a disk of area sigma= pi P^2 =exp(-sigma N l) 
+		// which may be reasonable
+		if(sigopi < lattice*lattice) { 
+			// normal long-flight approximation
+			P = std::sqrt(-std::log(G4UniformRand()) *sigopi);
+		} else {
+			// short-flight limit
+			P = std::sqrt(G4UniformRand())*lattice;
+		}
+			
+		G4double fraction=GetHardeningFraction();
+		if(fraction && G4UniformRand() < fraction) { 
+			// pick out some events, and increase the central cross section
+			// by reducing the impact parameter
+			P /= std::sqrt(GetHardeningFactor());
+		}
+		
+		
+		// check if we are far enough away that the energy transfer must be below cutoff, 
+		// and leave everything alone if so, saving a lot of time.
+		if(P*P > sigopi) {
+			if(GetVerboseLevel() > 1) 
+				printf("ScreenedNuclear impact reject: length=%.3f P=%.4f limit=%.4f\n",
+					   length/angstrom, P/angstrom,std::sqrt(sigopi)/angstrom);
+			// no collision, don't follow up with anything
+			validCollision=0;
+		}
 	}
 	
 	// find out what we hit, and record it in our kinematics block.
+	kinematics.targetMaterial=mat;
+	kinematics.a1=a1;
+	
 	if(validCollision) {
 		G4ScreenedCoulombCrossSection	*xsect=GetCrossSectionHandlers()[z1];
@@ -477,10 +495,8 @@
 		kinematics.recoilIon=recoilIon;
 		kinematics.impactParameter=P;
-		kinematics.a1=baseParticle->GetPDGMass()/amu_c2;
 		kinematics.a2=recoilIon->GetPDGMass()/amu_c2;
 	} else {
 		kinematics.recoilIon=0;
 		kinematics.impactParameter=0;
-		kinematics.a1=baseParticle->GetPDGMass()/amu_c2;
 		kinematics.a2=0;
 	}
@@ -492,8 +508,21 @@
 	
 	if(registerDepositedEnergy) {
-	  aParticleChange.ProposeLocalEnergyDeposit(NIEL);
-	  aParticleChange.ProposeNonIonizingEnergyDeposit(NIEL);
-	}
+		pParticleChange->ProposeLocalEnergyDeposit(IonizingLoss+NIEL);
+		pParticleChange->ProposeNonIonizingEnergyDeposit(NIEL);
+		//MHM G4cout << "depositing energy, total = " << IonizingLoss+NIEL << " NIEL = " << NIEL << G4endl;
+	}
+
 	return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep );
+}
+
+G4ScreenedCoulombClassicalKinematics::G4ScreenedCoulombClassicalKinematics() :
+// instantiate all the needed functions statically, so no allocation is done at run time
+// we will be solving x^2 - x phi(x*au)/eps - beta^2 == 0.0
+// or, for easier scaling, x'^2 - x' au phi(x')/eps - beta^2 au^2
+// note that only the last of these gets deleted, since it owns the rest
+phifunc(c2.const_plugin_function()),
+xovereps(c2.linear(0., 0., 0.)), // will fill this in with the right slope at run time
+diff(c2.quadratic(0., 0., 0., 1.)-xovereps*phifunc)
+{
 }
 
@@ -520,35 +549,24 @@
 	}
 	
-	c2_function<G4double> &phiData=*(screen->EMphiData);
-	// instantiate all the needed functions statically, so no allocation is done at run time
 	// we will be solving x^2 - x phi(x*au)/eps - beta^2 == 0.0
 	// or, for easier scaling, x'^2 - x' au phi(x')/eps - beta^2 au^2
-	static c2_plugin_function<G4double> phifunc;
-	static c2_quadratic<G4double> xsq(0., 0., 0., 1.); //  x^2
-	static c2_linear<G4double> xovereps(0., 0., 0.); // will fill this in with the right slope at run time
-	static c2_function<G4double> &xphi=xovereps*phifunc;
-	static c2_function<G4double> &diff=xsq-xphi;
-	
 	xovereps.reset(0., 0.0, au/eps); // slope of x*au/eps term
-	phifunc.set_function(phiData); // install interpolating table
-	
+	phifunc.set_function(&(screen->EMphiData.get())); // install interpolating table
 	G4double xx1, phip, phip2;
-	G4int root_error;
-	
-	xx1=diff.find_root(phiData.xmin(), std::min(10*xx0*au,phiData.xmax()), 
-					   std::min(xx0*au, phiData.xmax()), beta*beta*au*au, &root_error, &phip, &phip2)/au; 
+	G4int root_error;	
+	xx1=diff->find_root(phifunc.xmin(), std::min(10*xx0*au,phifunc.xmax()), 
+					   std::min(xx0*au, phifunc.xmax()), beta*beta*au*au, &root_error, &phip, &phip2)/au; 
 	
 	if(root_error) {
 		G4cout << "Screened Coulomb Root Finder Error" << G4endl;
 		G4cout << "au " << au << " A " << A << " a1 " << a1 << " xx1 " << xx1 << " eps " << eps << " beta " << beta << G4endl;
-		G4cout << " xmin " << phiData.xmin() << " xmax " << std::min(10*xx0*au,phiData.xmax()) ;
-		G4cout << " f(xmin) " << phifunc(phiData.xmin()) <<  " f(xmax) " << phifunc(std::min(10*xx0*au,phiData.xmax())) ;
-		G4cout << " xstart " << std::min(xx0*au, phiData.xmax()) <<  " target " <<  beta*beta*au*au ;
+		G4cout << " xmin " << phifunc.xmin() << " xmax " << std::min(10*xx0*au,phifunc.xmax()) ;
+		G4cout << " f(xmin) " << phifunc(phifunc.xmin()) <<  " f(xmax) " << phifunc(std::min(10*xx0*au,phifunc.xmax())) ;
+		G4cout << " xstart " << std::min(xx0*au, phifunc.xmax()) <<  " target " <<  beta*beta*au*au ;
 		G4cout << G4endl;
 		throw c2_exception("Failed root find");
 	}
 	
-	phifunc.unset_function(); // throws an exception if used without setting again
-							  // phiprime is scaled by one factor of au because phi is evaluated at (xx0*au),
+	// phiprime is scaled by one factor of au because phi is evaluated at (xx0*au),
 	G4double phiprime=phip*au;
 	
@@ -564,8 +582,10 @@
 		G4double x, ff;
 		x=xx1/xvals[k];
-		ff=1.0/std::sqrt(1.0-phiData(x*au)/(x*eps)-beta*beta/(x*x));
+		ff=1.0/std::sqrt(1.0-phifunc(x*au)/(x*eps)-beta*beta/(x*x));
 		alpha+=weights[k]*ff;
 	}
 	
+	phifunc.unset_function(); // throws an exception if used without setting again
+
 	G4double thetac1=CLHEP::pi*beta*alpha/xx1; // complement of CM scattering angle
 	G4double sintheta=std::sin(thetac1); //note sin(pi-theta)=sin(theta)
@@ -626,19 +646,14 @@
 	kin.eRecoil=eRecoil;
 	
-	if(incidentEnergy-eRecoil < master->GetRecoilCutoff()) {
-		if(!baseParticle->GetProcessManager()->
-		   GetAtRestProcessVector()->size())
-			aParticleChange.ProposeTrackStatus(fStopAndKill);
-		else
-			aParticleChange.ProposeTrackStatus(fStopButAlive);
+	if(incidentEnergy-eRecoil < master->GetRecoilCutoff()*a1) {
 		aParticleChange.ProposeEnergy(0.0);
-		master->AddToNIEL(incidentEnergy-eRecoil);
+		master->DepositEnergy(int(screen->z1), a1, kin.targetMaterial, incidentEnergy-eRecoil);
 	} 
 	
-	if(master->GetEnableRecoils() && eRecoil > master->GetRecoilCutoff()) {
+	if(master->GetEnableRecoils() && eRecoil > master->GetRecoilCutoff() * kin.a2) {
 		kin.recoilIon=recoilIon;		
 	} else {
 		kin.recoilIon=0; // this flags no recoil to be generated
-		master->AddToNIEL(eRecoil) ;
+		master->DepositEnergy(Z, A, kin.targetMaterial, eRecoil) ;
 	}	
 }
@@ -706,5 +721,5 @@
 #include <vector>
 
-static c2_function<G4double> &ZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)
+G4_c2_function &ZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)
 {
 	static const size_t ncoef=4;
@@ -729,8 +744,8 @@
 	
 	*auval=au;
-	return *static_cast<c2_function<G4double> *>(new lin_log_interpolating_function<G4double>(r, phi, false, phiprime0));
-}
-
-static c2_function<G4double> &MoliereScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)
+	return c2.lin_log_interpolating_function().load(r, phi, false, phiprime0,true,0);
+}
+
+G4_c2_function &MoliereScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)
 {	
 	static const size_t ncoef=3;
@@ -755,8 +770,8 @@
 	
 	*auval=au;
-	return *static_cast<c2_function<G4double> *>(new lin_log_interpolating_function<G4double>(r, phi, false, phiprime0));
-}
-
-static c2_function<G4double> &LJScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)
+	return c2.lin_log_interpolating_function().load(r, phi, false, phiprime0,true,0);
+}
+
+G4_c2_function &LJScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)
 {	
 //from Loftager, Besenbacher, Jensen & Sorensen
@@ -781,5 +796,31 @@
 	
 	*auval=au;
-	return *static_cast<c2_function<G4double> *>(new lin_log_interpolating_function<G4double>(r, phi, false, logphiprime0*phi[0]));
+	return c2.lin_log_interpolating_function().load(r, phi, false, logphiprime0*phi[0],true,0);
+}
+
+G4_c2_function &LJZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)
+{	
+// hybrid of LJ and ZBL, uses LJ if x < 0.25*auniv, ZBL if x > 1.5*auniv, and 
+/// connector in between.  These numbers are selected so the switchover
+// is very near the point where the functions naturally cross.
+	G4double auzbl, aulj;
+	
+	c2p zbl=ZBLScreening(z1, z2, npoints, rMax, &auzbl);
+	c2p lj=LJScreening(z1, z2, npoints, rMax, &aulj);
+
+	G4double au=(auzbl+aulj)*0.5;
+	lj->set_domain(lj->xmin(), 0.25*au);
+	zbl->set_domain(1.5*au,zbl->xmax());
+	
+	c2p conn=c2.connector_function(lj->xmax(), lj, zbl->xmin(), zbl, true,0);
+	c2_piecewise_function_p<G4double> &pw=c2.piecewise_function();
+	c2p keepit(pw);
+	pw.append_function(lj);
+	pw.append_function(conn);
+	pw.append_function(zbl);
+	
+	*auval=au;
+	keepit.release_for_return();
+	return pw;
 }
 
@@ -791,4 +832,5 @@
 	AddScreeningFunction("lj", LJScreening);	
 	AddScreeningFunction("mol", MoliereScreening);	
+	AddScreeningFunction("ljzbl", LJZBLScreening);	
 }
 
@@ -855,8 +897,8 @@
 			
 			G4double au; 
-			c2_function<G4double> &screen=sfunc(z1, Z, 200, 50.0*angstrom, &au); // generate the screening data
-
+			G4_c2_ptr screen=sfunc(z1, Z, 200, 50.0*angstrom, &au); // generate the screening data
 			G4ScreeningTables st;
-			st.EMphiData=&screen; // this is our phi table
+	
+			st.EMphiData=screen; //save our phi table
 			st.z1=z1; st.m1=a1; st.z2=Z; st.m2=a2; st.emin=recoilCutoff;
 			st.au=au;
@@ -869,8 +911,11 @@
 			//this rearranges to phi(x0)/(x0*eps) = 2*theta/pi - theta^2/pi^2
 			
-			c2_linear<G4double> c2au(0.0, 0.0, au);
-			c2_composed_function<G4double> phiau(screen, c2au); // build phi(x*au) for dimensionless phi
-			c2_linear<G4double> c2eps(0.0, 0.0, 0.0); // will store an appropriate eps inside this in loop
-			c2_ratio<G4double> x0func(phiau, c2eps); // this will be phi(x)/(x*eps) when c2eps is correctly set
+			c2_linear_p<G4double> &c2eps=c2.linear(0.0, 0.0, 0.0); // will store an appropriate eps inside this in loop
+			G4_c2_ptr phiau=screen(c2.linear(0.0, 0.0, au));
+			G4_c2_ptr x0func(phiau/c2eps); // this will be phi(x)/(x*eps) when c2eps is correctly set
+			x0func->set_domain(1e-6*angstrom/au, 0.9999*screen->xmax()/au); // needed for inverse function
+			// use the c2_inverse_function interface for the root finder... it is more efficient for an ordered 
+			// computation of values.
+			G4_c2_ptr x0_solution(c2.inverse_function(x0func));
 			
 			G4double m1c2=a1*amu_c2;
@@ -897,5 +942,16 @@
 				G4double q=theta/pi;
 				// G4cout << ee << " " << m1c2 << " " << gamma << " " << eps << " " << theta << " " << q << G4endl;
-				G4double x0= x0func.find_root(1e-6*angstrom/au, 0.9999*screen.xmax()/au, 1.0, 2*q-q*q);
+				// old way using root finder
+				// G4double x0= x0func->find_root(1e-6*angstrom/au, 0.9999*screen.xmax()/au, 1.0, 2*q-q*q);
+				// new way using c2_inverse_function which caches useful information so should be a bit faster
+				// since we are scanning this in strict order.
+				G4double x0=0;
+				try {
+					x0=x0_solution(2*q-q*q);
+				} catch(c2_exception e) {
+					G4Exception(
+						G4String("G4ScreenedNuclearRecoil: failure in inverse solution to generate MFP Tables: ")+e.what()
+					);
+				}
 				G4double betasquared=x0*x0 - x0*phiau(x0)/eps;	
 				G4double sigma=pi*betasquared*au*au;
@@ -903,8 +959,6 @@
 				data[idx]=sigma;
 			}
-			
 			screeningData[Z]=st;
-			sigmaMap[Z] = static_cast<c2_function<G4double> *>(new log_log_interpolating_function<G4double>(
-				energies, data));
+			sigmaMap[Z] = c2.log_log_interpolating_function().load(energies, data, true,0,true,0);
 		}
 	}
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmLivermore.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmLivermore.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmLivermore.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmLivermore.cc,v 1.2 2006/12/11 20:13:53 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmPenelope.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmPenelope.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmPenelope.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPenelope.cc,v 1.1 2006/11/22 18:56:21 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandard.cc	(revision 1230)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: PhysListEmStandard.cc,v 1.11 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.19 2008/11/20 20:34:50 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,5 +38,5 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
+#include "G4eMultipleScattering.hh"
 #include "G4hMultipleScattering.hh"
 
@@ -51,7 +50,11 @@
 
 #include "G4hIonisation.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
+
 #include "G4ionIonisation.hh"
 
 #include "G4EmProcessOptions.hh"
+#include "G4MscStepLimitType.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -86,26 +89,38 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
       
     } else if( particleName == "mu+" || 
                particleName == "mu-"    ) {
       //muon  
-      pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,       -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 4,4);       
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,        -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,    -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,    -1, 4, 4);       
+              
+    } else if( particleName == "proton" ||
+               particleName == "pi-" ||
+               particleName == "pi+"    ) {
+      //proton  
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
      
-    } else if( particleName == "alpha" || particleName == "GenericIon" ) { 
-      pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,      -1, 2,2);
+    } else if( particleName == "alpha" || 
+	       particleName == "He3" || 
+	       particleName == "GenericIon" ) {
+      //Ions 
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);    
 
     } else if ((!particle->IsShortLived()) &&
@@ -113,16 +128,8 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      pmanager->AddProcess(new G4hMultipleScattering,-1,1,1);
-      pmanager->AddProcess(new G4hIonisation,        -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     }
   }
-  G4EmProcessOptions opt;
-  opt.SetStepFunction(0.2, 10*um);
-  //  opt.SetSkin(1.);
-  opt.SetMinEnergy(0.1*keV);
-  opt.SetMaxEnergy(100.*GeV);
-  opt.SetDEDXBinning(360);
-  opt.SetLambdaBinning(360);
-  opt.SetLinearLossLimit(1.e-6);
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardNR.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardNR.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardNR.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysListEmStandardNR.cc,v 1.1 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandardNR.cc,v 1.3 2008/05/09 08:30:59 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,4 +56,6 @@
 #include "G4CoulombScattering.hh"
 
+#include "G4DummyModel.hh"
+
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
@@ -74,4 +76,6 @@
 
   G4ScreenedNuclearRecoil* nucr = new G4ScreenedNuclearRecoil();
+  G4double energyLimit = 100.*MeV;
+  nucr->SetMaxEnergyForScattering(energyLimit);
 
   theParticleIterator->reset();
@@ -109,14 +113,30 @@
              
     } else if (particleName == "alpha" || particleName == "He3") {
+      G4hMultipleScattering* msc = new G4hMultipleScattering();
+      G4DummyModel* dm = new G4DummyModel();
+      dm->SetLowEnergyLimit(0.0);
+      dm->SetHighEnergyLimit(energyLimit);
+      msc->AddEmModel(0, dm);
+      pmanager->AddProcess(msc, -1, 1,1);
+
       G4ionIonisation* ion = new G4ionIonisation();
       ion->ActivateNuclearStopping(false);
-      pmanager->AddProcess(ion, -1, 1, 1);
+      pmanager->AddProcess(ion, -1, 2, 2);
+
       pmanager->AddDiscreteProcess(nucr);      
 
     } else if (particleName == "GenericIon" ) { 
+      G4hMultipleScattering* msc = new G4hMultipleScattering();
+      G4DummyModel* dm = new G4DummyModel();
+      dm->SetLowEnergyLimit(0.0);
+      dm->SetHighEnergyLimit(energyLimit);
+      msc->AddEmModel(0, dm);
+      pmanager->AddProcess(msc, -1, 1,1);
+
       G4ionIonisation* ion = new G4ionIonisation();
       ion->ActivateNuclearStopping(false);
       ion->SetStepFunction(0.1, um);
-      pmanager->AddProcess(ion, -1, 1, 1);
+      pmanager->AddProcess(ion, -1, 2, 2);
+
       pmanager->AddDiscreteProcess(nucr);      
 
@@ -124,9 +144,17 @@
 	       particleName == "deuteron" ||
                particleName == "triton") { 
+      G4hMultipleScattering* msc = new G4hMultipleScattering();
+      G4DummyModel* dm = new G4DummyModel();
+      dm->SetLowEnergyLimit(0.0);
+      dm->SetHighEnergyLimit(energyLimit);
+      msc->AddEmModel(0, dm);
+      pmanager->AddProcess(msc, -1, 1,1);
+
       G4hIonisation* hion = new G4hIonisation();
       hion->SetFluctModel(new G4IonFluctuations());
       hion->SetStepFunction(0.1, 10.*um);
       hion->ActivateNuclearStopping(false);
-      pmanager->AddProcess(hion, -1, 1,1);
+      pmanager->AddProcess(hion, -1, 2, 2);
+
       pmanager->AddDiscreteProcess(nucr);      
      
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardSS.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardSS.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardSS.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysListEmStandardSS.cc,v 1.5 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandardSS.cc,v 1.8 2008/11/16 19:17:39 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,5 +38,5 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
+#include "G4CoulombScattering.hh"
 
 #include "G4eIonisation.hh"
@@ -50,7 +50,6 @@
 #include "G4hIonisation.hh"
 #include "G4ionIonisation.hh"
-#include "G4ionGasIonisation.hh"
-#include "G4IonFluctuations.hh"
-#include "G4CoulombScattering.hh"
+
+#include "G4EmProcessOptions.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -85,50 +84,61 @@
     } else if (particleName == "e-") {
       //electron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1,1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2,2);
       pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
 	    
     } else if (particleName == "e+") {
       //positron
-      pmanager->AddProcess(new G4eIonisation,        -1, 1,1);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2,2);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,3);
       pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
+      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
+      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 3);
             
     } else if (particleName == "mu+" || 
                particleName == "mu-"    ) {
-      //muon  
-      pmanager->AddProcess(new G4MuIonisation,       -1, 1,1);
-      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2,2);
-      pmanager->AddProcess(new G4MuPairProduction,   -1, 3,3);
-      pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      //muon
+      pmanager->AddDiscreteProcess(new G4CoulombScattering);        
+      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
+      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
+      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);
              
-    } else if (particleName == "alpha" || particleName == "He3") {
-      G4ionIonisation* ion = new G4ionIonisation();
-      ion->SetStepFunction(0.1, um);
-      ion->ActivateNuclearStopping(false);
-      pmanager->AddProcess(ion,  -1, 1,1);
-      pmanager->AddDiscreteProcess(new G4CoulombScattering);      
-
-    } else if (particleName == "GenericIon" ) { 
-      G4ionGasIonisation* ion = new G4ionGasIonisation();
-      ion->ActivateNuclearStopping(false);
-      ion->SetStepFunction(0.1, um);
-      pmanager->AddProcess(ion,  -1, 1,1);
-      G4CoulombScattering* cs = new G4CoulombScattering();
-      cs->SetBuildTableFlag(false);
-      pmanager->AddDiscreteProcess(cs);
-      
+    } else if (particleName == "alpha" || 
+	       particleName == "He3" ||
+               particleName == "GenericIon") {
+      pmanager->AddDiscreteProcess(new G4CoulombScattering);	       
+      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);
+     
     } else if ((!particle->IsShortLived()) &&
 	       (particle->GetPDGCharge() != 0.0) && 
 	       (particle->GetParticleName() != "chargedgeantino")) {
       //all others charged particles except geantino
-      G4hIonisation* hion = new G4hIonisation();
-      hion->SetStepFunction(0.1, 10.*um);
-      hion->ActivateNuclearStopping(false);
-      pmanager->AddProcess(hion,  -1,1,1);
       pmanager->AddDiscreteProcess(new G4CoulombScattering);      
+      pmanager->AddProcess(new G4hIonisation,        -1, 1, 1);
     }
   }
+  
+  // Em options
+  //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //
+  G4EmProcessOptions emOptions;
+  
+  //physics tables
+  //
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default
+      
+  //energy loss
+  //
+  emOptions.SetStepFunction(0.2,50*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);	//default
+   
+  //ionization
+  //
+  emOptions.SetSubCutoff(false);	//default    
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.28 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: PhysicsList.cc,v 1.36 2008/11/21 12:53:13 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,5 +35,4 @@
 #include "PhysListEmStandard.hh"
 #include "PhysListEmStandardSS.hh"
-#include "PhysListEmStandardIG.hh"
 #include "PhysListEmStandardNR.hh"
 #include "PhysListEmLivermore.hh"
@@ -42,4 +41,7 @@
 #include "G4EmStandardPhysics_option1.hh"
 #include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
+
+#include "G4DecayPhysics.hh"
 
 #include "G4HadronElasticPhysics.hh"
@@ -50,6 +52,4 @@
 #include "G4IonBinaryCascadePhysics.hh"
 
-#include "G4EmProcessOptions.hh"
-
 #include "G4LossTableManager.hh"
 #include "G4UnitsTable.hh"
@@ -57,4 +57,9 @@
 #include "G4ProcessManager.hh"
 #include "G4Decay.hh"
+
+#include "StepMax.hh"
+
+#include "G4IonFluctuations.hh"
+#include "G4IonParametrisedLossModel.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -79,6 +84,9 @@
 
   // EM physics
-  emPhysicsList = new PhysListEmStandard(emName = "standard");
-
+  emPhysicsList = new G4EmStandardPhysics(1);
+  emName = G4String("emstandard");
+
+  // Deacy physics and all particles
+  decPhysicsList = new G4DecayPhysics();
 }
 
@@ -89,29 +97,7 @@
   delete pMessenger;
   delete emPhysicsList;
-  for(size_t i=0; i<hadronPhys.size(); i++) delete hadronPhys[i];
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-// Bosons
-#include "G4ChargedGeantino.hh"
-#include "G4Geantino.hh"
-#include "G4Gamma.hh"
-
-// leptons
-#include "G4MuonPlus.hh"
-#include "G4MuonMinus.hh"
-#include "G4NeutrinoMu.hh"
-#include "G4AntiNeutrinoMu.hh"
-
-#include "G4Electron.hh"
-#include "G4Positron.hh"
-#include "G4NeutrinoE.hh"
-#include "G4AntiNeutrinoE.hh"
-
-// Hadrons
-#include "G4MesonConstructor.hh"
-#include "G4BaryonConstructor.hh"
-#include "G4IonConstructor.hh"
+  delete decPhysicsList;
+  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
+}
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -119,36 +105,9 @@
 void PhysicsList::ConstructParticle()
 {
-// pseudo-particles
-  G4Geantino::GeantinoDefinition();
-  G4ChargedGeantino::ChargedGeantinoDefinition();
-  
-// gamma
-  G4Gamma::GammaDefinition();
-  
-// leptons
-  G4Electron::ElectronDefinition();
-  G4Positron::PositronDefinition();
-  G4MuonPlus::MuonPlusDefinition();
-  G4MuonMinus::MuonMinusDefinition();
-
-  G4NeutrinoE::NeutrinoEDefinition();
-  G4AntiNeutrinoE::AntiNeutrinoEDefinition();
-  G4NeutrinoMu::NeutrinoMuDefinition();
-  G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();  
-
-// mesons
-  G4MesonConstructor mConstructor;
-  mConstructor.ConstructParticle();
-
-// barions
-  G4BaryonConstructor bConstructor;
-  bConstructor.ConstructParticle();
-
-// ions
-  G4IonConstructor iConstructor;
-  iConstructor.ConstructParticle();
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+  decPhysicsList->ConstructParticle();
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
 void PhysicsList::ConstructProcess()
 {
@@ -160,34 +119,18 @@
   //
   emPhysicsList->ConstructProcess();
+  em_config.AddModels();
+
+  // decay physics list
+  //
+  decPhysicsList->ConstructProcess();
   
   // hadronic physics lists
-  for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();
-  
-  // decay process
-  //
-  G4Decay* fDecayProcess = new G4Decay();
-
-  theParticleIterator->reset();
-  while( (*theParticleIterator)() ){
-    G4ParticleDefinition* particle = theParticleIterator->value();
-    G4ProcessManager* pmanager = particle->GetProcessManager();
-
-    if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) { 
-
-      pmanager ->AddProcess(fDecayProcess);
-
-      // set ordering for PostStepDoIt and AtRestDoIt
-      pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
-      pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
-
-    }
+  for(size_t i=0; i<hadronPhys.size(); i++) {
+    hadronPhys[i]->ConstructProcess();
   }
   
   // step limitation (as a full process)
   //  
-  AddStepMax();
-  
-  G4EmProcessOptions opt;
-  opt.SetDEDXBinning(480);
+  AddStepMax();  
 }
 
@@ -196,5 +139,5 @@
 void PhysicsList::AddPhysicsList(const G4String& name)
 {
-  if (verboseLevel>-1) {
+  if (verboseLevel>1) {
     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
   }
@@ -202,5 +145,5 @@
   if (name == emName) return;
 
-  if (name == "standard") {
+  if (name == "standard_local") {
 
     emName = name;
@@ -212,5 +155,5 @@
     emName = name;
     delete emPhysicsList;
-    emPhysicsList = new G4EmStandardPhysics();
+    emPhysicsList = new G4EmStandardPhysics(1);
 
   } else if (name == "emstandard_opt1") {
@@ -225,4 +168,10 @@
     delete emPhysicsList;
     emPhysicsList = new G4EmStandardPhysics_option2();
+    
+  } else if (name == "emstandard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();    
 
   } else if (name == "standardSS") {
@@ -238,9 +187,14 @@
     emPhysicsList = new PhysListEmStandardNR(name);
 
-  } else if (name == "standardIG") {
-
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmStandardIG(name);
+  } else if (name == "standardICRU73") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard(name);
+    em_config.SetExtraEmModel("GenericIon","ionIoni",
+			      new G4IonParametrisedLossModel(),
+			      "",0.0, 100.0*TeV,
+			      new G4IonFluctuations());
+    G4cout << "standardICRU73" << G4endl;
 
   } else if (name == "livermore") {
@@ -288,6 +242,4 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-#include "StepMax.hh"
-
 void PhysicsList::AddStepMax()
 {
@@ -297,11 +249,11 @@
   theParticleIterator->reset();
   while ((*theParticleIterator)()){
-      G4ParticleDefinition* particle = theParticleIterator->value();
-      G4ProcessManager* pmanager = particle->GetProcessManager();
-
-      if (stepMaxProcess->IsApplicable(*particle) && pmanager)
-        {
-	  pmanager ->AddDiscreteProcess(stepMaxProcess);
-        }
+    G4ParticleDefinition* particle = theParticleIterator->value();
+    G4ProcessManager* pmanager = particle->GetProcessManager();
+
+    if (stepMaxProcess->IsApplicable(*particle) && pmanager)
+      {
+	pmanager ->AddDiscreteProcess(stepMaxProcess);
+      }
   }
 }
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:58:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:58:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.3 2006/06/29 16:58:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.21 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: RunAction.cc,v 1.24 2008/08/22 18:30:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,8 +42,5 @@
 
 #include "Randomize.hh"
-
-#ifdef G4ANALYSIS_USE
-#include "AIDA/AIDA.h"
-#endif
+#include "Histo.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -51,19 +48,13 @@
 RunAction::RunAction(DetectorConstruction* det, PhysicsList* phys,
                      PrimaryGeneratorAction* kin)
-:detector(det), physics(phys), kinematic(kin), af(0), tree(0)
+:detector(det), physics(phys), kinematic(kin)
 { 
   tallyEdep = new G4double[MaxTally];
   binLength = offsetX = 0.;
-  histo[0] = 0;
-  
-#ifdef G4ANALYSIS_USE
-  // Creating the analysis factory
-  af = AIDA_createAnalysisFactory();
-  if(!af) {
-    G4cout << "RunAction::RunAction() :" 
-	   << " problem creating the AIDA analysis factory."
-	   << G4endl;
-  } 	   
-#endif  
+  histo = new Histo();
+  histo->setFileName("testem7");
+  histo->add1D("1","Edep (MeV/mm) along absorber (mm)", 100, 0, 100);
+  histo->add1D("2","Edep (MeV/mm) along absorber zoomed (mm)", 100, 0, 100);
+  histo->add1D("3","Projectile range (mm)", 100, 0, 100);
 }
 
@@ -73,63 +64,5 @@
 {
   delete [] tallyEdep;
-  
-#ifdef G4ANALYSIS_USE
-  delete af;  
-#endif      
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void RunAction::bookHisto()
-{
-  length  = detector->GetAbsorSizeX();
-  G4double stepMax = physics->GetStepMaxProcess()->GetMaxStep();
-  const G4int nbmin = 100;
-  G4int nbBins = (int)(0.5 + length/stepMax);
-  if (nbBins < nbmin) nbBins = nbmin;
-  binLength = length/nbBins;
-  offsetX   = 0.5*length;
- 
-#ifdef G4ANALYSIS_USE
-  if (!af) return;
-
-  // Create a tree mapped to an hbook file.
-  G4bool readOnly  = false;
-  G4bool createNew = true;
-  G4String options = "--noErrors uncompress";
-  AIDA::ITreeFactory* tf  = af->createTreeFactory();  
-  tree = tf->create("testem7.hbook","hbook", readOnly, createNew, options);
-  //tree = tf->create("testem7.root", "root",readOnly, createNew, options);
-  //tree = tf->create("testem7.XML" , "XML" ,readOnly, createNew, options);
-  delete tf;
-  if (!tree) {
-    G4cout << "RunAction::bookHisto()" << G4endl;
-    return;
-  }
-
-  // Create a histogram factory, whose histograms will be handled by the tree
-  AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
-  
-  // Create histogram
-  histo[0] = hf->createHistogram1D("1","Edep (MeV/mm) along absorber (mm)",
-             nbBins, 0, length/mm);
-	     
-  delete hf;	     
-  G4cout << "\n----> Histogram Tree opened" << G4endl;
-#endif
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void RunAction::cleanHisto()
-{
-#ifdef G4ANALYSIS_USE
-  tree->commit();       // Writing the histograms to the file
-  tree->close();        // and closing the tree (and the file)
-  delete tree;
-  tree = 0;
-  
-  G4cout << "\n----> Histogram Tree saved" << G4endl;  
-#endif
+  delete histo;  
 }
 
@@ -138,7 +71,5 @@
 void RunAction::FillHisto(G4int ih, G4double x, G4double weight)
 {
-#ifdef G4ANALYSIS_USE
-  if(histo[ih]) histo[ih]->fill(x, weight);
-#endif
+  histo->fill(ih, x, weight);
 }
 
@@ -156,9 +87,24 @@
   //
   nPrimarySteps = 0;
+  nRange = 0;
   projRange = projRange2 = 0.;
   edeptot = eniel = 0.;
   for (G4int j=0; j<MaxTally; j++) tallyEdep[j] = 0.;
   kinematic->ResetEbeamCumul();
-  bookHisto();      
+
+  // define "1" histogram binning
+  length  = detector->GetAbsorSizeX();
+  G4double stepMax = physics->GetStepMaxProcess()->GetMaxStep();
+  const G4int nbmin = 100;
+  G4int nbBins = (G4int)(0.5 + length/stepMax);
+  if (nbBins < nbmin) nbBins = nbmin;
+  binLength = length/nbBins;
+  offsetX   = 0.5*length;
+   
+  // histogram "1" is defined by the length of the target
+  // zoomed histograms are defined by UI command
+  histo->setHisto1D(0, nbBins, 0, length, mm);
+ 
+  histo->book();
 }
 
@@ -186,5 +132,8 @@
   //compute projected range and straggling
   //
-  projRange /= NbofEvents; projRange2 /= NbofEvents;
+  if(nRange > 0) {
+    projRange /= nRange; 
+    projRange2 /= nRange;
+  }
   G4double rms = projRange2 - projRange*projRange;        
   if (rms>0.) rms = std::sqrt(rms); else rms = 0.;
@@ -227,13 +176,10 @@
   }
 
-#ifdef G4ANALYSIS_USE
   // normalize histogram
   G4double fac = (mm/MeV)/(NbofEvents *  binLength);
-  histo[0]->scale(fac);
-#endif
-  
+  for (G4int j=0; j<3; j++) {histo->scale(j, fac);}
  
   // save and clean histo
-  cleanHisto();
+  histo->save();
  
   // show Rndm status
Index: trunk/examples/extended/electromagnetic/TestEm7/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.5 2006/06/29 16:58:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:58:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/SteppingAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: SteppingAction.cc,v 1.12 2008/01/14 12:11:39 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: SteppingAction.cc,v 1.14 2008/08/22 18:30:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -51,28 +51,29 @@
 void SteppingAction::UserSteppingAction(const G4Step* aStep)
 {
- G4double edep = aStep->GetTotalEnergyDeposit();
- if (edep <= 0.) return;
+  G4double edep = aStep->GetTotalEnergyDeposit();
+  if (edep <= 0.) return;
 
- // G4cout << "edep= " << edep << "NIEL= " << aStep->GetNonIonizingEnergyDeposit()<<G4endl;
+  // G4cout << "edep= " << edep << "NIEL= " << aStep->GetNonIonizingEnergyDeposit()<<G4endl;
 
- runAction->FillEdep(edep,aStep->GetNonIonizingEnergyDeposit());
+  runAction->FillEdep(edep,aStep->GetNonIonizingEnergyDeposit());
 
- if(aStep->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep();  
+  if(aStep->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep();  
  
- //Bragg curve
- //	
- G4StepPoint* prePoint  = aStep->GetPreStepPoint();
- G4StepPoint* postPoint = aStep->GetPostStepPoint();
+  //Bragg curve
+  //	
+  G4StepPoint* prePoint  = aStep->GetPreStepPoint();
+  G4StepPoint* postPoint = aStep->GetPostStepPoint();
    
- G4double x1 = prePoint->GetPosition().x(), x2 = postPoint->GetPosition().x();  
- G4double x = runAction->GetOffsetX() + x1 + G4UniformRand()*(x2-x1);
- runAction->FillHisto(0, x/mm , edep);
+  G4double x1 = prePoint->GetPosition().x(), x2 = postPoint->GetPosition().x();  
+  G4double x = runAction->GetOffsetX() + x1 + G4UniformRand()*(x2-x1);
+  runAction->FillHisto(0, x/mm , edep);
+  runAction->FillHisto(1, x/mm , edep);
 
- //fill tallies
- //
- G4TouchableHandle touchable = prePoint->GetTouchableHandle();
- G4LogicalVolume* lVolume = touchable->GetVolume()->GetLogicalVolume();
- if (lVolume == detector->GetLogicalTally())
-     runAction->FillTallyEdep(touchable->GetCopyNumber(), edep);
+  //fill tallies
+  //
+  G4TouchableHandle touchable = prePoint->GetTouchableHandle();
+  G4LogicalVolume* lVolume = touchable->GetVolume()->GetLogicalVolume();
+  if (lVolume == detector->GetLogicalTally())
+    runAction->FillTallyEdep(touchable->GetCopyNumber(), edep);
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm7/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:58:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm7/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm7/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm7/src/TrackingAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: TrackingAction.cc,v 1.3 2006/11/22 17:58:11 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: TrackingAction.cc,v 1.5 2008/08/22 18:30:27 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -50,5 +50,8 @@
     G4double x = aTrack->GetPosition().x() + runAction->GetOffsetX();
     if(x > runAction->GetLength()) x = runAction->GetLength(); 
-    runAction->AddProjRange(x);
+    //G4cout << " range= " << x << " x= " << aTrack->GetPosition().x()
+    //	   << " ofset= " << runAction->GetOffsetX() << G4endl;
+    if(x > 0.0) runAction->AddProjRange(x);
+    runAction->FillHisto(2, x/mm, 1.0);
   }  
 }
Index: trunk/examples/extended/electromagnetic/TestEm8/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.7 2006/10/26 16:20:33 maire Exp $
+# $Id: GNUmakefile,v 1.8 2008/06/11 22:27:45 maire Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -15,15 +15,7 @@
 all: lib bin
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
+#### G4ANALYSIS_USE := true
 
 include $(G4INSTALL)/config/architecture.gmk
 
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
-
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm8/TestEm8.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/TestEm8.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/TestEm8.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm8.cc,v 1.8 2007/07/27 15:29:38 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorHit.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorHit.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8CalorHit.hh,v 1.4 2006/06/29 16:58:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorimeterSD.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorimeterSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8CalorimeterSD.hh,v 1.4 2006/06/29 16:59:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8DetectorConstruction.hh,v 1.9 2007/10/02 10:12:47 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8DetectorMessenger.hh,v 1.6 2007/10/02 10:12:47 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8EventAction.hh,v 1.4 2006/06/29 16:59:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8EventActionMessenger.hh,v 1.4 2006/06/29 16:59:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:59:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8PrimaryGeneratorMessenger.hh,v 1.4 2006/06/29 16:59:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8RunAction.hh,v 1.8 2006/06/29 16:59:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunMessenger.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: Em8RunMessenger.hh,v 1.4 2006/06/29 16:59:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8SteppingAction.hh,v 1.5 2006/06/29 16:59:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8SteppingVerbose.hh,v 1.4 2006/06/29 16:59:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsList.hh	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysicsList.hh,v 1.2 2006/06/29 16:59:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.hh,v 1.3 2008/11/21 12:39:24 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -40,4 +40,5 @@
 #include "G4VModularPhysicsList.hh"
 #include "globals.hh"
+#include "G4EmConfigurator.hh"
 
 class G4VPhysicsConstructor;
@@ -49,35 +50,46 @@
 class PhysicsList: public G4VModularPhysicsList
 {
-  public:
-    PhysicsList();
-   ~PhysicsList();
+public:
+  PhysicsList();
+  virtual ~PhysicsList();
 
-    void ConstructParticle();
+  void ConstructParticle();
     
-    void SetCuts();
-    void SetCutForGamma(G4double);
-    void SetCutForElectron(G4double);
-    void SetCutForPositron(G4double);
+  void SetCuts();
+  void SetCutForGamma(G4double);
+  void SetCutForElectron(G4double);
+  void SetCutForPositron(G4double);
         
-    void AddPhysicsList(const G4String& name);
-    void ConstructProcess();
+  void AddPhysicsList(const G4String& name);
+  void ConstructProcess();
     
-    void AddStepMax();       
-    StepMax* GetStepMaxProcess() {return stepMaxProcess;};
+  void AddStepMax();       
+  //StepMax* GetStepMaxProcess() {return stepMaxProcess;};
 
-  private:
-    G4double cutForGamma;
-    G4double cutForElectron;
-    G4double cutForPositron;
+private:
 
-    G4VPhysicsConstructor*  emPhysicsList;
-    G4VPhysicsConstructor*  generalPhysicsList;
-    G4VPhysicsConstructor*  particleList;
-    std::vector<G4VPhysicsConstructor*>  hadronPhys;
-    G4String emName;
+  void  AddPAIModel(const G4String&);
+  void  NewPAIModel(const G4ParticleDefinition*, const G4String& modname, 
+		    const G4String& procname);
+
+  G4EmConfigurator em_config;
+
+  G4double cutForGamma;
+  G4double cutForElectron;
+  G4double cutForPositron;
+
+  G4VPhysicsConstructor*  emPhysicsList;
+  G4VPhysicsConstructor*  generalPhysicsList;
+  G4VPhysicsConstructor*  particleList;
+  std::vector<G4VPhysicsConstructor*>  hadronPhys;
+  G4String emName;
     
-    StepMax* stepMaxProcess;
+  StepMax* stepMaxProcess;
     
-    PhysicsListMessenger* pMessenger;
+  PhysicsListMessenger* pMessenger;
+
+  G4VEmModel* em_model;
+  G4VEmFluctuationModel* fm_model;
+
 };
 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsListMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:59:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.2 2006/06/29 16:59:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm8/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:59:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm8/include/TRTDetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/TRTDetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/TRTDetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TRTDetectorConstruction.hh,v 1.4 2006/06/29 16:59:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/include/TRTMaterials.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/include/TRTMaterials.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/include/TRTMaterials.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TRTMaterials.hh,v 1.4 2006/06/29 17:00:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorHit.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorHit.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8CalorHit.cc,v 1.5 2006/06/29 17:00:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorimeterSD.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorimeterSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8CalorimeterSD.cc,v 1.7 2006/06/29 17:00:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8DetectorConstruction.cc,v 1.21 2007/10/02 10:12:47 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8DetectorMessenger.cc,v 1.8 2007/10/02 10:12:47 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8EventAction.cc,v 1.10 2007/11/12 10:54:49 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8EventActionMessenger.cc,v 1.5 2006/06/29 17:00:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8PrimaryGeneratorAction.cc,v 1.7 2006/06/29 17:00:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 17:00:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8RunAction.cc,v 1.15 2007/11/12 10:54:49 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8RunMessenger.cc,v 1.7 2006/06/29 17:00:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8SteppingAction.cc,v 1.10 2007/11/12 10:54:49 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Em8SteppingVerbose.cc,v 1.8 2006/06/29 17:00:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsList.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysicsList.cc,v 1.14 2007/09/26 10:23:17 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.16 2008/12/05 17:46:12 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
@@ -36,9 +36,11 @@
 
 #include "G4EmStandardPhysics.hh"
+#include "G4EmStandardPhysics_option1.hh"
+#include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
 #include "G4DecayPhysics.hh"
 
-#include "PhysListEmModelPai.hh"
-#include "PhysListEmPaiPhoton.hh"
-#include "PhysListEmPAI.hh"
+#include "G4PAIModel.hh"
+#include "G4PAIPhotonModel.hh"
 
 #include "G4Gamma.hh"
@@ -69,6 +71,4 @@
   pMessenger = new PhysicsListMessenger(this);
 
-  SetVerboseLevel(1);
-
   // Decay Physics is always defined
   generalPhysicsList = new G4DecayPhysics();
@@ -76,6 +76,7 @@
   // EM physics
   emName = G4String("emstandard");
-  emPhysicsList = new G4EmStandardPhysics();
-
+  emPhysicsList = new G4EmStandardPhysics(1);
+
+  SetVerboseLevel(1);
 }
 
@@ -104,4 +105,5 @@
   AddTransportation();
   emPhysicsList->ConstructProcess();
+  em_config.AddModels();
   generalPhysicsList->ConstructProcess();
   for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();
@@ -113,33 +115,41 @@
 void PhysicsList::AddPhysicsList(const G4String& name)
 {
-  if (verboseLevel>-1) {
+  if (verboseLevel>1) {
     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
   }
 
-  if (name == emName) return;
-
-  if (name == "pai") 
-  {
+  if (name == emName) {
+    return;
+
+  } else if (name == "emstandard_opt1") {
+
     emName = name;
     delete emPhysicsList;
-    emPhysicsList = new PhysListEmModelPai(name);
-    G4cout<<"PhysListEmModelPai is called"<<G4endl;
-  }
-  else if (name == "pai_photon") 
-  {
+    emPhysicsList = new G4EmStandardPhysics_option1();
+
+  } else if (name == "emstandard_opt2") {
+
     emName = name;
     delete emPhysicsList;
-    emPhysicsList = new PhysListEmPaiPhoton(name);
-    G4cout<<"PhysListEmModelPaiPhoton is called"<<G4endl;
-  } 
-  else if (name == "pai_brem") 
-  {
+    emPhysicsList = new G4EmStandardPhysics_option2();
+
+  } else if (name == "emstandard_opt3") {
+
     emName = name;
     delete emPhysicsList;
-    emPhysicsList = new PhysListEmPAI(name);
-    G4cout<<"PhysListEmPAI is called (bremsstrahlung dedx added)"<<G4endl;
-  } 
-  else 
-  {
+    emPhysicsList = new G4EmStandardPhysics_option3();
+
+  } else if (name == "pai") {
+
+    emName = name;
+    AddPAIModel(name);
+
+  } else if (name == "pai_photon") { 
+
+    emName = name;
+    AddPAIModel(name);
+
+  } else {
+
     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
            << " is not defined"
@@ -156,5 +166,4 @@
 
   theParticleIterator->reset();
-
   while ((*theParticleIterator)())
   {
@@ -216,2 +225,44 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
+void PhysicsList::AddPAIModel(const G4String& modname)
+{
+  theParticleIterator->reset();
+  while ((*theParticleIterator)())
+  {
+    G4ParticleDefinition* particle = theParticleIterator->value();
+    G4String partname = particle->GetParticleName();
+    if(partname == "e-" || partname == "e+") {
+      NewPAIModel(particle, modname, "eIoni");
+
+    } else if(partname == "mu-" || partname == "mu+") {
+      NewPAIModel(particle, modname, "muIoni");
+
+    } else if(partname == "proton" ||
+	      partname == "pi+" ||
+              partname == "pi-"   
+	      ) {
+      NewPAIModel(particle, modname, "hIoni");
+    }
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void PhysicsList::NewPAIModel(const G4ParticleDefinition* part, 
+			      const G4String& modname,
+			      const G4String& procname)
+{
+  G4String partname = part->GetParticleName();
+  if(modname == "pai") {
+    G4PAIModel* pai = new G4PAIModel(part,"PAIModel");
+    em_config.SetExtraEmModel(partname,procname,pai,"VertexDetector",
+			      0.0,100.*TeV,pai);
+  } else if(modname == "pai_photon") {
+    G4PAIPhotonModel* pai = new G4PAIPhotonModel(part,"PAIPhotModel");
+    em_config.SetExtraEmModel(partname,procname,pai,"VertexDetector",
+			      0.0,100.*TeV,pai);
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsListMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 17:00:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm8/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.3 2006/06/29 17:00:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm8/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm8/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm8/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 17:00:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/GNUmakefile
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/GNUmakefile	(revision 1230)
@@ -1,4 +1,4 @@
-# $Id: GNUmakefile,v 1.8 2006/10/26 15:50:35 maire Exp $
-# GEANT4 tag $Name:  $
+# $Id: GNUmakefile,v 1.9 2008/06/11 22:31:05 maire Exp $
+# GEANT4 tag $Name: geant4-09-03-cand-01 $
 # --------------------------------------------------------------
 # GNUmakefile for examples module with AIDA interface
@@ -16,15 +16,7 @@
 all: lib bin
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
+#### G4ANALYSIS_USE := true
 
 include $(G4INSTALL)/config/architecture.gmk
-
-# for the aida-config command see the README file
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/electromagnetic/TestEm9/TestEm9.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/TestEm9.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/TestEm9.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: TestEm9.cc,v 1.8 2006/11/17 17:45:05 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/cms10gev.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/cms10gev.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/cms10gev.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: cms10gev.mac,v 1.2 2006/10/26 15:50:35 maire Exp $
+# $Id: cms10gev.mac,v 1.5 2008/09/24 10:38:46 vnivanch Exp $
 #
 # Macro file for "TestEm9.cc" 
@@ -10,12 +10,14 @@
 #
 /testem/det/CalMat     G4_PbWO4
-/testem/del/EcalLength 230 mm
+/testem/det/EcalLength 230 mm
 /testem/det/EcalWidth   22 mm
 #
-/testem/phys/addPhysics  standard
+#/testem/phys/addPhysics  emstandard_opt2
+/testem/phys/addPhysics  standardLPM
 #
+/testem/phys/setCuts 1 mm
 /testem/phys/VertexCuts 0.01 mm
 /testem/phys/MuonCuts  10.0 mm
-/testem/stepMax          10 mm
+#/testem/stepMax          10 mm
 #
 #
@@ -31,14 +33,17 @@
 #/random/resetEngineFrom first.rndm
 /testem/event/printModulo 1000
-/testem/histo/fileName  cms.paw
-/testem/histo/setHisto  0 75  7000  8500 MeV
-/testem/histo/setHisto  1 100 9000 10000 MeV
-/testem/histo/setHisto  2 100 9500 10000 MeV
-#/testem/histo/fileType  hbook
-/testem/
+/testem/histo/fileName cms10gev1mm
+/testem/histo/fileType root
+/testem/histo/setHisto 0  250 0.60 0.85 
+/testem/histo/setHisto 1  200 0.80 1.00 
+/testem/histo/setHisto 2  100 0.90 1.00 
+/testem/histo/setHisto 10  80 0.80 0.88 
+/testem/histo/setHisto 11 100 0.75 0.85 
+/testem/histo/setHisto 12  40 0.94 0.98 
+/run/initialize
+/run/beamOn 10000
 #
-/testem/phys/setCuts 1 mm
-/run/initialize
-/run/beamOn 1000
+/testem/phys/setCuts 3 mm
+/testem/histo/fileName cms10gev3mm
+/run/beamOn 10000
 #
-#
Index: trunk/examples/extended/electromagnetic/TestEm9/csi.mac
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/csi.mac	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/csi.mac	(revision 1230)
@@ -1,4 +1,4 @@
 # $Id: csi.mac,v 1.4 2006/10/26 15:50:35 maire Exp $
-# GEANT4 tag $Name:  $
+# GEANT4 tag $Name: geant4-09-03-cand-01 $
 #
 # Macro file for TestEm9 - Crystal Calorimeter
Index: trunk/examples/extended/electromagnetic/TestEm9/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/DetectorConstruction.hh	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: DetectorConstruction.hh,v 1.5 2006/06/29 17:00:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: DetectorConstruction.hh,v 1.7 2008/04/07 18:09:05 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
@@ -57,4 +57,5 @@
 class DetectorMessenger;
 class G4Region;
+class G4ProductionCuts;
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -65,5 +66,5 @@
 
   DetectorConstruction();
-  ~DetectorConstruction();
+  virtual ~DetectorConstruction();
 
 public:
@@ -71,10 +72,10 @@
   void SetEcalMaterial(const G4String&);
   void SetAbsMaterial(const G4String&);
-  void SetEcalLength (G4double val)   {ecalLength = val;};
-  void SetEcalWidth  (G4double val)   {ecalWidth = val;};
-  void SetVertexLength (G4double val) {vertexLength = val;};
-  void SetPadLength  (G4double val)   {padLength = val;};
-  void SetPadWidth  (G4double val)    {padWidth = val;};
-  void SetAbsLength(G4double val)     {absLength = val;};
+  void SetEcalLength(G4double val);
+  void SetEcalWidth(G4double val);
+  void SetVertexLength(G4double val);
+  void SetPadLength(G4double val);
+  void SetPadWidth(G4double val);
+  void SetAbsLength(G4double val);
 
   G4VPhysicalVolume* Construct();
@@ -82,5 +83,5 @@
   void UpdateGeometry();
 
-  G4double GetWorldSizeZ()            {return worldZ;}
+  G4double GetWorldSizeZ()  {return worldZ;}
 
 private:
@@ -106,12 +107,21 @@
   G4Material* yorkMaterial;
 
-  G4LogicalVolume* logicC;
+  G4LogicalVolume* logicWorld;
+  G4LogicalVolume* logicECal;
+  G4LogicalVolume* logicCal;
   G4LogicalVolume* logicA1;
   G4LogicalVolume* logicA2;
   G4LogicalVolume* logicA3;
   G4LogicalVolume* logicA4;
+  G4LogicalVolume* logicYV;
+  G4LogicalVolume* logicY;
+  G4LogicalVolume* logicVV;
+  G4LogicalVolume* logicVD;
+  G4LogicalVolume* logicV;
   
   G4Region*   vertexRegion;
   G4Region*   muonRegion;
+  G4ProductionCuts* vertexDetectorCuts;
+  G4ProductionCuts* muonDetectorCuts;
 
   DetectorMessenger* detectorMessenger;  //pointer to the Messenger
Index: trunk/examples/extended/electromagnetic/TestEm9/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.4 2006/06/29 17:00:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/include/EmAcceptance.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/EmAcceptance.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/EmAcceptance.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EmAcceptance.hh,v 1.2 2006/06/29 17:01:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/include/EventAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/EventAction.hh	(revision 1230)
@@ -28,5 +28,5 @@
 
 // $Id: EventAction.hh,v 1.3 2006/06/29 17:01:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Index: trunk/examples/extended/electromagnetic/TestEm9/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 17:01:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/include/Histo.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/Histo.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/Histo.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: Histo.hh,v 1.5 2007/05/24 13:17:41 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef Histo_h
Index: trunk/examples/extended/electromagnetic/TestEm9/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/HistoManager.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.hh,v 1.8 2007/04/24 14:20:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: HistoManager.hh,v 1.11 2008/09/24 10:38:46 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef HistoManager_h
@@ -110,5 +110,5 @@
   void SetThresholdEnergy(G4double val) {thKinE = val;};
   void SetThresholdZ(G4double val) {thPosZ = val;};
-  void AddStep() {n_step++;};
+  void AddStep() {n_step += 1.0;};
 
   // Acceptance parameters
@@ -133,4 +133,6 @@
 
   G4double trackLength;
+  G4double n_step;
+  G4double n_step_target;
   G4bool trackAbs;        // Track is in absorber
   G4int n_evt;
@@ -138,8 +140,7 @@
   G4int n_posit;
   G4int n_gam;
-  G4int n_step;
   G4int n_gamph;
   G4int n_gam_tar;
-  G4int n_step_target;
+  G4int n_lowe;
   G4int nBinsE, nBinsEA, nBinsED;
   G4bool nTuple;
@@ -153,9 +154,9 @@
   G4double  rmstrue[3];
   G4double  limittrue[3];
-  G4double  edep[3];
-  G4double  erms[3];
-  G4double  edeptr[3];
-  G4double  ermstr[3];
-  G4int     stat[3];
+  G4double  edep[6];
+  G4double  erms[6];
+  G4double  edeptr[6];
+  G4double  ermstr[6];
+  G4int     stat[6];
   G4int     nmax;
 
Index: trunk/examples/extended/electromagnetic/TestEm9/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/HistoMessenger.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.3 2006/06/29 17:01:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmLivermore.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmLivermore.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmLivermore.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmLivermore.hh,v 1.1 2006/11/17 17:45:57 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmPenelope.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmPenelope.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmPenelope.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPenelope.hh,v 1.1 2006/11/17 17:45:57 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmStandard.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.3 2006/06/29 17:02:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsList.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.hh,v 1.5 2006/11/17 17:03:26 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.hh,v 1.7 2008/04/07 18:09:05 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -61,5 +61,5 @@
 public:
   PhysicsList();
-  ~PhysicsList();
+  virtual ~PhysicsList();
 
   void ConstructParticle();
@@ -69,5 +69,4 @@
   void SetCutForElectron(G4double);
   void SetCutForPositron(G4double);
-  void SetMscStepLimit(G4bool val);
 
   void AddPhysicsList(const G4String& name);
@@ -89,4 +88,6 @@
   G4double cutForElectron;
   G4double cutForPositron;
+  G4double cutForVertexDetector;
+  G4double cutForMuonDetector;
 
   G4VPhysicsConstructor*  emPhysicsList;
@@ -102,5 +103,4 @@
   G4ProductionCuts* muonDetectorCuts;
 
-  G4bool mscStepLimit;
   G4bool helIsRegisted;
   G4bool bicIsRegisted;
Index: trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsListMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.4 2006/06/29 17:02:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/electromagnetic/TestEm9/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 17:02:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/include/StepMax.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.3 2006/06/29 17:02:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 17:02:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/include/SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingAction.hh,v 1.3 2006/06/29 17:02:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/DetectorConstruction.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: DetectorConstruction.cc,v 1.9 2006/06/29 17:02:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: DetectorConstruction.cc,v 1.11 2008/04/07 18:09:05 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
@@ -58,4 +58,5 @@
 #include "G4Region.hh"
 #include "G4RegionStore.hh"
+#include "G4ProductionCuts.hh"
 #include "G4PhysicalVolumeStore.hh"
 #include "G4LogicalVolumeStore.hh"
@@ -72,5 +73,5 @@
 
 DetectorConstruction::DetectorConstruction()
-  :logicC(0),logicA1(0),logicA2(0)
+  : G4VUserDetectorConstruction()
 {
   detectorMessenger = new DetectorMessenger(this);
@@ -84,5 +85,10 @@
   vertexRegion = 0;
   muonRegion   = 0;
+  logicWorld   = 0;
+  logicCal     = 0;
+  logicA1      = 0;
   DefineMaterials();
+  vertexDetectorCuts = new G4ProductionCuts();
+  muonDetectorCuts   = new G4ProductionCuts();
 }
 
@@ -90,5 +96,9 @@
 
 DetectorConstruction::~DetectorConstruction()
-{ delete detectorMessenger;}
+{ 
+  delete detectorMessenger;
+  delete vertexDetectorCuts;
+  delete muonDetectorCuts;
+}
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -106,5 +116,5 @@
 
   G4NistManager* man = G4NistManager::Instance();
-  man->SetVerbose(1);
+  //  man->SetVerbose(1);
   worldMaterial = man->FindOrBuildMaterial("G4_AIR");
   absMaterial   = man->FindOrBuildMaterial("G4_Al");
@@ -118,17 +128,24 @@
 G4VPhysicalVolume* DetectorConstruction::ConstructVolumes()
 {
-  G4cout << *(G4Material::GetMaterialTable()) << G4endl;
-
   // Cleanup old geometry
 
   G4GeometryManager::GetInstance()->OpenGeometry();
+
+  if(G4NistManager::Instance()->GetVerbose() > 0)
+    G4cout << *(G4Material::GetMaterialTable()) << G4endl;
+
+  if(vertexRegion) {
+    delete vertexRegion;
+    delete muonRegion;
+  }
+  vertexRegion = new G4Region("VertexDetector");
+  vertexRegion->SetProductionCuts(vertexDetectorCuts);
+
+  muonRegion   = new G4Region("MuonDetector");
+  muonRegion->SetProductionCuts(muonDetectorCuts);
+
+  G4SolidStore::GetInstance()->Clean();
+  G4LogicalVolumeStore::GetInstance()->Clean();
   G4PhysicalVolumeStore::GetInstance()->Clean();
-  G4LogicalVolumeStore::GetInstance()->Clean();
-  G4SolidStore::GetInstance()->Clean();
-
-  if(vertexRegion) delete vertexRegion;
-  if(muonRegion) delete muonRegion;
-  vertexRegion = new G4Region("VertexDetector");
-  muonRegion   = new G4Region("MuonDetector");
 
   if(vertexLength < padLength*5.0) vertexLength = padLength*5.0;
@@ -137,11 +154,13 @@
   G4double york   = 10.*cm;
 
-           worldZ = 2.*vertexLength + 3.*absLength + 0.5*(ecalLength + york) + biggap*2.;
+  worldZ = 2.*vertexLength + 3.*absLength + 0.5*(ecalLength + york) + biggap*2.;
+
   G4double worldX = ecalWidth*3.0;
   G4double vertexZ= -worldZ + vertexLength*2.0 + absLength     + biggap;
   G4double absZ2  = -worldZ + vertexLength*4.0 + absLength*3.5 + biggap;
-  G4double ecalZ  = -worldZ + vertexLength*4.0 + absLength*4.0 + ecalLength*0.5 + 2.*biggap;
+  G4double ecalZ  = -worldZ + vertexLength*4.0 + absLength*4.0 + ecalLength*0.5 
+    + 2.*biggap;
   G4double yorkZ  = -worldZ + vertexLength*4.0 + absLength*5.0 + ecalLength
-                            + york*0.5 + 3.*biggap;
+    + york*0.5 + 3.*biggap;
 
   //
@@ -149,8 +168,7 @@
   //
   G4Box* solidW = new G4Box("World",worldX,worldX,worldZ);
-  G4LogicalVolume* logicW = new G4LogicalVolume( solidW,worldMaterial,
-                                                "World");
+  logicWorld = new G4LogicalVolume( solidW,worldMaterial,"World");
   G4VPhysicalVolume* world = new G4PVPlacement(0,G4ThreeVector(),
-                                       "World",logicW,0,false,0);
+					       "World",logicWorld,0,false,0);
 
   //
@@ -158,14 +176,13 @@
   //
   G4Box* solidE = new G4Box("VolE",worldX,worldX,ecalLength*0.5 + gap);
-  G4LogicalVolume* logicE = new G4LogicalVolume( solidE,worldMaterial,
-                                                "VolE");
+  logicECal = new G4LogicalVolume( solidE,worldMaterial,"VolE");
   G4VPhysicalVolume* physE = new G4PVPlacement(0,G4ThreeVector(0.,0.,ecalZ),
-                                       "VolE",logicE,world,false,0);
+					       "VolE",logicECal,world,false,0);
 
   G4Box* solidC = new G4Box("Ecal",ecalWidth*0.5,ecalWidth*0.5,ecalLength*0.5);
-  logicC = new G4LogicalVolume( solidC,calMaterial,"Ecal");
+  logicCal = new G4LogicalVolume( solidC,calMaterial,"Ecal");
 
   G4cout << "Ecal is " << G4BestUnit(ecalLength,"Length")
-       << " of " << calMaterial->GetName() << G4endl;
+	 << " of " << calMaterial->GetName() << G4endl;
 
   // Crystals
@@ -182,5 +199,5 @@
     for (j=0; j<5; j++) {
 
-      pv = new G4PVPlacement(0,G4ThreeVector(x,y,0.),"Ecal",logicC,
+      pv = new G4PVPlacement(0,G4ThreeVector(x,y,0.),"Ecal",logicCal,
                                     physE,false,k);
       k++;
@@ -195,43 +212,41 @@
   logicA2 = new G4LogicalVolume( solidA,absMaterial,"Abs2");
   pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,absZ2),
-                                       "Abs2",logicA2,world,false,0);
+			 "Abs2",logicA2,world,false,0);
 
   G4cout << "Absorber is " << G4BestUnit(absLength,"Length")
-       << " of " << absMaterial->GetName() << G4endl;
+	 << " of " << absMaterial->GetName() << G4endl;
 
   //York
 
   G4Box* solidYV = new G4Box("VolY",worldX,worldX,york*0.5+absLength);
-  G4LogicalVolume* logicYV = new G4LogicalVolume( solidYV,yorkMaterial,"VolY");
+  logicYV = new G4LogicalVolume( solidYV,yorkMaterial,"VolY");
   G4VPhysicalVolume* physYV = new G4PVPlacement(0,G4ThreeVector(0.,0.,yorkZ),
-                                       "VolY",logicYV,world,false,0);
+						"VolY",logicYV,world,false,0);
 
   G4Box* solidY = new G4Box("York",worldX,worldX,york*0.5);
-  G4LogicalVolume* logicY = new G4LogicalVolume( solidY,yorkMaterial,"York");
+  logicY = new G4LogicalVolume( solidY,yorkMaterial,"York");
   pv = new G4PVPlacement(0,G4ThreeVector(),
-                                       "York",logicY,physYV,false,0);
+			 "York",logicY,physYV,false,0);
 
   logicA3 = new G4LogicalVolume( solidA,absMaterial,"Abs3");
   logicA4 = new G4LogicalVolume( solidA,absMaterial,"Abs4");
+
   pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,-(york+absLength)*0.5),
-                                       "Abs3",logicA3,physYV,false,0);
+			 "Abs3",logicA3,physYV,false,0);
   pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,(york+absLength)*0.5),
-                                       "Abs4",logicA4,physYV,false,0);
+			 "Abs4",logicA4,physYV,false,0);
 
   //Vertex volume
-
   G4Box* solidVV = new G4Box("VolV",worldX,worldX,vertexLength*2.+absLength+gap);
-  G4LogicalVolume* logicVV = new G4LogicalVolume( solidVV,worldMaterial,"VolV");
+  logicVV = new G4LogicalVolume( solidVV,worldMaterial,"VolV");
   G4VPhysicalVolume* physVV = new G4PVPlacement(0,G4ThreeVector(0.,0.,vertexZ),
-                                       "VolV",logicVV,world,false,0);
+						"VolV",logicVV,world,false,0);
 
   //Absorber
-
   logicA1 = new G4LogicalVolume( solidA,absMaterial,"Abs1");
   pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,vertexLength*2.-absLength*0.5),
-                                       "Abs1",logicA1,physVV,false,0);
+			 "Abs1",logicA1,physVV,false,0);
 
   //Vertex
-
   G4double vertWidth = ecalWidth/5.;
   G4int npads = (G4int)(vertWidth/padWidth);
@@ -242,8 +257,9 @@
 
   G4Box* solidVD = new G4Box("VertDet",x1,ecalWidth*0.5+gap,padLength*0.5);
-  G4LogicalVolume* logicVD = new G4LogicalVolume( solidVD,vertMaterial,"VertDet");
+  logicVD = new G4LogicalVolume( solidVD,vertMaterial,"VertDet");
+  logicVD->SetSolid(solidVD);
 
   G4Box* solidV = new G4Box("Vert",padWidth*0.5,ecalWidth*0.5,padLength*0.5);
-  G4LogicalVolume* logicV = new G4LogicalVolume( solidV,vertMaterial,"Vert");
+  logicV = new G4LogicalVolume( solidV,vertMaterial,"Vert");
 
   for (i=0; i<3; i++) {
@@ -267,21 +283,18 @@
 
   // Define region for the vertex detector
-
   vertexRegion->AddRootLogicalVolume(logicVV);
   vertexRegion->AddRootLogicalVolume(logicA3);
 
   // Define region for the muon detector
-
   muonRegion->AddRootLogicalVolume(logicYV);
 
   // color regions
-
   logicVV-> SetVisAttributes(G4VisAttributes::Invisible);
   logicV-> SetVisAttributes(G4VisAttributes::Invisible);
-  logicE-> SetVisAttributes(G4VisAttributes::Invisible);
+  logicECal-> SetVisAttributes(G4VisAttributes::Invisible);
   logicYV-> SetVisAttributes(G4VisAttributes::Invisible);
 
   G4VisAttributes* regWcolor = new G4VisAttributes(G4Colour(0.3, 0.3, 0.3));
-  logicW->SetVisAttributes(regWcolor);
+  logicWorld->SetVisAttributes(regWcolor);
 
   G4VisAttributes* regVcolor = new G4VisAttributes(G4Colour(0., 0.3, 0.7));
@@ -289,5 +302,5 @@
 
   G4VisAttributes* regCcolor = new G4VisAttributes(G4Colour(0., 0.7, 0.3));
-  logicC->SetVisAttributes(regCcolor);
+  logicCal->SetVisAttributes(regCcolor);
 
   G4VisAttributes* regAcolor = new G4VisAttributes(G4Colour(1., 0.5, 0.5));
@@ -302,5 +315,5 @@
   // always return world
   G4cout << "### New geometry is constructed" << G4endl;
-
+ 
   return world;
 }
@@ -313,5 +326,11 @@
   G4Material* pttoMaterial = 
     G4NistManager::Instance()->FindOrBuildMaterial(mat, false);
-  if (pttoMaterial) calMaterial = pttoMaterial;
+  if (pttoMaterial) {
+    calMaterial = pttoMaterial;
+    if(logicCal) {
+      logicCal->SetMaterial(calMaterial);
+      G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+    }
+  }
 }
 
@@ -323,5 +342,14 @@
   G4Material* pttoMaterial = 
     G4NistManager::Instance()->FindOrBuildMaterial(mat, false);
-  if (pttoMaterial) absMaterial = pttoMaterial;
+  if (pttoMaterial) {
+    absMaterial = pttoMaterial;
+    if(logicA1) {
+      logicA1->SetMaterial(absMaterial);
+      logicA2->SetMaterial(absMaterial);
+      logicA3->SetMaterial(absMaterial);
+      logicA4->SetMaterial(absMaterial);
+      G4RunManager::GetRunManager()->PhysicsHasBeenModified();
+    }
+  }
 }
 
@@ -330,6 +358,67 @@
 void DetectorConstruction::UpdateGeometry()
 {
+  G4RunManager::GetRunManager()->PhysicsHasBeenModified();
   G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void DetectorConstruction::SetEcalLength (G4double val)   
+{
+  if(val > 0.0) {
+    ecalLength = val;
+    G4RunManager::GetRunManager()->GeometryHasBeenModified();
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void DetectorConstruction::SetEcalWidth  (G4double val)   
+{
+  if(val > 0.0) {
+    ecalWidth = val;
+    G4RunManager::GetRunManager()->GeometryHasBeenModified();
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void DetectorConstruction::SetVertexLength (G4double val) 
+{
+  if(val > 0.0) {
+    vertexLength = val;
+    G4RunManager::GetRunManager()->GeometryHasBeenModified();
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void DetectorConstruction::SetPadLength  (G4double val)   
+{
+  if(val > 0.0) {
+    padLength = val;
+    G4RunManager::GetRunManager()->GeometryHasBeenModified();
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void DetectorConstruction::SetPadWidth  (G4double val)    
+{
+  if(val > 0.0) {
+    padWidth = val;
+    G4RunManager::GetRunManager()->GeometryHasBeenModified();
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void DetectorConstruction::SetAbsLength(G4double val)     
+{
+  if(val > 0.0) {
+    absLength = val;
+    G4RunManager::GetRunManager()->GeometryHasBeenModified();
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 17:03:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/src/EmAcceptance.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/EmAcceptance.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/EmAcceptance.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: EmAcceptance.cc,v 1.4 2006/06/29 17:03:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/src/EventAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.4 2006/06/29 17:03:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Index: trunk/examples/extended/electromagnetic/TestEm9/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 17:03:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/src/Histo.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/Histo.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/Histo.cc	(revision 1230)
@@ -53,5 +53,5 @@
   verbose    = 0;
   histName   = "testem9";
-  histType   = "hbook";
+  histType   = "root";
   nHisto     = 0;
   defaultAct = 1;
@@ -93,6 +93,7 @@
 
   G4String nam = histName + "." + histType;
-
-  tree = tf->create(nam,histType,false,true,"uncompress");
+  G4String options  = "--noErrors export=root uncompress";
+  
+  tree = tf->create(nam,histType,false,true,options);
   delete tf;
   if(tree) {
@@ -107,6 +108,9 @@
   // Creating an 1-dimensional histograms in the root directory of the tree
   for(G4int i=0; i<nHisto; i++) {
-    if(active[i]) 
-      histo[i] = hf->createHistogram1D(ids[i], titles[i], bins[i], xmin[i], xmax[i]);
+    if(active[i]) {
+      G4String ss = ids[i];
+      if(histType == "root") ss = "h" + ids[i];
+      histo[i] = hf->createHistogram1D(ss, titles[i], bins[i], xmin[i], xmax[i]);
+    }
   }
   delete hf;
Index: trunk/examples/extended/electromagnetic/TestEm9/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/HistoManager.cc	(revision 1230)
@@ -87,5 +87,5 @@
   nBinsED= 100;
   nTuple = false;
-  nHisto = 10;
+  nHisto = 13;
 
   // initialise acceptance
@@ -97,11 +97,11 @@
 
   histo->add1D("10",
-    "Energy deposit (MeV) in central crystal",nBinsED,0.0,beamEnergy,MeV);
+    "Evis/E0 in central crystal",nBinsED,0.0,1,1.0);
 
   histo->add1D("11",
-    "Energy deposit (MeV) in 3x3",nBinsED,0.0,beamEnergy,MeV);
+    "Evis/E0 in 3x3",nBinsED,0.0,1.0,1.0);
 
   histo->add1D("12",
-    "Energy deposit (MeV) in 5x5",nBinsED,0.0,beamEnergy,MeV);
+    "Evis/E0 in 5x5",nBinsED,0.0,1.0,1.0);
 
   histo->add1D("13",
@@ -125,4 +125,13 @@
   histo->add1D("19",
     "Number of vertex hits",20,-0.5,19.5,1.0);
+
+  histo->add1D("20",
+    "E1/E9 Ratio",nBinsED,0.0,1,1.0);
+
+  histo->add1D("21",
+    "E1/25 Ratio",nBinsED,0.0,1.0,1.0);
+
+  histo->add1D("22",
+    "E9/E25 Ratio",nBinsED,0.0,1.0,1.0);
 
   if(nTuple) {
@@ -141,11 +150,14 @@
   n_gam  = 0;
   n_step = 0;
-
-  for(G4int i=0; i<nmax; i++) {
+  n_lowe = 0;
+
+  for(G4int i=0; i<6; i++) {
     stat[i] = 0;
     edep[i] = 0.0;
     erms[i] = 0.0;
-    edeptr[i] = 0.0;
-    ermstr[i] = 0.0;
+    if(i < 3) {
+      edeptr[i] = 0.0;
+      ermstr[i] = 0.0;
+    }
   }
 
@@ -164,5 +176,5 @@
 
   G4cout << "HistoManager: End of run actions are started" << G4endl;
-  G4String nam[3] = {"1x1", "3x3", "5x5"};
+  G4String nam[6] = {"1x1", "3x3", "5x5", "E1/E9 ", "E1/E25", "E9/E25"};
 
   // average
@@ -175,6 +187,6 @@
 
     // total mean
-    edep[j] *= x/beamEnergy;
-    G4double y = erms[j]*x/(beamEnergy*beamEnergy) - edep[j]*edep[j];
+    edep[j] *= x;
+    G4double y = erms[j]*x - edep[j]*edep[j];
     if(y < 0.0) y = 0.0;
     erms[j] = std::sqrt(y);
@@ -183,6 +195,6 @@
     G4double xx = G4double(stat[j]);
     if(xx > 0.0) xx = 1.0/xx;
-    edeptr[j] *= xx/beamEnergy;
-    y = ermstr[j]*xx/(beamEnergy*beamEnergy) - edeptr[j]*edeptr[j];
+    edeptr[j] *= xx;
+    y = ermstr[j]*xx - edeptr[j]*edeptr[j];
     if(y < 0.0) y = 0.0;
     ermstr[j] = std::sqrt(y);
@@ -191,5 +203,5 @@
   G4double xg = x*(G4double)n_gam;
   G4double xp = x*(G4double)n_posit;
-  G4double xs = x*(G4double)n_step;
+  G4double xs = x*n_step;
 
   G4double f = 100.*std::sqrt(beamEnergy/GeV);
@@ -201,8 +213,10 @@
   G4cout << std::setprecision(4) << "Average number of steps      " << xs << G4endl;
   
-  for(j=0; j<nmax; j++) {
+  for(j=0; j<3; j++) {
     G4double e = edeptr[j];
     G4double s = ermstr[j];
-    G4double r = s*std::sqrt(x);
+    G4double xx= G4double(stat[j]);
+    if(xx > 0.0) xx = 1.0/xx;
+    G4double r = s*std::sqrt(xx);
     G4cout << std::setprecision(4) << "Edep " << nam[j] << " =                   " << e
            << " +- " << r;
@@ -222,4 +236,20 @@
     }
   }
+  G4cout<<"===========  Ratios without trancating ==========================="<<G4endl;
+  for(j=3; j<6; j++) {
+    G4double e = edep[j];
+    G4double xx= G4double(stat[j]);
+    if(xx > 0.0) xx = 1.0/xx;
+    e *= xx;
+    G4double y = erms[j]*xx - e*e;
+    G4double r = 0.0;
+    if(y > 0.0) r = std::sqrt(y*xx);
+    G4cout << "  " << nam[j] << " =                   " << e
+           << " +- " << r;
+    G4cout << G4endl;
+  }
+  G4cout << std::setprecision(4) << "Beam Energy                  " << beamEnergy/GeV 
+	 << " GeV" << G4endl;
+  if(n_lowe > 0)          G4cout << "Number of events E/E0<0.8    " << n_lowe << G4endl; 
   G4cout<<"=================================================================="<<G4endl;
   G4cout<<G4endl;
@@ -264,5 +294,5 @@
   Evertex.clear();
   Nvertex.clear();
-  for (int i=0; i<25; i++) {
+  for (G4int i=0; i<25; i++) {
     E[i] = 0.0;
   }
@@ -275,9 +305,37 @@
   G4double e9 = 0.0;
   G4double e25= 0.0;
-  for (int i=0; i<25; i++) {
+  for (G4int i=0; i<25; i++) {
+    E[i] /= beamEnergy;
     e25 += E[i];
     if( ( 6<=i &&  8>=i) || (11<=i && 13>=i) || (16<=i && 18>=i)) e9 += E[i];
   }
-  histo->fill(0,E[12],1.0);
+
+  if(e25 < 0.8) {
+    n_lowe++;
+    G4cout << "### in the event# " << n_evt << "  E25= " << e25 << G4endl;
+  }
+
+  // compute ratios
+  G4double e0 = E[12];
+  G4double e19  = 0.0;
+  G4double e125 = 0.0;
+  G4double e925 = 0.0;
+  if(e9 > 0.0) {
+    e19 = e0/e9;
+    e125 = e0/e25;
+    e925 = e9/e25;
+    edep[3] += e19;
+    erms[3] += e19*e19;
+    edep[4] += e125;
+    erms[4] += e125*e125;
+    edep[5] += e925;
+    erms[5] += e925*e925;
+    stat[3] += 1;
+    stat[4] += 1;
+    stat[5] += 1;
+  }
+
+  // fill histo
+  histo->fill(0,e0,1.0);
   histo->fill(1,e9,1.0);
   histo->fill(2,e25,1.0);
@@ -286,9 +344,10 @@
   histo->fill(7,Eabs3,1.0);
   histo->fill(8,Eabs4,1.0);
-  float nn = (double)(Nvertex.size());
-  histo->fill(9,nn,1.0);
-
-  G4double e0 = E[12];
-
+  histo->fill(9,G4double(Nvertex.size()),1.0);
+  histo->fill(10,e19,1.0);
+  histo->fill(11,e125,1.0);
+  histo->fill(12,e925,1.0);
+
+  // compute sums
   edep[0] += e0;
   erms[0] += e0*e0;
@@ -299,15 +358,15 @@
 
   // trancated mean
-  if(limittrue[0] == DBL_MAX || std::abs(e0/beamEnergy-edeptrue[0])<rmstrue[0]*limittrue[0]) {
+  if(limittrue[0] == DBL_MAX || std::abs(e0-edeptrue[0])<rmstrue[0]*limittrue[0]) {
     stat[0] += 1;
     edeptr[0] += e0;
     ermstr[0] += e0*e0;
   }
-  if(limittrue[1] == DBL_MAX || std::abs(e9/beamEnergy-edeptrue[1])<rmstrue[1]*limittrue[1]) {
+  if(limittrue[1] == DBL_MAX || std::abs(e9-edeptrue[1])<rmstrue[1]*limittrue[1]) {
     stat[1] += 1;
     edeptr[1] += e9;
     ermstr[1] += e9*e9;
   }
-  if(limittrue[2] == DBL_MAX || std::abs(e25/beamEnergy-edeptrue[2])<rmstrue[2]*limittrue[2]) {
+  if(limittrue[2] == DBL_MAX || std::abs(e25-edeptrue[2])<rmstrue[2]*limittrue[2]) {
     stat[2] += 1;
     edeptr[2] += e25;
@@ -333,4 +392,5 @@
   if(0 == pid) {
 
+    beamEnergy = kinE;
     histo->fillTuple("TKIN", kinE/MeV);
 
Index: trunk/examples/extended/electromagnetic/TestEm9/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/HistoMessenger.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: HistoMessenger.cc,v 1.6 2006/06/29 17:03:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: HistoMessenger.cc,v 1.7 2008/08/22 14:11:53 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -60,5 +60,5 @@
   //
   G4UIparameter* ih = new G4UIparameter("ih",'i',false);
-  ih->SetGuidance("histo number : from 1 to MaxHisto");
+  ih->SetGuidance("histo number : from 0 to MaxHisto-1");
   histoCmd->SetParameter(ih);
   //
@@ -110,5 +110,6 @@
      G4String unit = unts;
      G4double vUnit = 1. ;
-     if (unit != "none") vUnit = G4UIcommand::ValueOf(unit);
+     if(unit != "none") vUnit = G4UIcommand::ValueOf(unit);
+     if(vUnit <= 0.0)  vUnit = 1.;
      histo->setHisto1D(ih,nbBins,vmin,vmax,vUnit);
    }
Index: trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmLivermore.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmLivermore.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmLivermore.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmLivermore.cc,v 1.2 2007/01/08 16:29:42 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmPenelope.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmPenelope.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmPenelope.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPenelope.cc,v 1.1 2006/11/17 17:45:57 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmStandard.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysListEmStandard.cc,v 1.8 2006/11/22 19:09:12 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysListEmStandard.cc,v 1.13 2008/11/16 21:01:10 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,5 +39,6 @@
 #include "G4PhotoElectricEffect.hh"
 
-#include "G4MultipleScattering.hh"
+#include "G4eMultipleScattering.hh"
+#include "G4hMultipleScattering.hh"
 
 #include "G4eIonisation.hh"
@@ -48,7 +49,12 @@
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
+#include "G4hBremsstrahlung.hh"
+#include "G4hPairProduction.hh"
 
 #include "G4hIonisation.hh"
 #include "G4ionIonisation.hh"
+
+#include "G4EmProcessOptions.hh"
+#include "G4MscStepLimitType.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -83,22 +89,31 @@
     } else if (particleName == "e-") {
   
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation(),      -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation(),       -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
 	    
     } else if (particleName == "e+") {
 
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4eIonisation(),      -1, 2,2);
-      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
-      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
+      pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4eIonisation(),       -1, 2, 2);
+      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
       
     } else if (particleName == "mu+" || 
                particleName == "mu-"    ) {
 
-      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
-      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
-      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
-      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4MuIonisation,        -1, 2, 2);
+      pmanager->AddProcess(new G4MuBremsstrahlung,    -1, 3, 3);
+      pmanager->AddProcess(new G4MuPairProduction,    -1, 4, 4);       
+
+    } else if (particleName == "proton" || 
+               particleName == "pi-" ||  
+	       particleName == "pi+") {
+
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
+      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
+      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
 
     } else if (particleName == "alpha" ||
@@ -106,6 +121,6 @@
 	       particleName == "GenericIon") {
 
-      pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
-      pmanager->AddProcess(new G4ionIonisation,      -1, 2,2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
      
     } else if ((!particle->IsShortLived()) &&
@@ -113,8 +128,39 @@
 	       (particle->GetParticleName() != "chargedgeantino")) {
 
-      pmanager->AddProcess(new G4MultipleScattering,-1,1,1);
-      pmanager->AddProcess(new G4hIonisation,       -1,2,2);
+      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
+      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
     }
   }
+  
+  // Em options
+  //
+  // Main options and setting parameters are shown here.
+  // Several of them have default values.
+  //  
+  G4EmProcessOptions emOptions;
+  
+  //physics tables
+  //
+  emOptions.SetMinEnergy(100*eV);	//default    
+  emOptions.SetMaxEnergy(100*TeV);	//default  
+  emOptions.SetDEDXBinning(12*20);	//default=12*7  
+  emOptions.SetLambdaBinning(12*20);	//default=12*7
+  emOptions.SetSplineFlag(true);	//default  
+    
+  //coulomb scattering
+  //
+  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
+  emOptions.SetMscRangeFactor(0.04);	//default
+  emOptions.SetMscGeomFactor (2.5);	//default       
+  emOptions.SetSkin(3.);		//default
+          
+  //energy loss
+  //
+  emOptions.SetStepFunction(0.2, 100*um);	//default=(0.2, 1*mm)   
+  emOptions.SetLinearLossLimit(1.e-2);		//default
+   
+  //ionization
+  //
+  emOptions.SetSubCutoff(true);		//default=false  
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.19 2007/11/13 14:44:26 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: PhysicsList.cc,v 1.24 2008/10/16 11:48:58 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
@@ -46,8 +46,8 @@
 
 #include "PhysListEmStandard.hh"
-#include "PhysListEmStandardIG.hh"
 #include "G4EmStandardPhysics.hh"
 #include "G4EmStandardPhysics_option1.hh"
 #include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
 #include "PhysListEmLivermore.hh"
 #include "PhysListEmPenelope.hh"
@@ -85,4 +85,6 @@
   cutForElectron  = defaultCutValue;
   cutForPositron  = defaultCutValue;
+  cutForVertexDetector = defaultCutValue;
+  cutForMuonDetector   = defaultCutValue;
 
   vertexDetectorCuts = 0;
@@ -96,5 +98,4 @@
   SetVerboseLevel(1);
 
-  mscStepLimit   = true;
   helIsRegisted  = false;
   bicIsRegisted  = false;
@@ -106,6 +107,6 @@
 
   // EM physics
-  emName = G4String("standard");
-  emPhysicsList = new PhysListEmStandard(emName);
+  emName = G4String("emstandard");
+  emPhysicsList = new G4EmStandardPhysics();
 }
 
@@ -173,5 +174,12 @@
       G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
 
-  } else if (name == "standard") {
+  } else if (name == "emstandard_opt3") {
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
+    if (verboseLevel > 0) 
+      G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
+
+  } else if (name == "emstandard_local") {
     emName = name;
     delete emPhysicsList;
@@ -179,11 +187,4 @@
     if (verboseLevel > 0) 
       G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
-
-  } else if (name == "standardIG") {
-    emName = name;
-    delete emPhysicsList;
-    emPhysicsList = new PhysListEmStandardIG();
-    if (verboseLevel > 0) 
-      G4cout << "PhysicsList::Set StandardIG EM physics" << G4endl;
 
   } else if (name == "livermore") {
@@ -255,21 +256,23 @@
 void PhysicsList::SetCuts()
 {
-
   SetCutValue(cutForGamma, "gamma", "DefaultRegionForTheWorld");
   SetCutValue(cutForElectron, "e-", "DefaultRegionForTheWorld");
   SetCutValue(cutForPositron, "e+", "DefaultRegionForTheWorld");
-  G4cout << "PhysicsList: world cuts are set cutG= " << cutForGamma/mm 
-	 << " mm    cutE= " << cutForElectron/mm << " mm " << G4endl;
-
-  if( !vertexDetectorCuts ) SetVertexCut(cutForElectron);
+  //  G4cout << "PhysicsList: world cuts are set cutG= " << cutForGamma/mm 
+  //	 << " mm    cutE= " << cutForElectron/mm << " mm " << G4endl;
+
+  //G4cout << " cutV= " << cutForVertexDetector 
+  //     << " cutM= " << cutForMuonDetector<<G4endl;
+
   G4Region* region = (G4RegionStore::GetInstance())->GetRegion("VertexDetector");
-  region->SetProductionCuts(vertexDetectorCuts);
-  G4cout << "Vertex cuts are set" << G4endl;
-
-  if( !muonDetectorCuts ) SetMuonCut(cutForElectron);
+  vertexDetectorCuts = region->GetProductionCuts();
+  SetVertexCut(cutForVertexDetector);
+  //  G4cout << "Vertex cuts are set" << G4endl;
+ 
   region = (G4RegionStore::GetInstance())->GetRegion("MuonDetector");
-  region->SetProductionCuts(muonDetectorCuts);
-  G4cout << "Muon cuts are set" << G4endl;
-
+  muonDetectorCuts = region->GetProductionCuts();
+  SetMuonCut(cutForMuonDetector);
+  //G4cout << "Muon cuts are set " <<muonRegion << " " << muonDetectorCuts << G4endl;
+  
   if (verboseLevel>0) DumpCutValuesTable();
 }
@@ -303,10 +306,11 @@
 void PhysicsList::SetVertexCut(G4double cut)
 {
-  if( !vertexDetectorCuts ) vertexDetectorCuts = new G4ProductionCuts();
-
-  vertexDetectorCuts->SetProductionCut(cut, idxG4GammaCut);
-  vertexDetectorCuts->SetProductionCut(cut, idxG4ElectronCut);
-  vertexDetectorCuts->SetProductionCut(cut, idxG4PositronCut);
-
+  cutForVertexDetector = cut;
+  
+  if( vertexDetectorCuts ) {
+    vertexDetectorCuts->SetProductionCut(cut, idxG4GammaCut);
+    vertexDetectorCuts->SetProductionCut(cut, idxG4ElectronCut);
+    vertexDetectorCuts->SetProductionCut(cut, idxG4PositronCut);
+  } 
 }
 
@@ -315,18 +319,13 @@
 void PhysicsList::SetMuonCut(G4double cut)
 {
-  if( !muonDetectorCuts ) muonDetectorCuts = new G4ProductionCuts();
-
-  muonDetectorCuts->SetProductionCut(cut, idxG4GammaCut);
-  muonDetectorCuts->SetProductionCut(cut, idxG4ElectronCut);
-  muonDetectorCuts->SetProductionCut(cut, idxG4PositronCut);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void PhysicsList::SetMscStepLimit(G4bool val)
-{
-  mscStepLimit = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
+  cutForMuonDetector   = cut;
+
+  if( muonDetectorCuts ) {
+    muonDetectorCuts->SetProductionCut(cut, idxG4GammaCut);
+    muonDetectorCuts->SetProductionCut(cut, idxG4ElectronCut);
+    muonDetectorCuts->SetProductionCut(cut, idxG4PositronCut);
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 17:03:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.cc,v 1.4 2008/04/03 15:07:55 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -143,6 +143,6 @@
    { pPhysicsList->AddPhysicsList(newValue);}
 
-  if( command == mscCmd )
-   { pPhysicsList->SetMscStepLimit(mscCmd->GetNewBoolValue(newValue));}
+  //  if( command == mscCmd )
+  // { pPhysicsList->SetMscStepLimit(mscCmd->GetNewBoolValue(newValue));}
 }
 
Index: trunk/examples/extended/electromagnetic/TestEm9/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 17:03:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/electromagnetic/TestEm9/src/StepMax.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.3 2006/06/29 17:03:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 17:03:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/electromagnetic/TestEm9/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/electromagnetic/TestEm9/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/electromagnetic/TestEm9/src/SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SteppingAction.cc,v 1.2 2006/06/29 17:03:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/errorpropagation/GNUmakefile
===================================================================
--- trunk/examples/extended/errorpropagation/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/errorpropagation/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.1 2007/05/28 08:31:53 gcosmo Exp $
+# $Id: GNUmakefile,v 1.2 2009/03/06 09:50:28 gbarrand Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -15,15 +15,5 @@
 all: lib bin
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/errorpropagation/errprop.cc
===================================================================
--- trunk/examples/extended/errorpropagation/errprop.cc	(revision 1187)
+++ trunk/examples/extended/errorpropagation/errprop.cc	(revision 1230)
@@ -48,5 +48,5 @@
 void Initialize();
 G4ErrorTarget* BuildTarget( G4int iTarget );
-void ProcessEvent( G4int iProp, uint nEv );
+void ProcessEvent( G4int iProp, size_t nEv );
 void Finalize();
 
@@ -77,6 +77,6 @@
   } 
 
-  uint nEvents = 3;
-  for( uint ii = 0; ii < nEvents; ii++ ){
+  size_t nEvents = 3;
+  for( size_t ii = 0; ii < nEvents; ii++ ){
     ProcessEvent( iProp, ii );
   }
@@ -149,5 +149,5 @@
 
 
-void ProcessEvent( G4int iProp, uint )
+void ProcessEvent( G4int iProp, size_t )
 {
   
Index: trunk/examples/extended/eventgenerator/HepMC/HepMCEx01/hepmcEx01.cc
===================================================================
--- trunk/examples/extended/eventgenerator/HepMC/HepMCEx01/hepmcEx01.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/HepMC/HepMCEx01/hepmcEx01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: hepmcEx01.cc,v 1.5 2006/07/05 11:06:36 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/eventgenerator/HepMC/HepMCEx02/hepmcEx02.cc
===================================================================
--- trunk/examples/extended/eventgenerator/HepMC/HepMCEx02/hepmcEx02.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/HepMC/HepMCEx02/hepmcEx02.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: hepmcEx02.cc,v 1.5 2006/07/05 12:04:07 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/eventgenerator/exgps/GNUmakefile
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.3 2005/07/19 08:35:49 flei Exp $
+# $Id: GNUmakefile,v 1.5 2008/12/02 21:42:48 flei Exp $
 # --------------------------------------------------------------
 # GNUmakefile for tests module.  Gabriele Cosmo, 27/06/98.
@@ -21,6 +21,2 @@
 #LDFLAGS += -static
 
-ifdef G4ANALYSIS_USE
-   CPPFLAGS += `aida-config --include`
-   LDLIBS += `aida-config --lib`
-endif
Index: trunk/examples/extended/eventgenerator/exgps/display_vrml.mac
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/display_vrml.mac	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/display_vrml.mac	(revision 1230)
@@ -7,3 +7,6 @@
 /vis/scene/endOfEventAction accumulate
 /tracking/storeTrajectory 1
+#
+# Flush visualization
+#/vis/viewer/update
 
Index: trunk/examples/extended/eventgenerator/exgps/exGPS.cc
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/exGPS.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/exGPS.cc	(revision 1230)
@@ -34,9 +34,10 @@
 
 #ifdef G4ANALYSIS_USE
-#include <AIDA/AIDA.h>
 #include "exGPSAnalysisManager.hh"
 #endif
 
+#ifdef G4VIS_USE
 #include "G4VisExecutive.hh"
+#endif
 
 #include "exGPSGeometryConstruction.hh"
@@ -54,5 +55,5 @@
 #ifdef G4ANALYSIS_USE
   //constructe the analysis manager (need here to activate the UI)
-  exGPSAnalysisManager* aMgr = exGPSAnalysisManager::getInstance(); 
+  exGPSAnalysisManager::getInstance(); 
 #endif
 
@@ -88,6 +89,8 @@
   
   // visualization manager
+#ifdef G4VIS_USE
   G4VisManager* visManager = new G4VisExecutive;
   visManager->Initialize();
+#endif
     
   //Initialize G4 kernel
@@ -114,8 +117,10 @@
 
 #ifdef G4ANALYSIS_USE
-  delete aMgr;
+  exGPSAnalysisManager::dispose();
 #endif
 
+#ifdef G4VIS_USE
   delete visManager;
+#endif
   delete runManager;
   
Index: trunk/examples/extended/eventgenerator/exgps/include/exGPSAnalysisManager.hh
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/include/exGPSAnalysisManager.hh	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/include/exGPSAnalysisManager.hh	(revision 1230)
@@ -31,11 +31,13 @@
 #include "globals.hh"
 
-using namespace AIDA;
+namespace AIDA {
 
-class AIDA::IAnalysisFactory;
-class AIDA::ITree;
-class AIDA::IHistogramFactory;
-class AIDA::ITupleFactory;
-class AIDA::IPlotter;
+class IAnalysisFactory;
+class ITree;
+class IPlotter;
+class IHistogram1D;
+class IHistogram2D;
+class ITuple;
+}
 
 class exGPSAnalysisMessenger;
@@ -48,14 +50,9 @@
 private:
   exGPSAnalysisManager ();
+  virtual ~exGPSAnalysisManager ();
 
 public:
-  virtual ~exGPSAnalysisManager ();
   static exGPSAnalysisManager* getInstance ();
   static void dispose();
-
-  IHistogramFactory* getHistogramFactory();
-  ITupleFactory* getTupleFactory();
-  IPlotter* createPlotter();
-
 
 public:
@@ -80,21 +77,18 @@
   G4String fileType;
 
-  IAnalysisFactory* analysisFactory;
-  IHistogramFactory* hFactory;
-  ITupleFactory* tFactory;
-  ITree* tree;
+  AIDA::IAnalysisFactory* analysisFactory;
+  AIDA::ITree* tree;
+  AIDA::IPlotter* plotter;
 
   G4double minpos, maxpos;
   G4double mineng, maxeng;
 
-  IHistogram1D* enerHisto;
-  IHistogram2D* posiXY;
-  IHistogram2D* posiXZ;
-  IHistogram2D* posiYZ;
-  IHistogram2D* anglCTP;
-  IHistogram2D* anglTP;
-  ITuple* tuple;
-
-  IPlotter* plotter;
+  AIDA::IHistogram1D* enerHisto;
+  AIDA::IHistogram2D* posiXY;
+  AIDA::IHistogram2D* posiXZ;
+  AIDA::IHistogram2D* posiYZ;
+  AIDA::IHistogram2D* anglCTP;
+  AIDA::IHistogram2D* anglTP;
+  AIDA::ITuple* tuple;
 
   exGPSAnalysisMessenger* analysisMessenger;
Index: trunk/examples/extended/eventgenerator/exgps/include/exGPSEventActionMessenger.hh
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/include/exGPSEventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/include/exGPSEventActionMessenger.hh	(revision 1230)
@@ -32,5 +32,5 @@
 //
 // $Id: exGPSEventActionMessenger.hh,v 1.4 2006/06/29 17:14:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/eventgenerator/exgps/macros/display.mac
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/macros/display.mac	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/macros/display.mac	(revision 1230)
@@ -1,8 +1,8 @@
 #
 /vis/scene/create
-/vis/sceneHandler/create OGLIX
+/vis/sceneHandler/create VRML2FILE
 /vis/viewer/create
 /vis/drawVolume
-/vis/viewer/viewpointThetaPhi 30 30
+#/vis/viewer/viewpointThetaPhi 30 30
 #/vis/viewer/update
 /vis/scene/endOfEventAction accumulate
Index: trunk/examples/extended/eventgenerator/exgps/src/exGPSAnalysisManager.cc
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/src/exGPSAnalysisManager.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/src/exGPSAnalysisManager.cc	(revision 1230)
@@ -37,6 +37,7 @@
 
 exGPSAnalysisManager::exGPSAnalysisManager(): 
-fileName("exgps.aida"),fileType("xml"),analysisFactory(0), hFactory(0), tFactory(0),
-minpos(-10.),maxpos(10),mineng(0.),maxeng(1000.)
+fileName("exgps.aida"),fileType("xml"),analysisFactory(0), tree(0),plotter(0),
+minpos(-10.),maxpos(10),mineng(0.),maxeng(1000.),
+enerHisto(0),posiXY(0),posiXZ(0),posiYZ(0),anglCTP(0),anglTP(0),tuple(0)
 {
   // Define the messenger and the analysis system
@@ -55,31 +56,5 @@
 
 
-IHistogramFactory* exGPSAnalysisManager::getHistogramFactory()
-{
-  return hFactory;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-
-ITupleFactory* exGPSAnalysisManager::getTupleFactory()
-{
-  return tFactory;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-IPlotter* exGPSAnalysisManager::createPlotter()
-{
-#ifdef JAIDA_HOME 
-  if (analysisFactory)
-  {
-    IPlotterFactory* pf = analysisFactory->createPlotterFactory(0,0);
-    if (pf) return pf->create("Plotter");
-  }
-#endif
-  return 0;
-}
-
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -108,10 +83,12 @@
 				G4double t, G4double p, G4double w)
 {
-  enerHisto->fill(e/MeV,w);
-  posiXY->fill(x/cm,y/cm,w);
-  posiXZ->fill(x/cm,z/cm,w);
-  posiYZ->fill(y/cm,z/cm,w);
-  anglCTP->fill(p/deg,std::cos(t),w);
-  anglTP->fill(p/deg,t/deg,w);
+  if(enerHisto) {
+    enerHisto->fill(e/MeV,w);
+    posiXY->fill(x/cm,y/cm,w);
+    posiXZ->fill(x/cm,z/cm,w);
+    posiYZ->fill(y/cm,z/cm,w);
+    anglCTP->fill(p/deg,std::cos(t),w);
+    anglTP->fill(p/deg,t/deg,w);
+  }
 
   if (plotter) plotter->refresh();
@@ -141,20 +118,33 @@
 void exGPSAnalysisManager::BeginOfRun() 
 { 
+  tree = 0;
+  plotter = 0;
+
+  enerHisto =0;
+  posiXY = posiXZ = posiYZ = anglCTP =anglTP = 0;
+  tuple = 0;
 
   // Hooking an AIDA compliant analysis system.
   analysisFactory = AIDA_createAnalysisFactory();
-  if(analysisFactory){
-    ITreeFactory* treeFactory = analysisFactory->createTreeFactory();
+  if(!analysisFactory) //Have to check that, it can fail.
+  {
+    G4cout << "exGPSAnalysisManager::BeginOfRun: can't get AIDA." << G4endl; 
+    return;
+  }
+  AIDA::ITreeFactory* treeFactory = analysisFactory->createTreeFactory();
+  if(treeFactory) 
+  {
     tree = treeFactory->create(fileName,fileType,false,true,"compress=yes");
-    hFactory = analysisFactory->createHistogramFactory(*tree);
-    tFactory = analysisFactory->createTupleFactory(*tree);
+    if(!tree) //Have to check that, it can fail.
+    {
+      G4cout << "exGPSAnalysisManager::BeginOfRun:"
+             << " can't create the AIDA::ITree : " << fileName << G4endl; 
+      return;
+    }
+
     delete treeFactory; // Will not delete the ITree.
   }
-  //
-  enerHisto =0;
-  posiXY = posiXZ = posiYZ = anglCTP =anglTP = 0;
-  plotter = 0;
-  tuple = 0;
-  //
+
+  AIDA::IHistogramFactory* hFactory = analysisFactory->createHistogramFactory(*tree);
   if (hFactory)
   {
@@ -173,28 +163,33 @@
     anglTP = hFactory->createHistogram2D("Source phi-theta distribution",360,0,360
 						  ,180,0,180);
-#ifdef JAIDA_HOME
-    plotter = createPlotter();
-
+    delete hFactory;
+  }
+
+  // Create a Tuple
+
+  AIDA::ITupleFactory* tFactory = analysisFactory->createTupleFactory(*tree);
+  if (tFactory)
+  {
+     tuple = tFactory->create("MyTuple","MyTuple","string Pname, double Energy, X, Y, Z, Theta, Phi, Weight","");
+     delete tFactory;
+  }
+  
+  AIDA::IPlotterFactory* pf = analysisFactory->createPlotterFactory(0,0);
+  if(pf) 
+  {
+    plotter = pf->create();
     if (plotter)
     {
        plotter->createRegions(2,3);
-       plotter->region(0)->plot(*enerHisto);
-       plotter->region(1)->plot(*posiXY);
-       plotter->region(2)->plot(*posiXZ);
-       plotter->region(3)->plot(*posiYZ);
-       plotter->region(4)->plot(*anglCTP);
-       plotter->region(5)->plot(*anglTP);
+       if(enerHisto) plotter->region(0)->plot(*enerHisto);
+       if(posiXY) plotter->region(1)->plot(*posiXY);
+       if(posiXZ) plotter->region(2)->plot(*posiXZ);
+       if(posiYZ) plotter->region(3)->plot(*posiYZ);
+       if(anglCTP) plotter->region(4)->plot(*anglCTP);
+       if(anglTP) plotter->region(5)->plot(*anglTP);
        plotter->show();
-     }
-#endif
-  }
-
-  // Create a Tuple
-
-  if (tFactory)
-  {
-     tuple = tFactory->create("MyTuple","MyTuple","std::string Pname, std::double Energy, X, Y, Z, Theta, Phi, Weight","");
-  }
-
+    }
+    delete pf;
+  }
 }
 
@@ -210,10 +205,18 @@
     if (!tree->commit()) G4cout << "Commit failed: no AIDA file produced!" << G4endl;
     delete tree;
-    delete tFactory;
-    delete hFactory;
+    tree = 0;
     //    G4cout << "Warning: Geant4 will NOT continue unless you close the JAS-AIDA window." << G4endl;
-    delete analysisFactory;
-  }
-  //  dispose();
+
+    delete plotter;
+    plotter = 0;
+
+    delete analysisFactory; //cleanup all AIDA related things.
+    analysisFactory = 0;
+
+    enerHisto = 0;
+    posiXY = posiXZ = posiYZ = anglCTP =anglTP = 0;
+    tuple = 0;
+
+  }
 }
 
Index: trunk/examples/extended/eventgenerator/exgps/src/exGPSAnalysisMessenger.cc
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/src/exGPSAnalysisMessenger.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/src/exGPSAnalysisMessenger.cc	(revision 1230)
@@ -25,6 +25,4 @@
 //
 #ifdef G4ANALYSIS_USE
-
-#include <AIDA/AIDA.h>
 
 #include "exGPSAnalysisMessenger.hh"
Index: trunk/examples/extended/eventgenerator/exgps/src/exGPSEventAction.cc
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/src/exGPSEventAction.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/src/exGPSEventAction.cc	(revision 1230)
@@ -28,5 +28,4 @@
 
 #ifdef G4ANALYSIS_USE
-#include <AIDA/AIDA.h>
 #include "exGPSAnalysisManager.hh"
 #endif
@@ -89,5 +88,6 @@
       E=std::sqrt(P*P+E0*E0);   
       E -= E0;
-      G4String pname = evt->GetPrimaryVertex(j)->GetPrimary(i)->GetG4code()->GetParticleName();
+//      G4String pname = evt->GetPrimaryVertex(j)->GetPrimary(i)->GetG4code()->GetParticleName();
+      G4double pid = G4double(evt->GetPrimaryVertex(j)->GetPrimary(i)->GetPDGcode());
       //
       direction=direction*(1./direction.mag());                
@@ -101,9 +101,11 @@
       z=position.z();
       w = evt->GetPrimaryVertex(j)->GetPrimary(i)->GetWeight();
-      exGPSAnalysisManager::getInstance()->Fill(pname,E,x,y,z,Theta,Phi,w);
+//      exGPSAnalysisManager::getInstance()->Fill(pname,E,x,y,z,Theta,Phi,w);
+     exGPSAnalysisManager::getInstance()->Fill(pid,E,x,y,z,Theta,Phi,w);
     }
   }   
 #endif
-  
+
+#ifdef G4VIS_USE
   // extract the trajectories and draw them
   if (G4VVisManager::GetConcreteInstance())
@@ -122,4 +124,5 @@
        }
    }             
+#endif
 }
 
Index: trunk/examples/extended/eventgenerator/exgps/src/exGPSEventActionMessenger.cc
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/src/exGPSEventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/src/exGPSEventActionMessenger.cc	(revision 1230)
@@ -32,5 +32,5 @@
 //
 // $Id: exGPSEventActionMessenger.cc,v 1.3 2006/06/29 17:14:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/eventgenerator/exgps/src/exGPSRunAction.cc
===================================================================
--- trunk/examples/extended/eventgenerator/exgps/src/exGPSRunAction.cc	(revision 1187)
+++ trunk/examples/extended/eventgenerator/exgps/src/exGPSRunAction.cc	(revision 1230)
@@ -33,5 +33,4 @@
 
 #ifdef G4ANALYSIS_USE
-#include <AIDA/AIDA.h>
 #include "exGPSAnalysisManager.hh"
 #endif
@@ -55,4 +54,5 @@
   G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
 
+#ifdef G4VIS_USE
   if (G4VVisManager::GetConcreteInstance())
     {
@@ -60,4 +60,5 @@
       UI->ApplyCommand("/vis/scene/notifyHandlers");
     } 
+#endif
 #ifdef G4ANALYSIS_USE
   // If analysis is used reset the histograms
@@ -70,7 +71,9 @@
 void exGPSRunAction::EndOfRunAction(const G4Run* )
 {
+#ifdef G4VIS_USE
   if (G4VVisManager::GetConcreteInstance()) {
      G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
   }
+#endif
   // If analysis is used
 #ifdef G4ANALYSIS_USE 
Index: trunk/examples/extended/exoticphysics/monopole/GNUmakefile
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
+# $Id: GNUmakefile,v 1.2 2008/06/11 14:34:19 vnivanch Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -15,15 +15,5 @@
 all: lib bin
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/exoticphysics/monopole/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/DetectorConstruction.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: DetectorConstruction.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: DetectorConstruction.hh,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,51 +46,46 @@
 class DetectorConstruction : public G4VUserDetectorConstruction
 {
-  public:
+public:
   
-    DetectorConstruction();
-   ~DetectorConstruction();
+  DetectorConstruction();
+  ~DetectorConstruction();
 
-  public:
-       
-     void SetSizeX    (G4double);
-     void SetSizeYZ   (G4double);              
-     void SetMaterial (G4String);            
-     void SetMagField (G4double);
+  void SetSizeX    (G4double);
+  void SetSizeYZ   (G4double);              
+  void SetMaterial (G4String);            
+  void SetMagField (G4double);
      
-     void SetMaxStepSize   (G4double);
+  void SetMaxStepSize   (G4double);
      
-     G4VPhysicalVolume* Construct();
-     void               UpdateGeometry();
+  G4VPhysicalVolume* Construct();
+  void               UpdateGeometry();
      
-  public:  
-                    
-     G4double     GetWorldSizeX()    {return worldSizeX;};
-     G4double     GetWorldSizeYZ()   {return worldSizeYZ;};
-     G4Material*  GetWorldMaterial() {return worldMaterial;};     
-     G4double     GetAbsorSizeX()    {return absorSizeX;};
-     G4double     GetAbsorSizeYZ()   {return absorSizeYZ;};
-     G4double     GetMaxStepSize()   {return maxStepSize;};
-     G4Material*  GetAbsorMaterial() {return absorMaterial;};
-     
-     void         PrintParameters();
+  G4double     GetWorldSizeX()    {return worldSizeX;};
+  G4double     GetWorldSizeYZ()   {return worldSizeYZ;};
+  G4Material*  GetWorldMaterial() {return worldMaterial;};     
+  G4double     GetAbsorSizeX()    {return absorSizeX;};
+  G4double     GetAbsorSizeYZ()   {return absorSizeYZ;};
+  G4double     GetMaxStepSize()   {return maxStepSize;};
+  G4Material*  GetAbsorMaterial() {return absorMaterial;};
+  
+  void         PrintParameters();
                        
-  private:
+private:
+
+  void               DefineMaterials();
+  G4VPhysicalVolume* ConstructVolumes();     
   
-     G4double            worldSizeX;
-     G4double            worldSizeYZ;
-     G4Material*         worldMaterial;           
-     G4double            absorSizeX;
-     G4double            absorSizeYZ;
-		 G4double						 maxStepSize;
-     G4Material*         absorMaterial;
-     G4UniformMagField*  magField;
-     G4LogicalVolume*    lAbsor;
+  G4double            worldSizeX;
+  G4double            worldSizeYZ;
+  G4Material*         worldMaterial;           
+  G4double            absorSizeX;
+  G4double            absorSizeYZ;
+  G4double	      maxStepSize;
+  G4Material*         absorMaterial;
+  G4UniformMagField*  magField;
+  G4LogicalVolume*    lAbsor;
                
-     DetectorMessenger* detectorMessenger;
+  DetectorMessenger* detectorMessenger;
 
-  private:
-    
-     void               DefineMaterials();
-     G4VPhysicalVolume* ConstructVolumes();     
 };
 
Index: trunk/examples/extended/exoticphysics/monopole/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/include/EventAction.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/include/G4Monopole.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/G4Monopole.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/G4Monopole.hh	(revision 1230)
@@ -53,4 +53,5 @@
 {
 private:
+
   static G4Monopole*  theMonopole;
 
@@ -66,7 +67,7 @@
        G4DecayTable        *decaytable );
 
+  virtual ~G4Monopole();
+
 public: 
-
-  virtual ~G4Monopole();
   
   static G4Monopole* MonopoleDefinition(G4double mass_ = 100.*GeV, 
Index: trunk/examples/extended/exoticphysics/monopole/include/G4MonopolePhysics.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/G4MonopolePhysics.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/G4MonopolePhysics.hh	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4MonopolePhysics.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: G4MonopolePhysics.hh,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,9 +39,12 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
+class G4MonopolePhysicsMessenger;
+
 class G4MonopolePhysics : public G4VPhysicsConstructor
 {
 public:
-  G4MonopolePhysics(const G4String& name = "EM_monopole");
-  virtual ~G4MonopolePhysics();
+
+  G4MonopolePhysics(const G4String& nam = "Monopole Physics");
+  ~G4MonopolePhysics();
 
   // This method is dummy for physics
@@ -53,9 +56,19 @@
   virtual void ConstructProcess();
 
+  void SetMagneticCharge(G4int);
+  void SetElectricCharge(G4int);
+  void SetMonopoleMass(G4double);
+
 private:
 
   // hide assignment operator
-  G4MonopolePhysics & operator=(const G4MonopolePhysics &right);
-  G4MonopolePhysics(const G4MonopolePhysics&);
+  //  G4MonopolePhysics & operator=(const G4MonopolePhysics &right);
+  // G4MonopolePhysics(const G4MonopolePhysics&);
+
+  G4int    magCharge;
+  G4int    elCharge;
+  G4double monopoleMass;
+
+  G4MonopolePhysicsMessenger*  theMessenger;
 
 };
Index: trunk/examples/extended/exoticphysics/monopole/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PrimaryGeneratorAction.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PrimaryGeneratorAction.hh,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,23 +45,24 @@
 class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
 {
-  public:
-    PrimaryGeneratorAction(DetectorConstruction*);    
-   ~PrimaryGeneratorAction();
+public:
 
-  public:  
-    void SetRndmBeam(G4double val)  {rndmBeam = val;}   
-    void GeneratePrimaries(G4Event*);
+  PrimaryGeneratorAction(DetectorConstruction*);    
+  ~PrimaryGeneratorAction();
+
+  void SetRndmBeam(G4double val)  {rndmBeam = val;}   
+  void GeneratePrimaries(G4Event*);
     
-    void   ResetEbeamCumul() {EbeamCumul = 0.;}
-    G4double GetEbeamCumul() {return EbeamCumul;}
+  void   ResetEbeamCumul() {EbeamCumul = 0.;}
+  G4double GetEbeamCumul() {return EbeamCumul;}
      
-    G4ParticleGun* GetParticleGun() {return particleGun;}
+  G4ParticleGun* GetParticleGun() {return particleGun;}
     
-  private:
-    G4ParticleGun*             particleGun;
-    DetectorConstruction*      detector;
-    G4double                   rndmBeam;
-    G4double                   EbeamCumul;       
-    PrimaryGeneratorMessenger* gunMessenger;     
+private:
+
+  G4ParticleGun*             particleGun;
+  DetectorConstruction*      detector;
+  G4double                   rndmBeam;
+  G4double                   EbeamCumul;       
+  PrimaryGeneratorMessenger* gunMessenger;     
 };
 
Index: trunk/examples/extended/exoticphysics/monopole/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/include/RunAction.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/include/RunActionMessenger.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/RunActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/RunActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunActionMessenger.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/monopole.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/monopole.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/monopole.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: monopole.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: monopole.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,4 +35,5 @@
 #include "G4UItcsh.hh"
 #include "Randomize.hh"
+#include "globals.hh"
 
 #include "DetectorConstruction.hh"
@@ -60,16 +61,26 @@
   G4RunManager * runManager = new G4RunManager;
 
-  //set mandatory initialization classes
-  DetectorConstruction* det;
-
-	//ceate physicsList
+  //create physicsList
   QGSP* phys = new QGSP();
-  G4MonopolePhysics * theMonopole = new G4MonopolePhysics;
+  G4MonopolePhysics * theMonopole = new G4MonopolePhysics();
   phys->RegisterPhysics(theMonopole);
 
-  PrimaryGeneratorAction* kin;
-  runManager->SetUserInitialization(det  = new DetectorConstruction);
-	runManager->SetUserInitialization(phys);
-  runManager->SetUserAction(kin = new PrimaryGeneratorAction(det));
+  //get the pointer to the User Interface manager
+  G4UImanager* UI = G4UImanager::GetUIpointer();
+
+  // Setup monopole
+  G4String s = ""; 
+  if(argc > 2) s = argv[2];
+  UI->ApplyCommand("/control/verbose 1");
+  UI->ApplyCommand("/monopole/setup "+s);
+
+  // mandator user classes
+  DetectorConstruction* det = new DetectorConstruction();
+
+  runManager->SetUserInitialization(det);  
+  runManager->SetUserInitialization(phys);
+
+  PrimaryGeneratorAction* kin = new PrimaryGeneratorAction(det);
+  runManager->SetUserAction(kin);
 
 #ifdef G4VIS_USE
@@ -78,5 +89,5 @@
 #endif
 
-  //set user action classes
+  //user action classes
   RunAction* run;
 
@@ -85,8 +96,4 @@
   runManager->SetUserAction(new TrackingAction(run));
   runManager->SetUserAction(new SteppingAction(det, run));
-
-  //get the pointer to the User Interface manager
-  G4UImanager* UI = G4UImanager::GetUIpointer();
-  G4cout << "User actions are instantiated" << G4endl;
 
   if (argc == 1)   // Define UI terminal for interactive mode
@@ -100,12 +107,12 @@
       session = new G4UIterminal();
 #endif
-     session->SessionStart();
-     delete session;
+      session->SessionStart();
+      delete session;
     }
   else           // Batch mode
     {
-     G4String command = "/control/execute ";
-     G4String fileName = argv[1];
-     UI->ApplyCommand(command+fileName);
+      G4String command = "/control/execute ";
+      G4String fileName = argv[1];
+      UI->ApplyCommand(command+fileName);
     }
 
Index: trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc	(revision 1230)
@@ -103,4 +103,5 @@
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
 G4Monopole* G4Monopole::Monopole()
 {    
Index: trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4MonopolePhysics.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: G4MonopolePhysics.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
@@ -42,6 +42,8 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
+#include "G4MonopolePhysics.hh"
+#include "G4MonopolePhysicsMessenger.hh"
+
 #include "G4Monopole.hh"
-#include "G4MonopolePhysics.hh"
 #include "G4ParticleDefinition.hh"
 #include "G4ProcessManager.hh"
@@ -55,37 +57,83 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4MonopolePhysics::G4MonopolePhysics(const G4String& name):  G4VPhysicsConstructor(name)
-{}
+G4MonopolePhysics::G4MonopolePhysics(const G4String& nam)
+  : G4VPhysicsConstructor(nam)
+{
+  magCharge = 1;
+  elCharge  = 0;
+  monopoleMass = 100.*GeV;
+  theMessenger = new G4MonopolePhysicsMessenger(this);
+}
 
 G4MonopolePhysics::~G4MonopolePhysics()
-{}
+{
+  delete theMessenger;
+}
 
 void G4MonopolePhysics::ConstructParticle()
 {
-  G4Monopole::MonopoleDefinition(); 
+  G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+void G4MonopolePhysics::ConstructProcess()
+{
+  if(verboseLevel > 0) {
+    G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
+  }
+  G4Monopole* mpl = G4Monopole::Monopole();
+  
+  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
+  mpl->SetProcessManager(pmanager);
+  
+  // defined monopole parameters and binning
+
+  G4double emax = 10.*TeV;
+  G4double magn = mpl->MagneticCharge();
+  G4double emin = mpl->GetPDGMass()/20000.;
+  if(emin < keV) emin = keV;
+
+  G4int nbin = G4int(std::log10(emin/eV));
+  emin       = std::pow(10.,G4double(nbin))*eV;
+
+  nbin = G4int(std::log10(emax/emin));
+  if(nbin < 1) nbin = 1;
+  nbin *= 10;
+  
+  pmanager->AddProcess( new G4Transportation(), -1, 0, 0);
+  if(magn != 0.0) {
+    G4mplIonisation* mplioni = new G4mplIonisation(magn);
+    mplioni->SetDEDXBinning(nbin);
+    mplioni->SetMinKinEnergy(emin);
+    mplioni->SetMaxKinEnergy(emax);
+    pmanager->AddProcess(mplioni, -1, 1, 1);
+  }
+  if(mpl->GetPDGCharge() != 0.0) {
+    G4hhIonisation* hhioni = new G4hhIonisation();
+    hhioni->SetDEDXBinning(nbin);
+    hhioni->SetMinKinEnergy(emin);
+    hhioni->SetMaxKinEnergy(emax);
+    pmanager->AddProcess(hhioni,  -1, 2, 2);
+  }
+  pmanager->AddProcess( new G4StepLimiter(),  -1, -1, 3);
+
+}
+
+void G4MonopolePhysics::SetMagneticCharge(G4int val)
+{
+  magCharge = val;
+}
+
+void G4MonopolePhysics::SetElectricCharge(G4int val)
+{
+  elCharge = val;
+}
+
+void G4MonopolePhysics::SetMonopoleMass(G4double mass)
+{
+  monopoleMass = mass;
 }
 
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-void G4MonopolePhysics::ConstructProcess()
-{
 
-  // Add standard EM Processes for gamma
-  G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
-
-  G4Monopole* mpl = G4Monopole::MonopoleDefinition();
-  
-  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
-  mpl->SetProcessManager(pmanager);
-  
-  pmanager->AddProcess( new G4Transportation(), -1, 0, 0);
-  pmanager->AddProcess( new G4mplIonisation(mpl->MagneticCharge()), -1, 1, 1);
-  pmanager->AddProcess( new G4StepLimiter(),  -1, -1, 3);
-  if(mpl->GetPDGCharge() != 0.0) {
-    pmanager->AddProcess(new G4hhIonisation(),  -1, 2, 2);
-  }
-
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
Index: trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PrimaryGeneratorAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PrimaryGeneratorAction.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,8 +44,9 @@
 
 PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det)
-:detector(det)					       
+  :detector(det)
 {
   particleGun  = new G4ParticleGun(1);
-  G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle("monopole");
+  G4ParticleDefinition* particle = 
+    G4ParticleTable::GetParticleTable()->FindParticle("monopole");
   particleGun->SetParticleDefinition(particle);
   particleGun->SetParticleEnergy(100 * GeV);
@@ -59,5 +60,4 @@
 }
 
-
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 PrimaryGeneratorAction::~PrimaryGeneratorAction()
@@ -67,6 +67,6 @@
 }
 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
 {
Index: trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: RunAction.cc,v 1.2 2008/06/11 14:34:19 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -84,9 +84,10 @@
   if(!binLength) binLength = 5 * mm;
 	if(binLength > detector->GetMaxStepSize()) binLength = detector->GetMaxStepSize();
-  G4int nbBins = (int)(0.5 + length / binLength);
   offsetX   = 0.5 * length;
  
 #ifdef G4ANALYSIS_USE
   if(GetVerbose() > 0) G4cout << "\n----> Histogram Tree opened" << G4endl;
+
+  G4int nbBins = (int)(0.5 + length / binLength);
 
   // Create the tree factory
@@ -143,4 +144,8 @@
 void RunAction::FillHisto(G4int ih, G4double x, G4double weight)
 {
+  if(GetVerbose() > 1) {
+    G4cout << "FillHisto " << ih << "  x=" << x << " weight= " << weight 
+	   << G4endl;
+  }
 #ifdef G4ANALYSIS_USE
   if(histo[ih]) histo[ih]->fill(x, weight);
Index: trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.2 2007/12/10 16:28:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/field/BlineTracer/include/G4BlineEquation.hh
===================================================================
--- trunk/examples/extended/field/BlineTracer/include/G4BlineEquation.hh	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/include/G4BlineEquation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineEquation.hh,v 1.2 2006/06/29 17:14:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/BlineTracer/include/G4BlineEventAction.hh
===================================================================
--- trunk/examples/extended/field/BlineTracer/include/G4BlineEventAction.hh	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/include/G4BlineEventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineEventAction.hh,v 1.2 2006/06/29 17:14:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/BlineTracer/include/G4BlinePrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/field/BlineTracer/include/G4BlinePrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/include/G4BlinePrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlinePrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:14:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/BlineTracer/include/G4BlineSteppingAction.hh
===================================================================
--- trunk/examples/extended/field/BlineTracer/include/G4BlineSteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/include/G4BlineSteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineSteppingAction.hh,v 1.2 2006/06/29 17:15:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/BlineTracer/include/G4BlineTracer.hh
===================================================================
--- trunk/examples/extended/field/BlineTracer/include/G4BlineTracer.hh	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/include/G4BlineTracer.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineTracer.hh,v 1.2 2006/06/29 17:15:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/BlineTracer/include/G4BlineTracerMessenger.hh
===================================================================
--- trunk/examples/extended/field/BlineTracer/include/G4BlineTracerMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/include/G4BlineTracerMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineTracerMessenger.hh,v 1.2 2006/06/29 17:15:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/BlineTracer/src/G4BlineEquation.cc
===================================================================
--- trunk/examples/extended/field/BlineTracer/src/G4BlineEquation.cc	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/src/G4BlineEquation.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineEquation.cc,v 1.2 2006/06/29 17:15:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/BlineTracer/src/G4BlineEventAction.cc
===================================================================
--- trunk/examples/extended/field/BlineTracer/src/G4BlineEventAction.cc	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/src/G4BlineEventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineEventAction.cc,v 1.2 2006/06/29 17:15:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/BlineTracer/src/G4BlinePrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/field/BlineTracer/src/G4BlinePrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/src/G4BlinePrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlinePrimaryGeneratorAction.cc,v 1.3 2006/06/29 17:15:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/BlineTracer/src/G4BlineSteppingAction.cc
===================================================================
--- trunk/examples/extended/field/BlineTracer/src/G4BlineSteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/src/G4BlineSteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineSteppingAction.cc,v 1.2 2006/06/29 17:15:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/BlineTracer/src/G4BlineTracer.cc
===================================================================
--- trunk/examples/extended/field/BlineTracer/src/G4BlineTracer.cc	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/src/G4BlineTracer.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineTracer.cc,v 1.3 2006/06/29 17:15:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/BlineTracer/src/G4BlineTracerMessenger.cc
===================================================================
--- trunk/examples/extended/field/BlineTracer/src/G4BlineTracerMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/BlineTracer/src/G4BlineTracerMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4BlineTracerMessenger.cc,v 1.2 2006/06/29 17:15:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------------
Index: trunk/examples/extended/field/field01/field01.cc
===================================================================
--- trunk/examples/extended/field/field01/field01.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/field01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: field01.cc,v 1.8 2006/06/29 17:15:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01CalorHit.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01CalorHit.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01CalorHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01CalorHit.hh,v 1.4 2006/06/29 17:15:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01CalorimeterSD.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01CalorimeterSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01CalorimeterSD.hh,v 1.4 2006/06/29 17:15:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01DetectorConstruction.hh,v 1.7 2006/06/29 17:15:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01DetectorMessenger.hh,v 1.4 2006/06/29 17:15:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01EventAction.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01EventAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01EventAction.hh,v 1.5 2006/06/29 17:15:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01EventActionMessenger.hh,v 1.3 2006/06/29 17:15:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01FieldMessenger.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01FieldMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01FieldMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01FieldMessenger.hh,v 1.7 2006/06/29 17:15:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01FieldSetup.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01FieldSetup.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01FieldSetup.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01FieldSetup.hh,v 1.3 2006/06/29 17:15:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/field01/include/F01PhysicsList.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PhysicsList.hh,v 1.5 2007/05/23 09:14:09 japost Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field01/include/F01PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01PhysicsListMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PhysicsListMessenger.hh,v 1.4 2006/06/29 17:15:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PrimaryGeneratorAction.hh,v 1.3 2006/06/29 17:15:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 17:16:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01RunAction.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01RunAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01RunAction.hh,v 1.6 2006/06/29 17:16:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01RunMessenger.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01RunMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01RunMessenger.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: F01RunMessenger.hh,v 1.4 2006/06/29 17:16:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/field01/include/F01StepCut.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01StepCut.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01StepCut.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01StepCut.hh,v 1.5 2006/06/29 17:16:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01SteppingAction.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01SteppingAction.hh,v 1.4 2006/06/29 17:16:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/include/F01SteppingMessenger.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01SteppingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01SteppingMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01SteppingMessenger.hh,v 1.3 2006/06/29 17:16:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field01/include/F01SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/field/field01/include/F01SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/field/field01/include/F01SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01SteppingVerbose.hh,v 1.4 2006/06/29 17:16:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/field/field01/src/F01CalorHit.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01CalorHit.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01CalorHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01CalorHit.cc,v 1.4 2006/06/29 17:16:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01CalorimeterSD.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01CalorimeterSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01CalorimeterSD.cc,v 1.6 2006/06/29 17:16:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01DetectorConstruction.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: F01DetectorConstruction.cc,v 1.15 2006/06/29 17:16:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: F01DetectorConstruction.cc,v 1.16 2009/11/05 01:07:41 gum Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -199,5 +199,5 @@
   // Carbon dioxide, STP
 
-  density = 1.977*mg/cm3;
+  density = 1.842*mg/cm3;
   G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
   CarbonDioxide->AddElement(elC,1);
Index: trunk/examples/extended/field/field01/src/F01DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01DetectorMessenger.cc,v 1.5 2006/06/29 17:16:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01EventAction.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01EventAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01EventAction.cc,v 1.6 2006/06/29 17:16:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01EventActionMessenger.cc,v 1.4 2006/06/29 17:16:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01FieldMessenger.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01FieldMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01FieldMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01FieldMessenger.cc,v 1.8 2006/06/29 17:16:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01FieldSetup.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01FieldSetup.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01FieldSetup.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01FieldSetup.cc,v 1.7 2006/06/29 17:16:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   User Field setup class implementation.
Index: trunk/examples/extended/field/field01/src/F01PhysicsList.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PhysicsList.cc,v 1.12 2007/05/23 09:14:09 japost Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/field/field01/src/F01PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01PhysicsListMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PhysicsListMessenger.cc,v 1.6 2006/06/29 17:16:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PrimaryGeneratorAction.cc,v 1.8 2006/06/29 17:16:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 17:16:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01RunAction.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01RunAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01RunAction.cc,v 1.10 2006/06/29 17:16:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01RunMessenger.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01RunMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01RunMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01RunMessenger.cc,v 1.6 2006/06/29 17:16:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01StepCut.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01StepCut.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01StepCut.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01StepCut.cc,v 1.3 2006/06/29 17:16:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field01/src/F01SteppingAction.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01SteppingAction.cc,v 1.7 2006/06/29 17:16:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field01/src/F01SteppingMessenger.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01SteppingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01SteppingMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01SteppingMessenger.cc,v 1.4 2006/06/29 17:16:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field01/src/F01SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/field/field01/src/F01SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/field/field01/src/F01SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F01SteppingVerbose.cc,v 1.7 2006/06/29 17:17:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
Index: trunk/examples/extended/field/field02/field02.cc
===================================================================
--- trunk/examples/extended/field/field02/field02.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/field02.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: field02.cc,v 1.9 2006/06/29 17:17:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02CalorHit.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02CalorHit.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02CalorHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02CalorHit.hh,v 1.4 2006/06/29 17:17:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02CalorimeterSD.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02CalorimeterSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02CalorimeterSD.hh,v 1.4 2006/06/29 17:17:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02DetectorConstruction.hh,v 1.6 2006/06/29 17:17:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02DetectorMessenger.hh,v 1.4 2006/06/29 17:17:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02ElectricFieldSetup.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02ElectricFieldSetup.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02ElectricFieldSetup.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02ElectricFieldSetup.hh,v 1.2 2006/06/29 17:17:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    A class for control of the Electric Field of the detector.
Index: trunk/examples/extended/field/field02/include/F02EventAction.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02EventAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02EventAction.hh,v 1.4 2006/06/29 17:17:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02EventActionMessenger.hh,v 1.3 2006/06/29 17:17:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02FieldMessenger.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02FieldMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02FieldMessenger.hh	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: F02FieldMessenger.hh,v 1.4.2.1 2008/05/05 09:23:51 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: F02FieldMessenger.hh,v 1.6 2008/05/14 15:27:01 tnikitin Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -64,5 +64,5 @@
 
     G4UIcmdWithAnInteger*      StepperCmd;
-    G4UIcmdWithADouble*        ElFieldCmd;
+    G4UIcmdWithADoubleAndUnit* ElFieldCmd;
     G4UIcmdWithADoubleAndUnit* MinStepCmd;
     G4UIcmdWithoutParameter*   UpdateCmd;
Index: trunk/examples/extended/field/field02/include/F02PhysicsList.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PhysicsList.hh,v 1.5 2007/05/23 13:40:14 tnikitin Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field02/include/F02PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02PhysicsListMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PhysicsListMessenger.hh,v 1.4 2006/06/29 17:17:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PrimaryGeneratorAction.hh,v 1.4 2006/06/29 17:17:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 17:17:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02RunAction.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02RunAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02RunAction.hh,v 1.6 2006/06/29 17:17:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02RunMessenger.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02RunMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02RunMessenger.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: F02RunMessenger.hh,v 1.4 2006/06/29 17:17:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/field02/include/F02StepCut.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02StepCut.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02StepCut.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02StepCut.hh,v 1.5 2006/06/29 17:17:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02SteppingAction.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02SteppingAction.hh,v 1.5 2006/06/29 17:17:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/include/F02SteppingMessenger.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02SteppingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02SteppingMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02SteppingMessenger.hh,v 1.3 2006/06/29 17:17:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field02/include/F02SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/field/field02/include/F02SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/field/field02/include/F02SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02SteppingVerbose.hh,v 1.4 2006/06/29 17:17:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/field/field02/src/F02CalorHit.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02CalorHit.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02CalorHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02CalorHit.cc,v 1.4 2006/06/29 17:17:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02CalorimeterSD.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02CalorimeterSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02CalorimeterSD.cc,v 1.6 2006/06/29 17:17:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02DetectorConstruction.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: F02DetectorConstruction.cc,v 1.12 2006/06/29 17:17:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: F02DetectorConstruction.cc,v 1.13 2009/11/05 01:08:51 gum Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -193,5 +193,5 @@
   // Carbon dioxide, STP
 
-  density = 1.977*mg/cm3;
+  density = 1.842*mg/cm3;
   G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
   CarbonDioxide->AddElement(elC,1);
Index: trunk/examples/extended/field/field02/src/F02DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02DetectorMessenger.cc,v 1.5 2006/06/29 17:17:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02ElectricFieldSetup.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02ElectricFieldSetup.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02ElectricFieldSetup.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: F02ElectricFieldSetup.cc,v 1.2.2.1 2008/05/05 09:23:52 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: F02ElectricFieldSetup.cc,v 1.4 2008/05/14 15:27:29 tnikitin Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
@@ -196,5 +196,5 @@
 void F02ElectricFieldSetup::SetFieldValue(G4double fieldValue)
 {
-  G4ThreeVector fieldVector( 0.0, 0.0, fieldValue*volt/mm );  
+  G4ThreeVector fieldVector( 0.0, 0.0, fieldValue );  
 
   SetFieldValue( fieldVector );
Index: trunk/examples/extended/field/field02/src/F02EventAction.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02EventAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02EventAction.cc,v 1.6 2006/06/29 17:18:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02EventActionMessenger.cc,v 1.5 2006/06/29 17:18:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02FieldMessenger.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02FieldMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02FieldMessenger.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: F02FieldMessenger.cc,v 1.6.2.1 2008/05/05 09:23:53 gcosmo Exp $
-// GEANT4 tag $Name: geant4-09-01-patch-02 $
+// $Id: F02FieldMessenger.cc,v 1.8 2008/05/14 15:27:13 tnikitin Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -61,9 +61,10 @@
   UpdateCmd->AvailableForStates(G4State_Idle);
       
-  ElFieldCmd = new G4UIcmdWithADouble("/field/setFieldZ",this);  
+  ElFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);  
   ElFieldCmd->SetGuidance("Define uniform Electric field.");
   ElFieldCmd->SetGuidance("Electric field will be in Z direction.");
-  ElFieldCmd->SetGuidance("Value of Electric field has to be given in Volt/mm");
-  ElFieldCmd->SetParameterName("Ez",false);
+  ElFieldCmd->SetGuidance("Value of Electric field has to be given in volt/m");
+  ElFieldCmd->SetParameterName("Ez",false,false);
+  ElFieldCmd->SetDefaultUnit("volt/m");
   ElFieldCmd->AvailableForStates(G4State_Idle); 
  
Index: trunk/examples/extended/field/field02/src/F02PhysicsList.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PhysicsList.cc,v 1.11 2007/05/23 13:40:28 tnikitin Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/field/field02/src/F02PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02PhysicsListMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PhysicsListMessenger.cc,v 1.6 2006/06/29 17:18:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PrimaryGeneratorAction.cc,v 1.5 2006/06/29 17:18:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 17:18:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02RunAction.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02RunAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02RunAction.cc,v 1.8 2006/06/29 17:18:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02RunMessenger.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02RunMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02RunMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02RunMessenger.cc,v 1.6 2006/06/29 17:18:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02StepCut.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02StepCut.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02StepCut.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02StepCut.cc,v 1.3 2006/06/29 17:18:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field02/src/F02SteppingAction.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02SteppingAction.cc,v 1.6 2006/06/29 17:18:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field02/src/F02SteppingMessenger.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02SteppingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02SteppingMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02SteppingMessenger.cc,v 1.4 2006/06/29 17:18:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field02/src/F02SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/field/field02/src/F02SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/field/field02/src/F02SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F02SteppingVerbose.cc,v 1.6 2006/06/29 17:18:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/field03/field03.cc
===================================================================
--- trunk/examples/extended/field/field03/field03.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/field03.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: field03.cc,v 1.8 2006/06/29 17:18:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03CalorHit.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03CalorHit.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03CalorHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03CalorHit.hh,v 1.4 2006/06/29 17:18:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03CalorimeterSD.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03CalorimeterSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03CalorimeterSD.hh,v 1.4 2006/06/29 17:18:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03DetectorConstruction.hh,v 1.6 2006/06/29 17:18:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03DetectorMessenger.hh,v 1.4 2006/06/29 17:18:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03EventAction.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03EventAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03EventAction.hh,v 1.4 2006/06/29 17:18:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03EventActionMessenger.hh,v 1.3 2006/06/29 17:18:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03FieldMessenger.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03FieldMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03FieldMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03FieldMessenger.hh,v 1.4 2006/06/29 17:18:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03FieldSetup.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03FieldSetup.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03FieldSetup.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03FieldSetup.hh,v 1.2 2006/06/29 17:18:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  A class for setting up the Magnetic Field of the setup, and 
Index: trunk/examples/extended/field/field03/include/F03PhysicsList.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PhysicsList.hh,v 1.6 2007/05/23 13:39:01 tnikitin Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field03/include/F03PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03PhysicsListMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PhysicsListMessenger.hh,v 1.4 2006/06/29 17:18:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PrimaryGeneratorAction.hh,v 1.4 2006/06/29 17:18:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 17:19:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03RunAction.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03RunAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03RunAction.hh,v 1.6 2006/06/29 17:19:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03RunMessenger.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03RunMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03RunMessenger.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: F03RunMessenger.hh,v 1.4 2006/06/29 17:19:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/field03/include/F03StepCut.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03StepCut.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03StepCut.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03StepCut.hh,v 1.5 2006/06/29 17:19:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03SteppingAction.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03SteppingAction.hh,v 1.5 2006/06/29 17:19:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/include/F03SteppingMessenger.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03SteppingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03SteppingMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03SteppingMessenger.hh,v 1.3 2006/06/29 17:19:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field03/include/F03SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/field/field03/include/F03SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/field/field03/include/F03SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03SteppingVerbose.hh,v 1.4 2006/06/29 17:19:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/field/field03/src/F03CalorHit.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03CalorHit.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03CalorHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03CalorHit.cc,v 1.4 2006/06/29 17:19:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03CalorimeterSD.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03CalorimeterSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03CalorimeterSD.cc,v 1.6 2006/06/29 17:19:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03DetectorConstruction.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: F03DetectorConstruction.cc,v 1.12 2006/06/29 17:19:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: F03DetectorConstruction.cc,v 1.13 2009/11/05 01:10:06 gum Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -200,5 +200,5 @@
   // Carbon dioxide, STP
 
-  density = 1.977*mg/cm3;
+  density = 1.842*mg/cm3;
   G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
   CarbonDioxide->AddElement(elC,1);
Index: trunk/examples/extended/field/field03/src/F03DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03DetectorMessenger.cc,v 1.5 2006/06/29 17:19:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03EventAction.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03EventAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03EventAction.cc,v 1.6 2006/06/29 17:19:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03EventActionMessenger.cc,v 1.4 2006/06/29 17:19:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03FieldMessenger.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03FieldMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03FieldMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03FieldMessenger.cc,v 1.7 2006/06/29 17:19:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03FieldSetup.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03FieldSetup.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03FieldSetup.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03FieldSetup.cc,v 1.5 2007/04/28 01:31:12 gum Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/field/field03/src/F03PhysicsList.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PhysicsList.cc,v 1.11 2007/05/23 13:39:16 tnikitin Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/field/field03/src/F03PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03PhysicsListMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PhysicsListMessenger.cc,v 1.5 2006/06/29 17:19:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PrimaryGeneratorAction.cc,v 1.6 2006/06/29 17:19:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 17:19:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03RunAction.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03RunAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03RunAction.cc,v 1.9 2006/06/29 17:19:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field03/src/F03RunMessenger.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03RunMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03RunMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03RunMessenger.cc,v 1.6 2006/06/29 17:19:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03StepCut.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03StepCut.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03StepCut.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03StepCut.cc,v 1.3 2006/06/29 17:19:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field03/src/F03SteppingAction.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03SteppingAction.cc,v 1.6 2006/06/29 17:19:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/field/field03/src/F03SteppingMessenger.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03SteppingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03SteppingMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03SteppingMessenger.cc,v 1.5 2006/06/29 17:19:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/field/field03/src/F03SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/field/field03/src/F03SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/field/field03/src/F03SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F03SteppingVerbose.cc,v 1.5 2006/06/29 17:19:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
Index: trunk/examples/extended/field/field04/field04.cc
===================================================================
--- trunk/examples/extended/field/field04/field04.cc	(revision 1187)
+++ trunk/examples/extended/field/field04/field04.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: field04.cc,v 1.7 2007/11/02 10:53:41 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// $Id: field04.cc,v 1.11 2009/10/30 10:17:43 allison Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
@@ -45,7 +45,4 @@
 #include "G4UImanager.hh"
 
-#include "G4UIterminal.hh"
-#include "G4UItcsh.hh"
-
 #include "Randomize.hh"
 
@@ -65,4 +62,8 @@
 #endif
 
+#ifdef G4UI_USE
+#include "G4UIExecutive.hh"
+#endif
+
 // argc holds the number of arguments (including the name) on the command line
 // -> it is ONE when only the name is  given !!!
@@ -72,16 +73,17 @@
 int main(int argc,char** argv) 
 {
-  G4bool useUItcsh = true;
-
   G4String physicsList = "QGSP_BERT";
 
-  G4int seed = 0;
+  G4int seed = 123;
   if (argc  > 2) seed = atoi(argv[argc-1]);
 
+  // Choose the Random engine
+
+  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
   CLHEP::HepRandom::setTheSeed(seed);
 
 #ifndef WIN32
   G4int c = 0;
-  while ((c=getopt(argc,argv,"p:t")) != -1)
+  while ((c=getopt(argc,argv,"p")) != -1)
   {
      switch (c)
@@ -90,7 +92,4 @@
          physicsList = optarg;
          G4cout << "Physics List used is " <<  physicsList << G4endl;
-         break;
-       case 't': // Don't use a tcsh-style command line interface
-         useUItcsh = false;
          break;
        case ':':       /* -p without operand */
@@ -105,8 +104,4 @@
 #endif
 
-  // Choose the Random engine
-
-  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
-  
   // My Verbose output class
 
@@ -148,5 +143,5 @@
   // Get the pointer to the User Interface manager 
 
-  G4UImanager * UI = G4UImanager::GetUIpointer();  
+  G4UImanager * UImanager = G4UImanager::GetUIpointer();  
 
 #ifndef WIN32
@@ -160,38 +155,27 @@
      {
          G4String macroFilename = argv[optind];
-         UI->ApplyCommand(command+macroFilename);
+         UImanager->ApplyCommand(command+macroFilename);
      }
   }
-  else
-  {
-     // Define (G)UI terminal for interactive mode
-     G4UIsession * session = 0;
-     if (useUItcsh)
-     {
-        // G4UIterminal is a terminal with tcsh-like control.
-        session = new G4UIterminal(new G4UItcsh);
-     }
-     else
-     {
-        // G4UIterminal is a (dumb) terminal.
-        session = new G4UIterminal();
-     }
-     session->SessionStart();
-     delete session;
-  }
 #else  // Simple UI for Windows runs, no possibility of additional arguments
-  if (argc==1)   // Define UI terminal for interactive mode  
-  { 
-     G4UIsession * session = new G4UIterminal;
-     session->SessionStart();
-     delete session;
-  }
-  else           // Batch mode
+  if (argc!=1)
   { 
      G4String command = "/control/execute ";
      G4String fileName = argv[1];
-     UI->ApplyCommand(command+fileName);
+     UImanager->ApplyCommand(command+fileName);
   }
-#endif      
+#endif
+  else  {
+     // Define (G)UI terminal for interactive mode
+#ifdef G4UI_USE
+     G4UIExecutive * ui = new G4UIExecutive(argc,argv);
+#ifdef G4VIS_USE
+     UImanager->ApplyCommand("/control/execute vis.mac");     
+#endif
+     ui->SessionStart();
+     delete ui;
+#endif
+  }
+
   // job termination
 
Index: trunk/examples/extended/field/field04/include/F04DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/field/field04/include/F04DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field04/include/F04DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: F04DetectorMessenger.hh,v 1.1 2007/10/30 02:01:47 gum Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/field/field04/include/F04PhysicsList.hh
===================================================================
--- trunk/examples/extended/field/field04/include/F04PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/field/field04/include/F04PhysicsList.hh	(revision 1230)
@@ -49,6 +49,4 @@
     virtual ~F04PhysicsList();
 
-    void ConstructParticle();
-    
     void SetCuts();
     void SetCutForGamma(G4double);
@@ -59,37 +57,19 @@
     F04StepMax* GetStepMaxProcess();
     void AddStepMax();
-    
-    /// Add physics to the Physics List    
-    void AddPhysicsList(const G4String& name);
+/*    
+    /// Remove specific physics from physics list.
+    void RemoveFromPhysicsList(const G4String&);
 
-    /// Remove specific EM physics from EM physics list.
-    void RemoveFromEMPhysicsList(const G4String&);
+    /// Make sure that the physics list is empty.
+    void ClearPhysics();
+*/
+    void ConstructParticle();
+    void ConstructProcess();
 
-    /// Remove specific Hadron physics from Hadron physics list.
-    void RemoveFromHadronPhysicsList(const G4String&);
-
-    /// Make sure that the EM physics list is empty.
-    void ClearEMPhysics();
-
-    /// Make sure that the hadron physics list is empty.
-    void ClearHadronPhysics();
-
-    void ConstructProcess();
-    void List();
-  
 private:
-
-    typedef std::vector<G4VPhysicsConstructor*>  PhysicsListVector;
-
-    void SetStandardList(G4bool flagHP = false, G4bool glauber = false);
 
     G4double fCutForGamma;
     G4double fCutForElectron;
     G4double fCutForPositron;
-
-    G4VPhysicsConstructor*  fParticleList;
-
-    PhysicsListVector* fEMPhysics;
-    PhysicsListVector* fHadronPhysics;
 
     G4double MaxChargedStep;
@@ -98,5 +78,5 @@
     F04PhysicsListMessenger* fMessenger;
 
-    G4bool fDump;
 };
+
 #endif
Index: trunk/examples/extended/field/field04/include/F04PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/field/field04/include/F04PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field04/include/F04PhysicsListMessenger.hh	(revision 1230)
@@ -73,13 +73,8 @@
     G4UIcmdWithADoubleAndUnit* fAllCutCMD;
     G4UIcmdWithADoubleAndUnit* fStepMaxCMD;
-
-    G4UIcmdWithAString*        fAddPhysicsCMD;
-    G4UIcmdWithAString*        fRemoveEMPhysicsCMD;
-    G4UIcmdWithAString*        fRemoveHadronPhysicsCMD;
-    G4UIcmdWithoutParameter*   fClearEMPhysicsCMD;
-    G4UIcmdWithoutParameter*   fClearHadronPhysicsCMD;
-
-    G4UIcmdWithoutParameter*   fListCMD;
-
+/*
+    G4UIcmdWithAString*        fRemovePhysicsCMD;
+    G4UIcmdWithoutParameter*   fClearPhysicsCMD;
+*/
     G4UIcmdWithoutParameter* fPienuCMD;
     G4UIcmdWithoutParameter* fPimunuCMD;
Index: trunk/examples/extended/field/field04/include/F04RunAction.hh
===================================================================
--- trunk/examples/extended/field/field04/include/F04RunAction.hh	(revision 1187)
+++ trunk/examples/extended/field/field04/include/F04RunAction.hh	(revision 1230)
@@ -56,4 +56,6 @@
     G4int GetRndmFreq()          {return saveRndm;}
 
+    inline void SetAutoSeed (const G4bool val) {autoSeed = val;}
+
   private:
  
@@ -61,4 +63,6 @@
 
     G4int saveRndm;
+    G4bool autoSeed;
+
 };
 
Index: trunk/examples/extended/field/field04/include/F04RunActionMessenger.hh
===================================================================
--- trunk/examples/extended/field/field04/include/F04RunActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/field/field04/include/F04RunActionMessenger.hh	(revision 1230)
@@ -43,4 +43,5 @@
 class G4UIcmdWithAnInteger;
 class G4UIcmdWithAString;
+class G4UIcmdWithABool;
 
 class F04RunActionMessenger : public G4UImessenger
@@ -59,5 +60,6 @@
     G4UIdirectory*             RndmDir;
     G4UIcmdWithAnInteger*      RndmSaveCmd;    
-    G4UIcmdWithAString*        RndmReadCmd;    
+    G4UIcmdWithAString*        RndmReadCmd;
+    G4UIcmdWithABool*          SetAutoSeedCmd;
  
 };
Index: trunk/examples/extended/field/field04/src/F04Materials.cc
===================================================================
--- trunk/examples/extended/field/field04/src/F04Materials.cc	(revision 1187)
+++ trunk/examples/extended/field/field04/src/F04Materials.cc	(revision 1230)
@@ -94,9 +94,5 @@
   elements.push_back("H");     natoms.push_back(10);
 
-  // density = 1.032*g/cm3; 
-  // ==> when using ConstructNewMaterial give the density in g/cm3
-  // ==> but do NOT multiply by the unit!!!
-
-  density = 1.032;
+  density = 1.032*g/cm3;;
 
   Sci = nistMan->
Index: trunk/examples/extended/field/field04/src/F04PhysicsList.cc
===================================================================
--- trunk/examples/extended/field/field04/src/F04PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/field/field04/src/F04PhysicsList.cc	(revision 1230)
@@ -31,48 +31,5 @@
 
 #include "F04ExtraPhysics.hh"
-//#include "F04OpticalPhysics.hh"
-
-#include "G4DecayPhysics.hh"
-
-#include "G4EmStandardPhysics_option1.hh"
-#include "G4EmStandardPhysics_option2.hh"
-#include "G4EmStandardPhysics.hh"
-
-#include "G4EmExtraPhysics.hh"
-#include "G4EmProcessOptions.hh"
-
-#include "G4HadronElasticPhysics.hh"
-#include "G4HadronQElasticPhysics.hh"
-#include "G4HadronHElasticPhysics.hh"
-#include "G4NeutronTrackingCut.hh"
-#include "G4QStoppingPhysics.hh"
-#include "G4LHEPStoppingPhysics.hh"
-#include "G4IonBinaryCascadePhysics.hh"
-#include "G4IonPhysics.hh"
-
-#include "HadronPhysicsFTFP.hh"
-#include "HadronPhysicsFTFC.hh"
-
-#include "HadronPhysicsLHEP.hh"
-#include "HadronPhysicsLHEP_BERT.hh"
-#include "HadronPhysicsLHEP_EMV.hh"
-#include "HadronPhysicsLHEP_PRECO_HP.hh"
-
-#include "HadronPhysicsQGSC.hh"
-#include "HadronPhysicsQGSC_EFLOW.hh"
-
-#include "HadronPhysicsQGSP.hh"
-#include "HadronPhysicsQGSP_BERT.hh"
-#include "HadronPhysicsQGSP_BERT_HP.hh"
-#include "HadronPhysicsQGSP_BERT_TRV.hh"
-#include "HadronPhysicsQGSP_BIC.hh"
-#include "HadronPhysicsQGSP_BIC_HP.hh"
-
-#include "G4HadronInelasticQBBC.hh"
-#include "G4HadronInelasticQLHEP.hh"
-
-#include "G4IonPhysics.hh"
-
-#include "G4HadronProcessStore.hh"
+#include "G4OpticalPhysics.hh"
 
 #include "G4LossTableManager.hh"
@@ -81,4 +38,6 @@
 #include "G4ParticleTypes.hh"
 #include "G4ParticleTable.hh"
+
+#include "G4PhysListFactory.hh"
 
 #include "G4Gamma.hh"
@@ -105,19 +64,28 @@
     fCutForElectron  = defaultCutValue;
     fCutForPositron  = defaultCutValue;
-    fDump            = false;
 
     fMessenger = new F04PhysicsListMessenger(this);
 
-    fEMPhysics     = new PhysicsListVector();
-    fHadronPhysics = new PhysicsListVector();
-
-    // Particles
-    fParticleList = new G4DecayPhysics("decays");
-
-    // EM physics
-    AddPhysicsList("emstandard_opt1");
-
-    // Set the default hadronic physics.
-    AddPhysicsList(physicsList);
+    SetVerboseLevel(1);
+
+    G4PhysListFactory factory;
+    G4VModularPhysicsList* phys = 0;
+
+    if(factory.IsReferencePhysList(physicsList))
+      phys =factory.GetReferencePhysList(physicsList);
+
+    // Physics List is defined via environment variable PHYSLIST
+    if(!phys) phys = factory.ReferencePhysList();
+
+    for (G4int i = 0; ; ++i) {
+       G4VPhysicsConstructor* elem =
+                  const_cast<G4VPhysicsConstructor*> (phys->GetPhysics(i));
+       if (elem == NULL) break;
+       G4cout << "RegisterPhysics: " << elem->GetPhysicsName() << G4endl;
+       RegisterPhysics(elem);
+    }
+
+    RegisterPhysics(new F04ExtraPhysics());
+    RegisterPhysics(new G4OpticalPhysics());
 
     stepMaxProcess = new F04StepMax();
@@ -127,36 +95,11 @@
 {
     delete fMessenger;
-    delete fParticleList;
-
-    ClearEMPhysics();
-    ClearHadronPhysics();
-
-    delete fEMPhysics;
-    delete fHadronPhysics;
 
     delete stepMaxProcess;
 }
 
-void F04PhysicsList::ClearEMPhysics()
-{
-    for (PhysicsListVector::iterator p  = fEMPhysics->begin();
-                                     p != fEMPhysics->end(); ++p) {
-        delete (*p);
-    }
-    fEMPhysics->clear();
-}
-
-void F04PhysicsList::ClearHadronPhysics()
-{
-    for (PhysicsListVector::iterator p  = fHadronPhysics->begin();
-                                     p != fHadronPhysics->end(); ++p) {
-        delete (*p);
-    }
-    fHadronPhysics->clear();
-}
-
 void F04PhysicsList::ConstructParticle()
 {
-    fParticleList->ConstructParticle();
+    G4VModularPhysicsList::ConstructParticle();
 
     G4DecayTable* MuonPlusDecayTable = new G4DecayTable();
@@ -173,17 +116,9 @@
                             G4MuonRadiativeDecayChannelWithSpin("mu-",0.014));
     G4MuonMinus::MuonMinusDefinition() -> SetDecayTable(MuonMinusDecayTable);
-
 }
 
 void F04PhysicsList::ConstructProcess()
 {
-    AddTransportation();
-
-    for (PhysicsListVector::iterator p  = fEMPhysics->begin();
-                                     p != fEMPhysics->end(); ++p) {
-        (*p)->ConstructProcess();
-    }
-
-    fParticleList->ConstructProcess();
+    G4VModularPhysicsList::ConstructProcess();
 
     G4DecayWithSpin* decayWithSpin = new G4DecayWithSpin();
@@ -243,22 +178,16 @@
     }
 
-    for (PhysicsListVector::iterator p  = fHadronPhysics->begin();
-                                     p != fHadronPhysics->end();++p) {
-        (*p)->ConstructProcess();
-    }
-
     AddStepMax();
-
-    if (fDump) G4HadronProcessStore::Instance()->Dump(1);
-}
-
-void F04PhysicsList::RemoveFromEMPhysicsList(const G4String& name)
+}
+
+/*
+void F04PhysicsList::RemoveFromPhysicsList(const G4String& name)
 {
     G4bool success = false;
-    for (PhysicsListVector::iterator p  = fEMPhysics->begin();
-                                     p != fEMPhysics->end(); ++p) {
+    for (G4PhysConstVector::iterator p  = physicsVector->begin();
+                                     p != physicsVector->end(); ++p) {
         G4VPhysicsConstructor* e = (*p);
         if (e->GetPhysicsName() == name) {
-           fEMPhysics->erase(p);
+           physicsVector->erase(p);
            success = true;
            break;
@@ -267,282 +196,18 @@
     if (!success) {
        std::ostringstream message;
-       message << "PhysicsList::RemoveFromEMPhysicsList "<< name << "not found";
+       message << "PhysicsList::RemoveFromPhysicsList "<< name << "not found";
        G4Exception(message.str().c_str());
     }
 }
 
-void F04PhysicsList::RemoveFromHadronPhysicsList(const G4String& name)
-{
-    G4bool success = false;
-    for (PhysicsListVector::iterator p  = fHadronPhysics->begin();
-                                     p != fHadronPhysics->end(); ++p) {
-        G4VPhysicsConstructor* e = (*p);
-        if (e->GetPhysicsName() == name) {
-           fHadronPhysics->erase(p);
-           success = true;
-           break;
-        }
-    }
-    if (!success) {
-       G4String message("F04PhysicsList::RemoveFromHadronPhysicsList \"");
-       message += name;
-       message += " not found \"";
-       G4Exception(message);
-    }
-}
-
-void F04PhysicsList::AddPhysicsList(const G4String& name)
-{
-    if (verboseLevel>0) {
-        G4cout << "F04PhysicsList::AddPhysicsList: <" << name 
-               << ">" << G4endl;
-    }
-
-    if (name == "emstandard_opt1") {
-
-       ClearEMPhysics();
-       fEMPhysics->push_back(new G4EmStandardPhysics_option1());
-       fEMPhysics->push_back(new F04ExtraPhysics());
-//       fEMPhysics->push_back(new F04OpticalPhysics());
-
-    } else if (name == "emstandard_opt2") {
-
-       ClearEMPhysics();
-       fEMPhysics->push_back(new G4EmStandardPhysics_option2());
-       fEMPhysics->push_back(new F04ExtraPhysics());
-//       fEMPhysics->push_back(new F04OpticalPhysics());
-
-   } else if (name == "FTFC") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsFTFC("hadron",true));
-
-    } else if (name == "FTFP") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsFTFP("hadron",true));
-
-    } else if (name == "FTFP_EMV") {
-
-       AddPhysicsList("emstandard_opt1");
-       AddPhysicsList("FTFP");
-
-    } else if (name == "LHEP") {
-
-       ClearHadronPhysics();
-       fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-       fHadronPhysics->push_back(new G4HadronElasticPhysics("LElastic",
-                                                           verboseLevel,
-                                                           false));
-       fHadronPhysics->push_back(new HadronPhysicsLHEP("hadron"));
-       fHadronPhysics->push_back(new G4IonPhysics("ion"));
-       fDump = true;
- 
-    } else if (name == "LHEP_BERT") {
-
-       ClearHadronPhysics();
-       fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-       fHadronPhysics->push_back(new G4HadronElasticPhysics("LElastic",
-                                                           verboseLevel,
-                                                           false));
-       fHadronPhysics->push_back(new HadronPhysicsLHEP_BERT("hadron"));
-       fHadronPhysics->push_back(new G4QStoppingPhysics("stopping",
-                                                       verboseLevel));
-       fHadronPhysics->push_back(new G4IonPhysics("ion"));
-       fDump = true;
-
-    } else if (name == "LHEP_EMV") {
-
-       ClearHadronPhysics();
-       AddPhysicsList("emstandard_opt1");
-       fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-       fHadronPhysics->push_back(new G4HadronElasticPhysics("LElastic",
-                                                           verboseLevel,
-                                                           false));
-       fHadronPhysics->push_back(new HadronPhysicsLHEP_EMV("hadron"));
-       fHadronPhysics->push_back(new G4QStoppingPhysics("stopping",
-							verboseLevel));
-       fHadronPhysics->push_back(new G4IonPhysics("ion"));
-       fDump = true;
-
-    } else if (name == "LHEP_PRECO_HP") {
-
-       ClearHadronPhysics();
-       fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-       fHadronPhysics->push_back(new G4HadronElasticPhysics("LElastic",
-                                                           verboseLevel,
-                                                           false));
-       fHadronPhysics->push_back(new HadronPhysicsLHEP_PRECO_HP("hadron"));
-       fHadronPhysics->push_back(new G4QStoppingPhysics("stopping",
-                                                       verboseLevel));
-       fHadronPhysics->push_back(new G4IonPhysics("ion"));
-       fDump = true;
-
-    } else if (name == "QBBC") {
-
-       SetStandardList(false,true);
-       fHadronPhysics->push_back(new G4HadronInelasticQBBC("QBBC",
-                                                          verboseLevel,
-                                                          false,false,
-                                                          false,false,true));
-
-    } else if (name == "QBBCG") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new G4HadronInelasticQBBC("QBBC",
-                                                          verboseLevel,
-                                                          false,false,
-                                                          false,false,false));
-
-    } else if (name == "QBEC") {
-
-       SetStandardList(false,true);
-       fHadronPhysics->push_back(new G4HadronInelasticQBBC("QBBC",
-                                                          verboseLevel,
-                                                          false,true,
-                                                          false,false,true));
-
-    } else if (name == "QBBC_HP") {
-
-       SetStandardList(true,true);
-       fHadronPhysics->push_back(new G4HadronInelasticQBBC("QBBC",
-                                                          verboseLevel,
-                                                          false,false,
-                                                          false,true,true));
-
-    } else if (name == "QBEC_HP") {
-
-       SetStandardList(true,true);
-       fHadronPhysics->push_back(new G4HadronInelasticQBBC("QBBC",
-                                                          verboseLevel,
-                                                          false,true,
-                                                          false,true,true));
-
-    } else if (name == "QGSC") {
-
-       ClearHadronPhysics();
-       fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-       fHadronPhysics->push_back(new G4HadronQElasticPhysics("QElastic",
-                                                            verboseLevel));
-       fHadronPhysics->push_back(new HadronPhysicsQGSC("hadron",true));
-       fHadronPhysics->push_back(new G4QStoppingPhysics("stopping",
-                                                       verboseLevel,false));
-       fHadronPhysics->push_back(new G4IonPhysics("ion"));
-       fHadronPhysics->push_back(new G4NeutronTrackingCut());
-       fDump = true;
-
-    } else if (name == "QGSC_EFLOW") {
-
-       ClearHadronPhysics();
-       fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-       fHadronPhysics->push_back(new G4HadronQElasticPhysics("QElastic",
-                                                            verboseLevel));
-       fHadronPhysics->push_back(new HadronPhysicsQGSC_EFLOW("hadron",true));
-       fHadronPhysics->push_back(new G4QStoppingPhysics("stopping",
-                                                       verboseLevel,false));
-       fHadronPhysics->push_back(new G4IonPhysics("ion"));
-       fHadronPhysics->push_back(new G4NeutronTrackingCut());
-       fDump = true;
-
-    } else if (name == "QGSC_EMV") {
-
-       AddPhysicsList("emstandard_opt1");
-       AddPhysicsList("QGSC");
-
-    } else if (name == "QGSP") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP("hadron",true));
-
-    } else if (name == "QGSP_BERT") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP_BERT("hadron",true));
-
-    } else if (name == "QGSP_BERT_EMV") {
-
-       AddPhysicsList("emstandard_opt1");
-       AddPhysicsList("QGSP_BERT");
-
-    } else if (name == "QGSP_BERT_HP") {
-
-       SetStandardList(true, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP_BERT_HP("hadron",true));
-
-    } else if (name == "QGSP_BERT_NQE") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP_BERT("hadron",false));
-
-    } else if (name == "QGSP_BERT_TRV") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP_BERT_TRV("hadron",true));
-
-    } else if (name == "QGSP_BIC") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP_BIC("hadron",true));
-
-    } else if (name == "QGSP_BIC_HP") {
-
-       SetStandardList(true, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP_BIC_HP("hadron",true));
-
-    } else if (name == "QGSP_EMV") {
-
-       AddPhysicsList("emstandard_opt1");
-       AddPhysicsList("QGSP");
-
-    } else if (name == "QGSP_EMV_NQE") {
-
-       AddPhysicsList("emstandard_opt1");
-       AddPhysicsList("QGSP_NQE");
-
-    } else if (name == "QGSP_EMX") {
-
-       AddPhysicsList("emstandard_opt2");
-       AddPhysicsList("QGSP");
-
-    } else if (name == "QGSP_NQE") {
-
-       SetStandardList(false, false);
-       fHadronPhysics->push_back(new HadronPhysicsQGSP("hadron",false));
-
-    } else if (name == "QGSP_QEL") {
-
-       ClearHadronPhysics();
-       fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-       fHadronPhysics->push_back(new G4HadronQElasticPhysics("QElastic",
-                                                            verboseLevel));
-       fHadronPhysics->push_back(new HadronPhysicsQGSP("hadron",true));
-       fHadronPhysics->push_back(new G4QStoppingPhysics("stopping",
-                                                       verboseLevel));
-       fHadronPhysics->push_back(new G4IonPhysics("ion"));
-       fHadronPhysics->push_back(new G4NeutronTrackingCut());
-       fDump = true;
-
-    } else {
-
-       G4cout << "F04PhysicsList::AddPhysicsList: <" << name << ">"
-              << " is not defined" << G4endl;
-    }
-}
-
-void F04PhysicsList::SetStandardList(G4bool flagHP, G4bool glauber)
-{
-    ClearHadronPhysics();
-
-    fHadronPhysics->push_back(new G4EmExtraPhysics("gamma_nuc"));
-    fHadronPhysics->push_back(new G4HadronElasticPhysics("elastic",
-                                                        verboseLevel,
-                                                        flagHP,glauber));
-    fHadronPhysics->push_back(new  G4QStoppingPhysics("stopping",
-                                                     verboseLevel));
-    fHadronPhysics->push_back(new G4IonBinaryCascadePhysics("binary_ion"));
-    fHadronPhysics->push_back(new G4NeutronTrackingCut());
-
-    fDump = true;
-}
+void F04PhysicsList::ClearPhysics()
+{
+    for (G4PhysConstVector::iterator p  = physicsVector->begin();
+                                     p != physicsVector->end(); ++p) {
+        delete (*p);
+    }
+    physicsVector->clear();
+}
+*/
 
 void F04PhysicsList::SetCuts()
@@ -581,25 +246,4 @@
 }
 
-void F04PhysicsList::List()
-{
-    G4cout << "### PhysicsLists available: FTFC FTFP FTFP_EMV"
-           << " LHEP LHEP_BERT LHEP_EMV"
-           << G4endl;
-    G4cout << "                            LHEP_PRECO_HP QBBC QBBCG"
-           << " QBEC QBBC_HP QBEC_HP"
-           << G4endl;
-    G4cout << "                            QGSC QGSC_EFLOW QGSC_EMV"
-           << " QGSP QGSP_BERT QGSP_BER_EMV"
-           << G4endl;
-    G4cout << "                            QGSP_BERT_HP QGSP_BERT_NQE"
-           << " QGSP_BERT_TRV"
-           << G4endl;
-    G4cout << "                            QGSP_BIC QGSP_BIC_HP QGSP_EMV"
-           << " QGSP_EMV_NQE"
-           << G4endl;
-    G4cout << "                            QGSC_EMX QGSP_NQE QGSP_QEL"
-           << G4endl;
-}
-
 void F04PhysicsList::SetStepMax(G4double step)
 {
Index: trunk/examples/extended/field/field04/src/F04PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/field/field04/src/F04PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field04/src/F04PhysicsListMessenger.cc	(revision 1230)
@@ -87,32 +87,14 @@
     fStepMaxCMD->SetDefaultUnit("mm");
     fStepMaxCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
+/*
+    fClearPhysicsCMD = new G4UIcmdWithoutParameter("/exp/phys/clearPhysics",this);
+    fClearPhysicsCMD->SetGuidance("Clear the physics list");
+    fClearPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
 
-    fAddPhysicsCMD = new G4UIcmdWithAString("/exp/phys/addPhysics",this);
-    fAddPhysicsCMD->SetGuidance("Add to modular physics list");
-    fAddPhysicsCMD->SetParameterName("PList",false);
-    fAddPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
-
-    fClearEMPhysicsCMD = new G4UIcmdWithoutParameter("/exp/phys/clearEMPhysics",this);
-    fClearEMPhysicsCMD->SetGuidance("Clear the EM physics list");
-    fClearEMPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
-
-    fClearHadronPhysicsCMD = new G4UIcmdWithoutParameter("/exp/phys/clearHadronPhysics",this);
-    fClearHadronPhysicsCMD->SetGuidance("Clear the Hadron physics list");
-    fClearHadronPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
-
-    fRemoveEMPhysicsCMD = new G4UIcmdWithAString("/exp/phys/removeEMPhysics",this);
-    fRemoveEMPhysicsCMD->SetGuidance("Remove a physics process from EM Physics List");
-    fRemoveEMPhysicsCMD->SetParameterName("PList",false);
-    fRemoveEMPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
-
-    fRemoveHadronPhysicsCMD = new G4UIcmdWithAString("/exp/phys/removeHadronPhysics",this);
-    fRemoveHadronPhysicsCMD->SetGuidance("Remove a physics process from Hadron Physics List");
-    fRemoveHadronPhysicsCMD->SetParameterName("PList",false);
-    fRemoveHadronPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
-
-    fListCMD = new G4UIcmdWithoutParameter("/exp/phys/list",this);
-    fListCMD->SetGuidance("Available Physics Lists");
-    fListCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
-
+    fRemovePhysicsCMD = new G4UIcmdWithAString("/exp/phys/removePhysics",this);
+    fRemovePhysicsCMD->SetGuidance("Remove a physics process from Physics List");
+    fRemovePhysicsCMD->SetParameterName("PList",false);
+    fRemovePhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
+*/
     fDecayDirectory = new G4UIdirectory("/decay/");
     fDecayDirectory->SetGuidance("Decay chain control commands.");
@@ -132,13 +114,8 @@
     delete fPosCutCMD;
     delete fAllCutCMD;
-
-    delete fAddPhysicsCMD;
-    delete fClearEMPhysicsCMD;
-    delete fClearHadronPhysicsCMD;
-    delete fRemoveEMPhysicsCMD;
-    delete fRemoveHadronPhysicsCMD;
-
-    delete fListCMD;
-
+/*
+    delete fClearPhysicsCMD;
+    delete fRemovePhysicsCMD;
+*/
     delete fPienuCMD;
     delete fPimunuCMD;
@@ -191,34 +168,11 @@
                                      ->GetNewDoubleValue(newValue));
     }
-    else if (command == fAddPhysicsCMD) {
+/*  else if (command == fClearPhysicsCMD) {
+        fPhysicsList->ClearPhysics();
+    }
+    else if (command == fRemovePhysicsCMD) {
         G4String name = newValue;
-        if (name == "PHYSLIST") {
-            char* path = getenv(name);
-            if (path) name = G4String(path);
-            else {
-                G4cout << "### F04PhysicsListMessenger WARNING: "
-                       << " environment variable PHYSLIST is not defined"
-                       << G4endl;
-                return; 
-            }
-        }
-        fPhysicsList->AddPhysicsList(name);
+        fPhysicsList->RemoveFromPhysicsList(name);
     }
-    else if (command == fClearEMPhysicsCMD) {
-        fPhysicsList->ClearEMPhysics();
-    }
-    else if (command == fClearHadronPhysicsCMD) {
-        fPhysicsList->ClearHadronPhysics();
-    }
-    else if (command == fRemoveEMPhysicsCMD) {
-        G4String name = newValue;
-        fPhysicsList->RemoveFromEMPhysicsList(name);
-    }
-    else if (command == fRemoveHadronPhysicsCMD) {
-        G4String name = newValue;
-        fPhysicsList->RemoveFromHadronPhysicsList(name);
-    }
-    else if (command == fListCMD) {
-        fPhysicsList->List();
-    }
+*/
 }
Index: trunk/examples/extended/field/field04/src/F04RunAction.cc
===================================================================
--- trunk/examples/extended/field/field04/src/F04RunAction.cc	(revision 1187)
+++ trunk/examples/extended/field/field04/src/F04RunAction.cc	(revision 1230)
@@ -38,5 +38,5 @@
 
 F04RunAction::F04RunAction()
-  : saveRndm(0)
+  : saveRndm(0), autoSeed(false)
 {
   runMessenger = new F04RunActionMessenger(this);
@@ -54,10 +54,21 @@
   G4RunManager::GetRunManager()->SetRandomNumberStore(true);
   G4RunManager::GetRunManager()->SetRandomNumberStoreDir("random/");
+
+  if (autoSeed) {
+     // automatic (time-based) random seeds for each run
+     G4cout << "*******************" << G4endl;
+     G4cout << "*** AUTOSEED ON ***" << G4endl;
+     G4cout << "*******************" << G4endl;
+     long seeds[2];
+     time_t systime = time(NULL);
+     seeds[0] = (long) systime;
+     seeds[1] = (long) (systime*G4UniformRand());
+     CLHEP::HepRandom::setTheSeeds(seeds);
+     CLHEP::HepRandom::showEngineStatus();
+  } else {
+     CLHEP::HepRandom::showEngineStatus();
+  }
   
-  if (saveRndm > 0)
-  { 
-      CLHEP::HepRandom::showEngineStatus();
-      CLHEP::HepRandom::saveEngineStatus("BeginOfRun.rndm");
-  }
+  if (saveRndm > 0) CLHEP::HepRandom::saveEngineStatus("BeginOfRun.rndm");
 
   FieldList* fields = F04GlobalField::getObject()->getFields();
@@ -73,6 +84,5 @@
 void F04RunAction::EndOfRunAction(const G4Run*)
 {
-  if (saveRndm == 1)
-  { 
+  if (saveRndm == 1) {
      CLHEP::HepRandom::showEngineStatus();
      CLHEP::HepRandom::saveEngineStatus("endOfRun.rndm");
Index: trunk/examples/extended/field/field04/src/F04RunActionMessenger.cc
===================================================================
--- trunk/examples/extended/field/field04/src/F04RunActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/field/field04/src/F04RunActionMessenger.cc	(revision 1230)
@@ -33,4 +33,5 @@
 #include "G4UIcmdWithAnInteger.hh"
 #include "G4UIcmdWithAString.hh"
+#include "G4UIcmdWithABool.hh"
 
 #include "F04RunAction.hh"
@@ -57,21 +58,32 @@
   RndmReadCmd->SetParameterName("fileName",true);
   RndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
-  RndmReadCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
+  RndmReadCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
+
+  SetAutoSeedCmd = new G4UIcmdWithABool("/rndm/autoSeed",this);
+  SetAutoSeedCmd->SetGuidance("Switch on/off time-based random seeds");
+  SetAutoSeedCmd->SetGuidance(" true: run seeds determined by system time");
+  SetAutoSeedCmd->SetGuidance("false: use command 'random/resetEngineFrom'");
+  SetAutoSeedCmd->SetGuidance("Default = false");
+  SetAutoSeedCmd->SetParameterName("autoSeed", false);
+  SetAutoSeedCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
 }
 
 F04RunActionMessenger::~F04RunActionMessenger()
 { 
-  delete RndmDir; delete RndmSaveCmd; delete RndmReadCmd;
+  delete RndmDir; delete RndmSaveCmd; delete RndmReadCmd; delete SetAutoSeedCmd;
 }
 
-void F04RunActionMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
+void F04RunActionMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
 {
   if (command == RndmSaveCmd)
-      runAction->SetRndmFreq(RndmSaveCmd->GetNewIntValue(newValues));
+      runAction->SetRndmFreq(RndmSaveCmd->GetNewIntValue(newValue));
 		 
   if (command == RndmReadCmd)
-  {  G4cout << "\n---> rndm status restored from file: " << newValues << G4endl;
-     CLHEP::HepRandom::restoreEngineStatus(newValues);
+  {  G4cout << "\n---> rndm status restored from file: " << newValue << G4endl;
+     CLHEP::HepRandom::restoreEngineStatus(newValue);
      CLHEP::HepRandom::showEngineStatus();
-  }   
+  }
+
+  if(command == SetAutoSeedCmd)
+      runAction->SetAutoSeed(SetAutoSeedCmd->GetNewBoolValue(newValue));
 }
Index: trunk/examples/extended/g3tog4/clGeometry/clGeometry.cc
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/clGeometry.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/clGeometry.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: clGeometry.cc,v 1.7 2006/06/29 17:20:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/clGeometry/include/G3toG4DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/include/G3toG4DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/include/G3toG4DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4DetectorConstruction.hh,v 1.4 2006/06/29 17:20:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #ifndef G3toG4DetectorConstruction_h
Index: trunk/examples/extended/g3tog4/clGeometry/include/G3toG4EventAction.hh
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/include/G3toG4EventAction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/include/G3toG4EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventAction.hh,v 1.3 2006/06/29 17:20:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/clGeometry/include/G3toG4EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/include/G3toG4EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/include/G3toG4EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventActionMessenger.hh,v 1.3 2006/06/29 17:20:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/clGeometry/include/G3toG4PhysicsList.hh
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/include/G3toG4PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/include/G3toG4PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PhysicsList.hh,v 1.3 2006/06/29 17:20:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/clGeometry/include/G3toG4PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/include/G3toG4PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/include/G3toG4PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PrimaryGeneratorAction.hh,v 1.3 2006/06/29 17:20:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/g3tog4/clGeometry/include/G3toG4RunAction.hh
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/include/G3toG4RunAction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/include/G3toG4RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4RunAction.hh,v 1.3 2006/06/29 17:20:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/g3tog4/clGeometry/src/G3toG4DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/src/G3toG4DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/src/G3toG4DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4DetectorConstruction.cc,v 1.5 2006/06/29 17:20:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //--------------------------------------------------------------------------
Index: trunk/examples/extended/g3tog4/clGeometry/src/G3toG4EventAction.cc
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/src/G3toG4EventAction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/src/G3toG4EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventAction.cc,v 1.5 2006/06/29 17:20:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/clGeometry/src/G3toG4EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/src/G3toG4EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/src/G3toG4EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventActionMessenger.cc,v 1.4 2006/06/29 17:20:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/clGeometry/src/G3toG4PhysicsList.cc
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/src/G3toG4PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/src/G3toG4PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PhysicsList.cc,v 1.5 2006/06/29 17:20:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/clGeometry/src/G3toG4PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/src/G3toG4PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/src/G3toG4PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PrimaryGeneratorAction.cc,v 1.5 2006/06/29 17:20:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/g3tog4/clGeometry/src/G3toG4RunAction.cc
===================================================================
--- trunk/examples/extended/g3tog4/clGeometry/src/G3toG4RunAction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/clGeometry/src/G3toG4RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4RunAction.cc,v 1.4 2006/06/29 17:20:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/g3tog4/cltog4/cltog4.cc
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/cltog4.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/cltog4.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: cltog4.cc,v 1.6 2006/06/29 17:20:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/cltog4/include/G3toG4DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/include/G3toG4DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/include/G3toG4DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4DetectorConstruction.hh,v 1.3 2006/06/29 17:20:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #ifndef G3toG4DetectorConstruction_h
Index: trunk/examples/extended/g3tog4/cltog4/include/G3toG4EventAction.hh
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/include/G3toG4EventAction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/include/G3toG4EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventAction.hh,v 1.3 2006/06/29 17:20:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/cltog4/include/G3toG4EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/include/G3toG4EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/include/G3toG4EventActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventActionMessenger.hh,v 1.3 2006/06/29 17:20:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/cltog4/include/G3toG4PhysicsList.hh
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/include/G3toG4PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/include/G3toG4PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PhysicsList.hh,v 1.3 2006/06/29 17:20:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/cltog4/include/G3toG4PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/include/G3toG4PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/include/G3toG4PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PrimaryGeneratorAction.hh,v 1.3 2006/06/29 17:20:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/g3tog4/cltog4/include/G3toG4RunAction.hh
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/include/G3toG4RunAction.hh	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/include/G3toG4RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4RunAction.hh,v 1.3 2006/06/29 17:20:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/g3tog4/cltog4/src/G3toG4DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/src/G3toG4DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/src/G3toG4DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4DetectorConstruction.cc,v 1.5 2006/06/29 17:20:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //--------------------------------------------------------------------------
Index: trunk/examples/extended/g3tog4/cltog4/src/G3toG4EventAction.cc
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/src/G3toG4EventAction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/src/G3toG4EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventAction.cc,v 1.6 2006/06/29 17:20:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/cltog4/src/G3toG4EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/src/G3toG4EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/src/G3toG4EventActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4EventActionMessenger.cc,v 1.4 2006/06/29 17:20:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/cltog4/src/G3toG4PhysicsList.cc
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/src/G3toG4PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/src/G3toG4PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PhysicsList.cc,v 1.5 2006/06/29 17:21:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/g3tog4/cltog4/src/G3toG4PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/src/G3toG4PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/src/G3toG4PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4PrimaryGeneratorAction.cc,v 1.5 2006/06/29 17:21:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/g3tog4/cltog4/src/G3toG4RunAction.cc
===================================================================
--- trunk/examples/extended/g3tog4/cltog4/src/G3toG4RunAction.cc	(revision 1187)
+++ trunk/examples/extended/g3tog4/cltog4/src/G3toG4RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G3toG4RunAction.cc,v 1.4 2006/06/29 17:21:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/geometry/olap/include/G4GeoNav.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/G4GeoNav.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/G4GeoNav.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeoNav.hh,v 1.4 2006/06/29 17:21:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapDetConstr.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapDetConstr.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapDetConstr.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapDetConstr.hh,v 1.2 2006/06/29 17:22:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapEventAction.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapEventAction.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapEventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapEventAction.hh,v 1.3 2006/06/29 17:22:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapGenerator.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapGenerator.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapGenerator.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapGenerator.hh,v 1.3 2006/06/29 17:22:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapLogManager.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapLogManager.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapLogManager.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapLogManager.hh,v 1.2 2006/06/29 17:22:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapManager.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapManager.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapManager.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapManager.hh,v 1.4 2006/06/29 17:22:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapManagerMessenger.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapManagerMessenger.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapManagerMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapManagerMessenger.hh,v 1.2 2006/06/29 17:22:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapNotify.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapNotify.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapNotify.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapNotify.hh,v 1.3 2006/06/29 17:22:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapPhysicsList.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapPhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapPhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapPhysicsList.hh,v 1.2 2006/06/29 17:22:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapRunAction.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapRunAction.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapRunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapRunAction.hh,v 1.3 2006/06/29 17:22:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/OlapSteppingAction.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/OlapSteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/OlapSteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapSteppingAction.hh,v 1.3 2006/06/29 17:22:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/RandomDetector.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/RandomDetector.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/RandomDetector.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RandomDetector.hh,v 1.2 2006/06/29 17:22:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/SolidAnalyser.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/SolidAnalyser.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/SolidAnalyser.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SolidAnalyser.hh,v 1.3 2006/06/29 17:22:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/include/tree.hh
===================================================================
--- trunk/examples/extended/geometry/olap/include/tree.hh	(revision 1187)
+++ trunk/examples/extended/geometry/olap/include/tree.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: tree.hh,v 1.4 2006/06/29 17:22:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/olapex.cc
===================================================================
--- trunk/examples/extended/geometry/olap/olapex.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/olapex.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: olapex.cc,v 1.3 2006/06/29 17:21:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/G4GeoNav.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/G4GeoNav.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/G4GeoNav.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4GeoNav.cc,v 1.3 2006/06/29 17:22:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapDetConstr.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapDetConstr.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapDetConstr.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapDetConstr.cc,v 1.4 2006/06/29 17:22:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapEventAction.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapEventAction.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapEventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapEventAction.cc,v 1.5 2006/06/29 17:22:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapGenerator.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapGenerator.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapGenerator.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapGenerator.cc,v 1.4 2006/06/29 17:22:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapLogManager.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapLogManager.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapLogManager.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapLogManager.cc,v 1.3 2006/06/29 17:22:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapManager.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapManager.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapManager.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapManager.cc,v 1.3 2006/06/29 17:23:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapManagerMessenger.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapManagerMessenger.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapManagerMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapManagerMessenger.cc,v 1.3 2006/06/29 17:23:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapNotify.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapNotify.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapNotify.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapNotify.cc,v 1.2 2006/06/29 17:23:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapPhysicsList.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapPhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapPhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapPhysicsList.cc,v 1.2 2006/06/29 17:23:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapRunAction.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapRunAction.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapRunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapRunAction.cc,v 1.5 2006/06/29 17:23:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/OlapSteppingAction.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/OlapSteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/OlapSteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: OlapSteppingAction.cc,v 1.3 2006/06/29 17:23:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/RandomDetector.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/RandomDetector.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/RandomDetector.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RandomDetector.cc,v 1.5 2006/06/29 17:23:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/geometry/olap/src/SolidAnalyser.cc
===================================================================
--- trunk/examples/extended/geometry/olap/src/SolidAnalyser.cc	(revision 1187)
+++ trunk/examples/extended/geometry/olap/src/SolidAnalyser.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: SolidAnalyser.cc,v 1.6 2006/06/29 17:23:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/hadronic/Hadr01/GNUmakefile
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/GNUmakefile	(revision 1230)
@@ -1,4 +1,4 @@
-# $Id: GNUmakefile,v 1.7 2006/10/31 15:05:33 vnivanch Exp $
-# GEANT4 tag $Name:  $
+# $Id: GNUmakefile,v 1.8 2008/06/13 15:41:34 vnivanch Exp $
+# GEANT4 tag $Name: geant4-09-03-cand-01 $
 # --------------------------------------------------------------
 # GNUmakefile for examples module with AIDA interface
@@ -16,15 +16,5 @@
 all: lib bin
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-# for the aida-config command see the README file
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/hadronic/Hadr01/hadr01.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/hadr01.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/hadr01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: hadr01.cc,v 1.9 2006/11/24 16:48:57 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------
Index: trunk/examples/extended/hadronic/Hadr01/include/CheckVolumeSD.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/CheckVolumeSD.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/CheckVolumeSD.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: CheckVolumeSD.hh,v 1.3 2006/06/29 17:23:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.4 2006/06/29 17:23:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.7 2007/05/16 11:43:30 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/EventAction.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.3 2006/06/29 17:23:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 17:23:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/Histo.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/Histo.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/Histo.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: Histo.hh,v 1.6 2007/05/24 13:52:31 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef Histo_h
Index: trunk/examples/extended/hadronic/Hadr01/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/HistoManager.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.hh,v 1.8 2007/05/16 11:43:30 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: HistoManager.hh,v 1.9 2009/08/28 09:21:34 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
@@ -122,4 +122,7 @@
   G4double edepMax;
   G4double edepEvt;
+  G4double edepEM;
+  G4double edepPI;
+  G4double edepP;
   G4double edepSum;
   G4double edepSum2;
Index: trunk/examples/extended/hadronic/Hadr01/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.5 2006/11/15 14:58:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.6 2007/11/14 18:59:08 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/PhysicsListMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 17:23:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/hadronic/Hadr01/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 17:23:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/hadronic/Hadr01/include/StackingAction.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/StackingAction.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/StackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.hh,v 1.3 2006/06/29 17:23:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/include/StackingMessenger.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/StackingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/StackingMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingMessenger.hh,v 1.3 2006/06/29 17:23:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/hadronic/Hadr01/include/TargetSD.hh
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/include/TargetSD.hh	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/include/TargetSD.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TargetSD.hh,v 1.4 2006/06/29 17:24:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/CheckVolumeSD.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/CheckVolumeSD.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/CheckVolumeSD.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: CheckVolumeSD.cc,v 1.3 2006/06/29 17:24:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.6 2006/10/04 09:56:03 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.7 2007/05/16 11:43:30 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/EventAction.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.4 2007/05/16 11:43:30 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 17:24:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/Histo.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/Histo.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/Histo.cc	(revision 1230)
@@ -51,9 +51,9 @@
   verbose    = ver;
   histName   = "histo";
-  histType   = "hbook";
+  histType   = "root";
   option     = "--noErrors uncompress";
   nHisto     = 0;
   defaultAct = 1;
-  tupleName  = "tuple.hbook";
+  tupleName  = "tree.root";
   tupleId    = "100";
   tupleList  = "";
Index: trunk/examples/extended/hadronic/Hadr01/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.14 2007/05/24 13:52:31 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: HistoManager.cc,v 1.16 2009/09/02 10:21:32 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
@@ -90,5 +90,5 @@
   nSlices   = 300;
   nBinsE    = 100;
-  nHisto    = 22;
+  nHisto    = 25;
   length    = 300.*mm;
   edepMax   = 1.0*GeV;
@@ -133,6 +133,12 @@
   histo->add1D("20","Log10 Energy (MeV) of pi+",nBinsE,-4.,6.,1.0);
   histo->add1D("21","Log10 Energy (MeV) of pi-",nBinsE,-4.,6.,1.0);
-  histo->add1D("22","Energy deposition (GeV) in the target",
-	       nBinsE,0.0,edepMax,GeV);
+  histo->add1D("22","Energy deposition in the target normalized to beam energy",
+	       110,0.0,1.1,1.0);
+  histo->add1D("23","EM energy deposition in the target normalized to beam energy",
+	       110,0.0,1.1,1.0);
+  histo->add1D("24","Pion energy deposition in the target normalized to beam energy",
+	       110,0.0,1.1,1.0);
+  histo->add1D("25","Proton energy deposition in the target normalized to beam energy",
+	       110,0.0,1.1,1.0);
 }
 
@@ -256,4 +262,7 @@
 {
   edepEvt = 0.0;
+  edepEM  = 0.0;
+  edepPI  = 0.0;
+  edepP   = 0.0;
 }
 
@@ -264,5 +273,8 @@
   edepSum  += edepEvt;
   edepSum2 += edepEvt*edepEvt;
-  histo->fill(21,edepEvt,1.0);
+  histo->fill(21,edepEvt/primaryKineticEnergy,1.0);
+  histo->fill(22,edepEM/primaryKineticEnergy,1.0);
+  histo->fill(23,edepPI/primaryKineticEnergy,1.0);
+  histo->fill(24,edepP/primaryKineticEnergy,1.0);
 }
 
@@ -372,4 +384,14 @@
     edepEvt += edep;
     histo->fill(0,z,edep);
+    const G4ParticleDefinition* pd = currentDef;
+
+    if(pd == G4Gamma::Gamma() || pd == G4Electron::Electron() 
+       || pd == G4Positron::Positron()) {
+      edepEM += edep;
+    } else if ( pd == G4PionPlus::PionPlus() || pd == G4PionMinus::PionMinus()) {
+      edepPI += edep;
+    } else if ( pd == G4Proton::Proton() || pd == G4AntiProton::AntiProton()) {
+      edepP  += edep;
+    }
 
     if(1 < verbose) 
Index: trunk/examples/extended/hadronic/Hadr01/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/HistoMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.5 2006/06/29 17:24:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/PhysicsList.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: PhysicsList.cc,v 1.24 2007/12/12 12:00:24 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.31 2009/08/28 09:21:34 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
@@ -45,4 +45,5 @@
 
 #include "G4DecayPhysics.hh"
+#include "G4EmStandardPhysics_option3.hh"
 #include "G4EmStandardPhysics_option2.hh"
 #include "G4EmStandardPhysics_option1.hh"
@@ -52,4 +53,5 @@
 #include "G4HadronQElasticPhysics.hh"
 #include "G4HadronHElasticPhysics.hh"
+#include "G4ChargeExchangePhysics.hh"
 #include "G4NeutronTrackingCut.hh"
 #include "G4QStoppingPhysics.hh"
@@ -60,15 +62,15 @@
 #include "G4EmProcessOptions.hh"
 
-#include "HadronPhysicsFTFC.hh"
+#include "HadronPhysicsFTFP_BERT_TRV.hh"
 #include "HadronPhysicsFTFP.hh"
 #include "HadronPhysicsFTFP_BERT.hh"
+#include "HadronPhysicsFTF_BIC.hh"
 #include "HadronPhysicsLHEP.hh"
-#include "HadronPhysicsLHEP_BERT.hh"
 #include "HadronPhysicsLHEP_EMV.hh"
-#include "HadronPhysicsLHEP_PRECO_HP.hh"
 #include "G4HadronInelasticQBBC.hh"
 #include "HadronPhysicsQGSC.hh"
 #include "HadronPhysicsQGSC_BERT.hh"
-#include "HadronPhysicsQGSC_EFLOW.hh"
+#include "HadronPhysicsQGSC_CHIPS.hh"
+#include "HadronPhysicsQGSC_QGSC.hh"
 #include "HadronPhysicsQGSP.hh"
 #include "HadronPhysicsQGSP_BERT.hh"
@@ -76,8 +78,9 @@
 #include "HadronPhysicsQGSP_BIC.hh"
 #include "HadronPhysicsQGSP_BIC_HP.hh"
+#include "HadronPhysicsQGSP_FTFP_BERT.hh"
+#include "HadronPhysicsQGS_BIC.hh"
 
 #include "G4HadronInelasticQLHEP.hh"
 #include "G4IonPhysics.hh"
-#include "G4HadronProcessStore.hh"
 
 #include "G4LossTableManager.hh"
@@ -100,4 +103,5 @@
   cutForPositron  = defaultCutValue;
   dump            = false;
+  verboseLevel    = 1;
 
   pMessenger = new PhysicsListMessenger(this);
@@ -139,6 +143,4 @@
     hadronPhys[i]->ConstructProcess();
   }
-
-  if(dump) G4HadronProcessStore::Instance()->Dump(1);
 }
 
@@ -155,4 +157,9 @@
     emPhysicsList = new G4EmStandardPhysics_option2();
 
+  } else if (name == "emstandard_opt3") {
+
+    delete emPhysicsList;
+    emPhysicsList = new G4EmStandardPhysics_option3();
+
   } else if (name == "emstandard_opt1") {
 
@@ -160,9 +167,13 @@
     emPhysicsList = new G4EmStandardPhysics_option1();
 
-  } else if (name == "FTFC") {
-
-    SetBuilderList1();
-    hadronPhys.push_back( new HadronPhysicsFTFC("hadron",true));
-    dump = true;
+  } else if (name == "FTFP_BERT_EMV") {
+
+    AddPhysicsList("emstandard_opt1");
+    AddPhysicsList("FTFP_BERT");
+
+  } else if (name == "FTFP_BERT_EMX") {
+
+    AddPhysicsList("emstandard_opt2");
+    AddPhysicsList("FTFP_BERT");
 
   } else if (name == "FTFP") {
@@ -178,8 +189,15 @@
     dump = true;
 
-  } else if (name == "FTFP_EMV") {
-
-    AddPhysicsList("emstandard_opt1");
-    AddPhysicsList("FTFP");
+  } else if (name == "FTFP_BERT_TRV") {
+
+    SetBuilderList1();
+    hadronPhys.push_back( new HadronPhysicsFTFP_BERT_TRV("hadron",true));
+    dump = true;
+
+  } else if (name == "FTF_BIC") {
+
+    SetBuilderList0();
+    hadronPhys.push_back( new HadronPhysicsFTF_BIC("hadron",true));
+    dump = true;
 
   } else if (name == "LHEP") {
@@ -187,10 +205,4 @@
     SetBuilderList2();
     hadronPhys.push_back( new HadronPhysicsLHEP("hadron"));
-    dump = true;
-
-  } else if (name == "LHEP_BERT") {
-
-    SetBuilderList3();
-    hadronPhys.push_back( new HadronPhysicsLHEP_BERT("hadron"));
     dump = true;
 
@@ -202,15 +214,22 @@
     dump = true;
 
-  } else if (name == "LHEP_PRECO_HP") {
-
-    SetBuilderList3(true);
-    hadronPhys.push_back( new HadronPhysicsLHEP_PRECO_HP("hadron"));
-    dump = true;
-
   } else if (name == "QBBC") {
 
     SetBuilderList0();
     hadronPhys.push_back( new G4HadronInelasticQBBC("QBBC",verboseLevel,
-						    false,false,false,false,true));
+						    false,true,false,false,false));
+
+  } else if (name == "QBBCG") {
+
+    SetBuilderList0();
+    hadronPhys.push_back( new G4ChargeExchangePhysics(verboseLevel,false));
+    hadronPhys.push_back( new G4HadronInelasticQBBC("QBBC",verboseLevel,
+						    false,true,false,false,true));
+  } else if (name == "QBBCF") {
+
+    SetBuilderList0();
+    hadronPhys.push_back( new G4ChargeExchangePhysics(verboseLevel,false));
+    hadronPhys.push_back( new G4HadronInelasticQBBC("QBBC",verboseLevel,
+						    false,true,false,false,false));
 
   } else if (name == "QBBC_DEL") {
@@ -243,8 +262,14 @@
     dump = true;
 
-  } else if (name == "QGSC_EFLOW") {
+  } else if (name == "QGSC_CHIPS") {
 
     SetBuilderList4();
-    hadronPhys.push_back( new HadronPhysicsQGSC_EFLOW("hadron",true));
+    hadronPhys.push_back( new HadronPhysicsQGSC_CHIPS("hadron",true));
+    dump = true;
+
+  } else if (name == "QGSC_QGSC") {
+
+    SetBuilderList4();
+    hadronPhys.push_back( new HadronPhysicsQGSC_QGSC("hadron",true));
     dump = true;
 
@@ -266,4 +291,10 @@
     dump = true;
 
+  } else if (name == "QGSP_FTFP_BERT") {
+
+    SetBuilderList1();
+    hadronPhys.push_back( new HadronPhysicsQGSP_FTFP_BERT("hadron",true));
+    dump = true;
+
   } else if (name == "QGSP_BERT_EMV") {
 
@@ -271,4 +302,9 @@
     AddPhysicsList("QGSP_BERT");
 
+  } else if (name == "QGSP_BERT_EMX") {
+
+    AddPhysicsList("emstandard_opt2");
+    AddPhysicsList("QGSP_BERT");
+
   } else if (name == "QGSP_BERT_HP") {
 
@@ -282,4 +318,10 @@
     dump = true;
 
+  } else if (name == "QGS_BIC") {
+
+    SetBuilderList0();
+    hadronPhys.push_back( new HadronPhysicsQGS_BIC("hadron",true));
+    dump = true;
+
   } else if (name == "QGSP_BIC_HP") {
 
@@ -288,36 +330,8 @@
     dump = true;
 
-  } else if (name == "QGSP_DIF") {
-
-    SetBuilderList1();
-    HadronPhysicsQGSP * hp = new HadronPhysicsQGSP("hadron");
-    hp->SetQuasiElastic(true);
-    hp->SetProjectileDiffraction(true);
-    hadronPhys.push_back(hp);
-    dump = true;
-
-  } else if (name == "QGSP_EMV") {
-
-    AddPhysicsList("emstandard_opt1");
-    AddPhysicsList("QGSP");
-    dump = true;
-
-  } else if (name == "QGSP_EMX") {
-
-    AddPhysicsList("emstandard_opt2");
-    AddPhysicsList("QGSP");
-    dump = true;
-
-  } else if (name == "QGSP_NQE") {
-
-    SetBuilderList1();
-    hadronPhys.push_back( new HadronPhysicsQGSP("hadron",false));
-    dump = true;
-
-  } else if (name == "QGSP_QEL") {
-
-    SetBuilderList4();
-    hadronPhys.push_back( new HadronPhysicsQGSP("hadron",true));
-    dump = true;
+  } else if (name == "QGSP_BIC_EMY") {
+
+    AddPhysicsList("emstandard_opt3");
+    AddPhysicsList("QGSP_BIC");
 
   } else {
@@ -338,5 +352,5 @@
   hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
   hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC"));
-  hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
+  hadronPhys.push_back( new G4NeutronTrackingCut("nTackingCut",verboseLevel));
 }
 
@@ -350,5 +364,5 @@
   hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
   hadronPhys.push_back( new G4IonPhysics("ion"));
-  hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
+  hadronPhys.push_back( new G4NeutronTrackingCut("nTackingCut",verboseLevel));
 }
 
@@ -382,5 +396,5 @@
   hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
   hadronPhys.push_back( new G4IonPhysics("ion"));
-  hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
+  hadronPhys.push_back( new G4NeutronTrackingCut("nTackingCut",verboseLevel));
 }
 
@@ -393,5 +407,5 @@
   hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
   hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC"));
-  hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
+  hadronPhys.push_back( new G4NeutronTrackingCut("nTackingCut",verboseLevel));
 }
 
@@ -404,5 +418,5 @@
   hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
   hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC"));
-  hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
+  hadronPhys.push_back( new G4NeutronTrackingCut("nTackingCut",verboseLevel));
 }
 
@@ -452,14 +466,12 @@
 void PhysicsList::List()
 {
-  G4cout << "### PhysicsLists available: FTFC FTFP FTFP_BERT FTFP_EMV LHEP LHEP_BERT LHEP_EMV "
+  G4cout << "### PhysicsLists available: FTFP FTFP_BERT FTFP_BERT_EMV FTFP_BERT_EMX FTFP_BERT_TRV FTF_BIC LHEP LHEP_EMV"
 	 << G4endl;
-  G4cout << "                            LHEP_PRECO_HP QBBC QBBC_DEL QBBC_HEL QBBC_HP QGSC "
+  G4cout << "                            QBBC QBBC_DEL QBBC_HEL QBBC_HP QGSC "
 	 << G4endl; 
-  G4cout << "                            QGSC_BERT QGSC_EFLOW QGSC_EMV QGSP QGSP_BERT QGSP_BER_EMV "
+  G4cout << "                            QGSC_BERT QGSC_CHIPS QGSC_QGSC QGSC_EMV QGSP QGSP_BERT QGSP_BER_EMV "
 	 << G4endl; 
-  G4cout << "                            QGSP_BERT_HP QGSP_BIC QGSP_BIC_HP QGSP_DIF " 
+  G4cout << "                            QGSP_BERT_EMX QGSP_BERT_HP QGSP_BIC QGSP_BIC_HP QGSP_FTFP_BERT " 
 	 << G4endl; 
-  G4cout << "                            QGSP_EMV QGSP_EMX QGSP_NQE QGSP_QEL  "
-	 << G4endl; 
 }
 
Index: trunk/examples/extended/hadronic/Hadr01/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/PhysicsListMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.4 2006/08/11 14:38:11 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/hadronic/Hadr01/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.4 2006/11/15 14:58:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/RunAction.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/RunAction.cc	(revision 1230)
@@ -40,5 +40,4 @@
 #include "G4UImanager.hh"
 #include "G4VVisManager.hh"
-#include "G4HadronProcessStore.hh"
 #include "G4NistManager.hh"
 #include "G4Element.hh"
Index: trunk/examples/extended/hadronic/Hadr01/src/StackingAction.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/StackingAction.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/StackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.cc,v 1.5 2006/10/04 09:56:03 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/StackingMessenger.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/StackingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/StackingMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingMessenger.cc,v 1.3 2006/06/29 17:24:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/hadronic/Hadr01/src/TargetSD.cc
===================================================================
--- trunk/examples/extended/hadronic/Hadr01/src/TargetSD.cc	(revision 1187)
+++ trunk/examples/extended/hadronic/Hadr01/src/TargetSD.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TargetSD.cc,v 1.4 2006/06/29 17:24:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 /////////////////////////////////////////////////////////////////////////
Index: trunk/examples/extended/medical/DICOM/dicom.cc
===================================================================
--- trunk/examples/extended/medical/DICOM/dicom.cc	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/dicom.cc	(revision 1230)
@@ -56,4 +56,5 @@
 #include "DicomPrimaryGeneratorAction.hh"
 #include "DicomEventAction.hh"
+#include "DicomRunAction.hh"
 #include "DicomHandler.hh"
 
@@ -77,5 +78,6 @@
   runManager->SetUserInitialization(theGeometry);
   runManager->SetUserAction(new DicomPrimaryGeneratorAction());
-  //  runManager->SetUserAction(new DicomEventAction);
+  runManager->SetUserAction(new DicomRunAction);
+  runManager->SetUserAction(new DicomEventAction);
 
   runManager->Initialize();
Index: trunk/examples/extended/medical/DICOM/include/DicomDetectorConstruction.hh
===================================================================
--- trunk/examples/extended/medical/DICOM/include/DicomDetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/include/DicomDetectorConstruction.hh	(revision 1230)
@@ -79,4 +79,6 @@
   // construct the patient volumes. This method should be implemented for each of the derived classes
 
+  void SetScorer(G4LogicalVolume* voxel_logic);
+
 protected:
   G4Material* air;
Index: trunk/examples/extended/medical/DICOM/include/DicomNestedPhantomParameterisation.hh
===================================================================
--- trunk/examples/extended/medical/DICOM/include/DicomNestedPhantomParameterisation.hh	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/include/DicomNestedPhantomParameterisation.hh	(revision 1230)
@@ -24,11 +24,16 @@
 // ********************************************************************
 //
-#ifndef RE02NESTEDPARAMETERISATION_HH
-#define RE02NESTEDPARAMETERISATION_HH
+// $Id: DicomNestedPhantomParameterisation.hh,v 1.3 2009/01/27 10:44:58 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+// --------------------------------------------------------------------
+#ifndef DICOMNESTEDPARAMETERISATION_HH
+#define DICOMNESTEDPARAMETERISATION_HH
+
+#include <vector>
 
 #include "G4Types.hh"
+#include "G4ThreeVector.hh"
 #include "G4VNestedParameterisation.hh" 
-#include "G4ThreeVector.hh"
-#include <vector>
 
 class G4VPhysicalVolume;
@@ -52,78 +57,68 @@
 class G4Hype;
 
-class DicomNestedPhantomParameterisation: public G4VNestedParameterisation
+class DicomNestedPhantomParameterisation : public G4VNestedParameterisation
 {
-  public:  // with description
+  public:
 
     DicomNestedPhantomParameterisation(const G4ThreeVector& voxelSize,
-				      std::vector<G4Material*>& mat);
+                                       std::vector<G4Material*>& mat);
     virtual ~DicomNestedPhantomParameterisation(); 
 
-    // Methods required in derived classes
-    // -----------------------------------
-    virtual G4Material* ComputeMaterial(G4VPhysicalVolume *currentVol,
-					const G4int repNo, 
-                                        const G4VTouchable *parentTouch=0
-                                        );
-  // Required method, as it is the reason for this class.
-  //   Must cope with parentTouch=0 for navigator's SetupHierarchy
+    G4Material* ComputeMaterial(G4VPhysicalVolume *currentVol,
+                                const G4int repNo, 
+                                const G4VTouchable *parentTouch );
+      // Must cope with parentTouch for navigator's SetupHierarchy
 
-    virtual G4int       GetNumberOfMaterials() const;
-    virtual G4Material* GetMaterial(G4int idx) const;
+    G4int       GetNumberOfMaterials() const;
+    G4Material* GetMaterial(G4int idx) const;
       // Needed to define materials for instances of Nested Parameterisation 
-      //   Current convention: each call should return the materials 
-      //   of all instances with the same mother/ancestor volume.
+      // Current convention: each call should return the materials 
+      // of all instances with the same mother/ancestor volume
+
     size_t GetMaterialIndex( size_t nx, size_t ny, size_t nz) const;
     size_t GetMaterialIndex( size_t copyNo) const;
-    void SetMaterialIndices( size_t* matInd ){
-      fMaterialIndices = matInd; }
+    void SetMaterialIndices( size_t* matInd ) { fMaterialIndices = matInd; }
     void SetNoVoxel( size_t nx, size_t ny, size_t nz );
 
-    virtual void ComputeTransformation(const G4int no,
-                                       G4VPhysicalVolume *currentPV) const;
-
-    // Methods optional in derived classes
-    // -----------------------------------
+    void ComputeTransformation(const G4int no,
+                                     G4VPhysicalVolume *currentPV) const;
 
     // Additional standard Parameterisation methods, 
-    //   which can be optionally defined, in case solid is used.
+    // which can be optionally defined, in case solid is used.
 
-    virtual void ComputeDimensions(G4Box &,
-                                   const G4int,
-                                   const G4VPhysicalVolume *) const;
+    void ComputeDimensions(G4Box &, const G4int,
+                                    const G4VPhysicalVolume *) const;
 
-private:  // Dummy declarations to get rid of warnings ...
-  void ComputeDimensions (G4Trd&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Trap&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Cons&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Sphere&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Orb&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Torus&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Para&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Hype&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Tubs&,const G4int,const G4VPhysicalVolume*) 
-    const {}
-  void ComputeDimensions (G4Polycone&,const G4int,const G4VPhysicalVolume*)
-    const {}
-  void ComputeDimensions (G4Polyhedra&,const G4int,const G4VPhysicalVolume*) 
-    const {}
+  private:  // Dummy declarations to get rid of warnings ...
 
-private:
-  G4double fdX,fdY,fdZ;
-  G4int fnX,fnY,fnZ;
-  
-  //
-  std::vector<G4Material*> fMaterials;
+    void ComputeDimensions (G4Trd&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Trap&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Cons&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Sphere&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Orb&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Torus&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Para&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Hype&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Tubs&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Polycone&, const G4int,
+                            const G4VPhysicalVolume*) const {}
+    void ComputeDimensions (G4Polyhedra&, const G4int,
+                            const G4VPhysicalVolume*) const {}
 
-  size_t* fMaterialIndices;
-      // Index in fMaterials that correspond to each voxel.
+  private:
+
+    G4double fdX,fdY,fdZ;
+    G4int fnX,fnY,fnZ;
+    std::vector<G4Material*> fMaterials;
+    size_t* fMaterialIndices; // Index in materials corresponding to each voxel
 };
 
Index: trunk/examples/extended/medical/DICOM/src/DicomDetectorConstruction.cc
===================================================================
--- trunk/examples/extended/medical/DICOM/src/DicomDetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/src/DicomDetectorConstruction.cc	(revision 1230)
@@ -451,2 +451,31 @@
 }
 
+
+#include "G4SDManager.hh"
+#include "G4MultiFunctionalDetector.hh"
+#include "G4PSDoseDeposit_RegNav.hh"
+
+//-------------------------------------------------------------
+void DicomDetectorConstruction::SetScorer(G4LogicalVolume* voxel_logic)
+{
+
+  G4SDManager* SDman = G4SDManager::GetSDMpointer();
+  //
+  // Sensitive Detector Name
+  G4String concreteSDname = "PatientSD";
+
+  //------------------------
+  // MultiFunctionalDetector
+  //------------------------
+  //
+  // Define MultiFunctionalDetector with name.
+  G4MultiFunctionalDetector* MFDet = new G4MultiFunctionalDetector(concreteSDname);
+  SDman->AddNewDetector( MFDet );                 // Register SD to SDManager
+
+  voxel_logic->SetSensitiveDetector(MFDet);
+
+  G4PSDoseDeposit_RegNav*   scorer = new G4PSDoseDeposit_RegNav("DoseDeposit");  
+  MFDet->RegisterPrimitive(scorer);
+
+}
+
Index: trunk/examples/extended/medical/DICOM/src/DicomNestedPhantomParameterisation.cc
===================================================================
--- trunk/examples/extended/medical/DICOM/src/DicomNestedPhantomParameterisation.cc	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/src/DicomNestedPhantomParameterisation.cc	(revision 1230)
@@ -24,5 +24,8 @@
 // ********************************************************************
 //
-///////////////////////////////////////////////////////////////////////////////
+// $Id: DicomNestedPhantomParameterisation.cc,v 1.5 2009/01/27 10:44:58 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+// --------------------------------------------------------------------
 #include "DicomNestedPhantomParameterisation.hh"
 
@@ -34,12 +37,13 @@
 #include "G4Material.hh"
 
-DicomNestedPhantomParameterisation::DicomNestedPhantomParameterisation(
-						     const G4ThreeVector& voxelSize,
-						     std::vector<G4Material*>& mat):
-  G4VNestedParameterisation(),fdX(voxelSize.x()),fdY(voxelSize.y()),fdZ(voxelSize.z()),fMaterials(mat)
+DicomNestedPhantomParameterisation::
+DicomNestedPhantomParameterisation(const G4ThreeVector& voxelSize,
+                                         std::vector<G4Material*>& mat):
+  G4VNestedParameterisation(), fdX(voxelSize.x()),
+  fdY(voxelSize.y()), fdZ(voxelSize.z()), fMaterials(mat)
 {
   // Position of voxels. 
-  // x and y positions are already defined in DetectorConstruction 
-  // by using replicated volume. Here only we need to define is z positions of voxes.
+  // x and y positions are already defined in DetectorConstruction by using
+  // replicated volume. Here only we need to define is z positions of voxels.
 }
 
@@ -48,5 +52,6 @@
 }
 
-void DicomNestedPhantomParameterisation::SetNoVoxel( size_t nx, size_t ny, size_t nz )
+void DicomNestedPhantomParameterisation::
+SetNoVoxel( size_t nx, size_t ny, size_t nz )
 {
   fnX = nx;
@@ -58,9 +63,12 @@
 // Material assignment to geometry.
 //
-G4Material* DicomNestedPhantomParameterisation::ComputeMaterial(G4VPhysicalVolume* ,
-							 const G4int copyNoZ, 
-							 const G4VTouchable* parentTouch)
+G4Material* DicomNestedPhantomParameterisation::
+ComputeMaterial(G4VPhysicalVolume*, const G4int copyNoZ, 
+                                    const G4VTouchable* parentTouch)
 {
-  if(parentTouch==0) return fMaterials[0]; // protection for initialization and vis at idle state
+  // protection for initialization and vis at idle state
+  //
+  if(parentTouch==0) return fMaterials[0];
+
   // Copy number of voxels. 
   // Copy number of X and Y are obtained from replication number.
@@ -70,10 +78,9 @@
   G4int iz = copyNoZ;
 
-  G4int copyNo = ix + fnZ*iy + fnX*fnY*iz;
+  G4int copyNo = ix + fnX*iy + fnX*fnY*iz;
 
   size_t matIndex = GetMaterialIndex(copyNo);
 
   return fMaterials[ matIndex ];
-
 }
 
@@ -86,8 +93,10 @@
 
 //
-//  Number of Materials
-//  Material scanner is required for preparing physics tables and so on before 
-//  stating simulation, so that G4 has to know number of materials.
-G4int       DicomNestedPhantomParameterisation::GetNumberOfMaterials() const{
+// Number of Materials
+// Material scanner is required for preparing physics tables and so on before 
+// starting simulation, so that G4 has to know number of materials.
+//
+G4int DicomNestedPhantomParameterisation::GetNumberOfMaterials() const
+{
   return fMaterials.size();
 }
@@ -97,5 +106,6 @@
 //  This is needed for material scanner and realizing geometry.
 //
-G4Material* DicomNestedPhantomParameterisation::GetMaterial(G4int i) const{
+G4Material* DicomNestedPhantomParameterisation::GetMaterial(G4int i) const
+{
   return fMaterials[i];
 }
@@ -104,8 +114,8 @@
 // Transformation of voxels.
 //
-void DicomNestedPhantomParameterisation::ComputeTransformation(const G4int copyNo, 
-						  G4VPhysicalVolume* physVol)const{
+void DicomNestedPhantomParameterisation::
+ComputeTransformation(const G4int copyNo, G4VPhysicalVolume* physVol) const
+{
   G4ThreeVector position(0.,0.,(2*copyNo+1)*fdZ - fdZ*fnZ);
-
   physVol->SetTranslation(position);
 }
@@ -114,7 +124,7 @@
 // Dimensions are always same in this RE02 example.
 //
-void DicomNestedPhantomParameterisation::ComputeDimensions(G4Box& box, 
-					       const G4int ,
-					       const G4VPhysicalVolume* ) const{
+void DicomNestedPhantomParameterisation::
+ComputeDimensions( G4Box& box, const G4int, const G4VPhysicalVolume* ) const
+{
   box.SetXHalfLength(fdX);
   box.SetYHalfLength(fdY);
Index: trunk/examples/extended/medical/DICOM/src/DicomPhysicsList.cc
===================================================================
--- trunk/examples/extended/medical/DICOM/src/DicomPhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/src/DicomPhysicsList.cc	(revision 1230)
@@ -54,6 +54,6 @@
 DicomPhysicsList::DicomPhysicsList():  G4VUserPhysicsList()
 {
-  defaultCutValue = 1.e-3*mm;
-  cutForGamma     = 1.e-3*mm;
+  defaultCutValue = 1.*mm;
+  cutForGamma     = 1.*mm;
   cutForElectron  = defaultCutValue;
   cutForPositron  = defaultCutValue;
Index: trunk/examples/extended/medical/DICOM/src/DicomPrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/medical/DICOM/src/DicomPrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/src/DicomPrimaryGeneratorAction.cc	(revision 1230)
@@ -65,11 +65,15 @@
   G4String particleName;
   G4ParticleDefinition* particle
-    = particleTable->FindParticle(particleName="gamma");
+    = particleTable->FindParticle(particleName="e-");
   particleGun->SetParticleDefinition(particle);
-  G4ThreeVector dir(2.*CLHEP::RandFlat::shoot()-1.,2.*CLHEP::RandFlat::shoot()-1.,2.*CLHEP::RandFlat::shoot()-1);
+  // put the e- in the x direction of the patient (z in the accelerator axs) to hit patient in the central slice of the phantom
+  G4ThreeVector dir(0,1,0);
+  //G4ThreeVector dir(2.*CLHEP::RandFlat::shoot()-1.,2.*CLHEP::RandFlat::shoot()-1.,-CLHEP::RandFlat::shoot());
   dir /= dir.mag();
   particleGun->SetParticleMomentumDirection(dir);       
   particleGun->SetParticleEnergy(5.*MeV);
-  particleGun->SetParticlePosition(G4ThreeVector(0.,0.,-20.)); // put it close to the patient voxels
+  //put it at SAD = 1 m on xy plane of central slice
+  particleGun->SetParticlePosition(G4ThreeVector(0.,-99.9*cm,-27.));
+  //particleGun->SetParticlePosition(G4ThreeVector(0.,0.,-22.));
   particleGun->GeneratePrimaryVertex(anEvent);
 }
Index: trunk/examples/extended/medical/DICOM/src/RegularDicomDetectorConstruction.cc
===================================================================
--- trunk/examples/extended/medical/DICOM/src/RegularDicomDetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/src/RegularDicomDetectorConstruction.cc	(revision 1230)
@@ -95,4 +95,6 @@
   //----- Set this physical volume as having a regular structure of type 1, so that G4RegularNavigation is used
   patient_phys->SetRegularStructureId(1); // if not set, G4VoxelNavigation will be used instead 
+
+  SetScorer(voxel_logic);
 }
 
Index: trunk/examples/extended/medical/DICOM/vis.mac
===================================================================
--- trunk/examples/extended/medical/DICOM/vis.mac	(revision 1187)
+++ trunk/examples/extended/medical/DICOM/vis.mac	(revision 1230)
@@ -3,5 +3,7 @@
 #visualisation
 /vis/scene/create
-/vis/open OGLSQT
+/vis/open OGLIX
+#/vis/open DAWNFILE
+/vis/open VRML2FILE
 /vis/viewer/update
 /vis/viewer/zoom 5
@@ -10,3 +12,4 @@
 /tracking/verbose 1
 /run/beamOn 10
+/vis/viewer/update
 
Index: trunk/examples/extended/medical/GammaTherapy/GNUmakefile
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.2 2006/11/16 14:42:20 vnivanch Exp $
+# $Id: GNUmakefile,v 1.3 2008/06/11 15:17:57 vnivanch Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -15,14 +15,5 @@
 all: lib bin
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  CPPFLAGS   += `aida-config --include`
-  LOADLIBS   += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
Index: trunk/examples/extended/medical/GammaTherapy/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 17:25:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterBuilder.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterBuilder.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterBuilder.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4StepLimiterBuilder.hh,v 1.2 2006/06/29 17:26:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterMessenger.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: G4StepLimiterMessenger.hh,v 1.2 2006/06/29 17:26:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterPerRegion.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterPerRegion.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/G4StepLimiterPerRegion.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: G4StepLimiterPerRegion.hh,v 1.4 2007/05/16 16:27:53 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/include/ParticlesBuilder.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/ParticlesBuilder.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/ParticlesBuilder.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ParticlesBuilder.hh,v 1.2 2006/06/29 17:26:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/medical/GammaTherapy/include/PhysListEmLivermore.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/PhysListEmLivermore.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/PhysListEmLivermore.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmLivermore.hh,v 1.1 2006/11/16 14:42:20 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/include/PhysListEmPenelope.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/PhysListEmPenelope.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/PhysListEmPenelope.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPenelope.hh,v 1.3 2006/11/16 14:42:20 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/PhysicsList.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsList.hh,v 1.6 2006/11/16 14:42:20 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // Modified:
Index: trunk/examples/extended/medical/GammaTherapy/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 17:26:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 17:27:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterBuilder.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterBuilder.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterBuilder.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4StepLimiterBuilder.cc,v 1.3 2006/06/29 17:27:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
Index: trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterMessenger.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: G4StepLimiterMessenger.cc,v 1.2 2006/06/29 17:27:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterPerRegion.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterPerRegion.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/G4StepLimiterPerRegion.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: G4StepLimiterPerRegion.cc,v 1.4 2007/05/16 16:27:53 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/src/ParticlesBuilder.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/ParticlesBuilder.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/ParticlesBuilder.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ParticlesBuilder.cc,v 1.3 2006/06/29 17:27:56 gunter Exp $
-// GEANT4 tag $Name:  $ 
+// GEANT4 tag $Name: geant4-09-03-cand-01 $ 
 //
 //---------------------------------------------------------------------------
Index: trunk/examples/extended/medical/GammaTherapy/src/PhysListEmLivermore.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/PhysListEmLivermore.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/PhysListEmLivermore.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmLivermore.cc,v 1.1 2006/11/16 14:42:20 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/src/PhysListEmPenelope.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/PhysListEmPenelope.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/PhysListEmPenelope.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPenelope.cc,v 1.3 2006/11/16 14:42:20 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/PhysicsList.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsList.cc,v 1.15 2007/07/04 11:14:33 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsList.cc,v 1.16 2008/06/11 15:17:57 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
@@ -50,4 +50,5 @@
 #include "G4EmStandardPhysics_option1.hh"
 #include "G4EmStandardPhysics_option2.hh"
+#include "G4EmStandardPhysics_option3.hh"
 #include "PhysListEmLivermore.hh"
 #include "PhysListEmPenelope.hh"
@@ -150,4 +151,9 @@
     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
 
+  } else if (name == "emstandard_opt3" && !emBuilderIsRegisted) {
+    RegisterPhysics(new G4EmStandardPhysics_option3());
+    emBuilderIsRegisted = true;
+    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
+
   } else if (name == "livermore" && !emBuilderIsRegisted) {
     RegisterPhysics(new PhysListEmLivermore());
Index: trunk/examples/extended/medical/GammaTherapy/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 17:28:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/GammaTherapy/vis.mac
===================================================================
--- trunk/examples/extended/medical/GammaTherapy/vis.mac	(revision 1187)
+++ trunk/examples/extended/medical/GammaTherapy/vis.mac	(revision 1230)
@@ -34,5 +34,5 @@
 #
 ####/vis/open DAWNFILE
-/vis/open OGLSQT
+/vis/open OGLIX
 #
 # Draw scene
Index: trunk/examples/extended/medical/fanoCavity/GNUmakefile
===================================================================
--- trunk/examples/extended/medical/fanoCavity/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.1 2007/01/19 17:20:26 maire Exp $
+# $Id: GNUmakefile,v 1.2 2008/06/11 15:25:38 vnivanch Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
@@ -34,5 +24,5 @@
 	rm -f g4*.prim g4*.eps g4*.wrl
 	rm -f .DAWN_*
-	
+
 histclean:
 	rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/HistoManager.o
Index: trunk/examples/extended/medical/fanoCavity/fanoCavity.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/fanoCavity.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/fanoCavity.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: fanoCavity.cc,v 1.6 2007/10/29 17:09:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2007/10/08 12:05:02 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.2 2007/10/08 12:05:02 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/EventAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.3 2007/10/29 17:09:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.1 2007/01/19 17:20:26 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.4 2007/11/13 11:31:54 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.2 2007/11/13 11:31:54 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/MyKleinNishinaCompton.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/MyKleinNishinaCompton.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/MyKleinNishinaCompton.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: MyKleinNishinaCompton.hh,v 1.3 2007/05/23 08:40:21 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// $Id: MyKleinNishinaCompton.hh,v 1.4 2009/10/25 19:06:26 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -36,4 +36,5 @@
 
 class DetectorConstruction;
+class MyKleinNishinaMessenger;
 class G4ParticleChangeForGamma;
 
@@ -66,6 +67,7 @@
 protected:
 
-  DetectorConstruction* detector;
-  G4double              CrossSectionFactor;
+  DetectorConstruction*    detector;
+  MyKleinNishinaMessenger* pMessenger;
+  G4double  CrossSectionFactor;
 
 };
Index: trunk/examples/extended/medical/fanoCavity/include/MyMollerBhabhaModel.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/MyMollerBhabhaModel.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/MyMollerBhabhaModel.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: MyMollerBhabhaModel.hh,v 1.1 2007/01/19 17:20:26 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Index: trunk/examples/extended/medical/fanoCavity/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/PhysicsList.hh	(revision 1230)
@@ -24,10 +24,7 @@
 // ********************************************************************
 //
+// $Id: PhysicsList.hh,v 1.4 2009/10/25 19:06:26 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
-// $Id: PhysicsList.hh,v 1.3 2007/10/02 14:42:51 maire Exp $
-// GEANT4 tag $Name:  $
-//
-// 
-
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,39 +33,35 @@
 #define PhysicsList_h 1
 
-#include "G4VUserPhysicsList.hh"
+#include "G4VModularPhysicsList.hh"
 #include "globals.hh"
 
+class G4VPhysicsConstructor;
+
 class DetectorConstruction;
-class MyKleinNishinaCompton;
 class PhysicsListMessenger;
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-class PhysicsList: public G4VUserPhysicsList
+class PhysicsList: public G4VModularPhysicsList
 {
-  public:
-    PhysicsList(DetectorConstruction*);
-   ~PhysicsList();
+public:
+  PhysicsList(DetectorConstruction*);
+  virtual ~PhysicsList();
 
-    // Construct particle and physics
-    void ConstructParticle();
-    void ConstructProcess();
- 
-    void SetCuts();
+  void ConstructParticle();
+        
+  void AddPhysicsList(const G4String& name);    
+  void ConstructProcess();    
+  void AddStepMax(); 
+  
+  void SetCuts();      
     
-    // these methods Construct physics processes and register them
-    void ConstructEM();
-    void AddStepMax();
-    
-    void SetComptonCSfactor(G4double);
-    void SingleCoulombScattering (G4bool);    
-    void RegisterBrem (G4bool);
-    
-  private:
-    DetectorConstruction*  detector;
-    MyKleinNishinaCompton* comptonModel;
-    G4bool                 singleScattering;        
-    G4bool                 registerBrem;    
-    PhysicsListMessenger*  pMessenger;    
+private:
+
+  DetectorConstruction* detector;
+  PhysicsListMessenger* pMessenger; 
+
+  G4String emName;
+  G4VPhysicsConstructor*  emPhysicsList;
 };
 
@@ -77,4 +70,2 @@
 #endif
 
-
-
Index: trunk/examples/extended/medical/fanoCavity/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/PhysicsListMessenger.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.hh,v 1.2 2007/10/02 14:42:51 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.hh,v 1.3 2009/10/25 19:06:26 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,11 +33,11 @@
 #define PhysicsListMessenger_h 1
 
+#include "G4UImessenger.hh"
 #include "globals.hh"
-#include "G4UImessenger.hh"
 
 class PhysicsList;
 class G4UIdirectory;
-class G4UIcmdWithADouble;
-class G4UIcmdWithABool;
+class G4UIcmdWithADoubleAndUnit;
+class G4UIcmdWithAString;
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,5 +45,6 @@
 class PhysicsListMessenger: public G4UImessenger
 {
-  public:  
+  public:
+  
     PhysicsListMessenger(PhysicsList* );
    ~PhysicsListMessenger();
@@ -51,10 +52,10 @@
     void SetNewValue(G4UIcommand*, G4String);
     
-  private:  
-    PhysicsList*        pPhysicsList;   
-    G4UIdirectory*      physDir;        
-    G4UIcmdWithADouble* csFactor;
-    G4UIcmdWithABool*   singleScat;      
-    G4UIcmdWithABool*   brem;    
+  private:
+  
+    PhysicsList*               pPhysicsList;
+    
+    G4UIdirectory*             physDir;
+    G4UIcmdWithAString*        pListCmd;
 };
 
Index: trunk/examples/extended/medical/fanoCavity/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.1 2007/01/19 17:20:26 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.hh,v 1.1 2007/01/19 17:20:26 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/ProcessesCount.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.1 2007/01/19 17:20:26 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/RunAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.3 2007/10/29 12:36:26 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/StackingAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/StackingAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/StackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.hh,v 1.1 2007/01/23 13:34:19 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/StackingMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/StackingMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/StackingMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingMessenger.hh,v 1.1 2007/01/23 13:34:19 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/StepMax.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.4 2007/10/29 17:09:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.3 2007/10/29 17:09:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/run01.mac
===================================================================
--- trunk/examples/extended/medical/fanoCavity/run01.mac	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/run01.mac	(revision 1230)
@@ -1,6 +1,8 @@
-# $Id: run01.mac,v 1.5 2007/10/29 17:09:53 maire Exp $
+# $Id: run01.mac,v 1.7 2009/10/25 19:06:26 maire Exp $
 #
 /control/verbose 2
 /run/verbose 2
+#
+/testem/phys/addPhysics  standard_opt3
 #
 /run/initialize
@@ -9,5 +11,5 @@
 #
 /testem/histo/setFileName fanocavity
-/testem/histo/setFileType hbook
+/testem/histo/setFileType root
 /testem/histo/setHisto  1 120 -6 +6 mm		#interaction point
 /testem/histo/setHisto  2 125  0  1250 keV	#energy spectrum
Index: trunk/examples/extended/medical/fanoCavity/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.3 2007/10/08 12:05:02 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 //
Index: trunk/examples/extended/medical/fanoCavity/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.3 2007/11/05 13:44:18 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/EventAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.4 2007/10/29 17:09:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.5 2007/11/13 11:31:54 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: HistoManager.cc,v 1.7 2008/09/28 16:04:01 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "fanocavity";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -224,5 +224,5 @@
  if (ih > MaxHisto) {
     G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih
-           << "does not exist" << G4endl;
+           << "does not exist  (fac = " << fac << ")"  << G4endl;
     return;
   }
Index: trunk/examples/extended/medical/fanoCavity/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.2 2007/11/13 11:31:54 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/MyKleinNishinaCompton.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/MyKleinNishinaCompton.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/MyKleinNishinaCompton.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: MyKleinNishinaCompton.cc,v 1.5 2007/10/01 15:19:57 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: MyKleinNishinaCompton.cc,v 1.6 2009/10/25 19:06:26 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -31,4 +31,5 @@
 
 #include "MyKleinNishinaCompton.hh"
+#include "MyKleinNishinaMessenger.hh"
 #include "DetectorConstruction.hh"
 
@@ -48,5 +49,6 @@
   :G4KleinNishinaCompton(0,nam), detector(det)
 {
-  CrossSectionFactor = 1.; 
+  CrossSectionFactor = 1.;
+  pMessenger = new MyKleinNishinaMessenger(this);    
 }
 
@@ -54,5 +56,7 @@
 
 MyKleinNishinaCompton::~MyKleinNishinaCompton()
-{}
+{  
+  delete pMessenger;  
+}
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Index: trunk/examples/extended/medical/fanoCavity/src/MyMollerBhabhaModel.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/MyMollerBhabhaModel.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/MyMollerBhabhaModel.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: MyMollerBhabhaModel.cc,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/PhysicsList.cc	(revision 1230)
@@ -24,9 +24,7 @@
 // ********************************************************************
 //
+// $Id: PhysicsList.cc,v 1.18 2009/10/29 16:19:59 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
-// $Id: PhysicsList.cc,v 1.9 2007/10/02 14:42:51 maire Exp $
-// GEANT4 tag $Name:  $
-//
-
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,25 +32,47 @@
 #include "PhysicsList.hh"
 #include "PhysicsListMessenger.hh"
-#include "DetectorConstruction.hh"
+
+#include "PhysListEmStandard_option0.hh"
+#include "PhysListEmStandard_option3.hh"
+#include "PhysListEmStandard_GS.hh"
+#include "PhysListEmStandard_SS.hh"
+
+#include "StepMax.hh"
 
 #include "G4ParticleDefinition.hh"
-#include "G4ParticleTypes.hh"
-#include "G4ParticleTable.hh"
 
 #include "G4ProcessManager.hh"
 #include "G4LossTableManager.hh"
 
+// Bosons
+#include "G4ChargedGeantino.hh"
+#include "G4Geantino.hh"
+#include "G4Gamma.hh"
+
+// leptons
+#include "G4Electron.hh"
+#include "G4Positron.hh"
+
+// Hadrons
+#include "G4Proton.hh"
+
+
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 PhysicsList::PhysicsList(DetectorConstruction* det)
-: G4VUserPhysicsList(), detector(det)
+: G4VModularPhysicsList(), detector(det)
 {
-  defaultCutValue = 10.*km;
-  singleScattering = false;
-  registerBrem = false;
-  pMessenger = new PhysicsListMessenger(this);
-  SetVerboseLevel(1);
+  G4LossTableManager::Instance();
+  pMessenger = new PhysicsListMessenger(this); 
+   
+  // EM physics
+  emName = G4String("standard_opt3");
+  emPhysicsList = new PhysListEmStandard_option3(emName,detector);
+      
+  defaultCutValue = 10*km;
+
+  SetVerboseLevel(1);  
   
-  G4LossTableManager::Instance();  
+  G4LossTableManager::Instance();
 }
 
@@ -60,5 +80,8 @@
 
 PhysicsList::~PhysicsList()
-{ delete pMessenger; }
+{
+  delete emPhysicsList;
+  delete pMessenger;  
+}
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,11 +89,17 @@
 void PhysicsList::ConstructParticle()
 {
+  // pseudo-particles
   G4Geantino::GeantinoDefinition();
+  G4ChargedGeantino::ChargedGeantinoDefinition();
+  
+  // gamma
   G4Gamma::GammaDefinition();
-
+  
+  // leptons
   G4Electron::ElectronDefinition();
   G4Positron::PositronDefinition();
 
-  G4Proton::ProtonDefinition();
+  // baryons
+  G4Proton::ProtonDefinition();  
 }
 
@@ -80,122 +109,10 @@
 {
   AddTransportation();
-  ConstructEM();
+  emPhysicsList->ConstructProcess();
+
   AddStepMax();
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4ComptonScattering.hh"
-#include "MyKleinNishinaCompton.hh"
-#include "G4GammaConversion.hh"
-#include "G4PhotoElectricEffect.hh"
-
-#include "G4MultipleScattering.hh"
-#include "G4CoulombScattering.hh"
-
-#include "G4eIonisation.hh"
-#include "MyMollerBhabhaModel.hh"
-#include "G4eBremsstrahlung.hh"
-#include "G4eplusAnnihilation.hh"
-
-#include "G4hIonisation.hh"
-
-#include "G4EmProcessOptions.hh"
-#include "G4MscStepLimitType.hh"
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
-void PhysicsList::ConstructEM()
-{
-  theParticleIterator->reset();
-  while( (*theParticleIterator)() ){
-    G4ParticleDefinition* particle = theParticleIterator->value();
-    G4ProcessManager* pmanager = particle->GetProcessManager();
-    G4String particleName = particle->GetParticleName();
-    G4int iAlong = 0, iPost = 0; 
-     
-    if (particleName == "gamma") {
-    
-      G4ComptonScattering* compton = new G4ComptonScattering();
-      compton->SetModel(comptonModel = new MyKleinNishinaCompton(detector));
-      comptonModel->SetCSFactor(1000.);
-       
-      pmanager->AddDiscreteProcess(compton);                
-      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
-      pmanager->AddDiscreteProcess(new G4GammaConversion);
-      
-    } else if (particleName == "e-") {
-
-      if (singleScattering)
-        pmanager->AddProcess(new G4CoulombScattering,  -1, -1,       ++iPost);
-        else    
-        pmanager->AddProcess(new G4MultipleScattering, -1, ++iAlong, ++iPost);
-      
-      G4eIonisation* eIoni = new G4eIonisation();
-      eIoni->SetEmModel(new MyMollerBhabhaModel);             
-      pmanager->AddProcess(eIoni,                      -1, ++iAlong, ++iPost);
-      
-      if (registerBrem)
-        pmanager->AddProcess(new G4eBremsstrahlung,    -1, ++iAlong, ++iPost);      
-       
-    } else if (particleName == "e+") {
-    
-      if (singleScattering)
-        pmanager->AddProcess(new G4CoulombScattering,  -1, -1,       ++iPost);
-        else   
-        pmanager->AddProcess(new G4MultipleScattering, -1, ++iAlong, ++iPost);
-      
-      G4eIonisation* pIoni = new G4eIonisation();
-      pIoni->SetEmModel(new MyMollerBhabhaModel);                   
-      pmanager->AddProcess(pIoni,                      -1, ++iAlong, ++iPost);
-      
-      if (registerBrem) {
-        pmanager->AddProcess(new G4eBremsstrahlung,    -1, ++iAlong, ++iPost);
-        pmanager->AddProcess(new G4eplusAnnihilation,   0, -1,       ++iPost);
-      }
-      
-    } else if (particleName == "proton") {
-    
-      if (singleScattering)
-        pmanager->AddProcess(new G4CoulombScattering,  -1, -1,       ++iPost);
-        else   
-        pmanager->AddProcess(new G4MultipleScattering, -1, ++iAlong, ++iPost);
-	
-      pmanager->AddProcess(new G4hIonisation,          -1, ++iAlong, ++iPost);
-    }
-  }
-  
-  // Em options
-  //
-  G4EmProcessOptions emOptions;
-  
-  //multiple scattering
-  //
-  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);
-  emOptions.SetSkin(2.);
-  
-  //physics tables
-  //
-  emOptions.SetMinEnergy(100*eV);    
-  emOptions.SetMaxEnergy(10*GeV);  
-  emOptions.SetDEDXBinning(800);  
-  emOptions.SetLambdaBinning(800);
-  
-  //energy loss
-  //  
-  emOptions.SetStepFunction(0.2, 10*um);
-  emOptions.SetLinearLossLimit(1.e-6);
-          
-  //build CSDA range
-  //
-  emOptions.SetBuildCSDARange(true);
-  emOptions.SetMaxEnergyForCSDARange(10*GeV);  
-  emOptions.SetDEDXBinningForCSDARange(800);    
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "StepMax.hh"
 
 void PhysicsList::AddStepMax()
@@ -209,8 +126,49 @@
       G4ProcessManager* pmanager = particle->GetProcessManager();
 
-      if (stepMaxProcess->IsApplicable(*particle))
+      if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
         {
 	  pmanager ->AddDiscreteProcess(stepMaxProcess);
         }
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void PhysicsList::AddPhysicsList(const G4String& name)
+{
+  if (verboseLevel>-1) {
+    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
+  }
+
+  if (name == emName) return;
+
+  if (name == "standard_opt0") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_option0(name,detector);
+    
+  } else if (name == "standard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_option3(name,detector);
+    
+  } else if (name == "standard_GS") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_GS(name,detector);    
+    
+  } else if (name == "standard_SS") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_SS(name,detector);    
+  } else {
+
+    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
+           << " is not defined"
+           << G4endl;
   }
 }
@@ -232,30 +190,6 @@
   SetCutValue(defaultCutValue, "e-");
   SetCutValue(defaultCutValue, "e+");
+  SetCutValue(defaultCutValue, "proton");  
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void PhysicsList::SetComptonCSfactor(G4double factor)
-{
-  if (comptonModel) comptonModel->SetCSFactor(factor);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void PhysicsList::SingleCoulombScattering(G4bool flag)
-{
-  singleScattering = flag;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void PhysicsList::RegisterBrem(G4bool flag)
-{
-  registerBrem = flag;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
-
-
Index: trunk/examples/extended/medical/fanoCavity/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/PhysicsListMessenger.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.cc,v 1.2 2007/10/02 14:42:51 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.cc,v 1.3 2009/10/25 19:06:26 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,8 +33,7 @@
 
 #include "PhysicsList.hh"
-#include "MyKleinNishinaCompton.hh"
 #include "G4UIdirectory.hh"
-#include "G4UIcmdWithADouble.hh"
-#include "G4UIcmdWithABool.hh"
+#include "G4UIcmdWithADoubleAndUnit.hh"
+#include "G4UIcmdWithAString.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,24 +41,12 @@
 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
 :pPhysicsList(pPhys)
-{
+{ 
   physDir = new G4UIdirectory("/testem/phys/");
   physDir->SetGuidance("physics list commands");
-  
-  csFactor = new G4UIcmdWithADouble("/testem/phys/crossSectionFactor",this);
-  csFactor->SetGuidance("multiply Compton cross section");
-  csFactor->SetParameterName("factor",false);
-  csFactor->SetRange("factor>=0");
-  
-  singleScat = new G4UIcmdWithABool("/testem/phys/singleScattering",this);
-  singleScat->SetGuidance("apply single Coulomb scattering process");
-  singleScat->SetParameterName("flag",true);
-  singleScat->SetDefaultValue(true);
-  singleScat->AvailableForStates(G4State_PreInit);
-        
-  brem = new G4UIcmdWithABool("/testem/phys/registerBrem",this);
-  brem->SetGuidance("register Brems in PhysicsList");
-  brem->SetParameterName("flag",true);
-  brem->SetDefaultValue(true);
-  brem->AvailableForStates(G4State_PreInit);    
+
+  pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);  
+  pListCmd->SetGuidance("Add modula physics list.");
+  pListCmd->SetParameterName("PList",false);
+  pListCmd->AvailableForStates(G4State_PreInit);
 }
 
@@ -68,8 +55,6 @@
 PhysicsListMessenger::~PhysicsListMessenger()
 {
-  delete csFactor;
-  delete singleScat;
-  delete brem;
-  delete physDir;    
+  delete pListCmd;
+  delete physDir;
 }
 
@@ -78,13 +63,7 @@
 void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
                                           G4String newValue)
-{ 
-  if (command == csFactor)
-   {pPhysicsList->SetComptonCSfactor(csFactor->GetNewDoubleValue(newValue));}
-   
-  if (command == singleScat)
-   {pPhysicsList->SingleCoulombScattering(singleScat->GetNewBoolValue(newValue));}
-            
-  if (command == brem)
-   {pPhysicsList->RegisterBrem(brem->GetNewBoolValue(newValue));}      
+{           
+  if( command == pListCmd )
+   { pPhysicsList->AddPhysicsList(newValue);}
 }
 
Index: trunk/examples/extended/medical/fanoCavity/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorMessenger.cc,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/RunAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/RunAction.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: RunAction.cc,v 1.3 2007/10/29 12:36:26 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: RunAction.cc,v 1.4 2009/01/22 18:34:06 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -325,5 +325,5 @@
   //
   G4double ratio = doseOverBeam/massTransfCoef;
-  G4double error = ratio*(dEoverE + dToverT);
+  G4double error = ratio*std::sqrt(dEoverE*dEoverE + dToverT*dToverT);
   
   G4cout.precision(5);  
Index: trunk/examples/extended/medical/fanoCavity/src/StackingAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/StackingAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/StackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingAction.cc,v 1.2 2007/03/02 11:08:41 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/StackingMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/StackingMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/StackingMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StackingMessenger.cc,v 1.1 2007/01/23 13:34:19 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/StepMax.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.4 2007/10/29 17:09:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.1 2007/01/19 17:20:27 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.4 2007/10/29 17:09:53 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/GNUmakefile
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.1 2007/10/15 16:20:23 maire Exp $
+# $Id: GNUmakefile,v 1.2 2008/06/11 15:27:31 vnivanch Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,15 +17,5 @@
 #### G4ANALYSIS_USE := true
 
-ifdef G4ANALYSIS_USE
-  CPPFLAGS += -DG4ANALYSIS_USE
-endif
-
 include $(G4INSTALL)/config/architecture.gmk
-
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LOADLIBS += `aida-config --lib`
-endif
 
 include $(G4INSTALL)/config/binmake.gmk
@@ -34,5 +24,5 @@
 	rm -f g4*.prim g4*.eps g4*.wrl
 	rm -f .DAWN_*
-	
+
 histclean:
 	rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/HistoManager.o
Index: trunk/examples/extended/medical/fanoCavity2/basic.mac
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/basic.mac	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/basic.mac	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: basic.mac,v 1.2 2007/11/05 13:19:16 maire Exp $
+# $Id: basic.mac,v 1.4 2009/10/31 18:05:56 maire Exp $
 #
 /control/verbose 2
@@ -7,4 +7,6 @@
 /testem/det/wallThickness 5 cm
 #
+/testem/phys/addPhysics standard_opt3
+#
 /run/initialize
 #
@@ -12,7 +14,9 @@
 /process/eLoss/fluct false
 #
-/gun/energy 10 keV
+/process/eLoss/StepFunction 0.2 10 um
 #
-/testem/event/printModulo 500000
+/gun/energy 1 MeV
 #
-/run/beamOn 10000000
+/testem/event/printModulo 50000
+#
+/run/beamOn 500000
Index: trunk/examples/extended/medical/fanoCavity2/essai.mac
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/essai.mac	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/essai.mac	(revision 1230)
@@ -1,20 +1,14 @@
-# $Id: essai.mac,v 1.3 2007/11/12 18:19:30 maire Exp $
+# $Id: essai.mac,v 1.5 2009/10/31 18:05:56 maire Exp $
 #
 /control/verbose 2
 /run/verbose 2
 #
-/testem/det/wallMater Water
-/testem/det/wallThickness 5 mm
-/testem/det/worldRadius   5 mm
+/testem/phys/addPhysics standard_opt3
 #
 /run/initialize
 #
-/process/inactivate msc
-/process/eLoss/fluct false
+/gun/energy 1 MeV
 #
-/gun/energy 10 keV
-/gun/direction 0 1 0
+/testem/event/printModulo 100000
 #
-/testem/event/printModulo 20000
-#
-#/run/beamOn 200000
+/run/beamOn 1000000
Index: trunk/examples/extended/medical/fanoCavity2/fanoCavity2.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/fanoCavity2.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/fanoCavity2.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: fanoCavity2.cc,v 1.2 2007/10/31 16:16:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/EventAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.3 2007/11/12 18:19:30 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.2 2007/11/12 18:19:30 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/MyMollerBhabhaModel.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/MyMollerBhabhaModel.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/MyMollerBhabhaModel.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: MyMollerBhabhaModel.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Index: trunk/examples/extended/medical/fanoCavity2/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/PhysicsList.hh	(revision 1230)
@@ -24,10 +24,7 @@
 // ********************************************************************
 //
+// $Id: PhysicsList.hh,v 1.2 2009/10/31 18:05:56 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
-// $Id: PhysicsList.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
-//
-// 
-
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,6 +33,8 @@
 #define PhysicsList_h 1
 
-#include "G4VUserPhysicsList.hh"
+#include "G4VModularPhysicsList.hh"
 #include "globals.hh"
+
+class G4VPhysicsConstructor;
 
 class DetectorConstruction;
@@ -44,28 +43,25 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-class PhysicsList: public G4VUserPhysicsList
+class PhysicsList: public G4VModularPhysicsList
 {
-  public:
-    PhysicsList(DetectorConstruction*);
-   ~PhysicsList();
+public:
+  PhysicsList(DetectorConstruction*);
+  virtual ~PhysicsList();
 
-    // Construct particle and physics
-    void ConstructParticle();
-    void ConstructProcess();
- 
-    void SetCuts();
+  void ConstructParticle();
+        
+  void AddPhysicsList(const G4String& name);    
+  void ConstructProcess();    
+  void AddStepMax(); 
+  
+  void SetCuts();      
     
-    // these methods Construct physics processes and register them
-    void ConstructEM();
-    void AddStepMax();
-    
-    void SingleCoulombScattering (G4bool);    
-    void RegisterBrem (G4bool);
-    
-  private:
-    DetectorConstruction*  detector;
-    G4bool                 singleScattering;        
-    G4bool                 registerBrem;    
-    PhysicsListMessenger*  pMessenger;    
+private:
+
+  DetectorConstruction* detector;
+  PhysicsListMessenger* pMessenger; 
+
+  G4String emName;
+  G4VPhysicsConstructor*  emPhysicsList;
 };
 
@@ -74,4 +70,2 @@
 #endif
 
-
-
Index: trunk/examples/extended/medical/fanoCavity2/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/PhysicsListMessenger.hh	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.hh,v 1.2 2009/10/31 18:05:56 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,10 +33,11 @@
 #define PhysicsListMessenger_h 1
 
+#include "G4UImessenger.hh"
 #include "globals.hh"
-#include "G4UImessenger.hh"
 
 class PhysicsList;
 class G4UIdirectory;
-class G4UIcmdWithABool;
+class G4UIcmdWithADoubleAndUnit;
+class G4UIcmdWithAString;
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,5 +45,6 @@
 class PhysicsListMessenger: public G4UImessenger
 {
-  public:  
+  public:
+  
     PhysicsListMessenger(PhysicsList* );
    ~PhysicsListMessenger();
@@ -50,9 +52,10 @@
     void SetNewValue(G4UIcommand*, G4String);
     
-  private:  
-    PhysicsList*        pPhysicsList;   
-    G4UIdirectory*      physDir;        
-    G4UIcmdWithABool*   singleScat;      
-    G4UIcmdWithABool*   brem;    
+  private:
+  
+    PhysicsList*               pPhysicsList;
+    
+    G4UIdirectory*             physDir;
+    G4UIcmdWithAString*        pListCmd;
 };
 
Index: trunk/examples/extended/medical/fanoCavity2/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/ProcessesCount.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/RunAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.2 2007/10/31 16:16:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/StepMax.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.2 2007/10/31 16:16:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/SteppingVerbose.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.hh,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/include/TrackingAction.hh
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/include/TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/include/TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.hh,v 1.2 2007/10/31 16:16:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/run01.mac
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/run01.mac	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/run01.mac	(revision 1230)
@@ -1,6 +1,8 @@
-# $Id: run01.mac,v 1.2 2007/10/31 16:16:20 maire Exp $
+# $Id: run01.mac,v 1.3 2009/10/31 18:05:56 maire Exp $
 #
 /control/verbose 2
 /run/verbose 2
+#
+/testem/phys/addPhysics standard_opt3
 #
 /run/initialize
Index: trunk/examples/extended/medical/fanoCavity2/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.2 2007/11/05 13:19:16 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 //
Index: trunk/examples/extended/medical/fanoCavity2/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2007/11/05 13:19:16 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/EventAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/HistoManager.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: HistoManager.cc,v 1.3 2007/11/12 18:19:30 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: HistoManager.cc,v 1.5 2008/09/28 16:15:39 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,6 +54,6 @@
  
   fileName[0] = "fanocavity2";
-  fileType    = "hbook";
-  fileOption  = "--noErrors uncompress";  
+  fileType    = "root";
+  fileOption  = "--noErrors export=root uncompress";  
   // histograms
   for (G4int k=0; k<MaxHisto; k++) {
@@ -224,5 +224,5 @@
  if (ih > MaxHisto) {
     G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih
-           << "does not exist" << G4endl;
+           << "does not exist  (fac = " << fac << ")"  << G4endl;
     return;
   }
Index: trunk/examples/extended/medical/fanoCavity2/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.2 2007/11/12 18:19:30 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/MyMollerBhabhaModel.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/MyMollerBhabhaModel.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/MyMollerBhabhaModel.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: MyMollerBhabhaModel.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/PhysicsList.cc	(revision 1230)
@@ -24,9 +24,7 @@
 // ********************************************************************
 //
+// $Id: PhysicsList.cc,v 1.7 2009/10/31 18:05:01 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
-// $Id: PhysicsList.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
-//
-
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,25 +32,47 @@
 #include "PhysicsList.hh"
 #include "PhysicsListMessenger.hh"
-#include "DetectorConstruction.hh"
+
+#include "PhysListEmStandard_option0.hh"
+#include "PhysListEmStandard_option3.hh"
+#include "PhysListEmStandard_GS.hh"
+#include "PhysListEmStandard_SS.hh"
+
+#include "StepMax.hh"
 
 #include "G4ParticleDefinition.hh"
-#include "G4ParticleTypes.hh"
-#include "G4ParticleTable.hh"
 
 #include "G4ProcessManager.hh"
 #include "G4LossTableManager.hh"
 
+// Bosons
+#include "G4ChargedGeantino.hh"
+#include "G4Geantino.hh"
+#include "G4Gamma.hh"
+
+// leptons
+#include "G4Electron.hh"
+#include "G4Positron.hh"
+
+// Hadrons
+#include "G4Proton.hh"
+
+
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 PhysicsList::PhysicsList(DetectorConstruction* det)
-: G4VUserPhysicsList(), detector(det)
+: G4VModularPhysicsList(), detector(det)
 {
-  defaultCutValue = 10.*km;
-  singleScattering = false;
-  registerBrem = false;
-  pMessenger = new PhysicsListMessenger(this);
-  SetVerboseLevel(1);
+  G4LossTableManager::Instance();
+  pMessenger = new PhysicsListMessenger(this); 
+   
+  // EM physics
+  emName = G4String("standard_opt3");
+  emPhysicsList = new PhysListEmStandard_option3(emName,detector);
+      
+  defaultCutValue = 10*km;
+
+  SetVerboseLevel(1);  
   
-  G4LossTableManager::Instance();  
+  G4LossTableManager::Instance();
 }
 
@@ -60,5 +80,8 @@
 
 PhysicsList::~PhysicsList()
-{ delete pMessenger; }
+{
+  delete emPhysicsList;
+  delete pMessenger;  
+}
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,11 +89,17 @@
 void PhysicsList::ConstructParticle()
 {
+  // pseudo-particles
   G4Geantino::GeantinoDefinition();
+  G4ChargedGeantino::ChargedGeantinoDefinition();
+  
+  // gamma
   G4Gamma::GammaDefinition();
-
+  
+  // leptons
   G4Electron::ElectronDefinition();
   G4Positron::PositronDefinition();
 
-  G4Proton::ProtonDefinition();
+  // baryons
+  G4Proton::ProtonDefinition();  
 }
 
@@ -80,117 +109,10 @@
 {
   AddTransportation();
-  ConstructEM();
+  emPhysicsList->ConstructProcess();
+
   AddStepMax();
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "G4ComptonScattering.hh"
-#include "G4GammaConversion.hh"
-#include "G4PhotoElectricEffect.hh"
-
-#include "G4MultipleScattering.hh"
-#include "G4CoulombScattering.hh"
-
-#include "G4eIonisation.hh"
-#include "MyMollerBhabhaModel.hh"
-#include "G4eBremsstrahlung.hh"
-#include "G4eplusAnnihilation.hh"
-
-#include "G4hIonisation.hh"
-
-#include "G4EmProcessOptions.hh"
-#include "G4MscStepLimitType.hh"
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
-void PhysicsList::ConstructEM()
-{
-  theParticleIterator->reset();
-  while( (*theParticleIterator)() ){
-    G4ParticleDefinition* particle = theParticleIterator->value();
-    G4ProcessManager* pmanager = particle->GetProcessManager();
-    G4String particleName = particle->GetParticleName();
-    G4int iAlong = 0, iPost = 0; 
-     
-    if (particleName == "gamma") {
-                 
-      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
-      pmanager->AddDiscreteProcess(new G4ComptonScattering);         
-      pmanager->AddDiscreteProcess(new G4GammaConversion);
-      
-    } else if (particleName == "e-") {
-
-      if (singleScattering)
-        pmanager->AddProcess(new G4CoulombScattering,  -1, -1,       ++iPost);
-        else    
-        pmanager->AddProcess(new G4MultipleScattering, -1, ++iAlong, ++iPost);
-      
-      G4eIonisation* eIoni = new G4eIonisation();
-      eIoni->SetEmModel(new MyMollerBhabhaModel);             
-      pmanager->AddProcess(eIoni,                      -1, ++iAlong, ++iPost);
-      
-      if (registerBrem)
-        pmanager->AddProcess(new G4eBremsstrahlung,    -1, ++iAlong, ++iPost);      
-       
-    } else if (particleName == "e+") {
-    
-      if (singleScattering)
-        pmanager->AddProcess(new G4CoulombScattering,  -1, -1,       ++iPost);
-        else   
-        pmanager->AddProcess(new G4MultipleScattering, -1, ++iAlong, ++iPost);
-      
-      G4eIonisation* pIoni = new G4eIonisation();
-      pIoni->SetEmModel(new MyMollerBhabhaModel);                   
-      pmanager->AddProcess(pIoni,                      -1, ++iAlong, ++iPost);
-      
-      if (registerBrem) {
-        pmanager->AddProcess(new G4eBremsstrahlung,    -1, ++iAlong, ++iPost);
-        pmanager->AddProcess(new G4eplusAnnihilation,   0, -1,       ++iPost);
-      }
-      
-    } else if (particleName == "proton") {
-    
-      if (singleScattering)
-        pmanager->AddProcess(new G4CoulombScattering,  -1, -1,       ++iPost);
-        else   
-        pmanager->AddProcess(new G4MultipleScattering, -1, ++iAlong, ++iPost);
-	
-      pmanager->AddProcess(new G4hIonisation,          -1, ++iAlong, ++iPost);
-    }
-  }
-  
-  // Em options
-  //
-  G4EmProcessOptions emOptions;
-  
-  //multiple scattering
-  //
-  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);
-  emOptions.SetSkin(2.);
-  
-  //physics tables
-  //
-  emOptions.SetMinEnergy(100*eV);    
-  emOptions.SetMaxEnergy(10*GeV);  
-  emOptions.SetDEDXBinning(800);  
-  emOptions.SetLambdaBinning(800);
-  
-  //energy loss
-  //  
-  emOptions.SetStepFunction(0.2, 10*um);
-  emOptions.SetLinearLossLimit(1.e-6);
-          
-  //build CSDA range
-  //
-  emOptions.SetBuildCSDARange(true);
-  emOptions.SetMaxEnergyForCSDARange(10*GeV);  
-  emOptions.SetDEDXBinningForCSDARange(800);    
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-#include "StepMax.hh"
 
 void PhysicsList::AddStepMax()
@@ -204,8 +126,49 @@
       G4ProcessManager* pmanager = particle->GetProcessManager();
 
-      if (stepMaxProcess->IsApplicable(*particle))
+      if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
         {
 	  pmanager ->AddDiscreteProcess(stepMaxProcess);
         }
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void PhysicsList::AddPhysicsList(const G4String& name)
+{
+  if (verboseLevel>-1) {
+    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
+  }
+
+  if (name == emName) return;
+
+  if (name == "standard_opt0") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_option0(name,detector);
+    
+  } else if (name == "standard_opt3") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_option3(name,detector);
+    
+  } else if (name == "standard_GS") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_GS(name,detector);    
+    
+  } else if (name == "standard_SS") {
+
+    emName = name;
+    delete emPhysicsList;
+    emPhysicsList = new PhysListEmStandard_SS(name,detector);    
+  } else {
+
+    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
+           << " is not defined"
+           << G4endl;
   }
 }
@@ -227,23 +190,6 @@
   SetCutValue(defaultCutValue, "e-");
   SetCutValue(defaultCutValue, "e+");
+  SetCutValue(defaultCutValue, "proton");  
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void PhysicsList::SingleCoulombScattering(G4bool flag)
-{
-  singleScattering = flag;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-void PhysicsList::RegisterBrem(G4bool flag)
-{
-  registerBrem = flag;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
-
-
Index: trunk/examples/extended/medical/fanoCavity2/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/PhysicsListMessenger.cc	(revision 1230)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: PhysicsListMessenger.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// $Id: PhysicsListMessenger.cc,v 1.2 2009/10/31 18:05:01 maire Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,5 +34,6 @@
 #include "PhysicsList.hh"
 #include "G4UIdirectory.hh"
-#include "G4UIcmdWithABool.hh"
+#include "G4UIcmdWithADoubleAndUnit.hh"
+#include "G4UIcmdWithAString.hh"
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -40,19 +41,12 @@
 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
 :pPhysicsList(pPhys)
-{
+{ 
   physDir = new G4UIdirectory("/testem/phys/");
   physDir->SetGuidance("physics list commands");
-  
-  singleScat = new G4UIcmdWithABool("/testem/phys/singleScattering",this);
-  singleScat->SetGuidance("apply single Coulomb scattering process");
-  singleScat->SetParameterName("flag",true);
-  singleScat->SetDefaultValue(true);
-  singleScat->AvailableForStates(G4State_PreInit);
-        
-  brem = new G4UIcmdWithABool("/testem/phys/registerBrem",this);
-  brem->SetGuidance("register Brems in PhysicsList");
-  brem->SetParameterName("flag",true);
-  brem->SetDefaultValue(true);
-  brem->AvailableForStates(G4State_PreInit);    
+
+  pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);  
+  pListCmd->SetGuidance("Add modula physics list.");
+  pListCmd->SetParameterName("PList",false);
+  pListCmd->AvailableForStates(G4State_PreInit);
 }
 
@@ -61,7 +55,6 @@
 PhysicsListMessenger::~PhysicsListMessenger()
 {
-  delete singleScat;
-  delete brem;
-  delete physDir;    
+  delete pListCmd;
+  delete physDir;
 }
 
@@ -70,10 +63,7 @@
 void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
                                           G4String newValue)
-{  
-  if (command == singleScat)
-   {pPhysicsList->SingleCoulombScattering(singleScat->GetNewBoolValue(newValue));}
-            
-  if (command == brem)
-   {pPhysicsList->RegisterBrem(brem->GetNewBoolValue(newValue));}      
+{           
+  if( command == pListCmd )
+   { pPhysicsList->AddPhysicsList(newValue);}
 }
 
Index: trunk/examples/extended/medical/fanoCavity2/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/RunAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.3 2007/11/05 13:19:16 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/StepMax.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.2 2007/10/31 16:16:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/SteppingVerbose.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingVerbose.cc,v 1.1 2007/10/15 16:20:23 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/src/TrackingAction.cc
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/src/TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/src/TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: TrackingAction.cc,v 1.2 2007/10/31 16:16:20 maire Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/medical/fanoCavity2/stepfunction.mac
===================================================================
--- trunk/examples/extended/medical/fanoCavity2/stepfunction.mac	(revision 1187)
+++ trunk/examples/extended/medical/fanoCavity2/stepfunction.mac	(revision 1230)
@@ -1,6 +1,8 @@
-# $Id: stepfunction.mac,v 1.1 2007/10/15 16:29:06 maire Exp $
+# $Id: stepfunction.mac,v 1.2 2009/10/31 18:05:56 maire Exp $
 #
 /control/verbose 2
 /run/verbose 2
+#
+/testem/phys/addPhysics standard_opt3
 #
 /run/initialize
Index: trunk/examples/extended/optical/LXe/LXe.cc
===================================================================
--- trunk/examples/extended/optical/LXe/LXe.cc	(revision 1187)
+++ trunk/examples/extended/optical/LXe/LXe.cc	(revision 1230)
@@ -27,6 +27,4 @@
 #include "G4UImanager.hh"
 #include "G4String.hh"
-#include "G4UItcsh.hh"
-#include "G4UIterminal.hh"
 
 #include "LXeDetectorConstruction.hh"
@@ -44,4 +42,8 @@
 #ifdef G4VIS_USE
 #include "G4VisExecutive.hh"
+#endif
+
+#ifdef G4UI_USE
+#include "G4UIExecutive.hh"
 #endif
 
@@ -71,28 +73,23 @@
   runManager->SetUserAction(new LXeSteppingAction(recorder));
 
-  runManager->Initialize();
+  // runManager->Initialize();
  
   // get the pointer to the UI manager and set verbosities
-  G4UImanager* UI = G4UImanager::GetUIpointer();
+  G4UImanager* UImanager = G4UImanager::GetUIpointer();
   
   if(argc==1){
-    G4UIsession* session=0;
-#ifdef G4UI_USE_TCSH
-    session = new G4UIterminal(new G4UItcsh);
-#else
-    session = new G4UIterminal();
+#ifdef G4UI_USE
+    G4UIExecutive* ui = new G4UIExecutive(argc, argv);
+#ifdef G4VIS_USE
+    UImanager->ApplyCommand("/control/execute vis.mac");     
 #endif
-
-    //execute vis.mac
-    UI->ApplyCommand("/control/execute vis.mac");
-
-    session->SessionStart();
-    delete session;
-
+    ui->SessionStart();
+    delete ui;
+#endif
   }
   else{
     G4String command = "/control/execute ";
     G4String filename = argv[1];
-    UI->ApplyCommand(command+filename);
+    UImanager->ApplyCommand(command+filename);
   }
 
Index: trunk/examples/extended/optical/LXe/include/LXeEMPhysics.hh
===================================================================
--- trunk/examples/extended/optical/LXe/include/LXeEMPhysics.hh	(revision 1187)
+++ trunk/examples/extended/optical/LXe/include/LXeEMPhysics.hh	(revision 1230)
@@ -35,5 +35,5 @@
 #include "G4ComptonScattering.hh"
 #include "G4GammaConversion.hh"
-#include "G4MultipleScattering.hh"
+#include "G4eMultipleScattering.hh"
 #include "G4eIonisation.hh"
 #include "G4eBremsstrahlung.hh"
@@ -63,10 +63,10 @@
   
     // Electron physics
-    G4MultipleScattering* theElectronMultipleScattering;
+    G4eMultipleScattering* theElectronMultipleScattering;
     G4eIonisation* theElectronIonisation;
     G4eBremsstrahlung* theElectronBremsStrahlung;
   
     //Positron physics
-    G4MultipleScattering* thePositronMultipleScattering;
+    G4eMultipleScattering* thePositronMultipleScattering;
     G4eIonisation* thePositronIonisation; 
     G4eBremsstrahlung* thePositronBremsStrahlung;  
Index: trunk/examples/extended/optical/LXe/include/LXeMuonPhysics.hh
===================================================================
--- trunk/examples/extended/optical/LXe/include/LXeMuonPhysics.hh	(revision 1187)
+++ trunk/examples/extended/optical/LXe/include/LXeMuonPhysics.hh	(revision 1230)
@@ -31,5 +31,5 @@
 
 #include "G4VPhysicsConstructor.hh"
-#include "G4MultipleScattering.hh"
+#include "G4MuMultipleScattering.hh"
 #include "G4MuBremsstrahlung.hh"
 #include "G4MuPairProduction.hh"
@@ -58,10 +58,10 @@
    // Muon physics
    G4MuIonisation*         fMuPlusIonisation;
-   G4MultipleScattering*   fMuPlusMultipleScattering;
+   G4MuMultipleScattering* fMuPlusMultipleScattering;
    G4MuBremsstrahlung*     fMuPlusBremsstrahlung ;
    G4MuPairProduction*     fMuPlusPairProduction;
 
    G4MuIonisation*         fMuMinusIonisation;
-   G4MultipleScattering*   fMuMinusMultipleScattering;
+   G4MuMultipleScattering* fMuMinusMultipleScattering;
    G4MuBremsstrahlung*     fMuMinusBremsstrahlung ;
    G4MuPairProduction*     fMuMinusPairProduction;
Index: trunk/examples/extended/optical/LXe/include/LXePrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/optical/LXe/include/LXePrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/optical/LXe/include/LXePrimaryGeneratorAction.hh	(revision 1230)
@@ -28,5 +28,4 @@
 #define LXePrimaryGeneratorAction_h 1
 
-#include "G4GeneralParticleSource.hh"
 #include "G4VUserPrimaryGeneratorAction.hh"
 
Index: trunk/examples/extended/optical/LXe/src/LXeDetectorConstruction.cc
===================================================================
--- trunk/examples/extended/optical/LXe/src/LXeDetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/optical/LXe/src/LXeDetectorConstruction.cc	(revision 1230)
@@ -140,4 +140,8 @@
   LXe_mt->AddConstProperty("YIELDRATIO",1.0);
   LXe->SetMaterialPropertiesTable(LXe_mt);
+
+  // Set the Birks Constant for the LXe scintillator
+
+  LXe->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
   
   G4double Glass_RIND[LXe_NUMENTRIES]={1.49,1.49,1.49};
@@ -171,4 +175,8 @@
   Pstyrene->SetMaterialPropertiesTable(MPTPStyrene);
 
+  // Set the Birks Constant for the Polystyrene scintillator
+
+  Pstyrene->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
+
   G4double RefractiveIndexFiber[WLS_NUMENTRIES]={ 1.60, 1.60, 1.60, 1.60};
   G4double AbsFiber[WLS_NUMENTRIES]={9.00*m,9.00*m,0.1*mm,0.1*mm};
@@ -343,4 +351,5 @@
   G4LogicalSkinSurface::CleanSurfaceTable();
   G4LogicalBorderSurface::CleanSurfaceTable();
+  G4SurfaceProperty::CleanSurfacePropertyTable();
 
   //define new one
Index: trunk/examples/extended/optical/LXe/src/LXeEMPhysics.cc
===================================================================
--- trunk/examples/extended/optical/LXe/src/LXeEMPhysics.cc	(revision 1187)
+++ trunk/examples/extended/optical/LXe/src/LXeEMPhysics.cc	(revision 1230)
@@ -74,10 +74,10 @@
   
     // Electron physics
-  theElectronMultipleScattering = new G4MultipleScattering();
+  theElectronMultipleScattering = new G4eMultipleScattering();
   theElectronIonisation = new G4eIonisation();
   theElectronBremsStrahlung = new G4eBremsstrahlung();
   
     //Positron physics
-  thePositronMultipleScattering = new G4MultipleScattering();
+  thePositronMultipleScattering = new G4eMultipleScattering();
   thePositronIonisation = new G4eIonisation(); 
   thePositronBremsStrahlung = new G4eBremsstrahlung();  
Index: trunk/examples/extended/optical/LXe/src/LXeMainVolume.cc
===================================================================
--- trunk/examples/extended/optical/LXe/src/LXeMainVolume.cc	(revision 1187)
+++ trunk/examples/extended/optical/LXe/src/LXeMainVolume.cc	(revision 1230)
@@ -266,8 +266,10 @@
   //**Photocathode surface properties
   G4double photocath_EFF[num]={1.,1.}; //Enables 'detection' of photons
-  G4double photocath_REFL[num]={0.,0.};
+  G4double photocath_ReR[num]={1.92,1.92};
+  G4double photocath_ImR[num]={1.69,1.69};
   G4MaterialPropertiesTable* photocath_mt = new G4MaterialPropertiesTable();
   photocath_mt->AddProperty("EFFICIENCY",Ephoton,photocath_EFF,num);
-  photocath_mt->AddProperty("REFLECTIVITY",Ephoton,photocath_REFL,num);
+  photocath_mt->AddProperty("REALRINDEX",Ephoton,photocath_ReR,num);
+  photocath_mt->AddProperty("IMAGINARYRINDEX",Ephoton,photocath_ImR,num);
   G4OpticalSurface* photocath_opsurf= 
     new G4OpticalSurface("photocath_opsurf",glisur,polished,
Index: trunk/examples/extended/optical/LXe/src/LXeMuonPhysics.cc
===================================================================
--- trunk/examples/extended/optical/LXe/src/LXeMuonPhysics.cc	(revision 1187)
+++ trunk/examples/extended/optical/LXe/src/LXeMuonPhysics.cc	(revision 1230)
@@ -63,10 +63,10 @@
 {
   fMuPlusIonisation = new G4MuIonisation();
-  fMuPlusMultipleScattering = new G4MultipleScattering();
+  fMuPlusMultipleScattering = new G4MuMultipleScattering();
   fMuPlusBremsstrahlung=new G4MuBremsstrahlung();
   fMuPlusPairProduction= new G4MuPairProduction();
 
   fMuMinusIonisation = new G4MuIonisation();
-  fMuMinusMultipleScattering = new G4MultipleScattering;
+  fMuMinusMultipleScattering = new G4MuMultipleScattering;
   fMuMinusBremsstrahlung = new G4MuBremsstrahlung();
   fMuMinusPairProduction = new G4MuPairProduction();
Index: trunk/examples/extended/optical/LXe/src/LXePMTSD.cc
===================================================================
--- trunk/examples/extended/optical/LXe/src/LXePMTSD.cc	(revision 1187)
+++ trunk/examples/extended/optical/LXe/src/LXePMTSD.cc	(revision 1230)
@@ -65,6 +65,6 @@
 
 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
-G4bool LXePMTSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist){
-  return ProcessHits_constStep(aStep,ROhist);
+G4bool LXePMTSD::ProcessHits(G4Step* ,G4TouchableHistory* ){
+  return false;
 }
 
@@ -120,5 +120,4 @@
   }
     
-
   return true;
 }
Index: trunk/examples/extended/optical/LXe/src/LXePhysicsList.cc
===================================================================
--- trunk/examples/extended/optical/LXe/src/LXePhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/optical/LXe/src/LXePhysicsList.cc	(revision 1230)
@@ -26,20 +26,9 @@
 #include "LXePhysicsList.hh"
 
-#include "globals.hh"
-#include "G4ParticleDefinition.hh"
-#include "G4ProcessManager.hh"
-#include "G4ProcessVector.hh"
-#include "G4ParticleTypes.hh"
-#include "G4ParticleTable.hh"
-
-#include "G4Material.hh"
-#include "G4MaterialTable.hh"
-#include "G4ios.hh"
-#include <iomanip>   
-
 #include "LXeGeneralPhysics.hh"
 #include "LXeEMPhysics.hh"
 #include "LXeMuonPhysics.hh"
-#include "LXeOpticalPhysics.hh"
+
+#include "G4OpticalPhysics.hh"
 
 LXePhysicsList::LXePhysicsList():  G4VModularPhysicsList()
@@ -47,5 +36,4 @@
   // default cut value  (1.0mm) 
   defaultCutValue = 1.0*mm;
-  // SetVerboseLevel(1);
 
   // General Physics
@@ -56,8 +44,19 @@
 
   // Muon Physics
-  RegisterPhysics(  new LXeMuonPhysics("muon"));
+  RegisterPhysics( new LXeMuonPhysics("muon"));
 
-   // Optical Physics
-  RegisterPhysics(  new LXeOpticalPhysics("optical"));
+  // Optical Physics
+  G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
+  RegisterPhysics( opticalPhysics );
+
+  opticalPhysics->SetWLSTimeProfile("delta");
+
+  opticalPhysics->SetScintillationYieldFactor(1.0);
+  opticalPhysics->SetScintillationExcitationRatio(0.0);
+
+  opticalPhysics->SetMaxNumPhotonsPerStep(100);
+  opticalPhysics->SetMaxBetaChangePerStep(10.0);
+
+  opticalPhysics->SetTrackSecondariesFirst(true);
 
 }
Index: trunk/examples/extended/parallel/ExDiane/Brachy.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/Brachy.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/Brachy.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: Brachy.cc
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------
Index: trunk/examples/extended/parallel/ExDiane/GNUmakefile
===================================================================
--- trunk/examples/extended/parallel/ExDiane/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.3 2004/05/25 12:46:46 guatelli Exp $
+# $Id: GNUmakefile,v 1.4 2009/03/06 09:51:42 gbarrand Exp $
 # --------------------------------------------------------------
 
@@ -22,9 +22,3 @@
 
 include $(G4INSTALL)/config/binmake.gmk
-ifdef G4ANALYSIS_USE  
- CPPFLAGS += `aida-config --include`
- LDFLAGS  += `aida-config --lib`
- LOADLIBS += `aida-config --lib` 
-endif
 
-
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyAnalysisManager.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyAnalysisManager.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyAnalysisManager.hh	(revision 1230)
@@ -30,5 +30,5 @@
 //
 // $Id: BrachyAnalysisManager.hh,v 1.3 2006/06/29 17:30:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    **********************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstruction.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyDetectorConstruction.hh,v 1.3 2006/06/29 17:30:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //  
 //    ****************************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionI.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionI.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionI.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyDetectorConstructionI.hh,v 1.3 2006/06/29 17:31:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    ****************************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionIr.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionIr.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionIr.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyDetectorConstructionIr.hh,v 1.3 2006/06/29 17:31:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    ****************************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionLeipzig.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionLeipzig.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorConstructionLeipzig.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyDetectorConstructionLeipzig.hh,v 1.3 2006/06/29 17:31:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //Author: Susanna Guatelli
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorMessenger.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyDetectorMessenger.hh	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyDetectorMessenger.hh,v 1.3 2006/06/29 17:31:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyEventAction.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyEventAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyEventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyEventAction.hh,v 1.3 2006/06/29 17:31:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // Code developed by:
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyFactory.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyFactory.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyFactory.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: BrachyFactory.hh,v 1.2 2006/06/29 17:31:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    **********************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryI.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryI.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryI.hh	(revision 1230)
@@ -36,5 +36,5 @@
 // 
 // $Id: BrachyFactoryI.hh,v 1.2 2006/06/29 17:32:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryIr.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryIr.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryIr.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyFactoryIr.hh,v 1.2 2006/06/29 17:32:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    **********************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryLeipzig.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryLeipzig.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyFactoryLeipzig.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyFactoryLeipzig.hh,v 1.2 2006/06/29 17:32:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    **********************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyMaterial.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyMaterial.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyMaterial.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyMaterial.hh,v 1.2 2006/06/29 17:32:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    **********************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomHit.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomHit.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyPhantomHit.hh,v 1.3 2006/06/29 17:32:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomROGeometry.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomROGeometry.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomROGeometry.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyPhantomROGeometry.hh,v 1.3 2006/06/29 17:32:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    ************************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomSD.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomSD.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyPhantomSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyPhantomSD.hh,v 1.2 2006/06/29 17:32:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    ********************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyPhysicsList.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyPhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyPhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyPhysicsList.hh,v 1.3 2006/06/29 17:32:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    **********************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyPrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:32:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    ********************************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorActionI.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorActionI.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorActionI.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyPrimaryGeneratorActionI.hh,v 1.3 2006/06/29 17:32:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorActionIr.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorActionIr.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyPrimaryGeneratorActionIr.hh	(revision 1230)
@@ -27,5 +27,5 @@
 //
 // $Id: BrachyPrimaryGeneratorActionIr.hh,v 1.3 2006/06/29 17:32:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //    *************************************************
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyRunAction.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyRunAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyRunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyRunAction.hh,v 1.3 2006/06/29 17:32:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //Author: Susanna Guatelli
Index: trunk/examples/extended/parallel/ExDiane/include/BrachyRunMessenger.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachyRunMessenger.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachyRunMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachyRunMessenger.hh,v 1.3 2006/06/29 17:32:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //Author: Susanna Guatelli 
Index: trunk/examples/extended/parallel/ExDiane/include/BrachySimulation.hh
===================================================================
--- trunk/examples/extended/parallel/ExDiane/include/BrachySimulation.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/include/BrachySimulation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachySimulation.hh
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyAnalysisManager.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyAnalysisManager.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyAnalysisManager.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyAnalysisManager.cc,v 1.3 2006/06/29 17:32:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #ifdef  G4ANALYSIS_USE
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstruction.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstruction.cc	(revision 1230)
@@ -38,5 +38,5 @@
 //
 // $Id: BrachyDetectorConstruction.cc,v 1.3 2006/06/29 17:32:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyPhantomROGeometry.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionI.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionI.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionI.cc	(revision 1230)
@@ -38,5 +38,5 @@
 //
 // $Id: BrachyDetectorConstructionI.cc,v 1.3 2006/06/29 17:32:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "globals.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionIr.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionIr.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionIr.cc	(revision 1230)
@@ -38,5 +38,5 @@
 //
 // $Id: BrachyDetectorConstructionIr.cc,v 1.3 2006/06/29 17:32:56 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "globals.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionLeipzig.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionLeipzig.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionLeipzig.cc	(revision 1230)
@@ -39,5 +39,5 @@
 //
 // $Id: BrachyDetectorConstructionLeipzig.cc,v 1.3 2006/06/29 17:32:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorMessenger.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorMessenger.cc	(revision 1230)
@@ -36,5 +36,5 @@
 //
 // $Id: BrachyDetectorMessenger.cc,v 1.3 2006/06/29 17:33:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyEventAction.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyEventAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyEventAction.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyEventAction.cc,v 1.3 2006/06/29 17:33:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyEventAction.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyFactory.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyFactory.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyFactory.cc	(revision 1230)
@@ -36,5 +36,5 @@
 //
 // $Id: BrachyFactory.cc,v 1.3 2006/06/29 17:33:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include"BrachyFactory.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryI.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryI.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryI.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyFactoryI.cc,v 1.2 2006/06/29 17:33:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyFactoryI.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryIr.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryIr.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryIr.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyFactoryIr.cc,v 1.3 2006/06/29 17:33:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "globals.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryLeipzig.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryLeipzig.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyFactoryLeipzig.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyFactoryLeipzig.cc,v 1.3 2006/06/29 17:33:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyMaterial.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyMaterial.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyMaterial.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyMaterial.cc,v 1.3 2006/06/29 17:33:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomHit.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomHit.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomHit.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyPhantomHit.cc,v 1.3 2006/06/29 17:33:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyPhantomHit.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomROGeometry.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomROGeometry.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomROGeometry.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyPhantomROGeometry.cc,v 1.3 2006/06/29 17:33:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyPhantomROGeometry.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomSD.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomSD.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyPhantomSD.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyPhantomSD.cc,v 1.4 2006/06/29 17:33:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyPhantomSD.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyPhysicsList.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyPhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyPhysicsList.cc	(revision 1230)
@@ -34,5 +34,5 @@
 //
 // $Id: BrachyPhysicsList.cc,v 1.3 2006/06/29 17:33:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyPhysicsList.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorAction.cc	(revision 1230)
@@ -39,5 +39,5 @@
 //
 // $Id: BrachyPrimaryGeneratorAction.cc,v 1.2 2006/06/29 17:33:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "globals.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorActionI.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorActionI.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorActionI.cc	(revision 1230)
@@ -38,5 +38,5 @@
 //
 // $Id: BrachyPrimaryGeneratorActionI.cc,v 1.4 2006/06/29 17:33:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyPrimaryGeneratorActionI.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorActionIr.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorActionIr.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyPrimaryGeneratorActionIr.cc	(revision 1230)
@@ -38,5 +38,5 @@
 //
 // $Id: BrachyPrimaryGeneratorActionIr.cc,v 1.4 2006/06/29 17:33:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 #include "BrachyPrimaryGeneratorActionIr.hh"
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyRunAction.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyRunAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyRunAction.cc	(revision 1230)
@@ -40,5 +40,5 @@
 //
 // $Id: BrachyRunAction.cc,v 1.3 2006/06/29 17:33:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ExDiane/src/BrachyRunMessenger.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachyRunMessenger.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachyRunMessenger.cc	(revision 1230)
@@ -28,5 +28,5 @@
 //
 // $Id: BrachyRunMessenger.cc,v 1.3 2006/06/29 17:33:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/parallel/ExDiane/src/BrachySimulation.cc
===================================================================
--- trunk/examples/extended/parallel/ExDiane/src/BrachySimulation.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ExDiane/src/BrachySimulation.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: BrachySimulation.cc
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------
Index: trunk/examples/extended/parallel/MPI/exMPI01/GNUmakefile
===================================================================
--- trunk/examples/extended/parallel/MPI/exMPI01/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/parallel/MPI/exMPI01/GNUmakefile	(revision 1230)
@@ -1,4 +1,4 @@
 # $Id: GNUmakefile,v 1.1 2007/11/16 14:16:46 kmura Exp $
-# $Name:  $
+# $Name: geant4-09-03-cand-01 $
 # ===========================================================
 #   Makefile for building G4 MPI aplication
Index: trunk/examples/extended/parallel/MPI/exMPI01/exMPI01.cc
===================================================================
--- trunk/examples/extended/parallel/MPI/exMPI01/exMPI01.cc	(revision 1187)
+++ trunk/examples/extended/parallel/MPI/exMPI01/exMPI01.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: exMPI01.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
-// $Name:  $
+// $Name: geant4-09-03-cand-01 $
 //
 // ====================================================================
Index: trunk/examples/extended/parallel/MPI/exMPI02/GNUmakefile
===================================================================
--- trunk/examples/extended/parallel/MPI/exMPI02/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/parallel/MPI/exMPI02/GNUmakefile	(revision 1230)
@@ -1,4 +1,4 @@
 # $Id: GNUmakefile,v 1.1 2007/11/16 14:28:34 kmura Exp $
-# $Name:  $
+# $Name: geant4-09-03-cand-01 $
 # ===========================================================
 #   Makefile for building G4 MPI aplication
Index: trunk/examples/extended/parallel/MPI/exMPI02/exMPI02.cc
===================================================================
--- trunk/examples/extended/parallel/MPI/exMPI02/exMPI02.cc	(revision 1187)
+++ trunk/examples/extended/parallel/MPI/exMPI02/exMPI02.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: exMPI02.cc,v 1.1 2007/11/16 14:28:34 kmura Exp $
-// $Name:  $
+// $Name: geant4-09-03-cand-01 $
 //
 // ====================================================================
Index: trunk/examples/extended/parallel/MPI/mpi_interface/GNUmakefile
===================================================================
--- trunk/examples/extended/parallel/MPI/mpi_interface/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/parallel/MPI/mpi_interface/GNUmakefile	(revision 1230)
@@ -1,4 +1,4 @@
 # $Id: GNUmakefile,v 1.1 2007/11/16 13:32:56 kmura Exp $
-# $Name:  $
+# $Name: geant4-09-03-cand-01 $
 # ===========================================================
 #   Makefile for building MPI interface
Index: trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4HCofThisEvent.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4HCofThisEvent.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4HCofThisEvent.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4HCofThisEvent.hh,v 1.3 2006/06/29 17:33:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4THitsCollection.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4THitsCollection.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4THitsCollection.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4THitsCollection.hh,v 1.3 2006/06/29 17:33:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4VHitsCollection.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4VHitsCollection.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/AnnotatedFiles/G4VHitsCollection.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4VHitsCollection.hh,v 1.3 2006/06/29 17:34:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ParN02/ParN02.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/ParN02.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/ParN02.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ParN02.cc,v 1.5 2006/07/05 12:45:59 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/parallel/ParN02/ParTopC.icc
===================================================================
--- trunk/examples/extended/parallel/ParN02/ParTopC.icc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/ParTopC.icc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ParTopC.icc,v 1.2 2006/06/29 17:33:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------------
Index: trunk/examples/extended/parallel/ParN02/include/ExN02ChamberParameterisation.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02ChamberParameterisation.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02ChamberParameterisation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02ChamberParameterisation.hh,v 1.4 2006/06/29 17:34:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/parallel/ParN02/include/ExN02DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02DetectorConstruction.hh,v 1.2 2006/06/29 17:34:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ExN02DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02DetectorMessenger.hh,v 1.3 2006/06/29 17:34:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ExN02EventAction.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02EventAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02EventAction.hh,v 1.2 2006/06/29 17:34:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ExN02MagneticField.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02MagneticField.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02MagneticField.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02MagneticField.hh,v 1.2 2006/06/29 17:34:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/parallel/ParN02/include/ExN02PhysicsList.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02PhysicsList.hh,v 1.2 2006/06/29 17:34:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ExN02PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02PrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:34:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ExN02RunAction.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02RunAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02RunAction.hh,v 1.3 2006/07/05 12:46:00 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ExN02SteppingAction.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02SteppingAction.hh,v 1.2 2006/06/29 17:34:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ExN02SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02SteppingVerbose.hh,v 1.2 2006/06/29 17:34:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/parallel/ParN02/include/ExN02TrackerSD.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ExN02TrackerSD.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ExN02TrackerSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02TrackerSD.hh,v 1.2 2006/06/29 17:34:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/include/ParRunManager.hh
===================================================================
--- trunk/examples/extended/parallel/ParN02/include/ParRunManager.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/include/ParRunManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ParRunManager.hh,v 1.3 2006/06/29 17:34:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------------
Index: trunk/examples/extended/parallel/ParN02/src/ExN02ChamberParameterisation.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02ChamberParameterisation.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02ChamberParameterisation.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02ChamberParameterisation.cc,v 1.3 2006/06/29 17:34:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02DetectorConstruction.cc,v 1.3 2006/06/29 17:34:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 
Index: trunk/examples/extended/parallel/ParN02/src/ExN02DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02DetectorMessenger.cc,v 1.4 2006/06/29 17:34:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02EventAction.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02EventAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02EventAction.cc,v 1.2 2006/06/29 17:34:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02MagneticField.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02MagneticField.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02MagneticField.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02MagneticField.cc,v 1.2 2006/06/29 17:34:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //  
 //   User Field class implementation.
Index: trunk/examples/extended/parallel/ParN02/src/ExN02PhysicsList.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02PhysicsList.cc,v 1.4 2006/06/29 17:34:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02PrimaryGeneratorAction.cc,v 1.2 2006/06/29 17:34:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02RunAction.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02RunAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02RunAction.cc,v 1.3 2006/07/05 12:46:00 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02SteppingAction.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02SteppingAction.cc,v 1.2 2006/06/29 17:35:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02SteppingVerbose.cc,v 1.4 2006/06/29 17:35:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02TrackerHit.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02TrackerHit.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02TrackerHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02TrackerHit.cc,v 1.3 2006/06/29 17:35:09 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN02/src/ExN02TrackerSD.cc
===================================================================
--- trunk/examples/extended/parallel/ParN02/src/ExN02TrackerSD.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN02/src/ExN02TrackerSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN02TrackerSD.cc,v 1.3 2006/06/29 17:35:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4HCofThisEvent.hh
===================================================================
--- trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4HCofThisEvent.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4HCofThisEvent.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4HCofThisEvent.hh,v 1.3 2006/06/29 17:35:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4THitsCollection.hh
===================================================================
--- trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4THitsCollection.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4THitsCollection.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4THitsCollection.hh,v 1.3 2006/06/29 17:35:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4VHitsCollection.hh
===================================================================
--- trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4VHitsCollection.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/AnnotatedFiles/G4VHitsCollection.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: G4VHitsCollection.hh,v 1.3 2006/06/29 17:35:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/parallel/ParN04/ParN04.cc
===================================================================
--- trunk/examples/extended/parallel/ParN04/ParN04.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/ParN04.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ParN04.cc,v 1.6 2006/07/05 13:07:54 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/parallel/ParN04/ParTopC.icc
===================================================================
--- trunk/examples/extended/parallel/ParN04/ParTopC.icc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/ParTopC.icc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ParTopC.icc,v 1.2 2006/06/29 17:35:18 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------------
Index: trunk/examples/extended/parallel/ParN04/include/ExN04EMPhysics.hh
===================================================================
--- trunk/examples/extended/parallel/ParN04/include/ExN04EMPhysics.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/include/ExN04EMPhysics.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN04EMPhysics.hh,v 1.2 2006/06/29 17:36:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/parallel/ParN04/include/ExN04RunAction.hh
===================================================================
--- trunk/examples/extended/parallel/ParN04/include/ExN04RunAction.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/include/ExN04RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN04RunAction.hh,v 1.3 2006/07/05 13:07:55 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN04/include/ExN04SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/parallel/ParN04/include/ExN04SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/include/ExN04SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN04SteppingVerbose.hh,v 1.2 2006/06/29 17:36:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/parallel/ParN04/include/ParRunManager.hh
===================================================================
--- trunk/examples/extended/parallel/ParN04/include/ParRunManager.hh	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/include/ParRunManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ParRunManager.hh,v 1.4 2006/06/29 17:36:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // --------------------------------------------------------------------
Index: trunk/examples/extended/parallel/ParN04/src/ExN04RunAction.cc
===================================================================
--- trunk/examples/extended/parallel/ParN04/src/ExN04RunAction.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/src/ExN04RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN04RunAction.cc,v 1.3 2006/07/05 13:07:56 gcosmo Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/parallel/ParN04/src/ExN04SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/parallel/ParN04/src/ExN04SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/parallel/ParN04/src/ExN04SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExN04SteppingVerbose.cc,v 1.2 2006/06/29 17:37:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/exampleP01.cc
===================================================================
--- trunk/examples/extended/persistency/P01/exampleP01.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/exampleP01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: exampleP01.cc,v 1.2 2006/06/29 17:38:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/persistency/P01/include/ExP01ChamberParameterisation.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01ChamberParameterisation.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01ChamberParameterisation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01ChamberParameterisation.hh,v 1.2 2006/06/29 17:38:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/persistency/P01/include/ExP01DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01DetectorConstruction.hh,v 1.2 2006/06/29 17:38:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01DetectorMessenger.hh,v 1.2 2006/06/29 17:38:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01EventAction.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01EventAction.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01EventAction.hh,v 1.2 2006/06/29 17:38:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01MagneticField.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01MagneticField.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01MagneticField.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01MagneticField.hh,v 1.2 2006/06/29 17:38:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/persistency/P01/include/ExP01PhysicsList.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01PhysicsList.hh,v 1.2 2006/06/29 17:38:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01PrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:38:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01RunAction.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01RunAction.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01RunAction.hh,v 1.2 2006/06/29 17:39:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01SteppingAction.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01SteppingAction.hh,v 1.2 2006/06/29 17:39:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01SteppingVerbose.hh,v 1.2 2006/06/29 17:39:06 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/persistency/P01/include/ExP01TrackerHit.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01TrackerHit.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01TrackerHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01TrackerHit.hh,v 1.2 2006/06/29 17:39:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/include/ExP01TrackerSD.hh
===================================================================
--- trunk/examples/extended/persistency/P01/include/ExP01TrackerSD.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P01/include/ExP01TrackerSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01TrackerSD.hh,v 1.2 2006/06/29 17:39:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01ChamberParameterisation.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01ChamberParameterisation.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01ChamberParameterisation.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01ChamberParameterisation.cc,v 1.2 2006/06/29 17:39:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01DetectorConstruction.cc,v 1.2 2006/06/29 17:39:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 
Index: trunk/examples/extended/persistency/P01/src/ExP01DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01DetectorMessenger.cc,v 1.2 2006/06/29 17:39:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01EventAction.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01EventAction.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01EventAction.cc,v 1.2 2006/06/29 17:39:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01MagneticField.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01MagneticField.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01MagneticField.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01MagneticField.cc,v 1.2 2006/06/29 17:39:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //  
 //   User Field class implementation.
Index: trunk/examples/extended/persistency/P01/src/ExP01PhysicsList.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01PhysicsList.cc,v 1.2 2006/06/29 17:39:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01PrimaryGeneratorAction.cc,v 1.2 2006/06/29 17:39:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01RunAction.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01RunAction.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01RunAction.cc,v 1.2 2006/06/29 17:39:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01SteppingAction.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01SteppingAction.cc,v 1.2 2006/06/29 17:39:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01SteppingVerbose.cc,v 1.2 2006/06/29 17:39:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01TrackerHit.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01TrackerHit.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01TrackerHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01TrackerHit.cc,v 1.2 2006/06/29 17:39:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P01/src/ExP01TrackerSD.cc
===================================================================
--- trunk/examples/extended/persistency/P01/src/ExP01TrackerSD.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P01/src/ExP01TrackerSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP01TrackerSD.cc,v 1.2 2006/06/29 17:39:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P02/exampleP02.cc
===================================================================
--- trunk/examples/extended/persistency/P02/exampleP02.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P02/exampleP02.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: exampleP02.cc,v 1.1 2007/11/29 17:05:21 witoldp Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/persistency/P02/include/ExP02PhysicsList.hh
===================================================================
--- trunk/examples/extended/persistency/P02/include/ExP02PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P02/include/ExP02PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP02PhysicsList.hh,v 1.1 2007/11/29 17:05:22 witoldp Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P02/include/ExP02PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/persistency/P02/include/ExP02PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/persistency/P02/include/ExP02PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP02PrimaryGeneratorAction.hh,v 1.1 2007/11/29 17:05:22 witoldp Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/persistency/P02/src/ExP02PhysicsList.cc
===================================================================
--- trunk/examples/extended/persistency/P02/src/ExP02PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/persistency/P02/src/ExP02PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: ExP02PhysicsList.cc,v 1.2 2007/12/10 16:29:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/GNUmakefile
===================================================================
--- trunk/examples/extended/polarisation/Pol01/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
+# $Id: GNUmakefile,v 1.4 2008/06/11 17:17:54 schaelic Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -17,9 +17,4 @@
 include $(G4INSTALL)/config/binmake.gmk
 
-ifdef G4ANALYSIS_USE
-  # for the aida-config command see the README file
-  CPPFLAGS += `aida-config --include`
-  LDLIBS  += `aida-config --lib`  
-
 plots:	plotResults.class
 	@echo calling JAIDA ...
@@ -29,3 +24,2 @@
 	@echo compiling $<
 	javac $<
-endif
Index: trunk/examples/extended/polarisation/Pol01/include/DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.hh,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/DetectorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/EventAction.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/EventAction.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/EventActionMessenger.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/EventActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/EventActionMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/HistoManager.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/HistoManager.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/HistoManager.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.hh,v 1.2 2006/11/17 11:44:46 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/HistoMessenger.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/HistoMessenger.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/HistoMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/PhysListEmPolarized.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/PhysListEmPolarized.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/PhysListEmPolarized.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPolarized.hh,v 1.1 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/PhysListEmStandard.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/PhysListEmStandard.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/PhysListEmStandard.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.hh,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/PhysicsList.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysicsList.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/PhysicsListMessenger.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/PhysicsListMessenger.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/PhysicsListMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/ProcessesCount.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/ProcessesCount.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/ProcessesCount.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: ProcessesCount.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/RunAction.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/RunAction.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/RunAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.hh,v 1.2 2006/11/17 11:44:46 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/StepMax.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/StepMax.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/StepMax.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/StepMaxMessenger.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/StepMaxMessenger.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/StepMaxMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/include/SteppingAction.hh
===================================================================
--- trunk/examples/extended/polarisation/Pol01/include/SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/include/SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.hh,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/pol01.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/pol01.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/pol01.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: pol01.cc,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorConstruction.cc,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/DetectorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: DetectorMessenger.cc,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/EventAction.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/EventAction.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventAction.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/EventActionMessenger.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/EventActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/EventActionMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: EventActionMessenger.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/HistoManager.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/HistoManager.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/HistoManager.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoManager.cc,v 1.3 2006/11/17 11:44:46 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/HistoMessenger.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/HistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/HistoMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: HistoMessenger.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/PhysListEmPolarized.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/PhysListEmPolarized.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/PhysListEmPolarized.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PhysListEmPolarized.cc,v 1.2 2007/11/01 17:34:53 schaelic Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/PhysListEmStandard.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/PhysListEmStandard.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/PhysListEmStandard.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysListEmStandard.cc,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/PhysicsList.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 // 
 // $Id: PhysicsList.cc,v 1.2 2006/10/02 16:25:55 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/PhysicsListMessenger.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/PhysicsListMessenger.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/PhysicsListMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PhysicsListMessenger.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: PrimaryGeneratorAction.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/RunAction.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/RunAction.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/RunAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RunAction.cc,v 1.3 2006/11/17 11:44:46 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/StepMax.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/StepMax.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/StepMax.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMax.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/StepMaxMessenger.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/StepMaxMessenger.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/StepMaxMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: StepMaxMessenger.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/polarisation/Pol01/src/SteppingAction.cc
===================================================================
--- trunk/examples/extended/polarisation/Pol01/src/SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/polarisation/Pol01/src/SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: SteppingAction.cc,v 1.1 2006/10/02 13:48:10 vnivanch Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/radioactivedecay/exrdm/GNUmakefile
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/GNUmakefile	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.4 2006/12/21 17:52:39 flei Exp $
+# $Id: GNUmakefile,v 1.9 2008/12/05 09:57:30 flei Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module
@@ -12,26 +12,22 @@
 endif
 
-ifdef G4ANALYSIS_USE_ROOT
-CPPFLAGS += -DG4ANALYSIS_USE_ROOT 
-CPPFLAGS += -D_REENTRANT -I$(ROOTSYS)/include
-
-EXTRALIBS += -L$(ROOTSYS)/lib \
--lCore -lCint \
--lHist -lGraf -lGraf3d -lGpad \
--lTree -lRint -lPostscript \
--lMatrix -lPhysics \
--lm -ldl -lpthread -rdynamic
-
-endif
-
-ifdef G4ANALYSIS_USE_AIDA
-   CPPFLAGS += -DG4ANALYSIS_USE_AIDA
-   CPPFLAGS += `aida-config --include`
-   LDLIBS += `aida-config --lib`
-endif
-
 .PHONY: all
 all: lib bin
 
+ifdef G4ANALYSIS_USE_ROOT
+  CPPFLAGS += -DG4ANALYSIS_USE_ROOT 
+endif
+
+include $(G4INSTALL)/config/architecture.gmk
+
+ifdef G4ANALYSIS_USE_ROOT
+  CPPFLAGS += $(shell $(ROOTSYS)/bin/root-config --cflags)
+  LDFLAGS  += $(shell $(ROOTSYS)/bin/root-config --glibs)
+endif
+
 include $(G4INSTALL)/config/binmake.gmk
 
+anaclean:
+	rm -f $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(G4TARGET)/exrdmHisto* 
+	rm -f $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(G4TARGET)/exrdmAnalysis* 
+	rm -f $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(G4TARGET)/exrdmStepping* 
Index: trunk/examples/extended/radioactivedecay/exrdm/History
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/History	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/History	(revision 1230)
@@ -1,3 +1,3 @@
-$Id: History,v 1.17 2007/11/15 16:10:09 vnivanch Exp $
+$Id: History,v 1.27 2009/09/22 16:50:06 gunter Exp $
 -------------------------------------------------------------------
 
@@ -15,4 +15,47 @@
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
+
+22/09/2009 G.Folger (exrdm-V09-02-00)
+-  remove trivial compilation warning when compiled without G4ANALYSIS_USE in 
+   src/src/exrdmHisto.cc
+
+05/12/2008 F.Lei (exrdm-V09-01-04)
+- exrdmAnalysisManager.cc, exrdmSteppingAction.cc
+   - better G4ANALYSIS_USE and G4ANALYSIS_USE_ROOT logic 
+- GNUMakefile
+
+04/12/2008 F.Lei (exrdm-V09-01-03)
+- exrdmHisto: delete hfileROOT in save();
+- exrdmAnalysisManager.cc, exrdmSteppingAction.cc
+   - used || login between G4ANALYSIS_USE and G4ANALYSIS_USE_ROOT
+- Updated README, macro/f24.mac
+
+04/12/2008 G.Barrand
+- exrdmAnalyisManager : dispose() : cstor, dstor private.
+- exrdmHisto : revisit the AIDA sector, mainly creation/deletion of things.
+  Now the program holds in case of multiple /run/beamOn.
+  NOTE : someone should do the same with the ROOT sector...
+  I have let a //FIXME in exrdmHisto::~exrdmHisto and ~exrdmAnalysisManager().
+- EventAction, RunAction : have some #ifdef G4VIS_USE to be able to
+  disconnect properly the G4/vis.
+
+02/12/2008 F.Lei (exrdm-V09-01-02)
+- exrdmHisto,exrdmHistoMessenger & exrdmAnalysisManager: updated the usage 
+  of AIDA analysis package.
+  
+August 10th, 2008 V.Ivanchenko (exrdm-V09-01-01)
+--------------------------------------------------
+- exdrmMatarialMessenger - fix units of density
+- exdrmPhysicsList - fix definition of cuts; simplify logic
+                     of setting of hadronic physics;
+                     remove double instantiation of radioactive decay
+- removed compillation warnings in several places
+- replace flag G4ANALYSIS_USE_AIDA by G4ANALYSIS_USE
+- remove AIDA setup from GNUmakefile (use one from central scripts)
+
+01 May 2008, Fan Lei (exrdm-V09-01-00)
+--------------------------------------------------
+- Removed "," from the Ntuple header definition
+- All energy depositions are collected, apart from that of the primary track.  
 
 November 15th, 2007 V.Ivanchenko (exrdm-V09-00-02)
Index: trunk/examples/extended/radioactivedecay/exrdm/README
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/README	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/README	(revision 1230)
@@ -7,8 +7,10 @@
                        -------------------- 
 
-  The exRDM is created to show how to use the G4RadioactiveDecay process to simulate the decays of radioactive 
-  isotopes as well as the induced radioactivity resulted from nuclear interactions. In the example a simple 
-  geometry consists of a cylindric target placed in the centre of a tube shaped detector is used. Various primary event
-  generation and tallying options are available. More documentations are available at
+  The exRDM is created to show how to use the G4RadioactiveDecay process to simulate the decays of 
+  radioactive isotopes as well as the induced radioactivity resulted from nuclear interactions. 
+
+  In this example a simple geometry consists of a cylindric target placed in the centre of a tube detector 
+  is constructed. Various primary event generation and tallying options are available. Further documentations 
+  are available at
 
 	  http://reat.space.qinetiq.com/septimess/exrdm
@@ -31,8 +33,8 @@
                   5 cm long. The default material is "Germanium".
 
-     The user can change the target/detector size and material at the at the "PreIni" state, using the commands under
+     The user can change the target/detector size and material at the at the "PreIni" state, using the 
+     commands in the directory
 		  
 		/exrdm/det
-
 
   2. PHYSICS
@@ -58,9 +60,7 @@
 	        /grdm/selectVolume Target
 
-
-
        - Hadronic processes:
 	  Hadronic processes are not invoked by default. They can be activated by the user at the "PreIni" 
- 	  state of the execution via the command
+ 	  state via the command
 
 		/exrdm/phys/SelectPhysics
@@ -72,5 +72,4 @@
 		"QGSP_BERT", "QGSP_BIC", "QGSP_HP", "LHEP_BERT", "LHEP_BERT_HP", "LHEP_BIC",
 		"LHEP_BIC_HP".
-
 
   3. EVENT:
@@ -84,6 +83,7 @@
   4. DETECTOR RESPONSE:
 
-     No Geant4 HITS and SD are defined in this example. All the relevant information of the simulation is extracted
-     at the "UserSteppingAction" stage, if the variable "G4ANALYSIS_USE" is defined. These include:
+     No Geant4 HITS and SD are defined in this example. If the variable "G4ANALYSIS_USE" is defined, all 
+     the relevant information of the simulation is collected  at the "UserSteppingAction" stage. These 
+     include:
 
        - Emission particles in the RadioactiveDecay process: 
@@ -112,32 +112,41 @@
   6. ANALYSIS:
 
-     This example implements an AIDA-compliant analysis system as well as the ROOT file format for 
-     histograms and ntuples. If the the user has an AIDA-compliant tool such as 
-     AIDAJNI, ANAPHE, or PI installed on his/her system, the analysis part of this example can 
+     This example implements an AIDA-compliant analysis system as well as the ROOT system, for accumulating 
+     and output histograms and ntuples. If the the user has an AIDA-compliant tool such as 
+     AIDAJNI, ANAPHE, OpenScientist or PI installed, the analysis part of this example can 
      be activated by 
 	
-	setenv G4ANALYSIS_USE_AIDA 1
-
-     before building the executable.  The user can also add the "root" file format option by define 
+	setenv G4ANALYSIS_USE 1
+
+     before building the executable.  
+
+     The user can also use the executable with the ROOT system, if it is available. This is done by 
       
-       setenv G4ANALYSIS_USE_RROT 1
+       setenv G4ANALYSIS_USE_ROOT 1
        
-     before the compilation.
-
-     At the completion of a simulation run a file "exrdm.root" by default is produced which contains 
-     these data structures. The user can change the name of this output file with the command
+     again before the compilation. The AIDA and ROOT systems can be used individually, or in parallel 
+     at the same time!
+
+     If no analysis system is activated, there is no output file produced apart from the screen dump. 
+     A file called "exrdm.aida" is produced by default for AIDA system and "exrdm.root" if the ROOT 
+     system is selected. 
+  
+     The user can change the name of this output file with the command
 
 	/histo/fileName new-filename
 
-     The output file by default is in "root" format and can be analysed offline using the ROOT tool, 
-     which allows the histograms and ntuples to examined, manipulated, saved and printed.
-
-     User can also change the output file format to "hbook"  or "xml" using the commands
+     The output AIDA file by default is in xml format. The AIDA system allows the use of other file format
+     such as "root" and "hbook". User can change the output format to "hbook"  or "root" using the command 
+     /histo/fileType.e.g.
 	
 	/histo/fileType hbook  
-	/histo/fileType xml
+	/histo/fileType root
      
-     The output file, in "xml" or "hbook" or "root" format, conatins the 3 ntuples (100,200,300) whose details have been 
-     described in section 4. In addition, there are 7 histograms in the file:
+     When "root" format is selected for the AIDA system, the output AIDA file name is changed to 
+     fileName_aida.root. This is to separate it from the the ROOT system output file fileName.root, in case 
+     both systems are used.
+    
+     The output file, in "aida" or "hbook" or "root" format, conatins the 3 ntuples (100,200,300) which have 
+     been described in section 4. In addition, there are 7 histograms in the file:
 
 	histogram 10: The Pulse Height Spectrum (PHS) of the target.
@@ -153,12 +162,11 @@
         /histo/setHisto
 
-     It is assumed the detector and target pulses both have an integration time of 1 micro-second, and the 
-     coincidence gate is 2 microsecond wide. The target and detctor have a threshold of 10 keV in the 
-     anti-/coincidence modes.        
+     It is assumed the detector and target pulses both have an integration time of 1 microsecond, and the 
+     gate is 2 microsecond for the coincidence spectrum. The target and detctor have a threshold of 10 keV 
+     in the anti-/coincidence modes.        
 
      Histograms 10-15 were derived from the same data stored in ntuple-300(the energy depositions), while
      Histogram 16 is obtained with data in ntuple-100 (the emission particles). The user should be able to
-     reproduce these histograms, or new histograms, with the ntuple data in an analyis tool such as JAS3. 
-        
+     reproduce these histograms, or new histograms, with the ntuple data in an off-line analyis tool.
 
   7. GETTING STARTED:
@@ -167,13 +175,13 @@
      example by 
 
-	setenv G4ANALYSIS_USE_AIDA 1
- 
-     in addition if you want to add the ROOT file format, do
+	setenv G4ANALYSIS_USE 1
+ 
+     in addition if you want to add the ROOT link to the ROOT system, do
        
         setenv G4ANALYSIS_USE_ROOT 1
 
-     otherwise make sure the G4ANALYSIS_USE_AIDA and G4ANALYSIS_USE_ROOT are not definded
- 
-	unsetenv G4ANALYSIS_USE_AIDA
+     Otherwise make sure the G4ANALYSIS_USE and G4ANALYSIS_USE_ROOT are not definded
+ 
+	unsetenv G4ANALYSIS_USE
 	unsetenv G4ANALYSIS_USE_ROOT
 	 
@@ -184,5 +192,5 @@
          gmake
 
-     gmake will create tmp and bin directories in your $G4TMP and $G4BIN directories. 
+     Depends on the setup, gmake will create tmp and bin directories in your $G4TMP and $G4BIN directories. 
      The executable, named exRDM, will be in $G4BIN/$G4SYSTEM/ directory.
 
@@ -191,14 +199,13 @@
          $G4BIN/$G4SYSTEM/exRDM exrdm.in
 
-     If all goes well, the execution shall be terminated in a few seconds. If G4ANALYSIS_USE_ROOT is 
-     defined, there will be a proton.root file in the current directory.
-
-     One can use ROOT to exam the file.
+     If all goes well, the execution shall be terminated in a few seconds. If G4ANALYSIS_USE is defined, one
+     should see a "proton.aida" file created. If G4ANALYSIS_USE_ROOT is defined, there will be 
+     a proton.root file in the same directory.
 
  8. FURTHER EXAMPLES:
 
-    There are a number of g4mac files in the ./macros subdirectory, to show the features of the G4RadioactiveDecay
-    process. Most of them will lead to the creation of an aida file in the same name of the micro file, which can 
-    be examed and analysed with an analysis tool such as ROOT.
+    There are a number of g4mac files in the ./macros subdirectory, to show the features of the 
+    G4RadioactiveDecay process. Most of them will lead to the creation of an aida file in the same name 
+    of the micro file, which can be examed and analysed with an analysis tool such as OpenScientist ,or JAS3.
  
 	vrml.mac:  to visulise the geometry and the incident of one 100 MeV Cf240 isotope and its decay. A vrml
Index: trunk/examples/extended/radioactivedecay/exrdm/exRDM.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/exRDM.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/exRDM.cc	(revision 1230)
@@ -58,5 +58,5 @@
 
   // Creation of the analysis manager
-  exrdmAnalysisManager* analysis = exrdmAnalysisManager::getInstance();
+  exrdmAnalysisManager::getInstance();
 
   // set mandatory initialization classes
@@ -116,5 +116,5 @@
   delete visManager;
 #endif
-  delete analysis;
+  exrdmAnalysisManager::dispose();
   delete runManager;
 
Index: trunk/examples/extended/radioactivedecay/exrdm/exrdm.in
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/exrdm.in	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/exrdm.in	(revision 1230)
@@ -1,3 +1,3 @@
-/control/saveHistory
+#/control/saveHistory
 /exrdm/phys/SelectPhysics QGSP_BIC_HP
 #/exrdm/phys/SelectPhysics Hadron
@@ -20,5 +20,5 @@
 /gps/energy 1 GeV
 /tracking/verbose 0
-/run/beamOn 10
+/run/beamOn 1000
 
 
Index: trunk/examples/extended/radioactivedecay/exrdm/include/exrdmAnalysisManager.hh
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/include/exrdmAnalysisManager.hh	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/include/exrdmAnalysisManager.hh	(revision 1230)
@@ -58,12 +58,12 @@
 
   static exrdmAnalysisManager* getInstance();
+  static void dispose();
 
 private:
 
   exrdmAnalysisManager();
+  ~exrdmAnalysisManager();
 
 public: // Without description
-
-  ~exrdmAnalysisManager();
 
   void bookHisto();
Index: trunk/examples/extended/radioactivedecay/exrdm/include/exrdmHisto.hh
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/include/exrdmHisto.hh	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/include/exrdmHisto.hh	(revision 1230)
@@ -39,10 +39,7 @@
 #include <vector>
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-class exrdmHistoMessenger;
-
-#ifdef G4ANALYSIS_USE_AIDA
+#ifdef G4ANALYSIS_USE
 namespace AIDA {
+ class IAnalysisFactory;
  class ITree;
  class ITuple;
@@ -51,5 +48,8 @@
 #endif
 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
 #ifdef G4ANALYSIS_USE_ROOT
+// Root classes
 class TFile;
 class TH1D;
@@ -57,4 +57,5 @@
 #endif
 
+class exrdmHistoMessenger;
 
 class exrdmHisto
@@ -92,5 +93,5 @@
   void fillTuple(G4int, G4int, G4double);
   // Fill nTuple at a given col with a double
-  void fillTuple(G4int, const G4String&, G4String);
+  void fillTuple(G4int, const G4String&, G4String&);
   // Fill nTuple parameter with a string
 
@@ -115,8 +116,8 @@
   G4int    verbose;
   G4int    defaultAct;
-
-#ifdef G4ANALYSIS_USE_AIDA
+#ifdef G4ANALYSIS_USE
   std::vector<AIDA::IHistogram1D*> histo;
   std::vector<AIDA::ITuple*>   ntup;
+  AIDA::IAnalysisFactory* aida;
   AIDA::ITree*    tree;
 #endif
Index: trunk/examples/extended/radioactivedecay/exrdm/macros/f24.mac
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/macros/f24.mac	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/macros/f24.mac	(revision 1230)
@@ -33,10 +33,10 @@
 #
 # complete chain decays
-/histo/fileName f24c.aida
+/histo/fileName f24c
 /run/beamOn 1000
 #
 # complete chain decays in VR mode
 /grdm/analogueMC 0
-/histo/fileName f24c-b.aida
+/histo/fileName f24c-b
 /run/beamOn 1000
 #
Index: trunk/examples/extended/radioactivedecay/exrdm/macros/neutron-10ev.mac
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/macros/neutron-10ev.mac	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/macros/neutron-10ev.mac	(revision 1230)
@@ -1,5 +1,4 @@
 #################################################################################
 #                                                                              	#
-
 # THIS TEST TO DEMONSTRATE THAT ISOTOPES GENERATED IN HADRONIC                  #
 # PROCESSES CAN BE TREATED BY THE RDM.					        # 
@@ -8,10 +7,12 @@
 #
 #
-/exrdm/phys/SelectPhysics Hadron
 /geometry/material/add NaI Na-I 3.67
 /exrdm/det/setTargetMate NaI
+
 # material definitions has to be done before /run/initilalize
 /histo/fileName neutron-10ev
+/exrdm/phys/SelectPhysics Hadron
 /run/initialize
+
 /run/setCutForRegion Target 10 cm
 /run/setCutForRegion Detector 50 cm
@@ -24,6 +25,2 @@
 /gps/energy 10 eV
 /run/beamOn 1000
-
-
-
-
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmAnalysisManager.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmAnalysisManager.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmAnalysisManager.cc	(revision 1230)
@@ -46,4 +46,9 @@
   return fManager;
 }
+void exrdmAnalysisManager::dispose()
+{
+  delete fManager;
+  fManager = 0;
+}
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -58,14 +63,20 @@
   pulseWidth = 1.*microsecond;
   histo   = new exrdmHisto();
-#if defined G4ANALYSIS_USE_AIDA || defined G4ANALYSIS_USE_ROOT
-   bookHisto();
+  bookHisto();
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+exrdmAnalysisManager::~exrdmAnalysisManager()
+{
+#ifdef G4ANALYSIS_USE 
+#define HISTDELETE
 #endif
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-exrdmAnalysisManager::~exrdmAnalysisManager()
-{
-//  delete histo;
+#ifdef G4ANALYSIS_USE_ROOT
+#define HISTDELETE
+#endif
+#ifdef HISTDELETE
+  delete histo;
+#endif
 }
 
@@ -94,7 +105,7 @@
   // in aida these histos are indiced from 0-6
   //
-  histo->addTuple( "100", "Emitted Particles","float PID, Energy, Time, Weight" );
-  histo->addTuple( "200", "RadioIsotopes","float PID, Time, Weight" );
-  histo->addTuple( "300", "Energy Depositions","float Energy, Time, Weight" );
+  histo->addTuple( "1", "Emitted Particles","double PID, Energy, Time, Weight" );
+  histo->addTuple( "2", "RadioIsotopes","double PID, Time, Weight" );
+  histo->addTuple( "3", "Energy Depositions","double Energy, Time, Weight" );
 
 }
@@ -104,11 +115,6 @@
 void exrdmAnalysisManager::BeginOfRun()
 {
-#if defined G4ANALYSIS_USE_AIDA || G4ANALYSIS_USE_ROOT
   histo->book();
-#endif
-  if(verbose > 0) {
-    G4cout << "exrdmAnalysisManager: Histograms are booked and the run has been started"
-           << G4endl;
-  }
+  G4cout << "exrdmAnalysisManager: Histograms are booked and the run has been started" << G4endl;
 }
 
@@ -117,7 +123,5 @@
 void exrdmAnalysisManager::EndOfRun()
 {
-#if defined G4ANALYSIS_USE_AIDA || G4ANALYSIS_USE_ROOT
   histo->save();  
-#endif
 }
 
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmEventAction.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmEventAction.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmEventAction.cc	(revision 1230)
@@ -67,8 +67,9 @@
 void exrdmEventAction::EndOfEventAction(const G4Event* evt)
 {
-  G4int event_id       = evt->GetEventID();
   //analysis
   exrdmAnalysisManager::getInstance()->EndOfEvent();
   // visualisation
+#ifdef G4VIS_USE
+  G4int event_id       = evt->GetEventID();
   if (event_id < 100 && G4VVisManager::GetConcreteInstance()) {
     G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
@@ -85,4 +86,5 @@
     }
   }
+#endif
 }
 
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHisto.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHisto.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHisto.cc	(revision 1230)
@@ -24,12 +24,5 @@
 // ********************************************************************
 //
-
-#include "exrdmHisto.hh"
-#include "exrdmHistoMessenger.hh"
-#include "G4ParticleTable.hh"
-
-#include "G4Tokenizer.hh"
-
-#ifdef G4ANALYSIS_USE_AIDA
+#ifdef G4ANALYSIS_USE
 #include <AIDA/AIDA.h>
 #endif
@@ -47,18 +40,27 @@
 #include "TNtuple.h"
 #endif
+
+#include "exrdmHisto.hh"
+#include "exrdmHistoMessenger.hh"
+#include "G4ParticleTable.hh"
+
+#include "G4Tokenizer.hh"
+
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 exrdmHisto::exrdmHisto()
 {
-  verbose    = 0;
+  verbose    = 1;
   histName   = "exrdm";
-  histType   = "root";
+  histType   = "aida";
+  //histType   = "root";
   nHisto     = 0;
   nTuple     = 0;
   defaultAct = 1;
   //
-#ifdef G4ANALYSIS_USE_AIDA
-  histo.clear();
-  ntup.clear();
-#endif
+#ifdef G4ANALYSIS_USE
+  aida = 0;
+  tree = 0;
+#endif
+
 #ifdef G4ANALYSIS_USE_ROOT
   ROOThisto.clear();
@@ -67,4 +69,5 @@
   Rcol.clear();
 #endif
+
   active.clear();
   bins.clear();
@@ -78,5 +81,4 @@
   tupleList.clear();
   tupleListROOT.clear();
-  messenger  = 0;
 
   messenger = new exrdmHistoMessenger(this);
@@ -87,13 +89,20 @@
 exrdmHisto::~exrdmHisto()
 {
-#ifdef G4ANALYSIS_USE_AIDA
-  for(G4int i=0; i<nHisto; i++) {
-    if(histo[i]) delete histo[i];
-  }
-#endif
-#ifdef G4ANALYSIS_USE_ROOT
-  for(G4int i=0; i<nHisto; i++) {
-    if(ROOThisto[i]) delete ROOThisto[i];
-  }
+#ifdef G4ANALYSIS_USE
+  histo.clear();
+  ntup.clear();
+#endif
+#ifdef G4ANALYSIS_USE_ROOT
+  //FIXME : G.Barrand : the below is crashy.
+  //        In principle the TH are deleted
+  //        when doing the TFile::Close !
+  //         In fact the hfileROOT should 
+  //        be deleted in save(). And I am pretty
+  //        sure that the TApplication is not needed.
+  //
+  // removed by F.Lei
+  //  for(G4int i=0; i<nHisto; i++) {
+  //   if(ROOThisto[i]) delete ROOThisto[i];
+  // }
 #endif
   delete messenger;
@@ -104,45 +113,57 @@
 void exrdmHisto::book()
 {
+#ifdef G4ANALYSIS_USE
   G4cout << "### exrdmHisto books " << nHisto << " histograms " << G4endl; 
-#ifdef G4ANALYSIS_USE_AIDA
   // Creating the analysis factory
-  AIDA::IAnalysisFactory* af = AIDA_createAnalysisFactory();
+  aida = AIDA_createAnalysisFactory();
+  if(!aida) {
+    G4cout << "ERROR: can't get AIDA." << G4endl; 
+    return;
+  }
   // Creating the tree factory
-  AIDA::ITreeFactory* tf = af->createTreeFactory(); 
+ {AIDA::ITreeFactory* tf = aida->createTreeFactory(); 
   // Creating a tree mapped to a new aida file.
-  G4String aidaFileName;
-  if (fileType == "hbook")
-    aidaFileName = histName +G4String(".hbook");
-  else
-    aidaFileName = histName +G4String(".aida");
-  tree = tf->create(aidaFileName,histType,false,true,"uncompress");
-  if(tree) 
-    G4cout << "Tree store  : " << tree->storeName() << G4endl;
-  else
-    G4cout << "ERROR: Tree store " << histName  << " is not created!" << G4endl;
-
+  G4String fileName = histName + "." + histType;
+  if (histType == "root") fileName = histName + "_aida." + histType;
+  tree = tf->create(fileName,histType,false,true,"compress=yes");
+  delete tf;
+  if(!tree) { 
+    G4cout << "ERROR: Tree store " << histName  << " is not created!" << G4endl; 
+    return;
+  }
+  G4cout << "Tree store  : " << tree->storeName() << G4endl;}
   // Creating a histogram factory, whose histograms will be handled by the tree
-  AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
+ {AIDA::IHistogramFactory* hf = aida->createHistogramFactory(*tree);
   // Creating an 1-dimensional histograms in the root directory of the tree
   for(G4int i=0; i<nHisto; i++) {
     if(active[i]) {
-      histo[i] = hf->createHistogram1D(ids[i], titles[i], bins[i], xmin[i], xmax[i]);
+      if(verbose>1)
+        G4cout<<"book: histogram "<< i << " id= " << ids[i] <<G4endl;
+      G4String tit = ids[i];
+      if(histType == "root") tit = "h" + ids[i];
+      histo[i] = hf->createHistogram1D(tit, titles[i], bins[i], xmin[i], xmax[i]);
     }
   }
+  delete hf;
+  G4cout << "AIDA histograms are booked" << G4endl;}
+
   // Creating a tuple factory, whose tuples will be handled by the tree  
-  AIDA::ITupleFactory* tpf =  af->createTupleFactory( *tree );
+ {AIDA::ITupleFactory* tpf =  aida->createTupleFactory( *tree );
+  G4cout << "AIDA will book " << nTuple << " ntuples" << G4endl;
   for(G4int i=0; i<nTuple; i++) {
     if(tupleList[i] != "") {
-      G4cout << "Creating Ntuple: " << tupleName[i] << G4endl;
-      ntup[i] = tpf->create(tupleId[i], tupleName[i], tupleList[i]);
+      G4cout << "Creating Ntuple: " << tupleName[i] <<":" <<tupleList[i] <<G4endl;
+      ntup[i] = tpf->create(tupleId[i], tupleName[i], tupleList[i],"");
     }
   }
-#endif
-
-#ifdef G4ANALYSIS_USE_ROOT
-  new TApplication("App", ((int *)0), ((char **)0));
+  delete tpf;
+  G4cout << "AIDA ntuples are booked" << G4endl;}
+#endif
+
+#ifdef G4ANALYSIS_USE_ROOT
+//  new TApplication("App", ((int *)0), ((char **)0));
   G4String fileNameROOT = histName + G4String(".root");
   hfileROOT = new TFile(fileNameROOT.c_str() ,"RECREATE","ROOT file for exRDM");
-  
+  G4cout << "Root file: " << fileNameROOT << G4endl;
   // Creating an 1-dimensional histograms in the root directory of the tree
   for(G4int i=0; i<nHisto; i++) {
@@ -157,6 +178,8 @@
     if(tupleListROOT[i] != "") {
       G4String id = G4String("t")+tupleId[i];
-      G4cout << "Creating Ntuple "<<tupleId[i] << " in ROOT file: " << tupleName[i] << G4endl;
+      G4cout << "Creating Ntuple "<<tupleId[i] << " in ROOT file: " 
+	     << tupleName[i] << G4endl;
       ROOTntup[i] = new TNtuple(id, tupleName[i], tupleListROOT[i]);
+      G4cout << "ROOT Ntuple " << id << " " << tupleName[i] <<" "<< tupleListROOT[i]<< " booked " << G4endl;
     }
   }
@@ -169,5 +192,5 @@
 void exrdmHisto::save()
 {
-#ifdef G4ANALYSIS_USE_AIDA
+#ifdef G4ANALYSIS_USE
   // Write histogram file
   tree->commit();
@@ -175,4 +198,10 @@
   tree->close();
   G4cout << "Histograms and Ntuples are saved" << G4endl;
+  delete tree;
+  tree = 0;
+  delete aida;
+  aida = 0;
+  {for(G4int i=0; i<nHisto; i++) histo[i] = 0;}
+  {for(G4int i=0; i<nTuple; i++) ntup[i] = 0;}
 #endif
 #ifdef G4ANALYSIS_USE_ROOT
@@ -181,4 +210,8 @@
   G4cout << "ROOT: files closing..." << G4endl;
   hfileROOT->Close();
+  //
+  // F.Lei added following Guy's suggestion!
+  delete hfileROOT;
+
 #endif
 }
@@ -205,5 +238,5 @@
   ids.push_back(id);
   titles.push_back(name);
-#ifdef G4ANALYSIS_USE_AIDA
+#ifdef G4ANALYSIS_USE
   histo.push_back(0);
 #endif
@@ -241,7 +274,7 @@
            << G4endl;   
   }
-#ifdef G4ANALYSIS_USE_AIDA  
+#ifdef G4ANALYSIS_USE
   if(i>=0 && i<nHisto) {
-    histo[i]->fill((float)(x/unit[i]), (float)w);
+    histo[i]->fill(x/unit[i], w);
   } else {
     G4cout << "exrdmHisto::fill: WARNING! wrong AIDA histogram index " << i << G4endl;
@@ -264,5 +297,5 @@
     G4cout << "Scale histogram: #" << i << " by factor " << x << G4endl;   
   }
-#ifdef G4ANALYSIS_USE_AIDA  
+#ifdef G4ANALYSIS_USE
   if(i>=0 && i<nHisto) {
     histo[i]->scale(x);
@@ -281,16 +314,25 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
-void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3)
-{
-//  G4cout << w1 << " " << w2 << " " << w3 << G4endl;
+#ifdef G4ANALYSIS_USE
+void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3 )
+#else
+void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& )
+#endif
+
+{
+  //G4cout << w1 << " " << w2 << " " << w3 << G4endl;
+  nTuple++;
+  tupleId.push_back(w1);
+  tupleName.push_back(w2) ;
+#ifdef G4ANALYSIS_USE
+  tupleList.push_back(w3);
+  ntup.push_back(0);
+#endif
+
+#ifdef G4ANALYSIS_USE_ROOT
   std::vector<float> ar;
   ar.clear();
   for (size_t i = 0; i < 20; i++) ar.push_back(0.);
-  nTuple++;
-#ifdef G4ANALYSIS_USE_ROOT
   Rarray.push_back(ar);
-#endif
-  tupleId.push_back(w1);
-  tupleName.push_back(w2) ;
   // convert AIDA header to ROOT header for ntuple
   G4Tokenizer next(w3);
@@ -300,5 +342,7 @@
   while ( token != "") {
    token = next();
-   ROOTList1 = ROOTList1 + token +G4String(":");
+   if (token == ",") token = next();
+   if (token.contains(",")) token.remove(token.size()-1);
+   ROOTList1 = ROOTList1 + token + G4String(":");
    col++;
   }
@@ -306,9 +350,4 @@
 //  G4cout << ROOTList << G4endl;
   tupleListROOT.push_back(ROOTList);
-  //
-#ifdef G4ANALYSIS_USE_AIDA  
-  ntup.push_back(0);
-#endif
-#ifdef G4ANALYSIS_USE_ROOT
   ROOTntup.push_back(0);
   Rcol.push_back(col-1);
@@ -323,6 +362,6 @@
     G4cout << "fill tuple # " << i 
 	   <<" with  parameter <" << parname << "> = " << x << G4endl; 
-#ifdef G4ANALYSIS_USE_AIDA  
-  if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), (float)x);
+#ifdef G4ANALYSIS_USE
+  if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), x);
 #endif
 }
@@ -336,6 +375,6 @@
 	   <<" in column < " << col << "> = " << x << G4endl; 
   }
-#ifdef G4ANALYSIS_USE_AIDA  
-  if(ntup[i]) ntup[i]->fill(col, (float)x);
+#ifdef G4ANALYSIS_USE
+  if(ntup[i]) ntup[i]->fill(col,double(x));
 #endif
 
@@ -348,5 +387,5 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
-void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4String x)
+void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4String& x)
 {
   if(verbose > 1) {
@@ -354,7 +393,8 @@
 	   <<" with  parameter <" << parname << "> = " << x << G4endl; 
   }
-#ifdef G4ANALYSIS_USE_AIDA  
+#ifdef G4ANALYSIS_USE
   if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), x);
 #endif
+
 }
 
@@ -363,5 +403,6 @@
 void exrdmHisto::addRow(G4int i)
 {
-#ifdef G4ANALYSIS_USE_AIDA
+  if(verbose > 1) G4cout << "Added a raw #" << i << " to tuple" << G4endl; 
+#ifdef G4ANALYSIS_USE
   if(ntup[i]) ntup[i]->addRow();
 #endif
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHistoMessenger.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHistoMessenger.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmHistoMessenger.cc	(revision 1230)
@@ -49,5 +49,5 @@
 
   fileCmd = new G4UIcmdWithAString("/histo/fileType",this);
-  fileCmd->SetGuidance("set type (hbook, XML) for the histograms file");
+  fileCmd->SetGuidance("set type (aida, hbook or root) for the histograms file");
   fileCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 
 
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterial.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterial.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterial.cc	(revision 1230)
@@ -115,5 +115,5 @@
 
   G4Material* aMaterial = 0;
-  //  G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" " <<pres << G4endl;
+  G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" " <<pres << G4endl;
  
   if (state == "") {
@@ -237,11 +237,11 @@
       } else {
         if (natoms>0) { 
-	  aMaterial->AddElement( G4Element::GetElement(isotopename) , natoms);
+	  aMaterial->AddElement( G4Element::GetElement(isotopename,false) , natoms);
 	} else {
-	  aMaterial->AddElement( G4Element::GetElement(isotopename) , fatoms);
+	  aMaterial->AddElement( G4Element::GetElement(isotopename,false) , fatoms);
 	}
       }      
     } else {
-      if ( G4Element::GetElement(element) == NULL) {
+      if ( G4Element::GetElement(element,false) == NULL) {
         G4Element* aElement = new G4Element(element, element, Z, A[Z-1]*g/mole);
 	if (natoms>0) { 
@@ -253,7 +253,7 @@
       } else {
 	if (natoms>0) { 
-	  aMaterial->AddElement( G4Element::GetElement(element) , natoms);
+	  aMaterial->AddElement( G4Element::GetElement(element,false) , natoms);
 	} else {
-	  aMaterial->AddElement( G4Element::GetElement(element) , fatoms);
+	  aMaterial->AddElement( G4Element::GetElement(element,false) , fatoms);
 	} 
       }
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterialMessenger.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterialMessenger.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmMaterialMessenger.cc	(revision 1230)
@@ -130,5 +130,5 @@
     //    G4cout<< "stat = " <<state<< "tem = " << tem<< " pre = " << pres << G4endl;
     //     tick *= G4UIcommand::ValueOf(unt);
-    materialsManager->AddMaterial(material,formula,den,state,tem,pres);
+    materialsManager->AddMaterial(material,formula,den*g/cm3,state,tem,pres);
   }
 }
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysListHadron.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysListHadron.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysListHadron.cc	(revision 1230)
@@ -253,4 +253,5 @@
   theAlphaInelasticProcess->RegisterMe(theTheoModel);
   pManager->AddDiscreteProcess(theAlphaInelasticProcess);
+
   // GenericIon
   pManager = G4GenericIon::GenericIon()->GetProcessManager();
@@ -266,11 +267,4 @@
   theIonInelasticProcess->RegisterMe(theIonBC);
   theIonInelasticProcess->RegisterMe(theTheoModel);
-  pManager->AddDiscreteProcess(theIonInelasticProcess);
-
-  // Add RadioactiveDecay Process
-
-  G4RadioactiveDecay*  theRadioactiveDecay = new G4RadioactiveDecay();
-  G4GenericIon* ion = G4GenericIon::GenericIon();
-  pManager->AddProcess(theRadioactiveDecay, 0, -1, 3);
- 
+  pManager->AddDiscreteProcess(theIonInelasticProcess); 
 }
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysicsList.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmPhysicsList.cc	(revision 1230)
@@ -75,5 +75,5 @@
   pMessenger = new exrdmPhysicsListMessenger(this);
 
-  SetVerboseLevel(2);
+  SetVerboseLevel(1);
 
   //default physics
@@ -87,5 +87,5 @@
   
   // Had physics 
-  hadPhysicsList = new exrdmPhysListHadron("hadron");
+  hadPhysicsList = 0;
   nhadcomp = 0;
 
@@ -131,4 +131,6 @@
   }
   if (hadPhysicsList) hadPhysicsList->ConstructProcess();
+  G4cout << "### exrdmPhysicsList::ConstructProcess is done" << G4endl;
+
 }
 
@@ -141,33 +143,24 @@
   }
   // default  Had physics
-  if (name == "Hadron" && nhadcomp == 0) {
-    if (hadPhysicsList) delete hadPhysicsList;
+  if (name == "Hadron" && !hadPhysicsList) {
     hadPhysicsList = new exrdmPhysListHadron("hadron");
   } else if (name == "QGSP_BERT") {
     AddExtraBuilders(false);
     hadPhysicsList = new HadronPhysicsQGSP_BERT("std-hadron");
-  } else if (name == "QGSP_BIC" && nhadcomp == 0) {
+  } else if (name == "QGSP_BIC" && !hadPhysicsList) {
     AddExtraBuilders(false);
     hadPhysicsList = new HadronPhysicsQGSP_BIC("std-hadron");
-  } else if (name == "QGSP_BERT_HP"  && nhadcomp == 0) {
+  } else if (name == "QGSP_BERT_HP"  && !hadPhysicsList) {
     AddExtraBuilders(true);
     hadPhysicsList = new HadronPhysicsQGSP_BERT_HP("std-hadron");
-  } else if (name == "QGSP_BIC_HP"  && nhadcomp == 0) {
+  } else if (name == "QGSP_BIC_HP"  && !hadPhysicsList) {
     AddExtraBuilders(true);
     hadPhysicsList = new HadronPhysicsQGSP_BIC_HP("std-hadron");
   } else if (name == "LowEnergy_EM") {
-    if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) { 
-      if (emPhysicsList) delete emPhysicsList;
+      delete emPhysicsList;
       emPhysicsList = new exrdmPhysListEmLowEnergy("lowe-em");
-    } else {
-      G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl;
-    }     
   } else if (name == "Standard_EM") {
-    if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) { 
-      if (emPhysicsList) delete emPhysicsList;
+      delete emPhysicsList;
       emPhysicsList = new G4EmStandardPhysics();
-    } else {
-      G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl;
-    }
   } else {
       G4cout << "exrdmPhysicsList WARNING wrong or unkonwn <" 
@@ -180,13 +173,5 @@
 void exrdmPhysicsList::AddExtraBuilders(G4bool flagHP)
 {
-  if (emPhysicsList) delete emPhysicsList;
-  emPhysicsList = new G4EmStandardPhysics();
-
-  if (hadPhysicsList) {
-    delete hadPhysicsList;
-    hadPhysicsList = 0;
-  }
-  nhadcomp = 6;
-
+  nhadcomp = 5;
   hadronPhys.push_back( new G4EmExtraPhysics("extra EM"));
   hadronPhys.push_back( new G4HadronElasticPhysics("elastic",verboseLevel,
@@ -194,5 +179,4 @@
   hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
   hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC"));
-  hadronPhys.push_back( new G4RadioactiveDecayPhysics("radioactiveDecay"));
   hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
 }
@@ -202,5 +186,4 @@
 void exrdmPhysicsList::SetCuts()
 {
-
   SetCutValue(cutForGamma, "gamma");
   SetCutValue(cutForElectron, "e-");
@@ -226,4 +209,5 @@
 {
   cutForGamma = cut;
+  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
 }
 
@@ -233,4 +217,5 @@
 {
   cutForElectron = cut;
+  SetParticleCuts(cutForElectron, G4Electron::Electron());
 }
 
@@ -240,4 +225,5 @@
 {
   cutForPositron = cut;
+  SetParticleCuts(cutForPositron, G4Positron::Positron());
 }
 
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmRunAction.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmRunAction.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmRunAction.cc	(revision 1230)
@@ -58,4 +58,5 @@
     G4cout << "### Run : " << RunN << G4endl;
 
+#ifdef G4VIS_USE
   if (G4VVisManager::GetConcreteInstance())
     {
@@ -64,4 +65,5 @@
       UI->ApplyCommand("/vis/draw/current");
     } 
+#endif
 }
 
@@ -74,6 +76,8 @@
   analysis->EndOfRun();
  
+#ifdef G4VIS_USE
   if (G4VVisManager::GetConcreteInstance())
     G4UImanager::GetUIpointer()->ApplyCommand("/vis/show/view");
+#endif
 }
 
Index: trunk/examples/extended/radioactivedecay/exrdm/src/exrdmSteppingAction.cc
===================================================================
--- trunk/examples/extended/radioactivedecay/exrdm/src/exrdmSteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/radioactivedecay/exrdm/src/exrdmSteppingAction.cc	(revision 1230)
@@ -46,8 +46,18 @@
 void exrdmSteppingAction::UserSteppingAction(const G4Step* fStep) 
 {
-#ifdef G4ANALYSIS_USE
   G4Track* fTrack = fStep->GetTrack();
   G4int StepNo = fTrack->GetCurrentStepNumber();
   if(StepNo >= 10000) fTrack->SetTrackStatus(fStopAndKill);
+
+#ifdef G4ANALYSIS_USE 
+#define COLLECT
+#endif
+#ifdef G4ANALYSIS_USE_ROOT
+#ifndef COLLECT
+#define COLLECT
+#endif
+#endif
+
+#ifdef COLLECT
   if (StepNo == 1) {
     if ( (fTrack->GetDefinition()->GetParticleType() == "nucleus") && 
@@ -80,7 +90,7 @@
     }
   }
-  // energy deposition: collect energy deposited by decay products only
+  // energy deposition
   if (fTrack->GetTrackID() != 1 ) {
-    if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") {	
+    //    if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") {	
       if (fStep->GetTotalEnergyDeposit() ) {
 	G4double time = fStep->GetPreStepPoint()->GetGlobalTime() ;
@@ -92,7 +102,7 @@
 	exrdmAnalysisManager::getInstance()->AddEnergy(edep,weight,time);
       }
-    }
+      //    }
   }
-#endif  
+#endif 
 }
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Index: trunk/examples/extended/runAndEvent/RE01/RE01.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/RE01.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/RE01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01.cc,v 1.3 2006/06/29 17:42:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01BosonPhysics.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01BosonPhysics.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01BosonPhysics.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01BosonPhysics.hh,v 1.2 2006/06/29 17:42:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterHit.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterHit.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterHit.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01CalorimeterHit.hh,v 1.3 2006/06/29 17:42:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterParametrisation.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterParametrisation.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterParametrisation.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01CalorimeterParametrisation.hh,v 1.2 2006/06/29 17:42:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterROGeometry.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterROGeometry.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterROGeometry.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01CalorimeterROGeometry.hh,v 1.2 2006/06/29 17:42:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterSD.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterSD.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01CalorimeterSD.hh,v 1.2 2006/06/29 17:42:35 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01DecayPhysics.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01DecayPhysics.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01DecayPhysics.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01DecayPhysics.hh,v 1.2 2006/06/29 17:42:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01DetectorConstruction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01DetectorConstruction.hh,v 1.2 2006/06/29 17:42:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01DetectorParameterDef.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01DetectorParameterDef.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01DetectorParameterDef.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01DetectorParameterDef.hh,v 1.2 2006/06/29 17:42:41 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01DummySD.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01DummySD.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01DummySD.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01DummySD.hh,v 1.2 2006/06/29 17:42:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01EventAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01EventAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01EventAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01EventAction.hh,v 1.2 2006/06/29 17:42:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01Field.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01Field.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01Field.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01Field.hh,v 1.2 2006/06/29 17:42:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01HadronPhysics.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01HadronPhysics.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01HadronPhysics.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01HadronPhysics.hh,v 1.2 2006/06/29 17:42:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01IonPhysics.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01IonPhysics.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01IonPhysics.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01IonPhysics.hh,v 1.2 2006/06/29 17:42:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01LeptonPhysics.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01LeptonPhysics.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01LeptonPhysics.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01LeptonPhysics.hh,v 1.2 2006/06/29 17:42:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01PhysicsList.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01PhysicsList.hh,v 1.2 2006/06/29 17:43:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01PrimaryGeneratorAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01PrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:43:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01PrimaryGeneratorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01PrimaryGeneratorMessenger.hh,v 1.2 2006/06/29 17:43:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01RegionInformation.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01RegionInformation.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01RegionInformation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01RegionInformation.hh,v 1.2 2006/06/29 17:43:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01RunAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01RunAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01RunAction.hh,v 1.2 2006/06/29 17:43:11 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01StackingAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01StackingAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01StackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01StackingAction.hh,v 1.2 2006/06/29 17:43:14 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01SteppingAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01SteppingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01SteppingAction.hh,v 1.2 2006/06/29 17:43:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01TrackInformation.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01TrackInformation.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01TrackInformation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01TrackInformation.hh,v 1.2 2006/06/29 17:43:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerHit.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerHit.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerHit.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackerHit.hh,v 1.3 2006/06/29 17:43:21 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerParametrisation.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerParametrisation.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerParametrisation.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackerParametrisation.hh,v 1.2 2006/06/29 17:43:24 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerSD.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerSD.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01TrackerSD.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackerSD.hh,v 1.2 2006/06/29 17:43:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01TrackingAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01TrackingAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01TrackingAction.hh	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackingAction.hh,v 1.2 2006/06/29 17:43:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/include/RE01Trajectory.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/include/RE01Trajectory.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/include/RE01Trajectory.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01Trajectory.hh,v 1.3 2006/06/29 17:43:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01BosonPhysics.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01BosonPhysics.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01BosonPhysics.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01BosonPhysics.cc,v 1.2 2006/06/29 17:43:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterHit.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterHit.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01CalorimeterHit.cc,v 1.5 2006/11/14 07:07:38 perl Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterParametrisation.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterParametrisation.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterParametrisation.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01CalorimeterParametrisation.cc,v 1.2 2006/06/29 17:43:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterROGeometry.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterROGeometry.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterROGeometry.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01CalorimeterROGeometry.cc,v 1.2 2006/06/29 17:43:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterSD.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01CalorimeterSD.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01CalorimeterSD.cc,v 1.3 2006/11/18 02:42:27 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01DecayPhysics.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01DecayPhysics.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01DecayPhysics.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01DecayPhysics.cc,v 1.2 2006/06/29 17:43:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01DetectorConstruction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01DetectorConstruction.cc,v 1.3 2006/06/29 17:43:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01DetectorParameterDef.icc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01DetectorParameterDef.icc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01DetectorParameterDef.icc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01DetectorParameterDef.icc,v 1.2 2006/06/29 17:43:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01DummySD.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01DummySD.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01DummySD.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01DummySD.cc,v 1.2 2006/06/29 17:43:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01EventAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01EventAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01EventAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01EventAction.cc,v 1.2 2006/06/29 17:43:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01Field.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01Field.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01Field.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01Field.cc,v 1.3 2006/06/29 17:43:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01HadronPhysics.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01HadronPhysics.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01HadronPhysics.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01HadronPhysics.cc,v 1.2 2006/06/29 17:44:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01IonPhysics.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01IonPhysics.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01IonPhysics.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01IonPhysics.cc,v 1.2 2006/06/29 17:44:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01LeptonPhysics.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01LeptonPhysics.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01LeptonPhysics.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01LeptonPhysics.cc,v 1.2 2006/06/29 17:44:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01PhysicsList.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01PhysicsList.cc,v 1.2 2006/06/29 17:44:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01PrimaryGeneratorAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01PrimaryGeneratorAction.cc,v 1.2 2006/06/29 17:44:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01PrimaryGeneratorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01PrimaryGeneratorMessenger.cc,v 1.2 2006/06/29 17:44:12 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01RegionInformation.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01RegionInformation.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01RegionInformation.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01RegionInformation.cc,v 1.2 2006/06/29 17:44:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01RunAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01RunAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01RunAction.cc,v 1.2 2006/06/29 17:44:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01StackingAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01StackingAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01StackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01StackingAction.cc,v 1.2 2006/06/29 17:44:20 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01SteppingAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01SteppingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01SteppingAction.cc,v 1.2 2006/06/29 17:44:23 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01TrackInformation.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01TrackInformation.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01TrackInformation.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01TrackInformation.cc,v 1.2 2006/06/29 17:44:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerHit.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerHit.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerHit.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackerHit.cc,v 1.5 2006/11/14 07:07:38 perl Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerParametrisation.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerParametrisation.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerParametrisation.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackerParametrisation.cc,v 1.2 2006/06/29 17:44:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerSD.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerSD.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01TrackerSD.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackerSD.cc,v 1.2 2006/06/29 17:44:32 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01TrackingAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01TrackingAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01TrackingAction.cc	(revision 1230)
@@ -25,5 +25,5 @@
 //
 // $Id: RE01TrackingAction.cc,v 1.2 2006/06/29 17:44:34 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE01/src/RE01Trajectory.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE01/src/RE01Trajectory.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE01/src/RE01Trajectory.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE01Trajectory.cc,v 1.3 2006/06/29 17:44:37 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/exampleRE02.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/exampleRE02.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/exampleRE02.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: exampleRE02.cc,v 1.3 2006/11/18 01:37:22 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -41,6 +41,4 @@
 #include "G4UIterminal.hh"
 #include "G4UItcsh.hh"
-#include "G4UIQt.hh"
-#include "G4Qt.hh"
 
 #ifdef G4VIS_USE
@@ -96,7 +94,4 @@
 #ifdef G4UI_USE_TCSH
       session = new G4UIterminal(new G4UItcsh);      
-#elif defined(G4UI_USE_QT)
-      session = new G4UIQt(argc,argv);
-      //      UI->ApplyCommand("/control/execute visTutor/gui.mac");      
 #else
       session = new G4UIterminal();
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02DetectorConstruction.hh,v 1.3 2006/11/18 01:37:23 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02EventAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02EventAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02EventAction.hh,v 1.3 2006/11/18 01:37:23 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
  
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02NestedPhantomParameterisation.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02NestedPhantomParameterisation.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02NestedPhantomParameterisation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02NestedPhantomParameterisation.hh,v 1.2 2006/12/13 15:42:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // class G4VNestedParameterisation
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02PSCellFlux.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02PSCellFlux.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02PSCellFlux.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSCellFlux.hh,v 1.2 2006/12/13 15:42:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02PSEnergyDeposit.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02PSEnergyDeposit.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02PSEnergyDeposit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSEnergyDeposit.hh,v 1.2 2006/12/13 15:42:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02PSFlatSurfaceCurrent.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02PSFlatSurfaceCurrent.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02PSFlatSurfaceCurrent.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSFlatSurfaceCurrent.hh,v 1.2 2006/12/13 15:42:52 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02PSFlatSurfaceFlux.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02PSFlatSurfaceFlux.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02PSFlatSurfaceFlux.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSFlatSurfaceFlux.hh,v 1.2 2006/12/13 15:42:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02PSNofStep.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02PSNofStep.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02PSNofStep.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSNofStep.hh,v 1.2 2006/12/13 15:42:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02PSPassageCellFlux.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02PSPassageCellFlux.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02PSPassageCellFlux.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSPassageCellFlux.hh,v 1.2 2006/12/13 15:43:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PrimaryGeneratorAction.hh,v 1.3 2006/11/18 01:37:23 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
  
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02Run.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02Run.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02Run.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02Run.hh,v 1.3 2006/11/18 01:37:23 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //---------------------------------------------------------------------
Index: trunk/examples/extended/runAndEvent/RE02/include/RE02RunAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/include/RE02RunAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/include/RE02RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02RunAction.hh,v 1.3 2006/11/18 01:37:23 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02DetectorConstruction.cc,v 1.3 2006/11/18 01:37:23 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
  
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02EventAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02EventAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02EventAction.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
  
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02PSCellFlux.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02PSCellFlux.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02PSCellFlux.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSCellFlux.cc,v 1.3 2007/05/18 18:16:28 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // RE02PSCellFlux
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02PSEnergyDeposit.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02PSEnergyDeposit.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02PSEnergyDeposit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSEnergyDeposit.cc,v 1.3 2007/05/18 18:16:28 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // RE02PSEnergyDeposit
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02PSFlatSurfaceCurrent.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02PSFlatSurfaceCurrent.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02PSFlatSurfaceCurrent.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSFlatSurfaceCurrent.cc,v 1.3 2007/05/18 18:16:28 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // RE02PSFlatSurfaceCurrent
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02PSFlatSurfaceFlux.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02PSFlatSurfaceFlux.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02PSFlatSurfaceFlux.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSFlatSurfaceFlux.cc,v 1.3 2007/05/18 18:16:28 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // RE02PSFlatSurfaceFlux
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02PSNofStep.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02PSNofStep.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02PSNofStep.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSNofStep.cc,v 1.3 2007/05/18 18:16:28 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // RE02PSNofStep
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02PSPassageCellFlux.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02PSPassageCellFlux.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02PSPassageCellFlux.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PSPassageCellFlux.cc,v 1.3 2007/05/18 18:16:28 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // RE02PSPassageCellFlux
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02PrimaryGeneratorAction.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02Run.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02Run.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02Run.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02Run.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE02/src/RE02RunAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/src/RE02RunAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/src/RE02RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE02RunAction.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 #include "RE02RunAction.hh"
Index: trunk/examples/extended/runAndEvent/RE02/vis.mac
===================================================================
--- trunk/examples/extended/runAndEvent/RE02/vis.mac	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE02/vis.mac	(revision 1230)
@@ -17,5 +17,5 @@
 #
 #/vis/open VRML2FILE
-/vis/open OGLSQt
+/vis/open OGLIX
 #/vis/open DAWNFILE
 #/vis/open DAWN
Index: trunk/examples/extended/runAndEvent/RE03/RE03.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE03/RE03.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE03/RE03.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE03.cc,v 1.4 2007/11/17 01:26:01 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/runAndEvent/RE03/include/RE03DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE03/include/RE03DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE03/include/RE03DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE03DetectorConstruction.hh,v 1.1 2007/11/13 19:55:43 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/runAndEvent/RE03/include/RE03PhysicsList.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE03/include/RE03PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE03/include/RE03PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE03PhysicsList.hh,v 1.1 2007/11/13 19:55:43 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/runAndEvent/RE03/include/RE03PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/runAndEvent/RE03/include/RE03PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE03/include/RE03PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE03PrimaryGeneratorAction.hh,v 1.1 2007/11/13 19:55:43 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/runAndEvent/RE03/src/RE03DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE03/src/RE03DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE03/src/RE03DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE03DetectorConstruction.cc,v 1.1 2007/11/13 19:55:43 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/runAndEvent/RE03/src/RE03PhysicsList.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE03/src/RE03PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE03/src/RE03PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE03PhysicsList.cc,v 1.1 2007/11/13 19:55:43 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/runAndEvent/RE03/src/RE03PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/runAndEvent/RE03/src/RE03PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/runAndEvent/RE03/src/RE03PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: RE03PrimaryGeneratorAction.cc,v 1.1 2007/11/13 19:55:43 asaim Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 
Index: trunk/examples/extended/visualization/perspective/include/PerspectiveVisAction.hh
===================================================================
--- trunk/examples/extended/visualization/perspective/include/PerspectiveVisAction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/perspective/include/PerspectiveVisAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PerspectiveVisAction.hh,v 1.2 2006/06/29 17:45:43 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef PERSPECTIVEVISACTION_HH
Index: trunk/examples/extended/visualization/perspective/include/PerspectiveVisActionMessenger.hh
===================================================================
--- trunk/examples/extended/visualization/perspective/include/PerspectiveVisActionMessenger.hh	(revision 1187)
+++ trunk/examples/extended/visualization/perspective/include/PerspectiveVisActionMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PerspectiveVisActionMessenger.hh,v 1.2 2006/06/29 17:45:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef PERSPECTIVEVISACTIONMESSENGER_HH
Index: trunk/examples/extended/visualization/perspective/perspective.cc
===================================================================
--- trunk/examples/extended/visualization/perspective/perspective.cc	(revision 1187)
+++ trunk/examples/extended/visualization/perspective/perspective.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: perspective.cc,v 1.2 2006/06/29 17:45:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #include "globals.hh"
Index: trunk/examples/extended/visualization/perspective/src/PerspectiveVisAction.cc
===================================================================
--- trunk/examples/extended/visualization/perspective/src/PerspectiveVisAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/perspective/src/PerspectiveVisAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PerspectiveVisAction.cc,v 1.2 2006/06/29 17:45:48 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #include "PerspectiveVisAction.hh"
Index: trunk/examples/extended/visualization/perspective/src/PerspectiveVisActionMessenger.cc
===================================================================
--- trunk/examples/extended/visualization/perspective/src/PerspectiveVisActionMessenger.cc	(revision 1187)
+++ trunk/examples/extended/visualization/perspective/src/PerspectiveVisActionMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: PerspectiveVisActionMessenger.cc,v 1.3 2006/11/06 20:07:36 allison Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #include "PerspectiveVisActionMessenger.hh"
Index: trunk/examples/extended/visualization/standalone/include/StandaloneVisAction.hh
===================================================================
--- trunk/examples/extended/visualization/standalone/include/StandaloneVisAction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/standalone/include/StandaloneVisAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: StandaloneVisAction.hh,v 1.2 2006/06/29 17:45:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef STANDALONEVISACTION_HH
Index: trunk/examples/extended/visualization/standalone/src/StandaloneVisAction.cc
===================================================================
--- trunk/examples/extended/visualization/standalone/src/StandaloneVisAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/standalone/src/StandaloneVisAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: StandaloneVisAction.cc,v 1.2 2006/06/29 17:45:58 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #include "StandaloneVisAction.hh"
Index: trunk/examples/extended/visualization/standalone/standalone.cc
===================================================================
--- trunk/examples/extended/visualization/standalone/standalone.cc	(revision 1187)
+++ trunk/examples/extended/visualization/standalone/standalone.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: standalone.cc,v 1.2 2006/06/29 17:45:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #include "globals.hh"
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_ChamberParameterisation.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_ChamberParameterisation.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_ChamberParameterisation.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_ChamberParameterisation.hh,v 1.2 2006/06/29 17:46:02 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_DetectorConstruction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_DetectorConstruction.hh,v 1.2 2006/06/29 17:46:04 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_DetectorMessenger.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_DetectorMessenger.hh,v 1.2 2006/06/29 17:46:07 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_EventAction.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_EventAction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_EventAction.hh,v 1.2 2006/06/29 17:46:10 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_MagneticField.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_MagneticField.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_MagneticField.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_MagneticField.hh,v 1.2 2006/06/29 17:46:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_PhysicsList.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_PhysicsList.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_PhysicsList.hh,v 1.2 2006/06/29 17:46:16 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_PrimaryGeneratorAction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_PrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:46:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_RunAction.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_RunAction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_RunAction.hh,v 1.2 2006/06/29 17:46:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_SteppingAction.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_SteppingAction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_SteppingAction.hh,v 1.2 2006/06/29 17:46:24 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_SteppingVerbose.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_SteppingVerbose.hh,v 1.2 2006/06/29 17:46:26 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //   This class manages the verbose outputs in G4SteppingManager. 
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_TrackerHit.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_TrackerHit.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_TrackerHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_TrackerHit.hh,v 1.2 2006/06/29 17:46:28 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_TrackerSD.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_TrackerSD.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_TrackerSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_TrackerSD.hh,v 1.2 2006/06/29 17:46:30 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/include/UVA_VisAction.hh
===================================================================
--- trunk/examples/extended/visualization/userVisAction/include/UVA_VisAction.hh	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/include/UVA_VisAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_VisAction.hh,v 1.2 2006/06/29 17:46:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #ifndef UVA_VISACTION_HH
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_ChamberParameterisation.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_ChamberParameterisation.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_ChamberParameterisation.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_ChamberParameterisation.cc,v 1.2 2006/06/29 17:46:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_DetectorConstruction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_DetectorConstruction.cc,v 1.2 2006/06/29 17:46:39 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_DetectorMessenger.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_DetectorMessenger.cc,v 1.2 2006/06/29 17:46:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_EventAction.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_EventAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_EventAction.cc,v 1.2 2006/06/29 17:46:45 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_MagneticField.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_MagneticField.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_MagneticField.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_MagneticField.cc,v 1.2 2006/06/29 17:46:47 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //  
 //   User Field class implementation.
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_PhysicsList.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_PhysicsList.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_PhysicsList.cc,v 1.2 2006/06/29 17:46:50 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_PrimaryGeneratorAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_PrimaryGeneratorAction.cc,v 1.3 2006/11/06 20:11:51 allison Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_RunAction.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_RunAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_RunAction.cc,v 1.2 2006/06/29 17:46:54 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_SteppingAction.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_SteppingAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_SteppingAction.cc,v 1.2 2006/06/29 17:46:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 // 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_SteppingVerbose.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_SteppingVerbose.cc,v 1.2 2006/06/29 17:47:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_TrackerHit.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_TrackerHit.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_TrackerHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_TrackerHit.cc,v 1.2 2006/06/29 17:47:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_TrackerSD.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_TrackerSD.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_TrackerSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_TrackerSD.cc,v 1.2 2006/06/29 17:47:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/examples/extended/visualization/userVisAction/src/UVA_VisAction.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/src/UVA_VisAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/src/UVA_VisAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: UVA_VisAction.cc,v 1.3 2006/06/29 17:47:08 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 
 #include "UVA_VisAction.hh"
Index: trunk/examples/extended/visualization/userVisAction/userVisAction.cc
===================================================================
--- trunk/examples/extended/visualization/userVisAction/userVisAction.cc	(revision 1187)
+++ trunk/examples/extended/visualization/userVisAction/userVisAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: userVisAction.cc,v 1.2 2006/06/29 17:46:00 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
