ATLAS Offline Software
Functions
SectorLogic.cxx File Reference
#include "TrigT1RPChardware/SectorLogic.h"
Include dependency graph for SectorLogic.cxx:

Go to the source code of this file.

Functions

CMAword getbits (CMAword x, int msb, int lsb)
 
unsigned setbits (unsigned x, int msb, int lsb, unsigned y)
 
ostream & dfpa (ostream &stream, int indent, int whitesp, int ntimes)
 
ostream & operator<< (ostream &stream, const DataFromPad &o)
 
ostream & ofsla (ostream &stream, int indent, int whitesp, int ntimes)
 
ostream & operator<< (ostream &stream, OutputFromSectorLogic &o)
 
ostream & operator<< (ostream &stream, InternalRegister &o)
 
std::ostream & operator<< (std::ostream &stream, SectorLogic &o)
 

Function Documentation

◆ dfpa()

ostream& dfpa ( ostream &  stream,
int  indent,
int  whitesp,
int  ntimes 
)

Definition at line 46 of file SectorLogic.cxx.

46  {
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";
52  }
53  stream << std::endl;
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";
58  }
59  stream << std::endl;
60  return stream;
61 }

◆ getbits()

CMAword getbits ( CMAword  x,
int  msb,
int  lsb 
)

Definition at line 27 of file SectorLogic.cxx.

27 { return ~(~0u << (msb - lsb + 1)) & (x >> lsb); }

◆ ofsla()

ostream& ofsla ( ostream &  stream,
int  indent,
int  whitesp,
int  ntimes 
)

Definition at line 83 of file SectorLogic.cxx.

83  {
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";
89  }
90  stream << std::endl;
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";
95  }
96  stream << std::endl;
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 ";
101  }
102  stream << std::endl;
103  return stream;
104 }

◆ operator<<() [1/4]

ostream& operator<< ( ostream &  stream,
const DataFromPad o 
)

Definition at line 64 of file SectorLogic.cxx.

64  {
65  stream.width(3);
66  stream.fill('x');
67  stream << o.bcid << " ";
68  stream.width(1);
69  stream.fill(' ');
70  stream << o.opl << " ";
71  stream << o.r << " ";
72  stream << o.oveta << " ";
73  stream << o.ovphi << " ";
74  stream << o.pt << " ";
75  stream << o.roi << " ";
76  stream << o.ntrig << " ";
77  stream << o.sign;
78  return stream;
79 }

◆ operator<<() [2/4]

ostream& operator<< ( std::ostream &  stream,
InternalRegister o 
)

Definition at line 140 of file SectorLogic.cxx.

140  {
141  int j = 0;
142  for (j = 0; j <= 7; j++) {
143  stream << "pad[" << j << "] : ";
144  stream << o.pad[j] << std::endl;
145  }
146  stream.setf(ios::hex, ios::basefield);
147  stream << "tile : " << o.tile << std::endl;
148  stream << "sl out : " << o.out;
149  stream.setf(ios::hex, ios::basefield);
150  return stream;
151 }

◆ operator<<() [3/4]

ostream& operator<< ( std::ostream &  stream,
OutputFromSectorLogic o 
)

Definition at line 107 of file SectorLogic.cxx.

107  {
108  // stream << "x x ";
109  stream.setf(std::ios::dec, std::ios::basefield);
110  // stream << setw(3);
111  stream << o.sign2;
112  stream << o.sign1;
113  stream.width(3);
114  stream.fill('x');
115  stream << o.bcid;
116  stream.width(1);
117  stream.fill(' ');
118  stream << o.ntrig2;
119  stream << o.ntrig1;
120  stream << o.pt2;
121  stream << o.pt1;
122  stream << o.ove2;
123  stream << o.ovf2;
124  stream << o.r2;
125  stream << o.pad2;
126  stream << o.roi2;
127  stream << o.ove1;
128  stream << o.ovf1;
129  stream << o.r1;
130  stream << o.pad1;
131  stream << o.roi1;
132  stream << o.ntrig;
133  return stream;
134 }

◆ operator<<() [4/4]

std::ostream& operator<< ( std::ostream &  stream,
SectorLogic o 
)

Definition at line 543 of file SectorLogic.cxx.

543  {
544  int nBunMax = o.numberOfBunches();
545  stream << "@@@@@@@@@@ event and sector logic identification @@@@@@@@@@\n\n";
546 
547  stream << "run = " << o.m_run << std::endl;
548  stream << "event = " << o.m_event << std::endl;
549  stream << "debug = " << o.m_debug << std::endl;
550  stream << "subsys = " << o.m_subsys << std::endl;
551  stream << "sect = " << o.m_sect << std::endl;
552 
553  stream << std::endl;
554 
555  // print all the parameters of the sector logic board
556  stream << "@@@@@@@@@@ sector logic configuration parameters @@@@@@@@@@\n\n";
557 
558  // tccheck
559  stream.setf(ios::hex, ios::basefield);
560  stream << "EnableTCCheckLow : ";
561  stream.width(8);
562  stream.fill('0');
563  stream << o.m_EnableTCCheckLow << std::endl;
564  stream << "EnableTCCheckHigh : ";
565  stream.width(8);
566  stream.fill('0');
567  stream << o.m_EnableTCCheckHigh << std::endl;
568  int jj = 0;
569  int kk = 0;
570  for (jj = 0; jj <= 7; jj++) {
571  stream << "SetTCCheck pad[";
572  stream << jj;
573  stream << "] : ";
574  for (kk = 5; kk >= 0; kk--) {
575  stream.width(8);
576  stream.fill('0');
577  stream << o.m_SetTCCheck[jj][kk] << " ";
578  }
579  stream << std::endl;
580  }
581  stream << std::endl;
582 
583  // opl check
584  stream << "EnableOPLCheck : ";
585  stream.width(8);
586  stream.fill('0');
587  stream << o.m_EnableOPLCheck << std::endl;
588  for (jj = 0; jj <= 7; jj++) {
589  stream << "SetOPLCheck pad[";
590  stream << jj;
591  stream << "] : ";
592  for (kk = 2; kk >= 0; kk--) {
593  stream.width(2);
594  stream.fill('0');
595  stream << o.m_SetOPLCheck[jj][kk] << " ";
596  }
597  stream << std::endl;
598  }
599  stream << std::endl;
600 
601  stream.width(1);
602  stream.fill(' ');
603 
604  // internal register (input register)
605  InternalRegister *intreginp[5];
606  intreginp[0] = o.m_LowPtFilter_in.data();
607  intreginp[1] = o.m_TileCalConfirm_in.data();
608  intreginp[2] = o.m_SolveEtaOverlap_in.data();
609  intreginp[3] = o.m_SortHighest_in.data();
610  intreginp[4] = o.m_Sort2ndHighest_in.data();
611  // internal register (output register)
612  InternalRegister *intregoutp[5];
613  intregoutp[0] = o.m_LowPtFilter_out.data();
614  intregoutp[1] = o.m_TileCalConfirm_out.data();
615  intregoutp[2] = o.m_SolveEtaOverlap_out.data();
616  intregoutp[3] = o.m_SortHighest_out.data();
617  intregoutp[4] = o.m_Sort2ndHighest_out.data();
618 
619  int ibx = 0;
620 
621  // print the input registers of the sector logic board
622  stream << "@@@@@@@@@@ sector logic input registers @@@@@@@@@@\n\n";
623 
624  // print input from pads
625  stream.setf(std::ios::dec, std::ios::basefield);
626  dfpa(stream, 8, 8, nBunMax);
627  int ipad = 0;
628  for (ipad = 0; ipad <= 7; ipad++) {
629  stream << "pad[" << ipad << "] :";
630  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
631  stream << " ";
632  stream << o.m_InFromPad[ibx][ipad];
633  }
634  stream << std::endl;
635  }
636 
637  // print input from tilecal
638  stream.setf(std::ios::hex, std::ios::basefield);
639  stream << "tile :";
640  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
641  stream << " ";
642  stream.width(8);
643  stream.fill('0');
644  stream << o.m_InFromTileCal[ibx];
645  }
646  stream.width(1);
647  stream.fill(' ');
648  stream << std::endl << std::endl;
649 
650  // print all sector logic internal registers
651  stream << "@@@@@@@@@@ sector logic internal registers @@@@@@@@@@\n\n";
652 
653  int ireg = 0;
654  for (ireg = 0; ireg <= 4; ireg++) {
655  // input registers
656  stream << "internal registers # " << ireg + 1 << " (input)" << std::endl;
657  // DataFromPad
658  stream.setf(std::ios::dec, std::ios::basefield);
659  dfpa(stream, 8, 8, nBunMax);
660  for (ipad = 0; ipad <= 7; ipad++) {
661  stream << "pad[" << ipad << "] :";
662  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
663  stream << " ";
664  stream << (intreginp[ireg] + ibx)->pad[ipad];
665  }
666  stream << std::endl;
667  }
668  // Tile Cal
669  stream.setf(ios::hex, ios::basefield);
670  stream << "tile :";
671  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
672  stream << " ";
673  stream.width(8);
674  stream.fill('0');
675  stream << (intreginp[ireg] + ibx)->tile;
676  }
677  stream.width(1);
678  stream.fill(' ');
679  stream << std::endl;
680  // Sector Logic Output
681  stream.setf(std::ios::dec, std::ios::basefield);
682  stream << "sl out :";
683  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
684  stream << " ";
685  stream << (intreginp[ireg] + ibx)->out;
686  }
687  stream << std::endl;
688  stream << std::endl;
689 
690  // output registers
691  stream << "internal registers # " << ireg + 1 << " (output)" << std::endl;
692  // DataFromPad
693  stream.setf(std::ios::dec, std::ios::basefield);
694  dfpa(stream, 8, 8, nBunMax);
695  for (ipad = 0; ipad <= 7; ipad++) {
696  stream << "pad[" << ipad << "] :";
697  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
698  stream << " ";
699  stream << (intregoutp[ireg] + ibx)->pad[ipad];
700  }
701  stream << std::endl;
702  }
703  // Tile Cal
704  stream.setf(std::ios::hex, std::ios::basefield);
705  stream << "tile :";
706  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
707  stream << " ";
708  stream.width(8);
709  stream.fill('0');
710  stream << (intregoutp[ireg] + ibx)->tile;
711  }
712  stream.width(1);
713  stream.fill(' ');
714  stream << std::endl;
715  // Sector Logic Output
716  stream.setf(std::ios::dec, std::ios::basefield);
717  stream << "sl out :";
718  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
719  stream << " ";
720  stream << (intregoutp[ireg] + ibx)->out;
721  }
722  stream << std::endl << std::endl;
723  }
724 
725  // print the output registers of the sector logic board
726  stream.setf(std::ios::dec, std::ios::basefield);
727  stream << "@@@@@@@@@@ sector logic output register @@@@@@@@@@\n\n";
728  ofsla(stream, 8, 5, nBunMax);
729  stream << " ";
730  for (ibx = 0; ibx <= nBunMax - 1; ibx++) {
731  stream << " ";
732  stream << o.m_OutFromSectorLogic[ibx];
733  }
734 
735  return stream;
736 }

◆ setbits()

unsigned setbits ( unsigned  x,
int  msb,
int  lsb,
unsigned  y 
)

Definition at line 32 of file SectorLogic.cxx.

32  {
33  unsigned mask = 0u;
34  mask = (~0u << (msb + 1)) | ~(~0u << lsb);
35  return (x & mask) | (y << lsb);
36 }
OutputFromSectorLogic::ove2
int ove2
Definition: SectorLogic.h:73
OutputFromSectorLogic::r1
int r1
Definition: SectorLogic.h:66
InternalRegister::tile
CMAword tile
Definition: SectorLogic.h:89
SectorLogic::m_run
int m_run
Definition: SectorLogic.h:98
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
OutputFromSectorLogic::sign1
int sign1
Definition: SectorLogic.h:79
SectorLogic::m_Sort2ndHighest_out
std::array< InternalRegister, 8 > m_Sort2ndHighest_out
Definition: SectorLogic.h:205
SectorLogic::m_SolveEtaOverlap_out
std::array< InternalRegister, 8 > m_SolveEtaOverlap_out
Definition: SectorLogic.h:199
DataFromPad::opl
int opl
Definition: SectorLogic.h:31
OutputFromSectorLogic::pad1
int pad1
Definition: SectorLogic.h:65
x
#define x
SectorLogic::m_EnableTCCheckLow
CMAword m_EnableTCCheckLow
Definition: SectorLogic.h:165
SectorLogic::m_SetTCCheck
CMAword m_SetTCCheck[8][6]
Definition: SectorLogic.h:157
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
SectorLogic::m_debug
CMAword m_debug
Definition: SectorLogic.h:100
ReadCellNoiseFromCool.tile
tile
Definition: ReadCellNoiseFromCool.py:92
DataFromPad::sign
int sign
Definition: SectorLogic.h:35
SectorLogic::m_LowPtFilter_out
std::array< InternalRegister, 8 > m_LowPtFilter_out
Definition: SectorLogic.h:193
python.changerun.kk
list kk
Definition: changerun.py:41
InternalRegister::out
OutputFromSectorLogic out
Definition: SectorLogic.h:90
OutputFromSectorLogic::ovf1
int ovf1
Definition: SectorLogic.h:67
SectorLogic::numberOfBunches
ubit16 numberOfBunches() const
Definition: SectorLogic.h:218
DataFromPad::bcid
int bcid
Definition: SectorLogic.h:27
InternalRegister::pad
std::array< DataFromPad, 8 > pad
Definition: SectorLogic.h:88
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:36
dfpa
ostream & dfpa(ostream &stream, int indent, int whitesp, int ntimes)
Definition: SectorLogic.cxx:46
OutputFromSectorLogic::bcid
int bcid
Definition: SectorLogic.h:78
DataFromPad::ovphi
int ovphi
Definition: SectorLogic.h:30
SectorLogic::m_TileCalConfirm_in
std::array< InternalRegister, 8 > m_TileCalConfirm_in
Definition: SectorLogic.h:195
SectorLogic::m_EnableTCCheckHigh
CMAword m_EnableTCCheckHigh
Definition: SectorLogic.h:166
OutputFromSectorLogic::roi1
int roi1
Definition: SectorLogic.h:64
SectorLogic::m_event
int m_event
Definition: SectorLogic.h:99
OutputFromSectorLogic::pt1
int pt1
Definition: SectorLogic.h:74
SectorLogic::m_LowPtFilter_in
std::array< InternalRegister, 8 > m_LowPtFilter_in
Definition: SectorLogic.h:192
SectorLogic::m_InFromPad
DataFromPad m_InFromPad[8][8]
Definition: SectorLogic.h:184
DataFromPad::pt
int pt
Definition: SectorLogic.h:32
DataFromPad::r
int r
Definition: SectorLogic.h:28
OutputFromSectorLogic::pt2
int pt2
Definition: SectorLogic.h:75
SectorLogic::m_EnableOPLCheck
CMAword m_EnableOPLCheck
Definition: SectorLogic.h:181
InternalRegister
Definition: SectorLogic.h:86
SectorLogic::m_InFromTileCal
std::array< CMAword, 8 > m_InFromTileCal
Definition: SectorLogic.h:185
OutputFromSectorLogic::ove1
int ove1
Definition: SectorLogic.h:68
DataFromPad::ntrig
int ntrig
Definition: SectorLogic.h:34
SectorLogic::m_SetOPLCheck
ubit16 m_SetOPLCheck[8][3]
Definition: SectorLogic.h:173
OutputFromSectorLogic::ntrig1
int ntrig1
Definition: SectorLogic.h:76
SectorLogic::m_OutFromSectorLogic
std::array< OutputFromSectorLogic, 8 > m_OutFromSectorLogic
Definition: SectorLogic.h:186
DataFromPad::roi
int roi
Definition: SectorLogic.h:33
OutputFromSectorLogic::ntrig2
int ntrig2
Definition: SectorLogic.h:77
SectorLogic::m_subsys
ubit16 m_subsys
Definition: SectorLogic.h:101
SectorLogic::m_sect
ubit16 m_sect
Definition: SectorLogic.h:102
y
#define y
SectorLogic::m_SortHighest_in
std::array< InternalRegister, 8 > m_SortHighest_in
Definition: SectorLogic.h:201
DataFromPad::oveta
int oveta
Definition: SectorLogic.h:29
OutputFromSectorLogic::sign2
int sign2
Definition: SectorLogic.h:80
ofsla
ostream & ofsla(ostream &stream, int indent, int whitesp, int ntimes)
Definition: SectorLogic.cxx:83
SectorLogic::m_SortHighest_out
std::array< InternalRegister, 8 > m_SortHighest_out
Definition: SectorLogic.h:202
OutputFromSectorLogic::roi2
int roi2
Definition: SectorLogic.h:69
SectorLogic::m_Sort2ndHighest_in
std::array< InternalRegister, 8 > m_Sort2ndHighest_in
Definition: SectorLogic.h:204
OutputFromSectorLogic::pad2
int pad2
Definition: SectorLogic.h:70
OutputFromSectorLogic::r2
int r2
Definition: SectorLogic.h:71
OutputFromSectorLogic::ntrig
int ntrig
Definition: SectorLogic.h:63
SectorLogic::m_SolveEtaOverlap_in
std::array< InternalRegister, 8 > m_SolveEtaOverlap_in
Definition: SectorLogic.h:198
SectorLogic::m_TileCalConfirm_out
std::array< InternalRegister, 8 > m_TileCalConfirm_out
Definition: SectorLogic.h:196
OutputFromSectorLogic::ovf2
int ovf2
Definition: SectorLogic.h:72