1 #ifndef artdaq_demo_hdf5_ArtModules_detail_FragmentNtuple
2 #define artdaq_demo_hdf5_ArtModules_detail_FragmentNtuple 1
4 #include "artdaq-core/Data/Fragment.hh"
5 #include "artdaq-core/Data/RawEvent.hh"
7 #pragma GCC diagnostic push
8 #pragma GCC diagnostic ignored "-Wmissing-braces"
9 #include "hep_hpc/hdf5/Column.hpp"
10 #include "hep_hpc/hdf5/Ntuple.hpp"
11 #pragma GCC diagnostic pop
13 #include "artdaq-demo-hdf5/HDF5/FragmentDataset.hh"
18 typedef hep_hpc::hdf5::Column<uint8_t, 1> uint8Column;
19 typedef hep_hpc::hdf5::Column<uint16_t, 1> uint16Column;
20 typedef hep_hpc::hdf5::Column<uint32_t, 1> uint32Column;
21 typedef hep_hpc::hdf5::Column<uint64_t, 1> uint64Column;
22 typedef hep_hpc::hdf5::Column<artdaq::RawDataType, 1> dataColumn;
41 FragmentNtuple(fhicl::ParameterSet
const& ps, hep_hpc::hdf5::File
const& file);
63 void insertOne(artdaq::Fragment
const& frag)
override;
69 void insertHeader(artdaq::detail::RawEventHeader
const& hdr)
override;
77 std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments>>
readNextEvent()
override
79 TLOG(TLVL_ERROR) <<
"FragmentNtuple is not capable of reading!";
80 return std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments>>();
89 std::unique_ptr<artdaq::detail::RawEventHeader>
getEventHeader(artdaq::Fragment::sequence_id_t
const&)
override
91 TLOG(TLVL_ERROR) <<
"FragmentNtuple is not capable of reading!";
97 hep_hpc::hdf5::Ntuple<uint64Column, uint16Column, uint64Column, uint8Column, uint64Column, uint64Column, dataColumn> fragments_;
98 hep_hpc::hdf5::Ntuple<uint32Column, uint32Column, uint32Column, uint64Column, uint8Column> eventHeaders_;
102 #endif //artdaq_demo_hdf5_ArtModules_detail_FragmentNtuple
void insertOne(artdaq::Fragment const &frag) override
Insert a Fragment into the Fragment Ntuple Dataset (write it to the HDF5 file)
Implemementation of FragmentDataset using hep_hpc Ntuples.
virtual ~FragmentNtuple()
FragmentNtuple Destructor.
std::unordered_map< artdaq::Fragment::type_t, std::unique_ptr< artdaq::Fragments > > readNextEvent() override
Read the next event from the Dataset (HDF5 file)
FragmentNtuple(fhicl::ParameterSet const &ps, hep_hpc::hdf5::File const &file)
FragmentNtuple Constructor with input hep_hpc::hdf5::File.
void insertHeader(artdaq::detail::RawEventHeader const &hdr) override
Insert a RawEventHeader into the Event Header Ntuple Dataset (write it to the HDF5 file) ...
Base class that defines methods for reading and writing to HDF5 files via various implementation plug...
std::unique_ptr< artdaq::detail::RawEventHeader > getEventHeader(artdaq::Fragment::sequence_id_t const &) override
Read a RawEventHeader from the Dataset (HDF5 file)