Skip to content
Snippets Groups Projects

Prototype of new alignment configuration

Merged Florian Reiss requested to merge pyconf into master
Compare and Show latest version
21 files
+ 1016
604
Compare changes
  • Side-by-side
  • Inline
Files
21
@@ -99,13 +99,15 @@ namespace LHCb::Alignment {
#endif
void applyToAllChildren( std::function<void( const LHCb::Alignment::DetectorElement& )> func ) const {
DELEGATEVOID(
std::for_each( de->childBegin(), de->childEnd(),
[&func]( const ::IDetectorElement* item ) {
func( LHCb::Alignment::DetectorElement{dynamic_cast<const ::DetectorElement*>( item )} );
} ),
de.applyToAllChildren(
[&func]( LHCb::Detector::DeIOV item ) { func( LHCb::Alignment::DetectorElement{item} ); } ) );
DELEGATEVOID( const auto& children = de->childIDetectorElements();
std::for_each( children.begin(), children.end(),
[&func]( const ::IDetectorElement* item ) {
std::invoke( func, LHCb::Alignment::DetectorElement{
dynamic_cast<const ::DetectorElement*>( item )} );
} ),
de.applyToAllChildren( [&func]( LHCb::Detector::DeIOV item ) {
std::invoke( func, LHCb::Alignment::DetectorElement{item} );
} ) );
}
LHCb::Alignment::DetectorElement getChild( const std::string& part ) {
@@ -116,12 +118,13 @@ namespace LHCb::Alignment {
} );
if ( det ) return LHCb::Detector::DeIOV( det );
#else
auto it = std::find_if( m_data->childBegin(), m_data->childEnd(), [&part]( const ::IDetectorElement* item ) {
const auto& children = m_data->childIDetectorElements();
auto it = std::find_if( children.begin(), children.end(), [&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 );
if ( it != children.end() ) return dynamic_cast<const ::DetectorElement*>( *it );
#endif
throw GaudiException( "WriteAlignmentConditions : unable to find requested element : no child named " + part +
" was found in " + name(),
Loading