diff --git a/DDCore/src/LCDDImp.cpp b/DDCore/src/LCDDImp.cpp index 7a0382e40be782bbcff9973d199dc92dcf9b3353..9e0015c9dcfb4055e89842428bfa9d0fdc3d1a66 100644 --- a/DDCore/src/LCDDImp.cpp +++ b/DDCore/src/LCDDImp.cpp @@ -279,9 +279,12 @@ vector<string> LCDDImp::detectorTypes() const { /// Access a set of subdetectors according to the sensitive type. const vector<DetElement>& LCDDImp::detectors(const string& type) { if ( m_manager->IsClosed() ) { - DetectorTypeMap::const_iterator i=m_detectorTypes.find(type); - if ( i != m_detectorTypes.end() ) return (*i).second; - throw runtime_error("detectors("+type+"): Detectors of this type do not exist in the current setup!"); + // DetectorTypeMap::const_iterator i=m_detectorTypes.find(type); + // if ( i != m_detectorTypes.end() ) return (*i).second; + // throw runtime_error("detectors("+type+"): Detectors of this type do not exist in the current setup!"); + + // return empty vector instead of exception + return m_detectorTypes[ type ] ; } throw runtime_error("detectors("+type+"): Detectors can only selected by type once the geometry is closed!"); }