Skip to content
Snippets Groups Projects
Commit 6f45e633 authored by Frank Gaede's avatar Frank Gaede
Browse files

return empty vector instead of exception in LCDDImp::detectors(const string&...

 return empty vector instead of exception in LCDDImp::detectors(const string& type) if nothing found for type
parent a963a4ab
No related branches found
No related tags found
No related merge requests found
......@@ -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!");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment