Definition at line 131 of file L1TRawToDigi.cc.
References amc13HeaderSize_, amc13TrailerSize_, amcHeaderSize_, l1t::stage2::layer2::demux::amcSlotNum, amcTrailerSize_, groupFilesInBlocks::block, FEDTrailer::check(), gather_cfg::cout, FEDTrailer::crc(), ctp7_mode_, FEDRawData::data(), data, debug_, TauDecayModes::dec, dmxFwId_, mps_fire::end, FEDTrailer::evtStatus(), fedData_, l1t::stage2::layer2::fedId, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedIds_, l1tstage2emulator_dqm_sourceclient-live_cfg::feds, FEDTrailer::fragmentLength(), fwId_, fwOverride_, RecoTauValidation_cfi::header, LogDebug, minFeds_, mtf7_mode_, l1t::stage2::layer2::mp::offsetBoardId, amc13::Packet::parse(), jetsAK4_Puppi_cff::payload, amc13::Packet::payload(), prov_, FEDRawData::size(), slinkHeaderSize_, slinkTrailerSize_, command_line::start, tmtCheck_, FEDTrailer::ttsBits(), dt_dqm_sourceclient_common_cff::unpackers, warnsa_, and warnsb_.
134 std::unique_ptr<UnpackerCollections> coll =
prov_->getCollections(
event);
139 if (!
feds.isValid()) {
140 LogError(
"L1T") <<
"Cannot unpack: no FEDRawDataCollection found";
144 unsigned valid_count = 0;
148 LogDebug(
"L1T") <<
"Found FEDRawDataCollection with ID " <<
fedId <<
" and size " << l1tRcd.
size();
152 if (l1tRcd.
size() > 0) {
153 LogError(
"L1T") <<
"Cannot unpack: invalid L1T raw data (size = " << l1tRcd.
size() <<
") for ID " <<
fedId 154 <<
". Returning empty collections!";
157 LogInfo(
"L1T") <<
"During unpacking, encountered empty L1T raw data (size = " << l1tRcd.
size()
158 <<
") for FED ID " <<
fedId <<
".";
165 const unsigned char*
data = l1tRcd.
data();
169 LogDebug(
"L1T") <<
"Found SLink header:" 170 <<
" Trigger type " <<
header.triggerType() <<
" L1 event ID " <<
header.lvl1ID()
171 <<
" BX Number " <<
header.bxID() <<
" FED source " <<
header.sourceID() <<
" FED version " 174 LogWarning(
"L1T") <<
"Did not find a SLink header!";
179 if (trailer.check()) {
180 LogDebug(
"L1T") <<
"Found SLink trailer:" 181 <<
" Length " << trailer.fragmentLength() <<
" CRC " << trailer.crc() <<
" Status " 182 << trailer.evtStatus() <<
" Throttling bits " << trailer.ttsBits();
184 LogWarning(
"L1T") <<
"Did not find a SLink trailer!";
200 LogError(
"L1T") <<
"Could not extract AMC13 Packet.";
208 auto payload64 =
amc.data();
209 const uint32_t*
start = (
const uint32_t*)payload64.get();
214 std::unique_ptr<Payload>
payload;
216 LogDebug(
"L1T") <<
"Using CTP7 mode";
220 LogDebug(
"L1T") <<
"Using MTF7 mode";
223 LogDebug(
"L1T") <<
"Using MP7 mode";
226 unsigned fw =
payload->getAlgorithmFWVersion();
227 unsigned board =
amc.blockHeader().getBoardID();
228 unsigned amc_no =
amc.blockHeader().getAMCNumber();
234 else if (
fedId == 1366)
241 std::unique_ptr<Block>
block;
245 unsigned bxId =
header.bxID();
246 unsigned unpackTMT = (!
tmtCheck_ || ((tmtId - 1) == ((bxId - 1 + 3) % 9)));
247 unsigned isCaloL2TMT =
250 if (!isCaloL2TMT || unpackTMT) {
252 std::cout <<
">>> block to unpack <<<" << std::endl
253 <<
"hdr: " << std::hex << std::setw(8) << std::setfill(
'0') <<
block->header().raw()
254 <<
std::dec <<
" (ID " <<
block->header().getID() <<
", size " <<
block->header().getSize()
255 <<
", CapID 0x" << std::hex << std::setw(2) << std::setfill(
'0') <<
block->header().getCapID()
257 for (
const auto&
word :
block->payload()) {
269 LogDebug(
"L1T") <<
"Cannot find an unpacker for" 270 <<
"\n\tblock: ID " <<
block->header().getID() <<
", size " <<
block->header().getSize()
271 <<
"\n\tAMC: # " << amc_no <<
", board ID 0x" << std::hex << board <<
std::dec 272 <<
"\n\tFED ID " <<
fedId <<
", and FW ID " <<
fw;
274 }
else if (!unpacker->second->unpack(*
block, coll.get())) {
275 LogDebug(
"L1T") <<
"Error unpacking data for block ID " <<
block->header().getID() <<
", AMC # " << amc_no
276 <<
", board ID " << board <<
", FED ID " <<
fedId <<
", and FW ID " <<
fw <<
"!";
286 LogWarning(
"L1T") <<
"Unpacked " << valid_count <<
" non-empty FED IDs but minimum is set to " <<
minFeds_
size_t size() const
Lenght of the data buffer in bytes.
Log< level::Error, false > LogError
const unsigned int offsetBoardId
std::vector< int > fedIds_
const unsigned int amcSlotNum
Log< level::Info, false > LogInfo
unsigned long long uint64_t
bool parse(const uint64_t *start, const uint64_t *data, unsigned int size, unsigned int lv1, unsigned int bx, bool legacy_mc=false, bool mtf7_mode=false)
char data[epos_bytes_allocation]
std::unique_ptr< PackingSetup > prov_
std::vector< amc::Packet > payload() const
edm::EDGetTokenT< FEDRawDataCollection > fedData_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Log< level::Warning, false > LogWarning