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

#include <LArBadChannelState.h>

Collaboration diagram for LArBadChannelState:

Classes

class  CoolChannelData

Public Types

enum  { NCoolChannels =8 }
enum  CaloPartEnum { EMB , EMEC , HEC , FCAL }
enum  PosNegEnum { NEG , POS }
enum  CoolChannelEnum {
  EMBA , EMBC , EMECA , EMECC ,
  HECA , HECC , FCALA , FCALC ,
  MAXCOOLCHAN
}
typedef std::pair< HWIdentifier, LArBadChannelBadChanEntry
typedef CoolChannelData::BadChanVec BadChanVec

Public Member Functions

 LArBadChannelState ()
int nCoolChannels () const
bool empty () const
 Returns true if all cool channels are empty.
void reset ()
 Reset to an empty state, erasing all data in all cool channels.
void addFromDB (const BadChanVec &stateVec, CoolChannelEnum chan)
 Add a complete cool channel from DB, with duplicate removal.
void add (const BadChanEntry &entry, CoolChannelEnum chan)
 Add a bad channel entry to a specified cool channel data.
void setFromDB (const BadChanVec &stateVec, CoolChannelEnum chan)
 Set cool channel from vector<BadChanEntry>, for example when reading from DB.
void addUpdate (const BadChanVec &stateVec, CoolChannelEnum chan)
 Add updates, e.g.
const CoolChannelDatacoolChannel (CoolChannelEnum chan) const

Static Public Member Functions

static std::string coolChannelName (CoolChannelEnum chan)
static CoolChannelEnum coolChannelEnum (CaloPartEnum part, PosNegEnum side)
static int barrelEndcap (CoolChannelEnum chan)
static CaloPartEnum caloPart (CoolChannelEnum chan)
static int posNeg (CoolChannelEnum chan)
static void mergeFlags (BadChanEntry &a, const BadChanEntry &b)

Private Member Functions

CoolChannelDatacoolChannel (int i)

Private Attributes

std::vector< CoolChannelDatam_DataVec

Detailed Description

Definition at line 15 of file LArBadChannelState.h.

Member Typedef Documentation

◆ BadChanEntry

Definition at line 18 of file LArBadChannelState.h.

◆ BadChanVec

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NCoolChannels 

Definition at line 20 of file LArBadChannelState.h.

◆ CaloPartEnum

◆ CoolChannelEnum

◆ PosNegEnum

Enumerator
NEG 
POS 

Definition at line 22 of file LArBadChannelState.h.

Constructor & Destructor Documentation

◆ LArBadChannelState()

LArBadChannelState::LArBadChannelState ( )

Definition at line 9 of file LArBadChannelState.cxx.

10{
11 for ( unsigned int i=0; i<NCoolChannels; i++) {
12 m_DataVec.emplace_back( static_cast<CoolChannelEnum>(i));
13 }
14}
std::vector< CoolChannelData > m_DataVec

Member Function Documentation

◆ add()

void LArBadChannelState::add ( const BadChanEntry & entry,
CoolChannelEnum chan )

Add a bad channel entry to a specified cool channel data.

Definition at line 16 of file LArBadChannelState.cxx.

17{
18 m_DataVec[chan].add(entry);
19}

◆ addFromDB()

void LArBadChannelState::addFromDB ( const BadChanVec & stateVec,
CoolChannelEnum chan )

Add a complete cool channel from DB, with duplicate removal.

Definition at line 27 of file LArBadChannelState.cxx.

29{
30 m_DataVec[chan].addFromDB( stateVec);
31}

◆ addUpdate()

void LArBadChannelState::addUpdate ( const BadChanVec & stateVec,
CoolChannelEnum chan )
inline

Add updates, e.g.

from an ASCII file or interactively. The new entries are appended to the existing container.

Definition at line 129 of file LArBadChannelState.h.

130 {
131 m_DataVec[chan].addUpdate( stateVec);
132 }

◆ barrelEndcap()

int LArBadChannelState::barrelEndcap ( CoolChannelEnum chan)
inlinestatic

Definition at line 145 of file LArBadChannelState.h.

145 {
146 if (chan == EMBA || chan == EMBC) return 0;
147 else return 1;
148 }

◆ caloPart()

CaloPartEnum LArBadChannelState::caloPart ( CoolChannelEnum chan)
inlinestatic

Definition at line 150 of file LArBadChannelState.h.

150 {
151 return static_cast<CaloPartEnum>(static_cast<int>(chan)/2);
152 }

◆ coolChannel() [1/2]

const CoolChannelData & LArBadChannelState::coolChannel ( CoolChannelEnum chan) const
inline

Definition at line 134 of file LArBadChannelState.h.

134 {
135 return m_DataVec.at(chan);
136 }

◆ coolChannel() [2/2]

CoolChannelData & LArBadChannelState::coolChannel ( int i)
inlineprivate

Definition at line 168 of file LArBadChannelState.h.

168 {
169 return m_DataVec.at( static_cast<CoolChannelEnum>(i));
170 }

◆ coolChannelEnum()

CoolChannelEnum LArBadChannelState::coolChannelEnum ( CaloPartEnum part,
PosNegEnum side )
inlinestatic

Definition at line 140 of file LArBadChannelState.h.

140 {
141 return static_cast<CoolChannelEnum>( 2 * static_cast<unsigned int>(part) +
142 1 - static_cast<unsigned int>(side));
143 }

◆ coolChannelName()

std::string LArBadChannelState::coolChannelName ( CoolChannelEnum chan)
static

Definition at line 40 of file LArBadChannelState.cxx.

41{
42 switch( chan) {
43 case EMBA:
44 return "EMBA";
45 break;
46 case EMBC:
47 return "EMBC";
48 break;
49 case EMECA:
50 return "EMECA";
51 break;
52 case EMECC:
53 return "EMECC";
54 break;
55 case HECA:
56 return "HECA";
57 break;
58 case HECC:
59 return "HECC";
60 break;
61 case FCALA:
62 return "FCALA";
63 break;
64 case FCALC:
65 return "FCALC";
66 break;
67 case MAXCOOLCHAN:
68 break;
69 }
70 return "Unknown";
71}

◆ empty()

bool LArBadChannelState::empty ( ) const
inline

Returns true if all cool channels are empty.

Definition at line 106 of file LArBadChannelState.h.

106 {
107 for (const CoolChannelData& cd : m_DataVec) {
108 if (!cd.empty()) return false;
109 }
110 return true;
111 }

◆ mergeFlags()

void LArBadChannelState::mergeFlags ( BadChanEntry & a,
const BadChanEntry & b )
inlinestatic

Definition at line 158 of file LArBadChannelState.h.

158 {
159 a.second = LArBadChannel( a.second.packedData() | b.second.packedData());
160 }
static Double_t a

◆ nCoolChannels()

int LArBadChannelState::nCoolChannels ( ) const
inline

Definition at line 103 of file LArBadChannelState.h.

103{ return m_DataVec.size();}

◆ posNeg()

int LArBadChannelState::posNeg ( CoolChannelEnum chan)
inlinestatic

Definition at line 154 of file LArBadChannelState.h.

154 {
155 return (static_cast<int>(chan)+1) % 2;
156 }

◆ reset()

void LArBadChannelState::reset ( )

Reset to an empty state, erasing all data in all cool channels.

Definition at line 33 of file LArBadChannelState.cxx.

34{
35 for ( unsigned int i=0; i<NCoolChannels; i++) {
36 m_DataVec[i].reset();
37 }
38}

◆ setFromDB()

void LArBadChannelState::setFromDB ( const BadChanVec & stateVec,
CoolChannelEnum chan )

Set cool channel from vector<BadChanEntry>, for example when reading from DB.

Definition at line 21 of file LArBadChannelState.cxx.

23{
24 m_DataVec[chan].setFromDB( stateVec);
25}

Member Data Documentation

◆ m_DataVec

std::vector< CoolChannelData> LArBadChannelState::m_DataVec
private

Definition at line 165 of file LArBadChannelState.h.


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