ATLAS Offline Software
Loading...
Searching...
No Matches
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
10class LArBadFeb : public LArBadFebEnum {
11public:
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
54private:
55
57
59
60 friend class LArBadFebBitPacking;
61
62};
63
64
65inline unsigned int LArBadFeb::ignoreErrors() const
66{
67 return (m_word >> 16); // return the most significant 16 bits
68}
69
70#endif
unsigned int PosType
unsigned int BitWord
static PosType bitPosition(ProblemType pb)
Definition LArBadFeb.h:43
LArBadFeb(BitWord rawStatus)
Definition LArBadFeb.h:15
bool operator==(BitWord other)
Definition LArBadFeb.h:47
unsigned int ignoreErrors() const
Definition LArBadFeb.h:65
bool deadAll() const
FEB is completely missing, e.g. powered off.
Definition LArBadFeb.h:30
BitWord packedData() const
Definition LArBadFeb.h:52
bool operator==(LArBadFeb other)
Definition LArBadFeb.h:48
bool deactivatedInOKS() const
Deactivated in OKS.
Definition LArBadFeb.h:39
bool operator!=(BitWord other)
Definition LArBadFeb.h:45
friend class LArBadFebBitPacking
Definition LArBadFeb.h:60
BitWord & packedDataRef()
Definition LArBadFeb.h:58
LArBadFeb & operator|=(LArBadFeb other)
Definition LArBadFeb.h:50
bool statusOK(ProblemType pb) const
Returns true if there is no problem in corresponding status bit.
Definition LArBadFeb.h:24
bool statusBad(ProblemType pb) const
Returns true if corresponding status bit its set.
Definition LArBadFeb.h:18
bool inError() const
FEB has readout errors, cannot be used.
Definition LArBadFeb.h:36
bool deadReadout() const
FEB is not sending readout data, but the L1 trigger path is working.
Definition LArBadFeb.h:33
bool operator!=(LArBadFeb other)
Definition LArBadFeb.h:46
BitWord m_word
Definition LArBadFeb.h:56
bool good() const
Returns true if no problems at all (all bits at zero)
Definition LArBadFeb.h:27