diff --git a/Dumpers/BinaryDumpers/src/DumpRawBanks.cpp b/Dumpers/BinaryDumpers/src/DumpRawBanks.cpp index c95f5d526ea841f95eac0a384b9ebdaf91de574b..771c2044e6b815f24579f1d4c8ef390c66be25b7 100644 --- a/Dumpers/BinaryDumpers/src/DumpRawBanks.cpp +++ b/Dumpers/BinaryDumpers/src/DumpRawBanks.cpp @@ -80,7 +80,7 @@ void DumpRawBanks::operator()( std::lock_guard _ {m_dirMutex}; if (!m_createdDirectories) { for (auto bt : LHCb::RawBank::types()) { - auto const& banks = std::get<0>(transposed_banks[bt]); + auto const& banks = std::get<0>(transposed_banks[(uint8_t) bt]); if (!banks.empty()) { if (!DumpUtils::createDirectory(outputDirectory(bt))) { throw GaudiException { @@ -93,7 +93,7 @@ void DumpRawBanks::operator()( } for (auto bt : LHCb::RawBank::types()) { - auto const& rawBanks = std::get<0>(transposed_banks[bt]); + auto const& rawBanks = std::get<0>(transposed_banks[(uint8_t) bt]); if (!rawBanks.empty()) { DumpUtils::FileWriter outfile = outputDirectory(bt) + "/" + to_string(odin.runNumber()) + "_" + to_string(odin.eventNumber()) + ".bin"; diff --git a/device/SciFi/preprocessing/src/SciFiCalculateClusterCount.cu b/device/SciFi/preprocessing/src/SciFiCalculateClusterCount.cu index 7bb4e966983e58e12e30554cf8b2b5908e8689d6..add71b3d95388c20df947e534fd5998bacf9625f 100644 --- a/device/SciFi/preprocessing/src/SciFiCalculateClusterCount.cu +++ b/device/SciFi/preprocessing/src/SciFiCalculateClusterCount.cu @@ -44,7 +44,7 @@ __global__ void scifi_calculate_cluster_count_kernel( uint32_t* hits_module; auto rawbank = scifi_raw_event.raw_bank(iRawBank); - if (rawbank.type != LHCb::Event::Enum::RawBank::BankType::FTCluster) continue; + if (rawbank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::FTCluster) continue; const auto iRowInMap = SciFi::getRowInMap(rawbank, geom); if (iRowInMap == geom.number_of_banks) continue; diff --git a/device/SciFi/preprocessing/src/SciFiPreDecode.cu b/device/SciFi/preprocessing/src/SciFiPreDecode.cu index c8417a4cf576781edbe4b1fbd9cb8096045ca991..9402472886e7d31f4f6903c5bf8034d377cb98ad 100644 --- a/device/SciFi/preprocessing/src/SciFiPreDecode.cu +++ b/device/SciFi/preprocessing/src/SciFiPreDecode.cu @@ -34,7 +34,7 @@ scifi_pre_decode_kernel(scifi_pre_decode::Parameters parameters, const unsigned for (unsigned iRawBank = threadIdx.x; iRawBank < scifi_raw_event.number_of_raw_banks(); iRawBank += blockDim.x) { auto rawbank = scifi_raw_event.raw_bank(iRawBank); - if (rawbank.type != LHCb::Event::Enum::RawBank::BankType::FTCluster) continue; + if (rawbank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::FTCluster) continue; const auto iRowInMap = SciFi::getRowInMap(rawbank, geom); if (iRowInMap == geom.number_of_banks) continue; diff --git a/device/calo/decoding/src/CaloDecode.cu b/device/calo/decoding/src/CaloDecode.cu index b9729597ff4dc1ce631f34d792c7bd31cc68b4c3..bc3d5786acc367007cef267e4f56fd5aa9e58db3 100644 --- a/device/calo/decoding/src/CaloDecode.cu +++ b/device/calo/decoding/src/CaloDecode.cu @@ -94,7 +94,7 @@ namespace { int32_t source_id = raw_bank.source_id; if (!((source_id >> 11) == 11)) continue; // Only decode Ecal banks - if (raw_bank.type != LHCb::Event::Enum::RawBank::BankType::Calo) { + if (raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::Calo) { // printf("at event %u, raw bank %u bank type = %u \n", event_number, bank_number, raw_bank.type); continue; // Only decode data banks } diff --git a/device/event_model/UT/include/UTDefinitions.cuh b/device/event_model/UT/include/UTDefinitions.cuh index a4297f94fdfa2c633589b96bec05e6edba1ddc0e..c090fc2498f86b720dbd47c6d2c3f99b2d4898a8 100644 --- a/device/event_model/UT/include/UTDefinitions.cuh +++ b/device/event_model/UT/include/UTDefinitions.cuh @@ -53,7 +53,8 @@ namespace UT { __host__ __device__ inline bool allowed_rawbank_type(const uint8_t type) { return ( - type == LHCb::Event::Enum::RawBank::BankType::UT || type == LHCb::Event::Enum::RawBank::BankType::UTError); + type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::UT || + type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::UTError); } } // namespace Decoding diff --git a/device/muon/decoding/src/MuonCalculateSRQSize.cu b/device/muon/decoding/src/MuonCalculateSRQSize.cu index c086b0faa080bca34cff49e391ee83bbce822790..2331acb1a2799531733be8d4442f77a4b19ef40c 100644 --- a/device/muon/decoding/src/MuonCalculateSRQSize.cu +++ b/device/muon/decoding/src/MuonCalculateSRQSize.cu @@ -77,8 +77,9 @@ __device__ void calculate_srq_size( bool corrupted = false; for (unsigned link = threadIdx.y; link < number_of_readout_fibers; link += blockDim.y) { - unsigned current_pointer = - raw_bank.type == LHCb::Event::Enum::RawBank::BankType::MuonError ? link_start_pointer + 3 : link_start_pointer; + unsigned current_pointer = raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::MuonError ? + link_start_pointer + 3 : + link_start_pointer; auto size_of_link = (static_cast(range_data[current_pointer] & 0xF0) >> 4) + 1; for (unsigned j = 0; j < link; ++j) { @@ -104,8 +105,9 @@ __device__ void calculate_srq_size( auto regionOfLink = muonGeometry->RegionOfLink(tell_number, pci_number, reroutered_link); auto quarterOfLink = muonGeometry->QuarterOfLink(tell_number, pci_number, reroutered_link); - unsigned current_pointer = - raw_bank.type == LHCb::Event::Enum::RawBank::BankType::MuonError ? link_start_pointer + 3 : link_start_pointer; + unsigned current_pointer = raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::MuonError ? + link_start_pointer + 3 : + link_start_pointer; auto size_of_link = (static_cast(range_data[current_pointer] & 0xF0) >> 4) + 1; for (unsigned j = 0; j < link; ++j) { @@ -178,8 +180,8 @@ __global__ void muon_calculate_srq_size_kernel( for (unsigned bank_index = threadIdx.x; bank_index < raw_event.number_of_raw_banks(); bank_index += blockDim.x) { const auto raw_bank = raw_event.raw_bank(bank_index); if ( - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::Muon && - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::MuonError) + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::Muon && + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::MuonError) continue; // skip invalid raw banks calculate_srq_size(muonTables, muonGeometry, raw_bank, storage_station_region_quarter_sizes); diff --git a/device/muon/decoding/src/MuonPopulateTileAndTDC.cu b/device/muon/decoding/src/MuonPopulateTileAndTDC.cu index c5beca58b3bda9db07d1fc5e5294a506cf599fc3..5d82b85348a88ca940f3c45d3890cc506e7d8162 100644 --- a/device/muon/decoding/src/MuonPopulateTileAndTDC.cu +++ b/device/muon/decoding/src/MuonPopulateTileAndTDC.cu @@ -153,8 +153,9 @@ __device__ void decode_muon_bank( bool corrupted = false; for (unsigned link = threadIdx.y; link < number_of_readout_fibers; link += blockDim.y) { - unsigned current_pointer = - raw_bank.type == LHCb::Event::Enum::RawBank::BankType::MuonError ? link_start_pointer + 3 : link_start_pointer; + unsigned current_pointer = raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::MuonError ? + link_start_pointer + 3 : + link_start_pointer; auto size_of_link = (static_cast(range_data[current_pointer] & 0xF0) >> 4) + 1; for (unsigned j = 0; j < link; ++j) { @@ -181,8 +182,9 @@ __device__ void decode_muon_bank( auto regionOfLink = muonGeometry->RegionOfLink(tell_number, pci_number, reroutered_link); auto quarterOfLink = muonGeometry->QuarterOfLink(tell_number, pci_number, reroutered_link); - unsigned current_pointer = - raw_bank.type == LHCb::Event::Enum::RawBank::BankType::MuonError ? link_start_pointer + 3 : link_start_pointer; + unsigned current_pointer = raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::MuonError ? + link_start_pointer + 3 : + link_start_pointer; auto size_of_link = (static_cast(range_data[current_pointer] & 0xF0) >> 4) + 1; for (unsigned j = 0; j < link; ++j) { @@ -279,8 +281,8 @@ __global__ void muon_populate_tile_and_tdc_kernel( const auto raw_bank = raw_event.raw_bank(bank_index); if ( - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::Muon && - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::MuonError) + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::Muon && + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::MuonError) continue; // skip invalid raw banks decode_muon_bank( diff --git a/device/plume/decoding/src/PlumeDecode.cu b/device/plume/decoding/src/PlumeDecode.cu index f38bc440cf42540995901b924f46631ce15b7450..624f29dfa81a4147865f1ad37245b4b5855f7640 100644 --- a/device/plume/decoding/src/PlumeDecode.cu +++ b/device/plume/decoding/src/PlumeDecode.cu @@ -33,7 +33,7 @@ namespace { auto raw_bank = raw_event.raw_bank(bank_number); int32_t source_id = raw_bank.source_id; - if (raw_bank.type != LHCb::Event::Enum::RawBank::BankType::Plume) { + if (raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::Plume) { continue; } diff --git a/device/velo/retinacluster_decoding/src/CalculateNumberOfRetinaClustersPerSensor.cu b/device/velo/retinacluster_decoding/src/CalculateNumberOfRetinaClustersPerSensor.cu index 89fd25e7e01f9cd3a2e0d248985a5162220a3f0f..8313e6a140a2266ccfd6b0a5adae5ebeea3f538b 100644 --- a/device/velo/retinacluster_decoding/src/CalculateNumberOfRetinaClustersPerSensor.cu +++ b/device/velo/retinacluster_decoding/src/CalculateNumberOfRetinaClustersPerSensor.cu @@ -49,10 +49,10 @@ __global__ void calculate_number_of_retinaclusters_each_sensor_pair_kernel( for (unsigned raw_bank_number = threadIdx.x; raw_bank_number < number_of_raw_banks; raw_bank_number += blockDim.x) { const auto raw_bank = velo_raw_event.raw_bank(raw_bank_number); if ( - check_velo_rawbank && (raw_bank.type == LHCb::Event::Enum::RawBank::BankType::VP || - raw_bank.type == LHCb::Event::Enum::RawBank::BankType::Velo)) + check_velo_rawbank && (raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::VP || + raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::Velo)) n_unexpected_velo_rawbank.increment(); - if (raw_bank.type == LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) { + if (raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) { if constexpr (decoding_version == 2 || decoding_version == 3) { each_sensor_pair_size[raw_bank.sourceID] = (masked_modules & (1 << (raw_bank.sourceID / 4))) ? 0 : raw_bank.count; diff --git a/device/velo/retinacluster_decoding/src/DecodeRetinaClusters.cu b/device/velo/retinacluster_decoding/src/DecodeRetinaClusters.cu index 39c976def45e7544363b26241d1a758d73707b81..5981ef173fa31f420e849370c1e6760a80768e78 100644 --- a/device/velo/retinacluster_decoding/src/DecodeRetinaClusters.cu +++ b/device/velo/retinacluster_decoding/src/DecodeRetinaClusters.cu @@ -193,7 +193,7 @@ __global__ void velo_calculate_sorting_key( unsigned index_within_raw_bank = cluster_number - (sensor_pair_offsets[sensor_pair] - event_clusters_offset); const auto raw_bank = velo_raw_event.raw_bank(raw_bank_number); - if (raw_bank.type == LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) { + if (raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) { populate_sorting_key( parameters.dev_hit_sorting_key, g, @@ -353,7 +353,7 @@ __global__ void decode_retinaclusters_sorted( unsigned index_within_raw_bank = cluster_number - sensor_pair_offsets[sensor_pair]; const auto raw_bank = velo_raw_event.raw_bank(raw_bank_number); - if (raw_bank.type == LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) { + if (raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) { populate_retinacluster( velo_cluster_container, g, diff --git a/device/velo/sparse_ccl/src/VeloCalculateNumberOfCandidates.cu b/device/velo/sparse_ccl/src/VeloCalculateNumberOfCandidates.cu index dd11f68c692134e9f8e88079fa50726a7e6a4341..bd6d109a8f242da0cb1a52396eece387fba8bd51 100644 --- a/device/velo/sparse_ccl/src/VeloCalculateNumberOfCandidates.cu +++ b/device/velo/sparse_ccl/src/VeloCalculateNumberOfCandidates.cu @@ -35,11 +35,11 @@ __global__ void velo_count_sp_per_sensor( unsigned* superpixels_offsets = parameters.dev_superpixels_offsets + event_number * Velo::Constants::n_sensors; - if (check_velo_rawbank && raw_bank.type == LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) + if (check_velo_rawbank && raw_bank.type == (uint8_t) LHCb::Event::Enum::RawBank::BankType::VPRetinaCluster) n_unexpected_velo_rawbank.increment(); if ( - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::VP && - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::Velo) + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::VP && + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::Velo) continue; if constexpr (decoding_version == 2 || decoding_version == 3) { @@ -99,8 +99,8 @@ __global__ void velo_partition_superpixels( unsigned* superpixels_offsets = parameters.dev_superpixels_offsets + event_number * Velo::Constants::n_sensors; if ( - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::VP && - raw_bank.type != LHCb::Event::Enum::RawBank::BankType::Velo) + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::VP && + raw_bank.type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::Velo) continue; if constexpr (decoding_version == 2 || decoding_version == 3) { diff --git a/host/error_banks_cut/src/ErrorBankFilter.cpp b/host/error_banks_cut/src/ErrorBankFilter.cpp index e5859df952f64004a9bef0920dc70353ae4d47cb..47a6f69d34c3b73dc7b1af5e90f77b3823b4a51a 100644 --- a/host/error_banks_cut/src/ErrorBankFilter.cpp +++ b/host/error_banks_cut/src/ErrorBankFilter.cpp @@ -89,7 +89,7 @@ void error_bank_filter::error_bank_filter_t::init() std::vector labels; labels.reserve(types.size()); std::transform(types.begin(), types.end(), std::back_inserter(labels), [](auto bt) { - if (bt < LHCb::RawBank::types().size()) { + if ((uint8_t) bt < LHCb::RawBank::types().size()) { return toString(bt); } else if (bt == LHCb::RawBank::BankType::LastType) { @@ -100,9 +100,9 @@ void error_bank_filter::error_bank_filter_t::init() } }); - mapping.fill(static_cast(256)); + mapping.fill(256); for (size_t i = 0; i < types.size(); ++i) { - mapping[types[i]] = i; + mapping[(uint8_t) types[i]] = i; } auto* histo = new Gaudi::Accumulators::StaticHistogram<1> { @@ -233,13 +233,14 @@ void error_bank_filter::error_bank_filter_t::error_bank_filter( // Clear all temporary bin storage auto bin_storage = parameters.host_counts.get(); std::memset(bin_storage.data(), 0, bin_storage.size_bytes()); - auto data_counts = bin_storage.subspan(0, LHCb::RawBank::types().size()); - auto other_counts = bin_storage.subspan(LHCb::RawBank::types().size(), LHCb::RawBank::types().size()); - auto error_counts = bin_storage.subspan(2 * LHCb::RawBank::types().size(), LHCb::RawBank::types().size()); - auto sd_counts = bin_storage.subspan(3 * LHCb::RawBank::types().size(), LHCb::RawBank::types().size()); + const auto spanSize = LHCb::RawBank::types().size(); + auto data_counts = bin_storage.subspan(0, spanSize); + auto other_counts = bin_storage.subspan(spanSize, spanSize); + auto error_counts = bin_storage.subspan(2 * spanSize, spanSize); + auto sd_counts = bin_storage.subspan(3 * spanSize, spanSize); // Don't need this many counts, but let's stick with it - auto source_counts = bin_storage.subspan(4 * LHCb::RawBank::types().size(), LHCb::RawBank::types().size()); - auto unexpected_counts = bin_storage.subspan(5 * LHCb::RawBank::types().size(), 256); + auto source_counts = bin_storage.subspan(4 * spanSize, spanSize); + auto unexpected_counts = bin_storage.subspan(5 * spanSize, 256); auto add_counts = [](Gaudi::Accumulators::StaticHistogram<1>& histo, std::span counts) { for (size_t i = 0; i < histo.nBins(0); ++i) { diff --git a/host/global_event_cut/include/HostSciFiGEC.h b/host/global_event_cut/include/HostSciFiGEC.h index 1693de228f4e6ce57d97b1397f1522cde1fe7705..ccdf9c464a3442d7c6d96b021078ac48295271d6 100644 --- a/host/global_event_cut/include/HostSciFiGEC.h +++ b/host/global_event_cut/include/HostSciFiGEC.h @@ -60,7 +60,7 @@ namespace host_scifi_gec { const auto scifi_event = SciFi::RawEvent { parameters.scifi_banks[0].data(), scifi_offsets.data(), scifi_sizes.data(), scifi_types.data(), event_number}; for (unsigned i = 0; i < scifi_event.number_of_raw_banks(); ++i) { - if (scifi_event.bank_type(i) == LHCb::Event::Enum::RawBank::BankType::FTCluster) { + if (scifi_event.bank_type(i) == (uint8_t) LHCb::Event::Enum::RawBank::BankType::FTCluster) { n_SciFi_clusters += scifi_event.bank_size(i); } } diff --git a/host/global_event_cut/include/HostUTGEC.h b/host/global_event_cut/include/HostUTGEC.h index e3d857ada8494b441bd6e3f5ba0939bfb0944540..f707ef41b792734f8220a4a181e72c1431dc9355 100644 --- a/host/global_event_cut/include/HostUTGEC.h +++ b/host/global_event_cut/include/HostUTGEC.h @@ -62,7 +62,7 @@ namespace host_ut_gec { auto const fragment_offset = ut_offsets[2 + number_of_ut_raw_banks * (1 + event_number) + i] - block_offset; char const* bank_data = parameters.ut_banks[i].data() + fragment_offset; auto const bank_type = MEP::bank_type(bank_data, ut_types.data(), event_number, i); - if (bank_type != LHCb::Event::Enum::RawBank::BankType::UT) continue; + if (bank_type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::UT) continue; auto const bank_size = MEP::bank_size(bank_data, ut_sizes.data(), event_number, i); if (ut_raw_bank_version == 4) n_clusters += UTRawBank<4> {sourceID, bank_data, bank_size, bank_type}.get_n_hits(); @@ -78,7 +78,7 @@ namespace host_ut_gec { for (unsigned i = 0; i < ut_event.number_of_raw_banks(); ++i) { auto const bank_type = Allen::bank_type(ut_types.data(), event_number, i); - if (bank_type != LHCb::Event::Enum::RawBank::BankType::UT) continue; + if (bank_type != (uint8_t) LHCb::Event::Enum::RawBank::BankType::UT) continue; if (ut_raw_bank_version == 4) n_clusters += ut_event.raw_bank<4>(i).get_n_hits(); else if (ut_raw_bank_version == 3) diff --git a/main/src/OutputHandler.cpp b/main/src/OutputHandler.cpp index 0b2265f6e8c0ad0ddce1f88b1832302fd1260826..4fc8ca5881aef10ae7f107e44ea7dc07fdddb2ed 100644 --- a/main/src/OutputHandler.cpp +++ b/main/src/OutputHandler.cpp @@ -510,7 +510,7 @@ size_t OutputHandler::add_banks( std::span data, char* output) -> size_t { // add the dec report - return data.empty() ? 0u : Allen::add_raw_bank(bank_type, version, source_id, data, output); + return data.empty() ? 0u : Allen::add_raw_bank((uint8_t) bank_type, version, source_id, data, output); }; for_each(hlt_banks, [&output, &add_hlt_bank](auto b) { diff --git a/main/src/Transpose.cpp b/main/src/Transpose.cpp index 7158b42c5e652dbd16d5b1dffd6ed674c52e5565..6511d08eabbc8add8b66241816c4eac1439281e6 100644 --- a/main/src/Transpose.cpp +++ b/main/src/Transpose.cpp @@ -27,11 +27,11 @@ std::array Allen::bank_ids() auto it = Allen::bank_mapping.find(bt); if (it != Allen::bank_mapping.end()) { for (auto allen_bt : it->second) { - ids[bt] = static_cast(allen_bt); + ids[(uint8_t) bt] = static_cast(allen_bt); } } else { - ids[bt] = -1; + ids[(uint8_t) bt] = -1; } } return ids; @@ -83,7 +83,7 @@ bool check_sourceIDs(std::span bank_data) BankTypes sd_from_bank_type(LHCb::RawBank const* raw_bank) { static auto const bank_ids = Allen::bank_ids(); - auto const bt = bank_ids[raw_bank->type()]; + auto const bt = bank_ids[(uint8_t) raw_bank->type()]; return bt == -1 ? BankTypes::Unknown : static_cast(bt); } diff --git a/mdf/test/bench_transpose.cpp b/mdf/test/bench_transpose.cpp index eda637dd650d142db491c862584edb25acd8b29d..ca228d9d146c1b9f749251c5848d3139af48e9d5 100644 --- a/mdf/test/bench_transpose.cpp +++ b/mdf/test/bench_transpose.cpp @@ -123,7 +123,7 @@ int main(int argc, char* argv[]) std::array banks_count {}; auto sd_from_bank_type = [bank_ids](LHCb::RawBank const* raw_bank) { - return static_cast(bank_ids[raw_bank->type()]); + return static_cast(bank_ids[(uint8_t) raw_bank->type()]); }; std::span bank_data {read_buffer.data(), event_offsets[1]}; diff --git a/mdf/test/test_read.cpp b/mdf/test/test_read.cpp index 85dc7f4b030d99e7cc9ce33c927a380fd7332fea..60f4f9410304862d32e757af00d08e945a6437ea 100644 --- a/mdf/test/test_read.cpp +++ b/mdf/test/test_read.cpp @@ -152,10 +152,10 @@ int main(int argc, char* argv[]) std::string det = (sys == nullptr) ? "Unknown" : sys; std::string fill(7 - det.size(), ' '); - bool dump_bank = b->type() == dump_type && (!dump_n || (dump_n && bank_counts[b->type()] == *dump_n)); + bool dump_bank = b->type() == dump_type && (!dump_n || (dump_n && bank_counts[(uint8_t) b->type()] == *dump_n)); - if (b->type() < LHCb::RawBank::types().size()) { - ++bank_counts[b->type()]; + if ((uint8_t) b->type() < LHCb::RawBank::types().size()) { + ++bank_counts[(uint8_t) b->type()]; if (b->type() == LHCb::RawBank::BankType::ODIN && (!dump.empty() || quiet)) { auto odin = MDF::decode_odin(b->range(), b->version()); odin_stream << "run " << odin.runNumber() << " event " << std::setw(15) << odin.eventNumber() @@ -193,7 +193,7 @@ int main(int argc, char* argv[]) } } else { - ++bank_counts[LHCb::RawBank::types().size()]; + ++bank_counts[(uint8_t) LHCb::RawBank::BankType::LastType]; } if (!dump.empty() && dump_bank) {