Skip to content

Commit

Permalink
feat: make Detector::detectors(type, throw_exc) const
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc authored and andresailer committed Oct 19, 2023
1 parent 2d4845f commit 80f6593
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DDCore/include/DD4hep/Detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion DDCore/include/DD4hep/DetectorImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion DDCore/src/DetectorImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 80f6593

Please sign in to comment.