ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArBadChannelTool
LArBadChannelTool
LArBadChanFebState.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 LArBadChanFebState_H
6
#define LArBadChanFebState_H
7
8
#include "
LArRecConditions/LArBadChannel.h
"
9
#include "
LArRecConditions/LArBadFeb.h
"
10
#include "
LArRecConditions/LArBadChanBitPacking.h
"
11
#include <vector>
12
16
17
class
LArBadChanFebState
{
18
public
:
19
20
LArBadChanFebState
() :
m_status
() {}
21
22
void
resetChannels
() {
23
if
(
m_vec
.capacity() != 0) std::vector<LArBadChannel>().swap(
m_vec
);
// clear() and free the memory
24
}
25
26
// void setBad() {m_bad = true;} // replaced by setFebStatus
27
void
setFebStatus
(
LArBadFeb
s) {
m_status
= s;}
28
void
resetBad
() {
m_status
=
LArBadFeb
();}
29
31
bool
bad
()
const
{
return
!
m_status
.good();}
32
34
LArBadFeb
febStatus
()
const
{
return
m_status
;}
35
37
bool
empty
()
const
{
return
m_vec
.empty();}
38
39
void
addChannel
(
unsigned
int
chan,
LArBadChannel
chanState) {
40
// FIXME 128 (number of channels per FEB) is a hard-wired constant here
41
if
(
m_vec
.size() != 128)
m_vec
.resize(128);
42
m_vec
.at(chan) = chanState;
43
}
44
46
LArBadChannel
status
(
unsigned
int
chan)
const
{
47
static
LArBadChannel
goodState(0);
48
static
LArBadChannel
badState =
setBadState
();
// initialized only at first call
49
50
if
(
empty
()) {
51
if
(
bad
())
return
badState;
52
else
return
goodState;
53
}
54
else
{
55
if
(!
bad
())
return
m_vec
.at(chan);
56
else
return
LArBadChannel
(
m_vec
.at(chan).packedData() | badState.
packedData
());
57
}
58
59
// does not return channel info in case the FEB is missing
60
// return ( bad() ? badState : ( m_vec.empty() ? goodState : m_vec.at(chan)));
61
}
62
63
private
:
64
65
LArBadFeb
m_status
;
66
std::vector<LArBadChannel>
m_vec
;
67
68
LArBadChannel
setBadState
()
const
{
69
LArBadChanBitPacking
packing;
70
LArBadChannel
bs;
71
packing.
setBit
(
LArBadChannel::LArBadChannelEnum::missingFEBBit
, bs);
72
return
bs;
73
}
74
75
};
76
77
#endif
LArBadChanBitPacking.h
LArBadChannel.h
LArBadFeb.h
LArBadChanBitPacking
Definition
LArBadChanBitPacking.h:13
LArBadChanFebState::status
LArBadChannel status(unsigned int chan) const
Returns an OR of the channel status and the missing FEB status.
Definition
LArBadChanFebState.h:46
LArBadChanFebState::empty
bool empty() const
Returns true if there are no bad channels in the FEB.
Definition
LArBadChanFebState.h:37
LArBadChanFebState::m_status
LArBadFeb m_status
Definition
LArBadChanFebState.h:65
LArBadChanFebState::setBadState
LArBadChannel setBadState() const
Definition
LArBadChanFebState.h:68
LArBadChanFebState::m_vec
std::vector< LArBadChannel > m_vec
Definition
LArBadChanFebState.h:66
LArBadChanFebState::setFebStatus
void setFebStatus(LArBadFeb s)
Definition
LArBadChanFebState.h:27
LArBadChanFebState::LArBadChanFebState
LArBadChanFebState()
Definition
LArBadChanFebState.h:20
LArBadChanFebState::resetChannels
void resetChannels()
Definition
LArBadChanFebState.h:22
LArBadChanFebState::bad
bool bad() const
Returns true if the entire FEB is missing.
Definition
LArBadChanFebState.h:31
LArBadChanFebState::resetBad
void resetBad()
Definition
LArBadChanFebState.h:28
LArBadChanFebState::addChannel
void addChannel(unsigned int chan, LArBadChannel chanState)
Definition
LArBadChanFebState.h:39
LArBadChanFebState::febStatus
LArBadFeb febStatus() const
Returns the FEB state.
Definition
LArBadChanFebState.h:34
LArBadChannel::LArBadChannelEnum::missingFEBBit
@ missingFEBBit
Definition
LArBadChannel.h:36
LArBadChannel
Definition
LArBadChannel.h:10
LArBadChannel::packedData
BitWord packedData() const
Definition
LArBadChannel.h:147
LArBadFeb
Definition
LArBadFeb.h:10
TLArBadChanBitPackingBase::setBit
void setBit(typename T::ProblemType pb, LArBadChannel::BitWord &word, bool value=true) const
Generated on
for ATLAS Offline Software by
1.17.0