10 LogDebug(
"L1T") <<
"AMCNo " <<
block.amc().getAMCNumber() <<
" Block ID = " <<
block.header().getID()
11 <<
" size = " <<
block.header().getSize();
15 unsigned int wdPerBX = 6;
16 unsigned int initialBlkID = 33;
17 unsigned int intermBlkID = 39;
18 unsigned int finalBlkID = 45;
21 unsigned int uGTBoard =
block.amc().getAMCNumber() - 1;
44 if (
block.header().getID() == initialBlkID && uGTBoard == 0) {
45 LogDebug(
"L1T") <<
"Creating GT Algorithm Block for BX =" <<
bx << std::endl;
47 res_->push_back(
bx, talg);
50 else if (res_->isEmpty(
bx))
52 <<
"The GlobalAlgBlk unpacker result vector is empty, but is not receiving the first expected header " 53 "ID! This may be due to corrupted, or poorly formatted events.\n" 54 <<
"uGTBoard: " << uGTBoard <<
"\nBX: " <<
bx <<
"\nFirst expected block: " << initialBlkID
55 <<
"\nReceived block: " <<
block.header().getID();
64 int algOffset = (
block.header().getID() - initialBlkID + 1) / 2;
65 algOffset = (algOffset % 3) * 192;
67 for (
unsigned int wd = 0; wd < wdPerBX; wd++) {
68 uint32_t raw_data =
block.payload()[wd +
numBX * wdPerBX];
69 LogDebug(
"L1T") <<
"BX " <<
bx <<
" payload word " << wd <<
" 0x" << hex << raw_data <<
" offset=" <<
dec 70 << algOffset << std::endl;
73 if ((
block.header().getID() != initialBlkID + 4 &&
block.header().getID() != intermBlkID + 4 &&
74 block.header().getID() != finalBlkID + 4) ||
76 for (
unsigned int bt = 0; bt < 32; bt++) {
77 int val = ((raw_data >> bt) & 0x1);
78 unsigned int algBit = bt + wd * 32 + algOffset;
81 LogDebug(
"L1T") <<
"Found valid alg bit (" << algBit <<
") on bit (" << bt <<
") word (" << wd
82 <<
") algOffset (" << algOffset <<
") block ID (" <<
block.header().getID() <<
")" 83 <<
" Board# " << uGTBoard << std::endl;
84 if (
block.header().getID() < initialBlkID + 5) {
86 }
else if (
block.header().getID() < intermBlkID + 5) {
91 }
else if (
val == 1) {
92 LogDebug(
"L1T") <<
"Found invalid alg bit (" << algBit <<
") out of range on bit (" << bt <<
") word (" 93 << wd <<
") algOffset (" << algOffset <<
") block ID (" <<
block.header().getID() <<
")" 98 }
else if (
block.header().getID() == initialBlkID + 4 && (wd == 4 || wd == 5)) {
106 }
else if (
block.header().getID() == finalBlkID + 4 && wd == 4) {
108 if ((raw_data & 0x100) >> 8)
110 if ((raw_data & 0x1) >> 0)
112 LogDebug(
"L1T") <<
" Packing the FinalOR " << wd <<
" 0x" << hex << raw_data << endl;
113 }
else if (
block.header().getID() == finalBlkID + 4 && wd == 5) {
116 LogDebug(
"L1T") <<
" Packing the Prescale Column " << wd <<
" 0x" << hex << raw_data << endl;
125 res_->set(
bx, 0, alg);
constexpr int32_t ceil(float num)
void setL1MenuUUID(int uuid)
set simple members
void setFinalORPreVeto(bool fOR)
void setAlgoDecisionInitial(unsigned int bit, bool val)
Set decision bits.
const bool getFinalORPreVeto() const
static const unsigned int numBX
const bool getFinalORVeto() const
void setAlgoDecisionInterm(unsigned int bit, bool val)
void setFinalOR(bool fOR)
void setFinalORVeto(bool fOR)
void setL1FirmwareUUID(int fuuid)
#define DEFINE_L1T_UNPACKER(type)
static constexpr unsigned int maxPhysicsTriggers
void setPreScColumn(int psC)
bool unpack(const Block &block, UnpackerCollections *coll) override
void setAlgoDecisionFinal(unsigned int bit, bool val)