Skip to content

Commit

Permalink
change detectorType set initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel committed Jul 31, 2024
1 parent 4d97247 commit e3c72fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DDRec/include/DDRec/SurfaceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace dd4hep {
SurfaceMapsMap _map ;
const Detector& m_detector;
const std::set<std::string> m_detectorNames;
const std::set<std::string> m_detectorTypes;
std::set<std::string> m_detectorTypes;
std::map<std::string, std::set<std::string>> m_missingDetectors;
};

Expand Down
7 changes: 4 additions & 3 deletions DDRec/src/SurfaceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,6 +43,7 @@ namespace dd4hep {
std::set<std::string> 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<std::string> nameSet{};
for (const DetElement& det : theDetector.detectors(typeName)) {
nameSet.insert(det.name());
Expand Down

0 comments on commit e3c72fb

Please sign in to comment.