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