44 auto rdhOnly = ic.
options().
get<
bool>(
"rdh-only");
45 auto dumpDecoded = ic.
options().
get<
bool>(
"decode");
46 auto dumpAll = ic.
options().
get<
bool>(
"payload-and-decode");
51 }
else if (dumpDecoded) {
63 size_t nWordsPerLine = isBare ? 2 : 4;
65 for (
size_t iword = 0; iword < words.size(); ++iword) {
66 auto word = words[iword];
67 if (iword % nWordsPerLine == 0) {
70 for (
size_t ibyte = 0,
end =
sizeof(word); ibyte <
end; ++ibyte) {
71 ss << fmt::format(
"{:02x}", (word >> 8 * ibyte) & 0xf);
74 LOG(info) << ss.str();
80 size_t wordLength = isBare ? 16 : 32;
82 for (
size_t iword = 0; iword < payload.size(); iword += wordLength) {
83 auto word = payload.subspan(iword, wordLength);
85 for (
auto it = word.rbegin(); it != word.rend(); ++it) {
86 auto ibInWord = word.rend() - it;
87 if (ibInWord == 4 || ibInWord == 9) {
90 if (ibInWord == 5 || ibInWord == 10) {
93 ss << fmt::format(
"{:02x}",
static_cast<int>(*it));
96 for (
auto it = word.begin(); it != word.end(); ++it) {
97 ss << fmt::format(
"{:02x}",
static_cast<int>(*it));
102 LOG(info) << ss.str();
108 std::vector<ROBoard>
data;
109 std::vector<ROFRecord> rofs;
121 mDecoder =
createDecoder(*rdhPtr, mIsDebugMode, mElectronicsDelay, mCrateMasks, mFeeIdConfig);
126 for (
auto it = parser.
begin(),
end = parser.
end(); it !=
end; ++it) {
128 gsl::span<const uint8_t> payload(it.data(), it.size());
137 mDecoder->process(payload, *rdhPtr);
138 std::stringstream ss;
139 for (
auto rofIt = mDecoder->getROFRecords().begin() + firstRof,
end = mDecoder->getROFRecords().end(); rofIt !=
end; ++rofIt) {
140 ss << fmt::format(
"BCid: 0x{:x} Orbit: 0x{:x} EvtType: {:d}", rofIt->interactionRecord.bc, rofIt->interactionRecord.orbit,
static_cast<int>(rofIt->eventType)) << std::endl;
141 for (
auto colIt = mDecoder->getData().begin() + rofIt->firstEntry,
end = mDecoder->getData().begin() + rofIt->getEndIndex(); colIt !=
end; ++colIt) {
142 ss << *colIt << std::endl;
145 LOG(info) << ss.str();
146 firstRof = mDecoder->getROFRecords().size();
152 std::unique_ptr<Decoder> mDecoder{
nullptr};
153 bool mIsDebugMode{
false};
154 FEEIdConfig mFeeIdConfig{};
155 CrateMasks mCrateMasks{};
156 ElectronicsDelay mElectronicsDelay{};
158 bool mDumpPayload =
true;
159 bool mDumpDecoded =
false;
172 of::adaptFromTask<o2::mid::RawDumpDeviceDPL>(isDebugMode, feeIdConfig, crateMasks, electronicsDelay, subSpecType),
187 return getRawDumpSpec(isDebugMode, feeIdConfig, crateMasks, electronicsDelay, inputSpecs, askDISTSTF, subSpec);
194 return getRawDumpSpec(isDebugMode, feeIdConfig, crateMasks, electronicsDelay, inputSpecs, askDISTSTF, subSpec);
A raw page parser for DPL input.
Device to dump decoded raw data.
T get(const char *key) const
buffer_type const * raw() const
get pointer to raw block at current position, rdh starts here
The parser handles transparently input in the format of raw pages.
const_iterator end() const
const_iterator begin() const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
void printPayload(gsl::span< const uint8_t > payload, bool isBare)
void init(of::InitContext &ic)
void printRDHHex(const o2::header::RDHAny *rdhPtr, bool isBare)
RawDumpDeviceDPL(bool isDebugMode, const FEEIdConfig &feeIdConfig, const CrateMasks &crateMasks, const ElectronicsDelay &electronicsDelay, header::DataHeader::SubSpecificationType subSpec)
void run(of::ProcessingContext &pc)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
constexpr o2::header::DataOrigin gDataOriginMID
constexpr o2::header::DataDescription gDataDescriptionRawData
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
bool isBare(const o2::header::RDHAny &rdh)
Test if the data comes from the common logic.
bool isDroppedTF(o2::framework::ProcessingContext &pc, o2::header::DataOrigin origin=o2::header::gDataOriginMID)
o2::framework::InputSpec getDiSTSTFSpec()
std::unique_ptr< Decoder > createDecoder(const o2::header::RDHAny &rdh, bool isDebugMode, const ElectronicsDelay &electronicsDelay, const CrateMasks &crateMasks, const FEEIdConfig &feeIdConfig)
framework::DataProcessorSpec getRawDumpSpec()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static void printRDH(const RDHv4 &rdh)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"