Skip to content

Commit efa06cd

Browse files
dstoccodavidrohr
authored andcommitted
Dump the RDH also as hexadecimal representation
1 parent 41115e6 commit efa06cd

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Detectors/MUON/MID/Workflow/src/RawDumpSpec.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ class RawDumpDeviceDPL
5757
}
5858
}
5959

60+
void printRDHHex(const o2::header::RDHAny* rdhPtr, bool isBare)
61+
{
62+
std::stringstream ss;
63+
size_t nWordsPerLine = isBare ? 2 : 4;
64+
std::vector<uint64_t> words{rdhPtr->word0, rdhPtr->word1, rdhPtr->word2, rdhPtr->word3, rdhPtr->word4, rdhPtr->word5, rdhPtr->word6, rdhPtr->word7};
65+
for (size_t iword = 0; iword < words.size(); ++iword) {
66+
auto word = words[iword];
67+
if (iword % nWordsPerLine == 0) {
68+
ss << "\n";
69+
}
70+
for (size_t ibyte = 0, end = sizeof(word); ibyte < end; ++ibyte) {
71+
ss << fmt::format("{:02x}", (word >> 8 * ibyte) & 0xf);
72+
}
73+
}
74+
LOG(info) << ss.str();
75+
}
76+
6077
void printPayload(gsl::span<const uint8_t> payload, bool isBare)
6178
{
6279
std::stringstream ss;
@@ -111,6 +128,7 @@ class RawDumpDeviceDPL
111128
gsl::span<const uint8_t> payload(it.data(), it.size());
112129
bool isBare = o2::mid::raw::isBare(*rdhPtr);
113130
o2::raw::RDHUtils::printRDH(rdhPtr);
131+
printRDHHex(rdhPtr, isBare);
114132
if (mDumpPayload) {
115133
printPayload(payload, isBare);
116134
}

0 commit comments

Comments
 (0)