23 int nBX, firstBX, lastBX;
36 unsigned int linkId = blockId / 2;
40 if (linkId > 47 && linkId < 60) {
43 processor = linkId - 48;
44 }
else if (linkId > 41 && linkId < 66) {
48 processor = linkId - 42;
51 processor = linkId - 60;
53 }
else if (linkId > 35 && linkId < 72) {
57 processor = linkId - 36;
60 processor = linkId - 66;
63 edm::LogError(
"L1T") <<
"No TF muon expected for link " << linkId;
68 LogDebug(
"L1T") <<
"nBX = " << nBX <<
" first BX = " << firstBX <<
" lastBX = " << lastBX;
72 for (
const auto& bxBlock : bxBlocks) {
74 const auto bx = bxBlock.header().getBx();
75 if (bx < firstBX || bx > lastBX) {
76 throw cms::Exception(
"CorruptData") <<
"Corrupt RAW data from AMC " << block.
amc().getAMCNumber() <<
". BX number " << bx <<
" in BX header is outside of the BX range [" << firstBX <<
"," << lastBX <<
"] defined in the block header.";
79 auto bxPayload = bxBlock.payload();
80 if (
nWords_ <= bxPayload.size()) {
81 for (
unsigned nWord = 0; nWord <
nWords_; nWord += 2) {
82 uint32_t raw_data_00_31 = bxPayload[nWord];
83 uint32_t raw_data_32_63 = bxPayload[nWord+1];
84 LogDebug(
"L1T") <<
"raw_data_00_31 = 0x" << hex << setw(8) << setfill(
'0') << raw_data_00_31 <<
" raw_data_32_63 = 0x" << setw(8) << setfill(
'0') << raw_data_32_63;
87 LogDebug(
"L1T") <<
"Muon hwPt zero. Skip.";
91 if (raw_data_00_31 == 0x505050bc || raw_data_32_63 == 0x505050bc) {
92 edm::LogWarning(
"L1T") <<
"Comma detected in raw data stream. Orbit number: " << block.
amc().getOrbitNumber() <<
", BX ID: " << block.
amc().getBX() <<
", BX: " << bx <<
", linkId: " << linkId <<
", Raw data: 0x" << hex << setw(8) << setfill(
'0') << raw_data_32_63 << setw(8) << setfill(
'0') << raw_data_00_31 <<
dec <<
". Skip.";
106 edm::LogWarning(
"L1T") <<
"Only " << bxPayload.size() <<
" 32 bit words in this BX but " << nWords <<
" are required. Not unpacking the data for BX " << bx <<
".";
const std::vector< uint32_t > & payload() const
const int hwSignValid() const
Get charge sign valid bit (0 - not valid (high pT muon); 1 - valid)
void getBXRange(int nbx, int &first, int &last)
BlockHeader header() const
static const unsigned ptMask_
const int hwQual() const
Get quality code.
static const unsigned ptShift_
bool unpack(const Block &block, UnpackerCollections *coll) override
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
const int hwPhi() const
Get compressed local phi (returned int * 2*pi/576 = local phi in rad)
static unsigned bxzs_enable_shift_
static void fillRegionalMuonCand(RegionalMuonCand &, uint32_t, uint32_t, int, tftype)
void setBXRange(int bxFirst, int bxLast)
BxBlocks getBxBlocks(unsigned int payloadWordsPerBx, bool bxHeader) const
const int hwPt() const
Get compressed pT (returned int * 0.5 = pT (GeV))
#define DEFINE_L1T_UNPACKER(type)
const int hwSign() const
Get charge sign bit (charge = (-1)^(sign))
void amc(const amc::Header &h)
void push_back(int bx, T object)