artdaq_demo_hdf5  v1_00_00
artdaq::hdf5::ToyFragmentNtuple Class Reference

An implementation of FragmentDataset for ToyFragment. Uses a FragmentNtuple dataset plugin for any Fragments which are not ToyFragments. More...

#include <artdaq-demo-hdf5/HDF5/hep-hpc/ToyFragmentNtuple.hh>

Inheritance diagram for artdaq::hdf5::ToyFragmentNtuple:
artdaq::hdf5::FragmentDataset

Public Member Functions

 ToyFragmentNtuple (fhicl::ParameterSet const &ps)
 ToyFragmentNtuple Constructor. More...
 
virtual ~ToyFragmentNtuple ()
 ToyFragmentNtuple Destructor.
 
void insertOne (artdaq::Fragment const &f) override
 Insert a Fragment into the Fragment Ntuple Dataset (write it to the HDF5 file) More...
 
void insertHeader (artdaq::detail::RawEventHeader const &evtHdr) override
 Insert a RawEventHeader into the Event Header Ntuple 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 &) override
 Read a RawEventHeader from the Dataset (HDF5 file) More...
 
- Public Member Functions inherited from artdaq::hdf5::FragmentDataset
 FragmentDataset (fhicl::ParameterSet const &ps, 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.
 

Detailed Description

An implementation of FragmentDataset for ToyFragment. Uses a FragmentNtuple dataset plugin for any Fragments which are not ToyFragments.

Definition at line 15 of file ToyFragmentNtuple.hh.

Constructor & Destructor Documentation

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

ToyFragmentNtuple Constructor.

Parameters
psParameterSet containing configuration for ToyFragmentNtuple

ToyFragmentNtuple accepts the following Parameters: "mode" (Default: "write"): Mode to use for this FragmentDataset (only "write" mode is supported) "nWordsPerRow" (Default: 10240): Number of ADC words to report on each row of the Ntuple "fileName" (Default: "toyFragments.hdf5"): File name to use for output

Definition at line 32 of file ToyFragmentNtuple_dataset.cc.

Member Function Documentation

std::unique_ptr<artdaq::detail::RawEventHeader> artdaq::hdf5::ToyFragmentNtuple::getEventHeader ( artdaq::Fragment::sequence_id_t const &  )
inlineoverridevirtual

Read a RawEventHeader from the Dataset (HDF5 file)

Returns
Pointer to a RawEventHeader if a match was found in the Dataset, nullptr otherwise

This function is not valid for this dataset plugin; it will log an error message and return nullptr

Implements artdaq::hdf5::FragmentDataset.

Definition at line 68 of file ToyFragmentNtuple.hh.

void artdaq::hdf5::ToyFragmentNtuple::insertHeader ( artdaq::detail::RawEventHeader const &  evtHdr)
override

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

Parameters
evtHdrRawEventHeader to insert

This function simply forwards to FragmentNtuple::insertHeader

Definition at line 102 of file ToyFragmentNtuple_dataset.cc.

void artdaq::hdf5::ToyFragmentNtuple::insertOne ( artdaq::Fragment const &  f)
override

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

Parameters
fFragment to insert

If the Fragment is not a ToyFragment, it will be inserted into the FragmentNtuple datset

Definition at line 67 of file ToyFragmentNtuple_dataset.cc.

std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments> > artdaq::hdf5::ToyFragmentNtuple::readNextEvent ( )
inlineoverridevirtual

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 not valid for this dataset plugin; it will log an error message and return an empty map

Implements artdaq::hdf5::FragmentDataset.

Definition at line 56 of file ToyFragmentNtuple.hh.


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