21 feHeader_ = std::unique_ptr<FEDFEHeader>();
74 uint16_t offsetBeginningOfChannel = 0;
87 LogDebug(
"FEDBuffer") <<
"Channel " << uint16_t(
i) <<
" (FE unit " <<
key.feUnit() <<
" channel "
88 <<
key.feChan() <<
" according to external numbering scheme) "
89 <<
"does not fit into buffer. "
90 <<
"Channel starts at " << uint16_t(offsetBeginningOfChannel) <<
" in payload. "
98 uint16_t channelLength =
channels_.back().length();
101 if UNLIKELY (channelLength < minLength) {
103 LogDebug(
"FEDBuffer") <<
"Channel " << uint16_t(
i) <<
" (FE unit " <<
key.feUnit() <<
" channel "
104 <<
key.feChan() <<
" according to external numbering scheme)"
106 <<
"Channel starts at " << uint16_t(offsetBeginningOfChannel) <<
" in payload. "
107 <<
"Channel length is " << uint16_t(channelLength) <<
". "
108 <<
"Min length is " << uint16_t(minLength) <<
". ";
114 LogDebug(
"FEDBuffer") <<
"Channel " << uint16_t(
i) <<
" (FE unit " <<
key.feUnit() <<
" channel "
115 <<
key.feChan() <<
" according to external numbering scheme)"
116 <<
"does not fit into buffer. "
117 <<
"Channel starts at " << uint16_t(offsetBeginningOfChannel) <<
" in payload. "
118 <<
"Channel length is " << uint16_t(channelLength) <<
". "
125 const uint16_t offsetEndOfChannel = offsetBeginningOfChannel + channelLength;
128 uint8_t numPaddingBytes = 8 - (offsetEndOfChannel % 8);
129 if (numPaddingBytes == 8)
131 offsetBeginningOfChannel = offsetEndOfChannel + numPaddingBytes;
133 offsetBeginningOfChannel = offsetEndOfChannel;
176 uint8_t lastEnabledFeUnit = 7;
177 while (!(
fePresent(lastEnabledFeUnit) &&
feEnabled(lastEnabledFeUnit)) && lastEnabledFeUnit != 0)
181 const uint16_t offsetLastChannel = lastChannel.
offset();
182 const uint16_t offsetEndOfChannelData = offsetLastChannel + lastChannel.
length();
183 const uint16_t channelDataLength = offsetEndOfChannelData;
185 uint16_t channelDataLengthInWords = channelDataLength / 8;
186 if (channelDataLength % 8)
187 channelDataLengthInWords++;
190 if (channelDataLengthInWords == payloadLengthInWords) {
200 if (!correctPacketCode)
223 if (goldenAddress == 0x00)
259 uint16_t lengthFromChannels = 0;
263 return lengthFromChannels;
280 summary <<
"FE units missing payloads: ";
283 summary << uint16_t(iFE) <<
" ";
289 unsigned int badChannels = 0;
303 summary <<
"Channels with errors: ";
308 summary << uint16_t(iCh) <<
" ";
314 summary <<
"Number of channels with bad status bits: " << badChannels << std::endl;
316 summary <<
"Check channel lengths match buffer length: "
320 summary <<
"Channels with bad packet codes: ";
325 summary << uint16_t(iCh) <<
" ";
332 summary <<
"Bad FE units:" << std::endl;
337 uint16_t lengthFromHeader = fdHeader->
feUnitLength(iFE);
338 if (lengthFromHeader != lengthFromChannels) {
339 summary <<
"FE unit: " << uint16_t(iFE) <<
" length in header: " << lengthFromHeader
340 <<
" length from channel lengths: " << lengthFromChannels << std::endl;
351 summary <<
"Address from APVe:" << uint16_t(goldenAddress) << std::endl;
352 summary <<
"Bad FE units:" << std::endl;
357 summary <<
"FE unit: " << uint16_t(iFE)
378 os <<
"FE units with data: " << uint16_t(
nFEUnitsPresent()) << std::endl;
379 os <<
"BE status register flags: ";
380 dynamic_cast<const FEDFullDebugHeader*>(
feHeader())->beStatusRegister().printFlags(os);
391 return "Channel length is invalid.";
393 return "First strip of new cluster is not greater than last strip of previous cluster.";
395 return "Invalid packet code.";
397 return "Invalid packet code 0 for zero-suppressed data.";