ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonRDO
MuonRDO
TgcRdo.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_TGCRDO_H
6
#define MUONRDO_TGCRDO_H 1
7
8
#include <inttypes.h>
9
#include "
MuonRDO/TgcRawData.h
"
10
#include "
AthContainers/DataVector.h
"
11
#include "
AthenaKernel/CLASS_DEF.h
"
12
#include "
Identifier/IdentifierHash.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
*/
21
class
TgcRdo
:
public
DataVector
<TgcRawData>
22
{
23
public
:
24
// typedef required by container
25
typedef
uint16_t
ID
;
26
typedef
TgcRawData
DIGIT
;
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
44
struct
RodStatus
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
76
struct
LocalStatus
77
{
78
unsigned
mergedHitBCs
:1;
79
unsigned
mergedTrackletBCs
: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
TgcRdo
();
91
93
TgcRdo
(uint16_t
id
,
IdentifierHash
idHash);
94
95
// P1
96
TgcRdo
(uint16_t
subDetectorId
,
97
uint16_t
rodId
,
98
uint16_t
bcId
,
99
uint16_t
l1Id
);
100
101
// Destructor
102
virtual
~TgcRdo
()
103
{
104
}
105
106
// Identifier
107
uint16_t
identify
()
const
108
{
109
return
m_id
;
110
}
111
112
// Identifier
113
IdentifierHash
identifyHash
()
const
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
rodId
);
132
133
// get methods
134
uint16_t
subDetectorId
()
const
135
{
136
return
m_subDetectorId
;
137
}
138
uint16_t
rodId
()
const
139
{
140
return
m_rodId
;
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
TgcRawData
&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;
168
Errors
errors
;
169
} cnv;
170
cnv.data = data;
171
m_errors
= cnv.errors;
172
}
173
174
const
RodStatus
&
rodStatus
()
const
175
{
176
return
m_rodStatus
;
177
}
178
void
setRodStatus
(uint32_t data)
179
{
180
// FIXME BUG: This is not portable!
181
// The layout of bitfields in a structure is implementation-defined.
182
union
cnvRodStatus {
183
uint16_t data;
184
RodStatus
rodStatus
;
185
} cnv;
186
cnv.data = data;
187
m_rodStatus
= cnv.rodStatus;
188
}
189
190
const
LocalStatus
&
localStatus
()
const
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;
200
LocalStatus
localStatus
;
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
{
222
m_version
=
version
;
223
}
224
225
// ??? This overrides DataVector::clear() with something that
226
// does something different. Should probably be called
227
// something else.
228
void
clear
();
229
230
// online ID calculator
231
static
uint16_t
calculateOnlineId
(uint16_t
subDetectorId
, uint16_t
rodId
);
232
233
private
:
234
// Returns offset, MAX_N_ROD
235
static
std::pair<int, int>
initOnlineId
();
236
237
uint16_t
m_version
= 0U;
// starting August 2006 version = 300. Before that, version = 0
238
240
uint16_t
m_id
= 0U;
241
243
IdentifierHash
m_idHash
;
244
245
// online IDs
246
uint16_t
m_subDetectorId
= 0U;
247
uint16_t
m_rodId
= 0U;
248
249
// Trigger Type
250
uint16_t
m_triggerType
= 0U;
251
252
// BCID and L1ID on ROD
253
uint16_t
m_bcId
= 0U;
254
uint16_t
m_l1Id
= 0U;
255
256
struct
Errors
m_errors
{};
257
struct
RodStatus
m_rodStatus
{};
258
struct
LocalStatus
m_localStatus
{};
259
uint32_t
m_orbit
= 0U;
260
};
261
263
std::ostream&
operator<<
(std::ostream& sl,
const
TgcRdo
& coll);
264
265
CLASS_DEF
(
TgcRdo
,4185,0)
266
267
// Class needed only for persistency
268
typedef
DataVector
<
TgcRdo
>
TGC_RDO_vector
;
269
CLASS_DEF
(
TGC_RDO_vector
, 4182, 1)
270
271
#endif
CLASS_DEF.h
macros to associate a CLID to a type
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition
Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
IdentifierHash.h
TgcRawData.h
operator<<
std::ostream & operator<<(std::ostream &sl, const TgcRdo &coll)
Overload of << operator for std::ostream for debug output.
Definition
TgcRdo.cxx:108
TGC_RDO_vector
DataVector< TgcRdo > TGC_RDO_vector
Definition
TgcRdo.h:268
DataVector
Derived DataVector<T>.
Definition
DataVector.h:795
DataVector< TgcRawData >::DataVector
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
TgcRawData
An unit object of TGC ROD output.
Definition
TgcRawData.h:23
TgcRdo
Definition
TgcRdo.h:22
TgcRdo::m_version
uint16_t m_version
Definition
TgcRdo.h:237
TgcRdo::DIGIT
TgcRawData DIGIT
Definition
TgcRdo.h:26
TgcRdo::rodStatus
const RodStatus & rodStatus() const
Definition
TgcRdo.h:174
TgcRdo::version
uint16_t version() const
Definition
TgcRdo.h:215
TgcRdo::clear
void clear()
Definition
TgcRdo.cxx:114
TgcRdo::triggerType
uint16_t triggerType() const
Definition
TgcRdo.h:142
TgcRdo::setLocalStatus
void setLocalStatus(uint32_t data)
Definition
TgcRdo.h:194
TgcRdo::m_bcId
uint16_t m_bcId
Definition
TgcRdo.h:253
TgcRdo::rodId
uint16_t rodId() const
Definition
TgcRdo.h:138
TgcRdo::m_rodId
uint16_t m_rodId
Definition
TgcRdo.h:247
TgcRdo::setTriggerType
void setTriggerType(uint16_t v)
Definition
TgcRdo.h:127
TgcRdo::l1Id
uint16_t l1Id() const
Definition
TgcRdo.h:150
TgcRdo::setVersion
void setVersion(uint16_t version)
Definition
TgcRdo.h:220
TgcRdo::setRodStatus
void setRodStatus(uint32_t data)
Definition
TgcRdo.h:178
TgcRdo::setL1Id
void setL1Id(uint32_t v)
Definition
TgcRdo.h:119
TgcRdo::m_l1Id
uint16_t m_l1Id
Definition
TgcRdo.h:254
TgcRdo::m_id
uint16_t m_id
ID of this instance.
Definition
TgcRdo.h:240
TgcRdo::identifyRawData
static uint16_t identifyRawData(const TgcRawData &rawData)
Definition
TgcRdo.cxx:47
TgcRdo::m_orbit
uint32_t m_orbit
Definition
TgcRdo.h:259
TgcRdo::m_idHash
IdentifierHash m_idHash
OFFLINE hash of this collection.
Definition
TgcRdo.h:243
TgcRdo::setOnlineId
void setOnlineId(uint16_t subDetectorId, uint16_t rodId)
Definition
TgcRdo.cxx:37
TgcRdo::setOrbit
void setOrbit(uint32_t orbit)
Definition
TgcRdo.h:210
TgcRdo::ID
uint16_t ID
Definition
TgcRdo.h:25
TgcRdo::identifyHash
IdentifierHash identifyHash() const
Definition
TgcRdo.h:113
TgcRdo::setErrors
void setErrors(uint16_t data)
Definition
TgcRdo.h:162
TgcRdo::m_subDetectorId
uint16_t m_subDetectorId
Definition
TgcRdo.h:246
TgcRdo::initOnlineId
static std::pair< int, int > initOnlineId()
Definition
TgcRdo.cxx:53
TgcRdo::orbit
uint32_t orbit() const
Definition
TgcRdo.h:206
TgcRdo::subDetectorId
uint16_t subDetectorId() const
Definition
TgcRdo.h:134
TgcRdo::~TgcRdo
virtual ~TgcRdo()
Definition
TgcRdo.h:102
TgcRdo::errors
const Errors & errors() const
Definition
TgcRdo.h:158
TgcRdo::calculateOnlineId
static uint16_t calculateOnlineId(uint16_t subDetectorId, uint16_t rodId)
Definition
TgcRdo.cxx:60
TgcRdo::m_triggerType
uint16_t m_triggerType
Definition
TgcRdo.h:250
TgcRdo::localStatus
const LocalStatus & localStatus() const
Definition
TgcRdo.h:190
TgcRdo::identify
uint16_t identify() const
Definition
TgcRdo.h:107
TgcRdo::bcId
uint16_t bcId() const
Definition
TgcRdo.h:146
TgcRdo::TgcRdo
TgcRdo()
Default constructor.
Definition
TgcRdo.cxx:11
TgcRdo::setBcId
void setBcId(uint16_t v)
Definition
TgcRdo.h:123
TgcRdo::Errors
Definition
TgcRdo.h:36
TgcRdo::Errors::timedout
unsigned timedout
Definition
TgcRdo.h:39
TgcRdo::Errors::overflow
unsigned overflow
Definition
TgcRdo.h:41
TgcRdo::Errors::badBcID
unsigned badBcID
Definition
TgcRdo.h:37
TgcRdo::Errors::badL1Id
unsigned badL1Id
Definition
TgcRdo.h:38
TgcRdo::Errors::badData
unsigned badData
Definition
TgcRdo.h:40
TgcRdo::LocalStatus
Definition
TgcRdo.h:77
TgcRdo::LocalStatus::fill1
unsigned fill1
Definition
TgcRdo.h:84
TgcRdo::LocalStatus::mergedTrackletBCs
unsigned mergedTrackletBCs
Definition
TgcRdo.h:79
TgcRdo::LocalStatus::sortedTracklets
unsigned sortedTracklets
Definition
TgcRdo.h:81
TgcRdo::LocalStatus::fakeSsw
unsigned fakeSsw
Definition
TgcRdo.h:83
TgcRdo::LocalStatus::hasRoI
unsigned hasRoI
Definition
TgcRdo.h:82
TgcRdo::LocalStatus::mergedHitBCs
unsigned mergedHitBCs
Definition
TgcRdo.h:78
TgcRdo::LocalStatus::sortedHits
unsigned sortedHits
Definition
TgcRdo.h:80
TgcRdo::RodStatus
Definition
TgcRdo.h:45
TgcRdo::RodStatus::EC_LDB
unsigned EC_LDB
Definition
TgcRdo.h:60
TgcRdo::RodStatus::EC_xor
unsigned EC_xor
Definition
TgcRdo.h:50
TgcRdo::RodStatus::EC_ovfl
unsigned EC_ovfl
Definition
TgcRdo.h:51
TgcRdo::RodStatus::EC_SSWerr
unsigned EC_SSWerr
Definition
TgcRdo.h:62
TgcRdo::RodStatus::EC_dupsb
unsigned EC_dupsb
Definition
TgcRdo.h:65
TgcRdo::RodStatus::EC_badEoE
unsigned EC_badEoE
Definition
TgcRdo.h:71
TgcRdo::RodStatus::EC_nohdr
unsigned EC_nohdr
Definition
TgcRdo.h:56
TgcRdo::RodStatus::EC_xormezz
unsigned EC_xormezz
Definition
TgcRdo.h:53
TgcRdo::RodStatus::EC_rectype
unsigned EC_rectype
Definition
TgcRdo.h:57
TgcRdo::RodStatus::EC_RXsend
unsigned EC_RXsend
Definition
TgcRdo.h:46
TgcRdo::RodStatus::EC_celladr
unsigned EC_celladr
Definition
TgcRdo.h:68
TgcRdo::RodStatus::EC_sbid
unsigned EC_sbid
Definition
TgcRdo.h:63
TgcRdo::RodStatus::EC_L1ID
unsigned EC_L1ID
Definition
TgcRdo.h:55
TgcRdo::RodStatus::EC_wc0
unsigned EC_wc0
Definition
TgcRdo.h:54
TgcRdo::RodStatus::EC_ec4
unsigned EC_ec4
Definition
TgcRdo.h:66
TgcRdo::RodStatus::EC_frame
unsigned EC_frame
Definition
TgcRdo.h:48
TgcRdo::RodStatus::EC_RXovfl
unsigned EC_RXovfl
Definition
TgcRdo.h:61
TgcRdo::RodStatus::EC_noEoE
unsigned EC_noEoE
Definition
TgcRdo.h:73
TgcRdo::RodStatus::EC_bc
unsigned EC_bc
Definition
TgcRdo.h:67
TgcRdo::RodStatus::EC_trgbit
unsigned EC_trgbit
Definition
TgcRdo.h:70
TgcRdo::RodStatus::EC_endWCnot0
unsigned EC_endWCnot0
Definition
TgcRdo.h:72
TgcRdo::RodStatus::EC_unxsbid
unsigned EC_unxsbid
Definition
TgcRdo.h:64
TgcRdo::RodStatus::EC_timeout
unsigned EC_timeout
Definition
TgcRdo.h:52
TgcRdo::RodStatus::EC_order
unsigned EC_order
Definition
TgcRdo.h:59
TgcRdo::RodStatus::EC_hitovfl
unsigned EC_hitovfl
Definition
TgcRdo.h:69
TgcRdo::RodStatus::EC_FELdown
unsigned EC_FELdown
Definition
TgcRdo.h:47
TgcRdo::RodStatus::EC_null
unsigned EC_null
Definition
TgcRdo.h:58
TgcRdo::RodStatus::EC_Glnk
unsigned EC_Glnk
Definition
TgcRdo.h:49
TgcRdo::m_errors
Definition
TgcRdo.h:256
TgcRdo::m_localStatus
Definition
TgcRdo.h:258
TgcRdo::m_rodStatus
Definition
TgcRdo.h:257
Generated on
for ATLAS Offline Software by
1.17.0