12#ifndef O2_MCH_RAW_BARE_GBT_DECODER_H
13#define O2_MCH_RAW_BARE_GBT_DECODER_H
19#include <fmt/printf.h>
20#include <fmt/format.h>
24#include <boost/multiprecision/cpp_int.hpp>
38template <
typename CHARGESUM>
73 void append(uint32_t,
int,
int);
77 std::array<BareElinkDecoder<CHARGESUM>, 40> mElinks;
78 int mNofGbtWordsSeens;
82using namespace boost::multiprecision;
84template <
typename CHARGESUM>
94template <
typename CHARGESUM>
97 if (bytes.size() % 16 != 0) {
98 throw std::invalid_argument(
"can only bytes by group of 16 (i.e. 128 bits)");
101 for (
int j = 0;
j < bytes.size();
j += 16) {
104 for (
auto b : bytes.subspan(
j, 10)) {
105 const uint8_t b8 = std::to_integer<uint8_t>(
b);
106 mElinks[elinkIndex++].append(b8 & 2, b8 & 1);
107 mElinks[elinkIndex++].append(b8 & 8, b8 & 4);
108 mElinks[elinkIndex++].append(b8 & 32, b8 & 16);
109 mElinks[elinkIndex++].append(b8 & 128, b8 & 64);
116template <
typename CHARGESUM>
119 for (
auto& e : mElinks) {
o2::raw::RawFileWriter * raw
Main element of the MCH Bare Raw Data Format decoder.
A BareGBTDecoder groups 40 ElinkDecoder objects.
BareGBTDecoder(uint16_t solarId, DecodedDataHandlers decodedDataHandlers)
size_t append(Payload bytes)
Append the equivalent n GBT words (n x 128 bits, split in 16 bytes). bytes size (=n) must be a multip...
void reset()
Clear our internal Elinks.
Decoder for MCH Raw Data Format.
GLboolean GLboolean GLboolean b
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...