1 #ifndef artdaq_ots_Overlays_DataGenFragment_hh
2 #define artdaq_ots_Overlays_DataGenFragment_hh
4 #include "artdaq-core/Data/Fragment.hh"
5 #include "cetlib_except/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 uint32_t data_t;
63 static size_t const size_words = 8ul;
66 static_assert(
sizeof(
Header) == Header::size_words *
sizeof(Header::data_t),
67 "DataGenFragment::Header size changed");
82 DataBlob
const* dataBegin()
const
84 return reinterpret_cast<DataBlob const*
>(header_() + 1);
92 DataBlob
const* dataEnd()
const
94 return dataBegin() + (artdaq_Fragment_.dataSize() /
sizeof(DataBlob));
102 Header
const* header_()
const
104 return reinterpret_cast<DataGenFragment::Header const*
>(
105 artdaq_Fragment_.dataBeginBytes());
109 artdaq::Fragment
const& artdaq_Fragment_;