ATLAS Offline Software
SectorLogicRXReadOutStructure.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TrigT1RPChardware_SectorLogicRXReadOutStructure_H
6 #define TrigT1RPChardware_SectorLogicRXReadOutStructure_H
7 
8 #include <vector>
9 
12 
14 public:
18 
19  void setInit();
20  //
21  ubit16 makeHeader(ubit16 *inputData);
22  ubit16 makeSubHeader() { return 0; };
23  ubit16 makeBody(ubit16 *inputData) { return *inputData; };
24  ubit16 makeFooter(ubit16 errorCode) { return errorCode; };
25  ubit16 makeFooter(ubit16 *errorCode);
26 
27  //**************************************************//
28  // general user methods to decode ReadOut stream //
29  //**************************************************//
30  ubit16 decodeFragment(ubit16 inputWord, char &field);
31  //
32  bool isHeader();
33  bool isBody() { return false; }
34  bool isFooter();
35 
36  bool isSubHeader();
37 
38  bool isInputHeader();
39  bool isOutputHeader();
40  bool isInputBody();
41  bool isOutputBody();
42  //
43  // header
44  ubit16 slid() const { return m_slid; }
45  ubit16 fel1id() const { return m_fel1id; }
46  // subheader
47  ubit16 slbcid() const { return m_slbcid; }
48  // input header
50  ubit16 inputPadId() const { return m_inputPadId; }
51  // output header
53  // input body
56  ubit16 inputRoi() const { return m_inputRoi; }
60  // output body
61  ubit16 nTriggerCand() const { return m_nTriggerCand; }
62  ubit16 outputTriggerBcid(int /*nCand*/) const { return m_outputTriggerBcid; }
63  ubit16 outputThreshold(int nCand) const { return m_outputThreshold[nCand]; }
64  ubit16 outputRoi(int nCand) const { return m_outputRoi[nCand]; }
65  ubit16 outputOverlap(int nCand) const { return m_outputOverlap[nCand]; }
67  // footer
68  ubit16 status() const { return m_status; }
69  ubit16 crc() const { return m_crc; }
70 
71  ubit16 nOfTriggerWords() const { return m_outTriggerWord.size(); }
72  bool isOutputDecoded() { return (nOfTriggerWords() == 3); }
73 
74 private:
75  //
76  // header
79  // subheader
81  // input header
84  // output header
86  // 8 or 12 bits of trigger output word
87  std::vector<ubit16> m_outTriggerWord{0};
88  // input body
95  // output body
97  std::array<ubit16, 2> m_outputThreshold{0};
98  std::array<ubit16, 2> m_outputOverlap{0};
99  std::array<ubit16, 2> m_outputRoi{0};
102  // footer
105 
106  //
107  // internal objects;
108  //
109  //
110  // some static parameter describing the structure
111  //
112  static constexpr ubit16 s_headerNum = 3;
113  static constexpr std::array<ubit16, s_headerNum> s_headerPos{12, 9, 0};
114  static constexpr std::array<ubit16, s_headerNum> s_headerLen{4, 3, 9};
115  static constexpr ubit16 s_headerVal = 0x000d;
116 
117  static constexpr ubit16 s_subHeaderNum = 2;
118  static constexpr std::array<ubit16, s_subHeaderNum> s_subHeaderPos{12, 0};
119  static constexpr std::array<ubit16, s_subHeaderNum> s_subHeaderLen{4, 12};
120  static constexpr ubit16 s_subHeaderVal = 0x0006;
121 
122  static constexpr ubit16 s_inputHeaderNum = 3;
123  static constexpr std::array<ubit16, s_inputHeaderNum> s_inputHeaderPos{12, 8, 0};
124  static constexpr std::array<ubit16, s_inputHeaderNum> s_inputHeaderLen{4, 4, 3};
125  static constexpr ubit16 s_inputHeaderVal = 0x0001;
126 
127  static constexpr ubit16 s_outputHeaderNum = 3;
128  static constexpr std::array<ubit16, s_outputHeaderNum> s_outputHeaderPos{12, 8, 0};
129  static constexpr std::array<ubit16, s_outputHeaderNum> s_outputHeaderLen{4, 4, 8};
130  static constexpr ubit16 s_outputHeaderVal = 0x0002;
131 
132  static constexpr ubit16 s_inputBodyNum = 7;
133  static constexpr std::array<ubit16, s_inputBodyNum> s_inputBodyPos{12, 9, 7, 6, 5, 2, 0};
134  static constexpr std::array<ubit16, s_inputBodyNum> s_inputBodyLen{4, 3, 1, 1, 1, 3, 2};
135  static constexpr ubit16 s_inputBodyVal = 0x0000;
136 
137  static constexpr ubit16 s_outputBodyNum = 4;
138  static constexpr std::array<ubit16, s_outputBodyNum> s_outputBodyPos{12, 0};
139  static constexpr std::array<ubit16, s_outputBodyNum> s_outputBodyLen{4, 12};
140  static constexpr ubit16 s_outputBodyVal = 0x0003;
141 
142  static constexpr ubit16 s_footerNum = 3;
143  static constexpr std::array<ubit16, s_footerNum> s_footerPos{12, 8, 0};
144  static constexpr std::array<ubit16, s_footerNum> s_footerLen{4, 4, 8};
145  static constexpr ubit16 s_footerVal = 0x000f;
146  //
147 };
148 
149 #endif
SectorLogicRXReadOutStructure::m_outputOverlap
std::array< ubit16, 2 > m_outputOverlap
Definition: SectorLogicRXReadOutStructure.h:98
SectorLogicRXReadOutStructure::crc
ubit16 crc() const
Definition: SectorLogicRXReadOutStructure.h:69
SectorLogicRXReadOutStructure::inputOuterPlane
ubit16 inputOuterPlane() const
Definition: SectorLogicRXReadOutStructure.h:59
SectorLogicRXReadOutStructure::s_headerVal
static constexpr ubit16 s_headerVal
Definition: SectorLogicRXReadOutStructure.h:115
SectorLogicRXReadOutStructure::s_subHeaderNum
static constexpr ubit16 s_subHeaderNum
Definition: SectorLogicRXReadOutStructure.h:117
SectorLogicRXReadOutStructure::isFooter
bool isFooter()
Definition: SectorLogicRXReadOutStructure.cxx:154
SectorLogicRXReadOutStructure::m_inputOuterPlane
ubit16 m_inputOuterPlane
Definition: SectorLogicRXReadOutStructure.h:94
SectorLogicRXReadOutStructure::inputOverlapPhi
ubit16 inputOverlapPhi() const
Definition: SectorLogicRXReadOutStructure.h:58
SectorLogicRXReadOutStructure::s_outputBodyNum
static constexpr ubit16 s_outputBodyNum
Definition: SectorLogicRXReadOutStructure.h:137
RPCReadOut.h
SectorLogicRXReadOutStructure::s_footerPos
static constexpr std::array< ubit16, s_footerNum > s_footerPos
Definition: SectorLogicRXReadOutStructure.h:143
SectorLogicRXReadOutStructure::isHeader
bool isHeader()
Definition: SectorLogicRXReadOutStructure.cxx:110
SectorLogicRXReadOutStructure::m_status
ubit16 m_status
Definition: SectorLogicRXReadOutStructure.h:103
SectorLogicRXReadOutStructure::s_outputBodyVal
static constexpr ubit16 s_outputBodyVal
Definition: SectorLogicRXReadOutStructure.h:140
SectorLogicRXReadOutStructure::isSubHeader
bool isSubHeader()
Definition: SectorLogicRXReadOutStructure.cxx:117
SectorLogicRXReadOutStructure::outputThreshold
ubit16 outputThreshold(int nCand) const
Definition: SectorLogicRXReadOutStructure.h:63
SectorLogicRXReadOutStructure::slid
ubit16 slid() const
Definition: SectorLogicRXReadOutStructure.h:44
SectorLogicRXReadOutStructure::m_outputThreshold
std::array< ubit16, 2 > m_outputThreshold
Definition: SectorLogicRXReadOutStructure.h:97
SectorLogicRXReadOutStructure::inputTriggerBcid
ubit16 inputTriggerBcid() const
Definition: SectorLogicRXReadOutStructure.h:54
SectorLogicRXReadOutStructure
Definition: SectorLogicRXReadOutStructure.h:13
SectorLogicRXReadOutStructure::makeHeader
ubit16 makeHeader(ubit16 *inputData)
Definition: SectorLogicRXReadOutStructure.cxx:29
SectorLogicRXReadOutStructure::makeSubHeader
ubit16 makeSubHeader()
Definition: SectorLogicRXReadOutStructure.h:22
SectorLogicRXReadOutStructure::hasMoreThan2TriggerCand
ubit16 hasMoreThan2TriggerCand() const
Definition: SectorLogicRXReadOutStructure.h:66
SectorLogicRXReadOutStructure::status
ubit16 status() const
Definition: SectorLogicRXReadOutStructure.h:68
SectorLogicRXReadOutStructure::s_outputBodyPos
static constexpr std::array< ubit16, s_outputBodyNum > s_outputBodyPos
Definition: SectorLogicRXReadOutStructure.h:138
SectorLogicRXReadOutStructure::s_inputBodyLen
static constexpr std::array< ubit16, s_inputBodyNum > s_inputBodyLen
Definition: SectorLogicRXReadOutStructure.h:134
SectorLogicRXReadOutStructure::m_nTriggerCand
ubit16 m_nTriggerCand
Definition: SectorLogicRXReadOutStructure.h:100
SectorLogicRXReadOutStructure::inputThreshold
ubit16 inputThreshold() const
Definition: SectorLogicRXReadOutStructure.h:55
SectorLogicRXReadOutStructure::s_inputBodyVal
static constexpr ubit16 s_inputBodyVal
Definition: SectorLogicRXReadOutStructure.h:135
SectorLogicRXReadOutStructure::isOutputBody
bool isOutputBody()
Definition: SectorLogicRXReadOutStructure.cxx:146
SectorLogicRXReadOutStructure::makeBody
ubit16 makeBody(ubit16 *inputData)
Definition: SectorLogicRXReadOutStructure.h:23
SectorLogicRXReadOutStructure::setInit
void setInit()
Definition: SectorLogicRXReadOutStructure.cxx:26
SectorLogicRXReadOutStructure::isOutputHeader
bool isOutputHeader()
Definition: SectorLogicRXReadOutStructure.cxx:131
SectorLogicRXReadOutStructure::s_headerNum
static constexpr ubit16 s_headerNum
Definition: SectorLogicRXReadOutStructure.h:112
SectorLogicRXReadOutStructure::s_outputHeaderVal
static constexpr ubit16 s_outputHeaderVal
Definition: SectorLogicRXReadOutStructure.h:130
SectorLogicRXReadOutStructure::m_outTriggerWord
std::vector< ubit16 > m_outTriggerWord
Definition: SectorLogicRXReadOutStructure.h:87
SectorLogicRXReadOutStructure::m_crc
ubit16 m_crc
Definition: SectorLogicRXReadOutStructure.h:104
SectorLogicRXReadOutStructure::s_headerLen
static constexpr std::array< ubit16, s_headerNum > s_headerLen
Definition: SectorLogicRXReadOutStructure.h:114
SectorLogicRXReadOutStructure::isInputHeader
bool isInputHeader()
Definition: SectorLogicRXReadOutStructure.cxx:124
SectorLogicRXReadOutStructure::s_inputBodyNum
static constexpr ubit16 s_inputBodyNum
Definition: SectorLogicRXReadOutStructure.h:132
SectorLogicRXReadOutStructure::~SectorLogicRXReadOutStructure
~SectorLogicRXReadOutStructure()=default
SectorLogicRXReadOutStructure::outputRowinBcid
ubit16 outputRowinBcid() const
Definition: SectorLogicRXReadOutStructure.h:52
SectorLogicRXReadOutStructure::fel1id
ubit16 fel1id() const
Definition: SectorLogicRXReadOutStructure.h:45
SectorLogicRXReadOutStructure::m_inputOverlapPhi
ubit16 m_inputOverlapPhi
Definition: SectorLogicRXReadOutStructure.h:93
SectorLogicRXReadOutStructure::s_footerVal
static constexpr ubit16 s_footerVal
Definition: SectorLogicRXReadOutStructure.h:145
SectorLogicRXReadOutStructure::m_inputOverlapEta
ubit16 m_inputOverlapEta
Definition: SectorLogicRXReadOutStructure.h:92
SectorLogicRXReadOutStructure::s_inputHeaderPos
static constexpr std::array< ubit16, s_inputHeaderNum > s_inputHeaderPos
Definition: SectorLogicRXReadOutStructure.h:123
SectorLogicRXReadOutStructure::outputOverlap
ubit16 outputOverlap(int nCand) const
Definition: SectorLogicRXReadOutStructure.h:65
Lvl1Def.h
SectorLogicRXReadOutStructure::nOfTriggerWords
ubit16 nOfTriggerWords() const
Definition: SectorLogicRXReadOutStructure.h:71
SectorLogicRXReadOutStructure::s_inputHeaderVal
static constexpr ubit16 s_inputHeaderVal
Definition: SectorLogicRXReadOutStructure.h:125
SectorLogicRXReadOutStructure::inputOverlapEta
ubit16 inputOverlapEta() const
Definition: SectorLogicRXReadOutStructure.h:57
SectorLogicRXReadOutStructure::s_footerLen
static constexpr std::array< ubit16, s_footerNum > s_footerLen
Definition: SectorLogicRXReadOutStructure.h:144
SectorLogicRXReadOutStructure::slbcid
ubit16 slbcid() const
Definition: SectorLogicRXReadOutStructure.h:47
SectorLogicRXReadOutStructure::m_inputRoi
ubit16 m_inputRoi
Definition: SectorLogicRXReadOutStructure.h:91
RPCReadOut::field
char field() const
Definition: RPCReadOut.h:19
SectorLogicRXReadOutStructure::m_outputRowinBcid
ubit16 m_outputRowinBcid
Definition: SectorLogicRXReadOutStructure.h:85
SectorLogicRXReadOutStructure::nTriggerCand
ubit16 nTriggerCand() const
Definition: SectorLogicRXReadOutStructure.h:61
SectorLogicRXReadOutStructure::m_inputPadId
ubit16 m_inputPadId
Definition: SectorLogicRXReadOutStructure.h:83
SectorLogicRXReadOutStructure::inputRowinBcid
ubit16 inputRowinBcid() const
Definition: SectorLogicRXReadOutStructure.h:49
SectorLogicRXReadOutStructure::inputRoi
ubit16 inputRoi() const
Definition: SectorLogicRXReadOutStructure.h:56
SectorLogicRXReadOutStructure::s_inputHeaderNum
static constexpr ubit16 s_inputHeaderNum
Definition: SectorLogicRXReadOutStructure.h:122
SectorLogicRXReadOutStructure::isInputBody
bool isInputBody()
Definition: SectorLogicRXReadOutStructure.cxx:138
SectorLogicRXReadOutStructure::m_slbcid
ubit16 m_slbcid
Definition: SectorLogicRXReadOutStructure.h:80
SectorLogicRXReadOutStructure::outputTriggerBcid
ubit16 outputTriggerBcid(int) const
Definition: SectorLogicRXReadOutStructure.h:62
SectorLogicRXReadOutStructure::s_subHeaderVal
static constexpr ubit16 s_subHeaderVal
Definition: SectorLogicRXReadOutStructure.h:120
SectorLogicRXReadOutStructure::m_inputThreshold
ubit16 m_inputThreshold
Definition: SectorLogicRXReadOutStructure.h:90
SectorLogicRXReadOutStructure::m_outputTriggerBcid
ubit16 m_outputTriggerBcid
Definition: SectorLogicRXReadOutStructure.h:96
SectorLogicRXReadOutStructure::s_outputBodyLen
static constexpr std::array< ubit16, s_outputBodyNum > s_outputBodyLen
Definition: SectorLogicRXReadOutStructure.h:139
SectorLogicRXReadOutStructure::s_footerNum
static constexpr ubit16 s_footerNum
Definition: SectorLogicRXReadOutStructure.h:142
SectorLogicRXReadOutStructure::s_outputHeaderNum
static constexpr ubit16 s_outputHeaderNum
Definition: SectorLogicRXReadOutStructure.h:127
SectorLogicRXReadOutStructure::makeFooter
ubit16 makeFooter(ubit16 errorCode)
Definition: SectorLogicRXReadOutStructure.h:24
SectorLogicRXReadOutStructure::s_outputHeaderLen
static constexpr std::array< ubit16, s_outputHeaderNum > s_outputHeaderLen
Definition: SectorLogicRXReadOutStructure.h:129
SectorLogicRXReadOutStructure::s_headerPos
static constexpr std::array< ubit16, s_headerNum > s_headerPos
Definition: SectorLogicRXReadOutStructure.h:113
SectorLogicRXReadOutStructure::m_fel1id
ubit16 m_fel1id
Definition: SectorLogicRXReadOutStructure.h:78
SectorLogicRXReadOutStructure::m_slid
ubit16 m_slid
Definition: SectorLogicRXReadOutStructure.h:77
SectorLogicRXReadOutStructure::SectorLogicRXReadOutStructure
SectorLogicRXReadOutStructure()
Definition: SectorLogicRXReadOutStructure.cxx:12
SectorLogicRXReadOutStructure::s_inputBodyPos
static constexpr std::array< ubit16, s_inputBodyNum > s_inputBodyPos
Definition: SectorLogicRXReadOutStructure.h:133
SectorLogicRXReadOutStructure::isOutputDecoded
bool isOutputDecoded()
Definition: SectorLogicRXReadOutStructure.h:72
SectorLogicRXReadOutStructure::m_inputRowinBcid
ubit16 m_inputRowinBcid
Definition: SectorLogicRXReadOutStructure.h:82
SectorLogicRXReadOutStructure::decodeFragment
ubit16 decodeFragment(ubit16 inputWord, char &field)
Definition: SectorLogicRXReadOutStructure.cxx:39
SectorLogicRXReadOutStructure::s_outputHeaderPos
static constexpr std::array< ubit16, s_outputHeaderNum > s_outputHeaderPos
Definition: SectorLogicRXReadOutStructure.h:128
SectorLogicRXReadOutStructure::outputRoi
ubit16 outputRoi(int nCand) const
Definition: SectorLogicRXReadOutStructure.h:64
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
RPCReadOut
Definition: RPCReadOut.h:13
SectorLogicRXReadOutStructure::inputPadId
ubit16 inputPadId() const
Definition: SectorLogicRXReadOutStructure.h:50
SectorLogicRXReadOutStructure::isBody
bool isBody()
Definition: SectorLogicRXReadOutStructure.h:33
SectorLogicRXReadOutStructure::m_moreThan2TriggerCand
bool m_moreThan2TriggerCand
Definition: SectorLogicRXReadOutStructure.h:101
SectorLogicRXReadOutStructure::s_subHeaderPos
static constexpr std::array< ubit16, s_subHeaderNum > s_subHeaderPos
Definition: SectorLogicRXReadOutStructure.h:118
SectorLogicRXReadOutStructure::m_outputRoi
std::array< ubit16, 2 > m_outputRoi
Definition: SectorLogicRXReadOutStructure.h:99
SectorLogicRXReadOutStructure::s_inputHeaderLen
static constexpr std::array< ubit16, s_inputHeaderNum > s_inputHeaderLen
Definition: SectorLogicRXReadOutStructure.h:124
SectorLogicRXReadOutStructure::m_inputTriggerBcid
ubit16 m_inputTriggerBcid
Definition: SectorLogicRXReadOutStructure.h:89
SectorLogicRXReadOutStructure::s_subHeaderLen
static constexpr std::array< ubit16, s_subHeaderNum > s_subHeaderLen
Definition: SectorLogicRXReadOutStructure.h:119