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

FineTimeErrorCode class for L1Calo error codes. More...

#include <FineTimeErrorCode.h>

Inheritance diagram for FineTimeErrorCode:
Collaboration diagram for FineTimeErrorCode:

Public Types

enum  FineTimeBits { BadRefBit = 0 , BadCalibBit = 1 , RefSetByHand = 2 , CalibSetByHand = 3 }

Public Member Functions

 FineTimeErrorCode ()
 FineTimeErrorCode (unsigned int errorCode)
virtual ~FineTimeErrorCode ()
 FineTimeErrorCode (const FineTimeErrorCode &e)
FineTimeErrorCodeoperator= (const FineTimeErrorCode &e)
FineTimeErrorCodeoperator|= (const FineTimeErrorCode &e)
bool badRefValue () const
void badRefValue (bool bad)
bool badCalib () const
void badAdc (bool bad)
bool isRefSetByHand () const
void refIsSetByHand (bool bad)
bool isCalibSetByHand () const
void calibIsSetByHand (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 FineTimeErrorCode &r)

Detailed Description

FineTimeErrorCode class for L1Calo error codes.

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

Definition at line 19 of file FineTimeErrorCode.h.

Member Enumeration Documentation

◆ FineTimeBits

Enumerator
BadRefBit 
BadCalibBit 
RefSetByHand 
CalibSetByHand 

Definition at line 25 of file FineTimeErrorCode.h.

25 {
26
27 BadRefBit = 0, //set if reference value couldn't be retrieved
28 BadCalibBit = 1, //set if calib value couldn't be retrieved
29 RefSetByHand = 2, //set if the reference value is set by hand
30 CalibSetByHand = 3 //set if the calibration value is set by hand
31 };

Constructor & Destructor Documentation

◆ FineTimeErrorCode() [1/3]

FineTimeErrorCode::FineTimeErrorCode ( )

Definition at line 12 of file FineTimeErrorCode.cxx.

13}
AbstractErrorCode(unsigned int errorCode)

◆ FineTimeErrorCode() [2/3]

FineTimeErrorCode::FineTimeErrorCode ( unsigned int errorCode)

Definition at line 15 of file FineTimeErrorCode.cxx.

16}
unsigned int errorCode() const

◆ ~FineTimeErrorCode()

virtual FineTimeErrorCode::~FineTimeErrorCode ( )
inlinevirtual

Definition at line 35 of file FineTimeErrorCode.h.

35{}

◆ FineTimeErrorCode() [3/3]

FineTimeErrorCode::FineTimeErrorCode ( const FineTimeErrorCode & e)

Definition at line 18 of file FineTimeErrorCode.cxx.

Member Function Documentation

◆ badAdc()

void FineTimeErrorCode::badAdc ( bool bad)
inline

Definition at line 45 of file FineTimeErrorCode.h.

void setBit(unsigned int number, bool value)

◆ badCalib()

bool FineTimeErrorCode::badCalib ( ) const
inline

Definition at line 44 of file FineTimeErrorCode.h.

44{ return bitIsSet(BadCalibBit); }
bool bitIsSet(unsigned int number) const

◆ badRefValue() [1/2]

bool FineTimeErrorCode::badRefValue ( ) const
inline

Definition at line 41 of file FineTimeErrorCode.h.

41{ return bitIsSet(BadRefBit); }

◆ badRefValue() [2/2]

void FineTimeErrorCode::badRefValue ( bool bad)
inline

Definition at line 42 of file FineTimeErrorCode.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

◆ calibIsSetByHand()

void FineTimeErrorCode::calibIsSetByHand ( bool bad)
inline

Definition at line 51 of file FineTimeErrorCode.h.

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

◆ isCalibSetByHand()

bool FineTimeErrorCode::isCalibSetByHand ( ) const
inline

Definition at line 50 of file FineTimeErrorCode.h.

50{ return bitIsSet(CalibSetByHand); }

◆ isRefSetByHand()

bool FineTimeErrorCode::isRefSetByHand ( ) const
inline

Definition at line 47 of file FineTimeErrorCode.h.

47{ return bitIsSet(RefSetByHand); }

◆ operator=()

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

Definition at line 21 of file FineTimeErrorCode.cxx.

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

◆ operator|=()

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

Definition at line 27 of file FineTimeErrorCode.cxx.

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

◆ printStatus()

std::string FineTimeErrorCode::printStatus ( ) const

Definition at line 33 of file FineTimeErrorCode.cxx.

33 {
34
35 std::stringstream status;
36
37 status << "ErrorCode: " << this->errorCode() << std::endl;
38
39 status << "Bit " << std::setw(2) << BadRefBit
40 << ": BadRefBit: "
41 << bitIsSet(BadRefBit) << std::endl;
42
43 status << "Bit " << std::setw(2) << BadCalibBit
44 << ": BadCalibBit: "
45 << bitIsSet(BadCalibBit) << std::endl;
46
47 status << "Bit " << std::setw(2) << RefSetByHand
48 << ": RefSetByHand: "
49 << bitIsSet(RefSetByHand) << std::endl;
50 status << "Bit " << std::setw(2) << CalibSetByHand
51 << ": CalibSetByHand: "
52 << bitIsSet(CalibSetByHand) << std::endl;
53
54 return status.str();
55}
status
Definition merge.py:16

◆ refIsSetByHand()

void FineTimeErrorCode::refIsSetByHand ( bool bad)
inline

Definition at line 48 of file FineTimeErrorCode.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 FineTimeErrorCode & r )
friend

Definition at line 58 of file FineTimeErrorCode.cxx.

58 {
59 output << r.errorCode();
60 return output;
61}
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: