diff --git a/include/aare/Hdf5MasterFile.hpp b/include/aare/Hdf5MasterFile.hpp index c51c8db..8ddd0d1 100644 --- a/include/aare/Hdf5MasterFile.hpp +++ b/include/aare/Hdf5MasterFile.hpp @@ -66,7 +66,7 @@ class Hdf5MasterFile { std::optional m_number_of_udp_interfaces; size_t m_bitdepth{}; std::optional m_ten_giga; - // thresholdenergy + std::optional m_threshold_energy; // thresholdall energy std::optional m_subexptime{}; std::optional m_subperiod{}; @@ -124,7 +124,7 @@ class Hdf5MasterFile { std::optional number_of_udp_interfaces() const; size_t bitdepth() const; std::optional ten_giga() const; - // thresholdenergy + std::optional threshold_energy() const; // thresholdall energy std::optional subexptime() const; std::optional subperiod() const; diff --git a/src/Hdf5MasterFile.cpp b/src/Hdf5MasterFile.cpp index 2244f46..423478a 100644 --- a/src/Hdf5MasterFile.cpp +++ b/src/Hdf5MasterFile.cpp @@ -122,7 +122,9 @@ size_t Hdf5MasterFile::bitdepth() const { return m_bitdepth; } std::optional Hdf5MasterFile::ten_giga() const { return m_ten_giga; } -// thresholdenergy +std::optional Hdf5MasterFile::threshold_energy() const { + return m_threshold_energy; +} // thresholdall energy std::optional Hdf5MasterFile::subexptime() const { return m_subexptime; @@ -351,7 +353,15 @@ void Hdf5MasterFile::parse_acquisition_metadata( // keep the optional empty } - // thresholdenergy + // Threshold Energy + try { + m_threshold_energy = h5_get_scalar_dataset( + file, std::string(metadata_group_name + "Threshold Energy")); + LOG(logDEBUG) << "Threshold Energy: " << m_threshold_energy; + } catch (H5::FileIException &e) { + // keep the optional empty + } + // thresholdall energy // Subexptime