42 unsigned int ownLinks[] = {4,5,12,13,20,21,22,23,28,29};
46 for (
int i = 0;
i < 10;
i++)
48 if (
block.header().getID()/2 == ownLinks[
i])
56 unsigned int blockId =
block.header().getID();
57 LogDebug(
"L1T") <<
"Block ID: " << blockId <<
" size: " <<
block.header().getSize();
69 bool ZS_enabled = (
bool)((
block.header().getFlags() >> 1) & 0x01);
71 bxBlocks =
block.getBxBlocks((
unsigned int)6,
true);
73 bxBlocks =
block.getBxBlocks((
unsigned int)6,
false);
76 for(
auto ibx : bxBlocks)
79 int bxNum = ibx.header().getBx();
80 uint32_t inputWords[ibx.getSize()];
87 for(
unsigned int iw = 0; iw < ibx.getSize(); iw++)
88 inputWords[iw] = (ibx.payload())[iw];
91 int wheel, sector, trTag;
93 sector =
block.amc().getBoardID() - 1;
96 if ( sector < 0 || sector > 11 )
98 edm::LogInfo (
"l1t:stage2::BMTFUnpackerInputs::unpack") <<
"Sector found out of range so it will be calculated by the slot number";
99 if (
block.amc().getAMCNumber()%2 != 0 )
100 sector =
block.amc().getAMCNumber()/2 ;
102 sector = 6 + (
block.amc().getAMCNumber()/2 -1);
105 int mbPhi[4], mbPhiB[4], mbQual[4], mbBxC[4], mbRPC[4];
108 for (
int iw = 0; iw < 4; iw++)
110 if ( ((inputWords[iw] & 0xfffffff) == 0) || (inputWords[iw] == 0x505050bc) )
112 else if ( (inputWords[iw] != 0x505050bc) && (inputWords[iw+2] == 0x505050bc) )
116 if ( ((inputWords[iw] >> 11) & 0x1) == 1 )
117 mbPhi[iw] = (inputWords[iw] & 0x7FF ) - 2048;
119 mbPhi[iw] = (inputWords[iw] & 0xFFF );
122 if ( ((inputWords[iw] >> 21) & 0x1) == 1 )
123 mbPhiB[iw] = ( (inputWords[iw] >> 12) & 0x1FF ) - 512;
125 mbPhiB[iw] = (inputWords[iw] >> 12) & 0x3FF;
127 mbQual[iw] = (inputWords[iw] >> 22) & 0x7;
128 mbRPC[iw] = (inputWords[iw] >> 26) & 0
x1;
129 mbBxC[iw] = (inputWords[iw] >> 30) & 0x3;
135 phiData.push_back(
L1MuDTChambPhDigi( bxNum, wheel, sector, iw+1, mbPhi[iw], mbPhiB[iw], mbQual[iw], trTag, mbBxC[iw], mbRPC[iw] ) );
142 for (
int i = 0;
i < 3;
i++)
145 for(
int j=0; j<7; j++)
147 etaHits[
i][j] = (inputWords[4] >> (
i*7 + j)) & 0x1;
148 if ( etaHits[
i][j]!=0 )
156 for (
int i = 0;
i < 3;
i++)
159 theData.push_back(
L1MuDTChambThDigi( bxNum, wheel, sector, i+1, etaHits[i], linkAndQual_.hits[i]) );
171 linkAndQual_.linkNo = blockId/2;
172 std::copy(&etaHits[0][0], &etaHits[0][0]+3*7,&linkAndQual_.hits[0][0]);
The_Container const * getContainer() const
bool checkQual_bmtf(const unsigned int &value, const bool &isNewFw)
void setContainer(Phi_Container inputSegments)
std::vector< L1MuDTChambPhDigi > Phi_Container
std::vector< L1MuDTChambThDigi > The_Container
std::vector< BxBlock > BxBlocks
void setContainer(The_Container inputSegments)
Phi_Container const * getContainer() const
void numWheelSectorTrTag_bmtf(int &wheelNo, int &tagSegID, int linkNo, int amcNo)