CbmRoot
Loading...
Searching...
No Matches
PsdGbtDataFormat-v1.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_V100_H_
6
#define PSD_GBT_DATA_FORMAT_V100_H_
7
8
#include <cstdint>
9
#include <cstdio>
10
#include <cstring>
11
#include <vector>
12
13
namespace
PsdDataV100
14
{
15
16
struct
PsdMsHeader
{
17
enum
bitFieldSizes
18
{
19
MWs
= 8,
20
E0s
= 8,
21
MSs
= 64
22
};
23
24
uint8_t
uMagicWord
:
MWs
;
25
uint8_t
uEmpty0
:
E0s
;
26
uint64_t
ulMicroSlice
:
MSs
;
27
28
void
printout
()
29
{
30
printf(
"MS magic word: %x; microslice: %llu\n"
,
uMagicWord
,
static_cast<
long
long
unsigned
int
>
(
ulMicroSlice
));
31
}
32
33
void
clear
()
34
{
35
uMagicWord
= 0;
36
uEmpty0
= 0;
37
ulMicroSlice
= 0;
38
}
39
40
PsdMsHeader
() {
clear
(); }
41
42
};
//PsdMsHeader;
43
44
45
struct
PsdPackHeader
{
46
enum
bitFieldSizes
47
{
48
MWs
= 4,
49
LIs
= 4,
50
E0s
= 24,
51
HNs
= 8,
52
TWs
= 8,
53
TMs
= 32
54
};
55
56
uint8_t
uMagicWord
:
MWs
;
57
uint8_t
uLinkIndex
:
LIs
;
58
uint32_t
uEmpty0
:
E0s
;
59
uint8_t
uHitsNumber
:
HNs
;
60
uint8_t
uTotalWords
:
TWs
;
61
uint32_t
uAdcTime
:
TMs
;
62
63
void
printout
()
64
{
65
printf(
"Pack magic word: %x; link: %u; total hits: %u; total gbt words: %u; ADC time in microslice: %u\n"
,
66
uMagicWord
,
uLinkIndex
,
uHitsNumber
,
uTotalWords
,
uAdcTime
);
67
}
68
69
void
clear
()
70
{
71
uMagicWord
= 0;
72
uLinkIndex
= 0;
73
uEmpty0
= 0;
74
uHitsNumber
= 0;
75
uTotalWords
= 0;
76
uAdcTime
= 0;
77
}
78
79
PsdPackHeader
() {
clear
(); }
80
81
};
//PsdPackHeader;
82
83
84
struct
PsdHitHeader
{
85
enum
bitFieldSizes
86
{
87
HCs
= 8,
88
WWs
= 8,
89
FAs
= 16,
90
E0s
= 12,
91
SCs
= 20,
92
ZLs
= 16
93
};
94
95
uint8_t
uHitChannel
:
HCs
;
96
uint8_t
uWfmWords
:
WWs
;
97
uint32_t
uFeeAccum
:
FAs
;
98
uint32_t
uEmpty0
:
E0s
;
99
uint32_t
uSignalCharge
:
SCs
;
100
uint16_t
uZeroLevel
:
ZLs
;
101
102
void
printout
()
103
{
104
printf(
"hit channel: %u; waveform words: %u; fee accumulator: %u; signal charge: %u; zero level: %u\n"
,
105
uHitChannel
,
uWfmWords
,
uFeeAccum
,
uSignalCharge
,
uZeroLevel
);
106
}
107
108
void
clear
()
109
{
110
uHitChannel
= 0;
111
uWfmWords
= 0;
112
uFeeAccum
= 0;
113
uEmpty0
= 0;
114
uSignalCharge
= 0;
115
uZeroLevel
= 0;
116
}
117
118
PsdHitHeader
() {
clear
(); }
119
120
};
//PsdHitHeader;
121
122
123
struct
PsdHitData
{
124
enum
bitFieldSizes
125
{
126
E0s
= 16,
127
WPs
= 16
128
};
129
130
uint16_t
uEmpty0
:
E0s
;
131
std::vector<uint16_t>
uWfm
;
132
133
void
printout
()
134
{
135
printf(
"waveform: "
);
136
for
(uint8_t iter = 0; iter <
uWfm
.size(); iter++)
137
printf(
"%u "
,
uWfm
.at(iter));
138
printf(
"\n"
);
139
}
140
141
void
clear
()
142
{
143
uEmpty0
= 0;
144
uWfm
.clear();
145
}
146
147
PsdHitData
() {
clear
(); }
148
149
};
//PsdHitData;
150
151
152
struct
PsdMsTrailer
{
153
enum
bitFieldSizes
154
{
155
E0s
= 64,
156
};
157
158
uint64_t
uEmpty0
:
E0s
;
159
160
void
printout
() { printf(
"trailer: %llu\n"
,
static_cast<
long
long
unsigned
int
>
(
uEmpty0
)); }
161
162
void
clear
() {
uEmpty0
= 0; }
163
164
PsdMsTrailer
() {
clear
(); }
165
166
};
//PsdMsTrailer;
167
168
169
}
// namespace PsdDataV100
170
171
172
#endif
/* PSD_GBT_DATA_FORMAT_V100_H_ */
PsdDataV100
Definition
PsdGbtDataFormat-v1.00.h:14
PsdDataV100::PsdHitData
Definition
PsdGbtDataFormat-v1.00.h:123
PsdDataV100::PsdHitData::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v1.00.h:125
PsdDataV100::PsdHitData::E0s
@ E0s
Definition
PsdGbtDataFormat-v1.00.h:126
PsdDataV100::PsdHitData::WPs
@ WPs
Empty bits size in bits.
Definition
PsdGbtDataFormat-v1.00.h:127
PsdDataV100::PsdHitData::uWfm
std::vector< uint16_t > uWfm
Empty bits.
Definition
PsdGbtDataFormat-v1.00.h:131
PsdDataV100::PsdHitData::PsdHitData
PsdHitData()
Definition
PsdGbtDataFormat-v1.00.h:147
PsdDataV100::PsdHitData::uEmpty0
uint16_t uEmpty0
Definition
PsdGbtDataFormat-v1.00.h:130
PsdDataV100::PsdHitData::clear
void clear()
Definition
PsdGbtDataFormat-v1.00.h:141
PsdDataV100::PsdHitData::printout
void printout()
Waveform vector.
Definition
PsdGbtDataFormat-v1.00.h:133
PsdDataV100::PsdHitHeader
Definition
PsdGbtDataFormat-v1.00.h:84
PsdDataV100::PsdHitHeader::uZeroLevel
uint16_t uZeroLevel
Waveform integral above ZeroLevel.
Definition
PsdGbtDataFormat-v1.00.h:100
PsdDataV100::PsdHitHeader::clear
void clear()
Definition
PsdGbtDataFormat-v1.00.h:108
PsdDataV100::PsdHitHeader::uFeeAccum
uint32_t uFeeAccum
Total waveform points per hit.
Definition
PsdGbtDataFormat-v1.00.h:97
PsdDataV100::PsdHitHeader::uHitChannel
uint8_t uHitChannel
Definition
PsdGbtDataFormat-v1.00.h:95
PsdDataV100::PsdHitHeader::uEmpty0
uint32_t uEmpty0
FEE accumulator.
Definition
PsdGbtDataFormat-v1.00.h:98
PsdDataV100::PsdHitHeader::uWfmWords
uint8_t uWfmWords
Hit channel.
Definition
PsdGbtDataFormat-v1.00.h:96
PsdDataV100::PsdHitHeader::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v1.00.h:86
PsdDataV100::PsdHitHeader::ZLs
@ ZLs
Signal charge size in bits.
Definition
PsdGbtDataFormat-v1.00.h:92
PsdDataV100::PsdHitHeader::SCs
@ SCs
Empty bits size in bits.
Definition
PsdGbtDataFormat-v1.00.h:91
PsdDataV100::PsdHitHeader::FAs
@ FAs
Waveform points size in bits.
Definition
PsdGbtDataFormat-v1.00.h:89
PsdDataV100::PsdHitHeader::WWs
@ WWs
Hit channel size in bits.
Definition
PsdGbtDataFormat-v1.00.h:88
PsdDataV100::PsdHitHeader::E0s
@ E0s
FEE accumulator bits size in bits.
Definition
PsdGbtDataFormat-v1.00.h:90
PsdDataV100::PsdHitHeader::HCs
@ HCs
Definition
PsdGbtDataFormat-v1.00.h:87
PsdDataV100::PsdHitHeader::uSignalCharge
uint32_t uSignalCharge
Empty bits.
Definition
PsdGbtDataFormat-v1.00.h:99
PsdDataV100::PsdHitHeader::PsdHitHeader
PsdHitHeader()
Definition
PsdGbtDataFormat-v1.00.h:118
PsdDataV100::PsdHitHeader::printout
void printout()
Waveform ZeroLevel.
Definition
PsdGbtDataFormat-v1.00.h:102
PsdDataV100::PsdMsHeader
Definition
PsdGbtDataFormat-v1.00.h:16
PsdDataV100::PsdMsHeader::PsdMsHeader
PsdMsHeader()
Definition
PsdGbtDataFormat-v1.00.h:40
PsdDataV100::PsdMsHeader::uEmpty0
uint8_t uEmpty0
MagicWord.
Definition
PsdGbtDataFormat-v1.00.h:25
PsdDataV100::PsdMsHeader::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v1.00.h:18
PsdDataV100::PsdMsHeader::E0s
@ E0s
MagicWord size in bits.
Definition
PsdGbtDataFormat-v1.00.h:20
PsdDataV100::PsdMsHeader::MWs
@ MWs
Definition
PsdGbtDataFormat-v1.00.h:19
PsdDataV100::PsdMsHeader::MSs
@ MSs
Empty bits size in bits.
Definition
PsdGbtDataFormat-v1.00.h:21
PsdDataV100::PsdMsHeader::clear
void clear()
Definition
PsdGbtDataFormat-v1.00.h:33
PsdDataV100::PsdMsHeader::uMagicWord
uint8_t uMagicWord
Definition
PsdGbtDataFormat-v1.00.h:24
PsdDataV100::PsdMsHeader::printout
void printout()
Epoch.
Definition
PsdGbtDataFormat-v1.00.h:28
PsdDataV100::PsdMsHeader::ulMicroSlice
uint64_t ulMicroSlice
Empty bits.
Definition
PsdGbtDataFormat-v1.00.h:26
PsdDataV100::PsdMsTrailer
Definition
PsdGbtDataFormat-v1.00.h:152
PsdDataV100::PsdMsTrailer::clear
void clear()
Definition
PsdGbtDataFormat-v1.00.h:162
PsdDataV100::PsdMsTrailer::PsdMsTrailer
PsdMsTrailer()
Definition
PsdGbtDataFormat-v1.00.h:164
PsdDataV100::PsdMsTrailer::printout
void printout()
Empty bits.
Definition
PsdGbtDataFormat-v1.00.h:160
PsdDataV100::PsdMsTrailer::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v1.00.h:154
PsdDataV100::PsdMsTrailer::E0s
@ E0s
Definition
PsdGbtDataFormat-v1.00.h:155
PsdDataV100::PsdMsTrailer::uEmpty0
uint64_t uEmpty0
Definition
PsdGbtDataFormat-v1.00.h:158
PsdDataV100::PsdPackHeader
Definition
PsdGbtDataFormat-v1.00.h:45
PsdDataV100::PsdPackHeader::uAdcTime
uint32_t uAdcTime
Words in data pack.
Definition
PsdGbtDataFormat-v1.00.h:61
PsdDataV100::PsdPackHeader::uLinkIndex
uint8_t uLinkIndex
MagicWord.
Definition
PsdGbtDataFormat-v1.00.h:57
PsdDataV100::PsdPackHeader::clear
void clear()
Definition
PsdGbtDataFormat-v1.00.h:69
PsdDataV100::PsdPackHeader::uEmpty0
uint32_t uEmpty0
Link index.
Definition
PsdGbtDataFormat-v1.00.h:58
PsdDataV100::PsdPackHeader::PsdPackHeader
PsdPackHeader()
Definition
PsdGbtDataFormat-v1.00.h:79
PsdDataV100::PsdPackHeader::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v1.00.h:47
PsdDataV100::PsdPackHeader::TWs
@ TWs
Hits number size in bits.
Definition
PsdGbtDataFormat-v1.00.h:52
PsdDataV100::PsdPackHeader::E0s
@ E0s
Link index size in bits.
Definition
PsdGbtDataFormat-v1.00.h:50
PsdDataV100::PsdPackHeader::MWs
@ MWs
Definition
PsdGbtDataFormat-v1.00.h:48
PsdDataV100::PsdPackHeader::TMs
@ TMs
Words in pack size in bits.
Definition
PsdGbtDataFormat-v1.00.h:53
PsdDataV100::PsdPackHeader::LIs
@ LIs
MagicWord size in bits.
Definition
PsdGbtDataFormat-v1.00.h:49
PsdDataV100::PsdPackHeader::HNs
@ HNs
Empty bits size in bits.
Definition
PsdGbtDataFormat-v1.00.h:51
PsdDataV100::PsdPackHeader::uHitsNumber
uint8_t uHitsNumber
Empty bits.
Definition
PsdGbtDataFormat-v1.00.h:59
PsdDataV100::PsdPackHeader::uMagicWord
uint8_t uMagicWord
Definition
PsdGbtDataFormat-v1.00.h:56
PsdDataV100::PsdPackHeader::printout
void printout()
ADC Time of threshold cross from the begining of MS.
Definition
PsdGbtDataFormat-v1.00.h:63
PsdDataV100::PsdPackHeader::uTotalWords
uint8_t uTotalWords
Hits number.
Definition
PsdGbtDataFormat-v1.00.h:60
core
data
raw
PsdGbtDataFormat-v1.00.h
Generated on Sun Dec 22 2024 23:04:08 for CbmRoot by
1.12.0