ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
ChanDeadErrorCode Class Reference

ChanDeadErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanDeadCode.h. More...

#include <ChanDeadErrorCode.h>

Inheritance diagram for ChanDeadErrorCode:
Collaboration diagram for ChanDeadErrorCode:

Public Types

enum  ChanDeadBits {
  BadLvdsBit = 0, BadAdcBit = 0, BadMcmBit = 1, FrontEndDeadBit = 4,
  ReceiverDeadBit = 5, HighVoltsOffBit = 6, LowVoltsOffBit = 7, NoisyTowerBit = 8,
  PSCellsMaskedBit = 16, FrontCellsMaskedBit = 17, MiddleCellsMaskedBit = 18, BackCellsMaskedBit = 19
}
 

Public Member Functions

 ChanDeadErrorCode ()
 
 ChanDeadErrorCode (unsigned int errorCode)
 
virtual ~ChanDeadErrorCode ()
 
 ChanDeadErrorCode (const ChanDeadErrorCode &e)
 
ChanDeadErrorCodeoperator= (const ChanDeadErrorCode &e)
 
ChanDeadErrorCodeoperator|= (const ChanDeadErrorCode &e)
 
bool chanValid () const
 
bool badLvds () const
 
void badLvds (bool bad)
 
bool badAdc () const
 
void badAdc (bool bad)
 
bool badMcm () const
 
void badMcm (bool bad)
 
bool frontEndDead () const
 
void frontEndDead (bool bad)
 
bool receiverDead () const
 
void receiverDead (bool bad)
 
bool highVoltsOff () const
 
void highVoltsOff (bool bad)
 
bool lowVoltsOff () const
 
void lowVoltsOff (bool bad)
 
bool noisyTower () const
 
void noisyTower (bool bad)
 
bool psCellsMasked () const
 
void psCellsMasked (bool bad)
 
bool frontCellsMasked () const
 
void frontCellsMasked (bool bad)
 
bool middleCellsMasked () const
 
void middleCellsMasked (bool bad)
 
bool backCellsMasked () const
 
void backCellsMasked (bool bad)
 
std::string printStatus () const
 
unsigned int errorCode () const
 

Protected Member Functions

void errorCode (unsigned int code)
 
bool bitIsSet (unsigned int number) const
 
void setBit (unsigned int number, bool value)
 

Private Attributes

unsigned int m_errorCode
 

Friends

std::ostream & operator<< (std::ostream &output, const ChanDeadErrorCode &r)
 

Detailed Description

ChanDeadErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanDeadCode.h.

Author
Damien Prieur damie.nosp@m.n.pr.nosp@m.ieur@.nosp@m.cern.nosp@m..ch

Definition at line 20 of file ChanDeadErrorCode.h.

Member Enumeration Documentation

◆ ChanDeadBits

Enumerator
BadLvdsBit 
BadAdcBit 
BadMcmBit 
FrontEndDeadBit 
ReceiverDeadBit 
HighVoltsOffBit 
LowVoltsOffBit 
NoisyTowerBit 
PSCellsMaskedBit 
FrontCellsMaskedBit 
MiddleCellsMaskedBit 
BackCellsMaskedBit 

Definition at line 26 of file ChanDeadErrorCode.h.

26  {
27  // Bits used for CPM/JEM dead channel folders.
28  BadLvdsBit = 0,
29 
30  // Bits used for PPM dead (or problem) channel folder.
31  // Bits 0-15 will zero the LUT if they are set.
32  // Bits 16-31 are flagging problems that do not need
33  // the LUT to be zeroed.
34 
35  // Internal L1Calo problems:
36  BadAdcBit = 0,
37  BadMcmBit = 1,
38 
39  // Calorimeter problems:
40  FrontEndDeadBit = 4,
41  ReceiverDeadBit = 5,
42  HighVoltsOffBit = 6,
43  LowVoltsOffBit = 7,
44  NoisyTowerBit = 8,
45 
46  // Calorimeter flags:
47  // (for Tile, can use A=Front, B/C=Middle, D=Back)
48  PSCellsMaskedBit = 16,
52  };

Constructor & Destructor Documentation

◆ ChanDeadErrorCode() [1/3]

ChanDeadErrorCode::ChanDeadErrorCode ( )

Definition at line 12 of file ChanDeadErrorCode.cxx.

12  : AbstractErrorCode(0) {
13 }

◆ ChanDeadErrorCode() [2/3]

ChanDeadErrorCode::ChanDeadErrorCode ( unsigned int  errorCode)

Definition at line 15 of file ChanDeadErrorCode.cxx.

16 }

◆ ~ChanDeadErrorCode()

virtual ChanDeadErrorCode::~ChanDeadErrorCode ( )
inlinevirtual

Definition at line 56 of file ChanDeadErrorCode.h.

56 {}

◆ ChanDeadErrorCode() [3/3]

ChanDeadErrorCode::ChanDeadErrorCode ( const ChanDeadErrorCode e)

Definition at line 18 of file ChanDeadErrorCode.cxx.

18  : AbstractErrorCode (e.errorCode()) {
19 }

Member Function Documentation

◆ backCellsMasked() [1/2]

bool ChanDeadErrorCode::backCellsMasked ( ) const
inline

Definition at line 97 of file ChanDeadErrorCode.h.

97 { return bitIsSet(BackCellsMaskedBit); }

◆ backCellsMasked() [2/2]

void ChanDeadErrorCode::backCellsMasked ( bool  bad)
inline

Definition at line 98 of file ChanDeadErrorCode.h.

◆ badAdc() [1/2]

bool ChanDeadErrorCode::badAdc ( ) const
inline

Definition at line 67 of file ChanDeadErrorCode.h.

67 { return bitIsSet(BadAdcBit); }

◆ badAdc() [2/2]

void ChanDeadErrorCode::badAdc ( bool  bad)
inline

Definition at line 68 of file ChanDeadErrorCode.h.

68 { setBit(BadAdcBit,bad); }

◆ badLvds() [1/2]

bool ChanDeadErrorCode::badLvds ( ) const
inline

Definition at line 64 of file ChanDeadErrorCode.h.

64 { return bitIsSet(BadLvdsBit); }

◆ badLvds() [2/2]

void ChanDeadErrorCode::badLvds ( bool  bad)
inline

Definition at line 65 of file ChanDeadErrorCode.h.

65 { setBit(BadLvdsBit,bad); }

◆ badMcm() [1/2]

bool ChanDeadErrorCode::badMcm ( ) const
inline

Definition at line 70 of file ChanDeadErrorCode.h.

70 { return bitIsSet(BadMcmBit); }

◆ badMcm() [2/2]

void ChanDeadErrorCode::badMcm ( bool  bad)
inline

Definition at line 71 of file ChanDeadErrorCode.h.

71 { setBit(BadMcmBit,bad); }

◆ bitIsSet()

bool AbstractErrorCode::bitIsSet ( unsigned int  number) const
protectedinherited

Definition at line 7 of file AbstractErrorCode.cxx.

7  {
8  unsigned int correspondingNumber = (unsigned int) (1<<number);
9 
10  bool isSet( ( m_errorCode & correspondingNumber) > 0);
11 
12  return isSet;
13 }

◆ chanValid()

bool ChanDeadErrorCode::chanValid ( ) const
inline

Definition at line 62 of file ChanDeadErrorCode.h.

62 {return (( this->errorCode() & 0xffff) == 0);}

◆ errorCode() [1/2]

unsigned int AbstractErrorCode::errorCode ( ) const
inlineinherited

Definition at line 21 of file AbstractErrorCode.h.

21 {return m_errorCode;}

◆ errorCode() [2/2]

void AbstractErrorCode::errorCode ( unsigned int  code)
inlineprotectedinherited

Definition at line 26 of file AbstractErrorCode.h.

26 {m_errorCode = code;}

◆ frontCellsMasked() [1/2]

bool ChanDeadErrorCode::frontCellsMasked ( ) const
inline

Definition at line 91 of file ChanDeadErrorCode.h.

91 { return bitIsSet(FrontCellsMaskedBit); }

◆ frontCellsMasked() [2/2]

void ChanDeadErrorCode::frontCellsMasked ( bool  bad)
inline

Definition at line 92 of file ChanDeadErrorCode.h.

◆ frontEndDead() [1/2]

bool ChanDeadErrorCode::frontEndDead ( ) const
inline

Definition at line 73 of file ChanDeadErrorCode.h.

73 { return bitIsSet(FrontEndDeadBit); }

◆ frontEndDead() [2/2]

void ChanDeadErrorCode::frontEndDead ( bool  bad)
inline

Definition at line 74 of file ChanDeadErrorCode.h.

◆ highVoltsOff() [1/2]

bool ChanDeadErrorCode::highVoltsOff ( ) const
inline

Definition at line 79 of file ChanDeadErrorCode.h.

79 { return bitIsSet(HighVoltsOffBit); }

◆ highVoltsOff() [2/2]

void ChanDeadErrorCode::highVoltsOff ( bool  bad)
inline

Definition at line 80 of file ChanDeadErrorCode.h.

◆ lowVoltsOff() [1/2]

bool ChanDeadErrorCode::lowVoltsOff ( ) const
inline

Definition at line 82 of file ChanDeadErrorCode.h.

82 { return bitIsSet(LowVoltsOffBit); }

◆ lowVoltsOff() [2/2]

void ChanDeadErrorCode::lowVoltsOff ( bool  bad)
inline

Definition at line 83 of file ChanDeadErrorCode.h.

◆ middleCellsMasked() [1/2]

bool ChanDeadErrorCode::middleCellsMasked ( ) const
inline

Definition at line 94 of file ChanDeadErrorCode.h.

94 { return bitIsSet(MiddleCellsMaskedBit); }

◆ middleCellsMasked() [2/2]

void ChanDeadErrorCode::middleCellsMasked ( bool  bad)
inline

Definition at line 95 of file ChanDeadErrorCode.h.

◆ noisyTower() [1/2]

bool ChanDeadErrorCode::noisyTower ( ) const
inline

Definition at line 85 of file ChanDeadErrorCode.h.

85 { return bitIsSet(NoisyTowerBit); }

◆ noisyTower() [2/2]

void ChanDeadErrorCode::noisyTower ( bool  bad)
inline

Definition at line 86 of file ChanDeadErrorCode.h.

◆ operator=()

ChanDeadErrorCode & ChanDeadErrorCode::operator= ( const ChanDeadErrorCode e)

Definition at line 21 of file ChanDeadErrorCode.cxx.

22 {
23  this->errorCode(e.errorCode());
24  return *this;
25 }

◆ operator|=()

ChanDeadErrorCode & ChanDeadErrorCode::operator|= ( const ChanDeadErrorCode e)

Definition at line 27 of file ChanDeadErrorCode.cxx.

28 {
29  this->errorCode( this->errorCode() | e.errorCode() );
30  return *this;
31 }

◆ printStatus()

std::string ChanDeadErrorCode::printStatus ( ) const

Definition at line 33 of file ChanDeadErrorCode.cxx.

33  {
34 
35  std::stringstream status;
36 
37  status << "ErrorCode: " << this->errorCode() << std::endl;
38 
39  status << "Bit " << std::setw(2) << BadAdcBit
40  << ": BadAdcBit: "
41  << bitIsSet(BadAdcBit) << std::endl;
42 
43  status << "Bit " << std::setw(2) << BadMcmBit
44  << ": BadMcmBit: "
45  << bitIsSet(BadMcmBit) << std::endl;
46 
47  status << "Bit " << std::setw(2) << FrontEndDeadBit
48  << ": FrontEndDeadBit: "
49  << bitIsSet(FrontEndDeadBit) << std::endl;
50 
51  status << "Bit " << std::setw(2) << ReceiverDeadBit
52  << ": ReceiverDeadBit: "
53  << bitIsSet(ReceiverDeadBit) << std::endl;
54 
55  status << "Bit " << std::setw(2) << HighVoltsOffBit
56  << ": HighVoltsOffBit: "
57  << bitIsSet(HighVoltsOffBit) << std::endl;
58 
59  status << "Bit " << std::setw(2) << LowVoltsOffBit
60  << ": LowVoltsOffBit: "
61  << bitIsSet(LowVoltsOffBit) << std::endl;
62 
63  status << "Bit " << std::setw(2) << NoisyTowerBit
64  << ": NoisyTowerBit: "
65  << bitIsSet(NoisyTowerBit) << std::endl;
66 
67  status << "Bit " << std::setw(2) << PSCellsMaskedBit
68  << ": PSCellsMaskedBit: "
69  << bitIsSet(PSCellsMaskedBit) << std::endl;
70 
71  status << "Bit " << std::setw(2) << FrontCellsMaskedBit
72  << ": FrontCellsMaskedBit: "
73  << bitIsSet(FrontCellsMaskedBit) << std::endl;
74 
75  status << "Bit " << std::setw(2) << MiddleCellsMaskedBit
76  << ": MiddleCellsMaskedBit: "
77  << bitIsSet(MiddleCellsMaskedBit) << std::endl;
78 
79  status << "Bit " << std::setw(2) << BackCellsMaskedBit
80  << ": BackCellsMaskedBit: "
81  << bitIsSet(BackCellsMaskedBit) << std::endl;
82 
83  return status.str();
84 }

◆ psCellsMasked() [1/2]

bool ChanDeadErrorCode::psCellsMasked ( ) const
inline

Definition at line 88 of file ChanDeadErrorCode.h.

88 { return bitIsSet(PSCellsMaskedBit); }

◆ psCellsMasked() [2/2]

void ChanDeadErrorCode::psCellsMasked ( bool  bad)
inline

Definition at line 89 of file ChanDeadErrorCode.h.

◆ receiverDead() [1/2]

bool ChanDeadErrorCode::receiverDead ( ) const
inline

Definition at line 76 of file ChanDeadErrorCode.h.

76 { return bitIsSet(ReceiverDeadBit); }

◆ receiverDead() [2/2]

void ChanDeadErrorCode::receiverDead ( bool  bad)
inline

Definition at line 77 of file ChanDeadErrorCode.h.

◆ setBit()

void AbstractErrorCode::setBit ( unsigned int  number,
bool  value 
)
protectedinherited

Definition at line 15 of file AbstractErrorCode.cxx.

15  {
16  bool isSet(bitIsSet(number));
17  unsigned int correspondingNumber = (unsigned int) (1<<number);
18 
19  // set bit if not set yet
20  if ((value) && (!isSet)) m_errorCode |= correspondingNumber;
21  // remove bit if bit is set
22  if ((!value) && (isSet)) m_errorCode &= ~correspondingNumber;
23 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  output,
const ChanDeadErrorCode r 
)
friend

Definition at line 87 of file ChanDeadErrorCode.cxx.

87  {
88  output << r.errorCode();
89  return output;
90 }

Member Data Documentation

◆ m_errorCode

unsigned int AbstractErrorCode::m_errorCode
privateinherited

Definition at line 32 of file AbstractErrorCode.h.


The documentation for this class was generated from the following files:
bad
@ bad
Definition: SUSYToolsTester.cxx:100
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
AbstractErrorCode::setBit
void setBit(unsigned int number, bool value)
Definition: AbstractErrorCode.cxx:15
AbstractErrorCode::errorCode
unsigned int errorCode() const
Definition: AbstractErrorCode.h:21
ChanDeadErrorCode::BadMcmBit
@ BadMcmBit
Definition: ChanDeadErrorCode.h:37
ChanDeadErrorCode::MiddleCellsMaskedBit
@ MiddleCellsMaskedBit
Definition: ChanDeadErrorCode.h:50
ChanDeadErrorCode::BackCellsMaskedBit
@ BackCellsMaskedBit
Definition: ChanDeadErrorCode.h:51
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ChanDeadErrorCode::BadLvdsBit
@ BadLvdsBit
Definition: ChanDeadErrorCode.h:28
athena.value
value
Definition: athena.py:124
AbstractErrorCode::AbstractErrorCode
AbstractErrorCode(unsigned int errorCode)
Definition: AbstractErrorCode.h:24
AbstractErrorCode::m_errorCode
unsigned int m_errorCode
Definition: AbstractErrorCode.h:32
histSizes.code
code
Definition: histSizes.py:129
ChanDeadErrorCode::PSCellsMaskedBit
@ PSCellsMaskedBit
Definition: ChanDeadErrorCode.h:48
AbstractErrorCode::bitIsSet
bool bitIsSet(unsigned int number) const
Definition: AbstractErrorCode.cxx:7
ChanDeadErrorCode::BadAdcBit
@ BadAdcBit
Definition: ChanDeadErrorCode.h:36
merge.output
output
Definition: merge.py:17
ChanDeadErrorCode::FrontEndDeadBit
@ FrontEndDeadBit
Definition: ChanDeadErrorCode.h:40
ChanDeadErrorCode::HighVoltsOffBit
@ HighVoltsOffBit
Definition: ChanDeadErrorCode.h:42
python.selection.number
number
Definition: selection.py:20
ChanDeadErrorCode::NoisyTowerBit
@ NoisyTowerBit
Definition: ChanDeadErrorCode.h:44
ChanDeadErrorCode::FrontCellsMaskedBit
@ FrontCellsMaskedBit
Definition: ChanDeadErrorCode.h:49
ChanDeadErrorCode::LowVoltsOffBit
@ LowVoltsOffBit
Definition: ChanDeadErrorCode.h:43
ChanDeadErrorCode::ReceiverDeadBit
@ ReceiverDeadBit
Definition: ChanDeadErrorCode.h:41
merge.status
status
Definition: merge.py:17