ATLAS Offline Software
LArBadFeb.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LArBadFeb_H
6 #define LArBadFeb_H
7 
9 
10 class LArBadFeb : public LArBadFebEnum {
11 public:
12 
13  LArBadFeb() : m_word(0) {}
14 
15  explicit LArBadFeb( BitWord rawStatus) : m_word(rawStatus) {}
16 
18  bool statusBad( ProblemType pb) const {
19  BitWord mask = 1 << bitPosition(pb);
20  return ((m_word & mask) != 0);
21  }
22 
24  bool statusOK( ProblemType pb) const {return !statusBad(pb);}
25 
27  bool good() const {return (m_word << 16) == 0;} // only use the lower 16 bits
28 
30  bool deadAll() const {return statusBad( deadAllBit);}
31 
33  bool deadReadout() const {return statusBad( deadReadoutBit);}
34 
36  bool inError() const {return statusBad( inErrorBit);}
37 
40 
41  unsigned int ignoreErrors() const;
42 
43  static PosType bitPosition( ProblemType pb) { return static_cast<PosType>(pb);}
44 
45  bool operator!=(BitWord other) {return m_word != other;}
46  bool operator!=(LArBadFeb other) {return m_word != other.packedData();}
47  bool operator==(BitWord other) {return m_word == other;}
48  bool operator==(LArBadFeb other) {return m_word == other.packedData();}
49 
50  LArBadFeb& operator|=(LArBadFeb other) {m_word|=other.m_word; return *this;}
51 
52  BitWord packedData() const {return m_word;}
53 
54 private:
55 
57 
59 
60  friend class LArBadFebBitPacking;
61 
62 };
63 
64 
65 inline unsigned int LArBadFeb::ignoreErrors() const
66 {
67  return (m_word >> 16); // return the most significant 16 bits
68 }
69 
70 #endif
LArBadFebEnum
Definition: LArBadFebEnum.h:8
LArBadFebEnum::PosType
unsigned int PosType
Definition: LArBadFebEnum.h:12
keylayer_zslicemap.pb
pb
Definition: keylayer_zslicemap.py:188
LArBadFeb::deadReadout
bool deadReadout() const
FEB is not sending readout data, but the L1 trigger path is working.
Definition: LArBadFeb.h:33
LArBadFeb::packedDataRef
BitWord & packedDataRef()
Definition: LArBadFeb.h:58
LArBadFebEnum::BitWord
unsigned int BitWord
Definition: LArBadFebEnum.h:13
LArBadFeb::operator!=
bool operator!=(LArBadFeb other)
Definition: LArBadFeb.h:46
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
LArBadFebEnum::deadAllBit
@ deadAllBit
Definition: LArBadFebEnum.h:16
LArBadFebEnum::inErrorBit
@ inErrorBit
Definition: LArBadFebEnum.h:18
LArBadFeb::operator!=
bool operator!=(BitWord other)
Definition: LArBadFeb.h:45
LArBadFebEnum::deadReadoutBit
@ deadReadoutBit
Definition: LArBadFebEnum.h:17
LArBadFeb::good
bool good() const
Returns true if no problems at all (all bits at zero)
Definition: LArBadFeb.h:27
LArBadFeb::deadAll
bool deadAll() const
FEB is completely missing, e.g. powered off.
Definition: LArBadFeb.h:30
LArBadFeb::operator==
bool operator==(LArBadFeb other)
Definition: LArBadFeb.h:48
LArBadFeb::LArBadFeb
LArBadFeb()
Definition: LArBadFeb.h:13
LArBadFeb::operator|=
LArBadFeb & operator|=(LArBadFeb other)
Definition: LArBadFeb.h:50
LArBadFeb::bitPosition
static PosType bitPosition(ProblemType pb)
Definition: LArBadFeb.h:43
LArBadFebEnum::deactivatedInOKSBit
@ deactivatedInOKSBit
Definition: LArBadFebEnum.h:19
LArBadFeb::ignoreErrors
unsigned int ignoreErrors() const
Definition: LArBadFeb.h:65
LArBadFeb
Definition: LArBadFeb.h:10
LArBadFebEnum::ProblemType
ProblemType
Definition: LArBadFebEnum.h:15
LArBadFeb::inError
bool inError() const
FEB has readout errors, cannot be used.
Definition: LArBadFeb.h:36
LArBadFeb::deactivatedInOKS
bool deactivatedInOKS() const
Deactivated in OKS.
Definition: LArBadFeb.h:39
LArBadFeb::LArBadFeb
LArBadFeb(BitWord rawStatus)
Definition: LArBadFeb.h:15
LArBadFebBitPacking
Definition: LArBadFebBitPacking.h:16
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArBadFeb::packedData
BitWord packedData() const
Definition: LArBadFeb.h:52
LArBadFeb::m_word
BitWord m_word
Definition: LArBadFeb.h:56
LArBadFeb::statusOK
bool statusOK(ProblemType pb) const
Returns true if there is no problem in corresponding status bit.
Definition: LArBadFeb.h:24
LArBadFeb::statusBad
bool statusBad(ProblemType pb) const
Returns true if corresponding status bit its set
Definition: LArBadFeb.h:18
LArBadFebEnum.h
LArBadFeb::operator==
bool operator==(BitWord other)
Definition: LArBadFeb.h:47