mu2e_artdaq_core  v1_02_00b
 All Classes Functions
DataBlock.hh
1 #ifndef mu2e_artdaq_core_Overlays_DataBlock_hh
2 #define mu2e_artdaq_core_Overlays_DataBlock_hh
3 
5 // DataBlock
6 //
7 // Class representing a mu2e "DataBlock", or DataHeaderPacket and its
8 // associated DataPackets. Each Fragment is made up of all DataBlocks
9 // from the ROCs connected to one DTC for one timestamp.
10 //
12 
13 #include "mu2e-artdaq-core/Overlays/DTCFragment.hh"
14 
15 #include <cstdint>
16 #include <cstddef>
17 
18 namespace mu2e {
19 class DataBlock {
20 public:
21  DataBlock();
22  DataBlock(packet_t* ptr);
23  virtual ~DataBlock() {}
24 
25  packet_t* headerPacket() { return header_; }
26  packet_t* dataBegin() { return data_; }
27  packet_t* dataEnd() { return data_ + getPacketCount(); }
28  packet_t* dataPacket(uint16_t index);
29 
30  uint16_t getPacketCount();
31  uint8_t getROCID();
32 
33 private:
34  packet_t* header_;
35  packet_t* data_;
36 
37 }; // class DataBlock
38 
39 } // namespace mu2e
40 
41 #endif