diff --git a/Calo/CaloDAQ/src/CaloAdcFromRaw.cpp b/Calo/CaloDAQ/src/CaloAdcFromRaw.cpp index e77a1330e46638a140ef58d32e71837f5cecc571..24181864da213cd067f8b4420cb7c88ac77add6c 100644 --- a/Calo/CaloDAQ/src/CaloAdcFromRaw.cpp +++ b/Calo/CaloDAQ/src/CaloAdcFromRaw.cpp @@ -65,7 +65,7 @@ StatusCode CaloAdcFromRaw::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; // get detector elements if ( m_caloName.empty() ) return Error( "Unknown calo detector name ", StatusCode::FAILURE ); @@ -81,7 +81,7 @@ StatusCode CaloAdcFromRaw::initialize() { //============================================================================= StatusCode CaloAdcFromRaw::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; // ADCs (ecal/hcal/prs) if ( !m_location.empty() && m_data->getBanks() ) { @@ -89,7 +89,7 @@ StatusCode CaloAdcFromRaw::execute() { put( outs, m_location ); const CaloVector<LHCb::CaloAdc>& adcs = m_data->adcs(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " #ADCS " << adcs.size() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " #ADCS " << adcs.size() << endmsg; for ( LHCb::CaloAdc adc : adcs ) { LHCb::CaloCellID id = adc.cellID(); int value = adc.adc(); @@ -102,7 +102,7 @@ StatusCode CaloAdcFromRaw::execute() { value = std::clamp( value, -m_offset, static_cast<int>( m_calo->adcMax() ) - m_offset ); try { auto out = std::make_unique<LHCb::CaloAdc>( id, value ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Inserting : " << id << " adc = " << value << " = " << adc.adc() << " / " << calib << " (dead channel ? " << m_calo->isDead( id ) << ")" << endmsg; outs->insert( out.get() ); diff --git a/Calo/CaloDAQ/src/CaloDataProvider.cpp b/Calo/CaloDAQ/src/CaloDataProvider.cpp index 7459715dcef3aa6659bd5e1c35afb644b56e3c8d..dd2cfc8c171670372c4efb6046cf6385eccf361d 100644 --- a/Calo/CaloDAQ/src/CaloDataProvider.cpp +++ b/Calo/CaloDAQ/src/CaloDataProvider.cpp @@ -37,7 +37,7 @@ DECLARE_COMPONENT( CaloDataProvider ) StatusCode CaloDataProvider::initialize() { StatusCode sc = base_class::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize " << name() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize " << name() << endmsg; switch ( m_detectorName ) { case details::DetectorName_t::Ecal: @@ -74,7 +74,7 @@ StatusCode CaloDataProvider::initialize() { m_adcs.reserve( nCells + nPins ); m_digits.reserve( nCells ); clear(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " Initialisation OK" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " Initialisation OK" << endmsg; return StatusCode::SUCCESS; } diff --git a/Calo/CaloDAQ/src/CaloDataProviderFromTES.cpp b/Calo/CaloDAQ/src/CaloDataProviderFromTES.cpp index a1e0c3d6da0e4609e8a7a7fb526914d87e790efe..0a2d380a3e0f0f7963b6b6aedb385b040bac0cc7 100644 --- a/Calo/CaloDAQ/src/CaloDataProviderFromTES.cpp +++ b/Calo/CaloDAQ/src/CaloDataProviderFromTES.cpp @@ -60,7 +60,7 @@ StatusCode CaloDataProviderFromTES::finalize() { StatusCode CaloDataProviderFromTES::initialize() { StatusCode sc = base_class::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize " << name() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize " << name() << endmsg; // fill incident listener IIncidentSvc* inc = incSvc(); @@ -101,7 +101,7 @@ StatusCode CaloDataProviderFromTES::initialize() { // - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " Initialisation OK" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " Initialisation OK" << endmsg; return StatusCode::SUCCESS; } diff --git a/Calo/CaloDAQ/src/CaloDigitsFromRaw.cpp b/Calo/CaloDAQ/src/CaloDigitsFromRaw.cpp index 4bf3353d517df1c6a600b3cabea4c4e0bf7f9561..09af5f5a09477b0af8e008582c1405f1649e2e60 100644 --- a/Calo/CaloDAQ/src/CaloDigitsFromRaw.cpp +++ b/Calo/CaloDAQ/src/CaloDigitsFromRaw.cpp @@ -62,7 +62,7 @@ CaloDigitsFromRaw::CaloDigitsFromRaw( const std::string& name, ISvcLocator* pSvc StatusCode CaloDigitsFromRaw::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize " << name() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize " << name() << endmsg; // get DeCalorimeter switch ( m_detectorNum ) { case 2: @@ -95,7 +95,7 @@ StatusCode CaloDigitsFromRaw::initialize() { //============================================================================= StatusCode CaloDigitsFromRaw::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; convertCaloEnergies(); return StatusCode::SUCCESS; @@ -125,10 +125,10 @@ void CaloDigitsFromRaw::convertCaloEnergies() { status.addStatus( tell1, LHCb::RawBankReadoutStatus::Status::DuplicateEntry ); } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "ID " << itD.cellID() << " energy " << itD.e() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "ID " << itD.cellID() << " energy " << itD.e() << endmsg; } std::stable_sort( digits->begin(), digits->end(), IncreasingByCellID ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << m_outputDigits.value() + m_extension.value() << " CaloDigit container size " << digits->size() << endmsg; if ( m_statusOnTES.value() ) m_energyTool->putStatusOnTES(); @@ -155,10 +155,9 @@ void CaloDigitsFromRaw::convertCaloEnergies() { LHCb::RawBankReadoutStatus& status = m_energyTool->status(); status.addStatus( tell1, LHCb::RawBankReadoutStatus::Status::DuplicateEntry ); } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) - verbose() << "ID " << itA.cellID() << " ADC value " << itA.adc() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "ID " << itA.cellID() << " ADC value " << itA.adc() << endmsg; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " CaloAdc container '" << m_outputADCs.value() + m_extension.value() << "' -> size = " << adcs->size() << endmsg; @@ -190,10 +189,10 @@ void CaloDigitsFromRaw::convertCaloEnergies() { status.addStatus( tell1, LHCb::RawBankReadoutStatus::Status::DuplicateEntry ); } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Pin-diode : ID " << itA.cellID() << " ADC value " << itA.adc() << endmsg; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " Adding PIN-Diode CaloAdc to container '" << m_pinContainerName.value() + m_extension.value() << "' -> size = " << pinAdcs->size() << endmsg; } diff --git a/Calo/CaloDAQ/src/CaloEnergyFromRaw.cpp b/Calo/CaloDAQ/src/CaloEnergyFromRaw.cpp index 6a2730530c6b5a595649533cd85464b6fb33aaad..d083e8f3035199d1a0696c707c04bd7fa77e9fdb 100644 --- a/Calo/CaloDAQ/src/CaloEnergyFromRaw.cpp +++ b/Calo/CaloDAQ/src/CaloEnergyFromRaw.cpp @@ -44,8 +44,7 @@ CaloEnergyFromRaw::CaloEnergyFromRaw( const std::string& type, const std::string StatusCode CaloEnergyFromRaw::initialize() { StatusCode sc = base_class::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << "==> Initialize " << name() << " Det = " << m_detectorName << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize " << name() << " Det = " << m_detectorName << endmsg; switch ( m_detectorName.value() ) { case details::DetectorName_t::Ecal: @@ -76,7 +75,7 @@ StatusCode CaloEnergyFromRaw::initialize() { m_pinData.reserve( nPins ); m_data.reserve( nCells ); m_digits.reserve( nCells ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Got detector element for " << m_detectorName << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Got detector element for " << m_detectorName << endmsg; return StatusCode::SUCCESS; } @@ -133,7 +132,7 @@ const std::vector<LHCb::CaloAdc>& CaloEnergyFromRaw::adcs( int source ) { bool found = false; if ( m_getRaw ) getBanks(); if ( m_banks.empty() ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "The banks container is empty" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "The banks container is empty" << endmsg; } else { for ( const auto& bank : m_banks ) { sourceID = bank->sourceID(); @@ -145,14 +144,14 @@ const std::vector<LHCb::CaloAdc>& CaloEnergyFromRaw::adcs( int source ) { decoded = getData( *bank ); if ( !decoded ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Error when decoding bank " << Gaudi::Utils::toString( sourceID ) << " -> incomplete data - May be corrupted" << endmsg; } } } if ( !found ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "rawBank sourceID : " << Gaudi::Utils::toString( source ) << " has not been found" << endmsg; } @@ -205,7 +204,7 @@ bool CaloEnergyFromRaw::getData( const LHCb::RawBank& bank ) { int version = bank.version(); int sourceID = bank.sourceID(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Decode bank " << &bank << " source " << sourceID << " version " << version << " size " << size << endmsg; @@ -260,7 +259,7 @@ bool CaloEnergyFromRaw::getData( const LHCb::RawBank& bank ) { // Get the FE-Cards associated to that bank (via condDB) auto feCards = m_calo->tell1ToCards( sourceID ); int nCards = feCards.size(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << nCards << " FE-Cards are expected to be readout : " << feCards << " in Tell1 bank " << sourceID << endmsg; int prevCard = -1; @@ -361,7 +360,7 @@ bool CaloEnergyFromRaw::getData( const LHCb::RawBank& bank ) { // Get the FE-Cards associated to that bank (via condDB) auto feCards = m_calo->tell1ToCards( sourceID ); int nCards = feCards.size(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << nCards << " FE-Cards are expected to be readout : " << feCards << " in Tell1 bank " << sourceID << endmsg; int prevCard = -1; diff --git a/Calo/CaloDAQ/src/CaloFillRawBuffer.cpp b/Calo/CaloDAQ/src/CaloFillRawBuffer.cpp index 287d3dcd78b66c8fa2b087159559db5a60efdd6e..36c93268fb25c50ec9528dc16551cd5f2557ef1d 100644 --- a/Calo/CaloDAQ/src/CaloFillRawBuffer.cpp +++ b/Calo/CaloDAQ/src/CaloFillRawBuffer.cpp @@ -55,7 +55,7 @@ StatusCode CaloFillRawBuffer::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; if ( "None" == m_detectorName ) { return Error( "Invalid algorithm name" + name(), StatusCode::FAILURE ); } @@ -98,7 +98,7 @@ StatusCode CaloFillRawBuffer::initialize() { //============================================================================= StatusCode CaloFillRawBuffer::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; for ( int kk = 0; m_numberOfBanks > kk; kk++ ) { m_banks[kk].clear(); } @@ -122,13 +122,13 @@ StatusCode CaloFillRawBuffer::execute() { m_totDataSize += totDataSize; m_nbEvents++; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Bank sizes: "; for ( unsigned int kk = 0; m_banks.size() > kk; kk++ ) { debug() << format( "%2d:%4d ", kk, m_banks[kk].size() ); } debug() << endmsg << "Total Data bank size " << totDataSize << endmsg; } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { for ( unsigned int kk = 0; m_banks.size() > kk; kk++ ) { verbose() << "DATA bank : " << kk << endmsg; int kl = 0; @@ -253,7 +253,7 @@ void CaloFillRawBuffer::fillPackedBank() { m_banks[kTell1][sizeIndex] |= ( sizeAdc << 7 ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << format( "Tell1 %2d card %3d pattern %8x patTrig %8x size Adc %2d", kTell1, cardNum, pattern, patTrig, sizeAdc ) << endmsg; diff --git a/Calo/CaloDAQ/src/CaloReadoutTool.cpp b/Calo/CaloDAQ/src/CaloReadoutTool.cpp index be3859e201794dba8a4c507d17c3a20c55674812..3741340b345c52b5620ce62210aae99c19db74a6 100644 --- a/Calo/CaloDAQ/src/CaloReadoutTool.cpp +++ b/Calo/CaloDAQ/src/CaloReadoutTool.cpp @@ -41,7 +41,7 @@ StatusCode CaloReadoutTool::initialize() { StatusCode sc = base_class::initialize(); if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize " << name() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize " << name() << endmsg; IIncidentSvc* inc = incSvc(); if ( inc ) inc->addListener( this, IncidentType::BeginEvent ); return sc; diff --git a/Calo/CaloDAQ/src/CaloReadoutTool.h b/Calo/CaloDAQ/src/CaloReadoutTool.h index 1780308c584e2ab6fd19f782f2506fe478c32200..214deb4d64b3d481bfc8eca328ffab8262fbd7c1 100644 --- a/Calo/CaloDAQ/src/CaloReadoutTool.h +++ b/Calo/CaloDAQ/src/CaloReadoutTool.h @@ -70,7 +70,7 @@ public: // ========================================================================= /// Inform that a new incident has occurred void handle( const Incident& /* inc */ ) override { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "IIncident Svc reset" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "IIncident Svc reset" << endmsg; m_getRaw = true; m_status.reset(); } diff --git a/Calo/CaloDAQ/src/CaloZSupAlg.cpp b/Calo/CaloDAQ/src/CaloZSupAlg.cpp index 412b46e822a86e19921b0cdcca4f35e6e2036b72..7d0117f8c61a8ae33e2740a25a9ab690b88115fc 100644 --- a/Calo/CaloDAQ/src/CaloZSupAlg.cpp +++ b/Calo/CaloDAQ/src/CaloZSupAlg.cpp @@ -81,7 +81,7 @@ StatusCode CaloZSupAlg::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); if ( sc.isFailure() ) return sc; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { if ( m_outputType.value().digitOnTES ) debug() << "CaloZSupAlg will produce CaloDigits on TES" << rootInTES() + m_outputDigitData + m_extension << endmsg; diff --git a/Calo/CaloDAQ/src/CheckCaloBank.cpp b/Calo/CaloDAQ/src/CheckCaloBank.cpp index 042c47610d24c654d3f66eb8e8160b5096a57ee9..dceaa4b8f89c654c903e9038c486353a25d3e45f 100644 --- a/Calo/CaloDAQ/src/CheckCaloBank.cpp +++ b/Calo/CaloDAQ/src/CheckCaloBank.cpp @@ -102,7 +102,7 @@ StatusCode CheckCaloBank::execute() { bool trig = ( 0 == ( rawEvt->banks( m_trig ) ).size() ) ? false : true; bool bank = ( 0 == ( rawEvt->banks( m_bank ) ).size() ) ? false : true; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "TYPE of Calo Bank to be checked : " << m_typ << " " << trig << " " << bank << endmsg; if ( trig || bank ) { debug() << " Calo Banks with 'compressed' format exist - Do nothing" << endmsg; diff --git a/Calo/CaloDAQ/src/CompareCaloDigits.cpp b/Calo/CaloDAQ/src/CompareCaloDigits.cpp index 00008671c11c8ac0fef4f4db41ca7528463143da..d9e480632e2d36bcc1d33d4b1334107f734048ef 100644 --- a/Calo/CaloDAQ/src/CompareCaloDigits.cpp +++ b/Calo/CaloDAQ/src/CompareCaloDigits.cpp @@ -42,7 +42,7 @@ CompareCaloDigits::CompareCaloDigits( const std::string& name, ISvcLocator* pSvc //============================================================================= StatusCode CompareCaloDigits::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; std::string ecalName = LHCb::CaloDigitLocation::Ecal; std::string hcalName = LHCb::CaloDigitLocation::Hcal; @@ -83,7 +83,7 @@ void CompareCaloDigits::compareContainers( const LHCb::CaloDigits& dig1, const L error() << "Incoherent size : " << dig1.registry()->identifier() << " : " << dig1.size() << " and " << dig2.registry()->identifier() << " : " << dig2.size() << endmsg; } else { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Comparing " << dig1.name() << " and " << dig2.name() << " both sizes = " << dig2.size() << endmsg; } @@ -96,7 +96,7 @@ void CompareCaloDigits::compareContainers( const LHCb::CaloDigits& dig1, const L ( *it1 )->e() / Gaudi::Units::MeV - ( *it2 )->e() / Gaudi::Units::MeV ) << endmsg; } else { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << ( *it1 )->cellID() << " " << ( *it2 )->cellID() << " E " << ( *it1 )->e() / Gaudi::Units::MeV << " " << ( *it2 )->e() / Gaudi::Units::MeV << endmsg; } diff --git a/CaloFuture/CaloFutureDAQ/src/CaloFutureFillRawBuffer.cpp b/CaloFuture/CaloFutureDAQ/src/CaloFutureFillRawBuffer.cpp index 6010349a7a2ea9868ae4dbcbd0fbe658d2166cf2..7a6b917b2629d801bfc30ba8f0c2fef29e67906c 100644 --- a/CaloFuture/CaloFutureDAQ/src/CaloFutureFillRawBuffer.cpp +++ b/CaloFuture/CaloFutureDAQ/src/CaloFutureFillRawBuffer.cpp @@ -99,7 +99,7 @@ StatusCode CaloFutureFillRawBuffer::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; if ( "None" == m_detectorName ) { return Error( "Invalid algorithm name" + name(), StatusCode::FAILURE ); } @@ -140,7 +140,7 @@ StatusCode CaloFutureFillRawBuffer::initialize() { //============================================================================= StatusCode CaloFutureFillRawBuffer::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; for ( int kk = 0; m_numberOfBanks > kk; kk++ ) { m_banks[kk].clear(); @@ -185,7 +185,7 @@ StatusCode CaloFutureFillRawBuffer::execute() { m_totTrigSize += totTrigSize; m_nbEvents++; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Bank sizes: "; for ( unsigned int kk = 0; m_banks.size() > kk; kk++ ) { debug() << format( "%2d:%4d+%4d ", kk, m_banks[kk].size(), m_trigBanks[kk].size() ); @@ -193,7 +193,7 @@ StatusCode CaloFutureFillRawBuffer::execute() { debug() << endmsg << "Total Data bank size " << totDataSize << " + trigger " << totTrigSize << endmsg; } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { for ( unsigned int kk = 0; m_banks.size() > kk; kk++ ) { verbose() << "DATA bank : " << kk << endmsg; int kl = 0; @@ -307,7 +307,7 @@ void CaloFutureFillRawBuffer::fillPackedBank() { m_banks[kTell1][sizeIndex] |= ( sizeAdc << 7 ) + sizeTrig; m_totTrigSize += sizeTrig; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << format( "Tell1 %2d card %3d pattern %8x patTrig %8x size Adc %2d Trig %2d", kTell1, cardNum, pattern, patTrig, sizeAdc, sizeTrig ) << endmsg; diff --git a/CaloFuture/CaloFutureDAQ/src/CaloFutureRawToDigits.cpp b/CaloFuture/CaloFutureDAQ/src/CaloFutureRawToDigits.cpp index c2071ed173d7b2bab53e4dbb00a1fe5d06b02ce8..203ae9e4b429ef88f67e0d754bcf7210d8aabed0 100644 --- a/CaloFuture/CaloFutureDAQ/src/CaloFutureRawToDigits.cpp +++ b/CaloFuture/CaloFutureDAQ/src/CaloFutureRawToDigits.cpp @@ -299,7 +299,7 @@ namespace LHCb::Calo { } } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { for ( const auto& anAdc : dataVec ) { int digAdc = anAdc.adc; if ( digAdc < zSupThreshold ) continue; @@ -497,7 +497,7 @@ namespace LHCb::Calo { CellID id = ( num < chanID.size() ? chanID[num] : CellID{} ); if ( 0 != id.index() && id.isPin() == ( decode == Decode::PinData ) ) dataVec.emplace_back( id, adc ); - if ( UNLIKELY( dump ) ) { + if ( dump ) { // event dump verbose() << " | SourceID : " << sourceID << " | FeBoard : " << calo.cardNumber( id ) << " | Channel : " << num << " | CaloCell " << id << " | valid ? " << calo.valid( id ) diff --git a/CaloFuture/CaloFutureDAQ/src/CheckCaloFutureBank.cpp b/CaloFuture/CaloFutureDAQ/src/CheckCaloFutureBank.cpp index fb794c215025d637771a45027f7e7d1c22e41a0d..52d95f4a3638b4ce273061be9d7493ee9cc4c796 100644 --- a/CaloFuture/CaloFutureDAQ/src/CheckCaloFutureBank.cpp +++ b/CaloFuture/CaloFutureDAQ/src/CheckCaloFutureBank.cpp @@ -123,7 +123,7 @@ StatusCode CheckCaloFutureBank::execute() { bool trig = ( 0 == ( rawEvt->banks( m_trig ) ).size() ) ? false : true; bool bank = ( 0 == ( rawEvt->banks( m_bank ) ).size() ) ? false : true; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "TYPE of Calo Bank to be checked : " << m_typ << " " << trig << " " << bank << endmsg; if ( trig || bank ) { debug() << " Calo Banks with 'compressed' format exist - Do nothing" << endmsg; diff --git a/CaloFuture/CaloFutureDAQ/src/CompareCaloFutureDigits.cpp b/CaloFuture/CaloFutureDAQ/src/CompareCaloFutureDigits.cpp index 89351b2794181266a3204dff0731e3d910c7c28a..7d57d9bfe1d5c726cd54cfb60cda8f0e516ebc19 100644 --- a/CaloFuture/CaloFutureDAQ/src/CompareCaloFutureDigits.cpp +++ b/CaloFuture/CaloFutureDAQ/src/CompareCaloFutureDigits.cpp @@ -56,7 +56,7 @@ CompareCaloFutureDigits::CompareCaloFutureDigits( const std::string& name, ISvcL //============================================================================= StatusCode CompareCaloFutureDigits::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; std::string ecalName = LHCb::CaloDigitLocation::Ecal; std::string hcalName = LHCb::CaloDigitLocation::Hcal; @@ -97,7 +97,7 @@ void CompareCaloFutureDigits::compareContainers( const LHCb::CaloDigits& dig1, c error() << "Incoherent size : " << dig1.registry()->identifier() << " : " << dig1.size() << " and " << dig2.registry()->identifier() << " : " << dig2.size() << endmsg; } else { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Comparing " << dig1.name() << " and " << dig2.name() << " both sizes = " << dig2.size() << endmsg; } @@ -110,7 +110,7 @@ void CompareCaloFutureDigits::compareContainers( const LHCb::CaloDigits& dig1, c ( *it1 )->e() / Gaudi::Units::MeV - ( *it2 )->e() / Gaudi::Units::MeV ) << endmsg; } else { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << ( *it1 )->cellID() << " " << ( *it2 )->cellID() << " E " << ( *it1 )->e() / Gaudi::Units::MeV << " " << ( *it2 )->e() / Gaudi::Units::MeV << endmsg; } diff --git a/DAQ/DAQUtils/src/bankKiller.cpp b/DAQ/DAQUtils/src/bankKiller.cpp index 6ac0835dc3f335e2de0e81e114886005264d14ab..331f7e06f18b44949d7eaf6f3c1708f7a70be368 100644 --- a/DAQ/DAQUtils/src/bankKiller.cpp +++ b/DAQ/DAQUtils/src/bankKiller.cpp @@ -155,7 +155,7 @@ StatusCode bankKiller::killFromRawEvent( LHCb::RawEvent* rawEvent ) const { void bankKiller::killBankType( LHCb::RawEvent* rawEvent, LHCb::RawBank::BankType bankType, bool warningmsg ) const { // only need the name for the debug messages, so avoid allocation if we aren't debugging - const std::string bankTypeName = UNLIKELY( msgLevel( MSG::DEBUG ) ) ? toString( bankType ) : ""; + const std::string bankTypeName = msgLevel( MSG::DEBUG ) ? toString( bankType ) : ""; // look for all banks of this type and remove them const auto& banks = rawEvent->banks( bankType ); @@ -164,7 +164,7 @@ void bankKiller::killBankType( LHCb::RawEvent* rawEvent, LHCb::RawBank::BankType return; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "All banks of type '" << bankTypeName << "' are to be removed - banks size = " << banks.size() << endmsg; } @@ -177,14 +177,14 @@ void bankKiller::killBankType( LHCb::RawEvent* rawEvent, LHCb::RawBank::BankType if ( !success && warningmsg ) { ++m_bank_not_found; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "The bank " << bank << " of type '" << bankTypeName << "' has not been found to be removed " << endmsg; } } } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "All banks of type '" << bankTypeName << "' have been removed - " << " banks size is now : " << rawEvent->banks( bankType ).size() << endmsg; } diff --git a/DAQ/MDF/src/MDFIO.cpp b/DAQ/MDF/src/MDFIO.cpp index b9b5fcd4ea7572caa45c9c87e11470bf3e2719b5..029546bab3d1c52a4a0daab802f3dd849b9378f5 100644 --- a/DAQ/MDF/src/MDFIO.cpp +++ b/DAQ/MDF/src/MDFIO.cpp @@ -136,7 +136,7 @@ StatusCode LHCb::MDFIO::commitRawBanks( int compTyp, int chksumTyp, void* const const OnlineRunInfo* odin_info = odin[0]->begin<OnlineRunInfo>(); MDFHeader::SubHeader inf = hdrBank->begin<MDFHeader>()->subHeader(); MsgStream log1( m_msgSvc, m_parent ); - if ( UNLIKELY( log1.level() <= MSG::DEBUG ) ) + if ( log1.level() <= MSG::DEBUG ) log1 << MSG::DEBUG << "Creating MDF/DAQ[DAQ_STATUS_BANK] with ODIN information." << endmsg; inf.H1->setTriggerMask( trMask ); inf.H1->setRunNumber( odin_info->Run ); @@ -150,8 +150,7 @@ StatusCode LHCb::MDFIO::commitRawBanks( int compTyp, int chksumTyp, void* const MsgStream msg( m_msgSvc, m_parent ); RawEvent privateBank; // This holds the two temporary banks std::vector<RawEvent*> theRawEvents; // Keep pointer on found events - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << "Found a TAE event. scan for various BXs" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Found a TAE event. scan for various BXs" << endmsg; // prepare the bank containing information for each BX // Maximum +-7 crossings, due to hardware limitation of derandomisers = 15 consecutive BX @@ -176,8 +175,7 @@ StatusCode LHCb::MDFIO::commitRawBanks( int compTyp, int chksumTyp, void* const size_t l = rawEventLengthTAE( rawEvt ); ctrlData.push_back( l ); // size of this BX information offset += l; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << "Found RawEvent in " << loc << ", size =" << l << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Found RawEvent in " << loc << ", size =" << l << endmsg; } } len = ctrlData.size(); @@ -229,7 +227,7 @@ StatusCode LHCb::MDFIO::commitRawBanks( int compTyp, int chksumTyp, void* const StatusCode sc = writeDataSpace( compTyp, chksumTyp, ioDesc, hdrBank, space.first, total ); if ( !sc.isSuccess() ) { msg << MSG::ERROR << "Failed write data to output device." << endmsg; } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Wrote TAE event of length:" << total << " bytes from " << theRawEvents.size() << " Bxs" << endmsg; privateBank.removeBank( ctrlBank ); @@ -617,8 +615,7 @@ MDFDescriptor LHCb::MDFIO::readBanks( void* const ioDesc, bool dbg ) { return MDFDescriptor( 0, -1 ); } MsgStream log( m_msgSvc, m_parent ); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) - log << MSG::DEBUG << "Cannot read " << rawSize << " bytes of header data." << endmsg; + if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Cannot read " << rawSize << " bytes of header data." << endmsg; return MDFDescriptor( 0, -1 ); } diff --git a/DAQ/MDF/src/RawDataSelector.cpp b/DAQ/MDF/src/RawDataSelector.cpp index 83bc9d6b5d113d34f1d7cb49d4574b2c217dbd38..16089d3e3b3c62b540329ce22dee21a8bca19c13 100755 --- a/DAQ/MDF/src/RawDataSelector.cpp +++ b/DAQ/MDF/src/RawDataSelector.cpp @@ -94,7 +94,7 @@ StatusCode RawDataSelector::initialize() { return StatusCode::FAILURE; } m_rootCLID = eds->rootCLID(); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) log << MSG::DEBUG << "Selection CLID:" << m_rootCLID << endmsg; + if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Selection CLID:" << m_rootCLID << endmsg; if ( !m_trgMask.empty() ) { log << MSG::INFO << "Trigger mask: " << std::hex; for ( size_t i = 0; i < m_trgMask.size(); ++i ) diff --git a/Det/CaloDet/src/Lib/DeCalorimeter.cpp b/Det/CaloDet/src/Lib/DeCalorimeter.cpp index 7195e596d1cbef01d84a5a568e4ee3e0068cc0ad..3d8e0efe622071e9c4ac49b8934faf832a6d7dac 100644 --- a/Det/CaloDet/src/Lib/DeCalorimeter.cpp +++ b/Det/CaloDet/src/Lib/DeCalorimeter.cpp @@ -47,7 +47,7 @@ namespace { template <typename Container, typename Fun> void resetCellParam( MsgStream& msg, const char* member, Container& c, Fun&& fun ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Before updating condition - reset CellParam." << member << endmsg; std::for_each( std::begin( c ), std::end( c ), std::forward<Fun>( fun ) ); } @@ -76,14 +76,13 @@ StatusCode DeCalorimeter::initialize() { m_caloIndex = CaloCellCode::CaloNumFromName( name() ); m_caloDet = CaloCellCode::caloName( m_caloIndex ) + "Det"; MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "'INITIALIZE DeCalorimeter " << name() << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "'INITIALIZE DeCalorimeter " << name() << endmsg; //============================= // collect the sub-calorimeters //============================= IDetectorElement::IDEContainer& subdets = childIDetectorElements(); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << " Number of subCalorimeter " << subdets.size() << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << " Number of subCalorimeter " << subdets.size() << endmsg; m_xSize = 0.0; m_ySize = 0.0; for ( auto child : subdets ) { @@ -167,7 +166,7 @@ StatusCode DeCalorimeter::initialize() { m_initialized = true; // DEBUG - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) { + if ( msg.level() <= MSG::DEBUG ) { msg << MSG::DEBUG << "'DeCalorimeter " << name() << " correctly initalized with : " << endmsg; msg << MSG::DEBUG << " - " << numberOfCells() << " channels " << endmsg; msg << MSG::DEBUG << " - " << numberOfCards() << " FE-boards " << endmsg; @@ -177,7 +176,7 @@ StatusCode DeCalorimeter::initialize() { } // VERBOSE - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "DDDB parameters : " << " Y/X ratio = " << m_YToXSizeRatio << " zOffset = " << m_zOffset << " zSize = " << m_zSize << endmsg; @@ -196,7 +195,7 @@ StatusCode DeCalorimeter::initialize() { thGain /= (double)adcMax(); } - if ( UNLIKELY( msg1.level() <= MSG::VERBOSE ) ) + if ( msg1.level() <= MSG::VERBOSE ) msg1 << MSG::VERBOSE << "Expected gain : " << id << " => " << cellGain( id ) << " MeV/ADC " << " = (nominal * calib * shift) = " << m_cells[id].nominalGain() << " x " << m_cells[id].calibration() << " / " << m_cells[id].gainShift() << " | Theoretical nominal gain [" << thGain << "]" << endmsg; @@ -206,7 +205,7 @@ StatusCode DeCalorimeter::initialize() { auto act = (double)m_cells[id].l0Constant(); double ag = 0; if ( act > 0 ) ag = cellGain( id ) * m_cells[id].sine() / act * 1024; - if ( UNLIKELY( msg2.level() <= MSG::VERBOSE ) ) + if ( msg2.level() <= MSG::VERBOSE ) msg2 << MSG::VERBOSE << "Chan : " << id << " [ crate=" << cardCrate( cardNumber( id ) ) << ", slot=" << cardSlot( cardNumber( id ) ) << "]" << " => nominal L0gain : " << m_l0Et << " MeV/ADC => expected L0Cte : " << (int)ect @@ -217,7 +216,7 @@ StatusCode DeCalorimeter::initialize() { if ( nGain > 0 && msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Found " << nGain << " channel(s) with null gain " << endmsg; // Verbosity - if ( UNLIKELY( msg3.level() <= MSG::VERBOSE ) ) { + if ( msg3.level() <= MSG::VERBOSE ) { msg3 << MSG::VERBOSE << " ----------- List of " << CaloCellCode::caloName( m_caloIndex ) << " channels " << " ----------- " << endmsg; long k = 1; @@ -264,7 +263,7 @@ StatusCode DeCalorimeter::buildCells() { // loop over sub-calo (calo halves) for ( auto& elem : m_subCalos ) { m_nArea = elem->subSubCalos().size(); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << " SubCalos : Side " << elem->sideName() << " | #areas " << elem->subSubCalos().size() << endmsg; int side = ( elem->side() == DeSubCalorimeter::Side::C ? -1 : +1 ); @@ -272,7 +271,7 @@ StatusCode DeCalorimeter::buildCells() { for ( auto& subSubCalo : elem->subSubCalos() ) { unsigned int Area = subSubCalo->area(); double xOffset = -side * subSubCalo->xSize() / 2.; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "SubSubCalo : Area " << Area << " | cellSize : " << ( subSubCalo )->cellSize() << " | local center X-offset: " << xOffset << endmsg; if ( cellSize.size() <= Area ) cellSize.resize( Area + 1, 0 ); @@ -398,7 +397,7 @@ StatusCode DeCalorimeter::buildCells() { } } // end of loop ovel all cells - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Initialized " << m_caloDet << ", " << nbCells << " channels" << endmsg; return StatusCode::SUCCESS; @@ -434,7 +433,7 @@ StatusCode DeCalorimeter::buildCards() { } // get pin ID.area if ( !m_readout->exists( "pinArea" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "No PIN FE-board for " << m_caloDet << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No PIN FE-board for " << m_caloDet << endmsg; m_pinArea = -1; } else { m_pinArea = m_readout->param<int>( "pinArea" ); @@ -448,7 +447,7 @@ StatusCode DeCalorimeter::buildCards() { while ( k < vec.size() ) { int typ = vec[k]; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Building mapping : type = " << typ << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Building mapping : type = " << typ << endmsg; if ( typ == CardParam::None ) { msg << MSG::ERROR << "The map type = " << typ << " is reserved ! Please change in condDB" << endmsg; return StatusCode::FAILURE; @@ -461,20 +460,20 @@ StatusCode DeCalorimeter::buildCards() { if ( k < vec.size() ) maps[typ].push_back( vec[k] ); } k++; - if ( UNLIKELY( ( msg.level() <= MSG::DEBUG ) && ( k == vec.size() ) ) ) { + if ( ( msg.level() <= MSG::DEBUG ) && ( k == vec.size() ) ) { msg << MSG::DEBUG << "Maps from condDB are completed " << endmsg; } } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Defined " << maps.size() << " different channel mappings" << endmsg; // decode cards array // ------------------ auto aSize = m_readout->param<int>( "size" ); const auto& temp = m_readout->param<std::vector<int>>( "FEB" ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "The calorimeter has " << temp.size() / aSize << " front end cards." << endmsg; int firstCrate = temp[6]; for ( unsigned int kk = 0; kk * aSize < temp.size(); ++kk ) { @@ -522,7 +521,7 @@ StatusCode DeCalorimeter::buildCards() { } if ( it != maps.end() ) { - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "The FE-board " << cardNum << " channels are re-mapped using mapping type = " << mapType << endmsg; std::vector<int> map = ( *it ).second; @@ -565,7 +564,7 @@ StatusCode DeCalorimeter::buildCards() { } } } else { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'SelectionBoard' parameters in 'Readout' condition" << endmsg; } @@ -581,7 +580,7 @@ StatusCode DeCalorimeter::buildCards() { m_valCards[num] = hcalFe; } } else { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'ValidationBoard' parameters in 'Readout' condition" << endmsg; } @@ -643,7 +642,7 @@ StatusCode DeCalorimeter::buildCards() { card.setValidationNumber( validationCard ); } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << format( "Card %3d (crate %2d slot %2d) has down %3d left %3d corner %3d previous %3d ", card.number(), card.crate(), card.slot(), card.downNumber(), card.leftNumber(), card.cornerNumber(), @@ -651,7 +650,7 @@ StatusCode DeCalorimeter::buildCards() { << format( " validation %2d Selection %2d #channels% 5d", card.validationNumber(), card.selectionType(), card.ids().size() ) << endmsg; - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << " >> boundaries : " << cardFirstValidRow( card.number() ) << " (" << cardFirstRow( card.number() ) << ") -> " << cardLastValidRow( card.number() ) << " (" << cardLastRow( card.number() ) << ") && " << cardFirstValidColumn( card.number() ) << " (" @@ -659,7 +658,7 @@ StatusCode DeCalorimeter::buildCards() { << cardLastColumn( card.number() ) << ") " << endmsg; } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Initialized, " << numberOfCards() << " front-end cards." << endmsg; return StatusCode::SUCCESS; } @@ -694,11 +693,10 @@ StatusCode DeCalorimeter::buildTell1s() { } int nb = ( *it++ ); Tell1Param tell1( num ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << " create Tell1 number " << num << " handling : " << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << " create Tell1 number " << num << " handling : " << endmsg; while ( 0 < nb-- ) { unsigned int feCard = *it++; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << " ----> FE-Card number " << feCard << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << " ----> FE-Card number " << feCard << endmsg; if ( m_feCards.size() < feCard ) { msg << MSG::ERROR << "**** TELL1 " << num << " reads unknown card " << feCard << endmsg; return StatusCode::FAILURE; @@ -715,7 +713,7 @@ StatusCode DeCalorimeter::buildTell1s() { if ( tell1.readPin() ) m_pinTell1s.push_back( num ); m_tell1Boards.push_back( tell1 ); } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Initialized, " << numberOfTell1s() << " Tell1 board " << endmsg; return StatusCode::SUCCESS; } @@ -796,7 +794,7 @@ StatusCode DeCalorimeter::buildMonitoring() { msg << MSG::ERROR << "PIN-diode with same ID but different location already exists " << endmsg; return StatusCode::FAILURE; } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Extended definition for an existing PIN-diode is found " << endmsg; } else { // create a new one and store it @@ -812,14 +810,14 @@ StatusCode DeCalorimeter::buildMonitoring() { auto& ids = const_cast<std::vector<LHCb::CaloCellID>&>( m_feCards[iCard].ids() ); ids[channel] = pinId; kk++; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "PIN diode " << kk << " ------" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "PIN diode " << kk << " ------" << endmsg; } // update CaloRegion m_pins[pinId].addCaloRegion( area, fCol, fRow, lCol, lRow ); if ( area2 >= 0 ) m_pins[pinId].addCaloRegion( area2, fCol2, fRow2, lCol2, lRow2 ); // Hcal Leds can be distributed on 2 areas - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "-->" << m_pins[pinId] << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "-->" << m_pins[pinId] << endmsg; int nleds = m_pins[pinId].leds().size(); @@ -871,14 +869,14 @@ StatusCode DeCalorimeter::buildMonitoring() { led.addCaloRegion( area2, fCol2, fRow2, lCol2, lRow2 ); } m_leds.push_back( led ); // store CaloLed - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << " --- " << led << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << " --- " << led << endmsg; } } // Link to cell (if not done yet) for ( int ledNum : m_pins[pinId].leds() ) { CaloLed& led = m_leds[ledNum]; - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) msg << MSG::VERBOSE << " LED " << ledNum << endmsg; + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << " LED " << ledNum << endmsg; for ( unsigned int ireg = 0; ireg < led.areas().size(); ++ireg ) { int ar = led.areas()[ireg]; @@ -889,7 +887,7 @@ StatusCode DeCalorimeter::buildMonitoring() { for ( int row = fr; lr >= row; ++row ) { for ( int col = fc; lc >= col; ++col ) { LHCb::CaloCellID id( m_caloIndex, ar, row, col ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << " Connected cells to LED/Pin " << id << " valid ? " << valid( id ) << endmsg; if ( valid( id ) ) { m_cells[id].addPin( pinId ); @@ -905,7 +903,7 @@ StatusCode DeCalorimeter::buildMonitoring() { // check all cells (including virtual) are connected to a Led for ( auto& elem : m_cells ) { - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << " Cell " << elem.cellID() << " <- Led " << elem.leds() << " -> Pin " << elem.pins() << endmsg; if ( elem.leds().empty() ) { @@ -914,7 +912,7 @@ StatusCode DeCalorimeter::buildMonitoring() { } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) { + if ( msg.level() <= MSG::DEBUG ) { msg << MSG::DEBUG << "Initialized, " << m_leds.size() << " monitoring LEDs" << endmsg; msg << MSG::DEBUG << "Initialized, " << m_pins.size() << " PIN-diodes." << endmsg; } @@ -931,7 +929,7 @@ StatusCode DeCalorimeter::getPileUpOffset() { if ( !m_pileUp->exists( "data" ) || !m_pileUp->exists( "size" ) || !m_pileUp->exists( "Method" ) || !m_pileUp->exists( "Bin" ) || !m_pileUp->exists( "Min" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'data' in 'PileUpOffset' condition : will assume offset = 0." << endmsg; return StatusCode::SUCCESS; } @@ -940,7 +938,7 @@ StatusCode DeCalorimeter::getPileUpOffset() { m_puBin = m_pileUp->param<int>( "Bin" ); m_puMin = m_pileUp->param<int>( "Min" ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Pileup offset substraction : method = " << m_puMeth << " ; Min = " << m_puMin << " ; Bin = " << m_puBin << endmsg; @@ -958,7 +956,7 @@ StatusCode DeCalorimeter::getPileUpOffset() { if ( m_cells[id].valid() ) { m_cells[id].setPileUpOffset( offs, eoffs ); m_cells[id].setPileUpOffsetSPD( offs, eoffs ); // set the same offset for SPD-tag/-untag cluster by default - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Added pileup offset for channel " << id << " : <offset> = " << offs << " ( RMS = " << eoffs << " )" << endmsg; } else @@ -979,7 +977,7 @@ StatusCode DeCalorimeter::getPileUpOffset() { id.setCalo( CaloCellCode::CaloNumFromName( name() ) ); if ( m_cells[id].valid() ) { m_cells[id].setPileUpOffsetSPD( offs, eoffs ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Added pileup (SPD-tag) offset for channel " << id << " : <offset> = " << offs << " ( RMS = " << eoffs << " )" << endmsg; } else @@ -987,7 +985,7 @@ StatusCode DeCalorimeter::getPileUpOffset() { ccount++; } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) { + if ( msg.level() <= MSG::DEBUG ) { msg << MSG::DEBUG << "Pileup offset added for " << count << " channel(s) " << endmsg; msg << MSG::DEBUG << "Alternative Pileup offset added for " << ccount << " channel(s) " << endmsg; } @@ -1004,7 +1002,7 @@ StatusCode DeCalorimeter::getCalibration() { // check array if ( !m_calib->exists( "data" ) || !m_calib->exists( "size" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'data' in 'Calibration' condition : will assume deltaG = 1." << endmsg; return StatusCode::SUCCESS; } @@ -1027,7 +1025,7 @@ StatusCode DeCalorimeter::getCalibration() { if ( m_cells[id].valid() ) { m_cells[id].setCalibration( dg ); // m_cells[id].setLedDataRef( ledDataRef, ledMoniRef ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Added calibration for channel " << id << " : dG = " << dg // << " Reference (<PMT> , <PMT/PIN>) datafrom LED signal = (" << ledDataRef << "," << ledMoniRef << ")" @@ -1037,7 +1035,7 @@ StatusCode DeCalorimeter::getCalibration() { msg << MSG::WARNING << "Trying to add calibration on non-valid channel : " << id << endmsg; } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Calibration constant added for " << count << " channel(s) " << endmsg; return StatusCode::SUCCESS; } @@ -1052,7 +1050,7 @@ StatusCode DeCalorimeter::getLEDReference() { // check array if ( !m_LEDReference->exists( "data" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "No 'data' in 'LEDReference' condition" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'data' in 'LEDReference' condition" << endmsg; return StatusCode::FAILURE; } auto size = m_LEDReference->param<int>( "size" ); @@ -1070,7 +1068,7 @@ StatusCode DeCalorimeter::getLEDReference() { // get cell if ( m_cells[id].valid() ) { m_cells[id].setLedDataRef( ledDataRef, ledMoniRef ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Added LED reference for channel " << id << " Reference (<PMT> , <PMT/PIN>) datafrom LED signal = (" << ledDataRef << "," << ledMoniRef << ")" << endmsg; @@ -1079,8 +1077,7 @@ StatusCode DeCalorimeter::getLEDReference() { msg << MSG::WARNING << "Trying to add reference on non-valid channel : " << id << endmsg; } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << "LED reference added for " << count << " channel(s) " << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "LED reference added for " << count << " channel(s) " << endmsg; return StatusCode::SUCCESS; } @@ -1094,7 +1091,7 @@ StatusCode DeCalorimeter::getQuality() { // check array if ( !m_quality->exists( "data" ) || !m_quality->exists( "size" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'data' in 'Quality condition : will assume Flag = 0" << endmsg; return StatusCode::SUCCESS; } @@ -1120,7 +1117,7 @@ StatusCode DeCalorimeter::getQuality() { m_cells[id].addQualityFlag( (int)qFlag ); m_cells[id].setLedData( ledData, ledDataRMS ); m_cells[id].setLedMoni( ledMoni, ledMoniRMS ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) { + if ( msg.level() <= MSG::VERBOSE ) { msg << MSG::VERBOSE << "Added quality for channel " << id << " : quality = " << qFlag << endmsg; msg << MSG::VERBOSE << " current <PMT> +- RMS from LED signal : " << ledData << " +- " << ledDataRMS << endmsg; @@ -1128,7 +1125,7 @@ StatusCode DeCalorimeter::getQuality() { << endmsg; } if ( CaloCellQuality::OK != (int)qFlag ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Quality " << id << " : " << m_cells[id].cellStatus() << endmsg; int iFlag = (int)qFlag; bool bLed = false; @@ -1156,7 +1153,7 @@ StatusCode DeCalorimeter::getQuality() { msg << MSG::WARNING << "Trying to add quality on non-valid channel : " << id << endmsg; } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) { + if ( msg.level() <= MSG::DEBUG ) { msg << MSG::DEBUG << "Quality constant added for " << count << " channel(s) " << endmsg; if ( bad > 0 ) msg << MSG::DEBUG << "Found " << bad << " problematic readout channel(s)" << endmsg; if ( masked > 0 ) msg << MSG::DEBUG << "Found " << masked << " channel(s) to be masked offline " << endmsg; @@ -1174,7 +1171,7 @@ StatusCode DeCalorimeter::getL0Calibration() { // check array if ( !m_l0calib->exists( "data" ) || !m_l0calib->exists( "size" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'data' in 'L0calibration' condition : will assume cte = 0" << endmsg; return StatusCode::SUCCESS; } @@ -1191,7 +1188,7 @@ StatusCode DeCalorimeter::getL0Calibration() { // get cell if ( m_cells[id].valid() ) { m_cells[id].setL0Constant( ct ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Added l0calibration for channel " << id << " : L0 calibration constant = " << ct << endmsg; count++; @@ -1199,7 +1196,7 @@ StatusCode DeCalorimeter::getL0Calibration() { msg << MSG::WARNING << "Trying to add l0calibration on non-valid channel : " << id << endmsg; } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "L0calibration constant added for " << count << " channel " << endmsg; return StatusCode::SUCCESS; } @@ -1213,7 +1210,7 @@ StatusCode DeCalorimeter::getNumericGains() { // check array if ( !m_numericGains->exists( "data" ) || !m_numericGains->exists( "size" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "No 'data' in 'NumericGains' condition : will assume cte = 0" << endmsg; return StatusCode::SUCCESS; } @@ -1231,15 +1228,14 @@ StatusCode DeCalorimeter::getNumericGains() { // get cell if ( m_cells[id].valid() ) { m_cells[id].setNumericGain( ng ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Added NumericGain for channel " << id << " : " << ng << endmsg; ++count; } else { msg << MSG::WARNING << "Trying to NumericGain on non-valid channel : " << id << endmsg; } } - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << "NumericGain added for " << count << " channel " << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "NumericGain added for " << count << " channel " << endmsg; return StatusCode::SUCCESS; } @@ -1310,7 +1306,7 @@ MsgStream& DeCalorimeter::printOut( MsgStream& os ) const { // bool DeCalorimeter::loadCondition( SmartRef<Condition>& cond, std::string name, bool mandatory ) { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Loading condition '" << name << "'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Loading condition '" << name << "'" << endmsg; if ( hasCondition( name ) ) { cond = condition( name ); return true; @@ -1323,7 +1319,7 @@ bool DeCalorimeter::loadCondition( SmartRef<Condition>& cond, std::string name, // Update cache StatusCode DeCalorimeter::updGain() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'Gain'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'Gain'" << endmsg; if ( !hasCondition( "Gain" ) ) return StatusCode::FAILURE; // the gain condition must exist @@ -1338,7 +1334,7 @@ StatusCode DeCalorimeter::updGain() { int count = 0; // Nominal Gain parameters if ( m_gain->exists( "data" ) && m_gain->exists( "size" ) ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Apply DB nominal gains" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Apply DB nominal gains" << endmsg; nominal = true; auto size = m_gain->param<int>( "size" ); const auto& data = m_gain->param<std::vector<double>>( "data" ); @@ -1392,10 +1388,10 @@ StatusCode DeCalorimeter::updGain() { } std::string nom = ( nominal ) ? "Nominal" : "Theoretical"; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << nom << " gain constant added for " << count << " / " << numberOfCells() << " channel(s) " << endmsg; - if ( UNLIKELY( msg.level() <= MSG::ERROR ) ) + if ( msg.level() <= MSG::ERROR ) if ( count != (int)numberOfCells() ) msg << MSG::ERROR << nom << " gains are missing for " << (int)numberOfCells() - count << " channels !" << endmsg; @@ -1431,7 +1427,7 @@ StatusCode DeCalorimeter::updGain() { StatusCode DeCalorimeter::updReco() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'Reco'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'Reco'" << endmsg; if ( !hasCondition( "Reco" ) ) return StatusCode::FAILURE; // the reco condition MUST exist @@ -1442,7 +1438,7 @@ StatusCode DeCalorimeter::updReco() { StatusCode DeCalorimeter::updHardware() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'Hardware'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'Hardware'" << endmsg; if ( !hasCondition( "Hardware" ) ) return StatusCode::FAILURE; // the hardware condition MUST exist m_adcMax = m_hardware->param<int>( "AdcMax" ); m_coding = m_hardware->param<int>( "CodingBit" ); @@ -1456,7 +1452,7 @@ StatusCode DeCalorimeter::updHardware() { StatusCode DeCalorimeter::updReadout() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'Readout'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'Readout'" << endmsg; if ( !hasCondition( "Readout" ) ) return StatusCode::SUCCESS; // the readout condition is not mandatory (e.g Spd) StatusCode sc = buildCards(); @@ -1466,7 +1462,7 @@ StatusCode DeCalorimeter::updReadout() { StatusCode DeCalorimeter::updMonitor() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'Monitoring'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'Monitoring'" << endmsg; if ( !hasCondition( "Monitoring" ) ) return StatusCode::SUCCESS; // the monitoring condition is not mandatory (e.g Spd/Prs) resetCellParam( msg, "Monitoring", m_cells, []( CellParam& ic ) { @@ -1481,7 +1477,7 @@ StatusCode DeCalorimeter::updMonitor() { StatusCode DeCalorimeter::updGeometry() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'IGeometry'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'IGeometry'" << endmsg; if ( !geometry() ) return StatusCode::FAILURE; resetCellParam( msg, "Geometry", m_cells, []( CellParam& ic ) { if ( !ic.cellID().isPin() ) { @@ -1490,14 +1486,14 @@ StatusCode DeCalorimeter::updGeometry() { } } ); auto sc = buildCells(); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Number of invalid cells = " << numberOfInvalidCells() << endmsg; return sc; } StatusCode DeCalorimeter::updCalib() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'Calibration'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'Calibration'" << endmsg; if ( !hasCondition( "Calibration" ) ) return StatusCode::SUCCESS; // the calibration condition is NOT mandatory resetCellParam( msg, "Calibration", m_cells, []( CellParam& ic ) { ic.setCalibration( 1.0 ); // same default as in CellParam.cpp @@ -1507,7 +1503,7 @@ StatusCode DeCalorimeter::updCalib() { StatusCode DeCalorimeter::updPileUp() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'PileUpOffset'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'PileUpOffset'" << endmsg; if ( !hasCondition( "PileUpOffset" ) ) return StatusCode::SUCCESS; // the pileUpOffset condition is NOT mandatory resetCellParam( msg, "PileUpOffset", m_cells, []( CellParam& ic ) { ic.setPileUpOffset( 0.0, 0.0 ); // same default as in CellParam.cpp @@ -1517,7 +1513,7 @@ StatusCode DeCalorimeter::updPileUp() { StatusCode DeCalorimeter::updLEDReference() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'LEDReference'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'LEDReference'" << endmsg; if ( !hasCondition( "LEDReference" ) ) return StatusCode::SUCCESS; // the LEDReference condition is NOT mandatory resetCellParam( msg, "LEDReference", m_cells, []( CellParam& ic ) { ic.setLedDataRef( -1.0, 0.0 ); // same default as in CellParam.cpp @@ -1527,7 +1523,7 @@ StatusCode DeCalorimeter::updLEDReference() { StatusCode DeCalorimeter::updQuality() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'Quality'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'Quality'" << endmsg; if ( !hasCondition( "Quality" ) ) return StatusCode::SUCCESS; // the quality condition is NOT mandatory resetCellParam( msg, "Quality", m_cells, []( CellParam& ic ) { ic.setLedData( -1.0, -1.0 ); @@ -1539,7 +1535,7 @@ StatusCode DeCalorimeter::updQuality() { StatusCode DeCalorimeter::updL0Calib() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'L0Calibration'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'L0Calibration'" << endmsg; if ( !hasCondition( "L0Calibration" ) ) return StatusCode::SUCCESS; // the L0Calibration condition is NOT mandatory resetCellParam( msg, "L0Calibration", m_cells, []( CellParam& ic ) { ic.setL0Constant( 0.0 ); // same default as in CellParam.cpp @@ -1549,7 +1545,7 @@ StatusCode DeCalorimeter::updL0Calib() { StatusCode DeCalorimeter::updNumGains() { MsgStream msg( msgSvc(), m_caloDet ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << "Updating condition 'NumericGain'" << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Updating condition 'NumericGain'" << endmsg; if ( !hasCondition( "NumericGains" ) ) return StatusCode::SUCCESS; // the L0Calibration condition is NOT mandatory resetCellParam( msg, "NumericGains", m_cells, []( CellParam& ic ) { ic.setNumericGain( 0.0 ); // same default as in CellParam.cpp diff --git a/Det/CaloDet/src/Lib/DeSubCalorimeter.cpp b/Det/CaloDet/src/Lib/DeSubCalorimeter.cpp index fa8a05428ea359107fce419f3a5a3fb3cd064369..d34a39a06fe878c7a6003a60954bafe8ab17c51b 100644 --- a/Det/CaloDet/src/Lib/DeSubCalorimeter.cpp +++ b/Det/CaloDet/src/Lib/DeSubCalorimeter.cpp @@ -54,7 +54,7 @@ StatusCode DeSubCalorimeter::initialize() { { // collect the sub-sub-calorimeters (calo areas) IDetectorElement::IDEContainer& subdets = childIDetectorElements(); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << name() << " : number of subSubCalorimeter " << subdets.size() << endmsg; for ( auto child : subdets ) { diff --git a/Det/CaloDet/src/component/DeCaloCalib.cpp b/Det/CaloDet/src/component/DeCaloCalib.cpp index 6e6d1ecbcbe88e0fc27838f1a1c02658779fa0a8..b506cbd9f697088e72b89455dea039ea3193e086 100644 --- a/Det/CaloDet/src/component/DeCaloCalib.cpp +++ b/Det/CaloDet/src/component/DeCaloCalib.cpp @@ -146,8 +146,7 @@ void DeCaloCalib::update( const DeCalorimeter& deCalo ) const { else dt = m_shoot(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << num << " Calibration constant for cellID " << id << " : " << dt << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << num << " Calibration constant for cellID " << id << " : " << dt << endmsg; cell.setCalibration( dt ); // cellids.push_back( id.index() ); cellind.push_back( num ); diff --git a/Det/CaloDet/src/component/DeCaloTiming.cpp b/Det/CaloDet/src/component/DeCaloTiming.cpp index 2f2d14b815817efbdc4fa9503e94f3f8ba347424..1463fc4fab52a26519ae3db3092bd6f31b412171 100644 --- a/Det/CaloDet/src/component/DeCaloTiming.cpp +++ b/Det/CaloDet/src/component/DeCaloTiming.cpp @@ -112,8 +112,7 @@ void DeCaloTiming::operator()( const DeCalorimeter& deCalo ) const { if ( !deCalo.valid( id ) || deCalo.isPinId( id ) ) continue; long num = deCalo.cellIndex( id ); double dt = ( m_method != "User" ? m_shoot() : delta( m_key != "Index" ? id.index() : num ) ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << num << " Delta time for cellID " << id << " : " << dt << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << num << " Delta time for cellID " << id << " : " << dt << endmsg; icell.setDeltaTime( dt ); // add delta time (ns) cellids.push_back( id.index() ); cellind.push_back( num ); diff --git a/Det/DetCond/src/CondDBDQScanner.cpp b/Det/DetCond/src/CondDBDQScanner.cpp index 4148b78b83826b642ebb60287140b79ec2f64df7..9c8ba17939f630016ccdbf695226be330007ef08 100644 --- a/Det/DetCond/src/CondDBDQScanner.cpp +++ b/Det/DetCond/src/CondDBDQScanner.cpp @@ -86,7 +86,7 @@ StatusCode CondDBDQScanner::initialize() { if ( sc.isFailure() ) return sc; m_converter = service( m_converterName ); - if ( UNLIKELY( !m_converter.isValid() ) ) { + if ( !m_converter.isValid() ) { error() << "Cannot get the IConverter implementation " << m_converterName << endmsg; return StatusCode::FAILURE; } diff --git a/Det/DetCond/src/RunStampCheck.cpp b/Det/DetCond/src/RunStampCheck.cpp index 045e4727027707435c729c332d1b5b9dc2ec35c6..9e88431c41d9978bf2786ab929d4b9d5c345c04e 100644 --- a/Det/DetCond/src/RunStampCheck.cpp +++ b/Det/DetCond/src/RunStampCheck.cpp @@ -17,7 +17,7 @@ #include "GaudiKernel/Kernel.h" #include "GaudiKernel/Service.h" -#define ON_DEBUG if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) +#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) #define DEBUG_MSG ON_DEBUG debug() /** Simple service to check if the run stamp condition exists for the current @@ -53,24 +53,24 @@ public: /// Connect to the required services and register as BeginEvent listener. StatusCode start() override { StatusCode sc = Service::start(); - if ( UNLIKELY( !sc ) ) return sc; + if ( !sc ) return sc; // ensure that we have the EventClocksvc (to get the current event time in // the DetectorDataSvc). - if ( UNLIKELY( !serviceLocator()->service( "EventClockSvc" ) ) ) { + if ( !serviceLocator()->service( "EventClockSvc" ) ) { error() << "Cannot get EventClockSvc" << endmsg; return StatusCode::FAILURE; } m_incSvc = serviceLocator()->service( "IncidentSvc" ); - if ( UNLIKELY( !m_incSvc ) ) { + if ( !m_incSvc ) { error() << "Cannot get IncidentSvc" << endmsg; return StatusCode::FAILURE; } m_incSvc->addListener( this, IncidentType::RunChange ); m_fileAccess = serviceLocator()->service( "VFSSvc" ); - if ( UNLIKELY( !m_fileAccess ) ) { + if ( !m_fileAccess ) { error() << "Cannot get VFSSvc" << endmsg; return StatusCode::FAILURE; } @@ -92,7 +92,7 @@ public: DEBUG_MSG << "loaded " << m_validRuns.size() << " valid run numbers" << endmsg; m_evtProc = serviceLocator(); - if ( UNLIKELY( !m_evtProc ) ) { + if ( !m_evtProc ) { error() << "Cannot get IEventProcessor" << endmsg; return StatusCode::FAILURE; } diff --git a/Det/DetDesc/include/DetDesc/ConditionAccessor.h b/Det/DetDesc/include/DetDesc/ConditionAccessor.h index 4953eef6111924cd72c8aa43344a287b9bfc98e6..6e2794f29be66a155c2ce20605f4efd843bbf0c1 100644 --- a/Det/DetDesc/include/DetDesc/ConditionAccessor.h +++ b/Det/DetDesc/include/DetDesc/ConditionAccessor.h @@ -75,7 +75,7 @@ namespace LHCb::DetDesc { // Access the value of the condition, for a given condition context const T& get( const ConditionContext& /*ctx*/ ) const { - if ( UNLIKELY( !m_ptr ) ) { + if ( !m_ptr ) { throw GaudiException( "payload not present: " + m_key.toString(), "ConditionAccessor::get", StatusCode::FAILURE ); } @@ -84,7 +84,7 @@ namespace LHCb::DetDesc { } else { // unbox... using BoxedType = std::conditional_t<std::is_copy_constructible_v<T>, T, detail::CopyWrapper<T>>; const auto* p = std::any_cast<BoxedType>( &m_ptr->payload ); - if ( UNLIKELY( !p ) ) { + if ( !p ) { throw GaudiException{"Key='" + m_key + "' type mis-match. Found='" + System::typeinfoName( m_ptr->payload.type() ) + "' Expected='" + System::typeinfoName( typeid( BoxedType ) ) + "'", diff --git a/Det/DetDesc/include/DetDesc/GeometryInfoPlus.h b/Det/DetDesc/include/DetDesc/GeometryInfoPlus.h index 071fe7fa6c4766f3622fc57da2c345a56f39b660..5fe0f532c193a8f55874cf0f0f64ec775390953f 100644 --- a/Det/DetDesc/include/DetDesc/GeometryInfoPlus.h +++ b/Det/DetDesc/include/DetDesc/GeometryInfoPlus.h @@ -221,12 +221,12 @@ public: /// (reference to) container of children IGeometryInfo inline IGeometryInfo::IGIChildrens& childIGeometryInfos() override { - if ( UNLIKELY( !m_gi_childLoaded ) ) loadChildren().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); + if ( !m_gi_childLoaded ) loadChildren().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return m_gi_childrens; } /// (reference to) container of children IGeometryInfo inline const IGeometryInfo::IGIChildrens& childIGeometryInfos() const override { - if ( UNLIKELY( !m_gi_childLoaded ) ) loadChildren().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); + if ( !m_gi_childLoaded ) loadChildren().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return m_gi_childrens; } /// iterators for manipulation of daughter elements diff --git a/Det/DetDesc/include/DetDesc/IConditionDerivationMgr.h b/Det/DetDesc/include/DetDesc/IConditionDerivationMgr.h index cda455ef3e8c7a8281694a9177cfc6d651c74240..c84e697574e02c40b3a614030ce1aaff5abcedb4 100644 --- a/Det/DetDesc/include/DetDesc/IConditionDerivationMgr.h +++ b/Det/DetDesc/include/DetDesc/IConditionDerivationMgr.h @@ -106,11 +106,11 @@ namespace LHCb::DetDesc { inline decltype( auto ) castAndCheck( IN& in, ConditionKey const& key ) { if constexpr ( std::is_same_v<std::any, std::decay_t<IN>> ) { const auto* p = std::any_cast<OUT>( &in ); - if ( UNLIKELY( !p ) ) { throwTypeMismatch( in.type(), typeid( OUT ), key ); } + if ( !p ) { throwTypeMismatch( in.type(), typeid( OUT ), key ); } return *p; } else { const auto* p = dynamic_cast<OUT>( in ); - if ( UNLIKELY( !p ) ) { throwTypeMismatch( typeid( decltype( in ) ), typeid( OUT ), key ); } + if ( !p ) { throwTypeMismatch( typeid( decltype( in ) ), typeid( OUT ), key ); } return *p; } } @@ -118,7 +118,7 @@ namespace LHCb::DetDesc { template <typename Input> decltype( auto ) fetch_1( ConditionUpdateContext const& ctx, ConditionKey const& key ) { auto i = ctx.find( key ); - if ( UNLIKELY( i == ctx.end() ) ) { + if ( i == ctx.end() ) { throw GaudiException{"No object found at " + key, "addConditionDerivation", StatusCode::FAILURE}; } using Exp = std::decay_t<Input>; diff --git a/Det/DetDesc/include/DetDesc/SolidBoolean.h b/Det/DetDesc/include/DetDesc/SolidBoolean.h index d77c2b0a7b38c935d0463a04c4600a74c199806c..8a026ef81bd4e3b683c3f1a3d86fe92dcc30eacc 100644 --- a/Det/DetDesc/include/DetDesc/SolidBoolean.h +++ b/Det/DetDesc/include/DetDesc/SolidBoolean.h @@ -245,7 +245,7 @@ private: ticks.clear(); unsigned int ret = 0; // line with null direction vector is not able to intersect any solid - if ( LIKELY( Vector.mag2() > 0 ) ) { + if ( Vector.mag2() > 0 ) { // find intersection with main solid: first()->intersectionTicks( Point, Vector, ticks ); // find intersections with child solids: diff --git a/Det/DetDesc/include/DetDesc/SolidMath.h b/Det/DetDesc/include/DetDesc/SolidMath.h index 3d465eb5d21d1a3cf76e7d7734312794f947d4e0..6da021a394d586f8c03e22434c578e785f02d1fe 100644 --- a/Det/DetDesc/include/DetDesc/SolidMath.h +++ b/Det/DetDesc/include/DetDesc/SolidMath.h @@ -11,9 +11,8 @@ // ============================================================================ #pragma once // Include files -#include "GaudiKernel/Kernel.h" // (UN)LIKELY -#include <algorithm> // std::min, std::max -#include <cmath> // std::sqrt, std::sin, std::cos, std::fma, std::copysign +#include <algorithm> // std::min, std::max +#include <cmath> // std::sqrt, std::sin, std::cos, std::fma, std::copysign #include "DetDesc/ISolid.h" @@ -45,15 +44,15 @@ namespace SolidTicks { template <class OUTPUTTYPE> inline unsigned int SolveQuadraticEquation( double a, double b, double c, OUTPUTTYPE out ) noexcept( noexcept( *out++ ) ) { - if ( UNLIKELY( 0 == a ) ) { // it is indeed a linear equation: b*x + c = 0 - if ( UNLIKELY( 0 == b ) ) return 0; // RETURN !!! 1 solution! + if ( 0 == a ) { // it is indeed a linear equation: b*x + c = 0 + if ( 0 == b ) return 0; // RETURN !!! 1 solution! c /= -b; *out++ = c; - *out++ = c; // double the solutions - return 1; // RETURN !!! - } else if ( UNLIKELY( 0 == b ) ) { // simple case: a x^2 + c = 0 + *out++ = c; // double the solutions + return 1; // RETURN !!! + } else if ( 0 == b ) { // simple case: a x^2 + c = 0 c /= a; - if ( UNLIKELY( 0 < c ) ) return 0; // RETURN !!! (no solutions) + if ( 0 < c ) return 0; // RETURN !!! (no solutions) c = std::sqrt( -c ); *out++ = -c; *out++ = +c; @@ -69,7 +68,7 @@ namespace SolidTicks { dtmp += -4 * a * c; double d = dtmp; #endif - if ( UNLIKELY( 0 > d ) ) return 0; // RETURN !!! (no solutions) + if ( 0 > d ) return 0; // RETURN !!! (no solutions) // 1 or 2 solutions d = sqrt( d ); // avoid loss of significance diff --git a/Det/DetDesc/include/DetDesc/SolidPolyHedronHelper.h b/Det/DetDesc/include/DetDesc/SolidPolyHedronHelper.h index d9de1b6d8f1e775b90ccc90742e04ffc4388f314..4a7e1ffd72d32322164c773c799ad6ea2974e8e3 100644 --- a/Det/DetDesc/include/DetDesc/SolidPolyHedronHelper.h +++ b/Det/DetDesc/include/DetDesc/SolidPolyHedronHelper.h @@ -162,14 +162,14 @@ private: ticks.clear(); unsigned int ret = 0; // check for valid arguments - if ( LIKELY( 0 != Vector.mag2() ) ) { + if ( 0 != Vector.mag2() ) { // line touches the bounding sphere? - if ( LIKELY( crossBSphere( Point, Vector ) ) ) { + if ( crossBSphere( Point, Vector ) ) { // loop over all faces ticks.reserve( planes().size() ); for ( const auto& plane : planes() ) { const auto vn = Vector.Dot( plane.Normal() ); - if ( LIKELY( 0 != vn ) ) { ticks.emplace_back( -1.0 * ( plane.Distance( Point ) / vn ) ); } + if ( 0 != vn ) { ticks.emplace_back( -1.0 * ( plane.Distance( Point ) / vn ) ); } } ret = SolidTicks::RemoveAdjacentTicks( ticks, Point, Vector, *this ); } diff --git a/Det/DetDesc/include/DetDesc/SolidSphere.h b/Det/DetDesc/include/DetDesc/SolidSphere.h index 37150fb20ddbda4a07e0904074f5987c9cd4b77f..801e8ac090b1429bd57160ca1b929831f7540cae 100644 --- a/Det/DetDesc/include/DetDesc/SolidSphere.h +++ b/Det/DetDesc/include/DetDesc/SolidSphere.h @@ -315,7 +315,7 @@ inline bool SolidSphere::insideR( const aPoint& point ) const { template <class aPoint> inline bool SolidSphere::insidePhi( const aPoint& point ) const { bool rc = true; - if ( UNLIKELY( !noPhiGap() ) ) { + if ( !noPhiGap() ) { auto phi = point.phi(); // [-180,180] rc = ( startPhiAngle() <= phi && startPhiAngle() + deltaPhiAngle() >= phi ); if ( !rc ) { @@ -336,7 +336,7 @@ inline bool SolidSphere::insidePhi( const aPoint& point ) const { template <class aPoint> inline bool SolidSphere::insideTheta( const aPoint& point ) const { bool rc = true; - if ( UNLIKELY( !noThetaGap() ) ) { + if ( !noThetaGap() ) { const auto theta = point.theta(); rc = ( startThetaAngle() <= theta && startThetaAngle() + deltaThetaAngle() >= theta ); } diff --git a/Det/DetDesc/include/DetDesc/SolidTicks.h b/Det/DetDesc/include/DetDesc/SolidTicks.h index f04a32d2861155c9c480ef5c067e2b7ea1b5fc03..f98f1d35a6af9009e0e0745b197b384ccb1a2e28 100644 --- a/Det/DetDesc/include/DetDesc/SolidTicks.h +++ b/Det/DetDesc/include/DetDesc/SolidTicks.h @@ -176,7 +176,7 @@ namespace SolidTicks { unsigned int ret = 0; // valid arguments? - if ( UNLIKELY( tickMin >= tickMax ) ) { + if ( tickMin >= tickMax ) { ticks.clear(); } else { @@ -196,12 +196,12 @@ namespace SolidTicks { ret = ticks.size(); } else { // first tick - if ( LIKELY( ticks.front() != tickMin ) ) { + if ( ticks.front() != tickMin ) { const auto middle = 0.5 * ( tickMin + ticks.front() ); if ( solid.isInside( point + middle * vect ) ) { ticks.insert( ticks.begin(), tickMin ); } } // last tick - if ( LIKELY( ticks.back() != tickMax ) ) { + if ( ticks.back() != tickMax ) { const auto middle = 0.5 * ( ticks.back() + tickMax ); if ( solid.isInside( point + middle * vect ) ) { ticks.push_back( tickMax ); } } diff --git a/Det/DetDesc/src/Lib/GeometryInfoPlus.cpp b/Det/DetDesc/src/Lib/GeometryInfoPlus.cpp index d4ad2dfb6374f7da506e6c24f6743042544e9582..4ce48c35dd5e29807ac45456bbfda49a2013ffec 100644 --- a/Det/DetDesc/src/Lib/GeometryInfoPlus.cpp +++ b/Det/DetDesc/src/Lib/GeometryInfoPlus.cpp @@ -335,7 +335,7 @@ StatusCode GeometryInfoPlus::registerSupportGI() { //============================================================================= const Gaudi::Transform3D& GeometryInfoPlus::ownToLocalMatrixNominal() const { - if ( LIKELY( bool( m_localIdealMatrix ) ) ) { + if ( bool( m_localIdealMatrix ) ) { VERBO << "Ideal matrix for " << m_gi_supportNamePath << " already present" << endmsg; return *m_localIdealMatrix; } @@ -357,7 +357,7 @@ const Gaudi::Transform3D& GeometryInfoPlus::ownToLocalMatrixNominal() const { } //============================================================================= const Gaudi::Transform3D& GeometryInfoPlus::ownToNominalMatrix() const { - if ( UNLIKELY( !m_localDeltaMatrix ) ) + if ( !m_localDeltaMatrix ) m_localDeltaMatrix = ( this->hasAlignmentCondition() ? myAlignmentCondition()->toNominalMatrix() : Gaudi::Transform3D{} ); return *m_localDeltaMatrix; @@ -396,7 +396,7 @@ Gaudi::Transform3D GeometryInfoPlus::accumulateMatrices( const ILVolume::PVolume const ILVolume::ReplicaPath& GeometryInfoPlus::supportPath() const { VERBO << "supportPath is " << m_gi_supportName << endmsg; - if ( LIKELY( !m_gi_has_support || !m_gi_supportPath.empty() ) ) { return m_gi_supportPath; } + if ( !m_gi_has_support || !m_gi_supportPath.empty() ) { return m_gi_supportPath; } // try to extract the replica path from its name (parse the name path) if ( !m_gi_support ) { m_gi_support = geoByName( m_gi_supportName ); } diff --git a/Det/DetDesc/src/Lib/MagneticFieldGrid.cpp b/Det/DetDesc/src/Lib/MagneticFieldGrid.cpp index d564eaeb6d097ec788814b99968eecd51f15ff41..38da703f50da0315988deecec7c583a25755652e 100644 --- a/Det/DetDesc/src/Lib/MagneticFieldGrid.cpp +++ b/Det/DetDesc/src/Lib/MagneticFieldGrid.cpp @@ -32,9 +32,9 @@ namespace LHCb { const IndexType i = ( r.x() - m_min[0] ) * m_invDxyz[0] + 0.5f; const IndexType j = ( r.y() - m_min[1] ) * m_invDxyz[1] + 0.5f; const IndexType k = ( r.z() - m_min[2] ) * m_invDxyz[2] + 0.5f; - if ( LIKELY( i >= 0 && i < m_Nxyz[0] && // - j >= 0 && j < m_Nxyz[1] && // - k >= 0 && k < m_Nxyz[2] ) ) { + if ( i >= 0 && i < m_Nxyz[0] && // + j >= 0 && j < m_Nxyz[1] && // + k >= 0 && k < m_Nxyz[2] ) { const auto index = m_Nxyz[0] * ( m_Nxyz[1] * k + j ) + i; const auto vx = m_B[index][0] * scaleFactor(); const auto vy = m_B[index][1] * scaleFactor(); @@ -49,9 +49,9 @@ namespace LHCb { const IndexType i = ( r.x() - m_min[0] ) * m_invDxyz[0]; const IndexType j = ( r.y() - m_min[1] ) * m_invDxyz[1]; const IndexType k = ( r.z() - m_min[2] ) * m_invDxyz[2]; - if ( LIKELY( i >= 0 && i < m_Nxyz[0] && // - j >= 0 && j < m_Nxyz[1] && // - k >= 0 && k < m_Nxyz[2] ) ) { + if ( i >= 0 && i < m_Nxyz[0] && // + j >= 0 && j < m_Nxyz[1] && // + k >= 0 && k < m_Nxyz[2] ) { const auto ijk000 = ( m_Nxyz[0] * ( m_Nxyz[1] * k + j ) + i ); const auto dijk0 = 1; const auto dijk1 = m_Nxyz[0]; @@ -84,9 +84,9 @@ namespace LHCb { const auto _k = static_cast<IndexType>( abc2 ); // bounds check - if ( LIKELY( _i >= 0 && _i < m_Nxyz[0] - 1 && // - _j >= 0 && _j < m_Nxyz[1] - 1 && // - _k >= 0 && _k < m_Nxyz[2] - 1 ) ) { + if ( _i >= 0 && _i < m_Nxyz[0] - 1 && // + _j >= 0 && _j < m_Nxyz[1] - 1 && // + _k >= 0 && _k < m_Nxyz[2] - 1 ) { // auxiliary variables defined at the vertices of the cube that // contains the (x, y, z) point where the field is interpolated @@ -131,9 +131,9 @@ namespace LHCb { const auto j = static_cast<IndexType>( abc[1] ); const auto k = static_cast<IndexType>( abc[2] ); - if ( LIKELY( i >= 0 && i < m_Nxyz[0] - 1 && // - j >= 0 && j < m_Nxyz[1] - 1 && // - k >= 0 && k < m_Nxyz[2] - 1 ) ) { + if ( i >= 0 && i < m_Nxyz[0] - 1 && // + j >= 0 && j < m_Nxyz[1] - 1 && // + k >= 0 && k < m_Nxyz[2] - 1 ) { // auxiliary variables defined at the vertices of the cube that // contains the (x, y, z) point where the field is interpolated diff --git a/Det/DetDesc/src/Lib/Services.cpp b/Det/DetDesc/src/Lib/Services.cpp index a805a6cb9dd33f3188053ac8d413852a1d5782c8..027f4c27a7a0301c5eccd44e967e8893631ec063 100644 --- a/Det/DetDesc/src/Lib/Services.cpp +++ b/Det/DetDesc/src/Lib/Services.cpp @@ -39,7 +39,7 @@ namespace { */ SmartIF<ISvcLocator>& DetDesc::Services::svcLocator() const { /// Get the service if necessary - if ( UNLIKELY( !m_svcLocator ) ) { + if ( !m_svcLocator ) { std::lock_guard lock( s_svcLoc_mutex ); if ( !m_svcLocator ) m_svcLocator = Gaudi::svcLocator(); if ( !m_svcLocator ) { @@ -56,7 +56,7 @@ SmartIF<ISvcLocator>& DetDesc::Services::svcLocator() const { */ IDataProviderSvc* DetDesc::Services::detSvc() const { /// locate the service if necessary - if ( UNLIKELY( !m_detSvc ) ) { + if ( !m_detSvc ) { std::lock_guard lock( s_detsvc_mutex ); if ( !m_detSvc ) m_detSvc = svcLocator()->service( "DetectorDataSvc" ); if ( !m_detSvc ) { @@ -75,7 +75,7 @@ IDataProviderSvc* DetDesc::Services::detSvc() const { */ IMessageSvc* DetDesc::Services::msgSvc() const { // locate the service if necessary - if ( UNLIKELY( !m_msgSvc ) ) { + if ( !m_msgSvc ) { std::lock_guard lock( s_msgsvc_mutex ); if ( !m_msgSvc ) m_msgSvc = svcLocator()->service( "MessageSvc" ); if ( !m_msgSvc ) { @@ -93,7 +93,7 @@ IMessageSvc* DetDesc::Services::msgSvc() const { */ IUpdateManagerSvc* DetDesc::Services::updMgrSvc( bool create ) const { // locate the service if necessary - if ( UNLIKELY( !m_updMgrSvc ) ) { + if ( !m_updMgrSvc ) { std::lock_guard lock( s_updsvc_mutex ); if ( !m_updMgrSvc ) m_updMgrSvc = svcLocator()->service( "UpdateManagerSvc", create ); if ( !m_updMgrSvc ) @@ -109,7 +109,7 @@ IUpdateManagerSvc* DetDesc::Services::updMgrSvc( bool create ) const { DetDesc::ServicesPtr DetDesc::Services::services() { auto sp = s_services.lock(); - if ( UNLIKELY( !sp ) ) { + if ( !sp ) { std::lock_guard lock( s_mutex ); sp = s_services.lock(); if ( !sp ) { diff --git a/Det/DetDesc/src/Lib/SolidBoolean.cpp b/Det/DetDesc/src/Lib/SolidBoolean.cpp index 982eaf75c616985b3168d9a0d7d05cad812e633d..34f083663231c882917c2ebab048802d9a7bd473 100644 --- a/Det/DetDesc/src/Lib/SolidBoolean.cpp +++ b/Det/DetDesc/src/Lib/SolidBoolean.cpp @@ -110,9 +110,9 @@ StatusCode SolidBoolean::addChild( std::unique_ptr<ISolid> child, // StatusCode SolidBoolean::addChild( std::unique_ptr<ISolid> child, // const Gaudi::XYZPoint& position, // const Gaudi::Rotation3D& rotation ) { - if ( UNLIKELY( !child ) ) { return StatusCode::FAILURE; } + if ( !child ) { return StatusCode::FAILURE; } auto pChild = std::make_unique<SolidChild>( std::move( child ), position, rotation, "Child For " + name() ); - if ( UNLIKELY( !pChild ) ) { return StatusCode::FAILURE; } + if ( !pChild ) { return StatusCode::FAILURE; } m_sb_childrens.push_back( std::move( pChild ) ); checkTickContainerCapacity(); return StatusCode::SUCCESS; diff --git a/Det/DetDesc/src/Lib/SolidCons.cpp b/Det/DetDesc/src/Lib/SolidCons.cpp index 1f0c117884c3b2a365b983624462dc93c35cedf0..f526bf49b12e6ccda43bea64a28a8d7864962181 100644 --- a/Det/DetDesc/src/Lib/SolidCons.cpp +++ b/Det/DetDesc/src/Lib/SolidCons.cpp @@ -307,7 +307,7 @@ bool SolidCons::testForIntersectionImpl( const aPoint& Point, const aVector& Vec boost::container::static_vector<ISolid::Tick, 6> tmpticks; - if ( UNLIKELY( !noPhiGap() ) ) { + if ( !noPhiGap() ) { // intersect with phi planes tmpticks.clear(); SolidTicks::LineIntersectsThePhi( Point, Vector, startPhiAngle(), std::back_inserter( tmpticks ) ); @@ -334,7 +334,7 @@ bool SolidCons::testForIntersectionImpl( const aPoint& Point, const aVector& Vec SolidTicks::LineIntersectsTheCone( Point, Vector, outerRadiusAtMinusZ(), outerRadiusAtPlusZ(), -zHalfLength(), zHalfLength(), std::back_inserter( tmpticks ) ); // intersect with inner conical surface - if ( UNLIKELY( 0 < innerRadiusAtPlusZ() || 0 < innerRadiusAtMinusZ() ) ) { + if ( 0 < innerRadiusAtPlusZ() || 0 < innerRadiusAtMinusZ() ) { SolidTicks::LineIntersectsTheCone( Point, Vector, innerRadiusAtMinusZ(), innerRadiusAtPlusZ(), -zHalfLength(), zHalfLength(), std::back_inserter( tmpticks ) ); } @@ -422,7 +422,7 @@ unsigned int SolidCons::intersectionTicksImpl( const aPoint& Point, // } } - if ( UNLIKELY( !noPhiGap() ) ) { + if ( !noPhiGap() ) { // intersect with phi planes tmpticks.clear(); SolidTicks::LineIntersectsThePhi( Point, Vector, startPhiAngle(), std::back_inserter( tmpticks ) ); @@ -449,7 +449,7 @@ unsigned int SolidCons::intersectionTicksImpl( const aPoint& Point, // SolidTicks::LineIntersectsTheCone( Point, Vector, outerRadiusAtMinusZ(), outerRadiusAtPlusZ(), -zHalfLength(), zHalfLength(), std::back_inserter( tmpticks ) ); // intersect with inner conical surface - if ( UNLIKELY( 0 < innerRadiusAtPlusZ() || 0 < innerRadiusAtMinusZ() ) ) { + if ( 0 < innerRadiusAtPlusZ() || 0 < innerRadiusAtMinusZ() ) { SolidTicks::LineIntersectsTheCone( Point, Vector, innerRadiusAtMinusZ(), innerRadiusAtPlusZ(), -zHalfLength(), zHalfLength(), std::back_inserter( tmpticks ) ); } diff --git a/Det/DetDesc/src/Lib/SolidTubs.cpp b/Det/DetDesc/src/Lib/SolidTubs.cpp index 433be9f04fa0ecab206bc57130bc5161291f8d7f..1211167868b496c20937b60891a10cc974445750 100644 --- a/Det/DetDesc/src/Lib/SolidTubs.cpp +++ b/Det/DetDesc/src/Lib/SolidTubs.cpp @@ -264,11 +264,11 @@ unsigned int SolidTubs::intersectionTicksImpl( const aPoint& Point, // ticks.clear(); /// line with null direction vector is not able to intersect any solid. - if ( UNLIKELY( Vector.mag2() == 0 ) ) { return 0; } ///< RETURN! + if ( Vector.mag2() == 0 ) { return 0; } ///< RETURN! // need to optimize these // if( !crossBSphere ( point , vect ) ) { return 0 ; } - if ( UNLIKELY( !crossBCylinder( Point, Vector ) ) ) { return 0; } + if ( !crossBCylinder( Point, Vector ) ) { return 0; } // first the cylinders ISolid::Ticks tmpticks; @@ -307,7 +307,7 @@ unsigned int SolidTubs::intersectionTicksImpl( const aPoint& Point, // } } - if ( UNLIKELY( !noPhiGap() ) ) { + if ( !noPhiGap() ) { tmpticks.clear(); SolidTicks::LineIntersectsThePhi( Point, Vector, startPhiAngle(), std::back_inserter( tmpticks ) ); // if( deltaPhiAngle() != M_PI ) @@ -435,7 +435,7 @@ SolidTubs::intersectionTicksImpl( const aPoint& Point, // // don't call down to SolidBase because it performs more complicated // tick operations than we need unsigned int ret = 0; - if ( UNLIKELY( isOutBBox( Point, Vector, tickMin, tickMax ) ) ) { + if ( isOutBBox( Point, Vector, tickMin, tickMax ) ) { ticks.clear(); } else { SolidTubs::intersectionTicksImpl( Point, Vector, ticks ); diff --git a/Det/DetDesc/src/Lib/SolidUnion.cpp b/Det/DetDesc/src/Lib/SolidUnion.cpp index 3170a4cc154551dd93e3eac05090feb719a35ed0..dafc4262877d52d053e367d6bdc46eb5266ae713 100644 --- a/Det/DetDesc/src/Lib/SolidUnion.cpp +++ b/Det/DetDesc/src/Lib/SolidUnion.cpp @@ -35,7 +35,7 @@ // ============================================================================ SolidUnion::SolidUnion( const std::string& name, std::unique_ptr<ISolid> first ) : SolidBase( name ), SolidBoolean( name, std::move( first ) ) { - if ( UNLIKELY( !SolidBoolean::first() ) ) { throw SolidException( " SolidUnion:: ISolid* points to NULL!" ); } + if ( !SolidBoolean::first() ) { throw SolidException( " SolidUnion:: ISolid* points to NULL!" ); } createCoverTop(); } // ============================================================================ diff --git a/Det/DetDescCnv/include/DetDescCnv/XmlGenericCnv.h b/Det/DetDescCnv/include/DetDescCnv/XmlGenericCnv.h index 54ed7f9fb6a74feda899d80b20d742e828c001f2..1bdd84aa971dbef4e6ad9a6b9d4cd31d0f706194 100755 --- a/Det/DetDescCnv/include/DetDescCnv/XmlGenericCnv.h +++ b/Det/DetDescCnv/include/DetDescCnv/XmlGenericCnv.h @@ -97,7 +97,7 @@ public: * @return status depending on the completion of the call */ IXmlSvc* xmlSvc() const { - if ( UNLIKELY( !m_xmlSvc ) ) { + if ( !m_xmlSvc ) { auto self = const_cast<XmlGenericCnv*>( this ); self->m_xmlSvc = this->conversionSvc(); } diff --git a/Det/DetDescSvc/src/RunChangeHandlerSvc.h b/Det/DetDescSvc/src/RunChangeHandlerSvc.h index 1e9f8899c99b52691376af833a572f10053a8cd8..48bdbbe9768ee17378b0ced885b7aded782160bc 100644 --- a/Det/DetDescSvc/src/RunChangeHandlerSvc.h +++ b/Det/DetDescSvc/src/RunChangeHandlerSvc.h @@ -63,11 +63,9 @@ private: /// Helper function to retrieve a service and cache the pointer to it. template <class I> inline SmartIF<I>& getService( const std::string& name, SmartIF<I>& ptr ) const { - if ( UNLIKELY( !ptr ) ) { + if ( !ptr ) { ptr = serviceLocator()->service( name, true ); - if ( UNLIKELY( !ptr ) ) { - throw GaudiException( "Service [" + name + "] not found", this->name(), StatusCode::FAILURE ); - } + if ( !ptr ) { throw GaudiException( "Service [" + name + "] not found", this->name(), StatusCode::FAILURE ); } } return ptr; } diff --git a/Det/Magnet/src/MagFieldReader.cpp b/Det/Magnet/src/MagFieldReader.cpp index 7d72bab0a4af2764e8169661baf14ee9e487a8b2..c32333dada8289c267335a02efce84699c810cf3 100644 --- a/Det/Magnet/src/MagFieldReader.cpp +++ b/Det/Magnet/src/MagFieldReader.cpp @@ -85,7 +85,7 @@ StatusCode MagFieldReader::execute() { Gaudi::XYZPoint P02( 0.0, 0.0, z ); m_pIMF->fieldVector( P0, B ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Magnetic Field at (" << P0.x() << ", " << P0.y() << ", " << P0.z() << " ) = " << ( B.x() ) / Gaudi::Units::tesla << ", " << ( B.y() ) / Gaudi::Units::tesla << ", " << ( B.z() ) / Gaudi::Units::tesla << " Tesla " << endmsg; diff --git a/Det/Magnet/src/MagneticFieldGridReader.cpp b/Det/Magnet/src/MagneticFieldGridReader.cpp index 20e7ee02367ae94e4d65b8954b5945fce8b3a841..34f20b90288ac0b17160fd6c6cdaeaf8b4246418 100644 --- a/Det/Magnet/src/MagneticFieldGridReader.cpp +++ b/Det/Magnet/src/MagneticFieldGridReader.cpp @@ -141,7 +141,7 @@ void MagneticFieldGridReader::fillGridFromQuadrants( GridQuadrant* quadrants, LH } grid.m_min = {-( ( Nxquad - 1 ) * Dxyz[0] ), -( ( Nyquad - 1 ) * Dxyz[1] ), (float)quadrants[0].zOffset}; - if ( UNLIKELY( m_msg.level() <= MSG::DEBUG ) ) { + if ( m_msg.level() <= MSG::DEBUG ) { m_msg << MSG::DEBUG << "Field grid , nbins x,y,z : (" << grid.m_Nxyz[0] << "," << grid.m_Nxyz[1] << "," << grid.m_Nxyz[2] << ")" << std::endl << "dx, xmin, xmax: " diff --git a/Det/Magnet/src/MagneticFieldSvc.cpp b/Det/Magnet/src/MagneticFieldSvc.cpp index 5d0a44ffe098be98bf1de77fb1115c845b04b3c1..23ee9bdb26f93fc0714e9ecdc843c3ec19fee9c5 100644 --- a/Det/Magnet/src/MagneticFieldSvc.cpp +++ b/Det/Magnet/src/MagneticFieldSvc.cpp @@ -277,7 +277,7 @@ StatusCode MagneticFieldSvc::initializeWithoutCondDB() if ( m_forcedScaleFactor > 9998. ) { scaleFactor = 1.; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Scale factor set to default = " << scaleFactor << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Scale factor set to default = " << scaleFactor << endmsg; } m_magFieldGrid.setScaleFactor( scaleFactor ); @@ -292,7 +292,7 @@ StatusCode MagneticFieldSvc::initializeWithoutCondDB() StatusCode MagneticFieldSvc::i_updateConditions() //============================================================================= { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "updateConditions called" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "updateConditions called" << endmsg; if ( m_forcedToUseDownMap.value() && m_forcedToUseUpMap.value() ) warning() << "inconsistent settings, forced to use Down AND Uo map = " << endmsg; @@ -330,7 +330,7 @@ StatusCode MagneticFieldSvc::i_updateConditions() MagneticFieldGridReader reader( *msgSvc() ); sc = ( m_mapFileNames.size() == 1 ? reader.readDC06File( m_mapFileNames.value().front(), m_magFieldGrid ) : reader.readFiles( m_mapFileNames.value(), m_magFieldGrid ) ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Field map files updated: " << m_mapFileNames << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Field map files updated: " << m_mapFileNames << endmsg; } } diff --git a/Det/MuonDet/include/MuonDet/DeMuonChamber.h b/Det/MuonDet/include/MuonDet/DeMuonChamber.h index 3b5a1ea4a9082bafa2d635cdc0c15ccda0ffcd90..2001cd9d164121b88788d5ca9f0cd04365a58158 100644 --- a/Det/MuonDet/include/MuonDet/DeMuonChamber.h +++ b/Det/MuonDet/include/MuonDet/DeMuonChamber.h @@ -91,7 +91,7 @@ public: private: /// Access to Msgstream object inline MsgStream& msgStream() const { - if ( UNLIKELY( !m_msgStream ) ) m_msgStream.reset( new MsgStream( msgSvc(), name() ) ); + if ( !m_msgStream ) m_msgStream.reset( new MsgStream( msgSvc(), name() ) ); return *m_msgStream; } diff --git a/Det/MuonDet/include/MuonDet/DeMuonDetector.h b/Det/MuonDet/include/MuonDet/DeMuonDetector.h index 90bb535ebfb228fc43b64490e017676d8794c192..791e1bfa1f72cc74383b7eac13be7362b3f4bd9a 100644 --- a/Det/MuonDet/include/MuonDet/DeMuonDetector.h +++ b/Det/MuonDet/include/MuonDet/DeMuonDetector.h @@ -230,7 +230,7 @@ private: /// Access to Msgstream object inline MsgStream& msgStream() const { - if ( UNLIKELY( !m_msgStream ) ) m_msgStream.reset( new MsgStream( msgSvc(), name() ) ); + if ( !m_msgStream ) m_msgStream.reset( new MsgStream( msgSvc(), name() ) ); return *m_msgStream; } diff --git a/Det/MuonDet/include/MuonDet/DeMuonRegion.h b/Det/MuonDet/include/MuonDet/DeMuonRegion.h index 3a16094d283000b556cf9f5b70652b96c172b2b2..7f32427260d15f5cd069d27823341d2647ce2505 100644 --- a/Det/MuonDet/include/MuonDet/DeMuonRegion.h +++ b/Det/MuonDet/include/MuonDet/DeMuonRegion.h @@ -44,7 +44,7 @@ public: private: /// Access to Msgstream object inline MsgStream& msgStream() const { - if ( UNLIKELY( !m_msgStream ) ) m_msgStream.reset( new MsgStream( msgSvc(), name() ) ); + if ( !m_msgStream ) m_msgStream.reset( new MsgStream( msgSvc(), name() ) ); return *m_msgStream; } diff --git a/Det/MuonDet/include/MuonDet/MuonDAQHelper.h b/Det/MuonDet/include/MuonDet/MuonDAQHelper.h index 99a08b0b3c145566e38cffe1e91b51d07f3ec637..a25476bb7b6804e15923a02174669b607563bd73 100644 --- a/Det/MuonDet/include/MuonDet/MuonDAQHelper.h +++ b/Det/MuonDet/include/MuonDet/MuonDAQHelper.h @@ -130,7 +130,7 @@ public: private: /// Access to Msgstream object inline MsgStream& msgStream() const { - if ( UNLIKELY( !m_msgStream ) ) m_msgStream.reset( new MsgStream( m_msgSvc, "MuonDAQHelper" ) ); + if ( !m_msgStream ) m_msgStream.reset( new MsgStream( m_msgSvc, "MuonDAQHelper" ) ); return *m_msgStream; } diff --git a/Det/MuonDet/src/Lib/DeMuonChamber.cpp b/Det/MuonDet/src/Lib/DeMuonChamber.cpp index 77a30b8a44b97383ece7ed06d6a27e14161b9038..f3e7b1d7b3fc6e9d2263c3529429d63855a76382 100644 --- a/Det/MuonDet/src/Lib/DeMuonChamber.cpp +++ b/Det/MuonDet/src/Lib/DeMuonChamber.cpp @@ -64,7 +64,7 @@ StatusCode DeMuonChamber::initialize() { // for now with MWPCs and RPCs this is a good formula setGridName( m_chmbGrid ); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Initialising DeMuonChamber: " << name << " " << sta << " " << reg << " " << chm << endmsg; return sc; diff --git a/Det/MuonDet/src/Lib/DeMuonDetector.cpp b/Det/MuonDet/src/Lib/DeMuonDetector.cpp index 8ee3a58e7d5d8a8ad6209e034f5cfc45cc2971bf..09468bee2e5debf1cf0370ea7f94bee3f1068eb5 100644 --- a/Det/MuonDet/src/Lib/DeMuonDetector.cpp +++ b/Det/MuonDet/src/Lib/DeMuonDetector.cpp @@ -41,8 +41,7 @@ static constexpr const std::array<int, 4> MaxRegions = {12, 24, 48, 192}; // thi const CLID& DeMuonDetector::clID() const { return DeMuonDetector::classID(); } StatusCode DeMuonDetector::initialize() { - if ( UNLIKELY( msgStream().level() <= MSG::VERBOSE ) ) - msgStream() << MSG::VERBOSE << "Initializing the detector" << endmsg; + if ( msgStream().level() <= MSG::VERBOSE ) msgStream() << MSG::VERBOSE << "Initializing the detector" << endmsg; m_detSvc = this->dataSvc(); @@ -107,7 +106,7 @@ StatusCode DeMuonDetector::initialize() { // fill geo info fillGeoInfo(); fillGeoArray(); - if ( UNLIKELY( msgStream().level() <= MSG::VERBOSE ) ) + if ( msgStream().level() <= MSG::VERBOSE ) msgStream() << MSG::VERBOSE << " ecco qui 111 " << m_stationBox[0][0] << " " << m_stationBox[0][1] << " " << m_stationBox[0][2] << " " << m_stationBox[0][3] << " " << endmsg; @@ -234,7 +233,7 @@ StatusCode DeMuonDetector::Hit2ChamberNumber( Gaudi::XYZPoint myPoint, int stati } if ( !isIn ) { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Smart seek didn't work. Perform loop on all chambers :( !!! " << endmsg; int msta( 0 ), mreg( 0 ), mchm( 0 ); // Getting stations @@ -262,7 +261,7 @@ StatusCode DeMuonDetector::Hit2ChamberNumber( Gaudi::XYZPoint myPoint, int stati chamberNumber = pCh->chamberNumber(); // mchm; regNum = mreg; - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Hit found in chamber C: " << chamberNumber << " , R: " << regNum << " ,S: " << station << endmsg; return sc; @@ -447,7 +446,7 @@ DeMuonDetector::listOfPhysChannels( Gaudi::XYZPoint my_entry, Gaudi::XYZPoint my // if(!myGap) { if ( !isIn ) { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Could not find the gap. Returning a void list." << endmsg; m_hitNotInGap++; return tmpPair; @@ -1102,7 +1101,7 @@ void DeMuonDetector::fillGeoArray() { MuonLayout layoutInner = m_chamberLayout->layout( 0 ); MuonLayout layoutOuter = m_chamberLayout->layout( 3 ); int station = 0; - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) { + if ( msgStream().level() <= MSG::DEBUG ) { msgStream() << MSG::DEBUG << "layout inner " << layoutInner.xGrid() << " " << layoutInner.yGrid() << endmsg; msgStream() << MSG::DEBUG << "layout outer " << layoutOuter.xGrid() << " " << layoutOuter.yGrid() << endmsg; } @@ -1110,10 +1109,10 @@ void DeMuonDetector::fillGeoArray() { for ( itSt = this->childBegin(); itSt < this->childEnd(); itSt++ ) { // get the dimensions of the inner rectangular - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "DeMuonDetector::fillGeoArray station: " << station << endmsg; if ( testForFilter( *itSt ) == true ) continue; - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "DeMuonDetector::fillGeoArray station: " << station << endmsg; double minX = 100000; @@ -1233,7 +1232,7 @@ void DeMuonDetector::fillGeoArray() { m_stationBox[station][2] = maxX; m_stationBox[station][3] = maxY; - if ( UNLIKELY( msgStream().level() <= MSG::VERBOSE ) ) + if ( msgStream().level() <= MSG::VERBOSE ) msgStream() << MSG::VERBOSE << " station inner " << station << " " << m_stationBox[station][0] << " " << m_stationBox[station][1] << " station outer " << station << " " << m_stationBox[station][2] << " " << m_stationBox[station][3] << endmsg; diff --git a/Det/MuonDet/src/Lib/MuonChamberLayout.cpp b/Det/MuonDet/src/Lib/MuonChamberLayout.cpp index dd49a1080f214ce1917aac14f71603e6aab29795..3f1f38b9213fd962c3861b29607c845f4a93e813 100644 --- a/Det/MuonDet/src/Lib/MuonChamberLayout.cpp +++ b/Det/MuonDet/src/Lib/MuonChamberLayout.cpp @@ -315,7 +315,7 @@ void MuonChamberLayout::chamberXY( int sx, int sy, int shx, int shy, int reg, st } } else { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Chamber " << chN << " in R" << reg << " xIndex " << fx << " yIndex " << fy << " is not in TES/xml. " << endmsg; } @@ -328,7 +328,7 @@ int MuonChamberLayout::findRegion( int chamber ) const { if ( chamber < offset[reg] ) break; } if ( reg > 3 ) { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Region not found for chamber: " << chamber << ". Go back and check the code!" << endmsg; reg = -1; @@ -967,7 +967,7 @@ StatusCode MuonChamberLayout::getXYZChamberTile( const LHCb::MuonTileID& tile, d unsigned int station = tile.station(); unsigned int region = tile.region(); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " Get XYZ Chamber Tile " << chamberNum << " " << station << " " << region << endmsg; StatusCode sc = getXYZChamber( station, region, chamberNum, x, deltax, y, deltay, z, deltaz, toGlob ); @@ -1519,7 +1519,7 @@ void MuonChamberLayout::localToglobal( const IGeometryInfo* gInfo, const Gaudi:: auto cent_global = gInfo->toGlobal( cent ); auto corn_global = gInfo->toGlobal( corn ); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) { + if ( msgStream().level() <= MSG::DEBUG ) { msgStream() << MSG::DEBUG << "Local to Global: gCtr:: " << cent_global.x() << " " << cent_global.y() << " " << cent_global.z() << " ; gCrn:: " << corn_global.x() << " " << corn_global.y() << " " << corn_global.z() << endmsg; @@ -1573,8 +1573,7 @@ std::vector<unsigned int> MuonChamberLayout::Tile2ChamberNum( const LHCb::MuonTi fillChambersVector( this->dataSvc() ); msgStream() << MSG::INFO << " Called initialization " << endmsg; if ( 0 == m_logVertGridX.size() ) { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) - msgStream() << MSG::DEBUG << " Initialization failed!" << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " Initialization failed!" << endmsg; return m_chaVect; } } diff --git a/Det/MuonDet/src/Lib/MuonDAQHelper.cpp b/Det/MuonDet/src/Lib/MuonDAQHelper.cpp index 4f978a8bd63fd6142fdb1137a4373721eaaee987..67b5ad68ee8dd110cd109e3f8145af49fd18606a 100644 --- a/Det/MuonDet/src/Lib/MuonDAQHelper.cpp +++ b/Det/MuonDet/src/Lib/MuonDAQHelper.cpp @@ -241,7 +241,7 @@ StatusCode MuonDAQHelper::initDAQMaps() { // // TELL1 sanity checks // - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) msgStream() << MSG::DEBUG << "Initialize TELL1 " << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Initialize TELL1 " << endmsg; sc = initTELL1(); if ( sc.isFailure() ) { @@ -252,7 +252,7 @@ StatusCode MuonDAQHelper::initDAQMaps() { // // ODE sanity checks // - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) msgStream() << MSG::DEBUG << " Initialize ODE " << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " Initialize ODE " << endmsg; sc = initODE(); if ( sc.isFailure() ) { @@ -263,8 +263,7 @@ StatusCode MuonDAQHelper::initDAQMaps() { // // Ititialize TELL1/ODE maps // - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) - msgStream() << MSG::DEBUG << " Initialize TELL1/ODE maps " << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " Initialize TELL1/ODE maps " << endmsg; sc = initMaps(); if ( sc.isFailure() ) { @@ -290,8 +289,7 @@ StatusCode MuonDAQHelper::initDAQMaps() { return sc; } - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) - msgStream() << MSG::DEBUG << "Map initialization sucessful" << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Map initialization sucessful" << endmsg; return StatusCode::SUCCESS; } @@ -304,7 +302,7 @@ StatusCode MuonDAQHelper::initDAQMaps() { //------------------------------------------------------------------------ StatusCode MuonDAQHelper::initTELL1() { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Retrieve the number of TELL1s and perform a sanity check" << endmsg; m_TotTell1 = 0; // TELL1 counter @@ -316,7 +314,7 @@ StatusCode MuonDAQHelper::initTELL1() { std::string cablingPath = cablingBasePath + "Cabling"; // path to the Cabling Condition for station SmartDataPtr<MuonStationCabling> cabling( m_detSvc, cablingPath ); - if ( UNLIKELY( 0 == cabling ) ) { + if ( 0 == cabling ) { msgStream() << MSG::ERROR << cablingPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -329,12 +327,12 @@ StatusCode MuonDAQHelper::initTELL1() { } // end of loop over stations - if ( UNLIKELY( m_TotTell1 > MuonDAQHelper_maxTell1Number ) ) { + if ( m_TotTell1 > MuonDAQHelper_maxTell1Number ) { msgStream() << MSG::ERROR << "Number of retrieved TELL1 in CondDB exceeds max allowed in software " << endmsg; return StatusCode::FAILURE; } - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Number of retrieved TELL1 in CondDB: " << m_TotTell1 << endmsg; return StatusCode::SUCCESS; @@ -348,7 +346,7 @@ StatusCode MuonDAQHelper::initTELL1() { //------------------------------------------------------------------------ StatusCode MuonDAQHelper::initODE() { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " Retrieve the ODEs connected to each TELL1" << endmsg; unsigned int ODECounter = 0; @@ -360,7 +358,7 @@ StatusCode MuonDAQHelper::initODE() { std::string cablingPath = cablingBasePath + "Cabling"; SmartDataPtr<MuonStationCabling> cabling( m_detSvc, cablingPath ); - if ( UNLIKELY( 0 == cabling ) ) { + if ( 0 == cabling ) { msgStream() << MSG::ERROR << cablingPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -372,7 +370,7 @@ StatusCode MuonDAQHelper::initODE() { // parse the xml file and load the parameters SmartDataPtr<MuonL1Board> l1( m_detSvc, L1Path ); - if ( UNLIKELY( 0 == l1 ) ) { + if ( 0 == l1 ) { msgStream() << MSG::ERROR << L1Path << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -382,13 +380,13 @@ StatusCode MuonDAQHelper::initODE() { } // end of loop over TELL1s } // end of loop over stations - if ( UNLIKELY( ODECounter > MuonDAQHelper_maxODENumber ) ) { + if ( ODECounter > MuonDAQHelper_maxODENumber ) { msgStream() << MSG::ERROR << " Number of retrieved ODEs in CondDB exceeds max allowed in software: " << ODECounter << endmsg; return StatusCode::FAILURE; } - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Number of retrieved ODEs in CondDB: " << ODECounter << endmsg; return StatusCode::SUCCESS; @@ -402,8 +400,7 @@ StatusCode MuonDAQHelper::initODE() { //------------------------------------------------------------------------ StatusCode MuonDAQHelper::initMaps() { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) - msgStream() << MSG::DEBUG << "Load TELL1/ODE mapping parameters " << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Load TELL1/ODE mapping parameters " << endmsg; int Tell1Number = 0; // this is a progressive number for ( int station = 0; station < m_nStations; station++ ) { @@ -412,7 +409,7 @@ StatusCode MuonDAQHelper::initMaps() { std::string cablingPath = cablingBasePath + "Cabling"; SmartDataPtr<MuonStationCabling> cabling( m_detSvc, cablingPath ); - if ( UNLIKELY( 0 == cabling ) ) { + if ( 0 == cabling ) { msgStream() << MSG::ERROR << cablingPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -422,7 +419,7 @@ StatusCode MuonDAQHelper::initMaps() { std::string L1Path = cablingBasePath + cabling->getL1Name( L1Board ); SmartDataPtr<MuonL1Board> l1( m_detSvc, L1Path ); - if ( UNLIKELY( 0 == l1 ) ) { + if ( 0 == l1 ) { msgStream() << MSG::ERROR << L1Path << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -433,7 +430,7 @@ StatusCode MuonDAQHelper::initMaps() { for ( unsigned int i = 0; i < MuonDAQHelper_linkNumber; i++ ) { // loop over TELL1 inputs // - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " TELL1 Optical Link: " << i << " is connected to ODE: " << l1->getLinkConnection( i ) << endmsg; // @@ -454,7 +451,7 @@ StatusCode MuonDAQHelper::initMaps() { std::string ODEPath = cablingBasePath + l1->getODEName( ODEBoard ); SmartDataPtr<MuonODEBoard> ode( m_detSvc, ODEPath ); - if ( UNLIKELY( 0 == ode ) ) { + if ( 0 == ode ) { msgStream() << MSG::ERROR << ODEPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -474,7 +471,7 @@ StatusCode MuonDAQHelper::initMaps() { std::string TSPath = cablingBasePath + ode->getTSName( TS ); SmartDataPtr<MuonTSMap> TSMap( m_detSvc, TSPath ); - if ( UNLIKELY( 0 == TSMap ) ) { + if ( 0 == TSMap ) { msgStream() << MSG::ERROR << TSPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -488,7 +485,7 @@ StatusCode MuonDAQHelper::initMaps() { int iOdeChan = 0; for ( int isynch = 0; isynch < TSMap->synchChSize(); isynch++ ) { - if ( UNLIKELY( msgStream().level() <= MSG::VERBOSE ) ) + if ( msgStream().level() <= MSG::VERBOSE ) msgStream() << MSG::VERBOSE << " SYNC channel " << isynch << " is used/unused (1/0): " << TSMap->synchChUsed( isynch ) << endmsg; @@ -561,7 +558,7 @@ StatusCode MuonDAQHelper::initLUTCrossing() std::string L1Path = cablingBasePath + cabling->getL1Name(L1Board); SmartDataPtr<MuonL1Board> l1(m_detSvc,L1Path); - if( UNLIKELY( 0 == l1) ) { + if( 0 == l1 ) { msgStream()<<MSG::ERROR << L1Path << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -571,7 +568,7 @@ StatusCode MuonDAQHelper::initLUTCrossing() std::string ODEPath=cablingBasePath + l1->getODEName(ODEBoard); SmartDataPtr<MuonODEBoard> ode(m_detSvc,ODEPath); - if( UNLIKELY( 0 == ode) ) { + if( 0 == ode ) { msgStream()<<MSG::ERROR << ODEPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -659,7 +656,7 @@ StatusCode MuonDAQHelper::initReverseMaps() { std::string cablingPath = cablingBasePath + "Cabling"; SmartDataPtr<MuonStationCabling> cabling( m_detSvc, cablingPath ); - if ( UNLIKELY( 0 == cabling ) ) { + if ( 0 == cabling ) { msgStream() << MSG::ERROR << cablingPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -669,7 +666,7 @@ StatusCode MuonDAQHelper::initReverseMaps() { std::string L1Path = cablingBasePath + cabling->getL1Name( L1Board ); SmartDataPtr<MuonL1Board> l1( m_detSvc, L1Path ); - if ( UNLIKELY( 0 == l1 ) ) { + if ( 0 == l1 ) { msgStream() << MSG::ERROR << L1Path << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -678,7 +675,7 @@ StatusCode MuonDAQHelper::initReverseMaps() { std::string ODEPath = cablingBasePath + l1->getODEName( ODEBoard ); SmartDataPtr<MuonODEBoard> ode( m_detSvc, ODEPath ); - if ( UNLIKELY( 0 == ode ) ) { + if ( 0 == ode ) { msgStream() << MSG::ERROR << ODEPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -706,7 +703,7 @@ StatusCode MuonDAQHelper::initReverseMaps() { std::string L1Path = m_L1Name[index]; SmartDataPtr<MuonL1Board> l1( m_detSvc, L1Path ); - if ( UNLIKELY( 0 == l1 ) ) { + if ( 0 == l1 ) { msgStream() << MSG::ERROR << L1Path << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -716,7 +713,7 @@ StatusCode MuonDAQHelper::initReverseMaps() { std::string ODEPath = cablingBasePath + l1->getODEName( ODEBoard ); SmartDataPtr<MuonODEBoard> ode( m_detSvc, ODEPath ); - if ( UNLIKELY( 0 == ode ) ) { + if ( 0 == ode ) { msgStream() << MSG::ERROR << ODEPath << " not found in XmlDDDB" << endmsg; return StatusCode::FAILURE; } @@ -854,7 +851,7 @@ std::vector<LHCb::MuonTileID> MuonDAQHelper::DoPadV1( std::vector<LHCb::MuonTile if ( m_basegeometry->getStationName( station ) == "M4" && region == 0 ) wrongFirmware = true; if ( m_basegeometry->getStationName( station ) == "M5" && region == 0 ) wrongFirmware = true; - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "Station/Region with wrong firmware: " << station << " " << region << " " << wrongFirmware << endmsg; @@ -895,12 +892,12 @@ std::vector<LHCb::MuonTileID> MuonDAQHelper::DoPadV1( std::vector<LHCb::MuonTile } std::stable_sort( doubleList.begin(), doubleList.end(), SortPairTileInTU() ); list_of_pads.clear(); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) msgStream() << MSG::DEBUG << " after reordering " << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " after reordering " << endmsg; std::vector<std::pair<LHCb::MuonTileID, LHCb::MuonTileID>>::iterator iPair; for ( iPair = doubleList.begin(); iPair != doubleList.end(); iPair++ ) { std::pair<LHCb::MuonTileID, LHCb::MuonTileID> tilePair = *iPair; - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) msgStream() << MSG::DEBUG << tilePair.second << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << tilePair.second << endmsg; list_of_pads.push_back( tilePair.second ); } @@ -1117,7 +1114,7 @@ long MuonDAQHelper::channelsInL1BeforeODE( std::string L1Path, long ODENumber, b SmartDataPtr<MuonL1Board> l1( m_detSvc, L1Path ); // long station=l1->getStation(); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << L1Path << " " << ODENumber << " " << hole << endmsg; return 192 * ( findODEPosition( L1Path, ODENumber, hole ) ); @@ -1130,19 +1127,18 @@ unsigned int MuonDAQHelper::DAQaddressInL1( LHCb::MuonTileID digitTile, long& L1 std::string L1Path = findL1( digitTile ); // unsigned int ODEPos=findODEPosition(L1Path,ODENumber,hole); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " check " << hole << " " << L1Path << " " << ODENumber << endmsg; unsigned int chToAdd = channelsInL1BeforeODE( L1Path, ODENumber, false ); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) - msgStream() << MSG::DEBUG << " ch add " << chToAdd + ODEAdd << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " ch add " << chToAdd + ODEAdd << endmsg; return chToAdd + ODEAdd; } unsigned int MuonDAQHelper::DAQaddressInODE( LHCb::MuonTileID digitTile, long& L1Number, long& ODENumber, bool hole ) { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << "************** start coding a digit " << endmsg; bool print = false; @@ -1186,7 +1182,7 @@ std::vector<unsigned int> MuonDAQHelper::padsinTS( std::vector<unsigned int>& TS std::vector<unsigned int> list_of_pads; // maxPads=0; SmartDataPtr<MuonTSMap> TS( m_detSvc, TSPath ); - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) { + if ( msgStream().level() <= MSG::DEBUG ) { msgStream() << MSG::DEBUG << "----- start a trigger sector cross ---------" << endmsg; msgStream() << MSG::DEBUG << TSPath << " " << TS->numberOfOutputSignal() << endmsg; msgStream() << MSG::DEBUG << " seq "; @@ -1226,13 +1222,13 @@ std::vector<unsigned int> MuonDAQHelper::padsinTS( std::vector<unsigned int>& TS hvert[Msub].emplace_back( tile ); // debug()<<" horizontal ? "<< horizontal<<endmsg; } - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) msgStream() << MSG::DEBUG << " after h/v " << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " after h/v " << endmsg; // now the address of fired pads.. for ( int i = 0; i < Nsub; i++ ) { // cross only local to each sub matrix // debug - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) msgStream() << MSG::DEBUG << " sub matrix " << i << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " sub matrix " << i << endmsg; // debug()<<" horizontal sequence "; // for(itx=horiz[i].begin(); @@ -1295,7 +1291,7 @@ StatusCode MuonDAQHelper::checkMapConsistency() { int num_lay = layout[station * 4 + region]; for ( int ilay = 0; ilay < num_lay; ilay++ ) { MuonLayout lay( m_layoutX[ilay][station * 4 + region], m_layoutY[ilay][station * 4 + region] ); - if ( UNLIKELY( msgStream().level() <= MSG::VERBOSE ) ) + if ( msgStream().level() <= MSG::VERBOSE ) msgStream() << MSG::VERBOSE << num_lay << " " << lay << " " << station << " " << region << endmsg; for ( int quadrant = 0; quadrant < 4; quadrant++ ) { @@ -1305,7 +1301,7 @@ StatusCode MuonDAQHelper::checkMapConsistency() { MuonTileID muontile2( station, lay, region, quadrant, x, y + m_layoutY[ilay][station * 4 + region] ); MuonTileID muontile3( station, lay, region, quadrant, x + m_layoutX[ilay][station * 4 + region], y + m_layoutY[ilay][station * 4 + region] ); - if ( UNLIKELY( msgStream().level() <= MSG::VERBOSE ) ) + if ( msgStream().level() <= MSG::VERBOSE ) msgStream() << MSG::VERBOSE << muontile1 << " " << muontile2 << " " << muontile3 << endmsg; long L1Number = 0; @@ -1601,7 +1597,7 @@ LHCb::MuonTileID MuonDAQHelper::getPadTileInODE( std::string ODEName, int firstC region--; station--; quadrant--; - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " debug " << station << " " << region << " " << quadrant << endmsg; int odeStart = m_ODENameStart[station][region][quadrant]; @@ -1612,15 +1608,14 @@ LHCb::MuonTileID MuonDAQHelper::getPadTileInODE( std::string ODEName, int firstC int odeNumber = -1; for ( int ode = odeStart + 1; ode < odeEnd + 1; ode++ ) { - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << ODEName << " debug ode " << m_ODENameInECS[ode] << endmsg; if ( m_ODENameInECS[ode] == ODEName ) { odeNumber = ode; break; } } - if ( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) - msgStream() << MSG::DEBUG << " debug ode " << odeNumber << endmsg; + if ( msgStream().level() <= MSG::DEBUG ) msgStream() << MSG::DEBUG << " debug ode " << odeNumber << endmsg; MuonTileID firstTile; firstTile = m_mapTileInODE[odeNumber - 1][firstChannel]; @@ -1637,7 +1632,7 @@ StatusCode MuonDAQHelper::initODEMaps() unsigned int countL1=0; for(int station = 0; station < m_nStations;station++){ - if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<"station number "<<station<<endmsg; std::string cablingBasePath=getBasePath(station); @@ -1649,12 +1644,12 @@ StatusCode MuonDAQHelper::initODEMaps() return StatusCode::FAILURE; } - if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<" station "<<station<<endmsg; for(int L1Board=0;L1Board<cabling->getNumberOfL1Board();L1Board++){ - if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<"L1 number "<<cabling->getL1Name(0)<<endmsg; std::string L1Path=cablingBasePath+cabling->getL1Name(L1Board); @@ -1665,7 +1660,7 @@ StatusCode MuonDAQHelper::initODEMaps() for(int ODEBoard=0;ODEBoard<l1->numberOfODE();ODEBoard++){ std::string ODEPath=cablingBasePath+l1->getODEName(ODEBoard); - if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<"ODE number "<<L1Board<< " "<<l1->getODEName(ODEBoard)<<endmsg; SmartDataPtr<MuonODEBoard> ode(m_detSvc,ODEPath); @@ -1710,7 +1705,7 @@ StatusCode MuonDAQHelper::initODEMaps() MuonTileID muontile(station,lay,region, quadrant,digitX,digitY); m_mapTileInODE[odenum-1].push_back(muontile); - if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<m_mapTileInODE[odenum-1].size()<<" "<< muontile<<endmsg; @@ -1724,7 +1719,7 @@ StatusCode MuonDAQHelper::initODEMaps() } } m_ODENumberInTell1[countL1]=totODE; - if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) + if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<" number "<<countL1<<" "<<totODE<<endmsg; countL1++; @@ -1775,13 +1770,13 @@ StatusCode MuonDAQHelper::initODENames() // sc=initODEMaps(); // inutile, mergiata con la precedente /* -if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) +if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<" step 6 "<<endmsg; if(sc.isFailure())return sc; */ /* inutile, incorporata nella precedente sc=initODENames(); -if( UNLIKELY( msgStream().level() <= MSG::DEBUG ) ) +if( msgStream().level() <= MSG::DEBUG ) msgStream()<<MSG::DEBUG<<" step odename "<<endmsg; if(sc.isFailure())return sc; */ diff --git a/Det/MuonDet/src/component/XmlMuonCablingCnv.cpp b/Det/MuonDet/src/component/XmlMuonCablingCnv.cpp index 185ccaeb5c3519a8886fc93cb814b6e57713fded..d94316f9fc0ca22ad099fb0884d62555ac59e547 100644 --- a/Det/MuonDet/src/component/XmlMuonCablingCnv.cpp +++ b/Det/MuonDet/src/component/XmlMuonCablingCnv.cpp @@ -86,7 +86,7 @@ DECLARE_CONVERTER( XmlMuonCablingCnv ) //============================================================================= XmlMuonCablingCnv::XmlMuonCablingCnv( ISvcLocator* svc ) : XmlUserConditionCnv<MuonStationCabling>( svc ) { MsgStream msg( msgSvc(), "XmlMuonCablingCnv" ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) msg << MSG::VERBOSE << " start muon cabling" << endmsg; + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << " start muon cabling" << endmsg; CablingString = xercesc::XMLString::transcode( "MuonStationCabling" ); SupportString = xercesc::XMLString::transcode( "SupportPath" ); @@ -129,7 +129,7 @@ StatusCode XmlMuonCablingCnv::i_fillSpecificObj( xercesc::DOMElement* childEleme long l1NumberValue = atol( l1NumberString.c_str() ); StatusCode sc = dataObj->update( l1NumberValue ); if ( sc.isFailure() ) return sc; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << " number of L1 " << l1NumberValue << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << " number of L1 " << l1NumberValue << endmsg; xercesc::DOMNodeList* nodeChildren = childElement->getChildNodes(); unsigned int i; for ( i = 0; i < nodeChildren->getLength(); ++i ) { @@ -141,7 +141,7 @@ StatusCode XmlMuonCablingCnv::i_fillSpecificObj( xercesc::DOMElement* childEleme // std::string entryName = "/" + L1Reference.substr(poundPosition + 1); sc = dataObj->addL1Name( L1Reference.substr( poundPosition + 1 ) ); if ( sc.isFailure() ) return sc; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "name of L1 " << L1Reference.substr( poundPosition + 1 ) << endmsg; } } diff --git a/Det/MuonDet/src/component/XmlMuonL1BoardCnv.cpp b/Det/MuonDet/src/component/XmlMuonL1BoardCnv.cpp index 539d646863a0d3bd398768c5fa89b533004fb134..e15cb8adc8e845f79052bc00d2fec36588c61e6a 100644 --- a/Det/MuonDet/src/component/XmlMuonL1BoardCnv.cpp +++ b/Det/MuonDet/src/component/XmlMuonL1BoardCnv.cpp @@ -147,13 +147,13 @@ StatusCode XmlMuonL1BoardCnv::i_fillSpecificObj( xercesc::DOMElement* childEleme std::vector<long> ODEListValue; StatusCode sc = splitList( ODEList, ODEListValue ); if ( sc.isFailure() ) return sc; - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) msg << MSG::DEBUG << " read in " << ODEList << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << " read in " << ODEList << endmsg; if ( ODEListValue.size() != NumLink ) { msg << MSG::ERROR << " something wrong in Tell1 - ODE connectiom description " << endmsg; return StatusCode::FAILURE; } for ( unsigned int i = 0; i < NumLink; i++ ) { - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) { + if ( msg.level() <= MSG::DEBUG ) { msg << MSG::DEBUG << " link " << i << " ODE " << ODEListValue[i] << endmsg; msg << MSG::DEBUG << " ODEList length " << ODEList.size() << " " << ODEListValue.size() << endmsg; } @@ -169,11 +169,11 @@ StatusCode XmlMuonL1BoardCnv::i_fillSpecificObj( xercesc::DOMElement* childEleme unsigned int iODE = 0; for ( unsigned int i = 0; i < nodeChildren->getLength(); ++i ) { - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Processing child " << dom2Std( nodeChildren->item( i )->getNodeName() ) << endmsg; if ( dom2Std( nodeChildren->item( i )->getNodeName() ) == dom2Std( ODEReferenceString ) ) { - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Processing element " << dom2Std( ODEReferenceString ) << " " << iODE << endmsg; xercesc::DOMNamedNodeMap* attributes = nodeChildren->item( i )->getAttributes(); xercesc::DOMNode* odeNode = attributes->getNamedItem( ODEConditionString ); @@ -191,14 +191,14 @@ StatusCode XmlMuonL1BoardCnv::i_fillSpecificObj( xercesc::DOMElement* childEleme // << OdeReference << " "<<entryName<< " "<<location // <<" "<<location1<<" "<<dataObj->name()<<endmsg; dataObj->addODE( ODEListValue[iODE], OdeReference.substr( poundPosition + 1 ) ); - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << ODEListValue[iODE] << " " << OdeReference.substr( poundPosition + 1 ) << endmsg; iODE++; } else if ( dom2Std( nodeChildren->item( i )->getNodeName() ) == dom2Std( TSLayoutString ) ) { - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "Processing element " << dom2Std( TSLayoutString ) << endmsg; xercesc::DOMNamedNodeMap* attributes = nodeChildren->item( i )->getAttributes(); @@ -211,7 +211,7 @@ StatusCode XmlMuonL1BoardCnv::i_fillSpecificObj( xercesc::DOMElement* childEleme xercesc::DOMNode* TSLayoutYNode = attributes->getNamedItem( TSLayoutYString ); long TSYValue = atol( dom2Std( TSLayoutYNode->getNodeValue() ).c_str() ); ; - if ( UNLIKELY( msg.level() <= MSG::VERBOSE ) ) + if ( msg.level() <= MSG::VERBOSE ) msg << MSG::VERBOSE << "layout " << TSXValue << " " << TSYValue << " " << TSRegionValue << endmsg; dataObj->addLayout( TSRegionValue, TSXValue, TSYValue ); } diff --git a/Det/MuonDet/src/component/XmlMuonReadoutCondCnv.cpp b/Det/MuonDet/src/component/XmlMuonReadoutCondCnv.cpp index a41487cd83400745f240f73805ff0a7a7d249f93..b49f0cad3f73352cd38dba53b14776f771aacf5d 100644 --- a/Det/MuonDet/src/component/XmlMuonReadoutCondCnv.cpp +++ b/Det/MuonDet/src/component/XmlMuonReadoutCondCnv.cpp @@ -152,8 +152,7 @@ StatusCode XmlMuonReadoutCondCnv::i_fillSpecificObj( xercesc::DOMElement* childE // gets the element's name const XMLCh* tagName = childElement->getNodeName(); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) - log << MSG::DEBUG << "Processing element " << dom2Std( tagName ) << endmsg; + if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Processing element " << dom2Std( tagName ) << endmsg; /* <!-- ReadoutType : either Anode or Cathode (must be defined) @@ -224,7 +223,7 @@ StatusCode XmlMuonReadoutCondCnv::i_fillSpecificObj( xercesc::DOMElement* childE return StatusCode::FAILURE; } - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) { + if ( log.level() <= MSG::DEBUG ) { log << MSG::DEBUG << "ReadoutType " << rType << endmsg; log << MSG::DEBUG << "Efficiency " << eff << endmsg; } @@ -234,7 +233,7 @@ StatusCode XmlMuonReadoutCondCnv::i_fillSpecificObj( xercesc::DOMElement* childE StatusCode sc = dataObj->addReadout( rType, index ); if ( sc.isFailure() ) { log << MSG::WARNING << "Failed to create a new readout" << endmsg; } - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) log << MSG::DEBUG << "Readout index is :" << index << endmsg; + if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Readout index is :" << index << endmsg; dataObj->setEfficiency( atof( eff.c_str() ), index ); dataObj->setSyncDrift( atof( syncD.c_str() ), index ); @@ -269,7 +268,7 @@ StatusCode XmlMuonReadoutCondCnv::setClusterSizes( MuonReadoutCond* dataObj, con // need to split clSzX and clPrX into component parts // should be a comma seperated list - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) { + if ( log.level() <= MSG::DEBUG ) { log << MSG::DEBUG << "Cluster size (X) " << clSzX << endmsg; log << MSG::DEBUG << "Cluster Prob (X) " << clPrX << endmsg; } @@ -302,14 +301,13 @@ StatusCode XmlMuonReadoutCondCnv::setClusterSizes( MuonReadoutCond* dataObj, con unsigned int i; for ( i = 0; i < clProb.size(); ++i ) { dataObj->addClusterX( clSize[i], clProb[i], index ); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) - log << MSG::DEBUG << "Clusters (X) " << clSize[i] << "," << clProb[i] << endmsg; + if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Clusters (X) " << clSize[i] << "," << clProb[i] << endmsg; } clSize.clear(); clProb.clear(); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) { + if ( log.level() <= MSG::DEBUG ) { log << MSG::DEBUG << "Cluster size (Y) " << clSzY << endmsg; log << MSG::DEBUG << "Cluster Prob (Y) " << clPrY << endmsg; } @@ -338,8 +336,7 @@ StatusCode XmlMuonReadoutCondCnv::setClusterSizes( MuonReadoutCond* dataObj, con } for ( i = 0; i < clProb.size(); ++i ) { dataObj->addClusterY( clSize[i], clProb[i], index ); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) - log << MSG::DEBUG << "Clusters (Y) " << clSize[i] << "," << clProb[i] << endmsg; + if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Clusters (Y) " << clSize[i] << "," << clProb[i] << endmsg; } return StatusCode::SUCCESS; } @@ -352,7 +349,7 @@ StatusCode XmlMuonReadoutCondCnv::setJitterVector( MuonReadoutCond* dataObj, con // need to split clSzX and clPrX into component parts // should be a comma seperated list - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) { + if ( log.level() <= MSG::DEBUG ) { log << MSG::DEBUG << "Jitter Min " << jitterMin << endmsg; log << MSG::DEBUG << "jitter Max " << jitterMax << endmsg; } diff --git a/Det/RichDet/include/RichDet/DeRichBase.h b/Det/RichDet/include/RichDet/DeRichBase.h index 5f7e9b58fa89e5e3ab8563c4b007075917e9bbdb..39fd8fa757cf06a7d3d125831266a27d6d791d2e 100644 --- a/Det/RichDet/include/RichDet/DeRichBase.h +++ b/Det/RichDet/include/RichDet/DeRichBase.h @@ -122,12 +122,10 @@ protected: inline MSG::Level msgLevel() const { return msgStream().level(); } /// Test the message level for the cached MsgStream object - inline bool msgLevel( const MSG::Level level ) const { return UNLIKELY( msgLevel() <= level ); } + inline bool msgLevel( const MSG::Level level ) const { return msgLevel() <= level; } /// Test the message level for a given MsgStream object - inline bool msgLevel( const MSG::Level level, MsgStream& msgStream ) const { - return UNLIKELY( msgStream.level() <= level ); - } + inline bool msgLevel( const MSG::Level level, MsgStream& msgStream ) const { return msgStream.level() <= level; } /// Report a fatal inline StatusCode Fatal( const std::string& mess, const StatusCode sc = StatusCode::FAILURE ) const { diff --git a/Det/RichDet/include/RichDet/DeRichBeamPipe.h b/Det/RichDet/include/RichDet/DeRichBeamPipe.h index 4a59f673734b64fb9e8444f87a202b1faf64f595..02c0b8313ec11c8605ceb5060b869d1bf7aab84e 100644 --- a/Det/RichDet/include/RichDet/DeRichBeamPipe.h +++ b/Det/RichDet/include/RichDet/DeRichBeamPipe.h @@ -129,7 +129,7 @@ public: auto inter = isCloseBy( start, end ); // If close enough, run full test - if ( UNLIKELY( inter ) ) { + if ( inter ) { // get point and direction in local coordinates const auto pLocal = geometry()->toLocalMatrix() * start; const auto vLocal = geometry()->toLocalMatrix() * ( end - start ); @@ -167,7 +167,7 @@ public: mask &= isCloseBy( start, end ); // If close enough, run full test - if ( UNLIKELY( any_of( mask ) ) ) { + if ( any_of( mask ) ) { // get point and direction in local coordinates const auto pL = m_toLocalMatrixSIMD * start; const auto vL = m_toLocalMatrixSIMD * ( end - start ); diff --git a/Det/RichDet/include/RichDet/DeRichPMTPanel.h b/Det/RichDet/include/RichDet/DeRichPMTPanel.h index 2311abf1f9ed9402be25cfd42423435b2b8e59b0..0336e497d55e45c4013f202d131a7057535ccfc9 100644 --- a/Det/RichDet/include/RichDet/DeRichPMTPanel.h +++ b/Det/RichDet/include/RichDet/DeRichPMTPanel.h @@ -300,13 +300,13 @@ private: const auto pdInCol = pdID.pdNumInCol(); // the pointer from the array - const auto pd = ( LIKELY( pdCol < m_DePMTs.size() && pdInCol < m_DePMTs[pdCol].size() ) // + const auto pd = ( pdCol < m_DePMTs.size() && pdInCol < m_DePMTs[pdCol].size() // ? dePMT( pdCol, pdInCol ) : nullptr ); #ifndef NDEBUG // Sanity checks, only in debug builds if ( pd ) { - if ( UNLIKELY( pd->pdSmartID().pdID() != pdID.pdID() ) ) { + if ( pd->pdSmartID().pdID() != pdID.pdID() ) { error() << "PMT ID mismatch !!!" << endmsg; error() << " -> requested " << pdID.pdID() << endmsg; error() << " -> retrieved " << pd->pdSmartID() << endmsg; diff --git a/Det/RichDet/include/RichDet/DeRichPMTPanelClassic.h b/Det/RichDet/include/RichDet/DeRichPMTPanelClassic.h index 05c0226db96a6f7b52085a84866784a70c86e684..b5d9915a80af2da4993bcf887654d136cce5a54e 100644 --- a/Det/RichDet/include/RichDet/DeRichPMTPanelClassic.h +++ b/Det/RichDet/include/RichDet/DeRichPMTPanelClassic.h @@ -183,7 +183,7 @@ private: auto pdInCol = pdID.pdNumInCol(); // Convert global module number to number in panel - if ( UNLIKELY( pdCol >= m_DePMTs.size() ) ) { pdCol = PmtModuleNumInPanelFromModuleNumAlone( pdCol ); } + if ( pdCol >= m_DePMTs.size() ) { pdCol = PmtModuleNumInPanelFromModuleNumAlone( pdCol ); } // the pointer from the array const auto pd = @@ -195,7 +195,7 @@ private: #ifndef NDEBUG // Sanity checks, only in debug builds if ( pd ) { - if ( UNLIKELY( pd->pdSmartID().pdID() != pdID.pdID() ) ) { + if ( pd->pdSmartID().pdID() != pdID.pdID() ) { error() << "Classic PMT ID mismatch !!!" << endmsg; error() << " -> requested " << pdID.pdID() << endmsg; error() << " -> retrieved " << pd->pdSmartID() << endmsg; diff --git a/Det/RichDet/include/RichDet/DeRichSystem.h b/Det/RichDet/include/RichDet/DeRichSystem.h index 97d8dc73df85a7080a4148b76be5c4793221e72a..468b057ed6114d8aff14568699c76838413ca32f 100644 --- a/Det/RichDet/include/RichDet/DeRichSystem.h +++ b/Det/RichDet/include/RichDet/DeRichSystem.h @@ -207,7 +207,7 @@ private: template <class SOURCE, class TARGET, class MAP> inline bool safeMapFill( const SOURCE& source, const TARGET& target, MAP& map ) { auto p = map.insert( typename MAP::value_type( source, target ) ); - if ( UNLIKELY( !p.second ) ) { + if ( !p.second ) { error() << "Error filling map '" << System::typeinfoName( typeid( map ) ) << "' source " << System::typeinfoName( typeid( source ) ) << "=" << source << " already has an entry for target " << System::typeinfoName( typeid( target ) ) << " OLD=" << map[source] << " NEW=" << target << endmsg; diff --git a/Det/RichDet/src/Lib/DeRichBase.cpp b/Det/RichDet/src/Lib/DeRichBase.cpp index d719d2a2e70eb4ae71c0763a8e6597062fb70f4e..6901fa09a808cb89e50eca762134421d45e386ec 100644 --- a/Det/RichDet/src/Lib/DeRichBase.cpp +++ b/Det/RichDet/src/Lib/DeRichBase.cpp @@ -19,7 +19,7 @@ // Access DeRichSystem on demand DeRichSystem* DeRichBase::deRichSys() const { - if ( UNLIKELY( !m_deRichS ) ) { + if ( !m_deRichS ) { // lock for update std::lock_guard lock( m_initLock ); diff --git a/Det/RichDet/src/Lib/DeRichHPD.cpp b/Det/RichDet/src/Lib/DeRichHPD.cpp index 2f372203a78c046c0616b9157097ec3c5a5da15f..b4233d21bb7b75a553597de2e24de9102d65fe0f 100644 --- a/Det/RichDet/src/Lib/DeRichHPD.cpp +++ b/Det/RichDet/src/Lib/DeRichHPD.cpp @@ -549,7 +549,7 @@ StatusCode DeRichHPD::fillHpdMagTable( const FieldPolarity field ) { m_magMapR[field].initInterpolator( tableR ); m_magMapPhi[field].initInterpolator( tablePhi ); - if ( UNLIKELY( 2 == m_MDMS_version[field] ) ) { + if ( 2 == m_MDMS_version[field] ) { m_MDMSRotCentre = Gaudi::XYZVector( coeff_rec[8], coeff_rec[9], 0.0 ); m_magnificationCoef1 = coeff_rec[10]; m_magnificationCoef2 = coeff_rec[11]; @@ -577,7 +577,7 @@ bool DeRichHPD::magnifyToGlobalMagnetON( Gaudi::XYZPoint& detectPoint, const boo // const bool rAnodeOK = rAnode < m_siAnodeRCheck; double rCathode( 0 ); - if ( UNLIKELY( 2 == m_MDMS_version[m_field] ) ) { + if ( 2 == m_MDMS_version[m_field] ) { detectPoint = m_SiSensorToHPDMatrix * detectPoint; detectPoint.SetZ( 0.0 ); const auto new_rAnode = detectPoint.R(); @@ -777,14 +777,14 @@ bool DeRichHPD::intersectEntryWindow( const Gaudi::XYZPoint& position, const Gau // find intersection point // for line sphere intersection look at http://www.realtimerendering.com/int/ const auto a = direction.Mag2(); - if ( UNLIKELY( 0 == a ) ) { + if ( 0 == a ) { OK = false; } else { const auto delta = position - m_windowCoCglobal; const auto b = 2.0 * direction.Dot( delta ); const auto c = delta.Mag2() - m_winOutRsq; const auto discr = b * b - 4.0 * a * c; - if ( UNLIKELY( discr < 0 ) ) { + if ( discr < 0 ) { OK = false; } else { // note this is optimised for the 'outside to in' solution... diff --git a/Det/RichDet/src/Lib/DeRichHPDPanel.cpp b/Det/RichDet/src/Lib/DeRichHPDPanel.cpp index 4885dfe10102f1175b78b1438dca5375693b6ee2..4e3d41040c2022170e9452326285ba77cdbc131c 100644 --- a/Det/RichDet/src/Lib/DeRichHPDPanel.cpp +++ b/Det/RichDet/src/Lib/DeRichHPDPanel.cpp @@ -237,7 +237,7 @@ LHCb::RichTraceMode::RayTraceResult DeRichHPDPanel::PDWindowPoint( const Gaudi:: // find the intersection with the detection plane const auto scalar = vInPanel.Dot( m_localPlaneNormal ); - if ( UNLIKELY( fabs( scalar ) < 1e-50 ) ) { return LHCb::RichTraceMode::RayTraceResult::RayTraceFailed; } + if ( fabs( scalar ) < 1e-50 ) { return LHCb::RichTraceMode::RayTraceResult::RayTraceFailed; } const auto scalar_inv = 1.0 / scalar; // transform point to the HPDPanel coordinate system @@ -289,7 +289,7 @@ LHCb::RichTraceMode::RayTraceResult DeRichHPDPanel::PDWindowPoint( const Gaudi:: } else { // perform fast intersection with the HPD entrance window sphere const auto ok = HPD->intersectEntryWindow( pGlobal, vGlobal, windowPointGlobal ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { // fall back to setting the window point to the panel intersection point windowPointGlobal = geometry()->toGlobal( panelIntersection ); } @@ -298,7 +298,7 @@ LHCb::RichTraceMode::RayTraceResult DeRichHPDPanel::PDWindowPoint( const Gaudi:: // Overwise slower but fully detailed checks using full HPD windows // Check for shadowing effects by HPD kapton shields - if ( UNLIKELY( mode.hpdKaptonShadowing() && HPD->testKaptonShadowing( pInPanel, vInPanel ) ) ) { + if ( mode.hpdKaptonShadowing() && HPD->testKaptonShadowing( pInPanel, vInPanel ) ) { // set final point using panel intersection windowPointGlobal = geometry()->toGlobal( panelIntersection ); // set acceptance flag to outside the HPDPanel @@ -311,7 +311,7 @@ LHCb::RichTraceMode::RayTraceResult DeRichHPDPanel::PDWindowPoint( const Gaudi:: ISolid::Ticks HPDWindowTicks; const auto numTicks = HPD->HPDWindowSolid()->intersectionTicks( pInWindow, vInWindow, HPDWindowTicks ); - if ( UNLIKELY( 0 == numTicks ) ) { + if ( 0 == numTicks ) { // set final point using panel intersection windowPointGlobal = geometry()->toGlobal( panelIntersection ); // not in an HPD, but are we in the HPD panel ? diff --git a/Det/RichDet/src/Lib/DeRichPMT.cpp b/Det/RichDet/src/Lib/DeRichPMT.cpp index b9efbec5fa3b2b2265ffeb904136022f4c1d1429..b0b6a7a1a61941456c1816f0ed2f38ce0b305465 100644 --- a/Det/RichDet/src/Lib/DeRichPMT.cpp +++ b/Det/RichDet/src/Lib/DeRichPMT.cpp @@ -253,7 +253,7 @@ bool DeRichPMT::detectionPoint( const LHCb::RichSmartID smartID, // // for now assume negligible refraction effect at the QW. - if ( UNLIKELY( !photoCathodeSide ) ) { aLocalHit.SetZ( scalar( m_pddata.PmtQwZSize ) + aLocalHit.Z() ); } + if ( !photoCathodeSide ) { aLocalHit.SetZ( scalar( m_pddata.PmtQwZSize ) + aLocalHit.Z() ); } detectPoint = ( toGlobalMatrix() * aLocalHit ); @@ -300,7 +300,7 @@ DeRichPD::SIMDFP::mask_type DeRichPMT::detectionPoint( const SmartIDs& smartID, // for now assume negligible refraction effect at the QW. - if ( UNLIKELY( !photoCathodeSide ) ) { aLocalHit.SetZ( m_pddata.PmtQwZSize + aLocalHit.Z() ); } + if ( !photoCathodeSide ) { aLocalHit.SetZ( m_pddata.PmtQwZSize + aLocalHit.Z() ); } detectPoint = m_toGlobalMatrixSIMD * aLocalHit; diff --git a/Det/RichDet/src/Lib/DeRichPMTPanel.cpp b/Det/RichDet/src/Lib/DeRichPMTPanel.cpp index 8857d47531d99d2b8285e54687002aaaa63f7748..43ddfa7c219d29da2544bbd69261346ee0cc547b 100644 --- a/Det/RichDet/src/Lib/DeRichPMTPanel.cpp +++ b/Det/RichDet/src/Lib/DeRichPMTPanel.cpp @@ -349,7 +349,7 @@ StatusCode DeRichPMTPanel::geometryUpdate() { const auto pdID = pd->pdSmartID(); // test method to get dePD from smartID const auto test_pd = dePMT( pdID ); - if ( UNLIKELY( test_pd != pd ) ) { + if ( test_pd != pd ) { error() << "Inconsistent results from dePMT(RichSmartID)" << endmsg; error() << " -> requested " << pdID << endmsg; error() << " -> retrieved " << test_pd->pdSmartID() << endmsg; @@ -601,7 +601,7 @@ DeRichPMTPanel::findPMTArraySetupSIMD( const SIMDPoint& aLocalPoint, / getModuleNumsSIMD( aLocalPoint.x(), aLocalPoint.y(), nums ); #ifndef NDEBUG - if ( UNLIKELY( any_of( nums.aModuleNum < SIMDINT32::Zero() ) ) ) { + if ( any_of( nums.aModuleNum < SIMDINT32::Zero() ) ) { error() << "DeRichPmtPanel : findPMTArraySetupSIMD : Problem getting module numbers" << endmsg; mask_sc = SIMDFP::mask_type( false ); return am; @@ -682,7 +682,7 @@ DeRichPMTPanel::findPMTArraySetupSIMD( const SIMDPoint& aLocalPoint, / } #ifndef NDEBUG - if ( UNLIKELY( any_of( aPmtNum < SIMDINT32::Zero() ) ) ) { + if ( any_of( aPmtNum < SIMDINT32::Zero() ) ) { error() << "DeRichPmtPanel : findPMTArraySetupSIMD : Problem getting PMT numbers" << endmsg; mask_sc = SIMDFP::mask_type( false ); return am; @@ -690,7 +690,7 @@ DeRichPMTPanel::findPMTArraySetupSIMD( const SIMDPoint& aLocalPoint, / #endif // Now, if required, the pixel numbers - if ( UNLIKELY( includePixInfo ) ) { + if ( includePixInfo ) { SIMDFP xpi, ypi; // this is not ideal. Should see if we can reduce what we need to do here... @@ -832,7 +832,7 @@ DeRichPMTPanel::detPlanePointSIMD( const SIMDPoint& pGlobal, // // get the PMT info (SIMD) const auto aC = findPMTArraySetupSIMD( panelIntersection, includePixInfo ); - if ( LIKELY( any_of( aC.mask ) ) ) { + if ( any_of( aC.mask ) ) { // get PMT module number in panel // Note module number should *always* be for current panel, so use method that assumes this @@ -845,7 +845,7 @@ DeRichPMTPanel::detPlanePointSIMD( const SIMDPoint& pGlobal, // // Resort to a scalar loop at this point. To be improved... for ( std::size_t i = 0; i < SIMDFP::Size; ++i ) { - if ( LIKELY( pmask[i] ) ) { + if ( pmask[i] ) { // get the DePMT object PDs[i] = dePMT( pdNumInPanel[i], aC.array[1][i] ); @@ -853,7 +853,7 @@ DeRichPMTPanel::detPlanePointSIMD( const SIMDPoint& pGlobal, // // Set the SmartID to the PD ID smartID[i] = PDs[i]->pdSmartID(); // set the pixel parts - if ( UNLIKELY( includePixInfo ) ) { setRichPmtSmartIDPix( aC.array[2][i], aC.array[3][i], smartID[i] ); } + if ( includePixInfo ) { setRichPmtSmartIDPix( aC.array[2][i], aC.array[3][i], smartID[i] ); } } else { pmask[i] = false; } @@ -939,14 +939,14 @@ DeRichPMTPanel::PDWindowPointSIMD( const SIMDPoint& pGlobal, // // are we in the panel ? auto mask = isInPmtPanel( panelIntersection ); - if ( LIKELY( any_of( mask ) ) ) { + if ( any_of( mask ) ) { // Set res flag for those in mask to InPDPanel res( simd_cast<SIMDRayTResult::Results::mask_type>( mask ) ) = SIMDRayTResult::Results( (unsigned int)LHCb::RichTraceMode::RayTraceResult::InPDPanel ); // check PD acceptance ? - if ( LIKELY( mode.detPlaneBound() != LHCb::RichTraceMode::DetectorPlaneBoundary::IgnorePDAcceptance ) ) { + if ( mode.detPlaneBound() != LHCb::RichTraceMode::DetectorPlaneBoundary::IgnorePDAcceptance ) { // get the PMT info (SIMD) - has to be checked here - findPMTArraySetupSIMD checks if smartID is valid (so // non-existent PMTs should give OutsidePDPanel) @@ -968,18 +968,18 @@ DeRichPMTPanel::PDWindowPointSIMD( const SIMDPoint& pGlobal, // // Resort to a scalar loop at this point to extract PD specific info. for ( std::size_t i = 0; i < SIMDFP::Size; ++i ) { // skip those already failed - if ( LIKELY( aC.mask[i] ) ) { + if ( aC.mask[i] ) { // get the DePMT object const auto pmt = dePMT( aModuleNumInPanel[i], aC.array[1][i] ); PDs[i] = pmt; - if ( LIKELY( pmt ) ) { + if ( pmt ) { // Set the SmartID to the PD ID smartID[i] = pmt->pdSmartID(); // set the pixel parts - if ( UNLIKELY( includePixInfo ) ) { setRichPmtSmartIDPix( aC.array[2][i], aC.array[3][i], smartID[i] ); } + if ( includePixInfo ) { setRichPmtSmartIDPix( aC.array[2][i], aC.array[3][i], smartID[i] ); } // Update SIMD PD X,Y in local panel X[i] = pmt->zeroInPanelLocal().X(); diff --git a/Det/RichDet/src/Lib/DeRichPMTPanelClassic.cpp b/Det/RichDet/src/Lib/DeRichPMTPanelClassic.cpp index 347fa9f3db4415f97cb0d148328d04d8517ab39a..fc6cd0cea1633b79d3499725be43e11b0be4396e 100644 --- a/Det/RichDet/src/Lib/DeRichPMTPanelClassic.cpp +++ b/Det/RichDet/src/Lib/DeRichPMTPanelClassic.cpp @@ -364,7 +364,7 @@ StatusCode DeRichPMTPanelClassic::geometryUpdate() { const auto pdID = pd->pdSmartID(); // test method to get dePD from smartID const auto test_pd = dePMT( pdID ); - if ( UNLIKELY( test_pd != pd ) ) { + if ( test_pd != pd ) { error() << "Inconsistent results from dePMT(RichSmartID)" << endmsg; error() << " -> requested " << pdID << endmsg; error() << " -> retrieved " << test_pd->pdSmartID() << endmsg; @@ -640,7 +640,7 @@ DeRichPMTPanelClassic::ArraySetupSIMD DeRichPMTPanelClassic::findPMTArraySetupSI getModuleNumsSIMD( aLocalPoint.x(), aLocalPoint.y(), nums ); #ifndef NDEBUG - if ( UNLIKELY( any_of( nums.aModuleNum < SIMDINT32::Zero() ) ) ) { + if ( any_of( nums.aModuleNum < SIMDINT32::Zero() ) ) { error() << "DeRichPmtPanelClassic : findPMTArraySetupSIMD : Problem getting PMT numbers" << endmsg; return aCh; } @@ -697,7 +697,7 @@ DeRichPMTPanelClassic::ArraySetupSIMD DeRichPMTPanelClassic::findPMTArraySetupSI } #ifndef NDEBUG - if ( UNLIKELY( any_of( aPmtNum < SIMDINT32::Zero() ) ) ) { + if ( any_of( aPmtNum < SIMDINT32::Zero() ) ) { error() << "DeRichPmtPanelClassic : findPMTArraySetupSIMD : Problem getting PMT numbers" << endmsg; return aCh; } @@ -706,7 +706,7 @@ DeRichPMTPanelClassic::ArraySetupSIMD DeRichPMTPanelClassic::findPMTArraySetupSI aCh[0] = nums.aModuleNum; // Now, if requires, the pixel numbers - if ( UNLIKELY( includePixInfo ) ) { + if ( includePixInfo ) { // New Use cached positions SIMDFP xpi( -aLocalPoint.X() ), ypi( aLocalPoint.Y() ); @@ -806,7 +806,7 @@ DeRichPMTPanelClassic::detPlanePointSIMD( const SIMDPoint& pGlobal, // Resort to a scalar loop at this point. To be improved... for ( std::size_t i = 0; i < SIMDFP::Size; ++i ) { - if ( LIKELY( pmask[i] ) ) { + if ( pmask[i] ) { // get the DePMT object PDs[i] = m_DePMTs[pdNumInPanel[i]][aC[1][i]]; @@ -816,7 +816,7 @@ DeRichPMTPanelClassic::detPlanePointSIMD( const SIMDPoint& pGlobal, smartID[i] = PDs[i]->pdSmartID(); // set the pixel parts - if ( UNLIKELY( includePixInfo ) ) { setRichPmtSmartIDPix( aC[2][i], aC[3][i], smartID[i] ); } + if ( includePixInfo ) { setRichPmtSmartIDPix( aC[2][i], aC[3][i], smartID[i] ); } } else { pmask[i] = false; @@ -940,7 +940,7 @@ DeRichPMTPanelClassic::PDWindowPointSIMD( const SIMDPoint& pGlobal, smartID[i] = pmt->pdSmartID(); // set the pixel parts - if ( UNLIKELY( includePixInfo ) ) { setRichPmtSmartIDPix( aC[2][i], aC[3][i], smartID[i] ); } + if ( includePixInfo ) { setRichPmtSmartIDPix( aC[2][i], aC[3][i], smartID[i] ); } // Update SIMD PD X,Y in local panel X[i] = pmt->zeroInPanelLocal().X(); diff --git a/Det/RichDet/src/Lib/DeRichSingleSolidRadiator.cpp b/Det/RichDet/src/Lib/DeRichSingleSolidRadiator.cpp index 5f4edaf5df7b2ad3059499eabe7ac5df4709af66..3efb20f54c3ab5164b3c412e02a7fca86c3e3c2a 100644 --- a/Det/RichDet/src/Lib/DeRichSingleSolidRadiator.cpp +++ b/Det/RichDet/src/Lib/DeRichSingleSolidRadiator.cpp @@ -104,11 +104,11 @@ StatusCode DeRichSingleSolidRadiator::prepareMomentumVector( std::vector<double> photonMomentumVect.clear(); // check parameters are sane - if ( UNLIKELY( max <= min ) ) { + if ( max <= min ) { error() << "Inadmissible photon energy limits " << max << " " << min << endmsg; return StatusCode::FAILURE; } - if ( UNLIKELY( nbins <= 0 ) ) { + if ( nbins <= 0 ) { error() << "Inadmissible photon energy num bins " << nbins << endmsg; return StatusCode::FAILURE; } @@ -139,7 +139,7 @@ StatusCode DeRichSingleSolidRadiator::nextIntersectionPoint( const Gaudi::XYZPoi ISolid::Ticks ticks; const auto noTicks = m_solid->intersectionTicks( pLocal, vLocal, ticks ); - if ( UNLIKELY( 0 == noTicks ) ) { return StatusCode::FAILURE; } + if ( 0 == noTicks ) { return StatusCode::FAILURE; } returnPoint = geometry()->toGlobal( pLocal + ticks[0] * vLocal ); return StatusCode::SUCCESS; @@ -160,7 +160,7 @@ StatusCode DeRichSingleSolidRadiator::intersectionPoints( const Gaudi::XYZPoint& ISolid::Ticks ticks; const auto noTicks = m_solid->intersectionTicks( pLocal, vLocal, ticks ); - if ( UNLIKELY( 0 == noTicks ) ) { return StatusCode::FAILURE; } + if ( 0 == noTicks ) { return StatusCode::FAILURE; } entryPoint = geometry()->toGlobal( pLocal + ticks[0] * vLocal ); exitPoint = geometry()->toGlobal( pLocal + ticks[noTicks - 1] * vLocal ); @@ -221,7 +221,7 @@ unsigned int DeRichSingleSolidRadiator::intersections( const Gaudi::XYZPoint& //========================================================================= double DeRichSingleSolidRadiator::refractiveIndex( const double energy, const bool hlt ) const { const auto ind = refIndex( hlt ); - if ( UNLIKELY( !ind ) ) { + if ( !ind ) { warning() << "Null refractive index pointer" << endmsg; return 0; } diff --git a/Det/RichDet/src/Lib/DeRichSystem.cpp b/Det/RichDet/src/Lib/DeRichSystem.cpp index a63ac8fbaf09ce2da5d78adfc27b3ff7733de642..add3197947954b42d11c220c172350cc0a51080d 100644 --- a/Det/RichDet/src/Lib/DeRichSystem.cpp +++ b/Det/RichDet/src/Lib/DeRichSystem.cpp @@ -359,7 +359,7 @@ StatusCode DeRichSystem::fillMaps( const Rich::DetectorType rich ) { const Rich::DAQ::PDHardwareID DeRichSystem::hardwareID( const LHCb::RichSmartID& smartID ) const { // See if this RichSmartID is known const auto id = m_soft2hard.find( smartID.pdID() ); - if ( UNLIKELY( m_soft2hard.end() == id ) ) { + if ( m_soft2hard.end() == id ) { std::ostringstream mess; mess << "Unknown PD RichSmartID " << smartID.pdID(); throw GaudiException( mess.str(), "DeRichSystem::hardwareID", StatusCode::FAILURE ); @@ -375,7 +375,7 @@ const Rich::DAQ::PDHardwareID DeRichSystem::hardwareID( const LHCb::RichSmartID& const LHCb::RichSmartID DeRichSystem::richSmartID( const Rich::DAQ::PDHardwareID& hID ) const { // See if this PD hardware ID is known const auto id = m_hard2soft.find( hID ); - if ( UNLIKELY( m_hard2soft.end() == id ) ) { + if ( m_hard2soft.end() == id ) { throw GaudiException( "Unknown PD hardware ID " + (std::string)hID, "DeRichSystem::richSmartID", StatusCode::FAILURE ); } @@ -390,7 +390,7 @@ const LHCb::RichSmartID DeRichSystem::richSmartID( const Rich::DAQ::PDHardwareID const LHCb::RichSmartID DeRichSystem::richSmartID( const Rich::DAQ::PDCopyNumber& copyNumber ) const { // See if this Level0 hardware ID is known const auto id = m_copyNumber2smartid.find( copyNumber ); - if ( UNLIKELY( m_copyNumber2smartid.end() == id ) ) { + if ( m_copyNumber2smartid.end() == id ) { throw GaudiException( "Unknown PD Copy Number " + (std::string)copyNumber, "DeRichSystem::richSmartID", StatusCode::FAILURE ); } @@ -405,7 +405,7 @@ const LHCb::RichSmartID DeRichSystem::richSmartID( const Rich::DAQ::PDCopyNumber const Rich::DAQ::PDCopyNumber DeRichSystem::copyNumber( const LHCb::RichSmartID& smartID ) const { // See if this RichSmartID is known const auto id = m_smartid2copyNumber.find( smartID.pdID() ); - if ( UNLIKELY( m_smartid2copyNumber.end() == id ) ) { + if ( m_smartid2copyNumber.end() == id ) { std::ostringstream mess; mess << "Unknown PD RichSmartID " << smartID.pdID(); throw GaudiException( mess.str(), "DeRichSystem::copyNumber", StatusCode::FAILURE ); diff --git a/Det/UTDet/src/Lib/DeUTSector.cpp b/Det/UTDet/src/Lib/DeUTSector.cpp index fa5fa4f5afbfb2f70c8297455bc68050404c464a..9b5daec4876beed8a41ee89b84f393b60fba4545 100644 --- a/Det/UTDet/src/Lib/DeUTSector.cpp +++ b/Det/UTDet/src/Lib/DeUTSector.cpp @@ -238,7 +238,7 @@ float DeUTSector::sectorNoise() const { if ( number < 1 ) return 999.99f; MsgStream msg( msgSvc(), name() ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << number << " strips out of " << nStrip() << " are not taken into account" << endmsg; return sum / number; } @@ -262,7 +262,7 @@ float DeUTSector::beetleNoise( unsigned int beetle ) const { if ( number < 1 ) return 999.99f; MsgStream msg( msgSvc(), name() ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << number << " strips out of " << LHCbConstants::nStripsInBeetle << " are not taken into account" << endmsg; return sum / number; @@ -288,7 +288,7 @@ float DeUTSector::portNoise( unsigned int beetle, unsigned int port ) const { if ( number < 1 ) return 999.99f; MsgStream msg( msgSvc(), name() ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << number << " strips out of " << LHCbConstants::nStripsInPort << " are not taken into account" << endmsg; return sum / number; @@ -385,7 +385,7 @@ float DeUTSector::cmSectorNoise() const { return 999.99f; } else { MsgStream msg( msgSvc(), name() ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << number << " strips out of " << nStrip() << " are not taken into account" << endmsg; return sum / number; } @@ -412,7 +412,7 @@ float DeUTSector::cmBeetleNoise( unsigned int beetle ) const { return 999.99f; else { MsgStream msg( msgSvc(), name() ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << number << " strips out of " << LHCbConstants::nStripsInBeetle << " are not taken into account" << endmsg; return sum / number; @@ -442,7 +442,7 @@ float DeUTSector::cmPortNoise( unsigned int beetle, unsigned int port ) const { return 999.99f; else { MsgStream msg( msgSvc(), name() ); - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << number << " strips out of " << LHCbConstants::nStripsInPort << " are not taken into account" << endmsg; return sum / number; @@ -718,8 +718,7 @@ void DeUTSector::setBeetleStatus( unsigned int beetle, const DeUTSector::Status& if ( sectorStatus() != DeUTSector::OK ) { // if the sector is not ok nothing to be done - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << "Sector is off anyway: set request ignored " << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Sector is off anyway: set request ignored " << endmsg; } else { if ( newStatus == DeUTSector::OK ) { // Lazarus walks...if we have an entry in the map delete it @@ -745,8 +744,7 @@ void DeUTSector::setStripStatus( unsigned int strip, const DeUTSector::Status& n if ( sectorStatus() != DeUTSector::OK || beetleStatus( strip ) != DeUTSector::OK ) { // if the sector is not ok nothing to be done - if ( UNLIKELY( msg.level() <= MSG::DEBUG ) ) - msg << MSG::DEBUG << "Sector/Beetle is off anyway: set request ignored " << endmsg; + if ( msg.level() <= MSG::DEBUG ) msg << MSG::DEBUG << "Sector/Beetle is off anyway: set request ignored " << endmsg; } else { if ( newStatus == DeUTSector::OK ) { // Lazarus walks...if we have an entry in the map delete it diff --git a/Det/VPDet/include/VPDet/DeVPSensor.h b/Det/VPDet/include/VPDet/DeVPSensor.h index 506459c53f7138f45ec42d77c29eeeabface0c67..fa9f2fbd8f28aa19097a5e75e3e9decb15df0506 100644 --- a/Det/VPDet/include/VPDet/DeVPSensor.h +++ b/Det/VPDet/include/VPDet/DeVPSensor.h @@ -207,7 +207,7 @@ private: mutable std::unique_ptr<MsgStream> m_msg; /// On-demand access to message stream MsgStream& msg() const { - if ( UNLIKELY( !m_msg ) ) m_msg.reset( new MsgStream( msgSvc(), "DeVPSensor" ) ); + if ( !m_msg ) m_msg.reset( new MsgStream( msgSvc(), "DeVPSensor" ) ); return *m_msg; } diff --git a/Event/DAQEvent/include/Event/RawEvent.h b/Event/DAQEvent/include/Event/RawEvent.h index 71e3729c22be786d2ee422e5dd798c099de247b1..4f239cdacfa6dc98d75d9c183a2ed0d721e157d0 100644 --- a/Event/DAQEvent/include/Event/RawEvent.h +++ b/Event/DAQEvent/include/Event/RawEvent.h @@ -161,7 +161,7 @@ namespace LHCb { /// accessor method to the vector of Raw banks for a given bank type [[nodiscard]] RawBank::View banks( RawBank::BankType bankType ) const { // The optimizer should be able to deal with this... - if ( UNLIKELY( !m_map ) ) m_map.emplace( *this ); + if ( !m_map ) m_map.emplace( *this ); return m_map->banks( bankType ); } diff --git a/Event/EventBase/include/Event/SOACollection.h b/Event/EventBase/include/Event/SOACollection.h index b54d9abb9a806831af5bb19ba4a23ba33581cf1d..180c9f87cdf660b2c03268bd6633cc6b14745490 100644 --- a/Event/EventBase/include/Event/SOACollection.h +++ b/Event/EventBase/include/Event/SOACollection.h @@ -360,7 +360,7 @@ namespace LHCb::v2::Event { void copy_back_helper( SOACollection const& from, int at, mask_t const& mask ) { auto const num_columns_this = Tag::num_columns( static_cast<Derived const&>( *this ) ); auto const num_columns_from = Tag::num_columns( static_cast<Derived const&>( from ) ); - if ( UNLIKELY( num_columns_this != num_columns_from ) ) { + if ( num_columns_this != num_columns_from ) { throw GaudiException{"logic error", "SOACollection", StatusCode::FAILURE}; } for ( auto n = 0ul; n < num_columns_this; ++n ) { diff --git a/Event/EventBase/include/Event/ZipUtils.h b/Event/EventBase/include/Event/ZipUtils.h index 387043beb01acede5e7640e7526d959e3045725d..0bc939ebfdfbe0f69ee34a9afa3998a38027ceb4 100644 --- a/Event/EventBase/include/Event/ZipUtils.h +++ b/Event/EventBase/include/Event/ZipUtils.h @@ -154,7 +154,7 @@ namespace Zipping { template <typename FIRST, typename... OTHERS> bool areSameSize( FIRST const& first, OTHERS const&... others ) { // Check that converting to std::size_t won't cause problems - if ( UNLIKELY( ( first.size() < 0 ) || ( ... || ( others.size() < 0 ) ) ) ) return false; + if ( ( first.size() < 0 ) || ( ... || ( others.size() < 0 ) ) ) return false; // Check that all containers have the same size as the first one. return ( ... && ( std::size_t( others.size() ) == std::size_t( first.size() ) ) ); } diff --git a/Event/EventPacker/include/Event/PackedCaloAdc.h b/Event/EventPacker/include/Event/PackedCaloAdc.h index 2efea82e35394a20884c1d4d151d1ae4dc962ca6..42520aac695e0f49d10f4ef7071479fc6131332a 100644 --- a/Event/EventPacker/include/Event/PackedCaloAdc.h +++ b/Event/EventPacker/include/Event/PackedCaloAdc.h @@ -166,7 +166,7 @@ namespace LHCb { /// Check if the given packing version is supported [[nodiscard]] bool isSupportedVer( const char& ver ) const { const bool OK = ( 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "CaloAdcPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedCaloCluster.h b/Event/EventPacker/include/Event/PackedCaloCluster.h index 894e8560766d2295a4b0cb870289ca35282f1dbd..7370a4d277d972780f5f697eaddfc28d6511679f 100644 --- a/Event/EventPacker/include/Event/PackedCaloCluster.h +++ b/Event/EventPacker/include/Event/PackedCaloCluster.h @@ -216,7 +216,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "RichPIDPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedCaloDigit.h b/Event/EventPacker/include/Event/PackedCaloDigit.h index a2aa8ca899cd3627a75d51506c659ce9b727203e..a9f46f27bc465e1293145c3080f641bb894d109f 100644 --- a/Event/EventPacker/include/Event/PackedCaloDigit.h +++ b/Event/EventPacker/include/Event/PackedCaloDigit.h @@ -167,7 +167,7 @@ namespace LHCb { /// Check if the given packing version is supported [[nodiscard]] bool isSupportedVer( const char& ver ) const { const bool OK = ( 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "CaloDigitPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedEventChecks.h b/Event/EventPacker/include/Event/PackedEventChecks.h index f790edb5a6d5af2e450fe65d32f2a70af647a312..35fdd790f5dab87668573ac5087b8ca34335ecd6 100644 --- a/Event/EventPacker/include/Event/PackedEventChecks.h +++ b/Event/EventPacker/include/Event/PackedEventChecks.h @@ -105,7 +105,7 @@ namespace DataPacking { template <class TYPE> bool compareInts( const std::string& name, const TYPE& a, const TYPE& b ) const { const bool ok = ( a == b ); - if ( UNLIKELY( !ok && parent ) ) { + if ( !ok && parent ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original = " << a << endmsg << " Unpacked = " << b << endmsg; } @@ -126,7 +126,7 @@ namespace DataPacking { template <class TYPE> bool comparePointers( const std::string& name, const TYPE* a, const TYPE* b ) const { const bool ok = ( a == b ); - if ( UNLIKELY( !ok && parent ) ) { + if ( !ok && parent ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original = " << a << endmsg << " Unpacked = " << b << endmsg; } diff --git a/Event/EventPacker/include/Event/PackedFlavourTag.h b/Event/EventPacker/include/Event/PackedFlavourTag.h index 73dd29b44e49d4df616d397a0745eccc4879dabd..0ff7399db69108a2fc4f8f8df172c455b523a60f 100644 --- a/Event/EventPacker/include/Event/PackedFlavourTag.h +++ b/Event/EventPacker/include/Event/PackedFlavourTag.h @@ -245,7 +245,7 @@ namespace LHCb { /// Check if the given packing version is supported [[nodiscard]] bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "FlavourTagPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMCCaloHit.h b/Event/EventPacker/include/Event/PackedMCCaloHit.h index af17a8e358b5694f330d643bdc1b9f7f1d6f852b..36418ca7170ca51f9d16b6870634d7d5298188a8 100644 --- a/Event/EventPacker/include/Event/PackedMCCaloHit.h +++ b/Event/EventPacker/include/Event/PackedMCCaloHit.h @@ -133,7 +133,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MCCaloHitPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMCHit.h b/Event/EventPacker/include/Event/PackedMCHit.h index b5c6c0be76ce123517adfdda8c867bcd682aa11e..4cf198ad908704767f9afb4785eec12285971840 100644 --- a/Event/EventPacker/include/Event/PackedMCHit.h +++ b/Event/EventPacker/include/Event/PackedMCHit.h @@ -138,7 +138,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MCHitPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMCRichDigitSummary.h b/Event/EventPacker/include/Event/PackedMCRichDigitSummary.h index dda710da66974fc6e6a7ede38eba5289593bd4a5..bababff075b1ad014b7a10d6e4fe21c8773e9645 100644 --- a/Event/EventPacker/include/Event/PackedMCRichDigitSummary.h +++ b/Event/EventPacker/include/Event/PackedMCRichDigitSummary.h @@ -126,7 +126,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MCRichDigitSummaryPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMCRichHit.h b/Event/EventPacker/include/Event/PackedMCRichHit.h index db26923ed51d9dbdf58015aeb2d0740a55c9f175..9b25de35487c57d569e84cd6648629f116c6fb79 100644 --- a/Event/EventPacker/include/Event/PackedMCRichHit.h +++ b/Event/EventPacker/include/Event/PackedMCRichHit.h @@ -129,7 +129,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MCRichHitPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMCRichOpticalPhoton.h b/Event/EventPacker/include/Event/PackedMCRichOpticalPhoton.h index 5ef84ce0d085338e12bd3114b4124e5a30a22d4f..b53d24fe888c69bc1411b36466831b2a96c2e1ee 100644 --- a/Event/EventPacker/include/Event/PackedMCRichOpticalPhoton.h +++ b/Event/EventPacker/include/Event/PackedMCRichOpticalPhoton.h @@ -134,7 +134,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MCRichOpticalPhotonPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMCRichSegment.h b/Event/EventPacker/include/Event/PackedMCRichSegment.h index 943eea0c127d73265cb43af28f28b094ec977311..3299abb1c97ab30987ff88dd69111808f5569af9 100644 --- a/Event/EventPacker/include/Event/PackedMCRichSegment.h +++ b/Event/EventPacker/include/Event/PackedMCRichSegment.h @@ -131,7 +131,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MCRichSegmentPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMCRichTrack.h b/Event/EventPacker/include/Event/PackedMCRichTrack.h index d2dc818d6585223aadc9c4ad05dc3ea28ee18318..b5a97f2fe933f5ab1f62c6f3d0a89376c6875446 100644 --- a/Event/EventPacker/include/Event/PackedMCRichTrack.h +++ b/Event/EventPacker/include/Event/PackedMCRichTrack.h @@ -128,7 +128,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MCRichTrackPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedMuonPID.h b/Event/EventPacker/include/Event/PackedMuonPID.h index e8d58c218b687a9a57accee7906434f5f833b48c..83842f7a32e7bc61e795367bb1b2b27a73289041 100644 --- a/Event/EventPacker/include/Event/PackedMuonPID.h +++ b/Event/EventPacker/include/Event/PackedMuonPID.h @@ -186,7 +186,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 3 == ver || 2 == ver || 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "MuonPIDPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedPartToRelatedInfoRelation.h b/Event/EventPacker/include/Event/PackedPartToRelatedInfoRelation.h index 4d32574f1d3c7a70ca9082ef0f34457d40734537..59979d34cba8387179213e34178f0fb22ab3fd8a 100644 --- a/Event/EventPacker/include/Event/PackedPartToRelatedInfoRelation.h +++ b/Event/EventPacker/include/Event/PackedPartToRelatedInfoRelation.h @@ -206,7 +206,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "RelatedInfoRelationsPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedProtoParticle.h b/Event/EventPacker/include/Event/PackedProtoParticle.h index 35f89e0962a1f5e6a1c6034cbc13904dfa3d4c48..46c4aaebcdd32cc919068f56940152acc4eb8bc0 100644 --- a/Event/EventPacker/include/Event/PackedProtoParticle.h +++ b/Event/EventPacker/include/Event/PackedProtoParticle.h @@ -177,7 +177,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "ProtoParticlePacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedRecVertex.h b/Event/EventPacker/include/Event/PackedRecVertex.h index 035f87e8d3d14b93a968b8db542bfd2f401e1321..b9c74bf848532f9c453e160eb0c07670e94b0f29 100644 --- a/Event/EventPacker/include/Event/PackedRecVertex.h +++ b/Event/EventPacker/include/Event/PackedRecVertex.h @@ -215,7 +215,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 2 == ver || 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "RecVertexPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedRichPID.h b/Event/EventPacker/include/Event/PackedRichPID.h index bfc15aa0998e56956b23986ac63ec7277d81b5be..62957fedd601be842d07d987eb36f28443a3748f 100644 --- a/Event/EventPacker/include/Event/PackedRichPID.h +++ b/Event/EventPacker/include/Event/PackedRichPID.h @@ -188,7 +188,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char& ver ) const { const bool OK = ( 0 <= ver && ver <= 4 ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "RichPIDPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedTrack.h b/Event/EventPacker/include/Event/PackedTrack.h index be1fbadf869777784cf38e2efa95c298734e993c..63d3d82053a1483ce414c9a66fbe74666aab5ede 100644 --- a/Event/EventPacker/include/Event/PackedTrack.h +++ b/Event/EventPacker/include/Event/PackedTrack.h @@ -265,7 +265,7 @@ namespace LHCb { /// Check if the given packing version is supported bool isSupportedVer( const char ver ) const { const bool OK = ( 0 <= ver && ver <= 5 ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "TrackPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedVertex.h b/Event/EventPacker/include/Event/PackedVertex.h index 449b9ba738a719d56f563feb0622e4d5014defb2..796e6991494f7601b3acb8425943461f8234deb9 100644 --- a/Event/EventPacker/include/Event/PackedVertex.h +++ b/Event/EventPacker/include/Event/PackedVertex.h @@ -239,7 +239,7 @@ namespace LHCb { /// Check if the given packing version is supported static bool isSupportedVer( const char ver ) { const bool OK = ( 1 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "VertexPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/include/Event/PackedWeightsVector.h b/Event/EventPacker/include/Event/PackedWeightsVector.h index 95d3e4bc5d1433b10f3fbc5fb3542e2e17d5cc1a..657f7331def91fca112b890a8683368e5e648004 100644 --- a/Event/EventPacker/include/Event/PackedWeightsVector.h +++ b/Event/EventPacker/include/Event/PackedWeightsVector.h @@ -156,7 +156,7 @@ namespace LHCb { /// Check if the given packing version is supported static bool isSupportedVer( const char& ver ) { const bool OK = ( 1 == ver || 0 == ver ); - if ( UNLIKELY( !OK ) ) { + if ( !OK ) { std::ostringstream mess; mess << "Unknown packed data version " << (int)ver; throw GaudiException( mess.str(), "WeightsVectorPacker", StatusCode::FAILURE ); diff --git a/Event/EventPacker/src/component/CompareMCParticle.cpp b/Event/EventPacker/src/component/CompareMCParticle.cpp index 169da2dc883dcba58979c989bedf7c8dbf5e7c5f..3b07f4f7f6552dda6541940c2967898a13c9d519 100644 --- a/Event/EventPacker/src/component/CompareMCParticle.cpp +++ b/Event/EventPacker/src/component/CompareMCParticle.cpp @@ -33,7 +33,7 @@ struct CompareMCParticle : Gaudi::Functional::Consumer<void( const LHCb::MCParti KeyValue{"TestName", LHCb::MCParticleLocation::Default + "Test"}}} {} void operator()( const LHCb::MCParticles& old, const LHCb::MCParticles& test ) const override { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; if ( old.size() != test.size() ) { err() << "Old MCParticle size " << old.size() << " differs form Test " << test.size() << endmsg; diff --git a/Event/EventPacker/src/component/CompareMCVertex.cpp b/Event/EventPacker/src/component/CompareMCVertex.cpp index 640e56c2b793f713618236eab4b3ab4593525f85..a7ff000783645aa71abb44fc6fbdcbfa660c331f 100644 --- a/Event/EventPacker/src/component/CompareMCVertex.cpp +++ b/Event/EventPacker/src/component/CompareMCVertex.cpp @@ -34,7 +34,7 @@ struct CompareMCVertex : Gaudi::Functional::Consumer<void( const LHCb::MCVertice void operator()( const LHCb::MCVertices& old, const LHCb::MCVertices& test ) const override { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; if ( old.size() != test.size() ) { err() << "Old MCVertex size " << old.size() << " differs form Test " << test.size() << endmsg; diff --git a/Event/EventPacker/src/component/MapperToolBase.h b/Event/EventPacker/src/component/MapperToolBase.h index 2f108f29d94dba8f0a35e45b833afa83031e1cc4..5e3a73a347fe098894c99f7a789929c90babeaa1 100644 --- a/Event/EventPacker/src/component/MapperToolBase.h +++ b/Event/EventPacker/src/component/MapperToolBase.h @@ -19,8 +19,8 @@ #include <string_view> // Helpers for printing -#define ON_VERBOSE if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) -#define ON_DEBUG if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) +#define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) ) +#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) #define LOG_VERBOSE ON_VERBOSE verbose() #define LOG_DEBUG ON_DEBUG debug() diff --git a/Event/EventPacker/src/component/PackCaloHypo.cpp b/Event/EventPacker/src/component/PackCaloHypo.cpp index 5292805b14fbaf165c9458afe77c4b3c580225ad..9080d07ff3224c76f882151efca2212f75c6352a 100644 --- a/Event/EventPacker/src/component/PackCaloHypo.cpp +++ b/Event/EventPacker/src/component/PackCaloHypo.cpp @@ -47,7 +47,7 @@ LHCb::PackedCaloHypos PackCaloHypo::operator()() const { packer.pack( *hypos, out ); // Packing checks - if ( UNLIKELY( m_enableCheck ) ) { + if ( m_enableCheck ) { // make new unpacked output data object LHCb::CaloHypos unpacked; // unpack diff --git a/Event/EventPacker/src/component/PackCluster.cpp b/Event/EventPacker/src/component/PackCluster.cpp index 2ae75eeadf866fdcffa108ca391c60596362cb78..8622d8b38eb0fc85bbd65bf66766512998005580 100644 --- a/Event/EventPacker/src/component/PackCluster.cpp +++ b/Event/EventPacker/src/component/PackCluster.cpp @@ -98,7 +98,7 @@ StatusCode PackCluster::execute() { if ( msgLevel( MSG::VERBOSE ) ) { verbose() << "Packing " << id << endmsg; } if ( id.isUT() ) { - if ( UNLIKELY( !utClus ) ) { + if ( !utClus ) { utClus = getIfExists<LHCb::UTClusters>( m_utClusLoc ); if ( !utClus ) { Warning( "Failed to load '" + m_utClusLoc + "'" ).ignore(); } } diff --git a/Event/EventPacker/src/component/PackDecReport.cpp b/Event/EventPacker/src/component/PackDecReport.cpp index b86940d2ed226bc750dd42b8b1611d8f811798e7..82ea5b1ee6c09cd61699bf75fcf66d71b5b596ea 100644 --- a/Event/EventPacker/src/component/PackDecReport.cpp +++ b/Event/EventPacker/src/component/PackDecReport.cpp @@ -109,7 +109,7 @@ StatusCode PackDecReport::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { StatusCode sc = evtSvc()->unregisterObject( reports ); if ( sc.isSuccess() ) { delete reports; diff --git a/Event/EventPacker/src/component/PackMCParticle.cpp b/Event/EventPacker/src/component/PackMCParticle.cpp index aaf8143460caf8f0f99fe52c065e7126d8cb3c26..5f3e5c3f43eb03a7b7987fc9dc148aa780c950e7 100644 --- a/Event/EventPacker/src/component/PackMCParticle.cpp +++ b/Event/EventPacker/src/component/PackMCParticle.cpp @@ -106,7 +106,7 @@ StatusCode PackMCParticle::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { const StatusCode sc = evtSvc()->unregisterObject( parts ); if ( sc.isSuccess() ) { delete parts; diff --git a/Event/EventPacker/src/component/PackMCVertex.cpp b/Event/EventPacker/src/component/PackMCVertex.cpp index 39b67e61c7ce4cba425212132c8ca69db304c318..4da8fbc0ea0fa02a28580a2c89e27e16a657b307 100644 --- a/Event/EventPacker/src/component/PackMCVertex.cpp +++ b/Event/EventPacker/src/component/PackMCVertex.cpp @@ -136,7 +136,7 @@ StatusCode PackMCVertex::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { const StatusCode sc = evtSvc()->unregisterObject( verts ); if ( sc.isSuccess() ) { delete verts; diff --git a/Event/EventPacker/src/component/PackParticlesAndVertices.cpp b/Event/EventPacker/src/component/PackParticlesAndVertices.cpp index c08dcbc8d27272d43f13ccaa83f02ec7f796dc04..7f099eee6a6e9bbd3363684df1423e1a68be64b3 100644 --- a/Event/EventPacker/src/component/PackParticlesAndVertices.cpp +++ b/Event/EventPacker/src/component/PackParticlesAndVertices.cpp @@ -158,7 +158,7 @@ private: const int i_ver = in.version(); const int o_ver = out.version(); // sanity check - if ( UNLIKELY( o_ver != 0 && o_ver != i_ver ) ) { + if ( o_ver != 0 && o_ver != i_ver ) { std::ostringstream mess; mess << objectLocation( in ) << " version " << i_ver << " != current packed version " << o_ver; Warning( mess.str() ).ignore(); diff --git a/Event/EventPacker/src/component/PackProtoParticle.cpp b/Event/EventPacker/src/component/PackProtoParticle.cpp index 9ba7e0152b9b685c60b4e1013048cd4805867140..02bd5dffd92d6204365f41e00998f7063fdf549c 100644 --- a/Event/EventPacker/src/component/PackProtoParticle.cpp +++ b/Event/EventPacker/src/component/PackProtoParticle.cpp @@ -85,7 +85,7 @@ StatusCode PackProtoParticle::execute() { debug() << "Created " << out->protos().size() << " PackedProtoParticles at '" << m_outputName << "'" << endmsg; // Packing checks - if ( UNLIKELY( m_enableCheck ) ) { + if ( m_enableCheck ) { // make new unpacked output data object LHCb::ProtoParticles* unpacked = new LHCb::ProtoParticles(); put( unpacked, m_inputName + "_PackingCheck" ); @@ -106,7 +106,7 @@ StatusCode PackProtoParticle::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { const StatusCode sc = evtSvc()->unregisterObject( parts ); if ( sc.isSuccess() ) { delete parts; diff --git a/Event/EventPacker/src/component/PackRecVertex.cpp b/Event/EventPacker/src/component/PackRecVertex.cpp index 6f3947f2114b22fe1dc04e09ded6cec6497a7c6c..5351d1207a1a5b02692bed318c181d703019de1b 100644 --- a/Event/EventPacker/src/component/PackRecVertex.cpp +++ b/Event/EventPacker/src/component/PackRecVertex.cpp @@ -89,7 +89,7 @@ StatusCode PackRecVertex::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { const StatusCode sc = evtSvc()->unregisterObject( verts ).andThen( [&] { delete verts; verts = nullptr; diff --git a/Event/EventPacker/src/component/PackTrack.cpp b/Event/EventPacker/src/component/PackTrack.cpp index 36d5077c7acb5faadbbdc9414cda7298eae83799..f58edabc7fc2dce033c2318784684e0cd84fb953 100644 --- a/Event/EventPacker/src/component/PackTrack.cpp +++ b/Event/EventPacker/src/component/PackTrack.cpp @@ -82,7 +82,7 @@ StatusCode PackTrack::execute() { packer.pack( *tracks, *out ); // Packing checks - if ( UNLIKELY( m_enableCheck ) ) { + if ( m_enableCheck ) { // make new unpacked output data object LHCb::Tracks* unpacked = new LHCb::Tracks(); put( unpacked, m_inputName + "_PackingCheck" ); @@ -99,7 +99,7 @@ StatusCode PackTrack::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { const StatusCode sc = evtSvc()->unregisterObject( tracks ).andThen( [&] { delete tracks; tracks = nullptr; diff --git a/Event/EventPacker/src/component/PackTwoProngVertex.cpp b/Event/EventPacker/src/component/PackTwoProngVertex.cpp index 2620eb72326d015f7c55603e7497adbe0c5a8ab7..6f2e16c17d6dfc9dd0d57c6bf69c6f511b60d3c7 100644 --- a/Event/EventPacker/src/component/PackTwoProngVertex.cpp +++ b/Event/EventPacker/src/component/PackTwoProngVertex.cpp @@ -78,7 +78,7 @@ StatusCode PackTwoProngVertex::execute() { out->vertices().emplace_back( LHCb::PackedTwoProngVertex() ); LHCb::PackedTwoProngVertex& pVert = out->vertices().back(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Found vertex key " << vert->key() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Found vertex key " << vert->key() << endmsg; pVert.key = vert->key(); pVert.technique = vert->technique(); diff --git a/Event/EventPacker/src/component/PackUTCluster.cpp b/Event/EventPacker/src/component/PackUTCluster.cpp index e0518e0e71a66f3d5ce2f34d8336bfd5b0f70e59..1da835f4e5eb4f02dd4eafbc341e090a2b7a53f9 100644 --- a/Event/EventPacker/src/component/PackUTCluster.cpp +++ b/Event/EventPacker/src/component/PackUTCluster.cpp @@ -71,7 +71,7 @@ StatusCode PackUTCluster::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { evtSvc()->unregisterObject( clusters ).andThen( [&] { delete clusters; } ).ignore(); } else { // Clear the registry address of the unpacked container, to prevent reloading diff --git a/Event/EventPacker/src/component/PackerBaseAlg.icpp b/Event/EventPacker/src/component/PackerBaseAlg.icpp index 255d85b1670989cd9f1dda895b73503f30c88e0e..cfab6d3a91492793377ddee4dabdb99f977121a1 100644 --- a/Event/EventPacker/src/component/PackerBaseAlg.icpp +++ b/Event/EventPacker/src/component/PackerBaseAlg.icpp @@ -87,7 +87,7 @@ StatusCode Pack<PACKER>::execute() { } // Packing checks - if ( UNLIKELY( m_enableCheck ) ) { + if ( m_enableCheck ) { // make new unpacked output data object auto* unpacked = new typename PACKER::DataVector(); @@ -113,7 +113,7 @@ StatusCode Pack<PACKER>::execute() { } // If requested, remove the input data from the TES and delete - if ( UNLIKELY( m_deleteInput ) ) { + if ( m_deleteInput ) { const auto sc = evtSvc()->unregisterObject( data ); if ( sc.isSuccess() ) { delete data; diff --git a/Event/EventPacker/src/component/UnpackCluster.cpp b/Event/EventPacker/src/component/UnpackCluster.cpp index 0795d301cac918291b249f86626f4bfe98349cf8..c9adc18252344da18b988c87558dc4e1930cad0b 100644 --- a/Event/EventPacker/src/component/UnpackCluster.cpp +++ b/Event/EventPacker/src/component/UnpackCluster.cpp @@ -117,7 +117,7 @@ StatusCode UnpackCluster::execute() { if ( m_utClus ) { std::sort( m_utClus->begin(), m_utClus->end(), compareKeys<LHCb::UTCluster> ); } //== If we stored in a different location, compare... - if ( UNLIKELY( !m_extension.empty() ) ) { + if ( !m_extension.empty() ) { LHCb::UTClusters* utRef = get<LHCb::UTClusters>( LHCb::UTClusterLocation::UTClusters ); for ( LHCb::UTClusters::iterator itU = utClus()->begin(); utClus()->end() != itU; ++itU ) { LHCb::UTCluster* sCl = *itU; diff --git a/Event/EventPacker/src/component/UnpackTrack.cpp b/Event/EventPacker/src/component/UnpackTrack.cpp index 1db32422d063db13cd6f461a27e25d7769648c1a..474d6b08071086243fe5154a77e9c969aae96a4c 100644 --- a/Event/EventPacker/src/component/UnpackTrack.cpp +++ b/Event/EventPacker/src/component/UnpackTrack.cpp @@ -80,7 +80,7 @@ StatusCode UnpackTrack::execute() { const auto* ancest = targetTracks->object( track->key() ); if ( ancest ) { track->addToAncestors( ancest ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Add ancestor for track " << track->key() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Add ancestor for track " << track->key() << endmsg; } } } diff --git a/Event/EventPacker/src/lib/PackedCaloHypo.cpp b/Event/EventPacker/src/lib/PackedCaloHypo.cpp index 53d85c2760ebe7d3735f1b2d568a3afc2ae40b42..6bd581f0d2d2f6262bb3492ac5c2c5ca3b3e64cc 100644 --- a/Event/EventPacker/src/lib/PackedCaloHypo.cpp +++ b/Event/EventPacker/src/lib/PackedCaloHypo.cpp @@ -82,8 +82,8 @@ void CaloHypoPacker::pack( const DataVector& hypos, PackedDataVector& phypos ) c for ( const auto& dig : H->digits() ) { if ( dig.target() ) { phypos.refs().push_back( - UNLIKELY( 0 == ver ) ? StandardPacker::reference32( &parent(), &phypos, dig->parent(), dig->key().all() ) - : StandardPacker::reference64( &phypos, dig->parent(), dig->key().all() ) ); + 0 == ver ? StandardPacker::reference32( &parent(), &phypos, dig->parent(), dig->key().all() ) + : StandardPacker::reference64( &phypos, dig->parent(), dig->key().all() ) ); } else { parent().Warning( "Null CaloDigit SmartRef found" ).ignore(); } @@ -94,7 +94,7 @@ void CaloHypoPacker::pack( const DataVector& hypos, PackedDataVector& phypos ) c pH.firstCluster = phypos.refs().size(); for ( const auto& clu : H->clusters() ) { if ( clu.target() ) { - phypos.refs().push_back( UNLIKELY( 0 == ver ) + phypos.refs().push_back( 0 == ver ? StandardPacker::reference32( &parent(), &phypos, clu->parent(), clu->key() ) : StandardPacker::reference64( &phypos, clu->parent(), clu->key() ) ); } else { @@ -107,9 +107,8 @@ void CaloHypoPacker::pack( const DataVector& hypos, PackedDataVector& phypos ) c pH.firstHypo = phypos.refs().size(); for ( const auto& iH : H->hypos() ) { if ( iH.target() ) { - phypos.refs().push_back( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &phypos, iH->parent(), iH->key() ) - : StandardPacker::reference64( &phypos, iH->parent(), iH->key() ) ); + phypos.refs().push_back( 0 == ver ? StandardPacker::reference32( &parent(), &phypos, iH->parent(), iH->key() ) + : StandardPacker::reference64( &phypos, iH->parent(), iH->key() ) ); } else { parent().Warning( "Null CaloCluster CaloHypo found" ).ignore(); } diff --git a/Event/EventPacker/src/lib/PackedEventChecks.cpp b/Event/EventPacker/src/lib/PackedEventChecks.cpp index 557789c58644eeea0517ad06a6b0aaa098eb47f1..36299d283b60c38ff7ae2f36e13202102292add0 100644 --- a/Event/EventPacker/src/lib/PackedEventChecks.cpp +++ b/Event/EventPacker/src/lib/PackedEventChecks.cpp @@ -31,7 +31,7 @@ bool DataChecks::comparePoints( const std::string& name, const Gaudi::XYZPoint& const double tol ) const { const bool ok = ( std::fabs( a.x() - b.x() ) < tol && std::fabs( a.y() - b.y() ) < tol && std::fabs( a.z() - b.z() ) < tol ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original " << a.x() << " " << a.y() << " " << a.z() << endmsg << " Unpacked " << b.x() << " " << b.y() << " " << b.z() << endmsg << " Diff. " << std::fabs( a.x() - b.x() ) << " " << std::fabs( a.y() - b.y() ) << " " @@ -53,7 +53,7 @@ bool DataChecks::compareVectors( const std::string& name, const Gaudi::XYZVector const double tol ) const { const bool ok = ( std::fabs( a.x() - b.x() ) < tol && std::fabs( a.y() - b.y() ) < tol && std::fabs( a.z() - b.z() ) < tol ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original " << a.x() << " " << a.y() << " " << a.z() << endmsg << " Unpacked " << b.x() << " " << b.y() << " " << b.z() << endmsg << " Diff " << std::fabs( a.x() - b.x() ) << " " << std::fabs( a.y() - b.y() ) << " " @@ -75,7 +75,7 @@ bool DataChecks::compareVectors( const std::string& name, const Gaudi::Vector3& const double tol ) const { const bool ok = ( std::fabs( a[0] - b[0] ) < tol && std::fabs( a[1] - b[1] ) < tol && std::fabs( a[2] - b[2] ) < tol ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original " << a[0] << " " << a[1] << " " << a[2] << endmsg << " Unpacked " << b[0] << " " << b[1] << " " << b[2] << endmsg << " Diff " << std::fabs( a[0] - b[0] ) << " " << std::fabs( a[1] - b[1] ) << " " << std::fabs( a[2] - b[2] ) @@ -96,7 +96,7 @@ bool DataChecks::compareVectors( const std::string& name, const Gaudi::Vector3& bool DataChecks::compareVectors( const std::string& name, const Gaudi::Vector2& a, const Gaudi::Vector2& b, const double tol ) const { const bool ok = ( std::fabs( a[0] - b[0] ) < tol && std::fabs( a[1] - b[1] ) < tol ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original " << a[0] << " " << a[1] << endmsg << " Unpacked " << b[0] << " " << b[1] << endmsg << " Diff " << std::fabs( a[0] - b[0] ) << " " << std::fabs( a[1] - b[1] ) << endmsg; @@ -112,7 +112,7 @@ bool DataChecks::compareVectors( const std::string& name, const Gaudi::Vector2& bool DataChecks::compareDoubles( const std::string& name, const double& a, const double& b, const double tol ) const { const bool ok = ( std::fabs( a - b ) < tol ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original = " << a << endmsg << " Unpacked = " << b << endmsg << " Diff = " << std::fabs( a - b ) << " > " << tol << endmsg; } @@ -124,7 +124,7 @@ bool DataChecks::compareDoubles( const std::string& name, const double& a, const bool DataChecks::compareFloats( const std::string& name, const float& a, const float& b, const float tol ) const { const bool ok = ( std::fabs( a - b ) < tol ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { parent->warning() << name << " comparison failed :-" << endmsg << " Original = " << a << endmsg << " Unpacked = " << b << endmsg << " Diff = " << std::fabs( a - b ) << " > " << tol << endmsg; } diff --git a/Event/EventPacker/src/lib/PackedMCCaloHit.cpp b/Event/EventPacker/src/lib/PackedMCCaloHit.cpp index bf3c1ed8ad291332421be314cf03c76886f08570..f25131631383b3f1f5eba239d9d14bf2884171ec 100644 --- a/Event/EventPacker/src/lib/PackedMCCaloHit.cpp +++ b/Event/EventPacker/src/lib/PackedMCCaloHit.cpp @@ -26,7 +26,7 @@ void MCCaloHitPacker::pack( const DataVector& hits, PackedDataVector& phits ) co phit.time = hit->time(); if ( hit->particle() ) { phit.mcParticle = - ( UNLIKELY( 0 == ver ) + ( 0 == ver ? StandardPacker::reference32( &parent(), &phits, hit->particle()->parent(), hit->particle()->key() ) : StandardPacker::reference64( &phits, hit->particle()->parent(), hit->particle()->key() ) ); } diff --git a/Event/EventPacker/src/lib/PackedMCHit.cpp b/Event/EventPacker/src/lib/PackedMCHit.cpp index 3a880bb2223a13f409af7d3ef4d2a5c4fe47b865..5fcf56a73ff872f3ca0c4e08e933c5484ad41203 100644 --- a/Event/EventPacker/src/lib/PackedMCHit.cpp +++ b/Event/EventPacker/src/lib/PackedMCHit.cpp @@ -34,10 +34,9 @@ void MCHitPacker::pack( const DataVector& hits, PackedDataVector& phits ) const phit.mp = StandardPacker::energy( hit->p() ); if ( hit->mcParticle() ) { phit.mcParticle = - ( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &phits, hit->mcParticle()->parent(), - hit->mcParticle()->key() ) - : StandardPacker::reference64( &phits, hit->mcParticle()->parent(), hit->mcParticle()->key() ) ); + ( 0 == ver ? StandardPacker::reference32( &parent(), &phits, hit->mcParticle()->parent(), + hit->mcParticle()->key() ) + : StandardPacker::reference64( &phits, hit->mcParticle()->parent(), hit->mcParticle()->key() ) ); } } } diff --git a/Event/EventPacker/src/lib/PackedMCRichDigitSummary.cpp b/Event/EventPacker/src/lib/PackedMCRichDigitSummary.cpp index 8f433be58dc9b8b31f8e57b6c7ee997699c6f547..ead74e55fb7c33fa17ae52568ff7aca5c8629354 100644 --- a/Event/EventPacker/src/lib/PackedMCRichDigitSummary.cpp +++ b/Event/EventPacker/src/lib/PackedMCRichDigitSummary.cpp @@ -27,10 +27,9 @@ void MCRichDigitSummaryPacker::pack( const DataVector& sums, PackedDataVector& p psum.richSmartID = sum->richSmartID().key(); if ( sum->mcParticle() ) { psum.mcParticle = - ( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &psums, sum->mcParticle()->parent(), - sum->mcParticle()->key() ) - : StandardPacker::reference64( &psums, sum->mcParticle()->parent(), sum->mcParticle()->key() ) ); + ( 0 == ver ? StandardPacker::reference32( &parent(), &psums, sum->mcParticle()->parent(), + sum->mcParticle()->key() ) + : StandardPacker::reference64( &psums, sum->mcParticle()->parent(), sum->mcParticle()->key() ) ); } } } diff --git a/Event/EventPacker/src/lib/PackedMCRichHit.cpp b/Event/EventPacker/src/lib/PackedMCRichHit.cpp index 43cab0fdd96f413c5aba87786f9ce6b8f0afa263..d743071db04612ecfcf2539fde0d4c06d49e7e26 100644 --- a/Event/EventPacker/src/lib/PackedMCRichHit.cpp +++ b/Event/EventPacker/src/lib/PackedMCRichHit.cpp @@ -30,10 +30,9 @@ void MCRichHitPacker::pack( const DataVector& hits, PackedDataVector& phits ) co phit.history = hit->historyCode(); if ( hit->mcParticle() ) { phit.mcParticle = - ( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &phits, hit->mcParticle()->parent(), - hit->mcParticle()->key() ) - : StandardPacker::reference64( &phits, hit->mcParticle()->parent(), hit->mcParticle()->key() ) ); + ( 0 == ver ? StandardPacker::reference32( &parent(), &phits, hit->mcParticle()->parent(), + hit->mcParticle()->key() ) + : StandardPacker::reference64( &phits, hit->mcParticle()->parent(), hit->mcParticle()->key() ) ); } } } diff --git a/Event/EventPacker/src/lib/PackedMCRichOpticalPhoton.cpp b/Event/EventPacker/src/lib/PackedMCRichOpticalPhoton.cpp index 15fbd315405726390cd4a1818955ada351e61a35..23be455768031b2e17293593dee25ef19236d707 100644 --- a/Event/EventPacker/src/lib/PackedMCRichOpticalPhoton.cpp +++ b/Event/EventPacker/src/lib/PackedMCRichOpticalPhoton.cpp @@ -58,11 +58,10 @@ void MCRichOpticalPhotonPacker::pack( const DataVector& phots, PackedDataVector& pphot.hpdqwz = StandardPacker::position( phot->hpdQWIncidencePoint().z() ); if ( phot->mcRichHit() ) { - pphot.mcrichhit = - ( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &pphots, phot->mcRichHit()->parent(), - phot->mcRichHit()->index() ) - : StandardPacker::reference64( &pphots, phot->mcRichHit()->parent(), phot->mcRichHit()->index() ) ); + pphot.mcrichhit = ( 0 == ver ? StandardPacker::reference32( &parent(), &pphots, phot->mcRichHit()->parent(), + phot->mcRichHit()->index() ) + : StandardPacker::reference64( &pphots, phot->mcRichHit()->parent(), + phot->mcRichHit()->index() ) ); } } } diff --git a/Event/EventPacker/src/lib/PackedMCRichSegment.cpp b/Event/EventPacker/src/lib/PackedMCRichSegment.cpp index 44842c5cfd3d3fc00bcb580e16629294c6502ee5..53e623888b01d1baa8a4c4176a4987c8c676195b 100644 --- a/Event/EventPacker/src/lib/PackedMCRichSegment.cpp +++ b/Event/EventPacker/src/lib/PackedMCRichSegment.cpp @@ -46,32 +46,28 @@ void MCRichSegmentPacker::pack( const DataVector& segs, PackedDataVector& psegs if ( seg->mcParticle() ) { pseg.mcParticle = - ( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &psegs, seg->mcParticle()->parent(), - seg->mcParticle()->key() ) - : StandardPacker::reference64( &psegs, seg->mcParticle()->parent(), seg->mcParticle()->key() ) ); + ( 0 == ver ? StandardPacker::reference32( &parent(), &psegs, seg->mcParticle()->parent(), + seg->mcParticle()->key() ) + : StandardPacker::reference64( &psegs, seg->mcParticle()->parent(), seg->mcParticle()->key() ) ); } if ( seg->mcRichTrack() ) { - pseg.mcRichTrack = - ( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &psegs, seg->mcRichTrack()->parent(), - seg->mcRichTrack()->key() ) - : StandardPacker::reference64( &psegs, seg->mcRichTrack()->parent(), seg->mcRichTrack()->key() ) ); + pseg.mcRichTrack = ( 0 == ver ? StandardPacker::reference32( &parent(), &psegs, seg->mcRichTrack()->parent(), + seg->mcRichTrack()->key() ) + : StandardPacker::reference64( &psegs, seg->mcRichTrack()->parent(), + seg->mcRichTrack()->key() ) ); } pseg.mcPhotons.reserve( seg->mcRichOpticalPhotons().size() ); for ( const auto& P : seg->mcRichOpticalPhotons() ) { - pseg.mcPhotons.push_back( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &psegs, P->parent(), P->key() ) - : StandardPacker::reference64( &psegs, P->parent(), P->key() ) ); + pseg.mcPhotons.push_back( 0 == ver ? StandardPacker::reference32( &parent(), &psegs, P->parent(), P->key() ) + : StandardPacker::reference64( &psegs, P->parent(), P->key() ) ); } pseg.mcHits.reserve( seg->mcRichHits().size() ); for ( const auto& H : seg->mcRichHits() ) { - pseg.mcHits.push_back( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &psegs, H->parent(), H.linkID() ) - : StandardPacker::reference64( &psegs, H->parent(), H.linkID() ) ); + pseg.mcHits.push_back( 0 == ver ? StandardPacker::reference32( &parent(), &psegs, H->parent(), H.linkID() ) + : StandardPacker::reference64( &psegs, H->parent(), H.linkID() ) ); } } } diff --git a/Event/EventPacker/src/lib/PackedMCRichTrack.cpp b/Event/EventPacker/src/lib/PackedMCRichTrack.cpp index 5ec500e43ac30f2c1726c1803b6f51415bdd932e..a042bf64fb3312fe72ddff9fa4c482b5aede4930 100644 --- a/Event/EventPacker/src/lib/PackedMCRichTrack.cpp +++ b/Event/EventPacker/src/lib/PackedMCRichTrack.cpp @@ -25,17 +25,17 @@ void MCRichTrackPacker::pack( const DataVector& tracks, PackedDataVector& ptrack ptrack.key = track->key(); for ( const auto& S : track->mcSegments() ) { - ptrack.mcSegments.emplace_back( UNLIKELY( 0 == ver ) + ptrack.mcSegments.emplace_back( 0 == ver ? StandardPacker::reference32( &parent(), &ptracks, S->parent(), S->key() ) : StandardPacker::reference64( &ptracks, S->parent(), S->key() ) ); } if ( track->mcParticle() ) { ptrack.mcParticle = - ( UNLIKELY( 0 == ver ) ? StandardPacker::reference32( &parent(), &ptracks, track->mcParticle()->parent(), - track->mcParticle()->key() ) - : StandardPacker::reference64( &ptracks, track->mcParticle()->parent(), - track->mcParticle()->key() ) ); + ( 0 == ver ? StandardPacker::reference32( &parent(), &ptracks, track->mcParticle()->parent(), + track->mcParticle()->key() ) + : StandardPacker::reference64( &ptracks, track->mcParticle()->parent(), + track->mcParticle()->key() ) ); } } } diff --git a/Event/EventPacker/src/lib/PackedMuonPID.cpp b/Event/EventPacker/src/lib/PackedMuonPID.cpp index c19d773a71e17ed67b368bdf792be27d89bc56d2..f124e1a7f2541c031a1eaaa5fa9c0e3e9c95f74b 100644 --- a/Event/EventPacker/src/lib/PackedMuonPID.cpp +++ b/Event/EventPacker/src/lib/PackedMuonPID.cpp @@ -30,13 +30,12 @@ void MuonPIDPacker::pack( const Data& pid, PackedData& ppid, PackedDataVector& p ppid.status = (int)pid.Status(); if ( pid.idTrack() ) { ppid.idtrack = - ( UNLIKELY( 1 >= ver ) - ? StandardPacker::reference32( &parent(), &ppids, pid.idTrack()->parent(), pid.idTrack()->key() ) - : StandardPacker::reference64( &ppids, pid.idTrack()->parent(), pid.idTrack()->key() ) ); + ( 1 >= ver ? StandardPacker::reference32( &parent(), &ppids, pid.idTrack()->parent(), pid.idTrack()->key() ) + : StandardPacker::reference64( &ppids, pid.idTrack()->parent(), pid.idTrack()->key() ) ); } if ( pid.muonTrack() ) { ppid.mutrack = - ( UNLIKELY( 1 >= ver ) + ( 1 >= ver ? StandardPacker::reference32( &parent(), &ppids, pid.muonTrack()->parent(), pid.muonTrack()->key() ) : StandardPacker::reference64( &ppids, pid.muonTrack()->parent(), pid.muonTrack()->key() ) ); } diff --git a/Event/EventPacker/src/lib/PackedPartToRelatedInfoRelation.cpp b/Event/EventPacker/src/lib/PackedPartToRelatedInfoRelation.cpp index 6d7274398734aeca624a02d41657748467e5b971..3838e5af5a2172664aed7df7191b35c5345907b6 100644 --- a/Event/EventPacker/src/lib/PackedPartToRelatedInfoRelation.cpp +++ b/Event/EventPacker/src/lib/PackedPartToRelatedInfoRelation.cpp @@ -81,7 +81,7 @@ void RelatedInfoRelationsPacker::unpack( const LHCb::PackedRelatedInfoMap& pmap, const auto* link = ( linkMgr ? linkMgr->link( srcLink ) : nullptr ); const auto& srcName = ( link ? link->path() : "" ); const auto* srcContainer = ( !srcName.empty() ? parent().getIfExists<LHCb::Particles>( srcName ) : nullptr ); - if ( UNLIKELY( !srcContainer ) ) { + if ( !srcContainer ) { parent().Error( "Failed to load container '" + srcName + "'" ).ignore(); } else { // Get the source object diff --git a/Event/EventPacker/src/lib/PackedProtoParticle.cpp b/Event/EventPacker/src/lib/PackedProtoParticle.cpp index 4391b6893e4d36379a63f89ca248036f851ae156..6c62748101b0f11c5d1e23a7b66de5c857b0aff0 100644 --- a/Event/EventPacker/src/lib/PackedProtoParticle.cpp +++ b/Event/EventPacker/src/lib/PackedProtoParticle.cpp @@ -26,14 +26,13 @@ void ProtoParticlePacker::pack( const Data& proto, PackedData& pproto, PackedDat if ( parent().msgLevel( MSG::VERBOSE ) ) parent().verbose() << "Packing ProtoParticle " << proto.key() << " Ver=" << (int)ver << endmsg; - if ( UNLIKELY( ver == 0 ) ) + if ( ver == 0 ) parent().Warning( "Packinger Version requested will Create obsolete 32bit packed reference" ).ignore(); if ( proto.track() ) { pproto.track = - ( UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &pprotos, proto.track()->parent(), proto.track()->key() ) - : StandardPacker::reference64( &pprotos, proto.track()->parent(), proto.track()->key() ) ); + ( 0 == ver ? StandardPacker::reference32( &parent(), &pprotos, proto.track()->parent(), proto.track()->key() ) + : StandardPacker::reference64( &pprotos, proto.track()->parent(), proto.track()->key() ) ); if ( parent().msgLevel( MSG::VERBOSE ) ) parent().verbose() << " -> Track " << proto.track() << " " << proto.track()->parent()->registry()->identifier() << " " << pproto.track << endmsg; @@ -43,7 +42,7 @@ void ProtoParticlePacker::pack( const Data& proto, PackedData& pproto, PackedDat if ( proto.richPID() ) { pproto.richPID = - ( UNLIKELY( 0 == ver ) + ( 0 == ver ? StandardPacker::reference32( &parent(), &pprotos, proto.richPID()->parent(), proto.richPID()->key() ) : StandardPacker::reference64( &pprotos, proto.richPID()->parent(), proto.richPID()->key() ) ); if ( parent().msgLevel( MSG::VERBOSE ) ) @@ -55,7 +54,7 @@ void ProtoParticlePacker::pack( const Data& proto, PackedData& pproto, PackedDat if ( proto.muonPID() ) { pproto.muonPID = - ( UNLIKELY( 0 == ver ) + ( 0 == ver ? StandardPacker::reference32( &parent(), &pprotos, proto.muonPID()->parent(), proto.muonPID()->key() ) : StandardPacker::reference64( &pprotos, proto.muonPID()->parent(), proto.muonPID()->key() ) ); if ( parent().msgLevel( MSG::VERBOSE ) ) @@ -68,7 +67,7 @@ void ProtoParticlePacker::pack( const Data& proto, PackedData& pproto, PackedDat //== Store the CaloHypos pproto.firstHypo = pprotos.refs().size(); for ( const auto& caloH : proto.calo() ) { - pprotos.refs().push_back( UNLIKELY( 0 == ver ) + pprotos.refs().push_back( 0 == ver ? StandardPacker::reference32( &parent(), &pprotos, caloH->parent(), caloH->key() ) : StandardPacker::reference64( &pprotos, caloH->parent(), caloH->key() ) ); if ( parent().msgLevel( MSG::VERBOSE ) ) diff --git a/Event/EventPacker/src/lib/PackedRecVertex.cpp b/Event/EventPacker/src/lib/PackedRecVertex.cpp index a1a34fa232e4e83d2286ddddf05b9c7d085f6949..c8c6ee09bfdb054067e52e0fc14d04f2833d8e09 100644 --- a/Event/EventPacker/src/lib/PackedRecVertex.cpp +++ b/Event/EventPacker/src/lib/PackedRecVertex.cpp @@ -44,9 +44,8 @@ void RecVertexPacker::pack( const Data& vert, PackedData& pvert, const DataVecto for ( auto itT = vert.tracks().begin(); vert.tracks().end() != itT; ++itT, ++iW ) { if ( *itT ) { pverts.refs().push_back( - UNLIKELY( 0 == ver ) - ? StandardPacker::reference32( &parent(), &pverts, ( *itT )->parent(), ( *itT )->key() ) - : StandardPacker::reference64( &pverts, ( *itT )->parent(), ( *itT )->key() ) ); + 0 == ver ? StandardPacker::reference32( &parent(), &pverts, ( *itT )->parent(), ( *itT )->key() ) + : StandardPacker::reference64( &pverts, ( *itT )->parent(), ( *itT )->key() ) ); pverts.weights().push_back( StandardPacker::fraction( *iW ) ); } else { parent() diff --git a/Event/EventPacker/src/lib/PackedRichPID.cpp b/Event/EventPacker/src/lib/PackedRichPID.cpp index c89549c8414e4282f319ccbae2c637631a84ad91..5005e4f860894a112340f21d35cac151e1da3c7e 100644 --- a/Event/EventPacker/src/lib/PackedRichPID.cpp +++ b/Event/EventPacker/src/lib/PackedRichPID.cpp @@ -25,9 +25,9 @@ void RichPIDPacker::pack( const Data& pid, PackedData& ppid, PackedDataVector& p if ( ver > 0 ) ppid.dllBt = StandardPacker::deltaLL( pid.particleDeltaLL( Rich::BelowThreshold ) ); if ( ver > 3 ) ppid.dllDe = StandardPacker::deltaLL( pid.particleDeltaLL( Rich::Deuteron ) ); if ( nullptr != pid.track() ) { - ppid.track = ( UNLIKELY( ver < 3 ) - ? StandardPacker::reference32( &parent(), &ppids, pid.track()->parent(), pid.track()->key() ) - : StandardPacker::reference64( &ppids, pid.track()->parent(), pid.track()->key() ) ); + ppid.track = + ( ver < 3 ? StandardPacker::reference32( &parent(), &ppids, pid.track()->parent(), pid.track()->key() ) + : StandardPacker::reference64( &ppids, pid.track()->parent(), pid.track()->key() ) ); } } } diff --git a/Event/EventPacker/src/lib/PackedTrack.cpp b/Event/EventPacker/src/lib/PackedTrack.cpp index 8d061d8c6d83527d28ecedacaa05a0e2b0386449..faf4228a56b616db85087a15e926e79b6f974a48 100644 --- a/Event/EventPacker/src/lib/PackedTrack.cpp +++ b/Event/EventPacker/src/lib/PackedTrack.cpp @@ -30,7 +30,7 @@ void TrackPacker::pack( const Data& track, PackedData& ptrack, PackedDataVector& ptrack.firstId = ptracks.ids().size(); for ( const auto& id : track.lhcbIDs() ) { ptracks.ids().push_back( id.lhcbID() ); } ptrack.lastId = ptracks.ids().size(); - if ( UNLIKELY( parent().msgLevel( MSG::DEBUG ) ) ) { + if ( parent().msgLevel( MSG::DEBUG ) ) { parent().debug() << "Stored LHCbIDs from " << ptrack.firstId << " to " << ptrack.lastId << endmsg; } @@ -38,7 +38,7 @@ void TrackPacker::pack( const Data& track, PackedData& ptrack, PackedDataVector& ptrack.firstState = ptracks.states().size(); for ( const auto* S : track.states() ) { convertState( *S, ptracks ); } ptrack.lastState = ptracks.states().size(); - if ( UNLIKELY( parent().msgLevel( MSG::DEBUG ) ) ) { + if ( parent().msgLevel( MSG::DEBUG ) ) { parent().debug() << "Stored states from " << ptrack.firstState << " to " << ptrack.lastState << endmsg; } @@ -138,7 +138,7 @@ void TrackPacker::unpack( const PackedData& ptrack, Data& track, const PackedDat int lastId = ptrack.lastId; // Apply protection for short int wrapping - if ( UNLIKELY( ver < 5 && ptracks.ids().size() > std::numeric_limits<uint8_t>::max() ) ) { + if ( ver < 5 && ptracks.ids().size() > std::numeric_limits<uint8_t>::max() ) { firstId = m_firstIdHigh + ptrack.firstId; lastId = m_lastIdHigh + ptrack.lastId; if ( lastId < firstId ) { // we wrapped in the track @@ -150,7 +150,7 @@ void TrackPacker::unpack( const PackedData& ptrack, Data& track, const PackedDat } // Check firstId and lastID are sane - if ( UNLIKELY( lastId > static_cast<int>( ptracks.ids().size() ) || firstId > lastId ) ) { + if ( lastId > static_cast<int>( ptracks.ids().size() ) || firstId > lastId ) { parent() .Warning( "Attempted out-of-range access to packed LHCbIDs. " "This is bad, do not ignore !" ) @@ -172,7 +172,7 @@ void TrackPacker::unpack( const PackedData& ptrack, Data& track, const PackedDat int lastState = ptrack.lastState; // protection for short int wrapping - if ( UNLIKELY( ver < 5 && ptracks.states().size() > std::numeric_limits<uint8_t>::max() ) ) { + if ( ver < 5 && ptracks.states().size() > std::numeric_limits<uint8_t>::max() ) { firstState = m_firstStateHigh + ptrack.firstState; lastState = m_lastStateHigh + ptrack.lastState; if ( lastState < firstState ) { // we wrapped in the track @@ -184,7 +184,7 @@ void TrackPacker::unpack( const PackedData& ptrack, Data& track, const PackedDat } // check the indices are sane - if ( UNLIKELY( lastState > static_cast<int>( ptracks.states().size() ) || firstState > lastState ) ) { + if ( lastState > static_cast<int>( ptracks.states().size() ) || firstState > lastState ) { parent() .Warning( "Attempted out-of-range access to packed States. " "This is bad, do not ignore !" ) @@ -202,7 +202,7 @@ void TrackPacker::unpack( const PackedData& ptrack, Data& track, const PackedDat int lastExtra = ptrack.lastExtra; // protect against short int wrapping - if ( UNLIKELY( ver < 5 && ptracks.extras().size() > std::numeric_limits<uint8_t>::max() ) ) { + if ( ver < 5 && ptracks.extras().size() > std::numeric_limits<uint8_t>::max() ) { firstExtra = m_firstExtraHigh + ptrack.firstExtra; lastExtra = m_lastExtraHigh + ptrack.lastExtra; if ( lastExtra < firstExtra ) { // we wrapped in the track @@ -214,7 +214,7 @@ void TrackPacker::unpack( const PackedData& ptrack, Data& track, const PackedDat } // sanity checks on the indices - if ( UNLIKELY( lastExtra > static_cast<int>( ptracks.extras().size() ) || firstExtra > lastExtra ) ) { + if ( lastExtra > static_cast<int>( ptracks.extras().size() ) || firstExtra > lastExtra ) { parent() .Warning( "Attempted out-of-range access to packed ExtraInfo. " "This is bad, do not ignore !" ) @@ -228,7 +228,7 @@ void TrackPacker::unpack( const PackedData& ptrack, Data& track, const PackedDat { track.addInfo( info.first, StandardPacker::fltPacked( info.second ) ); } ); //== Cleanup extraInfo and set likelihood/ghostProbability for old data - if ( UNLIKELY( ver <= 2 ) ) { + if ( ver <= 2 ) { track.eraseInfo( LHCb::Track::AdditionalInfo::PatQuality ); track.eraseInfo( LHCb::Track::AdditionalInfo::Cand1stQPat ); track.eraseInfo( LHCb::Track::AdditionalInfo::Cand2ndQPat ); diff --git a/Event/RecEvent/include/Event/CaloClusters_v2.h b/Event/RecEvent/include/Event/CaloClusters_v2.h index a2b06084d01e1457697cad31d3026ad552bd1d05..92c668b7348adcb58c137cbd843b1d98638f185e 100644 --- a/Event/RecEvent/include/Event/CaloClusters_v2.h +++ b/Event/RecEvent/include/Event/CaloClusters_v2.h @@ -309,7 +309,7 @@ namespace LHCb::Event::Calo { m_index.fill( -1 ); for ( auto&& [i, cluster] : range::enumerate( *m_parent, int16_t{0} ) ) { auto& idx = m_index[LHCb::Calo::Index{cluster.cellID()}]; - if ( UNLIKELY( idx != -1 ) ) { + if ( idx != -1 ) { // oops -- not unique, so flag, and just give up... m_parent = nullptr; return; diff --git a/Event/TrackEvent/include/Event/PrFittedForwardTracks.h b/Event/TrackEvent/include/Event/PrFittedForwardTracks.h index b3e215a43416362a2b543db86b70fb766cc3b440..73e5c83fc3a72d03540148612ca7957cd415679b 100644 --- a/Event/TrackEvent/include/Event/PrFittedForwardTracks.h +++ b/Event/TrackEvent/include/Event/PrFittedForwardTracks.h @@ -227,7 +227,7 @@ namespace LHCb::Pr::Fitted::Forward { auto nHits() const { auto const* forward = this->m_Tracks->getForwardAncestors(); - if ( UNLIKELY( !forward ) ) { + if ( !forward ) { throw GaudiException{"No long track ancestors!", "LHCb::Pr::Fitted::Forward::Tracks::nHits", StatusCode::FAILURE}; } diff --git a/Event/TrackEvent/include/Event/Track_v1.h b/Event/TrackEvent/include/Event/Track_v1.h index 4d22545e2eb5d5362caf4613bc38f89e28767e75..325ff79293be8ffc9a81a5ea76b7468be6881444 100644 --- a/Event/TrackEvent/include/Event/Track_v1.h +++ b/Event/TrackEvent/include/Event/Track_v1.h @@ -1365,23 +1365,21 @@ namespace LHCb::Event { inline State& LHCb::Event::v1::Track::firstState() { // check at least the "first state" exists - if ( UNLIKELY( m_states.empty() ) ) - throw GaudiException( "first state not defined!", "Track.h", StatusCode::FAILURE ); + if ( m_states.empty() ) throw GaudiException( "first state not defined!", "Track.h", StatusCode::FAILURE ); return *m_states[0]; } inline const State& LHCb::Event::v1::Track::firstState() const { // check at least the "first state" exists - if ( UNLIKELY( m_states.empty() ) ) - throw GaudiException( "first state not defined!", "Track.h", StatusCode::FAILURE ); + if ( m_states.empty() ) throw GaudiException( "first state not defined!", "Track.h", StatusCode::FAILURE ); return *m_states[0]; } inline int LHCb::Event::v1::Track::charge() const { double qP = firstState().qOverP(); - return UNLIKELY( std::abs( qP ) < TrackParameters::lowTolerance ) ? 0 : qP < 0 ? -1 : +1; + return std::abs( qP ) < TrackParameters::lowTolerance ? 0 : qP < 0 ? -1 : +1; } inline double LHCb::Event::v1::Track::chi2() const { return ( m_chi2PerDoF * double( m_nDoF ) ); } diff --git a/Event/TrackEvent/src/Track_v1.cpp b/Event/TrackEvent/src/Track_v1.cpp index fa31288b2e6e81c94828e107a64f3b680c0fc0de..782d6220ebba7aef99c8549e80a4562fc681037f 100644 --- a/Event/TrackEvent/src/Track_v1.cpp +++ b/Event/TrackEvent/src/Track_v1.cpp @@ -35,7 +35,7 @@ namespace { template <typename F> constexpr decltype( auto ) with_order( useDecreasingOrder decreasing, F&& f ) { - return with_selection_invoke( UNLIKELY( static_cast<bool>( decreasing ) ), TrackFunctor::decreasingByZ(), + return with_selection_invoke( static_cast<bool>( decreasing ), TrackFunctor::decreasingByZ(), TrackFunctor::increasingByZ(), std::forward<F>( f ) ); } } // namespace diff --git a/Event/TrackEvent/src/Track_v2.cpp b/Event/TrackEvent/src/Track_v2.cpp index 97a823871360f04c467bec7f185a0dce1aae8dc0..387b7c4b07e06cfd91528c00988e803bc37b30c1 100644 --- a/Event/TrackEvent/src/Track_v2.cpp +++ b/Event/TrackEvent/src/Track_v2.cpp @@ -35,7 +35,7 @@ namespace { template <typename F> constexpr decltype( auto ) with_order( useDecreasingOrder decreasing, F&& f ) { - return with_selection_invoke( UNLIKELY( static_cast<bool>( decreasing ) ), TrackFunctor::decreasingByZ(), + return with_selection_invoke( static_cast<bool>( decreasing ), TrackFunctor::decreasingByZ(), TrackFunctor::increasingByZ(), std::forward<F>( f ) ); } @@ -232,7 +232,7 @@ namespace LHCb::Event::v2 { int Track::charge() const { double qP = firstState().qOverP(); - return UNLIKELY( std::abs( qP ) < TrackParameters::lowTolerance ) ? 0 : qP < 0 ? -1 : +1; + return std::abs( qP ) < TrackParameters::lowTolerance ? 0 : qP < 0 ? -1 : +1; } Track& Track::setQOverPInAllStates( float const qop ) { diff --git a/FT/FTDAQ/src/FTNZSRawBankDecoder.cpp b/FT/FTDAQ/src/FTNZSRawBankDecoder.cpp index 77b68cd81666ca17ea21f33c695a31a845255dd0..e3fec63c85ea9103fff5362b245e0f1c85a3b538 100644 --- a/FT/FTDAQ/src/FTNZSRawBankDecoder.cpp +++ b/FT/FTDAQ/src/FTNZSRawBankDecoder.cpp @@ -216,7 +216,7 @@ std::tuple<FTDigits, FTLiteClusters> FTNZSRawBankDecoder::operator()( const Even debug() << "Bank version=v" << vrsn << " with decoding version=v" << m_decodingVersion.toString() << endmsg; // Check if decoding version corresponds with bank version (only for first bank). - if ( UNLIKELY( vrsn != m_decodingVersion ) ) { + if ( vrsn != m_decodingVersion ) { error() << "Bank version=v" << vrsn << " is not compatible with decoding " << "version=v" << m_decodingVersion.toString() << endmsg; throw GaudiException( "Wrong decoding version", "FTNZSRawBankDecoder", StatusCode::FAILURE ); diff --git a/FT/FTDAQ/src/FTRawBankDecoder.cpp b/FT/FTDAQ/src/FTRawBankDecoder.cpp index e1c8414035e765b307dd548f563f8e2eca1eba66..eb457b589abe2a55b8e1df555f5eb77afcee7866 100644 --- a/FT/FTDAQ/src/FTRawBankDecoder.cpp +++ b/FT/FTDAQ/src/FTRawBankDecoder.cpp @@ -288,18 +288,18 @@ FTLiteClusters FTRawBankDecoder::decode( const EventContext& evtCtx, LHCb::RawBa unsigned sipm = modulesipm & 3; // hardcoded: this should be replaced by mapping int nClus = sipmHeader & 15; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) && nClus > 0 ) ) + if ( msgLevel( MSG::VERBOSE ) && nClus > 0 ) verbose() << " Module " << to_unsigned( module ) << " mat " << to_unsigned( mat ) << " SiPM " << sipm << " nClusters " << nClus << endmsg; - if ( UNLIKELY( nClus > std::distance( first, last ) ) ) { + if ( nClus > std::distance( first, last ) ) { warning() << "Inconsistent size of rawbank. #clusters in header=" << nClus << ", #clusters in bank=" << std::distance( first, last ) << endmsg; throw GaudiException( "Inconsistent size of rawbank", "FTRawBankDecoder", StatusCode::FAILURE ); } - if ( UNLIKELY( to_unsigned( module ) > 5 ) ) { + if ( to_unsigned( module ) > 5 ) { ++m_nonExistingModule; first += nClus; continue; @@ -333,7 +333,7 @@ FTLiteClusters FTRawBankDecoder::decode( const EventContext& evtCtx, LHCb::RawBa unsigned int diff = ( channel2 - channel ); - if ( UNLIKELY( diff > 128 ) ) { + if ( diff > 128 ) { error() << "something went terribly wrong here first fragment: " << channel << " second fragment: " << channel2 << endmsg; throw GaudiException( "There is an inconsistency between Encoder and Decoder!", "FTRawBankDecoder", @@ -451,7 +451,7 @@ FTLiteClusters FTRawBankDecoder::operator()( const EventContext& evtCtx, const L // Check if decoding version corresponds with bank version (only for first bank). // Special case for v5 data that is decoded as v4. This possibility is added // temporarily to test the tracking performance versus decoding speed. - if ( UNLIKELY( vrsn != m_decodingVersion ) && !( vrsn == 5u && m_decodingVersion == 4u ) ) { + if ( vrsn != m_decodingVersion && !( vrsn == 5u && m_decodingVersion == 4u ) ) { error() << "Bank version=v" << vrsn << " is not compatible with decoding " << "version=v" << m_decodingVersion.toString() << endmsg; throw GaudiException( "Wrong decoding version", "FTRawBankDecoder", StatusCode::FAILURE ); diff --git a/HC/HCDAQ/src/HCRawBankDecoder.cpp b/HC/HCDAQ/src/HCRawBankDecoder.cpp index 50d653f54a0caa9e437b5a3176a17ae8986a3c89..54017b9eb4ee805400f7cbf0385554841b9de23b 100644 --- a/HC/HCDAQ/src/HCRawBankDecoder.cpp +++ b/HC/HCDAQ/src/HCRawBankDecoder.cpp @@ -171,7 +171,7 @@ void HCRawBankDecoder::decode( const LHCb::RawBank& bank, LHCb::HCDigits& digits const unsigned int crate = ( word >> 18 ) & 0x1F; // Control word. const unsigned int ctrl = ( word >> 23 ) & 0x1FF; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << format( "Crate: %02u, card: %02u, ", crate, card ) << format( "trigger part: %03u bytes, ", lenTrig ) << format( "ADC part: %03u bytes", 2 * lenAdc ) << endmsg; const unsigned int ttype = ( ctrl >> 1 ) & 0xF; @@ -182,7 +182,7 @@ void HCRawBankDecoder::decode( const LHCb::RawBank& bank, LHCb::HCDigits& digits const unsigned int syncError = ctrl & 0x20; const unsigned int linkError = ctrl & 0x40; if ( generalError != 0 || syncError != 0 || linkError != 0 ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Tell1 error bits have been detected in data" << endmsg; if ( 0 != generalError ) debug() << "General error" << endmsg; if ( 0 != syncError ) debug() << "Synchronisation error" << endmsg; @@ -212,7 +212,7 @@ void HCRawBankDecoder::decode( const LHCb::RawBank& bank, LHCb::HCDigits& digits const int prs = ( word >> ( offset + 6 ) ) & 1; const int spd = ( word >> ( offset + 7 ) ) & 1; const int adc = prs; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << format( "Channel: %06u ", channel ) << format( "PRS: %01i ", prs ) << format( "SPD: %01i ", spd ) << endmsg; } @@ -252,7 +252,7 @@ void HCRawBankDecoder::decode( const LHCb::RawBank& bank, LHCb::HCDigits& digits } else { digits.insert( new LHCb::HCDigit( adc ), cell ); } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << format( "Channel: %06u ", channel ) << format( "ADC: %06i", adc ) << endmsg; } } diff --git a/HC/HCDAQ/src/HCRawBankDecoderHlt.cpp b/HC/HCDAQ/src/HCRawBankDecoderHlt.cpp index 698f5b11e2a58162d851a2f9b61aff57bcbff65e..83729e2d8ec27de6ff7fbdd1762ffac29b6e924a 100644 --- a/HC/HCDAQ/src/HCRawBankDecoderHlt.cpp +++ b/HC/HCDAQ/src/HCRawBankDecoderHlt.cpp @@ -86,7 +86,7 @@ StatusCode HCRawBankDecoderHlt::execute() { } const unsigned int source = bank->sourceID(); const unsigned int version = bank->version(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "Source: " << source << ", version: " << version << endmsg; } + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Source: " << source << ", version: " << version << endmsg; } // Decode the raw bank. if ( version == 2 || version == 3 ) { decode( *bank, sums ); @@ -150,7 +150,7 @@ bool HCRawBankDecoderHlt::decode( const LHCb::RawBank& bank, std::vector<int>& s warning() << "Unexpected crate number " << crate << endmsg; continue; } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << format( "Channel: %06u ", channel ) << format( "ADC: %06i", adc ) << format( "Station: %06u", station ) << endmsg; } diff --git a/Hlt/HLTScheduler/src/ExecutionReportsWriter.cpp b/Hlt/HLTScheduler/src/ExecutionReportsWriter.cpp index f632ec267e9afa7b1e8284e42ef462c344488d95..1d536f63edd1dac709cc17b7528a7f80624f3b63 100644 --- a/Hlt/HLTScheduler/src/ExecutionReportsWriter.cpp +++ b/Hlt/HLTScheduler/src/ExecutionReportsWriter.cpp @@ -103,7 +103,7 @@ LHCb::HltDecReports ExecutionReportsWriter::operator()( EventContext const& evtC auto const& lhcbExt = evtCtx.getExtension<LHCb::EventContextExtension>(); auto const& [NodeStates, AlgStates] = lhcbExt.getSchedulerExtension<HLTControlFlowMgr::SchedulerStates>(); - if ( UNLIKELY( evtCtx.evt() % m_printFreq == 0 ) && msgLevel( MSG::DEBUG ) ) { + if ( evtCtx.evt() % m_printFreq == 0 && msgLevel( MSG::DEBUG ) ) { debug() << m_schedulerPtr->buildAlgsWithStates( AlgStates ).str() << endmsg; debug() << m_schedulerPtr->buildPrintableStateTree( LHCb::make_span( NodeStates ) ).str() << endmsg; } diff --git a/Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp b/Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp index ed62a985545fd880364051f8ace45951a286e1dc..4c7d7a4ed38d8d5559c81e315ffb33fb74dbc046 100644 --- a/Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp +++ b/Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp @@ -343,7 +343,7 @@ StatusCode HLTControlFlowMgr::executeEvent( EventContext&& evtContext ) { void HLTControlFlowMgr::push( EventContext&& evtContext ) { // Now add event to the task pool - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Event " << evtContext.evt() << " submitting in slot " << evtContext.slot() << endmsg; EventTask event_task{ @@ -418,7 +418,7 @@ void HLTControlFlowMgr::push( EventContext&& evtContext ) { m_algExecStateSvc->updateEventStatus( false, evtContext ); // printing - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) && m_nextevt % m_printFreq == 0 ) ) { + if ( msgLevel( MSG::VERBOSE ) && m_nextevt % m_printFreq == 0 ) { verbose() << buildPrintableStateTree( LHCb::span<NodeState const>{NodeStates} ).str() << endmsg; verbose() << buildAlgsWithStates( AlgStates ).str() << endmsg; } @@ -555,20 +555,20 @@ StatusCode HLTControlFlowMgr::nextEvent( int maxevt ) { while ( not empty() ) pop(); return StatusCode::FAILURE; } - if ( UNLIKELY( m_startTimeAtEvt == m_nextevt ) ) { + if ( m_startTimeAtEvt == m_nextevt ) { auto currtime = std::time( nullptr ); info() << "Timing started at: " << std::put_time( std::localtime( &currtime ), "%T" ) << endmsg; m_alloc_tracker->beginTracking(); startTimeAndTicks.emplace( Clock::now(), getTotalWorkerTicks() ); } - if ( UNLIKELY( m_stopTimeAtEvt == m_nextevt ) ) { + if ( m_stopTimeAtEvt == m_nextevt ) { endTimeAndTicks.emplace( Clock::now(), getTotalWorkerTicks() ); m_alloc_tracker->endTracking(); auto currtime = std::time( nullptr ); info() << "Timing stopped at: " << std::put_time( std::localtime( &currtime ), "%T" ) << endmsg; } auto evtContext = createEventContext(); - if ( UNLIKELY( !evtContext.valid() ) ) { + if ( !evtContext.valid() ) { if ( m_nextevt == -1 ) break; // finished shutdown_threadpool(); return StatusCode::FAILURE; // else we have an success --> exit loop @@ -588,7 +588,7 @@ StatusCode HLTControlFlowMgr::nextEvent( int maxevt ) { releaseEvtSelContext().ignore(); - if ( UNLIKELY( !startTimeAndTicks ) ) { + if ( !startTimeAndTicks ) { info() << "---> Loop over " << m_finishedEvt << " Events Finished - " << " WSS " << System::mappedMemory( System::MemoryUnit::kByte ) * 1. / 1024. << ", timing failed.." << endmsg; diff --git a/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp b/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp index 0858e6cf17e2f9c481217ec196f5dcb122121846..3aef4bcb6826fe04530f514412c2b1a0db1ba05e 100644 --- a/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp +++ b/Hlt/HltDAQ/src/component/HltPackedDataDecoder.cpp @@ -157,7 +157,7 @@ namespace LHCb::Hlt::PackedData { payload.insert( end( payload ), begin( r ), end( r ) ); } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Compression " << compression( rawBank0->sourceID() ) << ", payload size " << payload.size() << endmsg; } @@ -215,7 +215,7 @@ namespace LHCb::Hlt::PackedData { } const auto& containerPath = locationIt->second; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Reading " << header.storedSize << " bytes " << "for object with CLID " << header.classID << " into TES location " << containerPath << endmsg; } @@ -256,7 +256,7 @@ namespace LHCb::Hlt::PackedData { } } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) && checksum ) ) { + if ( msgLevel( MSG::DEBUG ) && checksum ) { for ( const auto& x : checksum->checksums() ) debug() << "Packed data checksum for '" << x.first << "' = " << x.second << endmsg; } diff --git a/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp b/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp index 0204a5b7b106ecb43275862501d48c53fbf4b3f3..48e0fd666556a5181e7820a72ddb9fc9e49b2d68 100644 --- a/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp +++ b/Hlt/HltDAQ/src/component/HltPackedDataWriter.cpp @@ -174,7 +174,7 @@ namespace LHCb::Hlt::PackedData { buffer.save<int32_t>( linkID->second ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Packed link " << id << "/" << nlinks << " to " << linkMgr->link( id )->path() << " (" << location << ") with ID " << linkID->second << endmsg; } @@ -184,7 +184,7 @@ namespace LHCb::Hlt::PackedData { // Save the packed object itself auto objectSize = saveObjectFun( dataObject, containerPath, buffer, checksum ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Packed " << containerPath << " with ID " << locationID->second << " and CLID " << classID << " into " << objectSize << " bytes" << endmsg; counter( containerPath ) += objectSize; @@ -224,7 +224,7 @@ namespace LHCb::Hlt::PackedData { m_serializedDataSize += buffer.buffer().size(); m_compressedDataSize += output.size(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Total size of serialized data " << buffer.buffer().size() << endmsg; debug() << "Wrote " << output.size() << " compressed bytes" << endmsg; if ( checksum ) { @@ -248,10 +248,10 @@ namespace LHCb::Hlt::PackedData { Error( "Packed objects too large to save", StatusCode::SUCCESS, 50 ).ignore(); return; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "Writing " << chunks.size() << " banks" << endmsg; } + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Writing " << chunks.size() << " banks" << endmsg; } for ( auto [ibank, chunk] : range::enumerate( chunks ) ) { uint16_t sourceID = sourceIDCommon | shift<SourceIDMasks::PartID>( ibank ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Adding raw bank with sourceID=" << sourceID << ", length=" << chunk.size() << ", offset=" << ( chunk.data() - data.data() ) << endmsg; } diff --git a/Hlt/HltDAQ/src/component/HltRawBankDecoderBase.h b/Hlt/HltDAQ/src/component/HltRawBankDecoderBase.h index 93fe88046e924d9ccf5f6caac6fd83554391f897..5fcefda1427f533746c772466346015866751472 100644 --- a/Hlt/HltDAQ/src/component/HltRawBankDecoderBase.h +++ b/Hlt/HltDAQ/src/component/HltRawBankDecoderBase.h @@ -58,19 +58,19 @@ public: const GaudiUtils::VectorMap<int, element_t>& id2string( unsigned int tck ) const { auto itbl = m_idTable.find( tck ); - if ( UNLIKELY( itbl == std::end( m_idTable ) ) ) itbl = fetch_id2string( tck ); + if ( itbl == std::end( m_idTable ) ) itbl = fetch_id2string( tck ); return itbl->second; }; const GaudiUtils::VectorMap<int, Gaudi::StringKey>& info2string( unsigned int tck ) const { auto itbl = m_infoTable.find( tck ); static const Gaudi::StringKey InfoID{"InfoID"}; - if ( UNLIKELY( itbl == std::end( m_infoTable ) ) ) itbl = fetch_info2string( tck, InfoID, m_infoTable ); + if ( itbl == std::end( m_infoTable ) ) itbl = fetch_info2string( tck, InfoID, m_infoTable ); return itbl->second; } const GaudiUtils::VectorMap<int, Gaudi::StringKey>& packedObjectLocation2string( unsigned int tck ) const { auto itbl = m_packedObjectLocationsTable.find( tck ); static const Gaudi::StringKey PackedObjectLocations{"PackedObjectLocations"}; - if ( UNLIKELY( itbl == std::end( m_packedObjectLocationsTable ) ) ) + if ( itbl == std::end( m_packedObjectLocationsTable ) ) itbl = fetch_info2string( tck, PackedObjectLocations, m_packedObjectLocationsTable ); return itbl->second; } diff --git a/Hlt/HltDAQ/src/component/HltSelReportsWriter.cpp b/Hlt/HltDAQ/src/component/HltSelReportsWriter.cpp index 34fafe4142d674666baa2470c2d19be5c63c5df7..139376906b0176f76fe82e6afb69b96228dae8b5 100644 --- a/Hlt/HltDAQ/src/component/HltSelReportsWriter.cpp +++ b/Hlt/HltDAQ/src/component/HltSelReportsWriter.cpp @@ -469,7 +469,7 @@ const HltSelReportsWriter::NameToNumberMap& HltSelReportsWriter::tckANNSvcMap( u const auto key = std::pair{tck, major}; auto itbl = m_infoTable.find( key ); - if ( LIKELY( itbl != std::end( m_infoTable ) ) ) { return itbl->second; } + if ( itbl != std::end( m_infoTable ) ) { return itbl->second; } auto& map = m_infoTable[key]; for ( auto p : m_tckANNSvc->i2s( tck, InfoID ) ) { map.insert( {p.second, p.first} ); } diff --git a/Hlt/HltDAQ/src/component/HltTrackReportsWriter.cpp b/Hlt/HltDAQ/src/component/HltTrackReportsWriter.cpp index ff169c5508f5935f950101fb88e73c43a1d128b7..683d02ff0835bd3bd170ac646a838f063fc40c50 100644 --- a/Hlt/HltDAQ/src/component/HltTrackReportsWriter.cpp +++ b/Hlt/HltDAQ/src/component/HltTrackReportsWriter.cpp @@ -137,7 +137,7 @@ void HltTrackReportsWriter::convert( const std::string& location, unsigned sourc rawEvent->addBank( ( sourceID << kSourceID_BitShift ) | iBank, RawBank::HltTrackReports, kVersionNumber, LHCb::make_span( bankBody ).subspan( ioff, isize ) ); } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) && nBank > 1 ) { + if ( msgLevel( MSG::DEBUG ) && nBank > 1 ) { debug() << "HltTrackReports is huge. Saved in " << nBank << " separate RawBanks " << endmsg; } } diff --git a/Hlt/HltDAQ/src/component/ReportConvertTool.cpp b/Hlt/HltDAQ/src/component/ReportConvertTool.cpp index 4f0e206c1f933a8fe8a70137d134c0e35ef52ec5..88102ca17787bbedb70f777bf4bc03150ac54ae4 100644 --- a/Hlt/HltDAQ/src/component/ReportConvertTool.cpp +++ b/Hlt/HltDAQ/src/component/ReportConvertTool.cpp @@ -1031,7 +1031,7 @@ void ReportConvertTool::SummaryFromRaw( HltObjectSummary::Info* info, HltSelRepR // (has nothing to do with header ID). int run1version = -999; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "SummaryFromRaw call for ID:" << classID << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "SummaryFromRaw call for ID:" << classID << endmsg; // Make sure the tool is given a version to use if ( m_version == -999 ) { @@ -1039,7 +1039,7 @@ void ReportConvertTool::SummaryFromRaw( HltObjectSummary::Info* info, HltSelRepR m_version = m_LatestVersion; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Assigning used_map with version:" << m_version << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Assigning used_map with version:" << m_version << endmsg; // Which one of the member maps do we need to use? /* @@ -1182,7 +1182,7 @@ void ReportConvertTool::SummaryFromRaw( HltObjectSummary::Info* info, HltSelRepR // If version<3 => for Track, Particle, RecVertex, and CaloCluster, need to assign version based on size - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Inserting from bank" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Inserting from bank" << endmsg; auto version_to_use = findBestPrevious( *used_map, m_version ); const auto& table_to_use = used_map->at( version_to_use ); for ( const auto& object : table_to_use ) { diff --git a/Hlt/HltServices/src/ConfigCDBAccessSvc.cpp b/Hlt/HltServices/src/ConfigCDBAccessSvc.cpp index 9297ed40f662dfa896fc8fdf28f218dd70579cca..7b227e8422e76e2946d7103e57cf4aaa396f9888 100644 --- a/Hlt/HltServices/src/ConfigCDBAccessSvc.cpp +++ b/Hlt/HltServices/src/ConfigCDBAccessSvc.cpp @@ -71,7 +71,7 @@ namespace { static_assert( sizeof( std::istream::char_type ) == sizeof( uint8_t ), "" ); std::istream::char_type c; s.get( c ); - // if ( UNLIKELY(!s) ) throw std::runtime_error("error reading a character from stream"); + // if ( !s ) throw std::runtime_error("error reading a character from stream"); uint8_t ui; std::memcpy( &ui, &c, sizeof( uint8_t ) ); return ui; @@ -410,7 +410,7 @@ namespace ConfigCDBAccessSvc_details { } uid_t getUid() const { - if ( UNLIKELY( !m_myUid ) ) m_myUid = getuid(); + if ( !m_myUid ) m_myUid = getuid(); return m_myUid; } @@ -480,9 +480,9 @@ StatusCode ConfigCDBAccessSvc::initialize() { // TODO: return a shared_ptr which keeps the file alive for the duration of the read/write... ConfigCDBAccessSvc_details::CDB* ConfigCDBAccessSvc::file() const { - if ( UNLIKELY( !m_file ) ) { + if ( !m_file ) { std::unique_lock _( m_file_mtx ); - if ( LIKELY( !m_file ) ) { + if ( !m_file ) { std::string name = m_name.value(); if ( name.empty() ) { std::string def( System::getEnv( "HLTTCKROOT" ) ); diff --git a/Kernel/AllocationTracker/src/service/StacktraceAllocationTracker.cpp b/Kernel/AllocationTracker/src/service/StacktraceAllocationTracker.cpp index 1c46eefac25f088827490b43172415e910c53825..21c30b20eea49ef9e600c688e47438f9ebe905d1 100644 --- a/Kernel/AllocationTracker/src/service/StacktraceAllocationTracker.cpp +++ b/Kernel/AllocationTracker/src/service/StacktraceAllocationTracker.cpp @@ -57,7 +57,7 @@ namespace { // First try and use static storage m_static_addresses.resize( s_stack_depth_guess ); m_static_addresses.resize( System::backTrace( m_static_addresses.data(), m_static_addresses.size() ) ); - if ( UNLIKELY( m_static_addresses.size() == s_stack_depth_guess ) ) { + if ( m_static_addresses.size() == s_stack_depth_guess ) { // Didn't have enough space in the static buffer m_static_addresses.clear(); m_dynamic_addresses.resize( 2 * s_stack_depth_guess ); diff --git a/Kernel/LHCbAlgs/src/BasicDQFilter.cpp b/Kernel/LHCbAlgs/src/BasicDQFilter.cpp index 292a4ee02a8e67b37f8f878289df3bb7b8fc4aa9..b8c4022c424837e83b4bc8cb1425dde9e08e3b62 100644 --- a/Kernel/LHCbAlgs/src/BasicDQFilter.cpp +++ b/Kernel/LHCbAlgs/src/BasicDQFilter.cpp @@ -40,7 +40,7 @@ public: return std::none_of( flags.begin(), flags.end(), [&]( const auto& f ) { // if the flag is not ignored if ( m_ignoredFlags.find( f.first ) != m_ignoredFlags.end() ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Ignoring flag: " << f.first << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Ignoring flag: " << f.first << endmsg; return false; } return f.second != 0; diff --git a/Kernel/LHCbAlgs/src/DQAcceptTool.cpp b/Kernel/LHCbAlgs/src/DQAcceptTool.cpp index a0dcdf4874587ad2f67ea16cc26147c7a264138c..dc6f70734b6748e16ccaa3aa722c99d707286921 100644 --- a/Kernel/LHCbAlgs/src/DQAcceptTool.cpp +++ b/Kernel/LHCbAlgs/src/DQAcceptTool.cpp @@ -82,7 +82,7 @@ private: }; DECLARE_COMPONENT( DQAcceptTool ) -#define ON_DEBUG if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) +#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) #define DEBUG_MSG ON_DEBUG debug() // ============================================================================ @@ -103,7 +103,7 @@ StatusCode DQAcceptTool::initialize() { StatusCode sc = GaudiTool::initialize(); if ( sc.isFailure() ) return sc; - if ( UNLIKELY( m_condPath.empty() ) ) { + if ( m_condPath.empty() ) { error() << "Cannot work with empty ConditionPath" << endmsg; return StatusCode::FAILURE; } @@ -136,11 +136,11 @@ StatusCode DQAcceptTool::initialize() { } StatusCode DQAcceptTool::i_checkFlagsByRun() { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Updating Data Quality flags for run " << m_cond->param<int>( "RunNumber" ) << endmsg; const IDQFilter::FlagsType& flags = m_scanner->scan( m_cond->validSince(), m_cond->validTill() ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "-> " << flags << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "-> " << flags << endmsg; m_accepted = m_filter->accept( flags ); // we successfully updated the m_bad state @@ -148,10 +148,10 @@ StatusCode DQAcceptTool::i_checkFlagsByRun() { } StatusCode DQAcceptTool::i_checkFlagsByEvent() { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Updating Data Quality flags" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Updating Data Quality flags" << endmsg; const auto& flags = m_cond->param<IDQFilter::FlagsType>( "map" ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "-> " << flags << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "-> " << flags << endmsg; m_accepted = m_filter->accept( flags ); // we successfully updated the m_bad state diff --git a/Kernel/LHCbAlgs/src/DetTransientStoreMTManagers.cpp b/Kernel/LHCbAlgs/src/DetTransientStoreMTManagers.cpp index 5fa21c3e42c444f4e67c623716eafdad3bab1596..af1c2a29fc345344d0a70ae874531f986b39122f 100644 --- a/Kernel/LHCbAlgs/src/DetTransientStoreMTManagers.cpp +++ b/Kernel/LHCbAlgs/src/DetTransientStoreMTManagers.cpp @@ -62,14 +62,14 @@ namespace LHCb { auto mgr = detSvc().as<IDataManagerSvc>(); // this is for sure not null because I checked at initialize for ( const auto path : {"Structure", "Geometry"} ) { const std::string root{mgr->rootName() + "/" + path + "/*"}; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "preloading " << root << " in " << detSvc().as<INamedInterface>()->name() << endmsg; } detSvc()->addPreLoadItem( root ).ignore(); } const auto start = std::chrono::system_clock::now(); detSvc()->preLoad().ignore(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { const auto stop = std::chrono::system_clock::now(); debug() << "preload completed in " << std::chrono::duration<float>{stop - start}.count() << "s" << endmsg; } diff --git a/Kernel/LHCbAlgs/src/EventCountHisto.cpp b/Kernel/LHCbAlgs/src/EventCountHisto.cpp index a430d1a53ef8fa82cbf7100c1f9d842e55accd5f..c0b7462f618d283409871067c180b44800df3f21 100644 --- a/Kernel/LHCbAlgs/src/EventCountHisto.cpp +++ b/Kernel/LHCbAlgs/src/EventCountHisto.cpp @@ -48,7 +48,7 @@ EventCountHisto::EventCountHisto( const std::string& name, ISvcLocator* pSvcLoca //============================================================================= StatusCode EventCountHisto::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; // code goes here ++m_nEvents; @@ -61,7 +61,7 @@ StatusCode EventCountHisto::execute() { //============================================================================= StatusCode EventCountHisto::finalize() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Finalize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg; info() << m_nEvents << " events processed" << endmsg; diff --git a/Kernel/LHCbAlgs/src/LHCbTimerForSequencer.cpp b/Kernel/LHCbAlgs/src/LHCbTimerForSequencer.cpp index edef5bb5cfc037ad71f4c9d2c2dca6a8da47ab43..a561da44d5824d7f93b50a70b461acb549ff16b2 100644 --- a/Kernel/LHCbAlgs/src/LHCbTimerForSequencer.cpp +++ b/Kernel/LHCbAlgs/src/LHCbTimerForSequencer.cpp @@ -31,7 +31,7 @@ double LHCbTimerForSequencer::stop() { m_sum += lastTime; m_sumCpu += cpuTime; - if ( UNLIKELY( 1 == m_num ) ) { + if ( 1 == m_num ) { m_min = lastTime; m_max = lastTime; } else { diff --git a/Kernel/LHCbAlgs/src/MemoryTool.cpp b/Kernel/LHCbAlgs/src/MemoryTool.cpp index d71b5468e45eba7faee4414c86cd79dee417b585..16a6b334d3aee7057bd5c6ac80516a10572cd1e0 100644 --- a/Kernel/LHCbAlgs/src/MemoryTool.cpp +++ b/Kernel/LHCbAlgs/src/MemoryTool.cpp @@ -145,7 +145,7 @@ void MemoryTool::execute() { if ( 16 < m_totMem.nEntries() && 0 < m_totMem.mean() && 0 < m_totMem.standard_deviation() && 0 < memMB && memMB > m_totMem.mean() + 3 * m_totMem.standard_deviation() ) { Warning( "Total Memory for the event exceeds 3*sigma", StatusCode::SUCCESS, m_maxPrint.value() ).ignore(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " Total Memory : " << memMB << " Mean : (" << m_totMem.mean() << "+-" << m_totMem.standard_deviation() << ")" << endmsg; } @@ -153,7 +153,7 @@ void MemoryTool::execute() { if ( 0 <= prev && 16 < m_delMem.nEntries() && 0 < m_delMem.standard_deviation() && 0 < deltaMem && deltaMem > m_delMem.mean() + 3 * m_delMem.standard_deviation() ) { Warning( "Delta Memory for the event exceeds 3*sigma", StatusCode::SUCCESS, m_maxPrint.value() ).ignore(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " Delta Memory : " << deltaMem << " Mean : (" << m_delMem.mean() << "+-" << m_delMem.standard_deviation() << ")" << endmsg; } @@ -162,7 +162,7 @@ void MemoryTool::execute() { 16 < m_delMem.nEntries() && 0 < m_delMem.mean() && 0 < m_delMem.meanErr() && m_delMem.mean() > 3 * m_delMem.meanErr() ) { Warning( "Mean 'Delta-Memory' exceeds 3*sigma", StatusCode::SUCCESS, m_maxPrint.value() ).ignore(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " Memory Leak? " << "(" << m_delMem.mean() << "+-" << m_delMem.meanErr() << ")" << endmsg; } diff --git a/Kernel/LHCbAlgs/src/ODINCodec.cpp b/Kernel/LHCbAlgs/src/ODINCodec.cpp index d0ed80e214e0b7866318752c9d52753d13a65331..e7073ad5cfea94a8f349bf4a78a1f3af04f6f72a 100644 --- a/Kernel/LHCbAlgs/src/ODINCodec.cpp +++ b/Kernel/LHCbAlgs/src/ODINCodec.cpp @@ -17,7 +17,7 @@ using namespace LHCb::ODINCodec; namespace { inline void Assert( const bool cond, const std::string& tag, const std::string& msg ) { - if ( UNLIKELY( !( cond ) ) ) throw GaudiException( tag, msg, StatusCode::FAILURE ); + if ( !( cond ) ) throw GaudiException( tag, msg, StatusCode::FAILURE ); } inline void DecoderAssert( const bool cond, const std::string& msg ) { Assert( cond, "LHCb::ODINCodec::decode", msg ); @@ -55,16 +55,16 @@ ODIN LHCb::ODINCodec::decode( const RawBank& bank, const bool ignoreBankVersion // Validate bank version const unsigned int version = bank.version(); - if ( UNLIKELY( ( version > Bank::VERSION ) && !ignoreBankVersion ) ) { + if ( ( version > Bank::VERSION ) && !ignoreBankVersion ) { DecoderAssert( false, "Unknown ODIN bank version " + std::to_string( version ) + ", latest known is " + std::to_string( Bank::VERSION ) ); } // Validate bank size const size_t size = bank.size(); - if ( UNLIKELY( ( ( version >= 3 ) && size != Bank::SIZE ) || - ( ( version < 3 ) && size < bank_size_v2 ) ) ) { // relaxed check to take into account a bug in - // BooleInit + if ( ( ( version >= 3 ) && size != Bank::SIZE ) || + ( ( version < 3 ) && size < bank_size_v2 ) ) { // relaxed check to take into account a bug in + // BooleInit DecoderAssert( false, "Wrong ODIN bank size " + std::to_string( size ) + ", expected " + std::to_string( ( version >= 3 ) ? Bank::SIZE : bank_size_v2 ) ); } diff --git a/Kernel/LHCbAlgs/src/ODINDecodeTool.cpp b/Kernel/LHCbAlgs/src/ODINDecodeTool.cpp index f0c7245947b0d7e19db76d8b0136feaaf7a781f9..42da60374d59053a3466ea86c8f8391faaf92c11 100644 --- a/Kernel/LHCbAlgs/src/ODINDecodeTool.cpp +++ b/Kernel/LHCbAlgs/src/ODINDecodeTool.cpp @@ -86,15 +86,15 @@ void ODINDecodeTool::execute() { if ( odin ) { if ( m_force ) { // Use the already registered object - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Modify existing ODIN object" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Modify existing ODIN object" << endmsg; } else { // ODIN already there and we are not supposed to touch it - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Keep existing ODIN object" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Keep existing ODIN object" << endmsg; return; } } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Getting RawEvent" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Getting RawEvent" << endmsg; LHCb::RawEvent* rawEvent = findFirstRawEvent(); if ( !rawEvent ) { using namespace GaudiUtils; diff --git a/Kernel/LHCbAlgs/src/ODINEmulator.cpp b/Kernel/LHCbAlgs/src/ODINEmulator.cpp index c56e5fc2726af6c620611951f804d493f8715753..bbe7128e20bf46528ba784a914fe70472c4f6333 100644 --- a/Kernel/LHCbAlgs/src/ODINEmulator.cpp +++ b/Kernel/LHCbAlgs/src/ODINEmulator.cpp @@ -119,7 +119,7 @@ StatusCode ODINEmulator::initialize() { ODIN ODINEmulator::operator()( const ODIN& odin ) const { ODIN emulated{odin}; if ( m_setEventNumber ) { emulated.setEventNumber( ( m_eventNumber++ ).value() ); } - if ( UNLIKELY( m_overrideBXType >= 0 && m_overrideBXType < 4 ) ) { + if ( m_overrideBXType >= 0 && m_overrideBXType < 4 ) { emulated.setBunchCrossingType( static_cast<ODIN::BXTypes>( m_overrideBXType.value() ) ); } auto bx = emulated.bunchCrossingType(); diff --git a/Kernel/LHCbAlgs/src/OdinTimeDecoder.cpp b/Kernel/LHCbAlgs/src/OdinTimeDecoder.cpp index a64f422bfb257c3b95e6ec870eacccbb500c1232..256188d1b6f7205905ed7d3a934f027db36bd5fe 100644 --- a/Kernel/LHCbAlgs/src/OdinTimeDecoder.cpp +++ b/Kernel/LHCbAlgs/src/OdinTimeDecoder.cpp @@ -69,7 +69,7 @@ private: // Declaration of the Tool Factory DECLARE_COMPONENT( OdinTimeDecoder ) -#define ON_DEBUG if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) +#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) #define DEBUG_MSG ON_DEBUG debug() //============================================================================= @@ -89,7 +89,7 @@ LHCb::ODIN* OdinTimeDecoder::getODIN() const { // Check if the root of the transient store is available before calling the // ODIN decoder. (e. g. during the initialize) DataObject* tmp = nullptr; - if ( LIKELY( evtSvc()->findObject( "", tmp ).isSuccess() ) ) { + if ( evtSvc()->findObject( "", tmp ).isSuccess() ) { // Decode the ODIN bank. /// \fixme because of https://gitlab.cern.ch/gaudi/Gaudi/merge_requests/217 IGenericTool /// cannot be used in a const method. The proper fix can be implemented only in the context diff --git a/Kernel/LHCbAlgs/src/OfflineDeterministicPrescaler.h b/Kernel/LHCbAlgs/src/OfflineDeterministicPrescaler.h index 30ead145dcf2abd85c682893a82deadde7d6cc5f..c84d4a579d574371a8926da36b0a7b0a7f05be71 100644 --- a/Kernel/LHCbAlgs/src/OfflineDeterministicPrescaler.h +++ b/Kernel/LHCbAlgs/src/OfflineDeterministicPrescaler.h @@ -32,13 +32,12 @@ protected: void update() { constexpr auto mx = std::numeric_limits<uint32_t>::max(); m_acc = ( m_accFrac <= 0 ? 0 : m_accFrac >= 1 ? mx : uint32_t( m_accFrac * mx ) ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << "frac: " << m_accFrac.value() << " acc: 0x" << std::hex << m_acc << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "frac: " << m_accFrac.value() << " acc: 0x" << std::hex << m_acc << endmsg; } Gaudi::Property<double> m_accFrac{this, "AcceptFraction", 1., [=]( Gaudi::Details::PropertyBase& ) { update(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "frac: " << m_accFrac.value() << " acc: 0x" << std::hex << m_acc << endmsg; }}; // fraction of input events to accept... diff --git a/Kernel/LHCbAlgs/src/OfflineRateLimiter.cpp b/Kernel/LHCbAlgs/src/OfflineRateLimiter.cpp index a162039dafb846fed4047096315795659069df38..061130ea1af4352032adc4df0e98eb9f24d335fa 100644 --- a/Kernel/LHCbAlgs/src/OfflineRateLimiter.cpp +++ b/Kernel/LHCbAlgs/src/OfflineRateLimiter.cpp @@ -88,7 +88,7 @@ DECLARE_COMPONENT( OfflineRateLimiter ) StatusCode OfflineRateLimiter::initializeOnFirstEvent() { StatusCode sc = StatusCode::SUCCESS; if ( m_initialized ) return sc; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; m_initialized = true; if ( m_rate < 0 ) Exception( "Negative Rate requested" ); if ( m_useCondDB.value() ) { @@ -136,13 +136,12 @@ StatusCode OfflineRateLimiter::initializeOnFirstEvent() { // Not an Incident //============================================================================= bool OfflineRateLimiter::handleTCK() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> handleTCK " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> handleTCK " << endmsg; if ( !m_tckReader ) Exception( "TCK Reader is NULL in handleTCK" ); const unsigned int newTCK = m_tckReader->getTCK(); if ( m_tck == newTCK ) return false; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << " changed TCK from " << std::hex << m_tck << " to " << newTCK << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " changed TCK from " << std::hex << m_tck << " to " << newTCK << endmsg; m_tck = newTCK; return true; } @@ -152,7 +151,7 @@ bool OfflineRateLimiter::handleTCK() { void OfflineRateLimiter::updateRate() { const double triggerRate = ( m_storedRate * m_storedPrescale ); const double newacc = ( triggerRate > 0 ) ? m_rate / triggerRate : 0.; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> updateRate " << newacc << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> updateRate " << newacc << endmsg; if ( m_accFrac != newacc ) { info() << "Rate is now " << m_storedRate << " Hz and precale " << m_storedPrescale << " (=" << triggerRate << " Hz)" << " -> Need to reduce by factor " << newacc << " to reach target " << m_rate.value() << " Hz." << endmsg; @@ -192,7 +191,7 @@ void OfflineRateLimiter::updatePrescaleFromTCK() { // Not an Incident //============================================================================= void OfflineRateLimiter::updateRateFromCondDB() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> updateRateFromCondDB " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> updateRateFromCondDB " << endmsg; if ( !m_condTriggerTool ) Exception( "CondDB Reader is NULL in updateRateFromCondDB" ); const double randomRate = m_condTriggerTool->getRate(); diff --git a/Kernel/LHCbAlgs/src/PostScaler.cpp b/Kernel/LHCbAlgs/src/PostScaler.cpp index cf025ef6b44f47b6d9cb623ff7e12456a9393dae..ef593ab8c9e6a1c5e755662923fb76b6b5cb8fd1 100644 --- a/Kernel/LHCbAlgs/src/PostScaler.cpp +++ b/Kernel/LHCbAlgs/src/PostScaler.cpp @@ -73,7 +73,7 @@ PostScaler::PostScaler( const std::string& name, ISvcLocator* pSvcLocator ) : Ga StatusCode PostScaler::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; if ( m_forcedReduction > 1. ) m_eventCounter = tool<IEventCounter>( "EvtCounter" ); @@ -93,12 +93,12 @@ StatusCode PostScaler::execute() { Rndm::Numbers random( randSvc(), Rndm::Flat( 0.0, 100. ) ); if ( random ) { const auto r = random(); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Random number thrown: " << r << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Random number thrown: " << r << endmsg; if ( r > m_percentPass ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Random filter failed" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Random filter failed" << endmsg; accepted = false; } else { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Random filter passed" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Random filter passed" << endmsg; } } } @@ -106,17 +106,17 @@ StatusCode PostScaler::execute() { // Event number fraction method if ( m_forcedReduction > 1. ) { const auto event = m_eventCounter->getEventCounter(); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "event number is now " << event << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "event number is now " << event << endmsg; const auto max_evts = (double)event / m_forcedReduction + m_margin; // max_evts = max_evts + 3*sqrt(max_evts); /// 3 sigma security if ( m_nEvents > max_evts ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Filter not passed as " << m_nEvents << " > " << max_evts << " (reduction 1/" << m_forcedReduction << " + " << m_margin << ")" << endmsg; accepted = false; } else { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Filter passed." << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Filter passed." << endmsg; } } diff --git a/Kernel/LHCbAlgs/src/RateFromCondDB.cpp b/Kernel/LHCbAlgs/src/RateFromCondDB.cpp index cdeb15da32428bb2500d5774a909b8b11e74ef89..41bf0cacf230cb65eb2380eb0539afe4032ecf16 100644 --- a/Kernel/LHCbAlgs/src/RateFromCondDB.cpp +++ b/Kernel/LHCbAlgs/src/RateFromCondDB.cpp @@ -38,16 +38,16 @@ RateFromCondDB::RateFromCondDB( const std::string& type, const std::string& name // Initialize //============================================================================= bool RateFromCondDB::initializeCondDB() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Looking for " << m_condition << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Looking for " << m_condition << endmsg; if ( this->existDet<Condition>( m_condition ) ) { // Register condition and read parameters values registerCondition( m_condition, m_condTrigger, &RateFromCondDB::i_updateConditions ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << m_condition << " found" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << m_condition << " found" << endmsg; } else { warning() << m_condition << " Not found. I suggest you try to get it from TCK." << endmsg; return false; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Got condition: " << m_condition << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Got condition: " << m_condition << endmsg; StatusCode sc = runUpdate(); // initial update of DB if ( !sc ) Exception( "runUpdate failed" ); return true; @@ -57,14 +57,14 @@ bool RateFromCondDB::initializeCondDB() { //============================================================================= double RateFromCondDB::getRate() const { // get rate from CondDB - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> rate from CondDB: " << m_rate << " Hz" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> rate from CondDB: " << m_rate << " Hz" << endmsg; return m_rate; } //========================================================================= // Extract data from Trigger //========================================================================= StatusCode RateFromCondDB::i_updateConditions() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "callback" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "callback" << endmsg; if ( !m_condTrigger ) Exception( "NULL m_condTrigger in i_updateConditions()" ); if ( !m_condTrigger->exists( m_lineRate ) ) { err() << "Conditions " << m_condition << " does not contain " << m_lineRate << endmsg; @@ -73,7 +73,7 @@ StatusCode RateFromCondDB::i_updateConditions() { } m_rate = (double)m_condTrigger->param<double>( m_lineRate ) * m_unit; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Updated " << m_lineRate << " to " << m_rate << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Updated " << m_lineRate << " to " << m_rate << endmsg; return StatusCode::SUCCESS; } diff --git a/Kernel/LHCbAlgs/src/RateFromTCK.cpp b/Kernel/LHCbAlgs/src/RateFromTCK.cpp index d118101e2d61357a17b6dfe8c18022cc5ec399c6..487bb0e6e413bb6e4b06adc4552bbfa44a681782 100644 --- a/Kernel/LHCbAlgs/src/RateFromTCK.cpp +++ b/Kernel/LHCbAlgs/src/RateFromTCK.cpp @@ -75,14 +75,14 @@ DECLARE_COMPONENT( RateFromTCK ) StatusCode RateFromTCK::initialize() { StatusCode sc = base_class::initialize(); if ( !sc ) return sc; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "RateFromTCK::initialize()" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "RateFromTCK::initialize()" << endmsg; if ( !service( m_propertyConfigSvcName, m_propertyConfigSvc ).isSuccess() ) { fatal() << "RateFromTCK failed to get the IConfigAccessSvc." << endmsg; return StatusCode::FAILURE; } if ( this->existDet<Condition>( "Conditions/Online/LHCb/RunInfo/Trigger" ) ) { registerCondition( "Conditions/Online/LHCb/RunInfo/Trigger", m_condTrigger, &RateFromTCK::i_cacheTriggerData ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Conditions/Online/LHCb/RunInfo/Trigger found" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Conditions/Online/LHCb/RunInfo/Trigger found" << endmsg; } else { warning() << "Conditions/Online/LHCb/RunInfo/Trigger not found." << endmsg; } @@ -94,7 +94,7 @@ StatusCode RateFromTCK::initialize() { double RateFromTCK::parameterFromTCK( const std::string& instanceName, const std::string& code, const std::string& sub ) const { // get rate from TCK - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> rate from TCK with " << "``" << instanceName << "'' " << "``" << code << "'' " @@ -105,8 +105,7 @@ double RateFromTCK::parameterFromTCK( const std::string& instanceName, const std // Decode the raw event to get the TCK from the raw Hlt DecReports if ( !tck ) { // if there is no TCK, do nothing - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) - verbose() << "No TCK was found, we will get the rate from the CondDB" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "No TCK was found, we will get the rate from the CondDB" << endmsg; return rate; } TCK _tck( tck ); @@ -129,12 +128,12 @@ double RateFromTCK::parameterFromTCK( const std::string& instanceName, const std error() << "could not obtain PropertyConfig " << instanceName << endmsg; return rate; } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "TCK data found: " << tck << " for instance " << instanceName << " " << config->properties().size() << " properties " << endmsg; // list properties for ( const auto& i : config->properties() ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << i.first << " : " << i.second << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << i.first << " : " << i.second << endmsg; if ( i.first == code ) { try { const auto pos = i.second.find( sub ); diff --git a/Kernel/LHCbAlgs/src/TCKPrescaleEmulator.cpp b/Kernel/LHCbAlgs/src/TCKPrescaleEmulator.cpp index e0c8a709e9dedba5b98eaecc46e24714bff8d0c3..546fb9243de703526e34fb5df9844f8f39538cc3 100644 --- a/Kernel/LHCbAlgs/src/TCKPrescaleEmulator.cpp +++ b/Kernel/LHCbAlgs/src/TCKPrescaleEmulator.cpp @@ -118,8 +118,7 @@ StatusCode TCKPrescaleEmulator::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); if ( sc.isFailure() ) return sc; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) - verbose() << "TCKPrescaleEmulator::initialize() tck=" << std::hex << m_tck << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "TCKPrescaleEmulator::initialize() tck=" << std::hex << m_tck << endmsg; // Get property config service if ( !service( m_propertyConfigSvcName, m_propertyConfigSvc ).isSuccess() ) { @@ -131,7 +130,7 @@ StatusCode TCKPrescaleEmulator::initialize() { if ( this->existDet<Condition>( "Conditions/Online/LHCb/RunInfo/Trigger" ) ) { registerCondition( "Conditions/Online/LHCb/RunInfo/Trigger", m_condTrigger, &TCKPrescaleEmulator::i_cacheTriggerData ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Conditions/Online/LHCb/RunInfo/Trigger found" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Conditions/Online/LHCb/RunInfo/Trigger found" << endmsg; } else { warning() << "Conditions/Online/LHCb/RunInfo/Trigger not found." << endmsg; } @@ -169,7 +168,7 @@ StatusCode TCKPrescaleEmulator::execute() { // Get the dec reports, update prescalers if first event or TCK has changed auto decreports = getReports(); if ( !decreports ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << *decreports << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << *decreports << endmsg; HltDecReports* reports = new HltDecReports(); reports->setConfiguredTCK( decreports->configuredTCK() ); reports->setTaskID( decreports->taskID() ); @@ -193,7 +192,7 @@ StatusCode TCKPrescaleEmulator::execute() { if ( !result.isSuccess() ) return StatusCode::FAILURE; // If the ODP wants the line killed: if ( !myAlg->filterPassed() ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Prescaling this line: " << lineName << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Prescaling this line: " << lineName << endmsg; report.setDecision( false ); report.setExecutionStage( 6 ); } @@ -209,7 +208,7 @@ StatusCode TCKPrescaleEmulator::execute() { reports->insert( dec.first, report ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); } const_cast<HltDecReports*>( decreports )->setDecReports( reports->decReports() ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << *decreports << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << *decreports << endmsg; } else { Warning( "FAILED TO GET DECREPORTS! CANNOT PRESCALE THIS EVENT!" ).ignore(); } @@ -227,7 +226,7 @@ const HltDecReports* TCKPrescaleEmulator::getReports() { if ( !firstevent ) { if ( decreports->configuredTCK() == lasttck ) { // TCK unchanged, no need to do anything - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "TCK unchanged, continue " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "TCK unchanged, continue " << endmsg; return decreports; } else { // If we're already processing events and the TCK changes mid-run, warn the user, update the prescalers @@ -245,7 +244,7 @@ const HltDecReports* TCKPrescaleEmulator::getReports() { } else { // If it's the first event save the tck to lasttck, update the prescalers lasttck = decreports->configuredTCK(); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "First event, getting prescales for MC using TCK " << lasttck << endmsg; sc = getPrescalesFromTCK( lasttck, prescalesInMC, postscalesInMC, scaleProductsInMC ); @@ -285,7 +284,7 @@ StatusCode TCKPrescaleEmulator::getPrescalesFromTCK( unsigned int tck, StringMap for ( const auto& i : config->properties() ) { if ( i.first == "AcceptFraction" ) { double scale = -9999.; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Got an AcceptFraction = " << i.second << " for " << lineName << endmsg; try { const auto& str2 = ( i.second ); @@ -329,7 +328,7 @@ StatusCode TCKPrescaleEmulator::getPrescalesFromTCK( unsigned int tck, StringMap } // Make products of pre, post scales, print (if verbose) - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << "Line" << " : " << "Prescale" @@ -344,7 +343,7 @@ StatusCode TCKPrescaleEmulator::getPrescalesFromTCK( unsigned int tck, StringMap auto post = postscales[i.first]; if ( post < 0.0 ) { post = 1.0; } // If postscale was never found it'll be -9999., and we assume it will always pass scaleProducts.insert( {i.first, pre * post} ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << i.first << " : " << i.second << " : " << postscales[i.first] << " : " << scaleProducts[i.first] << endmsg; } @@ -357,7 +356,7 @@ StatusCode TCKPrescaleEmulator::getPrescalesFromTCK( unsigned int tck, StringMap // These are initialised with acceptfractions from the TCK, then updated at runtime with the ratios //======================================================================== StatusCode TCKPrescaleEmulator::getPrescalers() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "Initialising prescalers " << endmsg; } + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Initialising prescalers " << endmsg; } StatusCode final = StatusCode::SUCCESS; prescalers.clear(); @@ -371,7 +370,7 @@ StatusCode TCKPrescaleEmulator::getPrescalers() { const Gaudi::Utils::TypeNameString typeName( "OfflineDeterministicPrescaler", it.first + "ODPForPrescaleEmulator" ); const std::string& theName = typeName.name(); const std::string& theType = typeName.type(); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << "Initialising Algorithm: " << theName << " of type: " << theType << endmsg; } @@ -380,12 +379,12 @@ StatusCode TCKPrescaleEmulator::getPrescalers() { if ( !myIAlg.isValid() ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << "AppManager doesn't already have an instance of " << theName << endmsg; } // Set the acceptfraction and verbosity for the ODP: - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Setting an acceptfraction for " << theName << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Setting an acceptfraction for " << theName << endmsg; optsSvc.set( theName + ".OutputLevel", std::to_string( MSG::WARNING ) ); optsSvc.set( theName + ".AcceptFraction", std::to_string( it.second ) ); @@ -431,7 +430,7 @@ StatusCode TCKPrescaleEmulator::getPrescalers() { // Compare scale products between MC to run on and the TCK to emulate //============================================================================= StatusCode TCKPrescaleEmulator::updatePrescalers() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "Updating Prescalers" << endmsg; } + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Updating Prescalers" << endmsg; } StatusCode sc = StatusCode::SUCCESS; scaleProductsToApply.clear(); @@ -453,7 +452,7 @@ StatusCode TCKPrescaleEmulator::updatePrescalers() { double ratio = i.second / ( *j ).second; if ( ratio <= 1.0 ) { // MC >0 ratio <=1 means prescales are compatible, fill. - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { verbose() << i.first << " TCK, MC are compatible. ratio: " << ratio << endmsg; } scaleProductsToApply.insert( {i.first, ratio} ); @@ -533,8 +532,8 @@ bool TCKPrescaleEmulator::endedWith( const std::string& lineName, const std::str // Extract data from Trigger //========================================================================= StatusCode TCKPrescaleEmulator::i_cacheTriggerData() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "callback Trigger:" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "callback Trigger:" << endmsg; m_triggerTCK = (unsigned int)m_condTrigger->param<int>( "TCK" ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "tck from callback: " << m_triggerTCK << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "tck from callback: " << m_triggerTCK << endmsg; return StatusCode::SUCCESS; } diff --git a/Kernel/LHCbAlgs/src/TestTimeDecoderOdin.cpp b/Kernel/LHCbAlgs/src/TestTimeDecoderOdin.cpp index b0972ec5f1011ec8098d2727560452106e81bc62..f70cf05150bcc5d64fe8e5a839bf5ba59add4a16 100644 --- a/Kernel/LHCbAlgs/src/TestTimeDecoderOdin.cpp +++ b/Kernel/LHCbAlgs/src/TestTimeDecoderOdin.cpp @@ -75,15 +75,15 @@ Gaudi::Time TestTimeDecoderOdin::getTime() const { auto odin = std::make_unique<LHCb::ODIN>(); - if ( UNLIKELY( first ) ) { + if ( first ) { odin->setRunNumber( m_currentRun.value() ); first = false; } else { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Firing " << IncidentType::RunChange << " incident. Old run=" << m_currentRun.value(); m_currentRun += m_runNumberStep.value(); odin->setRunNumber( m_currentRun.value() ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << ", new run=" << m_currentRun.value() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << ", new run=" << m_currentRun.value() << endmsg; } last_time = odin->eventTime(); diff --git a/Kernel/LHCbAlgs/src/TrajPoca.cpp b/Kernel/LHCbAlgs/src/TrajPoca.cpp index 3da3422662dfb667b96a42b1d4b93409313c37c6..182a46ac98187905ade21cf9823a614d9a1d5500 100644 --- a/Kernel/LHCbAlgs/src/TrajPoca.cpp +++ b/Kernel/LHCbAlgs/src/TrajPoca.cpp @@ -115,7 +115,7 @@ TP::details::step_status_t stepTowardPoca( const LHCb::Trajectory<double>& traj1 const Gaudi::XYZVector d( cache.p1 - cache.p2 ); // if the distance between points is below 1e-4 mm, we consider the // minimisation to be converged - if ( UNLIKELY( d.mag2() < std::pow( 1e-4 * Gaudi::Units::mm, 2 ) ) ) { return TP::details::step_status_t::ok; } + if ( d.mag2() < std::pow( 1e-4 * Gaudi::Units::mm, 2 ) ) { return TP::details::step_status_t::ok; } std::array<double, 3> mat = { // keep all terms up to order mu1, mu2, mu1 * mu2 cache.dp1dmu1.mag2() + d.Dot( cache.d2p1dmu12 ), @@ -123,11 +123,11 @@ TP::details::step_status_t stepTowardPoca( const LHCb::Trajectory<double>& traj1 cache.dp2dmu2.mag2() - d.Dot( cache.d2p2dmu22 ), }; ROOT::Math::CholeskyDecomp<double, 2> decomp( &mat[0] ); - if ( UNLIKELY( !decomp ) ) { + if ( !decomp ) { // singular, or not pos. def; try again neglecting curvature mat[0] = cache.dp1dmu1.mag2(), mat[2] = cache.dp2dmu2.mag2(); decomp = ROOT::Math::CholeskyDecomp<double, 2>( &mat[0] ); - if ( UNLIKELY( !decomp ) ) { + if ( !decomp ) { // singular, or not pos. def; give up return TP::details::step_status_t::parallel; } @@ -136,8 +136,7 @@ TP::details::step_status_t stepTowardPoca( const LHCb::Trajectory<double>& traj1 // check product of eigenvalues of mat; if too small, trajectories are very // nearly parallel decltype( mat ) lmat; - if ( UNLIKELY( !decomp.getL( &lmat[0] ) ) || UNLIKELY( lmat[0] * lmat[2] < 1e-8 ) ) - return TP::details::step_status_t::nearly_parallel; + if ( !decomp.getL( &lmat[0] ) || lmat[0] * lmat[2] < 1e-8 ) return TP::details::step_status_t::nearly_parallel; } const std::array<double, 2> rhs = {-d.Dot( cache.dp1dmu1 ), d.Dot( cache.dp2dmu2 )}; std::array<double, 2> dmu = rhs; @@ -158,32 +157,31 @@ TP::details::step_status_t stepTowardPoca( const LHCb::Trajectory<double>& traj1 double distToErr2 = smudge * traj2.distTo2ndError( mu2, extraptolerance, pathDir2 ); // Factor to push just over border of piecewise traj (essential!) - if ( UNLIKELY( 0 < distToErr1 && distToErr1 < std::abs( dmu[0] ) ) ) { + if ( 0 < distToErr1 && distToErr1 < std::abs( dmu[0] ) ) { // choose solution for which dmu[0] steps just over border dmu[0] = distToErr1 * pathDir1; // now recalculate dmu[1], given dmu[0]: dmu[1] = ( rhs[1] - dmu[0] * mat[1] ) / mat[2]; } - if ( UNLIKELY( 0 < distToErr2 && distToErr2 < std::abs( dmu[0] ) ) ) { + if ( 0 < distToErr2 && distToErr2 < std::abs( dmu[0] ) ) { // choose solution for which dmu[1] steps just over border dmu[1] = distToErr2 * pathDir2; // now recalculate dmu[0], given dmu[1]: dmu[0] = ( rhs[0] - dmu[1] * mat[1] ) / mat[0]; // if still not okay, - if ( UNLIKELY( 0 < distToErr1 && distToErr1 < std::abs( dmu[0] ) ) ) { dmu[0] = distToErr1 * pathDir1; } + if ( 0 < distToErr1 && distToErr1 < std::abs( dmu[0] ) ) { dmu[0] = distToErr1 * pathDir1; } } mu1 += dmu[0], mu2 += dmu[1]; // these do not make any sense here. either we need to merge them with the lines above that restrict to the validity // of the expansion, or we need to move them out of here entirely. - if ( UNLIKELY( bool( restrictRange1 ) ) ) restrictToRange( mu1, traj1 ); - if ( UNLIKELY( bool( restrictRange2 ) ) ) restrictToRange( mu2, traj2 ); + if ( bool( restrictRange1 ) ) restrictToRange( mu1, traj1 ); + if ( bool( restrictRange2 ) ) restrictToRange( mu2, traj2 ); // another check for parallel trajectories - if ( UNLIKELY( std::min( std::abs( mu1 ), std::abs( mu2 ) ) > maxDist ) ) - return TP::details::step_status_t::beyond_maxdist; + if ( std::min( std::abs( mu1 ), std::abs( mu2 ) ) > maxDist ) return TP::details::step_status_t::beyond_maxdist; return TP::details::step_status_t::ok; } @@ -204,15 +202,15 @@ StatusCode TrajPoca::minimize( const LHCb::Trajectory<double>& traj1, double& mu bool finished = false; cache_t workspace; - for ( int istep = 0; LIKELY( istep < m_maxnTry && !finished ); ++istep ) { + for ( int istep = 0; istep < m_maxnTry && !finished; ++istep ) { double prevflt1 = mu1; double prevflt2 = mu2; double prevprevdelta2 = std::exchange( prevdelta2, delta2 ); auto step_status = stepTowardPoca( traj1, mu1, restrictRange1, traj2, mu2, restrictRange2, precision, workspace, m_maxExtrapTolerance, m_maxDist ); - if ( UNLIKELY( step_status != TP::details::step_status_t::ok ) ) { + if ( step_status != TP::details::step_status_t::ok ) { status = step_status; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << status.message() << endmsg; } + if ( msgLevel( MSG::DEBUG ) ) { debug() << status.message() << endmsg; } break; // Parallel Trajectories in stepTowardPoca } @@ -229,26 +227,25 @@ StatusCode TrajPoca::minimize( const LHCb::Trajectory<double>& traj1, double& mu finished = std::abs( step1 ) < distToErr1 && std::abs( step2 ) < distToErr2; // we have to catch some problematic cases - if ( UNLIKELY( !finished && istep > 2 && delta2 > prevdelta2 ) ) { + if ( !finished && istep > 2 && delta2 > prevdelta2 ) { // we can get stuck if a flt range is restricted - if ( UNLIKELY( ( restrictRange1 && std::abs( step1 ) > 1.0e-10 ) || - ( restrictRange2 && std::abs( step2 ) > 1e-10 ) ) ) { - if ( UNLIKELY( ++nStuck > m_maxnStuck ) ) { + if ( ( restrictRange1 && std::abs( step1 ) > 1.0e-10 ) || ( restrictRange2 && std::abs( step2 ) > 1e-10 ) ) { + if ( ++nStuck > m_maxnStuck ) { // downgrade to a point poca - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "Minimization got stuck." << endmsg; } + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Minimization got stuck." << endmsg; } Gaudi::XYZVector dist( 0., 0., 0. ); status = ( restrictRange2 ? minimize( traj1, mu1, restrictRange1, traj2.position( mu2 ), dist, precision ) : minimize( traj2, mu2, restrictRange2, traj1.position( mu1 ), dist, precision ) ); - if ( UNLIKELY( status.isFailure() ) ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "Downgrade to point POCA FAILED" << endmsg; } + if ( status.isFailure() ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Downgrade to point POCA FAILED" << endmsg; } break; } status = StatusCode::SUCCESS; // "Stuck poca" finished = true; } - } else if ( UNLIKELY( prevdelta2 > prevprevdelta2 ) ) { + } else if ( prevdelta2 > prevprevdelta2 ) { // diverging - if ( UNLIKELY( ++nDivergingStep > m_maxnDivergingStep ) ) { + if ( ++nDivergingStep > m_maxnDivergingStep ) { status = StatusCode::SUCCESS; // "Failed to converge" ++m_diverging; finished = true; @@ -256,12 +253,12 @@ StatusCode TrajPoca::minimize( const LHCb::Trajectory<double>& traj1, double& mu } else { nDivergingStep = 0; // oscillating - if ( UNLIKELY( ++nOscillStep > m_maxnOscillStep ) ) { + if ( ++nOscillStep > m_maxnOscillStep ) { // bail out of oscillation. since the previous step was // better, use that one. mu1 = prevflt1; mu2 = prevflt2; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "Minimization bailed out of oscillation." << endmsg; } + if ( msgLevel( MSG::DEBUG ) ) { debug() << "Minimization bailed out of oscillation." << endmsg; } status = StatusCode::SUCCESS; // "Oscillating poca" ++m_oscillating; finished = true; @@ -280,7 +277,7 @@ StatusCode TrajPoca::minimize( const LHCb::Trajectory<double>& traj1, double& mu } } - if ( UNLIKELY( !finished ) ) { + if ( !finished ) { status = StatusCode::FAILURE; ++m_notConverging; } diff --git a/Kernel/LHCbAlgs/src/TurboPrescaler.cpp b/Kernel/LHCbAlgs/src/TurboPrescaler.cpp index 5b7829ea591948e0b731250ba1577194acf36d7f..0a05e56ab7d23caadd04ceca9857f8c592362c36 100644 --- a/Kernel/LHCbAlgs/src/TurboPrescaler.cpp +++ b/Kernel/LHCbAlgs/src/TurboPrescaler.cpp @@ -265,7 +265,7 @@ void TurboPrescaler::setupPrescalers() { if ( !myIAlg.isValid() ) { // Set the acceptfraction and verbosity for the DP: - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Setting an acceptfraction for " << theName << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Setting an acceptfraction for " << theName << endmsg; optsSvc.set( theName + ".OutputLevel", std::to_string( MSG::WARNING ) ); optsSvc.set( theName + ".AcceptFraction", std::to_string( it.second ) ); diff --git a/Kernel/LHCbKernel/include/Kernel/EventLocalAllocator.h b/Kernel/LHCbKernel/include/Kernel/EventLocalAllocator.h index 8069b27a5bc2d5e9fb23e0ee3f11e217c8bf31c3..b684e4da04eac72427d7ed1823a8ad7f59ce8e5d 100644 --- a/Kernel/LHCbKernel/include/Kernel/EventLocalAllocator.h +++ b/Kernel/LHCbKernel/include/Kernel/EventLocalAllocator.h @@ -65,7 +65,7 @@ namespace LHCb { constexpr EventLocal( EventLocal<U> const& other ) noexcept : m_resource{other.m_resource} {} [[nodiscard]] __attribute__( ( always_inline ) ) T* allocate( std::size_t n ) { - if ( LIKELY( m_resource != defaultMemResource() ) ) { + if ( m_resource != defaultMemResource() ) { return reinterpret_cast<T*>( m_resource->template allocate<alignof( T )>( n * sizeof( T ) ) ); } else { return default_allocate( n ); @@ -73,7 +73,7 @@ namespace LHCb { } __attribute__( ( always_inline ) ) void deallocate( T* p, std::size_t n ) noexcept { - if ( LIKELY( m_resource != defaultMemResource() ) ) { + if ( m_resource != defaultMemResource() ) { m_resource->deallocate( reinterpret_cast<std::byte*>( p ), n * sizeof( T ) ); } else { default_deallocate( p, n ); diff --git a/Kernel/LHCbKernel/include/Kernel/MonotonicArena.h b/Kernel/LHCbKernel/include/Kernel/MonotonicArena.h index c4d3f9913a0ce4950131ae9ce16dffc37e1c98ca..6316ccaf07faaa73685852f59c6d8b26a871ba1e 100644 --- a/Kernel/LHCbKernel/include/Kernel/MonotonicArena.h +++ b/Kernel/LHCbKernel/include/Kernel/MonotonicArena.h @@ -111,7 +111,7 @@ namespace LHCb::Arena { // Figure out how many bytes we need to allocate std::size_t const aligned_n = details::align_up<Alignment>( n ); // Check that we have a current block and this request fits inside it - if ( UNLIKELY( !m_current || m_current + aligned_n > m_current_end ) ) { + if ( !m_current || m_current + aligned_n > m_current_end ) { // Calculate our next block size auto next_block_size = std::max( m_next_block_size, aligned_n ); // And update the estimate of what comes after that, following a geometric series @@ -141,7 +141,7 @@ namespace LHCb::Arena { m_allocations = 0; if ( !m_all_blocks.empty() ) { // Only re-use the first block, deallocate any others - if ( UNLIKELY( m_all_blocks.size() > 1 ) ) { + if ( m_all_blocks.size() > 1 ) { for ( std::size_t i = 1; i < m_all_blocks.size(); ++i ) { UpstreamAllocator{}.deallocate( m_all_blocks[i].data(), m_all_blocks[i].size() ); } diff --git a/Kernel/LHCbKernel/include/Kernel/RichSmartID.h b/Kernel/LHCbKernel/include/Kernel/RichSmartID.h index 889339db2ebb34d39c8aed0156fbde5039f14bca..e864309675140e55a4ef23a62fef5bdea932d87b 100644 --- a/Kernel/LHCbKernel/include/Kernel/RichSmartID.h +++ b/Kernel/LHCbKernel/include/Kernel/RichSmartID.h @@ -438,7 +438,7 @@ namespace LHCb { #endif { setIDType( type ); - if ( LIKELY( MaPMTID == type ) ) { + if ( MaPMTID == type ) { setRich_PMT( rich ); setPanel_PMT( panel ); setPD_PMT( pdMod, pdNumInMod ); @@ -464,7 +464,7 @@ namespace LHCb { #endif { setIDType( type ); - if ( LIKELY( MaPMTID == type ) ) { + if ( MaPMTID == type ) { setRich_PMT( rich ); setPanel_PMT( panel ); setPD_PMT( pdMod, pdNumInMod ); @@ -484,7 +484,7 @@ namespace LHCb { #endif { setIDType( type ); - if ( LIKELY( MaPMTID == type ) ) { + if ( MaPMTID == type ) { setRich_PMT( rich ); setPanel_PMT( panel ); } else { @@ -501,7 +501,7 @@ namespace LHCb { #endif { setIDType( type ); - if ( LIKELY( MaPMTID == type ) ) { + if ( MaPMTID == type ) { setRich_PMT( rich ); } else { setRich_HPD( rich ); @@ -708,7 +708,7 @@ namespace LHCb { noexcept #endif { - if ( LIKELY( isPMT() ) ) { + if ( isPMT() ) { setRich_PMT( rich ); } else { setRich_HPD( rich ); @@ -721,7 +721,7 @@ namespace LHCb { noexcept #endif { - if ( LIKELY( isPMT() ) ) { + if ( isPMT() ) { setPanel_PMT( panel ); } else { setPanel_HPD( panel ); @@ -734,7 +734,7 @@ namespace LHCb { noexcept #endif { - if ( LIKELY( isPMT() ) ) { + if ( isPMT() ) { setPD_PMT( mod, nInMod ); } else { setPD_HPD( mod, nInMod ); @@ -767,7 +767,7 @@ namespace LHCb { noexcept #endif { - if ( LIKELY( isPMT() ) ) { + if ( isPMT() ) { setPixelRow_PMT( row ); } else { setPixelRow_HPD( row ); @@ -780,7 +780,7 @@ namespace LHCb { noexcept #endif { - if ( LIKELY( isPMT() ) ) { + if ( isPMT() ) { setPixelCol_PMT( col ); } else { setPixelCol_HPD( col ); @@ -805,7 +805,7 @@ namespace LHCb { /// Decoding function to strip the sub-pixel information and return a pixel RichSmartID [[nodiscard]] constexpr LHCb::RichSmartID pixelID() const noexcept { - return RichSmartID( LIKELY( isPMT() ) // + return RichSmartID( isPMT() // ? key() : key() & ~( HPD::MaskPixelSubRow + HPD::MaskPixelSubRowIsSet ) ); } @@ -814,45 +814,42 @@ namespace LHCb { /// information [[nodiscard]] constexpr LHCb::RichSmartID pdID() const noexcept { return RichSmartID( key() & - ( LIKELY( isPMT() ) - ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskPDNumInMod + MaPMT::MaskPDMod + - MaPMT::MaskLargePixel + MaPMT::MaskRichIsSet + MaPMT::MaskPanelIsSet + - MaPMT::MaskPDIsSet + MaskIDType ) - : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskPDNumInCol + HPD::MaskPDCol + - HPD::MaskRichIsSet + HPD::MaskPanelIsSet + HPD::MaskPDIsSet + MaskIDType ) ) ); + ( isPMT() ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskPDNumInMod + MaPMT::MaskPDMod + + MaPMT::MaskLargePixel + MaPMT::MaskRichIsSet + MaPMT::MaskPanelIsSet + + MaPMT::MaskPDIsSet + MaskIDType ) + : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskPDNumInCol + HPD::MaskPDCol + + HPD::MaskRichIsSet + HPD::MaskPanelIsSet + HPD::MaskPDIsSet + MaskIDType ) ) ); } /// Decoding function to return an identifier for a single PD module (or column for HPDs) [[nodiscard]] constexpr LHCb::RichSmartID moduleID() const noexcept { - return RichSmartID( - key() & ( LIKELY( isPMT() ) ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskPDMod + MaPMT::MaskRichIsSet + - MaPMT::MaskPanelIsSet + MaPMT::MaskPDIsSet + MaskIDType ) - : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskPDCol + HPD::MaskRichIsSet + - HPD::MaskPanelIsSet + HPD::MaskPDIsSet + MaskIDType ) ) ); + return RichSmartID( key() & + ( isPMT() ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskPDMod + MaPMT::MaskRichIsSet + + MaPMT::MaskPanelIsSet + MaPMT::MaskPDIsSet + MaskIDType ) + : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskPDCol + HPD::MaskRichIsSet + + HPD::MaskPanelIsSet + HPD::MaskPDIsSet + MaskIDType ) ) ); } /// Decoding function to strip the photon-detector information and return a PD panel RichSmartID [[nodiscard]] constexpr LHCb::RichSmartID panelID() const noexcept { return RichSmartID( key() & - ( LIKELY( isPMT() ) - ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskRichIsSet + MaPMT::MaskPanelIsSet + MaskIDType ) - : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskRichIsSet + HPD::MaskPanelIsSet + MaskIDType ) ) ); + ( isPMT() ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskRichIsSet + MaPMT::MaskPanelIsSet + MaskIDType ) + : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskRichIsSet + HPD::MaskPanelIsSet + MaskIDType ) ) ); } /// Decoding function to strip all but the RICH information and return a RICH RichSmartID [[nodiscard]] constexpr LHCb::RichSmartID richID() const noexcept { - return RichSmartID( key() & ( LIKELY( isPMT() ) ? ( MaPMT::MaskRich + MaPMT::MaskRichIsSet + MaskIDType ) - : ( HPD::MaskRich + HPD::MaskRichIsSet + MaskIDType ) ) ); + return RichSmartID( key() & ( isPMT() ? ( MaPMT::MaskRich + MaPMT::MaskRichIsSet + MaskIDType ) + : ( HPD::MaskRich + HPD::MaskRichIsSet + MaskIDType ) ) ); } /// Returns only the data fields, with the validity bits stripped [[nodiscard]] constexpr LHCb::RichSmartID dataBitsOnly() const noexcept { - return RichSmartID( key() & ( LIKELY( isPMT() ) - ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskPDNumInMod + - MaPMT::MaskPDMod + MaPMT::MaskPixelRow + MaPMT::MaskPixelCol ) - : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskPDNumInCol + HPD::MaskPDCol + - HPD::MaskPixelRow + HPD::MaskPixelCol + HPD::MaskPixelSubRow ) ) ); + return RichSmartID( key() & ( isPMT() ? ( MaPMT::MaskRich + MaPMT::MaskPanel + MaPMT::MaskPDNumInMod + + MaPMT::MaskPDMod + MaPMT::MaskPixelRow + MaPMT::MaskPixelCol ) + : ( HPD::MaskRich + HPD::MaskPanel + HPD::MaskPDNumInCol + HPD::MaskPDCol + + HPD::MaskPixelRow + HPD::MaskPixelCol + HPD::MaskPixelSubRow ) ) ); } public: @@ -861,85 +858,84 @@ namespace LHCb { /// Retrieve The pixel sub-row (Alice mode) number [[nodiscard]] constexpr DataType pixelSubRow() const noexcept { // Note MaPMTs have no sub-pixel ... - return ( DataType )( UNLIKELY( isHPD() ) ? ( ( key() & HPD::MaskPixelSubRow ) >> HPD::ShiftPixelSubRow ) : 0 ); + return ( DataType )( isHPD() ? ( ( key() & HPD::MaskPixelSubRow ) >> HPD::ShiftPixelSubRow ) : 0 ); } /// Retrieve The pixel column number [[nodiscard]] constexpr DataType pixelCol() const noexcept { - return ( DataType )( LIKELY( isPMT() ) ? ( ( key() & MaPMT::MaskPixelCol ) >> MaPMT::ShiftPixelCol ) - : ( ( key() & HPD::MaskPixelCol ) >> HPD::ShiftPixelCol ) ); + return ( DataType )( isPMT() ? ( ( key() & MaPMT::MaskPixelCol ) >> MaPMT::ShiftPixelCol ) + : ( ( key() & HPD::MaskPixelCol ) >> HPD::ShiftPixelCol ) ); } /// Retrieve The pixel row number [[nodiscard]] constexpr DataType pixelRow() const noexcept { - return ( DataType )( LIKELY( isPMT() ) ? ( ( key() & MaPMT::MaskPixelRow ) >> MaPMT::ShiftPixelRow ) - : ( ( key() & HPD::MaskPixelRow ) >> HPD::ShiftPixelRow ) ); + return ( DataType )( isPMT() ? ( ( key() & MaPMT::MaskPixelRow ) >> MaPMT::ShiftPixelRow ) + : ( ( key() & HPD::MaskPixelRow ) >> HPD::ShiftPixelRow ) ); } /// Retrieve The PD number in module [[nodiscard]] constexpr DataType pdNumInMod() const noexcept { - return ( DataType )( LIKELY( isPMT() ) ? ( ( key() & MaPMT::MaskPDNumInMod ) >> MaPMT::ShiftPDNumInMod ) - : ( ( key() & HPD::MaskPDNumInCol ) >> HPD::ShiftPDNumInCol ) ); + return ( DataType )( isPMT() ? ( ( key() & MaPMT::MaskPDNumInMod ) >> MaPMT::ShiftPDNumInMod ) + : ( ( key() & HPD::MaskPDNumInCol ) >> HPD::ShiftPDNumInCol ) ); } /// Alias method for number in column (for HPD use case) [[nodiscard]] constexpr DataType pdNumInCol() const noexcept { return pdNumInMod(); } /// Retrieve The PD module number [[nodiscard]] constexpr DataType pdMod() const noexcept { - return ( DataType )( LIKELY( isPMT() ) ? ( ( key() & MaPMT::MaskPDMod ) >> MaPMT::ShiftPDMod ) - : ( ( key() & HPD::MaskPDCol ) >> HPD::ShiftPDCol ) ); + return ( DataType )( isPMT() ? ( ( key() & MaPMT::MaskPDMod ) >> MaPMT::ShiftPDMod ) + : ( ( key() & HPD::MaskPDCol ) >> HPD::ShiftPDCol ) ); } /// Alias method for PD column number (for HPD use case) [[nodiscard]] constexpr DataType pdCol() const noexcept { return pdMod(); } /// Retrieve The RICH panel [[nodiscard]] constexpr Rich::Side panel() const noexcept { - return ( Rich::Side )( LIKELY( isPMT() ) ? ( ( key() & MaPMT::MaskPanel ) >> MaPMT::ShiftPanel ) - : ( ( key() & HPD::MaskPanel ) >> HPD::ShiftPanel ) ); + return ( Rich::Side )( isPMT() ? ( ( key() & MaPMT::MaskPanel ) >> MaPMT::ShiftPanel ) + : ( ( key() & HPD::MaskPanel ) >> HPD::ShiftPanel ) ); } /// Retrieve The RICH Detector [[nodiscard]] constexpr Rich::DetectorType rich() const noexcept { - return ( Rich::DetectorType )( LIKELY( isPMT() ) ? ( ( key() & MaPMT::MaskRich ) >> MaPMT::ShiftRich ) - : ( ( key() & HPD::MaskRich ) >> HPD::ShiftRich ) ); + return ( Rich::DetectorType )( isPMT() ? ( ( key() & MaPMT::MaskRich ) >> MaPMT::ShiftRich ) + : ( ( key() & HPD::MaskRich ) >> HPD::ShiftRich ) ); } public: /// Retrieve Pixel sub-row field is set [[nodiscard]] constexpr bool pixelSubRowIsSet() const noexcept { // Note MaPMTs have no sub-pixel ... - return ( UNLIKELY( isHPD() ) ? 0 != ( ( key() & HPD::MaskPixelSubRowIsSet ) >> HPD::ShiftPixelSubRowIsSet ) - : false ); + return ( isHPD() ? 0 != ( ( key() & HPD::MaskPixelSubRowIsSet ) >> HPD::ShiftPixelSubRowIsSet ) : false ); } /// Retrieve Pixel column field is set [[nodiscard]] constexpr bool pixelColIsSet() const noexcept { - return ( LIKELY( isPMT() ) ? 0 != ( ( key() & MaPMT::MaskPixelColIsSet ) >> MaPMT::ShiftPixelColIsSet ) - : 0 != ( ( key() & HPD::MaskPixelColIsSet ) >> HPD::ShiftPixelColIsSet ) ); + return ( isPMT() ? 0 != ( ( key() & MaPMT::MaskPixelColIsSet ) >> MaPMT::ShiftPixelColIsSet ) + : 0 != ( ( key() & HPD::MaskPixelColIsSet ) >> HPD::ShiftPixelColIsSet ) ); } /// Retrieve Pixel row field is set [[nodiscard]] bool pixelRowIsSet() const noexcept { - return ( LIKELY( isPMT() ) ? 0 != ( ( key() & MaPMT::MaskPixelRowIsSet ) >> MaPMT::ShiftPixelRowIsSet ) - : 0 != ( ( key() & HPD::MaskPixelRowIsSet ) >> HPD::ShiftPixelRowIsSet ) ); + return ( isPMT() ? 0 != ( ( key() & MaPMT::MaskPixelRowIsSet ) >> MaPMT::ShiftPixelRowIsSet ) + : 0 != ( ( key() & HPD::MaskPixelRowIsSet ) >> HPD::ShiftPixelRowIsSet ) ); } /// Retrieve PD column field is set [[nodiscard]] constexpr bool pdIsSet() const noexcept { - return ( LIKELY( isPMT() ) ? 0 != ( ( key() & MaPMT::MaskPDIsSet ) >> MaPMT::ShiftPDIsSet ) - : 0 != ( ( key() & HPD::MaskPDIsSet ) >> HPD::ShiftPDIsSet ) ); + return ( isPMT() ? 0 != ( ( key() & MaPMT::MaskPDIsSet ) >> MaPMT::ShiftPDIsSet ) + : 0 != ( ( key() & HPD::MaskPDIsSet ) >> HPD::ShiftPDIsSet ) ); } /// Retrieve RICH panel field is set [[nodiscard]] constexpr bool panelIsSet() const noexcept { - return ( LIKELY( isPMT() ) ? 0 != ( ( key() & MaPMT::MaskPanelIsSet ) >> MaPMT::ShiftPanelIsSet ) - : 0 != ( ( key() & HPD::MaskPanelIsSet ) >> HPD::ShiftPanelIsSet ) ); + return ( isPMT() ? 0 != ( ( key() & MaPMT::MaskPanelIsSet ) >> MaPMT::ShiftPanelIsSet ) + : 0 != ( ( key() & HPD::MaskPanelIsSet ) >> HPD::ShiftPanelIsSet ) ); } /// Retrieve RICH detector field is set [[nodiscard]] constexpr bool richIsSet() const noexcept { - return ( LIKELY( isPMT() ) ? 0 != ( ( key() & MaPMT::MaskRichIsSet ) >> MaPMT::ShiftRichIsSet ) - : 0 != ( ( key() & HPD::MaskRichIsSet ) >> HPD::ShiftRichIsSet ) ); + return ( isPMT() ? 0 != ( ( key() & MaPMT::MaskRichIsSet ) >> MaPMT::ShiftRichIsSet ) + : 0 != ( ( key() & HPD::MaskRichIsSet ) >> HPD::ShiftRichIsSet ) ); } public: @@ -972,7 +968,7 @@ namespace LHCb { /** Returns true if the SmartID is for a 'large' (H-type) PMT. * @attention Will always return false for HPDs... */ [[nodiscard]] constexpr bool isLargePMT() const noexcept { - return ( UNLIKELY( isHPD() ) ? false : 0 != ( ( key() & MaPMT::MaskLargePixel ) >> MaPMT::ShiftLargePixel ) ); + return ( isHPD() ? false : 0 != ( ( key() & MaPMT::MaskLargePixel ) >> MaPMT::ShiftLargePixel ) ); } /// Alias method to explicitly ask if H-Type @@ -982,7 +978,7 @@ namespace LHCb { * @attention Does nothing for HPDs */ constexpr void setLargePMT( const bool flag ) noexcept { assert( isPMT() ); - if ( LIKELY( isPMT() ) ) { setData( flag, MaPMT::ShiftLargePixel, MaPMT::MaskLargePixel ); } + if ( isPMT() ) { setData( flag, MaPMT::ShiftLargePixel, MaPMT::MaskLargePixel ); } } public: @@ -995,9 +991,9 @@ namespace LHCb { #endif { assert( isPMT() ); - return ( LIKELY( isPMT() ) ? ( isLargePMT() ? MaPMT::HTypePMTsPerEC : MaPMT::RTypePMTsPerEC ) - // HPD fallback - : 1 ); + return ( isPMT() ? ( isLargePMT() ? MaPMT::HTypePMTsPerEC : MaPMT::RTypePMTsPerEC ) + // HPD fallback + : 1 ); } /// Derive PMT elementry cell number from PMT number in module @@ -1007,9 +1003,9 @@ namespace LHCb { #endif { assert( isPMT() ); - return ( LIKELY( isPMT() ) ? pdNumInMod() / numPMTsPerEC() - // HPD fallback - : 0 ); + return ( isPMT() ? pdNumInMod() / numPMTsPerEC() + // HPD fallback + : 0 ); } /// Derive PMT number within its elementry cell number from PMT number in module @@ -1019,9 +1015,9 @@ namespace LHCb { #endif { assert( isPMT() ); - return ( LIKELY( isPMT() ) ? pdNumInMod() % numPMTsPerEC() - // HPD fallback - : 0 ); + return ( isPMT() ? pdNumInMod() % numPMTsPerEC() + // HPD fallback + : 0 ); } /// Derive PMT anode index (0-63) from pixel column and row numbers @@ -1031,9 +1027,9 @@ namespace LHCb { #endif { assert( isPMT() ); - return ( LIKELY( isPMT() ) ? ( pixelRow() * MaPMT::PixelsPerCol ) + ( MaPMT::PixelsPerRow - 1 - pixelCol() ) - // HPD fallback - : 0 ); + return ( isPMT() ? ( pixelRow() * MaPMT::PixelsPerCol ) + ( MaPMT::PixelsPerRow - 1 - pixelCol() ) + // HPD fallback + : 0 ); } /// Returns the 'local' module number in each panel (i.e. starts at 0 in each panel) @@ -1044,9 +1040,9 @@ namespace LHCb { { assert( isPMT() ); // For PMTs, module number minus panel offset - return ( LIKELY( isPMT() ) ? pdMod() - MaPMT::PanelModuleOffsets[rich()][panel()] - // HPD fall back - : 0 ); + return ( isPMT() ? pdMod() - MaPMT::PanelModuleOffsets[rich()][panel()] + // HPD fall back + : 0 ); } /// Access the 'local' module column number (i.e. starts at 0 in each panel) @@ -1056,9 +1052,9 @@ namespace LHCb { #endif { assert( isPMT() ); - return ( LIKELY( isPMT() ) ? ( panelLocalModuleNum() / MaPMT::ModulesPerColumn ) - // HPD fallback - : 0 ); + return ( isPMT() ? ( panelLocalModuleNum() / MaPMT::ModulesPerColumn ) + // HPD fallback + : 0 ); } /// Returns the 'local' module number in each column (i.e. starts at 0 in each column) @@ -1068,9 +1064,9 @@ namespace LHCb { #endif { assert( isPMT() ); - return ( LIKELY( isPMT() ) ? ( panelLocalModuleNum() % MaPMT::ModulesPerColumn ) - // HPD fall back - : 0 ); + return ( isPMT() ? ( panelLocalModuleNum() % MaPMT::ModulesPerColumn ) + // HPD fall back + : 0 ); } /// Returns a 'local' EC pixel x coordinate for each PMT corrected for the PMT rotations in the EC @@ -1080,8 +1076,8 @@ namespace LHCb { #endif { assert( isPMT() ); - if ( LIKELY( isPMT() ) ) { - if ( UNLIKELY( isHTypePMT() ) ) { + if ( isPMT() ) { + if ( isHTypePMT() ) { return ( MaPMT::PixelsPerCol - 1 - pixelCol() ); } else { const auto iPMT = pdNumInEC(); @@ -1104,8 +1100,8 @@ namespace LHCb { #endif { assert( isPMT() ); - if ( LIKELY( isPMT() ) ) { - if ( UNLIKELY( isHTypePMT() ) ) { + if ( isPMT() ) { + if ( isHTypePMT() ) { return ( MaPMT::PixelsPerRow - 1 - pixelRow() ); } else { const auto iPMT = pdNumInEC(); @@ -1129,12 +1125,12 @@ namespace LHCb { { assert( isPMT() ); static_assert( MaPMT::PDGlobalViewShift % 2 == 0 ); - if ( LIKELY( isPMT() ) ) { + if ( isPMT() ) { const auto iCol = panelLocalModuleColumn(); const auto iLocalX = ecLocalPMTFrameX(); - return ( UNLIKELY( isHTypePMT() ) ? ( iCol * MaPMT::PDGlobalViewShift ) + ( 2 * iLocalX ) + 1 - : ( iCol * MaPMT::PDGlobalViewShift ) + - ( ( pdNumInEC() % 2 ) * ( MaPMT::PDGlobalViewShift / 2 ) ) + iLocalX ); + return ( isHTypePMT() ? ( iCol * MaPMT::PDGlobalViewShift ) + ( 2 * iLocalX ) + 1 + : ( iCol * MaPMT::PDGlobalViewShift ) + + ( ( pdNumInEC() % 2 ) * ( MaPMT::PDGlobalViewShift / 2 ) ) + iLocalX ); } else { // HPD fallback return 0; @@ -1149,16 +1145,15 @@ namespace LHCb { { assert( isPMT() ); static_assert( MaPMT::PDGlobalViewShift % 2 == 0 ); - if ( LIKELY( isPMT() ) ) { + if ( isPMT() ) { const auto iPDM = columnLocalModuleNum(); const auto iEC = elementaryCell(); const auto iLocalY = ecLocalPMTFrameY(); const std::int32_t shift = ( ( MaPMT::ModulesPerColumn - 1 - iPDM ) * MaPMT::PDGlobalViewShift * MaPMT::ECsPerModule ) + ( ( MaPMT::ECsPerModule - 1 - iEC ) * MaPMT::PDGlobalViewShift ) - MaPMT::PDGlobalViewRangeY[rich()]; - return ( UNLIKELY( isHTypePMT() ) - ? shift + ( ( 2 * iLocalY ) + 1 ) - : shift + ( ( 1 - ( pdNumInEC() / 2 ) ) * ( MaPMT::PDGlobalViewShift / 2 ) ) + iLocalY ); + return ( isHTypePMT() ? shift + ( ( 2 * iLocalY ) + 1 ) + : shift + ( ( 1 - ( pdNumInEC() / 2 ) ) * ( MaPMT::PDGlobalViewShift / 2 ) ) + iLocalY ); } else { // HPD fallback return 0; diff --git a/Kernel/LHCbKernel/src/LbAppInit.cpp b/Kernel/LHCbKernel/src/LbAppInit.cpp index 3d6b4c1eef59ee1533636342461eaeceb5e7fa2e..dea6f6281962e4ba52696fecf205cbd6a57e0779 100644 --- a/Kernel/LHCbKernel/src/LbAppInit.cpp +++ b/Kernel/LHCbKernel/src/LbAppInit.cpp @@ -125,12 +125,12 @@ void LbAppInit::checkMem() const { if ( msgLevel( MSG::DEBUG ) ) debug() << "==> LbAppInit()::execute" << endmsg; - if ( UNLIKELY( 0 == m_lastMem ) ) { + if ( 0 == m_lastMem ) { m_lastMem = System::virtualMemory(); - } else if ( UNLIKELY( 0 == m_evtCounter % m_increment && m_increment > 0 ) ) { + } else if ( 0 == m_evtCounter % m_increment && m_increment > 0 ) { unsigned long long mem = System::virtualMemory(); const auto memDiff = (long long)( mem - m_lastMem ); - if ( UNLIKELY( std::abs( memDiff ) >= m_minMemDelta ) ) { + if ( std::abs( memDiff ) >= m_minMemDelta ) { info() << "Memory has changed from " << m_lastMem << " to " << mem << " KB" << " (" << memDiff << "KB, " << 100. * memDiff / m_lastMem << "%)" << " in last " << m_increment.value() << " events" << endmsg; diff --git a/Kernel/LHCbKernel/src/RichSmartID.cpp b/Kernel/LHCbKernel/src/RichSmartID.cpp index 015dc7edce8070d38b8277018033f569d3bd61a6..0cbc090f3faf5aebced0289fa6ba58029480df8a 100644 --- a/Kernel/LHCbKernel/src/RichSmartID.cpp +++ b/Kernel/LHCbKernel/src/RichSmartID.cpp @@ -39,7 +39,7 @@ std::ostream& LHCb::RichSmartID::fillStream( std::ostream& s, const bool dumpSma s << "{"; // Dump the bits if requested - if ( UNLIKELY( dumpSmartIDBits ) ) { + if ( dumpSmartIDBits ) { s << " "; dumpBits( s ); } @@ -49,7 +49,7 @@ std::ostream& LHCb::RichSmartID::fillStream( std::ostream& s, const bool dumpSma const auto HPD = isHPD(); // Type - s << ( UNLIKELY( HPD ) ? " HPD" : PMT ? " PMT" : "UndefinedPD" ); + s << ( HPD ? " HPD" : PMT ? " PMT" : "UndefinedPD" ); // if PMT add size (large or small) if ( PMT && pdIsSet() ) { s << ( isLargePMT() ? ":h" : ":r" ); } @@ -83,7 +83,7 @@ std::ostream& LHCb::RichSmartID::fillStream( std::ostream& s, const bool dumpSma // Pixel info const auto pixColSet = pixelColIsSet(); const auto pixRowSet = pixelRowIsSet(); - if ( LIKELY( pixColSet || pixRowSet ) ) { + if ( pixColSet || pixRowSet ) { if ( pixColSet && pixRowSet ) { s << " Pix[Col,Row]:" << std::setfill( '0' ) << std::setw( PMT ? 1 : 2 ) << pixelCol() << "," << pixelRow(); } else { @@ -96,7 +96,7 @@ std::ostream& LHCb::RichSmartID::fillStream( std::ostream& s, const bool dumpSma } // Subpixel - if ( UNLIKELY( pixelSubRowIsSet() ) ) { s << " pixSubRow:" << format( "%1i", pixelSubRow() ); } + if ( pixelSubRowIsSet() ) { s << " pixSubRow:" << format( "%1i", pixelSubRow() ); } } else { // This SmartID has no valid bits set. This is bad ... diff --git a/Kernel/LHCbMath/include/LHCbMath/CPUDispatch.h b/Kernel/LHCbMath/include/LHCbMath/CPUDispatch.h index 64c3f3d1af1f00adc83887e019250b945bceb5a5..44f8176c5c40a1673f3a6caf3e89d97970cb3534 100644 --- a/Kernel/LHCbMath/include/LHCbMath/CPUDispatch.h +++ b/Kernel/LHCbMath/include/LHCbMath/CPUDispatch.h @@ -114,7 +114,7 @@ namespace LHCb { { ID lastID = UNKNOWN; for ( const auto& i : vtbl ) { - if ( UNLIKELY( i.first >= lastID ) ) { + if ( i.first >= lastID ) { throw GaudiException( "Dispatch table must be strictly in decreasing ID order", "LHCb::CPU::dispatch", StatusCode::FAILURE ); } @@ -140,7 +140,7 @@ namespace LHCb { } ); // check we found something to use - if ( UNLIKELY( impl == std::end( vtbl ) ) ) { + if ( impl == std::end( vtbl ) ) { throw GaudiException( "No implementation for instruction set level " + std::to_string( level ), "LHCb::CPU::dispatch", StatusCode::FAILURE ); } diff --git a/Kernel/LHCbMath/include/LHCbMath/FastMaths.h b/Kernel/LHCbMath/include/LHCbMath/FastMaths.h index f2390de47bdfda6e2ab2c8511f0b04580cb7b885..6639c6365077187ba88f2f9da778d9f76481b943 100644 --- a/Kernel/LHCbMath/include/LHCbMath/FastMaths.h +++ b/Kernel/LHCbMath/include/LHCbMath/FastMaths.h @@ -325,7 +325,7 @@ namespace LHCb::Math { // swap const auto swap = simd_cast<mtype>( poly == Int32<FP>::Zero() ); - if ( UNLIKELY( any_of( swap ) ) ) { + if ( any_of( swap ) ) { const auto tmp = c; c( swap ) = s; s( swap ) = tmp; diff --git a/Kernel/LHCbMath/include/LHCbMath/ve/compilerhints.h b/Kernel/LHCbMath/include/LHCbMath/ve/compilerhints.h index 615a65975162b7f44834b7dbe9cfcc509652a16e..6abe5ac70c64da504f6a9a768df963ec8b8e5435 100644 --- a/Kernel/LHCbMath/include/LHCbMath/ve/compilerhints.h +++ b/Kernel/LHCbMath/include/LHCbMath/ve/compilerhints.h @@ -12,44 +12,6 @@ #pragma once #include <cassert> - -// if somebody defined these macros before us, clean up -#if defined( NOINLINE ) -# undef NOINLINE -#endif -#if defined( UNREACHABLE ) -# undef UNREACHABLE -#endif -#if defined( LIKELY ) -# undef LIKELY -#endif -#if defined( UNLIKELY ) -# undef UNLIKELY -#endif -#if defined( ASSUME ) -# undef ASSUME -#endif -#if defined( PURE ) -# undef PURE -#endif - -// define our own versions, depending on compiler -#if defined( __GNUC__ ) -# define NOINLINE __attribute__( ( noinline ) ) -# define UNREACHABLE() __builtin_unreachable() -# define LIKELY( x ) __builtin_expect( static_cast<bool>( ( x ) ), true ) -# define UNLIKELY( x ) __builtin_expect( static_cast<bool>( ( x ) ), false ) -# define PURE __attribute__( ( pure ) ) -# define ASSUME( x ) ( static_cast<bool>( ( x ) ) ? static_cast<void>( 0 ) : __builtin_unreachable() ) -#else -# define NOINLINE -# define UNREACHABLE() assert( false ) -# define LIKELY( x ) ( static_cast<bool>( ( x ) ) ) -# define UNLIKELY( x ) ( static_cast<bool>( ( x ) ) ) -# define PURE -# define ASSUME( x ) assert( x ) -#endif - #include <type_traits> /* Copyright (C) CERN for the benefit of the LHCb collaboration diff --git a/Kernel/LHCbMath/include/LHCbMath/ve/ve.h b/Kernel/LHCbMath/include/LHCbMath/ve/ve.h index 88919de9cf606ac712eba5708fe777cf4bb8ffbc..7ebbe1120b4e9da1408fcb93b04d9e7fd6e67879 100644 --- a/Kernel/LHCbMath/include/LHCbMath/ve/ve.h +++ b/Kernel/LHCbMath/include/LHCbMath/ve/ve.h @@ -1305,8 +1305,6 @@ namespace ve { _hadd<1>( v, SEQ() ); // fallthrough case 1: break; - default: - UNREACHABLE(); } return v; } diff --git a/Kernel/LHCbMath/src/LHCbMath.cpp b/Kernel/LHCbMath/src/LHCbMath.cpp index 0708d7b12d54ab10e1451e2e36576d763a021a27..18b7806a54f36e2b389d220ccac19d279031f9f7 100644 --- a/Kernel/LHCbMath/src/LHCbMath.cpp +++ b/Kernel/LHCbMath/src/LHCbMath.cpp @@ -169,7 +169,7 @@ bool LHCb::Math::equal_to_uint( const double val, const unsigned int ref, const // ============================================================================ std::pair<double, int> LHCb::Math::frexp10( const double x ) { // - if ( UNLIKELY( 0 == x ) ) { return {x, 0}; } + if ( 0 == x ) { return {x, 0}; } // long double xa = 0 < x ? x : -x; // diff --git a/Kernel/LHCbMath/src/Lomont.cpp b/Kernel/LHCbMath/src/Lomont.cpp index 8bf06a995360e0fd7146fe1eb7d96ab97bd474d5..20353df877f45384bf14300f9c5420f6470a2bbb 100644 --- a/Kernel/LHCbMath/src/Lomont.cpp +++ b/Kernel/LHCbMath/src/Lomont.cpp @@ -164,7 +164,7 @@ namespace { // kind of "distance" between two floats inline int _distance_float_( const float af, const float bf ) { // - if ( UNLIKELY( af == bf ) ) { + if ( af == bf ) { return 0; } else if ( af > bf ) { return _safe_negate_( _distance_float_( bf, af ) ); @@ -194,7 +194,7 @@ namespace { // kind of "distance" between two doubles inline Long _distance_double_( const double af, const double bf ) { // - if ( UNLIKELY( af == bf ) ) { + if ( af == bf ) { return 0; } else if ( af > bf ) { return _safe_negate_( _distance_double_( bf, af ) ); diff --git a/Kernel/LHCbMath/src/Similarity.cpp b/Kernel/LHCbMath/src/Similarity.cpp index 4fe4554a139cb48c46ee811af6fd92fe2a94bf3f..7ffce47d635d4a9bdbf55851490ba16fa78e8495 100644 --- a/Kernel/LHCbMath/src/Similarity.cpp +++ b/Kernel/LHCbMath/src/Similarity.cpp @@ -256,7 +256,7 @@ namespace LHCb::Math::detail { #else - if ( UNLIKELY( Ci.data() == Ti.data() ) ) { throw "target and source overlap -- do not do that"; } + if ( Ci.data() == Ti.data() ) { throw "target and source overlap -- do not do that"; } auto _0 = Ci[0] * Fi[0] + Ci[1] * Fi[1] + Ci[3] * Fi[2] + Ci[6] * Fi[3] + Ci[10] * Fi[4]; auto _1 = Ci[1] * Fi[0] + Ci[2] * Fi[1] + Ci[4] * Fi[2] + Ci[7] * Fi[3] + Ci[11] * Fi[4]; auto _2 = Ci[3] * Fi[0] + Ci[4] * Fi[1] + Ci[5] * Fi[2] + Ci[8] * Fi[3] + Ci[12] * Fi[4]; @@ -312,7 +312,7 @@ namespace LHCb::Math::detail { * ( 0 0 | 0 0 | 1 ) **/ - if ( UNLIKELY( Ci.data() == Ti.data() ) ) { throw "target and source overlap -- do not do that"; } + if ( Ci.data() == Ti.data() ) { throw "target and source overlap -- do not do that"; } auto _0 = Ci[0] * 1. + Ci[3] * Fi[2] + Ci[6] * Fi[3] + Ci[10] * Fi[4]; auto _1 = Ci[1] * 1. + Ci[4] * Fi[2] + Ci[7] * Fi[3] + Ci[11] * Fi[4]; auto _2 = Ci[3] * 1. + Ci[5] * Fi[2] + Ci[8] * Fi[3] + Ci[12] * Fi[4]; @@ -467,7 +467,7 @@ namespace LHCb::Math::detail { #else - if ( UNLIKELY( Ci.data() == Ti.data() ) ) { throw "target and source overlap -- do not do that"; } + if ( Ci.data() == Ti.data() ) { throw "target and source overlap -- do not do that"; } auto _0 = Ci[0] * Fi[0] + Ci[1] * Fi[1] + Ci[3] * Fi[2] + Ci[6] * Fi[3] + Ci[10] * Fi[4]; auto _1 = Ci[1] * Fi[0] + Ci[2] * Fi[1] + Ci[4] * Fi[2] + Ci[7] * Fi[3] + Ci[11] * Fi[4]; auto _2 = Ci[3] * Fi[0] + Ci[4] * Fi[1] + Ci[5] * Fi[2] + Ci[8] * Fi[3] + Ci[12] * Fi[4]; @@ -536,7 +536,7 @@ namespace LHCb::Math::detail { } void similarity_2_5( span<const double, 3> Ci, span<const double, 10> Fi, span<double, 15> Ti ) { - if ( UNLIKELY( Ci.data() == Ti.data() ) ) { throw "target and source overlap -- do not do that"; } + if ( Ci.data() == Ti.data() ) { throw "target and source overlap -- do not do that"; } auto _0 = Ci[0] * Fi[0] + Ci[1] * Fi[1]; auto _1 = Ci[1] * Fi[0] + Ci[2] * Fi[1]; Ti[0] = Fi[0] * _0 + Fi[1] * _1; diff --git a/Kernel/PartProp/src/Components/PartPropAlg.cpp b/Kernel/PartProp/src/Components/PartPropAlg.cpp index f36ec2a00d1a3475dfc6efef79fb3dfdf2d02cea..f8e8d58de0c1f17870a1d6fd2f06312f633b82d3 100755 --- a/Kernel/PartProp/src/Components/PartPropAlg.cpp +++ b/Kernel/PartProp/src/Components/PartPropAlg.cpp @@ -74,7 +74,7 @@ namespace LHCb { // locate the new particle property service // ============================================================================ const LHCb::IParticlePropertySvc* LHCb::Example::PartPropAlg::ppSvc() const { - if ( UNLIKELY( !m_ppSvc ) ) { + if ( !m_ppSvc ) { m_ppSvc = service( "LHCb::ParticlePropertySvc", true ); if ( !m_ppSvc ) { throw GaudiException( "Service [LHCb::ParticlePropertySvc] not found", name(), StatusCode::FAILURE ); diff --git a/Kernel/PartProp/src/Components/ParticlePropertySvc.cpp b/Kernel/PartProp/src/Components/ParticlePropertySvc.cpp index e6fdd6139baaa5fb6273f35c5f0a86abd9f06951..1ad7ae5419896485d4bf9f9409a4913a30a59739 100755 --- a/Kernel/PartProp/src/Components/ParticlePropertySvc.cpp +++ b/Kernel/PartProp/src/Components/ParticlePropertySvc.cpp @@ -406,7 +406,7 @@ StatusCode LHCb::ParticlePropertySvc::rebuild() { if ( sc.isFailure() ) { return sc; } // RETURN /// some debug printout MsgStream log( msgSvc(), name() ); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) { + if ( log.level() <= MSG::DEBUG ) { log << MSG::DEBUG << " All: " << m_vector.size() << " By Name: " << m_nameMap.size() << " By PID: " << m_pidMap.size() << " Total: " << m_set.size() << endmsg; } @@ -631,7 +631,7 @@ StatusCode LHCb::ParticlePropertySvc::setAntiParticles() { // pp->setAntiParticle( anti ); if ( pp && pp->antiParticle() ) { - if ( UNLIKELY( log.level() <= MSG::VERBOSE ) ) + if ( log.level() <= MSG::VERBOSE ) log << MSG::VERBOSE << "Antiparticle for \n" << ( *pp ) << " is set to be \n" << ( *( pp->antiParticle() ) ) << endmsg; @@ -678,7 +678,7 @@ bool LHCb::ParticlePropertySvc::diff( const LHCb::ParticleProperty& n, const LHC // if ( d ) { MsgStream log( msgSvc(), name() ); - if ( UNLIKELY( log.level() <= MSG::DEBUG ) ) + if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << " Change the properties of '" << n.name() << "'/" << n.pid().pid() << std::endl << " New: " << n << std::endl << " Old: " << o << endmsg; diff --git a/Muon/MuonDAQ/src/components/MuonDAQTest.cpp b/Muon/MuonDAQ/src/components/MuonDAQTest.cpp index 26f84b5093dff602e96c62839c670a8f0696828c..cabfbf8b94d9a328cb847a41df52e3dd734b017e 100644 --- a/Muon/MuonDAQ/src/components/MuonDAQTest.cpp +++ b/Muon/MuonDAQ/src/components/MuonDAQTest.cpp @@ -29,7 +29,7 @@ StatusCode MuonDAQTest::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; m_MuonBuffer = tool<IMuonRawBuffer>( "MuonRawBuffer" ); if ( !m_MuonBuffer ) return Error( "Could not instantiate MuonRawBuffer tool" ); return sc; @@ -40,11 +40,11 @@ StatusCode MuonDAQTest::initialize() { //============================================================================= StatusCode MuonDAQTest::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; SmartDataPtr<LHCb::MuonDigits> digit( eventSvc(), LHCb::MuonDigitLocation::MuonDigit ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { for ( const auto& idigit : *digit ) { LHCb::MuonTileID digitTile = idigit->key(); debug() << "[" << digitTile.layout() << "," << digitTile.station() << "," << digitTile.region() << "," @@ -56,8 +56,8 @@ StatusCode MuonDAQTest::execute() { m_MuonBuffer->getTile( decodingTile ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); for ( auto jitile = decodingTile.begin(); jitile < decodingTile.end(); jitile++ ) { LHCb::MuonTileID digitTile = ( *jitile ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " ;ist of tile " << (unsigned int)digitTile << endmsg; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " ;ist of tile " << (unsigned int)digitTile << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "[" << digitTile.layout() << "," << digitTile.station() << "," << digitTile.region() << "," << digitTile.quarter() << "," << digitTile.nX() << "," << digitTile.nY() << "]" << endmsg; } @@ -69,7 +69,7 @@ StatusCode MuonDAQTest::execute() { LHCb::MuonTileID digitTile = digit.first; unsigned int time = digit.second; // info()<<" alesia "<<(unsigned int) digitTile<<endmsg; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "[" << digitTile.layout() << "," << digitTile.station() << "," << digitTile.region() << "," << digitTile.quarter() << "," << digitTile.nX() << "," << digitTile.nY() << "]" << " time " << time << endmsg; diff --git a/Muon/MuonDAQ/src/components/MuonDigitToRawBuffer.cpp b/Muon/MuonDAQ/src/components/MuonDigitToRawBuffer.cpp index d26c1872e61027e0c79118fe7994426b20035721..cd9e40e7c45ca6a97f30caa4733c9ecee01ff9e0 100644 --- a/Muon/MuonDAQ/src/components/MuonDigitToRawBuffer.cpp +++ b/Muon/MuonDAQ/src/components/MuonDigitToRawBuffer.cpp @@ -99,7 +99,7 @@ StatusCode MuonDigitToRawBuffer::initialize() { for ( int j = 0; j < 4; j++ ) firedInPP[i * 4 + j] = 0; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "board number " << m_TotL1Board << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "board number " << m_TotL1Board << endmsg; return StatusCode::SUCCESS; } @@ -118,7 +118,7 @@ StatusCode MuonDigitToRawBuffer::execute() { sc = ProcessV1( *digits, *raw ); break; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " exit " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " exit " << endmsg; return sc; } /// @@ -313,7 +313,7 @@ StatusCode MuonDigitToRawBuffer::ProcessV1( const LHCb::MuonDigits& digits, LHCb bank << padSize; bank << evt; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << i << " pad size " << padSize << " " << bankLenPad << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << i << " pad size " << padSize << " " << bankLenPad << endmsg; for ( std::vector<unsigned int>::iterator itPad = m_padInL1[i].begin(); itPad < m_padInL1[i].end(); itPad++ ) { @@ -335,7 +335,7 @@ StatusCode MuonDigitToRawBuffer::ProcessV1( const LHCb::MuonDigits& digits, LHCb if ( pp_data == 0 ) itHit = m_digitsInL1[i].begin(); for ( hit_counter = 0; hit_counter < pp_counter[pp_data]; hit_counter++ ) { short hit = (short)( *itHit ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "'digit written " << ( hit & 0x0FFF ) << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "'digit written " << ( hit & 0x0FFF ) << endmsg; bank << hit; itHit++; } @@ -411,7 +411,7 @@ StatusCode MuonDigitToRawBuffer::ProcessDigitDC06( const LHCb::MuonDigits& digit long DigitOutputPosition = ( m_muonDet->getDAQInfo() )->DAQaddressInODE( digitTile, L1Number, ODENumber, false ); if ( DigitOutputPosition >= 192 ) info() << " che diavolo succede " << endmsg; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "L1Number " << L1Number << " " << ODENumber << endmsg; debug() << " digitOutputPosition " << DigitOutputPosition << endmsg; } @@ -459,7 +459,7 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { unsigned int iODE = 0; for ( iODE = 0; iODE < ODE_in_L1; iODE++ ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " start a new ODE " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " start a new ODE " << endmsg; unsigned int odenumber = ( m_muonDet->getDAQInfo() )->getODENumberInTell1( i, iODE ) - 1; ; @@ -468,7 +468,7 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { SmartDataPtr<MuonODEBoard> ode( detSvc(), ODEpath ); // how many digit in the TS? TSInODE = ode->getTSNumber(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "TS " << TSInODE << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "TS " << TSInODE << endmsg; SmartDataPtr<MuonTSMap> TS( detSvc(), cablingBasePath + ode->getTSName( 0 ) ); long channelInTS = TS->numberOfOutputSignal(); @@ -477,7 +477,7 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { } else { maxPads = channelInTS; } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " max pad " << maxPads << " " << channelInTS << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " max pad " << maxPads << " " << channelInTS << endmsg; std::vector<unsigned int> list_input( channelInTS, 0 ); // debug()<<" channelInTS "<<channelInTS<<endmsg; @@ -486,7 +486,7 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { for ( auto itDigit = m_digitsInODE[odenumber].begin(); itDigit < m_digitsInODE[odenumber].end(); itDigit++ ) { MuonHLTDigitFormat temp( *itDigit, MuonBankVersion::DC06 ); unsigned int address = temp.getAddress(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << address << " " << channelInTS << " " << TSInODE << " " << TSnumberInODE << endmsg; if ( itDigit == m_digitsInODE[odenumber].begin() ) { TSnumberInODE = address / channelInTS; } @@ -503,7 +503,7 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { // debug()<<" TSPath "<< TSPath <<endmsg; std::vector<unsigned int> resultsAddress = m_muonDet->getDAQInfo()->padsinTS( list_input, TSPath ); // store the output - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "size " << resultsAddress.size() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "size " << resultsAddress.size() << endmsg; std::transform( resultsAddress.begin(), resultsAddress.end(), std::back_inserter( m_padInL1[i] ), [&]( const auto& pad ) { return padsInTell1 + maxPads * TSnumberInODE + pad; } ); @@ -512,11 +512,11 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { // padsInTell1=padsInTell1+maxPads; // clear the area std::fill( list_input.begin(), list_input.end(), 0 ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " qui qui " << swap << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " qui qui " << swap << endmsg; TSnumberInODE = address / channelInTS; if ( swap ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "adding in position " << address - channelInTS * TSnumberInODE << " " << address << endmsg; debug() << list_input.size() << endmsg; } @@ -524,9 +524,9 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { list_input[address - channelInTS * TSnumberInODE] = 1; // add the pads mechanism.... if ( itDigit == m_digitsInODE[odenumber].end() - 1 ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " before " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " before " << endmsg; const auto& resultsAddress = m_muonDet->getDAQInfo()->padsinTS( list_input, TSPath ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " after " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " after " << endmsg; std::transform( resultsAddress.begin(), resultsAddress.end(), std::back_inserter( m_padInL1[i] ), [&]( const auto& pad ) { return padsInTell1 + maxPads * TSnumberInODE + pad; } ); } @@ -537,7 +537,7 @@ StatusCode MuonDigitToRawBuffer::ProcessPads() { } padsInTell1 = padsInTell1 + maxPads * TSInODE; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " eccoci " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " eccoci " << endmsg; } // end of loop on ODEs } @@ -554,17 +554,17 @@ StatusCode MuonDigitToRawBuffer::ProcessDigitV1( const LHCb::MuonDigits& digit ) long ODENumber = 0; unsigned int ODEAdd = 0; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Processing V1 digit: " << digitTile.toString() << " time " << time << endmsg; // continue; long DigitOutputPosition = ( m_muonDet->getDAQInfo() )->DAQaddressInL1( digitTile, L1Number, ODENumber, ODEAdd ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " L1 add " << L1Number << " " << ODENumber << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " L1 add " << L1Number << " " << ODENumber << endmsg; long DigitOutputPositionInODE = ( m_muonDet->getDAQInfo() )->DAQaddressInODE( digitTile, L1Number, ODENumber, false ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "L1Number " << L1Number << " " << ODENumber << endmsg; debug() << " digitOutputPosition " << DigitOutputPosition << endmsg; } @@ -576,8 +576,7 @@ StatusCode MuonDigitToRawBuffer::ProcessDigitV1( const LHCb::MuonDigits& digit ) std::string l1name = ( m_muonDet->getDAQInfo() )->findL1( digitTile ); int L1Index = ( m_muonDet->getDAQInfo() )->findL1Index( l1name ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << "Found index for L1board: " << l1name << " " << L1Index << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Found index for L1board: " << l1name << " " << L1Index << endmsg; unsigned int pp_num = ( m_muonDet->getDAQInfo() )->getPPNumber( L1Index, ODENumber ); @@ -596,7 +595,7 @@ StatusCode MuonDigitToRawBuffer::ProcessDigitV1( const LHCb::MuonDigits& digit ) m_digitsInL1[L1Index].push_back( digitInDAQ ); firedInPP[L1Index * 4 + pp_num]++; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " pp_num/L1index/L1num " << pp_num << " " << L1Index << " " << L1Number << endmsg; // debug()<<" digit word "<<L1Number-1<<" "<<ODENumber-1<<" "<< @@ -614,11 +613,11 @@ StatusCode MuonDigitToRawBuffer::ProcessDigitV1( const LHCb::MuonDigits& digit ) // debug()<<" tot ODE "<<m_TotODEBoard<<endmsg; for ( unsigned int i = 0; i < MuonDAQHelper_maxTell1Number; i++ ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " start sorting " << m_digitsInL1[i].size() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " start sorting " << m_digitsInL1[i].size() << endmsg; std::stable_sort( m_digitsInL1[i].begin(), m_digitsInL1[i].end(), SortDigitInL1() ); } for ( unsigned int i = 0; i < MuonDAQHelper_maxODENumber; i++ ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " start sorting " << m_digitsInODE[i].size() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " start sorting " << m_digitsInODE[i].size() << endmsg; std::stable_sort( m_digitsInODE[i].begin(), m_digitsInODE[i].end(), SortDigitInODE() ); } diff --git a/Muon/MuonDAQ/src/components/MuonPadTest.cpp b/Muon/MuonDAQ/src/components/MuonPadTest.cpp index 8bbf669d35d95aa96300ab12d31304c7f0d71cd3..c06d89151c2d485597cea833d0b418b3967a1dda 100644 --- a/Muon/MuonDAQ/src/components/MuonPadTest.cpp +++ b/Muon/MuonDAQ/src/components/MuonPadTest.cpp @@ -30,7 +30,7 @@ StatusCode MuonPadTest::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; m_MuonBuffer = tool<IMuonRawBuffer>( "MuonRawBuffer" ); if ( !m_MuonBuffer ) return Error( "Could not instantiate MuonRawBuffer tool" ); return sc; @@ -41,26 +41,26 @@ StatusCode MuonPadTest::initialize() { //============================================================================= StatusCode MuonPadTest::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; std::vector<LHCb::MuonTileID> decodingTile; m_MuonBuffer->getPads( decodingTile ).ignore(); SmartDataPtr<LHCb::MuonCoords> coord( eventSvc(), LHCb::MuonCoordLocation::MuonCoords ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << " coord " << coord->size() << endmsg; debug() << " pad " << decodingTile.size() << endmsg; } for ( auto icoord = coord->begin(); icoord < coord->end(); icoord++ ) { LHCb::MuonTileID tileCoord = ( *icoord )->key(); if ( tileCoord.station() > 0 ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "[" << tileCoord.layout() << "," << tileCoord.station() << "," << tileCoord.region() << "," << tileCoord.quarter() << "," << tileCoord.nX() << "," << tileCoord.nY() << "]" << endmsg; bool found = false; for ( auto ipad = decodingTile.begin(); ipad < decodingTile.end(); ipad++ ) { if ( *ipad == tileCoord ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " found the matching coord " << "[" << ipad->layout() << "," << ipad->station() << "," << ipad->region() << "," << ipad->quarter() << "," << ipad->nX() << "," << ipad->nY() << "]" << endmsg; diff --git a/Muon/MuonDAQ/src/components/MuonRawBuffer.cpp b/Muon/MuonDAQ/src/components/MuonRawBuffer.cpp index 3cc51001446133a65a94f9bee0c25a051a30f5d4..ca794c63eca3f921796d082137219b2af98b11d1 100644 --- a/Muon/MuonDAQ/src/components/MuonRawBuffer.cpp +++ b/Muon/MuonDAQ/src/components/MuonRawBuffer.cpp @@ -49,7 +49,7 @@ namespace { TESOffsetGuard( GaudiTool& parent, int& parentScope, const std::string& offset ) : m_parent( &parent ), m_parentScope( parentScope ) { if ( ++m_parentScope != 1 ) return; // not the outermost guard - if ( UNLIKELY( m_parent->msgLevel( MSG::DEBUG ) ) ) m_parent->debug() << " changing rootInTES " << endmsg; + if ( m_parent->msgLevel( MSG::DEBUG ) ) m_parent->debug() << " changing rootInTES " << endmsg; m_original = m_parent->rootInTES(); StatusCode sc = m_parent->setProperty( "RootInTES", offset ); if ( sc.isFailure() ) { @@ -108,7 +108,7 @@ void MuonRawBuffer::handle( const Incident& incident ) { } void MuonRawBuffer::clearData() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " reset all buffers " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " reset all buffers " << endmsg; m_checkTell1HeaderPerformed = false; m_checkTell1HeaderResult = true; m_status.reset(); @@ -324,16 +324,16 @@ StatusCode MuonRawBuffer::decodeTileAndTDCV1( const RawBank* rawdata ) { unsigned int pp_cnt = *it++; m_hitNumInPP[tell1Number * 4 + i] = pp_cnt; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " hit in PP " << pp_cnt << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " hit in PP " << pp_cnt << endmsg; for ( unsigned int loop = 0; loop < pp_cnt; ++loop ) { unsigned int add = ( *it ) & ( 0x0FFF ); unsigned int tdc_value = ( ( ( *it ) & ( 0xF000 ) ) >> 12 ); ++it; MuonTileID tile = m_muonDet->getDAQInfo()->getADDInTell1( tell1Number, add ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " add " << add << ' ' << tile << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " add " << add << ' ' << tile << endmsg; if ( tile.isValid() ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " valid add " << add << ' ' << tile << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " valid add " << add << ' ' << tile << endmsg; m_storage[tell1Number].emplace_back( tile, tdc_value ); } else { m_counter_invalid_hit[tell1Number]++; @@ -425,7 +425,7 @@ StatusCode MuonRawBuffer::getTile( const LHCb::RawEvent* raw, std::vector<LHCb:: if ( !sc.isFailure() ) { const auto& b = raw->banks( RawBank::Muon ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " tell1 " << b.size() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " tell1 " << b.size() << endmsg; // first decode data and insert in buffer for ( const auto& r : b ) { @@ -453,7 +453,7 @@ StatusCode MuonRawBuffer::getTileAndTDC( const LHCb::RawEvent* if ( !sc.isFailure() ) { storage.clear(); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " start the real decoding " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " start the real decoding " << endmsg; const auto& mb = raw->banks( RawBank::Muon ); @@ -462,7 +462,7 @@ StatusCode MuonRawBuffer::getTileAndTDC( const LHCb::RawEvent* StatusCode sc = DecodeData( r ); if ( sc.isFailure() ) return sc; } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " the decoding is finished " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " the decoding is finished " << endmsg; // compact data in one container for ( const auto& r : mb ) { @@ -593,7 +593,7 @@ StatusCode MuonRawBuffer::decodeNZSupp( int tell1Number ) { if ( !raw ) return Error( "Failed to find raw data" ); const auto& b = raw->banks( RawBank::MuonFull ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " tell1 " << b.size() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " tell1 " << b.size() << endmsg; if ( b.empty() ) { info() << " you have request NZS bank for muon detectorct ---> " << "such bank are not presente in input file " << endmsg; @@ -603,7 +603,7 @@ StatusCode MuonRawBuffer::decodeNZSupp( int tell1Number ) { } StatusCode MuonRawBuffer::decodeNZSupp( const LHCb::RawBank* r ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " start decoding " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " start decoding " << endmsg; unsigned int tell1Num = ( r )->sourceID(); if ( RawBank::MagicPattern != r->magic() ) { error() << "magic pattern not correct in muon bank " << endmsg; @@ -617,7 +617,7 @@ StatusCode MuonRawBuffer::decodeNZSupp( const LHCb::RawBank* r ) { // loop on PP for ( int pp_num = 0; pp_num < 4; pp_num++ ) { unsigned int off = pp_num * 6; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " pp 0 " << pp_num << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " pp 0 " << pp_num << endmsg; // skip first 6 words ... always set to zero std::advance( it, 6 ); @@ -645,7 +645,7 @@ StatusCode MuonRawBuffer::decodeNZSupp( const LHCb::RawBank* r ) { it++; } } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " now fill the buffer " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " now fill the buffer " << endmsg; // now copy the data to the buffer for ( int i = 0; i < 24; i++ ) { m_ODEData[tell1Num * 24 + i].setData( data[i] ); } return StatusCode::SUCCESS; @@ -671,7 +671,7 @@ StatusCode MuonRawBuffer::getNZSupp( const LHCb::RawBank* std::vector<std::pair<LHCb::MuonTileID, unsigned int>>& tileAndTDC ) { unsigned int tell1Number = r->sourceID(); m_NZSprocessed_bank[tell1Number]++; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " t1 " << tell1Number << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " t1 " << tell1Number << endmsg; int fix_size = ( c_NLink * 36 + 8 * 4 ) * 4; if ( r->size() != fix_size ) return StatusCode::FAILURE; @@ -683,7 +683,7 @@ StatusCode MuonRawBuffer::getNZSupp( const LHCb::RawBank* unsigned int ODE_num = ( m_muonDet->getDAQInfo() )->getODENumberInLink( tell1Number, iLink ); if ( ODE_num > 0 ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " ODE " << ODE_num << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " ODE " << ODE_num << endmsg; unsigned int ch = 0; for ( unsigned int iData = 1; iData < c_NLink + 1; iData++ ) { @@ -710,7 +710,7 @@ MuonPPEventInfo MuonRawBuffer::getPPInfo( const LHCb::RawBank* r, unsigned int p unsigned int tell1Number = r->sourceID(); if ( !m_ODEAlreadyDecoded[tell1Number] ) { StatusCode sc = decodeNZSupp( r ); - if ( sc.isFailure() && UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "error in decoding NZSP bank" << endmsg; + if ( sc.isFailure() && msgLevel( MSG::DEBUG ) ) debug() << "error in decoding NZSP bank" << endmsg; } return m_PPEventInfo[tell1Number * 4 + pp_num]; } @@ -719,7 +719,7 @@ MuonPPEventInfo MuonRawBuffer::getPPInfo( unsigned int tell1Number, unsigned int if ( !m_ODEAlreadyDecoded[tell1Number] ) { // serach for bank and decode it StatusCode sc = decodeNZSupp( tell1Number ); - if ( sc.isFailure() && UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "error in decoding NZSP bank" << endmsg; + if ( sc.isFailure() && msgLevel( MSG::DEBUG ) ) debug() << "error in decoding NZSP bank" << endmsg; } return m_PPEventInfo[tell1Number * 4 + pp_num]; } @@ -751,7 +751,7 @@ StatusCode MuonRawBuffer::getNZSupp( const LHCb::RawEvent* TESOffsetGuard guard{*this, m_TESChanged, offset}; const auto& b = raw->banks( RawBank::MuonFull ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " tell1 " << b.size() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " tell1 " << b.size() << endmsg; if ( b.empty() ) { info() << " you have request NZS bank for muon detectorct ---> " << "such bank ar enot presente in input file " << endmsg; @@ -900,16 +900,16 @@ std::vector<std::pair<MuonTell1Header, unsigned int>> MuonRawBuffer::getHeaders( } StatusCode MuonRawBuffer::checkAllHeaders( const LHCb::RawEvent* raw ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " check headers consistency " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " check headers consistency " << endmsg; if ( m_checkTell1HeaderPerformed ) return StatusCode{m_checkTell1HeaderResult}; m_checkTell1HeaderPerformed = true; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " check headers consistency not yet done" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " check headers consistency not yet done" << endmsg; const auto& b = raw->banks( RawBank::Muon ); if ( b.empty() ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " no muon banks in event" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " no muon banks in event" << endmsg; for ( int i = 0; i < static_cast<int>( MuonDAQHelper_maxTell1Number ); i++ ) { m_status->addStatus( i, RawBankReadoutStatus::Status::Missing ); } @@ -930,7 +930,7 @@ StatusCode MuonRawBuffer::checkAllHeaders( const LHCb::RawEvent* raw ) { if ( iList != tell1InEvent.end() ) { m_checkTell1HeaderResult = false; m_checkTell1HeaderPerformed = true; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " failed " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " failed " << endmsg; foundError = true; m_status->addStatus( tell1Number, RawBankReadoutStatus::Status::NonUnique ); break; @@ -964,7 +964,7 @@ StatusCode MuonRawBuffer::checkAllHeaders( const LHCb::RawEvent* raw ) { m_status->addStatus( ( *ibad )->sourceID(), RawBankReadoutStatus::Status::Tell1Error ); return StatusCode::FAILURE; // return m_checkTell1HeaderResult; } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " test successeful " << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " test successeful " << endmsg; return StatusCode::SUCCESS; } @@ -973,7 +973,7 @@ void MuonRawBuffer::fillTell1Header( unsigned int tell1Number, unsigned int data if ( m_already_decoded_headerTell1[tell1Number] ) return; MuonTell1Header dataWord( data ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << dataWord.getError() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << dataWord.getError() << endmsg; if ( dataWord.getError() ) m_tell1_header_error[tell1Number]++; if ( dataWord.getOROfODEErrors() ) m_tell1_header_ORODE_error[tell1Number]++; @@ -993,8 +993,7 @@ void MuonRawBuffer::putStatusOnTES() { if ( !status ) { std::stringstream type; type << toString( m_status->key() ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) - verbose() << "Status for bankType " << type.str() << " created now" << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Status for bankType " << type.str() << " created now" << endmsg; status = new Status( *m_status ); statuss->insert( status ); @@ -1002,8 +1001,7 @@ void MuonRawBuffer::putStatusOnTES() { std::stringstream type; type << toString( m_status->key() ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << "Status for bankType " << type.str() << " already exists" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Status for bankType " << type.str() << " already exists" << endmsg; if ( status->status() != m_status->status() ) { Warning( "Status for bankType " + type.str() + " already exists with different status value -> merge both", StatusCode::SUCCESS ) @@ -1015,5 +1013,5 @@ void MuonRawBuffer::putStatusOnTES() { void MuonRawBuffer::initStatus() { if ( !m_status ) { m_status.emplace( RawBank::Muon ); } - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " init " << m_status->key() << " " << *m_status << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " init " << m_status->key() << " " << *m_status << endmsg; } diff --git a/Muon/MuonDAQ/src/components/MuonRawToCoord.cpp b/Muon/MuonDAQ/src/components/MuonRawToCoord.cpp index e25f07ea5be88d6475d7aed023e51b3a1b47f45a..5334a98b08464f20f8ca40131e97e18bfb442662 100644 --- a/Muon/MuonDAQ/src/components/MuonRawToCoord.cpp +++ b/Muon/MuonDAQ/src/components/MuonRawToCoord.cpp @@ -111,15 +111,13 @@ namespace { if ( rawdata.size() < preamble_size ) { OOPS( MuonRaw::ErrorCode::PADDING_TOO_LONG ); } rawdata = rawdata.subspan( preamble_size ); for ( int i = 0; i < 4; ++i ) { - if ( UNLIKELY( rawdata.empty() ) ) { OOPS( MuonRaw::ErrorCode::BANK_TOO_SHORT ); } - if ( UNLIKELY( rawdata.size() < static_cast<SpanSize>( 1 + rawdata[0] ) ) ) { - OOPS( MuonRaw::ErrorCode::TOO_MANY_HITS ); - } + if ( rawdata.empty() ) { OOPS( MuonRaw::ErrorCode::BANK_TOO_SHORT ); } + if ( rawdata.size() < static_cast<SpanSize>( 1 + rawdata[0] ) ) { OOPS( MuonRaw::ErrorCode::TOO_MANY_HITS ); } for ( unsigned int pp : rawdata.subspan( 1, rawdata[0] ) ) { unsigned int add = ( pp & 0x0FFF ); unsigned int tdc_value = ( ( pp & 0xF000 ) >> 12 ); std::optional<LHCb::MuonTileID> tile = make_tile( add ); - if ( UNLIKELY( !tile.has_value() ) ) continue; + if ( !tile.has_value() ) continue; *out++ = {std::move( *tile ), tdc_value}; } rawdata = rawdata.subspan( 1 + rawdata[0] ); diff --git a/Muon/MuonDAQ/src/components/MuonRawToHits.cpp b/Muon/MuonDAQ/src/components/MuonRawToHits.cpp index 6c00efa6ac9e9b079c0af53da58b6b74dcc514d3..a1779629acf473298c52170c105c677a474703a4 100644 --- a/Muon/MuonDAQ/src/components/MuonRawToHits.cpp +++ b/Muon/MuonDAQ/src/components/MuonRawToHits.cpp @@ -176,14 +176,10 @@ namespace LHCb::Muon::DAQ { if ( range.size() < preamble_size ) { OOPS( EC::RawToHits::ErrorCode::PADDING_TOO_LONG ); } range = range.subspan( preamble_size ); for ( int i = 0; i < 4; i++ ) { - if ( UNLIKELY( range.empty() ) ) { OOPS( EC::RawToHits::ErrorCode::BANK_TOO_SHORT ); } - if ( UNLIKELY( range.size() < static_cast<SpanSize>( 1 + range[0] ) ) ) { - OOPS( EC::RawToHits::ErrorCode::TOO_MANY_HITS ); - } + if ( range.empty() ) { OOPS( EC::RawToHits::ErrorCode::BANK_TOO_SHORT ); } + if ( range.size() < static_cast<SpanSize>( 1 + range[0] ) ) { OOPS( EC::RawToHits::ErrorCode::TOO_MANY_HITS ); } for ( unsigned short data : range.subspan( 1, range[0] ) ) { - if ( auto tile = make_tile( data ); LIKELY( tile.has_value() ) ) { - *output++ = {std::move( *tile ), make_tdc( data )}; - } + if ( auto tile = make_tile( data ); tile.has_value() ) { *output++ = {std::move( *tile ), make_tdc( data )}; } } range = range.subspan( 1 + range[0] ); } diff --git a/Muon/MuonDAQ/src/components/MuonRec.cpp b/Muon/MuonDAQ/src/components/MuonRec.cpp index 2e5edf4b720e0b1a0a857706408ac5c25b21c4b4..85ffef3ae6a9ee55a98f88998726304ebfa75609 100644 --- a/Muon/MuonDAQ/src/components/MuonRec.cpp +++ b/Muon/MuonDAQ/src/components/MuonRec.cpp @@ -98,7 +98,7 @@ StatusCode LHCb::MuonRec::initialize() { StatusCode sc = prop->setProperty( "RootInTES", rootInTES() ); if ( sc.isFailure() ) return Error( "Unable to set RootInTES property of MuonRawBuffer", sc ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " station number " << m_NStation << " " << m_NRegion << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " station number " << m_NStation << " " << m_NRegion << endmsg; return StatusCode::SUCCESS; } ); } @@ -114,7 +114,7 @@ LHCb::MuonCoords LHCb::MuonRec::operator()( const LHCb::RawEvent& rawEvent ) con StatusCode sc = m_muonBuffer->getTileAndTDC( &rawEvent, decoding, rootInTES() ); if ( sc.isFailure() ) throw( "Error in decoding the muon raw data " ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << decoding.size() << " digits in input " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << decoding.size() << " digits in input " << endmsg; MuonCoords coords; for ( int station = 0; station < m_NStation; station++ ) { @@ -123,7 +123,7 @@ LHCb::MuonCoords LHCb::MuonRec::operator()( const LHCb::RawEvent& rawEvent ) con // get mapping of input to output from region // in fact we are reversing the conversion done in the digitisation int NLogicalMap = m_muonDetector->getLogMapInRegion( station, region ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " station and region " << station << " " << region << " maps " << NLogicalMap << endmsg; if ( 1 == NLogicalMap ) { @@ -166,13 +166,13 @@ StatusCode LHCb::MuonRec::addCoordsNoMap( LHCb::MuonCoords& if ( ( iD->first ).station() == static_cast<unsigned int>( station ) && ( iD->first ).region() == static_cast<unsigned int>( region ) ) { // make the coordinate to be added to coords - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " digit tile " << iD->first << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " digit tile " << iD->first << endmsg; auto current = std::make_unique<MuonCoord>( iD->first, iD->second ); // need to clear the layer and readout bits MuonTileID pad = iD->first; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << pad << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << pad << endmsg; // as no change between digit and coord in this mapping key is the same try { @@ -247,7 +247,7 @@ StatusCode LHCb::MuonRec::addCoordsCrossingMap( LHCb::MuonCoords& iOne->second = true; iTwo->second = true; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " Made a crossed pad " << pad << " from " << ( iOne->first ) << " and " << ( iTwo->first ) << endmsg; } @@ -263,7 +263,7 @@ StatusCode LHCb::MuonRec::addCoordsCrossingMap( LHCb::MuonCoords& // make the coordinate to be added to coords auto current = std::make_unique<MuonCoord>( iOne->first.first, iOne->first.second ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " Found an uncrossed pad type 1 " << pad << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " Found an uncrossed pad type 1 " << pad << endmsg; try { coords.insert( current.get() ); @@ -285,7 +285,7 @@ StatusCode LHCb::MuonRec::addCoordsCrossingMap( LHCb::MuonCoords& // make the coordinate to be added to coords auto current = std::make_unique<MuonCoord>( iTwo->first.first, iTwo->first.second ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " Found an uncrossed pad type 2 " << pad << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " Found an uncrossed pad type 2 " << pad << endmsg; try { coords.insert( current.get() ); current.release(); diff --git a/Muon/MuonDAQ/src/components/MuonTAERec.cpp b/Muon/MuonDAQ/src/components/MuonTAERec.cpp index 9b17683f788696d0f7da9db8001f8402e8652738..1adf5f3c27bae14fc28035e2093135990523ca65 100644 --- a/Muon/MuonDAQ/src/components/MuonTAERec.cpp +++ b/Muon/MuonDAQ/src/components/MuonTAERec.cpp @@ -41,7 +41,7 @@ StatusCode MuonTAERec::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; m_muonDetector = getDet<DeMuonDetector>( DeMuonLocation::Default ); // TDS path to the Muon system is of the form /dd/Structure/LHCb/Muon @@ -60,7 +60,7 @@ StatusCode MuonTAERec::initialize() { // if TAE mode use the pribate tool to reset the meomory. m_muonBuffer = tool<IMuonRawBuffer>( "MuonRawBuffer", this ); if ( !m_muonBuffer ) info() << "error retrieving the tool " << endmsg; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " station number " << m_NStation << " " << m_NRegion << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " station number " << m_NStation << " " << m_NRegion << endmsg; m_offsetLoc[0] = "Prev7/"; m_offsetLoc[1] = "Prev6/"; m_offsetLoc[2] = "Prev5/"; @@ -87,7 +87,7 @@ StatusCode MuonTAERec::initialize() { //============================================================================= StatusCode MuonTAERec::execute() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; MuonCoords* coords = new MuonCoords; if ( !m_ignoreExecution ) { // need to loop over input vector of MuonDigits @@ -102,7 +102,7 @@ StatusCode MuonTAERec::execute() { // get tiles from the raw buffer StatusCode sc = m_muonBuffer->getTileAndTDC( raw, decoding, m_offsetLoc[7 + i] ); if ( sc.isFailure() ) { return Error( "Error in decoding the muon raw data" ); } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << decoding.size() << " digits in input " << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << decoding.size() << " digits in input " << endmsg; for ( it = decoding.begin(); it != decoding.end(); it++ ) { @@ -112,7 +112,7 @@ StatusCode MuonTAERec::execute() { // info()<<" digit in input "<<(*it).first<<endmsg; for ( icheck = m_logChannels.begin(); icheck != m_logChannels.end(); icheck++ ) { if ( ( *it ).first == ( *icheck ).first ) { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " found double hit check time " << ( *it ).second + ( 7 + i ) * 16 << " " << ( *icheck ).second << endmsg; // take only the first one @@ -120,13 +120,12 @@ StatusCode MuonTAERec::execute() { tone = tone + ( 7 + i ) * 16; if ( tone > ( *icheck ).second ) { add = false; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " so keep the existing one and not add the new one " << endmsg; break; } else { - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) - verbose() << "remove the old one " << m_logChannels.size() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "remove the old one " << m_logChannels.size() << endmsg; m_logChannels.erase( icheck ); } } @@ -134,7 +133,7 @@ StatusCode MuonTAERec::execute() { if ( add ) { ( *it ).second += ( 7 + i ) * 16; std::pair<LHCb::MuonTileID, unsigned int> ch( ( *it ).first, ( *it ).second ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "adding digit " << ( *it ).first << " to toal number " << m_logChannels.size() << endmsg; m_logChannels.push_back( ch ); } @@ -148,7 +147,7 @@ StatusCode MuonTAERec::execute() { // get mapping of input to output from region // in fact we are reversing the conversion done in the digitisation int NLogicalMap = m_muonDetector->getLogMapInRegion( station, region ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " station and region " << station << " " << region << " maps " << NLogicalMap << endmsg; if ( 1 == NLogicalMap ) { // straight copy of the input + making SmartRefs to the MuonDigits @@ -187,13 +186,13 @@ StatusCode MuonTAERec::addCoordsNoMap( MuonCoords* if ( ( iD->first ).station() == static_cast<unsigned int>( station ) && ( iD->first ).region() == static_cast<unsigned int>( region ) ) { // make the coordinate to be added to coords - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " digit tile " << iD->first << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " digit tile " << iD->first << endmsg; MuonCoord* current = new MuonCoord( iD->first, iD->second ); // need to clear the layer and readout bits MuonTileID pad = iD->first; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << pad << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << pad << endmsg; // as no change between digit and coord in this mapping key is the same coords->insert( current ); @@ -247,7 +246,7 @@ StatusCode MuonTAERec::addCoordsCrossingMap( MuonCoords* // make the coordinate to be added to coords MuonCoord* current = new MuonCoord( pad, iOne->first.first, iTwo->first.first, iOne->first.second, iTwo->first.second ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " Made an crossed pad " << pad << " from " << ( iOne->first ) << " and " << ( iTwo->first ) << endmsg; @@ -270,7 +269,7 @@ StatusCode MuonTAERec::addCoordsCrossingMap( MuonCoords* // make the coordinate to be added to coords MuonCoord* current = new MuonCoord( iOne->first.first, iOne->first.second ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " Found an uncrossed pad type 1 " << pad << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " Found an uncrossed pad type 1 " << pad << endmsg; coords->insert( current ); } @@ -284,7 +283,7 @@ StatusCode MuonTAERec::addCoordsCrossingMap( MuonCoords* // make the coordinate to be added to coords MuonCoord* current = new MuonCoord( iTwo->first.first, iTwo->first.second ); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " Found an uncrossed pad type 2 " << pad << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << " Found an uncrossed pad type 2 " << pad << endmsg; coords->insert( current ); } diff --git a/Muon/MuonDAQ/src/components/MuonTell1Config.cpp b/Muon/MuonDAQ/src/components/MuonTell1Config.cpp index e8bccf093f2da621d7ec8e8fbcf18ca4f4825dda..36bd723882180e2d8b3b3435e9baa2ea04a121e9 100644 --- a/Muon/MuonDAQ/src/components/MuonTell1Config.cpp +++ b/Muon/MuonDAQ/src/components/MuonTell1Config.cpp @@ -58,7 +58,7 @@ StatusCode MuonTell1Config::configTell1( int Tell1 ) const { data.setPadOffset( link, pad_off ); data.setHitOffset( link, HitInODE ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << " link connected ?" << l1->isLinkConnected( link ) << " " << l1->getLinkConnection( link ) << endmsg; if ( l1->isLinkConnected( link ) ) { @@ -68,16 +68,16 @@ StatusCode MuonTell1Config::configTell1( int Tell1 ) const { MuonTSMap* ts = m_muonDet->getDAQInfo()->getTSMap( l1, ode, 0 ); long padInTS = ts->numberOfPad(); long padInODE = padInTS * ode->getTSNumber(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << padInTS << " " << padInODE << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << padInTS << " " << padInODE << endmsg; pad_off = pad_off + padInODE; HitInODE = 192 + HitInODE; std::string TSName = ode->getTSName( 0 ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " ts name " << TSName << " ciao" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " ts name " << TSName << " ciao" << endmsg; auto itName = TUName.find( TSName ); if ( itName != TUName.end() ) TUType = itName->second; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " TUTYPE " << TUType << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << " TUTYPE " << TUType << endmsg; } data.setPadTU( link, TUType ); } diff --git a/Phys/LoKiCore/include/LoKi/AlgFunctors.h b/Phys/LoKiCore/include/LoKi/AlgFunctors.h index 34582e8ff9b8ac49410226d2e4f89471240da2ef..fdfbc72ef0c751003db0b70530c3e5b91363068c 100644 --- a/Phys/LoKiCore/include/LoKi/AlgFunctors.h +++ b/Phys/LoKiCore/include/LoKi/AlgFunctors.h @@ -385,8 +385,8 @@ namespace LoKi { template <typename Iterator> static bool execute( Iterator begin, Iterator end ) { return std::all_of( begin, end, []( IAlgorithm* alg ) { - if ( UNLIKELY( !alg ) ) { throw GaudiException( "Invalid algorithm!", "RunAll", StatusCode::FAILURE ); } - if ( UNLIKELY( !Predicates::isEnabled( alg ) ) ) { + if ( !alg ) { throw GaudiException( "Invalid algorithm!", "RunAll", StatusCode::FAILURE ); } + if ( !Predicates::isEnabled( alg ) ) { throw GaudiException( "Algorithm '" + alg->name() + "' is disabled", "RunAll", StatusCode::SUCCESS ); } if ( !Predicates::isExecuted( alg ) ) { diff --git a/Phys/LoKiCore/include/LoKi/DecayBase.h b/Phys/LoKiCore/include/LoKi/DecayBase.h index 56352ca881f06afaa3729b3095e4b7a3b25e0629..c34bde3a3fb36b6b643c80e3ee233bff0a1c70f0 100644 --- a/Phys/LoKiCore/include/LoKi/DecayBase.h +++ b/Phys/LoKiCore/include/LoKi/DecayBase.h @@ -94,7 +94,7 @@ namespace LoKi { protected: // ======================================================================== const LHCb::IParticlePropertySvc* ppSvc() const { - if ( UNLIKELY( !m_ppSvc ) ) { m_ppSvc = svc<LHCb::IParticlePropertySvc>( "LHCb::ParticlePropertySvc", true ); } + if ( !m_ppSvc ) { m_ppSvc = svc<LHCb::IParticlePropertySvc>( "LHCb::ParticlePropertySvc", true ); } return m_ppSvc; // RETURN } // ======================================================================== diff --git a/Phys/LoKiCore/include/LoKi/Services.h b/Phys/LoKiCore/include/LoKi/Services.h index 6d605cb449fc7002be584df9c45ed87d76764b62..099bedba6e37b1b4dbb19bd16888b3567596d45c 100644 --- a/Phys/LoKiCore/include/LoKi/Services.h +++ b/Phys/LoKiCore/include/LoKi/Services.h @@ -115,7 +115,7 @@ namespace LoKi { private: template <typename Svc> Svc* svc( SmartIF<Svc>& s, LoKi::ILoKiSvc* lokiSvc, const char* msg ) const { - if ( UNLIKELY( !s ) ) { + if ( !s ) { s = SmartIF<Svc>{lokiSvc}; if ( !s ) Error( msg ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); } diff --git a/Phys/LoKiCore/include/LoKi/Timers.h b/Phys/LoKiCore/include/LoKi/Timers.h index 5573b1fdb1f8013373a6f1d5ffcc553b0cf78dc6..8bc08d90630c633ef78d2afd88c73f05ea99807b 100644 --- a/Phys/LoKiCore/include/LoKi/Timers.h +++ b/Phys/LoKiCore/include/LoKi/Timers.h @@ -123,7 +123,7 @@ namespace LoKi { /// MANDATORY: the only one essential method TYPE2 operator()( typename LoKi::Functor<TYPE1, TYPE2>::argument a ) const override { // - if ( UNLIKELY( !m_timer ) ) { + if ( !m_timer ) { std::call_once( m_first, [&]() { if ( !m_svc ) { SmartIF<IChronoSvc> cs( this->lokiSvc().getObject() ); @@ -217,7 +217,7 @@ namespace LoKi { /// MANDATORY: the only one essenital method TYPE2 operator()() const override { // - if ( UNLIKELY( !m_timer ) ) { + if ( !m_timer ) { std::call_once( m_first, [&]() { if ( !m_svc ) { SmartIF<IChronoSvc> cs( this->lokiSvc().getObject() ); diff --git a/Phys/LoKiCore/src/ParticleProperties.cpp b/Phys/LoKiCore/src/ParticleProperties.cpp index aad3e0088409ede51675c953c8b2e8eb7c9bb529..f476e0b0b8df3758d25d9a06e7b7c988eca93311 100644 --- a/Phys/LoKiCore/src/ParticleProperties.cpp +++ b/Phys/LoKiCore/src/ParticleProperties.cpp @@ -86,13 +86,13 @@ LHCb::ParticleID LoKi::Particles::pidFromName( const std::string& name ) { auto res = s_map.with_lock( [&]( const Map& map ) -> std::optional<LHCb::ParticleID> { auto i = map.find( name ); - if ( UNLIKELY( i == map.end() ) ) return {}; + if ( i == map.end() ) return {}; return i->second; } ); if ( res ) return *res; // const LHCb::ParticleProperty* pp = ppFromName( name ); - if ( UNLIKELY( !pp ) ) { + if ( !pp ) { LoKi::Report::Error( std::string( " LoKi::Particles::pidFromName:" ) + "LHCb::ParticleProperty* points to NULL for '" + name + "' return ParticleID() " ) .ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); @@ -327,7 +327,7 @@ std::string LoKi::Particles::nameFromPID( const LHCb::ParticleID& pid ) { auto res = s_map.with_lock( [&]( const Map& m ) -> std::optional<std::string> { auto i = m.find( pid ); - if ( UNLIKELY( i == m.end() ) ) return {}; + if ( i == m.end() ) return {}; return i->second; } ); if ( res ) return *res; @@ -356,7 +356,7 @@ std::string LoKi::Particles::nameFromPID( const LHCb::ParticleID& pid ) { // ============================================================================ double LoKi::Particles::ctau( const std::string& name ) { const LHCb::ParticleProperty* pp = LoKi::Particles::_ppFromName( name ); - if ( UNLIKELY( !pp ) ) { + if ( !pp ) { LoKi::Report::Error( "LoKi::Particles::lifeTime('" + name + "'): ParticleProperty is NULL" ) .ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return LoKi::Constants::InvalidTime; @@ -371,7 +371,7 @@ double LoKi::Particles::ctau( const std::string& name ) { // ============================================================================ double LoKi::Particles::ctau( const LHCb::ParticleID& pid ) { const LHCb::ParticleProperty* pp = LoKi::Particles::_ppFromPID( pid ); - if ( UNLIKELY( !pp ) ) { + if ( !pp ) { LoKi::Report::Error( "LoKi::Particles::lifeTime('" + boost::lexical_cast<std::string>( pid ) + "'): LHCb::ParticleProperty* is NULL" ) .ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); diff --git a/Phys/LoKiCore/src/TES.cpp b/Phys/LoKiCore/src/TES.cpp index 5d07eb846b24608650290db3e4e3f4ae5df99b1b..042649bcdc551c9416aa7655afc136da2b5b92cd 100644 --- a/Phys/LoKiCore/src/TES.cpp +++ b/Phys/LoKiCore/src/TES.cpp @@ -403,7 +403,7 @@ namespace LoKi { _t{nEntries, "N"}, _t{nEntries, "Entries"}, _t{nEntries, "entries"}}; auto i = std::find_if( tbl.begin(), tbl.end(), [&]( const _t& p ) { return fun == p.second; } ); - if ( UNLIKELY( i == tbl.end() ) ) { throw LoKi::Exception( "invalid function name '" + fun + "'" ); } + if ( i == tbl.end() ) { throw LoKi::Exception( "invalid function name '" + fun + "'" ); } setHelper( i->first ); } diff --git a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h index 8a79941896042d0576592792c4d27aaaf2fc9cb6..0b26c88cccdad01755a10443542b8a4051725b6f 100644 --- a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h +++ b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h @@ -140,7 +140,7 @@ namespace Rich::Future::DAQ { const Rich::DAQ::PDMDBID pdmdb, // const Rich::DAQ::PDMDBFrame link, // const bool isHType ) const noexcept { - if ( LIKELY( !isHType ) ) { + if ( !isHType ) { // R type PMT assert( (std::size_t)rich < m_pdmDataR.size() ); assert( (std::size_t)pdmdb.data() < m_pdmDataR[rich].size() ); diff --git a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h index 37f045e99e4a1933e0faaf96b6fc0635cc38ba62..a47ff395b9eeb91eb5807c5cc491b30b55ad626b 100644 --- a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h +++ b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h @@ -136,7 +136,7 @@ namespace Rich::Future::DAQ { // Anode index (0-63) const auto anode = id.anodeIndex(); // get PMT type specific data - if ( UNLIKELY( id.isHTypePMT() ) ) { + if ( id.isHTypePMT() ) { const auto& d = m_hTypeData; // sanity checks assert( (std::size_t)ec < d.size() ); diff --git a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h index b6ab410d2afb6a8c177b96809958a5e9594ae451..9d234052c370f96ae73adf9d868cbe419e469185 100644 --- a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h +++ b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h @@ -198,7 +198,7 @@ namespace Rich::Future::DAQ { assert( rich != Rich::InvalidDetector ); const auto side = sID.side(); const auto idx = sID.payload(); - if ( UNLIKELY( (std::size_t)idx >= m_tel40ConnData[rich][side].size() ) ) { + if ( (std::size_t)idx >= m_tel40ConnData[rich][side].size() ) { std::ostringstream mess; mess << "SourceID Payload Out-Of-Range" << sID; throw Rich::Exception( mess.str() ); diff --git a/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp b/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp index b5b4f33aa4ea2415039c4d1158d8b942030630f6..721e2eb74d3130c6e3930954a385bb9cacce5820 100644 --- a/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp +++ b/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp @@ -261,32 +261,32 @@ OutData RawBankDecoder::operator()( const LHCb::RawEvent& rawEvent, // for ( const auto* const bank : richBanks ) { // test bank is OK - if ( UNLIKELY( !bank ) ) { + if ( !bank ) { ++m_nullRawBankErr; } else { // if configured, dump raw event before decoding - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) { + if ( msgLevel( MSG::VERBOSE ) ) { dumpRawBank( *bank, verbose() ); - } else if ( UNLIKELY( m_dumpBanks ) ) { + } else if ( m_dumpBanks ) { dumpRawBank( *bank, info() ); } // basic checks bool bankOK = true; // Check this is a RICH bank - if ( UNLIKELY( bank->type() != LHCb::RawBank::Rich ) ) { + if ( bank->type() != LHCb::RawBank::Rich ) { ++m_notRichErr; bankOK = false; } // check bank magic word - if ( UNLIKELY( LHCb::RawBank::MagicPattern != bank->magic() ) ) { + if ( LHCb::RawBank::MagicPattern != bank->magic() ) { ++m_magicErr; bankOK = false; } // If OK, carry on to actual version specific decoding - if ( LIKELY( bankOK ) ) { + if ( bankOK ) { // clear the ID vector for this bank decodedIDs.clear(); @@ -296,7 +296,7 @@ OutData RawBankDecoder::operator()( const LHCb::RawEvent& rawEvent, // // Get bank version const auto version = bankVersion( *bank ); // Check version to dispatch to the correct decoding - if ( LIKELY( MaPMT1 == version ) ) { + if ( MaPMT1 == version ) { // real PMT bank decodeToSmartIDs_MaPMT1( *bank, deRichSys, tel40Maps, pdmdbMaps, decodedIDs ); } else if ( StreamSmartIDs == version ) { @@ -344,7 +344,7 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, // Get Tel40 Source ID const Rich::DAQ::SourceID tel40ID( bank.sourceID() ); daq_debug( "MaPMT1 Decoding Tel40 bank ", tel40ID, endmsg ); - if ( UNLIKELY( !tel40ID.isValid() ) ) { + if ( !tel40ID.isValid() ) { ++m_invalidSourceID; std::ostringstream mess; mess << "Invalid Source ID " << tel40ID; @@ -362,7 +362,7 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, // ... number of packed words const auto nPackedSizeW = ( nTel40Links / 2 ) + ( nTel40Links % 2 ); daq_debug( " -> Expecting ", nTel40Links, " Tel40 Links, ", nPackedSizeW, " packed header words", endmsg ); - if ( UNLIKELY( bankSize < (std::size_t)nPackedSizeW ) ) { + if ( bankSize < (std::size_t)nPackedSizeW ) { ++m_bankSizeTooSmall; std::ostringstream mess; mess << "Bank Too Small " << tel40ID << " size=" << bankSize; @@ -396,7 +396,7 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, // Validate the data sizes for each tel40 link extracted from the data // is in agreement with the overall bank size - if ( UNLIKELY( ( nPackedSizeW + nPayloadWords ) != bankSize ) ) { + if ( ( nPackedSizeW + nPayloadWords ) != bankSize ) { ++m_bankSizeMisMatchErr; throw Rich::Exception( "Tel40:" + std::to_string( tel40ID.data() ) + " BankSize:" + std::to_string( bankSize ) + " != DecodedSize:" + std::to_string( nPackedSizeW + nPayloadWords ) ); @@ -415,7 +415,7 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, // Get the Tel40 Data for this connection const auto& cData = connData[iLink]; daq_verbo( " -> ", cData, endmsg ); - if ( UNLIKELY( !cData.isValid() ) ) { + if ( !cData.isValid() ) { ++m_invalidTel40ConData; throw Rich::Exception( "Tel40:" + std::to_string( tel40ID.data() ) + " Invalid data for connection " + std::to_string( iLink ) ); @@ -434,20 +434,20 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, " ", boost::format( "%02X" ) % (int)( *dataW ), // "(", std::bitset<NDataBits>( *dataW ), ")", endmsg ); - if ( LIKELY( !isNZS ) ) { + if ( !isNZS ) { // ZS decoding... word is bit index daq_verbo( " -> Bit Index ", (int)*dataW, endmsg ); // load the anode data for this bit - if ( LIKELY( ( std::size_t )( *dataW ) < frameData.size() ) ) { + if ( ( std::size_t )( *dataW ) < frameData.size() ) { const auto& aData = frameData[*dataW]; daq_verbo( " -> ", aData, endmsg ); // Data 'could' be invalid, e.g. radiation-induced-upsets // so cannot make this a hard error - if ( LIKELY( aData.isValid() ) ) { + if ( aData.isValid() ) { // make a smart ID auto hitID = cData.smartID; // sets RICH, side, module and PMT type // Add the PMT and pixel info @@ -468,9 +468,9 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, // which half of the payload are we in ? const bool firstHalf = ( 0 == iW && connSizes[iLink] > 5 ); // Number of words to decode depends on which half of the payload we are in - const auto nNZSwords = ( UNLIKELY( firstHalf ) ? 6 : 5 ); + const auto nNZSwords = ( firstHalf ? 6 : 5 ); // bit offset per half - const auto halfBitOffset = ( UNLIKELY( firstHalf ) ? 39 : 0 ); + const auto halfBitOffset = ( firstHalf ? 39 : 0 ); // look forward last NZS word and read backwards to match frame bit order for ( auto iNZS = nNZSwords - 1; iNZS >= 0; --iNZS ) { @@ -478,7 +478,7 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, // read the NZS word auto nzsW = *( dataW + iNZS ); // if word zero clear MSB as this is the NZS flag - if ( UNLIKELY( 0 == iNZS ) ) { setBitOff<NDataBits - 1>( nzsW ); } + if ( 0 == iNZS ) { setBitOff<NDataBits - 1>( nzsW ); } daq_verbo( " -> iNZS=", iNZS, " gW=", iNZS + ( dataW - bankStart ), // " ", boost::format( "%02X" ) % (int)( nzsW ), // @@ -494,19 +494,19 @@ void RawBankDecoder::decodeToSmartIDs_MaPMT1( const LHCb::RawBank& bank, // word has data so loop over bits to extract for ( auto iLB = 0; iLB < NDataBits; ++iLB ) { // is bit on ? - if ( UNLIKELY( isBitOn( nzsW, iLB ) ) ) { + if ( isBitOn( nzsW, iLB ) ) { // form frame bit value const auto bit = iLB + bitOffset; daq_verbo( " -> Bit Index ", (int)bit, endmsg ); // load the anode data for this bit - if ( LIKELY( ( std::size_t )( bit ) < frameData.size() ) ) { + if ( ( std::size_t )( bit ) < frameData.size() ) { const auto& aData = frameData[bit]; daq_verbo( " -> ", aData, endmsg ); // Data 'could' be invalid, e.g. radiation-induced-upsets // so cannot make this a hard error - if ( LIKELY( aData.isValid() ) ) { + if ( aData.isValid() ) { // make a smart ID auto hitID = cData.smartID; // sets RICH, side, module and PMT type // Add the PMT and pixel info @@ -564,14 +564,14 @@ void RawBankDecoder::decodeToSmartIDs_StreamIDs( const LHCb::RawBank& bank, // work around for some persistent data without 'large' PMT flag set. const bool isLarge = deRichSys.isLargePD( id ); - if ( UNLIKELY( id.isLargePMT() != isLarge ) ) { + if ( id.isLargePMT() != isLarge ) { ++m_pmtSLFlagMismatch; // hack to fix up large PMT flag id.setLargePMT( isLarge ); } // Is ID OK ? - if ( UNLIKELY( !id.isValid() ) ) { + if ( !id.isValid() ) { ++m_flatListReadWarn; } else { // save to the ID list @@ -621,15 +621,15 @@ void RawBankDecoder::fillDecodedData( const DecodedIDs& decodedIDs, // ModuleData* mInfo = nullptr; // Has PD changed ? - if ( UNLIKELY( pdID != last_pdID || !last_pdInfo || !last_mInfo ) ) { + if ( pdID != last_pdID || !last_pdInfo || !last_mInfo ) { // has the module changed ? - if ( UNLIKELY( mID != last_mID || !last_mInfo ) ) { + if ( mID != last_mID || !last_mInfo ) { // Find module data const auto mIt = std::find_if( mDataV.begin(), mDataV.end(), // [&mID]( const auto& i ) { return mID == i.moduleNumber(); } ); // If get here, most likely a new module - if ( LIKELY( mIt == mDataV.end() ) ) { + if ( mIt == mDataV.end() ) { // make a new entry mInfo = &mDataV.emplace_back( mID ); daq_verbo( " -> New Module ", mID, endmsg ); @@ -651,7 +651,7 @@ void RawBankDecoder::fillDecodedData( const DecodedIDs& decodedIDs, // const auto pdIt = std::find_if( mInfo->begin(), mInfo->end(), // [&pdID]( const auto& i ) { return pdID == i.pdID(); } ); // If get here most likely new PD - if ( LIKELY( pdIt == mInfo->end() ) ) { + if ( pdIt == mInfo->end() ) { // make a new entry pdInfo = &mInfo->emplace_back( pdID ); // Add to active PD count for current rich diff --git a/Rich/RichFutureDAQ/src/lib/EncodeTel40Data.cpp b/Rich/RichFutureDAQ/src/lib/EncodeTel40Data.cpp index 6284758cac5b3cf75c6f8b9bd7f9a4c89c09531f..bf39eda0b6390195d91c49ee58a6f06fc1aff942 100644 --- a/Rich/RichFutureDAQ/src/lib/EncodeTel40Data.cpp +++ b/Rich/RichFutureDAQ/src/lib/EncodeTel40Data.cpp @@ -75,7 +75,7 @@ void EncodeTel40::DataHalves::add( const Rich::DAQ::FrameBitIndex bit ) { // Do we need to convert this half to NZS ? // i.e. are we still ZS but at the max. size for this mode. - if ( UNLIKELY( m_zs[half] && m_data[half].size() == MaxZSByteSize[half] ) ) { + if ( m_zs[half] && m_data[half].size() == MaxZSByteSize[half] ) { // New data structure for NZS form HalfPayload nzs_data( NZSByteSize[half], 0u ); @@ -96,7 +96,7 @@ void EncodeTel40::DataHalves::add( const Rich::DAQ::FrameBitIndex bit ) { // Finally, set the new global bit // What mode are we in ? - if ( LIKELY( m_zs[half] ) ) { + if ( m_zs[half] ) { // ZS mode so just append bit to list as byte value assert( m_data[half].size() < MaxZSByteSize[half] ); m_data[half].emplace_back( bit.data() ); diff --git a/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp b/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp index 6221d76ccc8f7fda673fe8472bc21617096356a5..53d437fa9e5bbb71a09bb47c87da8b303b6f8451 100644 --- a/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp +++ b/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp @@ -42,7 +42,7 @@ bool PDMDBDecodeMapping::fillRType( const DeRichSystem& richSys ) { // Load the R Type encoding condition for this RICH const std::string richS = ( rich == Rich::Rich1 ? "R1" : "R2" ); const std::string condS = richS + "_PDMDB_R_DecodePixelMap"; - if ( UNLIKELY( !richSys.hasCondition( condS ) ) ) { + if ( !richSys.hasCondition( condS ) ) { OK = false; } else { debug( "Reading Condition '", condS, "'", endmsg ); @@ -110,7 +110,7 @@ bool PDMDBDecodeMapping::fillHType( const DeRichSystem& richSys ) { // Load the H Type encoding condition for this RICH const std::string condS = "R2_PDMDB_H_DecodePixelMap"; - if ( UNLIKELY( !richSys.hasCondition( condS ) ) ) { + if ( !richSys.hasCondition( condS ) ) { OK = false; } else { debug( "Reading Condition '", condS, "'", endmsg ); diff --git a/Rich/RichFutureDAQ/src/lib/RichPDMDBEncodeMapping.cpp b/Rich/RichFutureDAQ/src/lib/RichPDMDBEncodeMapping.cpp index 293d1e2bf3a656b2a737a48a36055bd02c05131c..c419245e958b6343922b45427856ff346b27a558 100644 --- a/Rich/RichFutureDAQ/src/lib/RichPDMDBEncodeMapping.cpp +++ b/Rich/RichFutureDAQ/src/lib/RichPDMDBEncodeMapping.cpp @@ -41,7 +41,7 @@ bool PDMDBEncodeMapping::fillRType( const DeRichSystem& richSys ) { // Load the R Type encoding condition for this RICH const std::string richS = ( rich == Rich::Rich1 ? "R1" : "R2" ); const std::string condS = richS + "_PDMDB_R_EncodePixelMap"; - if ( UNLIKELY( !richSys.hasCondition( condS ) ) ) { + if ( !richSys.hasCondition( condS ) ) { OK = false; } else { debug( "Reading Condition '", condS, "'", endmsg ); @@ -108,7 +108,7 @@ bool PDMDBEncodeMapping::fillHType( const DeRichSystem& richSys ) { // Load the H Type encoding condition for this RICH const std::string condS = "R2_PDMDB_H_EncodePixelMap"; - if ( UNLIKELY( !richSys.hasCondition( condS ) ) ) { + if ( !richSys.hasCondition( condS ) ) { OK = false; } else { debug( "Reading Condition '", condS, "'", endmsg ); diff --git a/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp b/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp index 07560c54db029f5be6607e5b6fb9ce747312312d..fe888de41e56087bcc1e9671d47eeaab5ac7e261 100644 --- a/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp +++ b/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp @@ -55,7 +55,7 @@ bool Tel40CableMapping::fillCableMaps( const DeRichSystem& richSys ) { // Number of links for this RICH panel const std::size_t nLinks = cond->param<int>( "NumberOfLinks" ); - if ( LIKELY( nLinks > 0 ) ) { + if ( nLinks > 0 ) { debug( " -> Found ", nLinks, " active links", endmsg ); // Load links data @@ -69,15 +69,15 @@ bool Tel40CableMapping::fillCableMaps( const DeRichSystem& richSys ) { const auto mpos = cond->paramVect<int>( "Tel40MPOs" ); const auto statuses = cond->paramVect<int>( "Tel40LinkIsActive" ); // sanity size check - if ( UNLIKELY( nLinks != pmtTypes.size() || // - nLinks != modNames.size() || // - nLinks != modNums.size() || // - nLinks != pdmdbs.size() || // - nLinks != pdmdbLinks.size() || // - nLinks != sourceIDs.size() || // - nLinks != connectors.size() || // - nLinks != mpos.size() || // - nLinks != statuses.size() ) ) { + if ( nLinks != pmtTypes.size() || // + nLinks != modNames.size() || // + nLinks != modNums.size() || // + nLinks != pdmdbs.size() || // + nLinks != pdmdbLinks.size() || // + nLinks != sourceIDs.size() || // + nLinks != connectors.size() || // + nLinks != mpos.size() || // + nLinks != statuses.size() ) { ok = false; throw Rich::Exception( "Inconsistent data sizes for " + std::string{cable_cond} ); } @@ -86,7 +86,7 @@ bool Tel40CableMapping::fillCableMaps( const DeRichSystem& richSys ) { assert( !sourceIDs.empty() ); const SourceID maxSID( *std::max_element( sourceIDs.begin(), sourceIDs.end() ) ); // handle this silently to work around issues with older DB tags. - if ( UNLIKELY( rich != maxSID.rich() || panel != maxSID.side() ) ) { + if ( rich != maxSID.rich() || panel != maxSID.side() ) { ok = false; continue; } @@ -148,7 +148,7 @@ bool Tel40CableMapping::fillCableMaps( const DeRichSystem& richSys ) { // fill the Tel40 connection data structure const std::size_t idx = sourceID.payload(); - if ( UNLIKELY( idx >= tel40CD.size() ) ) { + if ( idx >= tel40CD.size() ) { throw Rich::Exception( "Tel40 Source ID '" + std::to_string( idx ) + "' exceeds expected range" ); } auto& conData = tel40CD[idx]; diff --git a/Rich/RichFutureKernel/include/RichFutureKernel/RichCommonBase.h b/Rich/RichFutureKernel/include/RichFutureKernel/RichCommonBase.h index 553b300feefa0fefd9c99d78a098f6fe129f3650..65363273a57ce2a68496f6f908772e25e6db9212 100644 --- a/Rich/RichFutureKernel/include/RichFutureKernel/RichCommonBase.h +++ b/Rich/RichFutureKernel/include/RichFutureKernel/RichCommonBase.h @@ -98,7 +98,7 @@ namespace Rich { template <typename TOOL> inline void releaseTool( TOOL*& pTool ) const { if ( pTool ) { - if ( UNLIKELY( this->msgLevel( MSG::DEBUG ) ) ) { + if ( this->msgLevel( MSG::DEBUG ) ) { this->debug() << " Forced release for tool '" << pTool->name() << "'" << endmsg; } this->release( pTool ); diff --git a/Rich/RichFutureKernel/include/RichFutureKernel/RichHistoBase.h b/Rich/RichFutureKernel/include/RichFutureKernel/RichHistoBase.h index 8aa64b204341d7e33766b12e9e8858e677ddac35..81639727f073e9779d88e39aec83523248d00064 100644 --- a/Rich/RichFutureKernel/include/RichFutureKernel/RichHistoBase.h +++ b/Rich/RichFutureKernel/include/RichFutureKernel/RichHistoBase.h @@ -238,7 +238,7 @@ namespace Rich::Future { template <typename HIST, typename... Args> inline void fillHisto( HIST* h, Args&&... args ) const { assert( h ); - if ( LIKELY( h ) ) { h->fill( std::forward<Args>( args )... ); } + if ( h ) { h->fill( std::forward<Args>( args )... ); } } //----------------------------------------------------------------------------------------- diff --git a/Rich/RichFutureKernel/src/RichHistoBase.icpp b/Rich/RichFutureKernel/src/RichHistoBase.icpp index 219be7b21a784e550be6abcbe8823c2f046be8fe..e030b0d51e88022b7ed8db3bf499d5c82cdaa8e9 100644 --- a/Rich/RichFutureKernel/src/RichHistoBase.icpp +++ b/Rich/RichFutureKernel/src/RichHistoBase.icpp @@ -71,7 +71,7 @@ namespace { decltype( auto ) findHistoImpl( const MAP& hmap, const ID& id ) { const auto& map = hmap.getmap( id.packedData() ); const auto iH = map.find( id.id() ); - if ( UNLIKELY( iH == map.end() ) ) { // + if ( iH == map.end() ) { // throw Rich::Exception( "Cannot find pre-booked histogram '" + id.fullid() + "'" ); } return iH->second; @@ -110,13 +110,13 @@ namespace { const LABEL& xAxisLabel, // const LABEL& yAxisLabel, // const LABEL& zAxisLabel = "" ) { - if ( UNLIKELY( !zAxisLabel.empty() ) ) { + if ( !zAxisLabel.empty() ) { // Bug in GaudiUtils (to be fixed) with no way to set z axis. Ignore for the moment //_ri_debug << "Setting Z axis label currently not supported : " << zAxisLabel << endmsg; } // set the axis labels - if ( UNLIKELY( !xAxisLabel.empty() || !yAxisLabel.empty() ) ) { - if ( UNLIKELY( !setAxisLabels( h, xAxisLabel, yAxisLabel ) ) ) { + if ( !xAxisLabel.empty() || !yAxisLabel.empty() ) { + if ( !setAxisLabels( h, xAxisLabel, yAxisLabel ) ) { throw Rich::Exception( "Problem Setting Histogram Axis Labels" ); } } @@ -124,18 +124,16 @@ namespace { template <typename HISTO, typename LABELS> void binLabelsImpl( HISTO* h, // const LABELS& binLabels ) { - if ( UNLIKELY( !binLabels.empty() ) ) { - if ( UNLIKELY( !setBinLabels( h, binLabels ) ) ) { - throw Rich::Exception( "Problem Setting Histogram Bin Labels" ); - } + if ( !binLabels.empty() ) { + if ( !setBinLabels( h, binLabels ) ) { throw Rich::Exception( "Problem Setting Histogram Bin Labels" ); } } } template <typename HISTO, typename LABELS> void binLabelsImpl( HISTO* h, // const LABELS& xBinLabels, // const LABELS& yBinLabels ) { - if ( UNLIKELY( !xBinLabels.empty() || !yBinLabels.empty() ) ) { - if ( UNLIKELY( !setBinLabels( h, xBinLabels, yBinLabels ) ) ) { + if ( !xBinLabels.empty() || !yBinLabels.empty() ) { + if ( !setBinLabels( h, xBinLabels, yBinLabels ) ) { throw Rich::Exception( "Problem Setting Histogram Bin Labels" ); } } @@ -154,7 +152,7 @@ Rich::Future::HistoBase<PBASE>::richHisto1D( const Rich::HistogramID& id, const BinLabels& binLabels ) { // Already been booked ? auto*& h = m_1dhmap.getmap( id.packedData() )[id.id()]; - if ( LIKELY( !h ) ) { + if ( !h ) { // Book the histo h = PBASE::book1D( id.fullid(), id.fullTitle( title ), low, high, bins ); // set the labels @@ -182,7 +180,7 @@ Rich::Future::HistoBase<PBASE>::richHisto2D( const Rich::HistogramID& id, const BinLabels& yBinLabels ) { // Already been booked ? auto*& h = m_2dhmap.getmap( id.packedData() )[id.id()]; - if ( LIKELY( !h ) ) { + if ( !h ) { // Book the histo h = PBASE::book2D( id.fullid(), id.fullTitle( title ), lowX, highX, binsX, lowY, highY, binsY ); // set the labels @@ -205,7 +203,7 @@ Rich::Future::HistoBase<PBASE>::richProfile1D( const Rich::HistogramID& id, const BinLabels& binLabels ) { // Already been booked ? auto*& h = m_1dpmap.getmap( id.packedData() )[id.id()]; - if ( LIKELY( !h ) ) { + if ( !h ) { // Book the histo h = PBASE::bookProfile1D( id.fullid(), id.fullTitle( title ), low, high, bins ); // set the labels @@ -233,7 +231,7 @@ Rich::Future::HistoBase<PBASE>::richProfile2D( const Rich::HistogramID& id, const BinLabels& yBinLabels ) { // Already been booked ? auto*& h = m_2dpmap.getmap( id.packedData() )[id.id()]; - if ( LIKELY( !h ) ) { + if ( !h ) { // Book the histo h = PBASE::bookProfile2D( id.fullid(), id.fullTitle( title ), lowX, highX, binsX, lowY, highY, binsY ); // set the labels diff --git a/Rich/RichFutureUtils/include/RichFutureUtils/RichMessaging.h b/Rich/RichFutureUtils/include/RichFutureUtils/RichMessaging.h index 5bd1351f61257d5f531b3febd6117e4591dc3564..a696003345fa2f690bfe0c26395b48f6b1605d5c 100644 --- a/Rich/RichFutureUtils/include/RichFutureUtils/RichMessaging.h +++ b/Rich/RichFutureUtils/include/RichFutureUtils/RichMessaging.h @@ -32,15 +32,15 @@ namespace { // pointer to the entity that implements the Gaudi based messaging API. #ifndef _ri_debug # define _ri_debug \ - if ( UNLIKELY( messenger()->msgLevel( MSG::DEBUG ) ) ) messenger()->debug() + if ( messenger()->msgLevel( MSG::DEBUG ) ) messenger()->debug() #endif #ifndef _ri_verbo # define _ri_verbo \ - if ( UNLIKELY( messenger()->msgLevel( MSG::VERBOSE ) ) ) messenger()->verbose() + if ( messenger()->msgLevel( MSG::VERBOSE ) ) messenger()->verbose() #endif #ifndef ri_message # define ri_message( level, ... ) \ - if ( UNLIKELY( messenger()->msgLevel( level ) ) ) { rich_message( messenger()->msgStream( level ), __VA_ARGS__ ); } + if ( messenger()->msgLevel( level ) ) { rich_message( messenger()->msgStream( level ), __VA_ARGS__ ); } # define ri_debug( ... ) ri_message( MSG::DEBUG, __VA_ARGS__ ) # define ri_verbo( ... ) ri_message( MSG::VERBOSE, __VA_ARGS__ ) # ifndef NDEBUG diff --git a/Rich/RichFutureUtils/include/RichFutureUtils/RichMirrorFinder.h b/Rich/RichFutureUtils/include/RichFutureUtils/RichMirrorFinder.h index 931fc132a7b6e93c8af32b0be424f8a4bce55940..9fb7739e206a05b40370e1249716a2d19714c215 100644 --- a/Rich/RichFutureUtils/include/RichFutureUtils/RichMirrorFinder.h +++ b/Rich/RichFutureUtils/include/RichFutureUtils/RichMirrorFinder.h @@ -121,7 +121,7 @@ namespace Rich::Utils { /// Initialise this object void init() { // sanity check - if ( UNLIKELY( std::numeric_limits<MirrorNum>::max() < mirrors.size() ) ) { + if ( std::numeric_limits<MirrorNum>::max() < mirrors.size() ) { throw GaudiException( "Too many mirrors", "MirrorSegFinderLookUpTable::LookupTableFinder", StatusCode::FAILURE ); } diff --git a/Rich/RichFutureUtils/include/RichFutureUtils/RichSIMDMirrorData.h b/Rich/RichFutureUtils/include/RichFutureUtils/RichSIMDMirrorData.h index 6a3cf028a2d3edc3a13a8957f72ab821fbb675c4..04110cbbe98c12d271fa897ccb7e4046217c5f44 100644 --- a/Rich/RichFutureUtils/include/RichFutureUtils/RichSIMDMirrorData.h +++ b/Rich/RichFutureUtils/include/RichFutureUtils/RichSIMDMirrorData.h @@ -165,7 +165,7 @@ namespace Rich::SIMD { // the mirror pointer const auto m = mirrors[i]; // If changed from before, update - if ( UNLIKELY( m != cache_mirrors[i] ) ) { cache_update( m, i ); } + if ( m != cache_mirrors[i] ) { cache_update( m, i ); } } } diff --git a/Rich/RichFutureUtils/src/RichRayTracing.cpp b/Rich/RichFutureUtils/src/RichRayTracing.cpp index 1744dbdfe60e88247fb56c0cc2c43548fc025427..976244d8fd64a8b7bef48e15714d4f6b6a6772ae 100644 --- a/Rich/RichFutureUtils/src/RichRayTracing.cpp +++ b/Rich/RichFutureUtils/src/RichRayTracing.cpp @@ -136,7 +136,7 @@ RayTracing::traceToDetector( SIMD::STDVector<SIMDPointVect>& startPointsDirs, // const auto new_sides = m_rich[rich]->side( nomSphInter ); // changed ? const auto side_change = any_of( new_sides != sides ); - if ( UNLIKELY( side_change ) ) { + if ( side_change ) { // update sides sides = new_sides; // New CoCs @@ -186,7 +186,7 @@ RayTracing::traceToDetector( SIMD::STDVector<SIMDPointVect>& startPointsDirs, // mask &= LHCb::SIMD::simd_cast<SIMDFP::mask_type>( result.result >= testMask ); // test for beam pipe intersections ? - if ( UNLIKELY( mode.beamPipeIntersects() && any_of( mask ) ) ) { + if ( mode.beamPipeIntersects() && any_of( mask ) ) { const auto beam_mask = m_rich[rich]->beampipe()->testForIntersection( start_point, sphMir, mask ); if ( any_of( beam_mask ) ) { // set flag to outside panel... @@ -272,7 +272,7 @@ RayTracing::traceToDetector( const Gaudi::XYZPoint& startPoint, // const auto new_sides = m_rich[rich]->side( nomSphInter ); // changed ? const auto side_change = any_of( new_sides != sides ); - if ( UNLIKELY( side_change ) ) { + if ( side_change ) { // update sides sides = new_sides; // New CoCs @@ -295,7 +295,7 @@ RayTracing::traceToDetector( const Gaudi::XYZPoint& startPoint, // // nominal intersection point SIMDPoint planeInt; - if ( UNLIKELY( side_change ) ) { + if ( side_change ) { // slow method to construct a plane for the mixture of sides const auto nomPlane = m_rich[rich]->nominalPlane( sides ); intersectPlane( point, dir, nomPlane, planeInt ); @@ -328,7 +328,7 @@ RayTracing::traceToDetector( const Gaudi::XYZPoint& startPoint, // mask &= LHCb::SIMD::simd_cast<SIMDFP::mask_type>( result.result >= testMask ); // test for beam pipe intersections ? - if ( UNLIKELY( mode.beamPipeIntersects() && any_of( mask ) ) ) { + if ( mode.beamPipeIntersects() && any_of( mask ) ) { const auto beam_mask = m_rich[rich]->beampipe()->testForIntersection( simdStartPoint, sphMir, mask ); if ( any_of( beam_mask ) ) { // set flag to outside panel... @@ -338,7 +338,7 @@ RayTracing::traceToDetector( const Gaudi::XYZPoint& startPoint, // } } - // if ( UNLIKELY( msgLevel(MSG::VERBOSE) ) ) + // if ( msgLevel(MSG::VERBOSE) ) // { // for ( std::size_t i = 0; i < SIMDFP::Size; ++i ) // { @@ -525,7 +525,7 @@ bool RayTracing::reflectBothMirrors( const Rich::DetectorType rich, // reflectPlane( tmpPos, tmpDir, secSegment->centreNormalPlane() ); } else { const auto sc = reflectSpherical( tmpPos, tmpDir, secSegment->centreOfCurvature(), secSegment->radius() ); - if ( UNLIKELY( !sc ) ) { return false; } + if ( !sc ) { return false; } } // set secondary ("flat") mirror data @@ -576,7 +576,7 @@ bool RayTracing::traceBackFromDetector( const Gaudi::XYZPoint& startPoint, // } else { const auto sc = reflectSpherical( tmpStartPoint, tmpStartDir, secSegment->centreOfCurvature(), secSegment->radius() ); - if ( UNLIKELY( !sc ) ) { return false; } + if ( !sc ) { return false; } } } diff --git a/Rich/RichFutureUtils/src/RichSmartIDs.cpp b/Rich/RichFutureUtils/src/RichSmartIDs.cpp index ac06fb4d941e502b64c4ddec8d19d277017eb963..27e7c4c87d7f758befff6f1d63479fa3a5bf83d0 100644 --- a/Rich/RichFutureUtils/src/RichSmartIDs.cpp +++ b/Rich/RichFutureUtils/src/RichSmartIDs.cpp @@ -28,13 +28,13 @@ RichSmartIDs::globalPositions( const Rich::PDPixelCluster::Vector& clusters, // points.reserve( clusters.size() ); // Do we need to take the full cluster info into account - if ( UNLIKELY( !ignoreClusters ) ) { + if ( !ignoreClusters ) { // scalar loop using full cluster info for ( const auto& clus : clusters ) { points.emplace_back(); const auto ok = globalPosition( clus, points.back() ); - if ( UNLIKELY( !ok ) ) { + if ( !ok ) { // to do... Add MsgStream messaging here std::cout << "Failed to compute global position for " << clus << "\n"; } @@ -74,7 +74,7 @@ RichSmartIDs::globalPositions( const Rich::PDPixelCluster::Vector& clusters, // // loop over the cluster info for ( const auto& clus : clusters ) { // If new PD, or SIMD data is full, save and reset. - if ( UNLIKELY( ( lastPD != clus.dePD() || index >= SIMDFP::Size ) && lastPD ) ) { saveInfo(); } + if ( ( lastPD != clus.dePD() || index >= SIMDFP::Size ) && lastPD ) { saveInfo(); } // Fill info lastPD = clus.dePD(); ids[index] = clus.primaryID(); @@ -83,7 +83,7 @@ RichSmartIDs::globalPositions( const Rich::PDPixelCluster::Vector& clusters, // } // Save the last one - if ( LIKELY( lastPD && index > 0 ) ) { saveInfo(); } + if ( lastPD && index > 0 ) { saveInfo(); } } // debug sanity check @@ -103,7 +103,7 @@ bool RichSmartIDs::globalPosition( const Rich::PDPixelCluster& cluster, // bool sc = false; // cluster size const auto csize = cluster.size(); - if ( LIKELY( 1 == csize ) ) { + if ( 1 == csize ) { // Handle single pixel clusters differently for speed sc = _globalPosition( cluster.primaryID(), cluster.dePD(), detectPoint ); } else if ( csize > 1 ) { diff --git a/Rich/RichKernel/include/RichKernel/RichCommonBase.h b/Rich/RichKernel/include/RichKernel/RichCommonBase.h index 8872347c102baeb26411f4b7f77926c6489992d9..4929b118e45067093054937a23ea79a7f2bded77 100644 --- a/Rich/RichKernel/include/RichKernel/RichCommonBase.h +++ b/Rich/RichKernel/include/RichKernel/RichCommonBase.h @@ -123,7 +123,7 @@ namespace Rich { pTool = nullptr; // Check consistency - if ( UNLIKELY( parent && commonTool ) ) { + if ( parent && commonTool ) { this->Error( "Tool " + nickName + " cannot be common and private !" ).ignore(); } else { @@ -144,8 +144,8 @@ namespace Rich { // get tool pTool = this->template tool<TOOL>( type, fname, parent ); - if ( UNLIKELY( !pTool ) ) { this->Exception( "Null Pointer returned by ToolSvc for " + fname ); } - if ( UNLIKELY( this->msgLevel( MSG::DEBUG ) ) ) { + if ( !pTool ) { this->Exception( "Null Pointer returned by ToolSvc for " + fname ); } + if ( this->msgLevel( MSG::DEBUG ) ) { this->debug() << " Acquired tool '" << pTool->name() << "' of type '" << type << "'" << endmsg; } } @@ -186,7 +186,7 @@ namespace Rich { template <typename TOOL> inline void releaseTool( TOOL*& pTool ) const { if ( pTool ) { - if ( UNLIKELY( this->msgLevel( MSG::DEBUG ) ) ) { + if ( this->msgLevel( MSG::DEBUG ) ) { this->debug() << " Forced release for tool '" << pTool->name() << "'" << endmsg; } this->release( pTool ).ignore(); diff --git a/Rich/RichUtils/include/RichUtils/RichDAQDefinitions.h b/Rich/RichUtils/include/RichUtils/RichDAQDefinitions.h index f2025a678c55c179d60fac56fecb23c9ad0d52ff..fa1932343e3c5fa996c84ab3c16da19d6c0ff283 100644 --- a/Rich/RichUtils/include/RichUtils/RichDAQDefinitions.h +++ b/Rich/RichUtils/include/RichUtils/RichDAQDefinitions.h @@ -419,7 +419,7 @@ namespace Rich::DAQ { id.rawDump( os ); #endif os << " | Partition=" << id.partition(); - if ( LIKELY( id.isValid() ) ) { + if ( id.isValid() ) { os << " " << id.rich() << " " << Rich::text( id.rich(), id.side() ); } else { os << " INVALID"; diff --git a/Rich/RichUtils/include/RichUtils/RichRayTracingUtils.h b/Rich/RichUtils/include/RichUtils/RichRayTracingUtils.h index bc07270b4334c1bc6a0ec958a3d301aeede3ae4d..883865e2d393360056cbf450eec8c0ae1d0d2a90 100644 --- a/Rich/RichUtils/include/RichUtils/RichRayTracingUtils.h +++ b/Rich/RichUtils/include/RichUtils/RichRayTracingUtils.h @@ -76,13 +76,13 @@ namespace Rich { typename COC::Scalar, // FTYPE> ) { // scalar - if ( UNLIKELY( !OK ) ) { discr = zero; } + if ( !OK ) { discr = zero; } } else if constexpr ( all_SIMD_v<typename POSITION::Scalar, // typename DIRECTION::Scalar, // typename COC::Scalar, // FTYPE> ) { // SIMD - if ( UNLIKELY( !all_of( OK ) ) ) { discr.setZeroInverted( OK ); } + if ( !all_of( OK ) ) { discr.setZeroInverted( OK ); } } else { // If get here we don't know how to handle the types, so cause compilation failure. // Note, cannot use static_assert here as needs to be parsable (if not compilable). @@ -140,13 +140,13 @@ namespace Rich { typename COC::Scalar, // FTYPE> ) { // scalar - if ( UNLIKELY( !OK ) ) { discr = zero; } + if ( !OK ) { discr = zero; } } else if constexpr ( all_SIMD_v<typename POSITION::Scalar, // typename DIRECTION::Scalar, // typename COC::Scalar, // FTYPE> ) { // SIMD - if ( UNLIKELY( !all_of( OK ) ) ) { discr.setZeroInverted( OK ); } + if ( !all_of( OK ) ) { discr.setZeroInverted( OK ); } } else { // If get here we don't know how to handle the types, so cause compilation failure. // Note, cannot use static_assert here as needs to be parsable (if not compilable). diff --git a/Rich/RichUtils/include/RichUtils/ToArray.h b/Rich/RichUtils/include/RichUtils/ToArray.h index c21219b211cc4b5ba8dd668259b5c317b7852ce1..38eefae200a359907d169f04b174565927b8bb78 100644 --- a/Rich/RichUtils/include/RichUtils/ToArray.h +++ b/Rich/RichUtils/include/RichUtils/ToArray.h @@ -21,7 +21,7 @@ namespace Rich { /// utility method to convert a vector to an array of the same size template <typename OUTTYPE, std::size_t N, typename INTYPE = OUTTYPE> inline decltype( auto ) toArray( const std::vector<INTYPE>& v ) { - if ( UNLIKELY( v.size() != N ) ) { throw Rich::Exception( "Vector to Array Size Error" ); } + if ( v.size() != N ) { throw Rich::Exception( "Vector to Array Size Error" ); } std::array<OUTTYPE, N> a; std::copy( v.begin(), v.end(), a.begin() ); return a; diff --git a/Sim/SimComponents/src/EvtTypeChecker.cpp b/Sim/SimComponents/src/EvtTypeChecker.cpp index ca79c8fb5fac87851b7987cd9baf44c65faf40ec..341d0906e4e6936ffb0ed56ff8a07f93f150cd4a 100644 --- a/Sim/SimComponents/src/EvtTypeChecker.cpp +++ b/Sim/SimComponents/src/EvtTypeChecker.cpp @@ -112,7 +112,7 @@ StatusCode EvtTypeChecker::setDecayToFind( const int evtCode ) const { // Main execution //============================================================================= void EvtTypeChecker::operator()( const LHCb::GenHeader& header ) const { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; // If reading event type from data retrieve event header and set decay // unless already done (do it only for first time) if ( m_fromData.value() && !m_setDecay ) { @@ -126,7 +126,7 @@ void EvtTypeChecker::operator()( const LHCb::GenHeader& header ) const { //============================================================================= StatusCode EvtTypeChecker::finalize() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Finalize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg; auto decayAnalyzed = ( m_mcFinder ? m_mcFinder->decay() : "Unknown" ); diff --git a/Sim/SimComponents/src/MCDecayFinder.cpp b/Sim/SimComponents/src/MCDecayFinder.cpp index fc9dca70e34c8f79972fad4dd8d65cc9895d09c6..f8266667ec3c3a6045146c211eb0dd525ace2a10 100644 --- a/Sim/SimComponents/src/MCDecayFinder.cpp +++ b/Sim/SimComponents/src/MCDecayFinder.cpp @@ -600,7 +600,7 @@ bool MCDecayFinder::findDecay( const LHCb::MCParticle::ConstVector& event, if ( msgLevel( MSG::VERBOSE ) ) verbose() << "About to test the event" << endmsg; if ( !m_decay ) Exception( "Trying to find an unspecified decay!" ); bool r = m_decay->test( event.begin(), event.end(), previous_result ); - if ( !r && UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Could not find decay" << endmsg; + if ( !r && msgLevel( MSG::DEBUG ) ) debug() << "Could not find decay" << endmsg; return r; } @@ -609,7 +609,7 @@ bool MCDecayFinder::hasDecay( const LHCb::MCParticles& event ) const { if ( !m_decay ) Exception( "Trying to find an unspecified decay!" ); const LHCb::MCParticle* drop_me = nullptr; bool r = m_decay->test( event.begin(), event.end(), drop_me ); - if ( !r && UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Could not find decay" << endmsg; + if ( !r && msgLevel( MSG::DEBUG ) ) debug() << "Could not find decay" << endmsg; return r; } @@ -617,7 +617,7 @@ bool MCDecayFinder::findDecay( const LHCb::MCParticles& event, const LHCb::MCPar if ( msgLevel( MSG::VERBOSE ) ) verbose() << "About to test the event" << endmsg; if ( !m_decay ) Exception( "Trying to find an unspecified decay!" ); bool r = m_decay->test( event.begin(), event.end(), previous_result ); - if ( !r && UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Could not find decay" << endmsg; + if ( !r && msgLevel( MSG::DEBUG ) ) debug() << "Could not find decay" << endmsg; return r; } diff --git a/Sim/SimComponents/src/MCEventTypeFinder.cpp b/Sim/SimComponents/src/MCEventTypeFinder.cpp index 6b904d7b393f68e094d84fa82451155d4cd5ef21..6bff8941d93dbb2f27385bf79e6ea28436d08751 100644 --- a/Sim/SimComponents/src/MCEventTypeFinder.cpp +++ b/Sim/SimComponents/src/MCEventTypeFinder.cpp @@ -249,7 +249,7 @@ StatusCode MCEventTypeFinder::initialize() { else vec2set( m_inputTypes, m_allTypes ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "Number of event types to look for: m_allTypes.size() " << m_allTypes.size() << endmsg; return sc; @@ -259,7 +259,7 @@ StatusCode MCEventTypeFinder::initialize() { // SLOW. Find all event types in this event using the decay descriptors //============================================================================= StatusCode MCEventTypeFinder::findEventTypes( LHCb::EventTypeSet& found ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "findEventTypes called, with no passsed container" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "findEventTypes called, with no passsed container" << endmsg; // I should get the container, and iterate myself! @@ -274,14 +274,14 @@ StatusCode MCEventTypeFinder::findEventTypes( LHCb::EventTypeSet& found ) { StatusCode sc = findDecayType( found, *mcparts ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "findEventTypes completed, with no container, returning :" << found.size() << endmsg; return sc; } void MCEventTypeFinder::fillMCTools() { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "filling all MCDecayTools" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "filling all MCDecayTools" << endmsg; m_mcFinders.clear(); m_decProdCut.clear(); m_mcFinders.reserve( m_allTypes.size() ); @@ -305,7 +305,7 @@ void MCEventTypeFinder::fillMCTools() { } // if it still doesn't exist, just add it in, all events are min bias, generally if ( !m_allTypes.count( m_mbias ) ) m_allTypes.insert( m_mbias ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Min bias is set to EventType " << m_mbias << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Min bias is set to EventType " << m_mbias << endmsg; for ( auto iType = m_allTypes.begin(); iType != m_allTypes.end(); iType++ ) { if ( !( *iType ) ) break; @@ -325,14 +325,14 @@ void MCEventTypeFinder::fillMCTools() { if ( sdecay == "Unknown" || sdecay == "" || strcompNoSpace( sdecay, minbias ) ) // skip it { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Ignoring: " << *iType << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Ignoring: " << *iType << endmsg; m_mcFinders.push_back( nullptr ); continue; } if ( *iType > m_mbias + m_incb ) // ignore it, shouldn't allow decays above min bias { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Ignoring: " << *iType << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "Ignoring: " << *iType << endmsg; m_mcFinders.push_back( nullptr ); continue; } @@ -368,7 +368,7 @@ void MCEventTypeFinder::fillMCTools() { //============================================================================= StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& found, const LHCb::MCParticle* mc_mother ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "findDecayType called, with MCParticle*" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "findDecayType called, with MCParticle*" << endmsg; if ( !mc_mother ) { warning() << "passed MCParticle mother does not exist" << endmsg; @@ -403,7 +403,7 @@ StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& found, const LH } if ( !found.empty() ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "findDecayType completed, with an MCParticle * container, found:" << found.size() << endmsg; return StatusCode::SUCCESS; } @@ -416,7 +416,7 @@ StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& found, const LH //============================================================================= StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& found, const LHCb::MCParticle::ConstVector& mc_mothers ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "findDecayType called, with MCParticle::ConstVector" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "findDecayType called, with MCParticle::ConstVector" << endmsg; if ( mc_mothers.empty() ) { warning() << "passed empty MCParticle vector" << endmsg; return StatusCode::SUCCESS; @@ -435,7 +435,7 @@ StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& if ( dimuon( mc_mothers ) ) appendDiMuon( found ); // it's a dimuon event if ( found.size() > 0 ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "findDecayType completed, with an MCParticle::ConstVector container, found:" << found.size() << endmsg; return StatusCode::SUCCESS; } @@ -447,7 +447,7 @@ StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& // SLOW. Find all decay types from this particle using the decay descriptors //============================================================================= StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& found, const LHCb::MCParticles& mc_mothers ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "findDecayType called, with MCParticles" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "findDecayType called, with MCParticles" << endmsg; if ( mc_mothers.empty() ) { warning() << "passed empty MCParticle vector" << endmsg; @@ -464,7 +464,7 @@ StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& found, const LH if ( dimuon( mc_mothers ) ) appendDiMuon( found ); // it's a dimuon event if ( found.size() > 0 ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "findDecayType completed, with an MCParticles container, found:" << found.size() << endmsg; return StatusCode::SUCCESS; } @@ -477,7 +477,7 @@ StatusCode MCEventTypeFinder::findDecayType( LHCb::EventTypeSet& found, const LH // Guess event types in this event based on the quarks/decays in the event //============================================================================= StatusCode MCEventTypeFinder::constructEventTypes( LHCb::EventTypeSet& found ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "constructEventTypes called, with no container" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructEventTypes called, with no container" << endmsg; // get all MC particles, const LHCb::MCParticles* mcparts = m_mcparts.get(); @@ -490,7 +490,7 @@ StatusCode MCEventTypeFinder::constructEventTypes( LHCb::EventTypeSet& found ) { StatusCode sc = constructDecayType( found, *mcparts ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructEventTypes completed, with no container, returning :" << found.size() << endmsg; return sc; } @@ -499,7 +499,7 @@ StatusCode MCEventTypeFinder::constructEventTypes( LHCb::EventTypeSet& found ) { // Guess decay types from this particle based on its decay //============================================================================= StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& found, const LHCb::MCParticle* mc_mother ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "constructDecayType called, with an MCParticle*" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructDecayType called, with an MCParticle*" << endmsg; if ( !mc_mother ) return StatusCode::SUCCESS; bool dimuon = false; @@ -513,7 +513,7 @@ StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& found, con if ( dimuon ) appendDiMuon( found ); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructDecayType completed, with an MCParticle *, found:" << found.size() << endmsg; return StatusCode::SUCCESS; } @@ -523,8 +523,7 @@ StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& found, con //============================================================================= StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& found, const LHCb::MCParticle::ConstVector& mc_mothers ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << "constructDecayType called, with an MCParticle::ConstVector" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructDecayType called, with an MCParticle::ConstVector" << endmsg; bool posmuon = false; bool negmuon = false; @@ -547,7 +546,7 @@ StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& appendParents( found ); if ( posmuon && negmuon ) appendDiMuon( found ); // it's a dimuon event - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructDecayType completed, with an MCParticle::ConstVector container, found:" << found.size() << endmsg; return StatusCode::SUCCESS; @@ -556,8 +555,7 @@ StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& // Guess decay types from this particle based on its decay //============================================================================= StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& found, const LHCb::MCParticles& mc_mothers ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) - debug() << "constructDecayType called, with an MCParticles container" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructDecayType called, with an MCParticles container" << endmsg; bool posmuon = false; bool negmuon = false; @@ -579,7 +577,7 @@ StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& found, con appendParents( found ); if ( posmuon && negmuon ) appendDiMuon( found ); // it's a dimuon event - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "constructDecayType completed, with an MCParticles container, found:" << found.size() << endmsg; return StatusCode::SUCCESS; } @@ -592,7 +590,7 @@ StatusCode MCEventTypeFinder::constructDecayType( LHCb::EventTypeSet& found, con //============================================================================= StatusCode MCEventTypeFinder::parentEventTypes( long unsigned int evtType, LHCb::EventTypeSet& parents ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "looking for parents to event " << evtType << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "looking for parents to event " << evtType << endmsg; if ( evtType < 10000000 ) return StatusCode::FAILURE; @@ -602,14 +600,14 @@ StatusCode MCEventTypeFinder::parentEventTypes( long unsigned int evtType, LHCb: parents.insert( evtType - evtType % 10000000 ); // inclusive if ( evtType < m_mbias + m_incb ) parents.insert( m_mbias ); // min bias - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "found parents " << parents.size() << " first in list " << *( parents.begin() ) << endmsg; return StatusCode::SUCCESS; } void MCEventTypeFinder::appendParents( LHCb::EventTypeSet& aset ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "appending all parents, starting size:" << aset.size() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "appending all parents, starting size:" << aset.size() << endmsg; const LHCb::EventTypeSet parents = aset; @@ -621,7 +619,7 @@ void MCEventTypeFinder::appendParents( LHCb::EventTypeSet& aset ) { for ( LHCb::EventTypeSet::const_iterator n = parents.begin(); n != parents.end(); n++ ) { parentEventTypes( *n, aset ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); // append parents to aset } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "parents appended, final size:" << aset.size() << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "parents appended, final size:" << aset.size() << endmsg; return; } diff --git a/Sim/SimComponents/src/PrintMCDecayTreeAlg.cpp b/Sim/SimComponents/src/PrintMCDecayTreeAlg.cpp index bfe609c5b162a350650690a3dfd1e7bdecec738f..e7ff257c8b2d95448eed533ec57886d5002c1df8 100644 --- a/Sim/SimComponents/src/PrintMCDecayTreeAlg.cpp +++ b/Sim/SimComponents/src/PrintMCDecayTreeAlg.cpp @@ -54,9 +54,9 @@ PrintMCDecayTreeAlg::PrintMCDecayTreeAlg( const std::string& name, ISvcLocator* //============================================================================= void PrintMCDecayTreeAlg::operator()( const LHCb::MCParticles& parts ) const { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { + if ( msgLevel( MSG::DEBUG ) ) { debug() << "==> Execute" << endmsg; - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "Getting MCParticles from " << inputLocation() << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "Getting MCParticles from " << inputLocation() << endmsg; } for ( const auto& part : parts ) { diff --git a/Sim/SimComponents/src/PrintMCTree.cpp b/Sim/SimComponents/src/PrintMCTree.cpp index d6e866add25ac64aba76605835f2803d1c8ae322..aacb2c1bb7f6ecc478be2cd2f0b49101ea286880 100644 --- a/Sim/SimComponents/src/PrintMCTree.cpp +++ b/Sim/SimComponents/src/PrintMCTree.cpp @@ -58,7 +58,7 @@ StatusCode PrintMCTree::initialize() { StatusCode sc = FilterPredicate::initialize(); // must be executed first if ( sc.isFailure() ) return sc; // error printed already - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; if ( m_particleNames.empty() ) { fatal() << "You need to give a list of particles" << endmsg; @@ -86,13 +86,13 @@ StatusCode PrintMCTree::initialize() { //============================================================================= bool PrintMCTree::operator()( const LHCb::MCParticles& mcparts ) const { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg; - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "There are " << mcparts.size() << " MC particles" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; + if ( msgLevel( MSG::DEBUG ) ) debug() << "There are " << mcparts.size() << " MC particles" << endmsg; bool printed = false; for ( const auto* MCP : mcparts ) { int pid = MCP->particleID().pid(); - if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << "MC Particle is a " << pid << endmsg; + if ( msgLevel( MSG::VERBOSE ) ) verbose() << "MC Particle is a " << pid << endmsg; if ( std::find( m_particleIDs.begin(), m_particleIDs.end(), pid ) != m_particleIDs.end() ) { info() << "Printing MC tree for particle with ID " << pid << endmsg; m_printMCTree->printTree( MCP, m_depth ); @@ -100,7 +100,7 @@ bool PrintMCTree::operator()( const LHCb::MCParticles& mcparts ) const { } } - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) if ( !printed ) debug() << "No MC particles found to print in a tree" << endmsg; return printed; diff --git a/Tools/GitEntityResolver/src/GitEntityResolver.cpp b/Tools/GitEntityResolver/src/GitEntityResolver.cpp index 6958b59c0fb94a7f4c627c29a495e59adb62ae30..de3e719bec945a87c2c7b53bb7c1f0eef059e1c7 100644 --- a/Tools/GitEntityResolver/src/GitEntityResolver.cpp +++ b/Tools/GitEntityResolver/src/GitEntityResolver.cpp @@ -50,7 +50,7 @@ namespace { template <class RET, class FUNC, class... ARGS> RET git_call( boost::string_ref name, boost::string_ref err_msg, boost::string_ref key, FUNC func, ARGS&&... args ) { typename RET::element_type* tmp = nullptr; - if ( UNLIKELY( func( &tmp, std::forward<ARGS>( args )... ) ) ) + if ( func( &tmp, std::forward<ARGS>( args )... ) ) throw GaudiException( std::string( err_msg ) + " " + std::string( key ) + ": " + giterr_last()->message, std::string( name ), StatusCode::FAILURE ); return RET{tmp}; @@ -134,9 +134,9 @@ std::ostream& operator<<( std::ostream& s, const GitEntityResolver::IOVInfo& inf return s << info.key << " [" << info.since << ", " << info.until << ")"; } -#define ON_DEBUG if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) +#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) #define DEBUG_MSG ON_DEBUG debug() -#define ON_VERBOSE if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) +#define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) ) #define VERBOSE_MSG ON_VERBOSE verbose() GitEntityResolver::GitEntityResolver( const std::string& type, const std::string& name, const IInterface* parent ) @@ -148,7 +148,7 @@ GitEntityResolver::GitEntityResolver( const std::string& type, const std::string auto res = git_call<git_repository_ptr::storage_t>( this->name(), "cannot open repository", m_pathToRepository.value(), git_repository_open, m_pathToRepository.value().c_str() ); - if ( UNLIKELY( !res ) ) + if ( !res ) throw GaudiException( "invalid Git repository: '" + m_pathToRepository.value() + "'", this->name(), StatusCode::FAILURE ); return res; @@ -203,7 +203,7 @@ StatusCode GitEntityResolver::initialize() { char oid[GIT_OID_HEXSZ + 1] = {0}; git_oid_fmt( oid, git_object_id( obj.get() ) ); - if ( LIKELY( msgLevel( MSG::INFO ) ) ) { + if ( msgLevel( MSG::INFO ) ) { auto& log = info(); log << "using commit '" << m_commit.value() << "'"; if ( m_commit.value().compare( oid ) != 0 ) log << " corresponding to " << oid; @@ -213,7 +213,7 @@ StatusCode GitEntityResolver::initialize() { oid[8] = 0; m_defaultTag = m_commit.value() + '[' + oid + ']'; } - if ( UNLIKELY( m_limitToLastCommitTime ) ) { + if ( m_limitToLastCommitTime ) { // get the time of the requested commit/tag m_lastCommitTime = Gaudi::Time( git_commit_time( (git_commit*)obj.get() ), 0 ); DEBUG_MSG << "limit validity to commit time: " << m_lastCommitTime.format( false, "%Y-%m-%d %H:%M:%S" ) << "." @@ -288,11 +288,11 @@ git_object_ptr GitEntityResolver::i_getData( boost::string_ref path ) const { } GitEntityResolver::IOVInfo GitEntityResolver::i_getIOVInfo( const std::string& url ) { - if ( UNLIKELY( !m_detDataSvc ) ) { m_detDataSvc = service<IDetDataSvc>( m_detDataSvcName ); } + if ( !m_detDataSvc ) { m_detDataSvc = service<IDetDataSvc>( m_detDataSvcName ); } const std::string iovs_url = url + "/IOVs"; if ( i_exists( iovs_url ) ) { auto data = i_open( iovs_url ).first; - if ( UNLIKELY( !data ) ) + if ( !data ) throw GaudiException( "cannot access existing file " + iovs_url + ", configuration problem?", name(), StatusCode::FAILURE ); const auto when = m_detDataSvc->eventTime(); @@ -303,7 +303,7 @@ GitEntityResolver::IOVInfo GitEntityResolver::i_getIOVInfo( const std::string& u std::int_fast64_t current = 0, since = 0, until = m_lastCommitTime.ns(); std::string key; - if ( UNLIKELY( time >= until && FSMState() == Gaudi::StateMachine::RUNNING ) ) { + if ( time >= until && FSMState() == Gaudi::StateMachine::RUNNING ) { std::stringstream msg; // this message is not appropriate, but matches the message used in CondDBAccessSvc msg << "Database not up-to-date. Latest known update is at " @@ -353,18 +353,18 @@ std::pair<GitEntityResolver::open_result_t, GitEntityResolver::IOVInfo> GitEntityResolver::i_open( const std::string& url ) { DEBUG_MSG << "open(\"" << url << "\")" << ( m_useFiles ? " [files]" : "" ) << endmsg; auto path = strip_prefix( url ); - if ( UNLIKELY( std::regex_match( path.begin(), path.end(), m_ignore ) ) ) { + if ( std::regex_match( path.begin(), path.end(), m_ignore ) ) { VERBOSE_MSG << "path ignored" << endmsg; return {}; } - return UNLIKELY( m_useFiles ) ? i_open( m_pathToRepository.value() + "/" + path.to_string(), url ) - : i_open( i_getData( path ), url ); + return m_useFiles ? i_open( m_pathToRepository.value() + "/" + path.to_string(), url ) + : i_open( i_getData( path ), url ); } bool GitEntityResolver::i_exists( const std::string& url ) const { bool result = true; auto path = strip_prefix( url ); - if ( UNLIKELY( m_useFiles ) ) + if ( m_useFiles ) result = boost::filesystem::exists( m_pathToRepository.value() + "/" + path.to_string() ); else { git_object* tmp = nullptr; @@ -397,7 +397,7 @@ xercesc::InputSource* GitEntityResolver::resolveEntity( const XMLCh* const, cons } auto data = i_open( url.to_string() ); - if ( UNLIKELY( !data.first ) ) return nullptr; + if ( !data.first ) return nullptr; Blob blob{std::move( data.first )}; const auto buff_size = blob.size(); // must be done here because "adopt" set the size to 0 diff --git a/Tools/XmlTools/src/component/EntityResolverDispatcher.cpp b/Tools/XmlTools/src/component/EntityResolverDispatcher.cpp index d3f11bfc01910b3bc87c116bfae59965a10282ea..df031b735aad3368a29e24b97c05b58683b6fed5 100644 --- a/Tools/XmlTools/src/component/EntityResolverDispatcher.cpp +++ b/Tools/XmlTools/src/component/EntityResolverDispatcher.cpp @@ -54,7 +54,7 @@ public: m_mappingsDesc.declareUpdateHandler( [this]( auto& ) { m_mappings.clear(); for ( const auto& mapping : m_mappingsDesc.value() ) { - if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) + if ( msgLevel( MSG::DEBUG ) ) debug() << "defined mapping \"" << mapping.first << "\" -> \"" << mapping.second << "\"" << endmsg; m_mappings.emplace_back( std::regex{mapping.first}, mapping.second ); } @@ -79,7 +79,7 @@ public: for ( const auto& mapping : m_mappings ) { tmp2 = std::regex_replace( tmp2, mapping.first, mapping.second ); } tmpSysId.reset( xercesc::XMLString::transcode( tmp2.c_str() ) ); *const_cast<XMLCh**>( &systemId ) = tmpSysId.get(); - if ( UNLIKELY( msgLevel( MSG::DEBUG ) && tmp2.compare( tmp1.get() ) ) ) + if ( msgLevel( MSG::DEBUG ) && tmp2.compare( tmp1.get() ) ) debug() << "mapped " << tmp1.get() << " to " << tmp2 << endmsg; } xercesc::InputSource* out = nullptr; diff --git a/Tools/XmlTools/src/component/XmlParserSvc.cpp b/Tools/XmlTools/src/component/XmlParserSvc.cpp index d69489c2295f1918e38656036901ffd33092ee3f..b7050949719ead89e97ef879a90f832f2a1cf973 100644 --- a/Tools/XmlTools/src/component/XmlParserSvc.cpp +++ b/Tools/XmlTools/src/component/XmlParserSvc.cpp @@ -35,9 +35,9 @@ // ----------------------------------------------------------------------- DECLARE_COMPONENT( XmlParserSvc ) -#define ON_DEBUG if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) +#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) #define DEBUG_MSG ON_DEBUG debug() -#define ON_VERBOSE if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) +#define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) ) #define VERBOSE_MSG ON_VERBOSE verbose() //========================================================================= @@ -187,7 +187,7 @@ IOVDOMDocument* XmlParserSvc::parse( const char* fileName ) { DEBUG_MSG << "parsing file " << fileName << endmsg; long long start1 = 0; long long start2 = 0; - if ( UNLIKELY( m_measureTime ) ) { + if ( m_measureTime ) { start1 = System::cpuTime( System::microSec ); start2 = System::currentTime( System::microSec ); } @@ -218,7 +218,7 @@ IOVDOMDocument* XmlParserSvc::parse( const char* fileName ) { } auto myDoc = cacheItem( fileName, std::move( cache_doc ) ); // returns the parsed document - if ( UNLIKELY( m_measureTime ) ) { + if ( m_measureTime ) { double cpu1 = .001 * double( System::cpuTime( System::microSec ) - start1 ); double cpu2 = .001 * double( System::currentTime( System::microSec ) - start2 ); m_sumCpu += cpu1; diff --git a/Tools/ZeroMQ/component/ZeroMQSvc.cpp b/Tools/ZeroMQ/component/ZeroMQSvc.cpp index f364ce184695795b6a633d7d570a68f863633335..c087af1b92d3ffa46e868dc966ce24184304a5e3 100644 --- a/Tools/ZeroMQ/component/ZeroMQSvc.cpp +++ b/Tools/ZeroMQ/component/ZeroMQSvc.cpp @@ -73,6 +73,6 @@ StatusCode ZeroMQSvc::initialize() { //============================================================================= zmq::context_t& ZeroMQSvc::context() const { - if ( UNLIKELY( !m_context ) ) { m_context.reset( new zmq::context_t{m_nThreads} ); } + if ( !m_context ) { m_context.reset( new zmq::context_t{m_nThreads} ); } return *m_context; }