Skip to content
Snippets Groups Projects

Fix DD4hep compilation

Merged Sebastien Ponce requested to merge sponce_fixDD4hep into master
3 files
+ 50
41
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -107,6 +107,27 @@ namespace LHCb::Alignment {
de.applyToAllChildren(
[&func]( LHCb::Detector::DeIOV item ) { func( LHCb::Alignment::DetectorElement{item} ); } ) );
}
LHCb::Alignment::DetectorElement getChild( const std::string& part ) {
#ifdef USE_DD4HEP
LHCb::Detector::detail::DeIOVObject* det{nullptr};
m_data.applyToAllChildren( [&det, &part]( LHCb::Detector::DeIOV item ) {
if ( item.name() == part ) det = item.access();
} );
if ( det ) return LHCb::Detector::DeIOV( det );
#else
auto it = std::find_if( m_data->childBegin(), m_data->childEnd(), [&part]( const ::IDetectorElement* item ) {
auto& name = item->name();
return name.length() > part.length() && name.substr( name.length() - part.length() ) == part &&
name[name.length() - part.length() - 1] == '/';
} );
if ( it != m_data->childEnd() ) return dynamic_cast<const ::DetectorElement*>( *it );
#endif
throw GaudiException( "WriteAlignmentConditions : unable to find requested element : no child named " + part +
" was found in " + name(),
"GetElementsToBeAligned:", StatusCode::FAILURE );
}
auto size() const { DELEGATE2( de->childIDetectorElements().size(), de.size() ); }
bool operator==( const DetectorElement& other ) const { return m_data == other.m_data; }
Loading