Skip to content
Snippets Groups Projects
Commit 68549368 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

Don't throw exception if source ID is missing in LHCb Tel40 Link condition

parent 21f4e297
No related branches found
No related tags found
1 merge request!4014Use tel40 link condition from DeLHCb detector object with RichTel40CableMapping
......@@ -26,6 +26,10 @@
if ( messenger() ) { ri_debug( __VA_ARGS__ ); }
#define verbo( ... ) \
if ( messenger() ) { ri_verbo( __VA_ARGS__ ); }
#define warning( ... ) \
if ( messenger() ) { ri_warning( __VA_ARGS__ ); }
#define info( ... ) \
if ( messenger() ) { ri_info( __VA_ARGS__ ); }
// boost
#include "boost/container/static_vector.hpp"
......@@ -156,21 +160,23 @@ void Tel40CableMapping::fillCableMaps( const LHCb::Detector::DeLHCb&
LHCb::RichSmartID smartID( rich, panel, LHCb::RichSmartID::MaPMTID );
smartID.setLargePMT( isLargePMT );
// Is link active. Start with value in RICH condition.
bool linkIsActive = ( 0 != status );
#ifdef USE_DD4HEP
// Use link status flag from general LHCb condition instead of from RICH condition.
const auto linksActive = lhcb.tell40link( sourceID.data() );
if ( !linksActive.has_value() ) {
throw Rich::Exception( "Source ID '" + std::to_string( sourceID.data() ) +
"' is missing in LHCb Tel40 Link condition data" );
warning( "Source ID '", sourceID.data(), "' is missing in LHCb Tel40 Link condition", endmsg );
} else {
// LHCb general condition has this source ID so use its value instead.
linkIsActive = linksActive.value().isEnabled( link.data() );
// temporary sanity check
assert( status == linkIsActive );
}
const bool linkIsActive = linksActive.value().isEnabled( link.data() );
// temporary sanity check
assert( status == linkIsActive );
#else
// with DetDesc just use RICH value
// Eventually once DetDesc is dropped the use of the RICH status code can be dropped
// entirely both here and from the condition itself in dd4hep.
const bool linkIsActive = ( 0 != status );
#endif
// link data struct
......
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