ATLAS Offline Software
Loading...
Searching...
No Matches
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
bool affected() const
unsigned int PosType
BitWord packedData() const
bool dead() const
bool noisy() const
CaloBadChannel(const CaloBadChannel &rBad)=default
unsigned int BitWord
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".
CaloBadChannel(const CaloBadChannel *pBad)
CaloBadChannel(BitWord rawStatus)
CaloBadChannel & operator=(const CaloBadChannel &rBad)=default
bool statusOK(ProblemType pb) const