CbmRoot
Loading...
Searching...
No Matches
PsdGbtDataFormat-v0.00.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2021 Institute for Nuclear Research, Moscow
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Nikolay Karpushkin [committer]*/
4
5#ifndef PSD_GBT_DATA_FORMAT_H_
6#define PSD_GBT_DATA_FORMAT_H_
7
8#include <cstdint>
9#include <cstdio>
10#include <cstring>
11#include <vector>
12
13namespace PsdDataV000
14{
15
18 {
19 MWs = 8,
20 HNs = 8,
21 MSs = 64
22 };
23
24 uint8_t uMagicWordAB : MWs;
25 uint8_t uHitsNumber : HNs;
26 uint64_t ulMicroSlice : MSs;
27
28 void printout()
29 {
30 printf("magic word AB: %u; hits number: %u; microslice: %llu\n", uMagicWordAB, uHitsNumber,
31 static_cast<long long unsigned int>(ulMicroSlice));
32 }
33
34 void clear()
35 {
36 uMagicWordAB = 0;
37 uHitsNumber = 0;
38 ulMicroSlice = 0;
39 }
40
42 };
43
44
47 {
48 MWs = 8,
49 PVs = 8,
50 E0s = 32,
51 TMs = 32
52 };
53
54 uint8_t uMagicWordAC : MWs;
55 uint8_t uPacketVersion : PVs;
56 uint32_t uEmpty0 : E0s;
57 uint32_t uAdcTime : TMs;
58
59 void printout()
60 {
61 printf("magic word AC: %u; packet version: %u; ADC time in microslice: %u\n", uMagicWordAC, uPacketVersion,
62 uAdcTime);
63 }
64
65 void clear()
66 {
67 uMagicWordAC = 0;
69 uEmpty0 = 0;
70 uAdcTime = 0;
71 }
72
74 };
75
76
77 struct PsdHitHeader {
79 {
80 WPSs = 8,
81 HCs = 8,
82 E0s = 32,
83 SCs = 16,
84 ZLs = 16
85 };
86
87 uint8_t uWfmPoints : WPSs;
88 uint8_t uHitChannel : HCs;
89 uint32_t uEmpty0 : E0s;
90 uint16_t uSignalCharge : SCs;
91 uint16_t uZeroLevel : ZLs;
92
93 void printout()
94 {
95 printf("waveform points: %u; hit channel: %u; signal charge: %u; zero "
96 "level: %u\n",
98 }
99
100 void clear()
101 {
102 uWfmPoints = 0;
103 uHitChannel = 0;
104 uEmpty0 = 0;
105 uSignalCharge = 0;
106 uZeroLevel = 0;
107 }
108
110 };
111
112
113 struct PsdHitData {
115 {
116 E0s = 16,
117 WPs = 16
118 };
119
120 uint16_t uEmpty0 : E0s;
121 std::vector<uint16_t> uWfm;
122
123 void printout()
124 {
125 printf("waveform: ");
126 for (uint8_t iter = 0; iter < uWfm.size(); iter++)
127 printf("%u ", uWfm.at(iter));
128 printf("\n");
129 }
130
131 void clear()
132 {
133 uEmpty0 = 0;
134 uWfm.clear();
135 }
136
138 };
139
140} // namespace PsdDataV000
141
142
143#endif /* PSD_GBT_DATA_FORMAT_H_ */
uint64_t ulMicroSlice
Total number of hits.
void printout()
ADC Time of threshold cross from the begining of TS.
@ E0s
PacketVersion size in bits.
uint32_t uEmpty0
Version of gbt package.
@ WPs
Empty bits size in bits.
void printout()
Waveform vector.
std::vector< uint16_t > uWfm
Empty bits.
uint8_t uHitChannel
Total waveform points per hit.
@ SCs
Empty bits size in bits.
@ E0s
Hit channel size in bits.
@ HCs
Waveform points size in bits.
@ ZLs
Signal charge size in bits.
uint16_t uZeroLevel
Waveform integral above ZeroLevel.
void printout()
Waveform ZeroLevel.