LDMX Software
SubsystemPacket.h
1#ifndef PACKING_RAWDATAFILE_SUBSYSTEMPACKET_H_
2#define PACKING_RAWDATAFILE_SUBSYSTEMPACKET_H_
3
4#include <vector>
5
6#include "Packing/Utility/CRC.h"
7#include "Packing/Utility/Reader.h"
8#include "Packing/Utility/Writer.h"
9
10namespace packing {
11namespace rawdatafile {
12
17 public:
19 SubsystemPacket() = default;
20
22 SubsystemPacket(uint32_t event, uint16_t id, std::vector<uint32_t> data);
23
27 std::vector<uint32_t> header() const;
28
32 std::vector<uint32_t>& data() { return data_; }
33 const uint16_t& id() const { return id_; }
34
38 std::vector<uint32_t> tail() const;
39
48
52 utility::CRC& add(utility::CRC& c) const;
53
54 private:
55 uint32_t event_;
56 uint16_t id_;
57 std::vector<uint32_t> data_;
58 bool crc_ok_;
59 unsigned int crc_;
60}; // SubsystemPacket
61
62} // namespace rawdatafile
63} // namespace packing
64
65#endif // PACKING_RAWDATAFILE_SUBSYSTEMPACKET_H_
utility::CRC & add(utility::CRC &c) const
add the subsystem packet to the input crc
std::vector< uint32_t > & data()
Get data.
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...
Definition CRC.h:50
Reading a raw data file.
Definition Reader.h:19
Writing a raw data file.
Definition Writer.h:19