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 = 87; // Number of elinks per component (74 mRICH, 5 FSD/NCAL, 8 PASTA)
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, 0x7903, 0x7904,
82 0x7905, 0x9991, 0x9992, 0x9993, 0x9994, 0x9995, 0x9996, 0x9997, 0x9998};
83 // TRBaddresses 0x7901 and 0x7902 are for FSD/NCAL
84 // TRBaddresses 0x9991 to 0x9998 are for PASTA
85
86 double ToTshifts[numElinksPerComp][numChanPerElink] = {
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, 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,
90 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},
91 {0.00, 17.25, 16.25, 16.85, 14.75, 17.35, 14.45, 14.05, 16.15, 16.55, 14.25,
92 17.25, 18.55, 19.05, 17.25, 10.25, 11.45, 7.55, 5.85, 7.75, 9.85, 11.25,
93 8.85, 9.15, 9.75, 10.45, 11.25, 9.05, 7.85, 8.55, 6.75, 8.75, 10.45},
94 {0.00, 15.65, 14.35, 14.75, 12.55, 15.55, 12.75, 11.75, 14.25, 14.45, 12.65,
95 15.15, 16.85, 17.05, 15.55, 8.55, 10.05, 6.35, 4.25, 6.15, 8.15, 9.05,
96 7.25, 7.35, 7.75, 8.55, 9.55, 7.65, 6.25, 7.65, 5.25, 7.55, 9.25},
97 {0.00, 14.35, 13.75, 13.65, 11.75, 15.35, 12.35, 11.35, 14.05, 13.75, 11.85,
98 14.45, 16.25, 16.25, 14.55, 7.95, 9.15, 5.95, 0.00, 6.15, 7.65, 0.00,
99 6.85, 7.05, 7.25, 7.85, 9.15, 6.75, 5.85, 6.85, 5.05, 6.25, 7.85},
100 {0.00, 14.65, 13.45, 14.05, 12.25, 15.25, 12.15, 11.05, 13.85, 13.65, 11.85,
101 14.55, 16.05, 16.15, 15.05, 7.65, 9.15, 6.05, 4.05, 0.00, 7.75, 8.85,
102 7.25, 7.15, 7.55, 8.05, 9.25, 7.15, 5.55, 6.85, 5.25, 6.95, 8.75},
103 {0.00, 16.35, 15.05, 15.35, 13.25, 16.75, 13.15, 11.75, 15.05, 15.05, 13.15,
104 16.05, 17.55, 17.25, 16.15, 9.15, 9.05, 0.00, 4.75, 6.75, 8.95, 9.75,
105 7.65, 8.25, 8.55, 9.15, 10.25, 8.25, 6.65, 8.05, 5.75, 7.15, 10.25},
106 {0.00, 17.65, 16.45, 16.65, 14.35, 18.35, 14.85, 13.75, 16.55, 16.25, 14.35,
107 17.25, 19.05, 19.55, 17.75, 10.35, 11.55, 7.95, 5.55, 7.45, 9.85, 10.85,
108 8.75, 9.35, 9.75, 9.85, 11.35, 9.35, 7.35, 10.05, 5.05, 8.65, 10.75},
109 {0.00, 17.05, 16.25, 16.85, 14.65, 17.65, 14.75, 13.65, 16.25, 15.85, 14.15,
110 17.25, 18.75, 18.75, 17.25, 10.15, 11.15, 7.25, 5.05, 7.55, 9.55, 10.05,
111 8.15, 8.85, 9.35, 9.55, 10.35, 8.75, 6.75, 7.85, 6.35, 8.25, 10.05},
112 {0.00, 17.35, 16.25, 15.05, 14.35, 17.15, 14.55, 12.75, 0.00, 16.35, 13.75,
113 16.85, 18.35, 17.55, 17.05, 9.85, 11.25, 7.55, 5.85, 7.85, 9.15, 10.65,
114 8.45, 8.45, 0.00, 9.65, 9.55, 0.00, 5.95, 7.95, 6.55, 7.65, 10.05},
115 {0.00, 16.55, 15.55, 15.85, 13.35, 17.35, 13.75, 12.65, 15.25, 15.55, 13.55,
116 16.65, 17.85, 18.35, 16.85, 9.35, 10.75, 7.35, 4.55, 6.95, 8.85, 9.85,
117 8.25, 8.35, 8.75, 9.35, 10.05, 8.45, 6.85, 7.75, 6.35, 8.05, 9.85},
118 {0.00, 16.35, 15.05, 15.65, 13.35, 16.65, 13.75, 11.95, 15.05, 15.25, 13.05,
119 15.85, 17.65, 17.85, 16.55, 9.15, 10.55, 7.25, 4.75, 6.75, 8.65, 9.65,
120 7.85, 8.25, 8.15, 9.25, 10.45, 8.35, 6.65, 8.05, 6.25, 8.05, 9.85},
121 {0.00, 15.55, 14.55, 14.75, 12.75, 16.15, 12.85, 11.65, 14.35, 14.35, 12.75,
122 15.45, 17.15, 17.35, 15.95, 8.85, 9.75, 6.65, 4.35, 6.55, 8.55, 9.35,
123 7.65, 7.85, 8.35, 8.85, 10.05, 7.95, 6.35, 7.55, 5.25, 7.05, 9.05},
124 {0.00, 16.65, 15.35, 15.85, 13.55, 17.35, 13.65, 12.85, 16.05, 15.85, 13.75,
125 16.55, 17.65, 18.75, 16.85, 9.75, 10.65, 7.75, 5.05, 7.05, 9.05, 10.25,
126 8.35, 8.65, 9.35, 9.15, 10.05, 8.15, 7.25, 8.35, 6.25, 7.85, 9.65},
127 {0.00, 16.55, 15.55, 15.75, 13.75, 17.25, 13.85, 12.85, 15.65, 15.55, 13.65,
128 16.35, 18.05, 18.35, 17.25, 9.55, 10.95, 7.15, 4.85, 7.15, 9.15, 10.35,
129 8.05, 8.55, 9.15, 9.25, 10.45, 8.55, 6.75, 8.25, 6.25, 7.95, 9.85},
130 {0.00, 16.55, 15.65, 15.85, 13.85, 17.05, 14.05, 12.55, 15.55, 15.75, 13.75,
131 16.35, 18.05, 18.35, 17.15, 9.35, 10.55, 7.35, 4.85, 7.45, 9.25, 10.55,
132 8.35, 8.65, 9.15, 9.75, 10.75, 8.75, 6.85, 8.35, 6.55, 8.05, 10.05},
133 {0.00, 15.35, 13.95, 13.85, 12.15, 15.85, 12.55, 11.35, 14.15, 14.15, 12.25,
134 15.15, 16.45, 17.05, 15.05, 8.35, 9.55, 6.15, 3.25, 5.85, 7.75, 8.75,
135 7.15, 7.05, 7.75, 8.25, 9.15, 7.35, 6.05, 6.85, 5.05, 7.55, 8.55},
136 {0.00, 14.15, 13.55, 13.45, 11.45, 14.25, 12.05, 10.55, 13.25, 13.65, 11.25,
137 14.25, 16.05, 16.15, 15.05, 7.85, 9.05, 5.75, 3.65, 6.05, 7.75, 8.55,
138 6.95, 6.35, 7.35, 8.15, 9.05, 7.05, 5.65, 6.35, 4.65, 6.65, 8.75},
139 {0.00, 13.35, 12.85, 13.25, 10.85, 14.55, 11.75, 10.05, 13.15, 12.55, 10.85,
140 13.75, 15.55, 15.35, 14.55, 7.45, 8.45, 5.25, 3.05, 5.35, 6.75, 8.15,
141 6.55, 6.75, 6.95, 7.65, 8.35, 6.45, 4.85, 5.95, 4.35, 5.65, 7.65},
142 {0.00, 14.35, 12.95, 13.65, 11.25, 14.85, 11.65, 10.85, 13.35, 13.05, 11.35,
143 14.35, 15.55, 16.35, 14.85, 7.35, 8.35, 5.85, 3.15, 5.35, 7.25, 8.55,
144 6.65, 6.55, 7.35, 7.85, 8.85, 6.55, 5.05, 6.05, 4.55, 6.05, 7.95},
145 {0.00, 14.65, 13.85, 13.95, 12.35, 15.25, 12.25, 11.05, 13.85, 14.05, 12.15,
146 14.75, 16.55, 16.85, 15.85, 8.15, 9.35, 5.75, 3.65, 5.85, 8.15, 9.05,
147 7.25, 7.25, 7.95, 8.05, 9.65, 7.05, 6.05, 6.85, 5.45, 6.85, 8.65},
148 {0.00, 14.55, 13.25, 14.75, 12.25, 15.55, 12.85, 11.45, 14.35, 14.15, 12.55,
149 15.05, 16.85, 16.65, 15.75, 8.25, 9.55, 6.05, 4.15, 6.15, 8.35, 9.05,
150 0.00, 7.65, 8.15, 8.65, 9.55, 7.75, 6.05, 7.25, 5.25, 6.65, 8.65},
151 {0.00, 16.65, 15.05, 16.35, 14.15, 16.85, 13.55, 12.85, 15.65, 15.55, 13.25,
152 16.15, 17.65, 18.05, 17.05, 9.05, 11.05, 7.35, 4.55, 7.35, 9.05, 10.15,
153 8.55, 8.85, 9.15, 9.75, 10.55, 8.85, 7.25, 8.35, 6.35, 8.65, 10.05},
154 {0.00, 14.55, 13.75, 14.55, 12.15, 15.05, 12.15, 11.35, 13.75, 13.75, 11.75,
155 14.75, 16.65, 16.65, 15.15, 8.25, 8.85, 6.35, 3.85, 6.25, 8.05, 8.95,
156 7.55, 0.00, 7.75, 8.35, 9.55, 7.65, 5.85, 6.35, 5.85, 7.25, 8.45},
157 {0.00, 14.75, 13.35, 14.35, 12.65, 15.65, 12.75, 11.75, 14.25, 14.35, 12.05,
158 14.75, 16.05, 16.65, 15.55, 8.65, 9.35, 6.15, 4.15, 6.15, 7.85, 9.15,
159 0.00, 7.55, 7.95, 8.15, 9.35, 7.05, 5.85, 6.75, 5.25, 6.75, 8.85},
160 {0.00, 16.15, 15.05, 15.35, 13.25, 16.85, 13.55, 12.75, 15.35, 15.35, 13.55,
161 16.35, 17.65, 18.15, 16.95, 9.55, 10.75, 7.05, 4.85, 6.85, 9.15, 9.85,
162 8.05, 8.35, 8.75, 9.25, 10.05, 8.65, 6.55, 8.05, 6.55, 8.05, 9.75},
163 {0.00, 16.85, 15.55, 16.15, 13.75, 17.25, 14.25, 13.15, 15.75, 16.05, 14.05,
164 16.75, 18.35, 18.85, 17.15, 9.85, 10.85, 7.55, 5.35, 7.35, 9.65, 10.55,
165 8.65, 8.85, 9.35, 9.55, 10.85, 9.05, 7.15, 8.35, 6.65, 8.25, 10.45},
166 {0.00, 16.85, 15.75, 15.85, 13.85, 17.25, 14.35, 13.05, 15.75, 15.85, 13.95,
167 16.85, 18.35, 18.75, 17.35, 10.05, 10.75, 7.75, 5.35, 7.35, 9.45, 10.75,
168 8.75, 9.05, 9.35, 10.05, 11.05, 9.05, 7.35, 8.65, 6.75, 8.45, 10.55},
169 {0.00, 15.35, 13.75, 14.35, 12.55, 15.75, 12.65, 11.55, 14.35, 14.55, 12.75,
170 15.05, 16.55, 17.05, 16.05, 8.55, 9.55, 6.15, 3.75, 6.15, 8.15, 8.95,
171 7.35, 7.55, 8.15, 8.25, 9.55, 7.45, 5.65, 7.05, 5.45, 6.85, 8.75},
172 {0.00, 16.85, 15.55, 15.75, 13.65, 17.65, 13.75, 12.65, 15.55, 15.35, 13.55,
173 16.75, 18.05, 18.35, 17.45, 9.65, 10.35, 7.65, 5.15, 7.55, 9.35, 10.25,
174 8.75, 8.75, 9.15, 10.05, 10.55, 8.85, 7.15, 8.55, 7.05, 7.75, 10.55},
175 {0.00, 15.45, 14.45, 14.85, 12.55, 16.05, 12.95, 11.35, 14.45, 14.65, 12.85,
176 15.55, 17.25, 17.65, 16.05, 8.55, 9.65, 6.65, 4.05, 6.55, 8.35, 9.25,
177 7.65, 7.65, 8.35, 8.65, 9.95, 7.85, 6.05, 7.55, 5.95, 7.25, 8.85},
178 {0.00, 16.35, 15.05, 15.55, 13.65, 16.75, 13.75, 12.25, 15.15, 15.05, 13.25,
179 15.95, 17.55, 18.05, 16.75, 9.25, 10.25, 7.05, 4.15, 6.95, 8.65, 10.05,
180 8.15, 7.95, 8.95, 9.15, 10.55, 8.25, 6.65, 7.75, 6.85, 7.85, 9.55},
181 {0.00, 15.05, 13.85, 14.15, 12.35, 15.35, 12.35, 11.35, 14.05, 14.35, 12.25,
182 14.85, 16.25, 16.95, 15.65, 8.75, 9.35, 6.55, 4.15, 6.05, 7.75, 8.65,
183 6.75, 7.55, 8.15, 8.35, 9.05, 7.25, 5.75, 7.05, 5.05, 6.85, 8.75},
184 {0.00, 16.25, 15.75, 15.35, 13.75, 16.85, 13.65, 12.35, 15.55, 15.05, 13.25,
185 16.05, 17.75, 17.85, 16.55, 9.35, 10.35, 7.25, 5.35, 7.25, 8.85, 10.05,
186 8.45, 8.35, 8.55, 9.35, 10.25, 8.35, 6.25, 7.75, 5.85, 7.75, 9.75},
187 {0.00, 14.15, 13.05, 13.35, 11.25, 14.55, 11.55, 10.35, 12.85, 12.85, 10.45,
188 13.35, 14.75, 15.55, 13.85, 6.85, 8.05, 5.35, 3.65, 5.45, 7.55, 8.05,
189 6.15, 6.35, 6.95, 7.25, 8.15, 6.35, 4.15, 5.55, 4.05, 5.65, 7.35},
190 {0.00, 14.05, 12.75, 13.25, 11.45, 14.35, 11.55, 10.45, 12.45, 12.45, 11.35,
191 13.75, 15.25, 15.55, 14.25, 7.35, 8.65, 5.35, 3.35, 5.05, 6.75, 7.75,
192 6.45, 6.05, 6.65, 7.25, 8.25, 5.55, 4.75, 6.05, 3.75, 5.65, 7.85},
193 {0.00, 16.65, 15.45, 15.75, 13.15, 16.85, 13.75, 12.15, 15.05, 15.05, 12.85,
194 16.55, 18.05, 18.25, 16.35, 9.55, 10.35, 7.15, 5.05, 6.45, 8.55, 10.05,
195 7.75, 7.75, 8.25, 8.85, 10.15, 8.05, 6.65, 7.55, 5.75, 7.55, 9.85},
196 {0.00, 14.05, 12.85, 13.75, 11.35, 14.55, 11.25, 10.85, 13.35, 13.55, 11.15,
197 14.15, 15.65, 16.05, 14.55, 8.05, 8.75, 5.05, 3.75, 5.35, 7.55, 8.25,
198 6.35, 6.45, 7.05, 7.75, 8.75, 6.25, 4.75, 6.35, 4.45, 6.05, 8.25},
199 {0.00, 17.45, 15.85, 16.35, 14.55, 17.85, 14.75, 13.55, 15.85, 16.25, 14.45,
200 16.25, 18.75, 19.05, 17.35, 9.75, 10.95, 7.15, 5.35, 7.55, 9.25, 10.55,
201 8.75, 9.05, 9.05, 9.85, 11.15, 8.55, 7.55, 9.05, 6.55, 7.85, 10.05},
202 {0.00, 14.45, 13.65, 14.25, 12.05, 15.05, 11.75, 10.85, 13.65, 13.35, 11.85,
203 14.55, 16.25, 16.05, 15.35, 8.25, 8.55, 5.95, 3.75, 5.85, 7.65, 8.45,
204 6.65, 0.00, 7.55, 8.05, 8.85, 7.05, 5.45, 6.95, 5.35, 7.05, 0.00},
205 {0.00, 16.55, 15.55, 15.85, 13.55, 17.25, 13.85, 12.55, 15.65, 15.35, 13.05,
206 15.75, 18.05, 17.85, 16.55, 9.55, 10.85, 7.55, 5.15, 7.55, 9.35, 10.25,
207 8.05, 8.35, 9.05, 9.35, 10.65, 8.35, 6.95, 8.35, 6.85, 0.00, 10.25},
208 {0.00, 15.55, 14.45, 14.05, 12.25, 15.35, 12.35, 11.35, 14.15, 13.65, 11.95,
209 14.65, 16.35, 16.45, 15.35, 8.45, 9.75, 6.15, 3.85, 5.65, 7.35, 8.55,
210 7.15, 6.65, 7.15, 8.05, 9.05, 6.75, 5.25, 6.75, 4.85, 6.85, 8.25},
211 {0.00, 15.05, 13.65, 14.45, 12.05, 15.75, 12.25, 11.25, 14.25, 14.05, 12.05,
212 14.65, 16.35, 16.35, 15.55, 8.35, 9.65, 0.00, 4.15, 5.95, 8.05, 8.75,
213 7.05, 7.25, 7.75, 8.45, 9.35, 7.65, 5.95, 7.25, 6.05, 7.15, 9.15},
214 {0.00, 15.35, 13.75, 14.75, 12.25, 15.75, 12.05, 11.75, 14.35, 13.85, 12.55,
215 14.85, 16.85, 16.75, 15.75, 0.00, 9.45, 6.05, 3.35, 6.05, 8.05, 9.05,
216 7.25, 7.75, 7.85, 8.35, 9.45, 7.75, 6.15, 7.35, 5.75, 7.55, 9.55},
217 {0.00, 16.05, 14.75, 15.35, 13.05, 16.85, 13.55, 12.45, 15.05, 15.25, 13.05,
218 16.15, 17.55, 17.75, 16.35, 9.05, 10.05, 7.05, 4.75, 6.85, 9.15, 10.05,
219 8.05, 8.25, 8.85, 8.95, 10.05, 8.25, 6.55, 7.85, 6.05, 7.85, 9.55},
220 {0.00, 16.75, 15.55, 15.85, 13.75, 16.85, 13.75, 12.65, 15.15, 15.35, 13.25,
221 16.25, 17.95, 18.45, 16.75, 9.55, 10.65, 7.35, 5.15, 7.25, 9.35, 10.35,
222 8.65, 8.55, 9.25, 9.85, 10.55, 8.65, 7.05, 8.05, 6.05, 7.85, 10.05},
223 {0.00, 15.05, 13.65, 14.25, 12.25, 15.85, 12.55, 11.45, 14.35, 14.25, 12.05,
224 14.75, 16.25, 16.65, 15.25, 8.45, 9.35, 6.25, 4.05, 6.25, 8.15, 9.15,
225 7.55, 7.85, 8.05, 8.35, 9.35, 7.55, 5.85, 6.75, 5.35, 6.75, 8.45},
226 {0.00, 15.35, 14.25, 15.05, 12.55, 16.15, 13.05, 11.55, 14.35, 14.25, 12.75,
227 15.05, 16.85, 17.05, 15.65, 8.25, 9.55, 6.25, 4.25, 6.15, 8.25, 9.25,
228 7.45, 7.55, 7.85, 8.45, 9.65, 7.55, 5.85, 7.05, 5.25, 6.85, 8.65},
229 {0.00, 16.55, 15.25, 15.65, 13.55, 17.05, 13.85, 12.65, 15.25, 15.25, 13.75,
230 16.35, 17.85, 18.15, 16.75, 9.25, 10.35, 7.05, 4.75, 6.85, 8.85, 10.05,
231 8.05, 8.25, 8.65, 9.35, 0.00, 8.25, 6.85, 7.85, 6.25, 7.55, 10.05},
232 {0.00, 15.35, 14.25, 14.55, 12.35, 15.75, 12.65, 11.65, 14.25, 14.55, 12.35,
233 15.15, 16.55, 17.05, 15.55, 8.65, 9.65, 6.05, 4.05, 5.85, 8.05, 9.05,
234 7.25, 7.35, 7.75, 8.15, 9.15, 7.45, 5.25, 6.85, 5.25, 6.65, 8.55},
235 {0.00, 16.55, 15.55, 15.85, 13.75, 17.05, 13.75, 12.65, 16.05, 15.45, 14.15,
236 16.35, 18.05, 18.35, 17.05, 9.55, 10.55, 7.75, 5.25, 7.35, 9.75, 10.65,
237 8.45, 9.15, 9.05, 10.05, 10.35, 8.65, 7.25, 7.85, 6.25, 7.85, 9.55},
238 {0.00, 15.35, 14.55, 14.65, 12.95, 16.05, 13.05, 11.75, 14.65, 14.35, 12.75,
239 15.35, 16.85, 17.35, 16.05, 8.35, 9.55, 6.65, 4.05, 6.25, 8.25, 9.25,
240 7.35, 8.15, 8.15, 8.65, 9.65, 7.75, 5.85, 7.25, 5.75, 7.05, 8.75},
241 {0.00, 15.05, 13.45, 13.75, 11.85, 15.25, 12.25, 10.55, 13.55, 13.55, 12.15,
242 14.45, 15.85, 15.65, 15.05, 8.15, 9.35, 5.85, 3.75, 5.75, 7.35, 8.55,
243 7.05, 6.65, 7.55, 7.85, 8.65, 6.85, 5.55, 6.75, 5.05, 6.85, 8.55},
244 {0.00, 16.55, 15.45, 16.05, 13.75, 16.75, 13.75, 12.75, 15.45, 15.35, 13.35,
245 16.25, 17.65, 17.85, 16.85, 9.65, 10.35, 7.55, 5.05, 7.25, 9.05, 10.05,
246 8.35, 8.25, 9.05, 9.65, 10.35, 8.35, 6.95, 8.15, 6.75, 8.25, 10.05},
247 {0.00, 13.75, 12.85, 13.15, 11.15, 14.25, 11.55, 10.35, 12.95, 12.65, 10.85,
248 13.85, 15.05, 16.05, 14.35, 7.15, 8.55, 5.35, 3.15, 5.65, 7.15, 8.05,
249 6.35, 6.35, 6.85, 7.35, 8.15, 6.45, 4.55, 6.55, 5.35, 6.65, 7.95},
250 {0.00, 15.05, 13.45, 14.55, 12.25, 15.35, 12.75, 11.65, 14.25, 13.75, 12.25,
251 14.75, 16.55, 16.55, 16.05, 8.25, 10.05, 6.05, 3.95, 6.15, 8.15, 9.05,
252 7.15, 7.25, 8.05, 8.35, 9.35, 7.55, 6.05, 7.15, 5.55, 7.05, 8.65},
253 {0.00, 17.05, 15.55, 16.55, 14.25, 17.85, 14.65, 13.55, 16.55, 16.65, 14.55,
254 17.35, 18.85, 19.35, 18.05, 10.35, 11.05, 7.25, 5.35, 7.55, 10.05, 10.75,
255 9.05, 9.35, 9.85, 10.05, 11.25, 9.45, 7.85, 9.15, 7.45, 9.35, 11.25},
256 {0.00, 14.65, 13.35, 14.35, 11.85, 15.35, 12.55, 11.55, 14.15, 14.15, 12.35,
257 15.05, 16.35, 16.75, 15.25, 8.45, 9.05, 6.25, 3.55, 3.75, 7.85, 8.45,
258 6.75, 7.35, 7.85, 8.15, 9.05, 7.45, 5.55, 7.15, 5.05, 6.55, 9.25},
259 {0.00, 15.65, 14.65, 15.25, 12.75, 16.35, 12.85, 12.35, 14.65, 14.75, 12.65,
260 15.35, 16.85, 17.35, 16.35, 8.75, 10.05, 6.55, 0.35, 6.45, 8.55, 9.15,
261 7.25, 7.55, 8.05, 8.85, 10.05, 7.55, 5.35, 7.35, 5.75, 7.05, 9.05},
262 {0.00, 14.65, 13.35, 13.85, 11.85, 15.05, 12.05, 11.15, 13.35, 13.55, 11.85,
263 14.15, 16.05, 16.05, 15.05, 7.65, 8.75, 5.85, 3.55, 0.00, 7.35, 8.35,
264 6.85, 6.75, 7.15, 8.05, 8.95, 7.05, 5.35, 6.65, 5.25, 6.75, 8.15},
265 {0.00, 12.35, 15.05, 15.35, 13.15, 16.45, 13.15, 12.15, 14.75, 15.05, 13.25,
266 15.65, 17.25, 17.25, 16.25, 8.75, 9.65, 7.15, 4.55, 6.85, 8.75, 9.85,
267 7.75, 0.00, 8.65, 9.15, 10.05, 8.05, 6.55, 8.15, 6.45, 7.75, 9.85},
268 {0.00, 13.75, 14.25, 14.35, 12.75, 15.85, 12.65, 11.55, 14.85, 14.15, 12.35,
269 15.45, 16.55, 16.85, 15.55, 8.75, 9.85, 6.05, 3.75, 5.85, 7.65, 9.15,
270 7.05, 7.35, 7.55, 8.05, 9.15, 7.45, 5.55, 7.05, 5.35, 6.55, 8.35},
271 {0.00, 15.05, 13.65, 14.55, 12.65, 15.55, 12.55, 11.55, 14.15, 14.35, 12.35,
272 14.65, 16.25, 17.05, 15.35, 8.25, 9.25, 6.55, 4.05, 6.25, 8.25, 8.85,
273 7.35, 7.55, 8.05, 8.65, 9.65, 7.75, 6.25, 6.75, 5.85, 6.55, 8.55},
274 {0.00, 16.05, 15.05, 15.35, 13.65, 16.55, 13.55, 12.55, 15.35, 15.35, 13.25,
275 16.15, 17.55, 18.05, 16.55, 9.05, 10.35, 6.85, 4.25, 6.95, 8.55, 9.75,
276 8.05, 8.15, 8.35, 8.95, 10.15, 8.05, 6.55, 7.65, 6.15, 7.55, 9.55},
277 {0.00, 15.75, 14.35, 15.05, 12.55, 16.05, 13.05, 12.25, 14.75, 14.85, 12.75,
278 15.75, 17.25, 17.35, 16.05, 8.85, 9.85, 6.45, 4.55, 6.55, 8.55, 9.35,
279 7.55, 7.85, 8.05, 8.75, 10.05, 8.05, 6.05, 7.35, 5.65, 7.15, 8.85},
280 {0.00, 15.75, 14.65, 15.05, 13.15, 16.05, 13.15, 12.25, 14.85, 14.55, 12.75,
281 15.75, 17.05, 17.15, 15.95, 8.85, 9.85, 6.25, 4.35, 6.35, 8.55, 9.75,
282 7.65, 7.85, 8.25, 8.75, 9.75, 7.75, 6.15, 7.15, 5.35, 7.15, 9.35},
283 {0.00, 16.65, 15.15, 15.55, 13.55, 17.15, 13.85, 12.85, 15.65, 15.55, 13.65,
284 16.55, 18.15, 18.25, 16.75, 9.85, 10.85, 6.95, 4.65, 6.65, 8.85, 10.05,
285 8.05, 8.25, 8.75, 9.55, 10.35, 8.35, 6.35, 7.85, 6.05, 7.85, 9.85},
286 {0.00, 16.25, 15.75, 16.05, 13.45, 17.35, 12.85, 12.55, 15.55, 15.55, 13.15,
287 16.15, 17.45, 17.85, 16.35, 9.35, 10.55, 7.15, 4.15, 6.85, 8.55, 9.45,
288 7.35, 8.05, 8.75, 8.75, 10.05, 7.85, 5.55, 6.85, 5.45, 7.15, 9.45},
289 {0.00, 15.65, 14.75, 14.85, 13.05, 16.65, 13.75, 12.05, 14.55, 14.85, 13.15,
290 16.15, 17.55, 17.75, 16.55, 9.35, 10.35, 6.75, 4.65, 6.85, 8.75, 9.65,
291 8.05, 7.85, 8.25, 8.55, 10.05, 8.15, 6.35, 7.55, 5.85, 7.55, 9.35},
292 {0.00, 16.25, 14.85, 15.25, 13.25, 16.45, 13.65, 12.65, 15.05, 15.05, 13.25,
293 16.15, 17.65, 18.05, 16.85, 9.25, 10.25, 6.75, 4.65, 6.85, 8.85, 9.75,
294 7.75, 8.15, 8.65, 8.75, 10.35, 8.35, 6.55, 7.85, 6.35, 7.65, 9.55},
295 {0.00, 14.05, 12.85, 13.05, 11.55, 14.35, 11.55, 10.85, 13.05, 13.15, 11.25,
296 14.05, 14.75, 15.35, 14.15, 7.35, 8.65, 5.55, 3.55, 5.45, 7.55, 8.15,
297 6.65, 7.15, 7.15, 7.75, 8.85, 6.75, 5.35, 6.55, 5.05, 6.65, 8.05},
298 {0.00, 14.05, 13.05, 13.55, 11.35, 14.75, 11.65, 10.55, 13.55, 12.65, 11.45,
299 13.75, 15.55, 15.85, 14.45, 7.65, 8.85, 5.55, 3.55, 5.35, 7.15, 8.35,
300 6.65, 7.05, 7.15, 7.65, 8.75, 6.85, 5.35, 6.65, 4.45, 6.75, 8.15},
301 {0.00, 14.55, 13.55, 14.05, 12.05, 15.25, 11.75, 10.35, 13.35, 13.55, 11.35,
302 14.05, 15.85, 16.35, 15.35, 7.65, 8.65, 5.25, 3.35, 5.75, 7.55, 8.25,
303 6.55, 6.85, 7.05, 7.35, 8.55, 6.85, 5.55, 6.15, 4.65, 6.05, 7.75},
304 {0.00, 14.05, 12.75, 13.75, 11.35, 14.35, 11.85, 10.25, 13.35, 13.45, 11.25,
305 14.35, 16.05, 15.75, 14.65, 7.55, 8.35, 5.15, 2.95, 5.35, 7.55, 8.25,
306 6.55, 7.05, 7.35, 7.75, 8.65, 6.65, 5.05, 7.05, 4.55, 5.85, 7.75},
307 {0.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
308 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
309 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00},
310 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
311 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
312 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
313 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
314 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
315 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
316 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
317 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
318 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
319 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
320 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
321 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
322 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
323 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
324 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
325 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
326 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
327 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
328 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
329 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
330 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
331 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
332 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
333 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
334 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
335 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
336 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
337 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
338 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
339 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
340 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
341 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
342 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00},
343 {0.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
344 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00,
345 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.00}};
346
347 // Constructing the map (equipmentId, asic address, channel) -> (tot shift)
348 for (uint16_t comp = 0; comp < numComp; comp++) {
349 uint16_t equipment = eqId[comp];
350 for (uint16_t elink = 0; elink < numElinksPerComp; elink++) {
351 uint32_t address = TRBaddresses[elink];
352 fReadoutMap[equipment][address].resize(numChanPerElink);
353 for (uint16_t chan = 0; chan < numChanPerElink; chan++) {
354 fReadoutMap[equipment][address][chan] = ToTshifts[elink][chan];
355 } //# channel
356 } //# elink
357 } //# component
358 }
359 // ------------------------------------------------------------------------------------
360
361
362 // --- Mapping (equimentId, trb address, channel) -> (tot shift) --------------------
363 double ReadoutConfig::Map(uint16_t equipmentId, uint32_t address, uint16_t chan)
364 {
365 double result = -1.;
366 auto equipIter = fReadoutMap.find(equipmentId);
367 if (equipIter != fReadoutMap.end()) {
368 auto elinkMap = equipIter->second;
369 auto elinkIter = elinkMap.find(address);
370 if (elinkIter != elinkMap.end()) {
371 if (chan < elinkIter->second.size()) {
372 result = elinkIter->second.at(chan);
373 }
374 }
375 }
376 return result;
377 }
378 // ------------------------------------------------------------------------------------
379
380 // --- Returns map (trb address, channel) -> (tot shift) ----------------------------
381 std::map<uint32_t, std::vector<double>> ReadoutConfig::Map(uint16_t equipmentId)
382 {
383 std::map<uint32_t, std::vector<double>> result;
384 auto equipIter = fReadoutMap.find(equipmentId);
385 if (equipIter != fReadoutMap.end()) {
386 result = equipIter->second;
387 }
388 return result;
389 }
390 // ------------------------------------------------------------------------------------
391
392
393 // ----- Print readout map ------------------------------------------------
395 {
396 std::stringstream ss;
397 for (auto& equipment : fReadoutMap) {
398 uint16_t eqId = equipment.first;
399 for (auto& trb : equipment.second) {
400 uint32_t address = trb.first;
401 std::vector<double>& shifts = trb.second;
402 for (size_t channel = 0; channel < shifts.size(); channel++) {
403 ss << "\n Equipment " << eqId << " trb address " << setw(2) << address;
404 ss << " channel " << setw(2) << channel << " tot shift " << shifts.at(channel);
405 }
406 }
407 }
408 return ss.str();
409 }
410 // ----------------------------------------------------------------------------
411
412} // 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.