Project
Loading...
Searching...
No Matches
GBTWord.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12// \file GBTWord.cxx
13// \brief Classes for creation/interpretation of ITS/MFT GBT data
14
16#include "Framework/Logger.h"
17#include <sstream>
18
19using namespace o2::itsmft;
20
21void GBTWord::printX(bool padded, std::string com) const
22{
24 if (padded) {
25 LOGF(info, "0x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %s",
26 data8[15], data8[14], data8[13], data8[12], data8[11], data8[10],
27 data8[9], data8[8], data8[7], data8[6], data8[5], data8[4], data8[3], data8[2], data8[1], data8[0], com.c_str());
28 } else {
29 LOGF(info, "0x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %s",
30 data8[9], data8[8], data8[7], data8[6], data8[5], data8[4], data8[3], data8[2], data8[1], data8[0], com.c_str());
31 }
32}
33
34void GBTWord::printB(bool padded) const
35{
37 int nw = padded ? GBTPaddedWordLength : GBTWordLength;
38 std::stringstream ss;
39 for (int i = nw; i--;) {
40 uint8_t v = data8[i];
41 ss << ' ';
42 for (int j = 8; j--;) {
43 ss << ((v & (0x1 << j)) ? '1' : '0');
44 }
45 }
46 LOGF(info, "0b: %s", ss.str());
47}
int32_t i
uint32_t j
Definition RawData.h:0
const GLdouble * v
Definition glcorearb.h:832
constexpr int GBTPaddedWordLength
Definition GBTWord.h:56
constexpr int GBTWordLength
Definition GBTWord.h:55
void printB(bool padded=true) const
Definition GBTWord.cxx:34
void printX(bool padded=true, std::string com="") const
Definition GBTWord.cxx:21
uint8_t data8[16]
Definition GBTWord.h:120