14 if (linkNo >= 0 && linkNo < 6)
16 else if (linkNo >= 8 && linkNo < 14)
18 else if (linkNo >= 16 && linkNo < 22)
20 else if (linkNo >= 22 && linkNo < 28)
22 else if ( (linkNo >= 28 && linkNo < 30) || (linkNo >= 32 && linkNo < 36))
42 unsigned int ownLinks[] = {4,5,12,13,20,21,22,23,28,29};
46 for (
int i = 0;
i < 10;
i++)
72 bxBlocks = block.
getBxBlocks((
unsigned int)6,
true);
74 bxBlocks = block.
getBxBlocks((
unsigned int)6,
false);
77 for(
auto ibx : bxBlocks)
80 int bxNum = ibx.header().getBx();
81 uint32_t inputWords[ibx.getSize()];
84 for(
unsigned int iw = 0; iw < ibx.getSize(); iw++)
85 inputWords[iw] = (ibx.payload())[iw];
87 int wheel, sector, trTag;
89 sector = block.
amc().getBoardID() - 1;
92 if ( sector < 0 || sector > 11 )
94 edm::LogInfo (
"l1t:stage2::BMTFUnpackerInputs::unpack") <<
"Sector found out of range so it will be calculated by the slot number";
95 if ( block.
amc().getAMCNumber()%2 != 0 )
96 sector = block.
amc().getAMCNumber()/2 ;
98 sector = 6 + (block.
amc().getAMCNumber()/2 -1);
101 int mbPhi[4], mbPhiB[4], mbQual[4], mbBxC[4], mbRPC[4];
104 for (
int iw = 0; iw < 4; iw++)
106 if ( ((inputWords[iw] & 0xfffffff) == 0) || (inputWords[iw] == 0x505050bc) )
108 else if ( (inputWords[iw] != 0x505050bc) && (inputWords[iw+2] == 0x505050bc) )
112 if ( ((inputWords[iw] >> 11) & 0x1) == 1 )
113 mbPhi[iw] = (inputWords[iw] & 0x7FF ) - 2048;
115 mbPhi[iw] = (inputWords[iw] & 0xFFF );
118 if ( ((inputWords[iw] >> 21) & 0x1) == 1 )
119 mbPhiB[iw] = ( (inputWords[iw] >> 12) & 0x1FF ) - 512;
121 mbPhiB[iw] = (inputWords[iw] >> 12) & 0x3FF;
123 mbQual[iw] = (inputWords[iw] >> 22) & 0x7;
124 mbRPC[iw] = (inputWords[iw] >> 26) & 0
x1;
125 mbBxC[iw] = (inputWords[iw] >> 30) & 0x3;
131 phiData.push_back(
L1MuDTChambPhDigi( bxNum, wheel, sector, iw+1, mbPhi[iw], mbPhiB[iw], mbQual[iw], trTag, mbBxC[iw], mbRPC[iw] ) );
138 for (
int i = 0;
i < 3;
i++)
141 for(
int j=0; j<7; j++)
143 etaHits[
i][j] = (inputWords[4] >> (
i*7 + j)) & 0x1;
144 if ( etaHits[
i][j]!=0 )
152 for (
int i = 0;
i < 3;
i++)
167 linkAndQual_.
linkNo = blockId/2;
168 std::copy(&etaHits[0][0], &etaHits[0][0]+3*7,&linkAndQual_.
hits[0][0]);
The_Container const * getContainer() const
bool unpacking(const Block &block, UnpackerCollections *coll, qualityHits &linkAndQual_, const bool &isNewFw)
const std::vector< uint32_t > & payload() const
BlockHeader header() const
bool checkQual(const unsigned int &value, const bool &isNewFw)
std::vector< L1MuDTChambPhDigi > Phi_Container
std::vector< L1MuDTChambThDigi > The_Container
void setContainer(const The_Container &inputSegments)
std::vector< BxBlock > BxBlocks
void setContainer(const Phi_Container &inputSegments)
Phi_Container const * getContainer() const
BxBlocks getBxBlocks(unsigned int payloadWordsPerBx, bool bxHeader) const
#define DEFINE_L1T_UNPACKER(type)
void amc(const amc::Header &h)
void numWheelSectorTrTag(int &wheelNo, int &tagSegID, int linkNo, int amcNo)