From e3c72fbf3be7bb0cbc7878f92a76b4e6e86174ed Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Wed, 31 Jul 2024 13:58:15 +0200 Subject: [PATCH] change detectorType set initialisation --- DDRec/include/DDRec/SurfaceManager.h | 2 +- DDRec/src/SurfaceManager.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DDRec/include/DDRec/SurfaceManager.h b/DDRec/include/DDRec/SurfaceManager.h index a4be5c4f4..9934e90d4 100644 --- a/DDRec/include/DDRec/SurfaceManager.h +++ b/DDRec/include/DDRec/SurfaceManager.h @@ -78,7 +78,7 @@ namespace dd4hep { SurfaceMapsMap _map ; const Detector& m_detector; const std::set m_detectorNames; - const std::set m_detectorTypes; + std::set m_detectorTypes; std::map> m_missingDetectors; }; diff --git a/DDRec/src/SurfaceManager.cpp b/DDRec/src/SurfaceManager.cpp index 4a7078778..0768a5c9c 100644 --- a/DDRec/src/SurfaceManager.cpp +++ b/DDRec/src/SurfaceManager.cpp @@ -27,10 +27,10 @@ namespace dd4hep { SurfaceManager::SurfaceManager(const Detector& theDetector) : - m_detector(theDetector), + m_detector(theDetector) // TODO: clean up after c++23 - m_detectorNames(std::views::keys(theDetector.detectors()).begin(), std::views::keys(theDetector.detectors()).end()), - m_detectorTypes(theDetector.detectorTypes().begin(), theDetector.detectorTypes().end()) + , m_detectorNames(std::views::keys(theDetector.detectors()).begin(), std::views::keys(theDetector.detectors()).end()) + // , m_detectorTypes(theDetector.detectorTypes().begin(), theDetector.detectorTypes().end()) { // have to make sure the volume manager is populated once in order to have @@ -43,6 +43,7 @@ namespace dd4hep { std::set worldSet{}; // collect all detector names that belong to a type e.g.: tracker, calorimeter, passive for (const std::string& typeName : theDetector.detectorTypes()) { + m_detectorTypes.insert(typeName); std::set nameSet{}; for (const DetElement& det : theDetector.detectors(typeName)) { nameSet.insert(det.name());