ATLAS Offline Software
LArBadChannel.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LArBadChannel_H
6 #define LArBadChannel_H
7 
8 template <class T> class TLArBadChanBitPackingBase;
9 
11  public:
12  typedef unsigned int PosType;
13  typedef unsigned int BitWord;
14 
15 
17  public:
18 
19  enum ProblemType {
24  shortBit = 4,
44  };
45 
46  };
47 
49  public:
50 
51  enum ProblemType {
63  ADCJumpBit = 11,
72  };
73 
74  };
75 
76 
77  explicit LArBadChannel( BitWord rawStatus=0, bool isSC=false) : m_word(rawStatus), m_isSC(isSC) {}
78 
80  bool statusBad(PosType pb) const {
81  BitWord mask = 1u << pb;
82  return ((m_word & mask) != 0);
83  }
84 
86  bool statusOK( PosType pb) const {return !statusBad(pb);}
87 
89  bool good() const {return m_word == 0;}
90 
91 
92  //Cases used only for supercells
93  bool maskedOSUM() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::maskedOSUMBit); else return false;}
94  bool deformedTail() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::DeformedTailBit); else return false;}
95  bool deformedPulse() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::DeformedPulseBit); else return false;}
96  bool nonLinearRamp() const{ if (m_isSC) return statusBad( LArBadChannelSCEnum::NonLinearRampBit); else return false;}
97  bool ADCJump() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::ADCJumpBit); else return false;}
98  bool SCAProblem() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::SCAProblemBit); else return false;}
99  bool offOFCs() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::OffOFCsBit); else return false;}
100  bool offAmplitude() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::OffAmplitudeBit); else return false;}
101  bool offScale() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::OffScaleBit); else return false;}
102  bool lowLightFibre() const {if (m_isSC) return statusBad( LArBadChannelSCEnum::lowLightFibreBit); else return false;}
104 
105 
106  //Common cases (regular and supercell)
110  bool almostDead() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::almostDeadBit);}
111  bool shortProblem() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::shortBit);}
112  bool unstable() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::unstableBit);}
113  bool distorted() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::distortedBit);}
114  bool lowNoiseHG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::lowNoiseHGBit);}
115  bool highNoiseHG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::highNoiseHGBit);}
116  bool unstableNoiseHG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::unstableNoiseHGBit);}
117  bool lowNoiseMG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::lowNoiseMGBit);}
118  bool highNoiseMG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::highNoiseMGBit);}
119  bool unstableNoiseMG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::unstableNoiseMGBit);}
120  bool lowNoiseLG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::lowNoiseLGBit);}
121  bool highNoiseLG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::highNoiseLGBit);}
122  bool unstableNoiseLG() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::unstableNoiseLGBit);}
123  bool missingFEB() const { if(m_isSC) return false; else return statusBad( LArBadChannelEnum::missingFEBBit);}
127  bool deadSCACell() const {if(m_isSC) return false; else return statusBad( LArBadChannelEnum::deadSCACellBit);}
128  bool badFirstSample() const {if(m_isSC) return false; else return statusBad( LArBadChannelEnum::badFirstSampleBit);}
131 
132  bool reallyNoisy() const {return (highNoiseHG() || highNoiseMG() || highNoiseLG() ||
134  bool noisy() const {return (reallyNoisy() || lowNoiseHG() || lowNoiseMG() || lowNoiseLG());}
135 
136  bool operator!=(BitWord other) {return m_word != other;}
137  bool operator!=(LArBadChannel other) {return m_word != other.packedData();}
138  bool operator==(BitWord other) {return m_word == other;}
139  bool operator==(LArBadChannel other) {return m_word == other.packedData();}
140 
142 
143  BitWord packedData() const {return m_word;}
144 
145  bool isSC() const {return m_isSC;}
146  void setSC() {m_isSC=true;}
147 
148  private:
149 
150 
153  bool m_isSC;
154 
156  friend class TLArBadChanBitPackingBase<LArBadChannel::LArBadChannelEnum>;
157 };
158 
159 
160 #endif
LArBadChannel::LArBadChannelSCEnum::lowNoiseBit
@ lowNoiseBit
Definition: LArBadChannel.h:56
LArBadChannel::packedDataRef
BitWord & packedDataRef()
Definition: LArBadChannel.h:152
LArBadChannel::LArBadChannelSCEnum::DeformedTailBit
@ DeformedTailBit
Definition: LArBadChannel.h:60
LArBadChannel::shortProblem
bool shortProblem() const
Definition: LArBadChannel.h:111
LArBadChannel::deadReadout
bool deadReadout() const
Definition: LArBadChannel.h:107
LArBadChannel::lowNoiseHG
bool lowNoiseHG() const
Definition: LArBadChannel.h:114
LArBadChannel::LArBadChannelEnum::problematicForUnknownReasonBit
@ problematicForUnknownReasonBit
Definition: LArBadChannel.h:38
LArBadChannel::good
bool good() const
Returns true if no problems at all (all bits at zero)
Definition: LArBadChannel.h:89
LArBadChannel::LArBadChannelEnum::badFirstSampleBit
@ badFirstSampleBit
Definition: LArBadChannel.h:41
LArBadChannel::unflaggedByLADIeS
bool unflaggedByLADIeS() const
Definition: LArBadChannel.h:129
LArBadChannel::deadCalib
bool deadCalib() const
Definition: LArBadChannel.h:108
LArBadChannel::LArBadChannelSCEnum::OffAmplitudeBit
@ OffAmplitudeBit
Definition: LArBadChannel.h:66
keylayer_zslicemap.pb
pb
Definition: keylayer_zslicemap.py:188
LArBadChannel::operator!=
bool operator!=(BitWord other)
Definition: LArBadChannel.h:136
LArBadChannel::LArBadChannelEnum::deadReadoutBit
@ deadReadoutBit
Definition: LArBadChannel.h:20
LArBadChannel::unstableNoiseLG
bool unstableNoiseLG() const
Definition: LArBadChannel.h:122
LArBadChannel::LArBadChannelSCEnum::deadPhysBit
@ deadPhysBit
Definition: LArBadChannel.h:55
LArBadChannel::lowNoiseLG
bool lowNoiseLG() const
Definition: LArBadChannel.h:120
LArBadChannel::LArBadChannelSCEnum::sporadicBurstNoiseBit
@ sporadicBurstNoiseBit
Definition: LArBadChannel.h:59
LArBadChannel::offScale
bool offScale() const
Definition: LArBadChannel.h:101
LArBadChannel::LArBadChannelSCEnum::reflaggedByLADIeSBit
@ reflaggedByLADIeSBit
Definition: LArBadChannel.h:71
LArBadChannel::sporadicBurstNoise
bool sporadicBurstNoise() const
Definition: LArBadChannel.h:126
TLArBadChanBitPackingBase
Definition: LArBadChanBitPackingBase.h:14
LArBadChannel::LArBadChannelSCEnum
Definition: LArBadChannel.h:48
LArBadChannel::LArBadChannelEnum::lowNoiseLGBit
@ lowNoiseLGBit
Definition: LArBadChannel.h:33
LArBadChannel::LArBadChannelSCEnum::SCAProblemBit
@ SCAProblemBit
Definition: LArBadChannel.h:64
LArBadChannel::PosType
unsigned int PosType
Definition: LArBadChannel.h:12
LArBadChannel::LArBadChannelEnum::lowNoiseHGBit
@ lowNoiseHGBit
Definition: LArBadChannel.h:27
LArBadChannel::LArBadChannelSCEnum::maskedOSUMBit
@ maskedOSUMBit
Definition: LArBadChannel.h:52
LArBadChannel::m_isSC
bool m_isSC
Definition: LArBadChannel.h:153
LArBadChannel::LArBadChannelEnum::deadCalibBit
@ deadCalibBit
Definition: LArBadChannel.h:21
LArBadChannel::almostDead
bool almostDead() const
Definition: LArBadChannel.h:110
LArBadChannel::LArBadChannelSCEnum::DeformedPulseBit
@ DeformedPulseBit
Definition: LArBadChannel.h:61
LArBadChannel::highNoiseHG
bool highNoiseHG() const
Definition: LArBadChannel.h:115
LArBadChannel::LArBadChannelEnum::unstableNoiseMGBit
@ unstableNoiseMGBit
Definition: LArBadChannel.h:32
LArBadChannel::LArBadChannelEnum::missingFEBBit
@ missingFEBBit
Definition: LArBadChannel.h:36
LArBadChannel::badFirstSample
bool badFirstSample() const
Definition: LArBadChannel.h:128
LArBadChannel::operator==
bool operator==(BitWord other)
Definition: LArBadChannel.h:138
LArBadChannel::LArBadChannelSCEnum::ADCJumpBit
@ ADCJumpBit
Definition: LArBadChannel.h:63
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
LArBadChannel::SCAProblem
bool SCAProblem() const
Definition: LArBadChannel.h:98
LArBadChannel::LArBadChannelSCEnum::unflaggedByLADIeSBit
@ unflaggedByLADIeSBit
Definition: LArBadChannel.h:70
LArBadChannel::LArBadChannelEnum::unstableBit
@ unstableBit
Definition: LArBadChannel.h:25
LArBadChannel::unstableNoiseHG
bool unstableNoiseHG() const
Definition: LArBadChannel.h:116
LArBadChannel::deadSCACell
bool deadSCACell() const
Definition: LArBadChannel.h:127
LArBadChannel::deformedTail
bool deformedTail() const
Definition: LArBadChannel.h:94
LArBadChannel::statusOK
bool statusOK(PosType pb) const
Returns true if there is no problem in corresponding status bit.
Definition: LArBadChannel.h:86
LArBadChannel::LArBadChannelSCEnum::highNoiseBit
@ highNoiseBit
Definition: LArBadChannel.h:57
LArBadChannel::statusBad
bool statusBad(PosType pb) const
Returns true if corresponding status bit its set
Definition: LArBadChannel.h:80
LArBadChannel::LArBadChannelSCEnum::deadCalibBit
@ deadCalibBit
Definition: LArBadChannel.h:54
LArBadChannel::BitWord
unsigned int BitWord
Definition: LArBadChannel.h:13
LArBadChannel::LArBadChannelSCEnum::problematicForUnknownReasonBit
@ problematicForUnknownReasonBit
Definition: LArBadChannel.h:58
LArBadChannel::LArBadChannelEnum::almostDeadBit
@ almostDeadBit
Definition: LArBadChannel.h:23
LArBadChannel::operator|=
LArBadChannel & operator|=(LArBadChannel other)
Definition: LArBadChannel.h:141
LArBadChannel::LArBadChannelEnum::unstableNoiseHGBit
@ unstableNoiseHGBit
Definition: LArBadChannel.h:29
LArBadChannel::problematicForUnknownReason
bool problematicForUnknownReason() const
Definition: LArBadChannel.h:125
LArBadChannel::unstableNoiseMG
bool unstableNoiseMG() const
Definition: LArBadChannel.h:119
LArBadChannel::noisy
bool noisy() const
Definition: LArBadChannel.h:134
LArBadChannel::LArBadChannelSCEnum::NonLinearRampBit
@ NonLinearRampBit
Definition: LArBadChannel.h:62
LArBadChannel
Definition: LArBadChannel.h:10
LArBadChannel::operator==
bool operator==(LArBadChannel other)
Definition: LArBadChannel.h:139
LArBadChannel::missingFEB
bool missingFEB() const
Definition: LArBadChannel.h:123
LArBadChannel::LArBadChannelSCEnum::OffOFCsBit
@ OffOFCsBit
Definition: LArBadChannel.h:65
LArBadChannel::offOFCs
bool offOFCs() const
Definition: LArBadChannel.h:99
LArBadChannel::LArBadChannelEnum::highNoiseMGBit
@ highNoiseMGBit
Definition: LArBadChannel.h:31
LArBadChannel::m_word
BitWord m_word
Definition: LArBadChannel.h:151
LArBadChannel::LArBadChannelEnum::sporadicBurstNoiseBit
@ sporadicBurstNoiseBit
Definition: LArBadChannel.h:39
LArBadChannel::LArBadChannelEnum::unstableNoiseLGBit
@ unstableNoiseLGBit
Definition: LArBadChannel.h:35
LArBadChannel::reallyNoisy
bool reallyNoisy() const
Definition: LArBadChannel.h:132
LArBadChannel::lowNoiseMG
bool lowNoiseMG() const
Definition: LArBadChannel.h:117
LArBadChannel::peculiarCalibrationLine
bool peculiarCalibrationLine() const
Definition: LArBadChannel.h:124
LArBadChannel::packedData
BitWord packedData() const
Definition: LArBadChannel.h:143
LArBadChannel::LArBadChannelSCEnum::lowLightFibreBit
@ lowLightFibreBit
Definition: LArBadChannel.h:68
LArBadChannel::highNoiseLG
bool highNoiseLG() const
Definition: LArBadChannel.h:121
LArBadChannel::reflaggedByLADIeS
bool reflaggedByLADIeS() const
Definition: LArBadChannel.h:130
LArBadChannel::LArBadChannelEnum::reflaggedByLADIeSBit
@ reflaggedByLADIeSBit
Definition: LArBadChannel.h:43
LArBadChannel::lowLightFibre
bool lowLightFibre() const
Definition: LArBadChannel.h:102
LArBadChannel::setSC
void setSC()
Definition: LArBadChannel.h:146
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArBadChannel::offAmplitude
bool offAmplitude() const
Definition: LArBadChannel.h:100
LArBadChannel::unstable
bool unstable() const
Definition: LArBadChannel.h:112
LArBadChannel::LArBadChannelSCEnum::transmissionErrorFibreBit
@ transmissionErrorFibreBit
Definition: LArBadChannel.h:69
LArBadChannel::LArBadChannelEnum::shortBit
@ shortBit
Definition: LArBadChannel.h:24
LArBadChannel::LArBadChannelEnum::distortedBit
@ distortedBit
Definition: LArBadChannel.h:26
LArBadChannel::LArBadChannelEnum
Definition: LArBadChannel.h:16
LArBadChannel::distorted
bool distorted() const
Definition: LArBadChannel.h:113
LArBadChannel::LArBadChannelEnum::lowNoiseMGBit
@ lowNoiseMGBit
Definition: LArBadChannel.h:30
LArBadChannel::deadPhys
bool deadPhys() const
Definition: LArBadChannel.h:109
LArBadChannel::highNoiseMG
bool highNoiseMG() const
Definition: LArBadChannel.h:118
LArBadChannel::LArBadChannelEnum::deadSCACellBit
@ deadSCACellBit
Definition: LArBadChannel.h:40
LArBadChannel::maskedOSUM
bool maskedOSUM() const
Definition: LArBadChannel.h:93
LArBadChannel::transmissionErrorFibre
bool transmissionErrorFibre() const
Definition: LArBadChannel.h:103
LArBadChannel::operator!=
bool operator!=(LArBadChannel other)
Definition: LArBadChannel.h:137
LArBadChannel::LArBadChannel
LArBadChannel(BitWord rawStatus=0, bool isSC=false)
Definition: LArBadChannel.h:77
LArBadChannel::LArBadChannelEnum::unflaggedByLADIeSBit
@ unflaggedByLADIeSBit
Definition: LArBadChannel.h:42
LArBadChannel::LArBadChannelEnum::highNoiseHGBit
@ highNoiseHGBit
Definition: LArBadChannel.h:28
LArBadChannel::LArBadChannelEnum::highNoiseLGBit
@ highNoiseLGBit
Definition: LArBadChannel.h:34
LArBadChannel::isSC
bool isSC() const
Definition: LArBadChannel.h:145
LArBadChannel::LArBadChannelEnum::peculiarCalibrationLineBit
@ peculiarCalibrationLineBit
Definition: LArBadChannel.h:37
LArBadChannel::LArBadChannelEnum::ProblemType
ProblemType
Definition: LArBadChannel.h:19
LArBadChannel::LArBadChannelSCEnum::deadReadoutBit
@ deadReadoutBit
Definition: LArBadChannel.h:53
LArBadChannel::ADCJump
bool ADCJump() const
Definition: LArBadChannel.h:97
LArBadChannel::nonLinearRamp
bool nonLinearRamp() const
Definition: LArBadChannel.h:96
LArBadChannel::LArBadChannelEnum::deadPhysBit
@ deadPhysBit
Definition: LArBadChannel.h:22
LArBadChannel::deformedPulse
bool deformedPulse() const
Definition: LArBadChannel.h:95
LArBadChannel::LArBadChannelSCEnum::OffScaleBit
@ OffScaleBit
Definition: LArBadChannel.h:67