-
Notifications
You must be signed in to change notification settings - Fork 14
/
V1730.cc
31 lines (27 loc) · 1.02 KB
/
V1730.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "V1730.hh"
#include "MongoLog.hh"
#include "Options.hh"
V1730::V1730(std::shared_ptr<MongoLog>& log, std::shared_ptr<Options>& options, int link, int crate, int bid, unsigned address)
:V1724(log, options, link, crate, bid, address){
fNChannels = 16;
fSampleWidth = 2;
fClockCycle = 2;
fArtificialDeadtimeChannel = 792;
}
V1730::~V1730(){}
std::tuple<int, int, bool, uint32_t> V1730::UnpackEventHeader(std::u32string_view sv) {
// returns {words this event, channel mask, board fail, header timestamp}
return {sv[0]&0xFFFFFFF,
(sv[1]&0xFF) | ((sv[2]>>16)&0xFF00),
sv[1]&0x4000000,
sv[3]&0x7FFFFFFF};
}
std::tuple<int64_t, int, uint16_t, std::u32string_view>
V1730::UnpackChannelHeader(std::u32string_view sv, long, uint32_t, uint32_t, int, int) {
// returns {timestamp (ns), words this channel, baseline, waveform}
int words = sv[0]&0x7FFFFF;
return {(long(sv[1]) | (long(sv[2]&0xFFFF)<<32))*fClockCycle,
words,
(sv[2]>>16)&0x3FFF,
sv.substr(3, words-3)};
}