ATLAS Offline Software
SCT_ByteStreamErrors.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
13 #ifndef SCT_ByteStreamErrors_h
14 #define SCT_ByteStreamErrors_h
15 
16 #include <array>
17 #include <vector>
18 #include <cstdint>
19 
124 #ifndef SCT_ERRORTYPELIST
125 #define SCT_ERRORTYPELIST(XYZ) \
126  XYZ(ByteStreamParseError) \
127  XYZ(TimeOutError) \
128  XYZ(BCIDError) \
129  XYZ(LVL1IDError) \
130  XYZ(PreambleError) \
131  XYZ(FormatterError) \
132  XYZ(TrailerError) \
133  XYZ(TrailerOverflowError) \
134  XYZ(HeaderTrailerLimitError) \
135  XYZ(ABCDError) \
136  XYZ(RawError) \
137  XYZ(MaskedLink) \
138  XYZ(RODClockError) \
139  XYZ(TruncatedROD) \
140  XYZ(ROBFragmentError) \
141  XYZ(MissingLinkHeaderError) \
142  XYZ(MaskedROD) \
143  XYZ(ABCDError_Chip0) \
144  XYZ(ABCDError_Chip1) \
145  XYZ(ABCDError_Chip2) \
146  XYZ(ABCDError_Chip3) \
147  XYZ(ABCDError_Chip4) \
148  XYZ(ABCDError_Chip5) \
149  XYZ(ABCDError_Error1) \
150  XYZ(ABCDError_Error2) \
151  XYZ(ABCDError_Error4) \
152  XYZ(TempMaskedChip0) \
153  XYZ(TempMaskedChip1) \
154  XYZ(TempMaskedChip2) \
155  XYZ(TempMaskedChip3) \
156  XYZ(TempMaskedChip4) \
157  XYZ(TempMaskedChip5) \
158  XYZ(ABCDError_Error7) \
159  XYZ(ABCDError_Invalid) \
160  XYZ(RODSimulatedData) \
161  XYZ(NUM_ERROR_TYPES) // always have this one last, so we can use it as a loop index
162 #endif // SCT_ERRORTYPELIST
163 
164 #ifndef SCT_DO_ENUM
165 #define SCT_DO_ENUM(e) e,
166 #endif // SCT_DO_ENUM
167 
168 #ifndef SCT_DO_DESCRIPTION
169 #define SCT_DO_DESCRIPTION(e) #e,
170 #endif // SCT_DO_DESCRIPTION
171 
178  enum ErrorType {
180  };
185  static const std::vector<std::string> ErrorTypeDescription = {
187  };
193  static const std::vector<ErrorType> BadErrors = {
194  TimeOutError,
195  BCIDError,
196  LVL1IDError,
197  HeaderTrailerLimitError,
198  MaskedLink,
199  TruncatedROD,
200  ROBFragmentError,
201  MissingLinkHeaderError,
202  MaskedROD
203  };
208  static const std::vector<ErrorType> LinkLevelBadErrors = {
209  TimeOutError,
210  BCIDError,
211  LVL1IDError,
212  HeaderTrailerLimitError,
213  MaskedLink
214  };
219  static const std::vector<ErrorType> RodLevelBadErrors = {
220  TruncatedROD,
221  ROBFragmentError,
222  MissingLinkHeaderError,
223  // We cannot know which FE-link does not have header. We assign this error
224  // to all the FE-links without hit, ABCD error or raw data of the ROD.
225  MaskedROD
226  };
231  static const std::vector<ErrorType> LinkLevelErrors = {
232  ByteStreamParseError,
233  TimeOutError,
234  BCIDError,
235  LVL1IDError,
236  PreambleError,
237  FormatterError,
238  TrailerError,
239  TrailerOverflowError,
240  HeaderTrailerLimitError,
241  ABCDError,
242  RawError,
243  MaskedLink,
244  ABCDError_Chip0,
245  ABCDError_Chip1,
246  ABCDError_Chip2,
247  ABCDError_Chip3,
248  ABCDError_Chip4,
249  ABCDError_Chip5,
250  ABCDError_Error1,
251  ABCDError_Error2,
252  ABCDError_Error4,
253  TempMaskedChip0,
254  TempMaskedChip1,
255  TempMaskedChip2,
256  TempMaskedChip3,
257  TempMaskedChip4,
258  TempMaskedChip5,
259  ABCDError_Error7
260  };
265  static const std::vector<ErrorType> RodLevelErrors = {
266  RODClockError,
267  TruncatedROD,
268  ROBFragmentError,
269  MissingLinkHeaderError, // We cannot know which FE-link does not have header. We assign this error to all the FE-links of the ROD.
270  MaskedROD
271  };
272 
273  template<ErrorType et> static constexpr uint64_t maskUpTo() { return ( uint64_t(1) << et ) - 1; }
274  // Bit mask for ABCDError_Chip0, ABCDError_Chip1, ..., ABCDError_Chip5
275  static constexpr uint64_t ABCDErrorMask() { return maskUpTo<ABCDError_Chip5>() & ~(maskUpTo<ABCDError_Chip0>()); }
276  // Bit mask for TempMaskedChip0, TempMaskedChip1, ..., TempMaskedChip5
277  static constexpr uint64_t TempMaskedChipsMask() { return maskUpTo<TempMaskedChip5>() & ~(maskUpTo<TempMaskedChip0>()); }
278  inline ErrorType TempMaskedChipToBit(const int chip){ return std::array<ErrorType, 6>{{
279  TempMaskedChip0,
280  TempMaskedChip1,
281  TempMaskedChip2,
282  TempMaskedChip3,
283  TempMaskedChip4,
284  TempMaskedChip5}}[chip]; }
285 
291 }
292 
293 #endif // SCT_ByteStreamErrors_h
et
Extra patterns decribing particle interation process.
SCT_ByteStreamErrors::TempMaskedChipToBit
ErrorType TempMaskedChipToBit(const int chip)
Definition: SCT_ByteStreamErrors.h:278
SCT_DO_DESCRIPTION
#define SCT_DO_DESCRIPTION(e)
Definition: SCT_ByteStreamErrors.h:169
SCT_DO_ENUM
#define SCT_DO_ENUM(e)
Definition: SCT_ByteStreamErrors.h:165
SCT_ByteStreamErrors
Definition: SCT_ByteStreamErrors.h:172
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
TRTByteStreamErrors::BCIDError
@ BCIDError
Definition: ITRT_ByteStream_ConditionsSvc.h:19
SCT_ByteStreamErrors::ErrorType
ErrorType
SCT byte stream error type enums used in SCT_RodDecoder, SCT_ByteStreamErrorsTool,...
Definition: SCT_ByteStreamErrors.h:178
SCT_ByteStreamErrors::ROOT6_NamespaceAutoloadHook
Ensure that the enums are available from ROOT.
Definition: SCT_ByteStreamErrors.h:290
SCT_ERRORTYPELIST
#define SCT_ERRORTYPELIST(XYZ)
Specifications of the data format and errors is found in [1] http://www-eng.lbl.gov/~jmjoseph/Atlas-S...
Definition: SCT_ByteStreamErrors.h:125