1 #ifndef CSCDCCExaminer_h 2 #define CSCDCCExaminer_h 34 std::map<DDUIdType, ExaminerStatusType>
bDDU_ERR;
35 std::map<DDUIdType, ExaminerStatusType>
bDDU_WRN;
38 class OStream :
public std::ostream {
40 class buffer :
public std::streambuf {};
42 std::streambuf* stream;
47 void show(
void) { rdbuf(stream); }
48 void hide(
void) { rdbuf(null); }
50 void sign(
const char* nm) { name = nm; }
52 void redirect(std::ostream&
str) {
61 return (*(std::ostream*)
this) << name <<
val;
64 OStream(
void) : std::ostream(
std::cout.rdbuf()), buff(), stream(
std::cout.rdbuf()), null(&buff),
name(
"") {}
65 OStream(std::ostream& str) : std::ostream(str.rdbuf()), buff(), stream(str.rdbuf()), null(&buff),
name(
"") {}
110 inline int scanbuf(
const uint16_t*& buf, int32_t length, uint16_t sig, uint16_t mask = 0xFFFF);
151 std::map<DDUIdType, std::map<CSCIdType, const uint16_t*> >
dmbBuffers;
153 std::map<DDUIdType, std::map<CSCIdType, uint32_t> >
dmbOffsets;
155 std::map<DDUIdType, std::map<CSCIdType, uint32_t> >
dmbSize;
161 OStream&
output2(
void) {
return CERR; }
164 int32_t
check(
const uint16_t*&
buffer, int32_t length);
173 if (num >= 0 && num < nERRORS)
179 if (num >= 0 && num < nWARNINGS)
180 return sWARNING[
num];
186 if (num >= 0 && num < nERRORS)
192 if (num >= 0 && num < nWARNINGS)
193 return sWARNING_[
num];
199 if (num >= 0 && num < nPAYLOADS)
200 return sDMBExpectedPayload[
num];
205 if (num >= 0 && num < nSTATUSES)
206 return sDMBEventStaus[
num];
212 if (num >= 0 && num < nERRORS)
213 return fSUM_ERROR[
num];
218 if (num >= 0 && num < nWARNINGS)
219 return fSUM_WARNING[
num];
225 if (num >= 0 && num < nERRORS)
226 return fCHAMB_ERR[
num];
228 return std::set<int>();
231 if (num >= 0 && num < nWARNINGS)
232 return fCHAMB_WRN[
num];
234 return std::set<int>();
238 std::map<CSCIdType, ExaminerStatusType>::const_iterator
item = bCHAMB_PAYLOAD.find(chamber);
239 if (item != bCHAMB_PAYLOAD.end())
246 std::map<CSCIdType, ExaminerStatusType>::const_iterator
item = bCHAMB_STATUS.find(chamber);
247 if (item != bCHAMB_STATUS.end())
254 std::map<CSCIdType, ExaminerStatusType>::const_iterator
item = bCHAMB_ERR.find(chamber);
260 item = bCHAMB_ERR.find(chamber);
261 if (item != bCHAMB_ERR.end())
268 std::map<CSCIdType, ExaminerStatusType>::const_iterator
item = bCHAMB_WRN.find(chamber);
269 if (item != bCHAMB_WRN.end())
276 std::map<DDUIdType, ExaminerStatusType>::const_iterator
item = bDDU_ERR.find(dduSourceID);
277 if (item != bDDU_ERR.end())
283 std::map<DDUIdType, ExaminerStatusType>::const_iterator
item = bDDU_WRN.find(dduSourceID);
284 if (item != bDDU_WRN.end())
290 std::vector<DDUIdType> DDUs;
291 std::map<DDUIdType, ExaminerStatusType>::const_iterator
item = bDDU_ERR.begin();
292 while (item != bDDU_ERR.end()) {
293 DDUs.push_back(item->first);
323 std::map<DDUIdType, std::map<CSCIdType, uint32_t> >
DMB_size(
void)
const {
return dmbSize; }
uint32_t DDU_WordsSinceLastHeader
const uint16_t * buffer_start
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
void crcCFEB(bool enable)
std::map< DDUIdType, ExaminerStatusType > bDDU_ERR
const char * errorName(int num) const
uint32_t CFEB_SampleWordCount
bool warning(int num) const
std::map< DDUIdType, ExaminerStatusType > bDDU_WRN
std::set< CSCIdType > fCHAMB_ERR[29]
std::map< DDUIdType, uint32_t > dduOffsets
std::map< DDUIdType, uint32_t > dduSize
std::vector< DDUIdType > listOfDDUs(void) const
std::map< DDUIdType, uint32_t > DDU_ptrOffsets(void) const
int scanbuf(const uint16_t *&buf, int32_t length, uint16_t sig, uint16_t mask=0xFFFF)
void modeDDU(bool enable)
uint32_t ALCT_WordsSinceLastHeader
ExaminerStatusType bSUM_WARNING
ExaminerStatusType errorsForChamber(CSCIdType chamber) const
ExaminerStatusType statusForChamber(CSCIdType chamber) const
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > DMB_ptrOffsets(void) const
uint32_t DDU_WordsSinceLastTrailer
DDUIdType dduSourceID(void)
std::map< CSCIdType, ExaminerStatusType > bCHAMB_PAYLOAD
std::ostream & operator<<(std::ostream &out, const ALILine &li)
ExaminerStatusType errors(void) const
void crcALCT(bool enable)
const char * errName(int num) const
uint32_t ALCT_WordsExpected
std::map< DDUIdType, uint32_t > DDU_size(void) const
std::vector< const char * > sERROR
std::set< CSCIdType > chambersWithError(int num) const
std::map< DDUIdType, const uint16_t * > dduBuffers
ExaminerStatusType warnings(void) const
uint32_t TMB_Firmware_Revision
std::set< CSCIdType > chambersWithWarning(int num) const
uint32_t nWG_round_up
check zero suppression mode
std::map< CSCIdType, uint32_t > cntCHAMB_Trailers
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbSize
std::vector< const char * > sDMBExpectedPayload
std::vector< const char * > sWARNING_
ExaminerStatusType payloadForChamber(CSCIdType chamber) const
std::set< CSCIdType > fCHAMB_WRN[5]
uint32_t DDU_WordMismatch_Occurrences
uint32_t CFEB_SampleCount
std::map< DDUIdType, ExaminerStatusType > errorsDetailedDDU(void) const
ExaminerStatusType bSUM_ERROR
std::map< CSCIdType, ExaminerStatusType > bCHAMB_WRN
const char * statusName(int num) const
ExaminerStatusType errorsForDDU(DDUIdType dduSourceID) const
uint32_t TMB_WordsExpected
uint32_t CFEB_BSampleCount
ExaminerMaskType getMask() const
std::map< DDUIdType, std::map< CSCIdType, const uint16_t * > > DMB_block(void) const
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbOffsets
uint32_t TMB_WordsSinceLastHeader
to decode if zero suppression enabled
ExaminerStatusType bERROR
CSCDCCExaminer(ExaminerMaskType mask=0x1)
uint32_t DDU_Firmware_Revision
ExaminerStatusType warningsForDDU(DDUIdType dduSourceID) const
void checkTriggerHeadersAndTrailers()
const char * warningName(int num) const
std::map< DDUIdType, const uint16_t * > DDU_block(void) const
std::vector< const char * > sWARNING
const char * payloadName(int num) const
ExaminerStatusType warningsForChamber(CSCIdType chamber) const
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed
int32_t check(const uint16_t *&buffer, int32_t length)
const char * wrnName(int num) const
std::map< CSCIdType, ExaminerStatusType > warningsDetailed(void) const
std::map< CSCIdType, ExaminerStatusType > bCHAMB_STATUS
ExaminerMaskType examinerMask
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > DMB_size(void) const
void checkDAVs()
checks DAV_ALCT, DAV_TMB, and DAV_CFEB
ExaminerStatusType bWARNING
std::map< CSCIdType, ExaminerStatusType > statusDetailed(void) const
std::map< CSCIdType, ExaminerStatusType > errorsDetailed(void) const
std::vector< const char * > sDMBEventStaus
bool error(int num) const
std::map< DDUIdType, std::map< CSCIdType, const uint16_t * > > dmbBuffers
void setMask(ExaminerMaskType mask)
std::vector< const char * > sERROR_
std::map< CSCIdType, ExaminerStatusType > payloadDetailed(void) const
std::map< CSCIdType, uint32_t > cntCHAMB_Headers