ATLAS Offline Software
DataError.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace LVL1 {
8 
13 
14 DataError::DataError() : m_error(0)
15 {
16 }
17 
19 {
20 }
21 
23 {
24 }
25 
26 // Set an error bit or data
27 
29 {
30  if (bit == SubStatusWord) {
33  bit = FailingBCN;
35  }
36  int mask = 0x1;
37  if (bit == FailingBCN) mask = s_failingBcnMask;
38  else if (bit == PPMErrorWord) {
39  bit = ChannelDisabled;
41  }
42  m_error &= ~(mask << bit);
43  m_error |= (value & mask) << bit;
44 }
45 
46 // Return an error bit or data
47 
48 int DataError::get(ErrorBit bit) const
49 {
50  if (bit == SubStatusWord) return 0;
51  int mask = 0x1;
52  if (bit == FailingBCN) mask = s_failingBcnMask;
53  else if (bit == PPMErrorWord) {
54  bit = ChannelDisabled;
56  }
57  return (m_error >> bit) & mask;
58 }
59 
60 // Return an error bit or data
61 
62 int DataError::get(int bit) const
63 {
64  int mask = (bit == FailingBCN) ? s_failingBcnMask : 0x1;
65  return (m_error >> bit) & mask;
66 }
67 
68 // Return the name of an error bit
69 
70 std::string DataError::bitName(int bit) const
71 {
72  std::string name;
73  switch (bit) {
74  case Overflow: name = "Overflow"; break;
75  case Parity: name = "Parity"; break;
76  case LinkDown: name = "LinkDown"; break;
77  case ChannelDisabled: name = "ChannelDisabled"; break;
78  case MCMAbsent: name = "MCMAbsent"; break;
79  case Timeout: name = "Timeout"; break;
80  case ASICFull: name = "ASICFull"; break;
81  case EventMismatch: name = "EventMismatch"; break;
82  case BunchMismatch: name = "BunchMismatch"; break;
83  case FIFOCorrupt: name = "FIFOCorrupt"; break;
84  case PinParity: name = "PinParity"; break;
85  //case ParityMerge: name = "ParityMerge"; break;
86  //case ParityPhase0: name = "ParityPhase0"; break;
87  //case ParityPhase1: name = "ParityPhase1"; break;
88  //case ParityPhase2: name = "ParityPhase2"; break;
89  //case ParityPhase3: name = "ParityPhase3"; break;
90  case GLinkParity: name = "GLinkParity"; break;
91  case GLinkProtocol: name = "GLinkProtocol"; break;
92  case BCNMismatch: name = "BCNMismatch"; break;
93  case FIFOOverflow: name = "FIFOOverflow"; break;
94  case ModuleError: name = "ModuleError"; break;
95  case GLinkDown: name = "GLinkDown"; break;
96  case GLinkTimeout: name = "GLinkTimeout"; break;
97  default: name = ""; break;
98  }
99  return name;
100 }
101 
102 } // end namespace
LVL1::DataError::PinParity
@ PinParity
Definition: DataError.h:35
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LVL1::DataError::Timeout
@ Timeout
Definition: DataError.h:33
LVL1::DataError::s_failingBcnMask
static const int s_failingBcnMask
Mask for Failing BCN.
Definition: DataError.h:65
LVL1::DataError::LinkDown
@ LinkDown
Definition: DataError.h:31
LVL1::DataError::m_error
int m_error
Error word.
Definition: DataError.h:74
LVL1::DataError::ModuleError
@ ModuleError
Definition: DataError.h:41
LVL1::DataError::ErrorBit
ErrorBit
Definition: DataError.h:31
athena.value
value
Definition: athena.py:122
LVL1::DataError::GLinkParity
@ GLinkParity
Definition: DataError.h:40
LVL1::DataError::GLinkDown
@ GLinkDown
Definition: DataError.h:41
LVL1::DataError::MCMAbsent
@ MCMAbsent
Definition: DataError.h:33
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
LVL1::DataError::SubStatusWord
@ SubStatusWord
Definition: DataError.h:44
LVL1::DataError::Overflow
@ Overflow
Definition: DataError.h:31
LVL1::DataError::GLinkProtocol
@ GLinkProtocol
Definition: DataError.h:40
LVL1::DataError::DataError
DataError()
Definition: DataError.cxx:14
LVL1::DataError::set
void set(ErrorBit bit, int value=1)
Set an error bit or data.
Definition: DataError.cxx:28
LVL1::DataError::s_subStatusMask
static const int s_subStatusMask
Mask for error bits from sub-status word.
Definition: DataError.h:69
LVL1::DataError::EventMismatch
@ EventMismatch
Definition: DataError.h:34
LVL1::DataError::ASICFull
@ ASICFull
Definition: DataError.h:34
LVL1::DataError::Parity
@ Parity
Definition: DataError.h:31
DataError.h
TrigConf::name
Definition: HLTChainList.h:35
LVL1::DataError::GLinkTimeout
@ GLinkTimeout
Definition: DataError.h:42
LVL1::DataError::FailingBCN
@ FailingBCN
Definition: DataError.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
LVL1::DataError::ChannelDisabled
@ ChannelDisabled
Definition: DataError.h:33
LVL1::DataError::~DataError
~DataError()
Definition: DataError.cxx:22
LVL1::DataError::PPMErrorWord
@ PPMErrorWord
Definition: DataError.h:44
LVL1::DataError::BCNMismatch
@ BCNMismatch
Definition: DataError.h:40
LVL1::DataError::FIFOOverflow
@ FIFOOverflow
Definition: DataError.h:41
LVL1::DataError::BunchMismatch
@ BunchMismatch
Definition: DataError.h:34
LVL1::DataError::FIFOCorrupt
@ FIFOCorrupt
Definition: DataError.h:35
LVL1::DataError::get
int get(ErrorBit bit) const
Return an error bit or data.
Definition: DataError.cxx:48
LVL1::DataError::s_ppmErrorMask
static const int s_ppmErrorMask
Mask for PPM error bits.
Definition: DataError.h:67
error
Definition: IImpactPoint3dEstimator.h:70
LVL1::DataError::bitName
std::string bitName(int bit) const
Return the name of an error bit or data.
Definition: DataError.cxx:70
LVL1::DataError::s_subStatusBcn
static const int s_subStatusBcn
Bit position of failing BCN in sub-status word.
Definition: DataError.h:71