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

ChanCalibErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanErrorCode.h. More...

#include <ChanCalibErrorCode.h>

Inheritance diagram for ChanCalibErrorCode:
Collaboration diagram for ChanCalibErrorCode:

Public Types

enum  ChanErrorCodeBits {
  NoDataBit =0 , BadDataBit =1 , BadResultBit =2 , DacScanBadSlopeBit =4 ,
  DacScanBadOffsetBit =5 , DacScanBadCorrCoeffBit =6 , DacScanBadAdcDistribBit =7 , PedRunBadMeanBit =4 ,
  PedRunBadSigmaBit =5 , PedRunBadAdcDistribBit =6 , Phos4ScanNoSignalBit =4 , Phos4ScanBadSignalBit =5 ,
  Phos4ScanBadWidthBit =6 , Phos4ScanBadRiseTimeBit =7 , Phos4ScanBadAdcDistribBit =8 , Phos4ScanBadSignalShapeBit =9 ,
  Phos4ScanSignalSaturatedBit =10 , TotalWindowSizeUndercutBit =5 , DistToErrorRegionUndercutBit =6 , ExceededDelayBit =7 ,
  ExceededDelayAfterCorrBit =8
}
enum  ChanErrorComponent {
  DacScan =0 , PedestalRun =1 , CoarseTiming =2 , Phos4Scan =3 ,
  SatBcidValues =4 , FirFilterValues =5 , LutValues =6
}
enum  ChanErrorSet { PPM =0 , CPM =1 , JEM =2 , CMM =3 }

Public Member Functions

 ChanCalibErrorCode ()
 ChanCalibErrorCode (unsigned int errorCode)
virtual ~ChanCalibErrorCode ()
 ChanCalibErrorCode (const ChanCalibErrorCode &e)
ChanCalibErrorCodeoperator= (const ChanCalibErrorCode &e)
ChanCalibErrorCodeoperator|= (const ChanCalibErrorCode &e)
unsigned int errorCode (ChanErrorComponent component) const
bool chanValid () const
 Checks if channel is valid, ie.
bool chanValid (ChanErrorComponent component) const
 Checks if the component specific part is valid.
bool noData () const
void noData (bool nodata)
bool badData () const
void badData (bool bad)
bool badResult () const
void badResult (bool bad)
bool dacScanBadSlope () const
void dacScanBadSlope (bool bad)
bool dacScanBadOffset () const
void dacScanBadOffset (bool bad)
bool dacScanBadCorrCoeff () const
void dacScanBadCorrCoeff (bool bad)
bool dacScanBadAdcDistrib () const
void dacScanBadAdcDistrib (bool bad)
bool pedRunBadMean () const
void pedRunBadMean (bool bad)
bool pedRunBadSigma () const
void pedRunBadSigma (bool bad)
bool pedRunBadAdcDistrib () const
void pedRunBadAdcDistrib (bool bad)
bool phos4ScanNoSignal () const
void phos4ScanNoSignal (bool bad)
bool phos4ScanBadSignal () const
void phos4ScanBadSignal (bool bad)
bool phos4ScanBadWidth () const
void phos4ScanBadWidth (bool bad)
bool phos4ScanBadRiseTime () const
void phos4ScanBadRiseTime (bool bad)
bool phos4ScanBadAdcDistrib () const
void phos4ScanBadAdcDistrib (bool bad)
bool phos4ScanBadSignalShape () const
void phos4ScanBadSignalShape (bool bad)
bool phos4ScanSignalSaturated () const
void phos4ScanSignalSaturated (bool bad)
bool totalWindowSizeUndercut () const
void totalWindowSizeUndercut (bool undercut)
bool distToErrorRegionUndercut () const
void distToErrorRegionUndercut (bool undercut)
bool exceededDelay () const
void exceededDelay (bool exceeded)
bool exceededDelayAfterCorr () const
void exceededDelayAfterCorr (bool exceeded)
std::string printStatus (ChanErrorSet spec) const
unsigned int errorCode () const
void errorCode (unsigned int code)

Protected Member Functions

void setBad ()
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 ChanCalibErrorCode &r)

Detailed Description

ChanCalibErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanErrorCode.h.

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

Definition at line 20 of file ChanCalibErrorCode.h.

Member Enumeration Documentation

◆ ChanErrorCodeBits

Enumerator
NoDataBit 
BadDataBit 
BadResultBit 
DacScanBadSlopeBit 
DacScanBadOffsetBit 
DacScanBadCorrCoeffBit 
DacScanBadAdcDistribBit 
PedRunBadMeanBit 
PedRunBadSigmaBit 
PedRunBadAdcDistribBit 
Phos4ScanNoSignalBit 
Phos4ScanBadSignalBit 
Phos4ScanBadWidthBit 
Phos4ScanBadRiseTimeBit 
Phos4ScanBadAdcDistribBit 
Phos4ScanBadSignalShapeBit 
Phos4ScanSignalSaturatedBit 
TotalWindowSizeUndercutBit 
DistToErrorRegionUndercutBit 
ExceededDelayBit 
ExceededDelayAfterCorrBit 

Definition at line 26 of file ChanCalibErrorCode.h.

26 {
27 // Bits 0-3 common for all calibrations
28 NoDataBit=0,
29 BadDataBit=1,
31
32 // Specific bits (4-15) for PPM calibrations
33
34 // PPM DAC scan
39
40 // PPM pedestal run
44
45 // PPM PHOS4 Scan
53
54
55 // Specific bits (4-15) for CPM calibrations
56 // (none defined yet)
57
58 // Specific bits (4-15) for JEM calibrations
63
64 // Specific bits (4-15) for CMM calibrations
65 // (none defined yet)
66
67 // Bits 16-31 are used as copies of 0-3
68 // for component calibrations when combined
69 // several results into one validated folder.
70 };

◆ ChanErrorComponent

Enumerator
DacScan 
PedestalRun 
CoarseTiming 
Phos4Scan 
SatBcidValues 
FirFilterValues 
LutValues 

Definition at line 72 of file ChanCalibErrorCode.h.

72 {
73 // NB the maximum allowed value here is 7.
74 // Components of PPrChanCalib folder.
75 DacScan=0,
78 Phos4Scan=3,
81 LutValues=6
82 };

◆ ChanErrorSet

Enumerator
PPM 
CPM 
JEM 
CMM 

Definition at line 87 of file ChanCalibErrorCode.h.

Constructor & Destructor Documentation

◆ ChanCalibErrorCode() [1/3]

ChanCalibErrorCode::ChanCalibErrorCode ( )

Definition at line 12 of file ChanCalibErrorCode.cxx.

13}
AbstractErrorCode(unsigned int errorCode)

◆ ChanCalibErrorCode() [2/3]

ChanCalibErrorCode::ChanCalibErrorCode ( unsigned int errorCode)

Definition at line 15 of file ChanCalibErrorCode.cxx.

16}
unsigned int errorCode(ChanErrorComponent component) const

◆ ~ChanCalibErrorCode()

virtual ChanCalibErrorCode::~ChanCalibErrorCode ( )
inlinevirtual

Definition at line 96 of file ChanCalibErrorCode.h.

96{}

◆ ChanCalibErrorCode() [3/3]

ChanCalibErrorCode::ChanCalibErrorCode ( const ChanCalibErrorCode & e)

Definition at line 18 of file ChanCalibErrorCode.cxx.

Member Function Documentation

◆ badData() [1/2]

bool ChanCalibErrorCode::badData ( ) const
inline

Definition at line 111 of file ChanCalibErrorCode.h.

111{ return bitIsSet(BadDataBit); }
bool bitIsSet(unsigned int number) const

◆ badData() [2/2]

void ChanCalibErrorCode::badData ( bool bad)
inline

Definition at line 112 of file ChanCalibErrorCode.h.

void setBit(unsigned int number, bool value)

◆ badResult() [1/2]

bool ChanCalibErrorCode::badResult ( ) const
inline

Definition at line 114 of file ChanCalibErrorCode.h.

114{ return bitIsSet(BadResultBit); }

◆ badResult() [2/2]

void ChanCalibErrorCode::badResult ( bool bad)
inline

Definition at line 115 of file ChanCalibErrorCode.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() [1/2]

bool ChanCalibErrorCode::chanValid ( ) const

Checks if channel is valid, ie.

none of the lowest four bits set.

Definition at line 46 of file ChanCalibErrorCode.cxx.

46 {
47 return ( (this->errorCode() & 0xf) == 0);
48}
unsigned int errorCode() const

◆ chanValid() [2/2]

bool ChanCalibErrorCode::chanValid ( ChanErrorComponent component) const

Checks if the component specific part is valid.

Definition at line 57 of file ChanCalibErrorCode.cxx.

57 {
58 return ( this->errorCode(component) == 0);
59}

◆ dacScanBadAdcDistrib() [1/2]

bool ChanCalibErrorCode::dacScanBadAdcDistrib ( ) const
inline

Definition at line 126 of file ChanCalibErrorCode.h.

◆ dacScanBadAdcDistrib() [2/2]

void ChanCalibErrorCode::dacScanBadAdcDistrib ( bool bad)
inline

Definition at line 127 of file ChanCalibErrorCode.h.

◆ dacScanBadCorrCoeff() [1/2]

bool ChanCalibErrorCode::dacScanBadCorrCoeff ( ) const
inline

Definition at line 123 of file ChanCalibErrorCode.h.

◆ dacScanBadCorrCoeff() [2/2]

void ChanCalibErrorCode::dacScanBadCorrCoeff ( bool bad)
inline

Definition at line 124 of file ChanCalibErrorCode.h.

◆ dacScanBadOffset() [1/2]

bool ChanCalibErrorCode::dacScanBadOffset ( ) const
inline

Definition at line 120 of file ChanCalibErrorCode.h.

120{ return bitIsSet(DacScanBadOffsetBit); }

◆ dacScanBadOffset() [2/2]

void ChanCalibErrorCode::dacScanBadOffset ( bool bad)
inline

Definition at line 121 of file ChanCalibErrorCode.h.

◆ dacScanBadSlope() [1/2]

bool ChanCalibErrorCode::dacScanBadSlope ( ) const
inline

Definition at line 117 of file ChanCalibErrorCode.h.

117{ return bitIsSet(DacScanBadSlopeBit); }

◆ dacScanBadSlope() [2/2]

void ChanCalibErrorCode::dacScanBadSlope ( bool bad)
inline

Definition at line 118 of file ChanCalibErrorCode.h.

◆ distToErrorRegionUndercut() [1/2]

bool ChanCalibErrorCode::distToErrorRegionUndercut ( ) const
inline

Definition at line 162 of file ChanCalibErrorCode.h.

◆ distToErrorRegionUndercut() [2/2]

void ChanCalibErrorCode::distToErrorRegionUndercut ( bool undercut)
inline

Definition at line 163 of file ChanCalibErrorCode.h.

◆ errorCode() [1/3]

unsigned int AbstractErrorCode::errorCode ( ) const
inline

Definition at line 21 of file AbstractErrorCode.h.

21{return m_errorCode;}

◆ errorCode() [2/3]

unsigned int ChanCalibErrorCode::errorCode ( ChanErrorComponent component) const

Definition at line 34 of file ChanCalibErrorCode.cxx.

34 {
35 return (this->errorCode() >> (16 + 4 * component)) & 0xf;
36}

◆ errorCode() [3/3]

void AbstractErrorCode::errorCode ( unsigned int code)
inline

Definition at line 26 of file AbstractErrorCode.h.

◆ exceededDelay() [1/2]

bool ChanCalibErrorCode::exceededDelay ( ) const
inline

Definition at line 165 of file ChanCalibErrorCode.h.

165{ return bitIsSet(ExceededDelayBit); }

◆ exceededDelay() [2/2]

void ChanCalibErrorCode::exceededDelay ( bool exceeded)
inline

Definition at line 166 of file ChanCalibErrorCode.h.

166{ setBit(ExceededDelayBit,exceeded); setBad(); }

◆ exceededDelayAfterCorr() [1/2]

bool ChanCalibErrorCode::exceededDelayAfterCorr ( ) const
inline

Definition at line 168 of file ChanCalibErrorCode.h.

◆ exceededDelayAfterCorr() [2/2]

void ChanCalibErrorCode::exceededDelayAfterCorr ( bool exceeded)
inline

Definition at line 169 of file ChanCalibErrorCode.h.

◆ noData() [1/2]

bool ChanCalibErrorCode::noData ( ) const
inline

Definition at line 108 of file ChanCalibErrorCode.h.

108{ return bitIsSet(NoDataBit); }

◆ noData() [2/2]

void ChanCalibErrorCode::noData ( bool nodata)
inline

Definition at line 109 of file ChanCalibErrorCode.h.

109{ setBit(NoDataBit,nodata); }

◆ operator=()

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

Definition at line 21 of file ChanCalibErrorCode.cxx.

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

◆ operator|=()

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

Definition at line 27 of file ChanCalibErrorCode.cxx.

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

◆ pedRunBadAdcDistrib() [1/2]

bool ChanCalibErrorCode::pedRunBadAdcDistrib ( ) const
inline

Definition at line 135 of file ChanCalibErrorCode.h.

◆ pedRunBadAdcDistrib() [2/2]

void ChanCalibErrorCode::pedRunBadAdcDistrib ( bool bad)
inline

Definition at line 136 of file ChanCalibErrorCode.h.

◆ pedRunBadMean() [1/2]

bool ChanCalibErrorCode::pedRunBadMean ( ) const
inline

Definition at line 129 of file ChanCalibErrorCode.h.

129{ return bitIsSet(PedRunBadMeanBit); }

◆ pedRunBadMean() [2/2]

void ChanCalibErrorCode::pedRunBadMean ( bool bad)
inline

Definition at line 130 of file ChanCalibErrorCode.h.

◆ pedRunBadSigma() [1/2]

bool ChanCalibErrorCode::pedRunBadSigma ( ) const
inline

Definition at line 132 of file ChanCalibErrorCode.h.

132{ return bitIsSet(PedRunBadSigmaBit); }

◆ pedRunBadSigma() [2/2]

void ChanCalibErrorCode::pedRunBadSigma ( bool bad)
inline

Definition at line 133 of file ChanCalibErrorCode.h.

◆ phos4ScanBadAdcDistrib() [1/2]

bool ChanCalibErrorCode::phos4ScanBadAdcDistrib ( ) const
inline

Definition at line 150 of file ChanCalibErrorCode.h.

◆ phos4ScanBadAdcDistrib() [2/2]

void ChanCalibErrorCode::phos4ScanBadAdcDistrib ( bool bad)
inline

Definition at line 151 of file ChanCalibErrorCode.h.

◆ phos4ScanBadRiseTime() [1/2]

bool ChanCalibErrorCode::phos4ScanBadRiseTime ( ) const
inline

Definition at line 147 of file ChanCalibErrorCode.h.

◆ phos4ScanBadRiseTime() [2/2]

void ChanCalibErrorCode::phos4ScanBadRiseTime ( bool bad)
inline

Definition at line 148 of file ChanCalibErrorCode.h.

◆ phos4ScanBadSignal() [1/2]

bool ChanCalibErrorCode::phos4ScanBadSignal ( ) const
inline

Definition at line 141 of file ChanCalibErrorCode.h.

◆ phos4ScanBadSignal() [2/2]

void ChanCalibErrorCode::phos4ScanBadSignal ( bool bad)
inline

Definition at line 142 of file ChanCalibErrorCode.h.

◆ phos4ScanBadSignalShape() [1/2]

bool ChanCalibErrorCode::phos4ScanBadSignalShape ( ) const
inline

Definition at line 153 of file ChanCalibErrorCode.h.

◆ phos4ScanBadSignalShape() [2/2]

void ChanCalibErrorCode::phos4ScanBadSignalShape ( bool bad)
inline

Definition at line 154 of file ChanCalibErrorCode.h.

◆ phos4ScanBadWidth() [1/2]

bool ChanCalibErrorCode::phos4ScanBadWidth ( ) const
inline

Definition at line 144 of file ChanCalibErrorCode.h.

◆ phos4ScanBadWidth() [2/2]

void ChanCalibErrorCode::phos4ScanBadWidth ( bool bad)
inline

Definition at line 145 of file ChanCalibErrorCode.h.

◆ phos4ScanNoSignal() [1/2]

bool ChanCalibErrorCode::phos4ScanNoSignal ( ) const
inline

Definition at line 138 of file ChanCalibErrorCode.h.

◆ phos4ScanNoSignal() [2/2]

void ChanCalibErrorCode::phos4ScanNoSignal ( bool bad)
inline

Definition at line 139 of file ChanCalibErrorCode.h.

◆ phos4ScanSignalSaturated() [1/2]

bool ChanCalibErrorCode::phos4ScanSignalSaturated ( ) const
inline

Definition at line 156 of file ChanCalibErrorCode.h.

◆ phos4ScanSignalSaturated() [2/2]

void ChanCalibErrorCode::phos4ScanSignalSaturated ( bool bad)
inline

Definition at line 157 of file ChanCalibErrorCode.h.

◆ printStatus()

std::string ChanCalibErrorCode::printStatus ( ChanErrorSet spec) const

Definition at line 62 of file ChanCalibErrorCode.cxx.

62 {
63
64 std::stringstream status;
65
66 status << "ErrorCode: " << this->errorCode() << std::endl
67 << "Bit 0: NoDataBit: " << noData() << std::endl
68 << "Bit 1: BadDataBit: " << badData() << std::endl
69 << "Bit 2: BadResultBit: " << badResult() << std::endl
70 << "Bit 3: Not defined: " << bitIsSet(4) << std::endl;
71 if (spec == PPM) {
72 status << "Bit 4: DacScanBadSlopeBit: " << dacScanBadSlope() << std::endl
73 << "Bit 5: DacScanBadOffsetBit: " << dacScanBadOffset() << std::endl
74 << "Bit 6: DacScanBadCorrCoeffBit: " << dacScanBadCorrCoeff() << std::endl
75 << "Bit 7: DacScanBadAdcDistribBit: " << dacScanBadAdcDistrib() << std::endl
76
77 << "Bit 9: PedRunBadMeanBit: " << pedRunBadMean() << std::endl
78 << "Bit 10: PedRunBadSigmaBit: " << pedRunBadSigma() << std::endl
79 << "Bit 11: PedRunBadAdcDistrib: " << pedRunBadAdcDistrib() << std::endl;
80
81 }
82 else if (spec == CPM) {
83 }
84 else if (spec == JEM) {
85 status << "Bit 5: TotalWindowSizeUndercutBit: " << totalWindowSizeUndercut() << std::endl
86 << "Bit 6: DistToErrorRegionUndercutBit: " << distToErrorRegionUndercut() << std::endl
87 << "Bit 7: ExceededDelayBit: " << exceededDelay() << std::endl
88 << "Bit 8: ExceededDelayAfterCorrBit: " << exceededDelayAfterCorr() << std::endl;
89 }
90 else if (spec == CMM) {
91 }
92
93 return status.str();
94}
bool dacScanBadCorrCoeff() const
bool dacScanBadAdcDistrib() const
bool totalWindowSizeUndercut() const
bool dacScanBadOffset() const
bool distToErrorRegionUndercut() const
bool pedRunBadAdcDistrib() const
bool exceededDelayAfterCorr() const
status
Definition merge.py:16

◆ setBad()

void ChanCalibErrorCode::setBad ( )
inlineprotected

Definition at line 174 of file ChanCalibErrorCode.h.

174{ setBit(BadDataBit,true); }

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

◆ totalWindowSizeUndercut() [1/2]

bool ChanCalibErrorCode::totalWindowSizeUndercut ( ) const
inline

Definition at line 159 of file ChanCalibErrorCode.h.

◆ totalWindowSizeUndercut() [2/2]

void ChanCalibErrorCode::totalWindowSizeUndercut ( bool undercut)
inline

Definition at line 160 of file ChanCalibErrorCode.h.

◆ operator<<

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

Definition at line 96 of file ChanCalibErrorCode.cxx.

96 {
97 output << r.errorCode();
98 return output;
99}
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: