AARE
Data analysis library for PSI hybrid detectors
Loading...
Searching...
No Matches
defs.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <stdexcept>
5
6#include <cstdint>
7#include <string>
8#include <string_view>
9#include <variant>
10#include <vector>
11
12namespace aare {
13
15 uint64_t frameNumber;
16 uint32_t expLength;
17 uint32_t packetNumber;
18 uint64_t bunchId;
19 uint64_t timestamp;
20 uint16_t modId;
21 uint16_t row;
22 uint16_t column;
23 uint16_t reserved;
24 uint32_t debug;
25 uint16_t roundRNumber;
26 uint8_t detType;
27 uint8_t version;
28 uint8_t packetMask[64];
29};
30
31struct xy {
32 int row;
33 int col;
34 bool operator==(const xy &other) const { return row == other.row && col == other.col; }
35 bool operator!=(const xy &other) const { return !(*this == other); }
36};
37
38// using image_shape = std::array<ssize_t, 2>;
39using dynamic_shape = std::vector<ssize_t>;
40
42
43enum class TimingMode { Auto, Trigger };
44
45template <class T> T StringTo(std::string sv) { return T(sv); }
46
47template <class T> std::string toString(T sv) { return T(sv); }
48
49template <> DetectorType StringTo(std::string);
50template <> std::string toString(DetectorType type);
51
52template <> TimingMode StringTo(std::string);
53
54using DataTypeVariants = std::variant<uint16_t, uint32_t>;
55
59
60 bool operator==(const RawFileConfig &other) const {
61 if (module_gap_col != other.module_gap_col)
62 return false;
63 if (module_gap_row != other.module_gap_row)
64 return false;
65 return true;
66 }
67};
68
69} // namespace aare
Frame class to represent a single frame of data model class should be able to work with streams comin...
Definition CircularFifo.hpp:11
std::string toString(T sv)
Definition defs.hpp:47
TimingMode
Definition defs.hpp:43
T StringTo(std::string sv)
Definition defs.hpp:45
DetectorType
Definition defs.hpp:41
std::vector< ssize_t > dynamic_shape
Definition defs.hpp:39
std::variant< uint16_t, uint32_t > DataTypeVariants
Definition defs.hpp:54
Definition defs.hpp:56
int module_gap_col
Definition defs.hpp:58
bool operator==(const RawFileConfig &other) const
Definition defs.hpp:60
int module_gap_row
Definition defs.hpp:57
Definition defs.hpp:14
uint64_t bunchId
Definition defs.hpp:18
uint16_t row
Definition defs.hpp:21
uint64_t timestamp
Definition defs.hpp:19
uint8_t packetMask[64]
Definition defs.hpp:28
uint64_t frameNumber
Definition defs.hpp:15
uint32_t debug
Definition defs.hpp:24
uint32_t packetNumber
Definition defs.hpp:17
uint8_t detType
Definition defs.hpp:26
uint32_t expLength
Definition defs.hpp:16
uint16_t column
Definition defs.hpp:22
uint8_t version
Definition defs.hpp:27
uint16_t reserved
Definition defs.hpp:23
uint16_t modId
Definition defs.hpp:20
uint16_t roundRNumber
Definition defs.hpp:25
Definition defs.hpp:31
bool operator!=(const xy &other) const
Definition defs.hpp:35
int col
Definition defs.hpp:33
bool operator==(const xy &other) const
Definition defs.hpp:34
int row
Definition defs.hpp:32