1 #ifndef artdaq_ots_Overlays_DataGenFragment_hh
2 #define artdaq_ots_Overlays_DataGenFragment_hh
4 #include "artdaq-core/Data/Fragment.hh"
5 #include "cetlib/exception.h"
14 class DataGenFragment;
17 std::ostream& operator<<(std::ostream&, DataGenFragment
const&);
33 typedef uint64_t data_t;
39 static size_t const size_words = 1ull;
42 static_assert(
sizeof(
Metadata) == Metadata::size_words *
sizeof(Metadata::data_t),
43 "DataGenFragment::Metadata size changed");
50 typedef uint8_t data_t;
55 static size_t const size_words = 2ul;
58 static_assert(
sizeof(
Header) == Header::size_words *
sizeof(Header::data_t),
59 "DataGenFragment::Header size changed");
74 DataBlob
const* dataBegin()
const
76 return reinterpret_cast<DataBlob const*
>(header_() + 1);
84 DataBlob
const* dataEnd()
const
86 return dataBegin() + (artdaq_Fragment_.dataSize() /
sizeof(DataBlob));
94 Header
const* header_()
const
96 return reinterpret_cast<DataGenFragment::Header const*
>(
97 artdaq_Fragment_.dataBeginBytes());
101 artdaq::Fragment
const& artdaq_Fragment_;