ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
LArBadFeb febStatus () const
 Returns the FEB state. More...
 
bool empty () const
 Returns true if there are no bad channels in the FEB. More...
 
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. More...
 

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  }

◆ 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  }

◆ setFebStatus()

void LArBadChanFebState::setFebStatus ( LArBadFeb  s)
inline

Definition at line 27 of file LArBadChanFebState.h.

27 {m_status = s;}

◆ 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  }

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:
LArBadChanBitPacking
Definition: LArBadChanBitPacking.h:13
LArBadChanFebState::empty
bool empty() const
Returns true if there are no bad channels in the FEB.
Definition: LArBadChanFebState.h:37
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
LArBadChanFebState::m_vec
std::vector< LArBadChannel > m_vec
Definition: LArBadChanFebState.h:66
LArBadChannel::LArBadChannelEnum::missingFEBBit
@ missingFEBBit
Definition: LArBadChannel.h:36
LArBadFeb::good
bool good() const
Returns true if no problems at all (all bits at zero)
Definition: LArBadFeb.h:27
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LArBadChannel
Definition: LArBadChannel.h:10
LArBadChanFebState::setBadState
LArBadChannel setBadState() const
Definition: LArBadChanFebState.h:68
LArBadFeb
Definition: LArBadFeb.h:10
LArBadChannel::packedData
BitWord packedData() const
Definition: LArBadChannel.h:143
LArBadChanFebState::m_status
LArBadFeb m_status
Definition: LArBadChanFebState.h:65
TLArBadChanBitPackingBase::setBit
void setBit(typename T::ProblemType pb, LArBadChannel::BitWord &word, bool value=true) const
LArBadChanFebState::bad
bool bad() const
Returns true if the entire FEB is missing.
Definition: LArBadChanFebState.h:31