Skip to content

Commit 3ee5c9f

Browse files
mcoquet642Maurice Coquet
andauthored
[MFT] Fixing number of links per RU/zone in mapping (#15410)
Co-authored-by: Maurice Coquet <mcoquet@alicecerno2.cern.ch>
1 parent 2f52be1 commit 3ee5c9f

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ChipMappingMFT.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,15 @@ class ChipMappingMFT
7373
///< total number of RUs
7474
static constexpr Int_t getNRUs() { return NRUs; }
7575

76-
///< get FEEId of the RU (software id of the RU), read via given link
76+
///< get software id of the RU, from first 8 bits of FEEID (HW id of RU)
7777
uint8_t FEEId2RUSW(uint16_t hw) const { return mFEEId2RUSW[hw & 0xff]; }
7878

79-
///< get HW id of the RU (software id of the RU)
79+
///< get FEEID, from software id of the RU and link number
8080
uint16_t RUSW2FEEId(uint16_t sw, uint16_t linkID = 0) const { return ((linkID << 8) + mRUInfo[sw].idHW); }
8181

8282
///< compose FEEid for given stave (ru) relative to layer and link, see documentation in the constructor
8383
uint16_t composeFEEId(uint16_t layer, uint16_t ruOnLayer, uint16_t link) const
8484
{
85-
// only one link is used
8685
// ruOnLayer is 0, 1, 2, 3 for half = 0
8786
// 4, 5, 6, 7 1
8887
auto dhalf = std::div(ruOnLayer, 4);
@@ -114,7 +113,7 @@ class ChipMappingMFT
114113
face = (feeID >> 2) & 0x1;
115114
}
116115

117-
///< get info on sw RU
116+
///< get info on sw RU corresponding to given FEEID
118117
const RUInfo* getRUInfoFEEId(Int_t feeID) const { return &mRUInfo[FEEId2RUSW(feeID)]; }
119118

120119
///< get number of chips served by single cable on given RU type
@@ -123,13 +122,13 @@ class ChipMappingMFT
123122
return ((0x1 << 7) + (cableHW & 0x1f));
124123
}
125124

126-
///< convert HW cable ID to its position on the ActiveLanes word in the GBT.header for given RU type
125+
///< convert HW cable ID to its position on the ActiveLanes word in the GBT.header for given RU type (note: this position is equal to the HW cable ID)
127126
uint8_t cableHW2Pos(uint8_t ruType, uint8_t hwid) const { return mCableHW2Pos[ruType][hwid]; }
128127

129128
///< convert HW cable ID to SW ID for give RU type
130129
uint8_t cableHW2SW(uint8_t ruType, uint8_t hwid) const { return hwid < mCableHW2SW[ruType].size() ? mCableHW2SW[ruType][hwid] : 0xff; }
131130

132-
///< convert cable iterator ID to its position on the ActiveLanes word in the GBT.header for given RU type
131+
///< convert cable iterator ID (i.e. chipOnModule) to its position on the ActiveLanes word in the GBT.header for given RU type (note: this position is equal to the HW cable ID)
133132
uint8_t cablePos(uint8_t ruType, uint8_t id) const { return mCablePos[ruType][id]; }
134133

135134
///< get chipID on module from chip global SW ID, cable SW ID and stave (RU) info
@@ -139,7 +138,7 @@ class ChipMappingMFT
139138
return 0xffff;
140139
}
141140

142-
///< get chip global SW ID from chipID on module, cable SW ID and stave (RU) info
141+
///< get chip global SW ID from cable HW ID and stave (RU) info (note: chOnModuleHW is unused)
143142
uint16_t getGlobalChipID(uint16_t chOnModuleHW, int cableHW, const RUInfo& ruInfo) const
144143
{
145144
auto chipOnRU = cableHW2SW(ruInfo.ruType, cableHW);
@@ -393,11 +392,11 @@ class ChipMappingMFT
393392

394393
private:
395394
Int_t invalid() const;
396-
static constexpr Int_t NRUs = NLayers * NZonesPerLayer;
395+
static constexpr Int_t NRUs = NLayers * NZonesPerLayer; // 10 layers * 8 zones per layer
397396
static constexpr Int_t NModules = 280;
398397
static constexpr Int_t NChipsInfo = 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 16 + 17 + 18 + 19 + 14;
399398
static constexpr Int_t NChipsPerCable = 1;
400-
static constexpr Int_t NLinks = 1;
399+
static constexpr Int_t NLinks = 3;
401400
static constexpr Int_t NConnectors = 5;
402401
static constexpr Int_t NMaxChipsPerLadder = 5;
403402
static constexpr Int_t NRUCables = 25;

Detectors/ITSMFT/common/reconstruction/src/ChipMappingMFT.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ ChipMappingMFT::ChipMappingMFT()
16241624
{
16251625
// init chips info
16261626

1627-
uint32_t maxRUHW = composeFEEId(NLayers - 1, NZonesPerLayer - 1, NLinks - 1); // Max possible FEE ID
1627+
uint32_t maxRUHW = composeFEEId(NLayers - 1, NZonesPerLayer - 1, 0); // Max possible RU HW ID (first 8 bits of max FEEID, while link stored in 9th and 10th bit of FEEID)
16281628
mFEEId2RUSW.resize(maxRUHW + 1, 0xff);
16291629

16301630
int curLayer = -1, curZone = -1, curHalf = -1;
@@ -1698,8 +1698,8 @@ ChipMappingMFT::ChipMappingMFT()
16981698
auto& ruInfo = mRUInfo[ctrRU];
16991699
ruInfo.idSW = ctrRU++;
17001700

1701-
// map FEEIds (RU read out by at most 3 GBT links) to SW ID
1702-
ruInfo.idHW = composeFEEId(iLayer, iZone, 0); // FEEId for link 0
1701+
// map RU HW ID (RU read out by at most 3 GBT links) to SW ID
1702+
ruInfo.idHW = composeFEEId(iLayer, iZone, 0); // RU HW ID (first 8 bits of FEEID)
17031703
mFEEId2RUSW[ruInfo.idHW] = ruInfo.idSW;
17041704
ruInfo.layer = iLayer;
17051705
ruInfo.ruType = ZoneRUType[iZone % 4][iLayer / 2];

0 commit comments

Comments
 (0)