SRS-control 0.1.4
 
Loading...
Searching...
No Matches
SRSDataStructs.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstdint>
5#include <vector>
6
7#ifdef HAS_ROOT
8#include <Rtypes.h>
9#endif
10
11namespace srs
12{
13 constexpr auto VMM_TAG_BIT_LENGTH = 3;
15 {
16 uint32_t frame_counter{};
17 std::array<char, VMM_TAG_BIT_LENGTH> vmm_tag{};
18 uint8_t fec_id{};
19 uint32_t udp_timestamp{};
20 uint32_t overflow{};
21#ifdef HAS_ROOT
22 ClassDefNV(ReceiveDataHeader, 1);
23#endif
24 };
25
27 {
28 uint8_t vmm_id{};
29 uint64_t srs_timestamp{};
30#ifdef HAS_ROOT
31 ClassDefNV(MarkerData, 1);
32#endif
33 };
34
35 struct HitData
36 {
37 bool is_over_threshold = false;
38 uint8_t channel_num{};
39 uint8_t tdc{};
40 uint8_t offset{};
41 uint8_t vmm_id{};
42 uint16_t adc{};
43 uint16_t bc_id{};
44#ifdef HAS_ROOT
45 ClassDefNV(HitData, 1);
46#endif
47 };
48
50 {
52 std::vector<MarkerData> marker_data;
53 std::vector<HitData> hit_data;
54#ifdef HAS_ROOT
55 ClassDefNV(StructData, 1);
56#endif
57 };
58
59 inline void reset_struct_data(StructData& struct_data)
60 {
61 struct_data.header = ReceiveDataHeader{};
62 struct_data.marker_data.clear();
63 struct_data.hit_data.clear();
64 }
65
66} // namespace srs
constexpr auto VMM_TAG_BIT_LENGTH
void reset_struct_data(StructData &struct_data)
uint8_t vmm_id
VMM ID.
uint8_t tdc
TDC value.
bool is_over_threshold
whether the hit data is over the threshould
uint8_t channel_num
Channel number.
uint8_t offset
Offset value.
uint16_t adc
ADC value.
uint16_t bc_id
BC ID.
uint64_t srs_timestamp
Timestamp value.
uint8_t vmm_id
VMM ID for the marker data.
uint32_t udp_timestamp
UDP timestamp.
uint32_t overflow
Overflow value.
uint32_t frame_counter
The counting value for current UDP data frame.
std::array< char, VMM_TAG_BIT_LENGTH > vmm_tag
Hard-coded text "VMM3".
ReceiveDataHeader header
Header data.
std::vector< MarkerData > marker_data
Marker data.
std::vector< HitData > hit_data
Hit data.