ATLAS Offline Software
Loading...
Searching...
No Matches
TgcL1Rdo.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONRDO_TGCL1RDO_H
6#define MUONRDO_TGCL1RDO_H
7
8#include <inttypes.h>
13
14/*
15 TGC collection class used for bare RDO ByteStream Conversion.
16 This class holds one ROD information
17
18 @author Tadashi Maeno
19 based on the previous one by H.Kurashige
20*/
21class TgcL1Rdo : public DataVector<TgcL1RawData>
22{
23public:
24 // typedef required by container
25 typedef uint16_t ID;
27/*
28 enum
29 {
30 MAX_N_SIDE = 2, // A and C side
31 MAX_N_ROD = 12, // max number of ROD in each side
32 MAX_ID = MAX_N_SIDE*MAX_N_ROD
33 };
34*/
35 struct Errors
36 {
37 unsigned badBcID:1;
38 unsigned badL1Id:1;
39 unsigned timedout:1;
40 unsigned badData:1;
41 unsigned overflow:1;
42 };
43
45 {
46 unsigned EC_RXsend:1; // Error in request to send an event via RXlink
47 unsigned EC_FELdown:1; // A Front End link has gone down - abandoned
48 unsigned EC_frame:1; // Invalid FE link framing words
49 unsigned EC_Glnk:1; // G-link error
50 unsigned EC_xor:1; // Invalid XOR event checksum
51 unsigned EC_ovfl:1; // Input FE event is too long or FE FIFO overflow
52 unsigned EC_timeout:1; // Timeout expired for at least one FE link
53 unsigned EC_xormezz:1; // Bad XOR checksum from mezz board
54 unsigned EC_wc0:1; // Event has WC=0
55 unsigned EC_L1ID:1; // L1ID mismatch (TTC EVID FIFO vs local).
56 unsigned EC_nohdr:1; // First word is not header
57 unsigned EC_rectype:1; // Unrecognized record type
58 unsigned EC_null:1; // Unexpected nulls in FE input
59 unsigned EC_order:1; // Word is out of order
60 unsigned EC_LDB:1; // Invalid or unexpected Local Data Block ID
61 unsigned EC_RXovfl:1; // RXfifo has overflowed
62 unsigned EC_SSWerr:1; // SSW reports T1C, NRC, T2C, or GlinkNoLock error
63 unsigned EC_sbid:1; // Illegal SB ID
64 unsigned EC_unxsbid:1; // Unexpected SB ID received
65 unsigned EC_dupsb:1; // SB ID is duplicated in the event
66 unsigned EC_ec4:1; // Unexpected SB L1 Event ID(lo 4)
67 unsigned EC_bc:1; // Unexpected SB BCID
68 unsigned EC_celladr:1; // Invalid cell address
69 unsigned EC_hitovfl:1; // Too many hits in event
70 unsigned EC_trgbit:1; // Unexpected trigger bits
71 unsigned EC_badEoE:1; // Bad End-of-event marker received, not 0xFCA
72 unsigned EC_endWCnot0:1; // WC not 0 after EoE marker
73 unsigned EC_noEoE:1; // No End-of-event marker received
74 };
75
77 {
78 unsigned mergedHitBCs:1;
80 unsigned sortedHits:1;
81 unsigned sortedTracklets:1;
82 unsigned hasRoI:1;
83 unsigned fakeSsw:1;
84 unsigned fill1:10;
85 };
86
87 /* Constructors
88 */
90 TgcL1Rdo();
91
93 TgcL1Rdo(uint16_t id, IdentifierHash idHash);
94
95 // P1
96 TgcL1Rdo(uint16_t subDetectorId,
97 uint16_t srodId,
98 uint16_t bcId,
99 uint16_t l1Id);
100
101 // Destructor
102 virtual ~TgcL1Rdo()
103 {
104 }
105
106 // Identifier
107 uint16_t identify() const
108 {
109 return m_id;
110 }
111
112 // Identifier
114 {
115 return m_idHash;
116 }
117
118 // set methods
119 void setL1Id(uint32_t v)
120 {
121 m_l1Id = v;
122 }
123 void setBcId(uint16_t v)
124 {
125 m_bcId = v;
126 }
127 void setTriggerType(uint16_t v)
128 {
129 m_triggerType = v;
130 }
131 void setOnlineId (uint16_t subDetectorId, uint16_t srodId);
132
133 // get methods
134 uint16_t subDetectorId() const
135 {
136 return m_subDetectorId;
137 }
138 uint16_t srodId() const
139 {
140 return m_srodId;
141 }
142 uint16_t triggerType() const
143 {
144 return m_triggerType;
145 }
146 uint16_t bcId() const
147 {
148 return m_bcId;
149 }
150 uint16_t l1Id() const
151 {
152 return m_l1Id;
153 }
154
155 // class method for RawData identification
156 static uint16_t identifyRawData (const TgcL1RawData &rawData);
157
158 const Errors& errors() const
159 {
160 return m_errors;
161 }
162 void setErrors(uint16_t data)
163 {
164 // FIXME BUG: This is not portable!
165 // The layout of bitfields in a structure is implementation-defined.
166 union cnvErrors {
167 uint16_t data;
169 } cnv;
170 cnv.data = data;
171 m_errors = cnv.errors;
172 }
173
174 const SRodStatus& srodStatus() const
175 {
176 return m_srodStatus;
177 }
178 void setSRodStatus(uint32_t data)
179 {
180 // FIXME BUG: This is not portable!
181 // The layout of bitfields in a structure is implementation-defined.
182 union cnvSRodStatus {
183 uint16_t data;
185 } cnv;
186 cnv.data = data;
187 m_srodStatus = cnv.srodStatus;
188 }
189
191 {
192 return m_localStatus;
193 }
194 void setLocalStatus(uint32_t data)
195 {
196 // FIXME BUG: This is not portable!
197 // The layout of bitfields in a structure is implementation-defined.
198 union cnvLocalStatus {
199 uint16_t data;
201 } cnv;
202 cnv.data = data;
203 m_localStatus = cnv.localStatus;
204 }
205
206 uint32_t orbit() const
207 {
208 return m_orbit;
209 }
210 void setOrbit(uint32_t orbit)
211 {
212 m_orbit = orbit;
213 }
214
215 uint16_t version() const
216 {
217 return m_version;
218 }
219
220 void setVersion(uint16_t version)
221 {
223 }
224
225 void clear();
226
227 // online ID calculator
228 static uint16_t calculateOnlineId (uint16_t subDetectorId, uint16_t rodId);
229
230private:
231 // Returns offset, MAX_N_SROD
232 static std::pair<int, int> initOnlineId();
233
234 uint16_t m_version = 0U; // starting August 2006 version = 300. Before that, version = 0
235
237 uint16_t m_id = 0U;
238
241
242 // online IDs
243 uint16_t m_subDetectorId = 0U;
244 uint16_t m_srodId = 0U;
245
246 // Trigger Type
247 uint16_t m_triggerType = 0U;
248
249 // BCID and L1ID on ROD
250 uint16_t m_bcId = 0U ;
251 uint16_t m_l1Id = 0U ;
252
253 struct Errors m_errors{};
256 uint32_t m_orbit = 0U;
257};
258
260std::ostream& operator<<(std::ostream& sl, const TgcL1Rdo& coll);
261
262CLASS_DEF(TgcL1Rdo,29142172,0)
263
264// Class needed only for persistency
266CLASS_DEF(TGC_L1RDO_vector, 147069493, 1)
267
268#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::ostream & operator<<(std::ostream &sl, const TgcL1Rdo &coll)
Overload of << operator for std::ostream for debug output.
Definition TgcL1Rdo.cxx:100
DataVector< TgcL1Rdo > TGC_L1RDO_vector
Definition TgcL1Rdo.h:265
Derived DataVector<T>.
Definition DataVector.h:795
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
This is a "hash" representation of an Identifier.
An unit object of TGC SROD output.
void setErrors(uint16_t data)
Definition TgcL1Rdo.h:162
uint16_t version() const
Definition TgcL1Rdo.h:215
uint16_t m_triggerType
Definition TgcL1Rdo.h:247
uint16_t triggerType() const
Definition TgcL1Rdo.h:142
void setLocalStatus(uint32_t data)
Definition TgcL1Rdo.h:194
uint16_t m_bcId
Definition TgcL1Rdo.h:250
void setL1Id(uint32_t v)
Definition TgcL1Rdo.h:119
void setOrbit(uint32_t orbit)
Definition TgcL1Rdo.h:210
void setVersion(uint16_t version)
Definition TgcL1Rdo.h:220
uint16_t m_id
ID of this instance.
Definition TgcL1Rdo.h:237
IdentifierHash m_idHash
OFFLINE hash of this collection.
Definition TgcL1Rdo.h:240
uint16_t identify() const
Definition TgcL1Rdo.h:107
uint16_t l1Id() const
Definition TgcL1Rdo.h:150
IdentifierHash identifyHash() const
Definition TgcL1Rdo.h:113
const Errors & errors() const
Definition TgcL1Rdo.h:158
TgcL1Rdo()
Default constructor.
Definition TgcL1Rdo.cxx:11
const SRodStatus & srodStatus() const
Definition TgcL1Rdo.h:174
const LocalStatus & localStatus() const
Definition TgcL1Rdo.h:190
uint16_t srodId() const
Definition TgcL1Rdo.h:138
void setSRodStatus(uint32_t data)
Definition TgcL1Rdo.h:178
uint16_t m_version
Definition TgcL1Rdo.h:234
uint16_t m_srodId
Definition TgcL1Rdo.h:244
void setTriggerType(uint16_t v)
Definition TgcL1Rdo.h:127
void setOnlineId(uint16_t subDetectorId, uint16_t srodId)
Definition TgcL1Rdo.cxx:37
uint16_t m_l1Id
Definition TgcL1Rdo.h:251
uint16_t bcId() const
Definition TgcL1Rdo.h:146
uint16_t m_subDetectorId
Definition TgcL1Rdo.h:243
uint32_t m_orbit
Definition TgcL1Rdo.h:256
virtual ~TgcL1Rdo()
Definition TgcL1Rdo.h:102
void clear()
Definition TgcL1Rdo.cxx:106
uint16_t ID
Definition TgcL1Rdo.h:25
TgcL1RawData DIGIT
Definition TgcL1Rdo.h:26
void setBcId(uint16_t v)
Definition TgcL1Rdo.h:123
static uint16_t identifyRawData(const TgcL1RawData &rawData)
Definition TgcL1Rdo.cxx:47
static uint16_t calculateOnlineId(uint16_t subDetectorId, uint16_t rodId)
Definition TgcL1Rdo.cxx:59
static std::pair< int, int > initOnlineId()
Definition TgcL1Rdo.cxx:52
uint32_t orbit() const
Definition TgcL1Rdo.h:206
uint16_t subDetectorId() const
Definition TgcL1Rdo.h:134
unsigned timedout
Definition TgcL1Rdo.h:39
unsigned badL1Id
Definition TgcL1Rdo.h:38
unsigned badData
Definition TgcL1Rdo.h:40
unsigned overflow
Definition TgcL1Rdo.h:41
unsigned badBcID
Definition TgcL1Rdo.h:37
unsigned mergedHitBCs
Definition TgcL1Rdo.h:78
unsigned mergedTrackletBCs
Definition TgcL1Rdo.h:79
unsigned sortedTracklets
Definition TgcL1Rdo.h:81
unsigned EC_hitovfl
Definition TgcL1Rdo.h:69
unsigned EC_endWCnot0
Definition TgcL1Rdo.h:72
unsigned EC_timeout
Definition TgcL1Rdo.h:52
unsigned EC_unxsbid
Definition TgcL1Rdo.h:64
unsigned EC_FELdown
Definition TgcL1Rdo.h:47
unsigned EC_celladr
Definition TgcL1Rdo.h:68
unsigned EC_xormezz
Definition TgcL1Rdo.h:53
unsigned EC_rectype
Definition TgcL1Rdo.h:57