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++)
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++)
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)
BlockHeader header() const
std::vector< L1MuDTChambPhDigi > Phi_Container
std::vector< L1MuDTChambThDigi > The_Container
bool unpacking_bmtf(const Block &block, UnpackerCollections *coll, qualityHits &linkAndQual_, const bool &isNewFw)
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 numWheelSectorTrTag_bmtf(int &wheelNo, int &tagSegID, int linkNo, int amcNo)
void amc(const amc::Header &h)