ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
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.

12  : AbstractErrorCode(0) {
13 }

◆ FineTimeErrorCode() [2/3]

FineTimeErrorCode::FineTimeErrorCode ( unsigned int  errorCode)

Definition at line 15 of file FineTimeErrorCode.cxx.

16 }

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

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

Member Function Documentation

◆ badAdc()

void FineTimeErrorCode::badAdc ( bool  bad)
inline

Definition at line 45 of file FineTimeErrorCode.h.

◆ badCalib()

bool FineTimeErrorCode::badCalib ( ) const
inline

Definition at line 44 of file FineTimeErrorCode.h.

44 { return bitIsSet(BadCalibBit); }

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

42 { setBit(BadRefBit,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 }

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

26 {m_errorCode = code;}

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

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

Friends And Related Function Documentation

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

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:
FineTimeErrorCode::RefSetByHand
@ RefSetByHand
Definition: FineTimeErrorCode.h:29
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
FineTimeErrorCode::BadCalibBit
@ BadCalibBit
Definition: FineTimeErrorCode.h:28
FineTimeErrorCode::BadRefBit
@ BadRefBit
Definition: FineTimeErrorCode.h:27
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
FineTimeErrorCode::CalibSetByHand
@ CalibSetByHand
Definition: FineTimeErrorCode.h:30
histSizes.code
code
Definition: histSizes.py:129
AbstractErrorCode::bitIsSet
bool bitIsSet(unsigned int number) const
Definition: AbstractErrorCode.cxx:7
merge.output
output
Definition: merge.py:17
python.selection.number
number
Definition: selection.py:20
merge.status
status
Definition: merge.py:17