Index: trunk/source/geometry/solids/test/SurfaceChecker/SurfaceChecker.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/SurfaceChecker.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/SurfaceChecker.cc	(revision 1316)
@@ -0,0 +1,120 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SurfaceChecker.cc,v 1.3 2006/10/20 14:43:18 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+#include "Randomize.hh"
+
+#include "SCDetectorConstruction.hh"
+#include "SCPhysicsList.hh"
+#include "SCPrimaryGeneratorAction.hh"
+#include "SCRunAction.hh"
+#include "SCEventAction.hh"
+#include "SCSteppingAction.hh"
+#include "SCSteppingVerbose.hh"
+
+#include "G4RunManager.hh"
+#include "G4UImanager.hh"
+#include "G4UIterminal.hh"
+#include "G4UItcsh.hh"
+
+#ifdef G4VIS_USE
+#include "SCVisManager.hh"
+#endif
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+int main(int argc,char** argv) {
+
+  // choose the Random engine
+  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
+
+  //my Verbose output class
+  G4VSteppingVerbose::SetInstance(new SCSteppingVerbose);
+  
+  // Run manager
+  G4RunManager * runManager = new G4RunManager;
+
+  // UserInitialization classes (mandatory)
+  SCDetectorConstruction* SCdetector = new SCDetectorConstruction;
+  runManager->SetUserInitialization(SCdetector);
+  runManager->SetUserInitialization(new SCPhysicsList);
+  
+#ifdef G4VIS_USE
+  // Visualization, if you choose to have it!
+  G4VisManager* visManager = new SCVisManager;
+  visManager->Initialize();
+#endif
+   
+  // UserAction classes
+  runManager->SetUserAction(new SCPrimaryGeneratorAction(SCdetector));
+  runManager->SetUserAction(new SCRunAction);  
+  runManager->SetUserAction(new SCEventAction);
+  runManager->SetUserAction(new SCSteppingAction);
+
+  //Initialize G4 kernel
+  runManager->Initialize();
+      
+  //get the pointer to the User Interface manager 
+  G4UImanager * UI = G4UImanager::GetUIpointer();  
+
+  if(argc==1)
+  // Define (G)UI terminal for interactive mode  
+  { 
+    // G4UIterminal is a (dumb) terminal.
+    G4UIsession * session = 0;
+#ifdef G4UI_USE_TCSH
+      session = new G4UIterminal(new G4UItcsh);      
+#else
+      session = new G4UIterminal();
+#endif    
+
+    UI->ApplyCommand("/control/execute vis.mac");    
+    session->SessionStart();
+    delete session;
+  }
+  else
+  // Batch mode
+  { 
+    G4String command = "/control/execute ";
+    G4String fileName = argv[1];
+    UI->ApplyCommand(command+fileName);
+  }
+
+#ifdef G4VIS_USE
+  delete visManager;
+#endif
+  delete runManager;
+
+  return 0;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCDetectorConstruction.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCDetectorConstruction.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCDetectorConstruction.hh	(revision 1316)
@@ -0,0 +1,148 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCDetectorConstruction.hh,v 1.6 2006/12/13 15:43:46 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCDetectorConstruction_h
+#define SCDetectorConstruction_h 1
+
+#include "globals.hh"
+#include "G4VUserDetectorConstruction.hh"
+#include "SCMagneticField.hh"
+#include "G4VSolid.hh"
+
+class G4Box ;
+class G4LogicalVolume;
+class G4VPhysicalVolume;
+class G4Material;
+class SCDetectorMessenger;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCDetectorConstruction : public G4VUserDetectorConstruction
+{
+  public:
+  
+     SCDetectorConstruction();
+    ~SCDetectorConstruction();
+
+  public:
+  
+     G4VPhysicalVolume* Construct();
+     
+     const 
+     G4VPhysicalVolume* GetTracker() {return physiTracker;};
+     G4double GetWorldFullLength()   {return fWorldLength;}; 
+
+
+     G4double GetTrackerR() { return fTrackerR ; } ;
+     G4double GetTrackerR1() { return fTrackerR1 ; } ;
+     G4double GetTrackerR2() { return fTrackerR2 ; } ;
+
+     G4double GetTrackerpDz()  { return fTrackerpDz;};
+     G4double GetTrackerpDx1() { return fTrackerpDx1 ; } ;
+     G4double GetTrackerpDx2() { return fTrackerpDx2 ; } ;
+     G4double GetTrackerpDx3() { return fTrackerpDx3 ; } ;
+     G4double GetTrackerpDx4() { return fTrackerpDx4 ; } ;
+
+     G4double GetTrackerpDy1() { return fTrackerpDy1 ; } ;
+     G4double GetTrackerpDy2() { return fTrackerpDy2 ; } ;
+     G4double GetTwistAngle() { return fTwistAngle ; } ;
+
+     G4double GetAlpha() { return fAlph ; } ;
+     G4double GetPhi() { return fPhi ; } ;
+     G4double GetTheta() { return fTheta ; } ;
+     G4String GetDetectorType() { return fval ; } ;
+
+     G4double GetPhiSegment()   { return fPhiSegment ; } ;
+     G4double GetThetaSegment() { return fThetaSegment ; } ;
+
+     G4double GetSemiAxisX() { return fSemiAxisX ; }
+     G4double GetSemiAxisY() { return fSemiAxisY ; }
+     G4double GetSemiAxisZ() { return fSemiAxisZ ; }
+
+     G4VSolid * GetSolid()  { return aVolume ; }
+
+     void  SwitchDetector();
+     G4VPhysicalVolume* SelectDetector (const G4String& val);
+
+     void setTargetMaterial (G4String);
+     void setChamberMaterial(G4String);
+     void SetMagField(G4double);
+     
+  private:
+
+     G4Box*             solidWorld;    // pointer to the solid envelope 
+     G4LogicalVolume*   logicWorld;    // pointer to the logical envelope
+     G4VPhysicalVolume* physiWorld;    // pointer to the physical envelope
+     G4VSolid* aVolume;
+
+  //     G4TwistedTrap*     solidTracker;
+
+     G4LogicalVolume*   logicTracker;  // pointer to the logical Tracker
+     G4VPhysicalVolume* physiTracker;  // pointer to the physical Tracker
+     
+     SCMagneticField* fpMagField;   // pointer to the magnetic field 
+     
+     SCDetectorMessenger* detectorMessenger;  // pointer to the Messenger
+       
+     G4double fWorldLength;            // Full length of the world volume
+
+
+     G4double fTrackerR ;   // a radius
+     G4double fTrackerR1 ;   // r1
+     G4double fTrackerR2 ;   // r2
+    
+     G4double fTrackerpDz  ;          // Full length of Tracker (pDz)
+     G4double fTrackerpDx1 ;  // twisted Trapezoid
+     G4double fTrackerpDx2 ;
+     G4double fTrackerpDx3 ;
+     G4double fTrackerpDx4 ;
+     G4double fTrackerpDy1 ;
+     G4double fTrackerpDy2 ;
+     G4double fTwistAngle ;
+     G4double fPhi ;
+     G4double fTheta ;
+     G4double fAlph ;
+     G4double fSemiAxisX ;
+     G4double fSemiAxisY ;
+     G4double fSemiAxisZ ;
+
+
+     G4double fPhiSegment ;    // e.g. for a sphere : phi in [phi,phi+segment]
+     G4double fThetaSegment ;
+ 
+     G4String fval ;
+
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCDetectorMessenger.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCDetectorMessenger.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCDetectorMessenger.hh	(revision 1316)
@@ -0,0 +1,50 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+
+#ifndef SCDetectorMessenger_h
+#define SCDetectorMessenger_h 1
+
+#include "globals.hh"
+#include "G4UImessenger.hh"
+
+class SCDetectorConstruction;
+class G4UIdirectory;
+class G4UIcmdWithAString;
+
+class SCDetectorMessenger: public G4UImessenger
+{
+  public:
+    SCDetectorMessenger(SCDetectorConstruction * myDC);
+      void SetNewValue(G4UIcommand * command,G4String newValues);
+  private:
+    SCDetectorConstruction * myDetector;
+    G4UIdirectory *      mydetDir;
+    G4UIcmdWithAString * selDetCmd;
+};
+
+#endif
+
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCEventAction.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCEventAction.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCEventAction.hh	(revision 1316)
@@ -0,0 +1,57 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCEventAction.hh,v 1.2 2006/06/29 18:54:24 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+#ifndef SCEventAction_h
+#define SCEventAction_h 1
+
+#include "G4UserEventAction.hh"
+
+class G4Event;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCEventAction : public G4UserEventAction
+{
+  public:
+    SCEventAction();
+   ~SCEventAction();
+
+  public:
+    void BeginOfEventAction(const G4Event*);
+    void EndOfEventAction(const G4Event*);
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
+    
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCMagneticField.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCMagneticField.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCMagneticField.hh	(revision 1316)
@@ -0,0 +1,69 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCMagneticField.hh,v 1.2 2006/06/29 18:54:27 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+//    A class for control of the Magnetic Field of the detector.
+//  The field is assumed to be uniform.
+// 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCMagneticField_H
+#define SCMagneticField_H
+
+#include "G4UniformMagField.hh"
+
+class G4FieldManager;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+
+class SCMagneticField: public G4UniformMagField
+{
+  public:
+  
+   SCMagneticField(G4ThreeVector);  //  The value of the field
+   SCMagneticField();               //  A zero field
+  ~SCMagneticField();  
+      
+   //Set the field (fieldValue,0,0)
+   void SetFieldValue(G4double fieldValue);
+   void SetFieldValue(G4ThreeVector fieldVector);
+      
+   G4ThreeVector GetConstantFieldValue();
+
+  protected:
+
+      // Find the global Field Manager
+      G4FieldManager* GetGlobalFieldManager();   // static 
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCPhysicsList.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCPhysicsList.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCPhysicsList.hh	(revision 1316)
@@ -0,0 +1,60 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCPhysicsList.hh,v 1.2 2006/06/29 18:54:29 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCPhysicsList_h
+#define SCPhysicsList_h 1
+
+#include "G4VUserPhysicsList.hh"
+#include "globals.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCPhysicsList: public G4VUserPhysicsList
+{
+  public:
+    SCPhysicsList();
+   ~SCPhysicsList();
+
+  protected:
+    // Construct particle and physics
+    void ConstructParticle();
+    void ConstructProcess();
+    void SetCuts();
+
+   
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
+ 
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCPrimaryGeneratorAction.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCPrimaryGeneratorAction.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCPrimaryGeneratorAction.hh	(revision 1316)
@@ -0,0 +1,67 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCPrimaryGeneratorAction.hh,v 1.3 2006/06/29 18:54:31 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+#ifndef SCPrimaryGeneratorAction_h
+#define SCPrimaryGeneratorAction_h 1
+
+#include "G4VUserPrimaryGeneratorAction.hh"
+#include "G4ThreeVector.hh"
+
+class SCDetectorConstruction;
+class G4ParticleGun;
+class G4Event;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+class SCPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
+{
+  public:
+    SCPrimaryGeneratorAction(SCDetectorConstruction*);    
+   ~SCPrimaryGeneratorAction();
+
+  public:
+    void GeneratePrimaries(G4Event*);
+
+  private:
+
+    G4ParticleGun* particleGun;
+    G4ThreeVector GetRandomPosition( );
+    G4ThreeVector GetRandomDirection( );
+    G4ThreeVector GetSurfacePoint(G4double &u,G4double &v) ;
+    SCDetectorConstruction* myDetector;
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCRunAction.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCRunAction.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCRunAction.hh	(revision 1316)
@@ -0,0 +1,61 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCRunAction.hh,v 1.2 2006/06/29 18:54:33 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCRunAction_h
+#define SCRunAction_h 1
+
+#include "G4UserRunAction.hh"
+#include "globals.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class G4Run;
+
+class SCRunAction : public G4UserRunAction
+{
+  public:
+    SCRunAction();
+   ~SCRunAction();
+
+  public:
+    void BeginOfRunAction(const G4Run*);
+    void EndOfRunAction(const G4Run*);
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
+
+
+
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCSteppingAction.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCSteppingAction.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCSteppingAction.hh	(revision 1316)
@@ -0,0 +1,51 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCSteppingAction.hh,v 1.2 2006/06/29 18:54:35 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCSteppingAction_h
+#define SCSteppingAction_h 1
+
+#include "G4UserSteppingAction.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCSteppingAction : public G4UserSteppingAction
+{
+  public:
+    SCSteppingAction();
+   ~SCSteppingAction(){};
+
+    void UserSteppingAction(const G4Step*);
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCSteppingVerbose.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCSteppingVerbose.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCSteppingVerbose.hh	(revision 1316)
@@ -0,0 +1,60 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCSteppingVerbose.hh,v 1.2 2006/06/29 18:54:37 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//   This class manages the verbose outputs in G4SteppingManager. 
+//   It inherits from G4SteppingVerbose.
+//   It shows how to extract informations during the tracking of a particle.
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCSteppingVerbose;
+
+#ifndef SCSteppingVerbose_h
+#define SCSteppingVerbose_h 1
+
+#include "G4SteppingVerbose.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCSteppingVerbose : public G4SteppingVerbose 
+{
+ public:
+   
+  SCSteppingVerbose();
+ ~SCSteppingVerbose();
+
+  void StepInfo();
+  void TrackingStarted();
+
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCTrackerHit.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCTrackerHit.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCTrackerHit.hh	(revision 1316)
@@ -0,0 +1,103 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCTrackerHit.hh,v 1.2 2006/06/29 18:54:39 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCTrackerHit_h
+#define SCTrackerHit_h 1
+
+#include "G4VHit.hh"
+#include "G4THitsCollection.hh"
+#include "G4Allocator.hh"
+#include "G4ThreeVector.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCTrackerHit : public G4VHit
+{
+  public:
+
+      SCTrackerHit();
+     ~SCTrackerHit();
+      SCTrackerHit(const SCTrackerHit&);
+      const SCTrackerHit& operator=(const SCTrackerHit&);
+      G4int operator==(const SCTrackerHit&) const;
+
+      inline void* operator new(size_t);
+      inline void  operator delete(void*);
+
+      void Draw();
+      void Print();
+
+  public:
+  
+      void SetTrackID  (G4int track)      { trackID = track; };
+      void SetChamberNb(G4int chamb)      { chamberNb = chamb; };  
+      void SetEdep     (G4double de)      { edep = de; };
+      void SetPos      (G4ThreeVector xyz){ pos = xyz; };
+      
+      G4int GetTrackID()    { return trackID; };
+      G4int GetChamberNb()  { return chamberNb; };
+      G4double GetEdep()    { return edep; };      
+      G4ThreeVector GetPos(){ return pos; };
+      
+  private:
+  
+      G4int         trackID;
+      G4int         chamberNb;
+      G4double      edep;
+      G4ThreeVector pos;
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+typedef G4THitsCollection<SCTrackerHit> SCTrackerHitsCollection;
+
+extern G4Allocator<SCTrackerHit> SCTrackerHitAllocator;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline void* SCTrackerHit::operator new(size_t)
+{
+  void *aHit;
+  aHit = (void *) SCTrackerHitAllocator.MallocSingle();
+  return aHit;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline void SCTrackerHit::operator delete(void *aHit)
+{
+  SCTrackerHitAllocator.FreeSingle((SCTrackerHit*) aHit);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCTrackerSD.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCTrackerSD.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCTrackerSD.hh	(revision 1316)
@@ -0,0 +1,62 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCTrackerSD.hh,v 1.2 2006/06/29 18:54:41 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCTrackerSD_h
+#define SCTrackerSD_h 1
+
+#include "G4VSensitiveDetector.hh"
+#include "SCTrackerHit.hh"
+
+class G4Step;
+class G4HCofThisEvent;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCTrackerSD : public G4VSensitiveDetector
+{
+  public:
+      SCTrackerSD(G4String);
+     ~SCTrackerSD();
+
+      void Initialize(G4HCofThisEvent*);
+      G4bool ProcessHits(G4Step*, G4TouchableHistory*);
+      void EndOfEvent(G4HCofThisEvent*);
+
+  private:
+      SCTrackerHitsCollection* trackerCollection;
+
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/include/SCVisManager.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/include/SCVisManager.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/include/SCVisManager.hh	(revision 1316)
@@ -0,0 +1,75 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCVisManager.hh,v 1.2 2006/06/29 18:54:44 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// 
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+// Example Visualization Manager implementing virtual function
+//   RegisterGraphicsSystems.  Exploits C-pre-processor variables
+//   G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
+//   environment variables of the same name are set.
+
+// So all you have to do is set environment variables and compile and
+//   instantiate this in your main().
+
+// Alternatively, you can implement an empty function here and just
+//   register the systems you want in your main(), e.g.:
+//   G4VisManager* myVisManager = new MyVisManager;
+//   myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef SCVisManager_h
+#define SCVisManager_h 1
+
+#ifdef G4VIS_USE
+
+#include "G4VisManager.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class SCVisManager: public G4VisManager {
+
+public:
+
+  SCVisManager ();
+
+private:
+
+  void RegisterGraphicsSystems ();
+
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
+#endif
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCDetectorConstruction.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCDetectorConstruction.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCDetectorConstruction.cc	(revision 1316)
@@ -0,0 +1,638 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCDetectorConstruction.cc,v 1.9 2007/07/18 14:38:48 tnikitin Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+#include "SCDetectorConstruction.hh"
+#include "SCDetectorMessenger.hh"
+#include "SCMagneticField.hh"
+#include "SCTrackerSD.hh"
+
+#include "G4Material.hh"
+
+#include "G4Box.hh"
+#include "G4Orb.hh"
+#include "G4Tubs.hh"
+#include "G4Sphere.hh"
+#include "G4Cons.hh"
+#include "G4Hype.hh"
+#include "G4Para.hh"
+#include "G4Paraboloid.hh"
+#include "G4Torus.hh"
+#include "G4Trd.hh"
+#include "G4Ellipsoid.hh"
+#include "G4EllipticalTube.hh"
+#include "G4EllipticalCone.hh"
+
+#include "G4Trap.hh"
+#include "G4Trd.hh"
+#include "G4Tet.hh"
+
+#include "G4Polycone.hh"
+
+#include "G4TwistedTubs.hh"
+#include "G4TwistedBox.hh"
+#include "G4TwistedTrd.hh"
+#include "G4TwistedTrap.hh"
+
+#include "G4BooleanSolid.hh"
+#include "G4DisplacedSolid.hh"
+#include "G4UnionSolid.hh"
+#include "G4IntersectionSolid.hh"
+#include "G4SubtractionSolid.hh"
+#include "G4ReflectedSolid.hh"
+
+#include "G4LogicalVolume.hh"
+#include "G4PVPlacement.hh"
+#include "G4PVParameterised.hh"
+#include "G4SDManager.hh"
+
+#include "G4UserLimits.hh"
+
+#include "G4VisAttributes.hh"
+#include "G4Colour.hh"
+
+#include "G4ios.hh"
+
+#include "G4UnitsTable.hh"
+
+#include "G4RunManager.hh"
+
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+SCDetectorConstruction::SCDetectorConstruction()
+:solidWorld(0),  logicWorld(0),  physiWorld(0),
+ logicTracker(0),physiTracker(0), 
+ fpMagField(0), fWorldLength(0.),  fTrackerpDz(0.)
+{
+  fpMagField = new SCMagneticField();
+  detectorMessenger = new SCDetectorMessenger(this);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+SCDetectorConstruction::~SCDetectorConstruction()
+{
+  delete fpMagField;
+  delete detectorMessenger;             
+}
+
+////////////////////////////////////////////////////////////////
+
+void SCDetectorConstruction::SwitchDetector()
+{
+  G4RunManager::GetRunManager()->DefineWorldVolume(physiWorld);
+}
+
+
+G4VPhysicalVolume*
+SCDetectorConstruction::SelectDetector( const G4String& val )
+{
+
+
+  G4double a, z;
+
+  G4double density;
+  G4int nel;
+
+  //Air
+  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);
+   
+  G4Material* Air = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
+  Air->AddElement(N, 70*perCent);
+  Air->AddElement(O, 30*perCent);
+
+  // Print all the materials defined.
+  //
+  //  G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
+  //G4cout << *(G4Material::GetMaterialTable()) << G4endl;
+
+  G4Box* b1 = new G4Box ( "b1", 100*cm, 50*cm, 50*cm );
+  G4Box* b2 = new G4Box ( "b2", 50*cm, 100*cm, 50*cm );
+
+  fval = val ;
+
+  if (val == "Sphere")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 0*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 0*deg ;
+      fPhiSegment = 360*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 180*deg ;
+      aVolume = new G4Sphere ("aSphere",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+  }
+
+  else if (val == "HalfSphere")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 0*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 0*deg ;
+      fPhiSegment = 180*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 180*deg ;
+      aVolume = new G4Sphere ("aHalfSphere",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "HollowSphere")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 12*cm ;
+      fTrackerR2 = 14*cm ;
+      fPhi = 0*deg ;
+      fPhiSegment = 360*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 180*deg ;
+      aVolume = new G4Sphere ("aHollowSphere",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "HalfHollowSphere")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 12*cm ;
+      fTrackerR2 = 14*cm ;
+      fPhi = 0*deg ;
+      fPhiSegment = 180*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 180*deg ;
+      aVolume = new G4Sphere ("aHalfHollowSphere",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "Q1Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 0*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ1Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "Q2Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 90*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ2Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }  
+  else if (val == "Q3Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 180*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ3Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "Q4Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 270*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 0*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ4Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "Q5Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 0*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 90*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ5Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+else if (val == "Q6Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 90*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 90*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ5Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }  
+  else if (val == "Q7Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 180*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 90*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ7Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "Q8Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 270*deg ;
+      fPhiSegment = 90*deg ;
+      fTheta = 90*deg ;
+      fThetaSegment = 90*deg ;
+      aVolume = new G4Sphere ("aQ8Shell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+
+
+  else if (val == "Shell")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 30*deg ;
+      fPhiSegment = 120*deg ;
+      fTheta = 10*deg ;
+      fThetaSegment = 100*deg ;
+      aVolume = new G4Sphere ("aShell",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if (val == "Ring")
+  {
+    // only solid sphere is supportet for now
+      fTrackerR1 = 10*cm ;
+      fTrackerR2 = 12*cm ;
+      fPhi = 30*deg ;
+      fPhiSegment = 120*deg ;
+      fTheta = 10*deg ;
+      fThetaSegment = 40*deg ;
+      aVolume = new G4Sphere ("aRing",  fTrackerR1, fTrackerR2 ,fPhi, fPhiSegment, fTheta, fThetaSegment);
+
+  }
+  else if ( val == "Ellipsoid" ) {
+
+    fSemiAxisX = 1*cm ;
+    fSemiAxisY = 10*cm ;
+    fSemiAxisZ = 100*cm ;
+
+    aVolume = new  G4Ellipsoid("aEllipsoid",
+			       fSemiAxisX,
+			       fSemiAxisY,
+			       fSemiAxisZ,
+			       -fSemiAxisZ,fSemiAxisZ);
+
+
+  }
+  else if (val == "Orb")
+  {
+
+    fTrackerR = 11*cm ;
+    aVolume = new G4Orb ( "aOrb", fTrackerR );
+
+  }
+  else if (val == "Box") 
+  {         
+
+    fTrackerpDx1 = 10*cm ;
+    fTrackerpDy1 = 10*cm ;
+    fTrackerpDz  = 10*cm ;
+
+    aVolume = new G4Box ( "aBox", fTrackerpDx1, fTrackerpDy1, fTrackerpDz );
+  }
+  else if (val == "Cons")
+  {        
+
+    fTrackerpDz = 80*cm ;
+    fTrackerR1 = 11*cm ;
+    fTrackerR2 = 16*cm ;
+
+    aVolume = new G4Cons ( "aCons", 0.8*fTrackerR1 , fTrackerR1, 0.8*fTrackerR2, fTrackerR2, fTrackerpDz, 10*deg, 120.*deg  ); 
+
+  }
+  else if (val == "manyCons")
+  {        
+    aVolume = new G4Cons ( "aCone", 2*cm, 6*cm, 8*cm, 14*cm,
+                           10*cm, 10*deg, 300*deg ); 
+  //  10*cm, 10*deg, 300*deg ); 
+			   //  0., pi);
+
+ 
+  }
+  else if (val == "Tubs")
+  {
+
+    // only solid Tube is supported.
+    fTrackerpDz = 80*cm ;
+    fTrackerR = 11*cm ;
+
+    aVolume = new G4Tubs ( "aTube",0.8*fTrackerR,fTrackerR,fTrackerpDz,40.,100*deg) ;
+
+  }
+  else if (val == "Hype")
+  {
+    aVolume = new G4Hype ("aHype", 7*cm, 10*cm, 40*deg, 40*deg, 40*cm );
+  }
+  else if (val == "Torus")
+  {
+
+    fPhi = 40*deg ;
+    fPhiSegment = 100*deg ;
+
+    fTrackerR1 = 5*cm ;
+    fTrackerR2 = 6*cm ;
+    fTrackerR  = 20*cm ;
+
+    aVolume = new G4Torus("aTorus", fTrackerR1, fTrackerR2 ,fTrackerR, fPhi, fPhiSegment) ;
+
+  }
+  else if (val == "Para")
+  {
+    aVolume = new G4Para ("aPara", 8*cm, 10*cm, 12*cm, 30*deg, 45*deg, 60*deg);
+  }
+  else if (val == "Paraboloid")
+  {
+    aVolume = new G4Paraboloid ("aParaboloid", 8*cm, 1*cm, 12*cm);
+  }
+  else if (val == "Trd")
+  {
+    aVolume = new G4Trd ("aTrd", 80*cm, 100*cm, 70*cm, 90*cm, 100*cm);
+  }
+  else if (val == "b1Ub2") 
+  {         
+    aVolume = new G4UnionSolid("b1Ub2",b1,b2);
+    /*
+    G4Box * box1 = new G4Box("Box1",1092.500000,240.103374,92.000000);
+    G4Box * box2 = new G4Box("Box2",540.103374,792.500000,92.000000);
+
+    G4double L1 = 1104;
+
+    aVolume =
+    new G4UnionSolid("ECShapeBoxes",
+                     box1,
+                     box2,
+                     0,
+                     G4ThreeVector(-L1/2.,
+                                   L1/2.,
+                                   0.));
+    */
+  }
+  else if (val == "b1Ib2") 
+  {         
+    aVolume = new G4IntersectionSolid("b1Ib2",b1,b2);
+  }
+  else if (val == "b1Sb2") 
+  {         
+    aVolume = new G4SubtractionSolid("b1Sb2",b1,b2);
+  }
+  else if (val == "b1Ib1") 
+  {         
+    aVolume = new G4IntersectionSolid("b1Ib1",b1,b1);
+  }
+  else if (val == "b1Ub1") 
+  {         
+    aVolume = new G4UnionSolid("b1Ub1",b1,b1);
+  }
+  else if (val == "b1Sb1") 
+  {         
+    aVolume = new G4SubtractionSolid("b1Sb1",b1,b1);
+  }
+  else if ( val == "TwistedTubs" )
+  {
+
+    fTwistAngle = 20*deg ;
+    fTrackerpDz = 80*cm ;
+    fTrackerR1  = 5*cm ;
+    fTrackerR2  = 10*cm ;
+    fPhi        = 50*deg ;
+
+    aVolume = new G4TwistedTubs("aTwistedTubs", fTwistAngle, fTrackerR1 , fTrackerR2, fTrackerpDz, fPhi ) ;
+  }
+
+  else if (val == "TwistedBox")
+  {
+
+
+    fTwistAngle = 20*deg ;
+    fTrackerpDx1 = 11*cm ;
+    fTrackerpDy1 = 8*cm ;
+    fTrackerpDz  = 80*cm ;
+
+    aVolume = new G4TwistedBox("aTwistedBox",fTwistAngle,fTrackerpDx1,fTrackerpDy1,fTrackerpDz) ;
+  }
+  else if (val == "TwistedTrd")
+  {
+
+    fTrackerpDx1 = 5*cm ;
+    fTrackerpDx2 = 10*cm ;
+    fTrackerpDy1 = 8*cm ;
+    fTrackerpDy2 = 15*cm ;
+    fTrackerpDz  = 80*cm ;
+    fTwistAngle = 20*deg ;
+
+    aVolume = new G4TwistedTrd("aTwistedTrd",fTrackerpDx1,fTrackerpDx2,fTrackerpDy1,fTrackerpDy2,fTrackerpDz,fTwistAngle);
+
+  }
+  else if ( val == "TwistedTrap") 
+  {
+    fTwistAngle = 60*deg ; 
+    fTrackerpDz = 80*cm;
+    fTheta = 10*deg ;
+    fPhi  =  40*deg ;
+    fTrackerpDy1 = 16*cm ;
+    fTrackerpDx1 = 24*cm ;
+    fTrackerpDx2 = 14*cm ;
+    fTrackerpDy2 = 8*cm ;
+    fTrackerpDx3 = 16*cm ;
+    fTrackerpDx4 = 11*cm ;
+    fAlph = 50*deg    ;
+
+    aVolume = new G4TwistedTrap("aTwistedTrap",
+				fTwistAngle,         // twist angle
+				fTrackerpDz,         // half z length
+				fTheta,              // direction between end planes
+				fPhi,                // defined by polar and azimutal angles.
+				fTrackerpDy1,        // half y length at -pDz
+				fTrackerpDx1,        // half x length at -pDz,-pDy
+				fTrackerpDx2,        // half x length at -pDz,+pDy
+				fTrackerpDy2,        // half y length at +pDz
+				fTrackerpDx3,        // half x length at +pDz,-pDy
+				fTrackerpDx4,        // half x length at +pDz,+pDy
+				fAlph                // tilt angle at +pDz
+				) ;
+  }
+  else if ( val == "Tet" ) 
+  {
+
+      G4ThreeVector pzero(0,0,0);
+      G4ThreeVector pnt1(10.*cm,0.*cm,0.*cm),pnt2(5.0*cm,10.*cm,0.*cm), pnt3(5.*cm,5.*cm,10.*cm);
+      G4bool  goodTet;
+      G4Tet   t1( "aTet", pzero, pnt1, pnt2, pnt3, &goodTet);
+  }
+  else if ( val == "Trap") 
+  {
+    fTrackerpDz = 80*cm;
+    fTheta = 10*deg ;
+    fPhi  =  40*deg ;
+    fTrackerpDy1 = 16*cm ;
+    fTrackerpDx1 = 24*cm ;
+    fTrackerpDx2 = 14*cm ;
+    fTrackerpDy2 = 8*cm ;
+    fTrackerpDx3 = 16*cm ;
+    fTrackerpDx4 = 11*cm ;
+    fAlph = 50*deg    ;
+
+    aVolume = new G4Trap("aTrap",
+				fTrackerpDz,         // half z length
+				fTheta,              // direction between end planes
+				fPhi,                // defined by polar and azimutal angles.
+				fTrackerpDy1,        // half y length at -pDz
+				fTrackerpDx1,        // half x length at -pDz,-pDy
+				fTrackerpDx2,        // half x length at -pDz,+pDy
+				fAlph,                // tilt angle at +pDz
+				fTrackerpDy2,        // half y length at +pDz
+				fTrackerpDx3,        // half x length at +pDz,-pDy
+				fTrackerpDx4,        // half x length at +pDz,+pDy
+				fAlph                // tilt angle at +pDz
+				) ;
+  }
+  else if ( val == "EllipticalCone" ) 
+  {
+    aVolume = new G4EllipticalCone("aEllipticalCone",
+                        0.5*mm,       // xSemiAxis
+                        1*mm,       // ySemiAxis
+                        40*mm,      // zheight
+                        25*mm) ;    // zTopCut
+
+  }
+  else if ( val == "EllipticalTube" ) 
+  {
+    aVolume = new G4EllipticalTube("aEllipticalTube" ,
+				   2*cm,   // xSemiAxis
+				   5*cm,   // ySemiAxis
+				   35*cm) ;  // zheight
+
+  }
+  else
+  {
+    G4Exception("Sc01DetectorConstruction::SelectDetector() - Invalid shape!");
+  }
+
+  fWorldLength= 10*m ;
+   
+//--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
+  
+  //------------------------------ 
+  // World
+  //------------------------------ 
+
+  G4double HalfWorldLength = 0.5*fWorldLength;
+  solidWorld= new G4Box("world",HalfWorldLength,HalfWorldLength,HalfWorldLength);
+  logicWorld= new G4LogicalVolume( solidWorld, Air, "World", 0, 0, 0);
+  
+  //  Must place the World Physical volume unrotated at (0,0,0).
+  // 
+  physiWorld = new G4PVPlacement(0,               // no rotation
+                                 G4ThreeVector(), // at (0,0,0)
+                                 logicWorld,      // its logical volume
+				 "World",         // its name
+                                 0,               // its mother  volume
+                                 false,           // no boolean operations
+                                 0);              // no field specific to volume
+				 
+
+
+  G4LogicalVolume* aVolume_log = new G4LogicalVolume(aVolume, Air, "aVolume_L", 0,0,0);
+
+  // G4VPhysicalVolume * aVolume_phys1 =
+      new G4PVPlacement(0,
+			G4ThreeVector(0*cm, 0*cm, 0*cm),
+                        aVolume_log, 
+			val, 
+			logicWorld, 
+			false,
+			0);
+
+
+
+//--------- Visualization attributes -------------------------------
+
+
+// the world is transparent
+  G4VisAttributes* WorldAtt = new G4VisAttributes(G4Colour(1.,1.,1.,0.));
+  WorldAtt->SetVisibility(true);
+  logicWorld->SetVisAttributes(WorldAtt);  
+
+  G4VisAttributes* BoxVisAtt= new G4VisAttributes(G4Colour(0.0,.0,1.0,0.6));
+  BoxVisAtt->SetVisibility(true);
+  aVolume_log->SetVisAttributes(BoxVisAtt);
+  
+//--------- example of User Limits -------------------------------
+
+  
+  return physiWorld;
+
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+G4VPhysicalVolume* SCDetectorConstruction::Construct()
+{
+
+
+  //-------------------Hall ----------------------------------
+  
+  return SelectDetector ("Sphere");  // default is Sphere
+
+}
+
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+void SCDetectorConstruction::SetMagField(G4double fieldValue)
+{
+  fpMagField->SetFieldValue(fieldValue);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCDetectorMessenger.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCDetectorMessenger.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCDetectorMessenger.cc	(revision 1316)
@@ -0,0 +1,74 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+
+#include "SCDetectorMessenger.hh"
+
+#include "SCDetectorConstruction.hh"
+#include "G4UIdirectory.hh"
+#include "G4UIcmdWithAString.hh"
+#include "globals.hh"
+
+#include "G4ios.hh"
+
+SCDetectorMessenger::SCDetectorMessenger(SCDetectorConstruction * myDC)
+  : myDetector(myDC)
+{
+  G4String defParam;
+
+  mydetDir = new G4UIdirectory("/mydet/");
+  mydetDir->SetGuidance("Detector setup commands.");
+
+  selDetCmd = new G4UIcmdWithAString("/mydet/SelectDetector",this);
+  selDetCmd->SetGuidance("Select Detector Setup.");
+  selDetCmd->SetGuidance("  Choice : Detector type ");
+  selDetCmd->SetParameterName("choice",true);
+  selDetCmd->SetDefaultValue("Sphere");
+
+ selDetCmd->SetCandidates("Trap Trd Tet Sphere HalfSphere HollowSphere HalfHollowSphere Q1Shell Q2Shell Q3Shell Q4Shell Q5Shell Q6Shell Q7Shell Q8Shell Ring Shell Orb Box Cons manyCons Tubs Hype Torus Para Paraboloid Trd b1Ib2 b1Ub2 b1Sb2 b1Ub1 b1Ib1 b1Sb1 TwistedTubs TwistedBox TwistedTrd TwistedTrap Ellipsoid EllipticalCone EllipticalTube");
+  selDetCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
+
+    myDetector->SelectDetector(defParam="Sphere");
+}
+
+void SCDetectorMessenger::SetNewValue(G4UIcommand * command,
+                                         G4String newValues)
+{
+  if( command == selDetCmd )
+  {
+    myDetector->SelectDetector(newValues);
+    myDetector->SwitchDetector();
+  }
+  return;
+}
+
+
+
+
+
+
+
+
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCEventAction.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCEventAction.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCEventAction.cc	(revision 1316)
@@ -0,0 +1,70 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCEventAction.cc,v 1.2 2006/06/29 18:54:51 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+#include "SCEventAction.hh"
+
+#include "G4Event.hh"
+#include "G4EventManager.hh"
+#include "G4TrajectoryContainer.hh"
+#include "G4Trajectory.hh"
+#include "G4VVisManager.hh"
+#include "G4ios.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+SCEventAction::SCEventAction()
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+SCEventAction::~SCEventAction()
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+void SCEventAction::BeginOfEventAction(const G4Event*)
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+ 
+void SCEventAction::EndOfEventAction(const G4Event* )
+{
+  //  G4int event_id = evt->GetEventID();
+  G4cout << "EndOfEvent" << G4endl ;
+
+  // get number of stored trajectories
+  //
+  
+
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCMagneticField.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCMagneticField.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCMagneticField.cc	(revision 1316)
@@ -0,0 +1,102 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCMagneticField.cc,v 1.2 2006/06/29 18:54:53 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//  
+//   User Field class implementation.
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "SCMagneticField.hh"
+#include "G4FieldManager.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCMagneticField::SCMagneticField()
+  : G4UniformMagField(G4ThreeVector())
+{
+  GetGlobalFieldManager()->SetDetectorField(this);
+  GetGlobalFieldManager()->CreateChordFinder(this);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCMagneticField::SCMagneticField(G4ThreeVector fieldVector)
+  : G4UniformMagField(fieldVector)
+{
+  GetGlobalFieldManager()->SetDetectorField(this);    
+  GetGlobalFieldManager()->CreateChordFinder(this);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+// Set the value of the Global Field to fieldValue along X
+//
+void SCMagneticField::SetFieldValue(G4double fieldValue)
+{
+   G4UniformMagField::SetFieldValue(G4ThreeVector(fieldValue,0,0));
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+// Set the value of the Global Field
+//
+void SCMagneticField::SetFieldValue(G4ThreeVector fieldVector)
+{
+  // Find the Field Manager for the global field
+  G4FieldManager* fieldMgr= GetGlobalFieldManager();
+    
+  if(fieldVector!=G4ThreeVector(0.,0.,0.))
+  { 
+    G4UniformMagField::SetFieldValue(fieldVector);
+    fieldMgr->SetDetectorField(this);
+  } else {
+    // If the new field's value is Zero, then it is best to
+    //  insure that it is not used for propagation.
+    G4MagneticField* magField = NULL;
+    fieldMgr->SetDetectorField(magField);
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCMagneticField::~SCMagneticField()
+{
+  // GetGlobalFieldManager()->SetDetectorField(0);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "G4TransportationManager.hh"
+
+G4FieldManager*  SCMagneticField::GetGlobalFieldManager()
+{
+  return G4TransportationManager::GetTransportationManager()->GetFieldManager();
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCPhysicsList.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCPhysicsList.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCPhysicsList.cc	(revision 1316)
@@ -0,0 +1,78 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCPhysicsList.cc,v 1.2 2006/06/29 18:54:55 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "globals.hh"
+#include "SCPhysicsList.hh"
+#include "G4ParticleTypes.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+SCPhysicsList::SCPhysicsList()
+{}
+
+
+SCPhysicsList::~SCPhysicsList()
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCPhysicsList::ConstructParticle()
+{
+  // In this method, static member functions should be called
+  // for all particles which you want to use.
+  // This ensures that objects of these particle types will be
+  // created in the program. 
+
+  G4Geantino::GeantinoDefinition();
+
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCPhysicsList::ConstructProcess()
+{
+  AddTransportation();
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCPhysicsList::SetCuts()
+{
+  //G4VUserPhysicsList::SetCutsWithDefault method sets 
+  //the default cut value for all particle types 
+  //
+
+  SetCutsWithDefault();
+
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCPrimaryGeneratorAction.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCPrimaryGeneratorAction.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCPrimaryGeneratorAction.cc	(revision 1316)
@@ -0,0 +1,175 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCPrimaryGeneratorAction.cc,v 1.8 2006/12/13 15:43:52 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "Randomize.hh"
+
+#include "SCPrimaryGeneratorAction.hh"
+#include "SCDetectorConstruction.hh"
+
+#include "SCSurfacePoint.hh" 
+#include "G4Event.hh"
+#include "G4ParticleGun.hh"
+#include "G4ParticleTable.hh"
+#include "G4ParticleDefinition.hh"
+#include "globals.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+SurfacePoint spoint ;
+
+SCPrimaryGeneratorAction::SCPrimaryGeneratorAction(
+                                               SCDetectorConstruction* myDC)
+:myDetector(myDC)
+{
+  G4int n_particle = 1;
+  particleGun = new G4ParticleGun(n_particle);
+
+// default particle
+
+  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
+  G4ParticleDefinition* particle = particleTable->FindParticle("geantino");
+  
+  particleGun->SetParticleDefinition(particle);
+
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCPrimaryGeneratorAction::~SCPrimaryGeneratorAction()
+{
+  delete particleGun;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
+{ 
+
+  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
+  G4String particleName;
+  G4ParticleDefinition* aParticleDefinition 
+    = particleTable->FindParticle(particleName="geantino");
+
+  // create a new vertex in a random position 
+
+  G4int i = anEvent->GetEventID() ;
+
+  G4ThreeVector VertexPosition (GetRandomPosition());
+  G4PrimaryVertex* aVertex = new G4PrimaryVertex( VertexPosition, 0);
+
+  G4double u,v ;
+
+  G4ThreeVector aSurfacePoint (GetSurfacePoint(u,v)) ;  // point A on surface
+  G4ThreeVector aNormal(1,0,0) ;  // normal vector
+
+  G4ThreeVector m = (aSurfacePoint-VertexPosition).unit() ;  // direction
+
+  G4double distance = ( aSurfacePoint - VertexPosition ).mag() ;
+  G4double theta = std::acos(m.unit()*aNormal) ;
+
+  spoint.SetSurfacePoint(aSurfacePoint) ;
+  
+  G4PrimaryParticle* aPrimaryParticle =
+    new G4PrimaryParticle(aParticleDefinition, m.x(), m.y(), m.z());
+  aPrimaryParticle->SetMass (0.);
+
+  aVertex->SetPrimary( aPrimaryParticle );
+
+  G4cout  << "Event "     << i << G4endl 
+	  << "Vertex "  << VertexPosition << " " << u << " " << v <<  G4endl 
+	  << "Surface "  << aSurfacePoint << G4endl 
+	  << "Distance " << distance << G4endl 
+	  << "Momentum "  << m << G4endl 
+          << "Angle " << theta 
+	  << G4endl ;
+
+  anEvent->AddPrimaryVertex( aVertex );
+
+
+}
+
+
+G4ThreeVector SCPrimaryGeneratorAction::GetRandomDirection() {
+
+  G4ThreeVector retval;
+
+  G4double CosTheta;
+  G4double SinTheta;
+
+  G4double Phi;
+  G4double SinPhi;
+  G4double CosPhi;
+
+  G4double rand;
+
+  rand = G4UniformRand();
+
+  CosTheta = 2.0*rand -1.0;
+  SinTheta = std::sqrt (1.-CosTheta*CosTheta);
+  rand = G4UniformRand();
+  Phi = twopi*rand;
+  SinPhi = std::sin (Phi);
+  CosPhi = std::cos (Phi);
+  retval.setX(SinTheta*CosPhi);
+  retval.setY(SinTheta*SinPhi);
+  retval.setZ(CosTheta);
+
+  return retval;
+}
+
+G4ThreeVector SCPrimaryGeneratorAction::GetRandomPosition() 
+{
+
+  G4double a = 0.5*myDetector->GetWorldFullLength();
+
+  G4double x = ( G4UniformRand()*2 - 1 )*a;
+  G4double y = ( G4UniformRand()*2 - 1 )*a;
+  G4double z = ( G4UniformRand()*2 - 1 )*a;
+
+  G4ThreeVector retval (x, y, z);
+
+  return retval;
+}
+
+G4ThreeVector SCPrimaryGeneratorAction::GetSurfacePoint(G4double &, G4double &)
+{
+
+
+  G4String val = myDetector->GetDetectorType() ;
+
+
+  return myDetector->GetSolid()->GetPointOnSurface() ;
+
+
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCRunAction.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCRunAction.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCRunAction.cc	(revision 1316)
@@ -0,0 +1,76 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCRunAction.cc,v 1.2 2006/06/29 18:54:59 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "SCRunAction.hh"
+
+#include "G4Run.hh"
+#include "G4UImanager.hh"
+#include "G4VVisManager.hh"
+#include "G4ios.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCRunAction::SCRunAction()
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCRunAction::~SCRunAction()
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCRunAction::BeginOfRunAction(const G4Run* aRun)
+{
+  G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
+
+  if (G4VVisManager::GetConcreteInstance())
+    {
+      G4UImanager* UI = G4UImanager::GetUIpointer();
+      UI->ApplyCommand("/vis/scene/notifyHandlers");
+    } 
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCRunAction::EndOfRunAction(const G4Run*)
+{
+  if (G4VVisManager::GetConcreteInstance())
+    {
+     G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
+    }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCSteppingAction.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCSteppingAction.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCSteppingAction.cc	(revision 1316)
@@ -0,0 +1,70 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCSteppingAction.cc,v 1.2 2006/06/29 18:55:01 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "SCSteppingAction.hh"
+#include "G4SteppingManager.hh"
+
+#include "SCSurfacePoint.hh" 
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCSteppingAction::SCSteppingAction()
+{ }
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCSteppingAction::UserSteppingAction(const G4Step* aStep)
+{ 
+
+  G4Track* aTrack = aStep->GetTrack();
+
+  G4StepPoint*  PreStepPoint= aStep->GetPreStepPoint(); 
+  G4StepPoint*  PostStepPoint= aStep->GetPostStepPoint(); 
+  G4ThreeVector PostHitPoint = PostStepPoint->GetPosition();
+  G4ThreeVector PreHitPoint = PreStepPoint->GetPosition();
+
+  G4cout.precision(16) ;
+
+  G4ThreeVector VertexPosition = aTrack->GetVertexPosition();
+  G4ThreeVector m = (PostHitPoint - PreHitPoint).unit() ;
+
+  G4ThreeVector truepoint = spoint.GetSurfacePoint() ;
+  G4double delta = (truepoint - PostHitPoint).mag() ;
+
+  G4cout << "Intersection "  
+	 << PostHitPoint << " "  
+	 << delta  <<  G4endl ;
+  
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCSteppingVerbose.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCSteppingVerbose.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCSteppingVerbose.cc	(revision 1316)
@@ -0,0 +1,181 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCSteppingVerbose.cc,v 1.2 2006/06/29 18:55:03 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "SCSteppingVerbose.hh"
+
+#include "G4SteppingManager.hh"
+#include "G4UnitsTable.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCSteppingVerbose::SCSteppingVerbose()
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCSteppingVerbose::~SCSteppingVerbose()
+{}
+ 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCSteppingVerbose::StepInfo()
+{
+  CopyState();
+  
+  G4int prec = G4cout.precision(3);
+
+  if( verboseLevel >= 1 ){
+    if( verboseLevel >= 4 ) VerboseTrack();
+    if( verboseLevel >= 3 ){
+      G4cout << G4endl;    
+      G4cout << std::setw( 5) << "#Step#"     << " "
+	     << std::setw( 6) << "X"          << "    "
+	     << std::setw( 6) << "Y"          << "    "  
+	     << std::setw( 6) << "Z"          << "    "
+	     << std::setw( 9) << "KineE"      << " "
+	     << std::setw( 9) << "dEStep"     << " "  
+	     << std::setw(10) << "StepLeng"     
+	     << std::setw(10) << "TrakLeng" 
+	     << std::setw(10) << "Volume"    << "  "
+	     << std::setw(10) << "Process"   << G4endl;	          
+    }
+
+    G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
+	<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
+	<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
+	<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
+	<< "  ";
+
+    // if( fStepStatus != fWorldBoundary){ 
+    if( fTrack->GetNextVolume() != 0 ) { 
+      G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
+    } else {
+      G4cout << std::setw(10) << "OutOfWorld";
+    }
+
+    if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
+      G4cout << "  " 
+        << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
+	                                ->GetProcessName();
+    } else {
+      G4cout << "   UserLimit";
+    }
+
+    G4cout << G4endl;
+
+    if( verboseLevel == 2 ){
+      G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
+	                    fN2ndariesAlongStepDoIt +
+	                    fN2ndariesPostStepDoIt;
+      if(tN2ndariesTot>0){
+	G4cout << "    :----- List of 2ndaries - "
+	       << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot 
+	       << "(Rest="  << std::setw(2) << fN2ndariesAtRestDoIt
+	       << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
+	       << ",Post="  << std::setw(2) << fN2ndariesPostStepDoIt
+	       << "), "
+	       << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
+	       << " ---------------"
+	       << G4endl;
+
+	for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; 
+                        lp1<(*fSecondary).size(); lp1++){
+	  G4cout << "    : "
+		 << std::setw(6)
+		 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
+		 << std::setw(6)
+		 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
+		 << std::setw(6)
+		 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
+		 << std::setw(6)
+		 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
+		 << std::setw(10)
+		 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
+	  G4cout << G4endl;
+	}
+              
+	G4cout << "    :-----------------------------"
+	       << "----------------------------------"
+	       << "-- EndOf2ndaries Info ---------------"
+	       << G4endl;
+      }
+    }
+    
+  }
+  G4cout.precision(prec);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCSteppingVerbose::TrackingStarted()
+{
+
+  CopyState();
+G4int prec = G4cout.precision(3);
+  if( verboseLevel > 0 ){
+
+    G4cout << std::setw( 5) << "Step#"      << " "
+           << std::setw( 6) << "X"          << "    "
+	   << std::setw( 6) << "Y"          << "    "  
+	   << std::setw( 6) << "Z"          << "    "
+	   << std::setw( 9) << "KineE"      << " "
+	   << std::setw( 9) << "dEStep"     << " "  
+	   << std::setw(10) << "StepLeng"  
+	   << std::setw(10) << "TrakLeng"
+	   << std::setw(10) << "Volume"     << "  "
+	   << std::setw(10) << "Process"    << G4endl;	     
+
+    G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
+	<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
+	<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
+	<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
+	<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
+	<< "  ";
+
+    if(fTrack->GetNextVolume()){
+      G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
+    } else {
+      G4cout << std::setw(10) << "OutOfWorld";
+    }
+    G4cout  << "    initStep" << G4endl;
+  }
+  G4cout.precision(prec);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCSurfacePoint.hh
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCSurfacePoint.hh	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCSurfacePoint.hh	(revision 1316)
@@ -0,0 +1,54 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCSurfacePoint.hh,v 1.2 2006/06/29 18:55:06 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef Tc01SurfacePoint_h
+#define Tc01SurfacePoint_h 1
+
+#include "globals.hh"
+
+class SurfacePoint 
+{
+private:
+  G4ThreeVector p ;
+
+public:
+  SurfacePoint(){};
+  ~SurfacePoint(){};
+
+  void SetSurfacePoint(G4ThreeVector vec) { p = vec ; }
+  G4ThreeVector GetSurfacePoint() { return p ; }
+
+};
+
+extern SurfacePoint spoint ;
+
+#endif
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCTrackerHit.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCTrackerHit.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCTrackerHit.cc	(revision 1316)
@@ -0,0 +1,106 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCTrackerHit.cc,v 1.2 2006/06/29 18:55:09 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "SCTrackerHit.hh"
+#include "G4UnitsTable.hh"
+#include "G4VVisManager.hh"
+#include "G4Circle.hh"
+#include "G4Colour.hh"
+#include "G4VisAttributes.hh"
+
+G4Allocator<SCTrackerHit> SCTrackerHitAllocator;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCTrackerHit::SCTrackerHit() {}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCTrackerHit::~SCTrackerHit() {}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCTrackerHit::SCTrackerHit(const SCTrackerHit& right)
+  : G4VHit()
+{
+  trackID   = right.trackID;
+  chamberNb = right.chamberNb;
+  edep      = right.edep;
+  pos       = right.pos;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+const SCTrackerHit& SCTrackerHit::operator=(const SCTrackerHit& right)
+{
+  trackID   = right.trackID;
+  chamberNb = right.chamberNb;
+  edep      = right.edep;
+  pos       = right.pos;
+  return *this;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+G4int SCTrackerHit::operator==(const SCTrackerHit& right) const
+{
+  return (this==&right) ? 1 : 0;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCTrackerHit::Draw()
+{
+  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
+  if(pVVisManager)
+  {
+    G4Circle circle(pos);
+    circle.SetScreenSize(0.04);
+    circle.SetFillStyle(G4Circle::filled);
+    G4Colour colour(1.,0.,0.);
+    G4VisAttributes attribs(colour);
+    circle.SetVisAttributes(attribs);
+    pVVisManager->Draw(circle);
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCTrackerHit::Print()
+{
+  G4cout << "  trackID: " << trackID << "  chamberNb: " << chamberNb
+         << "  energy deposit: " << G4BestUnit(edep,"Energy")
+	 << "  position: " << G4BestUnit(pos,"Length") << G4endl;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCTrackerSD.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCTrackerSD.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCTrackerSD.cc	(revision 1316)
@@ -0,0 +1,100 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCTrackerSD.cc,v 1.2 2006/06/29 18:55:12 gunter Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#include "SCTrackerSD.hh"
+#include "G4HCofThisEvent.hh"
+#include "G4Step.hh"
+#include "G4ThreeVector.hh"
+#include "G4SDManager.hh"
+#include "G4ios.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCTrackerSD::SCTrackerSD(G4String name)
+:G4VSensitiveDetector(name)
+{
+  G4String HCname;
+  collectionName.insert(HCname="trackerCollection");
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCTrackerSD::~SCTrackerSD(){ }
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCTrackerSD::Initialize(G4HCofThisEvent* HCE)
+{
+  trackerCollection = new SCTrackerHitsCollection
+                          (SensitiveDetectorName,collectionName[0]); 
+  static G4int HCID = -1;
+  if(HCID<0)
+  { HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
+  HCE->AddHitsCollection( HCID, trackerCollection ); 
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+G4bool SCTrackerSD::ProcessHits(G4Step* aStep,G4TouchableHistory*)
+{
+  G4double edep = aStep->GetTotalEnergyDeposit();
+
+  if(edep==0.) return false;
+
+  SCTrackerHit* newHit = new SCTrackerHit();
+  newHit->SetTrackID  (aStep->GetTrack()->GetTrackID());
+  newHit->SetChamberNb(aStep->GetPreStepPoint()->GetTouchable()
+                                               ->GetReplicaNumber());
+  newHit->SetEdep     (edep);
+  newHit->SetPos      (aStep->GetPostStepPoint()->GetPosition());
+  trackerCollection->insert( newHit );
+  
+  //newHit->Print();
+  //newHit->Draw();
+
+  return true;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCTrackerSD::EndOfEvent(G4HCofThisEvent*)
+{
+  if (verboseLevel>0) { 
+     G4int NbHits = trackerCollection->entries();
+     G4cout << "\n-------->Hits Collection: in this event they are " << NbHits 
+            << " hits in the tracker chambers: " << G4endl;
+     for (G4int i=0;i<NbHits;i++) (*trackerCollection)[i]->Print();
+    } 
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
Index: trunk/source/geometry/solids/test/SurfaceChecker/src/SCVisManager.cc
===================================================================
--- trunk/source/geometry/solids/test/SurfaceChecker/src/SCVisManager.cc	(revision 1316)
+++ trunk/source/geometry/solids/test/SurfaceChecker/src/SCVisManager.cc	(revision 1316)
@@ -0,0 +1,156 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: SCVisManager.cc,v 1.3 2007/05/18 11:04:23 gcosmo Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// John Allison 24th January 1998.
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifdef G4VIS_USE
+
+#include "SCVisManager.hh"
+
+// Supported drivers...
+
+// Not needing external packages or libraries...
+#include "G4ASCIITree.hh"
+#include "G4DAWNFILE.hh"
+#include "G4HepRepFile.hh"
+#include "G4HepRep.hh"
+#include "G4RayTracer.hh"
+#include "G4VRML1File.hh"
+#include "G4VRML2File.hh"
+
+// Needing external packages or libraries...
+
+#ifdef G4VIS_USE_DAWN
+#include "G4FukuiRenderer.hh"
+#endif
+
+#ifdef G4VIS_USE_OPACS
+#include "G4Wo.hh"
+#include "G4Xo.hh"
+#endif
+
+#ifdef G4VIS_USE_OPENGLX
+#include "G4OpenGLImmediateX.hh"
+#include "G4OpenGLStoredX.hh"
+#endif
+
+#ifdef G4VIS_USE_OPENGLWIN32
+#include "G4OpenGLImmediateWin32.hh"
+#include "G4OpenGLStoredWin32.hh"
+#endif
+
+#ifdef G4VIS_USE_OPENGLXM
+#include "G4OpenGLImmediateXm.hh"
+#include "G4OpenGLStoredXm.hh"
+#endif
+
+#ifdef G4VIS_USE_OIX
+#include "G4OpenInventorX.hh"
+#endif
+
+#ifdef G4VIS_USE_OIWIN32
+#include "G4OpenInventorWin32.hh"
+#endif
+
+#ifdef G4VIS_USE_VRML
+#include "G4VRML1.hh"
+#include "G4VRML2.hh"
+#endif
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+SCVisManager::SCVisManager () {}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void SCVisManager::RegisterGraphicsSystems () {
+
+  // Graphics Systems not needing external packages or libraries...
+  RegisterGraphicsSystem (new G4ASCIITree);
+  RegisterGraphicsSystem (new G4DAWNFILE);
+  RegisterGraphicsSystem (new G4HepRepFile);
+  RegisterGraphicsSystem (new G4HepRep);
+  RegisterGraphicsSystem (new G4RayTracer);
+  RegisterGraphicsSystem (new G4VRML1File);
+  RegisterGraphicsSystem (new G4VRML2File);
+
+  // Graphics systems needing external packages or libraries...
+
+#ifdef G4VIS_USE_DAWN
+  RegisterGraphicsSystem (new G4FukuiRenderer);
+#endif
+
+#ifdef G4VIS_USE_OPACS
+  RegisterGraphicsSystem (new G4Wo);
+  RegisterGraphicsSystem (new G4Xo);
+#endif
+
+#ifdef G4VIS_USE_OPENGLX
+  RegisterGraphicsSystem (new G4OpenGLImmediateX);
+  RegisterGraphicsSystem (new G4OpenGLStoredX);
+#endif
+
+#ifdef G4VIS_USE_OPENGLWIN32
+  RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
+  RegisterGraphicsSystem (new G4OpenGLStoredWin32);
+#endif
+
+#ifdef G4VIS_USE_OPENGLXM
+  RegisterGraphicsSystem (new G4OpenGLImmediateXm);
+  RegisterGraphicsSystem (new G4OpenGLStoredXm);
+#endif
+
+#ifdef G4VIS_USE_OIX
+  RegisterGraphicsSystem (new G4OpenInventorX);
+#endif
+
+#ifdef G4VIS_USE_OIWIN32
+  RegisterGraphicsSystem (new G4OpenInventorWin32);
+#endif
+
+#ifdef G4VIS_USE_VRML
+  RegisterGraphicsSystem (new G4VRML1);
+  RegisterGraphicsSystem (new G4VRML2);
+#endif
+
+  if (fVerbose > 0) {
+    G4cout <<
+      "\nYou have successfully chosen to use the following graphics systems."
+	 << G4endl;
+    PrintAvailableGraphicsSystems ();
+  }
+}
+
+#endif
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
