Project
Loading...
Searching...
No Matches
ChipMappingMFT.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_MFT_CHIPMAPPING_H
13#define ALICEO2_MFT_CHIPMAPPING_H
14
15// \file ChipMappingMFT.h
16// \brief MFT chip <-> module mapping
17
18#include <Rtypes.h>
19#include <array>
20#include <fairlogger/Logger.h>
21#include "Headers/DataHeader.h"
24
25namespace o2
26{
27namespace itsmft
28{
29
31 UShort_t module = 0; // global module ID
32 UChar_t chipOnModule = 0; // chip within the module
33 UChar_t cable = 0; // cable in the connector
34 UChar_t chipOnRU = 0; // chip within the RU (SW)
35 UShort_t globalChipSWID = 0; // global software chip ID
36 UShort_t localChipSWID = 0; // local software chip ID
37 UShort_t localChipHWID = 0; // local hardware chip ID
38 UChar_t connector = 0; // cable connector in a zone
39 UChar_t zone = 0; // read-out zone id
40 UChar_t ruOnLayer = 0; // read-out-unit index on layer
41 UChar_t ruType = 0; // read-out-unit type
42 UChar_t ruSWID = 0; // read-out-unit hardware ID
43 UChar_t ruHWID = 0; // read-out-unit software ID
44 UChar_t layer = 0; // MFT layer
45 UChar_t disk = 0; // MFT disk
46 UChar_t half = 0; // MFT half
48};
49
51 UChar_t layer = 0; // layer id
52 UChar_t nChips = 0; // number of chips
53 UShort_t firstChipID = 0; // global id of 1st chip
54 UChar_t connector = 0; // cable connector in a zone
55 UChar_t zone = 0; // read-out zone id
56 UChar_t disk = 0; // disk id
57 UChar_t half = 0; // half id
59};
60
62{
63 public:
65 ~ChipMappingMFT() = default;
66
67 static constexpr std::string_view getName() { return "MFT"; }
70
71 // RS placeholder for methods to implement ----------->
72
74 static constexpr Int_t getNRUs() { return NRUs; }
75
77 uint8_t FEEId2RUSW(uint16_t hw) const { return mFEEId2RUSW[hw & 0xff]; }
78
80 uint16_t RUSW2FEEId(uint16_t sw, uint16_t linkID = 0) const { return ((linkID << 8) + mRUInfo[sw].idHW); }
81
83 uint16_t composeFEEId(uint16_t layer, uint16_t ruOnLayer, uint16_t link) const
84 {
85 // only one link is used
86 // ruOnLayer is 0, 1, 2, 3 for half = 0
87 // 4, 5, 6, 7 1
88 auto dhalf = std::div(ruOnLayer, 4);
89 uint16_t half = dhalf.quot;
90 uint16_t zone = dhalf.rem;
91 auto ddisk = std::div(layer, 2);
92 uint16_t disk = ddisk.quot;
93 uint16_t plane = layer % 2;
94 return (link << 8) + (half << 6) + (disk << 3) + (plane << 2) + zone;
95 }
96
98 void expandFEEId(uint16_t feeID, uint16_t& layer, uint16_t& ruOnLayer, uint16_t& link) const
99 {
100 link = feeID >> 8;
101 uint16_t half = (feeID >> 6) & 0x1;
102 uint16_t disk = (feeID >> 3) & 0x7;
103 uint16_t plane = (feeID >> 2) & 0x1;
104 uint16_t zone = feeID & 0x3;
105 layer = 2 * disk + plane;
106 ruOnLayer = 4 * half + zone;
107 }
108
110 void expandFEEIdFaceDiskHalf(uint16_t feeID, uint16_t& face, uint16_t& disk, uint16_t& half) const
111 {
112 half = (feeID >> 6) & 0x1;
113 disk = (feeID >> 3) & 0x7;
114 face = (feeID >> 2) & 0x1;
115 }
116
118 const RUInfo* getRUInfoFEEId(Int_t feeID) const { return &mRUInfo[FEEId2RUSW(feeID)]; }
119
121 uint8_t getGBTHeaderRUType(Int_t ruType, Int_t cableHW)
122 {
123 return ((0x1 << 7) + (cableHW & 0x1f));
124 }
125
127 uint8_t cableHW2Pos(uint8_t ruType, uint8_t hwid) const { return mCableHW2Pos[ruType][hwid]; }
128
130 uint8_t cableHW2SW(uint8_t ruType, uint8_t hwid) const { return hwid < mCableHW2SW[ruType].size() ? mCableHW2SW[ruType][hwid] : 0xff; }
131
133 uint8_t cablePos(uint8_t ruType, uint8_t id) const { return mCablePos[ruType][id]; }
134
136 uint16_t getLocalChipID(uint16_t globalID, int cableHW, const RUInfo& ruInfo) const
137 {
139 return 0xffff;
140 }
141
143 uint16_t getGlobalChipID(uint16_t chOnModuleHW, int cableHW, const RUInfo& ruInfo) const
144 {
145 auto chipOnRU = cableHW2SW(ruInfo.ruType, cableHW);
146 return mRUGlobalChipID[(int)(ruInfo.idSW)].at((int)(chipOnRU));
147 }
148
150 int chipModuleIDHW2SW(int ruType, int hwIDinMod) const
151 {
152 return (8 - hwIDinMod);
153 }
154
156 int chipModuleIDSW2HW(int ruType, int swIDinMod) const
157 {
158 return (8 - swIDinMod);
159 }
160
161 static constexpr Int_t getNChips() { return NChips; }
162
163 static constexpr Int_t getNModules() { return NModules; }
164
165 Int_t chipID2Module(Int_t chipID, Int_t& chipOnModule) const
166 {
167 chipOnModule = ChipMappingData[chipID].chipOnModule;
168 return ChipMappingData[chipID].module;
169 }
170
171 Int_t chipID2Module(Int_t chipID) const
172 {
173 return ChipMappingData[chipID].module;
174 }
175
176 Int_t getNChipsInModule(Int_t modID) const
177 {
178 return ModuleMappingData[modID].nChips;
179 }
180
181 Int_t module2ChipID(Int_t modID, Int_t chipOnModule) const
182 {
183 return ModuleMappingData[modID].firstChipID + chipOnModule;
184 }
185
186 Int_t module2Layer(Int_t modID) const
187 {
188 return ModuleMappingData[modID].layer;
189 }
190
191 Int_t chip2Layer(Int_t chipID) const
192 {
193 return ModuleMappingData[ChipMappingData[chipID].module].layer;
194 }
195
197 void imposeFEEId2RUSW(uint16_t, uint16_t) {}
198
200 void getChipInfoSW(Int_t chipSW, ChipInfo& chInfo) const
201 {
202 // ladder (MFT) = module (ITS)
203 UShort_t ladder = ChipMappingData[chipSW].module;
204 UChar_t layer = ModuleMappingData[ladder].layer;
205 UChar_t zone = ModuleMappingData[ladder].zone;
206 UChar_t half = ModuleMappingData[ladder].half;
207
208 chInfo.ruType = ZoneRUType[zone][layer / 2];
209
210 // count RU SW per half layers
211 //chInfo.ru = NLayers * (NZonesPerLayer / 2) * half + (NZonesPerLayer / 2) * layer + zone;
212
213 // count RU SW per full layers
214 chInfo.ru = NZonesPerLayer * layer + (NZonesPerLayer / 2) * half + zone;
215
216 chInfo.id = ChipMappingData[chipSW].chipOnRU;
217 chInfo.chOnRU = getChipOnRUInfo(chInfo.ruType, chInfo.id);
218 }
219
221 Int_t getNChipsOnRUType(Int_t ruType) const { return NChipsOnRUType[ruType]; }
222
225 const ChipOnRUInfo* getChipOnRUInfo(Int_t ruType, Int_t chipOnRU) const
226 {
227 return &mChipsInfo[mChipInfoEntryRU[ruType] + chipOnRU];
228 }
229
230 static constexpr std::int16_t getRUDetectorField() { return 0x0; }
231
232 uint32_t getCablesOnRUType(Int_t ruType) const
233 {
234 uint32_t pattern = 0;
235 for (Int_t i = 0; i < NRUCables; i++) {
236 pattern |= (0x1 << mCableHW2Pos[ruType][i]);
237 }
238 return pattern;
239 }
240
242 const RUInfo* getRUInfoSW(int ruSW) const { return &mRUInfo[ruSW]; }
243
245 int getRUIDSW(int layer, int ruOnLayer) const
246 {
247 int sid = 0;
248 for (int i = 0; i < NLayers; i++) {
249 if (i >= layer) {
250 break;
251 }
252 sid += NZonesPerLayer;
253 }
254 return sid + ruOnLayer;
255 }
256
257 const int getNZonesPerLayer() const { return NZonesPerLayer; }
258 const int getNLayers() const { return NLayers; }
259
261 int getRUType(int zone, int layer) const { return ZoneRUType[zone % 4][layer / 2]; }
262
263 static constexpr int NChips = 936, NLayers = 10, NZonesPerLayer = 2 * 4, NRUTypes = 13;
264
265 const std::array<MFTChipMappingData, NChips>& getChipMappingData() const { return ChipMappingData; }
266
267 const auto& getModuleMappingData() const { return ModuleMappingData; }
268
269 void print() const;
270
272 static constexpr std::array<int, NChips> ChipID2Layer{
273 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6,
296 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
297 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
298 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8,
299 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
300 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,
301 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8,
302 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
303 9, 9, 9, 9, 9, 9};
304
305 static constexpr std::array<int, 280> mLadderIDGeoToRO{
306 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 15,
307 16, 17, 18, 19, 20, 21, 22, 23, 5, 24, 30, 31, 32, 33, 34,
308 35, 36, 37, 38, 25, 26, 27, 28, 39, 40, 41, 42, 43, 44, 45,
309 46, 47, 29, 48, 52, 53, 66, 67, 54, 55, 56, 68, 69, 57, 58,
310 49, 50, 59, 60, 70, 71, 61, 62, 63, 72, 73, 64, 65, 51, 74,
311 75, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 76, 77, 78,
312 79, 80, 81, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 82,
313 83, 106, 107, 114, 115, 132, 133, 116, 117, 118, 119, 120, 134, 135, 121,
314 122, 108, 109, 110, 111, 123, 124, 136, 137, 125, 126, 127, 128, 129, 138,
315 139, 130, 131, 112, 113, 140, 146, 147, 148, 149, 150, 151, 152, 153, 154,
316 141, 142, 143, 144, 155, 156, 157, 158, 159, 160, 161, 162, 163, 145, 164,
317 170, 171, 172, 173, 174, 175, 176, 177, 178, 165, 166, 167, 168, 179, 180,
318 181, 182, 183, 184, 185, 186, 187, 169, 188, 192, 193, 206, 207, 194, 195,
319 196, 208, 209, 197, 198, 189, 190, 199, 200, 210, 211, 201, 202, 203, 212,
320 213, 204, 205, 191, 214, 215, 224, 225, 226, 227, 228, 229, 230, 231, 232,
321 233, 234, 216, 217, 218, 219, 220, 221, 235, 236, 237, 238, 239, 240, 241,
322 242, 243, 244, 245, 222, 223, 246, 247, 254, 255, 272, 273, 256, 257, 258,
323 259, 260, 274, 275, 261, 262, 248, 249, 250, 251, 263, 264, 276, 277, 265,
324 266, 267, 268, 269, 278, 279, 270, 271, 252, 253};
325
326 static constexpr std::array<int, NChips> mChipIDGeoToRO{
327 0, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
328 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 2,
329 3, 4, 5, 6, 7, 8, 9, 39, 40, 41, 42, 43, 44, 45, 46,
330 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
331 62, 63, 64, 65, 10, 11, 66, 67, 78, 79, 80, 81, 82, 83, 84,
332 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
333 100, 101, 102, 103, 104, 68, 69, 70, 71, 72, 73, 74, 75, 105, 106,
334 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
335 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 76, 77, 132, 133, 140,
336 141, 142, 143, 144, 145, 182, 183, 184, 185, 186, 187, 188, 189, 146, 147,
337 148, 149, 150, 151, 152, 153, 154, 190, 191, 192, 193, 194, 195, 196, 197,
338 155, 156, 157, 158, 159, 160, 134, 135, 136, 137, 161, 162, 163, 164, 165,
339 166, 198, 199, 200, 201, 202, 203, 204, 205, 167, 168, 169, 170, 171, 172,
340 173, 174, 175, 206, 207, 208, 209, 210, 211, 212, 213, 176, 177, 178, 179,
341 180, 181, 138, 139, 214, 215, 216, 217, 218, 219, 244, 245, 246, 247, 248,
342 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
343 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
344 279, 280, 281, 282, 283, 284, 285, 286, 287, 220, 221, 222, 223, 224, 225,
345 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 288, 289, 290,
346 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305,
347 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
348 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 238, 239, 240, 241,
349 242, 243, 332, 333, 334, 335, 336, 337, 356, 357, 358, 359, 360, 361, 362,
350 363, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 364, 365, 366, 367,
351 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
352 383, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 384, 385, 386, 387,
353 388, 389, 390, 391, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,
354 349, 392, 393, 394, 395, 396, 397, 398, 399, 448, 449, 450, 451, 452, 453,
355 454, 455, 456, 457, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410,
356 411, 412, 413, 414, 415, 416, 417, 418, 419, 458, 459, 460, 461, 462, 463,
357 464, 465, 466, 467, 420, 421, 422, 423, 424, 425, 426, 427, 350, 351, 352,
358 353, 354, 355, 468, 469, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489,
359 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504,
360 505, 506, 470, 471, 472, 473, 474, 475, 476, 477, 507, 508, 509, 510, 511,
361 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526,
362 527, 528, 529, 530, 531, 532, 533, 478, 479, 534, 535, 546, 547, 548, 549,
363 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564,
364 565, 566, 567, 568, 569, 570, 571, 572, 536, 537, 538, 539, 540, 541, 542,
365 543, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586,
366 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 544, 545,
367 600, 601, 608, 609, 610, 611, 612, 613, 650, 651, 652, 653, 654, 655, 656,
368 657, 614, 615, 616, 617, 618, 619, 620, 621, 622, 658, 659, 660, 661, 662,
369 663, 664, 665, 623, 624, 625, 626, 627, 628, 602, 603, 604, 605, 629, 630,
370 631, 632, 633, 634, 666, 667, 668, 669, 670, 671, 672, 673, 635, 636, 637,
371 638, 639, 640, 641, 642, 643, 674, 675, 676, 677, 678, 679, 680, 681, 644,
372 645, 646, 647, 648, 649, 606, 607, 682, 683, 684, 685, 686, 687, 712, 713,
373 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728,
374 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743,
375 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 688, 689, 690,
376 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705,
377 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770,
378 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785,
379 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 706,
380 707, 708, 709, 710, 711, 800, 801, 802, 803, 804, 805, 824, 825, 826, 827,
381 828, 829, 830, 831, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 832,
382 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847,
383 848, 849, 850, 851, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 852,
384 853, 854, 855, 856, 857, 858, 859, 806, 807, 808, 809, 810, 811, 812, 813,
385 814, 815, 816, 817, 860, 861, 862, 863, 864, 865, 866, 867, 916, 917, 918,
386 919, 920, 921, 922, 923, 924, 925, 868, 869, 870, 871, 872, 873, 874, 875,
387 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 926, 927, 928,
388 929, 930, 931, 932, 933, 934, 935, 888, 889, 890, 891, 892, 893, 894, 895,
389 818, 819, 820, 821, 822, 823};
390
391 private:
392 Int_t invalid() const;
393 static constexpr Int_t NRUs = NLayers * NZonesPerLayer;
394 static constexpr Int_t NModules = 280;
395 static constexpr Int_t NChipsInfo = 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 16 + 17 + 18 + 19 + 14;
396 static constexpr Int_t NChipsPerCable = 1;
397 static constexpr Int_t NLinks = 1;
398 static constexpr Int_t NConnectors = 5;
399 static constexpr Int_t NMaxChipsPerLadder = 5;
400 static constexpr Int_t NRUCables = 25;
401
402 static constexpr Int_t ZoneLadderIDmin[NZonesPerLayer / 2][NLayers]{
403 {0, 21, 0, 21, 0, 23, 0, 28, 0, 29},
404 {3, 18, 3, 18, 3, 20, 4, 24, 5, 25},
405 {6, 15, 6, 15, 6, 17, 8, 20, 9, 21},
406 {9, 12, 9, 12, 9, 13, 12, 16, 13, 17}};
407 static constexpr Int_t ZoneLadderIDmax[NZonesPerLayer / 2][NLayers]{
408 {2, 23, 2, 23, 2, 25, 3, 31, 4, 33},
409 {5, 20, 5, 20, 5, 22, 7, 27, 8, 28},
410 {8, 17, 8, 17, 8, 19, 11, 23, 12, 24},
411 {11, 14, 11, 14, 12, 16, 15, 19, 16, 20}};
412
413 static constexpr Int_t ZoneRUType[NZonesPerLayer / 2][NLayers / 2]{
414 {1, 1, 1, 7, 11},
415 {2, 2, 4, 8, 9},
416 {2, 2, 3, 8, 10},
417 {0, 0, 5, 6, 12}};
418
419 static constexpr Int_t ChipConnectorCable[NConnectors][NMaxChipsPerLadder]{
420 {5, 6, 7, 24, 23},
421 {0, 1, 2, 3, 4},
422 {17, 16, 15, 14, 13},
423 {22, 21, 20, 19, 18},
424 {12, 11, 10, 9, 8}};
425
426 static const std::array<MFTChipMappingData, NChips> ChipMappingData;
427 static const std::array<MFTModuleMappingData, NModules> ModuleMappingData;
428
430 static constexpr std::array<int, NRUTypes> NChipsOnRUType{7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 14};
431
432 // info on chips info within the zone (RU)
433 std::array<ChipOnRUInfo, NChipsInfo> mChipsInfo;
434 Int_t mChipInfoEntryRU[NRUTypes];
435
437 std::array<RUInfo, NRUs> mRUInfo;
438 std::vector<uint8_t> mFEEId2RUSW; // HW RU ID -> SW ID conversion
439
440 std::vector<uint8_t> mCableHW2SW[NRUs];
441 std::vector<uint8_t> mCableHW2Pos[NRUs];
442 std::vector<uint8_t> mCablePos[NRUs];
443 std::vector<uint8_t> mCableHWFirstChip[NRUs];
444
445 std::array<std::vector<uint16_t>, NRUs> mRUGlobalChipID;
446
447 ClassDefNV(ChipMappingMFT, 1)
448};
449} // namespace itsmft
450} // namespace o2
451
452#endif
int32_t i
static constexpr ID MFT
Definition DetID.h:71
static constexpr o2::detectors::DetID::ID getDetID()
uint8_t cablePos(uint8_t ruType, uint8_t id) const
get chipID on module from chip global SW ID, cable SW ID and stave (RU) info
uint8_t cableHW2SW(uint8_t ruType, uint8_t hwid) const
convert cable iterator ID to its position on the ActiveLanes word in the GBT.header for given RU type
static constexpr std::array< int, NChips > mChipIDGeoToRO
static constexpr std::array< int, 280 > mLadderIDGeoToRO
void expandFEEId(uint16_t feeID, uint16_t &layer, uint16_t &ruOnLayer, uint16_t &link) const
decompose FEEid to face, disk, half
static constexpr int NLayers
uint16_t RUSW2FEEId(uint16_t sw, uint16_t linkID=0) const
compose FEEid for given stave (ru) relative to layer and link, see documentation in the constructor
const std::array< MFTChipMappingData, NChips > & getChipMappingData() const
Int_t chip2Layer(Int_t chipID) const
impose user defined FEEId -> ruSW (staveID) conversion, to be used only for forced decoding of corrup...
uint8_t cableHW2Pos(uint8_t ruType, uint8_t hwid) const
convert HW cable ID to SW ID for give RU type
uint32_t getCablesOnRUType(Int_t ruType) const
get info on sw RU
static constexpr Int_t getNModules()
Int_t chipID2Module(Int_t chipID, Int_t &chipOnModule) const
uint8_t getGBTHeaderRUType(Int_t ruType, Int_t cableHW)
convert HW cable ID to its position on the ActiveLanes word in the GBT.header for given RU type
static constexpr Int_t getNChips()
const int getNLayers() const
convert zone number [0...8] and layer number [0...10] to RU type
uint8_t FEEId2RUSW(uint16_t hw) const
get HW id of the RU (software id of the RU)
void print() const
LayerID of each MFT chip.
void expandFEEIdFaceDiskHalf(uint16_t feeID, uint16_t &face, uint16_t &disk, uint16_t &half) const
get info on sw RU
int getRUIDSW(int layer, int ruOnLayer) const
const auto & getModuleMappingData() const
static constexpr std::int16_t getRUDetectorField()
const int getNZonesPerLayer() const
static constexpr int NChips
const RUInfo * getRUInfoSW(int ruSW) const
convert layer ID and RU sequential ID on Layer to absolute RU IDSW
Int_t chipID2Module(Int_t chipID) const
const RUInfo * getRUInfoFEEId(Int_t feeID) const
get number of chips served by single cable on given RU type
Int_t getNChipsOnRUType(Int_t ruType) const
uint16_t composeFEEId(uint16_t layer, uint16_t ruOnLayer, uint16_t link) const
decompose FEEid to layer, stave (ru) relative to layer, link, see documentation in the constructor
uint16_t getLocalChipID(uint16_t globalID, int cableHW, const RUInfo &ruInfo) const
get chip global SW ID from chipID on module, cable SW ID and stave (RU) info
static constexpr std::string_view getName()
void imposeFEEId2RUSW(uint16_t, uint16_t)
extract information about the chip with SW ID
static constexpr o2::header::DataOrigin getOrigin()
int chipModuleIDHW2SW(int ruType, int hwIDinMod) const
convert SW id of chip in the module to HW ID
const ChipOnRUInfo * getChipOnRUInfo(Int_t ruType, Int_t chipOnRU) const
static constexpr int NZonesPerLayer
int chipModuleIDSW2HW(int ruType, int swIDinMod) const
Int_t module2Layer(Int_t modID) const
static constexpr Int_t getNRUs()
< total number of RUs
Int_t getNChipsInModule(Int_t modID) const
static constexpr std::array< int, NChips > ChipID2Layer
uint16_t getGlobalChipID(uint16_t chOnModuleHW, int cableHW, const RUInfo &ruInfo) const
convert HW id of chip in the module to SW ID (sequential ID on the module)
void getChipInfoSW(Int_t chipSW, ChipInfo &chInfo) const
get number of chips served by RU of given type (i.e. RU type for ITS)
static constexpr int NRUTypes
Int_t module2ChipID(Int_t modID, Int_t chipOnModule) const
int getRUType(int zone, int layer) const
GLenum GLuint GLint GLenum face
Definition glcorearb.h:3184
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLuint id
Definition glcorearb.h:650
constexpr o2::header::DataOrigin gDataOriginMFT
Definition DataHeader.h:572
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::uint16_t id
Definition RUInfo.h:62
const ChipOnRUInfo * chOnRU
Definition RUInfo.h:59
std::uint16_t ru
Definition RUInfo.h:63
std::uint16_t ruType
Definition RUInfo.h:64
ClassDefNV(MFTChipMappingData, 1)
ClassDefNV(MFTModuleMappingData, 1)
uint16_t idSW
Definition RUInfo.h:31
uint8_t ruType
Definition RUInfo.h:35
TStopwatch sw
std::array< uint16_t, 5 > pattern