ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
void reset ()
 Reset to an empty state, erasing all data in all cool channels. More...
 
void addFromDB (const BadChanVec &stateVec, CoolChannelEnum chan)
 Add a complete cool channel from DB, with duplicate removal. More...
 
void add (const BadChanEntry &entry, CoolChannelEnum chan)
 Add a bad channel entry to a specified cool channel data. More...
 
void setFromDB (const BadChanVec &stateVec, CoolChannelEnum chan)
 Set cool channel from vector<BadChanEntry>, for example when reading from DB. More...
 
void addUpdate (const BadChanVec &stateVec, CoolChannelEnum chan)
 Add updates, e.g. More...
 
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

Definition at line 99 of file LArBadChannelState.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NCoolChannels 

Definition at line 20 of file LArBadChannelState.h.

20 {NCoolChannels=8};

◆ CaloPartEnum

Enumerator
EMB 
EMEC 
HEC 
FCAL 

Definition at line 21 of file LArBadChannelState.h.

21 {EMB, EMEC, HEC, FCAL};

◆ CoolChannelEnum

Enumerator
EMBA 
EMBC 
EMECA 
EMECC 
HECA 
HECC 
FCALA 
FCALC 
MAXCOOLCHAN 

Definition at line 23 of file LArBadChannelState.h.

◆ PosNegEnum

Enumerator
NEG 
POS 

Definition at line 22 of file LArBadChannelState.h.

22 { NEG, POS};

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 }

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()

static 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()

static 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()

static 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()

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

◆ nCoolChannels()

int LArBadChannelState::nCoolChannels ( ) const
inline

Definition at line 103 of file LArBadChannelState.h.

103 { return m_DataVec.size();}

◆ posNeg()

static 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:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
LArBadChannelState::FCALA
@ FCALA
Definition: LArBadChannelState.h:23
LArBadChannelState::HEC
@ HEC
Definition: LArBadChannelState.h:21
LArBadChannelState::POS
@ POS
Definition: LArBadChannelState.h:22
LArBadChannelState::m_DataVec
std::vector< CoolChannelData > m_DataVec
Definition: LArBadChannelState.h:165
TRT::Hit::side
@ side
Definition: HitInfo.h:83
LArBadChannelState::FCAL
@ FCAL
Definition: LArBadChannelState.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:92
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LArBadChannelState::EMB
@ EMB
Definition: LArBadChannelState.h:21
LArBadChannelState::EMBC
@ EMBC
Definition: LArBadChannelState.h:23
LArBadChannel
Definition: LArBadChannel.h:10
LArBadChannelState::EMECA
@ EMECA
Definition: LArBadChannelState.h:23
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
LArBadChannelState::NEG
@ NEG
Definition: LArBadChannelState.h:22
LArBadChannelState::CoolChannelEnum
CoolChannelEnum
Definition: LArBadChannelState.h:23
a
TList * a
Definition: liststreamerinfos.cxx:10
LArBadChannelState::HECA
@ HECA
Definition: LArBadChannelState.h:23
LArBadChannelState::EMBA
@ EMBA
Definition: LArBadChannelState.h:23
calibdata.cd
cd
Definition: calibdata.py:51
LArBadChannelState::CaloPartEnum
CaloPartEnum
Definition: LArBadChannelState.h:21
LArBadChannelState::EMEC
@ EMEC
Definition: LArBadChannelState.h:21
LArBadChannelState::NCoolChannels
@ NCoolChannels
Definition: LArBadChannelState.h:20
LArBadChannelState::HECC
@ HECC
Definition: LArBadChannelState.h:23
LArBadChannelState::MAXCOOLCHAN
@ MAXCOOLCHAN
Definition: LArBadChannelState.h:23
LArBadChannelState::EMECC
@ EMECC
Definition: LArBadChannelState.h:23
LArBadChannelState::FCALC
@ FCALC
Definition: LArBadChannelState.h:23