ATLAS Offline Software
Loading...
Searching...
No Matches
LArBadChanFebState Class Reference

A class that stores the bad channels of a single FEB. More...

#include <LArBadChanFebState.h>

Collaboration diagram for LArBadChanFebState:

Public Member Functions

 LArBadChanFebState ()
void resetChannels ()
void setFebStatus (LArBadFeb s)
void resetBad ()
bool bad () const
 Returns true if the entire FEB is missing.
LArBadFeb febStatus () const
 Returns the FEB state.
bool empty () const
 Returns true if there are no bad channels in the FEB.
void addChannel (unsigned int chan, LArBadChannel chanState)
LArBadChannel status (unsigned int chan) const
 Returns an OR of the channel status and the missing FEB status.

Private Member Functions

LArBadChannel setBadState () const

Private Attributes

LArBadFeb m_status
std::vector< LArBadChannelm_vec

Detailed Description

A class that stores the bad channels of a single FEB.

Definition at line 17 of file LArBadChanFebState.h.

Constructor & Destructor Documentation

◆ LArBadChanFebState()

LArBadChanFebState::LArBadChanFebState ( )
inline

Definition at line 20 of file LArBadChanFebState.h.

20: m_status() {}

Member Function Documentation

◆ addChannel()

void LArBadChanFebState::addChannel ( unsigned int chan,
LArBadChannel chanState )
inline

Definition at line 39 of file LArBadChanFebState.h.

39 {
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 }
std::vector< LArBadChannel > m_vec

◆ bad()

bool LArBadChanFebState::bad ( ) const
inline

Returns true if the entire FEB is missing.

Definition at line 31 of file LArBadChanFebState.h.

31{return !m_status.good();}

◆ empty()

bool LArBadChanFebState::empty ( ) const
inline

Returns true if there are no bad channels in the FEB.

Definition at line 37 of file LArBadChanFebState.h.

37{return m_vec.empty();}

◆ febStatus()

LArBadFeb LArBadChanFebState::febStatus ( ) const
inline

Returns the FEB state.

Definition at line 34 of file LArBadChanFebState.h.

34{return m_status;}

◆ resetBad()

void LArBadChanFebState::resetBad ( )
inline

Definition at line 28 of file LArBadChanFebState.h.

28{m_status = LArBadFeb();}

◆ resetChannels()

void LArBadChanFebState::resetChannels ( )
inline

Definition at line 22 of file LArBadChanFebState.h.

22 {
23 if (m_vec.capacity() != 0) std::vector<LArBadChannel>().swap(m_vec); // clear() and free the memory
24 }

◆ setBadState()

LArBadChannel LArBadChanFebState::setBadState ( ) const
inlineprivate

Definition at line 68 of file LArBadChanFebState.h.

68 {
69 LArBadChanBitPacking packing;
70 LArBadChannel bs;
72 return bs;
73 }
void setBit(typename T::ProblemType pb, LArBadChannel::BitWord &word, bool value=true) const

◆ setFebStatus()

void LArBadChanFebState::setFebStatus ( LArBadFeb s)
inline

Definition at line 27 of file LArBadChanFebState.h.

◆ status()

LArBadChannel LArBadChanFebState::status ( unsigned int chan) const
inline

Returns an OR of the channel status and the missing FEB status.

Definition at line 46 of file LArBadChanFebState.h.

46 {
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 }
bool empty() const
Returns true if there are no bad channels in the FEB.
LArBadChannel setBadState() const
bool bad() const
Returns true if the entire FEB is missing.
BitWord packedData() const

Member Data Documentation

◆ m_status

LArBadFeb LArBadChanFebState::m_status
private

Definition at line 65 of file LArBadChanFebState.h.

◆ m_vec

std::vector<LArBadChannel> LArBadChanFebState::m_vec
private

Definition at line 66 of file LArBadChanFebState.h.


The documentation for this class was generated from the following file: