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
13
namespace
PsdDataV000
14
{
15
16
struct
PsdEventHeaderAB
{
17
enum
bitFieldSizes
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
41
PsdEventHeaderAB
() {
clear
(); }
42
};
43
44
45
struct
PsdEventHeaderAC
{
46
enum
bitFieldSizes
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;
68
uPacketVersion
= 0;
69
uEmpty0
= 0;
70
uAdcTime
= 0;
71
}
72
73
PsdEventHeaderAC
() {
clear
(); }
74
};
75
76
77
struct
PsdHitHeader
{
78
enum
bitFieldSizes
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"
,
97
uWfmPoints
,
uHitChannel
,
uSignalCharge
,
uZeroLevel
);
98
}
99
100
void
clear
()
101
{
102
uWfmPoints
= 0;
103
uHitChannel
= 0;
104
uEmpty0
= 0;
105
uSignalCharge
= 0;
106
uZeroLevel
= 0;
107
}
108
109
PsdHitHeader
() {
clear
(); }
110
};
111
112
113
struct
PsdHitData
{
114
enum
bitFieldSizes
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
137
PsdHitData
() {
clear
(); }
138
};
139
140
}
// namespace PsdDataV000
141
142
143
#endif
/* PSD_GBT_DATA_FORMAT_H_ */
PsdDataV000
Definition
PsdGbtDataFormat-v0.00.h:14
PsdDataV000::PsdEventHeaderAB
Definition
PsdGbtDataFormat-v0.00.h:16
PsdDataV000::PsdEventHeaderAB::uMagicWordAB
uint8_t uMagicWordAB
Definition
PsdGbtDataFormat-v0.00.h:24
PsdDataV000::PsdEventHeaderAB::ulMicroSlice
uint64_t ulMicroSlice
Total number of hits.
Definition
PsdGbtDataFormat-v0.00.h:26
PsdDataV000::PsdEventHeaderAB::printout
void printout()
Epoch.
Definition
PsdGbtDataFormat-v0.00.h:28
PsdDataV000::PsdEventHeaderAB::clear
void clear()
Definition
PsdGbtDataFormat-v0.00.h:34
PsdDataV000::PsdEventHeaderAB::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v0.00.h:18
PsdDataV000::PsdEventHeaderAB::MSs
@ MSs
HitsNumber size in bits.
Definition
PsdGbtDataFormat-v0.00.h:21
PsdDataV000::PsdEventHeaderAB::HNs
@ HNs
MagicWord size in bits.
Definition
PsdGbtDataFormat-v0.00.h:20
PsdDataV000::PsdEventHeaderAB::MWs
@ MWs
Definition
PsdGbtDataFormat-v0.00.h:19
PsdDataV000::PsdEventHeaderAB::PsdEventHeaderAB
PsdEventHeaderAB()
Definition
PsdGbtDataFormat-v0.00.h:41
PsdDataV000::PsdEventHeaderAB::uHitsNumber
uint8_t uHitsNumber
Should be AB.
Definition
PsdGbtDataFormat-v0.00.h:25
PsdDataV000::PsdEventHeaderAC
Definition
PsdGbtDataFormat-v0.00.h:45
PsdDataV000::PsdEventHeaderAC::printout
void printout()
ADC Time of threshold cross from the begining of TS.
Definition
PsdGbtDataFormat-v0.00.h:59
PsdDataV000::PsdEventHeaderAC::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v0.00.h:47
PsdDataV000::PsdEventHeaderAC::MWs
@ MWs
Definition
PsdGbtDataFormat-v0.00.h:48
PsdDataV000::PsdEventHeaderAC::PVs
@ PVs
MagicWord size in bits.
Definition
PsdGbtDataFormat-v0.00.h:49
PsdDataV000::PsdEventHeaderAC::TMs
@ TMs
Empty bits size in bits.
Definition
PsdGbtDataFormat-v0.00.h:51
PsdDataV000::PsdEventHeaderAC::E0s
@ E0s
PacketVersion size in bits.
Definition
PsdGbtDataFormat-v0.00.h:50
PsdDataV000::PsdEventHeaderAC::clear
void clear()
Definition
PsdGbtDataFormat-v0.00.h:65
PsdDataV000::PsdEventHeaderAC::uPacketVersion
uint8_t uPacketVersion
Should be AC.
Definition
PsdGbtDataFormat-v0.00.h:55
PsdDataV000::PsdEventHeaderAC::uEmpty0
uint32_t uEmpty0
Version of gbt package.
Definition
PsdGbtDataFormat-v0.00.h:56
PsdDataV000::PsdEventHeaderAC::uMagicWordAC
uint8_t uMagicWordAC
Definition
PsdGbtDataFormat-v0.00.h:54
PsdDataV000::PsdEventHeaderAC::PsdEventHeaderAC
PsdEventHeaderAC()
Definition
PsdGbtDataFormat-v0.00.h:73
PsdDataV000::PsdEventHeaderAC::uAdcTime
uint32_t uAdcTime
Empty bits.
Definition
PsdGbtDataFormat-v0.00.h:57
PsdDataV000::PsdHitData
Definition
PsdGbtDataFormat-v0.00.h:113
PsdDataV000::PsdHitData::PsdHitData
PsdHitData()
Definition
PsdGbtDataFormat-v0.00.h:137
PsdDataV000::PsdHitData::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v0.00.h:115
PsdDataV000::PsdHitData::WPs
@ WPs
Empty bits size in bits.
Definition
PsdGbtDataFormat-v0.00.h:117
PsdDataV000::PsdHitData::E0s
@ E0s
Definition
PsdGbtDataFormat-v0.00.h:116
PsdDataV000::PsdHitData::printout
void printout()
Waveform vector.
Definition
PsdGbtDataFormat-v0.00.h:123
PsdDataV000::PsdHitData::clear
void clear()
Definition
PsdGbtDataFormat-v0.00.h:131
PsdDataV000::PsdHitData::uEmpty0
uint16_t uEmpty0
Definition
PsdGbtDataFormat-v0.00.h:120
PsdDataV000::PsdHitData::uWfm
std::vector< uint16_t > uWfm
Empty bits.
Definition
PsdGbtDataFormat-v0.00.h:121
PsdDataV000::PsdHitHeader
Definition
PsdGbtDataFormat-v0.00.h:77
PsdDataV000::PsdHitHeader::clear
void clear()
Definition
PsdGbtDataFormat-v0.00.h:100
PsdDataV000::PsdHitHeader::uSignalCharge
uint16_t uSignalCharge
Empty bits.
Definition
PsdGbtDataFormat-v0.00.h:90
PsdDataV000::PsdHitHeader::PsdHitHeader
PsdHitHeader()
Definition
PsdGbtDataFormat-v0.00.h:109
PsdDataV000::PsdHitHeader::uWfmPoints
uint8_t uWfmPoints
Definition
PsdGbtDataFormat-v0.00.h:87
PsdDataV000::PsdHitHeader::uHitChannel
uint8_t uHitChannel
Total waveform points per hit.
Definition
PsdGbtDataFormat-v0.00.h:88
PsdDataV000::PsdHitHeader::bitFieldSizes
bitFieldSizes
Definition
PsdGbtDataFormat-v0.00.h:79
PsdDataV000::PsdHitHeader::SCs
@ SCs
Empty bits size in bits.
Definition
PsdGbtDataFormat-v0.00.h:83
PsdDataV000::PsdHitHeader::E0s
@ E0s
Hit channel size in bits.
Definition
PsdGbtDataFormat-v0.00.h:82
PsdDataV000::PsdHitHeader::WPSs
@ WPSs
Definition
PsdGbtDataFormat-v0.00.h:80
PsdDataV000::PsdHitHeader::HCs
@ HCs
Waveform points size in bits.
Definition
PsdGbtDataFormat-v0.00.h:81
PsdDataV000::PsdHitHeader::ZLs
@ ZLs
Signal charge size in bits.
Definition
PsdGbtDataFormat-v0.00.h:84
PsdDataV000::PsdHitHeader::uZeroLevel
uint16_t uZeroLevel
Waveform integral above ZeroLevel.
Definition
PsdGbtDataFormat-v0.00.h:91
PsdDataV000::PsdHitHeader::printout
void printout()
Waveform ZeroLevel.
Definition
PsdGbtDataFormat-v0.00.h:93
PsdDataV000::PsdHitHeader::uEmpty0
uint32_t uEmpty0
Hit channel.
Definition
PsdGbtDataFormat-v0.00.h:89
core
data
raw
PsdGbtDataFormat-v0.00.h
Generated on Sun Dec 22 2024 23:04:08 for CbmRoot by
1.12.0