ATLAS Offline Software
ChanCalibErrorCode.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iomanip>
8 #include <iostream>
9 #include <sstream>
10 
11 
13 }
14 
15 ChanCalibErrorCode::ChanCalibErrorCode(unsigned int errorCode): AbstractErrorCode(errorCode) {
16 }
17 
19 }
20 
22 {
23  this->errorCode(e.errorCode());
24  return *this;
25 }
26 
28 {
29  this->errorCode( this->errorCode() | e.errorCode() );
30  return *this;
31 }
32 
33 
34 unsigned int ChanCalibErrorCode::errorCode(ChanErrorComponent component) const {
35  return (this->errorCode() >> (16 + 4 * component)) & 0xf;
36 }
37 
38 
39 //********************************************************************
40 // getChanValid
41 //********************************************************************
47  return ( (this->errorCode() & 0xf) == 0);
48 }
49 
50 //********************************************************************
51 // getChanValid
52 //********************************************************************
58  return ( this->errorCode(component) == 0);
59 }
60 
61 
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 }
95 
96 std::ostream& operator<<(std::ostream& output, const ChanCalibErrorCode& r) {
97  output << r.errorCode();
98  return output;
99 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
ChanCalibErrorCode::dacScanBadOffset
bool dacScanBadOffset() const
Definition: ChanCalibErrorCode.h:120
AbstractErrorCode::errorCode
unsigned int errorCode() const
Definition: AbstractErrorCode.h:21
ChanCalibErrorCode::operator=
ChanCalibErrorCode & operator=(const ChanCalibErrorCode &e)
Definition: ChanCalibErrorCode.cxx:21
ChanCalibErrorCode::pedRunBadMean
bool pedRunBadMean() const
Definition: ChanCalibErrorCode.h:129
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
ChanCalibErrorCode::ChanErrorSet
ChanErrorSet
Definition: ChanCalibErrorCode.h:87
ChanCalibErrorCode::chanValid
bool chanValid() const
Checks if channel is valid, ie.
Definition: ChanCalibErrorCode.cxx:46
ChanCalibErrorCode
ChanCalibErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanE...
Definition: ChanCalibErrorCode.h:20
operator<<
std::ostream & operator<<(std::ostream &output, const ChanCalibErrorCode &r)
Definition: ChanCalibErrorCode.cxx:96
ChanCalibErrorCode::distToErrorRegionUndercut
bool distToErrorRegionUndercut() const
Definition: ChanCalibErrorCode.h:162
ChanCalibErrorCode::totalWindowSizeUndercut
bool totalWindowSizeUndercut() const
Definition: ChanCalibErrorCode.h:159
ChanCalibErrorCode::ChanCalibErrorCode
ChanCalibErrorCode()
Definition: ChanCalibErrorCode.cxx:12
ChanCalibErrorCode::pedRunBadSigma
bool pedRunBadSigma() const
Definition: ChanCalibErrorCode.h:132
ChanCalibErrorCode::badResult
bool badResult() const
Definition: ChanCalibErrorCode.h:114
ChanCalibErrorCode::dacScanBadCorrCoeff
bool dacScanBadCorrCoeff() const
Definition: ChanCalibErrorCode.h:123
ChanCalibErrorCode::exceededDelay
bool exceededDelay() const
Definition: ChanCalibErrorCode.h:165
ChanCalibErrorCode::CMM
@ CMM
Definition: ChanCalibErrorCode.h:91
AbstractErrorCode::bitIsSet
bool bitIsSet(unsigned int number) const
Definition: AbstractErrorCode.cxx:7
ChanCalibErrorCode::errorCode
unsigned int errorCode(ChanErrorComponent component) const
Definition: ChanCalibErrorCode.cxx:34
ChanCalibErrorCode::printStatus
std::string printStatus(ChanErrorSet spec) const
Definition: ChanCalibErrorCode.cxx:62
ChanCalibErrorCode::PPM
@ PPM
Definition: ChanCalibErrorCode.h:88
merge.output
output
Definition: merge.py:17
ChanCalibErrorCode::CPM
@ CPM
Definition: ChanCalibErrorCode.h:89
ChanCalibErrorCode::noData
bool noData() const
Definition: ChanCalibErrorCode.h:108
ChanCalibErrorCode::pedRunBadAdcDistrib
bool pedRunBadAdcDistrib() const
Definition: ChanCalibErrorCode.h:135
ChanCalibErrorCode::operator|=
ChanCalibErrorCode & operator|=(const ChanCalibErrorCode &e)
Definition: ChanCalibErrorCode.cxx:27
ChanCalibErrorCode::ChanErrorComponent
ChanErrorComponent
Definition: ChanCalibErrorCode.h:72
ChanCalibErrorCode::dacScanBadSlope
bool dacScanBadSlope() const
Definition: ChanCalibErrorCode.h:117
AbstractErrorCode
AbstractErrorCode abstract base class for L1Calo error codes.
Definition: AbstractErrorCode.h:16
merge.status
status
Definition: merge.py:17
ChanCalibErrorCode::exceededDelayAfterCorr
bool exceededDelayAfterCorr() const
Definition: ChanCalibErrorCode.h:168
ChanCalibErrorCode.h
ChanCalibErrorCode::badData
bool badData() const
Definition: ChanCalibErrorCode.h:111
ChanCalibErrorCode::JEM
@ JEM
Definition: ChanCalibErrorCode.h:90
ChanCalibErrorCode::dacScanBadAdcDistrib
bool dacScanBadAdcDistrib() const
Definition: ChanCalibErrorCode.h:126