File indexing completed on 2025-08-05 08:16:14
0001 #ifndef MVTXRAWDEFS_H
0002 #define MVTXRAWDEFS_H
0003
0004 #include <array>
0005 #include <cstdint>
0006 #include <map>
0007
0008 namespace MvtxRawDefs
0009 {
0010
0011 static constexpr uint8_t nMvtxLayers = 3;
0012 static constexpr uint8_t nGbtPerStave = 3;
0013 static constexpr uint8_t nChipsPerGbt = 3;
0014 static constexpr uint8_t nStavesPerFelix = 8;
0015
0016 static const std::array<uint8_t, nMvtxLayers> firstStaveIndex = {{0, 12, 28}};
0017
0018 static const std::array<std::array<uint8_t, nChipsPerGbt>, nGbtPerStave> gbtChipId_to_staveChipId = {{{{0, 1, 2}}, {{3, 4, 5}}, {{6, 7, 8}}}};
0019
0020
0021
0022 const std::map<uint8_t, std::pair<uint8_t, uint8_t>> stave_felix_map =
0023 {
0024 {0, {2, 0}},
0025 {1, {2, 0}},
0026 {2, {2, 1}},
0027 {3, {0, 0}},
0028 {4, {0, 0}},
0029 {5, {0, 1}},
0030 {6, {4, 0}},
0031 {7, {4, 0}},
0032 {8, {4, 1}},
0033 {9, {3, 0}},
0034 {10, {3, 0}},
0035 {11, {3, 1}},
0036 {12, {1, 0}},
0037 {13, {1, 0}},
0038 {14, {1, 1}},
0039 {15, {1, 1}},
0040 {16, {2, 0}},
0041 {17, {2, 1}},
0042 {18, {2, 1}},
0043 {19, {2, 1}},
0044 {20, {5, 0}},
0045 {21, {5, 0}},
0046 {22, {5, 1}},
0047 {23, {5, 1}},
0048 {24, {4, 0}},
0049 {25, {4, 1}},
0050 {26, {4, 1}},
0051 {27, {4, 1}},
0052 {28, {4, 0}},
0053 {29, {0, 0}},
0054 {30, {0, 0}},
0055 {31, {0, 1}},
0056 {32, {0, 1}},
0057 {33, {3, 0}},
0058 {34, {1, 0}},
0059 {35, {1, 0}},
0060 {36, {1, 1}},
0061 {37, {1, 1}},
0062 {38, {2, 0}},
0063 {39, {3, 0}},
0064 {40, {3, 1}},
0065 {41, {3, 1}},
0066 {42, {3, 1}},
0067 {43, {0, 1}},
0068 {44, {5, 0}},
0069 {45, {5, 0}},
0070 {46, {5, 1}},
0071 {47, {5, 1}},
0072 };
0073
0074 using linkId_t = struct linkId
0075 {
0076 uint32_t layer{0xFF};
0077 uint32_t stave{0xFF};
0078 uint32_t gbtid{0xFF};
0079 };
0080
0081 uint8_t getStaveIndex(const uint8_t& lyrId, const uint8_t& stvId);
0082 std::pair<uint8_t, uint8_t> const& get_flx_endpoint(const uint8_t& lyrId, const uint8_t& stvId);
0083
0084 linkId_t decode_feeid(uint16_t feeid);
0085
0086 float getStrobeLength(const int& runNumber);
0087
0088 }
0089
0090 #endif