2#include "Packing/RawDataFile/SubsystemPacket.h"
4#include "Packing/Utility/Mask.h"
10 std::vector<uint32_t> data)
11 : event_{event}, id_{id}, data_{data} {
21 uint32_t word = ((id_ & utility::mask<16>) << 16) +
22 ((data_.size() & utility::mask<15>) << 1) + crc_ok_;
23 return {word, event_};
32 id_ = (word >> 16) & utility::mask<16>;
33 uint32_t len = (word >> 1) & utility::mask<15>;
34 crc_ok_ = word & utility::mask<1>;
46 std::vector<uint32_t> head{
header()}, t{
tail()};
47 w << head << data_ << t;
52 std::vector<uint32_t> head{
header()}, t{
tail()};
53 c << head << data_ << t;
utility::CRC & add(utility::CRC &c) const
add the subsystem packet to the input crc
std::vector< uint32_t > tail() const
get the tailing words
utility::Reader & read(utility::Reader &r)
read the subsystem packet from the input reader
std::vector< uint32_t > header() const
get the header words
SubsystemPacket()=default
default constructor for reading
utility::Writer & write(utility::Writer &w) const
write the subsystem packet to the input writer
The HGC ROC and FPGA use a CRC checksum to double check that the data transfer has been done correctl...
uint32_t get()
Get the calculate checksum from the calculator.
Reader & read(WordType *w, std::size_t count)
Read the next 'count' words into the input handle.