11 unsigned int blockId =
block.header().getID();
12 LogDebug(
"L1T") <<
"Block ID = " << blockId <<
" size = " <<
block.header().getSize();
15 if (
block.header().getSize() < 1) {
34 unsigned int linkId = blockId / 2;
39 if (linkId > 47 && linkId < 60) {
40 regionalMuonCollection =
static_cast<GMTCollections*
>(coll)->getRegionalMuonCandsBMTF();
41 regionalMuonShowerCollection =
44 processor = linkId - 48;
45 }
else if (linkId > 41 && linkId < 66) {
46 regionalMuonCollection =
static_cast<GMTCollections*
>(coll)->getRegionalMuonCandsOMTF();
47 regionalMuonShowerCollection =
51 processor = linkId - 42;
54 processor = linkId - 60;
56 }
else if (linkId > 35 && linkId < 72) {
57 regionalMuonCollection =
static_cast<GMTCollections*
>(coll)->getRegionalMuonCandsEMTF();
58 regionalMuonShowerCollection =
static_cast<GMTCollections*
>(coll)->getRegionalMuonShowersEMTF();
61 processor = linkId - 36;
64 processor = linkId - 66;
67 edm::LogError(
"L1T") <<
"No TF muon expected for link " << linkId;
77 for (
const auto& bxBlock : bxBlocks) {
79 const auto bx = bxBlock.header().getBx();
80 if (bx < firstBX || bx >
lastBX) {
81 throw cms::Exception(
"CorruptData") <<
"Corrupt RAW data from AMC " <<
block.amc().getAMCNumber()
82 <<
". BX number " <<
bx <<
" in BX header is outside of the BX range [" 83 <<
firstBX <<
"," <<
lastBX <<
"] defined in the block header.";
86 auto bxPayload = bxBlock.payload();
87 if (
nWords_ <= bxPayload.size()) {
88 for (
unsigned nWord = 0; nWord <
nWords_; nWord += 2) {
89 uint32_t raw_data_00_31 = bxPayload[nWord];
90 uint32_t raw_data_32_63 = bxPayload[nWord + 1];
91 LogDebug(
"L1T") <<
"raw_data_00_31 = 0x" << hex << setw(8) << setfill(
'0') << raw_data_00_31
92 <<
" raw_data_32_63 = 0x" << setw(8) << setfill(
'0') << raw_data_32_63;
96 LogDebug(
"L1T") <<
"Muon hwPt zero. Skip.";
100 if (raw_data_00_31 == 0x505050bc || raw_data_32_63 == 0x505050bc) {
101 edm::LogWarning(
"L1T") <<
"Comma detected in raw data stream. Orbit number: " 102 <<
block.amc().getOrbitNumber() <<
", BX ID: " <<
block.amc().getBX()
103 <<
", BX: " <<
bx <<
", linkId: " << linkId <<
", Raw data: 0x" << hex << setw(8)
104 << setfill(
'0') << raw_data_32_63 << setw(8) << setfill(
'0') << raw_data_00_31
110 mu.setMuIdx(nWord / 2);
115 LogDebug(
"L1T") <<
"Mu" << nWord / 2 <<
": eta " <<
mu.hwEta() <<
" phi " <<
mu.hwPhi() <<
" pT " 116 <<
mu.hwPt() <<
" qual " <<
mu.hwQual() <<
" sign " <<
mu.hwSign() <<
" sign valid " 117 <<
mu.hwSignValid() <<
" unconstrained pT " <<
mu.hwPtUnconstrained();
125 regionalMuonShowerCollection->
push_back(
bx, muShower);
131 <<
" are required. Not unpacking the data for BX " <<
bx <<
".";
constexpr int32_t ceil(float num)
void getBXRange(int nbx, int &first, int &last)
Log< level::Error, false > LogError
static constexpr unsigned nWords_
bool useEmtfDisplacementInfo_
bool unpack(const Block &block, UnpackerCollections *coll) override
bool useEmtfLooseShowers_
static constexpr unsigned ptShift_
static bool fillRegionalMuonShower(RegionalMuonShower &muShower, std::vector< uint32_t > bxPayload, int proc, tftype tf, bool useEmtfNominalTightShowers, bool useEmtfLooseShowers)
static constexpr unsigned ptMask_
BXVector< RegionalMuonShower > RegionalMuonShowerBxCollection
void setBXRange(int bxFirst, int bxLast)
bool useEmtfNominalTightShowers_
#define DEFINE_L1T_UNPACKER(type)
Log< level::Warning, false > LogWarning
static void fillRegionalMuonCand(RegionalMuonCand &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKbmtf, bool useEmtfDisplacementInfo)
void push_back(int bx, T object)
static constexpr unsigned bxzs_enable_shift_