artdaq_demo_hdf5  v1_02_01
artdaq::hdf5::HighFiveGroupedDataset Class Reference

A FragmentDataset implementation which produces files where each event is a Group, and each Fragment_id_t within the group is either a dataset or a group if it is a ContainerFragment. More...

Inheritance diagram for artdaq::hdf5::HighFiveGroupedDataset:
artdaq::hdf5::FragmentDataset

Public Member Functions

 HighFiveGroupedDataset (fhicl::ParameterSet const &ps)
 HighFiveGroupedDataset Constructor. More...
 
 ~HighFiveGroupedDataset () noexceptoverride
 HighFiveGroupedDataset Destructor.
 
void insertOne (artdaq::Fragment const &frag) override
 Insert a Fragment into the Dataset (write it to the HDF5 file) More...
 
void insertMany (artdaq::Fragments const &frags) override
 Insert several Fragments into the Dataset (write them to the HDF5 file) More...
 
void insertHeader (artdaq::detail::RawEventHeader const &hdr) override
 Insert a RawEventHeader into the Dataset (write it to the HDF5 file) More...
 
std::unordered_map
< artdaq::Fragment::type_t,
std::unique_ptr
< artdaq::Fragments > > 
readNextEvent () override
 Read the next event from the Dataset (HDF5 file) More...
 
std::unique_ptr
< artdaq::detail::RawEventHeader > 
getEventHeader (artdaq::Fragment::sequence_id_t const &seqID) override
 Read a RawEventHeader from the Dataset (HDF5 file) More...
 
- Public Member Functions inherited from artdaq::hdf5::FragmentDataset
 FragmentDataset (fhicl::ParameterSet const &ps, const std::string &mode)
 FragmentDataset Constructor. More...
 
virtual ~FragmentDataset () noexcept=default
 FragmentDataset default virtual destructor.
 
virtual void insertOne (Fragment const &f)=0
 Insert a Fragment into the Dataset (write it to the HDF5 file) More...
 
virtual void insertMany (Fragments const &fs)
 Insert several Fragments into the Dataset (write them to the HDF5 file) More...
 
virtual void insertHeader (detail::RawEventHeader const &e)=0
 Insert a RawEventHeader into the Dataset (write it to the HDF5 file) More...
 

Additional Inherited Members

- Protected Attributes inherited from artdaq::hdf5::FragmentDataset
FragmentDatasetMode mode_
 Mode of this FragmentDataset, either FragmentDatasetMode::Write or FragmentDatasetMode::Read.
 
std::shared_ptr
< artdaq::FragmentNameHelper > 
nameHelper_
 FragmentNameHelper used to translate between Fragment Type and string instance names.
 

Detailed Description

A FragmentDataset implementation which produces files where each event is a Group, and each Fragment_id_t within the group is either a dataset or a group if it is a ContainerFragment.

This implementation uses groups for each event, and datasets for each Fragment's metadata and payload. The advantage of this arrangement is that since each Fragment is its own dataset, each dataset can be sized to exactly hold that Fragment's data.

Definition at line 28 of file highFiveGroupedDataset_dataset.cc.

Constructor & Destructor Documentation

artdaq::hdf5::HighFiveGroupedDataset::HighFiveGroupedDataset ( fhicl::ParameterSet const &  ps)

HighFiveGroupedDataset Constructor.

Parameters
psParameterSet used to configure HighFiveGroupedDataset

HighFiveGroupedDataset accepts the following Parameters: "fileName" (REQUIRED): File name to use "mode" (Default: "write"): Mode string to use for this FragmentDataset

Definition at line 94 of file highFiveGroupedDataset_dataset.cc.

Member Function Documentation

std::unique_ptr< artdaq::detail::RawEventHeader > artdaq::hdf5::HighFiveGroupedDataset::getEventHeader ( artdaq::Fragment::sequence_id_t const &  seqID)
overridevirtual

Read a RawEventHeader from the Dataset (HDF5 file)

Parameters
seqIDSequence ID of the RawEventHeader (should be equivalent to event number)
Returns
Pointer to a RawEventHeader if a match was found in the Dataset, nullptr otherwise

Implements artdaq::hdf5::FragmentDataset.

Definition at line 327 of file highFiveGroupedDataset_dataset.cc.

void artdaq::hdf5::HighFiveGroupedDataset::insertHeader ( artdaq::detail::RawEventHeader const &  hdr)
override

Insert a RawEventHeader into the Dataset (write it to the HDF5 file)

Parameters
hdrRawEventHeader to insert

This function writes the header information into attributes for the HDF5 Group identified by the sequence ID of the RawDataHeader.

Definition at line 203 of file highFiveGroupedDataset_dataset.cc.

void artdaq::hdf5::HighFiveGroupedDataset::insertMany ( artdaq::Fragments const &  frags)
override

Insert several Fragments into the Dataset (write them to the HDF5 file)

Parameters
fragsFragments to insert

Definition at line 196 of file highFiveGroupedDataset_dataset.cc.

void artdaq::hdf5::HighFiveGroupedDataset::insertOne ( artdaq::Fragment const &  frag)
override

Insert a Fragment into the Dataset (write it to the HDF5 file)

Parameters
fragFragment to insert

Each Fragment will be written as an HDF5 Dataset, unless it is a Container type, in which case it will be written as an HDF5 Group, with each contained Fragment as a Dataset within that Group. Fragments are written as metadata and payload, with the Fragment header fields represented as Dataset attributes.

Definition at line 116 of file highFiveGroupedDataset_dataset.cc.

std::unordered_map< artdaq::Fragment::type_t, std::unique_ptr< artdaq::Fragments > > artdaq::hdf5::HighFiveGroupedDataset::readNextEvent ( )
overridevirtual

Read the next event from the Dataset (HDF5 file)

Returns
A Map of Fragment::type_t and pointers to Fragments, suitable for ArtdaqInput

Implements artdaq::hdf5::FragmentDataset.

Definition at line 220 of file highFiveGroupedDataset_dataset.cc.


The documentation for this class was generated from the following file: