ATLAS Offline Software
MatrixReadOutStructure.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_MatrixReadOutStructure_H
6 #define TrigT1RPChardware_MatrixReadOutStructure_H
7 
10 #include "TrigT1RPChardware/crc8.h"
11 
12 // class RPCReadOut;
14 public:
16  MatrixReadOutStructure(ubit16 inputData);
18  void setInit();
19  //
20  ubit16 makeHeader(ubit16 *inputData);
22  ubit16 makeBody(ubit16 *inputData);
23  ubit16 makeFooter(ubit16 inputData);
24  ubit16 makeFooter(ubit16 *inputData);
25  //
26  //**************************************************//
27  // general user methods to decode ReadOut stream //
28  //**************************************************//
29  ubit16 decodeFragment(ubit16 inputWord, char &field);
30  ubit16 cmid() { return m_cmid; };
31  ubit16 fel1id() { return m_fel1id; };
32  ubit16 febcid() { return m_febcid; };
33  ubit16 bcid() { return m_bcid; };
34  ubit16 time() { return m_time; };
35  ubit16 ijk() { return m_ijk; };
36  ubit16 channel() { return m_channel; }; // 0-32
37  ubit16 threshold() { return m_threshold; };
38  ubit16 overlap() { return m_overlap; };
39  ubit16 status() { return m_status; };
40  ubit16 crc() { return m_crc; };
41  //
42  bool isLowPt();
43  bool isHigPt();
44  bool isEtaProj();
45  bool isPhiProj();
46  bool is0LocAdd();
47  bool is1LocAdd();
48  //
50  ubit16 getFooterPos() { return s_footerPos[0]; };
51 
52  bool isHeader();
53  bool isSubHeader();
54  bool isBody();
55  bool isFooter();
56 
57  // create a 16 bits word of the CMA frame structure , starting from the fields:
58  // ubit16 set16Bits(const ubit16 num, const ubit16 *pos, const ubit16 *val);
59  // get the fields of the 16 bits word of the CMA frame structure:
60  // ubit16 get16Bits(const ubit16 num, const ubit16 pos, const ubit16 val);
61 
62  // some optional methods:
63  // get the real channel strip:
64  ubit16 global_channel(); // 0-64
65  ubit16 isPivot();
66  bool isTrigger();
67 
68 private:
69  //************************//
70  // Matrix ReadOut decoded data
71  //
72  // ubit16 m_word;
73  // char m_field;
86 
87  // some static parameter describing the structure
88  static const ubit16 s_headerNum = 3;
91  static const ubit16 s_headerVal;
92  static const ubit16 s_subHeaderNum = 2;
95  static const ubit16 s_subHeaderVal;
96  static const ubit16 s_CMABodyNum = 5;
99  static const ubit16 s_CMABodyVal;
100  static const ubit16 s_footerNum = 3;
103  static const ubit16 s_footerVal;
104 
105  //**********************************************************//
106  // Header: bit 00-08 FEL1ID
107  // Header: bit 09-11 CMcode
108  // Header: bit 12-12 0 - reserved
109  // Header: bit 13-13 0 - reserved
110  // Header: bit 14-14 1 - reserved
111  // Header: bit 15-15 1 - reserved
112  // Header: bit 00-08 FEL1ID
113  //
114  // Subheader: bit 00-11 FEBCID
115  // Subheader: bit 12-12 0 - reserved
116  // Subheader: bit 13-13 0 - reserved
117  // Subheader: bit 14-14 0 - reserved
118  // Subheader: bit 15-15 1 - reserved
119  //
120  // Body: bit 00-04 strip address
121  // Body: bit 05-07 IJK
122  // Body: bit 08-10 strip time
123  // Body: bit 11-13 BCID
124  // Body: bit 14-15 0
125  //
126  // IJK coding:
127  // IJK = 0 ==> pivot plane layer 0 channels 00-31 (all channels)
128  // IJK = 1 ==> pivot plane layer 1 channels 00-31 (all channels)
129  // IJK = 2 ==> coincidence plane layer 0 channels 00-31 (first 32 channels)
130  // IJK = 3 ==> coincidence plane layer 0 channels 32-63 (secon 32 channels)
131  // IJK = 4 ==> coincidence plane layer 1 channels 00-31 (first 32 channels)
132  // IJK = 5 ==> coincidence plane layer 1 channels 32-63 (secon 32 channels)
133  // IJK = 6 ==> trigger pattern channels 00-31
134  // IJK = 7 ==> highest threshold triggered + overlap flags
135  //
136  // 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
137  // -----------------------------------------------------------------
138  // | 1 | 1 | 0 | 0 | CMcode | F E L 1 I D | HEADER
139  // -----------------------------------------------------------------
140  // | 1 | 0 | 0 | 0 | F E B C I D | SUBHEADER
141  // -----------------------------------------------------------------
142  // | 0 | 0 | BCID | TIME | IJK | STRIP | BODY-Hit
143  // -----------------------------------------------------------------
144  // | 0 | 0 | BCID | TIME | IJK | STRIP | BODY-Hit
145  // -----------------------------------------------------------------
146  // | 0 | 0 | BCID | TIME | IJK | STRIP | BODY-Hit
147  // .................................................................
148  // -----------------------------------------------------------------
149  // | 0 | 0 | BCID | TIME | IJK | STRIP | BODY-Hit
150  // -----------------------------------------------------------------
151  // | 0 | 1 | 0 | 0 | STATUS | CRC | FOOTER
152  // -----------------------------------------------------------------
153  //
154  // CMcode: bit 00 localAddress (0 or 1)
155  // CMcode: bit 01 etaPhi: 0=eta; 1=phi
156  // CMcode: bit 02 lowHig: 0=low; 1=high
157  //
158 };
159 #endif
MatrixReadOutStructure::m_cmid
ubit16 m_cmid
Definition: MatrixReadOutStructure.h:74
MatrixReadOutStructure::makeBody
ubit16 makeBody(ubit16 *inputData)
Definition: MatrixReadOutStructure.cxx:83
MatrixReadOutStructure::m_threshold
ubit16 m_threshold
Definition: MatrixReadOutStructure.h:82
MatrixReadOutStructure::isHigPt
bool isHigPt()
Definition: MatrixReadOutStructure.cxx:224
MatrixReadOutStructure::febcid
ubit16 febcid()
Definition: MatrixReadOutStructure.h:32
MatrixReadOutStructure::m_overlap
ubit16 m_overlap
Definition: MatrixReadOutStructure.h:83
MatrixReadOutStructure::MatrixReadOutStructure
MatrixReadOutStructure()
Definition: MatrixReadOutStructure.cxx:40
MatrixReadOutStructure::m_crc
ubit16 m_crc
Definition: MatrixReadOutStructure.h:85
MatrixReadOutStructure::channel
ubit16 channel()
Definition: MatrixReadOutStructure.h:36
MatrixReadOutStructure::ijk
ubit16 ijk()
Definition: MatrixReadOutStructure.h:35
MatrixReadOutStructure::decodeFragment
ubit16 decodeFragment(ubit16 inputWord, char &field)
Definition: MatrixReadOutStructure.cxx:111
MatrixReadOutStructure::status
ubit16 status()
Definition: MatrixReadOutStructure.h:39
MatrixReadOutStructure::makeSubHeader
ubit16 makeSubHeader()
Definition: MatrixReadOutStructure.cxx:76
MatrixReadOutStructure::s_headerNum
static const ubit16 s_headerNum
Definition: MatrixReadOutStructure.h:88
MatrixReadOutStructure::isBody
bool isBody()
Definition: MatrixReadOutStructure.cxx:180
MatrixReadOutStructure::s_CMABodyVal
static const ubit16 s_CMABodyVal
Definition: MatrixReadOutStructure.h:99
MatrixReadOutStructure::global_channel
ubit16 global_channel()
Definition: MatrixReadOutStructure.cxx:198
MatrixReadOutStructure::crc
ubit16 crc()
Definition: MatrixReadOutStructure.h:40
MatrixReadOutStructure::is1LocAdd
bool is1LocAdd()
Definition: MatrixReadOutStructure.cxx:240
RPCReadOut.h
MatrixReadOutStructure::s_headerVal
static const ubit16 s_headerVal
Definition: MatrixReadOutStructure.h:91
crc8.h
MatrixReadOutStructure::isEtaProj
bool isEtaProj()
Definition: MatrixReadOutStructure.cxx:226
MatrixReadOutStructure::isHeader
bool isHeader()
Definition: MatrixReadOutStructure.cxx:166
MatrixReadOutStructure::s_CMABodyPos
static const ubit16 s_CMABodyPos[s_CMABodyNum]
Definition: MatrixReadOutStructure.h:97
MatrixReadOutStructure::s_subHeaderNum
static const ubit16 s_subHeaderNum
Definition: MatrixReadOutStructure.h:92
MatrixReadOutStructure::s_footerLen
static const ubit16 s_footerLen[s_footerNum]
Definition: MatrixReadOutStructure.h:102
MatrixReadOutStructure::overlap
ubit16 overlap()
Definition: MatrixReadOutStructure.h:38
MatrixReadOutStructure::getFooterVal
ubit16 getFooterVal()
Definition: MatrixReadOutStructure.h:49
MatrixReadOutStructure::fel1id
ubit16 fel1id()
Definition: MatrixReadOutStructure.h:31
MatrixReadOutStructure::cmid
ubit16 cmid()
Definition: MatrixReadOutStructure.h:30
MatrixReadOutStructure::is0LocAdd
bool is0LocAdd()
Definition: MatrixReadOutStructure.cxx:234
MatrixReadOutStructure::~MatrixReadOutStructure
~MatrixReadOutStructure()=default
MatrixReadOutStructure::s_headerPos
static const ubit16 s_headerPos[s_headerNum]
Definition: MatrixReadOutStructure.h:89
MatrixReadOutStructure::m_febcid
ubit16 m_febcid
Definition: MatrixReadOutStructure.h:76
MatrixReadOutStructure::s_subHeaderPos
static const ubit16 s_subHeaderPos[s_subHeaderNum]
Definition: MatrixReadOutStructure.h:93
MatrixReadOutStructure::getFooterPos
ubit16 getFooterPos()
Definition: MatrixReadOutStructure.h:50
Lvl1Def.h
MatrixReadOutStructure::isFooter
bool isFooter()
Definition: MatrixReadOutStructure.cxx:187
MatrixReadOutStructure::makeFooter
ubit16 makeFooter(ubit16 inputData)
Definition: MatrixReadOutStructure.cxx:100
MatrixReadOutStructure::m_status
ubit16 m_status
Definition: MatrixReadOutStructure.h:84
MatrixReadOutStructure::isTrigger
bool isTrigger()
Definition: MatrixReadOutStructure.cxx:211
RPCReadOut::field
char field() const
Definition: RPCReadOut.h:19
MatrixReadOutStructure::isPhiProj
bool isPhiProj()
Definition: MatrixReadOutStructure.cxx:232
MatrixReadOutStructure::m_time
ubit16 m_time
Definition: MatrixReadOutStructure.h:78
MatrixReadOutStructure::s_footerNum
static const ubit16 s_footerNum
Definition: MatrixReadOutStructure.h:100
MatrixReadOutStructure::makeHeader
ubit16 makeHeader(ubit16 *inputData)
Definition: MatrixReadOutStructure.cxx:68
MatrixReadOutStructure
Definition: MatrixReadOutStructure.h:13
MatrixReadOutStructure::isSubHeader
bool isSubHeader()
Definition: MatrixReadOutStructure.cxx:173
MatrixReadOutStructure::s_CMABodyLen
static const ubit16 s_CMABodyLen[s_CMABodyNum]
Definition: MatrixReadOutStructure.h:98
MatrixReadOutStructure::s_headerLen
static const ubit16 s_headerLen[s_headerNum]
Definition: MatrixReadOutStructure.h:90
MatrixReadOutStructure::time
ubit16 time()
Definition: MatrixReadOutStructure.h:34
MatrixReadOutStructure::s_subHeaderVal
static const ubit16 s_subHeaderVal
Definition: MatrixReadOutStructure.h:95
MatrixReadOutStructure::isLowPt
bool isLowPt()
Definition: MatrixReadOutStructure.cxx:218
MatrixReadOutStructure::setInit
void setInit()
Definition: MatrixReadOutStructure.cxx:51
MatrixReadOutStructure::m_fel1id
ubit16 m_fel1id
Definition: MatrixReadOutStructure.h:75
MatrixReadOutStructure::m_channel
ubit16 m_channel
Definition: MatrixReadOutStructure.h:80
MatrixReadOutStructure::threshold
ubit16 threshold()
Definition: MatrixReadOutStructure.h:37
MatrixReadOutStructure::s_footerPos
static const ubit16 s_footerPos[s_footerNum]
Definition: MatrixReadOutStructure.h:101
MatrixReadOutStructure::isPivot
ubit16 isPivot()
Definition: MatrixReadOutStructure.cxx:204
MatrixReadOutStructure::m_strip
ubit16 m_strip
Definition: MatrixReadOutStructure.h:81
MatrixReadOutStructure::s_footerVal
static const ubit16 s_footerVal
Definition: MatrixReadOutStructure.h:103
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
RPCReadOut
Definition: RPCReadOut.h:13
MatrixReadOutStructure::m_ijk
ubit16 m_ijk
Definition: MatrixReadOutStructure.h:79
MatrixReadOutStructure::m_bcid
ubit16 m_bcid
Definition: MatrixReadOutStructure.h:77
MatrixReadOutStructure::s_CMABodyNum
static const ubit16 s_CMABodyNum
Definition: MatrixReadOutStructure.h:96
MatrixReadOutStructure::bcid
ubit16 bcid()
Definition: MatrixReadOutStructure.h:33
MatrixReadOutStructure::s_subHeaderLen
static const ubit16 s_subHeaderLen[s_subHeaderNum]
Definition: MatrixReadOutStructure.h:94