From f137df8857bb2db3be08e9b8ede20d6fc5564752 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Tue, 6 Jun 2017 13:15:33 +0200
Subject: [PATCH] First attempt to fix DDDB after the re-organization.

---
 DDCore/include/DD4hep/Dictionary.h |  2 ++
 DDCore/src/AlignmentsProcessor.cpp | 47 +++++++++++++++++++-----------
 DDCore/src/ConditionsProcessor.cpp | 30 ++++++++++++-------
 DDG4/python/DD4hep.py              |  8 +++--
 4 files changed, 58 insertions(+), 29 deletions(-)

diff --git a/DDCore/include/DD4hep/Dictionary.h b/DDCore/include/DD4hep/Dictionary.h
index 0e2f89ec9..4f3f08110 100644
--- a/DDCore/include/DD4hep/Dictionary.h
+++ b/DDCore/include/DD4hep/Dictionary.h
@@ -222,6 +222,8 @@ template class DD4hep::Handle<TNamed>;
 
 #pragma link C++ class DD4hep::Conditions::Condition+;
 #pragma link C++ class vector<DD4hep::Conditions::Condition>+;
+#pragma link C++ class DD4hep::Conditions::ConditionKey+;
+#pragma link C++ class vector<DD4hep::Conditions::ConditionKey>+;
 #pragma link C++ class DD4hep::Conditions::Interna::ConditionObject+;
 #pragma link C++ class DD4hep::Handle<DD4hep::Conditions::Interna::ConditionObject>+;
 
diff --git a/DDCore/src/AlignmentsProcessor.cpp b/DDCore/src/AlignmentsProcessor.cpp
index aabf94ff7..51b80f8b5 100644
--- a/DDCore/src/AlignmentsProcessor.cpp
+++ b/DDCore/src/AlignmentsProcessor.cpp
@@ -39,15 +39,6 @@ template <typename T> int DeltaCollector<T>::operator()(DetElement de, int level
   except("Alignments","Cannot process alignments of an invalid detector element");
   return 0;  
 }
-template class DeltaCollector<list<Delta> >;
-template class DeltaCollector<vector<Delta> >;
-template class DeltaCollector<map<DetElement,Delta> >;
-template class DeltaCollector<vector<pair<DetElement,Delta> > >;
-template class DeltaCollector<vector<pair<string,Delta> > >;
-
-template class DeltaCollector<multimap<DetElement,Delta> >;
-template class DeltaCollector<map<string,Delta> >;
-template class DeltaCollector<multimap<string,Delta> >;
 
 /// Callback to output alignments information
 template <typename T>
@@ -68,12 +59,34 @@ int AlignmentsCollector<T>::operator()(DetElement de, int level)  const  {
   except("Alignments","Cannot process alignments of an invalid detector element");
   return 0;  
 }
-template class AlignmentsCollector<list<Alignment> >;
-template class AlignmentsCollector<vector<Alignment> >;
-template class AlignmentsCollector<map<DetElement,Alignment> >;
-template class AlignmentsCollector<vector<pair<DetElement,Alignment> > >;
-template class AlignmentsCollector<vector<pair<string,Alignment> > >;
 
-template class AlignmentsCollector<multimap<DetElement,Alignment> >;
-template class AlignmentsCollector<map<string,Alignment> >;
-template class AlignmentsCollector<multimap<string,Alignment> >;
+
+/// Namespace for the AIDA detector description toolkit
+namespace DD4hep {
+
+  /// Namespace for the AIDA detector description toolkit supporting XML utilities
+  namespace Alignments {
+
+    template class DeltaCollector<list<Delta> >;
+    template class DeltaCollector<vector<Delta> >;
+    template class DeltaCollector<map<DetElement,Delta> >;
+    template class DeltaCollector<vector<pair<DetElement,Delta> > >;
+    template class DeltaCollector<vector<pair<string,Delta> > >;
+
+    template class DeltaCollector<multimap<DetElement,Delta> >;
+    template class DeltaCollector<map<string,Delta> >;
+    template class DeltaCollector<multimap<string,Delta> >;
+
+
+    template class AlignmentsCollector<list<Alignment> >;
+    template class AlignmentsCollector<vector<Alignment> >;
+    template class AlignmentsCollector<map<DetElement,Alignment> >;
+    template class AlignmentsCollector<vector<pair<DetElement,Alignment> > >;
+    template class AlignmentsCollector<vector<pair<string,Alignment> > >;
+
+    template class AlignmentsCollector<multimap<DetElement,Alignment> >;
+    template class AlignmentsCollector<map<string,Alignment> >;
+    template class AlignmentsCollector<multimap<string,Alignment> >;
+
+  }    /* End namespace Alignments  */
+}      /* End namespace DD4hep      */
diff --git a/DDCore/src/ConditionsProcessor.cpp b/DDCore/src/ConditionsProcessor.cpp
index 13db4cd06..6f0df7703 100644
--- a/DDCore/src/ConditionsProcessor.cpp
+++ b/DDCore/src/ConditionsProcessor.cpp
@@ -38,13 +38,23 @@ int ConditionsCollector<T>::operator()(DetElement de, int)  const  {
   except("Conditions","Cannot process conditions of an invalid detector element");
   return 0;  
 }
-//template class ConditionsCollector<ConditionsMap>;
-template class ConditionsCollector<list<Condition> >;
-template class ConditionsCollector<vector<Condition> >;
-template class ConditionsCollector<map<DetElement,Condition> >;
-template class ConditionsCollector<vector<pair<DetElement,Condition> > >;
-template class ConditionsCollector<vector<pair<string,Condition> > >;
-
-template class ConditionsCollector<multimap<DetElement,Condition> >;
-template class ConditionsCollector<map<string,Condition> >;
-template class ConditionsCollector<multimap<string,Condition> >;
+
+
+/// Namespace for the AIDA detector description toolkit
+namespace DD4hep {
+
+  /// Namespace for the conditions part of the AIDA detector description toolkit
+  namespace Conditions   {
+
+    //template class ConditionsCollector<ConditionsMap>;
+    template class ConditionsCollector<list<Condition> >;
+    template class ConditionsCollector<vector<Condition> >;
+    template class ConditionsCollector<map<DetElement,Condition> >;
+    template class ConditionsCollector<vector<pair<DetElement,Condition> > >;
+    template class ConditionsCollector<vector<pair<string,Condition> > >;
+
+    template class ConditionsCollector<multimap<DetElement,Condition> >;
+    template class ConditionsCollector<map<string,Condition> >;
+    template class ConditionsCollector<multimap<string,Condition> >;
+  }       /* End namespace Conditions               */
+}         /* End namespace DD4hep                   */
diff --git a/DDG4/python/DD4hep.py b/DDG4/python/DD4hep.py
index 03cfeb764..8c6941a58 100644
--- a/DDG4/python/DD4hep.py
+++ b/DDG4/python/DD4hep.py
@@ -138,10 +138,14 @@ def import_geometry():
 
   #// Readout.h
   import_namespace_item('Geo','Readout')
+
+  #// Alignments.h
   import_namespace_item('Alignments','Alignment')
-  import_namespace_item('Alignments','Container')
+  import_namespace_item('Alignments','AlignmentCondition')
+
+  #// Conditions.h
   import_namespace_item('Conditions','Condition')
-  import_namespace_item('Conditions','Container')
+  import_namespace_item('Conditions','ConditionKey')
 
   #// DetElement.h
   import_namespace_item('Geo','World')
-- 
GitLab