23 int nBX, firstBX, lastBX;
42 LogDebug(
"L1T") <<
"nBX = " << nBX <<
" first BX = " << firstBX <<
" lastBX = " << lastBX;
46 for (
const auto& bxBlock : bxBlocks) {
48 const auto bx = bxBlock.header().getBx();
49 if (bx < firstBX || bx > lastBX) {
51 <<
"Corrupt RAW data from FED " <<
fed_ <<
", AMC " << block.
amc().getAMCNumber() <<
". BX number " <<
bx
52 <<
" in BX header is outside of the BX range [" << firstBX <<
"," << lastBX
53 <<
"] defined in the block header.";
61 const std::vector<uint32_t>&
payload,
63 unsigned int startIdx) {
64 unsigned int i = startIdx + 2;
66 if (startIdx +
nWords_ <= payload.size()) {
76 unsigned linkID{(blockID - link_offset) / 2};
89 }
else if (linkID == 1) {
97 for (
unsigned nWord = 2; nWord <
nWords_; nWord += 2) {
98 uint32_t raw_data_spare = payload[startIdx + 1];
99 uint32_t raw_data_00_31 = payload[i++];
100 uint32_t raw_data_32_63 = payload[i++];
101 LogDebug(
"L1T") <<
"raw_data_spare = 0x" << hex << raw_data_spare <<
" raw_data_00_31 = 0x" << raw_data_00_31
102 <<
" raw_data_32_63 = 0x" << raw_data_32_63;
105 LogDebug(
"L1T") <<
"Muon hwPt zero. Skip.";
112 mu, raw_data_spare, raw_data_00_31, raw_data_32_63,
fed_,
getAlgoVersion(), nWord / 2);
114 LogDebug(
"L1T") <<
"Mu" << nWord / 2 <<
": eta " << mu.
hwEta() <<
" phi " << mu.
hwPhi() <<
" pT " << mu.
hwPt()
122 <<
" are required. Not unpacking the data for BX " << bx <<
".";
constexpr int32_t ceil(float num)
const std::vector< uint32_t > & payload() const
unsigned int getAlgoVersion()
void unpackBx(int bx, const std::vector< uint32_t > &payload, unsigned int blockID, unsigned int startIdx=0)
void getBXRange(int nbx, int &first, int &last)
BlockHeader header() const
static constexpr unsigned bxzs_enable_shift_
static constexpr unsigned nWords_
bool isEmpty(int bx) const
void setOneTightInTime(const bool bit)
void setOneNominalInTime(const bool bit)
bool unpack(const Block &block, UnpackerCollections *coll) override
MuonShowerBxCollection * muonShowerCollection_
static constexpr unsigned ptShift_
MuonBxCollection * muonCollection_
void setBXRange(int bxFirst, int bxLast)
void erase(int bx, unsigned i)
BxBlocks getBxBlocks(unsigned int payloadWordsPerBx, bool bxHeader) const
static void fillMuon(Muon &mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fed, unsigned int fw, int muInBx)
#define DEFINE_L1T_UNPACKER(type)
Log< level::Warning, false > LogWarning
static bool showerFired(uint32_t shower_word, int fedId, unsigned int fwId)
void amc(const amc::Header &h)
int hwChargeValid() const
static constexpr unsigned ptMask_
void push_back(int bx, T object)
const T & at(int bx, unsigned i) const