From 3385db1fc6d8db4ecc49fc010ac9c364e4d1e9e5 Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Tue, 11 Jun 2024 22:09:15 -0500 Subject: [PATCH 1/7] testing an idea for tracking empty fragments --- scripts/hdf5_dump.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/hdf5_dump.py b/scripts/hdf5_dump.py index ac2c3c3..47d0bc1 100755 --- a/scripts/hdf5_dump.py +++ b/scripts/hdf5_dump.py @@ -172,8 +172,16 @@ def check_fragments(self, k_nrecords): dset = self.h5file[i.header] data_array = bytearray(dset[:]) (h, j, k) = struct.unpack('<3Q', data_array[8:32]) - (s, ) = struct.unpack(' Date: Wed, 12 Jun 2024 06:44:52 -0500 Subject: [PATCH 2/7] Next step in tracking empty fragments --- scripts/hdf5_dump.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/hdf5_dump.py b/scripts/hdf5_dump.py index 47d0bc1..d8f3bd8 100755 --- a/scripts/hdf5_dump.py +++ b/scripts/hdf5_dump.py @@ -178,23 +178,23 @@ def check_fragments(self, k_nrecords): for frag in i.fragments: frag_dset = self.h5file[frag] frag_data = bytearray(frag_dset[:]) - (frag_size, ) = struct.unpack(' Date: Thu, 13 Jun 2024 10:41:07 -0500 Subject: [PATCH 3/7] Added TRH and FragHeader version validation to the -c checking --- scripts/hdf5_dump.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/hdf5_dump.py b/scripts/hdf5_dump.py index d8f3bd8..7ec1d3a 100755 --- a/scripts/hdf5_dump.py +++ b/scripts/hdf5_dump.py @@ -171,6 +171,9 @@ def check_fragments(self, k_nrecords): break dset = self.h5file[i.header] data_array = bytearray(dset[:]) + (trh_version, ) = struct.unpack(' Date: Thu, 13 Jun 2024 11:24:04 -0500 Subject: [PATCH 4/7] Updated version to v2.8.3 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb4c3a8..5f67ec5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR) -project(hdf5libs VERSION 2.8.2) +project(hdf5libs VERSION 2.8.3) find_package(daq-cmake REQUIRED) From 852c63cf56b15eabc7c1270f6977190dd9018f54 Mon Sep 17 00:00:00 2001 From: Alejandro Oranday Date: Mon, 17 Jun 2024 17:42:45 +0200 Subject: [PATCH 5/7] Fix HLT/LLT Bit Position Print. --- test/apps/HDF5LIBS_TestDumpRecord.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/apps/HDF5LIBS_TestDumpRecord.cpp b/test/apps/HDF5LIBS_TestDumpRecord.cpp index 0d02dcd..ede0659 100644 --- a/test/apps/HDF5LIBS_TestDumpRecord.cpp +++ b/test/apps/HDF5LIBS_TestDumpRecord.cpp @@ -272,9 +272,9 @@ main(int argc, char** argv) bit_sniff = 1; for (bit_pos = 0; bit_pos < 32; bit_pos++) { if (input_low & bit_sniff) { - bit_sniff = bit_sniff << 1; ss << bit_pos << " "; } + bit_sniff = bit_sniff << 1; } } @@ -285,9 +285,9 @@ main(int argc, char** argv) bit_sniff = 1; for (bit_pos = 0; bit_pos < 32; bit_pos++) { if (input_high & bit_sniff) { - bit_sniff = bit_sniff << 1; ss << bit_pos << " "; } + bit_sniff = bit_sniff << 1; } } ss << "."; // Finishes the HSI section. From d17b28b6a9047464a81ebb61c9adb08c1ee23416 Mon Sep 17 00:00:00 2001 From: Alejandro Oranday Date: Tue, 18 Jun 2024 11:27:22 +0200 Subject: [PATCH 6/7] Update bit position print style. --- test/apps/HDF5LIBS_TestDumpRecord.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/apps/HDF5LIBS_TestDumpRecord.cpp b/test/apps/HDF5LIBS_TestDumpRecord.cpp index ede0659..3c5e182 100644 --- a/test/apps/HDF5LIBS_TestDumpRecord.cpp +++ b/test/apps/HDF5LIBS_TestDumpRecord.cpp @@ -19,6 +19,7 @@ #include "hdf5libs/hdf5rawdatafile/Nljs.hpp" #include "trgdataformats/TriggerObjectOverlay.hpp" +#include #include #include #include @@ -266,26 +267,38 @@ main(int argc, char** argv) // Finding the bit positions for input_low and input_high uint32_t bit_pos, bit_sniff; uint32_t input_low = hsi_ptr->input_low; + std::bitset<32> low_bits{input_low}; + size_t num_bits = low_bits.count(); ss << ",\n\t\t" << "Input Low Bitmap = " << input_low; if (input_low != 0) { // Skip printing the positions if the value is 0. ss << ", Input Low Bit Positions = "; bit_sniff = 1; - for (bit_pos = 0; bit_pos < 32; bit_pos++) { + for (bit_pos = 0; bit_pos < 32, num_bits > 0; bit_pos++) { if (input_low & bit_sniff) { - ss << bit_pos << " "; + if (num_bits == 1) + ss << bit_pos; + else + ss << bit_pos << ", "; + num_bits--; } bit_sniff = bit_sniff << 1; } } uint32_t input_high = hsi_ptr->input_high; + std::bitset<32> high_bits{input_high}; + num_bits = high_bits.count(); ss << ",\n\t\t" << "Input High Bitmap = " << input_high; if (input_high != 0) { ss << ", Input High Bit Positions = "; bit_sniff = 1; - for (bit_pos = 0; bit_pos < 32; bit_pos++) { + for (bit_pos = 0; bit_pos < 32, num_bits > 0; bit_pos++) { if (input_high & bit_sniff) { - ss << bit_pos << " "; + if (num_bits == 1) + ss << bit_pos; + else + ss << bit_pos << ", "; + num_bits--; } bit_sniff = bit_sniff << 1; } From 4ce2e25c37997d5bb22a6a013ae8797ab73a21b2 Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Tue, 18 Jun 2024 11:08:47 -0500 Subject: [PATCH 7/7] Updated version to v2.8.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f67ec5..e6e8d08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR) -project(hdf5libs VERSION 2.8.3) +project(hdf5libs VERSION 2.8.4) find_package(daq-cmake REQUIRED)