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
270 std::vector<uint16_t> getLayer2FEEIDs(int lr);
271
272 void print() const;
273
275 static constexpr std::array<int, NChips> ChipID2Layer{
276 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0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, 6, 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, 6,
299 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,
300 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,
301 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,
302 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,
303 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,
304 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,
305 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,
306 9, 9, 9, 9, 9, 9};
307
308 static constexpr std::array<int, 280> mLadderIDGeoToRO{
309 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 15,
310 16, 17, 18, 19, 20, 21, 22, 23, 5, 24, 30, 31, 32, 33, 34,
311 35, 36, 37, 38, 25, 26, 27, 28, 39, 40, 41, 42, 43, 44, 45,
312 46, 47, 29, 48, 52, 53, 66, 67, 54, 55, 56, 68, 69, 57, 58,
313 49, 50, 59, 60, 70, 71, 61, 62, 63, 72, 73, 64, 65, 51, 74,
314 75, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 76, 77, 78,
315 79, 80, 81, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 82,
316 83, 106, 107, 114, 115, 132, 133, 116, 117, 118, 119, 120, 134, 135, 121,
317 122, 108, 109, 110, 111, 123, 124, 136, 137, 125, 126, 127, 128, 129, 138,
318 139, 130, 131, 112, 113, 140, 146, 147, 148, 149, 150, 151, 152, 153, 154,
319 141, 142, 143, 144, 155, 156, 157, 158, 159, 160, 161, 162, 163, 145, 164,
320 170, 171, 172, 173, 174, 175, 176, 177, 178, 165, 166, 167, 168, 179, 180,
321 181, 182, 183, 184, 185, 186, 187, 169, 188, 192, 193, 206, 207, 194, 195,
322 196, 208, 209, 197, 198, 189, 190, 199, 200, 210, 211, 201, 202, 203, 212,
323 213, 204, 205, 191, 214, 215, 224, 225, 226, 227, 228, 229, 230, 231, 232,
324 233, 234, 216, 217, 218, 219, 220, 221, 235, 236, 237, 238, 239, 240, 241,
325 242, 243, 244, 245, 222, 223, 246, 247, 254, 255, 272, 273, 256, 257, 258,
326 259, 260, 274, 275, 261, 262, 248, 249, 250, 251, 263, 264, 276, 277, 265,
327 266, 267, 268, 269, 278, 279, 270, 271, 252, 253};
328
329 static constexpr std::array<int, NChips> mChipIDGeoToRO{
330 0, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
331 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 2,
332 3, 4, 5, 6, 7, 8, 9, 39, 40, 41, 42, 43, 44, 45, 46,
333 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
334 62, 63, 64, 65, 10, 11, 66, 67, 78, 79, 80, 81, 82, 83, 84,
335 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
336 100, 101, 102, 103, 104, 68, 69, 70, 71, 72, 73, 74, 75, 105, 106,
337 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
338 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 76, 77, 132, 133, 140,
339 141, 142, 143, 144, 145, 182, 183, 184, 185, 186, 187, 188, 189, 146, 147,
340 148, 149, 150, 151, 152, 153, 154, 190, 191, 192, 193, 194, 195, 196, 197,
341 155, 156, 157, 158, 159, 160, 134, 135, 136, 137, 161, 162, 163, 164, 165,
342 166, 198, 199, 200, 201, 202, 203, 204, 205, 167, 168, 169, 170, 171, 172,
343 173, 174, 175, 206, 207, 208, 209, 210, 211, 212, 213, 176, 177, 178, 179,
344 180, 181, 138, 139, 214, 215, 216, 217, 218, 219, 244, 245, 246, 247, 248,
345 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
346 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
347 279, 280, 281, 282, 283, 284, 285, 286, 287, 220, 221, 222, 223, 224, 225,
348 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 288, 289, 290,
349 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305,
350 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
351 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 238, 239, 240, 241,
352 242, 243, 332, 333, 334, 335, 336, 337, 356, 357, 358, 359, 360, 361, 362,
353 363, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 364, 365, 366, 367,
354 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
355 383, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 384, 385, 386, 387,
356 388, 389, 390, 391, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,
357 349, 392, 393, 394, 395, 396, 397, 398, 399, 448, 449, 450, 451, 452, 453,
358 454, 455, 456, 457, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410,
359 411, 412, 413, 414, 415, 416, 417, 418, 419, 458, 459, 460, 461, 462, 463,
360 464, 465, 466, 467, 420, 421, 422, 423, 424, 425, 426, 427, 350, 351, 352,
361 353, 354, 355, 468, 469, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489,
362 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504,
363 505, 506, 470, 471, 472, 473, 474, 475, 476, 477, 507, 508, 509, 510, 511,
364 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526,
365 527, 528, 529, 530, 531, 532, 533, 478, 479, 534, 535, 546, 547, 548, 549,
366 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564,
367 565, 566, 567, 568, 569, 570, 571, 572, 536, 537, 538, 539, 540, 541, 542,
368 543, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586,
369 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 544, 545,
370 600, 601, 608, 609, 610, 611, 612, 613, 650, 651, 652, 653, 654, 655, 656,
371 657, 614, 615, 616, 617, 618, 619, 620, 621, 622, 658, 659, 660, 661, 662,
372 663, 664, 665, 623, 624, 625, 626, 627, 628, 602, 603, 604, 605, 629, 630,
373 631, 632, 633, 634, 666, 667, 668, 669, 670, 671, 672, 673, 635, 636, 637,
374 638, 639, 640, 641, 642, 643, 674, 675, 676, 677, 678, 679, 680, 681, 644,
375 645, 646, 647, 648, 649, 606, 607, 682, 683, 684, 685, 686, 687, 712, 713,
376 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728,
377 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743,
378 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 688, 689, 690,
379 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705,
380 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770,
381 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785,
382 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 706,
383 707, 708, 709, 710, 711, 800, 801, 802, 803, 804, 805, 824, 825, 826, 827,
384 828, 829, 830, 831, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 832,
385 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847,
386 848, 849, 850, 851, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 852,
387 853, 854, 855, 856, 857, 858, 859, 806, 807, 808, 809, 810, 811, 812, 813,
388 814, 815, 816, 817, 860, 861, 862, 863, 864, 865, 866, 867, 916, 917, 918,
389 919, 920, 921, 922, 923, 924, 925, 868, 869, 870, 871, 872, 873, 874, 875,
390 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 926, 927, 928,
391 929, 930, 931, 932, 933, 934, 935, 888, 889, 890, 891, 892, 893, 894, 895,
392 818, 819, 820, 821, 822, 823};
393
394 private:
395 Int_t invalid() const;
396 static constexpr Int_t NRUs = NLayers * NZonesPerLayer;
397 static constexpr Int_t NModules = 280;
398 static constexpr Int_t NChipsInfo = 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 16 + 17 + 18 + 19 + 14;
399 static constexpr Int_t NChipsPerCable = 1;
400 static constexpr Int_t NLinks = 1;
401 static constexpr Int_t NConnectors = 5;
402 static constexpr Int_t NMaxChipsPerLadder = 5;
403 static constexpr Int_t NRUCables = 25;
404
405 static constexpr Int_t ZoneLadderIDmin[NZonesPerLayer / 2][NLayers]{
406 {0, 21, 0, 21, 0, 23, 0, 28, 0, 29},
407 {3, 18, 3, 18, 3, 20, 4, 24, 5, 25},
408 {6, 15, 6, 15, 6, 17, 8, 20, 9, 21},
409 {9, 12, 9, 12, 9, 13, 12, 16, 13, 17}};
410 static constexpr Int_t ZoneLadderIDmax[NZonesPerLayer / 2][NLayers]{
411 {2, 23, 2, 23, 2, 25, 3, 31, 4, 33},
412 {5, 20, 5, 20, 5, 22, 7, 27, 8, 28},
413 {8, 17, 8, 17, 8, 19, 11, 23, 12, 24},
414 {11, 14, 11, 14, 12, 16, 15, 19, 16, 20}};
415
416 static constexpr Int_t ZoneRUType[NZonesPerLayer / 2][NLayers / 2]{
417 {1, 1, 1, 7, 11},
418 {2, 2, 4, 8, 9},
419 {2, 2, 3, 8, 10},
420 {0, 0, 5, 6, 12}};
421
422 static constexpr Int_t ChipConnectorCable[NConnectors][NMaxChipsPerLadder]{
423 {5, 6, 7, 24, 23},
424 {0, 1, 2, 3, 4},
425 {17, 16, 15, 14, 13},
426 {22, 21, 20, 19, 18},
427 {12, 11, 10, 9, 8}};
428
429 static const std::array<MFTChipMappingData, NChips> ChipMappingData;
430 static const std::array<MFTModuleMappingData, NModules> ModuleMappingData;
431
433 static constexpr std::array<int, NRUTypes> NChipsOnRUType{7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 14};
434
435 // info on chips info within the zone (RU)
436 std::array<ChipOnRUInfo, NChipsInfo> mChipsInfo;
437 Int_t mChipInfoEntryRU[NRUTypes];
438
440 std::array<RUInfo, NRUs> mRUInfo;
441 std::vector<uint8_t> mFEEId2RUSW; // HW RU ID -> SW ID conversion
442
443 std::vector<uint8_t> mCableHW2SW[NRUs];
444 std::vector<uint8_t> mCableHW2Pos[NRUs];
445 std::vector<uint8_t> mCablePos[NRUs];
446 std::vector<uint8_t> mCableHWFirstChip[NRUs];
447
448 std::array<std::vector<uint16_t>, NRUs> mRUGlobalChipID;
449
450 ClassDefNV(ChipMappingMFT, 1)
451};
452} // namespace itsmft
453} // namespace o2
454
455#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
Collect all FEEIDs for one layer (lr>=0) or all (lr==-1)
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
std::vector< uint16_t > getLayer2FEEIDs(int lr)
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