@@ -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 ;
0 commit comments