From eab0010d4821b1857857796a1b239408dbbf8419 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Wed, 29 Nov 2017 13:26:34 +0100
Subject: [PATCH] Fix compatibility with XercesC 3.2; Add LHeD example from
 Peter; Fix compatibility with python3

---
 DDCMS/src/plugins/DDTIBLayerAlgo.cpp          |    1 +
 DDCore/include/DD4hep/DetElement.h            |    3 +
 DDCore/include/DD4hep/Readout.h               |   13 +-
 DDCore/include/DD4hep/Volumes.h               |    2 +
 DDCore/include/XML/config.h                   |   17 +-
 DDCore/src/DetElement.cpp                     |    5 +
 DDG4/tpython/DDPython.cpp                     |   39 +
 cmake/DD4hepBuild.cmake                       |    5 +-
 doc/CompileAllOptionPermutations.sh           |    4 +-
 doc/externalize/config.h                      |   53 +
 doc/externalize/externalize_xml.sh            |   13 +-
 examples/CLICSiD/CMakeLists.txt               |    8 +-
 examples/CMakeLists.txt                       |    4 +-
 examples/LHeD/CMakeLists.txt                  |  107 +
 examples/LHeD/compact/DDG4_field.xml          |    1 +
 examples/LHeD/compact/compact.xml             |    1 +
 .../LHeD/compact/compact_Lhe_dip_sol_circ.xml | 1920 ++++++++++++++++
 .../LHeD/compact/compact_Lhe_dip_sol_ell.xml  | 1932 +++++++++++++++++
 examples/LHeD/compact/detector_types.xml      |   74 +
 examples/LHeD/compact/elements.xml            |  884 ++++++++
 .../LHeD/compact/gGeoManager_commands.txt     |    2 +
 examples/LHeD/compact/materials.xml           |  148 ++
 examples/LHeD/compact/run.mac                 |    1 +
 examples/LHeD/compact/sensitive_detectors.xml |  165 ++
 examples/LHeD/compact/vis.mac                 |    1 +
 examples/LHeD/eve/DDEve-fcc-ell.xml           |  169 ++
 examples/LHeD/eve/DDEve-fcc.xml               |  169 ++
 examples/LHeD/eve/DDEve.C                     |    1 +
 examples/LHeD/eve/DDEve.xml                   |  168 ++
 examples/LHeD/scripts/DDG4_field.xml          |   19 +
 examples/LHeD/scripts/G4History.macro         |   35 +
 examples/LHeD/scripts/LHeD.py                 |   89 +
 examples/LHeD/scripts/LHeDACLick.C            |  128 ++
 examples/LHeD/scripts/LHeDMagField.py         |   13 +
 examples/LHeD/scripts/LHeDPhysics.py          |   13 +
 examples/LHeD/scripts/LHeDRandom.py           |   59 +
 examples/LHeD/scripts/LHeDScan.py             |   47 +
 examples/LHeD/scripts/LHeDXML.C               |   56 +
 examples/LHeD/scripts/LHeD_G4Gun.py           |   62 +
 examples/LHeD/scripts/LheSimu.py              |  330 +++
 examples/LHeD/scripts/TEve.C                  |   57 +
 examples/LHeD/scripts/compact-Lhe.xml         |    1 +
 examples/LHeD/scripts/elements.xml            |    1 +
 examples/LHeD/scripts/eve                     |    1 +
 examples/LHeD/scripts/initAClick.C            |   97 +
 examples/LHeD/scripts/materials.xml           |    1 +
 examples/LHeD/scripts/physics.xml             |   50 +
 examples/LHeD/scripts/rootlogon.C             |    3 +
 examples/LHeD/scripts/run.C                   |   27 +
 examples/LHeD/scripts/run.mac                 |   33 +
 examples/LHeD/scripts/sequences.xml           |  240 ++
 examples/LHeD/scripts/testDDPython.py         |   73 +
 examples/LHeD/scripts/vis.mac                 |  120 +
 examples/LHeD/sim/field.xml                   |   19 +
 examples/LHeD/sim/physics.xml                 |   69 +
 examples/LHeD/sim/sequences.xml               |  241 ++
 examples/LHeD/src/Lhe_BP_DiskTracker_geo.cpp  |  122 ++
 .../LHeD/src/Lhe_BP_MultiLayerTracker_geo.cpp |   83 +
 .../LHeD/src/Lhe_BP_SiTrackerEndcap2_geo.cpp  |  164 ++
 .../LHeD/src/Lhe_BP_SiVertexBarrel_geo.cpp    |  266 +++
 .../LHeD/src/Lhe_BeamPipe_Central_geo.cpp     |  214 ++
 examples/LHeD/src/Lhe_BoxSegment_geo.cpp      |   53 +
 .../LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp  |  163 ++
 .../LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp  |  163 ++
 examples/LHeD/src/Lhe_CylinderShell_geo.cpp   |   85 +
 .../Lhe_CylindricalBarrelCalorimeter_geo.cpp  |   79 +
 .../Lhe_CylindricalEndcapCalorimeter_geo.cpp  |  103 +
 examples/LHeD/src/Lhe_DiskTracker_geo.cpp     |   87 +
 examples/LHeD/src/Lhe_EcalBarrel_geo.cpp      |  167 ++
 examples/LHeD/src/Lhe_ForwardDetector_geo.cpp |  197 ++
 .../LHeD/src/Lhe_GenericSurfaceInstaller.cpp  |  181 ++
 .../LHeD/src/Lhe_MultiLayerTracker_geo.cpp    |   84 +
 examples/LHeD/src/Lhe_PolyconeSupport_geo.cpp |   65 +
 .../Lhe_PolyhedraBarrelCalorimeter2_geo.cpp   |  187 ++
 .../Lhe_PolyhedraEndcapCalorimeter2_geo.cpp   |  143 ++
 ...e_PolyhedraEndcapCalorimeter2_surfaces.cpp |   54 +
 examples/LHeD/src/Lhe_SiTrackerBarrel_geo.cpp |  170 ++
 .../LHeD/src/Lhe_SiTrackerBarrel_surfaces.cpp |   79 +
 .../LHeD/src/Lhe_SiTrackerEndcap2_geo.cpp     |  150 ++
 .../LHeD/src/Lhe_SiTrackerEndcap_surfaces.cpp |   46 +
 examples/LHeD/src/Lhe_Solenoid_o1_v01_gep.cpp |  136 ++
 .../LHeD/src/Lhe_SubdetectorAssembly_geo.cpp  |   85 +
 .../LHeD/src/Lhe_SurfaceExamplePlugin.cpp     |   41 +
 examples/LHeD/src/Lhe_TubeSegment_geo.cpp     |   53 +
 84 files changed, 11194 insertions(+), 20 deletions(-)
 create mode 100644 doc/externalize/config.h
 create mode 100644 examples/LHeD/CMakeLists.txt
 create mode 120000 examples/LHeD/compact/DDG4_field.xml
 create mode 120000 examples/LHeD/compact/compact.xml
 create mode 100644 examples/LHeD/compact/compact_Lhe_dip_sol_circ.xml
 create mode 100644 examples/LHeD/compact/compact_Lhe_dip_sol_ell.xml
 create mode 100644 examples/LHeD/compact/detector_types.xml
 create mode 100644 examples/LHeD/compact/elements.xml
 create mode 100644 examples/LHeD/compact/gGeoManager_commands.txt
 create mode 100644 examples/LHeD/compact/materials.xml
 create mode 120000 examples/LHeD/compact/run.mac
 create mode 100644 examples/LHeD/compact/sensitive_detectors.xml
 create mode 120000 examples/LHeD/compact/vis.mac
 create mode 100644 examples/LHeD/eve/DDEve-fcc-ell.xml
 create mode 100644 examples/LHeD/eve/DDEve-fcc.xml
 create mode 120000 examples/LHeD/eve/DDEve.C
 create mode 100644 examples/LHeD/eve/DDEve.xml
 create mode 100644 examples/LHeD/scripts/DDG4_field.xml
 create mode 100644 examples/LHeD/scripts/G4History.macro
 create mode 100644 examples/LHeD/scripts/LHeD.py
 create mode 100644 examples/LHeD/scripts/LHeDACLick.C
 create mode 100644 examples/LHeD/scripts/LHeDMagField.py
 create mode 100644 examples/LHeD/scripts/LHeDPhysics.py
 create mode 100644 examples/LHeD/scripts/LHeDRandom.py
 create mode 100644 examples/LHeD/scripts/LHeDScan.py
 create mode 100644 examples/LHeD/scripts/LHeDXML.C
 create mode 100644 examples/LHeD/scripts/LHeD_G4Gun.py
 create mode 100644 examples/LHeD/scripts/LheSimu.py
 create mode 100644 examples/LHeD/scripts/TEve.C
 create mode 120000 examples/LHeD/scripts/compact-Lhe.xml
 create mode 120000 examples/LHeD/scripts/elements.xml
 create mode 120000 examples/LHeD/scripts/eve
 create mode 100644 examples/LHeD/scripts/initAClick.C
 create mode 120000 examples/LHeD/scripts/materials.xml
 create mode 100644 examples/LHeD/scripts/physics.xml
 create mode 100644 examples/LHeD/scripts/rootlogon.C
 create mode 100644 examples/LHeD/scripts/run.C
 create mode 100644 examples/LHeD/scripts/run.mac
 create mode 100644 examples/LHeD/scripts/sequences.xml
 create mode 100644 examples/LHeD/scripts/testDDPython.py
 create mode 100644 examples/LHeD/scripts/vis.mac
 create mode 100644 examples/LHeD/sim/field.xml
 create mode 100644 examples/LHeD/sim/physics.xml
 create mode 100644 examples/LHeD/sim/sequences.xml
 create mode 100644 examples/LHeD/src/Lhe_BP_DiskTracker_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_BP_MultiLayerTracker_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_BP_SiTrackerEndcap2_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_BP_SiVertexBarrel_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_BoxSegment_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp
 create mode 100644 examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp
 create mode 100644 examples/LHeD/src/Lhe_CylinderShell_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_CylindricalBarrelCalorimeter_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_CylindricalEndcapCalorimeter_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_DiskTracker_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_EcalBarrel_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_ForwardDetector_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_GenericSurfaceInstaller.cpp
 create mode 100644 examples/LHeD/src/Lhe_MultiLayerTracker_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_PolyconeSupport_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_PolyhedraBarrelCalorimeter2_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_surfaces.cpp
 create mode 100644 examples/LHeD/src/Lhe_SiTrackerBarrel_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_SiTrackerBarrel_surfaces.cpp
 create mode 100644 examples/LHeD/src/Lhe_SiTrackerEndcap2_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_SiTrackerEndcap_surfaces.cpp
 create mode 100644 examples/LHeD/src/Lhe_Solenoid_o1_v01_gep.cpp
 create mode 100644 examples/LHeD/src/Lhe_SubdetectorAssembly_geo.cpp
 create mode 100644 examples/LHeD/src/Lhe_SurfaceExamplePlugin.cpp
 create mode 100644 examples/LHeD/src/Lhe_TubeSegment_geo.cpp

diff --git a/DDCMS/src/plugins/DDTIBLayerAlgo.cpp b/DDCMS/src/plugins/DDTIBLayerAlgo.cpp
index b19b3ca69..27f1570f5 100644
--- a/DDCMS/src/plugins/DDTIBLayerAlgo.cpp
+++ b/DDCMS/src/plugins/DDTIBLayerAlgo.cpp
@@ -484,6 +484,7 @@ static long algorithm(Detector& /* description */,
           << dohmRotation;
     }
 #else
+    if ( placeDohm || primReplica || auxReplica || dohmR>0e0 )  {} // Avoid warnings
     LogWarn("TIBGeom") << "DOOHM placement sucks for Geant4. ERASED!";
 #endif
     layer.placeVolume(dohmCarrier, dohmCarrierReplica, Transform3D(rotation,tran));// copyNr = dohmCarrierReplica
diff --git a/DDCore/include/DD4hep/DetElement.h b/DDCore/include/DD4hep/DetElement.h
index 876595119..6d4ef17ea 100644
--- a/DDCore/include/DD4hep/DetElement.h
+++ b/DDCore/include/DD4hep/DetElement.h
@@ -98,6 +98,9 @@ namespace dd4hep {
     /// Access readout structure of the sensitive detector
     Readout readout() const;
 
+    /// Access IDDescription structure
+    IDDescriptor idSpec() const;
+
     /// Set energy cut off
     SensitiveDetector& setEnergyCutoff(double value);
 
diff --git a/DDCore/include/DD4hep/Readout.h b/DDCore/include/DD4hep/Readout.h
index 90c77c59d..8a256a932 100644
--- a/DDCore/include/DD4hep/Readout.h
+++ b/DDCore/include/DD4hep/Readout.h
@@ -39,34 +39,45 @@ namespace dd4hep {
   public:
     /// Default constructor
     Readout() = default;
+
     /// Copy Constructor from object
     Readout(const Readout& e) = default;
+
 #ifndef __CINT__
     /// Copy Constructor from handle
     Readout(const Handle<ReadoutObject>& e) : Handle<Object>(e) { }
 #endif
+
     /// Constructor to be used when reading the already parsed object
     template <typename Q> Readout(const Handle<Q>& e) : Handle<Object>(e) { }
+
     /// Initializing constructor
     Readout(const std::string& name);
+
     /// Assignment operator
     Readout& operator=(const Readout& ro) = default;
+
     /// Access explicit names of hit collections if present
     std::vector<std::string> collectionNames()  const;
+
 #ifndef __CINT__
     /// Access hit collections if present
     std::vector<const HitCollection*> collections()  const;
 #endif
     /// Access number of hit collections
     size_t numCollections() const;
+    
     /// Assign IDDescription to readout structure
     void setIDDescriptor(const Ref_t& spec) const;
+
     /// Access IDDescription structure
     IDDescriptor idSpec() const;
+
     /// Assign segmentation structure to readout
     void setSegmentation(const Segmentation& segment) const;
+
     /// Access segmentation structure
     Segmentation segmentation() const;
   };
-} /* End namespace dd4hep                   */
+}         /* End namespace dd4hep         */
 #endif    /* DD4HEP_DDCORE_READOUT_H      */
diff --git a/DDCore/include/DD4hep/Volumes.h b/DDCore/include/DD4hep/Volumes.h
index f719b1955..70242093a 100644
--- a/DDCore/include/DD4hep/Volumes.h
+++ b/DDCore/include/DD4hep/Volumes.h
@@ -94,10 +94,12 @@ namespace dd4hep {
       template< class InputIt>
       iterator insert(InputIt first, InputIt last)
       {  return this->Base::insert(this->Base::end(), first, last);    }
+#if not defined __GNUCC__ || (defined __GNUCC__ && __GNUC_PREREQ(5,0) )
       /// Insert bunch of entries
       template< class InputIt>
       iterator insert(std::vector<VolID>::const_iterator pos, InputIt first, InputIt last)
       {  return this->Base::insert(pos, first, last);    }
+#endif
       /// String representation for debugging
       std::string str()  const;
     };
diff --git a/DDCore/include/XML/config.h b/DDCore/include/XML/config.h
index b742ea7a0..7c828c2fc 100644
--- a/DDCore/include/XML/config.h
+++ b/DDCore/include/XML/config.h
@@ -10,6 +10,10 @@
 // Author     : M.Frank
 //
 //==========================================================================
+//
+// Setup XML parsing for the use of Apache Xerces-C and TiXml
+//
+//==========================================================================
 #ifndef DD4HEP_XML_CONFIG_H
 #define DD4HEP_XML_CONFIG_H
 
@@ -20,10 +24,13 @@
 // C/C++ include files
 #include <cstdlib>
 
-/* Setup XML parsing for the use of Apache Xerces-C and TiXml
- *
- */
-
+#ifndef  __TIXML__
+// This is the absolute minimal include necessary to comply with XercesC
+// Not includuing this file leads to clashes in XmlChar aka XMLCh in XercesC.
+//
+// We do not load here many dependencies. This simply sets up primitive types.
+#include <xercesc/util/Xerces_autoconf_config.hpp>
+#endif
 
 /// Namespace for the AIDA detector description toolkit
 namespace dd4hep {
@@ -39,7 +46,7 @@ namespace dd4hep {
 #ifdef  __TIXML__
     typedef char XmlChar;
 #else
-    typedef unsigned short XmlChar;
+    typedef XERCES_XMLCH_T XmlChar;
 #endif
   }
 }
diff --git a/DDCore/src/DetElement.cpp b/DDCore/src/DetElement.cpp
index a00e9743c..557c0a784 100644
--- a/DDCore/src/DetElement.cpp
+++ b/DDCore/src/DetElement.cpp
@@ -369,6 +369,11 @@ Readout SensitiveDetector::readout() const {
   return access()->readout;
 }
 
+/// Assign the IDDescriptor reference
+IDDescriptor SensitiveDetector::idSpec() const {
+  return readout().idSpec();
+}
+
 /// Set energy cut off
 SensitiveDetector& SensitiveDetector::setEnergyCutoff(double value) {
   access()->ecut = value;
diff --git a/DDG4/tpython/DDPython.cpp b/DDG4/tpython/DDPython.cpp
index 240591d92..9a6278602 100644
--- a/DDG4/tpython/DDPython.cpp
+++ b/DDG4/tpython/DDPython.cpp
@@ -208,7 +208,27 @@ void DDPython::restoreThread()   {
 }
 
 int DDPython::setArgs(int argc, char** argv)  const   {
+  // Need to protect against API change from Python 2 to Python 3
+#if PY_VERSION_HEX < 0x03000000
   ::PySys_SetArgv(argc,argv);
+#else
+  vector<wstring> wargs;
+  vector<const wchar_t*> wargv;
+  for(int i=0; i<argc;++i)  {
+    std::wstring wstr;
+    if ( argv[i] )  {
+      const size_t size = strlen(argv[i]);
+      if (size > 0) {
+        wstr.resize(size+1);
+        std::mbstowcs(&wstr[0], argv[i], size);
+        wstr[size] = 0;
+      }
+    }
+    wargs.push_back(wstr);
+  }
+  for(auto& s : wargs ) wargv.push_back(s.c_str());
+  ::PySys_SetArgv(argc,(wchar_t**)&wargv[0]);
+#endif
   return 1;
 }
 
@@ -301,5 +321,24 @@ bool DDPython::isMainThread()   {
 
 /// Start the interpreter in normal mode without hacks like 'pythopn.exe' does.
 int DDPython::run_interpreter(int argc, char** argv)   {
+#if PY_VERSION_HEX < 0x03000000
   return ::Py_Main(argc, argv);
+#else
+  vector<wstring> wargs;
+  vector<const wchar_t*> wargv;
+  for(int i=0; i<argc;++i)  {
+    std::wstring wstr;
+    if ( argv[i] )  {
+      const size_t size = strlen(argv[i]);
+      if (size > 0) {
+        wstr.resize(size+1);
+        std::mbstowcs(&wstr[0], argv[i], size);
+        wstr[size] = 0;
+      }
+    }
+    wargs.push_back(wstr);
+  }
+  for( auto& s : wargs ) wargv.push_back(s.c_str());
+  return ::Py_Main(argc, (wchar_t**)&wargv[0]);
+#endif
 }
diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake
index 735ff31c9..250ef16d1 100644
--- a/cmake/DD4hepBuild.cmake
+++ b/cmake/DD4hepBuild.cmake
@@ -403,13 +403,14 @@ function ( dd4hep_find_packageEx PKG_NAME )
     set (pkg "DD4hep" )
   endif()
   dd4hep_debug( "Call find_package( ${pkg}/${PKG_NAME} ${ARGN})" )
+  ##MESSAGE(STATUS "Call find_package( ${pkg}/${PKG_NAME} ${ARGN})" )
   ##dd4hep_print ( "Call find_package( ${pkg}/${PKG_NAME} ${ARGN})" )
   if ( "${${pkg}_LIBRARIES}" STREQUAL "" )
     cmake_parse_arguments(ARG "" "" "ARGS" ${ARGN} )
     find_package( ${pkg} ${ARG_ARGS} )
   else()
     cmake_parse_arguments(ARG "" "" "ARGS" ${ARGN} )
-    find_package( ${pkg} QUIET ${ARG_ARGS} )
+    find_package( ${pkg} ${ARG_ARGS} )
   endif()
   # Propagate values to caller
   string ( TOUPPER "${pkg}" PKG )
@@ -419,6 +420,7 @@ function ( dd4hep_find_packageEx PKG_NAME )
     set ( libs ${libs}  ${${PKG}_LIBRARIES} ${${PKG}_LIBRARY} ${${PKG}_COMPONENT_LIBRARIES} )
     set ( incs ${incs}  ${${PKG}_INCLUDE_DIRS} ${${PKG}_INCLUDE_DIR} )
   endif()
+  ##MESSAGE(STATUS "Call find_package: ${pkg}/${PKG_NAME} -> ${libs}" )
   dd4hep_make_unique_list ( libs VALUES ${libs} )
   dd4hep_make_unique_list ( incs VALUES ${incs} )
 
@@ -1184,6 +1186,7 @@ endfunction(dd4hep_add_plugin)
 #
 #---------------------------------------------------------------------------------------------------
 function ( dd4hep_add_executable binary )
+  #set ( DD4HEP_DEBUG_CMAKE "ON" )
   dd4hep_package_properties( pkg PKG enabled )
   set ( tag "Executable[${pkg}] -> ${binary}" )
   if ( "${enabled}" STREQUAL "OFF" )
diff --git a/doc/CompileAllOptionPermutations.sh b/doc/CompileAllOptionPermutations.sh
index 8eb3ab74c..ff15ab257 100755
--- a/doc/CompileAllOptionPermutations.sh
+++ b/doc/CompileAllOptionPermutations.sh
@@ -162,7 +162,7 @@ build_all()
                     OPTS="`make_opt ${DOGEANT4} -DDD4HEP_USE_GEANT4 -DGeant4_DIR=${INSTALL_G4}`\
 		    `make_opt ${DOLCIO}     -DDD4HEP_USE_LCIO -DLCIO_DIR=${INSTALL_LCIO}` \
 		    `make_opt ${DOXERCESC}  -DDD4HEP_USE_XERCESC -DXERCESC_ROOT_DIR=${INSTALL_XERCESC}` \
-                    -DCLHEP_LIBRARY=${INSTALL_G4}/../libG4clhep.so \
+                    -DCLHEP_INCLUDE_DIR=${INSTALL_G4}/../../include/Geant4/CLHEP -DCLHEP_LIBRARY=${INSTALL_G4}/../libG4clhep.so \
                     -DROOTSYS=${ROOTSYS} -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/DD4hep";
 		    CMD="cd ${dir_name}/$folder ; cmake ${BUILD_TYPE} ${OPTS} ${CHECKOUT};";
                     make_build;
@@ -173,7 +173,7 @@ build_all()
                     OPTS_ex="`make_opt ${DOGEANT4} -DDD4HEP_USE_GEANT4 -DGeant4_DIR=${INSTALL_G4}`\
 		    `make_opt ${DOLCIO}     -DDD4HEP_USE_LCIO    -DLCIO_DIR=${INSTALL_LCIO}` \
 		    `make_opt ${DOXERCESC}  -DDD4HEP_USE_XERCESC -DXERCESC_ROOT_DIR=${INSTALL_XERCESC}` \
-                    -DCLHEP_LIBRARY=${INSTALL_G4}/../libG4clhep.so \
+                    -DCLHEP_INCLUDE_DIR=${INSTALL_G4}/../../include/Geant4/CLHEP -DCLHEP_LIBRARY=${INSTALL_G4}/../libG4clhep.so \
                     -DROOTSYS=${ROOTSYS}";
 		    source ${DD4hep_DIR}/bin/thisdd4hep.sh;
    		    CMD="cd ${WORK_DIR}/EX; cmake ${BUILD_TYPE} ${OPTS} -DDD4hep_DIR=${DD4hep_DIR} ${CHECKOUT}/examples;";
diff --git a/doc/externalize/config.h b/doc/externalize/config.h
new file mode 100644
index 000000000..3ff518a7e
--- /dev/null
+++ b/doc/externalize/config.h
@@ -0,0 +1,53 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+#ifndef DD4HEP_XML_CONFIG_H
+#define DD4HEP_XML_CONFIG_H
+
+#if      defined(DD4HEP_USE_TINYXML)
+#define  __TIXML__
+#endif
+
+// C/C++ include files
+#include <cstdlib>
+
+/* Setup XML parsing for the use of Apache Xerces-C and TiXml
+ *
+ */
+
+#define dd4hep Online
+
+/// Namespace for the AIDA detector description toolkit
+namespace dd4hep {
+
+  /// Namespace for the AIDA detector description toolkit supporting XML utilities
+  namespace xml {
+    class XmlElement;
+    class XmlDocument;
+    class XmlNodeList;
+    class XmlNode;
+    class XmlAttr;
+    typedef std::size_t XmlSize_t;
+#ifdef  __TIXML__
+    typedef char XmlChar;
+#else
+    typedef unsigned short XmlChar;
+#endif
+  }
+}
+
+#ifdef  __TIXML__
+#define XML_IMPLEMENTATION_TYPE " TinyXML DOM mini-parser   "
+#else   // Xerces-C
+#define XML_IMPLEMENTATION_TYPE " Apache Xerces-C DOM Parser"
+#endif  // __TIXML__
+#endif // DD4HEP_XML_CONFIG_H
diff --git a/doc/externalize/externalize_xml.sh b/doc/externalize/externalize_xml.sh
index 34e8e8523..089204477 100755
--- a/doc/externalize/externalize_xml.sh
+++ b/doc/externalize/externalize_xml.sh
@@ -15,21 +15,22 @@ copy_files()   {
     target=${1};
     cd DDCore/include/XML
     echo "+++ Copy header files from `pwd` to: ${target}/XML ....";
-    scp config.h DocumentHandler.h  tinyxml.h UriReader.h  XMLChildValue.h \
-        XMLDimension.h  XMLElements.h Evaluator.h tinystr.h   UnicodeValues.h \
-        XMLDimension.inl  XMLTags.h XML.h ${target}/XML/;
+    scp DocumentHandler.h Helper.h tinyxml.h tinystr.h UnicodeValues.h UriReader.h \
+        XMLChildValue.h XMLChildValue.inl \
+        XMLDimension.h  XMLElements.h XML.h XMLParsers.h XMLTags.h  ${target}/XML/;
+    scp -r detail ${target}/XML/;
     cd -;
     cd DDCore/src/XML;
     echo "+++ Copy source files from `pwd` to: ${target}/src ....";
     scp DocumentHandler.cpp tinyxmlerror_inl.h  tinyxml_inl.h  tinyxmlparser_inl.h \
-        UriReader.cpp XMLChildValue.cpp XMLDimension.cpp  \
-        XMLElements.cpp	XMLTags.cpp ${target}/src/;
+        UriReader.cpp XMLElements.cpp XMLHelpers.cpp XMLParsers.cpp XMLTags.cpp ${target}/src/;
     cd -;
-    cd DDCore/src/Evaluator;
+    cd DDParsers/src/Evaluator;
     echo "+++ Copy source files from `pwd` to: ${target}/Evaluator ....";
     scp Evaluator.cpp hash_map.src setStdMath.cpp setSystemOfUnits.cpp stack.src  string.src \
          ${target}/Evaluator/;
     cd -;
+    scp doc/externalize/config.h      ${target}/XML/;
     scp doc/externalize/Printout.h    ${target}/XML/;
     scp doc/externalize/Printout.cpp  ${target}/src/;
     scp doc/externalize/ExpressionEvaluator.cpp  ${target}/src/;
diff --git a/examples/CLICSiD/CMakeLists.txt b/examples/CLICSiD/CMakeLists.txt
index ba6d2fbb5..1ccd1cfa3 100644
--- a/examples/CLICSiD/CMakeLists.txt
+++ b/examples/CLICSiD/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: $
 #==========================================================================
 #  AIDA Detector description implementation 
 #--------------------------------------------------------------------------
@@ -16,16 +15,17 @@ include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 dd4hep_configure_output ()
 dd4hep_package ( CLICSiD MAJOR 0 MINOR 0 PATCH 1
   USES  [ROOT   REQUIRED COMPONENTS Geom] 
-        [dd4hep REQUIRED COMPONENTS DDCore]
+        [DD4hep REQUIRED COMPONENTS DDCore]
 )
 dd4hep_install_dir( compact scripts sim DESTINATION ${DD4hep_DIR}/examples/CLICSiD )
 #--------------------------------------------------------------------------
 if (DD4HEP_USE_GEANT4)
+  find_package(Geant4 REQUIRED)
   dd4hep_add_executable(CLICSiDXML SOURCES scripts/CLICSiDXML.C
-    USES  [dd4hep REQUIRED COMPONENTS DDCore DDG4] GEANT4 )
+    USES [DD4hep REQUIRED COMPONENTS DDCore DDG4] Geant4)
   #--------------------------------------------------------------------------
   dd4hep_add_executable(CLICSiDAClick SOURCES scripts/CLICSiDAClick.C
-    USES  [dd4hep REQUIRED COMPONENTS DDCore DDG4] GEANT4 )
+    USES [DD4hep REQUIRED COMPONENTS DDCore DDG4] Geant4)
 endif()
 #
 dd4hep_configure_scripts ( CLICSiD DEFAULT_SETUP WITH_TESTS )
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 68a3df1d3..334574fb3 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -43,8 +43,10 @@ dd4hep_package ( dd4hepExample MAJOR 0 MINOR 15 PATCH 0
                  [dd4hep REQUIRED COMPONENTS DDCore]
 )
 #
-dd4hep_enable_tests (AlignDet
+dd4hep_enable_tests (
   CLICSiD
+  LHeD
+  AlignDet
   ClientTests
   Conditions
   DDCMS
diff --git a/examples/LHeD/CMakeLists.txt b/examples/LHeD/CMakeLists.txt
new file mode 100644
index 000000000..898dc29b3
--- /dev/null
+++ b/examples/LHeD/CMakeLists.txt
@@ -0,0 +1,107 @@
+#==========================================================================
+#  AIDA Detector description implementation 
+#--------------------------------------------------------------------------
+# Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+# All rights reserved.
+#
+# For the licensing terms see $DD4hepINSTALL/LICENSE.
+# For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+# CLICSiD used as template!
+#==========================================================================
+cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
+
+#-----------------------------------------------------------------------------------
+dd4hep_configure_output ()
+dd4hep_package ( LHeD MAJOR 0 MINOR 0 PATCH 1
+  USES           [ROOT   REQUIRED COMPONENTS Geom GenVector MathCore] 
+                 [DD4hep REQUIRED COMPONENTS DDRec DDCore DDCond DDAlign]
+  )
+dd4hep_install_dir( src compact scripts sim DESTINATION ${DD4hep_DIR}/examples/LHeD )
+#-----------------------------------------------------------------------------------
+set(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/lib)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+dd4hep_add_plugin(LHeD SOURCES src/*.cpp)
+
+if (DD4HEP_USE_GEANT4)
+  find_package(Geant4 REQUIRED)
+  dd4hep_add_executable(LHeDXML SOURCES scripts/LHeDXML.C
+    USES [DD4hep REQUIRED COMPONENTS DDCore DDG4] Geant4)
+  #--------------------------------------------------------------------------
+  dd4hep_add_executable(LHeDACLick SOURCES scripts/LHeDACLick.C
+    USES [DD4hep REQUIRED COMPONENTS DDCore DDG4] Geant4)
+endif()
+#
+dd4hep_configure_scripts(LHeD DEFAULT_SETUP WITH_TESTS)
+#
+#---Testing-------------------------------------------------------------------------
+#
+#----- Tests for LHeD: here we simply require that at least 100 volumes have been converted
+foreach ( typ description gdml vis )
+  dd4hep_add_test_reg ( "LHeD_converter_${typ}_LONGTEST" 
+    COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
+    EXEC_ARGS  geoConverter -compact2${typ} 
+                            -input file:${CMAKE_CURRENT_SOURCE_DIR}/compact/compact.xml
+                            -output file:LHeD.${typ}
+    REGEX_PASS " Handled [1-9][0-9][0-9]+ volumes" )
+endforeach()
+#
+# ROOT Geometry overlap checks
+dd4hep_add_test_reg( LHeD_check_geometry_LONGTEST
+  COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
+  EXEC_ARGS  python ${DD4hep_DIR}/python/checkGeometry.py
+                    --compact=file:${CMAKE_CURRENT_SOURCE_DIR}/compact/compact.xml
+  # This takes too long                  --full=true --ntracks=10 --option=o --vx=0 --vy=0 --vz=0
+  REGEX_PASS " Execution finished..." )
+#
+# ROOT Geometry overlap checks
+dd4hep_add_test_reg( LHeD_check_overlaps_LONGTEST
+  COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
+  EXEC_ARGS  python ${DD4hep_DIR}/python/checkOverlaps.py 
+                    --compact=file:${CMAKE_CURRENT_SOURCE_DIR}/compact/compact.xml
+                    --tolerance=0.1
+  REGEX_PASS " Execution finished..." )
+#
+#---Geant4 Testsing-----------------------------------------------------------------
+#
+if (DD4HEP_USE_GEANT4)
+  #
+  # Basic DDG4 component/unit tests
+  foreach(script testDDPython LHeDMagField LHeDPhysics LHeDRandom LHeDScan)
+    dd4hep_add_test_reg( LHeD_DDG4_${script}_LONGTEST
+      COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
+      EXEC_ARGS  python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/${script}.py
+      REQUIRES   DDG4 Geant4
+      REGEX_PASS "TEST_PASSED"
+      REGEX_FAIL "Exception;EXCEPTION;ERROR" )
+  endforeach(script)
+  #
+  # Material scan
+  dd4hep_add_test_reg( LHeD_DDG4_g4material_scan_LONGTEST
+    COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
+    EXEC_ARGS  python ${DD4hep_DIR}/python/g4MaterialScan.py
+                      --compact=file:${CMAKE_CURRENT_SOURCE_DIR}/compact/compact.xml 
+                      "--position=0,0,0" "--direction=0,1,0"
+    REQUIRES   DDG4 Geant4
+    REGEX_PASS " Terminate Geant4 and delete associated actions." )
+  #
+  # Geant4 simulations with initialization using ACLick and XMl
+  foreach(script LHeDXML LHeDACLick)
+    #
+    # Build ACLick from the source file
+    dd4hep_add_test_reg( LHeD_DDG4_${script}_as_ACLick_LONGTEST
+      COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
+      EXEC_ARGS  root.exe -b -x -n -q -l "${CMAKE_CURRENT_SOURCE_DIR}/scripts/run.C(\"${DD4hep_DIR}/examples/LHeD/scripts/${script}\")"
+      REQUIRES   DDG4 Geant4
+      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=9"
+      REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" )
+    #
+    # Execute identical source linked executable 
+    dd4hep_add_test_reg( LHeD_DDG4_${script}_as_exe_LONGTEST
+      COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
+      EXEC_ARGS  ${script}
+      REQUIRES   DDG4 Geant4
+      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=9"
+      REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" )
+  endforeach(script)
+endif()
diff --git a/examples/LHeD/compact/DDG4_field.xml b/examples/LHeD/compact/DDG4_field.xml
new file mode 120000
index 000000000..4060bd006
--- /dev/null
+++ b/examples/LHeD/compact/DDG4_field.xml
@@ -0,0 +1 @@
+../scripts/DDG4_field.xml
\ No newline at end of file
diff --git a/examples/LHeD/compact/compact.xml b/examples/LHeD/compact/compact.xml
new file mode 120000
index 000000000..3f3f98321
--- /dev/null
+++ b/examples/LHeD/compact/compact.xml
@@ -0,0 +1 @@
+compact_Lhe_dip_sol_ell.xml
\ No newline at end of file
diff --git a/examples/LHeD/compact/compact_Lhe_dip_sol_circ.xml b/examples/LHeD/compact/compact_Lhe_dip_sol_circ.xml
new file mode 100644
index 000000000..bdceed6bc
--- /dev/null
+++ b/examples/LHeD/compact/compact_Lhe_dip_sol_circ.xml
@@ -0,0 +1,1920 @@
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--    XML description of the complete LHeC detector                       -->
+<!--    a detector for a new LHC option using a ERL e-source                -->
+<!--                                                                        -->
+<!--    Contained are the required                                          -->
+<!--      ++ global constants used uniquely by this detector                  -->
+<!--      ++ visualization attributes                                       -->
+<!--      ++ the definition of the readout structure and the                -->
+<!--         readout segmentation (if necessary)                            -->
+<!--      ++ [the include statements for the sensitive detectors and        -->
+<!--         the corresponding support structure(s)]                        -->
+<!--                                                                        -->
+<!--                                                                        -->
+<!--   @author  P.Kostka                                                    -->
+<!--   @date    old version 20.10.2017                                      -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">
+
+    <info name="LHeD_cdr"
+        title="LHeC Detector - based on CLIC Silicon Detector CDR"
+        author="Peter Kostka"
+        url="http:dummy-url.de"
+        status="development"
+        version="$Id: compact.xml 2013-12-13 12:28:53Z peter.kostka@cern.ch $">
+        <comment> The compact format for the LHeC Detector used for design studies </comment>
+    </info>
+
+    <includes>
+        <gdmlFile  ref="${Lhe_Detector_dir}/compact/elements.xml"/>
+        <gdmlFile  ref="${Lhe_Detector_dir}/compact/materials.xml"/>
+    </includes>
+
+    <define>
+        <constant name="Lhe_Detector_dir" value="${DD4hep}/examples/LHeD/" type="string"/>;
+        <constant name="world_side" value="20.*m"/>
+        <constant name="world_x" value="world_side"/>
+        <constant name="world_y" value="world_side"/>
+        <constant name="world_z" value="world_side"/>
+
+        <constant name="CrossingAngle" value="0.020*rad"/>
+
+        <constant name="tracking_region_radius" value="46.0*cm + 0.8*cm"/>
+        <constant name="SolenoidalFieldRadius"  value="100.0*cm + 0.2*m"/>
+
+        <constant name="CaloSides" value="12"/>
+        <constant name="MuonSides" value="8"/>
+
+    <comment> additional defined Parameters  - Lhe add-on </comment>
+        <constant name="CentralBeamPipe_zmax" value="580.0*cm"/>
+        <constant name="CentralBeamPipe_rmax" value="2.4*cm"/>
+        <constant name="CentralBeamPipe_thickness" value="0.40*cm"/>
+        <constant name="CentralEllBeamPipe_rmax" value="10.0*cm-CentralBeamPipe_thickness"/>
+        <constant name="CentralBeamPipe_rmin" value="CentralBeamPipe_rmax - CentralBeamPipe_thickness"/>
+        <constant name="BeamPipe_thickness" value="0.4*cm"/>
+        <constant name="BeamPipe_endThickness" value="0.1*cm"/>
+        <constant name="BeamPipe_zmax" value="420.0*cm - 0.5*cm"/>
+        <constant name="BeamPipe_rmax" value="5.6*cm"/>
+        <constant name="BeamPipe_rmin" value="BeamPipe_rmax - BeamPipe_thickness"/>
+
+        <constant name="Distance_VXDLayer" value="3.6*cm"/>
+        <constant name="Distance_VxBG10_in" value="0.03*cm"/>
+        <constant name="Distance_VxBG10_ou" value="0.03*cm"/>
+        <constant name="G10thickness" value="0.5*cm"/>
+        <constant name="VxBar_Env" value="0.6*cm"/>
+        <constant name="Distance_VxCo_in" value="Distance_VxBG10_ou + 0.01*cm"/>
+        <constant name="Distance_VxCo_ou" value="Distance_VxBG10_ou + 0.02*cm"/>
+
+        <constant name="VertexBarrel_r0" value="CentralBeamPipe_rmax+ VxBar_Env + 0.5*cm"/>                          <!-- 2.6 + 0.8       = 3.4-->
+        <constant name="VertexBarrel_r1"  value="VertexBarrel_r0 + VxBar_Env + Distance_VXDLayer"/>     <!-- 3.4 + 0.5 + 2.5 = 6.4-->
+        <constant name="VertexBarrel_r2"  value="VertexBarrel_r1 + VxBar_Env + Distance_VXDLayer"/>     <!-- 6.4 + 0.5 + 2.5 = 9.4-->
+        <constant name="VertexBarrel_r3"  value="VertexBarrel_r2 + VxBar_Env + Distance_VXDLayer"/>     <!-- 9.4 + 0.5 + 2.5 = 12.4-->
+
+        <constant name="VertexBG10_r0_in" value="VertexBarrel_r0 - 2*VxBar_Env - Distance_VxBG10_in"/>  <!-- 3.4 + 1.0 + 0.03 = 4.43-->
+        <constant name="VertexBG10_r1_in" value="VertexBarrel_r1 - 2*VxBar_Env - Distance_VxBG10_in"/>  <!-- 4.43 + 1.0 + 0.03 = 5.46-->
+        <constant name="VertexBG10_r2_in" value="VertexBarrel_r2 - 2*VxBar_Env - Distance_VxBG10_in"/>
+        <constant name="VertexBG10_r3_in" value="VertexBarrel_r3 - 2*VxBar_Env - Distance_VxBG10_in"/>
+
+        <constant name="VertexBG10_r0_ou" value="VertexBarrel_r0 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+        <constant name="VertexBG10_r1_ou" value="VertexBarrel_r1 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+        <constant name="VertexBG10_r2_ou" value="VertexBarrel_r2 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+        <constant name="VertexBG10_r3_ou" value="VertexBarrel_r3 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+
+        <constant name="VertexCo_r0_in" value="VertexBarrel_r0 - VxBar_Env -  Distance_VxCo_in"/>
+        <constant name="VertexCo_r1_in" value="VertexBarrel_r1 - VxBar_Env -  Distance_VxCo_in"/>
+        <constant name="VertexCo_r2_in" value="VertexBarrel_r2 - VxBar_Env -  Distance_VxCo_in"/>
+        <constant name="VertexCo_r3_in" value="VertexBarrel_r3 - VxBar_Env -  Distance_VxCo_in"/>
+
+        <constant name="VertexCo_r0_ou" value="VertexBarrel_r0 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="VertexCo_r1_ou" value="VertexBarrel_r1 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="VertexCo_r2_ou" value="VertexBarrel_r2 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="VertexCo_r3_ou" value="VertexBarrel_r3 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="Vertex_r_in" value="VertexBarrel_r0"/>
+        <constant name="Vertex_r_out" value="VertexBarrel_r3 + VxBar_Env +  Distance_VxCo_ou + 0.5*cm"/>
+
+
+        <constant name="VXD_Ell_Max_r" value="21.16*cm"/>
+        <constant name="Diff_Radius_SITLayer" value="3.2*cm"/>
+        <constant name="Distance_SITLayer" value="5.0*cm"/>
+        <constant name="Radius_SITLayer0" value="VXD_Ell_Max_r + 2.5*cm"/>                  <!-- 21.16 + 2.5 = 23.66-->
+        <constant name="Radius_SITLayer1" value="Radius_SITLayer0 + Distance_SITLayer"/>  <!-- 23.16 + 5. = 28.16-->
+        <constant name="Radius_SITLayer2" value="Radius_SITLayer1 + Distance_SITLayer"/>  <!-- 28.16 + 5. = 33.16-->
+        <constant name="Radius_SITLayer3" value="Radius_SITLayer2 + Distance_SITLayer"/>  <!-- 33.16 + 5. = 38.16-->
+        <constant name="Radius_SITLayer4" value="Radius_SITLayer3 + Distance_SITLayer"/>  <!-- 38.16 + 5. = 43.16--> 
+
+        <constant name="SiMod_w0" value="97.79*mm"/>
+        <constant name="SiMod_w1" value="97.79*mm"/>
+        <constant name="SiMod_w2" value="97.79*mm"/>
+        <constant name="SiMod_w3" value="97.79*mm"/>
+        <constant name="SiMod_w4" value="97.79*mm"/>
+        <constant name="SiWafer_w" value="92.031*mm"/>
+        <constant name="SiMod_l0" value="SiMod_w0"/>
+        <constant name="SiMod_l1" value="SiMod_w1"/>
+        <constant name="SiMod_l2" value="SiMod_w2"/>
+        <constant name="SiMod_l3" value="SiMod_w3"/>
+        <constant name="SiMod_l4" value="SiMod_w4"/>
+        <constant name="SiWafer_l" value="92.031*mm"/>
+
+        <constant name="SiMod_z0" value="54.0*cm"/>
+        <constant name="SiMod_z1" value="64.0*cm"/>
+        <constant name="SiMod_z2" value="74.0*cm"/>
+        <constant name="SiMod_z3" value="84.0*cm"/>
+        <constant name="SiMod_z4" value="94.0*cm"/>
+
+        <constant name="SiVXDEndcap_z0" value="SiMod_z0+0.5*cm"/>
+        <constant name="SiVXDEndcap_z1" value="SiMod_z2+0.5*cm"/>
+
+        <constant name="SiMod_zi0" value="SiMod_z0 - SiMod_w0 "/>
+        <constant name="SiMod_zi1" value="SiMod_z1 - SiMod_w1 "/>
+        <constant name="SiMod_zi2" value="SiMod_z2 - SiMod_w2 "/>
+        <constant name="SiMod_zi3" value="SiMod_z3 - SiMod_w3 "/>
+        <constant name="SiMod_zi4" value="SiMod_z4 - SiMod_w4 "/>
+
+
+      <comment>                 FTD parameters             </comment>
+        <constant name="Ftd_total_cylinder_thickness"          value="1.0*mm"/>
+        <constant name="Ftd_cables_thickness"                  value="0.08*mm"/>
+        <constant name="Ftd_Si_thickness1"                     value="0.3*mm"/>
+        <constant name="Ftd_Si_thickness2"                     value="0.3*mm"/>
+        <constant name="Ftd_inner_support_thickness"           value="2*mm"/>
+        <constant name="Ftd_inner_support_length"              value="4*mm"/>
+        <constant name="Ftd_outer_support_thickness"           value="10*mm"/>
+        <constant name="Ftd_outer_support_length"              value="4*mm"/>
+        <constant name="Diff_z_Ftd_disk" value="2.5*cm"/>
+      <comment>                ftd - pos z           </comment>
+        <constant name="Ftd_disk_z0"  value="65*cm"/>
+        <constant name="Ftd_disk_z1"  value="85*cm"/>
+        <constant name="Ftd_disk_z2"  value="140*cm"/>
+        <constant name="Ftd_disk_z3"  value="190*cm"/>
+        <constant name="Ftd_disk_z4"  value="260*cm"/>
+        <constant name="Ftd_disk_z5"  value="330*cm"/>
+        <constant name="Ftd_disk_z6"  value="370*cm"/>
+      <comment>            btd - neg z  </comment>
+        <constant name="Btd_disk_z0"  value="-65*cm"/>
+        <constant name="Btd_disk_z1"  value="-85*cm"/>
+        <constant name="Btd_disk_z2"  value="-130*cm"/>
+        <constant name="Btd_disk_z3"  value="-170*cm"/>
+        <constant name="Btd_disk_z4"  value="-200*cm"/>
+      <comment>            ftd - rings  </comment>
+        <constant name="Ftd_sdisk_ri0"  value="86.716*mm"/>
+        <constant name="Ftd_sdisk_ri1"  value="154.991*mm"/>
+        <constant name="Ftd_sdisk_ri2"  value="245.180*mm"/>
+        <constant name="Ftd_sdisk_ri3"  value="328.520*mm"/>
+        <constant name="Ftd_sdisk_ri4"  value="413.654*mm"/>
+
+        <constant name="EcalBarrel_rmin" value="((Radius_SITLayer4 + 6.0*cm) / (cos(pi/CaloSides)) )" />
+        <constant name="EcalBarrel_depth" value="40.*cm"/>
+        <constant name="EcalBarrel_fwd_depth" value="40.*cm"/>
+        <constant name="EcalBarrel_bwd_depth" value="40.*cm"/>
+        <constant name="EcalBarrel_rmax" value="( (EcalBarrel_rmin + EcalBarrel_depth + 1.0*cm)/(cos(pi/CaloSides)))"/>
+        <constant name="EcalBarrel_zmax" value="Ftd_disk_z6-Btd_disk_z4+10*cm "/>
+        <constant name="EcalBarrel_length" value="EcalBarrel_zmax - Btd_disk_z4 + 5.*cm"/>
+        <constant name="EcalEndcap_rmin" value="VertexBarrel_r1"/>
+        <constant name="EcalBarrel_zmin" value="Btd_disk_z4-2*cm "/>
+        <constant name="EcalEndcap_rmax" value="(EcalBarrel_rmin - 2.0*cm) / (cos(pi/CaloSides))"/>
+
+        <constant name="EcalEndcap_zmin_fwd" value="Ftd_disk_z6+5.0*cm"/>
+        <constant name="EcalEndcap_length_fwd" value="EcalBarrel_fwd_depth"/>
+        <constant name="EcalEndcap_length_bwd" value="EcalBarrel_bwd_depth"/>
+        <constant name="EcalEndcap_zmax_fwd" value="EcalEndcap_zmin_fwd+EcalEndcap_length_fwd"/>
+        <constant name="EcalEndcap_zmin_bwd" value="EcalBarrel_zmin-EcalEndcap_length_bwd"/>
+        <constant name="EcalEndcap_zmax_bwd" value="EcalEndcap_zmin_bwd+EcalEndcap_length_bwd"/>
+
+        <constant name="tracking_region_zmax" value="EcalEndcap_zmin_fwd - 1.0*cm"/>
+        <constant name="VXD_CF_sensor" value="0.026*cm"/>
+        <constant name="VXD_CF_support" value="0.05*cm"/>
+
+        <constant name="SolenoidBarrelInnerRadius1" value="EcalBarrel_rmax + 12.0*cm"/>
+        <constant name="SolenoidCoilOuterZ1" value="(EcalEndcap_zmin_fwd-EcalEndcap_zmax_bwd)/2."/>
+        <constant name="DipoleCoilOuterZ1" value="(EcalEndcap_zmin_fwd-EcalEndcap_zmax_bwd)/2."/>
+        <constant name="SolenoidBarrelInnerCryostatThickness1" value="3.0*cm"/>
+        <constant name="SolenoidBarrelInnerAirgapThickness1" value="1.5*cm"/>
+        <constant name="SolenoidBarrelAlConductorThickness1" value="6.0*cm"/>
+        <constant name="DipoleBarrelAlConductorThickness" value="1.5*cm"/>
+        <constant name="SolenoidBarrelQuenchbackThickness1" value="5.*cm"/>
+        <constant name="SolenoidBarrelOuterAirgapThickness1" value="3.*cm"/>
+        <constant name="SolenoidBarrelOuterCryostatThickness1" value="4.0*cm"/>
+        <constant name="SolenoidEndcapCryostatThickness1" value="3.0*cm"/>
+        <constant name="SolenoidEndcapAirgapThickness1" value="2.7*cm"/>
+        <constant name="SolenoidBarrelConductorInnerRadius1" value="SolenoidBarrelInnerRadius1 + 2.*SolenoidBarrelInnerCryostatThickness1 + SolenoidBarrelInnerAirgapThickness1"/>
+        <constant name="SolenoidBarrelOuterZ1" value="SolenoidCoilOuterZ1+SolenoidEndcapAirgapThickness1"/>
+        <constant name="SolenoidBarrelOuterCryostatInnerRadius1" value="SolenoidBarrelConductorInnerRadius1  + SolenoidBarrelAlConductorThickness1 + SolenoidBarrelQuenchbackThickness1 + DipoleBarrelAlConductorThickness + SolenoidBarrelInnerCryostatThickness1 + 4.*cm"/>
+        <constant name="SolenoidBarrelOuterRadius1" value="SolenoidBarrelOuterCryostatInnerRadius1 + SolenoidBarrelOuterAirgapThickness1 + SolenoidBarrelOuterCryostatThickness1"/>
+        <constant name="SolenoidalFieldRadius1" value="(SolenoidBarrelConductorInnerRadius1 + DipoleBarrelAlConductorThickness + SolenoidBarrelAlConductorThickness1 / 2.0)"/>
+        <constant name="DipoleBarrelAlConductorRadius" value="SolenoidBarrelOuterCryostatInnerRadius1 - SolenoidBarrelOuterAirgapThickness1 - SolenoidBarrelOuterCryostatThickness1"/>
+
+        <constant name="OffsetZ" value="85*cm"/>
+
+        <constant name="HcalBarrel_rmin" value="SolenoidBarrelOuterRadius1+5.0*cm"/>
+        <constant name="HcalBarrel_layers" value="(int) 85"/>
+        <constant name="HcalBarrel_layer_thickness" value="1.65*cm"/>
+        <constant name="HcalBarrel_length" value="EcalBarrel_zmax"/>
+
+        <constant name="HcalEndcap_fwd_layers" value="131"/>
+        <constant name="HcalEndcap_bwd_layers" value="113"/>        
+        <constant name="HcalEndcap_zmin_fwd" value="EcalBarrel_zmax + 5.0*cm"/> 
+        <constant name="HcalEndcap_rmin" value="VertexBarrel_r2"/>
+        <constant name="HcalBarrel_rmax" value="HcalBarrel_rmin+HcalBarrel_layers*HcalBarrel_layer_thickness"/>
+
+        <constant name="HcalEndcap_rmax" value="((HcalBarrel_rmin + HcalBarrel_layers * HcalBarrel_layer_thickness) / (cos(pi/CaloSides)))"/>
+
+        <constant name="HcalEndcap_layer_thickness_fwd" value="1.65*cm"/>
+        <constant name="HcalEndcap_layer_thickness_bwd" value="1.65*cm"/>
+        <constant name="HcalEndcap_thickness_fwd" value="HcalEndcap_fwd_layers*HcalEndcap_layer_thickness_fwd"/>
+        <constant name="HcalEndcap_thickness_bwd" value="HcalEndcap_bwd_layers*HcalEndcap_layer_thickness_bwd"/>
+        <constant name="HcalEndcap_zmax_fwd" value="HcalEndcap_zmin_fwd + HcalEndcap_thickness_fwd"/>
+        <constant name="HcalEndcap_zmin_bwd" value="EcalEndcap_zmin_bwd-HcalEndcap_thickness_bwd-4*cm"/>
+
+        <constant name="HcalPlug_fwd_layers" value="154"/>
+        <constant name="HcalPlug_bwd_layers" value="92"/>
+        <constant name="HcalPlug_layer_thickness_fwd" value="1.145*cm"/>
+        <constant name="HcalPlug_layer_thickness_bwd" value="1.6*cm"/>
+        <constant name="HcalPlug_thickness_fwd" value="HcalPlug_fwd_layers*HcalPlug_layer_thickness_fwd"/>
+        <constant name="HcalPlug_thickness_bwd" value="HcalPlug_bwd_layers*HcalPlug_layer_thickness_bwd"/>
+        <constant name="HcalPlug_zmin_bwd" value="EcalBarrel_zmin-EcalEndcap_length_bwd-HcalPlug_thickness_bwd"/>
+
+        <constant name="MuonBarrel_length" value="HcalBarrel_length + HcalEndcap_thickness_fwd + HcalEndcap_thickness_bwd"/>
+        <constant name="MuonEndcap_layers" value="12"/>
+        <constant name="MuonEndcap_layer_thickness" value="10.0*cm + 4.0*cm"/>
+        <constant name="MuonEndcap_thickness" value="MuonEndcap_layers*MuonEndcap_layer_thickness"/>
+
+        <constant name="MuonBarrel_zmin" value="HcalEndcap_zmin_bwd-HcalEndcap_thickness_bwd"/>
+        <constant name="MuonBarrel_layers" value="6"/>
+        <constant name="MuonBarrel_layer_thickness" value="10.0*cm + 4.0*cm"/>
+        <constant name="MuonBarrel_thickness" value="MuonBarrel_layers*MuonBarrel_layer_thickness"/>
+
+        <constant name="MuonBarrel_rmin" value="HcalEndcap_rmax + 2.0*cm"/>
+        <constant name="MuonBarrel_rmax" value="MuonBarrel_rmin + MuonBarrel_thickness"/>
+
+        <constant name="MuonEndcap_zmin_fwd" value="HcalEndcap_zmax_fwd-MuonEndcap_thickness-EcalEndcap_length_fwd+5.*cm"/> 
+        <constant name="MuonEndcap_rmax0" value="(HcalBarrel_rmin - 10.0*cm ) / (cos(pi/MuonSides))"/>
+        <constant name="MuonEndcap_zmin_bwd" value="MuonBarrel_zmin+EcalEndcap_length_bwd"/> 
+        <constant name="MuonEndcap_rmax1" value="(MuonBarrel_rmax)/(cos(pi/MuonSides))"/> 
+
+        <constant name="LumiCal_rmin" value="6.4*cm"/>
+        <constant name="LumiCal_rmax" value="EcalEndcap_rmin + 3.0*cm"/>
+        <constant name="LumiCal_zmin" value="HcalEndcap_zmin_fwd"/>
+        <constant name="LumiCal_thickness" value="20*0.371*cm + 15*0.643*cm"/>
+        <constant name="LumiCal_zmax" value="LumiCal_zmin + LumiCal_thickness"/>
+        <constant name="LumiCalElectronics_rmax" value="LumiCal_rmax+5.0*cm"/>
+
+        <constant name="SupportTube_thickness" value="1.0*cm"/>
+        <constant name="ForwardVacuumValve_thickness" value="36.0*cm"/>
+        <constant name="ForwardShielding_thickness" value="5.0*cm"/>
+        <constant name="ForwardMask_thickness" value="10.0*cm"/>
+        <constant name="ForwardMask_zmin" value="LumiCal_zmax + ForwardShielding_thickness + ForwardVacuumValve_thickness"/>
+        <constant name="BeamCal_rmax" value="13.0*cm"/>
+        <constant name="BeamCal_zmin" value="ForwardMask_zmin + ForwardMask_thickness"/>
+
+        <constant name="VertexSupport_r1" value="Radius_SITLayer1 - 0.5*cm"/>
+        <constant name="VertexSupport_r2" value="Radius_SITLayer2 - 0.5*cm"/>
+        <constant name="VertexSupport_zmax" value="52.0*cm"/>
+
+        <constant name="VertexBarrel_zmax" value="25.0*cm"/>
+
+        <constant name="bp_cone_slope" value="(BeamPipe_rmax-CentralBeamPipe_rmax)/(tracking_region_zmax-CentralBeamPipe_zmax)"/>
+        <constant name="BeamPipe_zmin" value="CentralBeamPipe_zmax + (BeamPipe_thickness - CentralBeamPipe_thickness)/bp_cone_slope"/>
+        <constant name="BeamPipeLiner_thickness" value="0.0*cm"/>
+        <constant name="BeamPipeLength" value="EcalBarrel_length"/>
+
+        <constant name="VertexService_zmin" value="SiMod_z4 + 2.0*cm"/>
+        <constant name="VertexService_zmax" value="VertexService_zmin + 2.0*cm"/>
+        <constant name="VertexServiceThickness" value="0.3*cm"/>
+        <constant name="VertexCableThickness" value="0.005*cm"/>
+
+        <constant name="IncomingBP_radius" value="0.25*cm"/>
+        <constant name="IncomingBP_thickness" value="0.05*cm"/>
+        <constant name="OutgoingBP_radius" value="tan(CrossingAngle/2/rad)*BeamCal_zmin"/>
+        <constant name="OutgoingBP_thickness" value="0.1*cm"/>
+
+    </define>
+    <materials>
+        <material formula="Si" name="silicon_2.33gccm" state="solid" >
+          <RL type="X0" unit="cm" value="9.36607" />
+          <NIL type="lambda" unit="cm" value="45.7531" />
+          <D type="density" unit="g/cm3" value="2.33" />
+          <composite n="1" ref="Si" />
+        </material>
+
+        <material name="silicon_8.72gccm" state="solid" >
+          <RL type="X0" unit="cm" value="9.36607" />
+          <NIL type="lambda" unit="cm" value="45.7531" />
+          <D type="density" unit="g/cm3" value="8.72" />
+          <composite n="1" ref="Si" />
+        </material>
+
+        <material formula="W" name="tungsten_19.3gccm" state="solid" >
+          <RL type="X0" unit="cm" value="0.350418" />
+          <NIL type="lambda" unit="cm" value="10.3057" />
+          <D type="density" unit="g/cm3" value="19.3" />
+          <composite n="1" ref="W" />
+        </material>
+
+        <material name="TungstenDens23">
+            <D value="17.7" unit="g/cm3"/>
+            <fraction n="0.925" ref="W"/>
+            <fraction n="0.066" ref="Ni"/>
+            <fraction n="0.009" ref="Fe"/>
+        </material>
+        <material name="TungstenDens24">
+            <D value="17.8" unit="g/cm3"/>
+            <fraction n="0.93" ref="W"/>
+            <fraction n="0.061" ref="Ni"/>
+            <fraction n="0.009" ref="Fe"/>
+        </material>
+        <material name="TungstenDens25">
+            <D value="18.2" unit="g/cm3"/>
+            <fraction n="0.950" ref="W"/>
+            <fraction n="0.044" ref="Ni"/>
+            <fraction n="0.006" ref="Fe"/>
+        </material>
+        <material name="CarbonFiber_25percent">
+            <D type="density" value="0.375" unit="g/cm3"/>
+            <fraction n="1.0" ref="CarbonFiber"/>
+        </material>
+        <material name="CarbonFiber_15percent">
+            <D type="density" value="0.225" unit="g/cm3"/>
+            <fraction n="1.0" ref="CarbonFiber"/>
+        </material>
+        <material name="Rohacell31_50percent">
+            <D type="density" value="0.016" unit="g/cm3"/>
+            <fraction n="1.0" ref="Rohacell31"/>
+        </material>
+        <material name="Rohacell31_15percent">
+            <D type="density" value="0.0048" unit="g/cm3"/>
+            <fraction n="1.0" ref="Rohacell31"/>
+        </material>
+        <material name="BoratedPolyethylene5">
+            <D value="0.93" unit="g/cm3"/>
+            <fraction n="0.612" ref="C"/>
+            <fraction n="0.222" ref="O"/>
+            <fraction n="0.116" ref="H"/>
+            <fraction n="0.050" ref="B"/>
+        </material>
+        <material name="SiliconCarbide">
+            <D value="3.1" unit="g/cm3"/>
+            <composite n="1" ref="Si"/>
+            <composite n="1" ref="C"/>
+        </material>
+        <material name="SiliconCarbide_6percent">
+            <D value="0.186" unit="g/cm3"/>
+            <fraction n="1.0" ref="SiliconCarbide"/>
+        </material>
+        <material name="Graphite">
+            <D value="1.7" unit="g/cm3"/>
+            <composite n="1" ref="C"/>
+        </material>
+        <material name="Polystyrene">
+           <D value="1.032" unit="g/cm3"/>
+           <composite n="19" ref="C"/>
+           <composite n="21" ref="H"/>
+        </material>
+    </materials>
+    <limits>
+        <limitset name="cal_limits">
+            <limit name="step_length_max" particles="*" value="5.0" unit="mm" />
+        </limitset>
+    <limitset name="SiTrackerBarrelRegionLimitSet">
+      <limit name="step_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="track_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="time_max" particles="*" value="5.0" unit="ns" />
+      <limit name="ekin_min" particles="*" value="0.01" unit="MeV" />
+      <limit name="range_min" particles="*" value="5.0" unit="mm" />
+    </limitset>
+    <limitset name="SiVertexBarrelRegionLimitSet">
+      <limit name="step_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="track_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="time_max" particles="*" value="5.0" unit="ns" />
+      <limit name="ekin_min" particles="*" value="0.01" unit="MeV" />
+      <limit name="range_min" particles="*" value="5.0" unit="mm" />
+    </limitset>
+    </limits>
+  <regions>
+    <region name="SiVertexBarrelRegion" eunit="MeV" lunit="mm" cut="0.001" threshold="0.001">
+      <limitsetref name="SiVertexBarrelRegionLimitSet"/>
+    </region>
+    <region name="SiTrackerBarrelRegion" eunit="MeV" lunit="mm" cut="0.001" threshold="0.001">
+      <limitsetref name="SiTrackerBarrelRegionLimitSet"/>
+    </region>
+  </regions>
+
+
+    <display>
+        <vis name="InvisibleNoDaughters"      showDaughters="false" visible="false"/>
+        <vis name="InvisibleWithDaughters"    showDaughters="true" visible="false"/>
+        <vis name="SiVertexBarrelModuleVis" alpha="0.6" r="1" g="0" b="0" drawingStyle="solid" showDaughters="true" visible="true"/>
+        <vis name="SiVertexSensitiveVis" alpha="0.8" r="1" g="0.2" b="0.2" drawingStyle="solid" showDaughters="true" visible="true"/>
+        <vis name="SiVertexPassiveVis"   alpha="0.5" r="0.2"  g="0"  b="0.62" drawingStyle="solid" showDaughters="true" visible="false"/>
+        <vis name="SiVertexBarrelLayerVis" alpha="0.2" r="0.1" g="0.1" b="0.6" showDaughters="true" visible="false"/>
+        <vis name="SiVertexBarrelROVis" alpha="0.2" r="0.2" g="0.4" b="0.4" showDaughters="true" visible="true"/>
+
+        <vis name="SiTrackerBarrelModuleVis" alpha="1" r="0.1" g="0.1" b="0.6" drawingStyle="solid" showDaughters="true" visible="true"/>
+        <vis name="SiTrackerBarrelLayerVis" alpha="0.5" r="1" g="1" b="0.6" showDaughters="true" visible="false"/>
+
+        <vis name="SiTrackerForwardVis" alpha="1" r="1" g="0" b="0" drawingStyle="solid" showDaughters="false" visible="true"/>
+        <vis name="SiTrackerBackwardVis" alpha="1" r="1" g="0" b="0" drawingStyle="solid" showDaughters="false" visible="true"/>
+        <vis name="SiTrackerForwardModulVis" alpha="1" r="1" g="0" b="0" drawingStyle="solid" showDaughters="false" visible="true"/>
+
+        <vis name="EcalBarrelVis"       alpha="0.1" r="0.2"   g="0.8" b="0.2" showDaughters="true" visible="true"/>
+        <vis name="EcalLayerVis"        alpha="0.1" r="0.2"   g="0.4" b="0.1" showDaughters="true" visible="true"/>        
+        <vis name="EcalBarrelStaveVis"  alpha="0.1" r="0"   g="0.9" b="0.1" showDaughters="true" visible="false"/>
+        <vis name="EcalSensitiveVis"    alpha="0.1" r="0"   g="0.9" b="0.2" showDaughters="true" visible="true"/>
+        <vis name="EcalAbsorberVis"     alpha="0.01" r="0"   g="0.9" b="0.2"  showDaughters="true" visible="false"/>
+        <vis name="EcalPlugVis"         alpha="1"   r="0.5" g="1"   b="0.8"  showDaughters="false" visible="true"/>
+        <vis name="EcalPlugSensitiveVis" alpha="0.1" r="0.5" g="1"   b="0.8" showDaughters="true" visible="true"/>
+
+        <vis name="HcalBarrelVis"          alpha="1"   r="1"    g="0.8"  b="0.6" showDaughters="false" visible="true"/>
+        <vis name="HcalSensorVis"          alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="true" visible="true"/>
+        <vis name="HcalAbsorberVis"        alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="false" visible="false"/>
+        <vis name="HcalBarrelStavesVis"    alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="true" visible="false"/>
+        <vis name="HcalBarrelLayerVis"     alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="false" visible="false"/>
+        <vis name="HcalBarrelSensorVis"    alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="true" visible="true"/>
+
+        <vis name="HcalEndcapVis"           alpha="1"   r="1"    g="0.8"  b="0.6" showDaughters="false" visible="true"/>
+        <vis name="HcalEndcapLayerVis"      alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="false" visible="false"/>
+        <vis name="HcalEndcapStavesVis"     alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="true" visible="false"/>
+        <vis name="HcalPlugVis"             alpha="1"   r="1"  g="0.8"  b="0.7" showDaughters="false" visible="true"/>
+        <vis name="HcalPlugLayerVis"        alpha="0.1" r="1"  g="0.9"  b="0.8" showDaughters="false" visible="false"/>
+
+        <vis name="SolenoidBarrelLayerVis" alpha="0.6" r="0.3" g="0.9"  b="0.4" showDaughters="false" visible="true"/>
+        <vis name="SolenoidDipoleBarrelLayerVis" alpha="0.6" r="0.2" g="0.9" b="0.9" showDaughters="false" visible="true"/>
+        <vis name="SolenoidBarrelSupportLayerVis" alpha="0.2" r="0.4" g="0.4" b="0.4" showDaughters="false" visible="false"/>
+
+        <vis name="SolenoidCoilEndsVis"    alpha="1" r="0" g="0.8"  b="0.8" showDaughters="true" visible="true"/>
+        <vis name="AntiSolenoidVis"        alpha="1" r="0.3"  g="1"    b="1"   showDaughters="true" visible="true"/>
+
+        <vis name="MuonBarrelVis"          alpha="0.1" r="0.8"  g="0.9"  b="1"  showDaughters="false" visible="true"/>
+        <vis name="MuonBarrelStavesVis"    alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="true" visible="false"/>
+        <vis name="MuonBarrelLayerVis"     alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="true" visible="false"/>
+        <vis name="MuonBarrelSensorVis"    alpha="0.4" r="0.8"  g="0.9"  b="1"  visible="true"/>
+        <vis name="MuonBarrelAbsorberVis"  alpha="0.4" r="0.8"  g="0.9"  b="1"  visible="false"/>
+
+        <vis name="MuonEndcapVis"          alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="false" visible="true"/>
+        <vis name="MuonEndcapLayerVis"     alpha="0.4" r="0.8"  g="0.9"  b="1"   showDaughters="true" visible="false"/>
+        <vis name="MuonEndcapSensorVis"    alpha="0.4" r="0.8"  g="0.9"  b="1"  visible="true"/>
+        <vis name="MuonEndcapAbsorberVis"  alpha="0.4" r="0.8"  g="0.9"  b="1"  visible="false"/>
+
+        <vis name="BeamPipeVis" alpha="1" r="0.9" g="0.9" b="0.9" showDaughters="true" visible="true"/> 
+        <vis name="CableVis" showDaughters="false" visible="false"/>
+
+        <vis name="SupportTubeVis" alpha="1" r="0.7" g="0.7" b="0.2" showDaughters="true" visible="true"/>
+        <vis name="TungstenShieldingVis" r="0.99" g="0.1" b="0.2" showDaughters="false" visible="true"/>
+
+        <vis name="SupportVis" r="0.01" g="0.7" b="0" showDaughters="true" visible="true"/>
+        <vis name="LumiCalVis" showDaughters="false" visible="true"/>
+        <vis name="GreenVis" r="0.0" g="1.0" b="0.0" showDaughters="false" visible="true"/>
+        <vis name="RedVis" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
+        <vis name="BlueVis" alpha="0.5" r="0.1" g="0.0" b="0.8" showDaughters="true" visible="true"/>
+        <vis name="BlueVisTrans" alpha="0.1" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="false"/>
+    </display>
+
+
+
+<!-- -->
+  <detectors>
+    <detector id="99" name="SiTrackers" type="Lhe_SubdetectorAssembly" vis="InvisibleWithDaughters">
+      <shape name="SiTrackersEnv" type="Tube" rmin="0.*cm" rmax="EcalBarrel_rmin-1*cm" dz="CentralBeamPipe_zmax+5*cm" material="Air">
+      </shape>
+      <comment>Silicon Tracker Assembly</comment>
+      <composite name="SiVertexBarrel"/>
+      <composite name="SiTrackerBarrel"/>
+      <composite name="SiTrackerForward"/>
+      <composite name="SiTrackerBackward"/>
+      <composite name="VertexBarrelSupports"/>
+      <composite name="VertexEndSupports"/>
+      <composite name="VertexReadout"/>
+      <composite name="TrackerBarrelSupports"/>
+      <composite name="TrackerReadout"/>
+      <composite name="Beampipe"/>
+    </detector>
+  </detectors>
+    
+    <detectors>
+
+        <comment>Trackers</comment>
+
+<!-- SiVertexBarrel -->
+        <comment>Vertex Detector Barrel</comment>
+        <detector id="1" name="SiVertexBarrel"
+                         type="Lhe_SiTrackerBarrel" 
+                         readout="SiVertexBarrelHits" 
+                         insideTrackingVolume="true" 
+                         reflect="true" 
+                         region="SiVertexBarrelRegion" 
+                         limits="SiVertexBarrelRegionLimitSet">
+    		<module name="VtxBarrelModuleInner" vis="SiVertexBarrelModuleVis">
+      		<module_envelope width="10.0*mm" length="(VertexBarrel_zmax - 0.1*cm) * 2" thickness="VxBar_Env"/>
+     		 <module_component width="7.8*mm" length="(VertexBarrel_zmax - 0.15*cm) * 2" thickness="0.0130*cm" material="CarbonFiber_50D" sensitive="false" vis="SiVertexPassiveVis">
+				<position z="-0.12*mm"/>
+   		     </module_component>
+             <module_component 
+                  width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="SiVertexPassiveVis">
+	            <position z="-0.024*cm" />
+             </module_component>
+		     <module_component width="9.8*mm" length="(VertexBarrel_zmax - 0.15*cm) * 2" thickness="0.005*cm" material="Silicon" sensitive="true" vis="SiVertexSensitiveVis">
+				<position z="0.225*mm"/>
+      		 </module_component>
+             <module_component 
+                  width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0038*cm" material="Kapton" sensitive="false" vis="SiVertexPassiveVis">
+				<position z="0.1375*cm"/>
+             </module_component>
+                <module_component 
+                  width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.00038*cm" material="Copper" sensitive="false" vis="SiVertexPassiveVis">
+				<position z="0.146*cm"/>
+             </module_component>
+    		</module>
+<!---->
+            <layer module="VtxBarrelModuleInner" id="1" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="VertexBarrel_r0 - VxBar_Env*1.2"
+                  outer_r="VertexBarrel_r0 + 1.8*VxBar_Env"
+                  z_length="VertexBarrel_zmax*4"/>
+                <rphi_layout
+                  phi_tilt="0.52*rad"
+                  nphi="20"
+                  phi0="0.2618*rad"
+                  rc="VertexBarrel_r0 + 0*mm"
+                  dr="0.*mm"/>
+                <z_layout dr="0.0*mm" z0="0*mm" nz="14"/>
+            </layer>
+
+            <layer module="VtxBarrelModuleInner" id="2" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="VertexBarrel_r1 - VxBar_Env*1.2"
+                  outer_r="VertexBarrel_r1 + 1.8*VxBar_Env"
+                  z_length="VertexBarrel_zmax*4"/>
+                <rphi_layout
+                  phi_tilt="0.54*rad"
+                  nphi="36"
+                  phi0="0.2618*rad"
+                  rc="VertexBarrel_r1 + 0*mm"
+                  dr="0.*mm"/>
+                <z_layout dr="0.0" z0="0.0" nz="14"/>
+            </layer>
+
+            <layer module="VtxBarrelModuleInner" id="3" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="VertexBarrel_r2 - VxBar_Env*1.2"
+                  outer_r="VertexBarrel_r2 + 1.8*VxBar_Env"
+                  z_length="VertexBarrel_zmax*4"/>
+                <rphi_layout
+                  phi_tilt="0.56*rad"
+                  nphi="50"
+                  phi0="0.0"
+                  rc="VertexBarrel_r2 + 0*mm"
+                  dr="0.*mm"/>
+                <z_layout dr="0.0" z0="0.0" nz="1"/>
+            </layer>
+
+            <layer module="VtxBarrelModuleInner" id="4" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="VertexBarrel_r3 - VxBar_Env*1.2"
+                  outer_r="VertexBarrel_r3 + 1.8*VxBar_Env"
+                  z_length="VertexBarrel_zmax*4"/>
+                <rphi_layout
+                  phi_tilt="0.56*rad"
+                  nphi="60"
+                  phi0="0.01745*rad"
+                  rc="VertexBarrel_r3 + 0*mm"
+                  dr="0.*mm"/>
+                <z_layout dr="0.0" z0="0.0" nz="1"/>
+            </layer>
+        </detector>
+
+  
+<!-- -->
+       <comment>Vertex Detector Supports </comment>
+        <detector name="VertexBarrelSupports" 
+                  type="Lhe_MultiLayerTracker" 
+                   reflect="true" 
+                 vis="SupportTubeVis">
+            <comment>Double-walled Carbon Fiber support tube</comment>
+
+            <layer id="1" 
+              inner_r = "VertexBarrel_r0 - 0.7*cm" 
+              outer_z = "VertexBarrel_zmax*2" 
+              outer_r = "VertexBarrel_r0 - 0.2*cm">
+                <slice material = "CarbonFiber" thickness ="VXD_CF_support"/>
+            </layer>
+            
+            <layer id="2" 
+              inner_r = "VertexBarrel_r3 + 2*VxBar_Env + 1*cm" 
+              outer_z = "VertexBarrel_zmax*2" 
+              outer_r = "VertexBarrel_r3 + 2*VxBar_Env + 1.5*cm">
+                <slice material = "CarbonFiber" thickness ="VXD_CF_support"/>
+            </layer>
+        
+        </detector>
+
+<!-- -->
+        <detector name="VertexEndSupports" 
+                  type="Lhe_DiskTracker" 
+                  reflect="true" 
+                  vis="SiVertexBarrelROVis">
+        
+            <layer id="3" 
+              inner_r = "VertexBarrel_r0 - 0.7*cm" 
+              inner_z="VertexBarrel_zmax*2 + 0.2*cm" 
+              outer_r = "VertexBarrel_r0 - 0.2*cm">
+                <slice material = "CarbonFiber" thickness = "VXD_CF_support" />
+            </layer>
+
+            <layer id="4" 
+              inner_r = "VertexBarrel_r3 + 2*VxBar_Env + 1*cm" 
+              inner_z="VertexBarrel_zmax*2 + 0.2*cm" 
+              outer_r = "VertexBarrel_r3 + 2*VxBar_Env + 1.5*cm">
+                <slice material = "CarbonFiber" thickness = "VXD_CF_support" />
+            </layer>
+        </detector>
+
+<!-- VertexReadout  -->
+        <detector name="VertexReadout" 
+                  type="Lhe_DiskTracker" 
+                  reflect="true"
+                  sensitive="false" 
+                  vis="SiVertexBarrelROVis">
+            <comment>Readout and Cabling</comment>
+
+            <layer id="5"
+              inner_r = "VertexBG10_r0_in" 
+              outer_r="VertexBG10_r0_ou"  
+              inner_z= "VertexBarrel_zmax*2 + 0.1*cm" vis="GreenVis">
+                <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="6"
+              inner_r = "VertexBG10_r1_in" 
+              outer_r="VertexBG10_r1_ou" 
+              inner_z="VertexBarrel_zmax*2 + 0.1*cm" 
+              vis = "GreenVis">
+                <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="7" 
+              inner_r = "VertexBG10_r2_in" 
+              outer_r="VertexBG10_r2_ou"  
+              inner_z="VertexBarrel_zmax*2 + 0.1*cm" 
+              vis="GreenVis">
+                <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="8" 
+              inner_r = "VertexBG10_r3_in" 
+              outer_r="VertexBG10_r3_ou"  
+              inner_z= "VertexBarrel_zmax*2 + 0.1*cm" 
+              vis="GreenVis">
+                <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="9" 
+              inner_r = "VertexCo_r0_in" 
+              outer_r = "VertexCo_r0_ou"  
+              inner_z= "VertexBarrel_zmax*2 + 0.6*cm" 
+              vis="BlueVis">
+                <slice material = "Copper" thickness ="0.0057*cm"/>
+            </layer>
+
+            <layer id="10" 
+              inner_r = "VertexCo_r1_in" 
+              outer_r = "VertexCo_r1_ou"  
+              inner_z= "VertexBarrel_zmax*2 + 0.6*cm" 
+              vis="BlueVis">
+                <slice material = "Copper" thickness ="0.0031*cm"/>
+            </layer>
+
+            <layer id="11" 
+              inner_r = "VertexCo_r2_in" 
+              outer_r = "VertexCo_r2_ou"  
+              inner_z= "VertexBarrel_zmax*2 + 0.6*cm" 
+              vis="BlueVis">
+                <slice material = "Copper" thickness ="0.0016*cm"/>
+            </layer>
+
+            <layer id="12" 
+              inner_r = "VertexCo_r3_in" 
+              outer_r = "VertexCo_r3_ou"  
+              inner_z= "VertexBarrel_zmax*2 + 0.6*cm" 
+              vis="BlueVis">
+                <slice material = "Copper" thickness ="0.0007*cm"/>
+            </layer>
+
+        </detector>
+
+
+
+<!--SiTrackerBarrel -->
+        <detector id="2" name="SiTrackerBarrel" 
+                         type="Lhe_SiTrackerBarrel" 
+                         insideTrackingVolume="true" 
+                         readout="SiTrackerBarrelHits" 
+                         region="SiTrackerBarrelRegion" 
+                         limits="SiTrackerBarrelRegionLimitSet">
+            <comment>Outer Tracker Barrel</comment>
+
+            <module name="SiTrackerModule_Layer0"   vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.3*cm"/>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false">
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false">
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component 
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.0038*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.00038*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer1" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.3*cm"/>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false">
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.0175*cm"  material="Epoxy" sensitive="false" vis="false">
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component                 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>                
+                <module_component 
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>                
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>                
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.0051*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>                
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.00052*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer2" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.3*cm"/>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false" >
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.0064*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.00065*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer3" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.3*cm"/>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false" >
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.0078*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.00079*cm" material="Copper" sensitive="false" vis="false" >
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer4" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.3*cm"/>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false" >
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false">
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.0091*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.00093*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <layer module="SiTrackerModule_Layer0" id="1" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="Radius_SITLayer0 + 8.*mm" 
+                  outer_r="Radius_SITLayer0+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z0*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="17" phi0="0."  rc="Radius_SITLayer0 + 12.*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi0" nz="11"/>               
+            </layer>   <comment>  z-length = +-53cm; radius = 24cm </comment>
+
+            <layer module="SiTrackerModule_Layer1" id="2" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="Radius_SITLayer1" 
+                  outer_r="Radius_SITLayer1+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z1*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="20" phi0="0.087*rad"  rc="Radius_SITLayer1 + 8*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi1" nz="13"/>        
+            </layer>   <comment>  z-length = +-59cm; radius = 29cm  </comment>
+          
+            <layer module="SiTrackerModule_Layer2" id="3" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="Radius_SITLayer2" 
+                  outer_r="Radius_SITLayer2+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z2*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="24" phi0="0.058*rad"  rc="Radius_SITLayer2 + 8*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi2" nz="14"/>
+            </layer>    <comment>  z-length = +-69cm; radius = 34cm  </comment>
+          
+            <layer module="SiTrackerModule_Layer3" id="4" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="Radius_SITLayer3" 
+                  outer_r="Radius_SITLayer3+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z3*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="28" phi0="0.0436*rad" rc="Radius_SITLayer3 + 8.*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi3" nz="18"/>
+            </layer>    <comment>  z-length = +-79cm; radius = 39cm  </comment>
+           
+            <layer module="SiTrackerModule_Layer4" id="5" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="Radius_SITLayer4"  
+                  outer_r="Radius_SITLayer4+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z4*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="32" phi0="0.01745*rad" rc="Radius_SITLayer4 + 8*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi4" nz="22"/>
+            </layer>    <comment>  z-length = +-89cm; radius = 44cm  </comment>                        
+        </detector>
+
+
+
+<!-- -->
+
+        <comment>   Outer Tracker Supports   </comment>
+
+        <detector name="TrackerBarrelSupports" 
+                  type="Lhe_MultiLayerTracker" 
+                  reflect="true" 
+                  vis="SupportVis">
+            <comment>Barrels</comment>
+ 
+            <layer id="1" 
+              inner_r = "Radius_SITLayer0 - VxBar_Env*0.3" 
+              outer_z = "SiMod_z0 + VxBar_Env/4 - 2.*cm">
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+            <layer id="2" 
+               inner_r="Radius_SITLayer1 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z1 + VxBar_Env/4 - 1.5*cm">
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+            <layer id="3" 
+               inner_r="Radius_SITLayer2 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z2 + VxBar_Env/4 - 1.5*cm">>
+                <slice material= "CarbonFiber" thickness = "0.05*cm" />
+                <slice material= "Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material= "CarbonFiber" thickness="0.05*cm" />
+            </layer>
+
+            <layer id="4" 
+               inner_r="Radius_SITLayer3 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z3 + VxBar_Env/4 - 1.5*cm">>
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+
+            <layer id="5" 
+               inner_r="Radius_SITLayer4 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z4 + VxBar_Env/4 - 1.5*cm">>
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+
+       </detector>
+
+<!-- -->
+        <detector name="TrackerBReadout" 
+                  type="Lhe_DiskTracker" 
+                  reflect="true" 
+                  vis="GreenVis">
+            <comment>Readouts</comment>
+
+            <layer id="1" 
+              inner_r="Radius_SITLayer0 - VxBar_Env " 
+              inner_z="SiMod_z0" 
+              outer_r="Radius_SITLayer0 ">
+                <slice material="G10" thickness="0.057*cm" />
+                <slice material="Copper" thickness="0.0038*cm" />
+            </layer>
+ 
+            <layer id="2" 
+              inner_r="Radius_SITLayer1 - VxBar_Env*2 " 
+              inner_z="SiMod_z1" 
+              outer_r="Radius_SITLayer1 ">
+                <slice material = "G10" thickness="0.102*cm" />
+                <slice material = "Copper" thickness="0.0068*cm" />
+            </layer>
+            <layer id="3" 
+              inner_r="Radius_SITLayer2 - VxBar_Env*2 " 
+              inner_z="SiMod_z2" 
+              outer_r="Radius_SITLayer2 ">
+                <slice material="G10" thickness="0.108*cm" />
+                <slice material="Copper" thickness="0.0072*cm" />
+            </layer>
+            <layer id="4" 
+              inner_r="Radius_SITLayer3 - VxBar_Env*2 " 
+              inner_z="SiMod_z3" 
+              outer_r="Radius_SITLayer3 ">
+                <slice material="G10" thickness="0.186*cm" />
+                <slice material="Copper" thickness="0.0124*cm" />
+            </layer>
+            <layer id="5" 
+              inner_r= "Radius_SITLayer4 - VxBar_Env*2 " 
+              inner_z="SiMod_z4" 
+              outer_r="Radius_SITLayer4 ">
+                <slice material="G10" thickness="0.246*cm" />
+                <slice material="Copper" thickness="0.0164*cm" />
+            </layer>
+
+        </detector>
+
+       
+<!-- fwd-tracker -->
+
+        <detector id="3" name="SiTrackerForward" 
+                         type="Lhe_SiTrackerEndcap2" 
+                         readout="SiTrackerForwardHits" 
+                         reflect="false"
+                         r="VertexBarrel_r0 - VxBar_Env"
+                         rmax="CentralBeamPipe_rmax + 1.*cm + 7.5*cm"
+                         vis="SiTrackerForwardVis">
+            <comment>Forward Tracker outside Barrel Support</comment>
+            <module name="Module1" vis="SiTrackerForwardModulVis">
+                <trd x1="36.112*mm" x2="46.635*mm" z="100.114/2*mm" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+            </module>
+            <module name="Module2" vis="SiTrackerForwardModulVis">
+                <trd x1="45.245*mm" x2="54.680*mm" z="89.773/2*mm" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+            </module>
+
+           <layer id="1">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z0+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z0+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z0+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>    <comment> new: middle-z-pos. = +75cm; outer_radius = 32cm  </comment>
+
+           <layer id="2">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z1+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z1+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z1+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>     <comment>  middle-z-pos. = +92.5cm; outer_radius = 38cm  </comment>
+
+           <layer id="3">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z2+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z2+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z2+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z2+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z2+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +142cm; outer_radius = 46cm  </comment>
+
+           <layer id="4">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z3+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z3+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z3+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z3+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z3+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +192cm; outer_radius = 46cm  </comment>
+
+           <layer id="5">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z4+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z4+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z4+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z4+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z4+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +267cm; outer_radius = 46cm  </comment>
+
+           <layer id="6">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z5+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z5+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z5+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z5+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z5+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +332cm; outer_radius = 46cm  </comment>
+
+           <layer id="7">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z6+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z6+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z6+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z6+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z6+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +372cm; outer_radius = 46cm  </comment>
+
+        </detector>
+
+<!-- bwd-tracker -->
+        <detector id="4" name="SiTrackerBackward" 
+                         type="Lhe_SiTrackerEndcap2" 
+                         readout="SiTrackerBackwardHits" 
+                         reflect="false">
+                         vis="SiTrackerBackwardVis">
+            <comment>Forward Tracker outside Barrel Support</comment>
+            <module name="Module1" vis="SiTrackerForwardModulVis">
+                <trd x1="36.112*mm" x2="46.635*mm" z="100.114/2*mm" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+            </module>
+            <module name="Module2" vis="SiTrackerForwardModulVis">
+                <trd x1="45.245*mm" x2="54.680*mm" z="89.773/2*mm" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+            </module>
+
+           <layer id="8">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z0-32*mm-5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z0-24*mm-4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z0-16*mm-4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>     <comment>  middle-z-pos. = -70cm; outer_radius = 29cm  </comment>
+
+           <layer id="9">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z1-32*mm-5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z1-24*mm-4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z1-16*mm-4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>     <comment>  middle-z-pos. = -92.5cm; outer_radius = 38cm  </comment>
+
+           <layer id="10">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z2-32*mm-5*mm" nmodules="8" dz="-2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z2-24*mm-4*mm" nmodules="14" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z2-16*mm-4*mm" nmodules="20" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Btd_disk_z2-8*mm-4*mm"  nmodules="22" dz="-2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Btd_disk_z2-4*mm" nmodules="28" dz="-2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = -132cm; outer_radius = 46cm  </comment>
+
+            <layer id="11">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z3-32*mm-5*mm" nmodules="8" dz="-2.5*mm" module="Module1" />
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z3-24*mm-4*mm" nmodules="14" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z3-16*mm-4*mm" nmodules="20" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Btd_disk_z3-8*mm-4*mm"  nmodules="22" dz="-2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Btd_disk_z3-4*mm" nmodules="28" dz="-2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = -172cm; outer_radius = 46cm  </comment>
+
+            <layer id="12">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z4-32*mm-5*mm" nmodules="8" dz="-2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z4-24*mm-4*mm" nmodules="14" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z4-16*mm-4*mm" nmodules="20" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Btd_disk_z4-8*mm-4*mm"  nmodules="22" dz="-2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Btd_disk_z4-4*mm" nmodules="28" dz="-2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = -202cm; outer_radius = 46cm  </comment>
+            
+        </detector>
+
+        <comment>Calorimeters</comment>
+<!--ECAL -->
+        <detector id="5" name="EcalBarrel" 
+                         type="Lhe_PolyhedraBarrelCalorimeter2" 
+                         readout="EcalBarrelHits" 
+                         vis="EcalBarrelVis" 
+                         reflect="false" 
+                         gap="0.*cm" 
+                         calorimeterType="EM_BARREL">
+            <comment>EM Calorimeter Barrel</comment>
+            <dimensions numsides="(int) CaloSides" rmin="EcalBarrel_rmin" z_offset="OffsetZ" z="EcalBarrel_zmax" />
+            <staves vis="EcalBarrelStaveVis"/>
+
+            <layer repeat="1" vis="EcalLayerVis" >
+                <slice material = "Kapton"  thickness = "0.03*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.3*cm" sensitive = "yes" limits="cal_limits" vis="EcalSensitiveVis"/>
+            </layer>   <comment>  -z-pos. = -205cm, +z-pos. = +375cm  inner_radius = 47cm (61cm) l_thick=0.33cm </comment>
+
+            <layer repeat="20" vis="EcalLayerVis" >
+                <slice material = "Pb" thickness = "0.4*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.3*cm" sensitive = "yes" limits="cal_limits" vis="EcalSensitiveVis"/>
+                <slice material = "Air" thickness = "0.05*cm" vis="InvisibleNoDaughters"/>
+            </layer>  <comment>  -z-pos. = -205cm, +z-pos. = +375cm  inner_radius = 47cm (+17cm)  l_thick=15.cm </comment>
+
+            <layer repeat="25" vis="EcalLayerVis" >
+                <slice material = "Pb" thickness = "0.65*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.3*cm" sensitive = "yes" limits="cal_limits" vis="EcalSensitiveVis"/>
+                <slice material = "Air" thickness = "0.05*cm" vis="InvisibleNoDaughters"/>
+            </layer>   <comment>  -z-pos. = -205cm, +z-pos. = +375cm  inner_radius = 47cm (+23cm) l_thick=25.cm </comment>
+
+        </detector>
+
+<!--ECALEndCap fwd/bwd -->
+        <detector id="6" name="EcalEndcap_fwd" 
+                         type="Lhe_PolyhedraEndcapCalorimeter2" 
+                         reflect="false" 
+                         readout="EcalEndcapHits0" 
+                         vis="EcalPlugVis"
+                         calorimeterType="EM_ENDCAP">
+        <comment> EM Calorimeter Endcaps </comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmin_fwd+2*cm" rmin="EcalEndcap_rmin" rmax="EcalBarrel_rmax" />
+
+            <layer repeat="1">      <comment> 0.1*cm  </comment>
+                 <slice material = "Silicon" thickness = "0.032*cm" sensitive="yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                 <slice material = "TungstenDens25"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                 <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                 <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>     
+            </layer>
+            <layer repeat="52">     <comment>  0.375*cm </comment>
+                  <slice material = "TungstenDens25" thickness = "0.25*cm" />
+                  <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                  <slice material = "Silicon" thickness = "0.032*cm" sensitive="yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                  <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>          
+            </layer>
+
+            <layer repeat="32">     <comment>  0.625*cm </comment>
+                  <slice material = "TungstenDens25" thickness = "0.5*cm" />
+                  <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                  <slice material = "Silicon" thickness = "0.032*cm" sensitive="yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                  <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+            
+        </detector>
+
+<!-- -->
+        <detector id="7" name="EcalEndcap_bwd" 
+                         type="Lhe_PolyhedraEndcapCalorimeter2" 
+                         reflect="false" 
+                         readout="EcalEndcapHits1" 
+                         vis="EcalPlugVis" 
+                         calorimeterType="EM_ENDCAP">
+            <comment>EM Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmin_bwd-4.*cm" rmin="EcalEndcap_rmin" rmax="EcalBarrel_rmax" />
+
+            <layer repeat="32">     <comment>  0.625*cm x 33  = 20.625*cm </comment>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Pb" thickness = "0.5*cm" vis="EcalAbsorberVis"/>
+            </layer>    
+
+            <layer repeat="52">     <comment>  0.375*cm x 53 = 19.875</comment>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Pb" thickness = "0.25*cm" vis="EcalAbsorberVis"/>
+            </layer>
+
+            <layer repeat="1">      <comment> 0.1*cm  </comment>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+            </layer>
+
+        </detector>
+
+<!--HCAL -->
+        <detector id="8" name="HcalBarrel" 
+                         type="Lhe_PolyhedraBarrelCalorimeter2" 
+                         readout="HcalBarrelHits" vis="HcalBarrelVis" 
+                         calorimeterType="HAD_BARREL" 
+                         gap="0.*cm" 
+                         material="Steel235">
+            <comment>Hadron Calorimeter Barrel</comment>
+            <dimensions numsides="(int) CaloSides" rmin="HcalBarrel_rmin" z="HcalBarrel_length" z_offset="OffsetZ"/>
+            <staves vis="HcalBarrelStavesVis"/>
+            <layer repeat="(int) HcalBarrel_layers">
+                <slice material = "Steel235" thickness = "1.00*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.50*cm" sensitive = "yes" limits="cal_limits" vis="HcalBarrelSensorVis"/>
+                <slice material = "Air" thickness = "0.15*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+        <detector id="9" name="HcalEndcap_fwd" 
+                         type="Lhe_PolyhedraEndcapCalorimeter2" 
+                         readout="HcalEndcapHits0" 
+                         reflect="false" 
+                         vis="HcalEndcapVis" 
+                         calorimeterType="HAD_ENDCAP">
+            <comment>Hadron Calorimeter Endcaps</comment>
+            <staves vis="HcalEndcapStavesVis"/>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmin_fwd" rmin="HcalBarrel_rmin"  rmax="HcalEndcap_rmax" />
+            <layer repeat="(int) HcalEndcap_fwd_layers">
+                <slice material = "Steel235" thickness = "1.00*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.50*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Air" thickness = "0.15*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+
+        <detector id="10" name="HcalEndcap_bwd" 
+                           type="Lhe_PolyhedraEndcapCalorimeter2" 
+                           readout="HcalEndcapHits1" 
+                           reflect="false" 
+                           vis="HcalEndcapVis" 
+                           calorimeterType="HAD_ENDCAP">
+            <staves vis="HcalEndcapStavesVis"/>
+            <comment>Hadron Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalBarrel_zmin-HcalEndcap_thickness_bwd-3.*cm" rmin="HcalBarrel_rmin"  rmax="HcalEndcap_rmax" />
+            <layer repeat="(int) HcalEndcap_bwd_layers">
+                <slice material = "Steel235" thickness = "1.00*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.50*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Air" thickness = "0.15*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+<!---->
+        <detector id="11" name="HcalPlug_fwd" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="HcalPlugHits01" 
+                          reflect="false" 
+                          vis="HcalPlugVis">
+            <comment>Hadron Calorimeter Plug</comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmax_fwd+4*cm" rmin="VertexBarrel_r2" rmax="SolenoidBarrelConductorInnerRadius1-10.*cm" />
+            <layer repeat="(int) HcalPlug_fwd_layers">
+                <slice material = "TungstenDens24" thickness = "1.0*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+        <detector id="13" name="HcalPlug_bwd" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="HcalPlugHits11" 
+                          reflect="false" 
+                          vis="HcalPlugVis">
+            <comment>Hadron Calorimeter Plug</comment>
+            <dimensions numsides="(int) CaloSides" zmin="HcalPlug_zmin_bwd-6.*cm" rmin="VertexBarrel_r2" rmax="SolenoidBarrelConductorInnerRadius1-10.*cm" />
+            <layer repeat="(int) HcalPlug_bwd_layers">
+                <slice material = "Cu" thickness = "1.5*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+<!-- Muon  -->      
+         <detector id="15" name="MuonBarrel" 
+                           type="Lhe_PolyhedraBarrelCalorimeter2" 
+                           readout="MuonBarrelHits" 
+                           reflect="false" 
+                           vis="MuonBarrelVis" 
+                           calorimeterType="MUON_BARREL" 
+                           gap="0.*cm" 
+                           material="Steel235">
+            <comment>Muon Calorimeter Barrel</comment>
+            <dimensions numsides="(int) MuonSides" rmin="((HcalEndcap_rmax+2.0*cm) / ( cos(pi/CaloSides) ) )" z="MuonBarrel_length" z_offset="OffsetZ*1.2"/>
+            <staves vis="MuonBarrelStavesVis"/>
+            <comment> Start with an active layer, followed by a thin 5.0cm absorber layer. The second active layer is followed by a thick 20.0cm steel layer to take the forces. </comment>
+            <layer repeat="1" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="5.0*cm" vis="MuonBarrelAbsorberVis"/>
+           </layer>
+           <layer repeat="1" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" />
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="20.0*cm" vis="MuonBarrelAbsorberVis"/>
+            </layer>
+            <layer repeat="(int) MuonBarrel_layers" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="10.0*cm" vis="MuonBarrelAbsorberVis"/>
+            </layer>
+            <comment> The last Iron layer is again 20.0cm to take the forces. </comment>
+            <layer repeat="1" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="20.0*cm" vis="MuonBarrelAbsorberVis"/>
+            </layer>
+        </detector>
+
+        <detector id="16" name="MuonEndcap_fwd1" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits01" 
+                          reflect="false" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+           <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_fwd" rmin="VertexBarrel_r3+5*cm" rmax="MuonEndcap_rmax0" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+            </layer>    <comment> layer thickness = 10+4cm </comment>
+        </detector>
+
+
+        <detector id="17" name="MuonEndcap_fwd2" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits02" 
+                          reflect="fasle" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_fwd" rmin="HcalBarrel_rmin" rmax="MuonEndcap_rmax1" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>>
+            </layer>
+        </detector>
+
+<!---->
+        <detector id="18" name="MuonEndcap_bwd1" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits11" 
+                          reflect="false" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_bwd+14.*cm" rmin="VertexBarrel_r3+5*cm" rmax="MuonEndcap_rmax0" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+            </layer>
+        </detector>
+
+        <detector id="19" name="MuonEndcap_bwd2" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits12" 
+                          reflect="false" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_bwd+14.*cm" rmin="HcalBarrel_rmin" rmax="MuonEndcap_rmax1" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+            </layer>
+        </detector>
+
+    <comment>Dead material and supports</comment>
+
+        <comment>Interaction region material - incl. Beampipe</comment>
+<!--            <include ref="LHeCProt.xml"/>
+-->
+<!-- Beampipe circ-elliptical 
+          
+       <comment> Beampipe </comment>
+       <comment> Central Be Beampipe</comment>
+       <detector name="Beampipe" type="Lhe_BeamPipe_Central" insideTrackingVolume="true"  vis="BeamPipeVis" z_offset="OffsetZ*2." >
+       <material name="Beryllium"/>
+        <zplane rmin="CentralBeamPipe_rmin" rmax="CentralEllBeamPipe_rmax" thickness="CentralBeamPipe_thickness" z="SolenoidCoilOuterZ1/1.4" />
+       </detector>
+   
+      <comment>Vacuum inside beampipe</comment>
+       <detector name="BeamPipeVacuum" type="Lhe_BeamPipe_Central" insideTrackingVolume="true" vis="InvisibleNoDaughters" z_offset="OffsetZ*2.">
+       <material name="Vacuum"/>
+            <zplane rmin="0.*cm" rmax="CentralBeamPipe_rmin" thickness="CentralBeamPipe_rmin" z="SolenoidCoilOuterZ1/1.4" />
+       </detector>
+-->
+
+<!-- circular beam pipe  for optimal acceptance simulation  -->
+         <comment>Beampipe - has to be modified - circular-elliptical, in turn the pixel layer(s) as well   </comment>
+         <detector name="Beampipe" 
+                   type="Lhe_PolyconeSupport" 
+                   insideTrackingVolume="true"  
+                   z_offset="OffsetZ" 
+                   vis="BeamPipeVis">
+           <comment>Central Be Beampipe</comment>
+            <material name="Beryllium"/>
+            <zplane rmin="CentralBeamPipe_rmin" rmax="CentralBeamPipe_rmax" z="-CentralBeamPipe_zmax"/>
+            <zplane rmin="CentralBeamPipe_rmin" rmax="CentralBeamPipe_rmax" z="CentralBeamPipe_zmax" />
+        </detector>
+
+
+<!-- -->
+        <detector name="ForwardVacuum" type="Lhe_PolyconeSupport" insideTrackingVolume="false" vis="InvisibleNoDaughters">
+            <material name="Vacuum"/>
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmin"  
+                    z="VertexBarrel_zmax*2 + 0.01*cm" />
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmin"
+                    z="- (VertexBarrel_zmax*2 + 0.01*cm)" />
+        </detector>
+        <detector name="BackwardVacuum" type="Lhe_PolyconeSupport" insideTrackingVolume="false" vis="InvisibleNoDaughters">
+            <material name="Vacuum"/>
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmax - BeamPipe_thickness"
+                    z="- (tracking_region_zmax + 0.01*cm)" />
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmax - BeamPipe_thickness"
+                    z="- BeamPipe_zmax" />
+            <zplane rmin="0.*cm"
+                    rmax="LumiCal_rmin - 2*BeamPipe_endThickness"
+                    z="- (LumiCal_zmin - 2*BeamPipe_endThickness)" />
+            <zplane rmin="0.*cm"
+                    rmax="LumiCal_rmin - 2*BeamPipe_endThickness"
+                    z="- (LumiCal_zmin - BeamPipe_endThickness)" />
+            <zplane rmin="0.*cm"
+                    rmax="LumiCal_rmin - 2*BeamPipe_endThickness"
+                    z="- (ForwardMask_zmin - BeamPipe_endThickness)" />
+        </detector>
+
+<!--Solenoid -->
+      <comment>Solenoid/Dipole</comment>
+
+       <detector name="SolenoidCoilBarrel1" 
+                 type="Lhe_MultiLayerTracker" 
+                 insideTrackingVolume="false">
+
+          <layer id="1" 
+            inner_r="SolenoidBarrelInnerRadius1" 
+            z_offset="OffsetZ*1.15" 
+            outer_z="MuonBarrel_length*0.5"  
+            vis="SolenoidBarrelSupportLayerVis">
+                <slice material="Aluminum" thickness="SolenoidBarrelInnerCryostatThickness1" />
+                <slice material="Vacuum"  thickness="SolenoidBarrelInnerAirgapThickness1" />
+                <slice material="Aluminum" thickness="SolenoidBarrelInnerCryostatThickness1" />
+          </layer>
+
+          <layer id="2" 
+            inner_r="SolenoidBarrelConductorInnerRadius1+2*cm" 
+            z_offset="OffsetZ"  
+            outer_z="SolenoidCoilOuterZ1" 
+            vis="SolenoidBarrelLayerVis">
+                <slice material="Aluminum" thickness="SolenoidBarrelAlConductorThickness1" />
+                <slice material="Aluminum" thickness="SolenoidBarrelQuenchbackThickness1" />
+          </layer>
+          <layer id="3" 
+            inner_r="SolenoidBarrelOuterCryostatInnerRadius1" 
+            z_offset="OffsetZ*1.15" 
+            outer_z="MuonBarrel_length*0.5" 
+            vis="SolenoidDipoleBarrelLayerVis">
+                <slice material="Aluminum" thickness="DipoleBarrelAlConductorThickness" />
+                <slice material="Aluminum" thickness="SolenoidBarrelInnerCryostatThickness1" />
+                <slice material="Vacuum"   thickness="SolenoidBarrelOuterAirgapThickness1" />
+                <slice material="Aluminum" thickness="SolenoidBarrelOuterCryostatThickness1" />
+           </layer>
+ 
+        </detector>
+
+    </detectors>
+
+    <readouts>
+        <readout name="SiVertexBarrelHits">
+            <id>system:0,barrel:3,layer:4,module:14,sensor:11,side:32:-2,strip:30</id>
+        </readout>
+        <readout name="SiTrackerBarrelHits">
+            <id>system:0,barrel:3,layer:5,module:14,sensor:2,side:32:-2,strip:20</id>
+        </readout>
+        <readout name="SiTrackerForwardHits">
+            <id>system:0,barrel:3,layer:7,module:12,sensor:1,side:32:-2,strip:28</id>
+        </readout>        
+        <readout name="SiTrackerBackwardHits">
+            <id>system:0,barrel:3,layer:7,module:12,sensor:1,side:32:-2,strip:28</id>
+        </readout>
+        <readout name="EcalBarrelHits">
+            <segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="EcalEndcapHits0">
+            <segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="EcalEndcapHits1">
+            <segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalBarrelHits">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalEndcapHits0">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalEndcapHits1">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits01">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits02">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits11">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits12">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonBarrelHits">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits01">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits02">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits11">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits12">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+     </readouts>
+
+
+<!--  
+        <plugin name="TestSurfaces"> <argument value="SiTrackerBackward"/> </plugin>
+-->
+<!-- 
+        <plugins>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="SiVertexBarrel"/> <argument value="dimension=1"/> 
+          </plugin>
+ 
+          <plugin name="Lhe_SurfaceExamplePlugin">
+             <argument value="SiVertexBarrel"/>
+             <argument value="aa=1*mm"/>
+             <argument value="bb=2*cm"/>
+             <argument value="cc=3*m"/>
+          </plugin>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="SiTrackerBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="SiTrackerForward"/> </plugin>
+          <plugin name="Lhe_SiTrackerEndcapSurfacePlugin"> <argument value="SiTrackerForward"/> </plugin>
+
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="SiTrackerBackward"/> </plugin>
+          <plugin name="Lhe_SiTrackerEndcapSurfacePlugin"> <argument value="SiTrackerBackward"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="EcalBarrel"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="EcalBarrel"/> </plugin>
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="EcalBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="EcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="EcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="EcalEndcap_fwd"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="EcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin">    <argument value="EcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="EcalEndcap_bwd"/> </plugin>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="HcalBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalEndcap_fwd"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalEndcap_bwd"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalPlug_fwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalPlug_fwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalPlug_fwd"/> </plugin>         
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalPlug_bwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalPlug_bwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalPlug_bwd"/> </plugin>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="MuonBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_fwd1"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_fwd1"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_fwd1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_fwd2"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_fwd2"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_fwd2"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_bwd1"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_bwd1"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_bwd1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_bwd2"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_bwd2"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_bwd2"/> </plugin>
+
+        </plugins>
+-->
+
+    <fields>
+        <field name="GlobalSolenoid1" type="solenoid"
+          inner_field="3.5*tesla"
+          outer_field="-1.5*tesla"
+          zmax="SolenoidCoilOuterZ1"
+          outer_radius="world_side">
+        </field>
+       <field name="MachineDipole+" type="DipoleMagnet"
+         rmax="DipoleBarrelAlConductorRadius"
+         zmin="1*cm"
+         zmax="SolenoidCoilOuterZ1">
+        <dipole_coeff>0.4*tesla</dipole_coeff>
+         <dipole_coeff>0.1*tesla/pow(cm,1)</dipole_coeff>
+         <dipole_coeff>0.01*tesla/pow(cm,2)</dipole_coeff>
+       </field>
+       <field name="MachineDipole-" type="DipoleMagnet"
+         rmax="DipoleBarrelAlConductorRadius"
+         zmin="-SolenoidCoilOuterZ1"
+         zmax="-1*cm">
+        <dipole_coeff>-0.4*tesla</dipole_coeff>
+         <dipole_coeff>0.1*tesla/pow(cm,1)</dipole_coeff>
+         <dipole_coeff>0.01*tesla/pow(cm,2)</dipole_coeff>
+       </field>
+    </fields>
+
+</lccdd>
diff --git a/examples/LHeD/compact/compact_Lhe_dip_sol_ell.xml b/examples/LHeD/compact/compact_Lhe_dip_sol_ell.xml
new file mode 100644
index 000000000..1631f4602
--- /dev/null
+++ b/examples/LHeD/compact/compact_Lhe_dip_sol_ell.xml
@@ -0,0 +1,1932 @@
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--    XML description of the complete LHeC detector                       -->
+<!--    a detector for a new LHC option using a ERL e-source                -->
+<!--                                                                        -->
+<!--    Contained are the required                                          -->
+<!--      ++ global constants used uniquely by this detector                  -->
+<!--      ++ visualization attributes                                       -->
+<!--      ++ the definition of the readout structure and the                -->
+<!--         readout segmentation (if necessary)                            -->
+<!--      ++ [the include statements for the sensitive detectors and        -->
+<!--         the corresponding support structure(s)]                        -->
+<!--                                                                        -->
+<!--                                                                        -->
+<!--   @author  P.Kostka                                                    -->
+<!--   @date    old version 20.10.2017                                      -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<lccdd xmlns:compact="-"
+    xmlns:xs="-"
+    xs:noNamespaceSchemaLocation="-">
+
+    <info name="LHeD_cdr"
+        title="LHeC Detector - based on CLIC Silicon Detector CDR"
+        author="Peter Kostka"
+        url="http:dummy-url.de"
+        status="development"
+        version="$Id: compact.xml 2013-12-13 12:28:53Z peter.kostka@cern.ch $">
+        <comment> The compact format for the LHeC Detector used for design studies </comment>
+    </info>
+
+    <includes>
+        <gdmlFile  ref="${Lhe_Detector_dir}/compact/elements.xml"/>
+        <gdmlFile  ref="${Lhe_Detector_dir}/compact/materials.xml"/>
+    </includes>
+
+    <define>
+        <constant name="Lhe_Detector_dir" value="${DD4hep}/examples/LHeD/" type="string"/>;
+        <constant name="world_side" value="20.*m"/>
+        <constant name="world_x" value="world_side"/>
+        <constant name="world_y" value="world_side"/>
+        <constant name="world_z" value="world_side"/>
+
+        <constant name="CrossingAngle" value="0.020*rad"/>
+
+        <constant name="tracking_region_radius" value="46.0*cm + 0.8*cm"/>
+        <constant name="SolenoidalFieldRadius"  value="100.0*cm + 0.2*m"/>
+
+        <constant name="CaloSides" value="12"/>
+        <constant name="MuonSides" value="8"/>
+
+    <comment> additional defined Parameters  - Lhe add-on </comment>
+        <constant name="CentralBeamPipe_zmax" value="580.0*cm"/>
+        <constant name="CentralBeamPipe_rmax" value="2.4*cm"/>
+        <constant name="CentralBeamPipe_thickness" value="0.40*cm"/>
+        <constant name="CentralEllBeamPipe_rmax" value="10.0*cm-CentralBeamPipe_thickness"/>
+        <constant name="CentralBeamPipe_rmin" value="CentralBeamPipe_rmax - CentralBeamPipe_thickness"/>
+        <constant name="BeamPipe_thickness" value="0.4*cm"/>
+        <constant name="BeamPipe_endThickness" value="0.1*cm"/>
+        <constant name="BeamPipe_zmax" value="420.0*cm - 0.5*cm"/>
+        <constant name="BeamPipe_rmax" value="5.6*cm"/>
+        <constant name="BeamPipe_rmin" value="BeamPipe_rmax - BeamPipe_thickness"/>
+
+        <constant name="Distance_VXDLayer" value="3.6*cm"/>
+        <constant name="Distance_VxBG10_in" value="0.03*cm"/>
+        <constant name="Distance_VxBG10_ou" value="0.03*cm"/>
+        <constant name="G10thickness" value="0.5*cm"/>
+        <constant name="VxBar_Env" value="0.6*cm"/>
+        <constant name="Distance_VxCo_in" value="Distance_VxBG10_ou + 0.01*cm"/>
+        <constant name="Distance_VxCo_ou" value="Distance_VxBG10_ou + 0.02*cm"/>
+
+        <constant name="VertexBarrel_r0" value="CentralBeamPipe_rmax+ VxBar_Env + 0.5*cm"/>                          <!-- 2.6 + 0.8       = 3.4-->
+        <constant name="VertexBarrel_r1"  value="VertexBarrel_r0 + VxBar_Env + Distance_VXDLayer"/>     <!-- 3.4 + 0.5 + 2.5 = 6.4-->
+        <constant name="VertexBarrel_r2"  value="VertexBarrel_r1 + VxBar_Env + Distance_VXDLayer"/>     <!-- 6.4 + 0.5 + 2.5 = 9.4-->
+        <constant name="VertexBarrel_r3"  value="VertexBarrel_r2 + VxBar_Env + Distance_VXDLayer"/>     <!-- 9.4 + 0.5 + 2.5 = 12.4-->
+
+        <constant name="VertexBG10_r0_in" value="VertexBarrel_r0 - 2*VxBar_Env - Distance_VxBG10_in"/>  <!-- 3.4 + 1.0 + 0.03 = 4.43-->
+        <constant name="VertexBG10_r1_in" value="VertexBarrel_r1 - 2*VxBar_Env - Distance_VxBG10_in"/>  <!-- 4.43 + 1.0 + 0.03 = 5.46-->
+        <constant name="VertexBG10_r2_in" value="VertexBarrel_r2 - 2*VxBar_Env - Distance_VxBG10_in"/>
+        <constant name="VertexBG10_r3_in" value="VertexBarrel_r3 - 2*VxBar_Env - Distance_VxBG10_in"/>
+
+        <constant name="VertexBG10_r0_ou" value="VertexBarrel_r0 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+        <constant name="VertexBG10_r1_ou" value="VertexBarrel_r1 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+        <constant name="VertexBG10_r2_ou" value="VertexBarrel_r2 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+        <constant name="VertexBG10_r3_ou" value="VertexBarrel_r3 + 2*VxBar_Env + Distance_VxBG10_ou"/>
+
+        <constant name="VertexCo_r0_in" value="VertexBarrel_r0 - VxBar_Env -  Distance_VxCo_in"/>
+        <constant name="VertexCo_r1_in" value="VertexBarrel_r1 - VxBar_Env -  Distance_VxCo_in"/>
+        <constant name="VertexCo_r2_in" value="VertexBarrel_r2 - VxBar_Env -  Distance_VxCo_in"/>
+        <constant name="VertexCo_r3_in" value="VertexBarrel_r3 - VxBar_Env -  Distance_VxCo_in"/>
+
+        <constant name="VertexCo_r0_ou" value="VertexBarrel_r0 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="VertexCo_r1_ou" value="VertexBarrel_r1 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="VertexCo_r2_ou" value="VertexBarrel_r2 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="VertexCo_r3_ou" value="VertexBarrel_r3 + VxBar_Env +  Distance_VxCo_ou"/>
+        <constant name="Vertex_r_in" value="VertexBarrel_r0"/>
+        <constant name="Vertex_r_out" value="VertexBarrel_r3 + VxBar_Env +  Distance_VxCo_ou + 0.5*cm"/>
+
+
+        <constant name="VXD_Ell_Max_r" value="21.16*cm"/>
+        <constant name="Diff_Radius_SITLayer" value="3.2*cm"/>
+        <constant name="Distance_SITLayer" value="5.0*cm"/>
+        <constant name="Radius_SITLayer0" value="VXD_Ell_Max_r + 2.5*cm"/>                  <!-- 21.16 + 2.5 = 23.66-->
+        <constant name="Radius_SITLayer1" value="Radius_SITLayer0 + Distance_SITLayer"/>  <!-- 23.16 + 5. = 28.16-->
+        <constant name="Radius_SITLayer2" value="Radius_SITLayer1 + Distance_SITLayer"/>  <!-- 28.16 + 5. = 33.16-->
+        <constant name="Radius_SITLayer3" value="Radius_SITLayer2 + Distance_SITLayer"/>  <!-- 33.16 + 5. = 38.16-->
+        <constant name="Radius_SITLayer4" value="Radius_SITLayer3 + Distance_SITLayer"/>  <!-- 38.16 + 5. = 43.16--> 
+
+        <constant name="SiMod_w0" value="97.79*mm"/>
+        <constant name="SiMod_w1" value="97.79*mm"/>
+        <constant name="SiMod_w2" value="97.79*mm"/>
+        <constant name="SiMod_w3" value="97.79*mm"/>
+        <constant name="SiMod_w4" value="97.79*mm"/>
+        <constant name="SiWafer_w" value="92.031*mm"/>
+        <constant name="SiMod_l0" value="SiMod_w0"/>
+        <constant name="SiMod_l1" value="SiMod_w1"/>
+        <constant name="SiMod_l2" value="SiMod_w2"/>
+        <constant name="SiMod_l3" value="SiMod_w3"/>
+        <constant name="SiMod_l4" value="SiMod_w4"/>
+        <constant name="SiWafer_l" value="92.031*mm"/>
+
+        <constant name="SiMod_z0" value="54.0*cm"/>
+        <constant name="SiMod_z1" value="64.0*cm"/>
+        <constant name="SiMod_z2" value="74.0*cm"/>
+        <constant name="SiMod_z3" value="84.0*cm"/>
+        <constant name="SiMod_z4" value="94.0*cm"/>
+
+        <constant name="SiVXDEndcap_z0" value="SiMod_z0+0.5*cm"/>
+        <constant name="SiVXDEndcap_z1" value="SiMod_z2+0.5*cm"/>
+
+        <constant name="SiMod_zi0" value="SiMod_z0 - SiMod_w0 "/>
+        <constant name="SiMod_zi1" value="SiMod_z1 - SiMod_w1 "/>
+        <constant name="SiMod_zi2" value="SiMod_z2 - SiMod_w2 "/>
+        <constant name="SiMod_zi3" value="SiMod_z3 - SiMod_w3 "/>
+        <constant name="SiMod_zi4" value="SiMod_z4 - SiMod_w4 "/>
+
+
+      <comment>                 FTD parameters             </comment>
+        <constant name="Ftd_total_cylinder_thickness"          value="1.0*mm"/>
+        <constant name="Ftd_cables_thickness"                  value="0.08*mm"/>
+        <constant name="Ftd_Si_thickness1"                     value="0.3*mm"/>
+        <constant name="Ftd_Si_thickness2"                     value="0.3*mm"/>
+        <constant name="Ftd_inner_support_thickness"           value="2*mm"/>
+        <constant name="Ftd_inner_support_length"              value="4*mm"/>
+        <constant name="Ftd_outer_support_thickness"           value="10*mm"/>
+        <constant name="Ftd_outer_support_length"              value="4*mm"/>
+        <constant name="Diff_z_Ftd_disk" value="2.5*cm"/>
+      <comment>                ftd - pos z           </comment>
+        <constant name="Ftd_disk_z0"  value="630*mm"/>
+        <constant name="Ftd_disk_z1"  value="846.2*mm"/>
+        <constant name="Ftd_disk_z2"  value="1136.7*mm"/>
+        <constant name="Ftd_disk_z3"  value="1526.8*mm"/>
+        <constant name="Ftd_disk_z4"  value="2050.8*mm"/>
+        <constant name="Ftd_disk_z5"  value="2754.6*mm"/>
+        <constant name="Ftd_disk_z6"  value="3700.0*mm"/>
+      <comment>            btd - neg z  </comment>
+        <constant name="Btd_disk_z0"  value="-630*mm"/>
+        <constant name="Btd_disk_z1"  value="-840.9*mm"/>
+        <constant name="Btd_disk_z2"  value="-1122.5*mm"/>
+        <constant name="Btd_disk_z3"  value="-1498.3*mm"/>
+        <constant name="Btd_disk_z4"  value="-2000.0*mm"/>
+      <comment>            ftd - rings  </comment>
+        <constant name="Ftd_sdisk_ri0"  value="86.716*mm"/>
+        <constant name="Ftd_sdisk_ri1"  value="154.991*mm"/>
+        <constant name="Ftd_sdisk_ri2"  value="245.180*mm"/>
+        <constant name="Ftd_sdisk_ri3"  value="328.520*mm"/>
+        <constant name="Ftd_sdisk_ri4"  value="413.654*mm"/>
+
+        <constant name="EcalBarrel_rmin" value="((Radius_SITLayer4 + 6.0*cm) / (cos(pi/CaloSides)) )" />
+        <constant name="EcalBarrel_depth" value="40.*cm"/>
+        <constant name="EcalBarrel_fwd_depth" value="40.*cm"/>
+        <constant name="EcalBarrel_bwd_depth" value="40.*cm"/>
+        <constant name="EcalBarrel_rmax" value="( (EcalBarrel_rmin + EcalBarrel_depth + 1.0*cm)/(cos(pi/CaloSides)))"/>
+        <constant name="EcalBarrel_zmax" value="Ftd_disk_z6-Btd_disk_z4+10*cm "/>
+        <constant name="EcalBarrel_length" value="EcalBarrel_zmax - Btd_disk_z4 + 5.*cm"/>
+        <constant name="EcalEndcap_rmin" value="VertexBarrel_r1"/>
+        <constant name="EcalBarrel_zmin" value="Btd_disk_z4-2*cm "/>
+        <constant name="EcalEndcap_rmax" value="(EcalBarrel_rmin - 2.0*cm) / (cos(pi/CaloSides))"/>
+
+        <constant name="EcalEndcap_zmin_fwd" value="Ftd_disk_z6+5.0*cm"/>
+        <constant name="EcalEndcap_length_fwd" value="EcalBarrel_fwd_depth"/>
+        <constant name="EcalEndcap_length_bwd" value="EcalBarrel_bwd_depth"/>
+        <constant name="EcalEndcap_zmax_fwd" value="EcalEndcap_zmin_fwd+EcalEndcap_length_fwd"/>
+        <constant name="EcalEndcap_zmin_bwd" value="EcalBarrel_zmin-EcalEndcap_length_bwd"/>
+        <constant name="EcalEndcap_zmax_bwd" value="EcalEndcap_zmin_bwd+EcalEndcap_length_bwd"/>
+
+        <constant name="tracking_region_zmax" value="EcalEndcap_zmin_fwd - 1.0*cm"/>
+        <constant name="VXD_CF_sensor" value="0.026*cm"/>
+        <constant name="VXD_CF_support" value="0.05*cm"/>
+
+        <constant name="SolenoidBarrelInnerRadius1" value="EcalBarrel_rmax + 12.0*cm"/>
+        <constant name="SolenoidCoilOuterZ1" value="(EcalEndcap_zmin_fwd-EcalEndcap_zmax_bwd)/2."/>
+        <constant name="DipoleCoilOuterZ1" value="(EcalEndcap_zmin_fwd-EcalEndcap_zmax_bwd)/2."/>
+        <constant name="SolenoidBarrelInnerCryostatThickness1" value="3.0*cm"/>
+        <constant name="SolenoidBarrelInnerAirgapThickness1" value="1.5*cm"/>
+        <constant name="SolenoidBarrelAlConductorThickness1" value="6.0*cm"/>
+        <constant name="DipoleBarrelAlConductorThickness" value="1.5*cm"/>
+        <constant name="SolenoidBarrelQuenchbackThickness1" value="5.*cm"/>
+        <constant name="SolenoidBarrelOuterAirgapThickness1" value="3.*cm"/>
+        <constant name="SolenoidBarrelOuterCryostatThickness1" value="4.0*cm"/>
+        <constant name="SolenoidEndcapCryostatThickness1" value="3.0*cm"/>
+        <constant name="SolenoidEndcapAirgapThickness1" value="2.7*cm"/>
+        <constant name="SolenoidBarrelConductorInnerRadius1" value="SolenoidBarrelInnerRadius1 + 2.*SolenoidBarrelInnerCryostatThickness1 + SolenoidBarrelInnerAirgapThickness1"/>
+        <constant name="SolenoidBarrelOuterZ1" value="SolenoidCoilOuterZ1+SolenoidEndcapAirgapThickness1"/>
+        <constant name="SolenoidBarrelOuterCryostatInnerRadius1" value="SolenoidBarrelConductorInnerRadius1  + SolenoidBarrelAlConductorThickness1 + SolenoidBarrelQuenchbackThickness1 + DipoleBarrelAlConductorThickness + SolenoidBarrelInnerCryostatThickness1 + 4.*cm"/>
+        <constant name="SolenoidBarrelOuterRadius1" value="SolenoidBarrelOuterCryostatInnerRadius1 + SolenoidBarrelOuterAirgapThickness1 + SolenoidBarrelOuterCryostatThickness1"/>
+        <constant name="SolenoidalFieldRadius1" value="(SolenoidBarrelConductorInnerRadius1 + DipoleBarrelAlConductorThickness + SolenoidBarrelAlConductorThickness1 / 2.0)"/>
+        <constant name="DipoleBarrelAlConductorRadius" value="SolenoidBarrelOuterCryostatInnerRadius1 - SolenoidBarrelOuterAirgapThickness1 - SolenoidBarrelOuterCryostatThickness1"/>
+
+        <constant name="OffsetZ" value="85*cm"/>
+
+        <constant name="HcalBarrel_rmin" value="SolenoidBarrelOuterRadius1+5.0*cm"/>
+        <constant name="HcalBarrel_layers" value="(int) 85"/>
+        <constant name="HcalBarrel_layer_thickness" value="1.65*cm"/>
+        <constant name="HcalBarrel_length" value="EcalBarrel_zmax"/>
+
+        <constant name="HcalEndcap_fwd_layers" value="131"/>
+        <constant name="HcalEndcap_bwd_layers" value="113"/>        
+        <constant name="HcalEndcap_zmin_fwd" value="EcalBarrel_zmax + 5.0*cm"/> 
+        <constant name="HcalEndcap_rmin" value="VertexBarrel_r2"/>
+        <constant name="HcalBarrel_rmax" value="HcalBarrel_rmin+HcalBarrel_layers*HcalBarrel_layer_thickness"/>
+
+        <constant name="HcalEndcap_rmax" value="((HcalBarrel_rmin + HcalBarrel_layers * HcalBarrel_layer_thickness) / (cos(pi/CaloSides)))"/>
+
+        <constant name="HcalEndcap_layer_thickness_fwd" value="1.65*cm"/>
+        <constant name="HcalEndcap_layer_thickness_bwd" value="1.65*cm"/>
+        <constant name="HcalEndcap_thickness_fwd" value="HcalEndcap_fwd_layers*HcalEndcap_layer_thickness_fwd"/>
+        <constant name="HcalEndcap_thickness_bwd" value="HcalEndcap_bwd_layers*HcalEndcap_layer_thickness_bwd"/>
+        <constant name="HcalEndcap_zmax_fwd" value="HcalEndcap_zmin_fwd + HcalEndcap_thickness_fwd"/>
+        <constant name="HcalEndcap_zmin_bwd" value="EcalEndcap_zmin_bwd-HcalEndcap_thickness_bwd-4*cm"/>
+
+        <constant name="HcalPlug_fwd_layers" value="154"/>
+        <constant name="HcalPlug_bwd_layers" value="92"/>
+        <constant name="HcalPlug_layer_thickness_fwd" value="1.145*cm"/>
+        <constant name="HcalPlug_layer_thickness_bwd" value="1.6*cm"/>
+        <constant name="HcalPlug_thickness_fwd" value="HcalPlug_fwd_layers*HcalPlug_layer_thickness_fwd"/>
+        <constant name="HcalPlug_thickness_bwd" value="HcalPlug_bwd_layers*HcalPlug_layer_thickness_bwd"/>
+        <constant name="HcalPlug_zmin_bwd" value="EcalBarrel_zmin-EcalEndcap_length_bwd-HcalPlug_thickness_bwd"/>
+
+        <constant name="MuonBarrel_length" value="HcalBarrel_length + HcalEndcap_thickness_fwd + HcalEndcap_thickness_bwd"/>
+        <constant name="MuonEndcap_layers" value="12"/>
+        <constant name="MuonEndcap_layer_thickness" value="10.0*cm + 4.0*cm"/>
+        <constant name="MuonEndcap_thickness" value="MuonEndcap_layers*MuonEndcap_layer_thickness"/>
+
+        <constant name="MuonBarrel_zmin" value="HcalEndcap_zmin_bwd-HcalEndcap_thickness_bwd"/>
+        <constant name="MuonBarrel_layers" value="6"/>
+        <constant name="MuonBarrel_layer_thickness" value="10.0*cm + 4.0*cm"/>
+        <constant name="MuonBarrel_thickness" value="MuonBarrel_layers*MuonBarrel_layer_thickness"/>
+
+        <constant name="MuonBarrel_rmin" value="HcalEndcap_rmax + 2.0*cm"/>
+        <constant name="MuonBarrel_rmax" value="MuonBarrel_rmin + MuonBarrel_thickness"/>
+
+        <constant name="MuonEndcap_zmin_fwd" value="HcalEndcap_zmax_fwd-MuonEndcap_thickness-EcalEndcap_length_fwd+5.*cm"/> 
+        <constant name="MuonEndcap_rmax0" value="(HcalBarrel_rmin - 10.0*cm ) / (cos(pi/MuonSides))"/>
+        <constant name="MuonEndcap_zmin_bwd" value="MuonBarrel_zmin+EcalEndcap_length_bwd"/> 
+        <constant name="MuonEndcap_rmax1" value="(MuonBarrel_rmax)/(cos(pi/MuonSides))"/> 
+
+        <constant name="LumiCal_rmin" value="6.4*cm"/>
+        <constant name="LumiCal_rmax" value="EcalEndcap_rmin + 3.0*cm"/>
+        <constant name="LumiCal_zmin" value="HcalEndcap_zmin_fwd"/>
+        <constant name="LumiCal_thickness" value="20*0.371*cm + 15*0.643*cm"/>
+        <constant name="LumiCal_zmax" value="LumiCal_zmin + LumiCal_thickness"/>
+        <constant name="LumiCalElectronics_rmax" value="LumiCal_rmax+5.0*cm"/>
+
+        <constant name="SupportTube_thickness" value="1.0*cm"/>
+        <constant name="ForwardVacuumValve_thickness" value="36.0*cm"/>
+        <constant name="ForwardShielding_thickness" value="5.0*cm"/>
+        <constant name="ForwardMask_thickness" value="10.0*cm"/>
+        <constant name="ForwardMask_zmin" value="LumiCal_zmax + ForwardShielding_thickness + ForwardVacuumValve_thickness"/>
+        <constant name="BeamCal_rmax" value="13.0*cm"/>
+        <constant name="BeamCal_zmin" value="ForwardMask_zmin + ForwardMask_thickness"/>
+
+        <constant name="VertexSupport_r1" value="Radius_SITLayer1 - 0.5*cm"/>
+        <constant name="VertexSupport_r2" value="Radius_SITLayer2 - 0.5*cm"/>
+        <constant name="VertexSupport_zmax" value="52.0*cm"/>
+
+        <constant name="VertexBarrel_zmax" value="25.0*cm"/>
+
+        <constant name="bp_cone_slope" value="(BeamPipe_rmax-CentralBeamPipe_rmax)/(tracking_region_zmax-CentralBeamPipe_zmax)"/>
+        <constant name="BeamPipe_zmin" value="CentralBeamPipe_zmax + (BeamPipe_thickness - CentralBeamPipe_thickness)/bp_cone_slope"/>
+        <constant name="BeamPipeLiner_thickness" value="0.0*cm"/>
+        <constant name="BeamPipeLength" value="EcalBarrel_length"/>
+
+        <constant name="VertexService_zmin" value="SiMod_z4 + 2.0*cm"/>
+        <constant name="VertexService_zmax" value="VertexService_zmin + 2.0*cm"/>
+        <constant name="VertexServiceThickness" value="0.3*cm"/>
+        <constant name="VertexCableThickness" value="0.005*cm"/>
+
+        <constant name="IncomingBP_radius" value="0.25*cm"/>
+        <constant name="IncomingBP_thickness" value="0.05*cm"/>
+        <constant name="OutgoingBP_radius" value="tan(CrossingAngle/2/rad)*BeamCal_zmin"/>
+        <constant name="OutgoingBP_thickness" value="0.1*cm"/>
+
+    </define>
+    <materials>
+        <material formula="Si" name="silicon_2.33gccm" state="solid" >
+          <RL type="X0" unit="cm" value="9.36607" />
+          <NIL type="lambda" unit="cm" value="45.7531" />
+          <D type="density" unit="g/cm3" value="2.33" />
+          <composite n="1" ref="Si" />
+        </material>
+
+        <material name="silicon_8.72gccm" state="solid" >
+          <RL type="X0" unit="cm" value="9.36607" />
+          <NIL type="lambda" unit="cm" value="45.7531" />
+          <D type="density" unit="g/cm3" value="8.72" />
+          <composite n="1" ref="Si" />
+        </material>
+
+        <material formula="W" name="tungsten_19.3gccm" state="solid" >
+          <RL type="X0" unit="cm" value="0.350418" />
+          <NIL type="lambda" unit="cm" value="10.3057" />
+          <D type="density" unit="g/cm3" value="19.3" />
+          <composite n="1" ref="W" />
+        </material>
+
+        <material name="TungstenDens23">
+            <D value="17.7" unit="g/cm3"/>
+            <fraction n="0.925" ref="W"/>
+            <fraction n="0.066" ref="Ni"/>
+            <fraction n="0.009" ref="Fe"/>
+        </material>
+        <material name="TungstenDens24">
+            <D value="17.8" unit="g/cm3"/>
+            <fraction n="0.93" ref="W"/>
+            <fraction n="0.061" ref="Ni"/>
+            <fraction n="0.009" ref="Fe"/>
+        </material>
+        <material name="TungstenDens25">
+            <D value="18.2" unit="g/cm3"/>
+            <fraction n="0.950" ref="W"/>
+            <fraction n="0.044" ref="Ni"/>
+            <fraction n="0.006" ref="Fe"/>
+        </material>
+        <material name="CarbonFiber_25percent">
+            <D type="density" value="0.375" unit="g/cm3"/>
+            <fraction n="1.0" ref="CarbonFiber"/>
+        </material>
+        <material name="CarbonFiber_15percent">
+            <D type="density" value="0.225" unit="g/cm3"/>
+            <fraction n="1.0" ref="CarbonFiber"/>
+        </material>
+        <material name="Rohacell31_50percent">
+            <D type="density" value="0.016" unit="g/cm3"/>
+            <fraction n="1.0" ref="Rohacell31"/>
+        </material>
+        <material name="Rohacell31_15percent">
+            <D type="density" value="0.0048" unit="g/cm3"/>
+            <fraction n="1.0" ref="Rohacell31"/>
+        </material>
+        <material name="BoratedPolyethylene5">
+            <D value="0.93" unit="g/cm3"/>
+            <fraction n="0.612" ref="C"/>
+            <fraction n="0.222" ref="O"/>
+            <fraction n="0.116" ref="H"/>
+            <fraction n="0.050" ref="B"/>
+        </material>
+        <material name="SiliconCarbide">
+            <D value="3.1" unit="g/cm3"/>
+            <composite n="1" ref="Si"/>
+            <composite n="1" ref="C"/>
+        </material>
+        <material name="SiliconCarbide_6percent">
+            <D value="0.186" unit="g/cm3"/>
+            <fraction n="1.0" ref="SiliconCarbide"/>
+        </material>
+        <material name="Graphite">
+            <D value="1.7" unit="g/cm3"/>
+            <composite n="1" ref="C"/>
+        </material>
+        <material name="Polystyrene">
+           <D value="1.032" unit="g/cm3"/>
+           <composite n="19" ref="C"/>
+           <composite n="21" ref="H"/>
+        </material>
+    </materials>
+    <limits>
+        <limitset name="cal_limits">
+            <limit name="step_length_max" particles="*" value="5.0" unit="mm" />
+        </limitset>
+    <limitset name="SiTrackerBarrelRegionLimitSet">
+      <limit name="step_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="track_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="time_max" particles="*" value="5.0" unit="ns" />
+      <limit name="ekin_min" particles="*" value="0.01" unit="MeV" />
+      <limit name="range_min" particles="*" value="5.0" unit="mm" />
+    </limitset>
+    <limitset name="SiVertexBarrelRegionLimitSet">
+      <limit name="step_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="track_length_max" particles="*" value="5.0" unit="mm" />
+      <limit name="time_max" particles="*" value="5.0" unit="ns" />
+      <limit name="ekin_min" particles="*" value="0.01" unit="MeV" />
+      <limit name="range_min" particles="*" value="5.0" unit="mm" />
+    </limitset>
+    </limits>
+  <regions>
+    <region name="SiVertexBarrelRegion" eunit="MeV" lunit="mm" cut="0.001" threshold="0.001">
+      <limitsetref name="SiVertexBarrelRegionLimitSet"/>
+    </region>
+    <region name="SiTrackerBarrelRegion" eunit="MeV" lunit="mm" cut="0.001" threshold="0.001">
+      <limitsetref name="SiTrackerBarrelRegionLimitSet"/>
+    </region>
+  </regions>
+
+
+    <display>
+        <vis name="InvisibleNoDaughters"      showDaughters="false" visible="false"/>
+        <vis name="InvisibleWithDaughters"    showDaughters="true" visible="false"/>
+        <vis name="SiVertexBarrelModuleVis" alpha="0.6" r="1" g="0" b="0" drawingStyle="solid" showDaughters="true" visible="true"/>
+        <vis name="SiVertexSensitiveVis" alpha="0.8" r="1" g="0.2" b="0.2" drawingStyle="solid" showDaughters="true" visible="true"/>
+        <vis name="SiVertexPassiveVis"   alpha="0.5" r="0.2"  g="0"  b="0.62" drawingStyle="solid" showDaughters="true" visible="false"/>
+        <vis name="SiVertexBarrelLayerVis" alpha="0.2" r="0.1" g="0.1" b="0.6" showDaughters="true" visible="true"/>
+        <vis name="SiVertexBarrelROVis" alpha="0.2" r="0.2" g="0.4" b="0.4" showDaughters="true" visible="true"/>
+
+        <vis name="SiTrackerBarrelModuleVis" alpha="0.5" r="0.1" g="0.1" b="0.6"  showDaughters="false" visible="true"/>
+        <vis name="SiTrackerBarrelLayerVis" alpha="0.5" r="1" g="1" b="0.6" showDaughters="true" visible="false"/>
+
+        <vis name="SiTrackerForwardVis" alpha="1" r="1" g="0" b="0" drawingStyle="solid" showDaughters="false" visible="true"/>
+        <vis name="SiTrackerBackwardVis" alpha="1" r="1" g="0" b="0" drawingStyle="solid" showDaughters="false" visible="true"/>
+        <vis name="SiTrackerForwardModulVis" alpha="1" r="1" g="0" b="0" drawingStyle="solid" showDaughters="false" visible="true"/>
+
+        <vis name="EcalBarrelVis"       alpha="0.1" r="0.2"   g="0.8" b="0.2" showDaughters="true" visible="true"/>
+        <vis name="EcalLayerVis"        alpha="0.1" r="0.2"   g="0.4" b="0.1" showDaughters="true" visible="true"/>        
+        <vis name="EcalBarrelStaveVis"  alpha="0.1" r="0"   g="0.9" b="0.1" showDaughters="true" visible="false"/>
+        <vis name="EcalSensitiveVis"    alpha="0.1" r="0"   g="0.9" b="0.2" showDaughters="true" visible="true"/>
+        <vis name="EcalAbsorberVis"     alpha="0.01" r="0"   g="0.9" b="0.2"  showDaughters="false" visible="false"/>
+        <vis name="EcalPlugVis"         alpha="1"   r="0.5" g="1"   b="0.8"  showDaughters="false" visible="true"/>
+        <vis name="EcalPlugSensitiveVis" alpha="0.1" r="0.5" g="1"   b="0.8" showDaughters="true" visible="true"/>
+
+        <vis name="HcalBarrelVis"          alpha="1"   r="1"    g="0.8"  b="0.6" showDaughters="false" visible="true"/>
+        <vis name="HcalSensorVis"          alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="true" visible="true"/>
+        <vis name="HcalAbsorberVis"        alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="false" visible="false"/>
+        <vis name="HcalBarrelStavesVis"    alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="false" visible="false"/>
+        <vis name="HcalBarrelLayerVis"     alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="false" visible="false"/>
+        <vis name="HcalBarrelSensorVis"    alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="fasle" visible="true"/>
+
+        <vis name="HcalEndcapVis"           alpha="1"   r="1"    g="0.8"  b="0.6" showDaughters="false" visible="true"/>
+        <vis name="HcalEndcapLayerVis"      alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="false" visible="false"/>
+        <vis name="HcalEndcapStavesVis"     alpha="0.1" r="1"    g="0.8"  b="0.6" showDaughters="true" visible="false"/>
+        <vis name="HcalPlugVis"             alpha="1"   r="1"  g="0.8"  b="0.7" showDaughters="false" visible="true"/>
+        <vis name="HcalPlugLayerVis"        alpha="0.1" r="1"  g="0.9"  b="0.8" showDaughters="false" visible="false"/>
+
+        <vis name="SolenoidBarrelLayerVis" alpha="0.6" r="0.3" g="0.9"  b="0.4" showDaughters="false" visible="true"/>
+        <vis name="SolenoidDipoleBarrelLayerVis" alpha="0.6" r="0.2" g="0.9" b="0.9" showDaughters="false" visible="true"/>
+        <vis name="SolenoidBarrelSupportLayerVis" alpha="0.2" r="0.4" g="0.4" b="0.4" showDaughters="false" visible="false"/>
+
+        <vis name="SolenoidCoilEndsVis"    alpha="1" r="0" g="0.8"  b="0.8" showDaughters="true" visible="true"/>
+        <vis name="AntiSolenoidVis"        alpha="1" r="0.3"  g="1"    b="1"   showDaughters="true" visible="true"/>
+
+        <vis name="MuonBarrelVis"          alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="false" visible="true"/>
+        <vis name="MuonBarrelStavesVis"    alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="fasle" visible="false"/>
+        <vis name="MuonBarrelLayerVis"     alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="false" visible="true"/>
+        <vis name="MuonBarrelSensorVis"    alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="true" visible="true"/>
+        <vis name="MuonBarrelAbsorberVis"  alpha="0.4" r="0.8"  g="0.9"  b="1"  visible="false"/>
+
+        <vis name="MuonEndcapVis"          alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="false" visible="true"/>
+        <vis name="MuonEndcapLayerVis"     alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="false" visible="true"/>
+        <vis name="MuonEndcapSensorVis"    alpha="0.4" r="0.8"  g="0.9"  b="1"  showDaughters="true"  visible="true"/>
+        <vis name="MuonEndcapAbsorberVis"  alpha="0.4" r="0.8"  g="0.9"  b="1"  visible="false"/>
+
+        <vis name="BeamPipeVis" alpha="1" r="0.9" g="0.9" b="0.9" showDaughters="true" visible="true"/> 
+        <vis name="CableVis" showDaughters="false" visible="false"/>
+
+        <vis name="SupportTubeVis" alpha="1" r="0.7" g="0.7" b="0.2" showDaughters="true" visible="true"/>
+        <vis name="TungstenShieldingVis" r="0.99" g="0.1" b="0.2" showDaughters="false" visible="true"/>
+
+        <vis name="SupportVis" alpha="0.5" r="0.01" g="0.7" b="0" showDaughters="false" visible="true"/>
+        <vis name="LumiCalVis" showDaughters="false" visible="true"/>
+        <vis name="GreenVis" r="0.0" g="1.0" b="0.0" showDaughters="false" visible="true"/>
+        <vis name="RedVis" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
+        <vis name="BlueVis" alpha="0.5" r="0.1" g="0.0" b="0.8" showDaughters="true" visible="true"/>
+        <vis name="BlueVisTrans" alpha="0.1" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="false"/>
+    </display>
+
+
+
+<!-- -->
+  <detectors>
+    <detector id="99" name="SiTrackers" type="Lhe_SubdetectorAssembly" vis="InvisibleWithDaughters">
+      <shape name="SiTrackersEnv" type="Tube" rmin="0.*cm" rmax="EcalBarrel_rmin-1*cm" dz="CentralBeamPipe_zmax+5*cm" material="Air">
+      </shape>
+      <comment>Silicon Tracker Assembly</comment>
+      <composite name="SiVertexBarrel"/>
+      <composite name="SiTrackerBarrel"/>
+      <composite name="SiTrackerForward"/>
+      <composite name="SiTrackerBackward"/>
+      <composite name="VertexBarrelSupports"/>
+      <composite name="VertexEndSupports"/>
+      <composite name="VertexReadout"/>
+      <composite name="TrackerBarrelSupports"/>
+      <composite name="TrackerBReadout"/>
+      <composite name="Beampipe"/>
+    </detector>
+  </detectors>
+    
+    <detectors>
+
+        <comment>Trackers</comment>
+
+<!-- SiVertexBarrel -->
+        <comment>Vertex Detector Barrel</comment>
+        <detector id="1" name="SiVertexBarrel"
+                         type="Lhe_BP_SiVertexBarrel" 
+                         readout="SiVertexBarrelHits" 
+                         insideTrackingVolume="true" 
+                         reflect="true" 
+                         region="SiVertexBarrelRegion" 
+                         limits="SiVertexBarrelRegionLimitSet">
+    		<module name="VtxBarrelModuleInner" vis="SiVertexBarrelModuleVis">
+      		<module_envelope width="10.0*mm" length="(VertexBarrel_zmax+0.1*cm)*2" thickness="VxBar_Env"/>
+     		 <module_component width="7.8*mm" length="(VertexBarrel_zmax-0.15*cm)*2" thickness="0.0130*cm" material="CarbonFiber_50D" sensitive="false" vis="SiVertexPassiveVis">
+				<position z="-0.12*mm"/>
+   		     </module_component>
+
+             <module_component 
+                  width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*2" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="SiVertexPassiveVis">
+	            <position z="-0.024*cm" />
+             </module_component>
+
+		     <module_component width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*2" thickness="0.005*cm" material="Silicon" sensitive="true" vis="SiVertexSensitiveVis">
+				<position z="0.225*mm"/>
+      		 </module_component> 
+             <module_component 
+                  width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*2" thickness="0.0038*cm" material="Kapton" sensitive="false" vis="SiVertexPassiveVis">
+				<position z="0.1375*cm"/>
+             </module_component>
+             <module_component 
+                  width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*2" thickness="0.00038*cm" material="Copper" sensitive="false" vis="SiVertexPassiveVis">
+				<position z="0.146*cm"/>
+             </module_component>
+
+    		</module>
+            <layer module="VtxBarrelModuleInner" id="1" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="VertexBarrel_r0 - VxBar_Env" 
+                  outer_r="VertexBarrel_r0 + VxBar_Env" 
+                  z_length="VertexBarrel_zmax"/>
+                <rphi_layout 
+                  phi_tilt="0.0*rad"
+                  nphi="50"
+                  phi0="4.71238898038468967e+00*rad" 
+                  rc="VertexBarrel_r0 + 0.0*mm" 
+                  dr="0.0*mm"/>
+                 <z_layout dr="0.0*mm" z0="0.0*mm" nz="1"/>
+            </layer>
+
+            <layer module="VtxBarrelModuleInner" id="2" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="VertexBarrel_r1 - VxBar_Env" 
+                  outer_r="VertexBarrel_r1 + VxBar_Env" 
+                  z_length="VertexBarrel_zmax"/>
+                <rphi_layout 
+                  phi_tilt="0.0*rad"
+                  nphi="50"
+                  phi0="4.71238898038468967e+00*rad" 
+                  rc="VertexBarrel_r1 + 0.0*mm" 
+                  dr="0.0*mm"/>
+    	    <z_layout dr="0.0*mm" z0="0.0*mm" nz="1"/>
+            </layer>
+
+            <layer module="VtxBarrelModuleInner" id="3" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="VertexBarrel_r2 - VxBar_Env" 
+                  outer_r="VertexBarrel_r2 + VxBar_Env" 
+                  z_length="VertexBarrel_zmax"/>
+                <rphi_layout 
+                  phi_tilt="0.0*rad"
+                  nphi="50"
+                  phi0="4.71238898038468967e+00*rad" 
+                  rc="VertexBarrel_r2 + 0.0*mm"
+                  dr="0.0*mm"/>
+     		 <z_layout dr="0.0*mm" z0="0.0*mm" nz="1"/>
+            </layer>
+            <layer module="VtxBarrelModuleInner" id="4" vis="SiVertexBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="VertexBarrel_r3 - VxBar_Env" 
+                  outer_r="VertexBarrel_r3 + VxBar_Env" 
+                  z_length="VertexBarrel_zmax"/>
+                <rphi_layout 
+                  phi_tilt="0.0*rad"
+                  nphi="50"
+                  phi0="4.71238898038468967e+00*rad" 
+                  rc="VertexBarrel_r3 + 0.0*mm" 
+                  dr="0.0*mm"/>
+     		 <z_layout dr="0.0*mm" z0="0.0*mm" nz="1"/>
+            </layer>
+
+        </detector>
+
+  
+<!-- -->
+       <comment>Vertex Detector Supports </comment>
+        <detector name="VertexBarrelSupports" 
+                  type="Lhe_BP_MultiLayerTracker" 
+                   reflect="true" 
+                 vis="SupportTubeVis">
+            <comment>Double-walled Carbon Fiber support tube</comment>
+
+            <layer id="1" 
+              inner_r = "CentralBeamPipe_rmax + VxBar_Env" 
+              outer_z = "VertexBarrel_zmax + 0.5*cm" 
+              outer_r = "CentralBeamPipe_rmax + VxBar_Env + 0.2*cm"  
+              rmax    = "CentralBeamPipe_rmax + 0.2*cm + 7.2*cm" >
+               <slice material = "CarbonFiber" thickness ="VXD_CF_support"/>
+            </layer>
+
+           <layer id="2" 
+             inner_r = "VertexBarrel_r3 + 2*VxBar_Env + 0.4*cm" 
+             outer_z = "VertexBarrel_zmax + 0.5*cm" 
+             outer_r = "VertexBarrel_r3 + 2*VxBar_Env + 0.8*cm" 
+             rmax    = "VertexBarrel_r3 + 2*VxBar_Env + 0.8*cm + 3.2*cm" >
+              <slice material = "CarbonFiber" thickness ="VXD_CF_support"/>
+            </layer>     
+
+        </detector>
+
+        <detector name="VertexEndSupports" 
+                  type="Lhe_BP_DiskTracker" 
+                  reflect="true" 
+                  vis="SiVertexBarrelROVis">
+        
+            <layer id="3" 
+              inner_r = "VertexBarrel_r0 + 0.4*cm" 
+              outer_r = "VertexBarrel_r0 + 1.6*cm" 
+              rmax    = "CentralBeamPipe_rmax + 0.2*cm + 10.7*cm" 
+              rmin    = "CentralBeamPipe_rmax + 10.7*cm" 
+              inner_z = "VertexBarrel_zmax + 1.0*cm" >
+              <slice material = "CarbonFiber" thickness = "VXD_CF_support" />
+            </layer>
+
+            <layer id="4" 
+              inner_r = "VertexBarrel_r3 + 2*VxBar_Env - 1.*cm" 
+              outer_r = "VertexBarrel_r3 + 2*VxBar_Env + 0.2*cm" 
+              rmax    = "VertexBarrel_r3 + 2*VxBar_Env + 3.5*cm" 
+              rmin    = "VertexBarrel_r3 + 2*VxBar_Env + 3.5*cm - 0.2*cm" 
+              inner_z = "VertexBarrel_zmax + 1.0*cm" >
+              <slice material = "CarbonFiber" thickness = "VXD_CF_support" />
+            </layer>
+        </detector>
+
+<!-- VertexReadout  -->
+        <detector name="VertexReadout" 
+                  type="Lhe_BP_DiskTracker" 
+                  reflect="true"
+                  sensitive="false" 
+                  vis="SiVertexBarrelROVis">
+            <comment>Readout and Cabling</comment>
+
+            <layer id="5"
+              inner_r = "VertexBG10_r0_in + 0.4*cm" 
+              outer_r = "VertexBG10_r0_ou + 1.6*cm"  
+              inner_z = "VertexBarrel_zmax + 2.*cm" 
+              rmax    = "CentralBeamPipe_rmax + 12.*cm" vis="SiVertexBarrelROVis" >
+              <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="6"
+              inner_r = "VertexBG10_r1_in + 0.4*cm" 
+              outer_r = "VertexBG10_r1_ou + 1.6*cm" 
+              inner_z = "VertexBarrel_zmax + 2.*cm"
+              rmax    = "CentralBeamPipe_rmax + 0.4*cm + 12.*cm + VertexBG10_r1_ou*0.22" vis="SiVertexBarrelROVis" >
+              <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="7" 
+              inner_r = "VertexBG10_r2_in + 0.4*cm" 
+              outer_r = "VertexBG10_r2_ou + 1.6*cm"  
+              inner_z = "VertexBarrel_zmax + 2.*cm"   
+              rmax    = "CentralBeamPipe_rmax + 0.2*cm + 12.*cm + VertexBG10_r2_ou*0.33" vis="SiVertexBarrelROVis">
+              <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="8" 
+              inner_r = "VertexBG10_r3_in + 0.4*cm" 
+              outer_r = "VertexBG10_r3_ou + 1.6*cm"  
+              inner_z = "VertexBarrel_zmax + 2.*cm"  
+              rmax    = "CentralBeamPipe_rmax + 0.2*cm + 12.*cm + VertexBG10_r3_ou*0.33" vis="SiVertexBarrelROVis">
+              <slice material = "G10" thickness ="G10thickness"/>
+            </layer>
+
+            <layer id="9" 
+              inner_r = "VertexCo_r0_in + 0.4*cm" 
+              outer_r = "VertexCo_r0_ou + 1.6*cm"  
+              inner_z = "VertexBarrel_zmax + 4.*cm" 
+              rmax    = "CentralBeamPipe_rmax + 0.4 + 12.*cm " vis="SiVertexBarrelROVis">
+              <slice material = "Copper" thickness ="0.0057*cm"/>
+            </layer>
+
+            <layer id="10" 
+              inner_r = "VertexCo_r1_in + 0.4*cm" 
+              outer_r = "VertexCo_r1_ou + 1.6*cm"  
+              inner_z = "VertexBarrel_zmax + 4.0*cm" 
+              rmax    = "CentralBeamPipe_rmax + 0.4*cm + 12.*cm + VertexCo_r0_ou*0.22" vis="SiVertexBarrelROVis">
+              <slice material = "Copper" thickness ="0.0031*cm"/>
+            </layer>
+
+            <layer id="11" 
+              inner_r = "VertexCo_r2_in + 0.4*cm" 
+              outer_r = "VertexCo_r2_ou + 1.6*cm"  
+              inner_z = "VertexBarrel_zmax + 4.0*cm" 
+              rmax    = "CentralBeamPipe_rmax + 0.4*cm + 12.*cm + VertexCo_r2_ou*0.33" vis="SiVertexBarrelROVis" >
+              <slice material = "Copper" thickness ="0.0016*cm"/>
+            </layer>
+
+            <layer id="12" 
+              inner_r = "VertexCo_r3_in + 0.4*cm" 
+              outer_r = "VertexCo_r3_ou + 1.6*cm"  
+              inner_z = "VertexBarrel_zmax + 4.0*cm" 
+              rmax    = "CentralBeamPipe_rmax + 0.4*cm + 12.*cm + VertexCo_r3_ou*0.33" vis="SiVertexBarrelROVis" >
+              <slice material = "Copper" thickness ="0.0007*cm"/>
+            </layer>
+
+        </detector>
+
+<!--SiTrackerBarrel -->
+        <detector id="2" name="SiTrackerBarrel" 
+                         type="Lhe_SiTrackerBarrel" 
+                         insideTrackingVolume="true" 
+                         readout="SiTrackerBarrelHits" 
+                         region="SiTrackerBarrelRegion" 
+                         limits="SiTrackerBarrelRegionLimitSet">
+            <comment>Outer Tracker Barrel</comment>
+
+            <module name="SiTrackerModule_Layer0"   vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.3*cm"/>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false">
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false">
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component 
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.0038*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component 
+                  width="SiMod_w0" length="SiMod_l0" thickness="0.00038*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer1" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.3*cm"/>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false">
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.0175*cm"  material="Epoxy" sensitive="false" vis="false">
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component                 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>                
+                <module_component 
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>                
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>                
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.0051*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>                
+                <module_component 
+                  width="SiMod_w1" length="SiMod_l1" thickness="0.00052*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer2" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.3*cm"/>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false" >
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component 
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.0064*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w2" length="SiMod_l2" thickness="0.00065*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer3" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.3*cm"/>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false" >
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.0078*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w3" length="SiMod_l3" thickness="0.00079*cm" material="Copper" sensitive="false" vis="false" >
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <module name="SiTrackerModule_Layer4" vis="SiTrackerBarrelModuleVis">
+                <module_envelope 
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.3*cm"/>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.02*cm" material="PEEK" sensitive="false" vis="false" >
+                    <position z="-0.14*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false" >
+                    <position z="-0.122*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.18*cm" material="Rohacell31_50D" sensitive="false" vis="false" >
+                    <position z="-0.024*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.0175*cm" material="Epoxy" sensitive="false" vis="false" >
+                    <position z="0.07475*cm" />
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.016*cm" material="CarbonFiber_50D" sensitive="false" vis="false">
+                    <position z="0.0915*cm" />
+                </module_component>
+                <module_component
+                  width="SiWafer_w" length="SiWafer_l" thickness="0.03*cm" material="Silicon" sensitive="true">
+                    <position z="0.1145*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.00048*cm" material="Silicon" sensitive="false" vis="false" >
+                    <position z="0.12974*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.0091*cm" material="Kapton" sensitive="false" vis="false" >
+                    <position z="0.1375*cm"/>
+                </module_component>
+                <module_component
+                  width="SiMod_w4" length="SiMod_l4" thickness="0.00093*cm" material="Copper" sensitive="false" vis="false">
+                    <position z="0.146*cm"/>
+                </module_component>
+            </module>
+
+            <layer module="SiTrackerModule_Layer0" id="1" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="Radius_SITLayer0 + 8.*mm" 
+                  outer_r="Radius_SITLayer0+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z0*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="17" phi0="0."  rc="Radius_SITLayer0 + 12.*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi0" nz="11"/>               
+            </layer>   <comment>  z-length = +-53cm; radius = 24cm </comment>
+
+            <layer module="SiTrackerModule_Layer1" id="2" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope
+                  inner_r="Radius_SITLayer1" 
+                  outer_r="Radius_SITLayer1+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z1*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="20" phi0="0.087*rad"  rc="Radius_SITLayer1 + 8*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi1" nz="13"/>        
+            </layer>   <comment>  z-length = +-59cm; radius = 29cm  </comment>
+          
+            <layer module="SiTrackerModule_Layer2" id="3" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="Radius_SITLayer2" 
+                  outer_r="Radius_SITLayer2+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z2*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="24" phi0="0.058*rad"  rc="Radius_SITLayer2 + 8*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi2" nz="14"/>
+            </layer>    <comment>  z-length = +-69cm; radius = 34cm  </comment>
+          
+            <layer module="SiTrackerModule_Layer3" id="4" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="Radius_SITLayer3" 
+                  outer_r="Radius_SITLayer3+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z3*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="28" phi0="0.0436*rad" rc="Radius_SITLayer3 + 8.*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi3" nz="18"/>
+            </layer>    <comment>  z-length = +-79cm; radius = 39cm  </comment>
+           
+            <layer module="SiTrackerModule_Layer4" id="5" vis="SiTrackerBarrelLayerVis">
+                <barrel_envelope 
+                  inner_r="Radius_SITLayer4"  
+                  outer_r="Radius_SITLayer4+Diff_Radius_SITLayer" 
+                  z_length="SiMod_z4*2"/>
+                <rphi_layout 
+                  phi_tilt="0.13*rad" nphi="32" phi0="0.01745*rad" rc="Radius_SITLayer4 + 8*mm" dr="0.0"/>
+                <z_layout dr="4.0*mm" z0="SiMod_zi4" nz="22"/>
+            </layer>    <comment>  z-length = +-89cm; radius = 44cm  </comment>
+                        
+        </detector>
+
+
+
+
+<!--  -->
+
+        <comment>   Outer Tracker Supports   </comment>
+
+        <detector name="TrackerBarrelSupports" 
+                  type="Lhe_MultiLayerTracker" 
+                  reflect="true" 
+                  vis="SupportVis">
+            <comment>Barrels</comment>
+ 
+            <layer id="1" 
+              inner_r = "Radius_SITLayer0 - VxBar_Env*0.3" 
+              outer_z = "SiMod_z0 + VxBar_Env/4 - 2.*cm">
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+            <layer id="2" 
+               inner_r="Radius_SITLayer1 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z1 + VxBar_Env/4 - 1.5*cm">
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+            <layer id="3" 
+               inner_r="Radius_SITLayer2 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z2 + VxBar_Env/4 - 1.5*cm">>
+                <slice material= "CarbonFiber" thickness = "0.05*cm" />
+                <slice material= "Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material= "CarbonFiber" thickness="0.05*cm" />
+            </layer>
+
+            <layer id="4" 
+               inner_r="Radius_SITLayer3 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z3 + VxBar_Env/4 - 1.5*cm">>
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+
+            <layer id="5" 
+               inner_r="Radius_SITLayer4 - VxBar_Env - 0.5*cm" 
+               outer_z="SiMod_z4 + VxBar_Env/4 - 1.5*cm">>
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+                <slice material="Rohacell31_15percent" thickness="0.8075*cm" />
+                <slice material="CarbonFiber" thickness="0.05*cm" />
+            </layer>
+
+       </detector>
+
+<!-- -->
+        <detector name="TrackerBReadout" 
+                  type="Lhe_DiskTracker" 
+                  reflect="true" 
+                  vis="GreenVis">
+            <comment>Readouts</comment>
+
+            <layer id="1" 
+              inner_r="Radius_SITLayer0 - VxBar_Env " 
+              inner_z="SiMod_z0" 
+              outer_r="Radius_SITLayer0 ">
+                <slice material="G10" thickness="0.057*cm" />
+                <slice material="Copper" thickness="0.0038*cm" />
+            </layer>
+ 
+            <layer id="2" 
+              inner_r="Radius_SITLayer1 - VxBar_Env*2 " 
+              inner_z="SiMod_z1" 
+              outer_r="Radius_SITLayer1 ">
+                <slice material = "G10" thickness="0.102*cm" />
+                <slice material = "Copper" thickness="0.0068*cm" />
+            </layer>
+            <layer id="3" 
+              inner_r="Radius_SITLayer2 - VxBar_Env*2 " 
+              inner_z="SiMod_z2" 
+              outer_r="Radius_SITLayer2 ">
+                <slice material="G10" thickness="0.108*cm" />
+                <slice material="Copper" thickness="0.0072*cm" />
+            </layer>
+            <layer id="4" 
+              inner_r="Radius_SITLayer3 - VxBar_Env*2 " 
+              inner_z="SiMod_z3" 
+              outer_r="Radius_SITLayer3 ">
+                <slice material="G10" thickness="0.186*cm" />
+                <slice material="Copper" thickness="0.0124*cm" />
+            </layer>
+            <layer id="5" 
+              inner_r= "Radius_SITLayer4 - VxBar_Env*2 " 
+              inner_z="SiMod_z4" 
+              outer_r="Radius_SITLayer4 ">
+                <slice material="G10" thickness="0.246*cm" />
+                <slice material="Copper" thickness="0.0164*cm" />
+            </layer>
+
+        </detector>
+
+       
+<!-- fwd-tracker -->
+
+        <detector id="3" name="SiTrackerForward" 
+                         type="Lhe_SiTrackerEndcap2" 
+                         readout="SiTrackerForwardHits" 
+                         reflect="false"
+                         r="VertexBarrel_r0 - VxBar_Env"
+                         rmax="CentralBeamPipe_rmax + 1.*cm + 7.5*cm"
+                         vis="SiTrackerForwardVis">
+            <comment>Forward Tracker outside Barrel Support</comment>
+            <module name="Module1" vis="SiTrackerForwardModulVis">
+                <trd x1="36.112*mm" x2="46.635*mm" z="100.114/2*mm" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+            </module>
+            <module name="Module2" vis="SiTrackerForwardModulVis">
+                <trd x1="45.245*mm" x2="54.680*mm" z="89.773/2*mm" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+            </module>
+
+           <layer id="1">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z0+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z0+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z0+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>    <comment> new: middle-z-pos. = +75cm; outer_radius = 32cm  </comment>
+
+           <layer id="2">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z1+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z1+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z1+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>     <comment>  middle-z-pos. = +92.5cm; outer_radius = 38cm  </comment>
+
+           <layer id="3">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z2+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z2+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z2+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z2+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z2+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +142cm; outer_radius = 46cm  </comment>
+
+           <layer id="4">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z3+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z3+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z3+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z3+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z3+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +192cm; outer_radius = 46cm  </comment>
+
+           <layer id="5">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z4+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z4+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z4+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z4+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z4+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +267cm; outer_radius = 46cm  </comment>
+
+           <layer id="6">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z5+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z5+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z5+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z5+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z5+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +332cm; outer_radius = 46cm  </comment>
+
+           <layer id="7">
+                <ring r="Ftd_sdisk_ri0" zstart="Ftd_disk_z6+32*mm+5*mm" nmodules="8" dz="2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Ftd_disk_z6+24*mm+4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Ftd_disk_z6+16*mm+4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Ftd_disk_z6+8*mm+4*mm"  nmodules="22" dz="2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Ftd_disk_z6+4*mm" nmodules="28" dz="2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = +372cm; outer_radius = 46cm  </comment>
+
+        </detector>
+
+<!-- bwd-tracker -->
+        <detector id="4" name="SiTrackerBackward" 
+                         type="Lhe_BP_SiTrackerEndcap2" 
+                         readout="SiTrackerBackwardHits" 
+                         reflect="false"
+                         r="VertexBarrel_r0 - VxBar_Env"
+                         rmax="CentralBeamPipe_rmax + 1.*cm + 7.5*cm"
+                         vis="SiTrackerBackwardVis">
+            <comment>Forward Tracker outside Barrel Support</comment>
+            <module name="Module1" vis="SiTrackerForwardModulVis">
+                <trd x1="36.112*mm" x2="46.635*mm" z="100.114/2*mm" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0051*cm"   material="Kapton" />
+                <module_component thickness="0.00052*cm"   material="Copper" />
+            </module>
+            <module name="Module2" vis="SiTrackerForwardModulVis">
+                <trd x1="45.245*mm" x2="54.680*mm" z="89.773/2*mm" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.18*cm" material="Rohacell31_50D" />
+                <module_component thickness="0.016*cm" material="CarbonFiber_50D" />
+                <module_component thickness="0.0175*cm" material="Epoxy" />
+                <module_component thickness="0.03*cm"   material="Silicon" sensitive="true" />
+                <module_component thickness="0.00048*cm" material="Silicon" />
+                <module_component thickness="0.0078*cm"   material="Kapton" />
+                <module_component thickness="0.00079*cm"   material="Copper" />
+            </module>
+
+           <layer id="1">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z0-32*mm-5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z0-24*mm-4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z0-16*mm-4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>     <comment>  middle-z-pos. = -70cm; outer_radius = 29cm  </comment>
+
+           <layer id="2">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z1-32*mm-5*mm" nmodules="8" dz="2.5*mm" module="Module1" phi0="pi/10"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z1-24*mm-4*mm" nmodules="14" dz="2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z1-16*mm-4*mm" nmodules="20" dz="2*mm" module="Module1"/>
+            </layer>     <comment>  middle-z-pos. = -92.5cm; outer_radius = 38cm  </comment>
+
+           <layer id="3">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z2-32*mm-5*mm" nmodules="8" dz="-2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z2-24*mm-4*mm" nmodules="14" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z2-16*mm-4*mm" nmodules="20" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Btd_disk_z2-8*mm-4*mm"  nmodules="22" dz="-2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Btd_disk_z2-4*mm" nmodules="28" dz="-2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = -132cm; outer_radius = 46cm  </comment>
+
+            <layer id="4">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z3-32*mm-5*mm" nmodules="8" dz="-2.5*mm" module="Module1" />
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z3-24*mm-4*mm" nmodules="14" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z3-16*mm-4*mm" nmodules="20" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Btd_disk_z3-8*mm-4*mm"  nmodules="22" dz="-2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Btd_disk_z3-4*mm" nmodules="28" dz="-2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = -172cm; outer_radius = 46cm  </comment>
+
+            <layer id="5">
+                <ring r="Ftd_sdisk_ri0" zstart="Btd_disk_z4-32*mm-5*mm" nmodules="8" dz="-2.5*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri1" zstart="Btd_disk_z4-24*mm-4*mm" nmodules="14" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri2" zstart="Btd_disk_z4-16*mm-4*mm" nmodules="20" dz="-2*mm" module="Module1"/>
+                <ring r="Ftd_sdisk_ri3" zstart="Btd_disk_z4-8*mm-4*mm"  nmodules="22" dz="-2*mm" module="Module2" phi0="pi/22"/>
+                <ring r="Ftd_sdisk_ri4" zstart="Btd_disk_z4-4*mm" nmodules="28" dz="-2*mm" module="Module2" phi0="pi/28"/>
+            </layer>     <comment>  middle-z-pos. = -202cm; outer_radius = 46cm  </comment>
+            
+        </detector>
+
+        <comment>Calorimeters</comment>
+<!--ECAL -->
+        <detector id="5" name="EcalBarrel" 
+                         type="Lhe_PolyhedraBarrelCalorimeter2" 
+                         readout="EcalBarrelHits" 
+                         vis="EcalBarrelVis" 
+                         reflect="false" 
+                         gap="0.*cm" 
+                         calorimeterType="EM_BARREL">
+            <comment>EM Calorimeter Barrel</comment>
+            <dimensions numsides="(int) CaloSides" rmin="EcalBarrel_rmin" z_offset="OffsetZ" z="EcalBarrel_zmax" />
+            <staves vis="EcalBarrelStaveVis"/>
+
+            <layer repeat="1" vis="EcalLayerVis" >
+                <slice material = "Kapton"  thickness = "0.03*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.3*cm" sensitive = "yes" limits="cal_limits" vis="EcalSensitiveVis"/>
+            </layer>   <comment>  -z-pos. = -205cm, +z-pos. = +375cm  inner_radius = 47cm (61cm) l_thick=0.33cm </comment>
+
+            <layer repeat="20" vis="EcalLayerVis" >
+                <slice material = "Pb" thickness = "0.4*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.3*cm" sensitive = "yes" limits="cal_limits" vis="EcalSensitiveVis"/>
+                <slice material = "Air" thickness = "0.05*cm" vis="InvisibleNoDaughters"/>
+            </layer>  <comment>  -z-pos. = -205cm, +z-pos. = +375cm  inner_radius = 47cm (+17cm)  l_thick=15.cm </comment>
+
+            <layer repeat="25" vis="EcalLayerVis" >
+                <slice material = "Pb" thickness = "0.65*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.3*cm" sensitive = "yes" limits="cal_limits" vis="EcalSensitiveVis"/>
+                <slice material = "Air" thickness = "0.05*cm" vis="InvisibleNoDaughters"/>
+            </layer>   <comment>  -z-pos. = -205cm, +z-pos. = +375cm  inner_radius = 47cm (+23cm) l_thick=25.cm </comment>
+        </detector>
+
+<!--ECALEndCap fwd/bwd -->
+        <detector id="6" name="EcalEndcap_fwd" 
+                         type="Lhe_PolyhedraEndcapCalorimeter2" 
+                         reflect="false" 
+                         readout="EcalEndcapHits0" 
+                         vis="EcalPlugVis"
+                         calorimeterType="EM_ENDCAP">
+        <comment> EM Calorimeter Endcaps </comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmin_fwd+2*cm" rmin="EcalEndcap_rmin" rmax="EcalBarrel_rmax" />
+
+            <layer repeat="1">      <comment> 0.1*cm  </comment>
+                 <slice material = "Silicon" thickness = "0.032*cm" sensitive="yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                 <slice material = "TungstenDens25"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                 <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                 <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>     
+            </layer>
+            <layer repeat="52">     <comment>  0.375*cm </comment>
+                  <slice material = "TungstenDens25" thickness = "0.25*cm" />
+                  <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                  <slice material = "Silicon" thickness = "0.032*cm" sensitive="yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                  <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>          
+            </layer>
+
+            <layer repeat="32">     <comment>  0.625*cm </comment>
+                  <slice material = "TungstenDens25" thickness = "0.5*cm" />
+                  <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                  <slice material = "Silicon" thickness = "0.032*cm" sensitive="yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                  <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                  <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+            
+        </detector>
+
+
+        <detector id="7" name="EcalEndcap_bwd" 
+                         type="Lhe_PolyhedraEndcapCalorimeter2" 
+                         reflect="false" 
+                         readout="EcalEndcapHits1" 
+                         vis="EcalPlugVis" 
+                         calorimeterType="EM_ENDCAP">
+            <comment>EM Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmin_bwd-4.*cm" rmin="EcalEndcap_rmin" rmax="EcalBarrel_rmax" />
+
+            <layer repeat="32">     <comment>  0.625*cm x 33  = 20.625*cm </comment>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Pb" thickness = "0.5*cm" vis="EcalAbsorberVis"/>
+            </layer>    
+
+            <layer repeat="52">     <comment>  0.375*cm x 53 = 19.875</comment>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+                <slice material = "Air"     thickness = "0.025*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Pb" thickness = "0.25*cm" vis="EcalAbsorberVis"/>
+            </layer>
+
+            <layer repeat="1">      <comment> 0.1*cm  </comment>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="EcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="EcalPlugSensitiveVis"/>
+            </layer>
+
+        </detector>
+
+<!--HCAL -->
+        <detector id="8" name="HcalBarrel" 
+                         type="Lhe_PolyhedraBarrelCalorimeter2" 
+                         readout="HcalBarrelHits" vis="HcalBarrelVis" 
+                         calorimeterType="HAD_BARREL" 
+                         gap="0.*cm" 
+                         material="Steel235">
+            <comment>Hadron Calorimeter Barrel</comment>
+            <dimensions numsides="(int) CaloSides" rmin="HcalBarrel_rmin" z="HcalBarrel_length" z_offset="OffsetZ"/>
+            <staves vis="HcalBarrelStavesVis"/>
+            <layer repeat="(int) HcalBarrel_layers">
+                <slice material = "Steel235" thickness = "1.00*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.50*cm" sensitive = "yes" limits="cal_limits" vis="HcalBarrelSensorVis"/>
+                <slice material = "Air" thickness = "0.15*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+        <detector id="9" name="HcalEndcap_fwd" 
+                         type="Lhe_PolyhedraEndcapCalorimeter2" 
+                         readout="HcalEndcapHits0" 
+                         reflect="false" 
+                         vis="HcalEndcapVis" 
+                         calorimeterType="HAD_ENDCAP">
+            <comment>Hadron Calorimeter Endcaps</comment>
+            <staves vis="HcalEndcapStavesVis"/>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmin_fwd" rmin="HcalBarrel_rmin"  rmax="HcalEndcap_rmax" />
+            <layer repeat="(int) HcalEndcap_fwd_layers">
+                <slice material = "Steel235" thickness = "1.00*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.50*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Air" thickness = "0.15*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+
+        <detector id="10" name="HcalEndcap_bwd" 
+                           type="Lhe_PolyhedraEndcapCalorimeter2" 
+                           readout="HcalEndcapHits1" 
+                           reflect="false" 
+                           vis="HcalEndcapVis" 
+                           calorimeterType="HAD_ENDCAP">
+            <staves vis="HcalEndcapStavesVis"/>
+            <comment>Hadron Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalBarrel_zmin-HcalEndcap_thickness_bwd-3.*cm" rmin="HcalBarrel_rmin"  rmax="HcalEndcap_rmax" />
+            <layer repeat="(int) HcalEndcap_bwd_layers">
+                <slice material = "Steel235" thickness = "1.00*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Polystyrene" thickness = "0.50*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Air" thickness = "0.15*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+
+        <detector id="11" name="HcalPlug_fwd" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="HcalPlugHits01" 
+                          reflect="false" 
+                          vis="HcalPlugVis">
+            <comment>Hadron Calorimeter Plug</comment>
+            <dimensions numsides="(int) CaloSides" zmin="EcalEndcap_zmax_fwd+4*cm" rmin="VertexBarrel_r2" rmax="SolenoidBarrelConductorInnerRadius1-10.*cm" />
+            <layer repeat="(int) HcalPlug_fwd_layers">
+                <slice material = "TungstenDens24" thickness = "1.0*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+        <detector id="13" name="HcalPlug_bwd" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="HcalPlugHits11" 
+                          reflect="false" 
+                          vis="HcalPlugVis">
+            <comment>Hadron Calorimeter Plug</comment>
+            <dimensions numsides="(int) CaloSides" zmin="HcalPlug_zmin_bwd-6.*cm" rmin="VertexBarrel_r2" rmax="SolenoidBarrelConductorInnerRadius1-10.*cm" />
+            <layer repeat="(int) HcalPlug_bwd_layers">
+                <slice material = "Cu" thickness = "1.5*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Silicon" thickness = "0.032*cm" sensitive = "yes" limits="cal_limits" vis="HcalSensorVis"/>
+                <slice material = "Copper"  thickness = "0.005*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Kapton"  thickness = "0.030*cm" vis="HcalAbsorberVis"/>
+                <slice material = "Air"     thickness = "0.033*cm" vis="InvisibleNoDaughters"/>
+            </layer>
+        </detector>
+
+
+<!-- Muon -->
+         <detector id="15" name="MuonBarrel" 
+                           type="Lhe_PolyhedraBarrelCalorimeter2" 
+                           readout="MuonBarrelHits" 
+                           reflect="false" 
+                           vis="MuonBarrelVis" 
+                           calorimeterType="MUON_BARREL" 
+                           gap="0.*cm" 
+                           material="Steel235">
+            <comment>Muon Calorimeter Barrel</comment>
+            <dimensions numsides="(int) MuonSides" rmin="((HcalEndcap_rmax+2.0*cm) / ( cos(pi/CaloSides) ) )" z="MuonBarrel_length" z_offset="OffsetZ*1.2"/>
+            <staves vis="MuonBarrelStavesVis"/>
+            <comment> Start with an active layer, followed by a thin 5.0cm absorber layer. The second active layer is followed by a thick 20.0cm steel layer to take the forces. </comment>
+            <layer repeat="1" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="5.0*cm" vis="MuonBarrelAbsorberVis"/>
+           </layer>
+           <layer repeat="1" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" />
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="20.0*cm" vis="MuonBarrelAbsorberVis"/>
+            </layer>
+            <layer repeat="(int) MuonBarrel_layers" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="10.0*cm" vis="MuonBarrelAbsorberVis"/>
+            </layer>
+            <comment> The last Iron layer is again 20.0cm to take the forces. </comment>
+            <layer repeat="1" vis="MuonBarrelLayerVis">
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" vis="MuonBarrelSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Iron" thickness="20.0*cm" vis="MuonBarrelAbsorberVis"/>
+            </layer>
+        </detector>
+
+<!-- -->
+        <detector id="16" name="MuonEndcap_fwd1" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits01" 
+                          reflect="false" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+           <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_fwd" rmin="VertexBarrel_r3+5*cm" rmax="MuonEndcap_rmax0" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+            </layer>    <comment> layer thickness = 10+4cm </comment>
+        </detector>
+
+
+        <detector id="17" name="MuonEndcap_fwd2" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits02" 
+                          reflect="fasle" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_fwd" rmin="HcalBarrel_rmin" rmax="MuonEndcap_rmax1" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>>
+            </layer>
+        </detector>
+
+<!-- -->
+        <detector id="18" name="MuonEndcap_bwd1" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits11" 
+                          reflect="false" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_bwd+14.*cm" rmin="VertexBarrel_r3+5*cm" rmax="MuonEndcap_rmax0" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+            </layer>
+        </detector>
+
+        <detector id="19" name="MuonEndcap_bwd2" 
+                          type="Lhe_PolyhedraEndcapCalorimeter2" 
+                          readout="MuonEndcapHits12" 
+                          reflect="false" 
+                          vis="MuonEndcapVis" 
+                          calorimeterType="MUON_ENDCAP">
+            <comment>Muon Calorimeter Endcaps</comment>
+            <dimensions numsides="(int) MuonSides" zmin="MuonEndcap_zmin_bwd+14.*cm" rmin="HcalBarrel_rmin" rmax="MuonEndcap_rmax1" />
+            <layer repeat="(int) MuonEndcap_layers" vis="MuonEndcapLayerVis">
+                <slice material="Air" thickness="1.0*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes"  vis="MuonEndcapSensorVis"/>
+                <slice material="PyrexGlass" thickness="0.2*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Air" thickness="0.35*cm" vis="InvisibleNoDaughters"/>
+                <slice material="Aluminum" thickness="0.1*cm" vis="MuonEndcapAbsorberVis"/>
+                <slice material="Iron" thickness="10.0*cm"  vis="MuonEndcapAbsorberVis"/>
+            </layer>
+        </detector>
+  
+    <comment>Dead material and supports</comment>
+
+        <comment>Interaction region material - incl. Beampipe</comment>
+<!--            <include ref="LHeCProt.xml"/>
+-->
+<!-- Beampipe circ-elliptical
+          
+       <comment> Beampipe </comment>
+       <comment> Central Be Beampipe</comment>
+       <detector name="Beampipe" type="Lhe_BeamPipe_Central" insideTrackingVolume="true"  vis="BeamPipeVis" z_offset="OffsetZ*2." >
+       <material name="Beryllium"/>
+        <zplane rmin="CentralBeamPipe_rmin" rmax="CentralEllBeamPipe_rmax" thickness="CentralBeamPipe_thickness" z="SolenoidCoilOuterZ1/1.4" />
+       </detector>
+   
+      <comment>Vacuum inside beampipe</comment>
+       <detector name="BeamPipeVacuum" type="Lhe_BeamPipe_Central" insideTrackingVolume="true" vis="InvisibleNoDaughters" z_offset="OffsetZ*2.">
+       <material name="Vacuum"/>
+            <zplane rmin="0.*cm" rmax="CentralBeamPipe_rmin" thickness="CentralBeamPipe_rmin" z="SolenoidCoilOuterZ1/1.4" />
+       </detector>
+-->
+
+<!-- circular beam pipe  for optimal acceptance simulation -->
+
+         <comment>Beampipe - has to be modified - circular-elliptical, in turn the pixel layer(s) as well   </comment>
+         <detector name="Beampipe" 
+                   type="Lhe_PolyconeSupport" 
+                   insideTrackingVolume="true"  
+                   z_offset="OffsetZ" 
+                   vis="BeamPipeVis">
+           <comment>Central Be Beampipe</comment>
+            <material name="Beryllium"/>
+            <zplane rmin="CentralBeamPipe_rmin" rmax="CentralBeamPipe_rmax" z="-CentralBeamPipe_zmax"/>
+            <zplane rmin="CentralBeamPipe_rmin" rmax="CentralBeamPipe_rmax" z="CentralBeamPipe_zmax" />
+        </detector>
+
+
+<!-- -->
+        <detector name="ForwardVacuum" type="Lhe_PolyconeSupport" insideTrackingVolume="false" vis="InvisibleNoDaughters">
+            <material name="Vacuum"/>
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmin"  
+                    z="VertexBarrel_zmax*2 + 0.01*cm" />
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmin"
+                    z="- (VertexBarrel_zmax*2 + 0.01*cm)" />
+        </detector>
+        <detector name="BackwardVacuum" type="Lhe_PolyconeSupport" insideTrackingVolume="false" vis="InvisibleNoDaughters">
+            <material name="Vacuum"/>
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmax - BeamPipe_thickness"
+                    z="- (tracking_region_zmax + 0.01*cm)" />
+            <zplane rmin="0.*cm"
+                    rmax="CentralBeamPipe_rmax - BeamPipe_thickness"
+                    z="- BeamPipe_zmax" />
+            <zplane rmin="0.*cm"
+                    rmax="LumiCal_rmin - 2*BeamPipe_endThickness"
+                    z="- (LumiCal_zmin - 2*BeamPipe_endThickness)" />
+            <zplane rmin="0.*cm"
+                    rmax="LumiCal_rmin - 2*BeamPipe_endThickness"
+                    z="- (LumiCal_zmin - BeamPipe_endThickness)" />
+            <zplane rmin="0.*cm"
+                    rmax="LumiCal_rmin - 2*BeamPipe_endThickness"
+                    z="- (ForwardMask_zmin - BeamPipe_endThickness)" />
+        </detector>
+
+<!--Solenoid -->
+      <comment>Solenoid/Dipole</comment>
+
+       <detector name="SolenoidCoilBarrel1" 
+                 type="Lhe_MultiLayerTracker" 
+                 insideTrackingVolume="false">
+
+          <layer id="1" 
+            z_offset="OffsetZ"  
+            inner_r="SolenoidBarrelInnerRadius1" 
+            outer_z="MuonBarrel_length*0.5"  
+            vis="SolenoidBarrelSupportLayerVis">
+                <slice material="Aluminum" thickness="SolenoidBarrelInnerCryostatThickness1" />
+                <slice material="Vacuum"  thickness="SolenoidBarrelInnerAirgapThickness1" />
+                <slice material="Aluminum" thickness="SolenoidBarrelInnerCryostatThickness1" />
+          </layer>
+
+          <layer id="2" 
+            z_offset="OffsetZ"
+            inner_r="SolenoidBarrelConductorInnerRadius1+2*cm" 
+            outer_z="SolenoidCoilOuterZ1" 
+            vis="SolenoidBarrelLayerVis">
+                <slice material="Aluminum" thickness="SolenoidBarrelAlConductorThickness1" />
+                <slice material="Aluminum" thickness="SolenoidBarrelQuenchbackThickness1" />
+          </layer>
+          <layer id="3" 
+            z_offset="OffsetZ*1.15"
+            inner_r="SolenoidBarrelOuterCryostatInnerRadius1" 
+            outer_z="MuonBarrel_length*0.5" 
+            vis="SolenoidDipoleBarrelLayerVis">
+                <slice material="Aluminum" thickness="DipoleBarrelAlConductorThickness" />
+                <slice material="Aluminum" thickness="SolenoidBarrelInnerCryostatThickness1" />
+                <slice material="Vacuum"   thickness="SolenoidBarrelOuterAirgapThickness1" />
+                <slice material="Aluminum" thickness="SolenoidBarrelOuterCryostatThickness1" />
+           </layer>
+ 
+        </detector>
+
+    </detectors>
+
+    <readouts>
+        <readout name="SiVertexBarrelHits">
+            <id>system:0,barrel:3,layer:4,module:14,sensor:11,side:32:-2,strip:30</id>
+        </readout>
+        <readout name="SiTrackerBarrelHits">
+            <id>system:0,barrel:3,layer:5,module:14,sensor:2,side:32:-2,strip:20</id>
+        </readout>
+        <readout name="SiTrackerForwardHits">
+            <id>system:0,barrel:3,layer:7,module:12,sensor:1,side:32:-2,strip:28</id>
+        </readout>        
+        <readout name="SiTrackerBackwardHits">
+            <id>system:0,barrel:3,layer:7,module:12,sensor:1,side:32:-2,strip:28</id>
+        </readout>
+        <readout name="EcalBarrelHits">
+            <segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="EcalEndcapHits0">
+            <segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="EcalEndcapHits1">
+            <segmentation type="CartesianGridXY" grid_size_x="3.5*cm" grid_size_y="3.5*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalBarrelHits">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalEndcapHits0">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalEndcapHits1">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits01">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits02">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:6,layer:10,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits11">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="HcalPlugHits12">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonBarrelHits">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits01">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits02">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits11">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+        <readout name="MuonEndcapHits12">
+            <segmentation type="CartesianGridXY" grid_size_x="3.0*cm" grid_size_y="3.0*cm" />
+            <id>system:0,barrel:3,module:4,layer:8,slice:5,x:32:-16,y:-16</id>
+        </readout>
+     </readouts>
+
+
+<!--  
+        <plugin name="TestSurfaces"> <argument value="SiTrackerBackward"/> </plugin>
+-->
+<!-- 
+        <plugins>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="SiVertexBarrel"/> <argument value="dimension=1"/> 
+          </plugin>
+ 
+          <plugin name="Lhe_SurfaceExamplePlugin">
+             <argument value="SiVertexBarrel"/>
+             <argument value="aa=1*mm"/>
+             <argument value="bb=2*cm"/>
+             <argument value="cc=3*m"/>
+          </plugin>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="SiTrackerBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="SiTrackerForward"/> </plugin>
+          <plugin name="Lhe_SiTrackerEndcapSurfacePlugin"> <argument value="SiTrackerForward"/> </plugin>
+
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="SiTrackerBackward"/> </plugin>
+          <plugin name="Lhe_SiTrackerEndcapSurfacePlugin"> <argument value="SiTrackerBackward"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="EcalBarrel"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="EcalBarrel"/> </plugin>
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="EcalBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="EcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="EcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="EcalEndcap_fwd"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="EcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin">    <argument value="EcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="EcalEndcap_bwd"/> </plugin>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="HcalBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalEndcap_fwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalEndcap_fwd"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalEndcap_bwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalEndcap_bwd"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalPlug_fwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalPlug_fwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalPlug_fwd"/> </plugin>         
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="HcalPlug_bwd"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="HcalPlug_bwd"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="HcalPlug_bwd"/> </plugin>
+
+          <plugin name="Lhe_SiTrackerBarrelSurfacePlugin"> 
+              <argument value="MuonBarrel"/> <argument value="dimension=1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_fwd1"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_fwd1"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_fwd1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_fwd2"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_fwd2"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_fwd2"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_bwd1"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_bwd1"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_bwd1"/> </plugin>
+
+          <plugin name="Lhe_SubdetectorExtensionPlugin"> <argument value="MuonEndcap_bwd2"/> </plugin>
+          <plugin name="Lhe_LayeringExtensionPlugin"> <argument value="MuonEndcap_bwd2"/> </plugin>
+          <plugin name="Lhe_PolyhedraEndcapCalorimeterSurfacePlugin"> <argument value="MuonEndcap_bwd2"/> </plugin>
+
+        </plugins>
+-->
+
+    <fields>
+        <field name="GlobalSolenoid1" type="solenoid"
+          inner_field="3.5*tesla"
+          outer_field="-1.5*tesla"
+          zmax="SolenoidCoilOuterZ1"
+          outer_radius="world_side">
+        </field>
+       <field name="MachineDipole+" type="DipoleMagnet"
+         rmax="DipoleBarrelAlConductorRadius"
+         zmin="1*cm"
+         zmax="SolenoidCoilOuterZ1">
+        <dipole_coeff>0.4*tesla</dipole_coeff>
+         <dipole_coeff>0.1*tesla/pow(cm,1)</dipole_coeff>
+         <dipole_coeff>0.01*tesla/pow(cm,2)</dipole_coeff>
+       </field>
+       <field name="MachineDipole-" type="DipoleMagnet"
+         rmax="DipoleBarrelAlConductorRadius"
+         zmin="-SolenoidCoilOuterZ1"
+         zmax="-1*cm">
+        <dipole_coeff>-0.4*tesla</dipole_coeff>
+         <dipole_coeff>0.1*tesla/pow(cm,1)</dipole_coeff>
+         <dipole_coeff>0.01*tesla/pow(cm,2)</dipole_coeff>
+       </field>
+    </fields>
+
+</lccdd>
diff --git a/examples/LHeD/compact/detector_types.xml b/examples/LHeD/compact/detector_types.xml
new file mode 100644
index 000000000..60a3d4f90
--- /dev/null
+++ b/examples/LHeD/compact/detector_types.xml
@@ -0,0 +1,74 @@
+<!--
+    define global constants with enums defined in 
+    $DD4hepINSTALL/DDCore/include/DD4hep/DetType.h
+    NB: if that file is changed this file needs to
+        be manually updated correspondingly !!
+
+   author: F.Gaede, DESY 02/2016
+-->
+<define>
+  <constant name="DetType_TRACKER"         value =  " 0x1 "/>
+  <constant name="DetType_CALORIMETER"     value =  " 0x2 "/>
+  <constant name="DetType_CHERENKOV"       value =  " 0x4 "/>
+  <constant name="DetType_ENDCAP"          value =  " 0x8 "/>
+  <constant name="DetType_BARREL"          value =  " 0x10 "/>
+  <constant name="DetType_FORWARD"         value =  " 0x20 "/>
+  <constant name="DetType_VERTEX"          value =  " 0x40 "/>
+  <constant name="DetType_STRIP"           value =  " 0x80 "/>
+  <constant name="DetType_PIXEL"           value =  " 0x100 "/>
+  <constant name="DetType_GASEOUS"         value =  " 0x200 "/>
+  <constant name="DetType_WIRE"            value =  " 0x400 "/>
+  <constant name="DetType_ELECTROMAGNETIC" value =  " 0x800 "/>
+  <constant name="DetType_HADRONIC"        value =  " 0x1000 "/>
+  <constant name="DetType_MUON"            value =  " 0x2000 "/>
+  <constant name="DetType_SUPPORT"         value =  " 0x4000 "/>
+  <constant name="DetType_BEAMPIPE"        value =  " 0x8000 "/>
+  <constant name="DetType_COIL"            value =  " 0x10000 "/>
+  <constant name="DetType_AUXILIARY"       value =  " 0x20000 "/>
+  <!-- <constant name="DetType_bit_ 18 " value =  " 0x40000 "/> -->
+  <!-- <constant name="DetType_bit_ 19 " value =  " 0x80000 "/> -->
+  <!-- <constant name="DetType_bit_ 20 " value =  " 0x100000 "/> -->
+  <!-- <constant name="DetType_bit_ 21 " value =  " 0x200000 "/> -->
+  <!-- <constant name="DetType_bit_ 22 " value =  " 0x400000 "/> -->
+  <!-- <constant name="DetType_bit_ 23 " value =  " 0x800000 "/> -->
+  <!-- <constant name="DetType_bit_ 24 " value =  " 0x1000000 "/> -->
+  <!-- <constant name="DetType_bit_ 25 " value =  " 0x2000000 "/> -->
+  <!-- <constant name="DetType_bit_ 26 " value =  " 0x4000000 "/> -->
+  <!-- <constant name="DetType_bit_ 27 " value =  " 0x8000000 "/> -->
+  <!-- <constant name="DetType_bit_ 28 " value =  " 0x10000000 "/> -->
+  <!-- <constant name="DetType_bit_ 29 " value =  " 0x20000000 "/> -->
+  <!-- <constant name="DetType_bit_ 30 " value =  " 0x40000000 "/> -->
+  <!-- <constant name="DetType_bit_ 31 " value =  " 0x80000000 "/> -->
+  <!-- <constant name="DetType_bit_ 32 " value =  " 0x100000000 "/> -->
+  <!-- <constant name="DetType_bit_ 33 " value =  " 0x200000000 "/> -->
+  <!-- <constant name="DetType_bit_ 34 " value =  " 0x400000000 "/> -->
+  <!-- <constant name="DetType_bit_ 35 " value =  " 0x800000000 "/> -->
+  <!-- <constant name="DetType_bit_ 36 " value =  " 0x1000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 37 " value =  " 0x2000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 38 " value =  " 0x4000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 39 " value =  " 0x8000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 40 " value =  " 0x10000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 41 " value =  " 0x20000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 42 " value =  " 0x40000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 43 " value =  " 0x80000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 44 " value =  " 0x100000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 45 " value =  " 0x200000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 46 " value =  " 0x400000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 47 " value =  " 0x800000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 48 " value =  " 0x1000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 49 " value =  " 0x2000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 50 " value =  " 0x4000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 51 " value =  " 0x8000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 52 " value =  " 0x10000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 53 " value =  " 0x20000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 54 " value =  " 0x40000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 55 " value =  " 0x80000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 56 " value =  " 0x100000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 57 " value =  " 0x200000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 58 " value =  " 0x400000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 59 " value =  " 0x800000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 60 " value =  " 0x1000000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 61 " value =  " 0x2000000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 62 " value =  " 0x4000000000000000 "/> -->
+  <!-- <constant name="DetType_bit_ 63 " value =  " 0x8000000000000000 "/> -->
+</define>
diff --git a/examples/LHeD/compact/elements.xml b/examples/LHeD/compact/elements.xml
new file mode 100644
index 000000000..e714c3a5c
--- /dev/null
+++ b/examples/LHeD/compact/elements.xml
@@ -0,0 +1,884 @@
+<materials>
+ <element Z="89" formula="Ac" name="Ac" >
+  <atom type="A" unit="g/mol" value="227.028" />
+ </element>
+ <material formula="Ac" name="Actinium" state="solid" >
+  <RL type="X0" unit="cm" value="0.601558" />
+  <NIL type="lambda" unit="cm" value="21.2048" />
+  <D type="density" unit="g/cm3" value="10.07" />
+  <composite n="1" ref="Ac" />
+ </material>
+ <element Z="47" formula="Ag" name="Ag" >
+  <atom type="A" unit="g/mol" value="107.868" />
+ </element>
+ <material formula="Ag" name="Silver" state="solid" >
+  <RL type="X0" unit="cm" value="0.854292" />
+  <NIL type="lambda" unit="cm" value="15.8546" />
+  <D type="density" unit="g/cm3" value="10.5" />
+  <composite n="1" ref="Ag" />
+ </material>
+ <element Z="13" formula="Al" name="Al" >
+  <atom type="A" unit="g/mol" value="26.9815" />
+ </element>
+ <material formula="Al" name="Aluminum" state="solid" >
+  <RL type="X0" unit="cm" value="8.89632" />
+  <NIL type="lambda" unit="cm" value="38.8766" />
+  <D type="density" unit="g/cm3" value="2.699" />
+  <composite n="1" ref="Al" />
+ </material>
+ <element Z="95" formula="Am" name="Am" >
+  <atom type="A" unit="g/mol" value="243.061" />
+ </element>
+ <material formula="Am" name="Americium" state="solid" >
+  <RL type="X0" unit="cm" value="0.42431" />
+  <NIL type="lambda" unit="cm" value="15.9812" />
+  <D type="density" unit="g/cm3" value="13.67" />
+  <composite n="1" ref="Am" />
+ </material>
+ <element Z="18" formula="Ar" name="Ar" >
+  <atom type="A" unit="g/mol" value="39.9477" />
+ </element>
+ <material formula="Ar" name="Argon" state="gas" >
+  <RL type="X0" unit="cm" value="11762.1" />
+  <NIL type="lambda" unit="cm" value="71926" />
+  <D type="density" unit="g/cm3" value="0.00166201" />
+  <composite n="1" ref="Ar" />
+ </material>
+ <element Z="33" formula="As" name="As" >
+  <atom type="A" unit="g/mol" value="74.9216" />
+ </element>
+ <material formula="As" name="Arsenic" state="solid" >
+  <RL type="X0" unit="cm" value="2.0838" />
+  <NIL type="lambda" unit="cm" value="25.7324" />
+  <D type="density" unit="g/cm3" value="5.73" />
+  <composite n="1" ref="As" />
+ </material>
+ <element Z="85" formula="At" name="At" >
+  <atom type="A" unit="g/mol" value="209.987" />
+ </element>
+ <material formula="At" name="Astatine" state="solid" >
+  <RL type="X0" unit="cm" value="0.650799" />
+  <NIL type="lambda" unit="cm" value="22.3202" />
+  <D type="density" unit="g/cm3" value="9.32" />
+  <composite n="1" ref="At" />
+ </material>
+ <element Z="79" formula="Au" name="Au" >
+  <atom type="A" unit="g/mol" value="196.967" />
+ </element>
+ <material formula="Au" name="Gold" state="solid" >
+  <RL type="X0" unit="cm" value="0.334436" />
+  <NIL type="lambda" unit="cm" value="10.5393" />
+  <D type="density" unit="g/cm3" value="19.32" />
+  <composite n="1" ref="Au" />
+ </material>
+ <element Z="5" formula="B" name="B" >
+  <atom type="A" unit="g/mol" value="10.811" />
+ </element>
+ <material formula="B" name="Boron" state="solid" >
+  <RL type="X0" unit="cm" value="22.2307" />
+  <NIL type="lambda" unit="cm" value="32.2793" />
+  <D type="density" unit="g/cm3" value="2.37" />
+  <composite n="1" ref="B" />
+ </material>
+ <element Z="56" formula="Ba" name="Ba" >
+  <atom type="A" unit="g/mol" value="137.327" />
+ </element>
+ <material formula="Ba" name="Barium" state="solid" >
+  <RL type="X0" unit="cm" value="2.37332" />
+  <NIL type="lambda" unit="cm" value="51.6743" />
+  <D type="density" unit="g/cm3" value="3.5" />
+  <composite n="1" ref="Ba" />
+ </material>
+ <element Z="4" formula="Be" name="Be" >
+  <atom type="A" unit="g/mol" value="9.01218" />
+ </element>
+ <material formula="Be" name="Beryllium" state="solid" >
+  <RL type="X0" unit="cm" value="35.276" />
+  <NIL type="lambda" unit="cm" value="39.4488" />
+  <D type="density" unit="g/cm3" value="1.848" />
+  <composite n="1" ref="Be" />
+ </material>
+ <element Z="83" formula="Bi" name="Bi" >
+  <atom type="A" unit="g/mol" value="208.98" />
+ </element>
+ <material formula="Bi" name="Bismuth" state="solid" >
+  <RL type="X0" unit="cm" value="0.645388" />
+  <NIL type="lambda" unit="cm" value="21.3078" />
+  <D type="density" unit="g/cm3" value="9.747" />
+  <composite n="1" ref="Bi" />
+ </material>
+ <element Z="97" formula="Bk" name="Bk" >
+  <atom type="A" unit="g/mol" value="247.07" />
+ </element>
+ <material formula="Bk" name="Berkelium" state="solid" >
+  <RL type="X0" unit="cm" value="0.406479" />
+  <NIL type="lambda" unit="cm" value="15.6902" />
+  <D type="density" unit="g/cm3" value="14" />
+  <composite n="1" ref="Bk" />
+ </material>
+ <element Z="35" formula="Br" name="Br" >
+  <atom type="A" unit="g/mol" value="79.9035" />
+ </element>
+ <material formula="Br" name="Bromine" state="gas" >
+  <RL type="X0" unit="cm" value="1615.12" />
+  <NIL type="lambda" unit="cm" value="21299" />
+  <D type="density" unit="g/cm3" value="0.0070721" />
+  <composite n="1" ref="Br" />
+ </material>
+ <element Z="6" formula="C" name="C" >
+  <atom type="A" unit="g/mol" value="12.0107" />
+ </element>
+ <material formula="C" name="Carbon" state="solid" >
+  <RL type="X0" unit="cm" value="21.3485" />
+  <NIL type="lambda" unit="cm" value="40.1008" />
+  <D type="density" unit="g/cm3" value="2" />
+  <composite n="1" ref="C" />
+ </material>
+ <element Z="20" formula="Ca" name="Ca" >
+  <atom type="A" unit="g/mol" value="40.078" />
+ </element>
+ <material formula="Ca" name="Calcium" state="solid" >
+  <RL type="X0" unit="cm" value="10.4151" />
+  <NIL type="lambda" unit="cm" value="77.3754" />
+  <D type="density" unit="g/cm3" value="1.55" />
+  <composite n="1" ref="Ca" />
+ </material>
+ <element Z="48" formula="Cd" name="Cd" >
+  <atom type="A" unit="g/mol" value="112.411" />
+ </element>
+ <material formula="Cd" name="Cadmium" state="solid" >
+  <RL type="X0" unit="cm" value="1.03994" />
+  <NIL type="lambda" unit="cm" value="19.46" />
+  <D type="density" unit="g/cm3" value="8.65" />
+  <composite n="1" ref="Cd" />
+ </material>
+ <element Z="58" formula="Ce" name="Ce" >
+  <atom type="A" unit="g/mol" value="140.115" />
+ </element>
+ <material formula="Ce" name="Cerium" state="solid" >
+  <RL type="X0" unit="cm" value="1.19506" />
+  <NIL type="lambda" unit="cm" value="27.3227" />
+  <D type="density" unit="g/cm3" value="6.657" />
+  <composite n="1" ref="Ce" />
+ </material>
+ <element Z="98" formula="Cf" name="Cf" >
+  <atom type="A" unit="g/mol" value="251.08" />
+ </element>
+ <material formula="Cf" name="Californium" state="solid" >
+  <RL type="X0" unit="cm" value="0.568328" />
+  <NIL type="lambda" unit="cm" value="22.085" />
+  <D type="density" unit="g/cm3" value="10" />
+  <composite n="1" ref="Cf" />
+ </material>
+ <element Z="17" formula="Cl" name="Cl" >
+  <atom type="A" unit="g/mol" value="35.4526" />
+ </element>
+ <material formula="Cl" name="Chlorine" state="gas" >
+  <RL type="X0" unit="cm" value="6437.34" />
+  <NIL type="lambda" unit="cm" value="38723.9" />
+  <D type="density" unit="g/cm3" value="0.00299473" />
+  <composite n="1" ref="Cl" />
+ </material>
+ <element Z="96" formula="Cm" name="Cm" >
+  <atom type="A" unit="g/mol" value="247.07" />
+ </element>
+ <material formula="Cm" name="Curium" state="solid" >
+  <RL type="X0" unit="cm" value="0.428706" />
+  <NIL type="lambda" unit="cm" value="16.2593" />
+  <D type="density" unit="g/cm3" value="13.51" />
+  <composite n="1" ref="Cm" />
+ </material>
+ <element Z="27" formula="Co" name="Co" >
+  <atom type="A" unit="g/mol" value="58.9332" />
+ </element>
+ <material formula="Co" name="Cobalt" state="solid" >
+  <RL type="X0" unit="cm" value="1.53005" />
+  <NIL type="lambda" unit="cm" value="15.2922" />
+  <D type="density" unit="g/cm3" value="8.9" />
+  <composite n="1" ref="Co" />
+ </material>
+ <element Z="24" formula="Cr" name="Cr" >
+  <atom type="A" unit="g/mol" value="51.9961" />
+ </element>
+ <material formula="Cr" name="Chromium" state="solid" >
+  <RL type="X0" unit="cm" value="2.0814" />
+  <NIL type="lambda" unit="cm" value="18.1933" />
+  <D type="density" unit="g/cm3" value="7.18" />
+  <composite n="1" ref="Cr" />
+ </material>
+ <element Z="55" formula="Cs" name="Cs" >
+  <atom type="A" unit="g/mol" value="132.905" />
+ </element>
+ <material formula="Cs" name="Cesium" state="solid" >
+  <RL type="X0" unit="cm" value="4.4342" />
+  <NIL type="lambda" unit="cm" value="95.317" />
+  <D type="density" unit="g/cm3" value="1.873" />
+  <composite n="1" ref="Cs" />
+ </material>
+ <element Z="29" formula="Cu" name="Cu" >
+  <atom type="A" unit="g/mol" value="63.5456" />
+ </element>
+ <material formula="Cu" name="Copper" state="solid" >
+  <RL type="X0" unit="cm" value="1.43558" />
+  <NIL type="lambda" unit="cm" value="15.5141" />
+  <D type="density" unit="g/cm3" value="8.96" />
+  <composite n="1" ref="Cu" />
+ </material>
+ <element Z="66" formula="Dy" name="Dy" >
+  <atom type="A" unit="g/mol" value="162.497" />
+ </element>
+ <material formula="Dy" name="Dysprosium" state="solid" >
+  <RL type="X0" unit="cm" value="0.85614" />
+  <NIL type="lambda" unit="cm" value="22.2923" />
+  <D type="density" unit="g/cm3" value="8.55" />
+  <composite n="1" ref="Dy" />
+ </material>
+ <element Z="68" formula="Er" name="Er" >
+  <atom type="A" unit="g/mol" value="167.256" />
+ </element>
+ <material formula="Er" name="Erbium" state="solid" >
+  <RL type="X0" unit="cm" value="0.788094" />
+  <NIL type="lambda" unit="cm" value="21.2923" />
+  <D type="density" unit="g/cm3" value="9.066" />
+  <composite n="1" ref="Er" />
+ </material>
+ <element Z="63" formula="Eu" name="Eu" >
+  <atom type="A" unit="g/mol" value="151.964" />
+ </element>
+ <material formula="Eu" name="Europium" state="solid" >
+  <RL type="X0" unit="cm" value="1.41868" />
+  <NIL type="lambda" unit="cm" value="35.6178" />
+  <D type="density" unit="g/cm3" value="5.243" />
+  <composite n="1" ref="Eu" />
+ </material>
+ <element Z="9" formula="F" name="F" >
+  <atom type="A" unit="g/mol" value="18.9984" />
+ </element>
+ <material formula="F" name="Fluorine" state="gas" >
+  <RL type="X0" unit="cm" value="20838.2" />
+  <NIL type="lambda" unit="cm" value="59094.3" />
+  <D type="density" unit="g/cm3" value="0.00158029" />
+  <composite n="1" ref="F" />
+ </material>
+ <element Z="26" formula="Fe" name="Fe" >
+  <atom type="A" unit="g/mol" value="55.8451" />
+ </element>
+ <material formula="Fe" name="Iron" state="solid" >
+  <RL type="X0" unit="cm" value="1.75749" />
+  <NIL type="lambda" unit="cm" value="16.959" />
+  <D type="density" unit="g/cm3" value="7.874" />
+  <composite n="1" ref="Fe" />
+ </material>
+ <element Z="87" formula="Fr" name="Fr" >
+  <atom type="A" unit="g/mol" value="223.02" />
+ </element>
+ <material formula="Fr" name="Francium" state="solid" >
+  <RL type="X0" unit="cm" value="6.18826" />
+  <NIL type="lambda" unit="cm" value="212.263" />
+  <D type="density" unit="g/cm3" value="1" />
+  <composite n="1" ref="Fr" />
+ </material>
+ <element Z="31" formula="Ga" name="Ga" >
+  <atom type="A" unit="g/mol" value="69.7231" />
+ </element>
+ <material formula="Ga" name="Gallium" state="solid" >
+  <RL type="X0" unit="cm" value="2.1128" />
+  <NIL type="lambda" unit="cm" value="24.3351" />
+  <D type="density" unit="g/cm3" value="5.904" />
+  <composite n="1" ref="Ga" />
+ </material>
+ <element Z="64" formula="Gd" name="Gd" >
+  <atom type="A" unit="g/mol" value="157.252" />
+ </element>
+ <material formula="Gd" name="Gadolinium" state="solid" >
+  <RL type="X0" unit="cm" value="0.947208" />
+  <NIL type="lambda" unit="cm" value="23.9377" />
+  <D type="density" unit="g/cm3" value="7.9004" />
+  <composite n="1" ref="Gd" />
+ </material>
+ <element Z="32" formula="Ge" name="Ge" >
+  <atom type="A" unit="g/mol" value="72.6128" />
+ </element>
+ <material formula="Ge" name="Germanium" state="solid" >
+  <RL type="X0" unit="cm" value="2.3013" />
+  <NIL type="lambda" unit="cm" value="27.3344" />
+  <D type="density" unit="g/cm3" value="5.323" />
+  <composite n="1" ref="Ge" />
+ </material>
+ <element Z="1" formula="H" name="H" >
+  <atom type="A" unit="g/mol" value="1.00794" />
+ </element>
+ <material formula="H" name="Hydrogen" state="gas" >
+  <RL type="X0" unit="cm" value="752776" />
+  <NIL type="lambda" unit="cm" value="421239" />
+  <D type="density" unit="g/cm3" value="8.3748e-05" />
+  <composite n="1" ref="H" />
+ </material>
+ <element Z="2" formula="He" name="He" >
+  <atom type="A" unit="g/mol" value="4.00264" />
+ </element>
+ <material formula="He" name="Helium" state="gas" >
+  <RL type="X0" unit="cm" value="567113" />
+  <NIL type="lambda" unit="cm" value="334266" />
+  <D type="density" unit="g/cm3" value="0.000166322" />
+  <composite n="1" ref="He" />
+ </material>
+ <element Z="72" formula="Hf" name="Hf" >
+  <atom type="A" unit="g/mol" value="178.485" />
+ </element>
+ <material formula="Hf" name="Hafnium" state="solid" >
+  <RL type="X0" unit="cm" value="0.517717" />
+  <NIL type="lambda" unit="cm" value="14.7771" />
+  <D type="density" unit="g/cm3" value="13.31" />
+  <composite n="1" ref="Hf" />
+ </material>
+ <element Z="80" formula="Hg" name="Hg" >
+  <atom type="A" unit="g/mol" value="200.599" />
+ </element>
+ <material formula="Hg" name="Mercury" state="solid" >
+  <RL type="X0" unit="cm" value="0.475241" />
+  <NIL type="lambda" unit="cm" value="15.105" />
+  <D type="density" unit="g/cm3" value="13.546" />
+  <composite n="1" ref="Hg" />
+ </material>
+ <element Z="67" formula="Ho" name="Ho" >
+  <atom type="A" unit="g/mol" value="164.93" />
+ </element>
+ <material formula="Ho" name="Holmium" state="solid" >
+  <RL type="X0" unit="cm" value="0.822447" />
+  <NIL type="lambda" unit="cm" value="21.8177" />
+  <D type="density" unit="g/cm3" value="8.795" />
+  <composite n="1" ref="Ho" />
+ </material>
+ <element Z="53" formula="I" name="I" >
+  <atom type="A" unit="g/mol" value="126.904" />
+ </element>
+ <material formula="I" name="Iodine" state="solid" >
+  <RL type="X0" unit="cm" value="1.72016" />
+  <NIL type="lambda" unit="cm" value="35.6583" />
+  <D type="density" unit="g/cm3" value="4.93" />
+  <composite n="1" ref="I" />
+ </material>
+ <element Z="49" formula="In" name="In" >
+  <atom type="A" unit="g/mol" value="114.818" />
+ </element>
+ <material formula="In" name="Indium" state="solid" >
+  <RL type="X0" unit="cm" value="1.21055" />
+  <NIL type="lambda" unit="cm" value="23.2468" />
+  <D type="density" unit="g/cm3" value="7.31" />
+  <composite n="1" ref="In" />
+ </material>
+ <element Z="77" formula="Ir" name="Ir" >
+  <atom type="A" unit="g/mol" value="192.216" />
+ </element>
+ <material formula="Ir" name="Iridium" state="solid" >
+  <RL type="X0" unit="cm" value="0.294142" />
+  <NIL type="lambda" unit="cm" value="9.01616" />
+  <D type="density" unit="g/cm3" value="22.42" />
+  <composite n="1" ref="Ir" />
+ </material>
+ <element Z="19" formula="K" name="K" >
+  <atom type="A" unit="g/mol" value="39.0983" />
+ </element>
+ <material formula="K" name="Potassium" state="solid" >
+  <RL type="X0" unit="cm" value="20.0871" />
+  <NIL type="lambda" unit="cm" value="138.041" />
+  <D type="density" unit="g/cm3" value="0.862" />
+  <composite n="1" ref="K" />
+ </material>
+ <element Z="36" formula="Kr" name="Kr" >
+  <atom type="A" unit="g/mol" value="83.7993" />
+ </element>
+ <material formula="Kr" name="Krypton" state="gas" >
+  <RL type="X0" unit="cm" value="3269.44" />
+  <NIL type="lambda" unit="cm" value="43962.9" />
+  <D type="density" unit="g/cm3" value="0.00347832" />
+  <composite n="1" ref="Kr" />
+ </material>
+ <element Z="57" formula="La" name="La" >
+  <atom type="A" unit="g/mol" value="138.905" />
+ </element>
+ <material formula="La" name="Lanthanum" state="solid" >
+  <RL type="X0" unit="cm" value="1.32238" />
+  <NIL type="lambda" unit="cm" value="29.441" />
+  <D type="density" unit="g/cm3" value="6.154" />
+  <composite n="1" ref="La" />
+ </material>
+ <element Z="3" formula="Li" name="Li" >
+  <atom type="A" unit="g/mol" value="6.94003" />
+ </element>
+ <material formula="Li" name="Lithium" state="solid" >
+  <RL type="X0" unit="cm" value="154.997" />
+  <NIL type="lambda" unit="cm" value="124.305" />
+  <D type="density" unit="g/cm3" value="0.534" />
+  <composite n="1" ref="Li" />
+ </material>
+ <element Z="71" formula="Lu" name="Lu" >
+  <atom type="A" unit="g/mol" value="174.967" />
+ </element>
+ <material formula="Lu" name="Lutetium" state="solid" >
+  <RL type="X0" unit="cm" value="0.703651" />
+  <NIL type="lambda" unit="cm" value="19.8916" />
+  <D type="density" unit="g/cm3" value="9.84" />
+  <composite n="1" ref="Lu" />
+ </material>
+ <element Z="12" formula="Mg" name="Mg" >
+  <atom type="A" unit="g/mol" value="24.305" />
+ </element>
+ <material formula="Mg" name="Magnesium" state="solid" >
+  <RL type="X0" unit="cm" value="14.3859" />
+  <NIL type="lambda" unit="cm" value="58.7589" />
+  <D type="density" unit="g/cm3" value="1.74" />
+  <composite n="1" ref="Mg" />
+ </material>
+ <element Z="25" formula="Mn" name="Mn" >
+  <atom type="A" unit="g/mol" value="54.938" />
+ </element>
+ <material formula="Mn" name="Manganese" state="solid" >
+  <RL type="X0" unit="cm" value="1.96772" />
+  <NIL type="lambda" unit="cm" value="17.8701" />
+  <D type="density" unit="g/cm3" value="7.44" />
+  <composite n="1" ref="Mn" />
+ </material>
+ <element Z="42" formula="Mo" name="Mo" >
+  <atom type="A" unit="g/mol" value="95.9313" />
+ </element>
+ <material formula="Mo" name="Molybdenum" state="solid" >
+  <RL type="X0" unit="cm" value="0.959107" />
+  <NIL type="lambda" unit="cm" value="15.6698" />
+  <D type="density" unit="g/cm3" value="10.22" />
+  <composite n="1" ref="Mo" />
+ </material>
+ <element Z="7" formula="N" name="N" >
+  <atom type="A" unit="g/mol" value="14.0068" />
+ </element>
+ <material formula="N" name="Nitrogen" state="gas" >
+  <RL type="X0" unit="cm" value="32602.2" />
+  <NIL type="lambda" unit="cm" value="72430.3" />
+  <D type="density" unit="g/cm3" value="0.0011652" />
+  <composite n="1" ref="N" />
+ </material>
+ <element Z="11" formula="Na" name="Na" >
+  <atom type="A" unit="g/mol" value="22.9898" />
+ </element>
+ <material formula="Na" name="Sodium" state="solid" >
+  <RL type="X0" unit="cm" value="28.5646" />
+  <NIL type="lambda" unit="cm" value="102.463" />
+  <D type="density" unit="g/cm3" value="0.971" />
+  <composite n="1" ref="Na" />
+ </material>
+ <element Z="41" formula="Nb" name="Nb" >
+  <atom type="A" unit="g/mol" value="92.9064" />
+ </element>
+ <material formula="Nb" name="Niobium" state="solid" >
+  <RL type="X0" unit="cm" value="1.15783" />
+  <NIL type="lambda" unit="cm" value="18.4846" />
+  <D type="density" unit="g/cm3" value="8.57" />
+  <composite n="1" ref="Nb" />
+ </material>
+ <element Z="60" formula="Nd" name="Nd" >
+  <atom type="A" unit="g/mol" value="144.236" />
+ </element>
+ <material formula="Nd" name="Neodymium" state="solid" >
+  <RL type="X0" unit="cm" value="1.11667" />
+  <NIL type="lambda" unit="cm" value="26.6308" />
+  <D type="density" unit="g/cm3" value="6.9" />
+  <composite n="1" ref="Nd" />
+ </material>
+ <element Z="10" formula="Ne" name="Ne" >
+  <atom type="A" unit="g/mol" value="20.18" />
+ </element>
+ <material formula="Ne" name="Neon" state="gas" >
+  <RL type="X0" unit="cm" value="34504.8" />
+  <NIL type="lambda" unit="cm" value="114322" />
+  <D type="density" unit="g/cm3" value="0.000838505" />
+  <composite n="1" ref="Ne" />
+ </material>
+ <element Z="28" formula="Ni" name="Ni" >
+  <atom type="A" unit="g/mol" value="58.6933" />
+ </element>
+ <material formula="Ni" name="Nickel" state="solid" >
+  <RL type="X0" unit="cm" value="1.42422" />
+  <NIL type="lambda" unit="cm" value="15.2265" />
+  <D type="density" unit="g/cm3" value="8.902" />
+  <composite n="1" ref="Ni" />
+ </material>
+ <element Z="93" formula="Np" name="Np" >
+  <atom type="A" unit="g/mol" value="237.048" />
+ </element>
+ <material formula="Np" name="Neptunium" state="solid" >
+  <RL type="X0" unit="cm" value="0.289676" />
+  <NIL type="lambda" unit="cm" value="10.6983" />
+  <D type="density" unit="g/cm3" value="20.25" />
+  <composite n="1" ref="Np" />
+ </material>
+ <element Z="8" formula="O" name="O" >
+  <atom type="A" unit="g/mol" value="15.9994" />
+ </element>
+ <material formula="O" name="Oxygen" state="gas" >
+  <RL type="X0" unit="cm" value="25713.8" />
+  <NIL type="lambda" unit="cm" value="66233.9" />
+  <D type="density" unit="g/cm3" value="0.00133151" />
+  <composite n="1" ref="O" />
+ </material>
+ <element Z="76" formula="Os" name="Os" >
+  <atom type="A" unit="g/mol" value="190.225" />
+ </element>
+ <material formula="Os" name="Osmium" state="solid" >
+  <RL type="X0" unit="cm" value="0.295861" />
+  <NIL type="lambda" unit="cm" value="8.92553" />
+  <D type="density" unit="g/cm3" value="22.57" />
+  <composite n="1" ref="Os" />
+ </material>
+ <element Z="15" formula="P" name="P" >
+  <atom type="A" unit="g/mol" value="30.9738" />
+ </element>
+ <material formula="P" name="Phosphorus" state="solid" >
+  <RL type="X0" unit="cm" value="9.63879" />
+  <NIL type="lambda" unit="cm" value="49.9343" />
+  <D type="density" unit="g/cm3" value="2.2" />
+  <composite n="1" ref="P" />
+ </material>
+ <element Z="91" formula="Pa" name="Pa" >
+  <atom type="A" unit="g/mol" value="231.036" />
+ </element>
+ <material formula="Pa" name="Protactinium" state="solid" >
+  <RL type="X0" unit="cm" value="0.38607" />
+  <NIL type="lambda" unit="cm" value="13.9744" />
+  <D type="density" unit="g/cm3" value="15.37" />
+  <composite n="1" ref="Pa" />
+ </material>
+ <element Z="82" formula="Pb" name="Pb" >
+  <atom type="A" unit="g/mol" value="207.217" />
+ </element>
+ <material formula="Pb" name="Lead" state="solid" >
+  <RL type="X0" unit="cm" value="0.561253" />
+  <NIL type="lambda" unit="cm" value="18.2607" />
+  <D type="density" unit="g/cm3" value="11.35" />
+  <composite n="1" ref="Pb" />
+ </material>
+ <element Z="46" formula="Pd" name="Pd" >
+  <atom type="A" unit="g/mol" value="106.415" />
+ </element>
+ <material formula="Pd" name="Palladium" state="solid" >
+  <RL type="X0" unit="cm" value="0.765717" />
+  <NIL type="lambda" unit="cm" value="13.7482" />
+  <D type="density" unit="g/cm3" value="12.02" />
+  <composite n="1" ref="Pd" />
+ </material>
+ <element Z="61" formula="Pm" name="Pm" >
+  <atom type="A" unit="g/mol" value="144.913" />
+ </element>
+ <material formula="Pm" name="Promethium" state="solid" >
+  <RL type="X0" unit="cm" value="1.04085" />
+  <NIL type="lambda" unit="cm" value="25.4523" />
+  <D type="density" unit="g/cm3" value="7.22" />
+  <composite n="1" ref="Pm" />
+ </material>
+ <element Z="84" formula="Po" name="Po" >
+  <atom type="A" unit="g/mol" value="208.982" />
+ </element>
+ <material formula="Po" name="Polonium" state="solid" >
+  <RL type="X0" unit="cm" value="0.661092" />
+  <NIL type="lambda" unit="cm" value="22.2842" />
+  <D type="density" unit="g/cm3" value="9.32" />
+  <composite n="1" ref="Po" />
+ </material>
+ <element Z="59" formula="Pr" name="Pr" >
+  <atom type="A" unit="g/mol" value="140.908" />
+ </element>
+ <material formula="Pr" name="Praseodymium" state="solid" >
+  <RL type="X0" unit="cm" value="1.1562" />
+  <NIL type="lambda" unit="cm" value="27.1312" />
+  <D type="density" unit="g/cm3" value="6.71" />
+  <composite n="1" ref="Pr" />
+ </material>
+ <element Z="78" formula="Pt" name="Pt" >
+  <atom type="A" unit="g/mol" value="195.078" />
+ </element>
+ <material formula="Pt" name="Platinum" state="solid" >
+  <RL type="X0" unit="cm" value="0.305053" />
+  <NIL type="lambda" unit="cm" value="9.46584" />
+  <D type="density" unit="g/cm3" value="21.45" />
+  <composite n="1" ref="Pt" />
+ </material>
+ <element Z="94" formula="Pu" name="Pu" >
+  <atom type="A" unit="g/mol" value="244.064" />
+ </element>
+ <material formula="Pu" name="Plutonium" state="solid" >
+  <RL type="X0" unit="cm" value="0.298905" />
+  <NIL type="lambda" unit="cm" value="11.0265" />
+  <D type="density" unit="g/cm3" value="19.84" />
+  <composite n="1" ref="Pu" />
+ </material>
+ <element Z="88" formula="Ra" name="Ra" >
+  <atom type="A" unit="g/mol" value="226.025" />
+ </element>
+ <material formula="Ra" name="Radium" state="solid" >
+  <RL type="X0" unit="cm" value="1.22987" />
+  <NIL type="lambda" unit="cm" value="42.6431" />
+  <D type="density" unit="g/cm3" value="5" />
+  <composite n="1" ref="Ra" />
+ </material>
+ <element Z="37" formula="Rb" name="Rb" >
+  <atom type="A" unit="g/mol" value="85.4677" />
+ </element>
+ <material formula="Rb" name="Rubidium" state="solid" >
+  <RL type="X0" unit="cm" value="7.19774" />
+  <NIL type="lambda" unit="cm" value="100.218" />
+  <D type="density" unit="g/cm3" value="1.532" />
+  <composite n="1" ref="Rb" />
+ </material>
+ <element Z="75" formula="Re" name="Re" >
+  <atom type="A" unit="g/mol" value="186.207" />
+ </element>
+ <material formula="Re" name="Rhenium" state="solid" >
+  <RL type="X0" unit="cm" value="0.318283" />
+  <NIL type="lambda" unit="cm" value="9.5153" />
+  <D type="density" unit="g/cm3" value="21.02" />
+  <composite n="1" ref="Re" />
+ </material>
+ <element Z="45" formula="Rh" name="Rh" >
+  <atom type="A" unit="g/mol" value="102.906" />
+ </element>
+ <material formula="Rh" name="Rhodium" state="solid" >
+  <RL type="X0" unit="cm" value="0.746619" />
+  <NIL type="lambda" unit="cm" value="13.2083" />
+  <D type="density" unit="g/cm3" value="12.41" />
+  <composite n="1" ref="Rh" />
+ </material>
+ <element Z="86" formula="Rn" name="Rn" >
+  <atom type="A" unit="g/mol" value="222.018" />
+ </element>
+ <material formula="Rn" name="Radon" state="gas" >
+  <RL type="X0" unit="cm" value="697.777" />
+  <NIL type="lambda" unit="cm" value="23532" />
+  <D type="density" unit="g/cm3" value="0.00900662" />
+  <composite n="1" ref="Rn" />
+ </material>
+ <element Z="44" formula="Ru" name="Ru" >
+  <atom type="A" unit="g/mol" value="101.065" />
+ </element>
+ <material formula="Ru" name="Ruthenium" state="solid" >
+  <RL type="X0" unit="cm" value="0.764067" />
+  <NIL type="lambda" unit="cm" value="13.1426" />
+  <D type="density" unit="g/cm3" value="12.41" />
+  <composite n="1" ref="Ru" />
+ </material>
+ <element Z="16" formula="S" name="S" >
+  <atom type="A" unit="g/mol" value="32.0661" />
+ </element>
+ <material formula="S" name="Sulfur" state="solid" >
+  <RL type="X0" unit="cm" value="9.74829" />
+  <NIL type="lambda" unit="cm" value="55.6738" />
+  <D type="density" unit="g/cm3" value="2" />
+  <composite n="1" ref="S" />
+ </material>
+ <element Z="51" formula="Sb" name="Sb" >
+  <atom type="A" unit="g/mol" value="121.76" />
+ </element>
+ <material formula="Sb" name="Antimony" state="solid" >
+  <RL type="X0" unit="cm" value="1.30401" />
+  <NIL type="lambda" unit="cm" value="25.8925" />
+  <D type="density" unit="g/cm3" value="6.691" />
+  <composite n="1" ref="Sb" />
+ </material>
+ <element Z="21" formula="Sc" name="Sc" >
+  <atom type="A" unit="g/mol" value="44.9559" />
+ </element>
+ <material formula="Sc" name="Scandium" state="solid" >
+  <RL type="X0" unit="cm" value="5.53545" />
+  <NIL type="lambda" unit="cm" value="41.609" />
+  <D type="density" unit="g/cm3" value="2.989" />
+  <composite n="1" ref="Sc" />
+ </material>
+ <element Z="34" formula="Se" name="Se" >
+  <atom type="A" unit="g/mol" value="78.9594" />
+ </element>
+ <material formula="Se" name="Selenium" state="solid" >
+  <RL type="X0" unit="cm" value="2.64625" />
+  <NIL type="lambda" unit="cm" value="33.356" />
+  <D type="density" unit="g/cm3" value="4.5" />
+  <composite n="1" ref="Se" />
+ </material>
+ <element Z="14" formula="Si" name="Si" >
+  <atom type="A" unit="g/mol" value="28.0854" />
+ </element>
+ <material formula="Si" name="Silicon" state="solid" >
+  <RL type="X0" unit="cm" value="9.36607" />
+  <NIL type="lambda" unit="cm" value="45.7531" />
+  <D type="density" unit="g/cm3" value="2.33" />
+  <composite n="1" ref="Si" />
+ </material>
+ <element Z="62" formula="Sm" name="Sm" >
+  <atom type="A" unit="g/mol" value="150.366" />
+ </element>
+ <material formula="Sm" name="Samarium" state="solid" >
+  <RL type="X0" unit="cm" value="1.01524" />
+  <NIL type="lambda" unit="cm" value="24.9892" />
+  <D type="density" unit="g/cm3" value="7.46" />
+  <composite n="1" ref="Sm" />
+ </material>
+ <element Z="50" formula="Sn" name="Sn" >
+  <atom type="A" unit="g/mol" value="118.71" />
+ </element>
+ <material formula="Sn" name="Tin" state="solid" >
+  <RL type="X0" unit="cm" value="1.20637" />
+  <NIL type="lambda" unit="cm" value="23.4931" />
+  <D type="density" unit="g/cm3" value="7.31" />
+  <composite n="1" ref="Sn" />
+ </material>
+ <element Z="38" formula="Sr" name="Sr" >
+  <atom type="A" unit="g/mol" value="87.6166" />
+ </element>
+ <material formula="Sr" name="Strontium" state="solid" >
+  <RL type="X0" unit="cm" value="4.237" />
+  <NIL type="lambda" unit="cm" value="61.0238" />
+  <D type="density" unit="g/cm3" value="2.54" />
+  <composite n="1" ref="Sr" />
+ </material>
+ <element Z="73" formula="Ta" name="Ta" >
+  <atom type="A" unit="g/mol" value="180.948" />
+ </element>
+ <material formula="Ta" name="Tantalum" state="solid" >
+  <RL type="X0" unit="cm" value="0.409392" />
+  <NIL type="lambda" unit="cm" value="11.8846" />
+  <D type="density" unit="g/cm3" value="16.654" />
+  <composite n="1" ref="Ta" />
+ </material>
+ <element Z="65" formula="Tb" name="Tb" >
+  <atom type="A" unit="g/mol" value="158.925" />
+ </element>
+ <material formula="Tb" name="Terbium" state="solid" >
+  <RL type="X0" unit="cm" value="0.893977" />
+  <NIL type="lambda" unit="cm" value="23.0311" />
+  <D type="density" unit="g/cm3" value="8.229" />
+  <composite n="1" ref="Tb" />
+ </material>
+ <element Z="43" formula="Tc" name="Tc" >
+  <atom type="A" unit="g/mol" value="97.9072" />
+ </element>
+ <material formula="Tc" name="Technetium" state="solid" >
+  <RL type="X0" unit="cm" value="0.833149" />
+  <NIL type="lambda" unit="cm" value="14.0185" />
+  <D type="density" unit="g/cm3" value="11.5" />
+  <composite n="1" ref="Tc" />
+ </material>
+ <element Z="52" formula="Te" name="Te" >
+  <atom type="A" unit="g/mol" value="127.603" />
+ </element>
+ <material formula="Te" name="Tellurium" state="solid" >
+  <RL type="X0" unit="cm" value="1.41457" />
+  <NIL type="lambda" unit="cm" value="28.1797" />
+  <D type="density" unit="g/cm3" value="6.24" />
+  <composite n="1" ref="Te" />
+ </material>
+ <element Z="90" formula="Th" name="Th" >
+  <atom type="A" unit="g/mol" value="232.038" />
+ </element>
+ <material formula="Th" name="Thorium" state="solid" >
+  <RL type="X0" unit="cm" value="0.51823" />
+  <NIL type="lambda" unit="cm" value="18.353" />
+  <D type="density" unit="g/cm3" value="11.72" />
+  <composite n="1" ref="Th" />
+ </material>
+ <element Z="22" formula="Ti" name="Ti" >
+  <atom type="A" unit="g/mol" value="47.8667" />
+ </element>
+ <material formula="Ti" name="Titanium" state="solid" >
+  <RL type="X0" unit="cm" value="3.5602" />
+  <NIL type="lambda" unit="cm" value="27.9395" />
+  <D type="density" unit="g/cm3" value="4.54" />
+  <composite n="1" ref="Ti" />
+ </material>
+ <element Z="81" formula="Tl" name="Tl" >
+  <atom type="A" unit="g/mol" value="204.383" />
+ </element>
+ <material formula="Tl" name="Thallium" state="solid" >
+  <RL type="X0" unit="cm" value="0.547665" />
+  <NIL type="lambda" unit="cm" value="17.6129" />
+  <D type="density" unit="g/cm3" value="11.72" />
+  <composite n="1" ref="Tl" />
+ </material>
+ <element Z="69" formula="Tm" name="Tm" >
+  <atom type="A" unit="g/mol" value="168.934" />
+ </element>
+ <material formula="Tm" name="Thulium" state="solid" >
+  <RL type="X0" unit="cm" value="0.754428" />
+  <NIL type="lambda" unit="cm" value="20.7522" />
+  <D type="density" unit="g/cm3" value="9.321" />
+  <composite n="1" ref="Tm" />
+ </material>
+ <element Z="92" formula="U" name="U" >
+  <atom type="A" unit="g/mol" value="238.029" />
+ </element>
+ <material formula="U" name="Uranium" state="solid" >
+  <RL type="X0" unit="cm" value="0.31663" />
+  <NIL type="lambda" unit="cm" value="11.4473" />
+  <D type="density" unit="g/cm3" value="18.95" />
+  <composite n="1" ref="U" />
+ </material>
+ <element Z="23" formula="V" name="V" >
+  <atom type="A" unit="g/mol" value="50.9415" />
+ </element>
+ <material formula="V" name="Vanadium" state="solid" >
+  <RL type="X0" unit="cm" value="2.59285" />
+  <NIL type="lambda" unit="cm" value="21.2187" />
+  <D type="density" unit="g/cm3" value="6.11" />
+  <composite n="1" ref="V" />
+ </material>
+ <element Z="74" formula="W" name="W" >
+  <atom type="A" unit="g/mol" value="183.842" />
+ </element>
+ <material formula="W" name="Tungsten" state="solid" >
+  <RL type="X0" unit="cm" value="0.350418" />
+  <NIL type="lambda" unit="cm" value="10.3057" />
+  <D type="density" unit="g/cm3" value="19.3" />
+  <composite n="1" ref="W" />
+ </material>
+ <element Z="54" formula="Xe" name="Xe" >
+  <atom type="A" unit="g/mol" value="131.292" />
+ </element>
+ <material formula="Xe" name="Xenon" state="gas" >
+  <RL type="X0" unit="cm" value="1546.2" />
+  <NIL type="lambda" unit="cm" value="32477.9" />
+  <D type="density" unit="g/cm3" value="0.00548536" />
+  <composite n="1" ref="Xe" />
+ </material>
+ <element Z="39" formula="Y" name="Y" >
+  <atom type="A" unit="g/mol" value="88.9058" />
+ </element>
+ <material formula="Y" name="Yttrium" state="solid" >
+  <RL type="X0" unit="cm" value="2.32943" />
+  <NIL type="lambda" unit="cm" value="34.9297" />
+  <D type="density" unit="g/cm3" value="4.469" />
+  <composite n="1" ref="Y" />
+ </material>
+ <element Z="70" formula="Yb" name="Yb" >
+  <atom type="A" unit="g/mol" value="173.038" />
+ </element>
+ <material formula="Yb" name="Ytterbium" state="solid" >
+  <RL type="X0" unit="cm" value="1.04332" />
+  <NIL type="lambda" unit="cm" value="28.9843" />
+  <D type="density" unit="g/cm3" value="6.73" />
+  <composite n="1" ref="Yb" />
+ </material>
+ <element Z="30" formula="Zn" name="Zn" >
+  <atom type="A" unit="g/mol" value="65.3955" />
+ </element>
+ <material formula="Zn" name="Zinc" state="solid" >
+  <RL type="X0" unit="cm" value="1.74286" />
+  <NIL type="lambda" unit="cm" value="19.8488" />
+  <D type="density" unit="g/cm3" value="7.133" />
+  <composite n="1" ref="Zn" />
+ </material>
+ <element Z="40" formula="Zr" name="Zr" >
+  <atom type="A" unit="g/mol" value="91.2236" />
+ </element>
+ <material formula="Zr" name="Zirconium" state="solid" >
+  <RL type="X0" unit="cm" value="1.56707" />
+  <NIL type="lambda" unit="cm" value="24.2568" />
+  <D type="density" unit="g/cm3" value="6.506" />
+  <composite n="1" ref="Zr" />
+ </material>
+</materials>
\ No newline at end of file
diff --git a/examples/LHeD/compact/gGeoManager_commands.txt b/examples/LHeD/compact/gGeoManager_commands.txt
new file mode 100644
index 000000000..e3c4378c4
--- /dev/null
+++ b/examples/LHeD/compact/gGeoManager_commands.txt
@@ -0,0 +1,2 @@
+gGeoManager->SetNsegments(200);
+gGeoManager->CheckOverlaps (0.001);
diff --git a/examples/LHeD/compact/materials.xml b/examples/LHeD/compact/materials.xml
new file mode 100644
index 000000000..5ad03131c
--- /dev/null
+++ b/examples/LHeD/compact/materials.xml
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<materials>
+
+  <!--
+       Air by weight from
+
+       http://www.engineeringtoolbox.com/air-composition-24_212.html
+  -->
+  <material name="Air">
+    <D type="density" unit="g/cm3" value="0.0012"/>
+    <fraction n="0.754" ref="N"/>
+    <fraction n="0.234" ref="O"/>
+    <fraction n="0.012" ref="Ar"/>
+  </material>
+  
+  <!-- We model vakuum just as very thin air -->
+  <material name="Vacuum">  
+    <D type="density" unit="g/cm3" value="0.0000000001" />
+    <fraction n="0.754" ref="N"/>
+    <fraction n="0.234" ref="O"/>
+    <fraction n="0.012" ref="Ar"/>
+  </material>
+
+  <material name="Epoxy">
+    <D type="density" value="1.3" unit="g/cm3"/>
+    <composite n="44" ref="H"/>
+    <composite n="15" ref="C"/>
+    <composite n="7" ref="O"/>
+  </material>
+
+  <material name="Quartz">
+    <D type="density" value="2.2" unit="g/cm3"/>
+    <composite n="1" ref="Si"/>
+    <composite n="2" ref="O"/>
+  </material>
+
+  <material name="G10">
+    <D type="density" value="1.7" unit="g/cm3"/>
+    <fraction n="0.08" ref="Cl"/>
+    <fraction n="0.773" ref="Quartz"/>
+    <fraction n="0.147" ref="Epoxy"/>
+  </material>
+
+  <material name="Polystyrene">
+    <D value="1.032" unit="g/cm3"/>
+    <composite n="19" ref="C"/>
+    <composite n="21" ref="H"/>
+  </material>
+
+  <material name="Steel235">
+    <D value="7.85" unit="g/cm3"/>
+    <fraction n="0.998" ref="Fe"/>
+    <fraction n=".002" ref="C"/>
+  </material>
+
+  <material name="SiliconOxide">
+    <D type="density" value="2.65" unit="g/cm3"/>
+    <composite n="1" ref="Si"/>
+    <composite n="2" ref="O"/>
+  </material>
+
+  <material name="BoronOxide">
+    <D type="density" value="2.46" unit="g/cm3"/>
+    <composite n="2" ref="B"/>
+    <composite n="3" ref="O"/>
+  </material>
+
+  <material name="SodiumOxide">
+    <D type="density" value="2.65" unit="g/cm3"/>
+    <composite n="2" ref="Na"/>
+    <composite n="1" ref="O"/>
+  </material>
+
+  <material name="AluminumOxide">
+    <D type="density" value="3.89" unit="g/cm3"/>
+    <composite n="2" ref="Al"/>
+    <composite n="3" ref="O"/>
+  </material>
+
+  <material name="PyrexGlass">
+    <D type="density" value="2.23" unit="g/cm3"/>
+    <fraction n="0.806" ref="SiliconOxide"/>
+    <fraction n="0.130" ref="BoronOxide"/>
+    <fraction n="0.040" ref="SodiumOxide"/>
+    <fraction n="0.023" ref="AluminumOxide"/>
+  </material>
+
+  <material name="CarbonFiber">
+    <D type="density" value="1.5" unit="g/cm3"/>
+    <fraction n="0.65" ref="C"/>
+    <fraction n="0.35" ref="Epoxy"/>
+  </material>
+  
+  <material name="CarbonFiber_50D">
+    <D type="density" value="0.75" unit="g/cm3"/>
+    <fraction n="0.65" ref="C"/>
+    <fraction n="0.35" ref="Epoxy"/>
+  </material>  
+
+  <material name="Rohacell31">
+    <D type="density" value="0.032" unit="g/cm3"/>
+    <composite n="9" ref="C"/>
+    <composite n="13" ref="H"/>
+    <composite n="2" ref="O"/>
+    <composite n="1" ref="N"/>
+  </material>
+  
+  <material name="Rohacell31_50D">
+    <D type="density" value="0.016" unit="g/cm3"/>
+    <composite n="9" ref="C"/>
+    <composite n="13" ref="H"/>
+    <composite n="2" ref="O"/>
+    <composite n="1" ref="N"/>
+  </material>  
+
+  <material name="RPCGasDefault" state="gas">
+    <D type="density" value="0.0037" unit="g/cm3"/>
+    <composite n="209" ref="C"/>
+    <composite n="239" ref="H"/>
+    <composite n="381" ref="F"/>
+  </material>
+
+  <material name="PolystyreneFoam">
+    <D type="density" value="0.0056" unit="g/cm3"/>
+    <fraction n="1.0" ref="Polystyrene"/>
+  </material>
+
+  <material name="Kapton">
+    <D value="1.43" unit="g/cm3" />
+    <composite n="22" ref="C"/>
+    <composite n="10" ref="H" />
+    <composite n="2" ref="N" />
+    <composite n="5" ref="O" />
+  </material>
+
+  <material name="PEEK">
+    <D value="1.37" unit="g/cm3" />
+    <composite n="19" ref="C"/>
+    <composite n="12" ref="H" />
+    <composite n="3" ref="O" />
+  </material>  
+
+  <material name="LAr">
+    <D value="1.390" unit="g/cm3" />
+    <fraction n="1.0" ref="Ar"/>
+  </material>
+  
+</materials>
diff --git a/examples/LHeD/compact/run.mac b/examples/LHeD/compact/run.mac
new file mode 120000
index 000000000..abab69392
--- /dev/null
+++ b/examples/LHeD/compact/run.mac
@@ -0,0 +1 @@
+../scripts/run.mac
\ No newline at end of file
diff --git a/examples/LHeD/compact/sensitive_detectors.xml b/examples/LHeD/compact/sensitive_detectors.xml
new file mode 100644
index 000000000..c9d8c93d2
--- /dev/null
+++ b/examples/LHeD/compact/sensitive_detectors.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geant4>
+  <sensitive_detectors>
+    <sd name="SiVertexBarrel" 
+        type="Geant4Tracker" 
+        ecut="10.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="SiTrackerBarrel"
+        type="Geant4Tracker" 
+        ecut="10.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="SiTrackerForward"
+        type="Geant4Tracker" 
+        ecut="10.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="SiTrackerBackward"
+        type="Geant4Tracker" 
+        ecut="10.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="EcalBarrel"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="EcalEndcap_fwd"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="EcalEndcap_bwd"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+
+    <sd name="HcalBarrel"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+
+    <sd name="HcalEndcap_fwd"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="HcalEndcap_bwd"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>   
+    <sd name="HcalPlug_fwd"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    <sd name="HcalPlug_bwd"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+     
+    <sd name="MuonBarrel"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        limits="cal_limits"
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    
+    <sd name="MuonEndcap_fwd1"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    
+    <sd name="MuonEndcap_fwd2"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    
+    <sd name="MuonEndcap_bwd1"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+    
+    <sd name="MuonEndcap_bwd2"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+
+<!--    
+    <sd name="LumiCal"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+
+    <sd name="BeamCal"
+        type="Geant4Calorimeter" 
+        ecut="100.0*MeV" 
+        verbose="true" 
+        hit_aggregation="position">
+    </sd>
+-->
+  </sensitive_detectors>
+
+  <properties>
+     <attributes name="geant4_field"
+          id="0"
+          type="Geant4FieldSetup"
+          object="GlobalSolenoid1"
+          global="true"
+          min_chord_step="0.01*mm"
+          delta_chord="0.25*mm"
+          delta_intersection="1e-05*mm"
+          delta_one_step="0.001*mm"
+          eps_min="5e-05*mm"
+          eps_max="0.001*mm"
+          stepper="HelixSimpleRunge"
+          equation="Mag_UsualEqRhs">
+     </attributes>
+<!--
+    <attributes name="geant4_field"
+          id="1"
+          type="Geant4FieldSetup"
+          object="DipoleMagnet"
+          global="true"
+          min_chord_step="0.01*mm"
+          delta_chord="0.25*mm"
+          delta_intersection="1e-05*mm"
+          delta_one_step="0.001*mm"
+          eps_min="5e-05*mm"
+          eps_max="0.001*mm"
+          stepper="HelixSimpleRunge"
+          equation="Mag_UsualEqRhs">
+     </attributes>
+-->
+  </properties>
+
+</geant4>
diff --git a/examples/LHeD/compact/vis.mac b/examples/LHeD/compact/vis.mac
new file mode 120000
index 000000000..2d9016354
--- /dev/null
+++ b/examples/LHeD/compact/vis.mac
@@ -0,0 +1 @@
+../scripts/vis.mac
\ No newline at end of file
diff --git a/examples/LHeD/eve/DDEve-fcc-ell.xml b/examples/LHeD/eve/DDEve-fcc-ell.xml
new file mode 100644
index 000000000..dd8347ffa
--- /dev/null
+++ b/examples/LHeD/eve/DDEve-fcc-ell.xml
@@ -0,0 +1,169 @@
+<ddeve>
+  <display visLevel="7" loadLevel="1"/>
+  <calodata name="Ecal" hits="EcalBarrelHits" towerH="80" emax="1000"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="EcalBarrel_rmin" dz="EcalEndcap_zmin_fwd" color="kBlue"/>
+  <calodata name="EcalEndcap_fwd" use="Ecal" hits="EcalEndcapHits0"/>
+  <calodata name="EcalEndcap_bwd" use="Ecal" hits="EcalEndcapHits1"/>
+
+  <calodata name="Hcal" hits="HcalBarrelHits"  towerH="150" emax="10000"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi"
+	    alpha="0.4" rmin="HcalBarrel_rmin" dz="HcalEndcap_zmin_bwd" color="kBlue"/>
+  <calodata name="HcalEndcap_fwd" use="Hcal" hits="HcalEndcapHits0"/>
+  <calodata name="HcalEndcap_bwd" use="Hcal" hits="HcalEndcapHits1"/>
+  <calodata name="HcalPlug_fwd" use="Hcal" hits="HcalPlugHits01"/>
+  <calodata name="HcalPlug_bwd" use="Hcal" hits="HcalPlugHits11"/>
+
+  <calodata name="SiVertex" hits="SiVertexBarrelHits" towerH="20" emax="200"
+	    n_eta="200" eta_min="-3" eta_max="3" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="VertexBarrel_r0" dz="VertexService_zmax" color="kBlue"/>
+
+  <calodata name="SiTracker" hits="SiTrackerBarrelHits" towerH="50" emax="200"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="Ftd_sdisk_ri4" dz="Btd_disk_z14" color="kBlue"/>
+  <calodata name="SiTrackerForward" use="SiTracker" hits="SiTrackerForwardHits"/>
+  <calodata name="SiTrackerBackward" use="SiTracker" hits="SiTrackerBackwardHits"/>
+
+
+  <calodata name="Muon" hits="MuonBarrelHits" towerH="300" emax="1000"
+	    n_eta="200" eta_min="-5" eta_max="9"
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="MuonBarrel_rmin" dz="MuonEndcap_zmin_bwd" color="kYellow"/>
+  <calodata name="MuonBarrel" use="Muon" hits="MuonBarrelHits"/>
+  <calodata name="MuonEndcap_fwd1" use="Muon" hits="MuonEndcapHits01"/>
+  <calodata name="MuonEndcap_fwd2" use="Muon" hits="MuonEndcapHits02"/>
+  <calodata name="MuonEndcap_bwd1" use="Muon" hits="MuonEndcapHits11"/>
+  <calodata name="MuonEndcap_bwd2" use="Muon" hits="MuonEndcapHits12"/>
+
+  <collection name="EcalBarrelHits" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="EcalEndcapHits0" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="EcalEndcapHits1" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalBarrelHits" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalEndcapHits0" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalEndcapHits1" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits01" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits02" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits11" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits12" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="SiVertexBarrelHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="SiTrackerForwardHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="SiTrackerBackwardHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="MC_Particles" hits="Particles" size="0.6" width="2" type="kCircle"/>
+  
+  <collection name="MuonBarrelHits" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits01" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits02" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits11" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits12" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  
+
+  <view name="3D Trackers R-Phi (Global)" type="RhoPhiProjection">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="-1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Trackers R-Phi (Local)" type="RhoPhiProjection">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="3" alpha="0.4"/>
+  </view>
+
+  <view name="3D Trackers" type="View3D">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerForward"   load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBackward"   load_geo="-1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Vertex" type="View3D">
+    <detelement name="SiVertexBarrel" load_geo="1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Ecal+Hcal" type="Calo3DProjection">
+    <detelement name="EcalBarrel" load_geo="-1" show_evt="1" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="-1" show_evt="0" alpha="0.4"/>
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+  </view>
+
+  <view name="3D Calorimeters" type="View3D">
+    <detelement name="EcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="EcalEndcap_fwd" load_geo="2" alpha="0.4"/>
+    <detelement name="EcalEndcap_bwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalEndcap_fwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalEndcap_bwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalPlug_fwd"   load_geo="2" alpha="0.4"/>
+    <detelement name="HcalPlug_bwd"   load_geo="2" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Calo 3D" type="Calo3DProjection">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="EcalEndcap_fwd"/>
+    <calodata name="EcalEndcap_bwd"/>
+    <calodata name="HcalEndcap_fwd"/>
+    <calodata name="HcalEndcap_bwd"/>
+    <calodata name="HcalPlug_fwd"/>
+    <calodata name="HcalPlug_bwd"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Calo Lego" type="CaloLego">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="EcalEndcap_fwd"/>
+    <calodata name="EcalEndcap_bwd"/>
+    <calodata name="HcalEndcap_fwd"/>
+    <calodata name="HcalEndcap_bwd"/>
+    <calodata name="HcalPlug_fwd"/>
+    <calodata name="HcalPlug_bwd"/>
+  </view>
+
+  <view name="Muon 3D" type="Calo3DProjection">
+    <calodata name="Muon"/>
+    <calodata name="MuonEndcap_fwd1"/>
+    <calodata name="MuonEndcap_fwd2"/>
+    <calodata name="MuonEndcap_bwd1"/>
+    <calodata name="MuonEndcap_bwd2"/>
+  </view>
+
+  <view name="Silicon Deposits" type="Calo3DProjection">
+    <calodata name="SiVertex"/>
+    <calodata name="SiTracker"/>
+    <calodata name="SiTrackerForward"/>
+    <calodata name="SiTrackerBackward"/>
+  </view>
+
+  <view name="Calo 2D" type="Calo2DProjection">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="Muon"/>
+    <detelement name="EcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="2" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Multi (Global)" type="MultiView">
+    <detelement name="global"/>
+  </view>
+
+  <view name="Multi (Calo)" type="MultiView">
+    <detelement name="EcalBarrel" load_geo="-1" alpha="0.4"/>
+    <detelement name="EcalEndcap_fwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="EcalEndcap_bwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalPlug_fwd"   load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalPlug_bwd"   load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalEndcap_fwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalEndcap_bwd" load_geo="-1" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+    <panel name="Silicon Deposits" use="Calo3DProjection"/>
+    <panel name="Calo 2D"          use="Calo2DProjection"/>
+  </view>
+  <include ref="../compact/../compact/compact_Fhe_dip_sol_ell.xml"/>
+</ddeve>
diff --git a/examples/LHeD/eve/DDEve-fcc.xml b/examples/LHeD/eve/DDEve-fcc.xml
new file mode 100644
index 000000000..e8179999c
--- /dev/null
+++ b/examples/LHeD/eve/DDEve-fcc.xml
@@ -0,0 +1,169 @@
+<ddeve>
+  <display visLevel="7" loadLevel="1"/>
+  <calodata name="Ecal" hits="EcalBarrelHits" towerH="80" emax="1000"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="EcalBarrel_rmin" dz="EcalEndcap_zmin_fwd" color="kBlue"/>
+  <calodata name="EcalEndcap_fwd" use="Ecal" hits="EcalEndcapHits0"/>
+  <calodata name="EcalEndcap_bwd" use="Ecal" hits="EcalEndcapHits1"/>
+
+  <calodata name="Hcal" hits="HcalBarrelHits"  towerH="150" emax="10000"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi"
+	    alpha="0.4" rmin="HcalBarrel_rmin" dz="HcalEndcap_zmin_bwd" color="kBlue"/>
+  <calodata name="HcalEndcap_fwd" use="Hcal" hits="HcalEndcapHits0"/>
+  <calodata name="HcalEndcap_bwd" use="Hcal" hits="HcalEndcapHits1"/>
+  <calodata name="HcalPlug_fwd" use="Hcal" hits="HcalPlugHits01"/>
+  <calodata name="HcalPlug_bwd" use="Hcal" hits="HcalPlugHits11"/>
+
+  <calodata name="SiVertex" hits="SiVertexBarrelHits" towerH="20" emax="200"
+	    n_eta="200" eta_min="-3" eta_max="3" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="VertexBarrel_r0" dz="VertexService_zmax" color="kBlue"/>
+
+  <calodata name="SiTracker" hits="SiTrackerBarrelHits" towerH="50" emax="200"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="Ftd_sdisk_ri4" dz="Btd_disk_z14" color="kBlue"/>
+  <calodata name="SiTrackerForward" use="SiTracker" hits="SiTrackerForwardHits"/>
+  <calodata name="SiTrackerBackward" use="SiTracker" hits="SiTrackerBackwardHits"/>
+
+
+  <calodata name="Muon" hits="MuonBarrelHits" towerH="300" emax="1000"
+	    n_eta="200" eta_min="-5" eta_max="9"
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="MuonBarrel_rmin" dz="MuonEndcap_zmin_bwd" color="kYellow"/>
+  <calodata name="MuonBarrel" use="Muon" hits="MuonBarrelHits"/>
+  <calodata name="MuonEndcap_fwd1" use="Muon" hits="MuonEndcapHits01"/>
+  <calodata name="MuonEndcap_fwd2" use="Muon" hits="MuonEndcapHits02"/>
+  <calodata name="MuonEndcap_bwd1" use="Muon" hits="MuonEndcapHits11"/>
+  <calodata name="MuonEndcap_bwd2" use="Muon" hits="MuonEndcapHits12"/>
+
+  <collection name="EcalBarrelHits" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="EcalEndcapHits0" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="EcalEndcapHits1" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalBarrelHits" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalEndcapHits0" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalEndcapHits1" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits01" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits02" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits11" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits12" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="SiVertexBarrelHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="SiTrackerForwardHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="SiTrackerBackwardHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="MC_Particles" hits="Particles" size="0.6" width="2" type="kCircle"/>
+  
+  <collection name="MuonBarrelHits" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits01" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits02" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits11" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="MuonEndcapHits12" hits="PointSet" color="kYellow+3" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  
+
+  <view name="3D Trackers R-Phi (Global)" type="RhoPhiProjection">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="-1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Trackers R-Phi (Local)" type="RhoPhiProjection">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="3" alpha="0.4"/>
+  </view>
+
+  <view name="3D Trackers" type="View3D">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerForward"   load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBackward"   load_geo="-1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Vertex" type="View3D">
+    <detelement name="SiVertexBarrel" load_geo="1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Ecal+Hcal" type="Calo3DProjection">
+    <detelement name="EcalBarrel" load_geo="-1" show_evt="1" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="-1" show_evt="0" alpha="0.4"/>
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+  </view>
+
+  <view name="3D Calorimeters" type="View3D">
+    <detelement name="EcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="EcalEndcap_fwd" load_geo="2" alpha="0.4"/>
+    <detelement name="EcalEndcap_bwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalEndcap_fwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalEndcap_bwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalPlug_fwd"   load_geo="2" alpha="0.4"/>
+    <detelement name="HcalPlug_bwd"   load_geo="2" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Calo 3D" type="Calo3DProjection">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="EcalEndcap_fwd"/>
+    <calodata name="EcalEndcap_bwd"/>
+    <calodata name="HcalEndcap_fwd"/>
+    <calodata name="HcalEndcap_bwd"/>
+    <calodata name="HcalPlug_fwd"/>
+    <calodata name="HcalPlug_bwd"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Calo Lego" type="CaloLego">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="EcalEndcap_fwd"/>
+    <calodata name="EcalEndcap_bwd"/>
+    <calodata name="HcalEndcap_fwd"/>
+    <calodata name="HcalEndcap_bwd"/>
+    <calodata name="HcalPlug_fwd"/>
+    <calodata name="HcalPlug_bwd"/>
+  </view>
+
+  <view name="Muon 3D" type="Calo3DProjection">
+    <calodata name="Muon"/>
+    <calodata name="MuonEndcap_fwd1"/>
+    <calodata name="MuonEndcap_fwd2"/>
+    <calodata name="MuonEndcap_bwd1"/>
+    <calodata name="MuonEndcap_bwd2"/>
+  </view>
+
+  <view name="Silicon Deposits" type="Calo3DProjection">
+    <calodata name="SiVertex"/>
+    <calodata name="SiTracker"/>
+    <calodata name="SiTrackerForward"/>
+    <calodata name="SiTrackerBackward"/>
+  </view>
+
+  <view name="Calo 2D" type="Calo2DProjection">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="Muon"/>
+    <detelement name="EcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="2" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Multi (Global)" type="MultiView">
+    <detelement name="global"/>
+  </view>
+
+  <view name="Multi (Calo)" type="MultiView">
+    <detelement name="EcalBarrel" load_geo="-1" alpha="0.4"/>
+    <detelement name="EcalEndcap_fwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="EcalEndcap_bwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalPlug_fwd"   load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalPlug_bwd"   load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalEndcap_fwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalEndcap_bwd" load_geo="-1" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+    <panel name="Silicon Deposits" use="Calo3DProjection"/>
+    <panel name="Calo 2D"          use="Calo2DProjection"/>
+  </view>
+  <include ref="../compact/../compact/compact_Fhe_dip_sol_circ.xml"/>
+</ddeve>
diff --git a/examples/LHeD/eve/DDEve.C b/examples/LHeD/eve/DDEve.C
new file mode 120000
index 000000000..ec83cedd1
--- /dev/null
+++ b/examples/LHeD/eve/DDEve.C
@@ -0,0 +1 @@
+../../../DDEve/DDEve/DDEve.C
\ No newline at end of file
diff --git a/examples/LHeD/eve/DDEve.xml b/examples/LHeD/eve/DDEve.xml
new file mode 100644
index 000000000..4ce83498b
--- /dev/null
+++ b/examples/LHeD/eve/DDEve.xml
@@ -0,0 +1,168 @@
+<ddeve>
+  <display visLevel="7" loadLevel="1"/>
+  <calodata name="Ecal" hits="EcalBarrelHits" towerH="80" emax="1000"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="EcalBarrel_rmin" dz="EcalEndcap_zmin_fwd" color="kBlue"/>
+  <calodata name="EcalEndcap_fwd" use="Ecal" hits="EcalEndcapHits0"/>
+  <calodata name="EcalEndcap_bwd" use="Ecal" hits="EcalEndcapHits1"/>
+
+  <calodata name="Hcal" hits="HcalBarrelHits"  towerH="150" emax="10000"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi"
+	    alpha="0.4" rmin="HcalBarrel_rmin" dz="HcalEndcap_zmin_bwd" color="kBlue"/>
+  <calodata name="HcalEndcap_fwd" use="Hcal" hits="HcalEndcapHits0"/>
+  <calodata name="HcalEndcap_bwd" use="Hcal" hits="HcalEndcapHits1"/>
+  <calodata name="HcalPlug_fwd" use="Hcal" hits="HcalPlugHits01"/>
+  <calodata name="HcalPlug_bwd" use="Hcal" hits="HcalPlugHits11"/>
+
+  <calodata name="SiVertex" hits="SiVertexBarrelHits" towerH="20" emax="200"
+	    n_eta="200" eta_min="-4" eta_max="4" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="VertexBarrel_r0" dz="VertexService_zmax" color="kBlue"/>
+
+  <calodata name="SiTracker" hits="SiTrackerBarrelHits" towerH="50" emax="200"
+	    n_eta="200" eta_min="-5" eta_max="7" 
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="Ftd_sdisk_ri4" dz="Btd_disk_z4" color="kBlue"/>
+  <calodata name="SiTrackerForward" use="SiTracker" hits="SiTrackerForwardHits"/>
+  <calodata name="SiTrackerBackward" use="SiTracker" hits="SiTrackerBackwardHits"/>
+
+
+  <calodata name="Muon" hits="MuonBarrelHits" towerH="300" emax="1000"
+	    n_eta="200" eta_min="-5" eta_max="9"
+	    n_phi="200" phi_min="-pi" phi_max="pi" 
+	    alpha="0.4" rmin="MuonBarrel_rmin" dz="MuonEndcap_zmin_bwd" color="kYellow"/>
+  <calodata name="MuonBarrel" use="Muon" hits="MuonBarrelHits"/>
+  <calodata name="MuonEndcap_fwd1" use="Muon" hits="MuonEndcapHits01"/>
+  <calodata name="MuonEndcap_fwd2" use="Muon" hits="MuonEndcapHits02"/>
+  <calodata name="MuonEndcap_bwd1" use="Muon" hits="MuonEndcapHits11"/>
+  <calodata name="MuonEndcap_bwd2" use="Muon" hits="MuonEndcapHits12"/>
+
+  <collection name="EcalBarrelHits" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="EcalEndcapHits0" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="EcalEndcapHits1" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalBarrelHits" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalEndcapHits0" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalEndcapHits1" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits01" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="HcalPlugHits11" hits="PointSet" color="kMagenta" size="0.3" type="21" towerH="3*MeV" emax="10*GeV"/>
+  <collection name="SiVertexBarrelHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="SiTrackerBarrelHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="SiTrackerForwardHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="SiTrackerBackwardHits" hits="PointSet" color="1" size="0.3" type="20"/>
+  <collection name="MC_Particles" hits="Particles" size="0.6" width="2" type="kCircle"/>
+  
+  <collection name="MuonBarrelHits" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="100*GeV"/>
+  <collection name="MuonEndcapHits01" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="100*GeV"/>
+  <collection name="MuonEndcapHits02" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="100*GeV"/>
+  <collection name="MuonEndcapHits11" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="100*GeV"/>
+  <collection name="MuonEndcapHits12" hits="PointSet" color="1" size="0.3" type="21" towerH="3*MeV" emax="100*GeV"/>
+  
+
+  <view name="3D Trackers R-Phi (Global)" type="RhoPhiProjection">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="-1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Trackers R-Phi (Local)" type="RhoPhiProjection">
+    <detelement name="SiVertexBarrel"    load_geo="3" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="3" alpha="0.4"/>
+  </view>
+
+  <view name="3D Trackers" type="View3D">
+    <detelement name="SiVertexBarrel"    load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBarrel"   load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerForward"   load_geo="-1" alpha="0.4"/>
+    <detelement name="SiTrackerBackward"   load_geo="-1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Vertex" type="View3D">
+    <detelement name="SiVertexBarrel" load_geo="1" alpha="0.4"/>
+  </view>
+
+  <view name="3D Ecal+Hcal" type="Calo3DProjection">
+    <detelement name="EcalBarrel" load_geo="-1" show_evt="1" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="-1" show_evt="0" alpha="0.4"/>
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+  </view>
+
+  <view name="3D Calorimeters" type="View3D">
+    <detelement name="EcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="EcalEndcap_fwd" load_geo="2" alpha="0.4"/>
+    <detelement name="EcalEndcap_bwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalEndcap_fwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalEndcap_bwd" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalPlug_fwd"   load_geo="2" alpha="0.4"/>
+    <detelement name="HcalPlug_bwd"   load_geo="2" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Calo 3D" type="Calo3DProjection">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="EcalEndcap_fwd"/>
+    <calodata name="EcalEndcap_bwd"/>
+    <calodata name="HcalEndcap_fwd"/>
+    <calodata name="HcalEndcap_bwd"/>
+    <calodata name="HcalPlug_fwd"/>
+    <calodata name="HcalPlug_bwd"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Calo Lego" type="CaloLego">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="EcalEndcap_fwd"/>
+    <calodata name="EcalEndcap_bwd"/>
+    <calodata name="HcalEndcap_fwd"/>
+    <calodata name="HcalEndcap_bwd"/>
+    <calodata name="HcalPlug_fwd"/>
+    <calodata name="HcalPlug_bwd"/>
+  </view>
+
+  <view name="Muon 3D" type="Calo3DProjection">
+    <calodata name="Muon"/>
+    <calodata name="MuonEndcap_fwd1"/>
+    <calodata name="MuonEndcap_fwd2"/>
+    <calodata name="MuonEndcap_bwd1"/>
+    <calodata name="MuonEndcap_bwd2"/>
+  </view>
+
+  <view name="Silicon Deposits" type="Calo3DProjection">
+    <calodata name="SiVertexBarrel"/>
+    <calodata name="SiTrackerBarrel"/>
+    <calodata name="SiTrackerForward"/>
+    <calodata name="SiTrackerBackward"/>
+  </view>
+
+  <view name="Calo 2D" type="Calo2DProjection">
+    <calodata name="Ecal"/>
+    <calodata name="Hcal"/>
+    <calodata name="Muon"/>
+    <detelement name="EcalBarrel" load_geo="2" alpha="0.4"/>
+    <detelement name="HcalBarrel" load_geo="2" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+  </view>
+
+  <view name="Multi (Global)" type="MultiView">
+    <detelement name="global"/>
+  </view>
+
+  <view name="Multi (Calo)" type="MultiView">
+    <detelement name="EcalBarrel"     load_geo="-1" alpha="0.4"/>
+    <detelement name="EcalEndcap_fwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="EcalEndcap_bwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalPlug_fwd"   load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalPlug_bwd"   load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalBarrel"     load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalEndcap_fwd" load_geo="-1" alpha="0.4"/>
+    <detelement name="HcalEndcap_bwd" load_geo="-1" alpha="0.4"/>
+    <collection name="MC_Particles" use="MC_Particles"/>
+    <panel name="Silicon Deposits" use="Calo3DProjection"/>
+    <panel name="Calo 2D"          use="Calo2DProjection"/>
+  </view>
+  <include ref="../compact/compact_Lhe_dip_sol_ell.xml"/>
+</ddeve>
diff --git a/examples/LHeD/scripts/DDG4_field.xml b/examples/LHeD/scripts/DDG4_field.xml
new file mode 100644
index 000000000..dc76375c0
--- /dev/null
+++ b/examples/LHeD/scripts/DDG4_field.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geant4_setup>
+  <properties>
+    <attributes name="solenoid"
+		id="0"
+		type="Geant4FieldSetup"
+		object="GlobalSolenoid1"
+		global="true"
+		min_chord_step="0.01*mm"
+		delta_chord="0.25*mm"
+		delta_intersection="1e-05*mm"
+		delta_one_step="0.001*mm"
+		eps_min="5e-05*mm"
+		eps_max="0.001*mm"
+		stepper="HelixSimpleRunge"
+		equation="Mag_UsualEqRhs">
+    </attributes>
+  </properties>
+</geant4_setup>
diff --git a/examples/LHeD/scripts/G4History.macro b/examples/LHeD/scripts/G4History.macro
new file mode 100644
index 000000000..188bff387
--- /dev/null
+++ b/examples/LHeD/scripts/G4History.macro
@@ -0,0 +1,35 @@
+/vis/viewer/set/viewpointVector -1 0 0
+/vis/viewer/set/lightsVector -1 0 0
+/vis/viewer/set/style wireframe
+/vis/viewer/set/auxiliaryEdge true
+/vis/viewer/set/lineSegmentsPerCircle 100
+/vis/scene/add/trajectories smooth
+/vis/modeling/trajectories/create/drawByCharge
+/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
+/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
+/tracking/storeTrajectory 1
+/vis/scene/add/hits
+/vis/sceneHandler/attach
+/vis/scene/endOfEventAction accumulate
+/vis/set/textColour green
+/vis/set/textLayout right
+/vis/scene/add/text2D 0.9 -.9 24 ! ! FCC-he
+/vis/set/textLayout
+/vis/set/textColour
+/vis/scene/add/scale
+/vis/scene/add/axes
+/vis/scene/add/eventID
+/vis/scene/add/date
+/vis/set/colour red
+/vis/set/lineWidth 2
+/vis/scene/add/frame
+/vis/set/colour
+/vis/set/lineWidth
+/vis/geometry/set/visibility World 0 false
+/vis/geometry/set/visibility Envelope 0 false
+/vis/viewer/set/style surface
+/vis/viewer/set/hiddenMarker true
+/vis/viewer/set/viewpointThetaPhi 120 150
+/vis/verbose warnings
+/run/initialize
+/run/verbose 2
diff --git a/examples/LHeD/scripts/LHeD.py b/examples/LHeD/scripts/LHeD.py
new file mode 100644
index 000000000..b70a024a9
--- /dev/null
+++ b/examples/LHeD/scripts/LHeD.py
@@ -0,0 +1,89 @@
+import sys, DDG4
+from SystemOfUnits import *
+
+class LHeD:
+  def __init__(self,tracker='Geant4TrackerCombineAction'):
+    self.kernel = DDG4.Kernel()
+    self.description   = self.kernel.detectorDescription()
+    self.geant4 = DDG4.Geant4(self.kernel,tracker=tracker)
+    self.kernel.UI = ""
+    self.noPhysics()
+ 
+  def loadGeometry(self):
+    import os
+    dd4hep_dir = os.environ['DD4hep']
+    self.kernel.loadGeometry("file:"+dd4hep_dir+"/examples/LHeD/compact/compact_Lhe_dip_sol_ell.xml")
+    return self
+
+  # Example to show how to configure G4 magnetic field tracking
+  def setupField(self, quiet=True):
+    return self.geant4.setupTrackingField(prt=True)
+
+  # Example to show how to setup random generator
+  def setupRandom(self, name, type=None, seed=None, quiet=True):
+    rndm = DDG4.Action(self.kernel,'Geant4Random/'+name)
+    if seed: rndm.Seed = seed
+    if type: rndm.Type = type
+    rndm.initialize()
+    if not quiet: rndm.showStatus()
+    return rndm
+
+  # Example to show how to configure the Geant4 physics list
+  def setupPhysics(self, model):
+    phys = self.geant4.setupPhysics(model)
+    ph = DDG4.PhysicsList(self.kernel,'Geant4PhysicsList/Myphysics')
+    # Add bosons to the model (redundant if already implemented by the model)
+    ph.addParticleConstructor('G4BosonConstructor')
+    # Add leptons to the model (redundant if already implemented by the model)
+    ph.addParticleConstructor('G4LeptonConstructor')
+    # Add multiple scattering in the material
+    ph.addParticleProcess('e[+-]','G4eMultipleScattering',-1,1,1)
+    # Add optical physics (RICH dets etc)
+    ph.addPhysicsConstructor('G4OpticalPhysics')
+    # Interactivity
+    ph.enableUI()
+    phys.adopt(ph)
+    phys.dump()
+    return phys
+
+  # No physics list wanted for tests ? See how:
+  def noPhysics(self):
+    self.geant4.setupPhysics('')
+    return self
+
+  def setupDetectors(self):
+    print "#  First the tracking detectors"
+    seq,act = self.geant4.setupTracker('SiVertexBarrel')
+    seq,act = self.geant4.setupTracker('SiTrackerForward')
+    seq,act = self.geant4.setupTracker('SiTrackerBarrel')
+    seq,act = self.geant4.setupTracker('SiTrackerBackward')
+    print "#  Now setup the calorimeters"
+    seq,act = self.geant4.setupCalorimeter('EcalBarrel')
+    seq,act = self.geant4.setupCalorimeter('EcalEndcap_fwd')
+    seq,act = self.geant4.setupCalorimeter('EcalEndcap_bwd')
+    seq,act = self.geant4.setupCalorimeter('HcalBarrel')
+    seq,act = self.geant4.setupCalorimeter('HcalEndcap_fwd')
+    seq,act = self.geant4.setupCalorimeter('HcalEndcap_bwd')
+    seq,act = self.geant4.setupCalorimeter('HcalPlug_fwd')
+    seq,act = self.geant4.setupCalorimeter('HcalPlug_bwd')
+    seq,act = self.geant4.setupCalorimeter('MuonBarrel')
+    seq,act = self.geant4.setupCalorimeter('MuonEndcap_fwd1')
+    seq,act = self.geant4.setupCalorimeter('MuonEndcap_fwd2')
+    seq,act = self.geant4.setupCalorimeter('MuonEndcap_bwd1')
+    seq,act = self.geant4.setupCalorimeter('MuonEndcap_bwd2')
+    return self
+  
+  def test_config(self, have_geo=True):
+    self.kernel.configure()
+    if have_geo:
+      self.kernel.initialize()
+
+  # Test runner
+  def test_run(self, have_geo=True, have_physics=False):
+    self.test_config(have_geo)
+    if have_geo:
+      self.kernel.NumEvents = 0
+      self.kernel.run()
+    self.kernel.terminate()
+    print '+++++ All Done....\n\nTEST_PASSED'
+    sys.exit(0)
diff --git a/examples/LHeD/scripts/LHeDACLick.C b/examples/LHeD/scripts/LHeDACLick.C
new file mode 100644
index 000000000..c2de909b2
--- /dev/null
+++ b/examples/LHeD/scripts/LHeDACLick.C
@@ -0,0 +1,128 @@
+// $Id: Geant4Data.h 513 2013-04-05 14:31:53Z gaede $
+//====================================================================
+//  AIDA Detector description implementation
+//--------------------------------------------------------------------
+//
+//  Run Geant4 using DDG4 from root prompt with test objects for
+//  Run/Event/Sensitive actions.
+//
+//  The Geant4 setup is programmed as a root script.
+//
+//  Usage:
+//  $> root.exe
+//  root[0] .x <installation-directory>/examples/LHeD/scripts/initACLick.C
+//  root[1] .L <installation-directory>/examples/LHeD/scripts/initACLick.C+
+//  root[2] LHeDACLick()
+//
+//
+//  Author     : M.Frank
+//
+//====================================================================
+
+#include "DDG4/Geant4Config.h"
+#include "DDG4/Geant4TestActions.h"
+#include "CLHEP/Units/SystemOfUnits.h"
+#include "TSystem.h"
+#include <iostream>
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::sim;
+using namespace dd4hep::sim::Test;
+using namespace dd4hep::sim::Setup;
+using namespace dd4hep::sim::Geant4GeometryMaps;
+
+Geant4SensDetActionSequence* setupDetector(Geant4Kernel& kernel, const std::string& name)   {
+  SensitiveSeq sd = SensitiveSeq(kernel,"Geant4SensDetActionSequence/"+name);
+  Sensitive  sens = Sensitive(kernel,"Geant4TestSensitive/"+name+"Handler",name);
+  sens["OutputLevel"] = 2;
+  sd->adopt(sens);
+  sens = Sensitive(kernel,"Geant4TestSensitive/"+name+"Monitor",name);
+  sd->adopt(sens);
+  return sd;
+}
+
+int setupG4_CINT(bool interactive)  {
+  Geant4Kernel& kernel = Geant4Kernel::instance(Detector::getInstance());
+  string install_dir = getenv("DD4hepINSTALL");
+  Phase p;
+
+  kernel.loadGeometry(("file:"+install_dir+"/examples/LHeD/compact/compact.xml").c_str());
+  kernel.loadXML(("file:"+install_dir+"/examples/LHeD/sim/field.xml").c_str());
+
+  if ( interactive )   {
+    kernel.property("UI") = "UI";
+    setPrintLevel(DEBUG);
+
+    Action ui(kernel,"Geant4UIManager/UI");
+    ui["HaveVIS"]     = true;
+    ui["HaveUI"]      = true;
+    ui["SessionType"] = "csh";
+    kernel.registerGlobalAction(ui);
+  }
+
+  GenAction gun(kernel,"Geant4ParticleGun/Gun");
+  gun["energy"]       = 10*CLHEP::GeV;
+  gun["particle"]     = "e-";
+  gun["multiplicity"] = 1;
+  gun["OutputLevel"]  = 3;
+  kernel.generatorAction().adopt(gun);
+
+  RunAction run_init(kernel,"Geant4TestRunAction/RunInit");
+  run_init["Property_int"] = 12345;
+  kernel.runAction().adopt(run_init);
+  kernel.eventAction().callAtBegin(run_init.get(),&Geant4TestRunAction::beginEvent);
+  kernel.eventAction().callAtEnd  (run_init.get(),&Geant4TestRunAction::endEvent);
+
+  EventAction evt_1(kernel,"Geant4TestEventAction/UserEvent_1");
+  evt_1["Property_int"] = 12345;
+  evt_1["Property_string"] = "Events";
+  evt_1["OutputLevel"] = 3;
+  kernel.eventAction().adopt(evt_1);
+
+  p = kernel.addPhase<const G4Run*>("BeginRun");
+  p->add(evt_1.get(),&Geant4TestEventAction::beginRun);
+  kernel.runAction().callAtBegin(p.get(),&Geant4ActionPhase::call<const G4Run*>);
+
+  p = kernel.addPhase<const G4Run*>("EndRun");
+  p->add(evt_1.get(),&Geant4TestEventAction::endRun);
+  kernel.runAction().callAtEnd(p.get(),&Geant4ActionPhase::call<const G4Run*>);
+
+  EventAction evt_2(kernel,"Geant4TestEventAction/UserEvent_2");
+  kernel.eventAction().adopt(evt_2);
+ 
+  setupDetector(kernel,"SiVertexBarrel");
+  setupDetector(kernel,"SiTrackerBarrel");
+  setupDetector(kernel,"SiTrackerBackward");
+  setupDetector(kernel,"SiTrackerForward");
+  setupDetector(kernel,"EcalBarrel");
+  setupDetector(kernel,"EcalEndcap_fwd");
+  setupDetector(kernel,"EcalEndcap_bwd");
+  setupDetector(kernel,"HcalBarrel");
+  setupDetector(kernel,"HcalEndcap_fwd");
+  setupDetector(kernel,"HcalEndcap_bwd");
+  setupDetector(kernel,"HcalPlug_fwd");
+  setupDetector(kernel,"HcalPlug_bwd");
+  setupDetector(kernel,"MuonBarrel");
+  setupDetector(kernel,"MuonEndcap_fwd1");
+  setupDetector(kernel,"MuonEndcap_fwd2");
+  setupDetector(kernel,"MuonEndcap_bwd1");
+  setupDetector(kernel,"MuonEndcap_bwd2");
+
+  kernel.configure();
+  kernel.initialize();
+  kernel.run();
+  std::cout << "LHeD, Successfully executed application .... " << std::endl;
+  kernel.terminate();
+  std::cout << "TEST_PASSED" << std::endl;
+  return 0;
+}
+
+#if defined(G__DICTIONARY) || defined(__CLING__) || defined(__CINT__) || defined(__MAKECINT__) // CINT script
+int LHeDACLick()
+#else
+int main(int, char**)                              // Main program if linked standalone
+#endif
+{
+  return setupG4_CINT(false);
+}
diff --git a/examples/LHeD/scripts/LHeDMagField.py b/examples/LHeD/scripts/LHeDMagField.py
new file mode 100644
index 000000000..553d0bad7
--- /dev/null
+++ b/examples/LHeD/scripts/LHeDMagField.py
@@ -0,0 +1,13 @@
+"""
+   Subtest using LHeD showing how to manipulate the magnetic field
+
+   @author  M.Frank
+   @version 1.0
+
+"""
+if __name__ == "__main__":
+  import LHeD
+  lhed = LHeD.LHeD().loadGeometry()
+  # <<-- See this function to know how it's done....
+  lhed.setupField(quiet=False)
+  lhed.test_run()
diff --git a/examples/LHeD/scripts/LHeDPhysics.py b/examples/LHeD/scripts/LHeDPhysics.py
new file mode 100644
index 000000000..a617a2ef9
--- /dev/null
+++ b/examples/LHeD/scripts/LHeDPhysics.py
@@ -0,0 +1,13 @@
+"""
+   Subtest using LHeD showing how to setup the Geant4 physics list
+
+   @author  M.Frank
+   @version 1.0
+
+"""
+if __name__ == "__main__":
+  import LHeD
+  lhed = LHeD.LHeD().loadGeometry()
+  # <<-- See this function to know how it's done....
+  lhed.setupPhysics('QGSP_BERT')
+  lhed.test_run()
diff --git a/examples/LHeD/scripts/LHeDRandom.py b/examples/LHeD/scripts/LHeDRandom.py
new file mode 100644
index 000000000..5bdf056fd
--- /dev/null
+++ b/examples/LHeD/scripts/LHeDRandom.py
@@ -0,0 +1,59 @@
+"""
+   Subtest using LHeD showing how to setup the random number generator
+
+   @author  M.Frank
+   @version 1.0
+
+"""
+from ROOT import TRandom
+from ROOT import gRandom
+
+if __name__ == "__main__":
+  import LHeD, DDG4
+  lhed = LHeD.LHeD()
+  print 'DEFAULT Engine:', DDG4.CLHEP.HepRandom.getTheEngine().name()
+  # <<-- See this function to know how it's done....
+  rndm1 = lhed.setupRandom('R1',seed=987654321,type='RunluxEngine')
+  print 'R1:', rndm1.name, ' Default instance:', rndm1.instance().name()
+  print '   Engine: ', rndm1.engine().name()
+  print '   DEFAULT:', DDG4.CLHEP.HepRandom.getTheEngine().name()
+  rndm1.showStatus()
+
+  rndm2 = lhed.setupRandom('R2',seed=1234321,type='MTwistEngine')
+  print 'R2:', rndm2.name, ' Default instance:', rndm2.instance().name()
+  print '   Engine:', rndm2.engine().name()
+  print '   DEFAULT:', DDG4.CLHEP.HepRandom.getTheEngine().name()
+  #rndm2.showStatus()
+
+  DDG4.Geant4Random.setMainInstance(rndm1.get())
+  rndm1.showStatus()
+
+  # Move main geant random instance from rndm1 to rndm2:
+  # See how gRandom and HepRandom instances move
+  DDG4.Geant4Random.setMainInstance(rndm1.get())
+  print 'DEFAULT Engine:', DDG4.CLHEP.HepRandom.getTheEngine().name()
+  print 'DDG4   DEFAULT:', DDG4.Geant4Random.instance().engine().name()
+  rndm = DDG4.Geant4Random.instance()
+
+  rndm.setSeed(1234)
+  rndm.showStatus()
+  for i in xrange(10):
+    print rndm.name(), ' -- 0 gRandome.Rndm()        -- Shoot random[',i,']= ',gRandom.Rndm()
+  
+  rndm.setSeed(1234)
+  for i in xrange(10):
+    print rndm.name(), ' -- 1 gRandome.Rndm()        -- Shoot random[',i,']= ',gRandom.Rndm()
+  
+  rndm.setSeed(1234)
+  for i in xrange(10):
+    print rndm.name(), ' -- 2 Geant4Random(CLHEP)    -- Shoot random[',i,']= ',rndm.rndm_clhep()
+  
+  rndm.setSeed(1234)
+  for i in xrange(10):
+    print rndm.name(), ' -- 3 Geant4Random(CLHEP)    -- Shoot random[',i,']= ',rndm.rndm_clhep()
+
+  rndm.setSeed(1234)
+  for i in xrange(10):
+    print rndm.name(), ' -- 4 HepRandomEngine(CLHEP) -- Shoot random[',i,']= ',rndm.engine().flat()
+  
+  lhed.test_run(have_geo=False)
diff --git a/examples/LHeD/scripts/LHeDScan.py b/examples/LHeD/scripts/LHeDScan.py
new file mode 100644
index 000000000..10bd3437c
--- /dev/null
+++ b/examples/LHeD/scripts/LHeDScan.py
@@ -0,0 +1,47 @@
+"""
+
+   Perform a material scan using Geant4 shotting geantinos
+
+   @author  M.Frank
+   @version 1.0
+
+"""
+def run():
+  import os, sys, DDG4, SystemOfUnits
+  kernel = DDG4.Kernel()
+  install_dir = os.environ['DD4hepINSTALL']
+  kernel.loadGeometry("file:"+install_dir+"/examples/LHeD/compact/compact.xml")
+  DDG4.Core.setPrintFormat("%-32s %6s %s")
+  geant4 = DDG4.Geant4(kernel)
+  # Configure UI
+  geant4.setupCshUI(ui=None)
+  gun = geant4.setupGun("Gun",
+                        Standalone=True,
+                        particle='geantino',
+                        energy=20*SystemOfUnits.GeV,
+                        position=(0,0,0),
+                        multiplicity=1,
+                        isotrop=False )
+  scan = DDG4.SteppingAction(kernel,'Geant4MaterialScanner/MaterialScan')
+  kernel.steppingAction().adopt(scan)
+
+  # Now build the physics list:
+  phys = geant4.setupPhysics('QGSP_BERT')
+  kernel.configure()
+  kernel.initialize()
+  kernel.NumEvents = 1
+
+  # 3 shots in different directions:
+  gun.direction = (0,1,0)
+  kernel.run()
+  gun.direction = (1,0,0)
+  kernel.run()
+  gun.direction = (1,1,1)
+  kernel.run()
+
+  kernel.terminate()
+  print 'End of run. Terminating .......'
+  print 'TEST_PASSED'
+
+if __name__ == "__main__":
+  run()
diff --git a/examples/LHeD/scripts/LHeDXML.C b/examples/LHeD/scripts/LHeDXML.C
new file mode 100644
index 000000000..69d6775a9
--- /dev/null
+++ b/examples/LHeD/scripts/LHeDXML.C
@@ -0,0 +1,56 @@
+// $Id$
+//====================================================================
+//  AIDA Detector description implementation
+//--------------------------------------------------------------------
+//
+//  Run Geant4 using DDG4 from root prompt with test objects for
+//  Run/Event/Sensitive actions.
+//
+//  The Geant4 setup is programmed in the xml files to be parsed. Only
+//  the commands to parse these xml files is executed by root.
+//
+//  Usage:
+//  $> root.exe
+//  root[0] .x <installation-directory>/examples/LHeD/scripts/initACLick.C
+//  root[1] .L <installation-directory>/examples/LHeD/scripts/LHeDXML.C+
+//  root[2] LHeDACLick()
+//
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#include "DDG4/Geant4Config.h"
+#include <iostream>
+
+using namespace std;
+using namespace dd4hep::sim;
+using namespace dd4hep::sim::Setup;
+
+int setupG4_XML(bool interactive)  {
+  string install_dir = getenv("DD4hepINSTALL");
+  string prefix = "file:"+install_dir+"/examples/";
+  Kernel& kernel = Kernel::instance(dd4hep::Detector::getInstance());
+  kernel.loadGeometry((prefix+"LHeD/compact/compact.xml").c_str());
+  kernel.loadXML((prefix+"LHeD/sim/field.xml").c_str());
+  kernel.loadXML((prefix+"LHeD/sim/sequences.xml").c_str());
+  kernel.loadXML((prefix+"LHeD/sim/physics.xml").c_str());
+  if ( interactive )  {
+    kernel.property("UI") = "UI";
+  }
+  kernel.configure();
+  kernel.initialize();
+  kernel.run();
+  cout << "Successfully executed application .... " << endl;
+  kernel.terminate();
+  cout << "TEST_PASSED" << endl;
+  return 0;
+}
+
+#if defined(G__DICTIONARY) || defined(__CLING__) || defined(__CINT__) || defined(__MAKECINT__) // CINT script
+int LHeDXML()
+#else
+int main(int, char**)                              // Main program if linked standalone
+#endif
+{
+  return setupG4_XML(false);
+}
diff --git a/examples/LHeD/scripts/LHeD_G4Gun.py b/examples/LHeD/scripts/LHeD_G4Gun.py
new file mode 100644
index 000000000..e98a4bc33
--- /dev/null
+++ b/examples/LHeD/scripts/LHeD_G4Gun.py
@@ -0,0 +1,62 @@
+"""
+
+   Subtest using LHeD showing the usage of the G4Particle gun using
+   the Geant4GeneratorWrapper object.
+
+   @author  M.Frank
+   @version 1.0
+
+"""
+def run():
+  import LHeD, DDG4
+  from DDG4 import OutputLevel as Output
+  
+  lhed = LHeD.LHeD()
+  geant4 = lhed.geant4
+  kernel = lhed.kernel
+  lhed.loadGeometry()
+  geant4.printDetectors()
+  kernel.UI = "UI"
+  geant4.setupCshUI()
+  lhed.setupField(quiet=False)
+  DDG4.importConstants(kernel.detectorDescription(),debug=False)
+
+  prt = DDG4.EventAction(kernel,'Geant4ParticlePrint/ParticlePrint')
+  prt.OutputLevel = Output.INFO
+  prt.OutputType  = 3 # Print both: table and tree
+  kernel.eventAction().adopt(prt)
+
+  gen = DDG4.GeneratorAction(kernel,"Geant4GeneratorActionInit/GenerationInit")
+  kernel.generatorAction().adopt(gen)
+  print "#  First particle generator: gun"
+  gun = DDG4.GeneratorAction(kernel,"Geant4GeneratorWrapper/Gun");
+  gun.Uses     = 'G4ParticleGun'
+  gun.Mask     = 1
+  kernel.generatorAction().adopt(gun)
+
+  # Merge all existing interaction records
+  merger = DDG4.GeneratorAction(kernel,"Geant4InteractionMerger/InteractionMerger")
+  merger.enableUI()
+  kernel.generatorAction().adopt(merger)
+
+
+  # And handle the simulation particles.
+  part = DDG4.GeneratorAction(kernel,"Geant4ParticleHandler/ParticleHandler")
+  kernel.generatorAction().adopt(part)
+  part.OutputLevel = Output.INFO
+  part.enableUI()
+  user = DDG4.Action(kernel,"Geant4TCUserParticleHandler/UserParticleHandler")
+  user.TrackingVolume_Zmax = DDG4.EcalEndcap_zmin
+  user.TrackingVolume_Rmax = DDG4.EcalBarrel_rmin
+  user.enableUI()
+  part.adopt(user)
+
+  lhed.setupDetectors()
+  lhed.setupPhysics('QGSP_BERT')
+  lhed.test_config()
+  gun.generator()  # Instantiate gun to be able to set properties from G4 prompt
+  kernel.run()
+  kernel.terminate()
+
+if __name__ == "__main__":
+  run()
diff --git a/examples/LHeD/scripts/LheSimu.py b/examples/LHeD/scripts/LheSimu.py
new file mode 100644
index 000000000..4c9cab54d
--- /dev/null
+++ b/examples/LHeD/scripts/LheSimu.py
@@ -0,0 +1,330 @@
+"""
+
+   DD4hep simulation example setup using the python configuration
+
+   @author  M.Frank
+   @version 1.0
+   modified for LHeC
+   
+"""
+def run():
+  import LHeD, DDG4, os, SystemOfUnits
+  from DDG4 import OutputLevel as Output
+  
+  lhed = LHeD.LHeD()
+  geant4 = lhed.geant4
+  kernel = lhed.kernel
+  lhed.loadGeometry()
+  geant4.printDetectors()
+  kernel.UI = "UI"
+  geant4.setupCshUI()
+  lhed.setupField(quiet=False)
+  DDG4.importConstants(kernel.detectorDescription(),debug=False)
+
+  dd4hep_dir = os.environ['DD4hep']
+  kernel.loadXML("file:"+dd4hep_dir+"/examples/LHeD/scripts/DDG4_field.xml")
+
+  geant4 = DDG4.Geant4(kernel,tracker='Geant4TrackerCombineAction')
+  geant4.printDetectors()
+
+  # Configure G4 magnetic field tracking
+  field = geant4.addConfig('Geant4FieldTrackingSetupAction/MagFieldTrackingSetup')
+  field.stepper            = "HelixGeant4Runge"
+  field.equation           = "Mag_UsualEqRhs"
+  field.eps_min            = 5e-0520*SystemOfUnits.mm
+  field.eps_max            = 0.001*SystemOfUnits.mm
+  field.min_chord_step     = 0.01*SystemOfUnits.mm
+  field.delta_chord        = 0.25*SystemOfUnits.mm
+  field.delta_intersection = 1e-05*SystemOfUnits.mm
+  field.delta_one_step     = 0.001*SystemOfUnits.mm
+  print '+++++> ',field.name,'-> stepper  = ',field.stepper
+  print '+++++> ',field.name,'-> equation = ',field.equation
+  print '+++++> ',field.name,'-> eps_min  = ',field.eps_min
+  print '+++++> ',field.name,'-> eps_max  = ',field.eps_max
+  print '+++++> ',field.name,'-> delta_one_step = ',field.delta_one_step
+
+
+  """
+  # Setup random generator
+  rndm = DDG4.Action(kernel,'Geant4Random/Random')
+  rndm.Seed = 987654321
+  rndm.initialize()
+  rndm.showStatus()
+  rndm.Seed = 987654321
+  """
+
+  # Configure Run actions
+  run1 = DDG4.RunAction(kernel,'Geant4TestRunAction/RunInit')
+  """
+  run1.Property_int    = 12345
+  run1.Property_double = -5e15*keV
+  run1.Property_string = 'Startrun: Hello_LHeD'
+  print run1.Property_string, run1.Property_double, run1.Property_int
+  """
+  run1.enableUI()
+  kernel.registerGlobalAction(run1)
+  kernel.runAction().adopt(run1)
+
+  # Configure Event actions
+  prt = DDG4.EventAction(kernel,'Geant4ParticlePrint/ParticlePrint')
+  prt.OutputLevel = Output.INFO
+  prt.OutputType  = 3 # Print both: table and tree
+  kernel.eventAction().adopt(prt)
+
+  # Configure I/O
+  #evt_lcio = geant4.setupLCIOOutput('LcioOutput','Lhe_dip_sol_circ-higgs-bb')
+  #evt_lcio.OutputLevel = Output.ERROR
+  
+  evt_root = geant4.setupROOTOutput('RootOutput','Lhe_dip_sol_circ-higgs-bb')
+  evt_root.OutputLevel = Output.INFO
+
+  gen = DDG4.GeneratorAction(kernel,"Geant4GeneratorActionInit/GenerationInit")
+  kernel.generatorAction().adopt(gen)
+
+  """
+  # First particle generator: e-  non-isotropic generation using Gun: 
+  gun = DDG4.GeneratorAction(kernel,"Geant4ParticleGenerator/Gun");
+  gun.Particle = 'e-'
+  gun.Energy = 60 * GeV
+  gun.Multiplicity = 1
+  gun.Position = (0.*mm,0.*mm,0.*mm)
+  gun.Direction = (1.,0.,0.)
+  gun.Mask = 2
+  gun.enableUI()
+  kernel.generatorAction().adopt(gun)
+  # Install vertex smearing for this primary e-
+  gen = DDG4.GeneratorAction(kernel,"Geant4InteractionVertexSmear/SmearE-");
+  gen.Mask = 1
+  gen.Sigma = (0*mm, 0*mm, 0*mm, 0*ns)
+  kernel.generatorAction().adopt(gen)
+  """
+
+  #VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
+  """
+  Generation of isotrope tracks of a given multiplicity with overlay:
+  """
+  #VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
+  """
+  # First particle generator: pi+
+  gen = DDG4.GeneratorAction(kernel,"Geant4IsotropeGenerator/IsotropPi+");
+  gen.Particle = 'pi+'
+  gen.Energy = 200*GeV
+  gen.Multiplicity = 1
+  gen.Mask = 1
+  kernel.generatorAction().adopt(gen)
+  # Install vertex smearing for this interaction
+  gen = DDG4.GeneratorAction(kernel,"Geant4InteractionVertexSmear/SmearPi+");
+  gen.Mask = 1
+  gen.Offset = (20*mm, 10*mm, 10*mm, 0*ns)
+  gen.Sigma = (4*mm, 1*mm, 1*mm, 0*ns)
+  kernel.generatorAction().adopt(gen)
+
+  # Second particle generator: e-
+  gen = DDG4.GeneratorAction(kernel,"Geant4IsotropeGenerator/IsotropE-");
+  gen.Particle = 'e-'
+  gen.Energy = 60 * GeV
+  gen.Multiplicity = 2
+  gen.Mask = 2
+  kernel.generatorAction().adopt(gen)
+  # Install vertex smearing for this interaction
+  gen = DDG4.GeneratorAction(kernel,"Geant4InteractionVertexSmear/SmearE-");
+  gen.Mask = 2
+  gen.Offset = (-20*mm, -10*mm, -10*mm, 0*ns)
+  gen.Sigma = (12*mm, 8*mm, 8*mm, 0*ns)
+  kernel.generatorAction().adopt(gen)
+  """
+  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ 
+
+
+  #VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
+  """
+  Generation of primary particles from LCIO input files
+  """
+  #VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
+    
+  # First particle file reader
+  gen = DDG4.GeneratorAction(kernel,"LCIOInputAction/LCIO1");
+  # gen.Input = "LCIOStdHepReader|/afs/.cern.ch/project/lhec/software/aidasoft/DD4hep/DD4hep/files/NC_bb_tag_2_pythia_events.hep"
+  #gen.Input = "LCIOStdHepReader|/opt/DD4hep/files/NC_bb_tag_2_pythia_events.hep"
+  gen.Input = "LCIOStdHepReader|/opt/DD4hep/files/lhec_for_peter/tag_2_pythia_events.hep"
+  # gen.Input = "LCIOStdHepReader|/opt/DD4hep/files/single-top-tag_1_pythia_events.hep"
+  
+  # gen.Input = "Geant4EventReaderHepMC|/opt/DD4hep/files/ePb-q2-0-i.mc2"
+  # gen.Input = "LCIOStdHepReader|/opt/DD4hep/files/single-top-tag_1_pythia_events.hep"
+  # gen.Input = "LCIOStdHepReader|/opt/DD4hep/files/root.hep"
+
+  gen.OutputLevel = 2 # generator_output_level
+  gen.MomentumScale = 1.0
+  gen.Mask = 1
+  gen.enableUI()
+  kernel.generatorAction().adopt(gen)
+
+  # Install vertex smearing for this interaction
+  gen = DDG4.GeneratorAction(kernel,"Geant4InteractionVertexSmear/Smear1");  
+  gen.OutputLevel = 4 #generator_output_level
+  gen.Mask = 1
+  gen.Offset = (-20*SystemOfUnits.mm, -10*SystemOfUnits.mm, -10*SystemOfUnits.mm, 0*SystemOfUnits.ns)
+  gen.Sigma = (12*SystemOfUnits.mm, 8*SystemOfUnits.mm, 8*SystemOfUnits.mm, 0*SystemOfUnits.ns)
+  gen.enableUI()
+  kernel.generatorAction().adopt(gen)
+
+  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  
+  # Merge all existing interaction records
+  gen = DDG4.GeneratorAction(kernel,"Geant4InteractionMerger/InteractionMerger")
+  gen.OutputLevel = 4 #generator_output_level
+  gen.enableUI()
+  kernel.generatorAction().adopt(gen)
+
+  # Finally generate Geant4 primaries
+  gen = DDG4.GeneratorAction(kernel,"Geant4PrimaryHandler/PrimaryHandler")
+  gen.OutputLevel = 4 #generator_output_level
+  gen.enableUI()
+  kernel.generatorAction().adopt(gen)
+
+  # And handle the simulation particles.
+  part = DDG4.GeneratorAction(kernel,"Geant4ParticleHandler/ParticleHandler")
+  kernel.generatorAction().adopt(part)
+  #part.SaveProcesses = ['conv','Decay']
+  part.SaveProcesses = ['Decay']
+  part.MinimalKineticEnergy = 10*SystemOfUnits.MeV
+  part.OutputLevel = 5 # generator_output_level
+  part.enableUI()
+
+  user = DDG4.Action(kernel,"Geant4TCUserParticleHandler/UserParticleHandler")
+  user.TrackingVolume_Zmax = DDG4.EcalEndcap_zmin_fwd
+  user.TrackingVolume_Rmax = DDG4.EcalBarrel_rmin
+  user.enableUI()
+  part.adopt(user)
+
+
+  """
+  rdr = DDG4.GeneratorAction(kernel,"LcioGeneratorAction/Reader")
+  rdr.zSpread = 0.0
+  rdr.lorentzAngle = 0.0
+  rdr.OutputLevel = DDG4.OutputLevel.INFO
+  rdr.Input = "LcioEventReader|test.data"
+  rdr.enableUI()
+  kernel.generatorAction().adopt(rdr)
+  """
+
+  # Setup global filters fur use in sensntive detectors
+  f1 = DDG4.Filter(kernel,'GeantinoRejectFilter/GeantinoRejector')
+  kernel.registerGlobalFilter(f1)
+  f2 = DDG4.Filter(kernel,'ParticleRejectFilter/OpticalPhotonRejector')
+  f2.particle = 'opticalphoton'
+  kernel.registerGlobalFilter(f2)
+  f3 = DDG4.Filter(kernel,'ParticleSelectFilter/OpticalPhotonSelector') 
+  f3.particle = 'opticalphoton'
+  kernel.registerGlobalFilter(f3)
+
+  f4 = DDG4.Filter(kernel,'EnergyDepositMinimumCut')
+  f4.Cut = 0.5*SystemOfUnits.MeV
+  f4.enableUI()
+  kernel.registerGlobalFilter(f4)
+
+  # First the tracking detectors
+  seq,act = geant4.setupTracker('SiVertexBarrel')
+  seq.adopt(f1)
+  act.adopt(f1)
+  
+  seq,act = geant4.setupTracker('SiTrackerBarrel')
+  seq.adopt(f1)
+  act.adopt(f1)
+  seq,act = geant4.setupTracker('SiTrackerForward')
+  seq.adopt(f1)
+  act.adopt(f1)
+  seq,act = geant4.setupTracker('SiTrackerBackward')
+  seq.adopt(f1)
+  act.adopt(f1)
+
+  # Now the calorimeters
+  seq,act = geant4.setupCalorimeter('EcalBarrel')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+
+  seq,act = geant4.setupCalorimeter('EcalEndcap_fwd')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+  seq,act = geant4.setupCalorimeter('EcalEndcap_bwd')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+    
+  seq,act = geant4.setupCalorimeter('HcalBarrel')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+  seq,act = geant4.setupCalorimeter('HcalEndcap_fwd')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+  seq,act = geant4.setupCalorimeter('HcalEndcap_bwd')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+
+  seq,act = geant4.setupCalorimeter('HcalPlug_fwd')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+  seq,act = geant4.setupCalorimeter('HcalPlug_bwd')
+  seq.adopt(f3)
+  act.adopt(f3)
+  seq.adopt(f4)
+  act.adopt(f4)
+    
+  seq,act = geant4.setupCalorimeter('MuonBarrel')
+  seq.adopt(f2)
+  act.adopt(f2)
+  seq,act = geant4.setupCalorimeter('MuonEndcap_fwd1')
+  seq.adopt(f2)
+  act.adopt(f2)
+  seq,act = geant4.setupCalorimeter('MuonEndcap_fwd2')
+  seq.adopt(f2)
+  act.adopt(f2)
+  seq,act = geant4.setupCalorimeter('MuonEndcap_bwd1')
+  seq.adopt(f2)
+  act.adopt(f2)
+  seq,act = geant4.setupCalorimeter('MuonEndcap_bwd2')
+  seq.adopt(f2)
+  act.adopt(f2)
+
+
+  """
+  scan = DDG4.SteppingAction(kernel,'Geant4MaterialScanner/MaterialScan')
+  kernel.steppingAction().adopt(scan)
+  """
+
+  # Now build the physics list:
+  phys = geant4.setupPhysics('QGSP_BERT')
+  ph = DDG4.PhysicsList(kernel,'Geant4PhysicsList/Myphysics')
+  ph.addParticleConstructor('G4Geantino')
+  ph.addParticleConstructor('G4BosonConstructor')
+  ph.addParticleConstructor('G4LeptonConstructor')
+  ph.addParticleProcess('e[+-]','G4eMultipleScattering',-1,1,1)
+  ph.addPhysicsConstructor('G4OpticalPhysics')
+  ph.enableUI()
+  phys.adopt(ph)
+  phys.dump()
+
+  kernel.configure()
+  kernel.initialize()
+
+  #DDG4.setPrintLevel(Output.DEBUG)
+  kernel.run()
+  print 'End of run. Terminating .......'
+  kernel.terminate()
+
+if __name__ == "__main__":
+  run()
diff --git a/examples/LHeD/scripts/TEve.C b/examples/LHeD/scripts/TEve.C
new file mode 100644
index 000000000..ca85752b5
--- /dev/null
+++ b/examples/LHeD/scripts/TEve.C
@@ -0,0 +1,57 @@
+// $Id: Geant4Data.h 513 2013-04-05 14:31:53Z gaede $
+//====================================================================
+//  AIDA Detector description implementation
+//--------------------------------------------------------------------
+//
+//  Define the ROOT dictionaries for all data classes to be saved 
+//  which are created by the DDG4 examples.
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#include "DD4hep/LCDD.h"
+#include "TGeoManager.h"
+#include "TEveGeoNode.h"
+#include "TGLViewer.h"
+#include "TGLUtil.h"
+#include "TGLClip.h"
+#include "TMap.h"
+#include "TEveElement.h"
+#include "TSysEvtHandler.h"
+#include "TTimer.h"
+#include "TVirtualPad.h"
+
+#define private public
+#include "TEveManager.h"
+
+using namespace DD4hep::Geometry;
+
+void TEve()    {
+  LCDD& lcdd = LCDD::getInstance();
+  const char* fname = "file:/opt/DD4hep/DD4hep/examples/LHeD/compact/compact_Fhe_big_sol.xml";
+  lcdd.apply("DD4hepCompactLoader",1,(char**)&fname);
+
+  TEveManager::Create();
+  //TFile::SetCacheFileDir(".");
+  //gGeoManager = gEve->GetGeometry("LHCb.gdml");
+  //gGeoManager = gEve->GetGeometry("lhcbfull_v1.root");
+
+  gEve->fGeometries->Add(new TObjString(fname),&lcdd.manager());
+  //gGeoManager->DefaultColors();
+
+  TEveGeoTopNode* tn = new TEveGeoTopNode(gGeoManager, gGeoManager->GetTopNode());
+  tn->SetVisLevel(4);
+  gEve->AddGlobalElement(tn);
+
+  gEve->FullRedraw3D(kTRUE);
+
+  // EClipType not exported to CINT (see TGLUtil.h):
+  // 0 - no clip, 1 - clip plane, 2 - clip box
+  TGLViewer *v = gEve->GetDefaultGLViewer();
+  v->GetClipSet()->SetClipType(TGLClip::kClipPlane);
+  v->ColorSet().Background().SetColor(kMagenta+4);
+  v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
+  v->RefreshPadEditor(v);
+  v->CurrentCamera().RotateRad(-1.2, 0.5);
+  v->DoDraw();
+}
diff --git a/examples/LHeD/scripts/compact-Lhe.xml b/examples/LHeD/scripts/compact-Lhe.xml
new file mode 120000
index 000000000..e0674fc47
--- /dev/null
+++ b/examples/LHeD/scripts/compact-Lhe.xml
@@ -0,0 +1 @@
+../compact/compact_Lhe_dip_sol_circ.xml
\ No newline at end of file
diff --git a/examples/LHeD/scripts/elements.xml b/examples/LHeD/scripts/elements.xml
new file mode 120000
index 000000000..99b9059a8
--- /dev/null
+++ b/examples/LHeD/scripts/elements.xml
@@ -0,0 +1 @@
+../compact/elements.xml
\ No newline at end of file
diff --git a/examples/LHeD/scripts/eve b/examples/LHeD/scripts/eve
new file mode 120000
index 000000000..0c0687a37
--- /dev/null
+++ b/examples/LHeD/scripts/eve
@@ -0,0 +1 @@
+../eve
\ No newline at end of file
diff --git a/examples/LHeD/scripts/initAClick.C b/examples/LHeD/scripts/initAClick.C
new file mode 100644
index 000000000..b6ed758ca
--- /dev/null
+++ b/examples/LHeD/scripts/initAClick.C
@@ -0,0 +1,97 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+
+// ROOT include files
+#include "TInterpreter.h"
+#include "TSystem.h"
+#include "RVersion.h"
+
+// C/C++ include files
+#include <iostream>
+#include <string>
+
+std::string make_str(const char* data)  {
+  if ( !data )   {
+    std::cout << "make_str:  '" << (data ? data : "Bad-Pointer") << "'" << std::endl;
+    return std::string("");
+  }
+  return std::string(data);
+}
+
+/// Process a single command in the ROOT interpreter
+int processCommand(const char* command, bool end_process)   {
+  int status;
+  // Disabling auto-parse is a hack required by a bug in ROOT
+#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
+  gInterpreter->SetClassAutoparsing(false);
+  status = gInterpreter->ProcessLine(command);
+  gInterpreter->SetClassAutoparsing(true);
+#else
+  status = gInterpreter->ProcessLine(command);
+#endif
+  ::printf("+++ Status(%s) = %d\n",command,status);
+  if ( end_process )  {
+    gInterpreter->ProcessLine("gSystem->Exit(0)");
+  }
+  return status;
+}
+
+/// Process a ROOT AClick given a file
+int processMacro(const char* macro, bool end_process)   {
+  std::string cmd = ".X ";
+  cmd += macro;
+  cmd += ".C+()";
+  return processCommand(cmd.c_str(), end_process);
+}
+
+/// Initialize the ROOT environment to compile and execute a ROOT ACLick
+int initAClick(const char* command=0)  {
+  std::string rootsys = make_str(gSystem->Getenv("ROOTSYS"));
+  std::string geant4  = make_str(gSystem->Getenv("G4INSTALL"));
+  std::string dd4hep  = make_str(gSystem->Getenv("DD4hepINSTALL"));
+  std::string clhep   = make_str(gSystem->Getenv("CLHEP_ROOT_DIR"));
+  std::string defs    = "";
+  std::string libs    = " -L"+rootsys+"/lib";
+  std::string inc     = " -I"+dd4hep+"/examples/LHeD/scripts -I"+dd4hep + " -I"+dd4hep+"/include"+clhep+"/include -I"+geant4+"/include";
+  libs += " -L"+dd4hep+"/lib -lDDCore -lDDG4 -lDDSegmentation";
+  if ( !geant4.empty() )  {
+    inc  += " -I"+geant4+"/include/Geant4";
+#ifdef __APPLE__
+    libs += (" -L"+geant4+"/lib");
+#else
+    libs += (" -L"+geant4+"/lib -L"+geant4+"/lib64");
+#endif
+  }
+  if ( !clhep.empty() )  {
+    // A bit unclear how to deal with CLHEP libraries here, 
+    // if CLHEP is not included in Geant4...
+    inc += " -I"+clhep+"/include";
+    std::string clhep_lib = make_str(gSystem->Getenv("CLHEP_LIBRARY_PATH"));
+    if ( !clhep_lib.empty() ) libs += " -L"+clhep_lib+"/lib";
+  }
+  inc += " -Wno-shadow -g -O0" + defs;
+#ifndef __APPLE__
+  libs += " -lCore -lMathCore -pthread -lm -ldl -rdynamic";
+#endif
+  gSystem->AddIncludePath(inc.c_str());
+  gSystem->AddLinkedLibs(libs.c_str());
+  std::cout << "+++ Includes:   " << gSystem->GetIncludePath() << std::endl;
+  std::cout << "+++ Linked libs:" << gSystem->GetLinkedLibs()  << std::endl;
+  int ret = 0;  // gSystem->Load("libDDG4Plugins");
+  if ( 0 == ret )   {
+    if ( command )  {
+      processCommand(command, true);
+    }
+  }
+  return ret;
+}
diff --git a/examples/LHeD/scripts/materials.xml b/examples/LHeD/scripts/materials.xml
new file mode 120000
index 000000000..b4e8be112
--- /dev/null
+++ b/examples/LHeD/scripts/materials.xml
@@ -0,0 +1 @@
+../compact/materials.xml
\ No newline at end of file
diff --git a/examples/LHeD/scripts/physics.xml b/examples/LHeD/scripts/physics.xml
new file mode 100644
index 000000000..f8694a530
--- /dev/null
+++ b/examples/LHeD/scripts/physics.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geant4_setup>
+
+  <!-- Definition of the physics list.
+  
+     Ordering values:
+     	ordInActive = -1,	// ordering parameter to indicate InActive DoIt
+     	ordDefault = 1000,	// default ordering parameter
+     	ordLast    = 9999 	// ordering parameter to indicate the last DoIt
+  -->
+
+  <sequences>
+   <sequence name="Geant4PhysicsListSequence/PhysicsList" decays="true" extends="QGSP_BERT"/>
+
+<!-- -->
+   <physicslist name="Geant4PhysicsList/MyPhysics.0" decays="true">
+<!--       <extends name="FTFP_BERT"/> -->
+       <extends name="QGSP_BERT"/>
+      <physics>
+	<construct name="G4BosonConstructor"/>
+	<construct name="G4LeptonConstructor"/>
+    <construct name="G4EmStandardPhysics"/>
+    <construct name="HadronPhysicsQGSP"/>
+      </physics>
+
+    <processes>
+     <particle name="gamma">
+     </particle>
+      
+	 <particle name="e[+-]" cut="0.001*mm">
+	  <process name="G4eMultipleScattering" ordAtRestDoIt="-1" ordAlongSteptDoIt="1" ordPostStepDoIt="1"/>
+	  <process name="G4eIonisation"         ordAtRestDoIt="-1" ordAlongSteptDoIt="2" ordPostStepDoIt="2"/>
+	 </particle>
+
+     <particle name="mu[+-]">
+	   <process name="G4MuMultipleScattering" ordAtRestDoIt="-1" ordAlongSteptDoIt="1" ordPostStepDoIt="1"/>
+	   <process name="G4MuIonisation"         ordAtRestDoIt="-1" ordAlongSteptDoIt="2" ordPostStepDoIt="2"/>
+      </particle>
+
+      <particle name="pi[+-]">
+	    <process name="G4hMultipleScattering" ordAtRestDoIt="-1" ordAlongSteptDoIt="1" ordPostStepDoIt="1"/>
+	    <process name="G4hIonisation"         ordAtRestDoIt="-1" ordAlongSteptDoIt="2" ordPostStepDoIt="2"/>
+      </particle>
+     </processes>
+
+   </physicslist>
+
+  </sequences>
+  
+</geant4_setup>
diff --git a/examples/LHeD/scripts/rootlogon.C b/examples/LHeD/scripts/rootlogon.C
new file mode 100644
index 000000000..926e74372
--- /dev/null
+++ b/examples/LHeD/scripts/rootlogon.C
@@ -0,0 +1,3 @@
+{
+gROOT->ProcessLine(".x initACliC.C");
+}
diff --git a/examples/LHeD/scripts/run.C b/examples/LHeD/scripts/run.C
new file mode 100644
index 000000000..2e063b630
--- /dev/null
+++ b/examples/LHeD/scripts/run.C
@@ -0,0 +1,27 @@
+
+// ROOT include files
+#include "TInterpreter.h"
+
+// C/C++ include files
+#include <string>
+
+// Run a ROOT macro
+void run(const char* macro)  {
+  int status;
+  char cmd[1024];
+  const char* dd4hep_install = getenv("DD4hepINSTALL");
+  const char* dd4hep = getenv("DD4hep");
+  if ( dd4hep_install )  {
+    ::sprintf(cmd,".L %s/examples/LHeD/scripts/initAClick.C+",dd4hep_install);
+  }
+  else  {
+    ::sprintf(cmd,".L examples/LHeD/scripts/initAClick.C+");
+  }
+  status = gInterpreter->ProcessLine(cmd); 
+  ::printf("Status(%s) = %d\n",cmd,status);
+  status = gInterpreter->ProcessLine("initAClick()");
+  ::printf("Status(%s) = %d\n",cmd,status);
+  ::sprintf(cmd,"processMacro(\"%s\",true)",macro);
+  status = gInterpreter->ProcessLine(cmd);
+  ::printf("Status(%s) = %d\n",cmd,status);
+}
diff --git a/examples/LHeD/scripts/run.mac b/examples/LHeD/scripts/run.mac
new file mode 100644
index 000000000..823dab410
--- /dev/null
+++ b/examples/LHeD/scripts/run.mac
@@ -0,0 +1,33 @@
+# $Id: run1.mac,v 1.2 2000-11-21 10:59:42 maire Exp $
+#
+# Macro file for "exampleN03.cc"
+# 
+# can be run in batch, without graphic
+# or interactively: Idle> /control/execute run1.mac
+#
+/control/verbose 1
+/control/saveHistory
+#
+/run/verbose 0
+/event/verbose 0
+/tracking/verbose 0
+#
+# 2 x  3 GeV Muons events
+#
+# uncomment when running slic
+#/generator/select gun
+#/gun/direction 1. 1. .1
+#/gun/particle mu+
+#/gun/energy 100 GeV
+  /vis/open DAWNFILE
+  /vis/viewer/refresh
+  /vis/viewer/zoom 100
+  /vis/viewer/set/viewpointThetaPhi 0 0
+  /vis/viewer/set/style wireframe
+  /vis/scene/create
+  /vis/scene/add/volume
+  /vis/scene/add/trajectories
+  /vis/scene/add/hits
+  /vis/sceneHandler/attach
+  /tracking/storeTrajectory 1
+/run/beamOn 1
diff --git a/examples/LHeD/scripts/sequences.xml b/examples/LHeD/scripts/sequences.xml
new file mode 100644
index 000000000..6d3f20507
--- /dev/null
+++ b/examples/LHeD/scripts/sequences.xml
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geant4_setup>
+
+
+
+  <!-- Kernel parameters  
+       UI="UI" is default, 
+    
+       Note:
+       NumEvents is ignored in interactive sessions, but  used
+       in batch mode without ui nor vis.
+    
+       To run batch: set UI=""
+  -->
+  <kernel UI="" NumEvents="10"/>  
+
+  <!-- List of globally known actions. These actions will be registered with the Geant4Kernel 
+       object and may be retrieved by there using the action name.
+    
+       Note: registered actions MUST be unique.
+       However, not all actions need to registered....
+       Only register those, you later need to retrieve by name.
+  -->
+  <actions>
+    <action name="Geant4TestRunAction/RunInit">
+      <properties Control="true"
+		  Property_int="12345"
+		  Property_double="-5e15"
+		  Property_string="Startrun: Hello_2"/>
+     </action>
+    <action name="Geant4TestEventAction/UserEvent_2">
+      <properties Control="true"
+		  Property_int="1234"
+		  Property_double="5e15"
+		  Property_string="Hello_2"/>
+    </action>
+    <action name="Geant4TCUserParticleHandler/UserParticleHandler">
+      <properties Control="true"
+		  TrackingVolume_Zmax="765*cm"
+		  TrackingVolume_Rmax="625*cm"/>
+    </action>
+
+    <!-- UI handler initializing vis and ui. NAME IS FIXED/COMMON KNOWLEDGE -->
+    <action name="Geant4UIManager/UI">
+      <properties HaveVIS="0"
+		  HaveUI="1"
+		  SetupUI=""
+		  SessionType="csh"/>
+     </action>
+  </actions>
+
+  <!-- List of known phases.
+       Note: Phases can only be attached to the program at very well defined moments,
+       which are explained in the documentation.
+       These are typically the "standard" moments: BeginRun, EndRun, BeginEvent, etc.
+       and the calls after processing the hits of each sensitive detector.
+    
+  -->
+  <phases>
+    <phase type="RunAction/begin">
+      <action name="RunInit"/>
+      <action name="Geant4TestRunAction/UserRunInit">
+	<properties Control="true"
+		    Property_int="1234"
+		    Property_double="5e15"
+		    Property_string="'Hello_2'"/>
+      </action>
+    </phase>
+    <phase type="EventAction/end">
+      <action name="UserEvent_2"/>
+    </phase>
+    <phase type="EventAction/begin">
+      <action name="UserEvent_2"/>
+    </phase>
+  </phases>
+
+  <!-- List of globally known filters. Filters are called by Geant4 before the
+       hit processing in the sensitive detectors start. The global filters
+       may be shared between many sensitive detectors. Alternatively filters
+       may be directly attached to the sensitive detector in question.
+       Attributes are directly passed as properties to the filter action.
+    
+       Note: registered global filters MUST be unique.
+       However, not all filters need to registered....
+  -->
+  <filters>
+    <filter name="GeantinoRejectFilter/GeantinoRejector"/>
+    <filter name="ParticleRejectFilter/OpticalPhotonRejector">
+        <properties particle="opticalphoton" Control="true"/>
+    </filter>
+    <filter name="ParticleSelectFilter/OpticalPhotonSelector">
+        <properties particle="opticalphoton" Control="true"/>
+    </filter>
+    <filter name="EnergyDepositMinimumCut">
+      <properties Cut="10*keV" Control="true"/>
+    </filter>
+  </filters>
+
+  <!-- List of known action sequences.
+       Note: Action sequences exist for each of the various geant4 callback,
+       which are explained in the documentation, such as EventAction, RunAction, etc
+       and the calls after processing the hits of each sensitive detector.
+    
+  -->
+  <sequences>
+    <sequence name="Geant4EventActionSequence/EventAction">
+      <properties Control="true"/>
+      <action name="Geant4TestEventAction/UserEvent_1">
+        <properties Control="true"
+		    OutputLevel="3"
+		    Property_int="901234"
+  	  	    Property_double="1e11"
+		    Property_string="'Hello_1'"/>
+      </action>
+      <action name="UserEvent_2"/>
+<!--
+      <action name="Geant4Output2LCIO/LCIOOutput">
+	<properties Control="true" Output="simple_lcio"/>
+      </action>
+-->
+      <action name="Geant4Output2ROOT/RootOutput">
+	<properties Control="true" Output="LHeD_simple.root"/>
+      </action>
+    </sequence>
+    <sequence name="Geant4GeneratorActionSequence/GeneratorAction">
+      <action name="Geant4ParticleGun/Gun">
+        <properties Control="true"
+                    OutputLevel="3"
+		    energy="500*MeV"
+  	  	    particle="'e-'"
+		    multiplicity="1"
+		    direction="(1,1,1)"/>
+      </action>
+      <action name="Geant4ParticleHandler/ParticleHandler">
+        <properties Control="true"
+		    SaveProcesses="['Decay']"
+  	  	    MinimalKineticEnergy="100*MeV"/>
+	<adopt name="UserParticleHandler"/>
+      </action>
+
+<!--
+      <action name="LCIOInputAction/LCIO1">
+       <properties Control="true"
+	   Input="LCIOStdHepReader|/opt/DD4hep/files/NC_bb_tag_2_pythia_events.hep"/>
+      </action>
+-->
+<!--
+		/afs/.cern.ch/project/lhec/users/pythia-files
+		/opt/DD4hep/files/
+		    input="LCIOFileReader|/opt/DD4hep/files/test03092013.slcio"/>
+-->
+    </sequence>
+
+    <sequence sd="SiVertexBarrel" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+       <filter name="GeantinoRejector"/>
+       <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiVertexBarrelHandler">
+       <properties Control="true"/>
+      </action>
+    </sequence>    
+    <sequence sd="SiTrackerBarrel" type="Geant4SensDetActionSequence">
+       <properties Control="true"/>
+      <filter name="GeantinoRejector"/>
+      <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiTrackerBarrelHandler"/>
+    </sequence>
+    <sequence sd="SiTrackerForward" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <filter name="GeantinoRejector"/>
+      <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiTrackerForwardHandler"/>
+    </sequence>
+    <sequence sd="SiTrackerBackward" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <filter name="GeantinoRejector"/>
+      <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiTrackerBackwardHandler"/>
+    </sequence>    
+
+    <sequence sd="EcalBarrel" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <action name="Geant4SimpleCalorimeterAction/EcalBarrelHandler"/>
+    </sequence>
+    <sequence sd="EcalEndcap_fwd" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <action name="Geant4SimpleCalorimeterAction/EcalEndCap_fwdpHandler"/>
+    </sequence>
+    <sequence sd="EcalEndcap_bwd" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <action name="Geant4SimpleCalorimeterAction/EcalEndCap_bwdHandler"/>
+    </sequence>
+
+    <sequence sd="HcalBarrel" type="Geant4SensDetActionSequence">
+	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleOpticalCalorimeterAction/HcalBarrelHandler">
+       <properties Control="true"/>
+      </action>
+    </sequence>
+    <sequence sd="HcalEndcap_fwd" type="Geant4SensDetActionSequence">
+	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleOpticalCalorimeterAction/HcalEndcap_fwdHandler">
+       <properties Control="true"/>
+      </action>
+    </sequence>    
+    <sequence sd="HcalEndcap_bwd" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleOpticalCalorimeterAction/HcalEndcap_bwdHandler">
+    </sequence>	    
+    <sequence sd="HcalPlug_fwd" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+ 	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleCalorimeterAction/HcalPlug_fwdHandler"/>
+    </sequence>
+    <sequence sd="HcalPlug_bwd" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+ 	  <filter name="OpticalPhotonSelector"/>
+ 	  <action name="Geant4SimpleCalorimeterAction/HcalPlug_bwdHandler"/>
+    </sequence>
+ 	
+    <sequence sd="MuonBarrel" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonBarrelHandler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_fwd1" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_fwd1Handler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_fwd2" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_fwd2Handler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_bwd1" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_bwd1Handler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_bwd2" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_bwd2Handler"/>
+    </sequence>
+
+  </sequences>
+
+</geant4_setup>
diff --git a/examples/LHeD/scripts/testDDPython.py b/examples/LHeD/scripts/testDDPython.py
new file mode 100644
index 000000000..384cd1736
--- /dev/null
+++ b/examples/LHeD/scripts/testDDPython.py
@@ -0,0 +1,73 @@
+from ROOT import gSystem
+import os
+import platform
+if platform.system()=="Darwin":
+  gSystem.SetDynamicPath(os.environ['DD4HEP_LIBRARY_PATH'])
+gSystem.Load('libDDPython')
+from ROOT import dd4hep as Core
+
+name_space = __import__(__name__)
+def import_namespace_item(ns,nam):  
+  scope = getattr(name_space,ns)
+  attr = getattr(scope,nam)
+  setattr(name_space,nam,attr)
+  return attr
+
+def a_func():
+  print 'Hello world'
+  return 1
+
+class a_class:
+  def __init__(self):
+    pass
+  def fcn(self):
+    print 'Hello world from member function fcn'
+    return 1
+  def fcn_except(self,args,aa):
+    print 'Hello world from member function fcn1 a1=',args,' a2=',aa
+    raise RuntimeError('Except from python test object a_class')
+    return 6
+      
+
+py = import_namespace_item('Core','DDPython')
+
+print '+++++ Test: Execute statements in python with C++ indirection'
+py.instance().execute('import sys')
+py.instance().execute('print "Arguments:", sys.argv')
+print '\n'
+
+obj=a_class()
+import sys, traceback
+
+print '+++++ Test: simple function call'
+ret = py.instance().call(a_func,None)
+print 'ret:',ret
+print '\n'
+
+print '+++++ Test: object method call'
+ret = py.instance().call(obj.fcn,None)
+print 'ret:',ret
+print '\n'
+
+print '+++++ Test: object method call with non callable'
+try: 
+  ret = py.instance().call(1,None)
+  print 'ret:',ret
+except:
+  traceback.print_exc()
+print '\n'
+
+print '+++++ Test: object method call with exception in python callback'
+try: 
+  ret = py.instance().call(obj.fcn_except,(1,[1,2,3,4,5,6],))
+  print 'ret:',ret
+except:
+  traceback.print_exc()
+print '\n'
+print '+++++ All Done....\n\n'
+print 'TEST_PASSED'
+
+#py.instance().prompt()
+
+sys.exit(0)
+
diff --git a/examples/LHeD/scripts/vis.mac b/examples/LHeD/scripts/vis.mac
new file mode 100644
index 000000000..4c9bfeb9f
--- /dev/null
+++ b/examples/LHeD/scripts/vis.mac
@@ -0,0 +1,120 @@
+# Macro file for the visualization setting in the initialization phase 
+#
+# Set some default verbose
+/control/verbose 2
+/control/saveHistory
+#/run/verbose 2
+#
+# Change the default number of threads (in multi-threaded mode)
+#/run/numberOfThreads 4
+#
+# Use these open statements to open selected visualization
+#
+# Use this open statement to create an OpenGL view:
+#/vis/open OGL 600x600-0+0
+#
+# Use this open statement to create an OpenInventor view:
+#/vis/open OI
+#
+# Use this open statement to create a .prim file suitable for
+# viewing in DAWN:
+#/vis/open DAWNFILE
+#
+# Use this open statement to create a .heprep file suitable for
+# viewing in HepRApp:
+#/vis/open HepRepFile
+#
+# Use this open statement to create a .wrl file suitable for
+# viewing in a VRML viewer:
+#/vis/open VRML2FILE
+#
+# Draw geometry:
+#/vis/drawVolume
+#
+# Specify view angle:
+/vis/viewer/set/viewpointVector -1 0 0
+/vis/viewer/set/lightsVector -1 0 0
+#
+# Specify style (surface, wireframe, auxiliary edges,...)
+/vis/viewer/set/style wireframe
+/vis/viewer/set/auxiliaryEdge true
+/vis/viewer/set/lineSegmentsPerCircle 100
+#
+# Draw smooth trajectories at end of event, showing trajectory points
+# as markers 2 pixels wide:
+/vis/scene/add/trajectories smooth
+/vis/modeling/trajectories/create/drawByCharge
+/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
+/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
+# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
+/tracking/storeTrajectory 1
+#
+# Draw hits at end of event:
+/vis/scene/add/hits
+/vis/sceneHandler/attach
+#
+# To draw only gammas:
+#/vis/filtering/trajectories/create/particleFilter
+#/vis/filtering/trajectories/particleFilter-0/add gamma
+#
+# To invert the above, drawing all particles except gammas,
+# keep the above two lines but also add:
+#/vis/filtering/trajectories/particleFilter-0/invert true
+#
+# Many other options are available with /vis/modeling and /vis/filtering.
+# For example, to select colour by particle ID:
+#/vis/modeling/trajectories/create/drawByParticleID
+#/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true
+# To select or override default colours (note: e+ is blue by default):
+#/vis/modeling/trajectories/list
+#/vis/modeling/trajectories/drawByParticleID-0/set e+ yellow
+#
+# To superimpose all of the events from a given run:
+/vis/scene/endOfEventAction accumulate
+#
+# Decorations
+# Name
+/vis/set/textColour green
+/vis/set/textLayout right
+/vis/scene/add/text2D 0.9 -.9 24 ! ! FCC-he
+# or, if your system does not support right-adjustment
+#/vis/scene/add/text2D 0 -.9 24 ! ! exampleB1
+/vis/set/textLayout    # Revert to normal (left adjusted) layout
+/vis/set/textColour    # Revert to default text colour (blue)
+#
+# Axes, scale, etc.
+/vis/scene/add/scale   # Simple scale line
+/vis/scene/add/axes    # Simple axes: x=red, y=green, z=blue.
+/vis/scene/add/eventID # Drawn at end of event
+/vis/scene/add/date    # Date stamp
+#/vis/scene/add/logo2D  # Simple logo
+#/vis/scene/add/logo    # 3D logo
+#
+# Frame
+/vis/set/colour red
+/vis/set/lineWidth 2
+/vis/scene/add/frame   # Simple frame around the view
+/vis/set/colour        # Revert to default colour (white)
+/vis/set/lineWidth     # Revert to default line width (1.)
+#
+# Attach text to one edge of Shape1, with a small, fixed offset
+#/vis/scene/add/text 0 6 -4 cm 18 4 4 Shape1
+# Attach text to one corner of Shape2, with a small, fixed offset
+#/vis/scene/add/text 6 7 10 cm 18 4 4 Shape2
+#
+# To get nice view
+/vis/geometry/set/visibility World 0 false
+/vis/geometry/set/visibility Envelope 0 false
+/vis/viewer/set/style surface
+/vis/viewer/set/hiddenMarker true
+/vis/viewer/set/viewpointThetaPhi 120 150
+#
+# Re-establish auto refreshing and verbosity:
+#/vis/viewer/set/autoRefresh true
+/vis/verbose warnings
+#
+# For file-based drivers, use this to create an empty detector view:
+#/vis/viewer/flush
+# Initialize kernel
+/run/initialize
+/run/verbose 2
\ No newline at end of file
diff --git a/examples/LHeD/sim/field.xml b/examples/LHeD/sim/field.xml
new file mode 100644
index 000000000..dc76375c0
--- /dev/null
+++ b/examples/LHeD/sim/field.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geant4_setup>
+  <properties>
+    <attributes name="solenoid"
+		id="0"
+		type="Geant4FieldSetup"
+		object="GlobalSolenoid1"
+		global="true"
+		min_chord_step="0.01*mm"
+		delta_chord="0.25*mm"
+		delta_intersection="1e-05*mm"
+		delta_one_step="0.001*mm"
+		eps_min="5e-05*mm"
+		eps_max="0.001*mm"
+		stepper="HelixSimpleRunge"
+		equation="Mag_UsualEqRhs">
+    </attributes>
+  </properties>
+</geant4_setup>
diff --git a/examples/LHeD/sim/physics.xml b/examples/LHeD/sim/physics.xml
new file mode 100644
index 000000000..d869f1911
--- /dev/null
+++ b/examples/LHeD/sim/physics.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geant4_setup>
+
+  <!-- Definition of the physics list.
+   
+       Ordering values:
+     	ordInActive = -1,	// ordering parameter to indicate InActive DoIt
+       	ordDefault = 1000,	// default ordering parameter
+       	ordLast    = 9999 	// ordering parameter to indicate the last DoIt
+  -->
+
+  <sequences>
+    <sequence name="Geant4PhysicsListSequence/PhysicsList" decays="true" extends="FTFP_BERT"/>
+
+<!--
+    <physicslist name="Geant4PhysicsList/MyPhysics.0" decays="true">
+      <extends name="FTFP_BERT"/>
+      <particles>
+	<construct name="G4BosonConstructor"/>
+	<construct name="G4LeptonConstructor"/>
+      </particles>
+      <processes>
+	<particle name="e[+-]" cut="0.001*mm">
+	  <process name="G4eMultipleScattering" ordAtRestDoIt="-1" ordAlongSteptDoIt="1" ordPostStepDoIt="1"/>
+	  <process name="G4eIonisation"         ordAtRestDoIt="-1" ordAlongSteptDoIt="2" ordPostStepDoIt="2"/>
+	</particle>
+      </processes>
+    </physicslist>
+-->
+  </sequences>
+
+  <!--
+  <physicslist name="Geant4PhysicsList/MyPhysics.0">
+
+
+    <physics>
+      <construct name="G4EmStandardPhysics"/>
+      <construct name="HadronPhysicsQGSP"/>
+    </physics>
+
+    <processes>
+      <particle name="gamma">
+      </particle>
+
+      <particle name="e[+-]" cut="1*mm">
+	<process name="G4eMultipleScattering" ordAtRestDoIt="-1" ordAlongSteptDoIt="1" ordPostStepDoIt="1"/>
+	<process name="G4eIonisation"         ordAtRestDoIt="-1" ordAlongSteptDoIt="2" ordPostStepDoIt="2"/>
+      </particle>
+
+      <particle name="mu[+-]">
+	<process name="G4MuMultipleScattering" ordAtRestDoIt="-1" ordAlongSteptDoIt="1" ordPostStepDoIt="1"/>
+	<process name="G4MuIonisation"         ordAtRestDoIt="-1" ordAlongSteptDoIt="2" ordPostStepDoIt="2"/>
+      </particle>
+
+      <particle name="pi[+-]">
+	<process name="G4hMultipleScattering" ordAtRestDoIt="-1" ordAlongSteptDoIt="1" ordPostStepDoIt="1"/>
+	<process name="G4hIonisation"         ordAtRestDoIt="-1" ordAlongSteptDoIt="2" ordPostStepDoIt="2"/>
+      </particle>
+    </processes>
+  </physicslist>
+
+  <physicslist name="Geant4PhysicsList/MyPhysics.0">
+    <physics>
+      <construct name="G4EmStandardPhysics"/>
+    </physics>
+  </physicslist>
+  -->
+  
+</geant4_setup>
diff --git a/examples/LHeD/sim/sequences.xml b/examples/LHeD/sim/sequences.xml
new file mode 100644
index 000000000..84c4a34f9
--- /dev/null
+++ b/examples/LHeD/sim/sequences.xml
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geant4_setup>
+
+
+
+  <!-- Kernel parameters  
+       UI="UI" is default, 
+    
+       Note:
+       NumEvents is ignored in interactive sessions, but  used
+       in batch mode without ui nor vis.
+    
+       To run batch: set UI=""
+  -->
+  <kernel UI="" NumEvents="10"/>  
+
+  <!-- List of globally known actions. These actions will be registered with the Geant4Kernel 
+       object and may be retrieved by there using the action name.
+    
+       Note: registered actions MUST be unique.
+       However, not all actions need to registered....
+       Only register those, you later need to retrieve by name.
+  -->
+  <actions>
+    <action name="Geant4TestRunAction/RunInit">
+      <properties Control="true"
+		  Property_int="12345"
+		  Property_double="-5e15"
+		  Property_string="Startrun: Hello_2"/>
+     </action>
+    <action name="Geant4TestEventAction/UserEvent_2">
+      <properties Control="true"
+		  Property_int="1234"
+		  Property_double="5e15"
+		  Property_string="Hello_2"/>
+    </action>
+    <action name="Geant4TCUserParticleHandler/UserParticleHandler">
+      <properties Control="true"
+		  TrackingVolume_Zmax="765*cm"
+		  TrackingVolume_Rmax="625*cm"/>
+    </action>
+
+    <!-- UI handler initializing vis and ui. NAME IS FIXED/COMMON KNOWLEDGE -->
+    <action name="Geant4UIManager/UI">
+      <properties HaveVIS="0"
+		  HaveUI="1"
+		  SetupUI=""
+		  SessionType="csh"/>
+     </action>
+  </actions>
+
+  <!-- List of known phases.
+       Note: Phases can only be attached to the program at very well defined moments,
+       which are explained in the documentation.
+       These are typically the "standard" moments: BeginRun, EndRun, BeginEvent, etc.
+       and the calls after processing the hits of each sensitive detector.
+    
+  -->
+  <phases>
+    <phase type="RunAction/begin">
+      <action name="RunInit"/>
+      <action name="Geant4TestRunAction/UserRunInit">
+	<properties Control="true"
+		    Property_int="1234"
+		    Property_double="5e15"
+		    Property_string="'Hello_2'"/>
+      </action>
+    </phase>
+    <phase type="EventAction/end">
+      <action name="UserEvent_2"/>
+    </phase>
+    <phase type="EventAction/begin">
+      <action name="UserEvent_2"/>
+    </phase>
+  </phases>
+
+  <!-- List of globally known filters. Filters are called by Geant4 before the
+       hit processing in the sensitive detectors start. The global filters
+       may be shared between many sensitive detectors. Alternatively filters
+       may be directly attached to the sensitive detector in question.
+       Attributes are directly passed as properties to the filter action.
+    
+       Note: registered global filters MUST be unique.
+       However, not all filters need to registered....
+  -->
+  <filters>
+    <filter name="GeantinoRejectFilter/GeantinoRejector"/>
+    <filter name="ParticleRejectFilter/OpticalPhotonRejector">
+        <properties particle="opticalphoton" Control="true"/>
+    </filter>
+    <filter name="ParticleSelectFilter/OpticalPhotonSelector">
+        <properties particle="opticalphoton" Control="true"/>
+    </filter>
+    <filter name="EnergyDepositMinimumCut">
+      <properties Cut="10*keV" Control="true"/>
+    </filter>
+  </filters>
+
+  <!-- List of known action sequences.
+       Note: Action sequences exist for each of the various geant4 callback,
+       which are explained in the documentation, such as EventAction, RunAction, etc
+       and the calls after processing the hits of each sensitive detector.
+    
+  -->
+  <sequences>
+    <sequence name="Geant4EventActionSequence/EventAction">
+      <properties Control="true"/>
+      <action name="Geant4TestEventAction/UserEvent_1">
+        <properties Control="true"
+		    OutputLevel="3"
+		    Property_int="901234"
+  	  	    Property_double="1e11"
+		    Property_string="'Hello_1'"/>
+      </action>
+      <action name="UserEvent_2"/>
+<!--
+      <action name="Geant4Output2LCIO/LCIOOutput">
+	<properties Control="true" Output="simple_lcio"/>
+      </action>
+-->
+      <action name="Geant4Output2ROOT/RootOutput">
+	<properties Control="true" Output="LHeD_simple.root"/>
+      </action>
+    </sequence>
+    <sequence name="Geant4GeneratorActionSequence/GeneratorAction">
+      <action name="Geant4ParticleGun/Gun">
+        <properties Control="true"
+                    OutputLevel="3"
+		    energy="500*MeV"
+  	  	    particle="'e-'"
+		    multiplicity="1"
+		    direction="(1,1,1)"/>
+      </action>
+      <action name="Geant4ParticleHandler/ParticleHandler">
+        <properties Control="true"
+		    SaveProcesses="['Decay']"
+  	  	    MinimalKineticEnergy="100*MeV"/>
+	<adopt name="UserParticleHandler"/>
+      </action>
+
+<!--
+      <action name="LCIOInputAction/LCIO1">
+       <properties Control="true"
+	   Input="LCIOStdHepReader|/opt/DD4hep/files/NC_bb_tag_2_pythia_events.hep"/>
+      </action>
+-->
+<!--
+		/afs/.cern.ch/project/lhec/users/pythia-files
+		/opt/DD4hep/files/
+		    input="LCIOFileReader|/opt/DD4hep/files/test03092013.slcio"/>
+-->
+    </sequence>
+
+    <sequence sd="SiVertexBarrel" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+       <filter name="GeantinoRejector"/>
+       <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiVertexBarrelHandler">
+       <properties Control="true"/>
+      </action>
+    </sequence>    
+    <sequence sd="SiTrackerBarrel" type="Geant4SensDetActionSequence">
+       <properties Control="true"/>
+      <filter name="GeantinoRejector"/>
+      <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiTrackerBarrelHandler"/>
+    </sequence>
+    <sequence sd="SiTrackerForward" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <filter name="GeantinoRejector"/>
+      <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiTrackerForwardHandler"/>
+    </sequence>
+    <sequence sd="SiTrackerBackward" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <filter name="GeantinoRejector"/>
+      <filter name="EnergyDepositMinimumCut"/>
+      <action name="Geant4SimpleTrackerAction/SiTrackerBackwardHandler"/>
+    </sequence>    
+
+    <sequence sd="EcalBarrel" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <action name="Geant4SimpleCalorimeterAction/EcalBarrelHandler"/>
+    </sequence>
+    <sequence sd="EcalEndcap_fwd" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <action name="Geant4SimpleCalorimeterAction/EcalEndCap_fwdpHandler"/>
+    </sequence>
+    <sequence sd="EcalEndcap_bwd" type="Geant4SensDetActionSequence">
+      <properties Control="true"/>
+      <action name="Geant4SimpleCalorimeterAction/EcalEndCap_bwdHandler"/>
+    </sequence>
+
+    <sequence sd="HcalBarrel" type="Geant4SensDetActionSequence">
+	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleOpticalCalorimeterAction/HcalBarrelHandler">
+       <properties Control="true"/>
+      </action>
+    </sequence>
+    <sequence sd="HcalEndcap_fwd" type="Geant4SensDetActionSequence">
+	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleOpticalCalorimeterAction/HcalEndcap_fwdHandler">
+       <properties Control="true"/>
+      </action>
+    </sequence>    
+    <sequence sd="HcalEndcap_bwd" type="Geant4SensDetActionSequence">
+	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleOpticalCalorimeterAction/HcalEndcap_bwdHandler">
+      <properties Control="true"/>
+      </action>
+    </sequence>	    
+    <sequence sd="HcalPlug_fwd" type="Geant4SensDetActionSequence">
+ 	  <filter name="OpticalPhotonSelector"/>
+      <action name="Geant4SimpleCalorimeterAction/HcalPlug_fwdHandler"/>
+      <properties Control="true"/>
+    </sequence>
+    <sequence sd="HcalPlug_bwd" type="Geant4SensDetActionSequence">
+ 	  <filter name="OpticalPhotonSelector"/>
+ 	  <action name="Geant4SimpleCalorimeterAction/HcalPlug_bwdHandler"/>
+      <properties Control="true"/>
+    </sequence>
+ 	
+    <sequence sd="MuonBarrel" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonBarrelHandler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_fwd1" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_fwd1Handler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_fwd2" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_fwd2Handler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_bwd1" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_bwd1Handler"/>
+    </sequence>
+    <sequence sd="MuonEndcap_bwd2" type="Geant4SensDetActionSequence">
+      <action name="Geant4SimpleCalorimeterAction/MuonEndcap_bwd2Handler"/>
+    </sequence>
+
+  </sequences>
+
+</geant4_setup>
diff --git a/examples/LHeD/src/Lhe_BP_DiskTracker_geo.cpp b/examples/LHeD/src/Lhe_BP_DiskTracker_geo.cpp
new file mode 100644
index 000000000..bb38b43a5
--- /dev/null
+++ b/examples/LHeD/src/Lhe_BP_DiskTracker_geo.cpp
@@ -0,0 +1,122 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//             : P.Kostka   (LHeC more refined version circ-ell BP)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t  x_det     = e;
+  Material   air       = description.air();
+  string     det_name  = x_det.nameStr();
+  string     det_type  = x_det.typeStr();
+  bool       reflect   = x_det.reflect();
+  DetElement sdet        (det_name,x_det.id());
+  Assembly   assembly    (det_name+"_assembly");
+  PlacedVolume pv;
+  int l_num = 0;
+    
+  for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++l_num)  {
+    xml_comp_t x_layer = i;
+    string l_nam = det_name+_toString(l_num,"_layer%d");
+    double  zmin = x_layer.inner_z();
+    double  rmin = x_layer.inner_r();
+    double  rmax = x_layer.outer_r();
+    double  z    = zmin, layerWidth = 0.;
+    int     s_num = 0;
+    double  rmax_ell  = x_layer.rmax();
+
+    for(xml_coll_t j(x_layer,_U(slice)); j; ++j)  {
+      double thickness = xml_comp_t(j).thickness();
+      layerWidth += thickness;
+    }
+
+
+    
+    double ra    = 1.;             // ellipse long radius init
+           ra    = rmax_ell;       // ellipse long radius
+    double rb    = 1.;             // ellipse short radius init
+           rb    = rmin;           // ellipse short radius
+    double thickl = 0.;    // layer thickness
+           thickl = layerWidth;    // layer thickness
+    double rdiff = rmax - rmin;    // layer thickness
+   
+    EllipticalTube bpElTubeOut1(ra+rdiff, rb+rdiff, thickl);
+    EllipticalTube bpElTubeInn1(ra, rb, thickl+0.1);
+    SubtractionSolid bpElTube1(bpElTubeOut1,bpElTubeInn1);
+
+    Tube bpTube1(rb, rb+rdiff, thickl+0.1, 3*M_PI/2, M_PI/2);
+    UnionSolid beamTube1(bpElTube1,bpTube1);
+
+    Tube bpTube2(rb+rdiff, ra+rdiff, thickl+0.1, 3*M_PI/2, M_PI/2);
+    SubtractionSolid l_tub(beamTube1,bpTube2);
+
+    Volume  l_vol(l_nam,l_tub,air);
+    l_vol.setVisAttributes(description,x_layer.visStr());
+    for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++s_num)  {
+      xml_comp_t x_slice = j;
+      double thicks = x_slice.thickness();
+      Material mat = description.material(x_slice.materialStr());
+      string s_nam = l_nam+_toString(s_num,"_slice%d");
+    
+    EllipticalTube bpElTubeOut2(ra+rdiff, rb+rdiff, thickl);
+    EllipticalTube bpElTubeInn2(ra, rb, thickl+0.1);
+    SubtractionSolid bpElTube2(bpElTubeOut2,bpElTubeInn2);
+
+    Tube bpTube3(rb, rb+rdiff, thickl+0.1, 3*M_PI/2, M_PI/2);
+    UnionSolid beamTube2(bpElTube2,bpTube3);
+
+    Tube bpTube4(rb+rdiff, ra+rdiff, thickl+0.1, 3*M_PI/2, M_PI/2);
+    SubtractionSolid s_tub(beamTube2,bpTube4);
+
+    Volume   s_vol(s_nam, s_tub, mat);
+    s_vol.setVisAttributes(description,x_layer.visStr());
+        
+      if ( x_slice.isSensitive() ) {
+	    sens.setType("tracker");
+	    s_vol.setSensitiveDetector(sens);
+       }
+    l_vol.setAttributes(description,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+    pv = s_vol.placeVolume(s_vol,Position(0,0,z-zmin-layerWidth/2+thicks/2));
+    pv.addPhysVolID("slice",s_num);
+    }
+
+    DetElement layer(sdet,l_nam+"_pos",l_num);
+    pv = assembly.placeVolume(l_vol,Position(0,0,zmin+layerWidth/2.));
+    pv.addPhysVolID("layer",l_num);
+    pv.addPhysVolID("barrel",1);
+    layer.setPlacement(pv);
+    if ( reflect )  {
+      pv = assembly.placeVolume(l_vol,Transform3D(RotationY(2*M_PI),Position(0,0,-zmin-layerWidth/2)));
+      pv.addPhysVolID("layer",l_num);
+      pv.addPhysVolID("barrel",2);
+      DetElement layerR = layer.clone(l_nam+"_neg");
+      sdet.add(layerR.setPlacement(pv));
+    }
+  }
+  if ( x_det.hasAttr(_U(combineHits)) ) {
+    sdet.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
+  }
+  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
+  pv.addPhysVolID("system", x_det.id());      // Set the subdetector system ID.
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_BP_DiskTracker,create_detector)
diff --git a/examples/LHeD/src/Lhe_BP_MultiLayerTracker_geo.cpp b/examples/LHeD/src/Lhe_BP_MultiLayerTracker_geo.cpp
new file mode 100644
index 000000000..1d330087b
--- /dev/null
+++ b/examples/LHeD/src/Lhe_BP_MultiLayerTracker_geo.cpp
@@ -0,0 +1,83 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//
+//  mod.:        P.Kostka LHeD (asymmetrical detector placement in z)
+//                             ( circ-ellipt. in x,y)
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/Printout.h"
+#include "XML/Layering.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t  x_det     = e;
+  string     det_name  = x_det.nameStr();
+  string     det_type  = x_det.typeStr();
+  Material   air       = description.air();
+  DetElement sdet        (det_name,x_det.id());
+  Assembly   assembly    (det_name+"_assembly");
+  PlacedVolume pv;
+  int n = 0;
+
+  for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++n)  {
+    xml_comp_t x_layer = i;
+    string  l_name = det_name+_toString(n,"_layer%d");
+    double  z    = x_layer.outer_z();
+    double  rmin = x_layer.inner_r();
+    double  rmax = x_layer.outer_r();
+    double  r    = rmin;
+    double  rmax_ell  = x_layer.rmax();
+
+    double ra    = 1.;             // ellipse long radius init
+           ra    = rmax_ell;       // ellipse long radius
+    double rb    = 1.;             // ellipse short radius init
+           rb    = rmin;           // ellipse short radius
+    double thick = rmax - rmin;    // layer thickness
+    
+    EllipticalTube bpElTubeOut(ra+thick, rb+thick, z);
+    EllipticalTube bpElTubeInn(ra, rb, z+0.1);
+    SubtractionSolid bpElTube(bpElTubeOut,bpElTubeInn);
+
+    Tube bpTube1(rb, rb+thick, z+0.1, 3*M_PI/2, M_PI/2);
+    UnionSolid beamTube1(bpElTube,bpTube1);
+
+    Tube bpTube2(rb+thick, ra+thick, z+0.1, 3*M_PI/2, M_PI/2);
+    SubtractionSolid l_tub(beamTube1,bpTube2);
+
+    DetElement layer(sdet,_toString(n,"layer%d"),x_layer.id());  
+    Volume   l_vol(l_name, l_tub, air);
+    
+    cout << l_name << " " << rmin << " " << r << " " << z << endl;
+    l_vol.setVisAttributes(description,x_layer.visStr());
+    
+    double z_offset = x_layer.hasAttr(_U(z_offset)) ? x_layer.z_offset() : 0.0;
+    pv = assembly.placeVolume(l_vol,Position(0,0,z_offset));
+    pv.addPhysVolID("layer",n);
+    layer.setPlacement(pv);
+  }
+  if ( x_det.hasAttr(_U(combineHits)) ) {
+    sdet.setCombineHits(x_det.combineHits(),sens);
+  }
+
+  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
+  pv.addPhysVolID("system",sdet.id()).addPhysVolID("barrel",0);
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_BP_MultiLayerTracker,create_detector)
diff --git a/examples/LHeD/src/Lhe_BP_SiTrackerEndcap2_geo.cpp b/examples/LHeD/src/Lhe_BP_SiTrackerEndcap2_geo.cpp
new file mode 100644
index 000000000..f45c55cee
--- /dev/null
+++ b/examples/LHeD/src/Lhe_BP_SiTrackerEndcap2_geo.cpp
@@ -0,0 +1,164 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//
+//  mod.:        P.Kostka LHeD (asymmetrical detector placement in z; BP shape adoption)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include <map>
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  typedef vector<PlacedVolume> Placements;
+    double     ra = 0.;
+    double     rb = 0.;
+  xml_det_t   x_det     = e;
+  Material    vacuum    = description.vacuum();
+  int         det_id    = x_det.id();
+  string      det_name  = x_det.nameStr();
+  bool        reflect   = x_det.reflect(false);
+  DetElement  sdet        (det_name,det_id);
+  Assembly    assembly    (det_name);
+              ra      = x_det.rmax();  // ellipse long radius - y
+              rb      = x_det.r();     // ellipse short radius - x   
+  //Volume      assembly    (det_name,Box(10000,10000,10000),vacuum);
+  Volume      motherVol = description.pickMotherVolume(sdet);
+  int         m_id=0, c_id=0, n_sensor=0;
+  map<string,Volume> modules;
+  map<string, Placements>  sensitives;
+  PlacedVolume pv;
+
+  assembly.setVisAttributes(description.invisible());
+  sens.setType("tracker");
+  double   total_thickness_max=0.;
+
+  for(xml_coll_t mi(x_det,_U(module)); mi; ++mi, ++m_id)  {
+    xml_comp_t x_mod   = mi;
+    string     m_nam   = x_mod.nameStr();
+    xml_comp_t trd     = x_mod.trd();
+    double     posY;
+    double     x1      = trd.x1();
+    double     x2      = trd.x2();
+    double     z       = trd.z();
+    double     y1, y2, total_thickness=0.;
+    xml_coll_t ci(x_mod,_U(module_component));
+    for(ci.reset(), total_thickness=0.0; ci; ++ci)
+      total_thickness += xml_comp_t(ci).thickness();
+    if ( total_thickness >  total_thickness_max) total_thickness_max=total_thickness;
+    
+    y1 = y2 = total_thickness / 2;
+    Volume  m_volume(m_nam, Trapezoid(x1, x2, y1, y2, z), vacuum);      
+    m_volume.setVisAttributes(description.visAttributes(x_mod.visStr()));
+
+    for(ci.reset(), n_sensor=1, c_id=0, posY=-y1; ci; ++ci, ++c_id)  {
+      xml_comp_t c       = ci;
+      double     c_thick = c.thickness();
+      Material   c_mat   = description.material(c.materialStr());
+      string     c_name  = _toString(c_id,"component%d");
+      Volume     c_vol(c_name, Trapezoid(x1,x2,c_thick/2e0,c_thick/2e0,z), c_mat);
+
+      c_vol.setVisAttributes(description.visAttributes(c.visStr()));
+      pv = m_volume.placeVolume(c_vol,Position(0,posY+c_thick/2,0));
+      if ( c.isSensitive() ) {
+        sdet.check(n_sensor > 2,"SiTrackerEndcap2::fromCompact: "+c_name+" Max of 2 modules allowed!");
+        pv.addPhysVolID("sensor",n_sensor);
+        c_vol.setSensitiveDetector(sens);
+        sensitives[m_nam].push_back(pv);
+        ++n_sensor;
+      }
+      posY += c_thick;
+    }
+    modules[m_nam] = m_volume;
+  }
+  
+  for(xml_coll_t li(x_det,_U(layer)); li; ++li)  {
+    xml_comp_t  x_layer(li);
+    int l_id    = x_layer.id();
+    int mod_num = 1;
+    for(xml_coll_t ri(x_layer,_U(ring)); ri; ++ri)  {
+      xml_comp_t x_ring = ri;
+      double r        = x_ring.r();
+      double phi0     = x_ring.phi0(0);
+      double zstart   = x_ring.zstart();
+      double dz       = x_ring.dz(0);
+      int    nmodules = x_ring.nmodules();
+      string m_nam    = x_ring.moduleStr();
+      Volume m_vol    = modules[m_nam];
+      double iphi     = 2*M_PI/nmodules;
+      double phi      = phi0;
+      Placements& sensVols = sensitives[m_nam];
+
+      for(int k=0; k<nmodules; ++k) {
+        string m_base = _toString(l_id,"layer%d") + _toString(mod_num,"_module%d");
+        double x = -r*std::cos(phi);
+        double y = -r*std::sin(phi);
+/*       
+        EllipticalTube bpElTube(rb, ra, zstart-total_thickness_max/2); 
+        SubtractionSolid tr1(m_vol,bpElTube);
+        Volume  m_vol(m_nam, tr1, c_mat);       
+        material of the module ? how to change a module shape?
+        m_vol.setVisAttributes(description.visAttributes(x_ring.visStr()));
+*/      
+      
+	if ( zstart >= 0 ) {
+        DetElement module(sdet,m_base+"_pos",det_id);
+        pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(0,-M_PI/2-phi,-M_PI/2),Position(x,y,zstart+dz)));
+        pv.addPhysVolID("barrel",1).addPhysVolID("layer", l_id).addPhysVolID("module",mod_num);
+        module.setPlacement(pv);
+        for(size_t ic=0; ic<sensVols.size(); ++ic)  {
+          PlacedVolume sens_pv = sensVols[ic];
+          DetElement comp_elt(module,sens_pv.volume().name(),mod_num);
+          comp_elt.setPlacement(sens_pv);
+        }
+
+        if ( reflect ) {
+          pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(M_PI,-M_PI/2-phi,-M_PI/2),Position(x,y,-zstart-dz)));
+          pv.addPhysVolID("barrel",2).addPhysVolID("layer",l_id).addPhysVolID("module",mod_num);
+          DetElement r_module(sdet,m_base+"_neg",det_id);
+          r_module.setPlacement(pv);
+          for(size_t ic=0; ic<sensVols.size(); ++ic)  {
+            PlacedVolume sens_pv = sensVols[ic];
+            DetElement comp_elt(r_module,sens_pv.volume().name(),mod_num);
+            comp_elt.setPlacement(sens_pv);
+          }
+        }
+    } else
+    {
+       pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(0,-M_PI/2-phi,-M_PI/2),Position(x,y,zstart-dz)));
+	   pv.addPhysVolID("barrel",3).addPhysVolID("layer", l_id).addPhysVolID("module",mod_num);
+	   DetElement r_module(sdet,m_base+"_neg-z",det_id);
+	   r_module.setPlacement(pv);
+	   for(size_t ic=0; ic<sensVols.size(); ++ic)  {
+	    PlacedVolume sens_pv = sensVols[ic];
+	    DetElement comp_elt(r_module,sens_pv.volume().name(),mod_num);
+	    comp_elt.setPlacement(sens_pv);
+	  }
+        }
+        dz   = -dz;
+        phi += iphi;
+        ++mod_num;
+      }
+    }
+  }
+  pv = motherVol.placeVolume(assembly);
+  pv.addPhysVolID("system",det_id);
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_BP_SiTrackerEndcap2,create_detector)
diff --git a/examples/LHeD/src/Lhe_BP_SiVertexBarrel_geo.cpp b/examples/LHeD/src/Lhe_BP_SiVertexBarrel_geo.cpp
new file mode 100644
index 000000000..c1effb56c
--- /dev/null
+++ b/examples/LHeD/src/Lhe_BP_SiVertexBarrel_geo.cpp
@@ -0,0 +1,266 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//
+//  mod.:        P.Kostka LHeD (circ-ellipt. in x,y)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DDRec/Surface.h"
+#include "DDRec/DetectorData.h"
+#include <exception>
+
+#include "DD4hep/Printout.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+using namespace dd4hep::rec;
+
+/*************************************************************
+ function to calculate path in a given theta
+**************************************************************/
+static double computeDpt( double ra, double rb, double theta ) {
+    double dpt_sin = std::pow(ra * std::sin(theta), 2.0);
+    double dpt_cos = std::pow(rb * std::cos(theta), 2.0);
+    double dp = std::sqrt(dpt_sin + dpt_cos);
+    return dp;
+}
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  typedef vector<PlacedVolume> Placements;
+  xml_det_t   x_det     = e;
+  Material    air       = description.air();
+  int         det_id    = x_det.id();
+  string      det_name  = x_det.nameStr();
+  DetElement  sdet       (det_name,det_id);
+  Assembly    assembly   (det_name+"_assembly");
+  map<string, Volume>    volumes;
+  PlacedVolume pv;
+
+  double  mod_width = 0.0;
+          mod_width = 1.;
+        
+  sens.setType("tracker");
+  for(xml_coll_t mi(x_det,_U(module)); mi; ++mi)  {
+    xml_comp_t x_mod  = mi;
+    xml_comp_t m_env  = x_mod.child(_U(module_envelope));
+    string     m_nam  = x_mod.nameStr();
+
+    mod_width = m_env.width();
+    
+    Volume     m_vol(det_name+"_"+m_nam,Box(m_env.width()/2,m_env.length()/2,m_env.thickness()/2),air);
+    int        ncomponents = 0, sensor_number = 1;
+
+    if ( volumes.find(m_nam) != volumes.end() )   {
+      printout(ERROR,"SiTrackerBarrel","Logics error in building modules.");
+      throw runtime_error("Logics error in building modules.");
+    }
+    volumes[m_nam] = m_vol;
+        
+    for(xml_coll_t ci(x_mod,_U(module_component)); ci; ++ci, ++ncomponents)  {
+      xml_comp_t x_comp = ci;
+      xml_comp_t x_pos  = x_comp.position(false);
+      xml_comp_t x_rot  = x_comp.rotation(false);
+      string     c_nam  = det_name+"_"+m_nam+_toString(ncomponents,"_component%d");
+      Box        c_box(x_comp.width()/2,x_comp.length()/2,x_comp.thickness()/2);
+      Volume     c_vol(c_nam,c_box,description.material(x_comp.materialStr()));
+
+      if ( x_pos && x_rot ) {
+        Position    c_pos(x_pos.x(0),x_pos.y(0),x_pos.z(0));
+        RotationZYX c_rot(x_rot.z(0),x_rot.y(0),x_rot.x(0));
+        pv = m_vol.placeVolume(c_vol, Transform3D(c_rot,c_pos));
+      }
+      else if ( x_rot ) {
+        pv = m_vol.placeVolume(c_vol,RotationZYX(x_rot.z(0),x_rot.y(0),x_rot.x(0)));
+      }
+      else if ( x_pos ) {
+        pv = m_vol.placeVolume(c_vol,Position(x_pos.x(0),x_pos.y(0),x_pos.z(0)));
+      }
+      else {
+        pv = m_vol.placeVolume(c_vol);
+      }
+      c_vol.setRegion(description, x_comp.regionStr());
+      c_vol.setLimitSet(description, x_comp.limitsStr());
+      c_vol.setVisAttributes(description, x_comp.visStr());
+      if ( x_comp.isSensitive() ) {
+        pv.addPhysVolID(_U(sensor),sensor_number++);
+        c_vol.setSensitiveDetector(sens);
+      }
+    }
+    m_vol.setVisAttributes(description.visAttributes(x_mod.visStr()));
+  }
+    
+  for(xml_coll_t li(x_det,_U(layer)); li; ++li)  {
+    xml_comp_t x_layer  = li;
+    xml_comp_t x_barrel = x_layer.child(_U(barrel_envelope));
+    xml_comp_t x_layout = x_layer.child(_U(rphi_layout));
+    xml_comp_t z_layout = x_layer.child(_U(z_layout));      // Get the <z_layout> element.
+    int        lay_id   = x_layer.id();
+    string     m_nam    = x_layer.moduleStr();
+    Volume     m_env    = volumes[m_nam];
+    string     lay_nam  = det_name+"_"+m_nam+_toString(x_layer.id(),"_layer%d");
+
+    double     phi0     = x_layout.phi0();              // Starting phi of first module.
+    double     phi_tilt = x_layout.phi_tilt();          // Phi tilt of a module.
+    double     rc       = x_layout.rc();                // Radius of the module center.
+    double     rphi_dr  = x_layout.dr();                // The delta radius of every other module.
+    double     phic     = phi0;                         // Phi of the module center.
+    double     z0       = z_layout.z0();                // Z position of first module in phi.
+    double     nz       = z_layout.nz();                // Number of modules to place in z.
+    double     z_dr     = z_layout.dr();                // Radial displacement parameter, of every other module.
+
+
+	// not necessary, calculated here
+    //int        nphi     = x_layout.nphi();             // Number of modules in phi.
+    //double     phi_incr = (2*M_PI) / nphi;             // Phi increment for one module.
+	
+    // Z increment for module placement along Z axis.
+    // Adjust for z0 at center of module rather than
+    // the end of cylindrical envelope.
+    double z_incr   = nz > 1 ? (2.0 * z0) / (nz - 1) : 0.0;
+    // Starting z for module placement along Z axis.
+    double module_z = -z0;
+    int module = 1;
+
+    // multiplication factor for ellipse major radius
+    double c0;                                      
+    if (x_layer.id() <=1 ) c0 = 2.9;
+    else if (x_layer.id() == 2 ) c0 = 1.9;
+    else if (x_layer.id() == 3 ) c0 = 1.45;
+    else c0 = 1.23;
+
+    // create an envelope        
+    double env_rmin = x_barrel.inner_r();    // inner radius for envelope
+    double env_rmax = x_barrel.outer_r();    // outer radius for envelope
+    double env_z    = x_barrel.z_length();   // length of envelope
+
+    EllipticalTube envElTubeOut(c0*env_rmax,env_rmax, env_z);
+    EllipticalTube envElTubeInn(c0*env_rmin,env_rmin, env_z+0.01);
+    SubtractionSolid envElTube(envElTubeOut,envElTubeInn);
+
+    Tube envTube1(env_rmin, env_rmax, env_z+0.01, 3*M_PI/2, M_PI/2);
+    UnionSolid lay_tub1(envElTube,envTube1);
+
+    Tube envTube2(env_rmax, c0*env_rmax, env_z+0.01, 3*M_PI/2, M_PI/2);
+    SubtractionSolid lay_tub(lay_tub1,envTube2);
+    Volume     lay_vol   (lay_nam,lay_tub,air);         // Create the layer envelope volume.
+
+    /*************************************************************
+     FIRST-HALF
+     semi-elliptical, from 90 to 270 degrees
+    **************************************************************/
+    
+    double a            = c0 * rc;    // (mm) ellipse major radius
+    double b            = rc;         // (mm) ellipse minor radius
+    double theta        = 0.;
+    double thetaMin     = M_PI / 2.;
+    double thetaMax     = M_PI * 3. / 2.;
+    double deltaTheta   = 0.0001;
+    double numIntegrals = (thetaMax-thetaMin) / deltaTheta; 
+    double cell         = 0.;
+
+    // integrate over the elipse to get the circumference
+    for( int i=0; i < numIntegrals; i++ ) {
+        if (i==0) theta = thetaMin;
+        else theta += deltaTheta;
+        cell += computeDpt( a, b, theta);
+    }
+
+    // number of modules along semi-ellipse path
+    int    n_ell     = (cell * deltaTheta / mod_width); // - 1 ;  
+    int    nextPoint = 0;
+    double run       = 0.;
+    theta            = 0.;
+
+    for( int i=0; i < numIntegrals; i++ ) {
+        if (i==0) theta = thetaMin;
+        else theta += deltaTheta;
+        double subIntegral = n_ell*run/cell;
+        if( (int) subIntegral >= nextPoint ) {
+            double x = a * std::cos(theta);
+            double y = b * std::sin(theta);
+            // Loop over the number of modules in z.
+            for (int j = 0; j < nz; j++)  {
+            // Module PhysicalVolume.
+            Transform3D tr(RotationZYX(0,M_PI/2-theta,-M_PI/2),Position(x,y,module_z));
+            pv = lay_vol.placeVolume(m_env,tr);
+            pv.addPhysVolID("module", module++);
+            // Add z increment to get next z placement pos.
+            module_z += z_incr;
+            }
+            nextPoint++;
+        }
+        run += computeDpt(a, b, theta);
+    }
+
+    /*************************************************************
+     SECOND-HALF
+     semi-circular, from 270 to 90 degrees
+    **************************************************************/
+
+    // circle circumference
+    double c_circ       = 2 * M_PI * rc;
+    int    n_circ       = c_circ / mod_width / 2;  // number of modules for semi-circle
+    double phi_incr     = (M_PI) / n_circ;         // Phi increment for one module along semi-circle
+    
+    // Loop over the number of modules in phi.
+    
+    for (int ii = 0; ii < n_circ; ii++)    {
+        
+      double dx = z_dr * std::cos(phic + phi_tilt);        // Delta x of module position.
+      double dy = z_dr * std::sin(phic + phi_tilt);        // Delta y of module position.
+      double  x = rc * std::cos(phic);                     // Basic x module position.
+      double  y = rc * std::sin(phic);                     // Basic y module position.
+            
+      // Loop over the number of modules in z.
+      for (int j = 0; j < nz; j++)  {
+         // Module PhysicalVolume.
+         // Transform3D tr(RotationZYX(0,-((M_PI/2)-phic-phi_tilt),M_PI/2),Position(x,y,module_z));
+         //NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the outside
+         Transform3D tr(RotationZYX(0,((M_PI/2)-phic-phi_tilt),-M_PI/2),Position(x,y,module_z));
+         pv = lay_vol.placeVolume(m_env,tr);
+         pv.addPhysVolID("module", module++);
+         // Adjust the x and y coordinates of the module.
+         x += dx;
+         y += dy;
+         // Flip sign of x and y adjustments.
+         dx *= -1;
+         dy *= -1;
+         // Add z increment to get next z placement pos.
+         module_z += z_incr;
+      }
+      phic      += phi_incr; // Increment the phi placement of module.
+      rc        += rphi_dr;  // Increment the center radius according to dr parameter.
+      rphi_dr   *= -1;       // Flip sign of dr parameter.
+      module_z   = -z0;      // Reset the Z placement parameter for module.
+    }
+
+    // Create the PhysicalVolume for the layer.
+    assembly.setVisAttributes(description.invisible());
+    pv = assembly.placeVolume(lay_vol);     // Place layer in mother
+    pv.addPhysVolID("layer", lay_id);       // Set the layer ID.
+    DetElement m_elt(sdet,lay_nam,lay_id);
+    m_elt.setAttributes(description,lay_vol,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
+    m_elt.setPlacement(pv);
+  }
+
+  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
+  pv.addPhysVolID("system", det_id);      // Set the subdetector system ID.
+  pv.addPhysVolID("barrel", 0);           // Flag this as a barrel subdetector.
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_BP_SiVertexBarrel,create_detector)
diff --git a/examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp b/examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp
new file mode 100644
index 000000000..6dfa67de8
--- /dev/null
+++ b/examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp
@@ -0,0 +1,214 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+//  Author     : M.Frank
+//  Modified   : E.Pilicer ( tube + elliptical pipe layout )
+//             : P.Kostka   ( more refined version circ-ell )
+//
+//====================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/DD4hepUnits.h"
+#include "DD4hep/DetType.h"
+#include "DD4hep/Printout.h"
+
+#include "DDRec/DetectorData.h"
+#include "DDRec/Surface.h"
+
+#include "XML/Utilities.h"
+
+#include <cmath>
+#include <map>
+#include <string>
+
+using dd4hep::Transform3D;
+using dd4hep::Position;
+using dd4hep::RotationY;
+using dd4hep::RotateY;
+using dd4hep::ConeSegment;
+using dd4hep::SubtractionSolid;
+using dd4hep::Material;
+using dd4hep::Volume;
+using dd4hep::Solid;
+using dd4hep::Tube;
+namespace units = dd4hep;
+using dd4hep::rec::Vector3D;
+using dd4hep::rec::VolCylinder;
+using dd4hep::rec::VolCone;
+using dd4hep::rec::SurfaceType;
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+/// helper class for a simple cylinder surface parallel to z with a given length - used as IP layer
+class SimpleCylinderImpl : public  dd4hep::rec::VolCylinderImpl{
+  double _half_length ;
+public:
+  /// standard c'tor with all necessary arguments - origin is (0,0,0) if not given.
+  SimpleCylinderImpl( dd4hep::Volume vol, SurfaceType type,
+		      double thickness_inner ,double thickness_outer,  Vector3D origin ) :
+    dd4hep::rec::VolCylinderImpl( vol,  type, thickness_inner, thickness_outer,   origin ),
+    _half_length(0){
+  }
+  void setHalfLength( double half_length){
+    _half_length = half_length ;
+  }
+  void setID( dd4hep::long64 id ) { _id = id ;
+  }
+  // overwrite to include points inside the inner radius of the barrel
+  bool insideBounds(const Vector3D& point, double epsilon) const {
+    return ( std::abs( point.rho() - origin().rho() ) < epsilon && std::abs( point.z() ) < _half_length ) ;
+  }
+
+  virtual std::vector< std::pair<Vector3D, Vector3D> > getLines(unsigned nMax=100){
+
+    std::vector< std::pair<Vector3D, Vector3D> >  lines ;
+
+    lines.reserve( nMax ) ;
+
+    Vector3D zv( 0. , 0. , _half_length ) ;
+    double r = _o.rho() ;
+
+    unsigned n = nMax / 4 ;
+    double dPhi = 2.* ROOT::Math::Pi() / double( n ) ;
+
+    for( unsigned i = 0 ; i < n ; ++i ) {
+
+      Vector3D rv0(  r*sin(  i   *dPhi ) , r*cos(  i   *dPhi )  , 0. ) ;
+      Vector3D rv1(  r*sin( (i+1)*dPhi ) , r*cos( (i+1)*dPhi )  , 0. ) ;
+
+      Vector3D pl0 =  zv + rv0 ;
+      Vector3D pl1 =  zv + rv1 ;
+      Vector3D pl2 = -zv + rv1  ;
+      Vector3D pl3 = -zv + rv0 ;
+
+      lines.push_back( std::make_pair( pl0, pl1 ) ) ;
+      lines.push_back( std::make_pair( pl1, pl2 ) ) ;
+      lines.push_back( std::make_pair( pl2, pl3 ) ) ;
+      lines.push_back( std::make_pair( pl3, pl0 ) ) ;
+    }
+    return lines;
+  }
+};
+
+class SimpleCylinder : public dd4hep::rec::VolSurface{
+public:
+  SimpleCylinder( dd4hep::Volume vol, dd4hep::rec::SurfaceType type, double thickness_inner ,
+		  double thickness_outer,  Vector3D origin ) :
+    dd4hep::rec::VolSurface( new SimpleCylinderImpl( vol,  type,  thickness_inner , thickness_outer, origin ) ) {
+  }
+  SimpleCylinderImpl* operator->() { return static_cast<SimpleCylinderImpl*>( _surf ) ; }
+} ;
+
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  printout(dd4hep::DEBUG,"Lhe_Beampipe", "Creating Beampipe" ) ;
+  
+//  typedef vector<PlacedVolume> Placements;
+  xml_det_t  x_det = e;
+  string     name  = x_det.nameStr();
+  DetElement sdet (name,x_det.id());
+  Material   mat  (description.material(x_det.materialStr()));
+//  vector<double> rmin,rmax,z,thickness;
+  double rmin, rmax, thickness, z;
+//  PlacedVolume pv;
+
+// multiplication factor for ellipse major radius
+// rmin        ellipse short radius
+// rmax        ellipse long radius
+// thickness   BP thickness
+// z           z-length
+  rmax = 1.;
+  thickness = 1.;
+  rmin = 1.;
+
+  for(xml_coll_t c(e,_U(zplane)); c; ++c )   {
+    xml_comp_t dim(c);
+    rmin = dim.rmin();
+    rmax = dim.rmax();
+    thickness = dim.thickness();
+    z = dim.z();
+//    rmin.push_back(dim.rmin());
+//    rmax.push_back(dim.rmax());
+//    z.push_back(dim.z());
+//    thickness.push_back(dim.thickness());
+  }
+
+  double ra    = 1.;         // ellipse long radius init
+         ra    = rmax;       // ellipse long radius
+  double rb    = 1.;         // ellipse short radius init
+         rb    = rmin;       // ellipse short radius
+  double thick = 1.;  // BP thickness
+         thick = thickness;  // BP thickness
+ 
+  EllipticalTube bpElTubeOut(ra+thick, rb+thick, z);
+  EllipticalTube bpElTubeInn(ra, rb, z+thick);
+  SubtractionSolid bpElTube(bpElTubeOut,bpElTubeInn);
+
+  Tube bpTube1(rb, rb+thick, z+thick, 3*M_PI/2, M_PI/2);
+  UnionSolid beamTube1(bpElTube,bpTube1);
+
+  Tube bpTube2(rb+thick, ra+thick, z+thick, 3*M_PI/2, M_PI/2);
+  SubtractionSolid beamTube(beamTube1,bpTube2);
+  
+  Volume  det_vol(name, beamTube, mat);
+  PlacedVolume pv = description.pickMotherVolume(sdet).placeVolume(det_vol,Position(0,0,0));
+  
+  double z_offset = x_det.hasAttr(_U(z_offset)) ? x_det.z_offset() : 0.0;
+  bool    reflect = x_det.hasAttr(_U(reflect)) ? x_det.reflect() : false;
+
+if ( z_offset >= 0 ) {
+  if ( reflect) {
+   PlacedVolume pv = description.pickMotherVolume(sdet).placeVolume(det_vol,Position(0,0,0));
+   sdet.setPlacement(pv);
+   det_vol.setVisAttributes(description, x_det.visStr());
+   det_vol.setLimitSet(description, x_det.limitsStr());
+   det_vol.setRegion(description, x_det.regionStr());
+     if ( x_det.isSensitive() )   {
+    SensitiveDetector sd = sens;
+    xml_dim_t sd_typ = x_det.child(_U(sensitive));
+    det_vol.setSensitiveDetector(sens);
+    sd.setType(sd_typ.typeStr());
+    }
+   } else {
+   PlacedVolume pv = description.pickMotherVolume(sdet).placeVolume(det_vol,Position(0,0,z_offset));
+   sdet.setPlacement(pv);
+   det_vol.setVisAttributes(description, x_det.visStr());
+   det_vol.setLimitSet(description, x_det.limitsStr());
+   det_vol.setRegion(description, x_det.regionStr());
+     if ( x_det.isSensitive() )   {
+    SensitiveDetector sd = sens;
+    xml_dim_t sd_typ = x_det.child(_U(sensitive));
+    det_vol.setSensitiveDetector(sens);
+    sd.setType(sd_typ.typeStr());
+    }
+   }
+  } else {
+   PlacedVolume pv = description.pickMotherVolume(sdet).placeVolume(det_vol,Position(0,0,z_offset-z));
+   sdet.setPlacement(pv);
+   det_vol.setVisAttributes(description, x_det.visStr());
+   det_vol.setLimitSet(description, x_det.limitsStr());
+   det_vol.setRegion(description, x_det.regionStr());
+     if ( x_det.isSensitive() )   {
+    SensitiveDetector sd = sens;
+    xml_dim_t sd_typ = x_det.child(_U(sensitive));
+    det_vol.setSensitiveDetector(sens);
+    sd.setType(sd_typ.typeStr());
+    }
+  }
+ 
+  if ( x_det.hasAttr(_U(id)) )  {
+    int det_id = x_det.id();
+    pv.addPhysVolID("system",det_id);
+  }
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_BeamPipe_Central,create_detector)
+
diff --git a/examples/LHeD/src/Lhe_BoxSegment_geo.cpp b/examples/LHeD/src/Lhe_BoxSegment_geo.cpp
new file mode 100644
index 000000000..9a991e357
--- /dev/null
+++ b/examples/LHeD/src/Lhe_BoxSegment_geo.cpp
@@ -0,0 +1,53 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_element(Detector& description, xml_h e, Ref_t sens)  {
+  xml_det_t   x_det = e;
+  string      name  = x_det.nameStr();
+  xml_comp_t  box    (x_det.child(_U(box)));
+  xml_dim_t   pos    (x_det.child(_U(position)));
+  xml_dim_t   rot    (x_det.child(_U(rotation)));
+  Material    mat    (description.material(x_det.materialStr()));
+  DetElement  det    (name,x_det.id());
+  Volume      det_vol(name+"_vol",Box(box.x(),box.y(),box.z()), mat);
+  Volume      mother = description.pickMotherVolume(det);
+  Transform3D transform(Rotation3D(RotationZYX(rot.z(),rot.y(),rot.x())),Position(pos.x(),pos.y(),pos.z()));
+  PlacedVolume phv = mother.placeVolume(det_vol,transform);
+
+  det_vol.setVisAttributes(description, x_det.visStr());
+  det_vol.setLimitSet(description, x_det.limitsStr());
+  det_vol.setRegion(description, x_det.regionStr());
+  if ( x_det.isSensitive() )   {
+    SensitiveDetector sd = sens;
+    xml_dim_t sd_typ = x_det.child(_U(sensitive));
+    det_vol.setSensitiveDetector(sens);
+    sd.setType(sd_typ.typeStr());
+  }
+  if ( x_det.hasAttr(_U(id)) )  {
+    phv.addPhysVolID("system",x_det.id());
+  }
+  det.setPlacement(phv);
+  return det;
+}
+
+// first argument is the type from the xml file
+DECLARE_DETELEMENT(Lhe_BoxSegment,create_element)
diff --git a/examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp b/examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp
new file mode 100644
index 000000000..5d4ebc9fb
--- /dev/null
+++ b/examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp
@@ -0,0 +1,163 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : F.Gaede DESY
+//
+//==========================================================================
+
+#include <string>
+
+namespace { 
+  struct UserData { 
+    float length ;
+    float radius ;
+    float phi0 ;
+    int   symmetry ;
+    int   systemID ;
+    std::string encoding ;
+
+  }; 
+}
+
+// Framework include files
+#define SURFACEINSTALLER_DATA UserData
+#define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_CaloFaceBarrelSurfacePlugin
+#include "DD4hep/Printout.h"
+#include "DD4hep/SurfaceInstaller.h"
+#include "DDRec/DetectorData.h"
+#include "DDRec/Surface.h"
+#include "DDSegmentation/BitField64.h"
+
+namespace{
+  
+  /// helper class for a planar surface placed into a polyhedral calorimeter barrel 
+  class CaloBarrelPlaneImpl : public  dd4hep::rec::VolPlaneImpl   {
+    double _length, _width ;
+
+  public:
+    /// standard c'tor with all necessary arguments - origin is (0,0,0) if not given.
+    CaloBarrelPlaneImpl( dd4hep::rec::SurfaceType typ,
+                         double thickness_inner ,double thickness_outer, 
+                         dd4hep::rec::Vector3D u_val ,dd4hep::rec::Vector3D v_val ,
+                         dd4hep::rec::Vector3D n_val , dd4hep::rec::Vector3D o_val, 
+                         dd4hep::Volume vol, int id_val ) :
+      dd4hep::rec::VolPlaneImpl( typ, thickness_inner,thickness_outer, u_val, v_val, n_val, o_val, vol, id_val),
+      _length(0),_width(0) {}
+    
+    void setData( double length, double width){
+      _length = length ;
+      _width = width ;
+    }
+
+    void setID( dd4hep::long64 id_val ) { _id = id_val ; }
+    
+    // overwrite to include points inside the inner radius of the barrel 
+    bool insideBounds(const dd4hep::rec::Vector3D& point, double epsilon) const {
+      dd4hep::rec::Vector2D uvVec = globalToLocal( point ) ;
+      
+      return ( std::abs ( distance( point ) ) < epsilon )  &&  
+        std::abs( uvVec[0] ) < _width/2. &&  std::abs( uvVec[1] ) < _length/2. ; 
+    }
+    
+    /// create outer bounding lines for the given symmetry of the polyhedron
+    virtual std::vector< std::pair<dd4hep::rec::Vector3D, dd4hep::rec::Vector3D> > getLines(unsigned){
+      
+      std::vector< std::pair<dd4hep::rec::Vector3D, dd4hep::rec::Vector3D> >  lines ;
+      
+      lines.push_back( std::make_pair( origin()+_width/2.*u()+_length/2.*v(), origin()-_width/2.*u()+_length/2.*v() ) ) ;
+      lines.push_back( std::make_pair( origin()-_width/2.*u()+_length/2.*v(), origin()-_width/2.*u()-_length/2.*v() ) ) ;
+      lines.push_back( std::make_pair( origin()-_width/2.*u()-_length/2.*v(), origin()+_width/2.*u()-_length/2.*v() ) ) ;
+      lines.push_back( std::make_pair( origin()+_width/2.*u()-_length/2.*v(), origin()+_width/2.*u()+_length/2.*v() ) ) ;
+      
+      return lines; 
+    }
+  };
+  
+  typedef dd4hep::rec::VolSurfaceHandle<CaloBarrelPlaneImpl> CaloBarrelPlane ;
+
+  
+  template <> void Installer<UserData>::handle_arguments(int argc, char** argv)   {
+    for(int i=0; i<argc; ++i)  {
+      char* ptr = ::strchr(argv[i],'=');
+      if ( ptr )  {
+        std::string name( argv[i] , ptr ) ;
+        double value = dd4hep::_toDouble(++ptr);
+        
+        printout(dd4hep::DEBUG,"DD4hep_CaloFaceBarrelSurfacePlugin", "argument[%d] = %s = %f" , i, name.c_str() , value  ) ;
+
+        if(      name=="length"    ) data.length     = value ; 
+        else if( name=="radius"  ) data.radius   = value ; 
+        else if( name=="phi0"    ) data.phi0     = value ; 
+        else if( name=="symmetry") data.symmetry = value ; 
+        else if( name=="systemID") data.systemID   = value ; 
+        else if( name=="encoding") data.encoding = ptr ; 
+        else {
+          printout(dd4hep::WARNING,"DD4hep_CaloFaceBarrelSurfacePlugin", "unknown parameter:  %s ", name.c_str() ) ;
+        }
+      }
+    }
+  }  
+  
+  /// Install measurement surfaces
+  template <typename UserData> 
+    void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv)   {
+    
+    dd4hep::Volume comp_vol = pv.volume();
+    
+    double length   = data.length ;
+    double symmetry = data.symmetry ;
+    double radius   = data.radius ;
+    double phi0     = data.phi0 ;  
+
+    //    if( symmetry ) radius /= cos( M_PI / symmetry ) ; 
+    
+
+    double width = 2. * radius * tan( M_PI / symmetry ) ;
+
+    double inner_thickness = 1e-6 ;
+    double outer_thickness = 1e-6 ;
+    
+    printout(dd4hep::INFO,"DD4hep_CaloFaceBarrelSurfacePlugin", "install tracking surfaces for :  %s ", component.name() ) ;
+
+
+    dd4hep::DDSegmentation::BitField64 bf( "system:5,side:-2,layer:9,module:8,sensor:8" ) ;
+    // dd4hep::DDSegmentation::BitField64 bf( data.encoding ) ;
+
+    bf["system"] = data.systemID ;
+    
+
+    double alpha = ( symmetry ? 2.* M_PI / symmetry : 0. ) ;
+      
+    for(unsigned i=0 ; i < symmetry ; ++i){
+
+      bf["module"] =  i ; 
+
+      double gam = phi0 + alpha/2. + i*alpha;
+
+      dd4hep::rec::Vector3D 
+        u( cos(gam+M_PI/2.), sin(gam+M_PI/2.), 0. ),
+        v(          0.     ,        0.       , 1. ), 
+        n(        cos(gam) ,        sin(gam) , 0. ),
+        o( radius*cos(gam) , radius*sin(gam) , 0. );
+      
+      CaloBarrelPlane surf(comp_vol,Type(Type::Helper,Type::Sensitive), inner_thickness, outer_thickness, u, v, n, o);
+
+      surf->setData( length, width ) ;
+      surf->setID( bf.getValue() ) ;
+      
+      addSurface(component,surf);
+
+    }      
+
+    // stop scanning the hierarchy any further
+    stopScanning() ;
+  }
+  
+
+}// namespace
diff --git a/examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp b/examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp
new file mode 100644
index 000000000..e08eb5665
--- /dev/null
+++ b/examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp
@@ -0,0 +1,163 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : F.Gaede DESY
+//
+//==========================================================================
+
+#include <string>
+
+namespace { 
+  struct UserData { 
+    float zpos ;
+    float radius ;
+    float phi0 ;
+    int   symmetry ;
+    int   systemID ;
+    std::string encoding ;
+  }; 
+}
+
+// Framework include files
+#define SURFACEINSTALLER_DATA UserData
+#define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_CaloFaceEndcapSurfacePlugin
+#include "DD4hep/Printout.h"
+#include "DD4hep/SurfaceInstaller.h"
+#include "DDRec/DetectorData.h"
+#include "DDRec/Surface.h"
+#include "DDSegmentation/BitField64.h"
+
+namespace{
+  
+  /// helper class for a planar surface placed into a polyhedral calorimeter endcap 
+  class CaloEndcapPlaneImpl : public  dd4hep::rec::VolPlaneImpl{
+    double  _r ;
+    double  _phi0 ;
+    unsigned _sym ;
+  public:
+    /// standard c'tor with all necessary arguments - origin is (0,0,0) if not given.
+    CaloEndcapPlaneImpl( dd4hep::rec::SurfaceType typ,
+                         double thickness_inner ,double thickness_outer, 
+                         dd4hep::rec::Vector3D u_val ,dd4hep::rec::Vector3D v_val ,
+                         dd4hep::rec::Vector3D n_val , dd4hep::rec::Vector3D o_val, 
+                         dd4hep::Volume vol, int id_val ) :
+      dd4hep::rec::VolPlaneImpl( typ, thickness_inner,thickness_outer, u_val, v_val, n_val, o_val, vol, id_val),
+      _r(0),_phi0(0),_sym(0) {}
+    
+    void setData( double radius, double phi0, unsigned symmetry){
+      _r = radius ;
+      _phi0 = phi0 ;
+      _sym = symmetry ;
+    }
+    void setID( dd4hep::long64 id_val ) { _id = id_val; }
+    
+    // overwrite to include points inside the inner radius of the endcap 
+    bool insideBounds(const dd4hep::rec::Vector3D& point, double epsilon) const {
+      
+      double ri = _r * cos(  2.* M_PI / _sym ) ;
+      
+      return ( std::abs ( distance( point ) ) < epsilon )  && 
+        ( (point.rho() < ri ) || 
+          ( volume()->GetShape()->Contains( const_cast<double*> (point.const_array() ) ) ) ) ;
+    }
+
+    /// create outer bounding lines for the given symmetry of the polyhedron
+    virtual std::vector< std::pair<dd4hep::rec::Vector3D, dd4hep::rec::Vector3D> > getLines(unsigned){
+      
+      std::vector< std::pair<dd4hep::rec::Vector3D, dd4hep::rec::Vector3D> >  lines ;
+      
+      double alpha = ( _sym ? 2.* M_PI / _sym : 0. ) ;
+      
+      for(unsigned i=0 ; i < _sym ; ++i){
+        double gam0 =    i  * alpha + _phi0 ;
+        double gam1 = (i+1) * alpha + _phi0 ;
+        lines.push_back( std::make_pair( dd4hep::rec::Vector3D( _r*cos(gam0), _r*sin(gam0), origin().z()  ), 
+                                         dd4hep::rec::Vector3D( _r*cos(gam1), _r*sin(gam1), origin().z()  ) ) ) ;
+      }
+      return lines; 
+    }
+  };
+  
+  typedef dd4hep::rec::VolSurfaceHandle<CaloEndcapPlaneImpl> CaloEndcapPlane ;
+
+  
+  template <> void Installer<UserData>::handle_arguments(int argc, char** argv)   {
+    for(int i=0; i<argc; ++i)  {
+      char* ptr = ::strchr(argv[i],'=');
+      if ( ptr )  {
+        std::string name( argv[i] , ptr ) ;
+        double value = dd4hep::_toDouble(++ptr);
+        
+	printout(dd4hep::DEBUG,"DD4hep_CaloFaceEndcapSurfacePlugin", "argument[%d] = %s = %f" , i, name.c_str() , value  ) ;
+
+        if(      name=="zpos"    ) data.zpos     = value ; 
+        else if( name=="radius"  ) data.radius   = value ; 
+        else if( name=="phi0"    ) data.phi0     = value ; 
+        else if( name=="symmetry") data.symmetry = value ; 
+        else if( name=="systemID") data.systemID   = value ; 
+        else if( name=="encoding") data.encoding = ptr ; 
+        else {
+	  printout(dd4hep::WARNING,"DD4hep_CaloFaceEndcapSurfacePlugin", "unknown parameter:  %s ", name.c_str() ) ;
+        }
+      }
+    }
+  }  
+  
+  /// Install measurement surfaces
+  template <typename UserData> 
+    void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv)   {
+    
+    dd4hep::Volume comp_vol = pv.volume();
+    
+
+    double zpos     = data.zpos ;
+    double symmetry = data.symmetry ;
+    double radius   = data.radius ;
+    double phi0     = data.phi0 ;  
+
+    if( symmetry ) radius /= cos( M_PI / symmetry ) ; 
+    
+
+    double inner_thickness = 1e-6 ;
+    double outer_thickness = 1e-6 ;
+    
+    printout(dd4hep::INFO,"DD4hep_CaloFaceEndcapSurfacePlugin", "install tracking surfaces for :  %s ", component.name() ) ;
+
+
+    dd4hep::DDSegmentation::BitField64 bf( "system:5,side:-2,layer:9,module:8,sensor:8" ) ;
+    //dd4hep::DDSegmentation::BitField64 bf( data.encoding ) ;
+
+    bf["system"] = data.systemID ;
+    bf["side"]   =  1 ; 
+    
+
+    // shift position of origin of helper plane to pick up Air instead of vacuum 
+    dd4hep::rec::Vector3D u(1.,0.,0.), v(0.,1.,0.), n(0.,0.,1.), o(0., 0.5*radius , zpos );
+    
+    CaloEndcapPlane surf_pz(comp_vol,Type(Type::Helper,Type::Sensitive), inner_thickness, outer_thickness, u, v, n, o);
+
+    surf_pz->setData( radius, phi0, symmetry ) ;
+    surf_pz->setID( bf.getValue() ) ;
+
+    addSurface(component,surf_pz);
+
+    CaloEndcapPlane surf_nz(comp_vol,Type(Type::Helper,Type::Sensitive), inner_thickness, outer_thickness, u, v, n, -1*o );
+
+    bf["side"]   =  -1 ; 
+    surf_nz->setData( radius, phi0, symmetry ) ;
+    surf_nz->setID( bf.getValue() ) ;
+
+    addSurface(component,surf_nz);
+
+    // stop scanning the hierarchy any further
+    stopScanning() ;
+  }
+  
+
+}// namespace
diff --git a/examples/LHeD/src/Lhe_CylinderShell_geo.cpp b/examples/LHeD/src/Lhe_CylinderShell_geo.cpp
new file mode 100644
index 000000000..5ec54f2ef
--- /dev/null
+++ b/examples/LHeD/src/Lhe_CylinderShell_geo.cpp
@@ -0,0 +1,85 @@
+//====================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------
+//
+//  Generic cylindric shell detector to be used to measure 
+//  e.g. escape energy from calorimeters.
+//
+//  Author     : M.Frank
+//
+//====================================================================
+
+/*
+  Example XML:
+
+  <detector id="2" name="ContainmentShell" type="ZylinderShell" vis="VisibleRed" readout="ContainmentHits" >
+      <comment>Containment shell to measure calorimeter escapes</comment>
+      <material name="Air"/>
+      <module name="Barrel" id="0" vis="VisibleRed">
+        <zplane rmin="HcalBarrel_rmax+20*cm" rmax="HcalBarrel_rmax+22*cm" z="-2*HcalBarrel_zmax"/>
+        <zplane rmin="HcalBarrel_rmax+20*cm" rmax="HcalBarrel_rmax+22*cm" z="2*HcalBarrel_zmax"/>
+      </module>
+      <module name="SideA" id="1" vis="VisibleRed">
+        <zplane rmin="0" rmax="HcalBarrel_rmax+22*cm" z="2*HcalBarrel_zmax+10*cm"/>
+        <zplane rmin="0" rmax="HcalBarrel_rmax+22*cm" z="2*HcalBarrel_zmax+20*cm"/>
+      </module>
+      <module name="SideB" id="2" vis="VisibleRed">
+        <zplane rmin="0" rmax="HcalBarrel_rmax+22*cm" z="-(2*HcalBarrel_zmax+10*cm)"/>
+        <zplane rmin="0" rmax="HcalBarrel_rmax+22*cm" z="-(2*HcalBarrel_zmax+20*cm)"/>
+      </module>
+    </detector>
+  </detectors>
+
+to be joined by a sensitive detector:
+  <readouts>
+    <readout name="ContainmentHits">
+      <id>system:8,barrel:3</id>
+    </readout>
+  </readouts>
+
+
+*/
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sensitive)  {
+  xml_det_t  x_det   = e;
+  string     name    = x_det.nameStr();
+  DetElement sdet   (name,x_det.id());
+  Assembly   assembly(name+"_assembly");
+  Material   mat    (description.material(x_det.materialStr()));
+  PlacedVolume pv;
+
+  sensitive.setType("escape_counter");
+  for(xml_coll_t xm(e,_U(module)); xm; ++xm)  {
+    xml_comp_t mod = xm;
+    vector<double> rmin,rmax,z;
+    string vis = mod.visStr().empty() ? x_det.visStr() : mod.visStr();
+    int num = 0;
+    for(xml_coll_t c(mod,_U(zplane)); c; ++c, ++num)  {
+      xml_comp_t dim(c);
+      rmin.push_back(dim.rmin());
+      rmax.push_back(dim.rmax());
+      z.push_back(dim.z()/2);
+    }
+    if ( num < 2 )  {
+      throw runtime_error("ZylinderShell["+name+"]> Not enough Z planes. minimum is 2!");
+    }
+    Polycone   cone  (0.,2*M_PI,rmin,rmax,z);
+    Volume     volume(name, cone, mat);
+    volume.setVisAttributes(description, vis);
+    volume.setSensitiveDetector(sensitive);
+    pv = assembly.placeVolume(volume);
+    pv.addPhysVolID("barrel",mod.id());
+  }
+
+  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
+  pv.addPhysVolID("system",x_det.id());
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_CylinderShell,create_detector)
diff --git a/examples/LHeD/src/Lhe_CylindricalBarrelCalorimeter_geo.cpp b/examples/LHeD/src/Lhe_CylindricalBarrelCalorimeter_geo.cpp
new file mode 100644
index 000000000..1894a76db
--- /dev/null
+++ b/examples/LHeD/src/Lhe_CylindricalBarrelCalorimeter_geo.cpp
@@ -0,0 +1,79 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)   {
+  xml_det_t  x_det     = e;
+  xml_dim_t  dim       = x_det.dimensions();
+  Material   air       = description.air();
+  string     det_name  = x_det.nameStr();
+  DetElement sdet       (det_name,x_det.id());
+  double     z         = dim.outer_z();
+  double     rmin      = dim.inner_r();
+  double     r         = rmin;
+  int        n         = 0;
+  Tube       envelope(rmin,2*rmin,2*z);
+  Volume     envelopeVol(det_name+"_envelope",envelope,air);
+    
+  for(xml_coll_t c(x_det,_U(layer)); c; ++c)  {
+    xml_comp_t x_layer = c;
+    for(int i=0, im=0, repeat=x_layer.repeat(); i<repeat; ++i, im=0)  {
+      string layer_name = det_name + _toString(n,"_layer%d");
+      double rlayer = r;
+      Tube   layer_tub(rmin,rlayer,2*z);
+      Volume layer_vol(layer_name,layer_tub,air);
+        
+      for(xml_coll_t l(x_layer,_U(slice)); l; ++l, ++im)  {
+        xml_comp_t x_slice = l;
+        double     router = r + x_slice.thickness();
+        Material   slice_mat  = description.material(x_slice.materialStr());
+        string     slice_name = layer_name + _toString(im,"slice%d");
+        Tube       slice_tube(r,router,z*2);
+        Volume     slice_vol (slice_name,slice_tube,slice_mat);
+          
+        if ( x_slice.isSensitive() ) {
+          sens.setType("calorimeter");
+          slice_vol.setSensitiveDetector(sens);
+        }
+        r = router;
+        slice_vol.setAttributes(description,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+        // Instantiate physical volume
+        layer_vol.placeVolume(slice_vol);
+      }
+      layer_vol.setVisAttributes(description,x_layer.visStr());
+      layer_tub.setDimensions(rlayer,r,z*2,0,2*M_PI);
+        
+      PlacedVolume layer_physvol = envelopeVol.placeVolume(layer_vol);
+      layer_physvol.addPhysVolID("layer",n);
+      ++n;
+    }
+  }
+  envelope.setDimensions(rmin,r,2*z);
+  // Set region of slice
+  envelopeVol.setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+    
+  PlacedVolume physvol = description.pickMotherVolume(sdet).placeVolume(envelopeVol);
+  physvol.addPhysVolID("system",sdet.id()).addPhysVolID(_U(barrel),0);
+  sdet.setPlacement(physvol);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_CylindricalBarrelCalorimeter,create_detector)
diff --git a/examples/LHeD/src/Lhe_CylindricalEndcapCalorimeter_geo.cpp b/examples/LHeD/src/Lhe_CylindricalEndcapCalorimeter_geo.cpp
new file mode 100644
index 000000000..4655a1c23
--- /dev/null
+++ b/examples/LHeD/src/Lhe_CylindricalEndcapCalorimeter_geo.cpp
@@ -0,0 +1,103 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/Printout.h"
+#include "XML/Layering.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t  x_det     = e;
+  xml_dim_t  dim       = x_det.dimensions();
+  Material   air       = description.air();
+  string     det_name  = x_det.nameStr();
+  bool       reflect   = x_det.reflect();
+  double     zmin      = dim.inner_z();
+  double     rmin      = dim.inner_r();
+  double     rmax      = dim.outer_r();
+  double     totWidth  = Layering(x_det).totalThickness();
+  double     z         = zmin;
+  Tube       envelope   (rmin,rmax,totWidth/2);
+  Volume     envelopeVol(det_name+"_envelope",envelope,air);
+  int        layer_num = 1;
+  PlacedVolume pv;
+
+  // Set attributes of slice
+  for(xml_coll_t c(x_det,_U(layer)); c; ++c)  {
+    xml_comp_t x_layer = c;
+    double layerWidth = 0;
+    for(xml_coll_t l(x_layer,_U(slice)); l; ++l)
+      layerWidth += xml_comp_t(l).thickness();
+    for(int i=0, im=0, repeat=x_layer.repeat(); i<repeat; ++i)  {
+      double     zlayer = z;
+      string     layer_name = det_name + _toString(layer_num,"_layer%d");
+      Volume     layer_vol(layer_name,Tube(rmin,rmax,layerWidth),air);
+
+      for(xml_coll_t l(x_layer,_U(slice)); l; ++l, ++im)  {
+        xml_comp_t x_slice = l;
+        double     w = x_slice.thickness();
+        string     slice_name = layer_name + _toString(m+1,"slice%d");
+        Material   slice_mat  = description.material(x_slice.materialStr());
+        Volume     slice_vol (slice_name,Tube(rmin,rmax,w),slice_mat);
+
+        if ( x_slice.isSensitive() )  {
+          sens.setType("calorimeter");
+          slice_vol.setSensitiveDetector(sens);
+        }
+        slice_vol.setAttributes(description,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+        pv = layer_vol.placeVolume(slice_vol,Position(0,0,z-zlayer-layerWidth/2+w/2));
+        pv.addPhysVolID("slice",m+1);
+        z += w;
+      }
+      layer_vol.setVisAttributes(description,x_layer.visStr());
+
+      Position layer_pos(0,0,zlayer-zmin-totWidth/2+layerWidth/2);
+      pv = envelopeVol.placeVolume(layer_vol,layer_pos);
+      pv.addPhysVolID("layer",layer_num);
+      printout(DEBUG,"Calo","CylindricalEndcapCalorimeter: built layer %d -> %s",layer_num,layer_name.c_str());
+      ++layer_num;
+    }
+  }
+  envelope.setDimensions(rmin,rmax,totWidth/2);
+  // Set attributes of slice
+  envelopeVol.setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+
+  DetElement   sdet(det_name,x_det.id());
+  Assembly     assembly(det_name+"_assembly");
+  Volume       motherVol = description.pickMotherVolume(sdet);
+  PlacedVolume phv = motherVol.placeVolume(assembly);
+  phv.addPhysVolID("system",sdet.id());
+  sdet.setPlacement(phv);
+
+  DetElement   sdetA(sdet,det_name+(reflect ? "_A" : ""),x_det.id());
+  phv = assembly.placeVolume(envelopeVol,Position(0,0,zmin+totWidth/2));
+  phv.addPhysVolID("barrel",1);
+  sdetA.setPlacement(phv);
+
+  if ( reflect )   {
+    phv=assembly.placeVolume(envelopeVol,Transform3D(RotationZ(M_PI),Position(0,0,-zmin-totWidth/2)));
+    phv.addPhysVolID("barrel",2);
+    /// Create the detector element for the opposite side....
+    DetElement   sdetB(sdet,det_name+"_B",x_det.id());
+    sdetB.setPlacement(phv);
+  }
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_CylindricalEndcapCalorimeter,create_detector)
diff --git a/examples/LHeD/src/Lhe_DiskTracker_geo.cpp b/examples/LHeD/src/Lhe_DiskTracker_geo.cpp
new file mode 100644
index 000000000..f53a175be
--- /dev/null
+++ b/examples/LHeD/src/Lhe_DiskTracker_geo.cpp
@@ -0,0 +1,87 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t  x_det     = e;
+  Material   air       = description.air();
+  string     det_name  = x_det.nameStr();
+  bool       reflect   = x_det.reflect();
+  DetElement sdet(det_name,x_det.id());
+  Assembly   assembly(det_name);
+  PlacedVolume pv;
+  int l_num = 0;
+    
+  for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++l_num)  {
+    xml_comp_t x_layer = i;
+    string l_nam = det_name+_toString(l_num,"_layer%d");
+    double  zmin = x_layer.inner_z();
+    double  rmin = x_layer.inner_r();
+    double  rmax = x_layer.outer_r();
+    double  z    = zmin, layerWidth = 0.;
+    int     s_num = 0;
+      
+    for(xml_coll_t j(x_layer,_U(slice)); j; ++j)  {
+      double thickness = xml_comp_t(j).thickness();
+      layerWidth += thickness;
+    }
+    Tube    l_tub(rmin,rmax,layerWidth,2*M_PI);
+    Volume  l_vol(l_nam,l_tub,air);
+    l_vol.setVisAttributes(description,x_layer.visStr());
+    for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++s_num)  {
+      xml_comp_t x_slice = j;
+      double thick = x_slice.thickness();
+      Material mat = description.material(x_slice.materialStr());
+      string s_nam = l_nam+_toString(s_num,"_slice%d");
+      Volume s_vol(s_nam, Tube(rmin,rmax,thick), mat);
+        
+      if ( x_slice.isSensitive() ) {
+        sens.setType("tracker");
+        s_vol.setSensitiveDetector(sens);
+      }
+      s_vol.setAttributes(description,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+      pv = l_vol.placeVolume(s_vol,Position(0,0,z-zmin-layerWidth/2+thick/2));
+      pv.addPhysVolID("slice",s_num);
+    }
+
+    DetElement layer(sdet,l_nam+"_pos",l_num);
+    pv = assembly.placeVolume(l_vol,Position(0,0,zmin+layerWidth/2.));
+    pv.addPhysVolID("layer",l_num);
+    pv.addPhysVolID("barrel",1);
+    layer.setPlacement(pv);
+    if ( reflect )  {
+      pv = assembly.placeVolume(l_vol,Transform3D(RotationY(M_PI),Position(0,0,-zmin-layerWidth/2)));
+      pv.addPhysVolID("layer",l_num);
+      pv.addPhysVolID("barrel",2);
+      DetElement layerR = layer.clone(l_nam+"_neg");
+      sdet.add(layerR.setPlacement(pv));
+    }
+  }
+  if ( x_det.hasAttr(_U(combineHits)) ) {
+    sdet.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
+  }
+  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
+  pv.addPhysVolID("system", x_det.id());      // Set the subdetector system ID.
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_DiskTracker,create_detector)
diff --git a/examples/LHeD/src/Lhe_EcalBarrel_geo.cpp b/examples/LHeD/src/Lhe_EcalBarrel_geo.cpp
new file mode 100644
index 000000000..1a5cd61f7
--- /dev/null
+++ b/examples/LHeD/src/Lhe_EcalBarrel_geo.cpp
@@ -0,0 +1,167 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+//  mod.:        P.Kostka LHeD
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "XML/Layering.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  static double tolerance = 0e0;
+  Layering      layering (e);
+  xml_det_t     x_det     = e;
+  Material      air       = description.air();
+  int           det_id    = x_det.id();
+  string        det_name  = x_det.nameStr();
+  xml_comp_t    x_staves  = x_det.staves();
+  xml_comp_t    x_dim     = x_det.dimensions();
+  int           nsides    = x_dim.numsides();
+  double        inner_r   = x_dim.rmin();
+  double        dphi      = (2*M_PI/nsides);
+  double        hphi      = dphi/2;
+  double        mod_z     = layering.totalThickness();
+  double        outer_r   = inner_r + mod_z;
+  double        totThick  = mod_z;
+  DetElement    sdet      (det_name,det_id);
+  Volume        motherVol = description.pickMotherVolume(sdet);
+  double z_offset = x_dim.hasAttr(_U(z_offset)) ? x_dim.z_offset() : 0.0; 
+  PolyhedraRegular hedra  (nsides,inner_r,inner_r+totThick+tolerance*2e0,x_dim.z());
+  Volume        envelope  (det_name,hedra,air);
+  PlacedVolume  env_phv   = motherVol.placeVolume(envelope,Transform3D (RotationZ(M_PI / nsides), Translation3D(0, 0, z_offset)) );
+  
+  env_phv.addPhysVolID("system",det_id);
+  env_phv.addPhysVolID("barrel",0);
+  sdet.setPlacement(env_phv);
+
+  DetElement    stave_det("stave0",det_id);
+  double dx = 0.0; //mod_z / std::sin(dphi); // dx per layer
+    
+  // Compute the top and bottom face measurements.
+  double trd_x2 = (2 * std::tan(hphi) * outer_r - dx)/2 - tolerance;
+  double trd_x1 = (2 * std::tan(hphi) * inner_r + dx)/2 - tolerance;
+  double trd_y1 = x_dim.z()/2 - tolerance;
+  double trd_y2 = trd_y1;
+  double trd_z  = mod_z/2 - tolerance;
+		
+  // Create the trapezoid for the stave.
+  Trapezoid trd(trd_x1, // Outer side, i.e. the "short" X side.
+                trd_x2, // Inner side, i.e. the "long"  X side.
+                trd_y1, // Corresponds to subdetector (or module) Z.
+                trd_y2, //
+                trd_z); // Thickness, in Y for top stave, when rotated.
+
+  Volume mod_vol("stave",trd,air);
+
+  sens.setType("calorimeter");
+  { // =====  buildBarrelStave(description, sens, module_volume) =====
+    // Parameters for computing the layer X dimension:
+    double stave_z  = trd_y1/2;
+    double l_dim_x  = trd_x1/2;                            // Starting X dimension for the layer.
+    double adj      = (l_dim_x-trd_x2/2)/2;                // Adjacent angle of triangle.
+    double hyp      = std::sqrt(trd_z*trd_z/4 + adj*adj);  // Hypotenuse of triangle.
+    double beta     = std::acos(adj / hyp);                // Lower-right angle of triangle.
+    double tan_beta = std::tan(beta);                      // Primary coefficient for figuring X.
+    double l_pos_z  = -(layering.totalThickness() / 2);
+
+    // Loop over the sets of layer elements in the detector.
+    int l_num = 1;
+    for(xml_coll_t li(x_det,_U(layer)); li; ++li)  {
+      xml_comp_t x_layer = li;
+      int repeat = x_layer.repeat();
+      // Loop over number of repeats for this layer.
+      for (int j=0; j<repeat; j++)    {
+        string l_name = _toString(l_num,"layer%d");
+        double l_thickness = layering.layer(l_num-1)->thickness();  // Layer's thickness.
+        double xcut = (l_thickness / tan_beta);                     // X dimension for this layer.
+        l_dim_x -= xcut/2;
+
+        Position   l_pos(0,0,l_pos_z+l_thickness/2);      // Position of the layer.
+        Box        l_box(l_dim_x*2-tolerance,stave_z*2-tolerance,l_thickness-tolerance);
+        Volume     l_vol(l_name,l_box,air);
+        DetElement layer(stave_det, l_name, det_id);
+
+        // Loop over the sublayers or slices for this layer.
+        int s_num = 1;
+        double s_pos_z = -(l_thickness / 2);
+        for(xml_coll_t si(x_layer,_U(slice)); si; ++si)  {
+          xml_comp_t x_slice = si;
+          string     s_name  = _toString(s_num,"slice%d");
+          double     s_thick = x_slice.thickness();
+          Box        s_box(l_dim_x*2-tolerance,stave_z*2-tolerance,s_thick-tolerance);
+          Volume     s_vol(s_name,s_box,description.material(x_slice.materialStr()));
+          DetElement slice(layer,s_name,det_id);
+
+          if ( x_slice.isSensitive() ) {
+            s_vol.setSensitiveDetector(sens);
+          }
+          slice.setAttributes(description,s_vol,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+
+          // Slice placement.
+          PlacedVolume slice_phv = l_vol.placeVolume(s_vol,Position(0,0,s_pos_z+s_thick/2));
+          slice_phv.addPhysVolID("slice", s_num);
+          slice.setPlacement(slice_phv);
+          // Increment Z position of slice.
+          s_pos_z += s_thick;
+                                        
+          // Increment slice number.
+          ++s_num;
+        }        
+
+        // Set region, limitset, and vis of layer.
+        layer.setAttributes(description,l_vol,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
+
+        PlacedVolume layer_phv = mod_vol.placeVolume(l_vol,l_pos);
+        layer_phv.addPhysVolID("layer", l_num);
+        layer.setPlacement(layer_phv);
+        // Increment to next layer Z position.
+        l_pos_z += l_thickness;          
+        ++l_num;
+      }
+    }
+  }
+
+  // Set stave visualization.
+  if ( x_staves )   {
+    mod_vol.setVisAttributes(description.visAttributes(x_staves.visStr()));
+  }
+  // Phi start for a stave.
+  double phi = M_PI / nsides;
+  double mod_x_off = dx / 2;             // Stave X offset, derived from the dx.
+  double mod_y_off = inner_r + mod_z/2;  // Stave Y offset
+
+  // Create nsides staves.
+  for (int i = 0; i < nsides; i++, phi -= dphi)      { // i is module number
+    // Compute the stave position
+    double m_pos_x = mod_x_off * std::cos(phi) - mod_y_off * std::sin(phi);
+    double m_pos_y = mod_x_off * std::sin(phi) + mod_y_off * std::cos(phi);
+    Transform3D tr(RotationZYX(0,phi,M_PI*0.5),Translation3D(-m_pos_x,-m_pos_y,0));
+    PlacedVolume pv = envelope.placeVolume(mod_vol,tr);
+    pv.addPhysVolID("system",det_id);
+    pv.addPhysVolID("barrel",0);
+    pv.addPhysVolID("module",i+1);
+    DetElement sd = i==0 ? stave_det : stave_det.clone(_toString(i,"stave%d"));
+    sd.setPlacement(pv);
+    sdet.add(sd);
+  }
+
+  // Set envelope volume attributes.
+  envelope.setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_EcalBarrel,create_detector)
diff --git a/examples/LHeD/src/Lhe_ForwardDetector_geo.cpp b/examples/LHeD/src/Lhe_ForwardDetector_geo.cpp
new file mode 100644
index 000000000..cfafaa027
--- /dev/null
+++ b/examples/LHeD/src/Lhe_ForwardDetector_geo.cpp
@@ -0,0 +1,197 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "XML/Layering.h"
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t   x_det      = e;
+  xml_dim_t   dim        = x_det.dimensions();
+  bool        reflect    = x_det.reflect();
+  xml_comp_t  beam       = x_det.beampipe();
+  string      det_name   = x_det.nameStr();
+  int         id         = x_det.id();
+  Material    air        = description.air();
+  DetElement  sdet       (det_name,id);
+  Layering    layering   (x_det);
+
+  Volume      motherVol  = description.pickMotherVolume(sdet);
+
+  double      rmax       = dim.outer_r();
+  double      rmin       = dim.inner_r();
+  double      zinner     = dim.inner_z();
+  double      outgoingR  = beam.outgoing_r();
+  double      incomingR  = beam.incoming_r();
+  double      xangle     = beam.crossing_angle();
+  double      xangleHalf = xangle/2;
+  double      thickness  = layering.totalThickness();
+  double      zpos       = zinner + thickness/2;
+  // Beampipe position in envelope.
+  double      beamPosX   = std::tan(xangleHalf) * zpos;
+
+  // Detector envelope solid. 
+  Tube envelopeTube(rmin,rmax,thickness/2);
+
+  // First envelope bool subtracion of outgoing beampipe.
+  // Incoming beampipe solid.
+  Tube beamInTube(0,outgoingR,thickness);
+  // Position of incoming beampipe.
+  Position beamInPos(beamPosX,0,0);
+  /// Rotation of incoming beampipe.
+  Rotation3D  beamInRot(RotationY(1.*xangleHalf));
+  Transform3D beamInTrans(beamInRot,beamInPos);
+
+  // Second envelope bool subtracion of outgoing beampipe.
+  // Outgoing beampipe solid.
+  Tube     beamOutTube(0,incomingR,thickness);
+  // Position of outgoing beampipe.
+  Position beamOutPos(-beamPosX,0,0);
+  // Rotation of outgoing beampipe.
+  Rotation3D  beamOutRot(RotationY(-xangleHalf));
+  Transform3D beamOutTrans(beamOutRot,beamOutPos);
+
+  // First envelope bool subtraction of incoming beampipe.
+  SubtractionSolid envelopeSubtraction1(envelopeTube,beamInTube,beamInTrans);
+  SubtractionSolid envelopeSubtraction2(envelopeSubtraction1,beamOutTube,beamOutTrans);
+
+  // Final envelope bool volume.
+  Volume envelopeVol(det_name+"_envelope", envelopeSubtraction2, air);
+
+  // Process each layer element.
+  double layerPosZ   = -thickness / 2;
+  double layerDisplZ = 0;
+
+  int layerCount = 1;
+  for(xml_coll_t c(x_det,_U(layer)); c; ++c)  {
+    xml_comp_t x_layer = c;
+    double layerThickness = layering.singleLayerThickness(x_layer);
+
+    // Create tube envelope for this layer, which can be reused in bool definition
+    // in the repeat loop below.
+    Tube layerTube(rmin,rmax,layerThickness);
+
+    for(int i=0, repeat=x_layer.repeat(); i<repeat; ++i)  {
+      string layer_nam = _toString(layerCount,"layer%d");
+      // Increment to new layer position.
+      layerDisplZ += layerThickness / 2;
+      layerPosZ   += layerThickness / 2;
+
+      // First layer subtraction solid.
+      DetElement  layer(sdet,layer_nam,sdet.id());
+      double      layerGlobalZ = zinner + layerDisplZ;
+      double      layerPosX    = std::tan(xangleHalf) * layerGlobalZ;
+      Position    layer1SubPos( layerPosX,0,0);
+      Position    layer2SubPos(-layerPosX,0,0);
+
+      SubtractionSolid layerSubtraction1(layerTube,beamInTube,Transform3D(beamInRot,layer1SubPos));
+      // Second layer subtraction solid.
+      SubtractionSolid layerSubtraction2(layerSubtraction1,beamOutTube,Transform3D(beamOutRot,layer2SubPos));
+      // Layer LV.
+      Volume layerVol(det_name+"_"+layer_nam,layerSubtraction2,air);
+      
+      // Slice loop.
+      int sliceCount = 1;
+      double slicePosZ = -layerThickness / 2;
+      double sliceDisplZ = 0;
+      for(xml_coll_t l(x_layer,_U(slice)); l; ++l)  {
+        xml_comp_t x_slice = l;
+        string slice_nam = _toString(sliceCount,"slice%d");
+        /** Get slice parameters. */
+        double sliceThickness = x_slice.thickness();
+        Material slice_mat = description.material(x_slice.materialStr());
+
+        // Go to mid of this slice.
+        sliceDisplZ += sliceThickness / 2;
+        slicePosZ   += sliceThickness / 2;
+
+        // Slice's basic tube.
+        Tube sliceTube(rmin,rmax,sliceThickness);
+        DetElement slice(layer,slice_nam,sdet.id());
+        double sliceGlobalZ = zinner + (layerDisplZ - layerThickness / 2) + sliceDisplZ;
+        double slicePosX    = std::tan(xangleHalf) * sliceGlobalZ;
+
+        // First slice subtraction solid.
+        SubtractionSolid sliceSubtraction1(sliceTube,beamInTube,Transform3D(beamInRot,Position(slicePosX,0,0)));
+        // Second slice subtraction solid.
+        SubtractionSolid sliceSubtraction2(sliceSubtraction1,beamOutTube,Transform3D(beamOutRot,Position(-slicePosX,0,0))); 
+        // Slice LV.
+        Volume sliceVol(det_name+"_"+layer_nam+"_"+slice_nam, sliceSubtraction2, slice_mat);
+
+        if ( x_slice.isSensitive() ) {
+          sens.setType("calorimeter");
+          sliceVol.setSensitiveDetector(sens);
+        }
+        // Set attributes of slice
+        slice.setAttributes(description, sliceVol, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
+
+        // Place volume in layer
+        PlacedVolume pv = layerVol.placeVolume(sliceVol,Position(0,0,slicePosZ));
+        pv.addPhysVolID("slice",sliceCount);
+        slice.setPlacement(pv);
+
+        // Start of next slice.
+        sliceDisplZ += sliceThickness / 2;
+        slicePosZ   += sliceThickness / 2;
+        ++sliceCount;
+      }
+      // Set attributes of slice
+      layer.setAttributes(description, layerVol, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr());
+
+      // Layer PV.
+      PlacedVolume layerPV = envelopeVol.placeVolume(layerVol,Position(0,0,layerPosZ));
+      layerPV.addPhysVolID("layer", layerCount);
+      layer.setPlacement(layerPV);
+
+      // Increment to start of next layer.
+      layerDisplZ += layerThickness / 2;
+      layerPosZ   += layerThickness / 2;
+      ++layerCount;
+    }
+  }
+  sdet.setVisAttributes(description, x_det.visStr(), envelopeVol);
+  
+  // Reflect it.
+  if ( reflect )  {
+    Assembly assembly(det_name+"_assembly");
+    PlacedVolume pv = motherVol.placeVolume(assembly);
+    pv.addPhysVolID("system", id);
+    sdet.setPlacement(pv);
+
+    DetElement   sdetA(sdet,det_name+"_A",x_det.id());
+    pv = assembly.placeVolume(envelopeVol,Transform3D(RotationZ(M_PI),Position(0,0,zpos)));
+    pv.addPhysVolID("barrel", 1);
+    sdetA.setPlacement(pv);
+
+    DetElement   sdetB = sdetA.clone(det_name+"_B",x_det.id());
+    sdet.add(sdetB);
+    pv = assembly.placeVolume(envelopeVol,Transform3D(RotationY(M_PI),Position(0,0,-zpos)));
+    pv.addPhysVolID("barrel", 2);
+    sdetB.setPlacement(pv);
+  }
+  else  {
+    PlacedVolume pv = motherVol.placeVolume(envelopeVol,Transform3D(RotationZ(M_PI),Position(0,0,zpos)));
+    pv.addPhysVolID("system", id);
+    pv.addPhysVolID("barrel", 1);
+    sdet.setPlacement(pv);
+  }
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_ForwardDetector,create_detector)
diff --git a/examples/LHeD/src/Lhe_GenericSurfaceInstaller.cpp b/examples/LHeD/src/Lhe_GenericSurfaceInstaller.cpp
new file mode 100644
index 000000000..f9ed3dbe6
--- /dev/null
+++ b/examples/LHeD/src/Lhe_GenericSurfaceInstaller.cpp
@@ -0,0 +1,181 @@
+//==========================================================================
+//  Surface installer plugin for generic sliced detector drivers
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : N. Nikiforou, adapted from dd4hep/SiTrackerBarrel_surfaces.cpp
+//              by M. Frank. Originally part of the lcgeo package
+//==========================================================================
+
+/** \addtogroup SurfacePlugin
+ * @{
+ * \package dd4hep_GenericSurfaceInstallerPlugin
+ * \brief Plugin to install measurement surfaces on a generic sliced detector
+ * 
+ * Takes up to 13 arguments:
+ * - \c dimension: A property of the surface that determines whether the resulting
+ *   measurement is 1-D, e.g. strips (\c dimension=1) or 2-D, e.g. pixels (\c dimension=2).
+ * - \c u_x, \c u_y, and \c u_z: The x, y, and z components of the u vector, usually associated
+ *   with the "good" (i.e. best resolution) measurement direction.
+ * - \c v_x, \c v_y, and \c v_z: The x, y, and z components of the v vector, usually associated
+ *   with the "bad" (i.e. worst resolution) measurement direction.
+ * - \c n_x, \c n_y, and \c n_z: The x, y, and z components of the vector perpendicular to the surface
+ *   plane and usually pointing outwards of the detector. 
+ * - \c o_x, \c o_y, and \c o_z: The x, y, and z components of the origin vector, used to shift the origin
+ *   of the surface from where it is placed within the volume (usually in the center
+ *   of a sensitive volume.
+ * 
+ * All the arguments are conveniently initialized to zero by default, 
+ * therefore only the non-zero components need to be provided. For example, to use this
+ * plugin for the VertexEndcap detector, put this snippet in the relevant compact file:
+ * \verbatim 
+<plugins>
+      <plugin name="DD4hep_GenericSurfaceInstallerPlugin">
+          <argument value="VertexEndcap"/>
+          <argument value="dimension=2"/>
+          <argument value="u_x=-1."/>
+          <argument value="v_z=1."/>
+          <argument value="n_y=1."/>
+      </plugin>
+</plugins>
+\endverbatim
+ * The plugin assumes boxes are stacked along one of the primary axes, x,y or z 
+ * The normal vector (n) must be along one of the axes (i.e. only one non-zero 
+ * component). The inner/outer thicknesses are calculated according to n.
+ * 
+ * Note: Assumes module and component volumes are boxes. For Trapezoids,
+ * a fitting box is built around the trapezoid which means dx1=dx2=dx1 and
+ * dy1=dy2=dy. This is in principle fine, since we only access the thicknesses
+ * (DY in the TrackerEncapSurfacePlugin example) which is supposed to be the same.
+ *
+ * For more information, please consult with GenericSurfaceInstaller.cpp
+ * @}
+ */
+
+namespace { 
+    struct UserData { 
+        int dimension ;
+        double uvector[3];
+        double vvector[3];
+        double nvector[3];
+        double ovector[3];
+        
+    }; 
+    
+}
+
+// Framework include files
+#define SURFACEINSTALLER_DATA UserData
+#define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_GenericSurfaceInstallerPlugin
+#include "DD4hep/SurfaceInstaller.h"
+
+namespace{
+    template <> void Installer<UserData>::handle_arguments(int argc, char** argv)   {
+
+        //Initialize defaults to zero
+        data.dimension=0;
+        data.uvector[0]=0.;
+        data.uvector[1]=0.;
+        data.uvector[2]=0.;
+        data.vvector[0]=0.;
+        data.vvector[1]=0.;
+        data.vvector[2]=0.;
+        data.nvector[0]=0.;
+        data.nvector[1]=0.;
+        data.nvector[2]=0.;
+        data.ovector[0]=0.;
+        data.ovector[1]=0.;
+        data.ovector[2]=0.;
+        
+        for(int i=0; i<argc; ++i)  {
+            double value = -1;
+            char* ptr = ::strchr(argv[i],'=');
+            if ( ptr )  {
+                std::string name( argv[i] , ptr ) ;
+                value = dd4hep::_toDouble(++ptr);
+                std::cout << "DD4hep_GenericSurfaceInstallerPlugin: argument[" << i << "] = " << name 
+                << " = " << value << std::endl;
+                if( name=="dimension" ) data.dimension = value ; 
+                if( name=="u_x" ) data.uvector[0]=value ; 
+                if( name=="u_y" ) data.uvector[1]=value ; 
+                if( name=="u_z" ) data.uvector[2]=value ; 
+                if( name=="v_x" ) data.vvector[0]=value ; 
+                if( name=="v_y" ) data.vvector[1]=value ; 
+                if( name=="v_z" ) data.vvector[2]=value ; 
+                if( name=="n_x" ) data.nvector[0]=value ; 
+                if( name=="n_y" ) data.nvector[1]=value ; 
+                if( name=="n_z" ) data.nvector[2]=value ; 
+                if( name=="o_x" ) data.ovector[0]=value ; 
+                if( name=="o_y" ) data.ovector[1]=value ; 
+                if( name=="o_z" ) data.ovector[2]=value ; 
+            }
+        }
+    
+        std::cout <<"DD4hep_GenericSurfaceInstallerPlugin: vectors: ";
+        std::cout <<"u( "<<data.uvector[0]<<" , "<<data.uvector[1]<<" , "<<data.uvector[2]<<") ";
+        std::cout <<"v( "<<data.vvector[0]<<" , "<<data.vvector[1]<<" , "<<data.vvector[2]<<") ";
+        std::cout <<"n( "<<data.nvector[0]<<" , "<<data.nvector[1]<<" , "<<data.nvector[2]<<") ";
+        std::cout <<"o( "<<data.ovector[0]<<" , "<<data.ovector[1]<<" , "<<data.ovector[2]<<") "<<std::endl;
+    
+    }  
+    
+    /// Install measurement surfaces
+    template <typename UserData> 
+      void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv)   {
+        dd4hep::Volume comp_vol = pv.volume();
+        if ( comp_vol.isSensitive() )  {  
+            dd4hep::Volume mod_vol  = parentVolume(component);
+            //FIXME: WHAT IF TRAPEZOID? Should work if trapezoid since it will fit minimal box and dy1=dy2=dy
+            dd4hep::Box mod_shape(mod_vol.solid()), comp_shape(comp_vol.solid());
+            
+            if ( !comp_shape.isValid() || !mod_shape.isValid() )   {
+                invalidInstaller("DD4hep_GenericSurfaceInstallerPlugin: Components and/or modules are not boxes -- invalid shapes");
+
+            }else if ( !handleUsingCache(component,comp_vol) )  {
+                const double* trans = placementTranslation(component);
+                double half_module_thickness = 0.;
+                double sensitive_z_position  = 0.;
+
+                if (data.nvector[0] !=0 && data.nvector[1] ==0 && data.nvector[2] ==0){
+                    half_module_thickness = mod_shape->GetDX();
+                    sensitive_z_position = data.nvector[0]>0 ? trans[0] : -trans[0];
+                }else if (data.nvector[1] !=0 && data.nvector[0] ==0 && data.nvector[2] ==0){
+                    half_module_thickness = mod_shape->GetDY();
+                    sensitive_z_position = data.nvector[1]>0 ? trans[1] : -trans[1];
+
+                }else if (data.nvector[2] !=0 && data.nvector[0] ==0 && data.nvector[1] ==0){
+                    half_module_thickness = mod_shape->GetDZ();
+                    sensitive_z_position = data.nvector[2]>0 ? trans[2] : -trans[2];
+
+                } else {
+                    throw std::runtime_error("**** dd4hep_GenericSurfaceInstallerPlugin: normal vector unsupported! It has to be "
+                    "perpenidcular to one of the box sides, i.e. only one non-zero component.") ;
+                }
+
+                double inner_thickness = half_module_thickness + sensitive_z_position;
+                double outer_thickness = half_module_thickness - sensitive_z_position;
+
+                //Surface is placed at the center of the volume, no need to shift origin
+                //Make sure u,v,n form a right-handed coordinate system, v along the final z
+                Vector3D u(data.uvector[0],data.uvector[1],data.uvector[2]);
+                Vector3D v(data.vvector[0],data.vvector[1],data.vvector[2]);
+                Vector3D n(data.nvector[0],data.nvector[1],data.nvector[2]);
+                Vector3D o(data.ovector[0],data.ovector[1],data.ovector[2]);
+                Type type( Type::Sensitive ) ;
+                
+                if( data.dimension == 1 ) {
+                    type.setProperty( Type::Measurement1D , true ) ;
+                } else if( data.dimension != 2 ) {
+                    throw std::runtime_error("**** dd4hep_GenericSurfaceInstallerPlugin: no or wrong "
+                    "'dimension' argument given - has to be 1 or 2") ;
+                }
+                VolPlane surf(comp_vol, type, inner_thickness, outer_thickness, u, v, n, o);
+                addSurface(component,surf);
+            }
+        }
+    }
+}// namespace
diff --git a/examples/LHeD/src/Lhe_MultiLayerTracker_geo.cpp b/examples/LHeD/src/Lhe_MultiLayerTracker_geo.cpp
new file mode 100644
index 000000000..e32382a99
--- /dev/null
+++ b/examples/LHeD/src/Lhe_MultiLayerTracker_geo.cpp
@@ -0,0 +1,84 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//
+//  mod.:        P.Kostka LHeD (asymmetrical detector placement in z)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "XML/Layering.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t  x_det     = e;
+  string     det_name  = x_det.nameStr();
+  Material   air       = description.air();
+  DetElement sdet        (det_name,x_det.id());
+  Assembly   assembly    (det_name+"_assembly");
+  PlacedVolume pv;
+  int n = 0;
+
+  for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++n)  {
+    xml_comp_t x_layer = i;
+    string  l_name = det_name+_toString(n,"_layer%d");
+    double  z    = x_layer.outer_z();
+    double  rmin = x_layer.inner_r();
+    double  r    = rmin;
+    DetElement layer(sdet,_toString(n,"layer%d"),x_layer.id());
+    Tube    l_tub (rmin,2*rmin,z);
+    Volume  l_vol(l_name,l_tub,air);
+    int im = 0;
+
+    for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++im)  {
+      xml_comp_t x_slice = j;
+      Material mat = description.material(x_slice.materialStr());
+      string s_name= l_name+_toString(im,"_slice%d");
+      double thickness = x_slice.thickness();
+      Tube   s_tub(r,r+thickness,z,2*M_PI);
+      Volume s_vol(s_name, s_tub, mat);
+
+      r += thickness;
+      if ( x_slice.isSensitive() ) {
+        sens.setType("tracker");
+        s_vol.setSensitiveDetector(sens);
+      }
+      // Set Attributes
+      s_vol.setAttributes(description,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+      pv = l_vol.placeVolume(s_vol);
+      // Slices have no extra id. Take the ID of the layer!
+      pv.addPhysVolID("slice",im);
+    }
+    l_tub.setDimensions(rmin,r,z);
+    //cout << l_name << " " << rmin << " " << r << " " << z << endl;
+    l_vol.setVisAttributes(description,x_layer.visStr());
+    
+    double z_offset = x_layer.hasAttr(_U(z_offset)) ? x_layer.z_offset() : 0.0;
+    pv = assembly.placeVolume(l_vol,Position(0,0,z_offset));
+    pv.addPhysVolID("layer",n);
+    layer.setPlacement(pv);
+  }
+  if ( x_det.hasAttr(_U(combineHits)) ) {
+    sdet.setCombineHits(x_det.combineHits(),sens);
+  }
+
+  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
+  pv.addPhysVolID("system",sdet.id()).addPhysVolID("barrel",0);
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_MultiLayerTracker,create_detector)
diff --git a/examples/LHeD/src/Lhe_PolyconeSupport_geo.cpp b/examples/LHeD/src/Lhe_PolyconeSupport_geo.cpp
new file mode 100644
index 000000000..abf4c373b
--- /dev/null
+++ b/examples/LHeD/src/Lhe_PolyconeSupport_geo.cpp
@@ -0,0 +1,65 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//  mod.:        P.Kostka LHeD (asymmetrical detector placement in z)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, Ref_t sens)  {
+  xml_det_t  x_det = e;
+  string     name  = x_det.nameStr();
+  DetElement sdet (name,x_det.id());
+  Material   mat  (description.material(x_det.materialStr()));
+  vector<double> rmin,rmax,z;
+  int num = 0;
+
+  for(xml_coll_t c(e,_U(zplane)); c; ++c, ++num)  {
+    xml_comp_t dim(c);
+    rmin.push_back(dim.rmin());
+    rmax.push_back(dim.rmax());
+    z.push_back(dim.z()); //Dropped division by 2 in z. Half length not needed
+  }
+  if ( num < 2 )  {
+    throw runtime_error("PolyCone["+name+"]> Not enough Z planes. minimum is 2!");
+  }
+  Polycone   cone  (0,2*M_PI,rmin,rmax,z);
+  Volume     det_vol(name, cone, mat);
+  double z_offset = x_det.hasAttr(_U(z_offset)) ? x_det.z_offset() : 0.0;
+    PlacedVolume pv = description.pickMotherVolume(sdet).placeVolume(det_vol,Position(0,0,z_offset));
+
+  sdet.setPlacement(pv);
+  det_vol.setVisAttributes(description, x_det.visStr());
+  det_vol.setLimitSet(description, x_det.limitsStr());
+  det_vol.setRegion(description, x_det.regionStr());
+  if ( x_det.isSensitive() )   {
+    SensitiveDetector sd = sens;
+    xml_dim_t sd_typ = x_det.child(_U(sensitive));
+    det_vol.setSensitiveDetector(sens);
+    sd.setType(sd_typ.typeStr());
+  }
+
+  if ( x_det.hasAttr(_U(id)) )  {
+    int det_id = x_det.id();
+    pv.addPhysVolID("system",det_id);
+  }
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_PolyconeSupport,create_detector)
diff --git a/examples/LHeD/src/Lhe_PolyhedraBarrelCalorimeter2_geo.cpp b/examples/LHeD/src/Lhe_PolyhedraBarrelCalorimeter2_geo.cpp
new file mode 100644
index 000000000..36a4b9912
--- /dev/null
+++ b/examples/LHeD/src/Lhe_PolyhedraBarrelCalorimeter2_geo.cpp
@@ -0,0 +1,187 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "XML/Layering.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static void placeStaves(DetElement& parent, DetElement& stave, double rmin, int numsides, double total_thickness,
+                        Volume envelopeVolume, double innerAngle, Volume sectVolume) {
+  double innerRotation = innerAngle;
+  double offsetRotation = -innerRotation / 2;
+  double sectCenterRadius = rmin + total_thickness / 2;
+  double rotX = M_PI / 2;
+  double rotY = -offsetRotation;
+  double posX = -sectCenterRadius * std::sin(rotY);
+  double posY = sectCenterRadius * std::cos(rotY);
+
+  for (int module = 1; module <= numsides; ++module) {
+    DetElement det = module > 1 ? stave.clone(_toString(module,"stave%d")) : stave;
+    Transform3D trafo(RotationZYX(0, rotY, rotX), Translation3D(-posX, -posY, 0));
+    PlacedVolume pv = envelopeVolume.placeVolume(sectVolume,trafo);
+    // Not a valid volID: pv.addPhysVolID("stave", 0);
+    pv.addPhysVolID("module", module);
+    det.setPlacement(pv);
+    parent.add(det);
+    rotY -= innerRotation;
+    posX = -sectCenterRadius * std::sin(rotY);
+    posY = sectCenterRadius * std::cos(rotY);
+  }
+}
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) {
+  xml_det_t x_det = e;
+  Layering layering(x_det);
+  xml_comp_t staves = x_det.staves();
+  xml_dim_t dim = x_det.dimensions();
+  string det_name = x_det.nameStr();
+  Material air = description.air();
+  double totalThickness = layering.totalThickness();
+  double gap = xml_dim_t(x_det).gap();
+  int numSides = dim.numsides();
+  double detZ = dim.z();
+  double rmin = dim.rmin();
+  DetElement sdet(det_name, x_det.id());
+  DetElement stave("stave1", x_det.id());
+  Volume motherVol = description.pickMotherVolume(sdet);
+
+#if 0
+  int totalRepeat = 0;
+  int totalSlices = 0;
+  for (xml_coll_t c(x_det, _U(layer)); c; ++c) {
+    xml_comp_t x_layer = c;
+    int repeat = x_layer.repeat();
+    totalRepeat += repeat;
+    totalSlices += x_layer.numChildren(_U(slice));
+  }
+#endif
+  PolyhedraRegular polyhedra(numSides, rmin, rmin + totalThickness, detZ);
+  Volume envelopeVol(det_name, polyhedra, air);
+
+  // Add the subdetector envelope to the structure.
+  double innerAngle = 2 * M_PI / numSides;
+  double halfInnerAngle = innerAngle / 2;
+  double tan_inner = std::tan(halfInnerAngle) * 2;
+  double innerFaceLen = rmin * tan_inner;
+  double outerFaceLen = (rmin + totalThickness) * tan_inner;
+  double staveThickness = totalThickness;
+
+  Trapezoid staveTrdOuter(innerFaceLen / 2, outerFaceLen / 2, detZ / 2, detZ / 2, staveThickness / 2);
+  Volume staveOuterVol("stave_outer", staveTrdOuter, air);
+
+  Trapezoid staveTrdInner(innerFaceLen / 2 - gap, outerFaceLen / 2 - gap, detZ / 2, detZ / 2, staveThickness / 2);
+  Volume staveInnerVol("stave_inner", staveTrdInner, air);
+
+  double layerOuterAngle = (M_PI - innerAngle) / 2;
+  double layerInnerAngle = (M_PI / 2 - layerOuterAngle);
+  double layer_pos_z = -(staveThickness / 2);
+  double layer_dim_x = innerFaceLen / 2 - gap * 2;
+  int layer_num = 1;
+
+  //#### LayeringExtensionImpl* layeringExtension = new LayeringExtensionImpl();
+  //#### Position layerNormal(0,0,1);
+
+  for (xml_coll_t xc(x_det, _U(layer)); xc; ++xc) {
+    xml_comp_t x_layer = xc;
+    int repeat = x_layer.repeat();            // Get number of times to repeat this layer.
+    const Layer* lay = layering.layer(layer_num - 1); // Get the layer from the layering engine.
+    // Loop over repeats for this layer.
+    for (int j = 0; j < repeat; j++) {
+      string layer_name = _toString(layer_num, "layer%d");
+      double layer_thickness = lay->thickness();
+      DetElement layer(stave, layer_name, layer_num);
+      //### layeringExtension->setLayer(layer_num, layer, layerNormal);
+
+      // Layer position in Z within the stave.
+      layer_pos_z += layer_thickness / 2;
+      // Layer box & volume
+      Volume layer_vol(layer_name, Box(layer_dim_x, detZ / 2, layer_thickness / 2), air);
+
+      // Create the slices (sublayers) within the layer.
+      double slice_pos_z = -(layer_thickness / 2);
+      int slice_number = 1;
+      for (xml_coll_t xk(x_layer, _U(slice)); xk; ++xk) {
+        xml_comp_t x_slice = xk;
+        string slice_name = _toString(slice_number, "slice%d");
+        double slice_thickness = x_slice.thickness();
+        Material slice_material = description.material(x_slice.materialStr());
+        DetElement slice(layer, slice_name, slice_number);
+
+        slice_pos_z += slice_thickness / 2;
+        // Slice volume & box
+        Volume slice_vol(slice_name, Box(layer_dim_x, detZ / 2, slice_thickness / 2), slice_material);
+
+        if (x_slice.isSensitive()) {
+          sens.setType("calorimeter");
+          slice_vol.setSensitiveDetector(sens);
+        }
+        // Set region, limitset, and vis.
+        slice_vol.setAttributes(description, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
+        // slice PlacedVolume
+        PlacedVolume slice_phv = layer_vol.placeVolume(slice_vol, Position(0, 0, slice_pos_z));
+        slice_phv.addPhysVolID("slice", slice_number);
+
+        slice.setPlacement(slice_phv);
+        // Increment Z position for next slice.
+        slice_pos_z += slice_thickness / 2;
+        // Increment slice number.
+        ++slice_number;
+      }
+      // Set region, limitset, and vis.
+      layer_vol.setAttributes(description, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr());
+
+      // Layer physical volume.
+      PlacedVolume layer_phv = staveInnerVol.placeVolume(layer_vol, Position(0, 0, layer_pos_z));
+      layer_phv.addPhysVolID("layer", layer_num);
+      layer.setPlacement(layer_phv);
+
+      // Increment the layer X dimension.
+      layer_dim_x += layer_thickness * std::tan(layerInnerAngle);    // * 2;
+      // Increment the layer Z position.
+      layer_pos_z += layer_thickness / 2;
+      // Increment the layer number.
+      ++layer_num;
+    }
+  }
+
+  // Add stave inner physical volume to outer stave volume.
+  staveOuterVol.placeVolume(staveInnerVol);
+  if ( staves )  {
+    // Set the vis attributes of the outer stave section.
+    stave.setVisAttributes(description, staves.visStr(), staveInnerVol);
+    stave.setVisAttributes(description, staves.visStr(), staveOuterVol);
+  }
+  // Place the staves.
+  placeStaves(sdet, stave, rmin, numSides, totalThickness, envelopeVol, innerAngle, staveOuterVol);
+  // Set envelope volume attributes.
+  envelopeVol.setAttributes(description, x_det.regionStr(), x_det.limitsStr(), x_det.visStr());
+
+  double z_offset = dim.hasAttr(_U(z_offset)) ? dim.z_offset() : 0.0;
+  Transform3D transform(RotationZ(M_PI / numSides), Translation3D(0, 0, z_offset));
+  PlacedVolume env_phv = motherVol.placeVolume(envelopeVol, transform);
+  env_phv.addPhysVolID("system", sdet.id());
+  env_phv.addPhysVolID("barrel", 0);
+  sdet.setPlacement(env_phv);
+
+  //#### sdet.addExtension<SubdetectorExtension>(new SubdetectorExtensionImpl(sdet));
+  //#### sdet.addExtension<LayeringExtension>(layeringExtension);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_PolyhedraBarrelCalorimeter2,create_detector)
diff --git a/examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_geo.cpp b/examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_geo.cpp
new file mode 100644
index 000000000..70d0db5ea
--- /dev/null
+++ b/examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_geo.cpp
@@ -0,0 +1,143 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//
+//  mod.:        P.Kostka LHeD (asymmetrical detector placement in z)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "XML/Layering.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t   x_det     = e;
+  xml_dim_t   dim       = x_det.dimensions();
+  int         det_id    = x_det.id();
+  bool        reflect   = x_det.reflect(true);
+  string      det_name  = x_det.nameStr();
+  Material    air       = description.air();
+  int         numsides  = dim.numsides();
+  double      rmin      = dim.rmin();
+  double      rmax      = dim.rmax()*std::cos(M_PI/numsides);
+  double      zmin      = dim.zmin();
+  double      z_offset  = dim.hasAttr(_U(z_offset)) ? dim.z_offset() : 0.0;
+  Layering    layering(x_det);
+  double      totalThickness = layering.totalThickness();
+  Volume      endcapVol("endcap",PolyhedraRegular(numsides,rmin,rmax,totalThickness+z_offset),air);
+  DetElement  endcap("endcap",det_id);
+
+  int l_num = 1;
+  int layerType   = 0;
+  double layerZ   = -totalThickness/2;
+
+  endcapVol.setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+
+  for(xml_coll_t xc(x_det,_U(layer)); xc; ++xc)  {
+    xml_comp_t       x_layer  = xc;
+    double           l_thick  = layering.layer(l_num-1)->thickness();
+    string           l_name   = _toString(layerType,"layer%d");
+    int              l_repeat = x_layer.repeat();
+    Volume           l_vol(l_name,PolyhedraRegular(numsides,rmin,rmax,l_thick),air);
+    vector<PlacedVolume> sensitives;
+
+    int s_num = 1;
+    double sliceZ = -l_thick/2;
+    for(xml_coll_t xs(x_layer,_U(slice)); xs; ++xs)  {
+      xml_comp_t x_slice = xs;
+      string     s_name  = _toString(s_num,"slice%d");
+      double     s_thick = x_slice.thickness();
+      Material   s_mat   = description.material(x_slice.materialStr());
+      Volume     s_vol(s_name,PolyhedraRegular(numsides,rmin,rmax,s_thick),s_mat);
+        
+      s_vol.setVisAttributes(description.visAttributes(x_slice.visStr()));
+      sliceZ += s_thick/2;
+      PlacedVolume s_phv = l_vol.placeVolume(s_vol,Position(0,0,sliceZ));
+      s_phv.addPhysVolID("slice",s_num);
+      if ( x_slice.isSensitive() )  {
+        sens.setType("calorimeter");
+        s_vol.setSensitiveDetector(sens);
+        sensitives.push_back(s_phv);
+      }
+      sliceZ += s_thick/2;
+      s_num++;
+    }
+    l_vol.setVisAttributes(description.visAttributes(x_layer.visStr()));
+    if ( l_repeat <= 0 ) throw std::runtime_error(x_det.nameStr()+"> Invalid repeat value");
+    for(int j=0; j<l_repeat; ++j) {
+      string phys_lay = _toString(l_num,"layer%d");
+      layerZ += l_thick/2;
+      DetElement    layer_elt(endcap, phys_lay, l_num);
+      PlacedVolume  pv = endcapVol.placeVolume(l_vol,Position(0,0,layerZ));
+      pv.addPhysVolID("layer", l_num);
+      layer_elt.setPlacement(pv);
+      for(size_t ic=0; ic<sensitives.size(); ++ic)  {
+        PlacedVolume sens_pv = sensitives[ic];
+        DetElement comp_elt(layer_elt,sens_pv.volume().name(),l_num);
+        comp_elt.setPlacement(sens_pv);
+      }
+      layerZ += l_thick/2;
+      ++l_num;
+    }
+    ++layerType;
+  }
+
+  double z_pos = zmin+totalThickness/2;
+  PlacedVolume pv;
+  // Reflect it.
+  if ( reflect )  {
+    Assembly    assembly(det_name);
+    DetElement  both_endcaps(det_name,det_id);
+    Volume      motherVol = description.pickMotherVolume(both_endcaps);
+    DetElement  sdetA = endcap;
+    Ref_t(sdetA)->SetName((det_name+"_A").c_str());
+    DetElement  sdetB = endcap.clone(det_name+"_B",x_det.id());
+
+    pv = assembly.placeVolume(endcapVol,Transform3D(RotationZYX(M_PI/numsides,0,0),
+                                                    Position(0,0,z_pos)));
+    pv.addPhysVolID("barrel", 1);
+    sdetA.setPlacement(pv);
+
+    pv = assembly.placeVolume(endcapVol,Transform3D(RotationZYX(M_PI/numsides,M_PI,0),
+                                                    Position(0,0,-z_pos)));
+    pv.addPhysVolID("barrel", 2);
+    sdetB.setPlacement(pv);
+
+    pv = motherVol.placeVolume(assembly);
+    pv.addPhysVolID("system", det_id);
+    both_endcaps.setPlacement(pv);
+    both_endcaps.add(sdetA);
+    both_endcaps.add(sdetB);
+    return both_endcaps;
+  }
+  else  {
+    Volume motherVol = description.pickMotherVolume(endcap);
+         pv = motherVol.placeVolume(endcapVol,Transform3D(RotationZYX(M_PI/numsides,0,0),
+                                                   Position(0,0,z_pos)));
+  pv.addPhysVolID("system", det_id);
+      if ( z_pos >= 0) { 
+         pv.addPhysVolID("barrel", 1);
+      }
+       else {
+         pv.addPhysVolID("barrel", 2);
+      }
+  endcap.setPlacement(pv);
+  Ref_t(endcap)->SetName(det_name.c_str());
+  return endcap;
+  }
+}
+
+DECLARE_DETELEMENT(Lhe_PolyhedraEndcapCalorimeter2,create_detector)
diff --git a/examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_surfaces.cpp b/examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_surfaces.cpp
new file mode 100644
index 000000000..d6ea22b67
--- /dev/null
+++ b/examples/LHeD/src/Lhe_PolyhedraEndcapCalorimeter2_surfaces.cpp
@@ -0,0 +1,54 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+// Framework include files
+#define  DD4HEP_USE_SURFACEINSTALL_HELPER  Lhe_PolyhedraEndcapCalorimeterSurfacePlugin
+#include "DD4hep/SurfaceInstaller.h"
+
+/// Install measurement surfaces
+template <typename UserData> 
+void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv)   {
+  dd4hep::Volume comp_vol = pv.volume();
+  if ( comp_vol.isSensitive() )  {  
+    dd4hep::Volume mod_vol = parentVolume(component);
+    dd4hep::PolyhedraRegular comp_shape(comp_vol.solid()), mod_shape(mod_vol.solid());
+
+    if ( !comp_shape.isValid() || !mod_shape.isValid() )   {
+      invalidInstaller("Components and/or modules are not Trapezoid -- invalid shapes");
+    }
+    else if ( !handleUsingCache(component,comp_vol) )  {
+      dd4hep::DetElement par = component.parent();
+      const TGeoHMatrix& m = par.nominal().worldTransformation();
+      double dz = m.GetTranslation()[2];
+      const double* trans = placementTranslation(component);
+      double half_mod_thickness  = (mod_shape->GetZ(1)-mod_shape->GetZ(0))/2.0;
+      double half_comp_thickness = (comp_shape->GetZ(1)-comp_shape->GetZ(0))/2.0;
+      double si_position         = trans[2]+half_mod_thickness;
+      double outer_thickness = half_mod_thickness - si_position;
+      double inner_thickness = half_mod_thickness + si_position;
+      Vector3D u(1.,0.,0.), v(0.,1.,0.), n(0.,0.,1.), o(100.,100.,0.);
+      std::cout << " Module:    " << mod_shape.toString() << std::endl;
+      std::cout << " Component: " << comp_shape.toString() << std::endl;
+      std::cout << "dz:" << dz << " Si-pos:" << si_position 
+                << " Mod-thickness:" << half_mod_thickness 
+                << " Comp-thickness:" << half_comp_thickness 
+                << std::endl;
+      VolPlane surf(comp_vol,Type(Type::Sensitive,Type::Measurement1D),
+                    inner_thickness, outer_thickness, u, v, n, o);
+      addSurface(component,surf);
+    }
+  }
+}
diff --git a/examples/LHeD/src/Lhe_SiTrackerBarrel_geo.cpp b/examples/LHeD/src/Lhe_SiTrackerBarrel_geo.cpp
new file mode 100644
index 000000000..4239b7a24
--- /dev/null
+++ b/examples/LHeD/src/Lhe_SiTrackerBarrel_geo.cpp
@@ -0,0 +1,170 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/Printout.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  typedef vector<PlacedVolume> Placements;
+  xml_det_t   x_det     = e;
+  Material    air       = description.air();
+  int         det_id    = x_det.id();
+  string      det_name  = x_det.nameStr();
+  DetElement  sdet       (det_name,det_id);
+  Assembly    assembly   (det_name);
+  map<string, Volume>    volumes;
+  map<string, Placements>  sensitives;
+  PlacedVolume pv;
+
+  sens.setType("tracker");
+  for(xml_coll_t mi(x_det,_U(module)); mi; ++mi)  {
+    xml_comp_t x_mod  = mi;
+    xml_comp_t m_env  = x_mod.child(_U(module_envelope));
+    string     m_nam  = x_mod.nameStr();
+    Volume     m_vol(m_nam,Box(m_env.width()/2,m_env.length()/2,m_env.thickness()/2),air);
+    int        ncomponents = 0, sensor_number = 1;
+
+    if ( volumes.find(m_nam) != volumes.end() )   {
+      printout(ERROR,"SiTrackerBarrel","Logics error in building modules.");
+      throw runtime_error("Logics error in building modules.");
+    }
+    volumes[m_nam] = m_vol;
+    m_vol.setVisAttributes(description.visAttributes(x_mod.visStr()));
+    for(xml_coll_t ci(x_mod,_U(module_component)); ci; ++ci, ++ncomponents)  {
+      xml_comp_t x_comp = ci;
+      xml_comp_t x_pos  = x_comp.position(false);
+      xml_comp_t x_rot  = x_comp.rotation(false);        
+      string     c_nam  = _toString(ncomponents,"component%d");
+      Box        c_box(x_comp.width()/2,x_comp.length()/2,x_comp.thickness()/2);
+      Volume     c_vol(c_nam,c_box,description.material(x_comp.materialStr()));
+
+      if ( x_pos && x_rot ) {
+        Position    c_pos(x_pos.x(0),x_pos.y(0),x_pos.z(0));
+        RotationZYX c_rot(x_rot.z(0),x_rot.y(0),x_rot.x(0));
+        pv = m_vol.placeVolume(c_vol, Transform3D(c_rot,c_pos));
+      }
+      else if ( x_rot ) {
+        pv = m_vol.placeVolume(c_vol,RotationZYX(x_rot.z(0),x_rot.y(0),x_rot.x(0)));
+      }
+      else if ( x_pos ) {
+        pv = m_vol.placeVolume(c_vol,Position(x_pos.x(0),x_pos.y(0),x_pos.z(0)));
+      }
+      else {
+        pv = m_vol.placeVolume(c_vol);
+      }
+      c_vol.setRegion(description, x_comp.regionStr());
+      c_vol.setLimitSet(description, x_comp.limitsStr());
+      c_vol.setVisAttributes(description, x_comp.visStr());
+      if ( x_comp.isSensitive() ) {
+        pv.addPhysVolID(_U(sensor),sensor_number++);
+        c_vol.setSensitiveDetector(sens);
+        sensitives[m_nam].push_back(pv);
+      }
+    }
+  }
+  for(xml_coll_t li(x_det,_U(layer)); li; ++li)  {
+    xml_comp_t x_layer  = li;
+    xml_comp_t x_barrel = x_layer.child(_U(barrel_envelope));
+    xml_comp_t x_layout = x_layer.child(_U(rphi_layout));
+    xml_comp_t z_layout = x_layer.child(_U(z_layout));      // Get the <z_layout> element.
+    int        lay_id   = x_layer.id();
+    string     m_nam    = x_layer.moduleStr();
+    string     lay_nam  = _toString(x_layer.id(),"layer%d");
+    Tube       lay_tub   (x_barrel.inner_r(),x_barrel.outer_r(),x_barrel.z_length()/2);
+    Volume     lay_vol   (lay_nam,lay_tub,air);         // Create the layer envelope volume.
+    double     phi0     = x_layout.phi0();              // Starting phi of first module.
+    double     phi_tilt = x_layout.phi_tilt();          // Phi tilt of a module.
+    double     rc       = x_layout.rc();                // Radius of the module center.
+    int        nphi     = x_layout.nphi();              // Number of modules in phi.
+    double     rphi_dr  = x_layout.dr();                // The delta radius of every other module.
+    double     phi_incr = (M_PI * 2) / nphi;            // Phi increment for one module.
+    double     phic     = phi0;                         // Phi of the module center.
+    double     z0       = z_layout.z0();                // Z position of first module in phi.
+    double     nz       = z_layout.nz();                // Number of modules to place in z.
+    double     z_dr     = z_layout.dr();                // Radial displacement parameter, of every other module.
+    Volume     m_env    = volumes[m_nam];
+    DetElement lay_elt(sdet,_toString(x_layer.id(),"layer%d"),lay_id);
+    Placements& sensVols = sensitives[m_nam];
+
+    // Z increment for module placement along Z axis.
+    // Adjust for z0 at center of module rather than
+    // the end of cylindrical envelope.
+    double z_incr   = nz > 1 ? (2.0 * z0) / (nz - 1) : 0.0;
+    // Starting z for module placement along Z axis.
+    double module_z = -z0;
+    int module = 1;
+      
+    // Loop over the number of modules in phi.
+    for (int ii = 0; ii < nphi; ii++)        {
+      double dx = z_dr * std::cos(phic + phi_tilt);        // Delta x of module position.
+      double dy = z_dr * std::sin(phic + phi_tilt);        // Delta y of module position.
+      double  x = rc * std::cos(phic);                     // Basic x module position.
+      double  y = rc * std::sin(phic);                     // Basic y module position.
+
+      // Loop over the number of modules in z.
+      for (int j = 0; j < nz; j++)          {
+        string module_name = _toString(module,"module%d");
+        DetElement mod_elt(lay_elt,module_name,module);
+        // Module PhysicalVolume.
+        //         Transform3D tr(RotationZYX(0,-((M_PI/2)-phic-phi_tilt),M_PI/2),Position(x,y,module_z));
+        //NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the outside
+        Transform3D tr(RotationZYX(0,((M_PI/2)-phic-phi_tilt),-M_PI/2),Position(x,y,module_z));
+
+        pv = lay_vol.placeVolume(m_env,tr);
+        pv.addPhysVolID("module", module);
+        mod_elt.setPlacement(pv);
+        for(size_t ic=0; ic<sensVols.size(); ++ic)  {
+          PlacedVolume sens_pv = sensVols[ic];
+          DetElement comp_elt(mod_elt,sens_pv.volume().name(),module);
+          comp_elt.setPlacement(sens_pv);
+        }
+
+        /// Increase counters etc.
+        module++;
+        // Adjust the x and y coordinates of the module.
+        x += dx;
+        y += dy;
+        // Flip sign of x and y adjustments.
+        dx *= -1;
+        dy *= -1;
+        // Add z increment to get next z placement pos.
+        module_z += z_incr;
+      }
+      phic     += phi_incr;      // Increment the phi placement of module.
+      rc       += rphi_dr;       // Increment the center radius according to dr parameter.
+      rphi_dr  *= -1;            // Flip sign of dr parameter.
+      module_z  = -z0;           // Reset the Z placement parameter for module.
+    }
+    // Create the PhysicalVolume for the layer.
+    pv = assembly.placeVolume(lay_vol); // Place layer in mother
+    pv.addPhysVolID("layer", lay_id);       // Set the layer ID.
+    lay_elt.setAttributes(description,lay_vol,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
+    lay_elt.setPlacement(pv);
+  }
+  sdet.setAttributes(description,assembly,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+  assembly.setVisAttributes(description.invisible());
+  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
+  pv.addPhysVolID("system", det_id);      // Set the subdetector system ID.
+  pv.addPhysVolID("barrel", 0);           // Flag this as a barrel subdetector.
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_SiTrackerBarrel,create_detector)
diff --git a/examples/LHeD/src/Lhe_SiTrackerBarrel_surfaces.cpp b/examples/LHeD/src/Lhe_SiTrackerBarrel_surfaces.cpp
new file mode 100644
index 000000000..44efec5c0
--- /dev/null
+++ b/examples/LHeD/src/Lhe_SiTrackerBarrel_surfaces.cpp
@@ -0,0 +1,79 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+
+namespace { 
+  struct UserData { 
+    int dimension ;
+  }; 
+}
+
+// Framework include files
+#define SURFACEINSTALLER_DATA UserData
+#define DD4HEP_USE_SURFACEINSTALL_HELPER Lhe_SiTrackerBarrelSurfacePlugin
+#include "DD4hep/SurfaceInstaller.h"
+
+namespace{
+  template <> void Installer<UserData>::handle_arguments(int argc, char** argv)   {
+    for(int i=0; i<argc; ++i)  {
+      char* ptr = ::strchr(argv[i],'=');
+      if ( ptr )  {
+        std::string name( argv[i] , ptr ) ;
+        double value = dd4hep::_toDouble(++ptr);
+        if( name=="dimension" ) data.dimension = value ; 
+        std::cout << "DD4hep_SiTrackerBarrelSurfacePlugin: argument[" << i << "] = " << name 
+                  << " = " << value << std::endl;
+      }
+    }
+  }  
+  
+  /// Install measurement surfaces
+  template <typename UserData> 
+    void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv)   {
+    dd4hep::Volume comp_vol = pv.volume();
+    if ( comp_vol.isSensitive() )  {  
+      dd4hep::Volume mod_vol  = parentVolume(component);
+      dd4hep::Box mod_shape(mod_vol.solid()), comp_shape(comp_vol.solid());
+      
+      if ( !comp_shape.isValid() || !mod_shape.isValid() )   {
+        invalidInstaller("Components and/or modules are not boxes -- invalid shapes");
+      }
+      else if ( !handleUsingCache(component,comp_vol) )  {
+        const double* trans = placementTranslation(component);
+        double half_module_thickness = mod_shape->GetDZ();
+        double sensitive_z_position  = trans[2];
+        double outer_thickness = half_module_thickness + sensitive_z_position;
+        double inner_thickness = half_module_thickness - sensitive_z_position;
+        //Surface is placed at the center of the volume, no need to shift origin
+        //Make sure u,v,n form a right-handed coordinate system, v along the final z
+        Vector3D u(-1.,0.,0.), v(0.,-1.,0.), n(0.,0.,1.), o(0.,0.,0.);
+	
+        Type type( Type::Sensitive ) ;
+
+        if( data.dimension == 1 ) {
+          type.setProperty( Type::Measurement1D , true ) ;
+        } else if( data.dimension != 2 ) {
+          throw std::runtime_error("**** Lhe_SiTrackerBarrelSurfacePlugin: no or wrong "
+                                   "'dimension' argument given - has to be 1 or 2") ;
+        }
+        VolPlane surf(comp_vol, type, inner_thickness, outer_thickness, u, v, n, o);
+        addSurface(component,surf);
+      }
+    }
+  }
+  
+
+}// namespace
diff --git a/examples/LHeD/src/Lhe_SiTrackerEndcap2_geo.cpp b/examples/LHeD/src/Lhe_SiTrackerEndcap2_geo.cpp
new file mode 100644
index 000000000..20482a52a
--- /dev/null
+++ b/examples/LHeD/src/Lhe_SiTrackerEndcap2_geo.cpp
@@ -0,0 +1,150 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//
+//  mod.:        P.Kostka LHeD (asymmetrical detector placement in z)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include <map>
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  typedef vector<PlacedVolume> Placements;
+  xml_det_t   x_det     = e;
+  Material    vacuum    = description.vacuum();
+  int         det_id    = x_det.id();
+  string      det_name  = x_det.nameStr();
+  bool        reflect   = x_det.reflect(false);
+  DetElement  sdet        (det_name,det_id);
+  Assembly    assembly    (det_name);
+  //Volume      assembly    (det_name,Box(10000,10000,10000),vacuum);
+  Volume      motherVol = description.pickMotherVolume(sdet);
+  int         m_id=0, c_id=0, n_sensor=0;
+  map<string,Volume> modules;
+  map<string, Placements>  sensitives;
+  PlacedVolume pv;
+
+  assembly.setVisAttributes(description.invisible());
+  sens.setType("tracker");
+
+  for(xml_coll_t mi(x_det,_U(module)); mi; ++mi, ++m_id)  {
+    xml_comp_t x_mod   = mi;
+    string     m_nam   = x_mod.nameStr();
+    xml_comp_t trd     = x_mod.trd();
+    double     posY;
+    double     x1      = trd.x1();
+    double     x2      = trd.x2();
+    double     z       = trd.z();
+    double     y1, y2, total_thickness=0.;
+    xml_coll_t ci(x_mod,_U(module_component));
+    for(ci.reset(), total_thickness=0.0; ci; ++ci)
+      total_thickness += xml_comp_t(ci).thickness();
+      
+    y1 = y2 = total_thickness / 2;
+    Volume  m_volume(m_nam, Trapezoid(x1, x2, y1, y2, z), vacuum);      
+    m_volume.setVisAttributes(description.visAttributes(x_mod.visStr()));
+
+    for(ci.reset(), n_sensor=1, c_id=0, posY=-y1; ci; ++ci, ++c_id)  {
+      xml_comp_t c       = ci;
+      double     c_thick = c.thickness();
+      Material   c_mat   = description.material(c.materialStr());
+      string     c_name  = _toString(c_id,"component%d");
+      Volume     c_vol(c_name, Trapezoid(x1,x2,c_thick/2e0,c_thick/2e0,z), c_mat);
+
+      c_vol.setVisAttributes(description.visAttributes(c.visStr()));
+      pv = m_volume.placeVolume(c_vol,Position(0,posY+c_thick/2,0));
+      if ( c.isSensitive() ) {
+        sdet.check(n_sensor > 2,"SiTrackerEndcap2::fromCompact: "+c_name+" Max of 2 modules allowed!");
+        pv.addPhysVolID("sensor",n_sensor);
+        c_vol.setSensitiveDetector(sens);
+        sensitives[m_nam].push_back(pv);
+        ++n_sensor;
+      }
+      posY += c_thick;
+    }
+    modules[m_nam] = m_volume;
+  }
+  
+  for(xml_coll_t li(x_det,_U(layer)); li; ++li)  {
+    xml_comp_t  x_layer(li);
+    int l_id    = x_layer.id();
+    int mod_num = 1;
+    for(xml_coll_t ri(x_layer,_U(ring)); ri; ++ri)  {
+      xml_comp_t x_ring = ri;
+      double r        = x_ring.r();
+      double phi0     = x_ring.phi0(0);
+      double zstart   = x_ring.zstart();
+      double dz       = x_ring.dz(0);
+      int    nmodules = x_ring.nmodules();
+      string m_nam    = x_ring.moduleStr();
+      Volume m_vol    = modules[m_nam];
+      double iphi     = 2*M_PI/nmodules;
+      double phi      = phi0;
+      Placements& sensVols = sensitives[m_nam];
+
+      for(int k=0; k<nmodules; ++k) {
+        string m_base = _toString(l_id,"layer%d") + _toString(mod_num,"_module%d");
+        double x = -r*std::cos(phi);
+        double y = -r*std::sin(phi);
+	if ( zstart >= 0 ) {
+        DetElement module(sdet,m_base+"_pos",det_id);
+        pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(0,-M_PI/2-phi,-M_PI/2),Position(x,y,zstart+dz)));
+        pv.addPhysVolID("barrel",1).addPhysVolID("layer", l_id).addPhysVolID("module",mod_num);
+        module.setPlacement(pv);
+        for(size_t ic=0; ic<sensVols.size(); ++ic)  {
+          PlacedVolume sens_pv = sensVols[ic];
+          DetElement comp_elt(module,sens_pv.volume().name(),mod_num);
+          comp_elt.setPlacement(sens_pv);
+        }
+
+        if ( reflect ) {
+          pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(M_PI,-M_PI/2-phi,-M_PI/2),Position(x,y,-zstart-dz)));
+          pv.addPhysVolID("barrel",2).addPhysVolID("layer",l_id).addPhysVolID("module",mod_num);
+          DetElement r_module(sdet,m_base+"_neg",det_id);
+          r_module.setPlacement(pv);
+          for(size_t ic=0; ic<sensVols.size(); ++ic)  {
+            PlacedVolume sens_pv = sensVols[ic];
+            DetElement comp_elt(r_module,sens_pv.volume().name(),mod_num);
+            comp_elt.setPlacement(sens_pv);
+          }
+        }
+    } else
+    {
+       pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(0,-M_PI/2-phi,-M_PI/2),Position(x,y,zstart-dz)));
+	   pv.addPhysVolID("barrel",3).addPhysVolID("layer", l_id).addPhysVolID("module",mod_num);
+	   DetElement r_module(sdet,m_base+"_neg-z",det_id);
+	   r_module.setPlacement(pv);
+	   for(size_t ic=0; ic<sensVols.size(); ++ic)  {
+	    PlacedVolume sens_pv = sensVols[ic];
+	    DetElement comp_elt(r_module,sens_pv.volume().name(),mod_num);
+	    comp_elt.setPlacement(sens_pv);
+	  }
+        }
+        dz   = -dz;
+        phi += iphi;
+        ++mod_num;
+      }
+    }
+  }
+  pv = motherVol.placeVolume(assembly);
+  pv.addPhysVolID("system",det_id);
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_SiTrackerEndcap2,create_detector)
diff --git a/examples/LHeD/src/Lhe_SiTrackerEndcap_surfaces.cpp b/examples/LHeD/src/Lhe_SiTrackerEndcap_surfaces.cpp
new file mode 100644
index 000000000..3a6e66111
--- /dev/null
+++ b/examples/LHeD/src/Lhe_SiTrackerEndcap_surfaces.cpp
@@ -0,0 +1,46 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+// Framework include files
+#define  DD4HEP_USE_SURFACEINSTALL_HELPER  Lhe_SiTrackerEndcapSurfacePlugin
+#include "DD4hep/SurfaceInstaller.h"
+
+/// Install measurement surfaces
+template <typename UserData> 
+void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv)   {
+  dd4hep::Volume comp_vol = pv.volume();
+  if ( comp_vol.isSensitive() )  {  
+    dd4hep::Volume mod_vol = parentVolume(component);
+    dd4hep::Trapezoid comp_shape(comp_vol.solid()), mod_shape(mod_vol.solid());
+
+    if ( !comp_shape.isValid() || !mod_shape.isValid() )   {
+      invalidInstaller("Components and/or modules are not Trapezoid -- invalid shapes");
+    }
+    else if ( !handleUsingCache(component,comp_vol) )  {
+      const double* trans = placementTranslation(component);
+      double half_mod_thickness  = mod_shape->GetDy1();
+      //double half_comp_thickness = comp_shape->GetDy1();
+      double si_position         = trans[1];
+      double outer_thickness = half_mod_thickness + si_position;
+      double inner_thickness = half_mod_thickness - si_position;
+      Vector3D u(0.,0.,-1.), v(-1.,0.,0.), n(0.,-1.,0.), o(0.,0.,0.);
+
+      VolPlane surf(comp_vol,Type(Type::Sensitive,Type::Measurement1D),
+                    inner_thickness, outer_thickness, u, v, n, o);
+      addSurface(component,surf);
+    }
+  }
+}
diff --git a/examples/LHeD/src/Lhe_Solenoid_o1_v01_gep.cpp b/examples/LHeD/src/Lhe_Solenoid_o1_v01_gep.cpp
new file mode 100644
index 000000000..13ab06f83
--- /dev/null
+++ b/examples/LHeD/src/Lhe_Solenoid_o1_v01_gep.cpp
@@ -0,0 +1,136 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+//==========================================================================
+
+#include "DDRec/DetectorData.h"
+
+#include "DD4hep/DetFactoryHelper.h"
+
+#include "XML/Layering.h"
+#include "XML/Utilities.h"
+
+
+#include "TGeoTrd2.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)  {
+  xml_det_t     x_det     = e;
+  int           det_id    = x_det.id();
+  string        det_name  = x_det.nameStr();
+  DetElement    sdet      (det_name,det_id);
+
+
+  // --- create an envelope volume and position it into the world ---------------------
+
+  Volume envelope = xml::createPlacedEnvelope( description,  e , sdet ) ;
+  xml::setDetectorTypeFlag( e, sdet ) ;
+
+  if( description.buildType() == BUILD_ENVELOPE ) return sdet ;
+
+  //-----------------------------------------------------------------------------------
+
+
+  Material air = description.air();
+  PlacedVolume pv;
+  int n = 0;
+
+  //added code by Thorben Quast for event display
+  rec::LayeredCalorimeterData* solenoidData = new rec::LayeredCalorimeterData;
+  solenoidData->inner_symmetry = 0;
+  solenoidData->outer_symmetry = 0;
+  solenoidData->layoutType = rec::LayeredCalorimeterData::BarrelLayout ;
+
+  double inner_radius= std::numeric_limits<double>::max();
+  double outer_radius= 0;
+
+  double detZ= 0.;
+
+  for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++n)  {
+    xml_comp_t x_layer = i;
+    string  l_name = det_name+_toString(n,"_layer%d");
+    double  z    = x_layer.outer_z();
+    double  rmin = x_layer.inner_r();
+    double  r    = rmin;
+    DetElement layer(sdet,_toString(n,"layer%d"),x_layer.id());
+    Tube    l_tub (rmin,2*rmin,z);
+    Volume  l_vol(l_name,l_tub,air);
+    int im = 0;
+
+
+    for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++im)  {
+      xml_comp_t x_slice = j;
+      Material mat = description.material(x_slice.materialStr());
+      string s_name= l_name+_toString(m,"_slice%d");
+      double thickness = x_slice.thickness();
+
+      //NN: These probably need to be fixed and ced modified to read the extent, rather than the layer
+      //added code by Thorben Quast for event display
+      rec::LayeredCalorimeterData::Layer solenoidLayer;
+      solenoidLayer.distance = r;
+
+      solenoidLayer.inner_thickness = thickness/2.;
+      solenoidLayer.outer_thickness = solenoidLayer.inner_thickness ;
+
+      solenoidLayer.cellSize0 = 0;    //equivalent to
+      solenoidLayer.cellSize1 = z;    //half extension along z-axis
+      solenoidData->layers.push_back(solenoidLayer);
+
+      Tube   s_tub(r,r+thickness,z,2*M_PI);
+      Volume s_vol(s_name, s_tub, mat);
+
+      r += thickness;
+      if ( x_slice.isSensitive() ) {
+        sens.setType("tracker");
+        s_vol.setSensitiveDetector(sens);
+      }
+      // Set Attributes
+      s_vol.setAttributes(description,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
+      pv = l_vol.placeVolume(s_vol);
+      // Slices have no extra id. Take the ID of the layer!
+      pv.addPhysVolID("slice",im);
+    }
+    l_tub.setDimensions(rmin,r,z);
+
+    if (rmin < inner_radius)
+      inner_radius = rmin;
+
+    if (z>detZ)
+      detZ = z;
+
+    if (r>outer_radius)
+      outer_radius = r;
+
+    l_vol.setVisAttributes(description,x_layer.visStr());
+
+    pv = envelope.placeVolume(l_vol);
+    pv.addPhysVolID("layer",n);
+    layer.setPlacement(pv);
+  }
+  if ( x_det.hasAttr(_U(combineHits)) ) {
+    sdet.setCombineHits(x_det.combineHits(),sens);
+  }
+
+  /// extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ] in mm.
+  solenoidData->extent[0] = inner_radius ;
+  solenoidData->extent[1] = outer_radius ;
+  solenoidData->extent[2] = 0. ;
+  solenoidData->extent[3] = detZ;
+
+  //added code by Thorben Quast for event display
+  sdet.addExtension< rec::LayeredCalorimeterData >( solenoidData ) ;
+
+  return sdet;
+
+}
+
+DECLARE_DETELEMENT(Lhe_Solenoid_o1_v01,create_detector)
diff --git a/examples/LHeD/src/Lhe_SubdetectorAssembly_geo.cpp b/examples/LHeD/src/Lhe_SubdetectorAssembly_geo.cpp
new file mode 100644
index 000000000..29a65770b
--- /dev/null
+++ b/examples/LHeD/src/Lhe_SubdetectorAssembly_geo.cpp
@@ -0,0 +1,85 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+//
+//  mod.:        P.Kostka LHeD (to be done: asym.detector placement in z)
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/Printout.h"
+#include "XML/Utilities.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_element(Detector& description, xml_h e, Ref_t)  {
+  xml_det_t  x_det  (e);
+  string     det_name = x_det.nameStr();
+  DetElement sdet(det_name, x_det.id());
+  Volume     vol;
+
+  bool useRot = x_det.hasChild(_U(rotation));
+  bool usePos = x_det.hasChild(_U(position));
+  Position    pos;
+  RotationZYX rot;
+
+  sdet.setType("compound");
+  xml::setDetectorTypeFlag( e, sdet ) ;
+
+  if( usePos ) {
+    pos = Position(x_det.position().x(), x_det.position().y(), x_det.position().z());
+  }
+  if( useRot ) {
+    rot = RotationZYX(x_det.rotation().x(), x_det.rotation().y(), x_det.rotation().z());
+  }
+
+  if ( x_det.hasChild(_U(shape)) )  {
+    xml_comp_t x_shape = x_det.child(_U(shape));
+    string     type  = x_shape.typeStr();
+    Solid      solid = xml::createShape(description, type, x_shape);
+    Material   mat   = description.material(x_shape.materialStr());
+    printout(DEBUG,det_name,"+++ Creating detector assembly with shape of type:%s",type.c_str());
+    vol = Volume(det_name,solid,mat);
+  }
+  else  {
+    printout(DEBUG,det_name,"+++ Creating detector assembly without shape");
+    vol = Assembly(det_name);
+  }
+
+  for(xml_coll_t c(x_det,_U(composite)); c; ++c)  {
+    xml_dim_t component = c;
+    string nam = component.nameStr();
+    description.declareMotherVolume(nam, vol);
+  }
+
+  vol.setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+
+  Volume mother = description.pickMotherVolume(sdet);
+  PlacedVolume pv;
+  if( useRot && usePos ){
+    pv =  mother.placeVolume(vol, Transform3D(rot, pos));
+  } else if( useRot ){
+    pv =  mother.placeVolume(vol, rot);
+  } else if( usePos ){
+    pv =  mother.placeVolume(vol, pos);
+  } else {
+    pv = mother.placeVolume(vol);
+  }
+
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_SubdetectorAssembly,create_element)
diff --git a/examples/LHeD/src/Lhe_SurfaceExamplePlugin.cpp b/examples/LHeD/src/Lhe_SurfaceExamplePlugin.cpp
new file mode 100644
index 000000000..fb3c5b0fa
--- /dev/null
+++ b/examples/LHeD/src/Lhe_SurfaceExamplePlugin.cpp
@@ -0,0 +1,41 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector plugin
+// 
+//==========================================================================
+// Framework include files
+namespace { struct UserData { /* int a,b,c; */ }; }
+#define SURFACEINSTALLER_DATA UserData
+#define DD4HEP_USE_SURFACEINSTALL_HELPER Lhe_SurfaceExamplePlugin
+#include "DD4hep/SurfaceInstaller.h"
+
+namespace {
+  template <> void Installer<UserData>::handle_arguments(int argc, char** argv)   {
+    for(int i=0; i<argc; ++i)  {
+      double value = -1;
+      char* ptr = ::strchr(argv[i],'=');
+      if ( ptr )  {
+        value = dd4hep::_toDouble(++ptr);
+      }
+      std::cout << "SurfaceExamplePlugin: argument[" << i << "] = " << argv[i] 
+                << " value = " << value << std::endl;
+    }
+  }
+
+  /// Install measurement surfaces
+  template <>
+  void Installer<UserData>::install(dd4hep::DetElement /* component */, dd4hep::PlacedVolume /* pv */)   {
+    // Do here whatever is necessary ....
+  }
+}
diff --git a/examples/LHeD/src/Lhe_TubeSegment_geo.cpp b/examples/LHeD/src/Lhe_TubeSegment_geo.cpp
new file mode 100644
index 000000000..fb01ef849
--- /dev/null
+++ b/examples/LHeD/src/Lhe_TubeSegment_geo.cpp
@@ -0,0 +1,53 @@
+//==========================================================================
+//  AIDA Detector description implementation 
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : M.Frank
+//
+//==========================================================================
+//
+// Specialized generic detector constructor
+// 
+//==========================================================================
+#include "DD4hep/DetFactoryHelper.h"
+
+using namespace std;
+using namespace dd4hep;
+using namespace dd4hep::detail;
+
+static Ref_t create_element(Detector& description, xml_h e, Ref_t sens)  {
+  xml_det_t  x_det  (e);
+  xml_comp_t x_tube = x_det.tubs();
+  xml_dim_t  pos    = x_det.position();
+  xml_dim_t  rot    = x_det.rotation();
+  string     name   = x_det.nameStr();
+  Tube       tub    (x_tube.rmin(),x_tube.rmax(),x_tube.zhalf());
+  Volume     vol    (name,tub,description.material(x_det.materialStr()));
+
+  vol.setVisAttributes(description, x_det.visStr());
+  vol.setLimitSet(description, x_det.limitsStr());
+  vol.setRegion(description, x_det.regionStr());
+  if ( x_det.isSensitive() )   {
+    SensitiveDetector sd = sens;
+    xml_dim_t sd_typ = x_det.child(_U(sensitive));
+    vol.setSensitiveDetector(sens);
+    sd.setType(sd_typ.typeStr());
+  }
+
+  DetElement   sdet(name,x_det.id());
+  Volume       mother = description.pickMotherVolume(sdet);
+  PlacedVolume phv = 
+    mother.placeVolume(vol,Transform3D(RotationZYX(rot.z(),rot.y(),rot.x()),Position(-pos.x(),-pos.y(),pos.z())));
+  if ( x_det.hasAttr(_U(id)) )  {
+    phv.addPhysVolID("system",x_det.id());
+  }
+  sdet.setPlacement(phv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(Lhe_TubeSegment,create_element)
-- 
GitLab