From 2ef12a65570df9fec63f3d6c3bb08c24754714e6 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Fri, 16 Mar 2018 20:24:50 +0100
Subject: [PATCH] Add study for new Velo-Pixel Detector element conditions.
 Include fixes from Chris Burr for alignment computations

---
 DDCore/src/AlignmentData.cpp            | 4 +++-
 DDDB/include/Detector/DetectorElement.h | 4 ++--
 examples/DDDB/CMakeLists.txt            | 8 ++++----
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/DDCore/src/AlignmentData.cpp b/DDCore/src/AlignmentData.cpp
index 6ab67070c..25944ca67 100644
--- a/DDCore/src/AlignmentData.cpp
+++ b/DDCore/src/AlignmentData.cpp
@@ -232,8 +232,10 @@ Alignment AlignmentData::nominal() const   {
 // The map is used by the Alignments calculator
 typedef std::map<DetElement, Delta> DeltaMap;
 
+// Have only a weak reference here!
+inline ostream& operator << (ostream& s, const DetElement& )   { return s; }
+
 #include "Parsers/Parsers.h"
-DD4HEP_DEFINE_OSTREAM_DUMMY(DetElement)
 DD4HEP_DEFINE_PARSER_DUMMY(Delta)
 DD4HEP_DEFINE_PARSER_DUMMY(DeltaMap)
 DD4HEP_DEFINE_PARSER_DUMMY(AlignmentData)
diff --git a/DDDB/include/Detector/DetectorElement.h b/DDDB/include/Detector/DetectorElement.h
index e27e729e4..7af8f4934 100644
--- a/DDDB/include/Detector/DetectorElement.h
+++ b/DDDB/include/Detector/DetectorElement.h
@@ -212,10 +212,10 @@ namespace gaudi    {
     {  return static_data().parameters;                                         }
     /// Access single parameter
     const Parameter& param(const std::string& nam, bool throw_if_not_present=true)   const
-    {   return static_data().parameters.param(nam, throw_if_not_present);       }
+    {   return params().param(nam, throw_if_not_present);                       }
     /// Type dependent accessor to a named parameter
     template <typename T> T param(const std::string& nam, bool throw_if_not_present=true)   const
-    {   return static_data().parameters.param<T>(nam, throw_if_not_present);    }
+    {   return params().param<T>(nam, throw_if_not_present);                    }
     /// Access the parent detector element
     DetElement parent()  const
     {   return static_data().detector.parent();                                 }
diff --git a/examples/DDDB/CMakeLists.txt b/examples/DDDB/CMakeLists.txt
index a805bcb8c..c84ec0141 100644
--- a/examples/DDDB/CMakeLists.txt
+++ b/examples/DDDB/CMakeLists.txt
@@ -71,7 +71,7 @@ if (DD4HEP_USE_XERCESC)
     -config    DD4hep_ConditionsManagerInstaller
     -exec      DDDB_ConditionsSummary
     DEPENDS    DDDB_extract_LONGTEST
-    REGEX_PASS "\\+ DDDB Total Number of parameters:    13650  " 
+    REGEX_PASS "\\+ DDDB Total Number of parameters:    13642  " 
     REGEX_FAIL "EXCEPTION;Exception"
   )
   #
@@ -137,7 +137,7 @@ if (DD4HEP_USE_XERCESC)
     -config    DD4hep_ConditionsManagerInstaller
     -plugin    DDDB_DetElementConditionDump -print DEBUG
     DEPENDS    DDDB_extract_LONGTEST
-    REGEX_PASS "\\+ DDDB: Total number of DetElement parameters:    13144"
+    REGEX_PASS "\\+ DDDB: Total number of DetElement parameters:    13136"
   )
   #
   #---Testing: Load the geometry + conditions + conditions derives
@@ -147,7 +147,7 @@ if (DD4HEP_USE_XERCESC)
     -config    DD4hep_ConditionsManagerInstaller
     -plugin    DDDB_DerivedCondTest -print DEBUG
     DEPENDS    DDDB_extract_LONGTEST
-    REGEX_PASS "\\+ DDDB: Total Number of callbacks:    16215"
+    REGEX_PASS "\\+ DDDB: Total Number of callbacks:    16221"
     REGEX_FAIL "EXCEPTION;Exception"
   )
   #
@@ -169,7 +169,7 @@ if (DD4HEP_USE_XERCESC)
     -config    DD4hep_ConditionsManagerInstaller
     -plugin    DDDB_AlignmentsAccessTest -print DEBUG
     DEPENDS    DDDB_extract_LONGTEST
-    REGEX_PASS "\\+ DDDB: Accessed 5405 alignments from 5405 DetElement objects" 
+    REGEX_PASS "\\+ DDDB: Accessed 5407 alignments from 5407 DetElement objects" 
     REGEX_FAIL "EXCEPTION;Exception"
   )
   #
-- 
GitLab