27 unsigned int wdPerBX = 6;
28 unsigned int initialBlkID = 33;
29 unsigned int intermBlkID = 39;
30 unsigned int finalBlkID = 45;
35 int firstBX = -(ceil((
double)nBX/2.)-1);
38 lastBX = ceil((
double)nBX/2.);
40 lastBX = ceil((
double)nBX/2.)-1;
44 res_->setBXRange(firstBX, lastBX);
46 LogDebug(
"L1T") <<
"nBX = " << nBX <<
" first BX = " << firstBX <<
" lastBX = " << lastBX << endl;
50 for (
int bx=firstBX; bx<=lastBX; bx++){
56 LogDebug(
"L1T") <<
"Creating GT Algorithm Block for BX =" << bx;
58 res_->push_back(bx,talg);
69 int algOffset = (block.
header().
getID() - initialBlkID + 1)/2;
70 algOffset = (algOffset%3)*192;
72 for(
unsigned int wd=0; wd<wdPerBX; wd++) {
73 uint32_t raw_data = block.
payload()[wd+numBX*wdPerBX];
74 LogDebug(
"L1T") <<
"BX "<<bx <<
" payload word " << wd <<
" 0x" << hex << raw_data <<
" offset=" <<
dec << algOffset << std::endl;
78 for(
unsigned int bt=0; bt<32; bt++) {
79 int val = ((raw_data >> bt) & 0x1);
80 unsigned int algBit = bt+wd*32+algOffset;
82 LogDebug(
"L1T") <<
"Found valid alg bit ("<< algBit <<
") on bit ("<<bt<<
") word ("<<wd<<
") algOffset ("<<algOffset<<
") block ID ("<< block.
header().
getID() <<
")" <<std::endl;
91 LogDebug(
"L1T") <<
"Found invalid alg bit ("<< algBit <<
") out of range (128) on bit ("<<bt<<
") word ("<<wd<<
") algOffset ("<<algOffset<<
") block ID ("<< block.
header().
getID() <<
")" <<std::endl;
95 }
else if(block.
header().
getID()==initialBlkID+4 && (wd==4 || wd==5) ) {
101 }
else if(block.
header().
getID()==finalBlkID+4 && wd==4) {
103 if ( (raw_data & 0x10000)>>16 ) alg.
setFinalOR(
true);
106 LogDebug(
"L1T") <<
" Packing the FinalOR " << wd <<
" 0x" << hex << raw_data << endl;
107 }
else if(block.
header().
getID()==finalBlkID+4 && wd==5) {
110 LogDebug(
"L1T") <<
" Packing the Prescale Column " << wd <<
" 0x" << hex << raw_data << endl;
void setL1MenuUUID(int uuid)
set simple members
void setFinalORPreVeto(bool fOR)
void setAlgoDecisionInitial(unsigned int bit, bool val)
Set decision bits.
BlockHeader header() const
static const unsigned int numBX
std::vector< uint32_t > payload() const
static const unsigned int maxPhysicsTriggers
#define DEFINE_L1T_UNPACKER(type)
void setAlgoDecisionInterm(unsigned int bit, bool val)
void setFinalOR(bool fOR)
void setFinalORVeto(bool fOR)
void setL1FirmwareUUID(int fuuid)
void setPreScColumn(int psC)
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
void setAlgoDecisionFinal(unsigned int bit, bool val)