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