ATLAS Offline Software
CaloBadChannel.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 CaloBadChannel_H
6 #define CaloBadChannel_H
7 
9  public:
10 
11  typedef unsigned int PosType;
12  typedef unsigned int BitWord;
13 
15 
16  CaloBadChannel( BitWord rawStatus) : m_word(rawStatus) {}
18 
19  CaloBadChannel(const CaloBadChannel& rBad) = default;
21  CaloBadChannel& operator= (const CaloBadChannel& rBad) = default;
22 
23  bool statusOK( ProblemType pb) const {
24  BitWord mask = 1 << (PosType) pb;
25  return ((m_word & mask) == 0); // OK means bit is not set
26  }
27 
28  bool dead() const {return !statusOK( deadBit);}
29  bool noisy() const {return !statusOK( noisyBit);}
30  bool affected() const {return !statusOK( affectedBit);}
31 
32  BitWord packedData() const {return m_word;}
33 
38  static void setBit( ProblemType pb, BitWord& word, bool value=true) {
39  BitWord mask = 1 << static_cast<PosType>(pb); // all at 0 axcept pb bit
40  if (value) word |= mask;
41  else word &= ~mask;
42  }
43 
44  private:
45 
47 
48 };
49 
50 #endif
CaloBadChannel::operator=
CaloBadChannel & operator=(const CaloBadChannel &rBad)=default
keylayer_zslicemap.pb
pb
Definition: keylayer_zslicemap.py:188
CaloBadChannel::deadBit
@ deadBit
Definition: CaloBadChannel.h:14
CaloBadChannel::CaloBadChannel
CaloBadChannel(const CaloBadChannel *pBad)
Definition: CaloBadChannel.h:20
CaloBadChannel::affectedBit
@ affectedBit
Definition: CaloBadChannel.h:14
athena.value
value
Definition: athena.py:122
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
CaloBadChannel::dead
bool dead() const
Definition: CaloBadChannel.h:28
CaloBadChannel::m_word
BitWord m_word
Definition: CaloBadChannel.h:46
CaloBadChannel::CaloBadChannel
CaloBadChannel(const CaloBadChannel &rBad)=default
CaloBadChannel::statusOK
bool statusOK(ProblemType pb) const
Definition: CaloBadChannel.h:23
CaloBadChannel::BitWord
unsigned int BitWord
Definition: CaloBadChannel.h:12
CaloBadChannel::CaloBadChannel
CaloBadChannel(BitWord rawStatus)
Definition: CaloBadChannel.h:16
CaloBadChannel::noisyBit
@ noisyBit
Definition: CaloBadChannel.h:14
CaloBadChannel::packedData
BitWord packedData() const
Definition: CaloBadChannel.h:32
CaloBadChannel::setBit
static void setBit(ProblemType pb, BitWord &word, bool value=true)
Sets the bit corresponding to "pb" inside the word passed as second argument to "value".
Definition: CaloBadChannel.h:38
CaloBadChannel
Definition: CaloBadChannel.h:8
CaloBadChannel::ProblemType
ProblemType
Definition: CaloBadChannel.h:14
CaloBadChannel::noisy
bool noisy() const
Definition: CaloBadChannel.h:29
CaloBadChannel::affected
bool affected() const
Definition: CaloBadChannel.h:30
CaloBadChannel::CaloBadChannel
CaloBadChannel()
Definition: CaloBadChannel.h:17
CaloBadChannel::PosType
unsigned int PosType
Definition: CaloBadChannel.h:11