diff --git a/DDAlign/src/AlignmentCache.cpp b/DDAlign/src/AlignmentCache.cpp
index 557ff9f2ed2b4dc3f9f1cf9f3f9e289a2d5e868b..0ab6c9cddcc6d8ff7e99566211fdb7cf08251b7c 100644
--- a/DDAlign/src/AlignmentCache.cpp
+++ b/DDAlign/src/AlignmentCache.cpp
@@ -204,7 +204,7 @@ void AlignmentCache::apply(AlignmentStack& stack)    {
   typedef map<DetElement,vector<Entry*> > sd_entries_t;
   TGeoManager& mgr = m_lcdd.manager();
   DetElementUpdates detelt_updates;
-  sd_entries_t all, highest;
+  sd_entries_t all;
 
   while(stack.size() > 0)    {
     Entry* e = stack.pop().release();
diff --git a/DDCore/include/DD4hep/Factories.h b/DDCore/include/DD4hep/Factories.h
index c891f193fbb70c3ec03fb53d9d1f8d6ced9ce3b9..b5f1baf1ebc8e9cbfc5f8bffe5b316b28deed4c3 100644
--- a/DDCore/include/DD4hep/Factories.h
+++ b/DDCore/include/DD4hep/Factories.h
@@ -9,10 +9,8 @@
 #ifndef DD4HEP_FACTORIES_H
 #define DD4HEP_FACTORIES_H
 
-#ifndef __CINT__
-#include "Reflex/PluginService.h"
-#endif
-#include "RVersion.h"
+// Framework include files
+#include "DD4hep/Plugins.h"
 #include "DD4hep/Detector.h"
 #include "DD4hep/NamedObject.h"
 #include "XML/XMLElements.h"
@@ -131,7 +129,7 @@ namespace DD4hep {
 }
 
 namespace {
-
+  template <typename P, typename S> class Factory;
   template <typename P> class Factory<P, void*(const char*)> {
   public:
     static void Func(void *ret, void*, const std::vector<void*>& arg, void*) {
@@ -201,29 +199,27 @@ namespace {
 }
 
 #define DECLARE_DETELEMENT_FACTORY(x)                                   \
-  PLUGINSVC_FACTORY(x,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*))
-#define DECLARE_NAMESPACE_DETELEMENT_FACTORY(n,x)  using n::x;          \
-  PLUGINSVC_FACTORY(x,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*))
-
-#define DECLARE_NAMED_APPLY_FACTORY(n,x)  using n::x;                   \
-  PLUGINSVC_FACTORY_WITH_ID(x,std::string(#x),long(DD4hep::Geometry::LCDD*,int, char**))
-#define DECLARE_NAMED_TRANSLATION_FACTORY(n,x)  using n::x;             \
-  PLUGINSVC_FACTORY_WITH_ID(x,std::string(#x),DD4hep::NamedObject*(DD4hep::Geometry::LCDD*))
-#define DECLARE_NAMED_XMLELEMENT_FACTORY(n,x)  using n::x;              \
-  PLUGINSVC_FACTORY_WITH_ID(x,std::string(#x),DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*))
-#define DECLARE_NAMED_DETELEMENT_FACTORY(n,x)  using n::x;              \
-  PLUGINSVC_FACTORY_WITH_ID(x,std::string(#x),DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*))
+  DD4HEP_PLUGINSVC_FACTORY(x,x,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*),__LINE__)
+#define DECLARE_NAMESPACE_DETELEMENT_FACTORY(n,x)                       \
+  DD4HEP_PLUGINSVC_FACTORY(n::x,x,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*),__LINE__)
+#define DECLARE_NAMED_APPLY_FACTORY(n,x)                                \
+  DD4HEP_PLUGINSVC_FACTORY(n::x,x,long(DD4hep::Geometry::LCDD*,int, char**),__LINE__)
+#define DECLARE_NAMED_TRANSLATION_FACTORY(n,x)                          \
+  DD4HEP_PLUGINSVC_FACTORY(n::x,x,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*),__LINE__)
+#define DECLARE_NAMED_XMLELEMENT_FACTORY(n,x)                           \
+  DD4HEP_PLUGINSVC_FACTORY(n::x,x,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*),__LINE__)
+#define DECLARE_NAMED_DETELEMENT_FACTORY(n,x)                           \
+  DD4HEP_PLUGINSVC_FACTORY(n::x,x,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*),__LINE__)
 
 #define DECLARE_APPLY(name,func)                                        \
   namespace DD4hep { namespace Geometry { namespace { struct name {}; } \
       template <> long ApplyFactory<name>::create(DD4hep::Geometry::LCDD& l,int n,char** a) {return func(l,n,a);} }} \
-  using DD4hep::Geometry::name;                                         \
-  DECLARE_NAMED_APPLY_FACTORY(DD4hep::Geometry,name)
+  DD4HEP_PLUGINSVC_FACTORY(DD4hep::Geometry::name,name,long(DD4hep::Geometry::LCDD*,int,char**),__LINE__)
 
 #define DECLARE_CONSTRUCTOR(name,func)                                  \
   namespace DD4hep { namespace Geometry { namespace { struct name {}; } \
       template <> void* ConstructionFactory<name>::create(const char* n) { return func(n);}}} \
-  PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),void*(const char*))
+  DD4HEP_PLUGINSVC_FACTORY(DD4hep::Geometry::name,name,void*(const char*),__LINE__)
 
 #define DECLARE_TRANSLATION(name,func)                                  \
   namespace DD4hep { namespace Geometry { namespace { struct name {}; } \
@@ -235,23 +231,23 @@ namespace {
   namespace DD4hep { namespace Geometry { namespace { struct xml_element_##name {}; } \
       template <> DD4hep::Geometry::Ref_t XMLElementFactory<DD4hep::Geometry::xml_element_##name>::create(DD4hep::Geometry::LCDD& l,DD4hep::XML::Handle_t e) {return func(l,e);} }} \
   using DD4hep::Geometry::xml_element_##name;                           \
-  PLUGINSVC_FACTORY_WITH_ID(xml_element_##name,std::string(#name),DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*))
+  DD4HEP_PLUGINSVC_FACTORY(xml_element_##name,name,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*),__LINE__)
 
 #define DECLARE_XML_DOC_READER(name,func)                               \
   namespace DD4hep { namespace Geometry { namespace { struct xml_document_##name {}; } \
       template <> long XMLDocumentReaderFactory<DD4hep::Geometry::xml_document_##name>::create(DD4hep::Geometry::LCDD& l,DD4hep::XML::Handle_t e) {return func(l,e);} }} \
   using DD4hep::Geometry::xml_document_##name;                          \
-  PLUGINSVC_FACTORY_WITH_ID(xml_document_##name,std::string(#name "_XML_reader"),long(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*))
+  DD4HEP_PLUGINSVC_FACTORY(xml_document_##name,name##_XML_reader,long(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*),__LINE__)
 
 #define DECLARE_XML_PROCESSOR_BASIC(name,func,deprecated)               \
   namespace DD4hep { namespace Geometry { struct det_element_##name {}; \
       template <> DD4hep::Geometry::Ref_t DetElementFactory< DD4hep::Geometry::det_element_##name >::create(DD4hep::Geometry::LCDD& l,DD4hep::XML::Handle_t e,DD4hep::Geometry::Ref_t h){ if (deprecated) warning_deprecated_xml_factory(#name); return func(l,e,h);}}  } \
   using DD4hep::Geometry::det_element_##name;                           \
-  PLUGINSVC_FACTORY_WITH_ID(det_element_##name,std::string(#name),DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*))
+  DD4HEP_PLUGINSVC_FACTORY(det_element_##name,name,DD4hep::NamedObject*(DD4hep::Geometry::LCDD*,DD4hep::XML::Handle_t*,DD4hep::Geometry::Ref_t*),__LINE__)
 
-#define DECLARE_XML_PROCESSOR(name,func) DECLARE_XML_PROCESSOR_BASIC(name,func,0)
-#define DECLARE_SUBDETECTOR(name,func) DECLARE_XML_PROCESSOR_BASIC(name,func,0)
-#define DECLARE_DETELEMENT(name,func)  DECLARE_XML_PROCESSOR_BASIC(name,func,0)
+#define DECLARE_XML_PROCESSOR(name,func)          DECLARE_XML_PROCESSOR_BASIC(name,func,0)
+#define DECLARE_SUBDETECTOR(name,func)            DECLARE_XML_PROCESSOR_BASIC(name,func,0)
+#define DECLARE_DETELEMENT(name,func)             DECLARE_XML_PROCESSOR_BASIC(name,func,0)
 #define DECLARE_DEPRECATED_DETELEMENT(name,func)  DECLARE_XML_PROCESSOR_BASIC(name,func,1)
 
 #endif // DD4HEP_FACTORIES_H
diff --git a/DDCore/include/DD4hep/Handle.inl b/DDCore/include/DD4hep/Handle.inl
index 48c328dd248226fa519ebacad13b18efb6085f5f..f924506e300d30c7719d75afaa9e0debd5303a0c 100644
--- a/DDCore/include/DD4hep/Handle.inl
+++ b/DDCore/include/DD4hep/Handle.inl
@@ -1,83 +1,83 @@
-        // $Id: Handle.h 1059 2014-04-04 20:24:53Z markus.frank@cern.ch $
-        //====================================================================
-        //  AIDA Detector description implementation for LCD
-        //--------------------------------------------------------------------
-        //
-        //  Author     : M.Frank
-        //
-        //====================================================================
+// $Id: Handle.h 1059 2014-04-04 20:24:53Z markus.frank@cern.ch $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
 
-        // Framework include files
-        #include "DD4hep/Handle.h"
+// Framework include files
+#include "DD4hep/Handle.h"
 
-        /*
-         *   DD4hep namespace declaration
-          */
-          namespace DD4hep {
+/// Namespace for the AIDA detector description toolkit
+namespace DD4hep {
 
-            /*
-               *   Geometry sub-namespace declaration
-                  */
-                    namespace Geometry {
+  /// Namespace for the geometry part of the AIDA detector description toolkit
+  namespace Geometry {
 
-                        template <typename T> void Handle<T>::bad_assignment(const std::type_info& from, const std::type_info& to) {
-                              invalidHandleAssignmentError(from,to);
-                                  }
-                                      template <typename T> void Handle<T>::assign(T* n, const std::string& nam, const std::string& tit) {
-                                            this->m_element = n;
-                                                  if (!nam.empty())
-                                                          n->SetName(nam.c_str());
-                                                                if (!tit.empty())
-                                                                        n->SetTitle(tit.c_str());
-                                                                            }
+    /// Helper routine called when unrelated types are assigned.
+    template <typename T> void Handle<T>::bad_assignment(const std::type_info& from, const std::type_info& to) {
+      invalidHandleAssignmentError(from,to);
+    }
 
-                                                                                template <typename T> const char* Handle<T>::name() const {
-                                                                                      return this->m_element ? this->m_element->GetName() : "";
-                                                                                          }
+    /// Assign a new named object. Note: object references must be managed by the user
+    template <typename T> void Handle<T>::assign(T* n, const std::string& nam, const std::string& tit) {
+      this->m_element = n;
+      if (!nam.empty())
+        n->SetName(nam.c_str());
+      if (!tit.empty())
+        n->SetTitle(tit.c_str());
+    }
 
-                                                                                              /// Checked object access. Throws invalid handle runtime exception
-                                                                                                  template <typename T> T* Handle<T>::access() const   {
-                                                                                                        if ( this->m_element ) return this->m_element;
-                                                                                                              invalidHandleError(typeid(T));
-                                                                                                                    return 0; // We have thrown an exception before - does not harm!
-                                                                                                                        }
+    /// Access the object name (or "" if not supported by the object)
+    template <typename T> const char* Handle<T>::name() const {
+      return this->m_element ? this->m_element->GetName() : "";
+    }
 
-                                                                                                                          } /* End namespace Geometry  */
-                                                                                                                          } /* End namespace DD4hep      */
+    /// Checked object access. Throws invalid handle runtime exception
+    template <typename T> T* Handle<T>::access() const   {
+      if ( this->m_element ) return this->m_element;
+      invalidHandleError(typeid(T));
+      return 0; // We have thrown an exception before - does not harm!
+    }
 
-                                                                                                                          #define DD4HEP_INSTANTIATE_HANDLE(X)                                    \
-                                                                                                                            namespace DD4hep { namespace Geometry {                               \
-                                                                                                                              template <> void Handle<X>::verifyObject() const {                        \
-                                                                                                                                  increment_object_validations();                                       \
-                                                                                                                                      if (m_element && dynamic_cast<X*>((TObject*)m_element) == 0) {    \
-                                                                                                                                            bad_assignment(typeid(*m_element), typeid(X));                      \
-                                                                                                                                                }                                                                       \
-                                                                                                                                                  }}}                                                                   \
-                                                                                                                                                    template class DD4hep::Geometry::Handle<X>
+  } /* End namespace Geometry    */
+}   /* End namespace DD4hep      */
 
-                                                                                                                                                    #define DD4HEP_INSTANTIATE_HANDLE_NAMED(X)                              \
-                                                                                                                                                      namespace DD4hep { namespace Geometry {                               \
-                                                                                                                                                        template <> const char* Handle<X>::name() const                       \
-                                                                                                                                                          { return this->m_element ? this->m_element->name.c_str() : ""; }      \
-                                                                                                                                                            template <> void                                                      \
-                                                                                                                                                              Handle<X>::assign(X* p, const std::string& n, const std::string& t) { \
-                                                                                                                                                                    this->m_element = p;                                              \
-                                                                                                                                                                          p->name = n;                                                      \
-                                                                                                                                                                                p->type = t;                                                      \
-                                                                                                                                                                                  }                                                                     \
-                                                                                                                                                                                    template <> void Handle<X>::verifyObject() const {                  \
-                                                                                                                                                                                        increment_object_validations();                                 \
-                                                                                                                                                                                            if (m_element && dynamic_cast<X*>((NamedObject*)m_element) == 0) {  \
-                                                                                                                                                                                                  bad_assignment(typeid(*m_element), typeid(X));                        \
-                                                                                                                                                                                                      }                                                                 \
-                                                                                                                                                                                                        }}}                                                                     \
-                                                                                                                                                                                                          template class DD4hep::Geometry::Handle<X>
+#define DD4HEP_INSTANTIATE_HANDLE(X)                                    \
+  namespace DD4hep { namespace Geometry {                               \
+      template <> void Handle<X>::verifyObject() const {		\
+        increment_object_validations();					\
+        if (m_element && dynamic_cast<X*>((TObject*)m_element) == 0) {	\
+	  bad_assignment(typeid(*m_element), typeid(X));		\
+        }								\
+      }}}								\
+  template class DD4hep::Geometry::Handle<X>
 
-                                                                                                                                                                                                          #define DD4HEP_INSTANTIATE_HANDLE_UNNAMED(X)                            \
-                                                                                                                                                                                                            namespace DD4hep { namespace Geometry {                               \
-                                                                                                                                                                                                              template <> void                                                      \
-                                                                                                                                                                                                                Handle<X>::assign(X* n, const std::string&, const std::string&)       \
-                                                                                                                                                                                                                  { this->m_element = n;}                                               \
-                                                                                                                                                                                                                    template <> const char* Handle<X>::name() const { return ""; }        \
-                                                                                                                                                                                                                      }}                                                                    \
-                                                                                                                                                                                                                        DD4HEP_INSTANTIATE_HANDLE(X)
+#define DD4HEP_INSTANTIATE_HANDLE_NAMED(X)                              \
+  namespace DD4hep { namespace Geometry {                               \
+      template <> const char* Handle<X>::name() const			\
+      { return this->m_element ? this->m_element->name.c_str() : ""; }	\
+      template <> void							\
+      Handle<X>::assign(X* p, const std::string& n, const std::string& t) { \
+        this->m_element = p;						\
+        p->name = n;							\
+        p->type = t;							\
+      }									\
+      template <> void Handle<X>::verifyObject() const {		\
+        increment_object_validations();                                 \
+        if (m_element && dynamic_cast<X*>((NamedObject*)m_element) == 0) { \
+	  bad_assignment(typeid(*m_element), typeid(X));		\
+        }								\
+      }}}								\
+  template class DD4hep::Geometry::Handle<X>
+
+#define DD4HEP_INSTANTIATE_HANDLE_UNNAMED(X)                            \
+  namespace DD4hep { namespace Geometry {                               \
+					 template <> void		\
+					 Handle<X>::assign(X* n, const std::string&, const std::string&) \
+					 { this->m_element = n;}	\
+					 template <> const char* Handle<X>::name() const { return ""; }	\
+					 }}				\
+  DD4HEP_INSTANTIATE_HANDLE(X)
diff --git a/DDCore/include/DD4hep/LCDD.h b/DDCore/include/DD4hep/LCDD.h
index 3eaf433ae7bde95519b299a0a97a35247655891e..1af20d19ef713c668a3da201a6a7ac3861dcb1d1 100644
--- a/DDCore/include/DD4hep/LCDD.h
+++ b/DDCore/include/DD4hep/LCDD.h
@@ -132,6 +132,16 @@ namespace DD4hep {
       /// Accessor to the map of ID specifications
       virtual const HandleMap& idSpecifications() const = 0;
 
+      /// Register new mother volume using the detector name.
+      /** Volumes must be registered/declared PRIOR to be picked up!
+       *  The method throws an exception if another volume was already declared for this subdetector
+       *  The method throws an exception if the volume to be registered is invalid.
+       */
+      virtual void   declareMotherVolume(const std::string& detector_name, const Volume& vol) = 0;
+      /// Access mother volume by detector element
+      /** The method uses the detector element's name for volume identification. 
+       *  Unregistered detectors are hosted by the world volume.
+       */
       virtual Volume pickMotherVolume(const DetElement& sd) const = 0;
 
       /// Typed access to constants: access string values
diff --git a/DDCore/include/DD4hep/LCDDData.h b/DDCore/include/DD4hep/LCDDData.h
index 6a36b8de86c4f011918f7aeb6ee68edd7ae18e13..99ac9fcc4912880b9e7afa6b3f33dfe6f1db28d7 100644
--- a/DDCore/include/DD4hep/LCDDData.h
+++ b/DDCore/include/DD4hep/LCDDData.h
@@ -93,6 +93,8 @@ namespace DD4hep {
       ObjectHandleMap m_display;
       ObjectHandleMap m_fields;
 
+      ObjectHandleMap m_motherVolumes;
+
       // GDML fields
       ObjectHandleMap m_define;
 
diff --git a/DDCore/include/DD4hep/Plugins.h b/DDCore/include/DD4hep/Plugins.h
index b7fcbaa38da742fcfd0ccdd5d56311a5380287ca..8e291cfd21bd54b49a5909c328ccb8222e9db98c 100644
--- a/DDCore/include/DD4hep/Plugins.h
+++ b/DDCore/include/DD4hep/Plugins.h
@@ -11,14 +11,12 @@
 
 // ROOT include files
 #ifndef __CINT__
-#include "Reflex/PluginService.h"
+#include <string>
+#include <vector>
 
 /// Namespace for the AIDA detector description toolkit
 namespace DD4hep {
 
-  // Forward declarations
-  typedef ROOT::Reflex::PluginService PluginService;
-
   /// Helper to debug plugin manager calls
   /**
    *  Small helper class to adjust the plugin service debug level
@@ -39,7 +37,55 @@ namespace DD4hep {
     std::string missingFactory(const std::string& name) const;
   };
 
+  template <typename SIGNATURE> class PluginRegistry {
+  public:
+    typedef void (*stub_t)(void *retaddr, void*, const std::vector<void*>& arg, void*);
+    typedef SIGNATURE signature_t;
+    static void add(const char* name, stub_t stub);
+  };
+
+  class PluginService  {
+  private:
+  public:
+    typedef void (*stub_t)(void *retaddr, void*, const std::vector<void*>& arg, void*);
+
+    static bool debug();
+    static bool setDebug(bool new_value);
+
+    template <typename R> static R Create(const std::string& name);
+
+    template <typename R, typename A0>
+      static R Create(const std::string& name,A0 a0);
+
+    template <typename R, typename A0, typename A1>
+      static R Create(const std::string& name, A0 a0, A1 a1);
+
+    template <typename R, typename A0, typename A1, typename A2>
+      static R Create(const std::string& name, A0 a0, A1 a1, A2 a2);
+
+    template <typename R, typename A0, typename A1, typename A2, typename A3>
+      static R Create(const std::string& name, A0 a0, A1 a1, A2 a2, A3 a3);
+
+    template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
+      static R Create(const std::string& name, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4);
+
+    template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
+      static R Create(const std::string& name, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5);
+  };
+
 } /* End namespace DD4hep      */
 
+#define DD4HEP_PLUGINSVC_CNAME(name, serial)  name##_dict_##serial
+
+#define DD4HEP_FACTORY_CALL(type,name,signature)   DD4hep::PluginRegistry<signature>::add(name,Factory<type,signature>::Func);
+
+#define DD4HEP_PLUGINSVC_FACTORY(type,name,signature,serial)	\
+  namespace {\
+  struct DD4HEP_PLUGINSVC_CNAME(__typeFactory__,serial)  {		\
+    DD4HEP_PLUGINSVC_CNAME(__typeFactory__,serial)()  { DD4HEP_FACTORY_CALL(type,#name,signature); } \
+  } DD4HEP_PLUGINSVC_CNAME(s____typeFactory__,serial);\
+}
+
+
 #endif    /* __CINT__          */
 #endif    /* DD4HEP_PLUGINS_H  */
diff --git a/DDCore/include/DD4hep/Plugins.inl b/DDCore/include/DD4hep/Plugins.inl
new file mode 100644
index 0000000000000000000000000000000000000000..dc2b44e7debae4e199b387086b14626a99a84128
--- /dev/null
+++ b/DDCore/include/DD4hep/Plugins.inl
@@ -0,0 +1,23 @@
+// $Id: Readout.cpp 590 2013-06-03 17:02:43Z markus.frank $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#ifndef DD4HEP_PLUGINS_INL
+#define DD4HEP_PLUGINS_INL
+
+#include "DD4hep/Plugins.h"
+#include "RVersion.h"
+
+#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
+#include "DD4hep/Plugins_ROOT5.inl"
+#elif ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) and ROOT_VERSION_CODE < ROOT_VERSION(7,0,0)
+#include "DD4hep/Plugins_ROOT6.inl"
+#else
+#pragma error "Unsupported ROOT version required."
+#endif
+
+#endif  // DD4HEP_PLUGINS_INL
diff --git a/DDCore/include/DD4hep/Plugins_ROOT5.inl b/DDCore/include/DD4hep/Plugins_ROOT5.inl
new file mode 100644
index 0000000000000000000000000000000000000000..5744594e2a444402e0a03eac9bbb265a49434805
--- /dev/null
+++ b/DDCore/include/DD4hep/Plugins_ROOT5.inl
@@ -0,0 +1,96 @@
+// $Id: Readout.cpp 590 2013-06-03 17:02:43Z markus.frank $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#ifndef DD4HEP_PLUGINS_ROOT5_INL
+#define DD4HEP_PLUGINS_ROOT5_INL
+
+
+#include "DD4hep/Printout.h"
+#include "Reflex/PluginService.h"
+#include "Reflex/Reflex.h"
+#include "Reflex/Builder/ReflexBuilder.h"
+
+namespace DD4hep  {
+
+  template <typename R> R PluginService::Create(const std::string& name)  
+  { return ROOT::Reflex::PluginService::Create<R>(name); }
+
+  template <typename R, typename A0> R PluginService::Create(const std::string& name, A0 a0)  
+  { return ROOT::Reflex::PluginService::Create<R>(name,a0); }
+
+  template <typename R, typename A0, typename A1>
+  R PluginService::Create(const std::string& name, A0 a0, A1 a1)  
+  { return ROOT::Reflex::PluginService::Create<R>(name, a0, a1); }
+
+  template <typename R, typename A0, typename A1, typename A2>
+  R PluginService::Create(const std::string& name, A0 a0, A1 a1, A2 a2)  
+  { return ROOT::Reflex::PluginService::Create<R>(name, a0, a1, a2); }
+
+  template <typename R, typename A0, typename A1, typename A2, typename A3>
+  R PluginService::Create(const std::string& name, A0 a0, A1 a1, A2 a2, A3 a3)  
+  { return ROOT::Reflex::PluginService::Create<R>(name, a0, a1, a2, a3); }
+
+  template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
+  R PluginService::Create(const std::string& name, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)  
+  { return ROOT::Reflex::PluginService::Create<R>(name, a0, a1, a2, a3, a4); }
+
+  template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
+  R PluginService::Create(const std::string& name, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)  
+  { return ROOT::Reflex::PluginService::Create<R>(name, a0, a1, a2, a3, a4, a5); }
+
+
+  namespace plugin_signatures_namespace {
+
+    template <typename R> R instantiate_creator ()  
+    { return PluginService::Create<R>(std::string("")); }
+    
+    template <typename R, typename A0> R instantiate_creator ( A0 a0)  
+    { return PluginService::Create<R>(std::string(""),a0); }
+
+    template <typename R, typename A0, typename A1> R instantiate_creator ( A0 a0, A1 a1)  
+    { return PluginService::Create<R>(std::string(""), a0, a1); }
+
+    template <typename R, typename A0, typename A1, typename A2>
+      R instantiate_creator ( A0 a0, A1 a1, A2 a2)  
+    { return PluginService::Create<R>(std::string(""), a0, a1, a2); }
+
+    template <typename R, typename A0, typename A1, typename A2, typename A3>
+      R instantiate_creator ( A0 a0, A1 a1, A2 a2, A3 a3)  
+    { return PluginService::Create<R>(std::string(""), a0, a1, a2, a3); }
+
+    template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
+      R instantiate_creator ( A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)  
+    { return PluginService::Create<R>(std::string(""), a0, a1, a2, a3, a4); }
+
+    template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
+      R instantiate_creator ( A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)  
+    { return PluginService::Create<R>(std::string(""), a0, a1, a2, a3, a4, a5); }
+
+    namespace  {
+      template <typename SIGNATURE> static void reflex_plugin(const std::string& name, DD4hep::PluginService::stub_t stub)  {
+        ROOT::Reflex::Type typ = ROOT::Reflex::TypeBuilder(name.c_str(),ROOT::Reflex::PUBLIC);
+        ROOT::Reflex::Type sig = ROOT::Reflex::FunctionDistiller < SIGNATURE > ::Get();
+        std::string fname = (std::string(PLUGINSVC_FACTORY_NS "::") + ROOT::Reflex::PluginService::FactoryName(name));
+        ROOT::Reflex::FunctionBuilder func(sig, fname.c_str(), stub, 0, "", ROOT::Reflex::PUBLIC);
+        func.AddProperty("name", name).AddProperty("id", name);
+	if ( PluginService::debug() )  {
+          printout(INFO,"PluginService","+++ Declared factory for id %s with signature %s.",fname.c_str(),sig.Name().c_str());
+        }
+      }
+    }
+
+  }
+}
+
+#define DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(R, ARGS) namespace DD4hep {		\
+  template <> void PluginRegistry< R ARGS >::add(const char* n, DD4hep::PluginService::stub_t f) \
+  {   plugin_signatures_namespace::reflex_plugin< R ARGS >(n,f);   } \
+  namespace plugin_signatures_namespace { template R instantiate_creator<R> ARGS ; }}
+
+#endif  // DD4HEP_PLUGINS_ROOT5_INL
+
diff --git a/DDCore/include/DD4hep/Plugins_ROOT6.inl b/DDCore/include/DD4hep/Plugins_ROOT6.inl
new file mode 100644
index 0000000000000000000000000000000000000000..3405fdf7037bb00e536f15eeead0907c5313dd90
--- /dev/null
+++ b/DDCore/include/DD4hep/Plugins_ROOT6.inl
@@ -0,0 +1,13 @@
+// $Id: Readout.cpp 590 2013-06-03 17:02:43Z markus.frank $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#ifndef DD4HEP_PLUGINS_ROOT6
+#define DD4HEP_PLUGINS_ROOT6
+
+#endif  // DD4HEP_PLUGINS_ROOT6
+
diff --git a/DDCore/include/DD4hep/Printout.h b/DDCore/include/DD4hep/Printout.h
index c9784bf3d649a7fc2fba245c406788aa3a98fa10..d979d2c1e43229d177194eef48bb7c575e63461c 100644
--- a/DDCore/include/DD4hep/Printout.h
+++ b/DDCore/include/DD4hep/Printout.h
@@ -115,6 +115,36 @@ namespace DD4hep {
    */
   int printout(PrintLevel severity, const char* src, const std::string& fmt, va_list& args);
 
+  /** Calls the display action with ERROR and throws an std::runtime_error exception
+   *  @arg src        [string,read-only]   Information source (component, etc.)
+   *  @arg fmt        [string,read-only]   Format string for ellipsis args
+   *  @return Status code indicating success or failure
+   */
+  void except(const std::string& src, const std::string& fmt, ...);
+
+  /** Calls the display action with ERROR and throws an std::runtime_error exception
+   *  @arg src        [string,read-only]   Information source (component, etc.)
+   *  @arg fmt        [string,read-only]   Format string for ellipsis args
+   *  @return Status code indicating success or failure
+   */
+  void except(const char* src, const char* fmt, ...);
+
+  /** Calls the display action with ERROR and throws an std::runtime_error exception
+   *  @arg src        [string,read-only]   Information source (component, etc.)
+   *  @arg fmt        [string,read-only]   Format string for ellipsis args
+   *  @arg args       [ap_list,read-only]  List with variable number of arguments to fill format string.
+   *  @return Status code indicating success or failure
+   */
+  void except(const std::string& src, const std::string& fmt, va_list& args);
+
+  /** Calls the display action with ERROR and throws an std::runtime_error exception
+   *  @arg src        [string,read-only]   Information source (component, etc.)
+   *  @arg fmt        [string,read-only]   Format string for ellipsis args
+   *  @arg args       [ap_list,read-only]  List with variable number of arguments to fill format string.
+   *  @return Status code indicating success or failure
+   */
+  void except(const char* src, const char* fmt, va_list& args);
+
   /** Build formatted string
    *  @arg src        [string,read-only]   Information source (component, etc.)
    *  @arg fmt        [string,read-only]   Format string for ellipsis args
@@ -122,6 +152,13 @@ namespace DD4hep {
    */
   std::string format(const std::string& src, const std::string& fmt, ...);
 
+  /** Build exception string
+   *  @arg src        [string,read-only]   Information source (component, etc.)
+   *  @arg fmt        [string,read-only]   Format string for ellipsis args
+   *  @return Status code indicating success or failure
+   */
+  std::string format(const char* src, const char* fmt, ...);
+
   /** Build formatted string
    *  @arg src        [string,read-only]   Information source (component, etc.)
    *  @arg fmt        [string,read-only]   Format string for ellipsis args
@@ -130,6 +167,14 @@ namespace DD4hep {
    */
   std::string format(const std::string& src, const std::string& fmt, va_list& args);
 
+  /** Build exception string and throw std::runtime_error
+   *  @arg src        [string,read-only]   Information source (component, etc.)
+   *  @arg fmt        [string,read-only]   Format string for ellipsis args
+   *  @arg args       [ap_list,read-only]  List with variable number of arguments to fill format string.
+   *  @return Status code indicating success or failure
+   */
+  std::string format(const char* src, const char* fmt, va_list& args);
+
   /// Customize printer function
   void setPrinter(void* print_arg, output_function_t fcn);
 
diff --git a/DDCore/include/XML/UnicodeValues.h b/DDCore/include/XML/UnicodeValues.h
index 81fc4c9e651bec61a07a99431b5a730ac28b9df5..3d5e3f0bd7e0e91d6da3130905785184a42f1425 100644
--- a/DDCore/include/XML/UnicodeValues.h
+++ b/DDCore/include/XML/UnicodeValues.h
@@ -74,6 +74,7 @@ namespace DD4hep {
 
     UNICODE (d);
     UNICODE (D);
+    UNICODE (daughter);
     UNICODE (define);
     UNICODE (delta);
     UNICODE (deltaphi);
@@ -224,6 +225,7 @@ namespace DD4hep {
     UNICODE (modulePosX);
     UNICODE (modulePosY);
     UNICODE (moduleWidth);
+    UNICODE (mother);
 
     UNICODE (n);
     UNICODE (N);
@@ -260,6 +262,7 @@ namespace DD4hep {
     UNICODE (paraboloid);
     UNICODE (param);
     UNICODE (params);
+    UNICODE (parent);
     UNICODE (particles);
     UNICODE (phi);
     UNICODE (phi0);
diff --git a/DDCore/include/XML/Utilities.h b/DDCore/include/XML/Utilities.h
new file mode 100644
index 0000000000000000000000000000000000000000..788e7df679375bc5d9989401cea1e36a8719bda9
--- /dev/null
+++ b/DDCore/include/XML/Utilities.h
@@ -0,0 +1,27 @@
+// $Id: Conversions.h 1479 2014-12-18 16:00:45Z markus.frank@cern.ch $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#ifndef DD4hep_XML_XMLUTILITIES_H
+#define DD4hep_XML_XMLUTILITIES_H
+
+#include "XML/Conversions.h"
+#include "XML/XMLElements.h"
+#include "DD4hep/LCDD.h"
+
+/// Namespace for the AIDA detector description toolkit
+namespace DD4hep {
+
+  /// Namespace for the AIDA detector description toolkit supporting XML utilities
+  namespace XML {
+
+    /// Create a solid shape using the plugin mechanism from the attributes of the XML element
+    Geometry::Solid createShape(Geometry::LCDD& lcdd, const std::string& shape_type, XML::Element element);
+
+  }  /* End namespace XML              */
+}    /* End namespace DD4hep           */
+#endif    /* DD4hep_XML_XMLUTILITIES_H */
diff --git a/DDCore/src/FieldTypes.cpp b/DDCore/src/FieldTypes.cpp
index c10fa1275c8b3b551ecc744e88c32f1285b49300..456814e36dd7f1c5a73e96442d7ceb752be71eea 100644
--- a/DDCore/src/FieldTypes.cpp
+++ b/DDCore/src/FieldTypes.cpp
@@ -57,17 +57,16 @@ DipoleField::DipoleField()
 
 /// Call to access the field components at a given location
 void DipoleField::fieldComponents(const double* pos, double* field) {
-  double bx = 0, z = pos[2], r = sqrt(pos[0] * pos[0] + pos[1] * pos[1]);
-
+  double z = pos[2], r = sqrt(pos[0] * pos[0] + pos[1] * pos[1]);
   // Check if z coordinate is within dipole z bounds.
   if (z > zmin && z < zmax && r < rmax) {
     // Apply all coefficients to this z coordinate.
-    double pp = 1.0;
+    double pp    = 1.0;
     double abs_z = fabs(z);
-    bx = coefficents[0];
+    double bx    = coefficents[0];
     for (size_t i = 1; i < coefficents.size(); ++i) {
       pp *= abs_z;
-      bx += coefficents[i] * abs_z;
+      bx += coefficents[i] * pp;
     }
     // Flip sign for negative z.
     if (z < 0)
diff --git a/DDCore/src/GeometryTreeDump.cpp b/DDCore/src/GeometryTreeDump.cpp
index 02d4d8976168ab32e0caac89fe1a0ad47cb1778b..ab3f49b42d65b055cdc5507dce7ec80db8361901 100644
--- a/DDCore/src/GeometryTreeDump.cpp
+++ b/DDCore/src/GeometryTreeDump.cpp
@@ -259,7 +259,7 @@ static void dumpStructure(PlacedVolume pv, int level) {
   ::printf(fmt, level, "", "  ->path:", _path.c_str());
   if (num_children > 0) {
     for (int i = 0; i < num_children; ++i) {
-      TGeoNode* node = (TGeoNode*) nodes->At(i);
+      TGeoNode* node = static_cast<TGeoNode*>(nodes->At(i));
       dumpStructure(PlacedVolume(node), level + 1);
     }
   }
diff --git a/DDCore/src/LCDDData.cpp b/DDCore/src/LCDDData.cpp
index 69841326c93574539e1f3e956e8ea5dedec94703..d3e2f3287a06c1bfa0c1476c86453ddfd65c5cce 100644
--- a/DDCore/src/LCDDData.cpp
+++ b/DDCore/src/LCDDData.cpp
@@ -40,6 +40,8 @@ LCDDData::~LCDDData() {
 /// Clear data content: releases all allocated resources
 void LCDDData::destroyData(bool destroy_mgr)   {
   m_extensions.clear();
+  m_motherVolumes.clear();
+
   destroyHandle(m_world);
   destroyHandle(m_field);
   destroyHandle(m_header);
@@ -74,6 +76,7 @@ void LCDDData::destroyData(bool destroy_mgr)   {
 /// Clear data content: releases all allocated resources
 void LCDDData::clearData()   {
   m_extensions.clear(false);
+  m_motherVolumes.clear();
   m_world.clear();
   m_field.clear();
   m_header.clear();
@@ -100,6 +103,7 @@ void LCDDData::clearData()   {
 /// Adopt all data from source structure
 void LCDDData::adoptData(LCDDData& source)   {
   m_extensions = source.m_extensions;
+  m_motherVolumes = source.m_motherVolumes;
   m_world = source.m_world;
   m_field = source.m_field;
   m_header = source.m_header;
diff --git a/DDCore/src/LCDDImp.cpp b/DDCore/src/LCDDImp.cpp
index 44cb349e071d706cf2f8b19ccca5b8138bf20601..45b735ac2302ba5217922ad77470a79af37430b9 100644
--- a/DDCore/src/LCDDImp.cpp
+++ b/DDCore/src/LCDDImp.cpp
@@ -135,7 +135,7 @@ LCDDImp::LCDDImp() : LCDDData(), LCDDLoad(this), m_buildType(BUILD_NONE)
 /// Standard destructor
 LCDDImp::~LCDDImp() {
   if ( m_manager == gGeoManager ) gGeoManager = 0;
-  destroyData();
+  destroyData(false);
   InstanceCount::decrement(this);
 }
 
@@ -160,14 +160,55 @@ void* LCDDImp::userExtension(const std::type_info& info, bool alert) const {
   return m_extensions.extension(info,alert);
 }
 
-Volume LCDDImp::pickMotherVolume(const DetElement&) const {     // throw if not existing
-  return m_worldVol;
+/// Register new mother volume using the detector name.
+void LCDDImp::declareMotherVolume(const std::string& detector_name, const Volume& vol)  {
+  if ( !detector_name.empty() )  {
+    if ( vol.isValid() )  {
+      HandleMap::const_iterator i = m_motherVolumes.find(detector_name);
+      if (i == m_motherVolumes.end())   {
+	m_motherVolumes.insert(make_pair(detector_name,vol));
+	return;
+      }
+      throw runtime_error("LCDD: A mother volume to the detector "+detector_name+" was already registered.");
+    }
+    throw runtime_error("LCDD: Attempt to register invalid mother volume for detector:"+detector_name+" [Invalid-Handle].");
+  }
+  throw runtime_error("LCDD: Attempt to register mother volume to invalid detector [Invalid-detector-name].");
 }
 
-LCDD& LCDDImp::addDetector(const Ref_t& x) {
-  m_detectors.append(x);
-  m_world.add(DetElement(x));
-  return *this;
+/// Access mother volume by detector element
+Volume LCDDImp::pickMotherVolume(const DetElement& de) const {
+  if ( de.isValid() )   {
+    string de_name = de.name();
+    HandleMap::const_iterator i = m_motherVolumes.find(de_name);
+    if (i == m_motherVolumes.end())   {
+      return m_worldVol;
+    }
+    return (*i).second;
+  }
+  throw runtime_error("LCDD: Attempt access mother volume of invalid detector [Invalid-handle]");
+}
+
+LCDD& LCDDImp::addDetector(const Ref_t& ref_det) {
+  DetElement detector(ref_det);
+  m_detectors.append(ref_det);
+  Volume volume = detector.placement()->GetMotherVolume();
+  if ( volume == m_worldVol )  {
+    printout(DEBUG,"LCDD","Added detector %s to the world instance.",detector.name());
+    m_world.add(detector);
+    return *this;
+  }
+  // The detector's placement must be one of the existing detectors
+  for(HandleMap::iterator i = m_detectors.begin(); i!=m_detectors.end(); ++i)  {
+    DetElement parent((*i).second);
+    Volume vol = parent.placement().volume();
+    if ( vol == volume )  {
+      printout(INFO,"LCDD","Added detector %s to the parent:%s.",detector.name(),parent.name());
+      parent.add(detector);
+      return *this;
+    }
+  }
+  throw runtime_error("LCDD: The detector" + string(detector.name()) + " has no known parent.");
 }
 
 /// Typed access to constants: access string values
diff --git a/DDCore/src/LCDDImp.h b/DDCore/src/LCDDImp.h
index b77def98e875e397a9aa73046607b3e732f49fa1..538d249d9b17daeb943546efce50ecc7e909236e 100644
--- a/DDCore/src/LCDDImp.h
+++ b/DDCore/src/LCDDImp.h
@@ -76,12 +76,19 @@ namespace DD4hep {
 
       /// Add an extension object to the LCDD instance
       virtual void* addUserExtension(void* ptr, const std::type_info& info, void (*destruct)(void*));
+
       /// Remove an existing extension object from the LCDD instance. If not destroyed, the instance is returned
       virtual void* removeUserExtension(const std::type_info& info, bool destroy=true);
+
       /// Access an existing extension object from the LCDD instance
       virtual void* userExtension(const std::type_info& info, bool alert=true) const;
 
       virtual Handle<TObject> getRefChild(const HandleMap& e, const std::string& name, bool throw_if_not = true) const;
+
+      /// Register new mother volume using the detector name.
+      virtual void   declareMotherVolume(const std::string& detector_name, const Volume& vol);
+
+      /// Access mother volume by detector element
       virtual Volume pickMotherVolume(const DetElement& sd) const;
 
       /// Access the geometry manager of this instance
@@ -139,8 +146,10 @@ namespace DD4hep {
 
       /// Typed access to constants: access string values
       virtual std::string constantAsString(const std::string& name) const;
+
       /// Typed access to constants: long values
       virtual long constantAsLong(const std::string& name) const;
+
       /// Typed access to constants: double values
       virtual double constantAsDouble(const std::string& name) const;
 
diff --git a/DDCore/src/Plugins.cpp b/DDCore/src/Plugins.cpp
index bb2b494242b2d53be6e5616f21f9a7e598027ec6..f9f5e10f3eec5346393c66bd4374973641ae7295 100644
--- a/DDCore/src/Plugins.cpp
+++ b/DDCore/src/Plugins.cpp
@@ -6,32 +6,83 @@
 //  Author     : M.Frank
 //
 //====================================================================
-
-#include "DD4hep/Plugins.h"
-#include "Reflex/Reflex.h"
+#include "DD4hep/LCDD.h"
+#include "DD4hep/Handle.h"
+#include "DD4hep/Plugins.inl"
+#include "XML/XMLElements.h"
 
 using namespace std;
 using namespace DD4hep;
-using namespace ROOT::Reflex;
+
+namespace {
+  inline int* s_debug_value()   {
+    static int s_debug_value = ::getenv("DD4HEP_TRACE") == 0 ? 0 : 1;
+    return &s_debug_value;
+  }
+}
+
+bool PluginService::debug()  {
+  return *s_debug_value() ? true : false;
+}
+
+bool PluginService::setDebug(bool new_value)   {
+  int *ptr = s_debug_value();
+  bool old_value = *ptr;
+  *ptr = new_value ? 1 : 0;
+  return old_value;
+}
+
+#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
 
 /// Default constructor
 PluginDebug::PluginDebug(int dbg)
   : m_debug(0) {
-  m_debug = PluginService::Debug();
-  PluginService::SetDebug(dbg);
+  m_debug = ROOT::Reflex::PluginService::Debug();
+  ROOT::Reflex::PluginService::SetDebug(dbg);
 }
 
 /// Default destructor
 PluginDebug::~PluginDebug() {
-  PluginService::SetDebug (m_debug);
+  ROOT::Reflex::PluginService::SetDebug (m_debug);
 }
 
 /// Helper to check factory existence
 string PluginDebug::missingFactory(const string& name) const {
-  string msg = "";
-  Scope factories = Scope::ByName(PLUGINSVC_FACTORY_NS);
-  string factoryname = PluginService::FactoryName(name);
-  msg = "\n\t\tNo factory with name " + factoryname + " for type " + name + " found.\n\t\tPlease check library load path.";
+  ROOT::Reflex::Scope factories = ROOT::Reflex::Scope::ByName(PLUGINSVC_FACTORY_NS);
+  string factoryname = ROOT::Reflex::PluginService::FactoryName(name);
+  string msg = "\n\t\tNo factory with name " + factoryname + " for type " + name + " found.\n\t\tPlease check library load path.";
   return msg;
 }
 
+#else   // ROOT 6
+
+// Do not know yet what code to really put in there.....at least it presevers the interfaces and links
+
+/// Default constructor
+PluginDebug::PluginDebug(int)
+  : m_debug(0) {
+}
+
+/// Default destructor
+PluginDebug::~PluginDebug() {
+}
+
+/// Helper to check factory existence
+string PluginDebug::missingFactory(const string& name) const {
+  string factoryname = "??? Create("+name+")";
+  string msg = "\n\t\tNo factory with name " + factoryname + " for type " + name + " found.\n\t\tPlease check library load path.";
+  return msg;
+}
+
+#endif
+
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(NamedObject*, (Geometry::LCDD*,XML::Handle_t*,Geometry::Ref_t*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(NamedObject*, (Geometry::LCDD*,XML::Handle_t*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(NamedObject*, (Geometry::LCDD*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*,XML::Handle_t*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*,XML::Handle_t const*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*, int, char**))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (Geometry::LCDD*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, ())
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(void*, (const char*))
+
diff --git a/DDCore/src/Printout.cpp b/DDCore/src/Printout.cpp
index d6de1b0b02b8bbe2c06cde3286cf3b50a7ef476b..f1a79006ca98470f295302212d657c32f4108a88 100644
--- a/DDCore/src/Printout.cpp
+++ b/DDCore/src/Printout.cpp
@@ -14,6 +14,8 @@
 #include <cstdarg>
 #include <stdexcept>
 
+using namespace std;
+
 static size_t _the_printer(void*, DD4hep::PrintLevel, const char* src, const char* text) {
   size_t len = ::fputs(src, stdout);
   len += fputs(": ", stdout);
@@ -48,7 +50,7 @@ int DD4hep::printout(PrintLevel severity, const char* src, const char* fmt, ...)
  *  @arg fmt        [string,read-only]   Format string for ellipsis args
  *  @return Status code indicating success or failure
  */
-int DD4hep::printout(PrintLevel severity, const std::string& src, const char* fmt, ...) {
+int DD4hep::printout(PrintLevel severity, const string& src, const char* fmt, ...) {
   if (severity >= print_lvl) {
     va_list args;
     va_start(args, fmt);
@@ -64,7 +66,7 @@ int DD4hep::printout(PrintLevel severity, const std::string& src, const char* fm
  *  @arg fmt        [string,read-only]   Format string for ellipsis args
  *  @return Status code indicating success or failure
  */
-int DD4hep::printout(PrintLevel severity, const char* src, const std::string& fmt, ...) {
+int DD4hep::printout(PrintLevel severity, const char* src, const string& fmt, ...) {
   if (severity >= print_lvl) {
     va_list args;
     va_start(args, &fmt);
@@ -80,7 +82,7 @@ int DD4hep::printout(PrintLevel severity, const char* src, const std::string& fm
  *  @arg fmt        [string,read-only]   Format string for ellipsis args
  *  @return Status code indicating success or failure
  */
-int DD4hep::printout(PrintLevel severity, const std::string& src, const std::string& fmt, ...) {
+int DD4hep::printout(PrintLevel severity, const string& src, const string& fmt, ...) {
   if (severity >= print_lvl) {
     va_list args;
     va_start(args, &fmt);
@@ -113,7 +115,7 @@ int DD4hep::printout(PrintLevel severity, const char* src, const char* fmt, va_l
  *  @arg fmt        [string,read-only]   Format string for ellipsis args
  *  @return Status code indicating success or failure
  */
-int DD4hep::printout(PrintLevel severity, const std::string& src, const char* fmt, va_list& args) {
+int DD4hep::printout(PrintLevel severity, const string& src, const char* fmt, va_list& args) {
   return printout(severity, src.c_str(), fmt, args);
 }
 
@@ -123,7 +125,7 @@ int DD4hep::printout(PrintLevel severity, const std::string& src, const char* fm
  *  @arg fmt        [string,read-only]   Format string for ellipsis args
  *  @return Status code indicating success or failure
  */
-int DD4hep::printout(PrintLevel severity, const char* src, const std::string& fmt, va_list& args) {
+int DD4hep::printout(PrintLevel severity, const char* src, const string& fmt, va_list& args) {
   return printout(severity, src, fmt.c_str(), args);
 }
 
@@ -133,19 +135,88 @@ int DD4hep::printout(PrintLevel severity, const char* src, const std::string& fm
  *  @arg fmt        [string,read-only]   Format string for ellipsis args
  *  @return Status code indicating success or failure
  */
-int DD4hep::printout(PrintLevel severity, const std::string& src, const std::string& fmt, va_list& args) {
+int DD4hep::printout(PrintLevel severity, const string& src, const string& fmt, va_list& args) {
   return printout(severity, src.c_str(), fmt.c_str(), args);
 }
 
-/** Build exception string and throw std::runtime_error
+/** Calls the display action with ERROR and throws an std::runtime_error exception
  *  @arg src        [string,read-only]   Information source (component, etc.)
  *  @arg fmt        [string,read-only]   Format string for ellipsis args
  *  @return Status code indicating success or failure
  */
-std::string DD4hep::format(const std::string& src, const std::string& fmt, ...) {
+void DD4hep::except(const string& src, const string& fmt, ...) {
   va_list args;
   va_start(args, &fmt);
-  std::string str = format(src, fmt, args);
+  string msg = format(src.c_str(), fmt.c_str(), args);
+  printout(ERROR, src.c_str(), fmt.c_str(), args);
+  va_end(args);
+  throw runtime_error(msg.c_str());
+}
+
+/** Calls the display action with ERROR and throws an std::runtime_error exception
+ *  @arg src        [string,read-only]   Information source (component, etc.)
+ *  @arg fmt        [string,read-only]   Format string for ellipsis args
+ *  @return Status code indicating success or failure
+ */
+void DD4hep::except(const char* src, const char* fmt, ...) {
+  va_list args;
+  va_start(args, fmt);
+  string msg = format(src, fmt, args);
+  printout(ERROR, src, fmt, args);
+  va_end(args);
+  throw runtime_error(msg.c_str());
+}
+
+/** Calls the display action with ERROR and throws an std::runtime_error exception
+ *  @arg src        [string,read-only]   Information source (component, etc.)
+ *  @arg fmt        [string,read-only]   Format string for ellipsis args
+ *  @arg args       [ap_list,read-only]  List with variable number of arguments to fill format string.
+ *  @return Status code indicating success or failure
+ */
+void DD4hep::except(const string& src, const string& fmt, va_list& args) {
+  string msg = format(src.c_str(), fmt.c_str(), args);
+  printout(ERROR, src.c_str(), fmt.c_str(), args);
+  // No return. Must call va_end here!
+  va_end(args);
+  throw runtime_error(msg.c_str());
+}
+
+/** Calls the display action with ERROR and throws an std::runtime_error exception
+ *  @arg src        [string,read-only]   Information source (component, etc.)
+ *  @arg fmt        [string,read-only]   Format string for ellipsis args
+ *  @arg args       [ap_list,read-only]  List with variable number of arguments to fill format string.
+ *  @return Status code indicating success or failure
+ */
+void DD4hep::except(const char* src, const char* fmt, va_list& args) {
+  string msg = format(src, fmt, args);
+  printout(ERROR, src, fmt, args);
+  // No return. Must call va_end here!
+  va_end(args);
+  throw runtime_error(msg.c_str());
+}
+
+/** Build exception string
+ *  @arg src        [string,read-only]   Information source (component, etc.)
+ *  @arg fmt        [string,read-only]   Format string for ellipsis args
+ *  @return Status code indicating success or failure
+ */
+string DD4hep::format(const string& src, const string& fmt, ...) {
+  va_list args;
+  va_start(args, &fmt);
+  string str = format(src, fmt, args);
+  va_end(args);
+  return str;
+}
+
+/** Build exception string
+ *  @arg src        [string,read-only]   Information source (component, etc.)
+ *  @arg fmt        [string,read-only]   Format string for ellipsis args
+ *  @return Status code indicating success or failure
+ */
+string DD4hep::format(const char* src, const char* fmt, ...) {
+  va_list args;
+  va_start(args, fmt);
+  string str = format(src, fmt, args);
   va_end(args);
   return str;
 }
@@ -156,11 +227,21 @@ std::string DD4hep::format(const std::string& src, const std::string& fmt, ...)
  *  @arg args       [ap_list,read-only]  List with variable number of arguments to fill format string.
  *  @return Status code indicating success or failure
  */
-std::string DD4hep::format(const std::string& src, const std::string& fmt, va_list& args) {
+string DD4hep::format(const string& src, const string& fmt, va_list& args) {
+  return format(src.c_str(), fmt.c_str(), args);
+}
+
+/** Build exception string and throw std::runtime_error
+ *  @arg src        [string,read-only]   Information source (component, etc.)
+ *  @arg fmt        [string,read-only]   Format string for ellipsis args
+ *  @arg args       [ap_list,read-only]  List with variable number of arguments to fill format string.
+ *  @return Status code indicating success or failure
+ */
+string DD4hep::format(const char* src, const char* fmt, va_list& args) {
   char str[4096];
-  size_t len = ::snprintf(str, sizeof(str), "%s: ", src.c_str());
-  ::vsnprintf(str + len, sizeof(str) - len, fmt.c_str(), args);
-  return std::string(str);
+  size_t len = ::snprintf(str, sizeof(str), "%s: ", src);
+  ::vsnprintf(str + len, sizeof(str) - len, fmt, args);
+  return string(str);
 }
 
 /// Set new print level. Returns the old print level
diff --git a/DDCore/src/VolumeManager.cpp b/DDCore/src/VolumeManager.cpp
index 8bd0bab22fa2a6cb2156630e7e9eb0180c13d36c..30fe81e94c6e9b1924cc2538ad5f5138f7e00fbd 100644
--- a/DDCore/src/VolumeManager.cpp
+++ b/DDCore/src/VolumeManager.cpp
@@ -73,7 +73,7 @@ namespace {
       return DetElement();
     }
     /// Scan a single physical volume and look for sensitive elements below
-    size_t scanPhysicalVolume(DetElement parent, DetElement e, PlacedVolume pv, VolIDs ids, SensitiveDetector& sd,Chain& chain) {
+    size_t scanPhysicalVolume(DetElement& parent, DetElement e, PlacedVolume pv, VolIDs ids, SensitiveDetector& sd, Chain& chain) {
       TGeoNode* node = pv.ptr();
       size_t count = 0;
       if (node) {
@@ -82,10 +82,10 @@ namespace {
         VolIDs pv_ids = pv.volIDs();
         ids.VolIDs::Base::insert(ids.end(), pv_ids.begin(), pv_ids.end());
         bool got_readout = false;
-        if (vol.isSensitive()) {
+        if (vol.isSensitive())  {
           sd = vol.sensitiveDetector();
           Readout ro = sd.readout();
-          if (ro.isValid()) {
+	  if ( sd.isValid() && ro.isValid() )   {
             got_readout = true;
             add_entry(sd, parent, e, node, ids, chain);
             ++count;
@@ -153,19 +153,21 @@ namespace {
     void add_entry(SensitiveDetector sd, DetElement parent, DetElement e, const TGeoNode* n, const VolIDs& ids, Chain& nodes) {
       Readout ro = sd.readout();
       IDDescriptor iddesc = ro.idSpec();
-      VolumeManager section = m_volManager.addSubdetector(parent, ro);
       pair<VolumeID, VolumeID> code = encoding(iddesc, ids);
 
       if (m_entries.find(code.first) == m_entries.end()) {
+	string        sd_name      = sd.name();
+	DetElement    sub_detector = m_lcdd.detector(sd_name);
+	VolumeManager section      = m_volManager.addSubdetector(sub_detector, ro);
         // This is the block, we effectively have to save for each physical volume with a VolID
         VolumeManager::Context* context = new VolumeManager::Context;
         context->identifier = code.first;
-        context->mask = code.second;
-        context->detector = parent;
-        context->placement = PlacedVolume(n);
-        context->element = e;
-        context->volID = ids;
-        context->path = nodes;
+        context->mask       = code.second;
+        context->detector   = parent;
+        context->placement  = PlacedVolume(n);
+        context->element    = e;
+        context->volID      = ids;
+        context->path       = nodes;
         for (size_t i = nodes.size(); i > 1; --i) {   // Omit the placement of the parent DetElement
           TGeoMatrix* m = nodes[i - 1]->GetMatrix();
           context->toWorld.MultiplyLeft(m);
@@ -180,7 +182,7 @@ namespace {
       }
     }
 
-    void print_node(SensitiveDetector sd, DetElement /* parent */, DetElement e,
+    void print_node(SensitiveDetector sd, DetElement parent, DetElement e,
                     const TGeoNode* n, const VolIDs& ids, const Chain& /* nodes */)
     {
       static int s_count = 0;
@@ -194,7 +196,7 @@ namespace {
       //if ( !sensitive ) return;
       ++s_count;
       stringstream log;
-      log << s_count << ": " << e.name() << " de:" << e.ptr() << " ro:" << ro.ptr() << " pv:" << n->GetName() << " id:"
+      log << s_count << ": " << parent.name() << ": " << e.name() << " ro:" << ro.ptr() << " pv:" << n->GetName() << " id:"
           << (void*) volume_id << " : ";
       for (VolIDs::const_iterator i = ids.begin(); i != ids.end(); ++i) {
         const PlacedVolume::VolID& id = (*i);
@@ -241,6 +243,10 @@ VolumeManager::VolumeManager(DetElement subdetector, Readout ro)  {
 VolumeManager VolumeManager::addSubdetector(DetElement detector, Readout ro) {
   if (isValid()) {
     Object& o = _data();
+    if (!detector.isValid()) {
+      throw runtime_error("DD4hep: VolumeManager::addSubdetector: Only valid subdetectors "
+			  "are allowed. [Invalid DetElement]");
+    }
     Detectors::const_iterator i = o.subdetectors.find(detector);
     if (i == o.subdetectors.end()) {
       string det_name = detector.name();
diff --git a/DDCore/src/Volumes.cpp b/DDCore/src/Volumes.cpp
index 9bb16d7930297b6c595951a9607e6edb457d6d3f..934b21c42cc6801ef7202643fb038f6a35cf3423 100644
--- a/DDCore/src/Volumes.cpp
+++ b/DDCore/src/Volumes.cpp
@@ -204,9 +204,8 @@ namespace DD4hep {
         // if volume is divided, copy finder
         vol->SetFinder(fFinder);
         // copy voxels
-        TGeoVoxelFinder *voxels = 0;
         if (fVoxels) {
-          voxels = new TGeoVoxelFinder(vol);
+          TGeoVoxelFinder *voxels = new TGeoVoxelFinder(vol);
           vol->SetVoxelFinder(voxels);
         }
         // copy option, uid
@@ -243,9 +242,8 @@ namespace DD4hep {
         vol->MakeCopyNodes(this);
         ((TGeoShapeAssembly*) vol->GetShape())->NeedsBBoxRecompute();
         // copy voxels
-        TGeoVoxelFinder *voxels = 0;
         if (fVoxels) {
-          voxels = new TGeoVoxelFinder(vol);
+          TGeoVoxelFinder *voxels = new TGeoVoxelFinder(vol);
           vol->SetVoxelFinder(voxels);
         }
         // copy option, uid
@@ -507,7 +505,7 @@ static PlacedVolume _addNode(TGeoVolume* par, TGeoVolume* daughter, TGeoMatrix*
     }
   }
   parent->AddNode(daughter, id, transform);
-  geo_node_t* n = (geo_node_t*)parent->GetNode(id);
+  geo_node_t* n = static_cast<geo_node_t*>(parent->GetNode(id));
   n->geo_node_t::SetUserExtension(new PlacedVolume::Object());
   return PlacedVolume(n);
 }
diff --git a/DDCore/src/XML/Utilities.cpp b/DDCore/src/XML/Utilities.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..dfe91e777cf136e7585ec7c5b467aa8c6a09a7aa
--- /dev/null
+++ b/DDCore/src/XML/Utilities.cpp
@@ -0,0 +1,31 @@
+// $Id: XMLDetector.cpp 1479 2014-12-18 16:00:45Z markus.frank@cern.ch $
+//====================================================================
+//  AIDA Detector description implementation
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+// Framework include files
+#include "XML/Utilities.h"
+#include "DD4hep/Printout.h"
+#include "DD4hep/Plugins.h"
+#include "DD4hep/LCDD.h"
+
+using namespace std;
+using namespace DD4hep;
+
+/// Create a solid shape using the plugin mechanism from the attributes of the XML element
+Geometry::Solid 
+DD4hep::XML::createShape(Geometry::LCDD& lcdd, const std::string& shape_type, XML::Element element)   {
+  string fac  = shape_type + "__shape_constructor";
+  XML::Handle_t solid_elt = element;
+  Geometry::Solid solid = Geometry::Ref_t(PluginService::Create<NamedObject*>(fac, &lcdd, &solid_elt));
+  if ( !solid.isValid() )  {
+    PluginDebug dbg;
+    PluginService::Create<NamedObject*>(shape_type, &lcdd, &solid_elt);
+    except("XML::createShape","Failed to create solid of type %s [%s]", 
+	   shape_type.c_str(),dbg.missingFactory(shape_type).c_str());
+  }
+  return solid;
+}
diff --git a/DDCore/src/XML/XMLElements.cpp b/DDCore/src/XML/XMLElements.cpp
index 5ceddf6ad228a7e4cf96ee43d48e7e88c03aca33..101bde38759e7d71243012b2f6d59c703f43c80a 100644
--- a/DDCore/src/XML/XMLElements.cpp
+++ b/DDCore/src/XML/XMLElements.cpp
@@ -682,7 +682,7 @@ Handle_t Handle_t::remove(Handle_t node) const {
     msg += "Element [" + tag() + "] has no child of type '" + node.tag() + "'";
   else if (node)
     msg += "Element [INVALID]. Cannot remove child of type: '" + node.tag() + "'";
-  else if (node)
+  else if (!node)
     msg += "Element [INVALID]. Cannot remove [INVALID] child. Big Shit!!!!";
 
   throw runtime_error(msg);
@@ -901,13 +901,12 @@ static unsigned int adler32(unsigned int adler, const XmlChar* xml_buff, size_t
   unsigned int s1 = adler & 0xffff;
   unsigned int s2 = (adler >> 16) & 0xffff;
   const char* buf = (const char*)xml_buff;
-  int k;
 
   if (buf == NULL)
     return 1;
 
   while (len > 0) {
-    k = len < NMAX ? (int) len : NMAX;
+    int k = len < NMAX ? (int) len : NMAX;
     len -= k;
     while (k >= 16) {
       DO16(buf);
diff --git a/DDCore/src/plugins/Compact2Objects.cpp b/DDCore/src/plugins/Compact2Objects.cpp
index 7a0198d6dc3963001f2ae8e95386c47d140d17e9..9af17febaf58072526dba3ecb78f682d9c77d242 100644
--- a/DDCore/src/plugins/Compact2Objects.cpp
+++ b/DDCore/src/plugins/Compact2Objects.cpp
@@ -17,7 +17,7 @@
 #include "DD4hep/objects/DetectorInterna.h"
 
 #include "XML/DocumentHandler.h"
-#include "XML/Conversions.h"
+#include "XML/Utilities.h"
 
 // Root/TGeo include files
 #include "TGeoManager.h"
@@ -185,15 +185,7 @@ static Ref_t create_MultipoleField(lcdd_t& lcdd, xml_h e) {
   }
   if ((child = c.child(_U(shape), false))) {      // Shape is not mandatory
     string type = child.typeStr();
-    string fac  = type + "__shape_constructor";
-    xml_h  solid_elt = child;
-    Solid solid = Ref_t(PluginService::Create<NamedObject*>(fac, &lcdd, &solid_elt));
-    if ( !solid.isValid() )  {
-      PluginDebug dbg;
-      PluginService::Create<NamedObject*>(type, &lcdd, &solid_elt);
-      throw_print("Failed to create solid of type " + type + ". " + dbg.missingFactory(type));
-    }
-    ptr->volume = solid;
+    ptr->volume = XML::createShape(lcdd, type, child);
   }
   ptr->B_z = bz;
   ptr->transform = Transform3D(rot,pos).Inverse();
@@ -295,18 +287,18 @@ template <> void Converter<Material>::operator()(xml_h e) const {
   TGeoMixture* mix = dynamic_cast<TGeoMixture*>(mat);
   xml_coll_t fractions(m, _U(fraction));
   xml_coll_t composites(m, _U(composite));
-  bool has_density = true;
 
   if (0 == mat) {
     TGeoMaterial* comp_mat;
     TGeoElement* comp_elt;
-    xml_h radlen = m.child(_U(RL), false);
-    xml_h intlen = m.child(_U(NIL), false);
-    xml_h density = m.child(_U(D), false);
-    double radlen_val = radlen.ptr() ? radlen.attr<double>(_U(value)) : 0.0;
-    double intlen_val = intlen.ptr() ? intlen.attr<double>(_U(value)) : 0.0;
-    double dens_val   = density.ptr() ? density.attr<double>(_U(value)) : 0.0;
-    double dens_unit  = 1.0;
+    xml_h  radlen      = m.child(_U(RL), false);
+    xml_h  intlen      = m.child(_U(NIL), false);
+    xml_h  density     = m.child(_U(D), false);
+    double radlen_val  = radlen.ptr()  ? radlen.attr<double>(_U(value)) : 0.0;
+    double intlen_val  = intlen.ptr()  ? intlen.attr<double>(_U(value)) : 0.0;
+    double dens_val    = density.ptr() ? density.attr<double>(_U(value)) : 0.0;
+    double dens_unit   = 1.0;
+    bool   has_density = true;
     if ( 0 == mat && !density.ptr() ) {
       has_density = false;
     }
@@ -344,7 +336,7 @@ template <> void Converter<Material>::operator()(xml_h e) const {
       else if (0 != (comp_elt = table->FindElement(nam.c_str())))
         fraction *= comp_elt->A();
       else
-        throw_print("Compact2Objects[ERROR]: Converting material:" + mname + " Element missing: " + nam);
+	except("Compact2Objects","Converting material: %s Element missing: %s",mname.c_str(),nam.c_str());
       composite_fractions_total += fraction;
       composite_fractions.push_back(fraction);
     }
@@ -777,9 +769,26 @@ template <> void Converter<DetElement>::operator()(xml_h element) const {
   if (ign_typs && strstr(ign_typs, type_match.c_str()))
     return;
   try {
-    xml_attr_t attr_ro = element.attr_nothrow(_U(readout));
+    xml_attr_t attr_par = element.attr_nothrow(_U(parent));
+    if (attr_par) {
+      // We have here a nested detector. If the mother volume is not yet registered
+      // it must be done here, so that the detector constructor gets the correct answer from
+      // the call to LCDD::pickMotherVolume(DetElement).
+      string par_name = element.attr<string>(attr_par);
+      DetElement parent_detector = lcdd.detector(par_name);
+      if ( !parent_detector.isValid() )  {
+	except("Compact","Failed to access valid parent detector of %s",name.c_str());
+      }
+      Volume parent_volume = parent_detector.placement().volume();
+      if ( !parent_volume.isValid() )   {
+	except("Compact","Failed to access valid parent volume of %s from %s",
+	       name.c_str(), par_name.c_str());
+      }
+      lcdd.declareMotherVolume(name, parent_volume);
+    }
+    xml_attr_t attr_ro  = element.attr_nothrow(_U(readout));
     SensitiveDetector sd;
-    if (attr_ro) {
+    if (attr_ro)   {
       Readout ro = lcdd.readout(element.attr<string>(attr_ro));
       if (!ro.isValid()) {
         throw runtime_error("No Readout structure present for detector:" + name);
diff --git a/DDCore/src/plugins/ShapePlugins.cpp b/DDCore/src/plugins/ShapePlugins.cpp
index 6f879d27bf6a11a9080721a5acd0b710a81dfaa6..070f3181206f3bbad6904dbede05a05d910a6d9f 100644
--- a/DDCore/src/plugins/ShapePlugins.cpp
+++ b/DDCore/src/plugins/ShapePlugins.cpp
@@ -11,11 +11,20 @@
 
 // Framework include files
 #include "DD4hep/DetFactoryHelper.h"
+#include "TGeoShapeAssembly.h"
 
 using namespace std;
 using namespace DD4hep;
 using namespace DD4hep::Geometry;
 
+#if 0
+static Ref_t create_Assembly(lcdd_t&, xml_h e)   {
+  xml_dim_t dim(e);
+  return Ref_t(new TGeoShapeAssembly());
+}
+DECLARE_XMLELEMENT(Assembly__shape_constructor,create_Assembly)
+#endif
+
 static Ref_t create_Box(lcdd_t&, xml_h e)   {
   xml_dim_t dim(e);
   return Box(dim.dx(),dim.dy(),dim.dz());
@@ -42,13 +51,13 @@ DECLARE_XMLELEMENT(Polycone__shape_constructor,create_Polycone)
 
 static Ref_t create_ConeSegment(lcdd_t&, xml_h element)   {
   xml_dim_t e(element);
-  return ConeSegment(e.rmin(0.0),e.rmax(),e.z(0.0),e.startphi(0.0),e.deltaphi(2*M_PI));
+  return ConeSegment(e.rmin(0.0),e.rmax(),e.dz(0.0),e.startphi(0.0),e.deltaphi(2*M_PI));
 }
 DECLARE_XMLELEMENT(ConeSegment__shape_constructor,create_ConeSegment)
 
 static Ref_t create_Tube(lcdd_t&, xml_h element)   {
   xml_dim_t e(element);
-  return Tube(e.rmin(0.0),e.rmax(),e.z(0.0),e.startphi(0.0),e.deltaphi(2*M_PI));
+  return Tube(e.rmin(0.0),e.rmax(),e.dz(0.0),e.startphi(0.0),e.deltaphi(2*M_PI));
 }
 DECLARE_XMLELEMENT(Tube__shape_constructor,create_Tube)
 
diff --git a/DDCore/src/plugins/StandardPlugins.cpp b/DDCore/src/plugins/StandardPlugins.cpp
index 1007bbb05800d2488242c3f68e485f9548c673b3..97a4ab816be24188392c435c894404b3cfb893a2 100644
--- a/DDCore/src/plugins/StandardPlugins.cpp
+++ b/DDCore/src/plugins/StandardPlugins.cpp
@@ -159,25 +159,27 @@ DECLARE_APPLY(DD4hepRootLoader,load_geometryFromroot)
  *  @date    01/04/2014
  */
 static long dump_volume_tree(LCDD& lcdd, int , char** ) {
-  struct Actor { static long dump(TGeoNode* ideal, TGeoNode* aligned,int level) {
-    char fmt[256];
-    if ( ideal == aligned )  {
-      ::snprintf(fmt,sizeof(fmt),"%03d %%-%ds %%s \t\tNode:%p",level+1,2*level+1,(void*)ideal);
-    }
-    else  {
-      ::snprintf(fmt,sizeof(fmt),"%03d %%-%ds %%s Ideal node:%p Aligned node:%p",
-                 level+1,2*level+1,(void*)ideal,(void*)aligned);
-    }
-    printout(INFO,"+++",fmt,"",aligned->GetName());
-    TGeoVolume* volume = ideal->GetVolume();
-    for (Int_t idau = 0, ndau = aligned->GetNdaughters(); idau < ndau; ++idau)  {
-      TGeoNode*   ideal_daughter   = ideal->GetDaughter(idau);
-      const char* daughter_name    = ideal_daughter->GetName();
-      TGeoNode*   aligned_daughter = volume->GetNode(daughter_name);
-      Actor::dump(ideal_daughter,aligned_daughter,level+1);
+  struct Actor {
+    static long dump(TGeoNode* ideal, TGeoNode* aligned,int level) {
+      char fmt[256];
+      if ( ideal == aligned )  {
+	::snprintf(fmt,sizeof(fmt),"%03d %%-%ds %%s \t\tNode:%p",level+1,2*level+1,(void*)ideal);
+      }
+      else  {
+	::snprintf(fmt,sizeof(fmt),"%03d %%-%ds %%s Ideal node:%p Aligned node:%p",
+		   level+1,2*level+1,(void*)ideal,(void*)aligned);
+      }
+      printout(INFO,"+++",fmt,"",aligned->GetName());
+      TGeoVolume* volume = ideal->GetVolume();
+      for (Int_t idau = 0, ndau = aligned->GetNdaughters(); idau < ndau; ++idau)  {
+	TGeoNode*   ideal_daughter   = ideal->GetDaughter(idau);
+	const char* daughter_name    = ideal_daughter->GetName();
+	TGeoNode*   aligned_daughter = volume->GetNode(daughter_name);
+	dump(ideal_daughter,aligned_daughter,level+1);
+      }
+      return 1;
     }
-    return 1;
-  }};
+  };
   string place = lcdd.world().placementPath();
   DetectorTools::PlacementPath path;
   DetectorTools::placementPath(lcdd.world(), path);
@@ -194,17 +196,19 @@ DECLARE_APPLY(DD4hepVolumeDump,dump_volume_tree)
  *  @date    01/04/2014
  */
 static long dump_detelement_tree(LCDD& lcdd, int argc, char** argv) {
-  struct Actor { static long dump(DetElement de,int level, bool sensitive_only) {
-    const DetElement::Children& c = de.children();
-    char fmt[64];
-    if ( !sensitive_only || 0 != de.volumeID() )  {
-      ::sprintf(fmt,"%03d %%-%ds %%s #Dau:%%d VolID:%%p",level+1,2*level+1);
-      printout(INFO,"+++",fmt,"",de.placementPath().c_str(),int(c.size()),(void*)de.volumeID());
+  struct Actor {
+    static long dump(DetElement de,int level, bool sensitive_only) {
+      const DetElement::Children& c = de.children();
+      if ( !sensitive_only || 0 != de.volumeID() )  {
+	char fmt[64];
+	::sprintf(fmt,"%03d %%-%ds %%s #Dau:%%d VolID:%%p",level+1,2*level+1);
+	printout(INFO,"+++",fmt,"",de.placementPath().c_str(),int(c.size()),(void*)de.volumeID());
+      }
+      for (DetElement::Children::const_iterator i = c.begin(); i != c.end(); ++i)
+	dump((*i).second,level+1,sensitive_only);
+      return 1;
     }
-    for (DetElement::Children::const_iterator i = c.begin(); i != c.end(); ++i)
-      Actor::dump((*i).second,level+1,sensitive_only);
-    return 1;
-  }};
+  };
   bool sensitive_only = false;
   for(int i=0; i<argc; ++i)  {
     if ( ::strcmp(argv[i],"--sensitive")==0 ) { sensitive_only = true; }
@@ -220,16 +224,18 @@ DECLARE_APPLY(DD4hepDetectorDump,dump_detelement_tree)
  *  @date    01/04/2014
  */
 static long detelement_cache(LCDD& lcdd, int , char** ) {
-  struct Actor {  static long cache(DetElement de) {
-    const DetElement::Children& c = de.children();
-    de.worldTransformation();
-    de.parentTransformation();
-    de.placementPath();
-    de.path();
-    for (DetElement::Children::const_iterator i = c.begin(); i != c.end(); ++i)
-      Actor::cache((*i).second);
-    return 1;
-  }};
+  struct Actor {
+    static long cache(DetElement de) {
+      const DetElement::Children& c = de.children();
+      de.worldTransformation();
+      de.parentTransformation();
+      de.placementPath();
+      de.path();
+      for (DetElement::Children::const_iterator i = c.begin(); i != c.end(); ++i)
+	cache((*i).second);
+      return 1;
+    }
+  };
   return Actor::cache(lcdd.world());
 }
 DECLARE_APPLY(DD4hepDetElementCache,detelement_cache)
diff --git a/DDCore/src/plugins/VolumeMgrTest.cpp b/DDCore/src/plugins/VolumeMgrTest.cpp
index ed5e1f11ed74e472f8b92eafdaffe177ed5db93e..8b98b2d68cd042c50b33a816ff1c44854a6409cf 100644
--- a/DDCore/src/plugins/VolumeMgrTest.cpp
+++ b/DDCore/src/plugins/VolumeMgrTest.cpp
@@ -135,7 +135,6 @@ void VolIDTest::walkVolume(DetElement e, PlacedVolume pv, VolIDs ids, size_t dep
       TGeoNode* node = (TGeoNode*)nodes->At(i);
       PlacedVolume place(node);
       VolIDs child_ids(ids);
-      stringstream err, log;
 
       child_ids.insert(child_ids.end(),place.volIDs().begin(),place.volIDs().end());
       bool is_sensitive = place.volume().isSensitive();
diff --git a/DDDetectors/compact/SiD/SiD_Tracker.xml b/DDDetectors/compact/SiD/SiD_Tracker.xml
index 0d3113a29a428a46eef421650c70caa95638a24b..09c9ae602195ceabc1c45c1374f3d159b18f7b31 100644
--- a/DDDetectors/compact/SiD/SiD_Tracker.xml
+++ b/DDDetectors/compact/SiD/SiD_Tracker.xml
@@ -18,35 +18,12 @@
 <!-- ====================================================================== -->
 
 <lccdd>
-  <!--  Definition of global dictionary constants          -->
-  <define>
-  </define>
+  <include ref="SiD_TrackerConfig.xml"/>
 
-  <!--  Definition of the used visualization attributes    -->
-  <display>
-    <vis name="SiTrackerLayerVis"   alpha="1.0" r="1.0" g="1.0" b="0.6" showDaughters="true" visible="true"/>
-    <vis name="SiTrackerModuleVis"  alpha="0.1" r="0.0" g="1.0" b="0.6" showDaughters="false" visible="true"/>
-    <vis name="SiTrackerForwardVis" alpha="1.0" r="0.8" g="0.1" b="0.1" showDaughters="false" visible="true"/>
-  </display>
-
-  <!--  Definition of the readout segmentation/definition  -->
-  <readouts>
-    <readout name="SiTrackerEndcapHits">
-      <id>system:8,barrel:3,layer:4,module:14,sensor:2,side:32:-2,strip:20</id>
-    </readout>        
-    <readout name="SiTrackerBarrelHits">
-      <id>system:8,barrel:3,layer:4,module:14,sensor:2,side:32:-2,strip:20</id>
-    </readout>
-    <readout name="SiTrackerForwardHits">
-      <id>system:8,barrel:3,layer:4,wedge:6,module:6,sensor:1,side:32:-2,strip:28</id>
-    </readout>
-  </readouts>
-  
   <!--  Includes for sensitives and support                -->
   <include ref="SiD_TrackerBarrel.xml"/>
   <include ref="SiD_TrackerEndcap.xml"/>
   <include ref="SiD_TrackerForward.xml"/>
   <include ref="SiD_TrackerSupport.xml"/>
-<!--
--->
+
 </lccdd>
diff --git a/DDDetectors/compact/SiD/SiD_TrackerConfig.xml b/DDDetectors/compact/SiD/SiD_TrackerConfig.xml
new file mode 100644
index 0000000000000000000000000000000000000000..98fefc4718eb0038665fb5ede31b45cb69664300
--- /dev/null
+++ b/DDDetectors/compact/SiD/SiD_TrackerConfig.xml
@@ -0,0 +1,39 @@
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--    XML description of the configuration of the SiD tracker detector    -->
+<!--    of the SiD linear collider detector design.                         -->
+<!--                                                                        -->
+<!--      ++ Visualization description                                      -->
+<!--      ++ Readout description                                            -->
+<!--                                                                        -->
+<!--                                                                        -->
+<!--   @author  M.Frank                                                     -->
+<!--   @date    14/11/2014                                                  -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+<lccdd>
+  <!--  Definition of global dictionary constants          -->
+  <define>
+  </define>
+
+  <!--  Definition of the used visualization attributes    -->
+  <display>
+    <vis name="SiTrackerLayerVis"   alpha="1.0" r="1.0" g="1.0" b="0.6" showDaughters="true" visible="true"/>
+    <vis name="SiTrackerModuleVis"  alpha="0.1" r="0.0" g="1.0" b="0.6" showDaughters="false" visible="true"/>
+    <vis name="SiTrackerForwardVis" alpha="1.0" r="0.8" g="0.1" b="0.1" showDaughters="false" visible="true"/>
+  </display>
+
+  <!--  Definition of the readout segmentation/definition  -->
+  <readouts>
+    <readout name="SiTrackerEndcapHits">
+      <id>system:8,barrel:3,layer:4,module:14,sensor:2,side:32:-2,strip:20</id>
+    </readout>        
+    <readout name="SiTrackerBarrelHits">
+      <id>system:8,barrel:3,layer:4,module:14,sensor:2,side:32:-2,strip:20</id>
+    </readout>
+    <readout name="SiTrackerForwardHits">
+      <id>system:8,barrel:3,layer:4,wedge:6,module:6,sensor:1,side:32:-2,strip:28</id>
+    </readout>
+  </readouts>
+  
+</lccdd>
diff --git a/DDDetectors/compact/SiD/SiD_Vertex.xml b/DDDetectors/compact/SiD/SiD_Vertex.xml
index dd65f30275feb35c324df8ef4050a496638f3ffa..92005d009772772543648db921f49241d328f2c4 100644
--- a/DDDetectors/compact/SiD/SiD_Vertex.xml
+++ b/DDDetectors/compact/SiD/SiD_Vertex.xml
@@ -18,28 +18,9 @@
 <!-- ====================================================================== -->
 
 <lccdd>
-  <!--  Definition of global dictionary constants          -->
-  <define>
-  </define>
 
-  <!--  Definition of the used visualization attributes    -->
-  <display>
-    <vis name="SiVertexModuleVis"    alpha="1.0" r="1" g="1"    b="0.6" drawingStyle="wireframe" showDaughters="true"  visible="true"/>
-    <vis name="SiVertexSensitiveVis" alpha="1.0" r="1" g="0.2"  b="0.2" drawingStyle="solid"     showDaughters="true"  visible="true"/>
-    <vis name="SiVertexPassiveVis"   alpha="1.0" r="0" g="0.2"  b="1"   drawingStyle="solid"     showDaughters="true"  visible="true"/>
-    <vis name="SiVertexLayerVis"     alpha="1.0" r="1" g="0.75" b="0"                            showDaughters="false" visible="true"/>
-  </display>
+  <include ref="SiD_VertexConfig.xml"/>
 
-  <!--  Definition of the readout segmentation/definition  -->
-  <readouts>
-    <readout name="SiVertexBarrelHits">
-      <id>system:8,barrel:3,layer:4,module:14,sensor:2,side:32:-2,strip:24</id>
-    </readout>
-    <readout name="SiVertexEndcapHits">
-      <id>system:8,barrel:3,layer:4,wedge:6,module:6,sensor:1,side:32:-2,strip:26</id>
-    </readout>
-  </readouts>
-  
   <!--  Includes for sensitives and support                -->
   <include ref="SiD_VertexBarrel.xml"/>
   <include ref="SiD_VertexEndcap.xml"/>
diff --git a/DDDetectors/compact/SiD/SiD_VertexConfig.xml b/DDDetectors/compact/SiD/SiD_VertexConfig.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0952978b9ffbfdf6ef6203af970a0b55b2dccce4
--- /dev/null
+++ b/DDDetectors/compact/SiD/SiD_VertexConfig.xml
@@ -0,0 +1,37 @@
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--    XML description of the configuration of the SiD vertex detector     -->
+<!--    of the SiD linear collider detector design.                         -->
+<!--                                                                        -->
+<!--      ++ Visualization description                                      -->
+<!--      ++ Readout description                                            -->
+<!--                                                                        -->
+<!--                                                                        -->
+<!--   @author  M.Frank                                                     -->
+<!--   @date    14/11/2014                                                  -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+<lccdd>
+  <!--  Definition of global dictionary constants          -->
+  <define>
+  </define>
+
+  <!--  Definition of the used visualization attributes    -->
+  <display>
+    <vis name="SiVertexModuleVis"    alpha="1.0" r="1" g="1"    b="0.6" drawingStyle="wireframe" showDaughters="true"  visible="true"/>
+    <vis name="SiVertexSensitiveVis" alpha="1.0" r="1" g="0.2"  b="0.2" drawingStyle="solid"     showDaughters="true"  visible="true"/>
+    <vis name="SiVertexPassiveVis"   alpha="1.0" r="0" g="0.2"  b="1"   drawingStyle="solid"     showDaughters="true"  visible="true"/>
+    <vis name="SiVertexLayerVis"     alpha="1.0" r="1" g="0.75" b="0"                            showDaughters="false" visible="true"/>
+  </display>
+
+  <!--  Definition of the readout segmentation/definition  -->
+  <readouts>
+    <readout name="SiVertexBarrelHits">
+      <id>system:8,barrel:3,layer:4,module:14,sensor:2,side:32:-2,strip:24</id>
+    </readout>
+    <readout name="SiVertexEndcapHits">
+      <id>system:8,barrel:3,layer:4,wedge:6,module:6,sensor:1,side:32:-2,strip:26</id>
+    </readout>
+  </readouts>
+    
+</lccdd>
diff --git a/DDDetectors/src/SubdetectorAssembly_geo.cpp b/DDDetectors/src/SubdetectorAssembly_geo.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a7b9785b2c3e44669361c7d7ad4536cb4350981a
--- /dev/null
+++ b/DDDetectors/src/SubdetectorAssembly_geo.cpp
@@ -0,0 +1,48 @@
+// $Id: SubdetectorAssembly_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/Printout.h"
+#include "XML/Utilities.h"
+
+using namespace std;
+using namespace DD4hep;
+using namespace DD4hep::Geometry;
+
+static Ref_t create_element(LCDD& lcdd, 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;
+
+  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(lcdd, type, x_shape);
+    Material   mat   = lcdd.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();
+    lcdd.declareMotherVolume(nam, vol);
+  }
+
+  vol.setAttributes(lcdd,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
+  PlacedVolume pv = lcdd.pickMotherVolume(sdet).placeVolume(vol);
+  sdet.setPlacement(pv);
+  return sdet;
+}
+
+DECLARE_DETELEMENT(DD4hep_SubdetectorAssembly,create_element)
diff --git a/DDEve/src/DDG4EventHandler.cpp b/DDEve/src/DDG4EventHandler.cpp
index 4e404d21837a8769dbfad9baaeb5b771dc7ef8ee..d32b3f1183727c39f13704fa2377e0fdea0ead7c 100644
--- a/DDEve/src/DDG4EventHandler.cpp
+++ b/DDEve/src/DDG4EventHandler.cpp
@@ -42,12 +42,12 @@ DECLARE_CONSTRUCTOR(DDEve_DDG4EventHandler,_create)
 
 /// Standard constructor
 DDG4EventHandler::DDG4EventHandler() : EventHandler(), m_file(0,0), m_entry(-1) {
-  void* ptr = ROOT::Reflex::PluginService::Create<void*>("DDEve_DDG4HitAccess",(const char*)"");
+  void* ptr = PluginService::Create<void*>("DDEve_DDG4HitAccess",(const char*)"");
   if ( 0 == ptr )   {
     throw runtime_error("FATAL: Failed to access function pointer from factory DDEve_DDG4HitAccess");
   }
   m_simhitConverter = FCN(ptr).hits;
-  ptr = ROOT::Reflex::PluginService::Create<void*>("DDEve_DDG4ParticleAccess",(const char*)"");
+  ptr = PluginService::Create<void*>("DDEve_DDG4ParticleAccess",(const char*)"");
   if ( 0 == ptr )   {
     throw runtime_error("FATAL: Failed to access function pointer from factory DDEve_DDG4ParticleAccess");
   }
diff --git a/DDEve/src/GenericEventHandler.cpp b/DDEve/src/GenericEventHandler.cpp
index a94aebc4a95374a70f185a99b7c67825abea020e..be9168cd47dd685a2d45a48d33385fdeb1f21ac6 100644
--- a/DDEve/src/GenericEventHandler.cpp
+++ b/DDEve/src/GenericEventHandler.cpp
@@ -11,6 +11,7 @@
 #include "DDEve/GenericEventHandler.h"
 #include "DD4hep/Primitives.h"
 #include "DD4hep/Factories.h"
+#include "DD4hep/Plugins.h"
 #include <stdexcept>
 
 /// ROOT include files
@@ -93,7 +94,6 @@ size_t GenericEventHandler::collectionLoop(const std::string& collection, DDEveP
 
 /// Open a new event data file
 bool GenericEventHandler::Open(const string& file_type, const string& file_name)   {
-  typedef ROOT::Reflex::PluginService _P;
   size_t idx = file_name.find("lcio");
   string err;
   m_hasFile = false;
@@ -101,10 +101,10 @@ bool GenericEventHandler::Open(const string& file_type, const string& file_name)
   try  {
     deletePtr(m_current);
     if ( idx != string::npos )   {
-      m_current = (EventHandler*)_P::Create<void*>("DDEve_LCIOEventHandler",(const char*)0);
+      m_current = (EventHandler*)PluginService::Create<void*>("DDEve_LCIOEventHandler",(const char*)0);
     }
     else if ( (idx=file_name.find("root")) != string::npos )   {
-      m_current = (EventHandler*)_P::Create<void*>("DDEve_DDG4EventHandler",(const char*)0);
+      m_current = (EventHandler*)PluginService::Create<void*>("DDEve_DDG4EventHandler",(const char*)0);
     }
     if ( m_current )   {
       if ( m_current->Open(file_type, file_name) )   {
diff --git a/DDG4/include/DDG4/Factories.h b/DDG4/include/DDG4/Factories.h
index 86d8f125ea1024eae598d52593bcb9ea04be6594..e5d85e372bb37fe2e7eb442d429dce2f74f0872e 100644
--- a/DDG4/include/DDG4/Factories.h
+++ b/DDG4/include/DDG4/Factories.h
@@ -69,6 +69,7 @@ namespace {
   typedef std::string STR;
   typedef const std::vector<void*>& ARGS;
 
+  template <typename P, typename S> class Factory;
   template <typename P> class Factory<P, long(LCDD*, const DS::Geant4Converter*, const std::map<STR, STR>*)> {
   public:
     typedef DS::Geant4Converter cnv_t;
@@ -173,57 +174,52 @@ namespace {
   namespace DD4hep { namespace Simulation { struct external_geant4_sd_##name {}; \
       template <> G4VSensitiveDetector* Geant4SensitiveDetectorFactory< external_geant4_sd_##name >::create(const std::string& n,DD4hep::Geometry::LCDD& l) { return func(n,l); } \
     }}  using DD4hep::Simulation::external_geant4_sd_##name;            \
-  PLUGINSVC_FACTORY_WITH_ID(external_geant4_sd_##name,std::string(#name),G4VSensitiveDetector*(std::string,DD4hep::Geometry::LCDD*))
+  DD4HEP_PLUGINSVC_FACTORY(external_geant4_sd_##name,name,G4VSensitiveDetector*(std::string,DD4hep::Geometry::LCDD*),__LINE__)
 
 /// Plugin definition to create Geant4 sensitive detectors
 #define DECLARE_GEANT4SENSITIVEDETECTOR(name) namespace DD4hep { namespace Simulation { struct geant4_sd_##name {}; \
       template <> G4VSensitiveDetector* Geant4SensitiveDetectorFactory< geant4_sd_##name >::create(const std::string& n,DD4hep::Geometry::LCDD& l) { return new name(n,l); } \
     }}  using DD4hep::Simulation::geant4_sd_##name;                     \
-  PLUGINSVC_FACTORY_WITH_ID(geant4_sd_##name,std::string(#name),G4VSensitiveDetector*(std::string,DD4hep::Geometry::LCDD*))
-#if 0     /* Equivalent:  */
-#define DECLARE_GEANT4SENSITIVEDETECTOR(name)                           \
-  namespace DD4hep { namespace Simulation {  static G4VSensitiveDetector* __sd_create__##name(const std::string& n,DD4hep::Geometry::LCDD& p) {  return new name(n,p); } }} \
-  DECLARE_EXTERNAL_GEANT4SENSITIVEDETECTOR(name,DD4hep::Simulation::__sd_create__##name)
-#endif
+  DD4HEP_PLUGINSVC_FACTORY(geant4_sd_##name,name,G4VSensitiveDetector*(std::string,DD4hep::Geometry::LCDD*),__LINE__)
 
 #define DECLARE_GEANT4SENSITIVE_NS(ns,name) using ns::name;             \
-  PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),DD4hep::Simulation::Geant4Sensitive*(DD4hep::Simulation::Geant4Context*,std::string,DD4hep::Geometry::DetElement*,DD4hep::Geometry::LCDD*))
+  DD4HEP_PLUGINSVC_FACTORY(name,name,DD4hep::Simulation::Geant4Sensitive*(DD4hep::Simulation::Geant4Context*,std::string,DD4hep::Geometry::DetElement*,DD4hep::Geometry::LCDD*),__LINE__)
 #define DECLARE_GEANT4SENSITIVE(name) DECLARE_GEANT4SENSITIVE_NS(DD4hep::Simulation,name)
 
 /// Plugin defintion to create Geant4Action objects
 #define DECLARE_GEANT4ACTION_NS(ns,name) using ns::name;                \
-  PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),DD4hep::Simulation::Geant4Action*(DD4hep::Simulation::Geant4Context*,std::string))
+  DD4HEP_PLUGINSVC_FACTORY(name,name,DD4hep::Simulation::Geant4Action*(DD4hep::Simulation::Geant4Context*,std::string),__LINE__)
 /// Plugin defintion to create Geant4Action objects
-#define DECLARE_GEANT4ACTION(name)  DECLARE_GEANT4ACTION_NS(DD4hep::Simulation,name)
+#define DECLARE_GEANT4ACTION(name)      DECLARE_GEANT4ACTION_NS(DD4hep::Simulation,name)
 
 /// Plugin definition to create Geant4 stepper objects
-#define DECLARE_GEANT4_STEPPER(name)    PLUGINSVC_FACTORY_WITH_ID(G4##name,std::string(#name),G4MagIntegratorStepper*(G4EquationOfMotion*))
-#define DECLARE_GEANT4_MAGSTEPPER(name) PLUGINSVC_FACTORY_WITH_ID(G4##name,std::string(#name),G4MagIntegratorStepper*(G4Mag_EqRhs*))
+#define DECLARE_GEANT4_STEPPER(name)    DD4HEP_PLUGINSVC_FACTORY(G4##name,name,G4MagIntegratorStepper*(G4EquationOfMotion*),__LINE__)
+#define DECLARE_GEANT4_MAGSTEPPER(name) DD4HEP_PLUGINSVC_FACTORY(G4##name,name,G4MagIntegratorStepper*(G4Mag_EqRhs*),__LINE__)
 /// Plugin definition to create Geant4 equations of motion for magnetic fields
-#define DECLARE_GEANT4_MAGMOTION(name) PLUGINSVC_FACTORY_WITH_ID(G4##name,std::string(#name),G4Mag_EqRhs*(G4MagneticField*))
+#define DECLARE_GEANT4_MAGMOTION(name)  DD4HEP_PLUGINSVC_FACTORY(G4##name,name,G4Mag_EqRhs*(G4MagneticField*),__LINE__)
 /// Plugin definition to create Geant4 physics processes (G4VProcess)
-#define DECLARE_GEANT4_PROCESS(name) PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),G4VProcess*())
+#define DECLARE_GEANT4_PROCESS(name)    DD4HEP_PLUGINSVC_FACTORY(name,name,G4VProcess*(),__LINE__)
 /// Plugin definition to create Geant4 physics constructors (G4VPhysicsConstructor)
-#define DECLARE_GEANT4_PHYSICS(name) PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),G4VPhysicsConstructor*())
+#define DECLARE_GEANT4_PHYSICS(name)    DD4HEP_PLUGINSVC_FACTORY(name,name,G4VPhysicsConstructor*(),__LINE__)
 /// Plugin definition to force particle constructors for GEANT4 (G4ParticleDefinition)
-#define DECLARE_GEANT4_PARTICLE(name) PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),G4ParticleDefinition*())
+#define DECLARE_GEANT4_PARTICLE(name)   DD4HEP_PLUGINSVC_FACTORY(name,name,G4ParticleDefinition*(),__LINE__)
 /// Plugin definition to force particle constructors for GEANT4 (G4XXXXConstructor)
-#define DECLARE_GEANT4_PARTICLEGROUP(name) PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),long())
+#define DECLARE_GEANT4_PARTICLEGROUP(name) DD4HEP_PLUGINSVC_FACTORY(name,name,long(),__LINE__)
 /// Plugin definition to force geant4 physics constructs such as FTFP_BERT (from source/physics_lists/) etc
 #define DECLARE_GEANT4_PHYSICS_LIST(name)  typedef DD4hep::Simulation::Geant4UserPhysicsList< name > G4_physics_list_##name; \
-  PLUGINSVC_FACTORY_WITH_ID(G4_physics_list_##name,std::string(#name),G4VUserPhysicsList*(DD4hep::Simulation::Geant4PhysicsListActionSequence*,int))
+  DD4HEP_PLUGINSVC_FACTORY(G4_physics_list_##name,name,G4VUserPhysicsList*(DD4hep::Simulation::Geant4PhysicsListActionSequence*,int),__LINE__)
 
 #define DECLARE_GEANT4_SETUP(name,func)                                 \
   namespace DD4hep { namespace Simulation { struct xml_g4_setup_##name {}; \
-      template <> long Geant4SetupAction<DD4hep::Simulation::xml_g4_setup_##name>::create(LCDD& l,const DD4hep::Simulation::Geant4Converter& e, const std::map<std::string,std::string>& a) {return func(l,e,a);} }} \
-  PLUGINSVC_FACTORY_WITH_ID(xml_g4_setup_##name,std::string(#name "_Geant4_action"),long(DD4hep::Geometry::LCDD*,const DD4hep::Simulation::Geant4Converter*,const std::map<std::string,std::string>*))
+    template <> long Geant4SetupAction<DD4hep::Simulation::xml_g4_setup_##name>::create(LCDD& l,const DD4hep::Simulation::Geant4Converter& e, const std::map<std::string,std::string>& a) {return func(l,e,a);} }} \
+  DD4HEP_PLUGINSVC_FACTORY(xml_g4_setup_##name,name "_Geant4_action",long(DD4hep::Geometry::LCDD*,const DD4hep::Simulation::Geant4Converter*,const std::map<std::string,std::string>*),__LINE__)
 
 /// Plugin defintion to create event reader objects
 #define DECLARE_GEANT4_EVENT_READER(name)                               \
-  PLUGINSVC_FACTORY_WITH_ID(name,std::string(#name),DD4hep::Simulation::Geant4EventReader*(std::string))
+  DD4HEP_PLUGINSVC_FACTORY(name,name,DD4hep::Simulation::Geant4EventReader*(std::string),__LINE__)
 
 /// Plugin defintion to create event reader objects
 #define DECLARE_GEANT4_EVENT_READER_NS(ns,name) typedef ns::name __##name##__; \
-  PLUGINSVC_FACTORY_WITH_ID(__##name##__,std::string(#name),DD4hep::Simulation::Geant4EventReader*(std::string))
+  DD4HEP_PLUGINSVC_FACTORY(__##name##__,name,DD4hep::Simulation::Geant4EventReader*(std::string),__LINE__)
 
 #endif // DDG4_FACTORIES_H
diff --git a/DDG4/include/DDG4/Geant4IsotropeGenerator.h b/DDG4/include/DDG4/Geant4IsotropeGenerator.h
index 6bfebe09ab864cd98a524fcabeece7f65e732cc3..08880af4b581bbcb9caf00c5d523cbf0db059206 100644
--- a/DDG4/include/DDG4/Geant4IsotropeGenerator.h
+++ b/DDG4/include/DDG4/Geant4IsotropeGenerator.h
@@ -10,11 +10,7 @@
 #define DD4HEP_DDG4_GEANT4ISOTROPEGENERATOR_H
 
 // Framework include files
-#include "DDG4/Geant4GeneratorAction.h"
-#include "Math/Vector3D.h"
-
-// Forward declarations
-class G4ParticleDefinition;
+#include "DDG4/Geant4ParticleGenerator.h"
 
 /// Namespace for the AIDA detector description toolkit
 namespace DD4hep {
@@ -27,27 +23,19 @@ namespace DD4hep {
      *  \version 1.0
      *  \ingroup DD4HEP_SIMULATION
      */
-    class Geant4IsotropeGenerator: public Geant4GeneratorAction {
+    class Geant4IsotropeGenerator: public Geant4ParticleGenerator {
     protected:
-      /// Property: Position and shooting direction of the gun
-      ROOT::Math::XYZVector m_position;
-      /// Property: Particle name
-      std::string m_particleName;
-      /// Pointer to geant4 particle definition
-      G4ParticleDefinition* m_particle;
-      /// Property: Particle energy
-      double m_energy;
-      /// Property: Desired multiplicity of the particles to be shot
-      int m_multiplicity;
-      /// Property: User mask passed to all particles in the generated interaction
-      int m_mask;
+      /// Particle modification. Caller presets defaults to: ( direction = m_direction, momentum = m_energy)
+      /** Use this function to implement isotrop guns, multiple guns etc. 
+	  User must return a UNIT vector, which gets scaled with momentum.
+       */
+      virtual void getParticleDirection(int num, ROOT::Math::XYZVector& direction, double& momentum) const;
+
     public:
       /// Standard constructor
       Geant4IsotropeGenerator(Geant4Context* context, const std::string& name);
       /// Default destructor
       virtual ~Geant4IsotropeGenerator();
-      /// Callback to generate primary particles
-      virtual void operator()(G4Event* event);
     };
   }    // End namespace Simulation
 }      // End namespace DD4hep
diff --git a/DDG4/include/DDG4/Geant4ParticleGenerator.h b/DDG4/include/DDG4/Geant4ParticleGenerator.h
new file mode 100644
index 0000000000000000000000000000000000000000..e1fb87bcb6bdaa1965a7a6ceb2834d57dedcc069
--- /dev/null
+++ b/DDG4/include/DDG4/Geant4ParticleGenerator.h
@@ -0,0 +1,69 @@
+// $Id: Geant4Hits.h 513 2013-04-05 14:31:53Z gaede $
+//====================================================================
+//  AIDA Detector description implementation
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+#ifndef DD4HEP_DDG4_GEANT4PARTICLEGENERATOR_H
+#define DD4HEP_DDG4_GEANT4PARTICLEGENERATOR_H
+
+// Framework include files
+#include "DDG4/Geant4GeneratorAction.h"
+#include "Math/Vector3D.h"
+
+// Forward declarations
+class G4ParticleDefinition;
+
+/// Namespace for the AIDA detector description toolkit
+namespace DD4hep {
+
+  /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
+  namespace Simulation {
+    /// Generate particles isotrop in space around origine (0,0,0)
+    /**
+     *  \author  M.Frank
+     *  \version 1.0
+     *  \ingroup DD4HEP_SIMULATION
+     */
+    class Geant4ParticleGenerator: public Geant4GeneratorAction {
+    protected:
+      /// Property: Shooting direction of the gun
+      ROOT::Math::XYZVector m_direction;
+      /// Property: Position of the gun in space
+      ROOT::Math::XYZVector m_position;
+      /// Property: Particle name
+      std::string m_particleName;
+      /// Pointer to geant4 particle definition
+      G4ParticleDefinition* m_particle;
+      /// Property: Particle energy
+      double m_energy;
+      /// Property: Desired multiplicity of the particles to be shot
+      int m_multiplicity;
+      /// Property: User mask passed to all particles in the generated interaction
+      int m_mask;
+      
+      /// Particle modification. Caller presets defaults to: (multiplicity=m_multiplicity)
+      virtual void getParticleMultiplicity(int& multiplicity) const;
+
+      /// Particle's vertex modification. Caller presets defaults to: (multiplicity=m_multiplicity)
+      virtual void getVertexPosition(ROOT::Math::XYZVector& position) const;
+
+      /// Particle modification. Caller presets defaults to: ( direction = m_direction, momentum = m_energy)
+      /** Use this function to implement isotrop guns, multiple guns etc. 
+	  User must return a UNIT vector, which gets scaled with momentum.
+       */
+      virtual void getParticleDirection(int num, ROOT::Math::XYZVector& direction, double& momentum) const;
+
+    public:
+      /// Standard constructor
+      Geant4ParticleGenerator(Geant4Context* context, const std::string& name);
+      /// Default destructor
+      virtual ~Geant4ParticleGenerator();
+      /// Callback to generate primary particles
+      virtual void operator()(G4Event* event);
+    };
+  }    // End namespace Simulation
+}      // End namespace DD4hep
+#endif /* DD4HEP_DDG4_GEANT4PARTICLEGENERATOR_H  */
diff --git a/DDG4/plugins/Geant4.10.PhysicsConstructors.h b/DDG4/plugins/Geant4.10.PhysicsConstructors.h
new file mode 100644
index 0000000000000000000000000000000000000000..a5b8febeb6be670dd8e6f5671543f09e0924ef65
--- /dev/null
+++ b/DDG4/plugins/Geant4.10.PhysicsConstructors.h
@@ -0,0 +1,93 @@
+
+// EM physics
+#include "G4EmStandardPhysics_option1.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option1)
+#include "G4EmStandardPhysics_option2.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option2)
+#include "G4EmStandardPhysics_option3.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option3)
+#include "G4EmStandardPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics)
+#include "G4EmStandardPhysicsSS.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysicsSS)
+#include "G4EmStandardPhysicsWVI.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysicsWVI)
+#include "G4EmExtraPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmExtraPhysics)
+#include "G4EmDNAPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmDNAPhysics)
+#include "G4EmLowEPPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmLowEPPhysics)
+#include "G4EmLivermorePhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmLivermorePhysics)
+#include "G4ChargeExchangePhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4ChargeExchangePhysics)
+#include "G4GenericBiasingPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4GenericBiasingPhysics)
+
+#include "G4HadronDElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronDElasticPhysics)
+#include "G4HadronElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysics)
+#include "G4HadronElasticPhysicsHP.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsHP)
+#include "G4HadronElasticPhysicsLEND.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsLEND)
+#include "G4HadronElasticPhysicsPHP.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsPHP)
+#include "G4HadronElasticPhysicsXS.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsXS)
+#include "G4HadronHElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronHElasticPhysics)
+#include "G4HadronPhysicsFTF_BIC.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsFTF_BIC)
+#include "G4HadronPhysicsFTFP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsFTFP_BERT)
+#include "G4HadronPhysicsFTFP_BERT_HP.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsFTFP_BERT_HP)
+#include "G4HadronPhysicsFTFP_BERT_TRV.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsFTFP_BERT_TRV)
+#include "G4HadronPhysicsINCLXX.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsINCLXX)
+#include "G4HadronPhysicsNuBeam.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsNuBeam)
+#include "G4HadronPhysicsQGS_BIC.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsQGS_BIC)
+#include "G4HadronPhysicsQGSP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsQGSP_BERT)
+#include "G4HadronPhysicsQGSP_BERT_HP.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsQGSP_BERT_HP)
+#include "G4HadronPhysicsQGSP_BIC_AllHP.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsQGSP_BIC_AllHP)
+#include "G4HadronPhysicsQGSP_FTFP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsQGSP_FTFP_BERT)
+#include "G4HadronPhysicsShielding.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronPhysicsShielding)
+
+
+// Ion and hadrons
+#include "G4IonBinaryCascadePhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonBinaryCascadePhysics)
+#include "G4IonElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonElasticPhysics)
+
+#include "G4IonINCLXXPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonINCLXXPhysics)
+#include "G4IonPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonPhysics)
+#include "G4IonQMDPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonQMDPhysics)
+
+#include "G4RadioactiveDecayPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4RadioactiveDecayPhysics)
+#include "G4StepLimiterPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4StepLimiterPhysics)
+#include "G4StoppingPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4StoppingPhysics)
+
+#include "G4NeutronTrackingCut.hh"
+DECLARE_GEANT4_PHYSICS(G4NeutronTrackingCut)
+
+// Optical physics
+#include "G4OpticalPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4OpticalPhysics)
diff --git a/DDG4/plugins/Geant4.9.PhysicsConstructors.h b/DDG4/plugins/Geant4.9.PhysicsConstructors.h
new file mode 100644
index 0000000000000000000000000000000000000000..6d1473c5874958806275fb6d126c1d0233107f47
--- /dev/null
+++ b/DDG4/plugins/Geant4.9.PhysicsConstructors.h
@@ -0,0 +1,140 @@
+// EM physics
+#include "G4EmStandardPhysics_option1.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option1)
+#include "G4EmStandardPhysics_option2.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option2)
+#include "G4EmStandardPhysics_option3.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option3)
+#include "G4EmStandardPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics)
+#include "G4EmExtraPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmExtraPhysics)
+#include "G4EmLivermorePhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4EmLivermorePhysics)
+
+// Ion and hadrons
+#include "G4IonBinaryCascadePhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonBinaryCascadePhysics)
+
+#if G4VERSION_NUMBER<=960
+#include "G4IonINCLXXPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonINCLXXPhysics)
+#include "G4IonLHEPPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonLHEPPhysics)
+#endif
+
+#include "G4IonPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonPhysics)
+#include "G4IonQMDPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4IonQMDPhysics)
+#include "G4LHEPStoppingPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4LHEPStoppingPhysics)
+#include "G4QStoppingPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QStoppingPhysics)
+#include "G4HadronElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysics)
+#include "G4HadronDElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronDElasticPhysics)
+#include "G4HadronElasticPhysicsHP.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsHP)
+#include "G4HadronElasticPhysicsLEND.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsLEND)
+#include "G4HadronElasticPhysicsLHEP.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsLHEP)
+#include "G4HadronElasticPhysicsXS.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsXS)
+#include "G4HadronHElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronHElasticPhysics)
+#include "G4HadronQElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4HadronQElasticPhysics)
+#include "G4NeutronTrackingCut.hh"
+DECLARE_GEANT4_PHYSICS(G4NeutronTrackingCut)
+
+// Optical physics
+#include "G4OpticalPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4OpticalPhysics)
+
+#include "G4QAtomicPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QAtomicPhysics)
+#include "G4QCaptureAtRestPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QCaptureAtRestPhysics)
+#include "G4QElasticPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QElasticPhysics)
+#include "G4QEmExtraPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QEmExtraPhysics)
+#include "G4QNeutrinoPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QNeutrinoPhysics)
+#include "G4QStoppingPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QStoppingPhysics)
+#include "G4QIonPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4QIonPhysics)
+#include "G4RadioactiveDecayPhysics.hh"
+DECLARE_GEANT4_PHYSICS(G4RadioactiveDecayPhysics)
+
+// LHEP hadrons
+#include "HadronPhysicsLHEP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsLHEP)
+
+// QGSP hadrons
+#include "HadronPhysicsQGSP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP)
+#include "HadronPhysicsQGSP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT)
+#include "HadronPhysicsQGSP_BERT_HP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_HP)
+#include "HadronPhysicsQGSP_BERT_CHIPS.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_CHIPS)
+#include "HadronPhysicsQGSP_FTFP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_FTFP_BERT)
+
+// FTFP hadrons
+#include "HadronPhysicsFTFP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT)
+
+#if G4VERSION_NUMBER<=960
+#include "HadronPhysicsQGSP_INCLXX.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_INCLXX)
+#include "HadronPhysicsFTFP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT)
+#include "HadronPhysicsFTFP_BERT_HP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT_HP)
+#include "HadronPhysicsQGSP_BERT_95.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_95)
+#include "HadronPhysicsQGSP_FTFP_BERT_95.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_FTFP_BERT_95)
+#endif
+
+#include "HadronPhysicsCHIPS.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsCHIPS)
+#include "HadronPhysicsFTF_BIC.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsFTF_BIC)
+#include "HadronPhysicsFTFP_BERT_TRV.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT_TRV)
+#include "HadronPhysicsLHEP_EMV.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsLHEP_EMV)
+#include "HadronPhysicsLHEP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsLHEP)
+#include "HadronPhysicsQGS_BIC.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGS_BIC)
+#include "HadronPhysicsQGSC_BERT.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSC_BERT)
+#include "HadronPhysicsQGSC_CHIPS.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSC_CHIPS)
+#include "HadronPhysicsQGSP_BERT_CHIPS.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_CHIPS)
+#include "HadronPhysicsQGSP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT)
+#include "HadronPhysicsQGSP_BERT_HP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_HP)
+#include "HadronPhysicsQGSP_BERT_NOLEP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_NOLEP)
+#include "HadronPhysicsQGSP_BERT_TRV.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_TRV)
+#include "HadronPhysicsQGSP_BIC.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BIC)
+#include "HadronPhysicsQGSP_BIC_HP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BIC_HP)
+#include "HadronPhysicsQGSP_FTFP_BERT.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_FTFP_BERT)
+#include "HadronPhysicsQGSP.hh"
+DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP)
diff --git a/DDG4/plugins/Geant4Factories.cpp b/DDG4/plugins/Geant4Factories.cpp
index 1aaee887ce28d21b368c6608fc70d69c8a8b353e..4f04807d5a9c2f66c7c91232552b3e804cf65a25 100644
--- a/DDG4/plugins/Geant4Factories.cpp
+++ b/DDG4/plugins/Geant4Factories.cpp
@@ -76,6 +76,7 @@ DECLARE_GEANT4ACTION(Geant4GeneratorActionInit)
 
 //=============================
 #include "DDG4/Geant4IsotropeGenerator.h"
+DECLARE_GEANT4ACTION(Geant4ParticleGenerator)
 DECLARE_GEANT4ACTION(Geant4IsotropeGenerator)
 
 //=============================
diff --git a/DDG4/plugins/Geant4FieldTrackingSetup.cpp b/DDG4/plugins/Geant4FieldTrackingSetup.cpp
index 6d89b84fedca72a8ab768ff3a474e82c3777ae06..78c5e6e837de8141975f6539e5e5003ff9d1a649 100644
--- a/DDG4/plugins/Geant4FieldTrackingSetup.cpp
+++ b/DDG4/plugins/Geant4FieldTrackingSetup.cpp
@@ -111,6 +111,7 @@ namespace DD4hep {
 #include <limits>
 
 using namespace std;
+using namespace CLHEP;
 using namespace DD4hep;
 using namespace DD4hep::Simulation;
 typedef DD4hep::Geometry::LCDD lcdd_t;
@@ -155,8 +156,8 @@ Geant4FieldTrackingSetup::~Geant4FieldTrackingSetup()   {
 int Geant4FieldTrackingSetup::execute(Geometry::LCDD& lcdd)   {
   Geometry::OverlayedField fld  = lcdd.field();
   G4MagneticField*         mag_field    = new Simulation::Geant4Field(fld);
-  G4Mag_EqRhs*             mag_equation = ROOT::Reflex::PluginService::Create<G4Mag_EqRhs*>(eq_typ,mag_field);
-  G4MagIntegratorStepper*  fld_stepper  = ROOT::Reflex::PluginService::Create<G4MagIntegratorStepper*>(stepper_typ,mag_equation);
+  G4Mag_EqRhs*             mag_equation = PluginService::Create<G4Mag_EqRhs*>(eq_typ,mag_field);
+  G4MagIntegratorStepper*  fld_stepper  = PluginService::Create<G4MagIntegratorStepper*>(stepper_typ,mag_equation);
   G4ChordFinder*           chordFinder  = new G4ChordFinder(mag_field,min_chord_step,fld_stepper);
   G4TransportationManager* transportMgr = G4TransportationManager::GetTransportationManager();
   G4PropagatorInField*     propagator   = transportMgr->GetPropagatorInField();
@@ -223,4 +224,3 @@ void Geant4FieldTrackingSetupAction::operator()()   {
 
 DECLARE_GEANT4_SETUP(Geant4FieldSetup,setup_fields)
 DECLARE_GEANT4ACTION(Geant4FieldTrackingSetupAction)
-
diff --git a/DDG4/plugins/Geant4PhysicsConstructors.cpp b/DDG4/plugins/Geant4PhysicsConstructors.cpp
index 033d654ab4f9a695ead9df6d4fe440fe434b3e71..9731cbfe31e074cb0067aa1e2efcef4d676f62fe 100644
--- a/DDG4/plugins/Geant4PhysicsConstructors.cpp
+++ b/DDG4/plugins/Geant4PhysicsConstructors.cpp
@@ -1,24 +1,16 @@
 // $Id: Factories.h 797 2013-10-03 19:20:32Z markus.frank@cern.ch $
 //====================================================================
 //  AIDA Detector description implementation
-//--------------------------------------------------------------------
+//-----------------------------------------------------------------------------------
 //
 //  Author     : M.Frank
 //
-//====================================================================
+//===================================================================================
 
 // Framework include files
 #include "DDG4/Factories.h"
 
-// Geant4 physics lists
-#include "G4Version.hh"
-#include "G4DecayPhysics.hh"
-
-#if G4VERSION_NUMBER>=960
-#define GEANT4_9_6
-#endif
-
-// ======================================================================
+// ==================================================================================
 // Predefined physics constructors
 //
 //  Usage:
@@ -30,167 +22,19 @@
 //    </physics>
 //  </physicslist>
 //
-// ======================================================================
-
-// EM physics
-#include "G4EmStandardPhysics_option1.hh"
-DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option1)
-#include "G4EmStandardPhysics_option2.hh"
-DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option2)
-#include "G4EmStandardPhysics_option3.hh"
-DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics_option3)
-#include "G4EmStandardPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4EmStandardPhysics)
-#include "G4EmExtraPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4EmExtraPhysics)
-#include "G4EmLivermorePhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4EmLivermorePhysics)
-
-// Ion and hadrons
-#include "G4IonBinaryCascadePhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4IonBinaryCascadePhysics)
-
-#ifdef GEANT4_9_6
-#include "G4IonINCLXXPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4IonINCLXXPhysics)
-
-#if G4VERSION_NUMBER < 1000
-#include "G4IonLHEPPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4IonLHEPPhysics)
-#endif
-
-#endif
-
-#include "G4IonPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4IonPhysics)
-#include "G4IonQMDPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4IonQMDPhysics)
-
-#if G4VERSION_NUMBER < 1000
-#include "G4LHEPStoppingPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4LHEPStoppingPhysics)
-#include "G4QStoppingPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QStoppingPhysics)
-#include "G4HadronElasticPhysicsLHEP.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsLHEP)
-#include "G4HadronQElasticPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronQElasticPhysics)
-#include "G4QAtomicPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QAtomicPhysics)
-#include "G4QCaptureAtRestPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QCaptureAtRestPhysics)
-#include "G4QElasticPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QElasticPhysics)
-#include "G4QEmExtraPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QEmExtraPhysics)
-#include "G4QNeutrinoPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QNeutrinoPhysics)
-#include "G4QStoppingPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QStoppingPhysics)
-#include "G4QIonPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4QIonPhysics)
-// LHEP hadrons
-#include "HadronPhysicsLHEP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsLHEP)
-
-// QGSP hadrons
-#include "HadronPhysicsQGSP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP)
-#include "HadronPhysicsQGSP_BERT.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT)
-#include "HadronPhysicsQGSP_BERT_HP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_HP)
-#include "HadronPhysicsQGSP_BERT_CHIPS.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_CHIPS)
-#include "HadronPhysicsQGSP_FTFP_BERT.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_FTFP_BERT)
+// ==================================================================================
 
-// FTFP hadrons
-#include "HadronPhysicsFTFP_BERT.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT)
-
-#endif
-
-#include "G4HadronElasticPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysics)
-#include "G4HadronDElasticPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronDElasticPhysics)
-#include "G4HadronElasticPhysicsHP.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsHP)
-#include "G4HadronElasticPhysicsLEND.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsLEND)
-#include "G4HadronElasticPhysicsXS.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronElasticPhysicsXS)
-#include "G4HadronHElasticPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4HadronHElasticPhysics)
-#include "G4NeutronTrackingCut.hh"
-DECLARE_GEANT4_PHYSICS(G4NeutronTrackingCut)
-
-// Optical physics
-#include "G4OpticalPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4OpticalPhysics)
-
-#include "G4RadioactiveDecayPhysics.hh"
-DECLARE_GEANT4_PHYSICS(G4RadioactiveDecayPhysics)
-
-
-
-#ifdef GEANT4_9_6
-
-#if G4VERSION_NUMBER < 1000
-#include "HadronPhysicsQGSP_INCLXX.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_INCLXX)
-#include "HadronPhysicsFTFP_BERT.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT)
-#include "HadronPhysicsFTFP_BERT_HP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT_HP)
-#include "HadronPhysicsQGSP_BERT_95.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_95)
-#include "HadronPhysicsQGSP_FTFP_BERT_95.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_FTFP_BERT_95)
-#endif
-
-#endif
-
-#if G4VERSION_NUMBER < 1000
-
-#include "HadronPhysicsCHIPS.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsCHIPS)
-#include "HadronPhysicsFTF_BIC.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsFTF_BIC)
-#include "HadronPhysicsFTFP_BERT_TRV.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsFTFP_BERT_TRV)
-#include "HadronPhysicsLHEP_EMV.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsLHEP_EMV)
-#include "HadronPhysicsLHEP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsLHEP)
-#include "HadronPhysicsQGS_BIC.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGS_BIC)
-#include "HadronPhysicsQGSC_BERT.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSC_BERT)
-#include "HadronPhysicsQGSC_CHIPS.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSC_CHIPS)
-#include "HadronPhysicsQGSP_BERT_CHIPS.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_CHIPS)
-#include "HadronPhysicsQGSP_BERT.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT)
-#include "HadronPhysicsQGSP_BERT_HP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_HP)
-#include "HadronPhysicsQGSP_BERT_NOLEP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_NOLEP)
-#include "HadronPhysicsQGSP_BERT_TRV.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BERT_TRV)
-#include "HadronPhysicsQGSP_BIC.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BIC)
-#include "HadronPhysicsQGSP_BIC_HP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_BIC_HP)
-#include "HadronPhysicsQGSP_FTFP_BERT.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP_FTFP_BERT)
-#include "HadronPhysicsQGSP.hh"
-DECLARE_GEANT4_PHYSICS(HadronPhysicsQGSP)
-#endif
+// Geant4 physics lists
+#include "G4Version.hh"
+#include "G4DecayPhysics.hh"
 
-#if 0
-#include ".hh"
-DECLARE_GEANT4_PHYSICS()
-#endif
+// ==================================================================================
+#if G4VERSION_NUMBER>=960 and G4VERSION_NUMBER<1000
+  #include "Geant4.9.PhysicsConstructors.h"
+// ==================================================================================
+#elif G4VERSION_NUMBER>=1000
+  #include "Geant4.10.PhysicsConstructors.h"
+// ==================================================================================
+#else
+  #pragma error "Unsupported Geant4 version "
+#endif  /*  G4VERSION_NUMBER>=1000  */
diff --git a/DDG4/plugins/Geant4PhysicsLists.cpp b/DDG4/plugins/Geant4PhysicsLists.cpp
index f502287559511aa7229f50f7352e018593fbf3f5..e4a1e223773397d71596b9d43390a833cdaed503 100644
--- a/DDG4/plugins/Geant4PhysicsLists.cpp
+++ b/DDG4/plugins/Geant4PhysicsLists.cpp
@@ -41,7 +41,8 @@ namespace {
 DECLARE_GEANT4_PHYSICS_LIST(EmptyPhysics)
 
 // Physics constructors from source/physics_lists
-#if G4VERSION_NUMBER < 1000
+
+#if G4VERSION_NUMBER>=960 and G4VERSION_NUMBER<1000
 #include "CHIPS.hh"
 DECLARE_GEANT4_PHYSICS_LIST(CHIPS)
 #endif
@@ -61,13 +62,6 @@ DECLARE_GEANT4_PHYSICS_LIST(CHIPS)
   DECLARE_GEANT4_PHYSICS_LIST(FTFP_BERT)
 #include "FTFP_BERT_HP.hh"
   DECLARE_GEANT4_PHYSICS_LIST(FTFP_BERT_HP)
-#include "QGSP_INCLXX.hh"
-  DECLARE_GEANT4_PHYSICS_LIST(QGSP_INCLXX)
-
-#endif
-
-#include "FTF_BIC.hh"
-  DECLARE_GEANT4_PHYSICS_LIST(FTF_BIC)
 
 #if G4VERSION_NUMBER < 1000
 
@@ -82,12 +76,8 @@ DECLARE_GEANT4_PHYSICS_LIST(CHIPS)
   DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT_EMV)
 #include "QGSP_BERT_EMX.hh"
   DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT_EMX)
-
-
 #include "QGSP_BIC_EMY.hh"
   DECLARE_GEANT4_PHYSICS_LIST(QGSP_BIC_EMY)
-
-
 #include "LHEP.hh"
   DECLARE_GEANT4_PHYSICS_LIST(LHEP)
 #include "QGSC_BERT.hh"
@@ -96,6 +86,11 @@ DECLARE_GEANT4_PHYSICS_LIST(CHIPS)
   DECLARE_GEANT4_PHYSICS_LIST(QGSC_CHIPS)
 #include "QGSP_BERT_CHIPS.hh"
   DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT_CHIPS)
+#include "QGSP_BERT_EMV.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT_EMV)
+#include "QGSP_BERT_EMX.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT_EMX)
+
 #include "QGSP_BERT_NOLEP.hh"
   DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT_NOLEP)
 #include "QGSP_BERT_TRV.hh"
@@ -104,12 +99,46 @@ DECLARE_GEANT4_PHYSICS_LIST(CHIPS)
   DECLARE_GEANT4_PHYSICS_LIST(QGSP)
 #include "QGSP_QEL.hh"
   DECLARE_GEANT4_PHYSICS_LIST(QGSP_QEL)
-
 #include "HadronPhysicsCHIPS.hh"
 
+#endif
 
+#include "FTFP_BERT.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(FTFP_BERT)
+#include "FTFP_BERT_TRV.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(FTFP_BERT_TRV)
+#include "LBE.hh"
+//DECLARE_GEANT4_PHYSICS_LIST(LBE) takes no verbosity arg!
+#include "QBBC.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QBBC)
+#include "QGS_BIC.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGS_BIC)
+#include "QGSP_BERT.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT)
+#endif
+
+#if G4VERSION_NUMBER>=1000
+#include "NuBeam.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(NuBeam)
+#include "FTFP_INCLXX.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(FTFP_INCLXX)
+#include "QGSP_BERT_HP.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGSP_BERT_HP)
+#include "QGSP_BIC_AllHP.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGSP_BIC_AllHP)
+#include "QGSP_INCLXX.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGSP_INCLXX)
 #endif
 
+#include "FTFP_BERT.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(FTFP_BERT)
+#include "FTFP_BERT_HP.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(FTFP_BERT_HP)
+#include "QGSP_INCLXX.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(QGSP_INCLXX)
+
+#include "FTF_BIC.hh"
+  DECLARE_GEANT4_PHYSICS_LIST(FTF_BIC)
 #include "FTFP_BERT.hh"
   DECLARE_GEANT4_PHYSICS_LIST(FTFP_BERT)
 #include "FTFP_BERT_TRV.hh"
diff --git a/DDG4/plugins/Geant4Processes.cpp b/DDG4/plugins/Geant4Processes.cpp
index 0441f3f0a5855a134afa691ade82db50c555bd27..26df360d66c82a7fbc02dc4551424616270ff26f 100644
--- a/DDG4/plugins/Geant4Processes.cpp
+++ b/DDG4/plugins/Geant4Processes.cpp
@@ -138,7 +138,103 @@ DECLARE_GEANT4_PROCESS(G4hImpactIonisation)
 //#include "G4IonInverseIonisation.hh"
 //DECLARE_GEANT4_PROCESS(G4IonInverseIonisation)
 
+// ==================================================================================
+#if G4VERSION_NUMBER>=960 and G4VERSION_NUMBER<1000
+#include "G4UrbanMscModel93.hh"
+DECLARE_GEANT4_PROCESS(G4UrbanMscModel93)
+// ==================================================================================
+#elif G4VERSION_NUMBER>=1000
+
+// Stuff commented cannot be instantiated!!
+
+#include "G4AdjointBremsstrahlungModel.hh"
+DECLARE_GEANT4_PROCESS(G4AdjointBremsstrahlungModel)
+#include "G4AdjointComptonModel.hh"
+DECLARE_GEANT4_PROCESS(G4AdjointComptonModel)
+#include "G4AdjointeIonisationModel.hh"
+DECLARE_GEANT4_PROCESS(G4AdjointeIonisationModel)
+#include "G4AdjointIonIonisationModel.hh"
+DECLARE_GEANT4_PROCESS(G4AdjointIonIonisationModel)
+#include "G4AdjointPhotoElectricModel.hh"
+DECLARE_GEANT4_PROCESS(G4AdjointPhotoElectricModel)
+#include "G4BetheBlochModel.hh"
+DECLARE_GEANT4_PROCESS(G4BetheBlochModel)
+#include "G4BetheBlochNoDeltaModel.hh"
+DECLARE_GEANT4_PROCESS(G4BetheBlochNoDeltaModel)
+#include "G4BetheHeitlerModel.hh"
+DECLARE_GEANT4_PROCESS(G4BetheHeitlerModel)
+#include "G4BoldyshevTripletModel.hh"
+DECLARE_GEANT4_PROCESS(G4BoldyshevTripletModel)
+#include "G4BraggIonModel.hh"
+DECLARE_GEANT4_PROCESS(G4BraggIonModel)
+#include "G4BraggModel.hh"
+DECLARE_GEANT4_PROCESS(G4BraggModel)
+#include "G4BraggNoDeltaModel.hh"
+DECLARE_GEANT4_PROCESS(G4BraggNoDeltaModel)
+#include "G4ChipsElasticModel.hh"
+DECLARE_GEANT4_PROCESS(G4ChipsElasticModel)
+#include "G4DNABornExcitationModel.hh"
+DECLARE_GEANT4_PROCESS(G4DNABornExcitationModel)
+#include "G4eBremParametrizedModel.hh"
+DECLARE_GEANT4_PROCESS(G4eBremParametrizedModel)
+#include "G4eBremsstrahlungRelModel.hh"
+DECLARE_GEANT4_PROCESS(G4eBremsstrahlungRelModel)
+#include "G4ecpssrBaseKxsModel.hh"
+DECLARE_GEANT4_PROCESS(G4ecpssrBaseKxsModel)
+#include "G4ecpssrBaseLixsModel.hh"
+DECLARE_GEANT4_PROCESS(G4ecpssrBaseLixsModel)
+#include "G4ecpssrFormFactorKxsModel.hh"
+DECLARE_GEANT4_PROCESS(G4ecpssrFormFactorKxsModel)
+//#include "G4ee2KChargedModel.hh"
+//DECLARE_GEANT4_PROCESS(G4ee2KChargedModel)
+//#include "G4ee2KNeutralModel.hh"
+//DECLARE_GEANT4_PROCESS(G4ee2KNeutralModel)
+//#include "G4eeTo3PiModel.hh"
+//DECLARE_GEANT4_PROCESS(G4eeTo3PiModel)
+//#include "G4eeToHadronsModel.hh"
+//DECLARE_GEANT4_PROCESS(G4eeToHadronsModel)
+#include "G4ecpssrFormFactorLixsModel.hh"
+DECLARE_GEANT4_PROCESS(G4ecpssrFormFactorLixsModel)
+#include "G4ecpssrFormFactorMixsModel.hh"
+DECLARE_GEANT4_PROCESS(G4ecpssrFormFactorMixsModel)
+#include "G4EmMultiModel.hh"
+DECLARE_GEANT4_PROCESS(G4EmMultiModel)
+#include "G4ePolarizedBremsstrahlungModel.hh"
+DECLARE_GEANT4_PROCESS(G4ePolarizedBremsstrahlungModel)
+#include "G4FTFModel.hh"
+DECLARE_GEANT4_PROCESS(G4FTFModel)
+#include "G4GoudsmitSaundersonMscModel.hh"
+DECLARE_GEANT4_PROCESS(G4GoudsmitSaundersonMscModel)
+#include "G4hBremsstrahlungModel.hh"
+DECLARE_GEANT4_PROCESS(G4hBremsstrahlungModel)
+#include "G4hCoulombScatteringModel.hh"
+DECLARE_GEANT4_PROCESS(G4hCoulombScatteringModel)
+//#include "G4hNuclearStoppingModel.hh"
+//DECLARE_GEANT4_PROCESS(G4hNuclearStoppingModel)
+#include "G4hPairProductionModel.hh"
+DECLARE_GEANT4_PROCESS(G4hPairProductionModel)
+//#include "G4hParametrisedLossModel.hh"
+//DECLARE_GEANT4_PROCESS(G4hParametrisedLossModel)
+#include "G4ICRU49NuclearStoppingModel.hh"
+DECLARE_GEANT4_PROCESS(G4ICRU49NuclearStoppingModel)
+#include "G4ICRU73NoDeltaModel.hh"
+DECLARE_GEANT4_PROCESS(G4ICRU73NoDeltaModel)
+#include "G4ICRU73QOModel.hh"
+DECLARE_GEANT4_PROCESS(G4ICRU73QOModel)
+//#include "G4INCLIClusteringModel.hh"
+//DECLARE_GEANT4_PROCESS(G4INCLIClusteringModel)
+//#include "G4INCLIPropagationModel.hh"
+//DECLARE_GEANT4_PROCESS(G4INCLIPropagationModel)
+//#include "G4INCLStandardPropagationModel.hh"
+//DECLARE_GEANT4_PROCESS(G4INCLStandardPropagationModel)
+//#include "G4IonChuFluctuationModel.hh"
+//DECLARE_GEANT4_PROCESS(G4IonChuFluctuationModel)
+
+#endif
+
+
 #if 0
 #include ".hh"
 DECLARE_GEANT4_PROCESS()
 #endif
+
diff --git a/DDG4/plugins/Geant4SDActions.cpp b/DDG4/plugins/Geant4SDActions.cpp
index 5b66094fa9d3e3d9b2c20fe8f138d30f50d5e62a..00a0c56610f8af621342aa7413546ba57f5c8304 100644
--- a/DDG4/plugins/Geant4SDActions.cpp
+++ b/DDG4/plugins/Geant4SDActions.cpp
@@ -12,6 +12,8 @@
 #include "G4OpticalPhoton.hh"
 #include "G4VProcess.hh"
 
+using namespace CLHEP;
+
 /// Namespace for the AIDA detector description toolkit
 namespace DD4hep {
 
diff --git a/DDG4/plugins/Geant4XMLSetup.cpp b/DDG4/plugins/Geant4XMLSetup.cpp
index 524e6b57e83284ca3b77f7dfc8d66711e80e8197..6e348cef84f80439198441e1e554d31455c1ad5c 100644
--- a/DDG4/plugins/Geant4XMLSetup.cpp
+++ b/DDG4/plugins/Geant4XMLSetup.cpp
@@ -467,7 +467,7 @@ namespace DD4hep {
   template <> void Converter<XMLSetup>::operator()(xml_h seq)  const  {
     xml_elt_t compact(seq);
     // First execute the basic setup from the plugins module
-    long result = ROOT::Reflex::PluginService::Create<long>("geant4_XML_reader",&lcdd,&seq);
+    long result = PluginService::Create<long>("geant4_XML_reader",&lcdd,&seq);
     if ( 0 == result )  {
       throw runtime_error("DD4hep: Failed to locate plugin to interprete files of type"
                           " \"" + seq.tag() + "\" - no factory of type geant4_XML_reader.");
diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp
index bd834e28da3dd2ff9c2b97f5bcb1a235445cafa5..3619bc25ba9a9b2b007fb170189bae981423e311 100644
--- a/DDG4/src/Geant4Converter.cpp
+++ b/DDG4/src/Geant4Converter.cpp
@@ -91,6 +91,7 @@ using namespace DD4hep::Simulation;
 using namespace DD4hep::Simulation::Geant4GeometryMaps;
 using namespace DD4hep::Geometry;
 using namespace DD4hep;
+using namespace CLHEP;
 using namespace std;
 
 #include "DDG4/Geant4AssemblyVolume.h"
@@ -827,7 +828,7 @@ void* Geant4Converter::handleSensitive(SensitiveDetector sens_det, const set<con
       g4 = PluginService::Create<G4VSensitiveDetector*>(type, name, &m_lcdd);
       if (!g4) {
         PluginDebug dbg;
-        g4 = ROOT::Reflex::PluginService::Create<G4VSensitiveDetector*>(type, name, &m_lcdd);
+        g4 = PluginService::Create<G4VSensitiveDetector*>(type, name, &m_lcdd);
         if ( !g4 )  {
           throw runtime_error("Geant4Converter<SensitiveDetector>: FATAL Failed to "
                               "create Geant4 sensitive detector factory " + name + " of type " + type + ".");
@@ -894,7 +895,7 @@ void Geant4Converter::handleProperties(LCDD::Properties& prp) const {
     const LCDD::PropertyValues& vals = prp[nam];
     string type = vals.find("type")->second;
     string tag = type + "_Geant4_action";
-    long result = ROOT::Reflex::PluginService::Create<long>(tag, &m_lcdd, ptr, &vals);
+    long result = PluginService::Create<long>(tag, &m_lcdd, ptr, &vals);
     if (0 == result) {
       throw runtime_error("Failed to locate plugin to interprete files of type"
                           " \"" + tag + "\" - no factory:" + type);
diff --git a/DDG4/src/Geant4Exec.cpp b/DDG4/src/Geant4Exec.cpp
index 6729076f47dec56488e0b1701da6363d94f85993..76bb84c0701561e317914f0e0b0e84b582988f60 100644
--- a/DDG4/src/Geant4Exec.cpp
+++ b/DDG4/src/Geant4Exec.cpp
@@ -18,9 +18,6 @@
 #include "G4UserTrackingAction.hh"
 #include "G4UserStackingAction.hh"
 #include "G4UserSteppingAction.hh"
-#if G4VERSION_NUMBER < 1000
-#include "G4UserReactionAction.hh"
-#endif
 #include "G4VUserPhysicsList.hh"
 #include "G4VModularPhysicsList.hh"
 #include "G4VUserPrimaryGeneratorAction.hh"
@@ -333,9 +330,9 @@ int Geant4Exec::configure(Geant4Kernel& kernel) {
   G4RunManager& runManager = kernel.runManager();
 
   // Check if the geometry was loaded
-  if (lcdd.detectors().size() <= 1) {
+  if (lcdd.sensitiveDetectors().size() <= 1) {
     printout(WARNING, "Geant4Exec", "+++ Only %d subdetectors present. "
-             "You sure you loaded the geometry properly?",int(lcdd.detectors().size()));
+             "You sure you loaded the geometry properly?",int(lcdd.sensitiveDetectors().size()));
   }
   // Get the detector constructed
   Geant4DetectorConstruction* detector = Geant4DetectorConstruction::instance(kernel);
diff --git a/DDG4/src/Geant4HierarchyDump.cpp b/DDG4/src/Geant4HierarchyDump.cpp
index a2ed19f7b21bcb086a2c0d4238859c7492585267..ccd98d0edf7641c3fe145b93f18a145259b37360 100644
--- a/DDG4/src/Geant4HierarchyDump.cpp
+++ b/DDG4/src/Geant4HierarchyDump.cpp
@@ -10,21 +10,18 @@
 #include <G4Version.hh>
 
 #include "DD4hep/LCDD.h"
+#include "DD4hep/Plugins.h"
 #include "DD4hep/Volumes.h"
 #include "DD4hep/Printout.h"
 #include "DDG4/Geant4HierarchyDump.h"
 
-#include "Reflex/PluginService.h"
-
 #include "G4VisAttributes.hh"
 #include "G4ProductionCuts.hh"
 #include "G4VUserRegionInformation.hh"
 // Geant4 include files
 #include "G4Element.hh"
 #include "G4SDManager.hh"
-#if G4VERSION_NUMBER < 1000
-#include "G4Assembly.hh"
-#endif
+
 #include "G4AssemblyVolume.hh"
 #include "G4Box.hh"
 #include "G4Trd.hh"
diff --git a/DDG4/src/Geant4InputHandling.cpp b/DDG4/src/Geant4InputHandling.cpp
index 2adb54e2222aef555ee72086d8da60ffb14bd64b..c50acf07f9723c2940afd9fc97ba142b552163d2 100644
--- a/DDG4/src/Geant4InputHandling.cpp
+++ b/DDG4/src/Geant4InputHandling.cpp
@@ -24,6 +24,7 @@
 #include <cmath>
 
 using namespace std;
+using namespace CLHEP;
 using namespace DD4hep;
 using namespace DD4hep::Simulation;
 
diff --git a/DDG4/src/Geant4IsotropeGenerator.cpp b/DDG4/src/Geant4IsotropeGenerator.cpp
index c0ea420f382d1c628e603617f845c66f57db028c..de5a9dc6d5760b5809d99c1a567ee3efaa456d6d 100644
--- a/DDG4/src/Geant4IsotropeGenerator.cpp
+++ b/DDG4/src/Geant4IsotropeGenerator.cpp
@@ -11,32 +11,16 @@
 #include "DD4hep/Printout.h"
 #include "DD4hep/InstanceCount.h"
 #include "DDG4/Geant4Random.h"
-#include "DDG4/Geant4Context.h"
-#include "DDG4/Geant4Primary.h"
 #include "DDG4/Geant4IsotropeGenerator.h"
-#include "CLHEP/Units/SystemOfUnits.h"
-
-#include "G4ParticleTable.hh"
-#include "G4ParticleDefinition.hh"
-
-// C/C++ include files
-#include <stdexcept>
-#include <cmath>
 
 using namespace std;
 using namespace DD4hep::Simulation;
 
 /// Standard constructor
 Geant4IsotropeGenerator::Geant4IsotropeGenerator(Geant4Context* context, const string& name)
-: Geant4GeneratorAction(context, name), m_position(0,0,0), m_particle(0)
+: Geant4ParticleGenerator(context, name)
 {
   InstanceCount::increment(this);
-  m_needsControl = true;
-  declareProperty("Particle",      m_particleName = "e-");
-  declareProperty("Energy",        m_energy = 50 * CLHEP::MeV);
-  declareProperty("Multiplicity",  m_multiplicity = 1);
-  declareProperty("Mask",          m_mask = 0);
-  declareProperty("Position",      m_position);
 }
 
 /// Default destructor
@@ -44,57 +28,16 @@ Geant4IsotropeGenerator::~Geant4IsotropeGenerator() {
   InstanceCount::decrement(this);
 }
 
-/// Callback to generate primary particles
-void Geant4IsotropeGenerator::operator()(G4Event*) {
-  typedef Geant4Particle Particle;
-
-  if (0 == m_particle || m_particle->GetParticleName() != m_particleName.c_str()) {
-    G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
-    m_particle = particleTable->FindParticle(m_particleName);
-    if (0 == m_particle) {
-      throw runtime_error("Geant4IsotropeGenerator: Bad particle type:"+m_particleName+"!");
-    }
-  }
+/// Particle modification. Caller presets defaults to: ( direction = m_direction, momentum = m_energy)
+void Geant4IsotropeGenerator::getParticleDirection(int, ROOT::Math::XYZVector& direction, double& momentum) const   {
   Geant4Event& evt = context()->event();
   Geant4Random& rnd = evt.random();
-  Geant4PrimaryEvent* prim = evt.extension<Geant4PrimaryEvent>();
-  Geant4PrimaryInteraction* inter = new Geant4PrimaryInteraction();
-  prim->add(m_mask, inter);
-
-  Geant4Vertex* vtx = new Geant4Vertex();
-  vtx->mask = m_mask;
-  vtx->x = m_position.X();
-  vtx->y = m_position.Y();
-  vtx->z = m_position.Z();
-  inter->vertices.insert(make_pair(inter->vertices.size(),vtx));
-  for(int i=0; i<m_multiplicity; ++i)   {
-    double phi = 2*M_PI*rnd.rndm();
-    double theta = M_PI*rnd.rndm();
-    double x1 = std::sin(theta)*std::cos(phi);
-    double x2 = std::sin(theta)*std::sin(phi);
-    double x3 = std::cos(theta);
-    double momentum = rnd.rndm()*m_energy;
-
-    Particle* p = new Particle();
-    p->id         = inter->nextPID();
-    p->status    |= G4PARTICLE_GEN_STABLE;
-    p->mask       = m_mask;
-    p->pdgID      = m_particle->GetPDGEncoding();
-    //p->definition = m_particle;
-    p->psx        = x1*momentum;
-    p->psy        = x2*momentum;
-    p->psz        = x3*momentum;
-    p->mass       = m_particle->GetPDGMass();
-    p->vsx        = vtx->x;
-    p->vsy        = vtx->y;
-    p->vsz        = vtx->z;
-    p->vex        = vtx->x;
-    p->vey        = vtx->y;
-    p->vez        = vtx->z;
-    inter->particles.insert(make_pair(p->id,p));
-    vtx->out.insert(p->id);
-    printout(INFO,name(),"Particle [%d] %s %.3f GeV direction:(%6.3f %6.3f %6.3f)",
-             p->id, m_particleName.c_str(), momentum/CLHEP::GeV, x1, x2, x3);
-
-  }
+  double phi   = 2*M_PI*rnd.rndm();
+  double theta = M_PI*rnd.rndm();
+  double x1 = std::sin(theta)*std::cos(phi);
+  double x2 = std::sin(theta)*std::sin(phi);
+  double x3 = std::cos(theta);
+
+  direction.SetXYZ(x1,x2,x3);
+  momentum = rnd.rndm()*momentum;
 }
diff --git a/DDG4/src/Geant4Particle.cpp b/DDG4/src/Geant4Particle.cpp
index 581333e7ec636dbb22afc9c18d58d66bf7fb2f64..19529229fe9cc85c8c12678a16fc38f9cab402fa 100644
--- a/DDG4/src/Geant4Particle.cpp
+++ b/DDG4/src/Geant4Particle.cpp
@@ -22,6 +22,7 @@
 
 #include <iostream>
 
+using namespace CLHEP;
 using namespace DD4hep;
 using namespace DD4hep::Simulation;
 typedef ReferenceBitMask<int> PropertyMask;
diff --git a/DDG4/src/Geant4ParticleGenerator.cpp b/DDG4/src/Geant4ParticleGenerator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2a134b855cea8f4ce0f1f9c9ed0daddc210ba8c6
--- /dev/null
+++ b/DDG4/src/Geant4ParticleGenerator.cpp
@@ -0,0 +1,115 @@
+// $Id: Geant4Converter.cpp 603 2013-06-13 21:15:14Z markus.frank $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+
+// Framework include files
+#include "DD4hep/Printout.h"
+#include "DD4hep/InstanceCount.h"
+#include "DDG4/Geant4Context.h"
+#include "DDG4/Geant4Primary.h"
+#include "DDG4/Geant4ParticleGenerator.h"
+#include "CLHEP/Units/SystemOfUnits.h"
+
+#include "G4ParticleTable.hh"
+#include "G4ParticleDefinition.hh"
+
+// C/C++ include files
+#include <stdexcept>
+#include <cmath>
+
+using CLHEP::MeV;
+using CLHEP::GeV;
+using namespace std;
+using namespace DD4hep::Simulation;
+
+/// Standard constructor
+Geant4ParticleGenerator::Geant4ParticleGenerator(Geant4Context* context, const string& name)
+  : Geant4GeneratorAction(context, name), m_direction(0,1,0), m_position(0,0,0), m_particle(0)
+{
+  InstanceCount::increment(this);
+  m_needsControl = true;
+  declareProperty("Particle",      m_particleName = "e-");
+  declareProperty("Energy",        m_energy = 50 * CLHEP::MeV);
+  declareProperty("Multiplicity",  m_multiplicity = 1);
+  declareProperty("Mask",          m_mask = 0);
+  declareProperty("Position",      m_position);
+  declareProperty("Direction",     m_direction);
+}
+
+/// Default destructor
+Geant4ParticleGenerator::~Geant4ParticleGenerator() {
+  InstanceCount::decrement(this);
+}
+
+/// Particle modification. Caller presets defaults to: ( direction = m_direction, momentum = m_energy)
+void Geant4ParticleGenerator::getParticleDirection(int , ROOT::Math::XYZVector& , double& ) const   {
+}
+
+/// Particle modification. Caller presets defaults to: (multiplicity=m_multiplicity)
+void Geant4ParticleGenerator::getParticleMultiplicity(int& ) const   {
+}
+
+/// Particle modification. Caller presets defaults to: (multiplicity=m_multiplicity)
+void Geant4ParticleGenerator::getVertexPosition(ROOT::Math::XYZVector& ) const   {
+}
+
+/// Callback to generate primary particles
+void Geant4ParticleGenerator::operator()(G4Event*) {
+  typedef Geant4Particle Particle;
+
+  if (0 == m_particle || m_particle->GetParticleName() != m_particleName.c_str()) {
+    G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
+    m_particle = particleTable->FindParticle(m_particleName);
+    if (0 == m_particle) {
+      throw runtime_error("Geant4ParticleGenerator: Bad particle type:"+m_particleName+"!");
+    }
+  }
+  Geant4Event& evt = context()->event();
+  Geant4PrimaryEvent* prim = evt.extension<Geant4PrimaryEvent>();
+  Geant4PrimaryInteraction* inter = new Geant4PrimaryInteraction();
+  prim->add(m_mask, inter);
+
+  Geant4Vertex* vtx = new Geant4Vertex();
+  int multiplicity = m_multiplicity;
+  ROOT::Math::XYZVector position = m_position;
+  getVertexPosition(position);
+  getParticleMultiplicity(multiplicity);
+  vtx->mask = m_mask;
+  vtx->x = position.X();
+  vtx->y = position.Y();
+  vtx->z = position.Z();
+  inter->vertices.insert(make_pair(inter->vertices.size(),vtx));
+  for(int i=0; i<m_multiplicity; ++i)   {
+    double momentum = m_energy;
+    ROOT::Math::XYZVector direction = m_direction;
+    getParticleDirection(i, direction, momentum);
+
+    Particle* p = new Particle();
+    p->id         = inter->nextPID();
+    p->status    |= G4PARTICLE_GEN_STABLE;
+    p->mask       = m_mask;
+    p->pdgID      = m_particle->GetPDGEncoding();
+
+    p->psx        = direction.X()*momentum;
+    p->psy        = direction.Y()*momentum;
+    p->psz        = direction.Z()*momentum;
+    p->mass       = m_particle->GetPDGMass();
+    p->vsx        = vtx->x;
+    p->vsy        = vtx->y;
+    p->vsz        = vtx->z;
+    p->vex        = vtx->x;
+    p->vey        = vtx->y;
+    p->vez        = vtx->z;
+    inter->particles.insert(make_pair(p->id,p));
+    vtx->out.insert(p->id);
+    printout(INFO,name(),"Particle [%d] %s %.3f GeV direction:(%6.3f %6.3f %6.3f)",
+             p->id, m_particleName.c_str(), momentum/CLHEP::GeV, 
+	     direction.X(), direction.Y(), direction.Z());
+
+  }
+}
diff --git a/DDG4/src/Geant4ParticleGun.cpp b/DDG4/src/Geant4ParticleGun.cpp
index 8b873c69bc4e7848f5152c92673f917fe6a3a383..16d5b82fb6aa30933b76c82897370ac2b3e5c679 100644
--- a/DDG4/src/Geant4ParticleGun.cpp
+++ b/DDG4/src/Geant4ParticleGun.cpp
@@ -25,6 +25,8 @@
 #include <limits>
 #include <cmath>
 
+using CLHEP::MeV;
+using CLHEP::GeV;
 using namespace std;
 using namespace DD4hep::Simulation;
 
diff --git a/DDG4/src/Geant4ParticleHandler.cpp b/DDG4/src/Geant4ParticleHandler.cpp
index cc538c2babc95cc11ae183f2e91c846de31b3fc1..8d63cb3d8e11181ac43aa826994a2ad565c1c4f0 100644
--- a/DDG4/src/Geant4ParticleHandler.cpp
+++ b/DDG4/src/Geant4ParticleHandler.cpp
@@ -33,6 +33,7 @@
 #include <stdexcept>
 #include <algorithm>
 
+using CLHEP::MeV;
 using namespace std;
 using namespace DD4hep;
 using namespace DD4hep::Simulation;
diff --git a/DDG4/src/Geant4Plugins.cpp b/DDG4/src/Geant4Plugins.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2a53f74e2b2406fa553d1e2da93343ee94662a57
--- /dev/null
+++ b/DDG4/src/Geant4Plugins.cpp
@@ -0,0 +1,38 @@
+// $Id: Readout.cpp 590 2013-06-03 17:02:43Z markus.frank $
+//====================================================================
+//  AIDA Detector description implementation for LCD
+//--------------------------------------------------------------------
+//
+//  Author     : M.Frank
+//
+//====================================================================
+
+#include "DD4hep/Plugins.inl"
+#include "DDG4/Factories.h"
+#include "DDG4/Geant4SensDetAction.h"
+#include "DDG4/Geant4PhysicsList.h"
+#include "DDG4/Geant4InputAction.h"
+#include "DDG4/Geant4Converter.h"
+
+#include "G4VSensitiveDetector.hh"
+#include "G4MagIntegratorStepper.hh"
+#include "G4EquationOfMotion.hh"
+#include "G4Mag_EqRhs.hh"
+#include "G4MagneticField.hh"
+#include "G4VProcess.hh"
+#include "G4VPhysicsConstructor.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4VUserPhysicsList.hh"
+
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4VSensitiveDetector*, (std::string,DD4hep::Geometry::LCDD*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(DD4hep::Simulation::Geant4Sensitive*, (DD4hep::Simulation::Geant4Context*,std::string,DD4hep::Geometry::DetElement*,DD4hep::Geometry::LCDD*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(DD4hep::Simulation::Geant4Action*, (DD4hep::Simulation::Geant4Context*,std::string))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4MagIntegratorStepper*, (G4EquationOfMotion*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4MagIntegratorStepper*, (G4Mag_EqRhs*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4Mag_EqRhs*, (G4MagneticField*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4VProcess*, ())
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4VPhysicsConstructor*, ())
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4ParticleDefinition*, ())
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(G4VUserPhysicsList*, (DD4hep::Simulation::Geant4PhysicsListActionSequence*,int))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(long, (DD4hep::Geometry::LCDD*,const DD4hep::Simulation::Geant4Converter*,const std::map<std::string,std::string>*))
+DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(DD4hep::Simulation::Geant4EventReader*, (std::string))
diff --git a/UtilityApps/CMakeLists.txt b/UtilityApps/CMakeLists.txt
index a7e2b87e579ee17ecb97ac0f876daebac19da6ef..02863d8dd587ec12b09dcd5aa1dbfefe3fd21030 100644
--- a/UtilityApps/CMakeLists.txt
+++ b/UtilityApps/CMakeLists.txt
@@ -38,6 +38,7 @@ if(DD4HEP_USE_LCIO)
 
   add_executable(test_surfaces src/test_surfaces.cpp )
   target_link_libraries(test_surfaces DD4hepCore DD4hepRec ${LCIO_LIBRARIES} )
+
 else()
   add_executable(teveDisplay src/teve_display.cpp G__teve.cxx src/next_event_dummy.cpp)
 endif()
diff --git a/UtilityApps/src/run_plugin.h b/UtilityApps/src/run_plugin.h
index 4dc37b4f3500c2697fe7471d5b0cf0bdafa956c9..39598b38d8d8dc770781bc971949e7686d7c1f14 100644
--- a/UtilityApps/src/run_plugin.h
+++ b/UtilityApps/src/run_plugin.h
@@ -30,10 +30,10 @@ namespace {
 
   LCDD& dd4hep_instance(const char* /* name */ ="") {
 #if 0
-#include "Reflex/PluginService.h"
+#include "DD4hep/PluginService.h"
     try {
       union { void* p; LCDD* l; } v;
-      v.p = ROOT::Reflex::PluginService::Create<void*>("LCDD_constructor",name);
+      v.p = ::DD4hep::PluginService::Create<void*>("LCDD_constructor",name);
       if ( v.p )  {
 	return *v.l;
       }
diff --git a/UtilityApps/src/test_surfaces.cpp b/UtilityApps/src/test_surfaces.cpp
index 5302f9654d02fbf013d9d96af714f41db829be67..301b445e33e00a65e33d7df27ebd75ed815ae8df 100644
--- a/UtilityApps/src/test_surfaces.cpp
+++ b/UtilityApps/src/test_surfaces.cpp
@@ -30,7 +30,7 @@ DDTest test = DDTest( "surfaces" ) ;
 //=============================================================================
 
 int main(int argc, char** argv ){
-  
+#if 0  
   if( argc < 3 ) {
     std::cout << " usage: test_surfaces compact.xml lcio_file.slcio" << std::endl ;
     exit(1) ;
@@ -188,7 +188,7 @@ int main(int argc, char** argv ){
     
     
   }
-  
+#endif  
   return 0;
 }
 
diff --git a/doc/release.notes b/doc/release.notes
index 02f6242d26b1228a37ac197b7c1931f38bf63829..5c6771fa85ff16eab91ef5f7aa25c332e7e690e5 100644
--- a/doc/release.notes
+++ b/doc/release.notes
@@ -3,6 +3,13 @@
 DD4hep  ----  Release Notes
 =================================
 
+
+2015/03/09 Markus Frank
+-----------------------
+  - Finalize move to geant4 version 10, started by A.Sailer
+  - Add non-isotrop particle generator in DDG4 (request P.Kostka)
+  - Isolate ROOT plugin manager as start to move to ROOT 6
+
  --------
 | v00-11 |  
  --------   
diff --git a/examples/ClientTests/compact/Assemblies.xml b/examples/ClientTests/compact/Assemblies.xml
index 05162d2c36fa22152c122f34dd58a570d17e23a9..a8d4a5cd0d3a0cda5ae6753b6a167f01e9cf3396 100644
--- a/examples/ClientTests/compact/Assemblies.xml
+++ b/examples/ClientTests/compact/Assemblies.xml
@@ -87,27 +87,27 @@
       <tubs rmin="VXD_inner_radius" rmax="VXD_outer_radius" zhalf="VXD_zhalf"/>
       <layer id="0"  vis="VXDLayerVis" phi0="-1.570796327e+00" region="VXD_LAYER_0_Region">
 	<support thickness=".1*mm" material="Carbon" vis="VXDSupportVis" region="VXD_SUPPORT_0_Region"/>
-	<ladder  zhalf="65*mm" radius="1.595000000e+01*mm"  width="1.100000000e+01*mm" offset="-1.874869853e+00*mm" thickness="0.05*mm" material="Silicon" number="10" region="VXD_LADDER_0_Region"/>
+	<ladder  zhalf="65*mm" radius="1.595e+01*mm"  width="1.1e+01*mm" offset="-1.874869853e+00*mm" thickness="0.05*mm" material="Silicon" number="10" region="VXD_LADDER_0_Region"/>
       </layer>
       <layer id="1"  vis="VXDLayerVis" phi0="-1.570796327e+00" region="VXD_Layer_1_Region">
 	<support thickness=".1*mm" material="Carbon" vis="VXDSupportVis"/>
-	<ladder  zhalf="65*mm" radius="18*mm"  width="1.100000000e+01*mm" offset="-1.874869853e+00*mm" thickness="0.05*mm" material="Silicon" number="10"/>
+	<ladder  zhalf="65*mm" radius="18*mm"  width="1.1e+01*mm" offset="-1.874869853e+00*mm" thickness="0.05*mm" material="Silicon" number="10"/>
       </layer>
       <layer id="2"  vis="VXDLayerVis" phi0="-1.570796327e+00" region="VXD_Layer_2_Region">
 	<support thickness=".1*mm" material="Carbon" vis="VXDSupportVis"/>
-	<ladder  zhalf="125*mm" radius="3.695000000e+01*mm"  width="2.200000000e+01*mm" offset="-1.837940563e+00*mm" thickness="0.05*mm" material="Silicon" number="11"/>
+	<ladder  zhalf="125*mm" radius="3.695e+01*mm"  width="2.2e+01*mm" offset="-1.837940563e+00*mm" thickness="0.05*mm" material="Silicon" number="11"/>
       </layer>
       <layer id="3"  vis="VXDLayerVis" phi0="-1.570796327e+00" region="VXD_Layer_3_Region">
 	<support thickness=".1*mm" material="Carbon" vis="VXDSupportVis"/>
-	<ladder  zhalf="125*mm" radius="39*mm"  width="2.200000000e+01*mm" offset="-1.837940563e+00*mm" thickness="0.05*mm" material="Silicon" number="11"/>
+	<ladder  zhalf="125*mm" radius="39*mm"  width="2.2e+01*mm" offset="-1.837940563e+00*mm" thickness="0.05*mm" material="Silicon" number="11"/>
       </layer>
       <layer id="4"  vis="VXDLayerVis" phi0="-1.570796327e+00" region="VXD_Layer_4_Region">
 	<support thickness=".1*mm" material="Carbon" vis="VXDSupportVis"/>
-	<ladder  zhalf="125*mm" radius="5.795000000e+01*mm"  width="2.200000000e+01*mm" offset="-2.636744400e+00*mm" thickness="0.05*mm" material="Silicon" number="17"/>
+	<ladder  zhalf="125*mm" radius="5.795e+01*mm"  width="2.2e+01*mm" offset="-2.6367444e+00*mm" thickness="0.05*mm" material="Silicon" number="17"/>
       </layer>
       <layer id="5"  vis="VXDLayerVis" phi0="-1.570796327e+00" region="VXD_Layer_5_Region">
 	<support thickness=".1*mm" material="Carbon" vis="VXDSupportVis"/>
-	<ladder  zhalf="125*mm" radius="60*mm"  width="2.200000000e+01*mm" offset="-2.636744400e+00*mm" thickness="0.05*mm" material="Silicon" number="17"/>
+	<ladder  zhalf="125*mm" radius="60*mm"  width="2.2e+01*mm" offset="-2.6367444e+00*mm" thickness="0.05*mm" material="Silicon" number="17"/>
       </layer>
     </detector>
   </detectors>
diff --git a/examples/ClientTests/compact/LheD_tracker.xml b/examples/ClientTests/compact/LheD_tracker.xml
index a6943bc4d4ff81c622f452a49fc4fad7e4e975d0..b0d0401a0f9626d28954d63f155685688f18bd97 100644
--- a/examples/ClientTests/compact/LheD_tracker.xml
+++ b/examples/ClientTests/compact/LheD_tracker.xml
@@ -22,343 +22,25 @@
     <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="tracking_region_zmax"   value="396.0*cm + 4*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.6*cm"/>
     <constant name="CentralBeamPipe_thickness" value="0.45*cm"/>
     <constant name="CentralBeamPipe_rmin" value="CentralBeamPipe_rmax - CentralBeamPipe_thickness"/>
-    <constant name="BeamPipe_thickness" value="0.3*cm"/>
-    <constant name="BeamPipe_endThickness" value="0.1*cm"/>
-    <constant name="BeamPipe_zmax" value="420.0*cm - 0.5*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="2.5*cm"/>
-    <constant name="Distance_VxBG10_in" value="0.03*cm"/>
-    <constant name="Distance_VxBG10_ou" value="0.6*cm"/>
-    <constant name="G10thickness" value="0.5*cm"/>
     <constant name="VxBar_Env" value="0.5*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+0.8*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="Distance_VXDLayer" value="5.0*cm"/>
-    <constant name="Diff_Radius_SITLayer" value="3.2*cm"/>
-    <constant name="Radius_SITLayer0" value="VXD_Ell_Max_r + 2*cm"/>                  <!-- 21.16 + 2. = 23.16-->
-    <constant name="Radius_SITLayer1" value="Radius_SITLayer0 + Distance_VXDLayer"/>  <!-- 23.16 + 5. = 28.16-->
-    <constant name="Radius_SITLayer2" value="Radius_SITLayer1 + Distance_VXDLayer"/>  <!-- 28.16 + 5. = 33.16-->
-    <constant name="Radius_SITLayer3" value="Radius_SITLayer2 + Distance_VXDLayer"/>  <!-- 33.16 + 5. = 38.16-->
-    <constant name="Radius_SITLayer4" value="Radius_SITLayer3 + Distance_VXDLayer"/>  <!-- 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+2.0*cm"/>
-    <constant name="SiVXDEndcap_z1" value="SiMod_z2+2.0*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="70*cm"/>
-    <constant name="Ftd_disk_z1"  value="90*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>            ftd - neg z  </comment>
-    <constant name="Btd_disk_z10"  value="-70*cm"/>
-    <constant name="Btd_disk_z11"  value="-90*cm"/>
-    <constant name="Btd_disk_z12"  value="-130*cm"/>
-    <constant name="Btd_disk_z13"  value="-170*cm"/>
-    <constant name="Btd_disk_z14"  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_z14+10*cm "/>
-    <constant name="EcalBarrel_zmin" value="Btd_disk_z14-2*cm "/>
-    <constant name="EcalEndcap_rmin" value="VertexBarrel_r1"/>
-    <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 + 9.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 + SolenoidBarrelInnerCryostatThickness1 + SolenoidBarrelInnerAirgapThickness1"/>
-    <constant name="SolenoidBarrelOuterZ1" value="SolenoidCoilOuterZ1+SolenoidEndcapAirgapThickness1"/>
-    <constant name="SolenoidBarrelOuterCryostatInnerRadius1" value="SolenoidBarrelConductorInnerRadius1  + SolenoidBarrelAlConductorThickness1 + SolenoidBarrelQuenchbackThickness1 + DipoleBarrelAlConductorThickness + 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+2.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"/> 
-    <constant name="MuonEndcap_zmin_bwd" value="MuonBarrel_zmin+EcalEndcap_length_bwd"/> 
-    <constant name="MuonEndcap_rmax0" value="(HcalBarrel_rmin - 10.0*cm ) / (cos(pi/MuonSides))"/>
-    <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="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="LumiCal_zmin - 0.5*cm"/>
-    <constant name="BeamPipe_rmax" value="19.0*cm"/>
-    <constant name="BeamPipe_rmin" value="BeamPipe_rmax - BeamPipe_thickness"/>
-    <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="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" />
@@ -366,124 +48,61 @@
   </limits>
 
   <display>
-    <vis name="InvisibleNoDaughters"      showDaughters="false" visible="false"/>
-    <vis name="InvisibleWithDaughters"    showDaughters="true" visible="false"/>
-
     <vis name="SiVertexBarrelModuleVis" alpha="1.0" r="1" g="1" b="0.6" drawingStyle="wireframe" showDaughters="true" visible="false"/>
     <vis name="SiVertexSensitiveVis" alpha="1.0" r="1" g="0.2" b="0.2" drawingStyle="solid" showDaughters="true" visible="true"/>
-    <vis name="SiVertexPassiveVis"   alpha="1.0" r="0" g="0.2" b="1" drawingStyle="solid" showDaughters="true" visible="true"/>
+    <vis name="SiVertexPassiveVis" alpha="1.0" r="0" g="0.2" b="1" drawingStyle="solid" showDaughters="true" visible="true"/>
     <vis name="SiVertexBarrelLayerVis" alpha="1.0" r="1" g="1" b="0.6" showDaughters="true" visible="false"/>
-
-    <vis name="SiTrackerBarrelModuleVis" alpha="1" r="0.7" g="1" b="0.6" drawingStyle="wireframe" showDaughters="false" visible="true"/>
-    <vis name="SiTrackerBarrelLayerVis" alpha="0.5" r="1" g="1" b="0.6" showDaughters="true" visible="false"/>
-
-    <vis name="SiTrackerForwardModulVis" alpha="1" r="1" g="0" b="0" showDaughters="false" visible="true"/>
-
-    <vis name="EcalBarrelVis" alpha="1.0" r="0" g="1" b="0.1" showDaughters="false" visible="true"/>
-    <vis name="EcalBarrelStaveVis" alpha="1.0" r="0" g="1" b="0.1" showDaughters="true" visible="true"/>
-
-    <vis name="EcalEndcapVis"       alpha="1" r="0" g="1" b="0.1" showDaughters="false" visible="true"/>
-    <vis name="EcalPlugVis"         alpha="1" r="0" g="1" b="0.8" showDaughters="false" visible="true"/>
-
-    <vis name="HcalBarrelVis"          alpha="1" r="1"    g="1"    b="0" showDaughters="false" visible="true"/>
-    <vis name="HcalBarrelStavesVis"    alpha="1" r="1"    g="1"    b="0" showDaughters="true" visible="true"/>
-    <vis name="HcalBarrelLayerVis"     alpha="1" r="1"    g="1"    b="0" showDaughters="true" visible="true"/>
-    <vis name="HcalBarrelSensorVis"    alpha="1" r="1"    g="1"    b="0" showDaughters="true" visible="true"/>
-
-    <vis name="HcalEndcapVis"          alpha="1" r="1"    g="1"    b="0.2" showDaughters="false" visible="true"/>
-    <vis name="HcalEndcapLayerVis"     alpha="1" r="1"    g="1"    b="0.2" showDaughters="true" visible="true"/>
-    <vis name="HcalEndcapStavesVis"     alpha="1" r="1"    g="1"    b="0.2" showDaughters="true" visible="true"/>
-    <vis name="HcalPlugVis"          alpha="1" r="0.8" g="0.8" b="0.8" showDaughters="false" visible="true"/>
-    <vis name="HcalPlugLayerVis"     alpha="1" r="0.8" g="0.8" b="0.8" showDaughters="true" visible="true"/>
-
-    <vis name="SolenoidBarrelLayerVis" alpha="1" r="0"    g="0.3"  b="0.3" showDaughters="true" visible="true"/>
-    <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.2"  g="0"  b="0.62"  showDaughters="true" visible="true"/>
-    <vis name="MuonBarrelStavesVis"    alpha="0.4" r="0.2"  g="0.2"  b="0.3" showDaughters="true" visible="true"/>
-    <vis name="MuonBarrelLayerVis"     alpha="0.4" r="0.2"  g="0.2"  b="0.3" showDaughters="false" visible="true"/>
-    <vis name="MuonBarrelSensorVis"    alpha="0.4" r="0.1"  g="0.2"  b="0.1" visible="true"/>
-    <vis name="MuonBarrelAbsorberVis"  alpha="0.4" r="0.3"  g="0.2"  b="0.62" visible="false"/>
-
-    <vis name="MuonEndcapVis"          alpha="0.4" r="0.2"  g="0.2"  b="0.62" showDaughters="true" visible="true"/>
-    <vis name="MuonEndcapLayerVis"     alpha="0.4" r="0.2"  g="0.2"  b="0.3"  showDaughters="true" visible="true"/>
-    <vis name="MuonEndcapSensorVis"    alpha="0.4" r="0.1"  g="0.2"  b="0.1" visible="true"/>
-    <vis name="MuonEndcapAbsorberVis"  alpha="0.4" r="0.3"  g="0.2"  b="0.62" visible="true"/>
-
     <vis name="BeamPipeVis" alpha="1" r="0.6" g="0.1" b="1" showDaughters="false" visible="true"/>
-    <vis name="CableVis" showDaughters="false" visible="false"/>
-
-    <vis name="SupportTubeVis" r="0.1" g="0.1" b="0.99" showDaughters="false" visible="true"/>
-    <vis name="TungstenShieldingVis" r="0.99" g="0.1" b="0.2" showDaughters="false" visible="true"/>
-
-    <vis name="SupportVis" r="0.8" g="0.8" b="0" showDaughters="false" visible="false"/>
-    <vis name="LumiCalVis" showDaughters="false" visible="true"/>
-    <vis name="GreenVis" r="0.0" g="1.0" b="0.0" showDaughters="true" visible="true"/>
-    <vis name="RedVis" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
     <vis name="BlueVis" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/>
   </display>
 
-
   <detectors>
 
-    <comment>Trackers</comment>
-    <detector id="1" name="SiVertexBarrel" type="LheD_tracker_SiVertexBarrel" readout="SiVertexBarrelHits" insideTrackingVolume="true" reflect="true" vis="BlueVis">
-      <comment>Vertex Detector Barrel</comment>
-      <module name="VtxBarrelModuleInner" vis="SiVertexBarrelModuleVis">
-	<module_envelope width="10.0*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="VxBar_Env"/>
-	<module_component width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0050*cm" material="Silicon" sensitive="true" vis="SiVertexSensitiveVis">
-	  <position z="0*cm"/>
-	</module_component>
-	<module_component width="7.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0065*cm" material="Carbon" sensitive="false" vis="SiVertexPassiveVis">
-	  <position z="0.0065*cm"/>
-	</module_component>
-	<module_component width="7.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0065*cm" material="Carbon" sensitive="false" vis="SiVertexPassiveVis">
-	  <position z="0.177*cm"/>
-	</module_component>
-	<module_component width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0050*cm" material="Silicon" sensitive="true" vis="SiVertexSensitiveVis">
-	  <position z="0.184*cm"/>
-	</module_component>
-      </module>
-
-      <layer module="VtxBarrelModuleInner" id="1" vis="SiVertexBarrelLayerVis">
-	<barrel_envelope inner_r="VertexBarrel_r0 - 1.8*VxBar_Env" outer_r="VertexBarrel_r0 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
-	<rphi_layout phi_tilt="0.*rad" nphi="21" phi0="1.57079632679489656e+00*rad" rc="VertexBarrel_r0 + 0*mm" dr="0.*mm"/>
-	<!-- 
-	     <rphi_layout phi_tilt="0.*rad" nphi="21" rmax2="11.*cm" phi0="1.57079632679489656e+00*rad" rc="VertexBarrel_r0 + 0*mm" dr="0.*mm"/>
-	-->
-	<z_layout dr="0.0*mm" z0="0*mm" nz="1"/>
-      </layer>
-
-      <layer module="VtxBarrelModuleInner" id="2" vis="SiVertexBarrelLayerVis">
-	<barrel_envelope inner_r="VertexBarrel_r1 - 1.8*VxBar_Env" outer_r="VertexBarrel_r1 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
-	<rphi_layout phi_tilt="0.*rad" nphi="40" phi0="1.57079632679489656e+00*rad" rc="VertexBarrel_r1 + 0*mm" dr="0.*mm"/>
-	<z_layout dr="0.0*mm" z0="0*mm" nz="1"/>
-      </layer>
-
-      <layer module="VtxBarrelModuleInner" id="3" vis="SiVertexBarrelLayerVis">
-	<barrel_envelope inner_r="VertexBarrel_r2 - 1.8*VxBar_Env" outer_r="VertexBarrel_r2 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
-	<rphi_layout phi_tilt="0.*rad" nphi="50" phi0="1.57079632679489656e+00*rad" 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 - 1.8*VxBar_Env" outer_r="VertexBarrel_r3 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
-	<rphi_layout phi_tilt="0.*rad" nphi="60" phi0="1.57079632679489656e+00*rad" rc="VertexBarrel_r3 + 0*mm" dr="0.*mm"/>
-	<z_layout dr="0.0" z0="0.0" nz="1"/>
-      </layer>
-
-    </detector>
-
-
-    <comment>Dead material and supports</comment>
-    <comment>Beampipe - has to be modified - circular-elliptical, in turn the pixel layer(s) as well   </comment>
-
-    <detector name="Beampipe" type="LheD_tracker_BeamPipe" insideTrackingVolume="true" vis="BeamPipeVis">
-      <comment>Central Be Beampipe</comment>
-      <material name="Beryllium"/>
-    </detector>
-
+   <comment>Vertex Detector Barrel</comment>
+   <detector id="1" name="SiVertexBarrel" type="LheD_tracker_SiVertexBarrel" readout="SiVertexBarrelHits" insideTrackingVolume="true" reflect="true" vis="BlueVis">
+    <module name="VtxBarrelModuleInner" vis="SiVertexBarrelModuleVis">
+      <module_envelope width="10.0*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="VxBar_Env"/>
+         <module_component width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0050*cm" material="Silicon" sensitive="true" vis="SiVertexSensitiveVis">
+         <position z="0*cm"/>
+      </module_component>
+      <module_component width="7.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0065*cm" material="Carbon" sensitive="false" vis="SiVertexPassiveVis">
+         <position z="0.0065*cm"/>
+      </module_component>
+      <module_component width="7.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0065*cm" material="Carbon" sensitive="false" vis="SiVertexPassiveVis">
+         <position z="0.177*cm"/>
+      </module_component>
+      <module_component width="9.8*mm" length="(VertexBarrel_zmax-0.15*cm)*4" thickness="0.0050*cm" material="Silicon" sensitive="true" vis="SiVertexSensitiveVis">
+         <position z="0.184*cm"/>
+      </module_component>
+    </module>
+    <layer module="VtxBarrelModuleInner" id="1" vis="SiVertexBarrelLayerVis">
+       <barrel_envelope inner_r="VertexBarrel_r0 - 1.8*VxBar_Env" outer_r="VertexBarrel_r0 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
+       <rphi_layout phi_tilt="0.*rad" nphi="21" phi0="4.71238898038468967e+00*rad" rc="VertexBarrel_r0 + 0*mm" dr="0.*mm"/>
+       <z_layout dr="0.0*mm" z0="0*mm" nz="1"/>
+    </layer>
+    <layer module="VtxBarrelModuleInner" id="2" vis="SiVertexBarrelLayerVis">
+       <barrel_envelope inner_r="VertexBarrel_r1 - 1.8*VxBar_Env" outer_r="VertexBarrel_r1 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
+       <rphi_layout phi_tilt="0.*rad" nphi="40" phi0="4.71238898038468967e+00*rad" rc="VertexBarrel_r1 + 0*mm" dr="0.*mm"/>
+       <z_layout dr="0.0*mm" z0="0*mm" nz="1"/>
+    </layer>
+    <layer module="VtxBarrelModuleInner" id="3" vis="SiVertexBarrelLayerVis">
+       <barrel_envelope inner_r="VertexBarrel_r2 - 1.8*VxBar_Env" outer_r="VertexBarrel_r2 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
+       <rphi_layout phi_tilt="0.*rad" nphi="50" phi0="4.71238898038468967e+00*rad" 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 - 1.8*VxBar_Env" outer_r="VertexBarrel_r3 + 1.8*VxBar_Env" z_length="VertexBarrel_zmax*4"/>
+       <rphi_layout phi_tilt="0.*rad" nphi="60" phi0="4.71238898038468967e+00*rad" rc="VertexBarrel_r3 + 0*mm" dr="0.*mm"/>
+       <z_layout dr="0.0" z0="0.0" nz="1"/>
+    </layer>
+   </detector>
+
+   <comment> Beampipe </comment>
+   <detector name="Beampipe" type="LheD_tracker_BeamPipe" insideTrackingVolume="true" vis="BeamPipeVis">
+     <comment>Central Be Beampipe</comment>
+     <material name="Beryllium"/>
+     <zplane rmin="CentralBeamPipe_rmin" rmax="CentralBeamPipe_rmax" z="VertexBarrel_zmax*2"/>
+   </detector>
 
   </detectors>
 
diff --git a/examples/ClientTests/compact/NestedDetectors.xml b/examples/ClientTests/compact/NestedDetectors.xml
new file mode 100644
index 0000000000000000000000000000000000000000..cd3d3e2a402aca999bb0f8c62ad05d7102bb103f
--- /dev/null
+++ b/examples/ClientTests/compact/NestedDetectors.xml
@@ -0,0 +1,62 @@
+<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="Nested_Detectors_test"
+        title="Test for nested detector descriptions"
+        author="Markus Frank"
+        url="None"
+        status="development"
+        version="$Id: compact.xml 1374 2014-11-05 10:49:55Z markus.frank@cern.ch $">
+    <comment>Test for nested detector descriptions</comment>        
+  </info>
+
+  <includes>
+    <gdmlFile ref="${DDDetectors_dir}/elements.xml"/>
+    <gdmlFile ref="${DDDetectors_dir}/materials.xml"/>
+  </includes>
+  
+  <define>
+    <constant name="DDDetectors_dir" value="../../../DDDetectors/compact" type="string"/>;
+    <constant name="SiD_dir" value="${DDDetectors_dir}/SiD" type="string"/>;
+    <constant name="world_side" value="30000*mm"/>
+    <constant name="world_x" value="world_side"/>
+    <constant name="world_y" value="world_side"/>
+    <constant name="world_z" value="world_side"/>
+
+    <constant name="VertexBarrel_ID" value="1"/>
+    <constant name="VertexBarrel_zmax" value="10.0*cm"/>
+    <constant name="VertexBarrel_r1" value="2.7*cm"/>
+    <constant name="VertexBarrel_r2" value="3.8*cm"/>
+    <constant name="VertexBarrel_r3" value="5.1*cm"/>
+    <constant name="VertexBarrel_r4" value="6.4*cm"/>
+    <constant name="VertexBarrel_r5" value="7.7*cm"/>
+
+    <constant name="SiTrackerBarrel_ID" value="3"/>
+  </define>
+
+  <limits><limitset name="SiTrackerBarrelRegionLimitSet"/></limits>
+  <regions><region name="SiTrackerBarrelRegion" eunit="MeV" lunit="mm" cut="0.001" threshold="0.001"/></regions>
+
+  <comment>Common Generic visualization attributes</comment>
+  <display>
+    <vis name="InvisibleNoDaughters"      showDaughters="false" visible="false"/>
+    <vis name="InvisibleWithDaughters"    showDaughters="true" visible="false"/>
+    <vis name="BlueVis" alpha="1" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/>
+  </display>
+
+  <comment>Tracking detectors</comment>
+  <detectors>
+    <detector id="99" name="SiTrackers" type="DD4hep_SubdetectorAssembly" vis="BlueVis">
+      <comment>Silicon Tracker Assembly</comment>
+      <composite name="SiTrackerBarrel"/>
+      <composite name="SiVertexBarrel"/>
+    </detector>
+  </detectors>
+
+  <include ref="${SiD_dir}/SiD_TrackerConfig.xml"/>
+  <include ref="${SiD_dir}/SiD_TrackerBarrel.xml"/>
+
+  <include ref="${SiD_dir}/SiD_VertexConfig.xml"/>
+  <include ref="${SiD_dir}/SiD_VertexBarrel.xml"/>
+</lccdd>
diff --git a/examples/ClientTests/scripts/LheD_tracker.py b/examples/ClientTests/scripts/LheD_tracker.py
index ce2f7076f2e4605c06a704480fd2207a23a89a99..9dbb9cc4d95e10ff6705cf65789fcbfd5d5d071d 100644
--- a/examples/ClientTests/scripts/LheD_tracker.py
+++ b/examples/ClientTests/scripts/LheD_tracker.py
@@ -16,8 +16,8 @@ from SystemOfUnits import *
 def run():
   kernel = DDG4.Kernel()
   lcdd = kernel.lcdd()
+  
   install_dir = os.environ['DD4hepINSTALL']
-  example_dir = install_dir+'/examples/DDG4/examples';
   kernel.loadGeometry("file:"+install_dir+"/examples/ClientTests/compact/LheD_tracker.xml")
 
   DDG4.importConstants(lcdd,debug=False)
@@ -26,8 +26,8 @@ def run():
 
   # Configure UI
   geant4.setupCshUI()
-  #simple.setupCshUI('csh',True,True)
-  #simple.setupCshUI('csh',True,True,'vis.mac')
+  ##geant4.setupCshUI('csh',True,True)
+  ##geant4.setupCshUI('csh',True,True,'vis.mac')
   if len(sys.argv) >= 2 and sys.argv[1] =="batch":
     kernel.UI = ''
   field = geant4.addConfig('Geant4FieldTrackingSetupAction/MagFieldTrackingSetup')
@@ -58,39 +58,18 @@ def run():
   kernel.eventAction().adopt(prt)
 
   generator_output_level = Output.WARNING
-  evt_root = geant4.setupROOTOutput('RootOutput','CLICSiD_'+time.strftime('%Y-%m-%d_%H-%M'))
+
+  # Configure I/O
+  ##evt_lcio = geant4.setupLCIOOutput('LcioOutput','LHeD_tracker_'+time.strftime('%Y-%m-%d_%H-%M'))
+  ##evt_lcio.OutputLevel = generator_output_level
+  evt_root = geant4.setupROOTOutput('RootOutput','LHeD_tracker_'+time.strftime('%Y-%m-%d_%H-%M'))
 
   gen = geant4.setupGun("Gun",particle='geantino',energy=20*GeV,position=(0*mm,0*mm,0*cm),multiplicity=3)
   gen.isotrop = False
   gen.direction = (1,0,0)
   gen.OutputLevel = generator_output_level
 
-
-  """
-  #seq,act = geant4.setupTracker('SiTrackerBarrel')
-
-  # First the tracking detectors
-  seq,act = geant4.setupTracker('SiVertexBarrel')
-  seq,act = geant4.setupTracker('SiVertexEndcap')
-  seq,act = geant4.setupTracker('SiTrackerBarrel')
-  seq,act = geant4.setupTracker('SiTrackerEndcap')
-  seq,act = geant4.setupTracker('SiTrackerForward')
-  # Now the calorimeters
-  seq,act = geant4.setupCalorimeter('EcalBarrel')
-  seq,act = geant4.setupCalorimeter('EcalEndcap')
-  seq,act = geant4.setupCalorimeter('HcalBarrel')
-  seq,act = geant4.setupCalorimeter('HcalEndcap')
-  seq,act = geant4.setupCalorimeter('HcalPlug')
-  seq,act = geant4.setupCalorimeter('MuonBarrel')
-  seq,act = geant4.setupCalorimeter('MuonEndcap')
-  seq,act = geant4.setupCalorimeter('LumiCal')
-  seq,act = geant4.setupCalorimeter('BeamCal')
-  """
-  """
-  scan = DDG4.SteppingAction(kernel,'Geant4MaterialScanner/MaterialScan')
-  kernel.steppingAction().adopt(scan)
-  """
-
+  #seq,act = geant4.setupTracker('SiVertexBarrel')
 
   # Now build the physics list:
   phys = geant4.setupPhysics('QGSP_BERT')
diff --git a/examples/ClientTests/src/LheD_tracker_BeamPipe_geo.cpp b/examples/ClientTests/src/LheD_tracker_BeamPipe_geo.cpp
index 5b769bb739271ba01b519747ab3a7d01ebdb3f58..513f237fcbdd16e703b0c21790900e3b4cc1026e 100644
--- a/examples/ClientTests/src/LheD_tracker_BeamPipe_geo.cpp
+++ b/examples/ClientTests/src/LheD_tracker_BeamPipe_geo.cpp
@@ -4,7 +4,7 @@
 //--------------------------------------------------------------------
 //
 //  Author     : M.Frank
-//  mod.:        P.Kostka LHeD (asymmetrical detector placement in z)
+//  Modified   : E.Pilicer ( tube + elliptical pipe layout )
 //
 //====================================================================
 #include "DD4hep/DetFactoryHelper.h"
@@ -15,21 +15,25 @@ using namespace DD4hep;
 using namespace DD4hep::Geometry;
 
 static Ref_t create_detector(LCDD& lcdd, xml_h e, Ref_t)    {
-  // XML detector object: DDCore/XML/XMLDetector.h
   xml_det_t  x_det = e;
-  //Create the DetElement for DD4hep
   string     name  = x_det.nameStr();
   DetElement sdet (name,x_det.id());
-  //DetElement d_det(x_det.nameStr(),x_det.id());
-  
   Material   mat  (lcdd.material(x_det.materialStr()));
 
-  // XML dimension object: DDCore/XML/XMLDimension.h   
-  double ra    = 10.;     // elipse short radius
-  double rb    = 2.2;     // elipse long radius
-  double z     = 50.0;    // pipe length
-  double thick = 0.45;    // pipe wall thickness
-  double phi   = M_PI/2;  // rotation
+  // multiplication factor for ellipse major radius
+  double c0 = 3.5;
+  double rmin, rmax, z;
+
+  for(xml_coll_t c(x_det,_U(zplane)); c; ++c)  {
+    xml_comp_t dim(c);
+    rmin = dim.rmin();
+    rmax = dim.rmax();
+    z    = dim.z();
+  }
+ 
+  double ra    = rmax * c0;      // elipse long radius
+  double rb    = rmax;           // elipse short radius
+  double thick = rmax - rmin;    // pipe wall thickness
  
   EllipticalTube bpElTubeOut(ra+thick, rb+thick, z);
   EllipticalTube bpElTubeInn(ra, rb, z+thick);
diff --git a/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp b/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp
index 7cb588516db354f3bbfad9490a5ba4b0324fe43e..63e00b0271ef2dcad63987b0ef81af759b906924 100644
--- a/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp
+++ b/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp
@@ -4,6 +4,7 @@
 //--------------------------------------------------------------------
 //
 //  Author     : M.Frank
+//  Modified   : E.Pilicer ( tube + elliptical vertex layout )
 //
 //====================================================================
 #include "DD4hep/DetFactoryHelper.h"
@@ -13,6 +14,17 @@ using namespace std;
 using namespace DD4hep;
 using namespace DD4hep::Geometry;
 
+/*************************************************************
+ function to calculate path in a given theta
+**************************************************************/
+static double computeDpt( double ra, double rb, double theta ) {
+    double dp = 0.0;
+    double dpt_sin = std::pow(ra * std::sin(theta), 2.0);
+    double dpt_cos = std::pow(rb * std::cos(theta), 2.0);
+    dp = std::sqrt(dpt_sin + dpt_cos);
+    return dp;
+}
+
 static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens)  {
   xml_det_t   x_det     = e;
   Material    air       = lcdd.air();
@@ -23,14 +35,16 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens)  {
   map<string, Volume>    volumes;
   PlacedVolume pv;
 
-  double  mod_width;//       =   1;                         // (10.0 mm) module width
+  double  mod_width;
     
   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;
 
@@ -47,27 +61,26 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens)  {
       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,lcdd.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));
+        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)));
+        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)));
+        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);
+        pv = m_vol.placeVolume(c_vol);
       }
       c_vol.setRegion(lcdd, x_comp.regionStr());
       c_vol.setLimitSet(lcdd, x_comp.limitsStr());
       c_vol.setVisAttributes(lcdd, x_comp.visStr());
       if ( x_comp.isSensitive() ) {
-	pv.addPhysVolID(_U(sensor),sensor_number++);
-	c_vol.setSensitiveDetector(sens);
+        pv.addPhysVolID(_U(sensor),sensor_number++);
+        c_vol.setSensitiveDetector(sens);
       }
     }
     m_vol.setVisAttributes(lcdd.visAttributes(x_mod.visStr()));
@@ -83,29 +96,35 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens)  {
     Volume     m_env    = volumes[m_nam];
     string     lay_nam  = det_name+"_"+m_nam+_toString(x_layer.id(),"_layer%d");
 
-    // parameters from XML file
-    //double     rrmax2    = x_layout.rmax2();          // add an attribute
-    
     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 = (2*M_PI) / 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.
 
+	// 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
-    // these values might be changed by rmax2
     double c0;                                      
     if (x_layer.id() <=1 ) c0 = 3.5;
     else if (x_layer.id() == 2 ) c0 = 2.3;
     else if (x_layer.id() == 3 ) c0 = 2;
     else c0 = 1.8;
 
-    // create envelope        
+    // 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
@@ -121,93 +140,107 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens)  {
     SubtractionSolid lay_tub(lay_tub1,envTube2);
     Volume     lay_vol   (lay_nam,lay_tub,air);         // Create the layer envelope volume.
 
-    // ellipse circumference Ramanujan method
-    double     a     = c0 * rc;    // (mm) ellipse major radius
-    double     b     = rc;         // (mm) ellipse minor radius
-    double cir_ellip = M_PI * ( 3*(a+b) - std::sqrt((3*a+b)* (a+3*b)));
-
-    // circle circumference
-    double cir_circl = 2 * M_PI * rc;
-
-    int     nphi_ellip      = cir_ellip / mod_width / 2;   // number of modules for semi-ellipse in phi
-    double  phi_incr_ellip  = (M_PI) / nphi_ellip;         // Phi increment for one module along semi-ellipse
-    int     nphi_circl      = cir_circl / mod_width / 2;   // number of modules for semi-circle in phi
-    double  phi_incr_circl  = (M_PI) / nphi_circl;         // Phi increment for one module along semi-circle
-
-    std::cout << "nphi_ellip,phi_incr_ellip,nphi_circl,phi_incr_circl : "
-	      << nphi_ellip << " " << phi_incr_ellip << " "
-	      << nphi_circl << " " << phi_incr_circl << " " << mod_width << std::endl;
+    /*************************************************************
+     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.;
+    double dpt          = 0.;
+
+    // integrate over the elipse to get the circumference
+    for( int i=0; i < numIntegrals; i++ ) {
+        if (i==0) theta = thetaMin;
+        else theta += deltaTheta;
+        dpt = computeDpt( a, b, theta);
+        cell += dpt;
+    }
 
-    // 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;
+    // 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);
+    }
 
-    double dx, dy, x, y;
+    /*************************************************************
+     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.
-    nphi = nphi_ellip + nphi_circl;
+    
+    for (int ii = 0; ii < n_circ; ii++)    {
         
-    for (int ii = 0; ii < nphi; ii++)    {
-      dx = z_dr * std::cos(phic + phi_tilt);    // Delta x of module position.
-      dy = z_dr * std::sin(phic + phi_tilt);    // Delta y of module position.
-
-      // first half, semi-elliptical, from 90 to 270 degrees
-      // second half, semi-circle, from 270 to 90 degrees    
-      // Basic x module position.
-      if (ii < nphi_ellip) x = c0 * rc * std::cos(phic); 
-      else x = rc * std::cos(phic);
-            
-      y = rc * std::sin(phic);                  // Basic y module position.
-
-      std::cout << x << " " << y << std::endl;
+      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;
+      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;
       }
-
-      // first half, semi-elliptical, from 90 to 270 degrees
-      // second half, semi-circle, from 270 to 90 degrees    
-      // Increment the phi placement of module.
-      if (ii < nphi_ellip) {
-	// more increment in 150-210 degrees
-	//if ( phic > 5*M_PI/6 && phic < 7*M_PI/6)  phic += 3*phi_incr_ellip;
-	//else phic += phi_incr_ellip;                
-	phic += phi_incr_ellip;                
-      }
-      else phic += phi_incr_circl;
-            
-      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.
+      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(lcdd.invisible());
-    pv = assembly.placeVolume(lay_vol); // Place layer in mother
+    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(lcdd,lay_vol,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
     m_elt.setPlacement(pv);
   }
-    
+
   pv = lcdd.pickMotherVolume(sdet).placeVolume(assembly);
   pv.addPhysVolID("system", det_id);      // Set the subdetector system ID.
   pv.addPhysVolID("barrel", 0);           // Flag this as a barrel subdetector.
@@ -216,16 +249,3 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens)  {
 }
 
 DECLARE_DETELEMENT(LheD_tracker_SiVertexBarrel,create_detector)
-
-
-
-
-/*
-  21/2 + 58/2 = 39    // cylinderCircumference/2 + ellipseCircumference/2
-  40/2 + 109/2 = 74   // cylinderCircumference/2 + ellipseCircumference/2
-  91. * TMath::Pi() / 180.
-  90 *deg  = 1.57079632679489656e+00 *rad
-  270 *deg = 4.71238898038468967e+00 *rad
-*/
-
-