ATLAS Offline Software
Loading...
Searching...
No Matches
Calorimeter
CaloConditions
CaloConditions
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
8
class
CaloBadChannel
{
9
public
:
10
11
typedef
unsigned
int
PosType
;
12
typedef
unsigned
int
BitWord
;
13
14
enum
ProblemType
{
deadBit
=0,
noisyBit
=1,
affectedBit
=2};
15
16
CaloBadChannel
(
BitWord
rawStatus) :
m_word
(rawStatus) {}
17
CaloBadChannel
() :
m_word
(0) {}
18
19
CaloBadChannel
(
const
CaloBadChannel
& rBad) =
default
;
20
CaloBadChannel
(
const
CaloBadChannel
* pBad) {
m_word
=pBad->
m_word
;}
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
46
BitWord
m_word
;
47
48
};
49
50
#endif
CaloBadChannel::affected
bool affected() const
Definition
CaloBadChannel.h:30
CaloBadChannel::ProblemType
ProblemType
Definition
CaloBadChannel.h:14
CaloBadChannel::affectedBit
@ affectedBit
Definition
CaloBadChannel.h:14
CaloBadChannel::deadBit
@ deadBit
Definition
CaloBadChannel.h:14
CaloBadChannel::noisyBit
@ noisyBit
Definition
CaloBadChannel.h:14
CaloBadChannel::PosType
unsigned int PosType
Definition
CaloBadChannel.h:11
CaloBadChannel::packedData
BitWord packedData() const
Definition
CaloBadChannel.h:32
CaloBadChannel::dead
bool dead() const
Definition
CaloBadChannel.h:28
CaloBadChannel::m_word
BitWord m_word
Definition
CaloBadChannel.h:46
CaloBadChannel::CaloBadChannel
CaloBadChannel()
Definition
CaloBadChannel.h:17
CaloBadChannel::noisy
bool noisy() const
Definition
CaloBadChannel.h:29
CaloBadChannel::CaloBadChannel
CaloBadChannel(const CaloBadChannel &rBad)=default
CaloBadChannel::BitWord
unsigned int BitWord
Definition
CaloBadChannel.h:12
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::CaloBadChannel
CaloBadChannel(const CaloBadChannel *pBad)
Definition
CaloBadChannel.h:20
CaloBadChannel::CaloBadChannel
CaloBadChannel(BitWord rawStatus)
Definition
CaloBadChannel.h:16
CaloBadChannel::operator=
CaloBadChannel & operator=(const CaloBadChannel &rBad)=default
CaloBadChannel::statusOK
bool statusOK(ProblemType pb) const
Definition
CaloBadChannel.h:23
Generated on
for ATLAS Offline Software by
1.14.0