CbmRoot
Loading...
Searching...
No Matches
rich/ReadoutConfig.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022-2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese, Dominik Smith [committer], Martin Beyer */
4
5#include "ReadoutConfig.h"
6
7#include <cassert>
8#include <iomanip>
9
10using std::setw;
11
13{
14
15
16 // --- Constructor ------------------------------------------------------------------
18 // ------------------------------------------------------------------------------------
19
20
21 // --- Destructor -----------------------------------------------------------------
23 // ------------------------------------------------------------------------------------
24
25
26 // --- Equipment IDs --------------------------------------------------------------
27 std::vector<uint16_t> ReadoutConfig::GetEquipmentIds()
28 {
29 std::vector<uint16_t> result;
30 for (auto& entry : fReadoutMap)
31 result.push_back(entry.first);
32 return result;
33 }
34 // ------------------------------------------------------------------------------------
35
36
37 // --- Number of elinks for a component / equipment -------------------------------
38 size_t ReadoutConfig::GetNumElinks(uint16_t equipmentId)
39 {
40 size_t result = 0;
41 auto it = fReadoutMap.find(equipmentId);
42 if (it != fReadoutMap.end()) result = fReadoutMap[equipmentId].size();
43 return result;
44 }
45 // ------------------------------------------------------------------------------------
46
47
48 // --- Total number of elinks for STS ---------------------------------------------
50 {
51 size_t result = 0;
52 for (auto& entry : fReadoutMap) {
53 result += entry.second.size();
54 }
55 return result;
56 }
57 // ------------------------------------------------------------------------------------
58
59
60 // --- Initialise the mapping structure --------------------------------------------
62 {
63 // This here refers to the mCBM 2024 setup, it is backward compatible with the 2021 setup.
64 // Taken from CbmMcbm2018RichPar in combination with macro/beamtime/mcbm2024/mRichPar_70.par
65
66 // Constants
67 const uint16_t numComp = 1; // Number of components
68 const uint16_t numElinksPerComp = 76; // Number of elinks per component (74 for mRICH, 2 for FSD/NCAL)
69 const uint16_t numChanPerElink = 33; // Number of channels per Elink
70
71 // Equipment IDs for each component
72 // This number is written to the data stream (MicrosliceDescriptor).
73 uint16_t eqId[numComp] = {12289};
74
75 uint32_t TRBaddresses[numElinksPerComp] = {
76 0xc000, 0xc001, 0x7000, 0x7001, 0x7010, 0x7011, 0x7020, 0x7021, 0x7030, 0x7031, 0x7040, 0x7041, 0x7050,
77 0x7051, 0x7060, 0x7061, 0x7070, 0x7071, 0x7080, 0x7081, 0x7100, 0x7101, 0x7110, 0x7111, 0x7120, 0x7121,
78 0x7130, 0x7131, 0x7140, 0x7141, 0x7150, 0x7151, 0x7160, 0x7161, 0x7170, 0x7171, 0x7180, 0x7181, 0x7200,
79 0x7201, 0x7210, 0x7211, 0x7220, 0x7221, 0x7230, 0x7231, 0x7240, 0x7241, 0x7250, 0x7251, 0x7260, 0x7261,
80 0x7270, 0x7271, 0x7280, 0x7281, 0x7300, 0x7301, 0x7310, 0x7311, 0x7320, 0x7321, 0x7330, 0x7331, 0x7340,
81 0x7341, 0x7350, 0x7351, 0x7360, 0x7361, 0x7370, 0x7371, 0x7380, 0x7381, 0x7901, 0x7902};
82 // TRBaddresses 0x7901 and 0x7902 are for FSD/NCAL
83
84 double ToTshifts[numElinksPerComp][numChanPerElink] = {
85 {0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
86 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00},
87 {0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
88 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00},
89 {0.00, 17.25, 16.25, 16.85, 14.75, 17.35, 14.45, 14.05, 16.15, 16.55, 14.25,
90 17.25, 18.55, 19.05, 17.25, 10.25, 11.45, 7.55, 5.85, 7.75, 9.85, 11.25,
91 8.85, 9.15, 9.75, 10.45, 11.25, 9.05, 7.85, 8.55, 6.75, 8.75, 10.45},
92 {0.00, 15.65, 14.35, 14.75, 12.55, 15.55, 12.75, 11.75, 14.25, 14.45, 12.65,
93 15.15, 16.85, 17.05, 15.55, 8.55, 10.05, 6.35, 4.25, 6.15, 8.15, 9.05,
94 7.25, 7.35, 7.75, 8.55, 9.55, 7.65, 6.25, 7.65, 5.25, 7.55, 9.25},
95 {0.00, 14.35, 13.75, 13.65, 11.75, 15.35, 12.35, 11.35, 14.05, 13.75, 11.85,
96 14.45, 16.25, 16.25, 14.55, 7.95, 9.15, 5.95, 0.00, 6.15, 7.65, 0.00,
97 6.85, 7.05, 7.25, 7.85, 9.15, 6.75, 5.85, 6.85, 5.05, 6.25, 7.85},
98 {0.00, 14.65, 13.45, 14.05, 12.25, 15.25, 12.15, 11.05, 13.85, 13.65, 11.85,
99 14.55, 16.05, 16.15, 15.05, 7.65, 9.15, 6.05, 4.05, 0.00, 7.75, 8.85,
100 7.25, 7.15, 7.55, 8.05, 9.25, 7.15, 5.55, 6.85, 5.25, 6.95, 8.75},
101 {0.00, 16.35, 15.05, 15.35, 13.25, 16.75, 13.15, 11.75, 15.05, 15.05, 13.15,
102 16.05, 17.55, 17.25, 16.15, 9.15, 9.05, 0.00, 4.75, 6.75, 8.95, 9.75,
103 7.65, 8.25, 8.55, 9.15, 10.25, 8.25, 6.65, 8.05, 5.75, 7.15, 10.25},
104 {0.00, 17.65, 16.45, 16.65, 14.35, 18.35, 14.85, 13.75, 16.55, 16.25, 14.35,
105 17.25, 19.05, 19.55, 17.75, 10.35, 11.55, 7.95, 5.55, 7.45, 9.85, 10.85,
106 8.75, 9.35, 9.75, 9.85, 11.35, 9.35, 7.35, 10.05, 5.05, 8.65, 10.75},
107 {0.00, 17.05, 16.25, 16.85, 14.65, 17.65, 14.75, 13.65, 16.25, 15.85, 14.15,
108 17.25, 18.75, 18.75, 17.25, 10.15, 11.15, 7.25, 5.05, 7.55, 9.55, 10.05,
109 8.15, 8.85, 9.35, 9.55, 10.35, 8.75, 6.75, 7.85, 6.35, 8.25, 10.05},
110 {0.00, 17.35, 16.25, 15.05, 14.35, 17.15, 14.55, 12.75, 0.00, 16.35, 13.75,
111 16.85, 18.35, 17.55, 17.05, 9.85, 11.25, 7.55, 5.85, 7.85, 9.15, 10.65,
112 8.45, 8.45, 0.00, 9.65, 9.55, 0.00, 5.95, 7.95, 6.55, 7.65, 10.05},
113 {0.00, 16.55, 15.55, 15.85, 13.35, 17.35, 13.75, 12.65, 15.25, 15.55, 13.55,
114 16.65, 17.85, 18.35, 16.85, 9.35, 10.75, 7.35, 4.55, 6.95, 8.85, 9.85,
115 8.25, 8.35, 8.75, 9.35, 10.05, 8.45, 6.85, 7.75, 6.35, 8.05, 9.85},
116 {0.00, 16.35, 15.05, 15.65, 13.35, 16.65, 13.75, 11.95, 15.05, 15.25, 13.05,
117 15.85, 17.65, 17.85, 16.55, 9.15, 10.55, 7.25, 4.75, 6.75, 8.65, 9.65,
118 7.85, 8.25, 8.15, 9.25, 10.45, 8.35, 6.65, 8.05, 6.25, 8.05, 9.85},
119 {0.00, 15.55, 14.55, 14.75, 12.75, 16.15, 12.85, 11.65, 14.35, 14.35, 12.75,
120 15.45, 17.15, 17.35, 15.95, 8.85, 9.75, 6.65, 4.35, 6.55, 8.55, 9.35,
121 7.65, 7.85, 8.35, 8.85, 10.05, 7.95, 6.35, 7.55, 5.25, 7.05, 9.05},
122 {0.00, 16.65, 15.35, 15.85, 13.55, 17.35, 13.65, 12.85, 16.05, 15.85, 13.75,
123 16.55, 17.65, 18.75, 16.85, 9.75, 10.65, 7.75, 5.05, 7.05, 9.05, 10.25,
124 8.35, 8.65, 9.35, 9.15, 10.05, 8.15, 7.25, 8.35, 6.25, 7.85, 9.65},
125 {0.00, 16.55, 15.55, 15.75, 13.75, 17.25, 13.85, 12.85, 15.65, 15.55, 13.65,
126 16.35, 18.05, 18.35, 17.25, 9.55, 10.95, 7.15, 4.85, 7.15, 9.15, 10.35,
127 8.05, 8.55, 9.15, 9.25, 10.45, 8.55, 6.75, 8.25, 6.25, 7.95, 9.85},
128 {0.00, 16.55, 15.65, 15.85, 13.85, 17.05, 14.05, 12.55, 15.55, 15.75, 13.75,
129 16.35, 18.05, 18.35, 17.15, 9.35, 10.55, 7.35, 4.85, 7.45, 9.25, 10.55,
130 8.35, 8.65, 9.15, 9.75, 10.75, 8.75, 6.85, 8.35, 6.55, 8.05, 10.05},
131 {0.00, 15.35, 13.95, 13.85, 12.15, 15.85, 12.55, 11.35, 14.15, 14.15, 12.25,
132 15.15, 16.45, 17.05, 15.05, 8.35, 9.55, 6.15, 3.25, 5.85, 7.75, 8.75,
133 7.15, 7.05, 7.75, 8.25, 9.15, 7.35, 6.05, 6.85, 5.05, 7.55, 8.55},
134 {0.00, 14.15, 13.55, 13.45, 11.45, 14.25, 12.05, 10.55, 13.25, 13.65, 11.25,
135 14.25, 16.05, 16.15, 15.05, 7.85, 9.05, 5.75, 3.65, 6.05, 7.75, 8.55,
136 6.95, 6.35, 7.35, 8.15, 9.05, 7.05, 5.65, 6.35, 4.65, 6.65, 8.75},
137 {0.00, 13.35, 12.85, 13.25, 10.85, 14.55, 11.75, 10.05, 13.15, 12.55, 10.85,
138 13.75, 15.55, 15.35, 14.55, 7.45, 8.45, 5.25, 3.05, 5.35, 6.75, 8.15,
139 6.55, 6.75, 6.95, 7.65, 8.35, 6.45, 4.85, 5.95, 4.35, 5.65, 7.65},
140 {0.00, 14.35, 12.95, 13.65, 11.25, 14.85, 11.65, 10.85, 13.35, 13.05, 11.35,
141 14.35, 15.55, 16.35, 14.85, 7.35, 8.35, 5.85, 3.15, 5.35, 7.25, 8.55,
142 6.65, 6.55, 7.35, 7.85, 8.85, 6.55, 5.05, 6.05, 4.55, 6.05, 7.95},
143 {0.00, 14.65, 13.85, 13.95, 12.35, 15.25, 12.25, 11.05, 13.85, 14.05, 12.15,
144 14.75, 16.55, 16.85, 15.85, 8.15, 9.35, 5.75, 3.65, 5.85, 8.15, 9.05,
145 7.25, 7.25, 7.95, 8.05, 9.65, 7.05, 6.05, 6.85, 5.45, 6.85, 8.65},
146 {0.00, 14.55, 13.25, 14.75, 12.25, 15.55, 12.85, 11.45, 14.35, 14.15, 12.55,
147 15.05, 16.85, 16.65, 15.75, 8.25, 9.55, 6.05, 4.15, 6.15, 8.35, 9.05,
148 0.00, 7.65, 8.15, 8.65, 9.55, 7.75, 6.05, 7.25, 5.25, 6.65, 8.65},
149 {0.00, 16.65, 15.05, 16.35, 14.15, 16.85, 13.55, 12.85, 15.65, 15.55, 13.25,
150 16.15, 17.65, 18.05, 17.05, 9.05, 11.05, 7.35, 4.55, 7.35, 9.05, 10.15,
151 8.55, 8.85, 9.15, 9.75, 10.55, 8.85, 7.25, 8.35, 6.35, 8.65, 10.05},
152 {0.00, 14.55, 13.75, 14.55, 12.15, 15.05, 12.15, 11.35, 13.75, 13.75, 11.75,
153 14.75, 16.65, 16.65, 15.15, 8.25, 8.85, 6.35, 3.85, 6.25, 8.05, 8.95,
154 7.55, 0.00, 7.75, 8.35, 9.55, 7.65, 5.85, 6.35, 5.85, 7.25, 8.45},
155 {0.00, 14.75, 13.35, 14.35, 12.65, 15.65, 12.75, 11.75, 14.25, 14.35, 12.05,
156 14.75, 16.05, 16.65, 15.55, 8.65, 9.35, 6.15, 4.15, 6.15, 7.85, 9.15,
157 0.00, 7.55, 7.95, 8.15, 9.35, 7.05, 5.85, 6.75, 5.25, 6.75, 8.85},
158 {0.00, 16.15, 15.05, 15.35, 13.25, 16.85, 13.55, 12.75, 15.35, 15.35, 13.55,
159 16.35, 17.65, 18.15, 16.95, 9.55, 10.75, 7.05, 4.85, 6.85, 9.15, 9.85,
160 8.05, 8.35, 8.75, 9.25, 10.05, 8.65, 6.55, 8.05, 6.55, 8.05, 9.75},
161 {0.00, 16.85, 15.55, 16.15, 13.75, 17.25, 14.25, 13.15, 15.75, 16.05, 14.05,
162 16.75, 18.35, 18.85, 17.15, 9.85, 10.85, 7.55, 5.35, 7.35, 9.65, 10.55,
163 8.65, 8.85, 9.35, 9.55, 10.85, 9.05, 7.15, 8.35, 6.65, 8.25, 10.45},
164 {0.00, 16.85, 15.75, 15.85, 13.85, 17.25, 14.35, 13.05, 15.75, 15.85, 13.95,
165 16.85, 18.35, 18.75, 17.35, 10.05, 10.75, 7.75, 5.35, 7.35, 9.45, 10.75,
166 8.75, 9.05, 9.35, 10.05, 11.05, 9.05, 7.35, 8.65, 6.75, 8.45, 10.55},
167 {0.00, 15.35, 13.75, 14.35, 12.55, 15.75, 12.65, 11.55, 14.35, 14.55, 12.75,
168 15.05, 16.55, 17.05, 16.05, 8.55, 9.55, 6.15, 3.75, 6.15, 8.15, 8.95,
169 7.35, 7.55, 8.15, 8.25, 9.55, 7.45, 5.65, 7.05, 5.45, 6.85, 8.75},
170 {0.00, 16.85, 15.55, 15.75, 13.65, 17.65, 13.75, 12.65, 15.55, 15.35, 13.55,
171 16.75, 18.05, 18.35, 17.45, 9.65, 10.35, 7.65, 5.15, 7.55, 9.35, 10.25,
172 8.75, 8.75, 9.15, 10.05, 10.55, 8.85, 7.15, 8.55, 7.05, 7.75, 10.55},
173 {0.00, 15.45, 14.45, 14.85, 12.55, 16.05, 12.95, 11.35, 14.45, 14.65, 12.85,
174 15.55, 17.25, 17.65, 16.05, 8.55, 9.65, 6.65, 4.05, 6.55, 8.35, 9.25,
175 7.65, 7.65, 8.35, 8.65, 9.95, 7.85, 6.05, 7.55, 5.95, 7.25, 8.85},
176 {0.00, 16.35, 15.05, 15.55, 13.65, 16.75, 13.75, 12.25, 15.15, 15.05, 13.25,
177 15.95, 17.55, 18.05, 16.75, 9.25, 10.25, 7.05, 4.15, 6.95, 8.65, 10.05,
178 8.15, 7.95, 8.95, 9.15, 10.55, 8.25, 6.65, 7.75, 6.85, 7.85, 9.55},
179 {0.00, 15.05, 13.85, 14.15, 12.35, 15.35, 12.35, 11.35, 14.05, 14.35, 12.25,
180 14.85, 16.25, 16.95, 15.65, 8.75, 9.35, 6.55, 4.15, 6.05, 7.75, 8.65,
181 6.75, 7.55, 8.15, 8.35, 9.05, 7.25, 5.75, 7.05, 5.05, 6.85, 8.75},
182 {0.00, 16.25, 15.75, 15.35, 13.75, 16.85, 13.65, 12.35, 15.55, 15.05, 13.25,
183 16.05, 17.75, 17.85, 16.55, 9.35, 10.35, 7.25, 5.35, 7.25, 8.85, 10.05,
184 8.45, 8.35, 8.55, 9.35, 10.25, 8.35, 6.25, 7.75, 5.85, 7.75, 9.75},
185 {0.00, 14.15, 13.05, 13.35, 11.25, 14.55, 11.55, 10.35, 12.85, 12.85, 10.45,
186 13.35, 14.75, 15.55, 13.85, 6.85, 8.05, 5.35, 3.65, 5.45, 7.55, 8.05,
187 6.15, 6.35, 6.95, 7.25, 8.15, 6.35, 4.15, 5.55, 4.05, 5.65, 7.35},
188 {0.00, 14.05, 12.75, 13.25, 11.45, 14.35, 11.55, 10.45, 12.45, 12.45, 11.35,
189 13.75, 15.25, 15.55, 14.25, 7.35, 8.65, 5.35, 3.35, 5.05, 6.75, 7.75,
190 6.45, 6.05, 6.65, 7.25, 8.25, 5.55, 4.75, 6.05, 3.75, 5.65, 7.85},
191 {0.00, 16.65, 15.45, 15.75, 13.15, 16.85, 13.75, 12.15, 15.05, 15.05, 12.85,
192 16.55, 18.05, 18.25, 16.35, 9.55, 10.35, 7.15, 5.05, 6.45, 8.55, 10.05,
193 7.75, 7.75, 8.25, 8.85, 10.15, 8.05, 6.65, 7.55, 5.75, 7.55, 9.85},
194 {0.00, 14.05, 12.85, 13.75, 11.35, 14.55, 11.25, 10.85, 13.35, 13.55, 11.15,
195 14.15, 15.65, 16.05, 14.55, 8.05, 8.75, 5.05, 3.75, 5.35, 7.55, 8.25,
196 6.35, 6.45, 7.05, 7.75, 8.75, 6.25, 4.75, 6.35, 4.45, 6.05, 8.25},
197 {0.00, 17.45, 15.85, 16.35, 14.55, 17.85, 14.75, 13.55, 15.85, 16.25, 14.45,
198 16.25, 18.75, 19.05, 17.35, 9.75, 10.95, 7.15, 5.35, 7.55, 9.25, 10.55,
199 8.75, 9.05, 9.05, 9.85, 11.15, 8.55, 7.55, 9.05, 6.55, 7.85, 10.05},
200 {0.00, 14.45, 13.65, 14.25, 12.05, 15.05, 11.75, 10.85, 13.65, 13.35, 11.85,
201 14.55, 16.25, 16.05, 15.35, 8.25, 8.55, 5.95, 3.75, 5.85, 7.65, 8.45,
202 6.65, 0.00, 7.55, 8.05, 8.85, 7.05, 5.45, 6.95, 5.35, 7.05, 0.00},
203 {0.00, 16.55, 15.55, 15.85, 13.55, 17.25, 13.85, 12.55, 15.65, 15.35, 13.05,
204 15.75, 18.05, 17.85, 16.55, 9.55, 10.85, 7.55, 5.15, 7.55, 9.35, 10.25,
205 8.05, 8.35, 9.05, 9.35, 10.65, 8.35, 6.95, 8.35, 6.85, 0.00, 10.25},
206 {0.00, 15.55, 14.45, 14.05, 12.25, 15.35, 12.35, 11.35, 14.15, 13.65, 11.95,
207 14.65, 16.35, 16.45, 15.35, 8.45, 9.75, 6.15, 3.85, 5.65, 7.35, 8.55,
208 7.15, 6.65, 7.15, 8.05, 9.05, 6.75, 5.25, 6.75, 4.85, 6.85, 8.25},
209 {0.00, 15.05, 13.65, 14.45, 12.05, 15.75, 12.25, 11.25, 14.25, 14.05, 12.05,
210 14.65, 16.35, 16.35, 15.55, 8.35, 9.65, 0.00, 4.15, 5.95, 8.05, 8.75,
211 7.05, 7.25, 7.75, 8.45, 9.35, 7.65, 5.95, 7.25, 6.05, 7.15, 9.15},
212 {0.00, 15.35, 13.75, 14.75, 12.25, 15.75, 12.05, 11.75, 14.35, 13.85, 12.55,
213 14.85, 16.85, 16.75, 15.75, 0.00, 9.45, 6.05, 3.35, 6.05, 8.05, 9.05,
214 7.25, 7.75, 7.85, 8.35, 9.45, 7.75, 6.15, 7.35, 5.75, 7.55, 9.55},
215 {0.00, 16.05, 14.75, 15.35, 13.05, 16.85, 13.55, 12.45, 15.05, 15.25, 13.05,
216 16.15, 17.55, 17.75, 16.35, 9.05, 10.05, 7.05, 4.75, 6.85, 9.15, 10.05,
217 8.05, 8.25, 8.85, 8.95, 10.05, 8.25, 6.55, 7.85, 6.05, 7.85, 9.55},
218 {0.00, 16.75, 15.55, 15.85, 13.75, 16.85, 13.75, 12.65, 15.15, 15.35, 13.25,
219 16.25, 17.95, 18.45, 16.75, 9.55, 10.65, 7.35, 5.15, 7.25, 9.35, 10.35,
220 8.65, 8.55, 9.25, 9.85, 10.55, 8.65, 7.05, 8.05, 6.05, 7.85, 10.05},
221 {0.00, 15.05, 13.65, 14.25, 12.25, 15.85, 12.55, 11.45, 14.35, 14.25, 12.05,
222 14.75, 16.25, 16.65, 15.25, 8.45, 9.35, 6.25, 4.05, 6.25, 8.15, 9.15,
223 7.55, 7.85, 8.05, 8.35, 9.35, 7.55, 5.85, 6.75, 5.35, 6.75, 8.45},
224 {0.00, 15.35, 14.25, 15.05, 12.55, 16.15, 13.05, 11.55, 14.35, 14.25, 12.75,
225 15.05, 16.85, 17.05, 15.65, 8.25, 9.55, 6.25, 4.25, 6.15, 8.25, 9.25,
226 7.45, 7.55, 7.85, 8.45, 9.65, 7.55, 5.85, 7.05, 5.25, 6.85, 8.65},
227 {0.00, 16.55, 15.25, 15.65, 13.55, 17.05, 13.85, 12.65, 15.25, 15.25, 13.75,
228 16.35, 17.85, 18.15, 16.75, 9.25, 10.35, 7.05, 4.75, 6.85, 8.85, 10.05,
229 8.05, 8.25, 8.65, 9.35, 0.00, 8.25, 6.85, 7.85, 6.25, 7.55, 10.05},
230 {0.00, 15.35, 14.25, 14.55, 12.35, 15.75, 12.65, 11.65, 14.25, 14.55, 12.35,
231 15.15, 16.55, 17.05, 15.55, 8.65, 9.65, 6.05, 4.05, 5.85, 8.05, 9.05,
232 7.25, 7.35, 7.75, 8.15, 9.15, 7.45, 5.25, 6.85, 5.25, 6.65, 8.55},
233 {0.00, 16.55, 15.55, 15.85, 13.75, 17.05, 13.75, 12.65, 16.05, 15.45, 14.15,
234 16.35, 18.05, 18.35, 17.05, 9.55, 10.55, 7.75, 5.25, 7.35, 9.75, 10.65,
235 8.45, 9.15, 9.05, 10.05, 10.35, 8.65, 7.25, 7.85, 6.25, 7.85, 9.55},
236 {0.00, 15.35, 14.55, 14.65, 12.95, 16.05, 13.05, 11.75, 14.65, 14.35, 12.75,
237 15.35, 16.85, 17.35, 16.05, 8.35, 9.55, 6.65, 4.05, 6.25, 8.25, 9.25,
238 7.35, 8.15, 8.15, 8.65, 9.65, 7.75, 5.85, 7.25, 5.75, 7.05, 8.75},
239 {0.00, 15.05, 13.45, 13.75, 11.85, 15.25, 12.25, 10.55, 13.55, 13.55, 12.15,
240 14.45, 15.85, 15.65, 15.05, 8.15, 9.35, 5.85, 3.75, 5.75, 7.35, 8.55,
241 7.05, 6.65, 7.55, 7.85, 8.65, 6.85, 5.55, 6.75, 5.05, 6.85, 8.55},
242 {0.00, 16.55, 15.45, 16.05, 13.75, 16.75, 13.75, 12.75, 15.45, 15.35, 13.35,
243 16.25, 17.65, 17.85, 16.85, 9.65, 10.35, 7.55, 5.05, 7.25, 9.05, 10.05,
244 8.35, 8.25, 9.05, 9.65, 10.35, 8.35, 6.95, 8.15, 6.75, 8.25, 10.05},
245 {0.00, 13.75, 12.85, 13.15, 11.15, 14.25, 11.55, 10.35, 12.95, 12.65, 10.85,
246 13.85, 15.05, 16.05, 14.35, 7.15, 8.55, 5.35, 3.15, 5.65, 7.15, 8.05,
247 6.35, 6.35, 6.85, 7.35, 8.15, 6.45, 4.55, 6.55, 5.35, 6.65, 7.95},
248 {0.00, 15.05, 13.45, 14.55, 12.25, 15.35, 12.75, 11.65, 14.25, 13.75, 12.25,
249 14.75, 16.55, 16.55, 16.05, 8.25, 10.05, 6.05, 3.95, 6.15, 8.15, 9.05,
250 7.15, 7.25, 8.05, 8.35, 9.35, 7.55, 6.05, 7.15, 5.55, 7.05, 8.65},
251 {0.00, 17.05, 15.55, 16.55, 14.25, 17.85, 14.65, 13.55, 16.55, 16.65, 14.55,
252 17.35, 18.85, 19.35, 18.05, 10.35, 11.05, 7.25, 5.35, 7.55, 10.05, 10.75,
253 9.05, 9.35, 9.85, 10.05, 11.25, 9.45, 7.85, 9.15, 7.45, 9.35, 11.25},
254 {0.00, 14.65, 13.35, 14.35, 11.85, 15.35, 12.55, 11.55, 14.15, 14.15, 12.35,
255 15.05, 16.35, 16.75, 15.25, 8.45, 9.05, 6.25, 3.55, 3.75, 7.85, 8.45,
256 6.75, 7.35, 7.85, 8.15, 9.05, 7.45, 5.55, 7.15, 5.05, 6.55, 9.25},
257 {0.00, 15.65, 14.65, 15.25, 12.75, 16.35, 12.85, 12.35, 14.65, 14.75, 12.65,
258 15.35, 16.85, 17.35, 16.35, 8.75, 10.05, 6.55, 0.35, 6.45, 8.55, 9.15,
259 7.25, 7.55, 8.05, 8.85, 10.05, 7.55, 5.35, 7.35, 5.75, 7.05, 9.05},
260 {0.00, 14.65, 13.35, 13.85, 11.85, 15.05, 12.05, 11.15, 13.35, 13.55, 11.85,
261 14.15, 16.05, 16.05, 15.05, 7.65, 8.75, 5.85, 3.55, 0.00, 7.35, 8.35,
262 6.85, 6.75, 7.15, 8.05, 8.95, 7.05, 5.35, 6.65, 5.25, 6.75, 8.15},
263 {0.00, 12.35, 15.05, 15.35, 13.15, 16.45, 13.15, 12.15, 14.75, 15.05, 13.25,
264 15.65, 17.25, 17.25, 16.25, 8.75, 9.65, 7.15, 4.55, 6.85, 8.75, 9.85,
265 7.75, 0.00, 8.65, 9.15, 10.05, 8.05, 6.55, 8.15, 6.45, 7.75, 9.85},
266 {0.00, 13.75, 14.25, 14.35, 12.75, 15.85, 12.65, 11.55, 14.85, 14.15, 12.35,
267 15.45, 16.55, 16.85, 15.55, 8.75, 9.85, 6.05, 3.75, 5.85, 7.65, 9.15,
268 7.05, 7.35, 7.55, 8.05, 9.15, 7.45, 5.55, 7.05, 5.35, 6.55, 8.35},
269 {0.00, 15.05, 13.65, 14.55, 12.65, 15.55, 12.55, 11.55, 14.15, 14.35, 12.35,
270 14.65, 16.25, 17.05, 15.35, 8.25, 9.25, 6.55, 4.05, 6.25, 8.25, 8.85,
271 7.35, 7.55, 8.05, 8.65, 9.65, 7.75, 6.25, 6.75, 5.85, 6.55, 8.55},
272 {0.00, 16.05, 15.05, 15.35, 13.65, 16.55, 13.55, 12.55, 15.35, 15.35, 13.25,
273 16.15, 17.55, 18.05, 16.55, 9.05, 10.35, 6.85, 4.25, 6.95, 8.55, 9.75,
274 8.05, 8.15, 8.35, 8.95, 10.15, 8.05, 6.55, 7.65, 6.15, 7.55, 9.55},
275 {0.00, 15.75, 14.35, 15.05, 12.55, 16.05, 13.05, 12.25, 14.75, 14.85, 12.75,
276 15.75, 17.25, 17.35, 16.05, 8.85, 9.85, 6.45, 4.55, 6.55, 8.55, 9.35,
277 7.55, 7.85, 8.05, 8.75, 10.05, 8.05, 6.05, 7.35, 5.65, 7.15, 8.85},
278 {0.00, 15.75, 14.65, 15.05, 13.15, 16.05, 13.15, 12.25, 14.85, 14.55, 12.75,
279 15.75, 17.05, 17.15, 15.95, 8.85, 9.85, 6.25, 4.35, 6.35, 8.55, 9.75,
280 7.65, 7.85, 8.25, 8.75, 9.75, 7.75, 6.15, 7.15, 5.35, 7.15, 9.35},
281 {0.00, 16.65, 15.15, 15.55, 13.55, 17.15, 13.85, 12.85, 15.65, 15.55, 13.65,
282 16.55, 18.15, 18.25, 16.75, 9.85, 10.85, 6.95, 4.65, 6.65, 8.85, 10.05,
283 8.05, 8.25, 8.75, 9.55, 10.35, 8.35, 6.35, 7.85, 6.05, 7.85, 9.85},
284 {0.00, 16.25, 15.75, 16.05, 13.45, 17.35, 12.85, 12.55, 15.55, 15.55, 13.15,
285 16.15, 17.45, 17.85, 16.35, 9.35, 10.55, 7.15, 4.15, 6.85, 8.55, 9.45,
286 7.35, 8.05, 8.75, 8.75, 10.05, 7.85, 5.55, 6.85, 5.45, 7.15, 9.45},
287 {0.00, 15.65, 14.75, 14.85, 13.05, 16.65, 13.75, 12.05, 14.55, 14.85, 13.15,
288 16.15, 17.55, 17.75, 16.55, 9.35, 10.35, 6.75, 4.65, 6.85, 8.75, 9.65,
289 8.05, 7.85, 8.25, 8.55, 10.05, 8.15, 6.35, 7.55, 5.85, 7.55, 9.35},
290 {0.00, 16.25, 14.85, 15.25, 13.25, 16.45, 13.65, 12.65, 15.05, 15.05, 13.25,
291 16.15, 17.65, 18.05, 16.85, 9.25, 10.25, 6.75, 4.65, 6.85, 8.85, 9.75,
292 7.75, 8.15, 8.65, 8.75, 10.35, 8.35, 6.55, 7.85, 6.35, 7.65, 9.55},
293 {0.00, 14.05, 12.85, 13.05, 11.55, 14.35, 11.55, 10.85, 13.05, 13.15, 11.25,
294 14.05, 14.75, 15.35, 14.15, 7.35, 8.65, 5.55, 3.55, 5.45, 7.55, 8.15,
295 6.65, 7.15, 7.15, 7.75, 8.85, 6.75, 5.35, 6.55, 5.05, 6.65, 8.05},
296 {0.00, 14.05, 13.05, 13.55, 11.35, 14.75, 11.65, 10.55, 13.55, 12.65, 11.45,
297 13.75, 15.55, 15.85, 14.45, 7.65, 8.85, 5.55, 3.55, 5.35, 7.15, 8.35,
298 6.65, 7.05, 7.15, 7.65, 8.75, 6.85, 5.35, 6.65, 4.45, 6.75, 8.15},
299 {0.00, 14.55, 13.55, 14.05, 12.05, 15.25, 11.75, 10.35, 13.35, 13.55, 11.35,
300 14.05, 15.85, 16.35, 15.35, 7.65, 8.65, 5.25, 3.35, 5.75, 7.55, 8.25,
301 6.55, 6.85, 7.05, 7.35, 8.55, 6.85, 5.55, 6.15, 4.65, 6.05, 7.75},
302 {0.00, 14.05, 12.75, 13.75, 11.35, 14.35, 11.85, 10.25, 13.35, 13.45, 11.25,
303 14.35, 16.05, 15.75, 14.65, 7.55, 8.35, 5.15, 2.95, 5.35, 7.55, 8.25,
304 6.55, 7.05, 7.35, 7.75, 8.65, 6.65, 5.05, 7.05, 4.55, 5.85, 7.75},
305 {0.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
306 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
307 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00},
308 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
309 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
310 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00}};
311
312 // Constructing the map (equipmentId, asic address, channel) -> (tot shift)
313 for (uint16_t comp = 0; comp < numComp; comp++) {
314 uint16_t equipment = eqId[comp];
315 for (uint16_t elink = 0; elink < numElinksPerComp; elink++) {
316 uint32_t address = TRBaddresses[elink];
317 fReadoutMap[equipment][address].resize(numChanPerElink);
318 for (uint16_t chan = 0; chan < numChanPerElink; chan++) {
319 fReadoutMap[equipment][address][chan] = ToTshifts[elink][chan];
320 } //# channel
321 } //# elink
322 } //# component
323 }
324 // ------------------------------------------------------------------------------------
325
326
327 // --- Mapping (equimentId, trb address, channel) -> (tot shift) --------------------
328 double ReadoutConfig::Map(uint16_t equipmentId, uint32_t address, uint16_t chan)
329 {
330 double result = -1.;
331 auto equipIter = fReadoutMap.find(equipmentId);
332 if (equipIter != fReadoutMap.end()) {
333 auto elinkMap = equipIter->second;
334 auto elinkIter = elinkMap.find(address);
335 if (elinkIter != elinkMap.end()) {
336 if (chan < elinkIter->second.size()) {
337 result = elinkIter->second.at(chan);
338 }
339 }
340 }
341 return result;
342 }
343 // ------------------------------------------------------------------------------------
344
345 // --- Returns map (trb address, channel) -> (tot shift) ----------------------------
346 std::map<uint32_t, std::vector<double>> ReadoutConfig::Map(uint16_t equipmentId)
347 {
348 std::map<uint32_t, std::vector<double>> result;
349 auto equipIter = fReadoutMap.find(equipmentId);
350 if (equipIter != fReadoutMap.end()) {
351 result = equipIter->second;
352 }
353 return result;
354 }
355 // ------------------------------------------------------------------------------------
356
357
358 // ----- Print readout map ------------------------------------------------
360 {
361 std::stringstream ss;
362 for (auto& equipment : fReadoutMap) {
363 uint16_t eqId = equipment.first;
364 for (auto& trb : equipment.second) {
365 uint32_t address = trb.first;
366 std::vector<double>& shifts = trb.second;
367 for (size_t channel = 0; channel < shifts.size(); channel++) {
368 ss << "\n Equipment " << eqId << " trb address " << setw(2) << address;
369 ss << " channel " << setw(2) << channel << " tot shift " << shifts.at(channel);
370 }
371 }
372 }
373 return ss.str();
374 }
375 // ----------------------------------------------------------------------------
376
377} // namespace cbm::algo::rich
double Map(uint16_t equipmentId, uint32_t address, uint16_t chan)
API: Mapping from component, address and channel to tot shift.
void Init()
Initialisation of readout map.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
size_t GetNumElinks()
Total number of elinks for RICH.
std::map< uint16_t, std::map< uint32_t, std::vector< double > > > fReadoutMap
std::string PrintReadoutMap()
Debug output of readout map.