LDMX Software
EventPacket.h
1#ifndef PACKING_RAWDATAFILE_EVENTPACKET_H_
2#define PACKING_RAWDATAFILE_EVENTPACKET_H_
3
4#include <map>
5#include <vector>
6
7#include "Packing/RawDataFile/SubsystemPacket.h"
8
9namespace packing {
10namespace rawdatafile {
11
16 public:
18 EventPacket() = default;
19
22 uint32_t id,
23 const std::map<uint16_t, std::vector<uint32_t>>& unwrapped_subsys_data);
24
26 std::vector<uint32_t> header() const;
27
29 std::vector<uint32_t> tail() const;
30
31 const uint32_t& id() const { return id_; }
32 std::vector<SubsystemPacket>& data() { return subsys_data_; }
33
42
46 utility::CRC& add(utility::CRC& c) const;
47
48 private:
49 uint32_t id_;
50 uint16_t event_length_in_words_;
51 std::vector<SubsystemPacket> subsys_data_;
52 bool crc_ok_;
53 uint32_t crc_;
54}; // EventPacket
55
56} // namespace rawdatafile
57} // namespace packing
58
59#endif // PACKING_RAWDATAFILE_EVENTPACKET_H_
Event Packet structure.
Definition EventPacket.h:15
EventPacket()=default
default constructor for reading
std::vector< uint32_t > header() const
Get the header words.
utility::CRC & add(utility::CRC &c) const
add the event packet to the input crc
std::vector< uint32_t > tail() const
Get the tail words.
utility::Reader & read(utility::Reader &r)
read the event packet from the input reader
utility::Writer & write(utility::Writer &w) const
write the event 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:51
Reading a raw data file.
Definition Reader.h:20
Writing a raw data file.
Definition Writer.h:20