32 unsigned setbits(
unsigned x,
int msb,
int lsb,
unsigned y) {
34 mask = (~0
u << (msb + 1)) | ~(~0
u << lsb);
35 return (
x &
mask) | (
y << lsb);
47 int iind = 0, iwhit = 0, itime = 0;
48 for (iind = 0; iind <=
indent - 1; iind++)
stream <<
" ";
49 for (itime = 0; itime <= ntimes - 1; itime++) {
50 for (iwhit = 0; iwhit <= whitesp - 1; iwhit++)
stream <<
" ";
51 stream <<
"b o r o o p m n s";
54 for (iind = 0; iind <=
indent - 1; iind++)
stream <<
" ";
55 for (itime = 0; itime <= ntimes - 1; itime++) {
56 for (iwhit = 0; iwhit <= whitesp - 1; iwhit++)
stream <<
" ";
57 stream <<
"c p s e f t t t g";
84 int iind = 0, iwhit = 0, itime = 0;
85 for (iind = 0; iind <=
indent - 1; iind++)
stream <<
" ";
86 for (itime = 0; itime <= ntimes - 1; itime++) {
87 for (iwhit = 0; iwhit <= whitesp - 1; iwhit++)
stream <<
" ";
88 stream <<
"ss bnnppoorproorprn";
91 for (iind = 0; iind <=
indent - 1; iind++)
stream <<
" ";
92 for (itime = 0; itime <= ntimes - 1; itime++) {
93 for (iwhit = 0; iwhit <= whitesp - 1; iwhit++)
stream <<
" ";
94 stream <<
"gg cttttefsdiefsdit";
97 for (iind = 0; iind <=
indent - 1; iind++)
stream <<
" ";
98 for (itime = 0; itime <= ntimes - 1; itime++) {
99 for (iwhit = 0; iwhit <= whitesp - 1; iwhit++)
stream <<
" ";
100 stream <<
"21 21212222211111 ";
109 stream.setf(std::ios::dec, std::ios::basefield);
142 for (j = 0; j <= 7; j++) {
143 stream <<
"pad[" << j <<
"] : ";
146 stream.setf(ios::hex, ios::basefield);
149 stream.setf(ios::hex, ios::basefield);
179 for (j = 0; j <= 7; j++) {
181 for (
k = 0;
k <= 2;
k++) {
196 if (bunchID < m_nBunMax && bunchID >= 0) {
200 throw std::out_of_range(
"SectorLogic::outputToMuCTPI: bunchID out of range: " +
std::to_string(bunchID));
248 for (
i = 0;
i <= 7;
i++) {
249 for (j = 0; j <= 5; j++) {
m_SetTCCheck[
i][j] = SetTCCheck_in[
i][j]; }
258 for (
i = 0;
i <= 7;
i++) {
259 for (j = 0; j <= 2; j++) {
m_SetOPLCheck[
i][j] = SetOPLCheck_in[
i][j]; }
268 for (ipad = 0; ipad <= 7; ipad++) {
m_InFromPad[
bx][ipad] = from_pad[ipad]; }
322 fmtout = fmtout | ((slroi1 & 0x1f) << 1);
323 fmtout = fmtout | ((0 & 0x03) << 6);
326 fmtout = fmtout | ((slroi2 & 0x1f) << 10);
327 fmtout = fmtout | ((0 & 0x03) << 15);
334 fmtout = fmtout | ((bc & 0x07) << 27);
345 for (ibx = 0; ibx <=
m_nBunMax - 1; ibx++) {
363 for (i1 = 0; i1 <= 7; i1++) {
367 if (0 < Pt_reg1 && Pt_reg1 <= 3) {
387 for (
j1 = 0;
j1 <= 7;
j1++) {
391 if (0 < Pt_reg2 && Pt_reg2 <= 6) {
396 if (0 < Pt_reg2 && Pt_reg2 <= 3) {
401 if (
getbits(EnableTCCheck,
j1 * 4 + Pt_reg2,
j1 * 4 + Pt_reg2) == 1) {
402 int TileCalCheck = 0;
421 for (k1 = 0; k1 <= 7; k1++) {
424 std::cout <<
"pad # " << k1 <<
" bcid # " << ibx <<
" has eta overlap flag on but no triggered track" << std::endl;
430 for (
kk = 0;
kk <= 1;
kk++) {
432 for (k3 =
kk; k3 <= 6 -
kk; k3 = k3 + 2) {
449 std::cout <<
"pads " << k3 <<
" and " << k3 + 1 <<
" have eta overlap flags on with wrong RoIs"
467 for (
l1 = 0;
l1 <= 7;
l1++) {
503 for (
m1 = 0;
m1 <= 7;
m1++) {
533 for (
m1 = 0;
m1 <= 7;
m1++) {
545 stream <<
"@@@@@@@@@@ event and sector logic identification @@@@@@@@@@\n\n";
556 stream <<
"@@@@@@@@@@ sector logic configuration parameters @@@@@@@@@@\n\n";
559 stream.setf(ios::hex, ios::basefield);
560 stream <<
"EnableTCCheckLow : ";
564 stream <<
"EnableTCCheckHigh : ";
570 for (jj = 0; jj <= 7; jj++) {
571 stream <<
"SetTCCheck pad[";
574 for (
kk = 5;
kk >= 0;
kk--) {
584 stream <<
"EnableOPLCheck : ";
588 for (jj = 0; jj <= 7; jj++) {
589 stream <<
"SetOPLCheck pad[";
592 for (
kk = 2;
kk >= 0;
kk--) {
622 stream <<
"@@@@@@@@@@ sector logic input registers @@@@@@@@@@\n\n";
625 stream.setf(std::ios::dec, std::ios::basefield);
628 for (ipad = 0; ipad <= 7; ipad++) {
629 stream <<
"pad[" << ipad <<
"] :";
630 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
638 stream.setf(std::ios::hex, std::ios::basefield);
640 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
648 stream << std::endl << std::endl;
651 stream <<
"@@@@@@@@@@ sector logic internal registers @@@@@@@@@@\n\n";
654 for (ireg = 0; ireg <= 4; ireg++) {
656 stream <<
"internal registers # " << ireg + 1 <<
" (input)" << std::endl;
658 stream.setf(std::ios::dec, std::ios::basefield);
660 for (ipad = 0; ipad <= 7; ipad++) {
661 stream <<
"pad[" << ipad <<
"] :";
662 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
664 stream << (intreginp[ireg] + ibx)->pad[ipad];
669 stream.setf(ios::hex, ios::basefield);
671 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
681 stream.setf(std::ios::dec, std::ios::basefield);
683 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
691 stream <<
"internal registers # " << ireg + 1 <<
" (output)" << std::endl;
693 stream.setf(std::ios::dec, std::ios::basefield);
695 for (ipad = 0; ipad <= 7; ipad++) {
696 stream <<
"pad[" << ipad <<
"] :";
697 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
699 stream << (intregoutp[ireg] + ibx)->pad[ipad];
704 stream.setf(std::ios::hex, std::ios::basefield);
706 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
716 stream.setf(std::ios::dec, std::ios::basefield);
718 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
722 stream << std::endl << std::endl;
726 stream.setf(std::ios::dec, std::ios::basefield);
727 stream <<
"@@@@@@@@@@ sector logic output register @@@@@@@@@@\n\n";
730 for (ibx = 0; ibx <= nBunMax - 1; ibx++) {