ATLAS Offline Software
Loading...
Searching...
No Matches
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:
44 NoisyTowerBit = 8,
45
46 // Calorimeter flags:
47 // (for Tile, can use A=Front, B/C=Middle, D=Back)
52 };

Constructor & Destructor Documentation

◆ ChanDeadErrorCode() [1/3]

ChanDeadErrorCode::ChanDeadErrorCode ( )

Definition at line 12 of file ChanDeadErrorCode.cxx.

13}
AbstractErrorCode(unsigned int errorCode)

◆ ChanDeadErrorCode() [2/3]

ChanDeadErrorCode::ChanDeadErrorCode ( unsigned int errorCode)

Definition at line 15 of file ChanDeadErrorCode.cxx.

16}
unsigned int errorCode() const

◆ ~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.

Member Function Documentation

◆ backCellsMasked() [1/2]

bool ChanDeadErrorCode::backCellsMasked ( ) const
inline

Definition at line 97 of file ChanDeadErrorCode.h.

bool bitIsSet(unsigned int number) const

◆ backCellsMasked() [2/2]

void ChanDeadErrorCode::backCellsMasked ( bool bad)
inline

Definition at line 98 of file ChanDeadErrorCode.h.

void setBit(unsigned int number, bool value)

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

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

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

◆ 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}
unsigned int m_errorCode
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186

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

◆ frontCellsMasked() [1/2]

bool ChanDeadErrorCode::frontCellsMasked ( ) const
inline

Definition at line 91 of file ChanDeadErrorCode.h.

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

◆ 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}
status
Definition merge.py:16

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

◆ 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}
int r
Definition globals.cxx:22
output
Definition merge.py:16

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: