LDMX Software
EventPacket.h
1#ifndef PACKING_RAWDATAFILE_EVENTPACKET_H_
2#define PACKING_RAWDATAFILE_EVENTPACKET_H_
3
4#include <iostream>
5#include <map>
6#include <string>
7#include <vector>
8
9#include "Packing/RawDataFile/SubsystemPacket.h"
10
11namespace packing {
12namespace rawdatafile {
13
18 public:
20 EventPacket() = default;
21
24 uint32_t id,
25 const std::map<uint16_t, std::vector<uint32_t>>& unwrapped_subsys_data);
26
28 std::vector<uint32_t> header() const;
29
31 std::vector<uint32_t> tail() const;
32
33 const uint32_t& id() const { return id_; }
34 std::vector<SubsystemPacket>& data() { return subsys_data_; }
35
44
48 utility::CRC& add(utility::CRC& c) const;
49
50 private:
51 uint32_t id_;
52 uint16_t event_length_in_words_;
53 std::vector<SubsystemPacket> subsys_data_;
54 bool crc_ok_;
55 uint32_t crc_;
56}; // EventPacket
57
58} // namespace rawdatafile
59} // namespace packing
60
61#endif // PACKING_RAWDATAFILE_EVENTPACKET_H_
Event Packet structure.
Definition EventPacket.h:17
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:50
Reading a raw data file.
Definition Reader.h:19
Writing a raw data file.
Definition Writer.h:19