173 uint32_t nbRobPerComp = 2;
178 L_(debug) <<
"============================================================";
179 L_(debug) <<
"================== TOF Mapping =============================";
182 for (uint32_t uGbtx = 0; uGbtx < pars.
NCrobs(); ++uGbtx) {
185 const auto& crob = pars.
crobs.at(uGbtx);
186 switch (crob.rpcType) {
210 case 7: [[fallthrough]];
213 if ((pars.
eqIds[uGdpb] & 0xF000) == 0xB000) {
223 if ((pars.
eqIds[uGdpb] & 0xF000) == 0xB000) {
246 L_(warning) <<
" Found unused GBTX link at uCh = " << uCh;
251 L_(error) <<
"Invalid Tof Type specifier for GBTx " << std::setw(2) << uGbtx <<
": " << crob.rpcType;
256 throw FatalError(
"Tof mapping error for Gbtx {}, diff = {}, type {}", uGbtx, uCh - uCh0, crob.rpcType);
259 L_(debug) <<
" Map for CROB " << uGbtx;
260 std::vector<int32_t> vAddrBunch(8, -1);
261 for (uint32_t uChPrint = uCh0; uChPrint < uCh; ++uChPrint) {
263 if (7 == uChPrint % 8) {
264 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] <<
" 0x" << std::setw(8)
265 << vAddrBunch[1] <<
" 0x" << std::setw(8) << vAddrBunch[2] <<
" 0x" << std::setw(8) << vAddrBunch[3]
266 <<
" 0x" << std::setw(8) << vAddrBunch[4] <<
" 0x" << std::setw(8) << vAddrBunch[5] <<
" 0x"
267 << std::setw(8) << vAddrBunch[6] <<
" 0x" << std::setw(8) << vAddrBunch[7] << std::dec;
275 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] << std::dec;
279 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] <<
" 0x" << std::setw(8)
280 << vAddrBunch[1] << std::dec;
284 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] <<
" 0x" << std::setw(8)
285 << vAddrBunch[1] <<
" 0x" << std::setw(8) << vAddrBunch[2] << std::dec;
289 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] <<
" 0x" << std::setw(8)
290 << vAddrBunch[1] <<
" 0x" << std::setw(8) << vAddrBunch[2] <<
" 0x" << std::setw(8) << vAddrBunch[3]
295 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] <<
" 0x" << std::setw(8)
296 << vAddrBunch[1] <<
" 0x" << std::setw(8) << vAddrBunch[2] <<
" 0x" << std::setw(8) << vAddrBunch[3]
297 <<
" 0x" << std::setw(8) << vAddrBunch[4] << std::dec;
301 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] <<
" 0x" << std::setw(8)
302 << vAddrBunch[1] <<
" 0x" << std::setw(8) << vAddrBunch[2] <<
" 0x" << std::setw(8) << vAddrBunch[3]
303 <<
" 0x" << std::setw(8) << vAddrBunch[4] <<
" 0x" << std::setw(8) << vAddrBunch[5] << std::dec;
307 L_(debug) << std::hex << std::setfill(
'0') <<
"0x" << std::setw(8) << vAddrBunch[0] <<
" 0x" << std::setw(8)
308 << vAddrBunch[1] <<
" 0x" << std::setw(8) << vAddrBunch[2] <<
" 0x" << std::setw(8) << vAddrBunch[3]
309 <<
" 0x" << std::setw(8) << vAddrBunch[4] <<
" 0x" << std::setw(8) << vAddrBunch[5] <<
" 0x"
310 << std::setw(8) << vAddrBunch[6] << std::dec;
316 L_(debug) <<
"============================================================";
387 L_(debug) <<
" Map CERN 20 gap at GBTX - uCh = " << uCh;
389 const int32_t StrMap[32] = {0, 1, 2, 3, 4, 31, 5, 6, 7, 30, 8,
390 9, 10, 29, 11, 12, 13, 14, 28, 15, 16, 17,
391 18, 27, 26, 25, 24, 23, 22, 21, 20, 19};
393 int32_t iModuleId = 0;
394 int32_t iModuleType = 7;
396 for (int32_t iFeet = 0; iFeet < 2; iFeet++) {
397 for (int32_t iStr = 0; iStr < 32; iStr++) {
398 int32_t iStrMap = 31 - 12 - StrMap[iStr];
399 int32_t iSideMap = iFeet;
407 L_(debug) <<
" Map end CERN 20 gap at GBTX - uCh = " << uCh;
484 if (crob.
rpcSide < 2) NrFeet = 1;
486 for (; iFeet < NrFeet; iFeet++) {
487 for (int32_t iStr = 0; iStr < 32; iStr++) {
488 int32_t iStrMap = iStr;
489 int32_t iRpcMap = crob.
nRPC;
490 int32_t iSideMap = crob.
rpcSide;
498 if (iSideMap == 0) iStrMap = 31 - iStr;
509 for (int32_t iStr = 0; iStr < 32; iStr++) {
521 for (int32_t iFeet = 0; iFeet < 5; iFeet++) {
522 for (int32_t iStr = 0; iStr < 32; iStr++) {
524 case 0: iSideMap = -1;
break;
559 const int ConOff[8] = {0, 2, 4, 6, 7, 1, 3, 5};
560 for (int32_t iFeet = 0; iFeet < 5; iFeet++) {
561 for (int32_t iStr = 0; iStr < 32; iStr++) {
563 case 0: iSideMap = -1;
break;
566 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
571 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
576 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
581 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
600 int32_t iModuleIdMap = crob.
moduleId;
601 const int32_t iRpc[5] = {0, -1, 0, 1, 1};
602 const int32_t iSide[5] = {1, -1, 0, 1, 0};
603 for (int32_t iFeet = 0; iFeet < 5; iFeet++) {
604 for (int32_t iStr = 0; iStr < 32; iStr++) {
605 int32_t iStrMap = iStr;
606 int32_t iRpcMap = iRpc[iFeet];
607 int32_t iSideMap = iSide[iFeet];
612 iRpcMap = 1 - iRpcMap;
616 iSideMap = 1 - iSideMap;
619 const int ConOff[8] = {0, 2, 4, 6, 7, 1, 3, 5};
621 case 0: iSideMap = -1;
break;
624 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
629 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
634 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
639 iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4];
645 iRpcMap = 1 - iRpcMap;
653 case 0: iRpcMap = 0;
break;
654 case 1: iRpcMap = 1;
break;
663 case 3: iSideMap = 0;
break;
665 case 2: iSideMap = 1;
break;
678 else if (23 == iStr) {
689 const int32_t iChMap[160]={
690 124, 125, 126, 127, 12, 13, 14, 15, 4, 5, 6, 7, 28, 29, 30, 31, 120, 121, 122, 123, 8, 9, 10, 11, 104, 105, 106, 107, 108, 109, 110, 111,
691 36, 37, 38, 39, 52, 53, 54, 55, 60, 61, 62, 63, 128, 129, 130, 131, 40, 41, 42, 43, 148, 149, 150, 151, 56, 57, 58, 59, 132, 133, 134, 135,
692 136, 137, 138, 139, 140, 141, 142, 143, 96, 97, 98, 99, 64, 65, 66, 67, 100, 101, 102, 103, 84, 85, 86, 87, 152, 153, 154, 155, 68, 69, 70, 71,
693 156, 157, 158, 159, 144, 145, 146, 147, 44, 45, 46, 47, 76, 77, 78, 79, 48, 49, 50, 51, 20, 21, 22, 23, 32, 33, 34, 35, 116, 117, 118, 119,
694 75, 74, 73, 72, 92, 93, 94, 95, 16, 17, 18, 19, 80, 81, 82, 83, 115, 114, 113, 112, 24, 25, 26, 27, 88, 89, 90, 91, 0, 1, 2, 3
697 int32_t iInd = iFeet * 32 + iStr;
700 if (iInd == iChMap[i])
break;
702 int32_t iFeetInd = (i - iStrMap) / 32;
720 case 4: iSideMap = -1;
break;