artdaq_demo_hdf5  v1_04_01
artdaq::hdf5::FragmentDataset Class Referenceabstract

Base class that defines methods for reading and writing to HDF5 files via various implementation plugins. More...

#include <artdaq-demo-hdf5/HDF5/FragmentDataset.hh>

Inheritance diagram for artdaq::hdf5::FragmentDataset:
artdaq::hdf5::FragmentNtuple artdaq::hdf5::HighFiveGeoCmpltPDSPSample artdaq::hdf5::HighFiveGeoCmpltPDSPSample artdaq::hdf5::HighFiveGeoSplitPDSPSample artdaq::hdf5::HighFiveGroupedDataset artdaq::hdf5::HighFiveNtupleDataset

Public Member Functions

 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...
 
virtual std::unordered_map
< artdaq::Fragment::type_t,
std::unique_ptr
< artdaq::Fragments > > 
readNextEvent ()=0
 Read the next event from the Dataset (HDF5 file) More...
 
virtual std::unique_ptr
< artdaq::detail::RawEventHeader > 
getEventHeader (artdaq::Fragment::sequence_id_t const &seqID)=0
 Read a RawEventHeader from the Dataset (HDF5 file) More...
 

Protected Attributes

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

Base class that defines methods for reading and writing to HDF5 files via various implementation plugins.

This design was chosen so that multiple different HDF5 backends could be evaluated in parallel, as well as different file formats within each backend.

Definition at line 30 of file FragmentDataset.hh.

Constructor & Destructor Documentation

artdaq::hdf5::FragmentDataset::FragmentDataset ( fhicl::ParameterSet const &  ps,
const std::string &  mode 
)

FragmentDataset Constructor.

Parameters
psParameterSet containing configuration for this FragmentDataset
modeString which will be converted to a FragmentDatasetMode. Currently, if this parameter contains "rite", then FragmentDatasetMode::Write will be used, FragmentDatasetMode::Read otherwise.

FragmentDataset takes no Parameters.

Definition at line 6 of file FragmentDataset.cc.

Member Function Documentation

virtual std::unique_ptr<artdaq::detail::RawEventHeader> artdaq::hdf5::FragmentDataset::getEventHeader ( artdaq::Fragment::sequence_id_t const &  seqID)
pure virtual

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

This function is pure virtual.

Implemented in artdaq::hdf5::FragmentNtuple, artdaq::hdf5::HighFiveGroupedDataset, artdaq::hdf5::HighFiveNtupleDataset, artdaq::hdf5::HighFiveGeoCmpltPDSPSample, artdaq::hdf5::HighFiveGeoSplitPDSPSample, and artdaq::hdf5::HighFiveGeoCmpltPDSPSample.

virtual void artdaq::hdf5::FragmentDataset::insertHeader ( detail::RawEventHeader const &  e)
pure virtual

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

Parameters
eRawEventHeader to insert

This function is pure virtual.

Implemented in artdaq::hdf5::HighFiveNtupleDataset.

virtual void artdaq::hdf5::FragmentDataset::insertMany ( Fragments const &  fs)
inlinevirtual

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

Parameters
fsFragments to insert

Definition at line 56 of file FragmentDataset.hh.

virtual void artdaq::hdf5::FragmentDataset::insertOne ( Fragment const &  f)
pure virtual

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

Parameters
fFragment to insert

This function is pure virtual.

Implemented in artdaq::hdf5::HighFiveNtupleDataset.

virtual std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments> > artdaq::hdf5::FragmentDataset::readNextEvent ( )
pure virtual

Read the next event from the Dataset (HDF5 file)

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

This function is pure virtual.

Implemented in artdaq::hdf5::FragmentNtuple, artdaq::hdf5::HighFiveGroupedDataset, artdaq::hdf5::HighFiveNtupleDataset, artdaq::hdf5::HighFiveGeoCmpltPDSPSample, artdaq::hdf5::HighFiveGeoSplitPDSPSample, and artdaq::hdf5::HighFiveGeoCmpltPDSPSample.


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