DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DAQHeader.hpp
Go to the documentation of this file.
1
10#ifndef DETDATAFORMATS_INCLUDE_DETDATAFORMATS_DAQHEADER_HPP_
11#define DETDATAFORMATS_INCLUDE_DETDATAFORMATS_DAQHEADER_HPP_
12
13#include <cstdint>
14#include <ostream>
15
17
21struct DAQHeader
22{
23 using word_t = uint32_t; // NOLINT(build/unsigned)
24
25 word_t version : 6, det_id : 6, crate_id : 10, slot_id : 4, link_id : 6;
28
29 uint64_t get_timestamp() const // NOLINT(build/unsigned)
30 {
31 return uint64_t(timestamp_1) | (uint64_t(timestamp_2) << 32); // NOLINT(build/unsigned)
32 }
33};
34
35inline std::ostream&
36operator<<(std::ostream& o, DAQHeader const& h)
37{
38 return o << "Version:" << unsigned(h.version) << " DetID:" << unsigned(h.det_id) << " CrateID:" << unsigned(h.crate_id)
39 << " SlotID:" << unsigned(h.slot_id) << " LinkID:" << unsigned(h.link_id)
40 << " Timestamp: " << h.get_timestamp() << '\n';
41}
42
43} // namespace dunedaq::detdataformats
44
45#endif // DETDATAFORMATS_INCLUDE_DETDATAFORMATS_DAQHEADER_HPP_
std::ostream & operator<<(std::ostream &o, DAQEthHeader const &h)
DAQHeader is a versioned and unified structure for every FE electronics.
Definition DAQHeader.hpp:22