diff --git a/DDCore/include/DD4hep/Detector.h b/DDCore/include/DD4hep/Detector.h index 46a4c0d957985a34148d3c685609818c67f22de9..76d8b802133c7ac39b27625155097d32eaa0863b 100644 --- a/DDCore/include/DD4hep/Detector.h +++ b/DDCore/include/DD4hep/Detector.h @@ -194,7 +194,7 @@ namespace dd4hep { is not present. Otherwise an empty detector container is returned. */ virtual const std::vector<DetElement>& detectors(const std::string& type, - bool throw_exc=false) = 0; + bool throw_exc=false) const = 0; /// Access a set of subdetectors according to several sensitive types. virtual std::vector<DetElement> detectors(const std::string& type1, diff --git a/DDCore/include/DD4hep/DetectorImp.h b/DDCore/include/DD4hep/DetectorImp.h index 175940116ba6868b12d74f5676ddf0796d577545..37dae4c5f480f3de0a585a3310bbf6393b0908bf 100644 --- a/DDCore/include/DD4hep/DetectorImp.h +++ b/DDCore/include/DD4hep/DetectorImp.h @@ -320,7 +320,7 @@ namespace dd4hep { - If throw_exc is set to true, an exception is thrown if the type is not present. Otherwise an empty detector container is returned. */ - virtual const std::vector<DetElement>& detectors(const std::string& type, bool throw_exc) override; + virtual const std::vector<DetElement>& detectors(const std::string& type, bool throw_exc) const override; /// Access a set of subdetectors according to several sensitive types. virtual std::vector<DetElement> detectors(const std::string& type1, diff --git a/DDCore/src/DetectorImp.cpp b/DDCore/src/DetectorImp.cpp index 9ab77d86d4d862c398945f0667fa19fd1186e8af..7e5eeb4d3cdecfe2814a57d1153011d7e5afae73 100644 --- a/DDCore/src/DetectorImp.cpp +++ b/DDCore/src/DetectorImp.cpp @@ -572,7 +572,7 @@ vector<string> DetectorImp::detectorTypes() const { } /// Access a set of subdetectors according to the sensitive type. -const vector<DetElement>& DetectorImp::detectors(const string& type, bool throw_exc) { +const vector<DetElement>& DetectorImp::detectors(const string& type, bool throw_exc) const { if ( m_manager->IsClosed() ) { DetectorTypeMap::const_iterator i=m_detectorTypes.find(type); if ( i != m_detectorTypes.end() ) return (*i).second;