CbmRoot
Loading...
Searching...
No Matches
much/ReadoutConfig.cxx
Go to the documentation of this file.
1/* Copyright (C) 2017-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Ajit Kumar, Florian Uhlig [committer] */
4
5#include "ReadoutConfig.h"
6
8#include "CbmMuchAddress.h"
9
10#include <bitset>
11#include <unordered_set>
12
13using namespace std;
14
15namespace cbm::algo::much
16{
17 // --- Constructor ------------------------------------------------------------------
19 // ------------------------------------------------------------------------------------
20
21 // --- Destructor -----------------------------------------------------------------
23 // ------------------------------------------------------------------------------------
24
25 // --- Equipment IDs --------------------------------------------------------------
26 std::vector<uint16_t> ReadoutConfig::GetEquipmentIds()
27 {
28 std::vector<uint16_t> result;
29 for (auto& entry : fReadoutMap)
30 result.push_back(entry.first);
31 return result;
32 }
33 // ------------------------------------------------------------------------------------
34
35 // --- Number of elinks for a component / equipment -------------------------------
36 size_t ReadoutConfig::GetNumElinks(uint16_t equipmentId)
37 {
38 size_t result = 0;
39 auto it = fReadoutMap.find(equipmentId);
40 if (it != fReadoutMap.end()) result = fReadoutMap[equipmentId].size();
41 return result;
42 }
43 // ------------------------------------------------------------------------------------
44
45 // --- Mapping (equimentId, elink) -> address[channel] ------------------------------
46 std::vector<uint32_t> ReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId)
47 {
48 std::vector<uint32_t> result;
49 auto equipIter = fReadoutMap.find(equipmentId);
50 if (equipIter != fReadoutMap.end()) {
51 if (elinkId < equipIter->second.size()) {
52 result = equipIter->second.at(elinkId);
53 }
54 }
55 return result;
56 }
57 // ------------------------------------------------------------------------------------
58
59 // --- Mapping (equimentId, elink) -> (vector of mask flags) ------------------------
60 std::vector<bool> ReadoutConfig::MaskMap(uint16_t equipmentId, uint16_t elinkId)
61 {
62 std::vector<bool> result;
63 auto equipIter = fMaskMap.find(equipmentId);
64 if (equipIter != fMaskMap.end()) {
65 auto elinkMap = equipIter->second;
66 auto elinkIter = elinkMap.find(elinkId);
67 if (elinkIter != elinkMap.end()) {
68 result = elinkIter->second;
69 }
70 }
71 return result;
72 }
73 // ------------------------------------------------------------------------------------
74
75
77 {
78 // This here refers to the mCBM 2022 setup.
79 // Taken from CbmMuchUnpackPar in combination with macro/beamtime/mcbm2022/mMuchParUpto26052022.par
80
81 // Array to hold the unique IDs (equipment ID) for all MUCH DPBs
82 uint16_t eqId[numComp] = {0x2001, 0x2002, 0x2003, 0x1006, 0x1001, 0x1002, 0x1003};
83
84 // Mapping of eLink to FEB number within CROB. If -1, elink not used.
85 // This mapping is the same for each component.
86 const int16_t elink2Feb[numElinksPerCrob] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4,
87 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8};
88
89 // FEB IDs connected to GEM Module A
91 7, 8, -1, 10, 17, 9, 14, 11, -1, //Id for the connected FEB Position in DPB 1001 GEM Module A
92 -1, 5, -1, 16, 13, 12, -1, 15, -1, //Id for the connected FEB Position in DPB 1002 GEM Module A
93 -1, -1, -1, 4, 3, -1, -1, -7, -1}; //Id for the connected FEB Position in DPB 1003 GEM Module A (-7 is Pulser)
94
95 // FEB IDs connected to GEM Module B
97 6, 7, -1, -1, 14, 2, -1, -1, 1, //Id for the connected FEB Position in DPB 2001 GEM Module B
98 0, 16, -1, -1, 5, 8, 9, 4, 15, //Id for the connected FEB Position in DPB 2002 GEM Module B
99 -1, 10, -1, 17, 13, 11, 12, -1, 3}; //Id for the connected FEB Position in DPB 2003 GEM Module B
100
101 // FEB IDs connected to RPC Module
102 fnFebsIdsArrayRpc = {3, -1, -1, -1, 0, 1, -1, -1, 2}; //Id for the connected FEB Position in GEM Module B
103
104 // Addresses of masked channels, taken from mMuChNoisyChannelMarch2022.txt
105 std::unordered_set<uint32_t> maskedaddr = {
106 44302340, 1703940, 27066372, 1343492, 1310724, 177963012, 161251332, 185991172, 186056708, 186253316,
107 186417156, 144670724, 186286084, 153026564, 178159620, 144703492, 144736260, 26869764, 1933316, 10092548,
108 59736068, 35487748, 51970068, 43941892, 35586052, 59801604, 51314692, 52068356, 18481156, 144801796,
109 145162244, 144769028, 161644548, 153223172, 51445764, 68026372, 51347460, 51412996, 59834372, 59867140,
110 44171268, 85622804, 161611780, 59408420, 161218564, 153354244, 153157636, 161742852, 186220548, 94273540,
111 51281924, 51478532, 59670532, 68124676, 59768836, 68059140, 59899908, 59637764, 169410564, 153092100,
112 177831940, 186777604, 144637956, 161710084, 153059332, 161447940, 51249156, 68091908, 59703300, 186187780,
113 177897476, 9207844, 43745284, 27000836, 9109508, 884740, 1867780, 17825796, 1802244, 18972676,
114 27328516, 1671172, 1376260, 42860548, 1409028, 9666564, 1605636, 51544068, 59965444, 161546244,
115 1572868, 1441796, 60293124, 1507332, 9699332, 1474564, 169672708, 161284100, 186548228, 178094084,
116 186449924, 177930244, 153190404, 186384388, 153518084, 153255940, 169607172, 178028548, 186482692, 161677316,
117 153124868, 153485316, 145063940, 186318852, 153288708, 186515460, 178192388, 9764868, 9797636, 60227588,
118 51740676, 51773444, 169508868, 169476100, 177995780, 169639940, 178126852, 145031172, 169443332, 161349636,
119 145391620, 178061316, 186351620, 153321476, 153550852, 145096708, 153387012, 186810372, 178520068, 186646532,
120 186843140, 169541636, 177864708, 161480708, 178356228, 186875908, 145129476, 169902084, 169967620, 186580996,
121 178225156, 170000388, 186679300, 169836548, 186613764, 60260356, 170164228, 170033156, 9732100, 60194820,
122 18022404, 51806212, 85622788, 917508, 51838980, 60129300, 52035604, 52068372, 60162068, 52101140,
123 118620180, 118489108, 126910484, 60358676, 169869316, 161775620, 786468, 25821220};
124
125 // Init arrays which store positions of PADs
127
128 // Constructing the map (equipmentId, eLink, channel) -> (MUCH address)
129 uint16_t numElinksPerComp = numCrobPerComp * numElinksPerCrob;
130 uint16_t numFebsPerComp = numCrobPerComp * numFebsPerCrob;
131
132 for (uint16_t comp = 0; comp < numComp; comp++) {
133 uint16_t equipment = eqId[comp];
134 fReadoutMap[equipment].resize(numElinksPerComp);
135 for (uint16_t crob = 0; crob < numCrobPerComp; crob++) {
136 for (uint16_t elink = 0; elink < numElinksPerCrob; elink++) {
137
138 fReadoutMap[equipment][elink].resize(numChanPerAsic);
139 uint16_t elinkId = numElinksPerCrob * crob + elink; // elink within component
140 uint32_t febInCrob = elink2Feb[elinkId]; // FEB within CROB
141 uint32_t feb = comp * numFebsPerComp + febInCrob; // global FEB index
142 int32_t febId = GetFebId(feb); // FEB Id in MUCH addressing scheme
143
144 // Skip unconnected FEB slots
145 if (-1 < febId) {
146
147 for (uint16_t chanInAsic = 0; chanInAsic < numChanPerAsic; chanInAsic++) {
148 uint32_t channel = chanInAsic + numChanPerAsic * (feb % numAsicsPerFeb); //Fix this!
149 uint32_t address = CreateMuchAddress(comp, febId, channel);
150 fReadoutMap[equipment][elink][channel] = address;
151
152 // Apply channel mask
153 if (maskedaddr.count(address)) {
154 std::vector<bool>& chanMask = fMaskMap[equipment][elink];
155 if (chanMask.empty()) {
156 chanMask.resize(numChanPerAsic, false);
157 }
158 chanMask[channel] = true;
159 }
160 } //# channel
161 }
162 } //# elink
163 } //# CROB
164 } //# component
165 }
166
167 //To do address need to be checked carefully
168 uint32_t ReadoutConfig::CreateMuchAddress(uint32_t dpbidx, int32_t iFebId, uint32_t usChan)
169 {
170 // For generating Station number (GEM1 station = 0, GEM2 station = 1 and RPC station = 2)
172 int32_t station = -1;
173 int32_t layer = -1;
174 if (iFebId == -7) //Pulser FEB
175 {
176 station = 6; // for Pulser
177 layer = 0; //
178 }
179 else if (dpbidx == 0 || dpbidx == 1 || dpbidx == 2) //First 3 DPBs are for GEM-1
180 {
181 station = 0; // for mCBM setup
182 layer = 0; // Station 0 for GEM-A and station 1 for Module GEM-B
183 }
184 else if (dpbidx == 4 || dpbidx == 5 || dpbidx == 6) //Last 3 DPBs are for GEM-2 after 10/04/2022
185 {
186 station = 1; // for mCBM setup station
187 layer = 0; // 0 for Module GEM-A and 1 for Module GEM-B
188 }
189 else if (dpbidx == 3) {
190 station = 2; // for mCBM setup only one station
191 layer = 0; //
192 }
193 else {
194 LOG(warning) << "Wrong DPB Id x " << dpbidx;
195 return 0;
196 } //No address generated.
197
198 //Common layer side module will be 0 only for mCBM 2022
199 int32_t layerside = 0; // 0 in mCBM
200 int32_t sModule = 0; // 0 in mCBM
201
202 int32_t sSector = -9; //channel values are from 0-96 therefore as per CbmMuchAddress it is sector
203 int32_t sChannel = -9; //sector values are from 0-22 therefore as per CbmMuchAddress it is channel
204
205 // Channel flip in stsXYTER v2.1 : 0<->1, 2<->3, 3<->4 and so on...
206 auto fiFlag = 1;
207 if (fiFlag == 1) {
208 if (usChan % 2 == 0)
209 usChan = usChan + 1;
210 else
211 usChan = usChan - 1;
212 }
213
214 // PadX means CHANNEL for CbmMuchAddress
215 // PadY means SECTOR for CbmMuchAddress
216 // Due to two FLEX cable connected to single FEB; First Flex Connector number
217 // 1 - 63 and second flex connector number 64 - 127
218 //in few FEB positioned these flex connectors are flipped so below correction applied.
219 if (station == 0 && fiFlag == 1 && layer == 0) { // First layer (GEM1) has old readout PCB
220 if (iFebId == 0 || iFebId == 1 || iFebId == 2 || iFebId == 3 || iFebId == 4 || iFebId == 8 || iFebId == 9
221 || iFebId == 10 || iFebId == 11 || iFebId == 17) {
222 sChannel = GetPadXA(iFebId, 127 - usChan);
223 sSector = GetPadYA(iFebId, 127 - usChan);
224 }
225 else {
226 sChannel = GetPadXA(iFebId, usChan);
227 sSector = GetPadYA(iFebId, usChan);
228 }
229 }
230 else if (station == 1 && fiFlag == 1 && layer == 0) { // second layer (GEM2) has new readout PCB
231 if (iFebId == 0 || iFebId == 1 || iFebId == 2 || iFebId == 3 || iFebId == 4 || iFebId == 8 || iFebId == 9
232 || iFebId == 10 || iFebId == 11 || iFebId == 17) {
233 sChannel = GetPadXB(iFebId, 127 - usChan);
234 sSector = GetPadYB(iFebId, 127 - usChan);
235 }
236 else {
237 sChannel = GetPadXB(iFebId, usChan);
238 sSector = GetPadYB(iFebId, usChan);
239 }
240 }
241 else if (station == 0 || station == 1) { // Both layer with same type of PCB (Probably below is not necessary)
242 if (iFebId == 0 || iFebId == 1 || iFebId == 2 || iFebId == 3 || iFebId == 4 || iFebId == 8 || iFebId == 9
243 || iFebId == 10 || iFebId == 11 || iFebId == 17) {
244 sChannel = GetPadXA(iFebId, 127 - usChan);
245 sSector = GetPadYA(iFebId, 127 - usChan);
246 }
247 else {
248 sChannel = GetPadXA(iFebId, usChan);
249 sSector = GetPadYA(iFebId, usChan);
250 }
251 }
252 else if (station == 2) { //For RPC
253 sChannel = GetPadXRpc(iFebId, usChan);
254 sSector = GetPadYRpc(iFebId, usChan);
255 }
256 else // Checking for the not connected or misconnected pads
257 {
258 LOG(debug) << "Sector " << sSector << " channel " << sChannel << " is not connected or misconnected to pad. "
259 << " corresponding Feb is " << iFebId << " and uschan " << usChan << " DPB id " << dpbidx
260 << " Skipping this hit message.";
261 return 0;
262 }
263
264 //Creating Unique address of the particular channel of GEM
265 uint32_t address = CbmMuchAddress::GetAddress(station, layer, layerside, sModule, sSector, sChannel);
266 // LOG(debug) << "Raw address " << address;
267 address = CbmMuchAddress::SetElementId(address, 1, station);
268 // LOG(debug) << "After adding station " << address << " binary " << std::bitset<32>(address);
269 address = CbmMuchAddress::SetElementId(address, 2, layer);
270 // LOG(debug) << "After adding Layer " << address << " binary " << std::bitset<32>(address);
271 address = CbmMuchAddress::SetElementId(address, 3, layerside);
272 // LOG(debug) << "After adding Layer Side " << address << " binary " << std::bitset<32>(address);
273 address = CbmMuchAddress::SetElementId(address, 4, sModule);
274 // LOG(debug) << "After adding module " << address << " binary " << std::bitset<32>(address);
275 address = CbmMuchAddress::SetElementId(address, 5, sSector);
276 // LOG(debug) << "After adding sector " << address << " binary " << std::bitset<32>(address);
277 address = CbmMuchAddress::SetElementId(address, 6, sChannel);
278 // LOG(debug) << "After adding channel " << address << " binary " << std::bitset<32>(address);
279
280 return address;
281 }
282
283 int8_t ReadoutConfig::GetPadXA(uint8_t febid, uint8_t channelid)
284 {
285 if (fChannelsToPadXA.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) {
286 LOG(debug) << "ReadoutConfig::GetPadXA => Index out of bounds: " << ((febid * numChanPerAsic) + channelid)
287 << " VS " << fChannelsToPadXA.size() << " (" << static_cast<uint16_t>(febid) << ", " << numChanPerAsic
288 << " and " << static_cast<uint16_t>(channelid) << ")";
289
290 return -2;
291 }
292 return fChannelsToPadXA[(febid * numChanPerAsic) + channelid];
293 }
294
295 int8_t ReadoutConfig::GetPadYA(uint8_t febid, uint8_t channelid)
296 {
297 if (fChannelsToPadYA.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) {
298 LOG(debug) << "ReadoutConfig::GetPadYA => Index out of bounds: " << ((febid * numChanPerAsic) + channelid)
299 << " VS " << fChannelsToPadYA.size() << " (" << static_cast<uint16_t>(febid) << ", " << numChanPerAsic
300 << " and " << static_cast<uint16_t>(channelid) << ")";
301 return -2;
302 }
303 return fChannelsToPadYA[(febid * numChanPerAsic) + channelid];
304 }
305
306 int8_t ReadoutConfig::GetPadXB(uint8_t febid, uint8_t channelid)
307 {
308 if (fChannelsToPadXB.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) {
309 LOG(debug) << "ReadoutConfig::GetPadXB => Index out of bounds: " << ((febid * numChanPerAsic) + channelid)
310 << " VS " << fChannelsToPadXB.size() << " (" << febid << " and " << channelid << ")";
311 return -2;
312 }
313 return fChannelsToPadXB[(febid * numChanPerAsic) + channelid];
314 }
315
316 int8_t ReadoutConfig::GetPadYB(uint8_t febid, uint8_t channelid)
317 {
318 if (fChannelsToPadYB.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) {
319 LOG(debug) << "ReadoutConfig::GetPadYB => Index out of bounds: " << ((febid * numChanPerAsic) + channelid)
320 << " VS " << fChannelsToPadYB.size() << " (" << febid << " and " << channelid << ")";
321 return -2;
322 }
323 return fChannelsToPadYB[(febid * numChanPerAsic) + channelid];
324 }
325
326 int8_t ReadoutConfig::GetPadXRpc(uint8_t febid, uint8_t channelid)
327 {
328 if (fChannelsToPadXRpc.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) {
329 LOG(debug) << "CbmMcbm2018MuchPar::GetPadXRpc => Index out of bounds: " << ((febid * numChanPerAsic) + channelid)
330 << " VS " << fChannelsToPadXRpc.size() << " (" << febid << " and " << channelid << ")";
331 return -2;
332 }
333 return fChannelsToPadXRpc[(febid * numChanPerAsic) + channelid];
334 }
335
336 int8_t ReadoutConfig::GetPadYRpc(uint8_t febid, uint8_t channelid)
337 {
338 if (fChannelsToPadYRpc.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) {
339 LOG(debug) << "CbmMcbm2018MuchPar::GetPadYRpc => Index out of bounds: " << ((febid * numChanPerAsic) + channelid)
340 << " VS " << fChannelsToPadYRpc.size() << " (" << febid << " and " << channelid << ")";
341 return -2;
342 }
343 return fChannelsToPadYRpc[(febid * numChanPerAsic) + channelid];
344 }
345
346 int32_t ReadoutConfig::GetFebId(uint16_t uAsicIdx)
347 {
348 if (uAsicIdx >= numFebsInGemA && uAsicIdx < (numFebsInGemA + numFebsInRpc)) //Check
349 return fnFebsIdsArrayRpc[uAsicIdx - numFebsInGemA]; //Check Vikas
350 else if (uAsicIdx >= (numFebsInGemA + numFebsInRpc)
351 && uAsicIdx < (numFebsInGemA + numFebsInRpc + numFebsInGemB)) //Check
352 return fnFebsIdsArrayGemB[uAsicIdx - (numFebsInGemA + numFebsInRpc)];
353 else if (uAsicIdx < numFebsInGemA)
354 return fnFebsIdsArrayGemA[uAsicIdx];
355 else {
356 LOG(warning) << "ReadoutConfig::GetFebId => provided uAsicIdx : " << uAsicIdx
357 << " not in the range of :" << (numFebsInGemA + numFebsInRpc + numFebsInGemB)
358 << "Returning large value -2";
359 return -2;
360 }
361 }
362
364 {
365
366 // Array which stores the corresponding x position of PAD of RPC module
367 fChannelsToPadXRpc = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, //
368 1, 1, 1, 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, //
369 3, 2, 3, 3, 3, 3, 3, 3, 0, 3, 2, 3, 4, 4, 4, 1, //
370 4, 4, 4, 4, 4, 4, 3, 4, 2, 5, 1, 0, 5, 4, 5, 5, //
371 5, 5, 5, 5, 5, 5, 3, 5, 3, 2, 2, 4, 0, 1, -3, -3, //
372 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 3, 5, 1, 2, //
373 7, 0, 7, 7, 7, 7, 4, 7, 7, 5, 7, 7, 7, 7, 5, 6, //
374 0, 1, 3, 2, 8, 6, 8, 8, 8, 8, 3, 8, 8, 4, 8, 8, //
375 //
376 8, 8, 5, 0, 6, 1, 7, 7, 9, 9, 9, 0, 4, 2, 9, 9, //
377 9, 3, 9, 9, 9, 9, 4, 9, 3, 4, 0, 2, 5, 1, 5, 5, //
378 6, 6, 6, 6, 7, 7, 7, 7, 8, 7, 8, 8, 8, 8, 2, 1, //
379 4, 3, 6, 5, 0, 7, 8, 1, 9, 9, 9, 2, 3, 8, 5, 4, //
380 0, 6, 1, 8, 7, 2, 9, 9, 4, 3, 6, 5, 8, 7, 6, 7, //
381 4, 5, 2, 3, 0, 1, 8, 8, 9, 9, 9, 9, 4, 9, 6, 5, //
382 8, 7, 9, 9, 8, 9, 2, 3, 7, 1, 6, 4, 9, 5, 8, 0, //
383 //
384 0, 0, 2, 1, 8, 9, 6, 7, 0, 5, 1, 4, 1, 1, 9, 3, //
385 2, 7, 5, 6, 2, 3, 2, 3, 0, 1, 8, 4, 9, 4, 7, 8, //
386 5, 6, 8, 9, 7, 1, 2, 6, 4, 5, 9, 3, 7, 8, 5, 6, //
387 3, 4, 9, 2, 0, 7, 3, 5, 1, -3, 4, -3, 6, -3, 8, -3, //
388 9, 2, 3, 8, 5, 4, 7, 6, 8, 9, 6, 7, 4, 5, 1, 3, //
389 9, 2, 0, 8, 6, 7, 4, 5, 2, 3, 8, 9, 5, 6, 4, 1, //
390 7, 3, 2, 9, -3, 8, -3, 7, -3, 6, -3, 5, -3, 4, -3, 3, //
391 -3, 1, -3, 2, 8, 9, -3, 7, 1, 6, 0, 0, -3, -3, 0, -3, //
392 6, 7, 1, 5, 3, 2, 3, 4, 1, 2, 0, 0, 0, 0, -3, -3, //
393 //
394 0, 0, 1, 0, 3, 2, 5, 4, 8, 9, 7, 0, 5, 6, 4, 1, //
395 2, 3, 8, 9, 0, 1, 6, 7, 4, 5, 2, 3, 8, 9, 1, 7, //
396 5, 6, 3, 4, 9, 2, 7, 8, 1, 6, 2, 5, 4, 3, 8, 9, //
397 6, 7, 4, 5, 2, 3, 9, 1, 7, 8, 5, 6, 3, 4, 9, 2, //
398 7, 8, 5, 6, 3, 4, 2, 0, 9, 1, 7, 8, 5, 6, 3, 4, //
399 1, 2, 8, 9, 6, 7, 4, 5, 2, 3, 1, 1, -3, -3, -3, -3, //
400 -3, -3, -3, -3, -3, -3, 0, 0, 0, -3, 0, -3, -3, -3, -3, -3, //
401 -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3};
402
403 // Array which stores the corresponding y position of PAD of RPC module
404 fChannelsToPadYRpc = {1, 0, 3, 2, 5, 4, 7, 6, 0, 8, 2, 1, 3, 9, 5, 4, //
405 7, 6, 9, 8, 0, 10, 2, 1, 4, 3, 6, 5, 8, 7, 10, 0, //
406 1, 9, 3, 2, 5, 4, 7, 6, 11, 8, 10, 9, 1, 0, 2, 11, //
407 4, 3, 6, 5, 8, 7, 10, 9, 11, 0, 12, 12, 1, 10, 3, 2, //
408 5, 4, 7, 6, 9, 8, 11, 10, 12, 12, 13, 11, 13, 13, -3, -3, //
409 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 12, 10, 13, 11, 14, 14, //
410 0, 14, 2, 1, 4, 3, 13, 5, 6, 12, 8, 7, 10, 9, 13, 11, //
411 15, 15, 14, 15, 0, 12, 2, 1, 4, 3, 15, 5, 6, 14, 8, 7, //
412 //
413 10, 9, 14, 16, 13, 16, 11, 12, 1, 0, 3, 2, 17, 15, 16, 4, //
414 5, 16, 7, 6, 9, 8, 16, 10, 17, 17, 18, 17, 15, 17, 17, 16, //
415 15, 14, 17, 16, 15, 14, 17, 16, 12, 13, 14, 13, 16, 15, 18, 18, //
416 18, 18, 18, 18, 19, 18, 11, 19, 12, 11, 13, 19, 19, 17, 19, 19, //
417 20, 19, 20, 18, 19, 20, 15, 14, 20, 20, 20, 20, 20, 20, 21, 21, //
418 21, 21, 21, 21, 21, 21, 19, 21, 17, 16, 19, 18, 22, 20, 22, 22, //
419 22, 22, 22, 21, 23, 23, 22, 22, 23, 22, 23, 23, 24, 23, 24, 22, //
420 24, 24, 23, 24, 23, 23, 24, 24, 24, 24, 23, 24, 26, 25, -3, -3, //
421 //
422 27, 28, 25, 25, 25, 25, 25, 25, 29, 25, 26, 25, 28, 27, 26, 25, //
423 26, 26, 26, 26, 27, 26, 28, 27, 30, 29, 26, 26, 27, 27, 27, 27, //
424 27, 27, 28, 28, 28, 30, 29, 28, 28, 28, 29, 28, 29, 29, 29, 29, //
425 29, 29, 30, 30, 31, 30, 30, 30, 31, -3, 30, -3, 30, -3, 30, -3, //
426 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, //
427 33, 32, 32, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 33, //
428 34, 34, 34, 35, -3, 35, -3, 35, -3, 35, -3, 35, -3, 35, -3, 35, //
429 -3, 34, -3, 35, 36, 36, -3, 36, 35, 36, 35, 34, -3, -3, 33, -3, //
430 //
431 37, 36, 36, 38, 36, 36, 36, 36, 37, 37, 37, 39, 37, 37, 37, 37, //
432 37, 37, 37, 37, 40, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, //
433 39, 39, 39, 39, 40, 39, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, //
434 41, 41, 41, 41, 41, 41, 42, 41, 42, 42, 42, 42, 42, 42, 43, 42, //
435 43, 43, 43, 43, 43, 43, 43, 41, 44, 42, 44, 44, 44, 44, 44, 44, //
436 43, 44, 45, 45, 45, 45, 45, 45, 45, 45, 44, 45, -3, -3, -3, -3, //
437 -3, -3, -3, -3, -3, -3, 44, 45, 43, -3, 42, -3, -3, -3, -3, -3, //
438 -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3};
439
440 // Array which stores the corresponding x position of PAD of entire module A
441 fChannelsToPadXA = {8, 6, 8, 6, 8, 6, 8, 5, 7, 5, 7, 5, 7, 5, 7, 5, //
442 7, 4, 6, 4, 6, 4, 8, 4, 9, 4, 9, 3, 9, 3, 9, 3, //
443 9, 3, 10, 3, 10, 2, 10, 2, 10, 2, 10, 2, 11, 2, 11, 1, //
444 11, 1, 11, 1, 11, 1, 12, 1, 12, 0, 12, 0, 12, 0, 12, 0, //
445 13, 0, 13, 6, 13, 5, 13, 5, 13, 5, 14, 5, 14, 5, 14, 4, //
446 14, 4, 14, 4, 15, 4, 15, 4, 15, 3, 15, 3, 15, 3, 16, 3, //
447 16, 3, 16, 2, 16, 2, 16, 2, 17, 2, 17, 2, 17, 1, 17, 1, //
448 17, 1, 18, 1, 18, 1, 18, 0, 18, 0, 18, 0, 19, 0, 19, 0, //
449 //
450 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
451 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
452 -2, -2, -2, -2, 17, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
453 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
454 -2, 19, -2, 20, -2, 20, -2, 20, 21, 20, 21, 20, 21, 20, 21, 20, //
455 21, 20, 21, 21, 22, 21, 22, 21, 22, -1, 22, -1, 22, -1, 22, -1, //
456 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
457 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
458 //
459 8, 6, 8, 6, 8, 6, 9, 7, 9, 6, 9, 7, 9, 7, 9, 7, //
460 10, 7, 10, 7, 10, 7, 10, 7, 10, 8, 11, 8, 11, 0, 11, 0, //
461 12, 0, 12, 11, 6, 11, 6, 4, 6, 4, 6, 5, 7, 5, 7, 5, //
462 7, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 3, 8, 3, //
463 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 2, 9, 2, 9, 2, //
464 9, 2, 10, 2, 10, 2, 10, 2, 10, 2, 10, 1, 10, 1, 10, 1, //
465 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 0, 11, 0, 11, 0, //
466 6, 0, 6, 0, 6, 0, 6, 0, 5, 0, 5, 0, 5, 3, 5, 5, //
467 //
468 5, 4, 5, 4, 5, 4, 5, 4, 7, 4, 6, 4, 6, 4, 6, 3, //
469 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, //
470 7, 3, 7, 2, 7, 2, 7, 2, 7, 2, 7, 2, 7, 2, 7, 2, //
471 8, 2, 8, 2, 8, 2, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, //
472 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 0, 9, 0, 9, 0, //
473 4, 0, 4, 0, 4, 0, 4, 4, 4, 4, 4, 4, 4, 5, 4, 5, //
474 4, 5, 3, 5, 3, 5, 3, 5, 3, 3, 4, 3, 5, 3, 5, 3, //
475 5, 3, 5, 3, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, //
476 //
477 11, 9, 11, 9, 11, 9, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, //
478 12, 10, 12, 10, 12, 10, 13, 10, 13, 10, 13, 11, 13, 11, 13, 11, //
479 14, 11, 14, 11, 14, 11, 14, 12, 14, 12, 15, 13, 15, 13, 15, 13, //
480 15, 13, 15, 13, 16, 14, 16, 14, 16, 14, 16, 14, 17, 14, 17, 15, //
481 9, 15, 9, 9, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, //
482 9, 9, -1, 8, -1, 8, 10, 8, 10, 8, 10, 7, 10, 7, 10, 7, //
483 10, 7, 10, 7, 10, 7, 10, 7, 11, 7, 11, 7, 11, 7, 11, 6, //
484 11, 6, 11, 6, 11, 6, 11, 6, 11, 6, 11, 6, 12, 6, 12, 6, //
485 //
486 17, 15, 17, 15, 17, 16, 17, 16, 17, 16, 18, 16, -1, 16, 18, 17, //
487 18, 17, 18, 17, 18, 18, 19, 15, 19, 18, 19, 18, 19, 18, 19, 18, //
488 19, 19, 20, 19, 20, 19, 20, 19, 20, 20, 20, 20, 21, 20, 21, 20, //
489 21, 20, 21, 21, 21, 21, 22, 21, 22, 21, 22, 21, 22, 22, 22, 22, //
490 22, 22, 22, 22, 22, 22, 14, 22, 14, 22, 14, 13, 14, 13, 14, 13, //
491 14, 13, 14, 13, 14, 12, 14, 12, 14, 12, 16, 13, 15, 13, 15, 13, //
492 15, 13, 15, 13, 15, 12, 15, 12, 15, 12, 15, 12, 16, 12, 16, 15, //
493 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, //
494 //
495 19, 17, 19, 17, 19, 18, 19, 18, 19, 18, 19, 18, 19, 18, 20, 18, //
496 20, 18, 20, 18, 20, 18, 20, 18, 21, 19, 21, 19, 21, 19, 21, 20, //
497 21, 20, 22, 20, 22, 20, 22, 20, 22, 21, 22, 21, 22, 21, 16, 21, //
498 16, 21, 16, 22, 16, 16, 16, 16, 16, 16, 17, 16, 17, 16, 17, 16, //
499 18, 17, 18, 17, 18, 17, 18, 17, 18, 17, 18, 17, 19, 17, 19, 17, //
500 19, 17, 19, 18, 19, 18, 19, 18, 19, 18, 20, 18, 20, 18, 20, 19, //
501 20, 19, 20, 19, 20, 19, 21, 19, 21, 20, 21, 20, 21, 20, 21, 20, //
502 21, 20, 21, 20, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, //
503 //
504 12, 11, 12, 11, 12, 11, 12, 11, 13, 11, 13, 11, 13, 11, 13, 12, //
505 13, 12, 13, 12, 13, 12, 13, 12, 14, 12, 14, 12, 14, 12, 14, 13, //
506 14, 13, 14, 13, 14, 13, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, //
507 15, 15, 12, 15, 12, 15, 12, 15, 12, 15, 12, 15, 12, 11, 12, 11, //
508 13, 12, 13, 12, 13, 12, 14, 13, 14, 13, 14, 13, 14, 13, 14, 13, //
509 14, 13, 15, 13, 15, 13, 15, 13, 15, 14, 15, 14, 15, 14, 15, 14, //
510 16, 14, 16, 14, 16, 15, 16, 15, 16, 15, 16, 15, 17, 15, 17, 16, //
511 17, 16, 11, 16, -1, 16, -1, 16, -1, 16, -1, 17, -1, 17, -1, 17, //
512 //
513 8, 7, 8, 7, 8, 7, 9, 7, -2, 7, -2, 7, -2, 7, -2, 8, //
514 -2, 8, -2, 8, 9, 8, -2, 8, -2, 8, -2, 8, 10, 8, 10, 8, //
515 10, 9, 10, 10, 10, 10, 10, 10, 11, 10, 11, 10, 11, 10, 8, 11, //
516 8, 11, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 8, //
517 8, 7, 8, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 6, 9, 6, //
518 9, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 9, 10, 9, 11, 9, //
519 11, 9, 11, 9, 11, 10, 11, 10, 11, 10, 12, 10, -1, 10, -1, 10, //
520 -1, 11, -1, 11, -1, 11, -1, 11, 8, 12, -1, 6, -1, 7, -1, 6, //
521 //
522 4, 2, 4, 2, -1, 2, 4, 2, 4, 1, 4, 1, 3, 1, 3, 1, //
523 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 0, 4, 0, //
524 4, 0, 4, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, //
525 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 2, 6, 2, //
526 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, //
527 6, 2, 6, 2, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, //
528 -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 0, -1, 0, //
529 -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, //
530 //
531 3, 0, 3, 0, 3, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, //
532 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, //
533 5, 3, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 1, //
534 5, 1, 5, 1, 5, 1, 6, 1, 6, -1, 6, 1, 6, 1, 6, 1, //
535 3, 1, 3, 1, 3, 1, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, //
536 2, 0, 2, 0, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 4, 2, //
537 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, //
538 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, //
539 //
540 8, 6, 8, 6, 8, 6, 8, 6, 8, 6, 9, 6, 9, 6, 9, 6, //
541 9, 6, 9, 7, 9, 7, 9, 7, 10, 7, 10, 7, 10, 8, 10, 8, //
542 10, 8, 10, 9, 11, 9, 11, 9, 11, 9, 11, 9, 7, 10, 7, 10, //
543 6, 10, 7, 10, 7, 10, 6, 10, 6, 11, 6, 11, 6, 11, 6, 6, //
544 7, 6, 7, 6, 7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 8, 5, //
545 8, 5, 8, 5, 8, 5, 8, 5, 8, 5, 8, 5, 8, -1, 8, -1, //
546 8, 4, 8, 4, 8, 4, 9, 4, 9, 4, 9, 6, 7, 6, 7, 6, //
547 7, 7, 7, 6, 7, 6, 7, -2, 7, 5, 6, 5, 6, 5, 6, 5, //
548 //
549 12, 11, 12, 11, 12, 11, 12, 11, 12, 12, 13, 12, 13, 12, 13, 12, //
550 13, 12, 10, 12, 10, 12, 10, 13, 11, 13, 11, 13, 11, 13, 11, 11, //
551 10, 11, 10, 9, 10, 9, 10, 10, 11, 10, 11, 10, 11, 9, 11, 9, //
552 11, 9, 12, 10, 12, 9, 12, 9, -1, 9, 12, 9, 10, 12, 12, 12, //
553 13, 12, 13, 12, 13, 12, 13, 11, 13, 12, 14, 13, 14, 13, 14, 13, //
554 14, 13, 14, 13, 14, 13, 15, 13, 15, 14, 15, 14, 10, 14, 10, 14, //
555 10, 14, 11, 14, 11, 15, 11, 9, 11, 9, 10, 9, 11, 9, -1, 8, //
556 11, 8, 11, 8, 10, 8, 10, 8, -1, 8, 9, 9, -1, 8, 10, 9, //
557 //
558 18, 17, 18, 17, 18, 17, 19, 17, 19, 17, 19, 17, 14, 18, 14, 18, //
559 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 19, //
560 14, 19, 15, 19, 15, 19, 15, 14, 15, 14, 16, 14, 16, 14, 16, 14, //
561 16, 14, 16, 14, 16, 14, 16, 14, 16, 13, 16, 13, 16, 13, 16, 13, //
562 15, 16, 15, 17, 15, 17, 16, 17, 16, 17, 16, 17, 16, 15, 16, 15, //
563 16, 15, 16, 15, 16, 15, 13, 16, 16, 16, 16, 12, 17, 12, 17, 12, //
564 13, 12, 13, -1, 13, -1, 14, -1, 14, -1, -1, -1, 14, -1, 14, -1, //
565 13, -1, 14, -1, 14, -1, 13, -1, 13, -1, 12, -1, 12, -1, 13, -1, //
566 //
567 -2, 19, 22, -2, -2, 19, 22, 19, 20, 19, 20, 20, 20, 20, 21, 20, //
568 21, 20, 21, 20, 21, 21, 21, 21, 22, 21, 22, 21, 22, 21, 22, 21, //
569 22, 22, 22, 22, 22, 22, 18, 22, 18, 22, 18, -2, 18, 17, 18, 17, //
570 18, 17, 18, 17, 18, 17, 19, 17, 19, 18, 19, 18, 19, 18, 19, 18, //
571 20, 19, 20, 19, 20, 19, 21, 19, 21, 19, 21, 19, 21, 19, 21, 20, //
572 21, 20, 21, 20, 22, 20, 22, 20, 22, 20, 22, 20, 22, 20, 22, 20, //
573 22, 21, 22, 21, 17, 21, 17, 21, 17, 21, 17, 22, 17, 22, 17, 22, //
574 17, 22, 18, -1, 18, 17, -1, 17, 18, 18, 18, 18, 18, 18, 18, 18, //
575 //
576 22, 22, -1, 22, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21, //
577 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, //
578 20, 20, 20, 20, 20, 20, 20, 19, 18, 19, 22, 19, 22, 19, 21, 19, //
579 22, 19, 17, 19, 21, 19, 22, 19, 21, 19, 22, 19, 22, 19, 22, 18, //
580 16, 18, 20, 18, 22, 16, 21, 18, 20, 17, 22, 18, 17, 18, 15, 18, //
581 21, 18, 20, 15, 19, 18, 19, 17, 18, 17, 18, 17, 17, 16, 17, 17, //
582 16, 17, 15, 17, 16, 16, 14, 16, 14, 15, 19, 14, 20, 15, 21, 16, //
583 22, 16, 21, 16, 20, 16, 19, 15, 19, 15, 20, 15, 20, 15, 13, 15, //
584 //
585 12, 12, -1, 19, -1, 20, -1, 19, -1, 21, -1, 20, -1, 21, -1, 19, //
586 -1, 11, -1, 21, -1, 20, -1, 20, -1, 19, -1, 19, -1, -1, -1, -1, //
587 -1, -1, -1, -1, 11, -1, 13, -1, 15, -1, 14, -1, 10, 10, 12, -1, //
588 13, -1, 11, -1, 12, -1, 11, -1, 10, -1, 10, -1, 9, -1, 9, 9, //
589 -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 8, -1, -1, -1, -1, -1, //
590 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
591 -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, 8, 7, //
592 7, 9, 6, 7, 4, 6, 5, 5, 6, 6, 5, 6, 5, 5, 4, 5, //
593 //
594 5, 1, -2, 1, -2, -2, -2, 0, -2, 0, -2, 0, -2, -1, -2, 0, //
595 4, 0, 3, -2, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, -1, //
596 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, -1, 0, -2, 0, //
597 -2, 0, -2, 0, -2, 0, -2, 0, -2, 0, -2, 0, -2, -1, -2, -1, //
598 -2, -1, 3, -1, 3, -1, 3, -1, 3, -1, 3, -1, 3, -1, 3, -1, //
599 3, -1, 4, -1, 4, -1, 4, -1, 4, -1, 4, 2, 4, 2, 4, 2, //
600 3, 2, 4, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, //
601 0, 0, 0, 0, 2, 0, 0, 0, 3, 1, 4, 0, 3, 0, 2, 1};
602
603 // Array which stores the corresponding y position of PAD of entire module A
604 fChannelsToPadYA = {1, 2, 2, 3, 3, 4, 4, 0, 0, 1, 1, 2, 2, 3, 3, 4, //
605 4, 0, 0, 1, 1, 2, 0, 3, 4, 4, 3, 0, 2, 1, 1, 2, //
606 0, 3, 4, 4, 3, 0, 2, 1, 1, 2, 0, 3, 4, 4, 3, 0, //
607 2, 1, 1, 2, 0, 3, 4, 4, 3, 0, 2, 1, 1, 2, 0, 3, //
608 4, 4, 3, 7, 2, 5, 1, 6, 0, 9, 4, 8, 3, 7, 2, 5, //
609 1, 6, 0, 9, 4, 8, 3, 7, 2, 5, 1, 6, 0, 9, 4, 8, //
610 3, 7, 2, 5, 1, 6, 0, 9, 4, 8, 3, 7, 2, 5, 1, 6, //
611 0, 9, 4, 8, 3, 7, 2, 5, 1, 6, 0, 9, 4, 8, 3, 7, //
612 //
613 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
614 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
615 -2, -2, -2, -2, 11, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
616 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
617 -2, 17, -2, 10, -2, 11, -2, 12, 17, 13, 9, 14, 8, 15, 7, 16, //
618 6, 17, 5, 10, 15, 11, 16, 12, 17, -1, 14, -1, 13, -1, 12, -1, //
619 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
620 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
621 //
622 7, 8, 6, 9, 5, 5, 9, 7, 8, 6, 7, 8, 6, 9, 5, 14, //
623 9, 13, 8, 12, 7, 11, 6, 10, 5, 9, 9, 8, 8, 12, 6, 11, //
624 9, 10, 8, 7, 13, 5, 12, 11, 11, 10, 10, 15, 15, 16, 16, 17, //
625 17, 12, 10, 13, 11, 14, 12, 17, 13, 16, 14, 15, 15, 10, 16, 11, //
626 17, 13, 10, 14, 11, 17, 12, 16, 13, 15, 14, 10, 15, 11, 16, 12, //
627 17, 13, 10, 14, 11, 17, 12, 16, 13, 15, 14, 10, 15, 11, 16, 12, //
628 17, 13, 10, 14, 11, 17, 12, 16, 13, 15, 14, 17, 15, 18, 16, 19, //
629 14, 20, 17, 21, 16, 16, 15, 15, 10, 14, 11, 13, 12, 12, 13, 14, //
630 //
631 27, 24, 26, 23, 25, 22, 24, 21, 21, 20, 18, 19, 19, 18, 20, 27, //
632 21, 26, 22, 25, 23, 24, 24, 23, 25, 22, 26, 21, 27, 20, 18, 19, //
633 19, 18, 20, 27, 22, 26, 23, 25, 24, 24, 25, 23, 26, 22, 27, 21, //
634 18, 20, 19, 19, 20, 18, 21, 27, 22, 26, 23, 25, 24, 24, 25, 23, //
635 26, 22, 27, 21, 18, 20, 19, 19, 20, 18, 21, 27, 22, 26, 23, 25, //
636 34, 24, 35, 23, 36, 22, 37, 25, 32, 26, 31, 27, 30, 18, 29, 19, //
637 28, 20, 28, 21, 29, 22, 30, 23, 31, 32, 33, 37, 33, 36, 34, 35, //
638 35, 34, 36, 33, 37, 33, 32, 34, 31, 35, 30, 36, 29, 37, 28, 32, //
639 //
640 25, 27, 26, 26, 27, 25, 18, 18, 19, 19, 20, 20, 21, 21, 22, 28, //
641 24, 23, 26, 24, 27, 25, 19, 26, 21, 27, 23, 18, 25, 19, 27, 20, //
642 19, 21, 21, 22, 22, 23, 24, 23, 26, 25, 18, 18, 20, 20, 22, 22, //
643 24, 24, 26, 26, 18, 18, 20, 20, 22, 23, 24, 25, 18, 27, 24, 19, //
644 30, 21, 31, 24, 32, 36, 37, 35, 36, 34, 35, 33, 34, 32, 29, 37, //
645 28, 33, -1, 28, -1, 29, 29, 30, 30, 31, 31, 28, 37, 29, 36, 30, //
646 35, 31, 34, 32, 33, 36, 32, 35, 34, 34, 35, 37, 36, 33, 37, 30, //
647 33, 31, 32, 32, 31, 35, 30, 36, 29, 33, 28, 34, 28, 29, 29, 28, //
648 //
649 19, 25, 21, 27, 23, 19, 25, 21, 27, 23, 18, 25, -1, 26, 21, 20, //
650 23, 22, 24, 26, 26, 19, 18, 23, 19, 20, 21, 22, 23, 25, 25, 27, //
651 27, 20, 19, 22, 21, 24, 22, 26, 24, 18, 26, 20, 18, 23, 20, 25, //
652 22, 27, 24, 19, 26, 21, 18, 23, 20, 25, 21, 27, 23, 19, 24, 22, //
653 32, 25, 30, 26, 28, 27, 28, 31, 29, 29, 30, 29, 37, 30, 36, 31, //
654 35, 28, 34, 37, 33, 32, 32, 33, 31, 34, 27, 36, 28, 35, 37, 34, //
655 36, 33, 35, 32, 34, 35, 33, 36, 32, 37, 31, 31, 28, 30, 37, 30, //
656 35, 29, 33, 36, 31, 34, 30, 32, 29, 28, 37, 36, 35, 34, 33, 32, //
657 //
658 36, 31, 35, 30, 34, 28, 33, 29, 32, 37, 31, 36, 30, 35, 29, 34, //
659 36, 33, 34, 32, 32, 31, 30, 30, 29, 28, 36, 29, 35, 37, 33, 28, //
660 31, 37, 33, 35, 39, 33, 38, 31, 37, 28, 36, 37, 35, 34, 49, 32, //
661 48, 30, 47, 34, 46, 38, 45, 39, 44, 40, 38, 41, 39, 42, 40, 43, //
662 39, 41, 40, 42, 42, 49, 48, 48, 46, 47, 44, 46, 38, 45, 40, 44, //
663 42, 43, 48, 38, 46, 41, 45, 49, 43, 47, 39, 45, 41, 43, 49, 39, //
664 47, 41, 45, 49, 43, 47, 39, 44, 41, 38, 42, 40, 49, 42, 47, 48, //
665 45, 46, 43, 44, 40, 38, 41, 40, 42, 50, 43, 48, 49, 46, 48, 44, //
666 //
667 44, 44, 45, 45, 46, 46, 43, 47, 45, 48, 46, 49, 47, 43, 48, 38, //
668 49, 39, 43, 40, 41, 41, 39, 42, 45, 49, 47, 48, 49, 47, 43, 44, //
669 41, 42, 39, 40, 38, 38, 39, 46, 41, 48, 49, 44, 47, 42, 45, 40, //
670 43, 38, 55, 40, 54, 42, 53, 48, 52, 46, 61, 44, 60, 55, 59, 54, //
671 61, 58, 59, 57, 57, 56, 50, 50, 52, 51, 54, 52, 61, 53, 59, 54, //
672 57, 55, 50, 60, 52, 58, 54, 56, 61, 51, 59, 53, 57, 55, 56, 60, //
673 51, 58, 53, 56, 55, 51, 60, 53, 58, 55, 56, 60, 51, 58, 53, 50, //
674 55, 52, 67, 54, -1, 61, -1, 59, -1, 57, -1, 50, -1, 52, -1, 54, //
675 //
676 45, 43, 44, 44, 43, 49, 38, 42, -2, 41, -2, 40, -2, 39, -2, 38, //
677 -2, 39, -2, 40, 47, 41, -2, 42, -2, 49, -2, 48, 39, 47, 41, 46, //
678 49, 44, 47, 38, 45, 40, 43, 42, 39, 48, 40, 46, 42, 44, 61, 38, //
679 60, 41, 59, 61, 55, 60, 54, 59, 53, 58, 52, 57, 51, 56, 58, 50, //
680 57, 52, 56, 53, 50, 54, 51, 55, 52, 51, 54, 50, 61, 56, 59, 57, //
681 57, 58, 50, 59, 52, 60, 54, 61, 61, 55, 59, 53, 57, 55, 50, 60, //
682 52, 58, 61, 56, 60, 51, 59, 53, 57, 55, 50, 60, -1, 58, -1, 56, //
683 -1, 51, -1, 53, -1, 58, -1, 56, 67, 51, -1, 62, -1, 62, -1, 63, //
684 //
685 43, 31, 42, 30, -1, 29, 40, 28, 39, 28, 38, 29, 44, 30, 45, 31, //
686 46, 32, 47, 37, 48, 36, 49, 35, 49, 34, 48, 33, 47, 33, 46, 34, //
687 45, 35, 44, 36, 38, 37, 39, 32, 40, 31, 41, 30, 42, 29, 43, 28, //
688 49, 40, 48, 41, 47, 42, 46, 43, 45, 39, 44, 38, 38, 44, 47, 45, //
689 39, 46, 40, 47, 41, 48, 42, 49, 49, 43, 48, 42, 46, 41, 45, 40, //
690 44, 39, 43, 38, 37, 44, 38, 45, 45, 46, 46, 47, 47, 48, 48, 49, //
691 -1, 43, -1, 42, -1, 41, -1, 40, -1, 39, -1, 38, -1, 44, -1, 45, //
692 -1, 46, -1, 47, -1, 48, -1, 49, -1, 43, -1, 42, -1, 41, -1, 40, //
693 //
694 58, 39, 57, 38, 56, 56, 50, 57, 51, 58, 52, 59, 53, 60, 54, 61, //
695 55, 50, 61, 51, 60, 52, 59, 53, 58, 54, 57, 55, 56, 61, 50, 60, //
696 51, 59, 52, 55, 53, 54, 54, 53, 55, 52, 61, 51, 60, 50, 59, 56, //
697 58, 57, 57, 58, 56, 59, 50, 60, 51, -1, 52, 55, 53, 54, 54, 53, //
698 70, 52, 71, 51, 72, 50, 73, 50, 65, 51, 64, 52, 63, 53, 62, 54, //
699 68, 55, 69, 61, 70, 60, 69, 59, 68, 58, 67, 57, 66, 56, 62, 71, //
700 63, 72, 64, 73, 69, 67, 68, 66, 67, 65, 73, 64, 72, 63, 71, 62, //
701 70, 68, 66, 69, 65, 70, 68, 71, 69, 72, 70, 73, 71, 67, 72, 66, //
702 //
703 72, 65, 73, 64, 70, 66, 65, 67, 63, 73, 67, 72, 70, 71, 72, 70, //
704 66, 69, 65, 63, 64, 64, 62, 65, 69, 66, 71, 67, 73, 66, 66, 64, //
705 64, 62, 62, 69, 69, 71, 71, 73, 73, 68, 66, 63, 75, 68, 74, 70, //
706 74, 72, 77, 67, 76, 65, 75, 63, 76, 68, 77, 70, 78, 72, 82, 81, //
707 84, 80, 83, 79, 82, 74, 81, 75, 80, 76, 79, 77, 78, 78, 82, 79, //
708 83, 80, 84, 81, 85, 85, 81, 84, 80, 83, 79, 82, 78, -1, 77, -1, //
709 76, 76, 75, 77, 74, 78, 74, 79, 75, 80, 76, 85, 86, 84, 87, 83, //
710 88, 85, 89, 87, 90, 88, 91, -2, 92, 87, 91, 88, 90, 89, 89, 90, //
711 //
712 64, 65, 66, 64, 73, 63, 71, 62, 69, 62, 65, 63, 67, 65, 70, 67, //
713 69, 72, 79, 70, 78, 68, 77, 66, 76, 68, 77, 73, 78, 72, 79, 75, //
714 80, 74, 81, 79, 82, 78, 84, 74, 84, 83, 83, 75, 82, 80, 81, 81, //
715 80, 82, 74, 76, 75, 83, 76, 84, -1, 85, 77, 77, 85, 79, 78, 84, //
716 83, 83, 85, 82, 78, 81, 76, 85, 74, 80, 75, 80, 77, 81, 78, 82, //
717 84, 84, 81, 79, 79, 77, 75, 75, 76, 74, 77, 76, 88, 82, 87, 85, //
718 86, 83, 86, 80, 87, 74, 88, 88, 89, 87, 89, 86, 90, 89, -1, 86, //
719 91, 87, 92, 88, 92, 89, 90, 90, -1, 91, 92, 90, -1, 92, 91, 91, //
720 //
721 60, 61, 58, 60, 56, 59, 51, 58, 53, 57, 55, 56, 63, 50, 62, 51, //
722 68, 52, 69, 53, 70, 54, 71, 55, 72, 61, 73, 59, 67, 57, 66, 50, //
723 67, 52, 65, 54, 64, 61, 63, 64, 62, 65, 68, 66, 69, 73, 70, 72, //
724 71, 71, 72, 70, 73, 69, 67, 68, 66, 71, 65, 62, 64, 63, 63, 64, //
725 82, 62, 81, 68, 80, 69, 80, 70, 81, 71, 82, 72, 83, 78, 84, 79, //
726 85, 85, 79, 84, 77, 83, 89, 78, 75, 76, 74, 86, 80, 87, 81, 88, //
727 88, 89, 87, -1, 86, -1, 86, -1, 87, -1, -1, -1, 89, -1, 90, -1, //
728 90, -1, 91, -1, 92, -1, 91, -1, 92, -1, 91, -1, 92, -1, 93, -1, //
729 //
730 -2, 60, 46, -2, -2, 58, 44, 57, 58, 56, 57, 50, 56, 51, 52, 52, //
731 54, 53, 61, 54, 59, 51, 57, 53, 56, 55, 58, 60, 60, 58, 61, 56, //
732 54, 57, 52, 59, 50, 55, 73, 53, 72, 51, 67, -2, 66, 67, 65, 66, //
733 64, 65, 63, 64, 62, 63, 68, 62, 69, 68, 70, 69, 71, 70, 72, 71, //
734 66, 73, 64, 67, 62, 66, 69, 65, 71, 64, 73, 63, 66, 62, 64, 68, //
735 63, 69, 62, 70, 63, 71, 65, 72, 67, 73, 72, 67, 71, 65, 70, 63, //
736 69, 68, 68, 70, 82, 72, 83, 67, 84, 65, 85, 62, 78, 64, 76, 66, //
737 74, 73, 81, -1, 83, 77, -1, 75, 78, 80, 77, 82, 76, 84, 75, 79, //
738 //
739 80, 81, -1, 82, 94, 83, 94, 84, 85, 79, 78, 77, 76, 75, 74, 74, //
740 75, 76, 77, 78, 79, 85, 84, 83, 82, 81, 80, 74, 75, 76, 77, 78, //
741 79, 85, 84, 83, 82, 81, 80, 74, 94, 75, 92, 76, 91, 77, 91, 78, //
742 90, 79, 94, 85, 90, 84, 89, 83, 89, 82, 88, 81, 87, 80, 86, 74, //
743 94, 93, 94, 92, 95, 93, 95, 91, 95, 92, 96, 90, 93, 89, 94, 88, //
744 96, 87, 96, 93, 95, 85, 96, 91, 95, 90, 96, 89, 95, 92, 96, 88, //
745 95, 87, 95, 86, 96, 90, 95, 91, 94, 92, 93, 93, 93, 91, 93, 89, //
746 93, 88, 92, 87, 92, 86, 92, 90, 91, 89, 91, 88, 90, 87, 94, 86, //
747 //
748 94, 93, -1, 90, -1, 89, -1, 89, -1, 88, -1, 88, -1, 87, -1, 88, //
749 -1, 93, -1, 86, -1, 87, -1, 86, -1, 87, -1, 86, -1, -1, -1, -1, //
750 -1, -1, -1, -1, 94, -1, 95, -1, 96, -1, 96, -1, 94, 93, 95, -1, //
751 96, -1, 95, -1, 96, -1, 96, -1, 95, -1, 96, -1, 95, -1, 94, 93, //
752 -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, 94, -1, -1, -1, -1, -1, //
753 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
754 -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 95, -1, 96, 94, //
755 96, 96, 95, 95, 96, 96, 95, 96, 94, 92, 94, 93, 93, 91, 94, 92, //
756 //
757 73, 64, -2, 61, -2, -2, -2, 68, -2, 69, -2, 70, -2, -1, -2, 72, //
758 75, 71, 75, -2, 74, 66, 76, 65, 77, 64, 78, 63, 79, 62, 80, -1, //
759 81, 78, 85, 80, 84, 83, 85, 83, 82, 82, 75, 75, -1, 76, -2, 78, //
760 -2, 80, -2, 85, -2, 83, -2, 82, -2, 75, -2, 74, -2, -1, -2, -1, //
761 -2, -1, 92, -1, 93, -1, 91, -1, 90, -1, 89, -1, 88, -1, 87, -1, //
762 86, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, 91, 91, 90, 92, 89, //
763 94, 88, 93, 87, 94, 86, 91, 92, 89, 93, 87, 90, 86, 88, 87, 94, //
764 89, 86, 91, 88, 95, 90, 94, 93, 95, 95, 95, 95, 96, 96, 96, 96};
765
766 // Array which stores the corresponding x position of PAD of entire module B
767 fChannelsToPadXB = {8, 6, 8, 6, 8, 6, 9, 6, 9, 6, 9, 6, 9, 7, 9, 7, //
768 9, 7, 10, 7, 10, 7, 10, 7, 10, 8, 11, 8, 11, 8, 11, 5, //
769 12, 10, 12, 10, 12, 11, 13, 11, 13, 11, 13, 12, 14, 12, 14, 12, //
770 14, 13, 14, 13, 15, 13, 15, 14, 15, 14, 15, 5, 15, 5, 16, 5, //
771 16, 5, 16, 5, 16, 4, 16, 4, 17, 4, 17, 4, 17, 4, 17, 4, //
772 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 2, 19, 2, //
773 19, 2, 19, 2, 19, 2, 20, 2, 20, 1, 20, 1, 20, 1, 20, 1, //
774 21, 1, 21, 1, 21, 0, 21, 0, 21, 0, 22, 0, 22, 0, 21, 0, //
775 //
776 17, 14, 17, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 16, //
777 19, 16, 19, 16, 19, 16, 19, 16, 19, 16, 19, 17, 20, 17, 20, 17, //
778 20, 17, 20, 14, 20, 14, 20, 14, 21, 14, 21, 14, 21, 13, 21, 13, //
779 21, 13, 21, 13, 22, 13, 22, 13, 22, 12, 22, 12, 22, 12, 22, 12, //
780 22, 12, 22, 12, 22, 12, 13, 12, 13, 12, 13, 11, 13, 11, 13, 11, //
781 14, 11, 14, 11, 14, 10, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, //
782 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, //
783 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, //
784 //
785 7, 0, 7, 0, 7, 6, 8, 6, 8, 6, 8, 6, 8, 5, 8, 5, //
786 8, 5, 9, 5, 9, 5, 9, 5, 9, 4, 9, 4, 9, 4, 10, 4, //
787 10, 4, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 2, 11, 2, //
788 11, 2, 11, 2, 11, 2, 12, 1, 12, 1, 7, 1, 7, 1, 7, 1, //
789 6, 6, 6, 6, 6, 0, 6, 0, 7, 0, 7, 4, 7, 4, 7, 3, //
790 7, 3, 6, 3, 8, 3, 8, 3, 8, 2, 8, 2, 8, 2, 9, 2, //
791 9, 2, 9, 2, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, //
792 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 4, 0, 4, 0, 4, 0, //
793 //
794 5, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6, 4, 6, 4, 6, 4, //
795 6, 4, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, //
796 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 9, 1, 9, 1, //
797 9, 1, 9, 1, 9, 1, 9, 1, 10, 0, 10, 0, 10, 0, 10, 0, //
798 4, 2, 4, 2, 4, 2, 4, 2, 3, 2, 3, 2, 3, 2, 3, 2, //
799 3, 2, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, //
800 4, 1, 4, 1, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, //
801 5, 0, 5, 0, 5, 0, 6, 0, 6, 0, 6, 0, 6, 0, 6, 0, //
802 //
803 11, 8, 10, 8, 10, 8, 11, 8, 11, 8, 11, 7, 11, 7, 11, 8, //
804 12, 8, 12, 7, 12, 8, 12, 8, 12, 7, 12, 7, 13, 7, 13, 7, //
805 13, 7, 13, 7, 13, 6, 13, 6, 14, 6, 14, 6, 14, 9, 14, 9, //
806 14, 9, 14, 9, 15, 9, 15, 9, 15, 9, 15, 9, 15, 9, 15, 10, //
807 12, 11, 12, 11, 12, 11, 12, 11, 13, 11, 13, 11, 13, 12, 13, 12, //
808 13, 12, 13, 12, 17, 12, 10, 13, 10, 13, 10, 13, 10, 8, 10, 8, //
809 10, 8, 10, 8, 10, 8, 10, 8, 10, 8, 10, 11, 11, 11, 11, 11, //
810 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, //
811 //
812 16, 14, 15, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, //
813 17, 14, 17, 15, 17, 15, 17, 15, 17, 15, 17, 15, 17, 15, 18, 15, //
814 18, 15, 18, 15, 18, 16, 18, 16, 18, 16, 18, 16, 19, 16, 19, 16, //
815 19, 16, 19, 16, 19, 16, 19, 17, 19, 17, 20, 17, 20, 17, 20, 17, //
816 20, 17, 20, 17, 20, 17, 20, 18, 21, 18, 21, 18, 21, 18, 21, 18, //
817 21, 18, 21, 18, 22, 18, 22, 18, 22, 19, 22, 19, 22, 19, 22, 19, //
818 22, 19, 22, 19, 22, 19, 22, 19, 21, 19, 21, 20, 21, 20, 21, 20, //
819 21, 20, 21, 20, 21, 20, 22, 20, 22, 20, 22, 20, 22, 21, 22, 21, //
820 //
821 20, 19, 20, 19, 20, 20, 20, 20, 20, 20, 21, 20, 21, 16, 21, 16, //
822 21, 16, 21, 16, 21, 16, 21, 16, 21, 16, 21, 16, 21, 16, 21, 16, //
823 22, 16, 22, 16, 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, //
824 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, 22, 18, 22, 18, //
825 19, 19, 19, 19, 19, 19, 20, 19, 20, 19, 20, 19, 20, 19, 20, 20, //
826 20, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 21, 21, 21, 21, 21, //
827 22, 21, 22, 21, 22, 22, 22, 22, 22, 14, 22, 14, 22, 14, 22, 14, //
828 22, 14, 22, 14, 22, 14, 22, 14, 22, 14, 22, 14, 22, 13, 22, 14, //
829 //
830 16, 15, 16, 15, 16, 15, 16, 15, 17, 15, 17, 15, 17, 15, 17, 15, //
831 17, 15, 17, 16, 17, 16, 17, 16, 18, 16, 18, 16, 18, 16, 18, 16, //
832 18, 17, 18, 17, 19, 17, 19, 18, 19, 18, 19, 18, 19, 18, 20, 18, //
833 12, 19, 12, 19, 13, 19, 13, 19, 13, 20, 13, 11, 13, 11, 13, 11, //
834 13, 11, 14, 11, 14, 11, 14, 12, 14, 11, 14, 13, 14, 12, 14, 12, //
835 14, 12, 14, 12, 14, 12, 14, 12, 15, 12, 15, 12, 15, 12, 15, 13, //
836 15, 13, 15, 13, 15, 14, 15, 15, 18, 15, 18, 15, 18, 15, 18, 10, //
837 18, 10, 18, 10, 18, 10, 18, 10, 18, 10, 18, 10, 19, 10, 19, 10, //
838 //
839 12, 8, 12, 8, 12, 8, 12, 7, 12, 7, 12, 7, 12, 7, 12, 7, //
840 12, 7, 12, 7, 13, 7, 13, 7, 13, 6, 13, 6, 13, 8, 13, 6, //
841 13, 6, 13, 9, 13, 9, 13, 9, 13, 9, 14, 9, 14, 9, 14, 9, //
842 14, 9, 14, 9, 14, 9, 14, 9, 14, 11, 14, 12, 15, 14, 15, 14, //
843 8, 7, 8, 7, 9, 7, 9, 7, 9, 8, 9, 8, 9, 8, 9, 8, //
844 9, 8, 9, 7, 9, 7, 9, 8, 9, 8, 9, 8, 10, 8, 10, 8, //
845 10, 7, 10, 7, 10, 7, 10, 7, 10, 7, 10, 7, 10, 6, 10, 6, //
846 10, 6, 10, 6, 11, 6, 13, 6, 11, 6, 11, 6, 11, 6, 11, 6, //
847 //
848 4, 3, 4, 3, 5, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, //
849 4, 3, 4, 3, 4, 2, 4, 2, 3, 2, 5, 2, 5, 2, 5, 2, //
850 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 1, 5, 1, 6, 1, //
851 7, 1, 6, 1, 7, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, //
852 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, //
853 4, 3, 4, 3, 4, 3, 3, 3, 3, 2, 3, 2, 4, 2, 4, 2, //
854 4, 2, 4, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, //
855 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, //
856 //
857 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 3, 0, 3, 2, 3, 2, //
858 3, 2, 3, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, //
859 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, //
860 3, 1, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, //
861 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, //
862 0, 1, 0, 1, 0, 1, 0, 1, 3, 1, 2, 1, 2, 1, 2, 1, //
863 3, 1, 3, 1, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, //
864 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, 4, 2, 4, 2, 4, 2, //
865 //
866 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, //
867 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 8, 5, 8, 5, 8, 5, //
868 8, 5, 8, 5, 8, 5, 8, 5, 8, 5, 8, 5, 8, 5, 8, 5, //
869 8, 5, 8, 5, 9, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 4, //
870 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 7, 5, 7, 5, 7, 5, //
871 7, 5, 7, 5, 7, 5, 7, 4, 7, 4, 7, 4, 7, 4, 7, 4, //
872 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, //
873 7, 6, 7, 6, 8, 6, 8, 6, 8, 6, 8, 6, 8, 6, 7, 6, //
874 //
875 11, 9, 11, 9, 11, 9, 11, 9, 11, 9, 12, 9, 12, 9, 12, 10, //
876 12, 10, 12, 10, 12, 10, 12, 11, 12, 11, 12, 11, 12, 11, 12, 11, //
877 12, 11, 12, 11, 13, 11, 13, 9, 13, 9, 13, 9, 13, 9, 13, 9, //
878 13, 9, 13, 9, 13, 9, 13, 9, 14, 9, 13, 9, 13, 10, 14, 10, //
879 11, 8, 11, 8, 11, 8, 11, 8, 11, 8, 11, 8, 11, 8, 11, 8, //
880 11, 8, 11, 8, 11, 8, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, //
881 12, 10, 12, 10, 12, 10, 10, 10, 10, 9, 10, 9, 10, 9, 10, 9, //
882 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 11, 9, 11, 10, 11, 9, //
883 //
884 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, //
885 16, 15, 17, 15, 17, 15, 17, 15, 17, 15, 17, 16, 17, 16, 18, 16, //
886 18, 16, 18, 17, 18, 17, 18, 17, 18, 17, 18, 17, 19, 17, 19, 17, //
887 19, 18, 19, 18, 14, 18, 14, 18, 14, 18, 14, 18, 14, 19, 14, 19, //
888 14, 12, 14, 12, 14, 12, 14, 13, 14, 13, 14, 13, 15, 13, 14, 13, //
889 13, 13, 13, 13, 13, 13, 13, 13, 14, 13, 14, 13, 14, 13, 14, 13, //
890 14, 12, 14, 12, 14, 12, 14, 12, 16, 12, 15, 12, 15, 12, 14, 12, //
891 15, 12, 15, 12, 15, 12, 15, 13, 15, 13, 15, 13, 15, 13, 16, 13, //
892 //
893 20, 19, 20, 19, 20, 19, 20, 19, 20, 19, 20, 19, 20, 19, 20, 20, //
894 20, 20, 20, 20, 21, 16, 21, 16, 21, 16, 21, 16, 21, 16, 21, 16, //
895 21, 16, 21, 16, 21, 16, 21, 16, 21, 16, 21, 17, 21, 17, 22, 17, //
896 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, 22, 17, //
897 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 19, 15, 19, 15, 19, 15, //
898 19, 15, 19, 15, 19, 15, 19, 18, 20, 18, 20, 18, 20, 18, 20, 18, //
899 20, 18, 20, 19, 21, 19, 21, 19, 21, 19, 21, 20, 21, 20, 21, 20, //
900 21, 20, 22, 20, 22, 21, 22, 21, 22, 21, 22, 21, 22, 17, 22, 17, //
901 //
902 22, 22, 21, 21, 21, 22, 22, 22, 21, 22, 22, 22, 22, 22, 22, 22, //
903 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, //
904 18, 20, 19, 20, 20, 20, 20, 20, 21, 20, 21, 20, 21, 20, 20, 20, //
905 20, 20, 20, 20, 17, 19, 19, 19, 18, 19, 19, 19, 19, 19, 19, 19, //
906 16, 19, -1, 19, 20, 19, -1, 19, -1, 19, -1, 18, 19, 18, 18, 18, //
907 -1, 18, 17, 15, 15, 18, 16, 18, -1, 18, 20, 18, 19, 18, 18, 18, //
908 17, 18, 16, 17, -1, 17, 15, 17, 15, 17, -1, 17, 14, 14, 14, 17, //
909 14, 17, 13, 17, 13, 16, 17, 16, 16, 16, 16, 16, 16, 16, 15, 16, //
910 //
911 12, 18, 12, 17, 13, 18, 12, 17, -1, 12, -1, 16, -1, 18, -1, 17, //
912 -1, -1, 11, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, -1, //
913 11, 14, -1, 16, -1, 15, -1, 16, -1, 13, -1, 12, -1, 10, -1, -1, //
914 -1, 11, -1, 11, -1, 11, -1, 11, -1, 11, 16, 11, 17, 11, 13, 11, //
915 -1, 9, -1, 11, -1, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, //
916 -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, -1, 13, -1, 15, -1, 14, //
917 -1, 13, -1, 7, -1, 12, -1, 10, -1, 9, 10, 11, 11, 12, 9, 10, //
918 8, 11, 7, 8, -1, 9, 10, 10, 10, 9, 9, 8, 9, 7, 6, 6, //
919 //
920 3, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, //
921 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, //
922 5, 3, 5, 3, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 6, 2, //
923 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 1, 1, 1, 1, 1, //
924 5, 1, 5, 1, 4, 1, 5, 1, 3, 1, 6, 0, 6, 0, 4, 0, //
925 7, 1, 8, 0, 7, 0, 6, 1, 5, 0, 3, 1, 4, 0, 5, 1, //
926 8, 2, 8, 3, 7, 3, 7, 3, 6, 4, 6, 4, 5, 2, 5, 3, //
927 4, 2, 3, 2, 4, 2, -1, 2, -1, 2, -1, 1, -1, 1, 1, 1};
928
929 // Array which stores the corresponding y position of PAD of entire module B
930 fChannelsToPadYB = {0, 2, 1, 3, 2, 4, 5, 5, 4, 1, 3, 0, 2, 5, 1, 4, //
931 0, 3, 5, 2, 4, 1, 2, 0, 0, 5, 4, 4, 2, 3, 0, 0, //
932 4, 3, 2, 1, 0, 5, 4, 3, 3, 1, 1, 5, 5, 3, 3, 1, //
933 2, 5, 0, 2, 4, 0, 3, 4, 2, 1, 1, 1, 0, 2, 4, 3, //
934 3, 4, 2, 5, 1, 0, 0, 1, 4, 2, 3, 3, 2, 4, 1, 5, //
935 0, 0, 4, 1, 3, 2, 2, 3, 1, 4, 0, 5, 4, 0, 3, 1, //
936 2, 2, 1, 3, 0, 4, 4, 5, 3, 0, 2, 1, 1, 2, 0, 3, //
937 5, 4, 4, 5, 3, 0, 2, 1, 1, 3, 1, 5, 0, 7, 0, 6, //
938 //
939 9, 11, 10, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 5, //
940 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 5, 5, 6, 6, 7, //
941 7, 8, 8, 10, 9, 9, 10, 8, 6, 7, 7, 6, 8, 11, 9, 10, //
942 10, 9, 11, 8, 2, 7, 3, 6, 4, 11, 5, 10, 6, 9, 7, 8, //
943 10, 12, 9, 13, 8, 14, 16, 15, 15, 16, 14, 12, 13, 13, 12, 14, //
944 16, 15, 15, 16, 14, 12, 12, 13, 14, 15, 12, 13, 11, 15, 14, 13, //
945 12, 11, 15, 14, 13, 12, 11, 15, 14, 13, 12, 11, 15, 14, 13, 12, //
946 11, 15, 14, 13, 12, 11, 16, 15, 14, 13, 12, 14, 15, 13, 12, 11, //
947 //
948 9, 4, 10, 2, 11, 6, 6, 7, 7, 8, 8, 9, 9, 11, 10, 10, //
949 11, 9, 6, 8, 7, 7, 8, 6, 9, 10, 10, 9, 11, 8, 6, 7, //
950 7, 6, 8, 10, 9, 9, 10, 8, 11, 7, 6, 6, 7, 10, 8, 9, //
951 9, 8, 10, 7, 11, 6, 6, 10, 7, 9, 8, 8, 7, 7, 6, 6, //
952 15, 10, 14, 11, 13, 10, 12, 9, 16, 8, 15, 14, 14, 15, 13, 11, //
953 12, 12, 16, 13, 16, 14, 15, 15, 14, 11, 13, 12, 12, 13, 16, 14, //
954 15, 15, 14, 16, 13, 11, 12, 12, 16, 13, 15, 14, 14, 15, 13, 16, //
955 12, 14, 13, 15, 14, 16, 15, 17, 16, 18, 11, 13, 12, 12, 13, 11, //
956 //
957 22, 20, 21, 21, 20, 22, 19, 17, 17, 18, 18, 19, 19, 18, 20, 17, //
958 21, 16, 22, 22, 17, 21, 18, 20, 19, 19, 20, 18, 21, 17, 22, 16, //
959 17, 22, 18, 21, 19, 20, 20, 19, 21, 18, 22, 17, 17, 22, 18, 21, //
960 19, 20, 20, 19, 21, 18, 22, 17, 17, 22, 18, 21, 19, 20, 20, 19, //
961 28, 23, 29, 24, 30, 25, 31, 26, 23, 27, 24, 28, 25, 29, 26, 30, //
962 27, 31, 28, 23, 29, 24, 30, 25, 31, 26, 27, 27, 26, 28, 25, 29, //
963 24, 30, 23, 31, 31, 23, 30, 24, 29, 25, 28, 26, 27, 27, 26, 28, //
964 25, 29, 24, 30, 23, 31, 26, 36, 31, 35, 30, 34, 29, 33, 28, 32, //
965 //
966 17, 23, 22, 24, 21, 25, 18, 26, 19, 27, 20, 23, 21, 24, 22, 28, //
967 17, 29, 18, 25, 19, 30, 20, 31, 21, 26, 22, 28, 17, 29, 18, 27, //
968 19, 30, 20, 31, 21, 23, 22, 24, 17, 25, 18, 27, 19, 31, 20, 30, //
969 21, 29, 22, 28, 16, 27, 17, 26, 18, 25, 19, 24, 20, 23, 21, 31, //
970 29, 28, 27, 27, 25, 26, 23, 25, 30, 24, 28, 23, 26, 31, 25, 30, //
971 24, 28, 23, 26, 26, 24, 34, 31, 35, 29, 33, 27, 32, 42, 36, 41, //
972 37, 40, 38, 39, 39, 38, 40, 37, 41, 36, 42, 29, 32, 30, 33, 31, //
973 34, 23, 35, 24, 36, 25, 37, 26, 38, 27, 39, 28, 40, 29, 41, 30, //
974 //
975 16, 28, 22, 27, 17, 26, 18, 29, 19, 30, 20, 31, 21, 25, 22, 24, //
976 16, 23, 17, 31, 18, 30, 19, 29, 20, 28, 21, 27, 22, 26, 16, 25, //
977 17, 24, 18, 23, 19, 31, 20, 30, 21, 29, 22, 28, 16, 27, 17, 26, //
978 18, 25, 19, 24, 20, 23, 21, 31, 22, 30, 16, 29, 17, 28, 18, 27, //
979 19, 25, 20, 24, 21, 23, 22, 31, 17, 30, 18, 29, 19, 28, 20, 27, //
980 21, 26, 22, 25, 16, 24, 17, 23, 18, 31, 19, 30, 20, 29, 21, 28, //
981 25, 27, 24, 26, 23, 25, 22, 24, 29, 23, 28, 31, 27, 30, 26, 29, //
982 25, 28, 24, 27, 23, 26, 30, 25, 29, 24, 28, 23, 27, 31, 26, 30, //
983 //
984 38, 40, 39, 42, 40, 33, 41, 35, 42, 36, 32, 37, 33, 49, 34, 48, //
985 35, 47, 36, 46, 37, 45, 38, 44, 39, 43, 40, 50, 41, 51, 42, 52, //
986 32, 53, 33, 54, 34, 43, 35, 44, 36, 45, 37, 46, 38, 47, 39, 48, //
987 40, 49, 41, 50, 42, 51, 46, 52, 45, 53, 44, 54, 43, 43, 31, 44, //
988 51, 44, 52, 45, 53, 46, 43, 48, 45, 49, 47, 50, 49, 54, 51, 44, //
989 53, 46, 43, 48, 45, 50, 46, 52, 47, 54, 49, 44, 51, 48, 53, 50, //
990 47, 52, 49, 54, 51, 48, 52, 50, 53, 65, 54, 63, 55, 67, 56, 62, //
991 57, 61, 58, 60, 64, 59, 63, 58, 62, 57, 61, 56, 60, 55, 59, 55, //
992 //
993 39, 34, 40, 35, 41, 36, 42, 37, 32, 38, 33, 39, 34, 40, 35, 41, //
994 36, 42, 38, 32, 39, 33, 41, 34, 32, 35, 34, 36, 36, 37, 38, 38, //
995 40, 37, 42, 40, 32, 42, 34, 33, 36, 35, 38, 37, 39, 39, 32, 41, //
996 51, 33, 52, 35, 45, 37, 46, 41, 47, 34, 48, 54, 49, 53, 50, 51, //
997 54, 50, 43, 49, 44, 48, 45, 43, 46, 52, 47, 44, 48, 44, 49, 45, //
998 50, 46, 51, 47, 52, 48, 54, 49, 44, 50, 46, 53, 48, 54, 49, 51, //
999 50, 52, 52, 53, 53, 53, 54, 43, 45, 45, 46, 47, 47, 51, 48, 65, //
1000 49, 66, 50, 67, 51, 64, 52, 63, 53, 62, 54, 61, 43, 60, 47, 59, //
1001 //
1002 33, 35, 34, 34, 35, 33, 36, 40, 37, 42, 38, 41, 39, 39, 40, 34, //
1003 41, 35, 42, 36, 32, 37, 33, 38, 34, 37, 35, 38, 36, 32, 37, 42, //
1004 38, 41, 39, 32, 40, 33, 41, 34, 42, 35, 32, 36, 33, 37, 34, 38, //
1005 35, 39, 36, 40, 37, 41, 39, 42, 41, 42, 42, 32, 32, 38, 33, 40, //
1006 53, 52, 54, 51, 43, 53, 44, 54, 45, 43, 46, 44, 47, 45, 48, 46, //
1007 49, 47, 50, 50, 51, 49, 52, 48, 53, 49, 54, 50, 43, 51, 44, 52, //
1008 45, 48, 46, 47, 47, 46, 48, 45, 49, 44, 50, 43, 51, 54, 52, 53, //
1009 53, 52, 54, 51, 43, 50, 43, 49, 44, 48, 45, 43, 46, 44, 47, 46, //
1010 //
1011 42, 41, 41, 40, 32, 39, 40, 38, 39, 37, 38, 36, 37, 35, 36, 34, //
1012 35, 33, 34, 32, 33, 42, 32, 41, 42, 40, 33, 39, 34, 38, 35, 37, //
1013 36, 36, 37, 35, 38, 34, 39, 33, 40, 32, 41, 42, 42, 41, 32, 40, //
1014 32, 39, 33, 38, 33, 37, 34, 36, 35, 35, 36, 34, 39, 33, 40, 32, //
1015 42, 39, 41, 38, 40, 37, 50, 51, 49, 50, 48, 49, 47, 48, 46, 47, //
1016 45, 46, 44, 45, 43, 44, 54, 43, 53, 54, 52, 53, 51, 52, 52, 51, //
1017 53, 50, 54, 49, 43, 48, 44, 47, 45, 46, 46, 45, 47, 44, 48, 43, //
1018 49, 54, 50, 53, 51, 52, 52, 51, 53, 50, 54, 49, 45, 48, 47, 47, //
1019 //
1020 46, 48, 45, 47, 44, 46, 43, 45, 49, 44, 63, 43, 64, 62, 65, 63, //
1021 66, 64, 67, 65, 55, 66, 56, 67, 57, 55, 58, 56, 59, 57, 60, 58, //
1022 61, 59, 62, 60, 61, 61, 60, 62, 59, 63, 58, 64, 57, 65, 56, 66, //
1023 55, 67, 67, 58, 66, 59, 65, 60, 64, 61, 63, 62, 62, 63, 61, 64, //
1024 65, 51, 66, 50, 67, 76, 68, 77, 69, 78, 70, 75, 57, 74, 56, 68, //
1025 55, 69, 54, 70, 53, 71, 52, 72, 78, 73, 68, 74, 69, 75, 70, 76, //
1026 77, 77, 76, 78, 75, 71, 74, 72, 73, 73, 72, 74, 71, 75, 70, 76, //
1027 69, 77, 68, 78, 78, 79, 77, 80, 76, 81, 75, 73, 74, 72, 73, 71, //
1028 //
1029 67, 66, 66, 67, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61, 60, 60, //
1030 59, 59, 58, 58, 57, 57, 56, 56, 55, 55, 67, 55, 66, 56, 65, 57, //
1031 64, 58, 63, 59, 62, 60, 61, 61, 60, 62, 59, 63, 58, 64, 57, 65, //
1032 56, 66, 55, 67, 67, 55, 66, 56, 65, 57, 64, 58, 63, 59, 62, 60, //
1033 72, 69, 71, 70, 70, 71, 69, 68, 68, 72, 78, 73, 77, 74, 76, 75, //
1034 75, 76, 74, 77, 73, 78, 72, 68, 71, 69, 70, 70, 69, 71, 68, 72, //
1035 83, 78, 84, 77, 82, 76, 81, 75, 80, 74, 79, 73, 85, 83, 86, 82, //
1036 87, 81, 88, 80, 79, 79, 80, 84, 81, 85, 82, 86, 83, 87, 89, 88, //
1037 //
1038 59, 56, 58, 57, 57, 58, 56, 59, 55, 60, 67, 61, 66, 55, 65, 58, //
1039 64, 57, 63, 56, 62, 55, 61, 67, 60, 66, 59, 65, 58, 64, 57, 63, //
1040 56, 62, 55, 61, 67, 60, 66, 72, 65, 71, 64, 70, 63, 69, 62, 68, //
1041 61, 73, 60, 74, 59, 75, 58, 76, 64, 77, 57, 78, 56, 78, 66, 77, //
1042 78, 68, 77, 69, 76, 70, 75, 71, 74, 72, 73, 73, 72, 74, 71, 75, //
1043 70, 76, 69, 77, 68, 78, 78, 76, 77, 75, 76, 74, 75, 73, 74, 72, //
1044 73, 71, 72, 70, 71, 69, 86, 68, 87, 87, 88, 86, 89, 85, 85, 84, //
1045 84, 83, 82, 82, 83, 81, 81, 80, 80, 79, 79, 88, 80, 79, 81, 89, //
1046 //
1047 66, 67, 65, 66, 64, 65, 63, 64, 62, 63, 60, 62, 58, 61, 56, 60, //
1048 55, 59, 66, 58, 64, 57, 62, 56, 60, 55, 58, 67, 56, 61, 67, 59, //
1049 65, 57, 63, 67, 61, 65, 60, 63, 58, 61, 56, 59, 67, 57, 65, 55, //
1050 63, 66, 62, 64, 78, 62, 77, 59, 76, 57, 75, 55, 74, 66, 73, 64, //
1051 72, 70, 71, 69, 70, 68, 69, 78, 68, 77, 79, 76, 79, 75, 80, 74, //
1052 88, 73, 87, 72, 86, 71, 85, 70, 81, 69, 82, 68, 83, 80, 84, 79, //
1053 85, 89, 86, 88, 88, 87, 87, 86, 79, 85, 80, 84, 81, 83, 89, 82, //
1054 82, 81, 83, 80, 84, 79, 85, 81, 86, 82, 87, 83, 88, 84, 80, 89, //
1055 //
1056 64, 61, 63, 60, 62, 59, 61, 58, 60, 57, 59, 56, 58, 55, 57, 67, //
1057 56, 66, 55, 65, 67, 74, 66, 75, 65, 73, 64, 72, 63, 71, 62, 70, //
1058 61, 76, 60, 77, 59, 78, 58, 69, 57, 68, 56, 78, 55, 77, 73, 76, //
1059 72, 75, 71, 74, 70, 73, 69, 72, 68, 71, 67, 70, 66, 69, 65, 68, //
1060 72, 71, 71, 72, 70, 73, 69, 74, 68, 75, 78, 76, 77, 77, 76, 78, //
1061 75, 70, 73, 69, 71, 68, 69, 78, 78, 77, 76, 76, 74, 75, 72, 74, //
1062 70, 73, 68, 74, 77, 72, 75, 70, 74, 68, 72, 77, 70, 75, 69, 73, //
1063 68, 71, 80, 69, 79, 78, 78, 76, 77, 73, 76, 71, 75, 79, 74, 80, //
1064 //
1065 96, 93, 96, 93, 95, 92, 95, 91, 94, 90, 94, 89, 88, 87, 86, 85, //
1066 84, 83, 82, 81, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 89, //
1067 94, 88, 94, 87, 94, 86, 93, 85, 92, 84, 91, 83, 90, 82, 92, 81, //
1068 91, 80, 90, 79, 94, 89, 93, 88, 93, 87, 92, 86, 91, 85, 90, 84, //
1069 94, 83, -1, 82, 95, 81, -1, 80, -1, 79, -1, 89, 95, 88, 95, 87, //
1070 -1, 86, 95, 93, 94, 85, 95, 84, -1, 83, 96, 82, 96, 81, 96, 80, //
1071 96, 79, 96, 89, -1, 88, 95, 87, 96, 86, -1, 85, 94, 93, 95, 83, //
1072 96, 82, 96, 81, 94, 88, 84, 86, 89, 85, 87, 83, 84, 82, 89, 81, //
1073 //
1074 94, 91, 95, 92, 95, 92, 96, 91, -1, 93, -1, 92, -1, 90, -1, 90, //
1075 -1, -1, 94, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, -1, -1, //
1076 95, 92, -1, 91, -1, 91, -1, 90, -1, 92, -1, 92, -1, 93, -1, -1, //
1077 -1, 89, -1, 88, -1, 87, -1, 86, -1, 85, 93, 84, 93, 83, 93, 82, //
1078 -1, 93, -1, 92, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, //
1079 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, 91, -1, 90, -1, 90, //
1080 -1, 90, -1, 93, -1, 91, -1, 92, -1, 92, 94, 91, 96, 90, 94, 91, //
1081 94, 90, 94, 92, -1, 91, 95, 90, 96, 90, 95, 91, 96, 92, 94, 93, //
1082 //
1083 89, 85, 79, 86, 80, 84, 81, 83, 82, 82, 83, 87, 84, 88, 85, 89, //
1084 86, 79, 87, 80, 88, 81, 89, 82, 79, 83, 80, 84, 81, 85, 82, 86, //
1085 83, 87, 84, 88, 85, 89, 86, 88, 87, 87, 88, 86, 89, 85, 89, 84, //
1086 84, 83, 85, 82, 86, 81, 87, 80, 88, 79, 89, 89, 86, 88, 85, 87, //
1087 90, 84, 91, 83, 92, 82, 92, 81, 93, 80, 90, 90, 91, 91, 93, 92, //
1088 90, 93, 90, 93, 91, 94, 92, 94, 93, 95, 94, 95, 94, 96, 94, 96, //
1089 95, 94, 96, 90, 95, 91, 96, 92, 95, 90, 96, 91, 95, 95, 96, 96, //
1090 95, 96, 95, 93, 96, 92, -1, 91, -1, 90, -1, 90, -1, 91, 79, 92};
1091 }
1092} // namespace cbm::algo::much
static uint32_t SetElementId(uint32_t address, int32_t level, int32_t newId)
static uint32_t GetAddress(int32_t station=0, int32_t layer=0, int32_t side=0, int32_t module=0, int32_t sector=0, int32_t channel=0)
uint32_t CreateMuchAddress(uint32_t dpbidx, int32_t iFebId, uint32_t usChan)
Maps component index, Fed Id and channel number to Much Address.
int8_t GetPadXB(uint8_t febid, uint8_t channelid)
static const uint16_t numAsicsPerFeb
Number of ASICs connected in each FEB for MUCH.
std::vector< int16_t > fChannelsToPadXA
Array which stores the corresponding x position of PAD of entire module A.
std::vector< int16_t > fChannelsToPadXB
Array which stores the corresponding x position of PAD of entire module B.
uint16_t numFebsInGemB
Number of FEBs connected in GEM Module B.
static const uint16_t numCrobPerComp
Constants.
void InitChannelToPadMaps()
Init arrays which store positions of PADs.
int8_t GetPadYB(uint8_t febid, uint8_t channelid)
static const uint16_t numFebsPerCrob
Number of FEBs connected to each CROB for mMuch 2019.
std::map< uint16_t, std::vector< std::vector< uint32_t > > > fReadoutMap
void Init()
Initialisation of readout map.
std::vector< int16_t > fnFebsIdsArrayRpc
Array to hold FEB IDs connected to RPC Module.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
int8_t GetPadYA(uint8_t febid, uint8_t channelid)
std::vector< int16_t > fChannelsToPadYRpc
Array which stores the corresponding y position of PAD of RPC module.
int8_t GetPadYRpc(uint8_t febid, uint8_t channelid)
std::vector< int16_t > fnFebsIdsArrayGemA
Array to hold FEB IDs connected to GEM Module A.
std::vector< int16_t > fChannelsToPadYB
Array which stores the corresponding y position of PAD of entire module B.
size_t GetNumElinks(uint16_t equipmentId)
Number of elinks of a component.
int8_t GetPadXRpc(uint8_t febid, uint8_t channelid)
std::vector< int16_t > fChannelsToPadYA
Array which stores the corresponding y position of PAD of entire module A.
std::vector< int16_t > fChannelsToPadXRpc
Array which stores the corresponding x position of PAD of RPC module.
std::vector< bool > MaskMap(uint16_t equipId, uint16_t elink)
API: Mapping from component and elink to channel mask flags.
static const uint16_t numComp
Total number of MUCH DPBs in system.
static const uint16_t numElinksPerCrob
Number of elinks in each CROB ?
const uint16_t numChanPerAsic
Number of channels in each ASIC.
uint16_t numFebsInRpc
Number of FEBs connected in RPC Module.
std::vector< int16_t > fnFebsIdsArrayGemB
Array to hold FEB IDs connected to GEM Module B.
std::vector< uint32_t > Map(uint16_t equipId, uint16_t elink)
API: Mapping from component and elink to addresses per channel.
int8_t GetPadXA(uint8_t febid, uint8_t channelid)
std::map< uint16_t, std::map< size_t, std::vector< bool > > > fMaskMap
Hash for CbmL1LinkKey.