Implements edm::one::EDProducerBase.
Definition at line 120 of file L1TRawToDigi.cc.
References amc, amc13HeaderSize_, amc13TrailerSize_, amcHeaderSize_, amcTrailerSize_, createPayload::block, FEDHeader::bxID(), FEDTrailer::check(), FEDHeader::check(), coll, FEDTrailer::crc(), ctp7_mode_, FEDRawData::data(), data, end, FEDTrailer::evtStatus(), fedData_, HLT_25ns14e33_v1_cff::fedId, fedIds_, HcalMonitorModule_cfi::feds, fwId_, FEDTrailer::lenght(), LogDebug, FEDHeader::lvl1ID(), amc13::Packet::parse(), amc13::Packet::payload(), prov_, FEDRawData::size(), slinkHeaderSize_, slinkTrailerSize_, FEDHeader::sourceID(), dqm_diff::start, FEDHeader::triggerType(), FEDTrailer::ttsBits(), dt_dqm_sourceclient_common_cff::unpackers, and FEDHeader::version().
Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().
124 std::unique_ptr<UnpackerCollections>
coll =
prov_->getCollections(event);
129 if (!
feds.isValid()) {
130 LogError(
"L1T") <<
"Cannot unpack: no collection found";
137 LogDebug(
"L1T") <<
"Found FEDRawDataCollection with ID " <<
fedId <<
" and size " << l1tRcd.
size();
140 LogError(
"L1T") <<
"Cannot unpack: empty/invalid L1T raw data (size = "
141 << l1tRcd.
size() <<
") for ID " <<
fedId <<
". Returning empty collections!";
146 const unsigned char *
data = l1tRcd.
data();
149 if (header.check()) {
150 LogDebug(
"L1T") <<
"Found SLink header:"
151 <<
" Trigger type " << header.triggerType()
152 <<
" L1 event ID " << header.lvl1ID()
153 <<
" BX Number " << header.bxID()
154 <<
" FED source " << header.sourceID()
155 <<
" FED version " << header.version();
157 LogWarning(
"L1T") <<
"Did not find a SLink header!";
162 if (trailer.check()) {
163 LogDebug(
"L1T") <<
"Found SLink trailer:"
164 <<
" Length " << trailer.lenght()
165 <<
" CRC " << trailer.crc()
166 <<
" Status " << trailer.evtStatus()
167 <<
" Throttling bits " << trailer.ttsBits();
169 LogWarning(
"L1T") <<
"Did not find a SLink trailer!";
177 <<
"Could not extract AMC13 Packet.";
182 auto payload64 =
amc.data();
183 const uint32_t *
start = (
const uint32_t*) payload64.get();
184 const uint32_t *
end = start + (
amc.size() * 2);
186 std::auto_ptr<Payload> payload;
188 LogDebug(
"L1T") <<
"Using CTP7 mode";
191 LogDebug(
"L1T") <<
"Using MP7 mode";
194 unsigned fw = payload->getFirmwareId();
200 unsigned board =
amc.header().getBoardID();
201 unsigned amc_no =
amc.header().getAMCNumber();
206 std::auto_ptr<Block>
block;
207 while ((block = payload->getBlock()).
get()) {
209 if (block->header().getID() == 0 and block->header().getSize() == 0)
212 auto unpacker =
unpackers.find(block->header().getID());
214 block->amc(
amc.header());
217 LogDebug(
"L1T") <<
"Cannot find an unpacker for block ID "
218 << block->header().getID() <<
", AMC # " << amc_no
219 <<
", board ID " << board <<
", FED ID " <<
fedId
220 <<
", and FW ID " << fw <<
"!";
222 }
else if (!unpacker->second->unpack(*block,
coll.get())) {
223 LogDebug(
"L1T") <<
"Error unpacking data for block ID "
224 << block->header().getID() <<
", AMC # " << amc_no
225 <<
", board ID " << board <<
", FED ID " <<
fedId
226 <<
", and FW ID " << fw <<
"!";
std::vector< amc::Packet > payload() const
tuple start
Check for commandline option errors.
std::auto_ptr< PackingSetup > prov_
size_t size() const
Lenght of the data buffer in bytes.
std::vector< int > fedIds_
unsigned long long uint64_t
char data[epos_bytes_allocation]
edm::EDGetTokenT< FEDRawDataCollection > fedData_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
bool parse(const uint64_t *, unsigned int)