16 if (linkNo >= 0 && linkNo < 6)
18 else if (linkNo >= 8 && linkNo < 14)
20 else if (linkNo >= 16 && linkNo < 22)
22 else if (linkNo >= 22 && linkNo < 28)
24 else if ( (linkNo >= 28 && linkNo < 30) || (linkNo >= 32 && linkNo < 36))
44 unsigned int ownLinks[] = {4,5,12,13,20,21,22,23,28,29};
46 for (
int i = 0;
i < 10;
i++)
57 int nBX, firstBX, lastBX;
62 LogDebug(
"L1T") <<
"BX override. Set firstBX = lastBX = 0";
71 for(
int ibx = firstBX; ibx <= lastBX; ibx++)
75 for(
unsigned int iw = 0; iw < block.
header().
getSize()/nBX; iw++)
76 inputWords[iw] = payload[iw+(ibx+lastBX)*6];
78 int wheel, sector, trTag;
80 sector = block.
amc().getBoardID() - 1;
81 if ( sector < 0 || sector > 11 )
83 edm::LogInfo (
"l1t:stage2::BMTFUnpackerInputs::unpack") <<
"Sector found out of range so it will be calculated by the slot number";
84 if ( block.
amc().getAMCNumber()%2 != 0 )
85 sector = block.
amc().getAMCNumber()/2 ;
87 sector = 6 + (block.
amc().getAMCNumber()/2 -1);
90 int mbPhi[4], mbPhiB[4], mbQual[4], mbBxC[4], mbRPC[4];
93 for (
int iw = 0; iw < 4; iw++)
95 if ( ((inputWords[iw] & 0xfffffff) == 0) || (inputWords[iw] == 0x505050bc) )
97 else if ( (inputWords[iw] != 0x505050bc) && (inputWords[iw+2] == 0x505050bc) )
101 if ( ((inputWords[iw] >> 11) & 0x1) == 1 )
102 mbPhi[iw] = (inputWords[iw] & 0x7FF ) - 2048;
104 mbPhi[iw] = (inputWords[iw] & 0xFFF );
107 if ( ((inputWords[iw] >> 21) & 0x1) == 1 )
108 mbPhiB[iw] = ( (inputWords[iw] >> 12) & 0x1FF ) - 512;
110 mbPhiB[iw] = (inputWords[iw] >> 12) & 0x3FF;
112 mbQual[iw] = (inputWords[iw] >> 22) & 0x7;
113 mbRPC[iw] = (inputWords[iw] >> 26) & 0x1;
114 mbBxC[iw] = (inputWords[iw] >> 30) & 0x3;
120 phiData.push_back(
L1MuDTChambPhDigi( ibx, wheel, sector, iw+1, mbPhi[iw], mbPhiB[iw], mbQual[iw], trTag, mbBxC[iw], mbRPC[iw] ) );
126 for (
int i = 0;
i < 3;
i++)
129 for(
int j=0;
j<7;
j++)
131 etaHits[
i][
j] = (inputWords[4] >> (
i*7 +
j)) & 0x1;
132 if ( etaHits[
i][
j]!=0 )
138 for (
int i = 0;
i < 3;
i++)
141 theData.push_back(
L1MuDTChambThDigi( ibx, wheel, sector, i+1, etaHits[i], linkAndQual_[blockId/2 - 1].hits[i]) );
149 std::copy(&etaHits[0][0], &etaHits[0][0]+3*7,&temp.
hits[0][0]);
150 linkAndQual_[blockId/2] =
temp;
The_Container const * getContainer() const
bool unpacking(const Block &block, UnpackerCollections *coll, std::map< int, qualityHits > &linkAndQual_, const bool &isNewFw)
void getBXRange(int nbx, int &first, int &last)
BlockHeader header() const
bool checkQual(const unsigned int &value, const bool &isNewFw)
std::vector< uint32_t > payload() const
std::vector< L1MuDTChambPhDigi > Phi_Container
std::vector< L1MuDTChambThDigi > The_Container
void setContainer(const The_Container &inputSegments)
void setContainer(const Phi_Container &inputSegments)
Phi_Container const * getContainer() const
#define DEFINE_L1T_UNPACKER(type)
void amc(const amc::Header &h)
void numWheelSectorTrTag(int &wheelNo, int &tagSegID, int linkNo, int amcNo)