88 produces<l1t::RegionalMuonCandBxCollection>(
theOutputTag);
110 desc.add<
bool>(
"skipRpc",
false);
111 desc.add<
bool>(
"skipCsc",
false);
112 desc.add<
bool>(
"skipDt",
false);
113 desc.add<
bool>(
"skipMuon",
false);
114 desc.add<
bool>(
"useRpcConnectionFile",
false);
117 descriptions.
add(
"omtfUnpacker",
desc);
151 auto producedRPCDigis = std::make_unique<RPCDigiCollection>();
152 auto producedCscLctDigis = std::make_unique<CSCCorrelatedLCTDigiCollection>();
153 auto producedMuonDigis = std::make_unique<l1t::RegionalMuonCandBxCollection>();
154 producedMuonDigis->setBXRange(-3, 4);
155 auto producedDTPhDigis = std::make_unique<L1MuDTChambPhContainer>();
156 auto producedDTThDigis = std::make_unique<L1MuDTChambThContainer>();
157 std::vector<L1MuDTChambPhDigi> phi_Container;
158 std::vector<L1MuDTChambThDigi> the_Container;
172 if (!fedHeader.
check()) {
173 LogTrace(
"") <<
" ** PROBLEM **, header.check() failed, break";
177 LogTrace(
"") <<
" ** PROBLEM **, fedHeader.sourceID() != fedId" 178 <<
"fedId = " <<
fedId <<
" sourceID=" << fedHeader.
sourceID();
180 int triggerBX = fedHeader.
bxID();
182 std::ostringstream
str;
183 str <<
" header: " << *
reinterpret_cast<const std::bitset<64>*
>(
header) << std::endl;
184 str <<
" header triggerType: " << fedHeader.
triggerType() << std::endl;
185 str <<
" header lvl1ID: " << fedHeader.
lvl1ID() << std::endl;
186 str <<
" header bxID: " << fedHeader.
bxID() << std::endl;
187 str <<
" header sourceID: " << fedHeader.
sourceID() << std::endl;
188 str <<
" header version: " << fedHeader.
version() << std::endl;
190 str <<
" triggerBx " << triggerBX << std::endl;
199 bool moreTrailers =
true;
200 while (moreTrailers) {
202 FEDTrailer fedTrailer(reinterpret_cast<const unsigned char*>(trailer));
203 if (!fedTrailer.
check()) {
205 LogTrace(
"") <<
" ** PROBLEM **, trailer.check() failed, break";
210 LogTrace(
"") <<
" ** PROBLEM **, fedTrailer.fragmentLength()!= nWords, break";
215 std::ostringstream
str;
216 str <<
" trailer: " << *
reinterpret_cast<const std::bitset<64>*
>(trailer) << std::endl;
218 str <<
" trailer crc: " << fedTrailer.
crc() << std::endl;
219 str <<
" trailer evtStatus: " << fedTrailer.
evtStatus() << std::endl;
220 str <<
" trailer ttsBits: " << fedTrailer.
ttsBits() << std::endl;
229 std::ostringstream
str;
231 str <<
" data: " << *
reinterpret_cast<const std::bitset<64>*
>(
word) << std::endl;
242 std::ostringstream
str;
243 str <<
" headerAMC13: " << *
reinterpret_cast<const std::bitset<64>*
>(headerAmc13raw) << std::endl;
244 str <<
" amc13 check: " << headerAmc13.
check() << std::endl;
258 const Word64* trailerAmc13raw = trailer - 1;
261 std::ostringstream
str;
262 str <<
" trailerAMC13: " << *
reinterpret_cast<const std::bitset<64>*
>(trailerAmc13raw) << std::endl;
263 str <<
" crc: " << trailerAmc13.
getCRC() << std::endl;
264 str <<
" block: " << trailerAmc13.
getBlock() << std::endl;
265 str <<
" LV1ID: " << trailerAmc13.
getLV1ID() << std::endl;
266 str <<
" BX: " << trailerAmc13.
getBX() << std::endl;
283 unsigned int blockNum = 0;
287 std::ostringstream
str;
288 str <<
" ----------- #" << blockNum++ << std::endl;
289 str <<
" blockheader: " << std::bitset<64>(bh.
raw()) << std::endl;
301 std::ostringstream
str;
302 str <<
" AMC header[0]: " << std::bitset<64>(headerAmc.
raw()[0]) << std::endl;
303 str <<
" AMC header[1]: " << std::bitset<64>(headerAmc.
raw()[1]) << std::endl;
315 std::ostringstream
str;
316 str <<
" AMC trailer: " << std::bitset<64>(trailerAmc.raw()) << std::endl;
317 str <<
" getLV1ID: " << trailerAmc.getLV1ID() << std::endl;
318 str <<
" size: " << trailerAmc.getSize() << std::endl;
325 const auto& payload64 =
amc.data();
327 for (
unsigned int iWord = 1; iWord <=
amc.size(); iWord++,
word++) {
330 if (iWord ==
amc.size())
333 LogTrace(
"") <<
" payload: " << *
reinterpret_cast<const std::bitset<64>*
>(
word);
371 producedDTPhDigis->setContainer(phi_Container);
373 producedDTThDigis->setContainer(the_Container);
379 using namespace omtf;
T getParameter(std::string const &) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::string fullPath() const
uint8_t ttsBits() const
Current value of the Trigger Throttling System bits.
void unpack(unsigned int fed, unsigned int amc, const CscDataWord64 &raw, CSCCorrelatedLCTDigiCollection *prod)
static MessageDrop * instance()
edm::ESGetToken< RPCEMap, RPCEMapRcd > theRPCEMapToken
unsigned int getLV1ID() const
void init(const RPCEMap &readoutMapping, const RPCAMCLinkMap &linkMap)
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
unsigned int getBX() const
Log< level::Error, false > LogError
uint32_t fragmentLength() const
The length of the event fragment counted in 64-bit words including header and trailer.
void unpack(int triggerBX, unsigned int fed, unsigned int amc, const RpcDataWord64 &raw, RPCDigiCollection *prod)
MuonUnpacker theMuonUnpacker
RpcUnpacker theRpcUnpacker
OmtfUnpacker(const edm::ParameterSet &pset)
uint16_t crc() const
Cyclic Redundancy Code of the event fragment including header and trailer.
#define DEFINE_FWK_MODULE(type)
unsigned int getBlock() const
uint8_t evtStatus() const
Event fragment status information.
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
unsigned long theEventCounter
edm::EDGetTokenT< FEDRawDataCollection > theFedDataToken
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)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void unpack(unsigned int fed, unsigned int amc, const DtDataWord64 &raw, std::vector< L1MuDTChambPhDigi > &phi_Container, std::vector< L1MuDTChambThDigi > &the_Container)
std::vector< amc::Packet > payload() const
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
edm::ParameterSet theConfig
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void unpack(unsigned int fed, unsigned int amc, const MuonDataWord64 &raw, l1t::RegionalMuonCandBxCollection *muColl)
unsigned int getCRC() const
bool check() const
Check that the trailer is OK.
edm::ESGetToken< RPCAMCLinkMap, RPCOMTFLinkMapRcd > theAmcMappingToken
void produce(edm::Event &ev, const edm::EventSetup &es) override
bool moreTrailers() const
CscUnpacker theCscUnpacker