CMS 3D CMS Logo

CSCDCCFormatStatusDigi.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: CSCDCCFormatStatusDigi.h
5  *
6  * Description: CSC DCC Format error, status and payload flags for a single DCC
7  *
8  * Version: 1.0
9  * Created: 02/12/2009 03:22:34 PM
10  * Revision: none
11  * Compiler: gcc
12  *
13  * Author: Valdas Rapsevicius (VR), valdas.rapsevicius@cern.ch,
14  * Victor Barashko (VB), victor.barashko@cern.ch
15  * Company: CERN, CH
16  *
17  * =====================================================================================
18  */
19 
22 #include <iostream>
23 #include <iomanip>
24 
36  const ExaminerMaskType fCSC_MASK_,
37  const ExaminerStatusType fDDU_SUMMARY_ERRORS_,
38  const std::map<DDUIdType, ExaminerStatusType>& mDDU_ERRORS_,
39  const std::map<CSCIdType, ExaminerStatusType>& mCSC_ERRORS_,
40  const std::map<CSCIdType, ExaminerStatusType>& mCSC_PAYLOADS_,
41  const std::map<CSCIdType, ExaminerStatusType>& mCSC_STATUS_) {
42  fDCC_MASK = fDCC_MASK_;
43  fCSC_MASK = fCSC_MASK_;
44  fDDU_SUMMARY_ERRORS = fDDU_SUMMARY_ERRORS_;
45  mDDU_ERRORS = mDDU_ERRORS_;
46  mCSC_ERRORS = mCSC_ERRORS_;
47  mCSC_PAYLOADS = mCSC_PAYLOADS_;
48  mCSC_STATUS = mCSC_STATUS_;
49 }
50 
53  // Keep original code in case I messed up the formatting in some subtle way when switching to MessageLogger
54  //
55  // std::cout << "CSCDCCFormatStatusDigi: DCC=" << std::dec << getDCCId()
56  // << " DCCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getDCCMask()
57  // << " CSCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCMask()
58  // << " DCCErrors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUSummaryErrors()
59  // << std::dec << "\n";
60  // std::set<DDUIdType> ddu_list = getListOfDDUs();
61  // for (std::set<DDUIdType>::iterator itr=ddu_list.begin(); itr != ddu_list.end(); ++itr) {
62  // std::cout << "DDU_" << std::dec << ((*itr)&0xFF)
63  // << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUErrors(*itr) << "\n";
64  // }
65  // std::set<CSCIdType> csc_list = getListOfCSCs();
66  // for (std::set<CSCIdType>::iterator itr=csc_list.begin(); itr != csc_list.end(); ++itr) {
67  //
68  // std::cout << "CSC_" << std::dec << (((*itr)>>4)&0xFF) << "_" << ((*itr)&0xF)
69  // << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCErrors(*itr)
70  // << " Payload=0x" << std::setw(8) << std::setfill('0') << getCSCPayload(*itr)
71  // << " Status=0x" << std::setw(8) << std::setfill('0') << getCSCStatus(*itr) << "\n";
72  // }
73 
74  edm::LogVerbatim("CSCDigi") << "CSCDCCFormatStatusDigi: DCC=" << std::dec << getDCCId() << " DCCMask=0x" << std::hex
75  << std::setw(8) << std::setfill('0') << getDCCMask() << " CSCMask=0x" << std::hex
76  << std::setw(8) << std::setfill('0') << getCSCMask() << " DCCErrors=0x" << std::hex
77  << std::setw(8) << std::setfill('0') << getDDUSummaryErrors() << std::dec;
78 
79  std::ostringstream ost;
80 
81  std::set<DDUIdType> ddu_list = getListOfDDUs();
82  for (std::set<DDUIdType>::iterator itr = ddu_list.begin(); itr != ddu_list.end(); ++itr) {
83  ost << "DDU_" << std::dec << ((*itr) & 0xFF) << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0')
84  << getDDUErrors(*itr);
85  edm::LogVerbatim("CSCDigi") << ost.str();
86  ost.clear();
87  }
88 
89  std::set<CSCIdType> csc_list = getListOfCSCs();
90  for (std::set<CSCIdType>::iterator itr = csc_list.begin(); itr != csc_list.end(); ++itr) {
91  ost << "CSC_" << std::dec << (((*itr) >> 4) & 0xFF) << "_" << ((*itr) & 0xF) << " Errors=0x" << std::hex
92  << std::setw(8) << std::setfill('0') << getCSCErrors(*itr) << " Payload=0x" << std::setw(8) << std::setfill('0')
93  << getCSCPayload(*itr) << " Status=0x" << std::setw(8) << std::setfill('0') << getCSCStatus(*itr);
94  edm::LogVerbatim("CSCDigi") << ost.str();
95  ost.clear();
96  }
97 }
98 
99 std::ostream& operator<<(std::ostream& o, const CSCDCCFormatStatusDigi& digi) {
100  o << "CSCDCCFormatStatusDigi: DCC=" << std::dec << digi.getDCCId() << " DCCMask=0x" << std::hex << std::setw(8)
101  << std::setfill('0') << digi.getDCCMask() << " CSCMask=0x" << std::hex << std::setw(8) << std::setfill('0')
102  << digi.getCSCMask() << " DCCErrors=0x" << std::hex << std::setw(8) << std::setfill('0')
103  << digi.getDDUSummaryErrors() << std::dec << "\n";
104  std::set<DDUIdType> ddu_list = digi.getListOfDDUs();
105  for (std::set<DDUIdType>::iterator itr = ddu_list.begin(); itr != ddu_list.end(); ++itr) {
106  o << "DDU_" << std::dec << ((*itr) & 0xFF) << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0')
107  << digi.getDDUErrors(*itr) << "\n";
108  }
109  std::set<CSCIdType> csc_list = digi.getListOfCSCs();
110  for (std::set<CSCIdType>::iterator itr = csc_list.begin(); itr != csc_list.end(); ++itr) {
111  o << "CSC_" << std::dec << (((*itr) >> 4) & 0xFF) << "_" << ((*itr) & 0xF) << " Errors=0x" << std::hex
112  << std::setw(8) << std::setfill('0') << digi.getCSCErrors(*itr) << " Payload=0x" << std::setw(8)
113  << std::setfill('0') << digi.getCSCPayload(*itr) << " Status=0x" << std::setw(8) << std::setfill('0')
114  << digi.getCSCStatus(*itr) << "\n";
115  }
116  return o;
117 }
void print() const
Debug.
ExaminerMaskType getDCCMask() const
ExaminerStatusType getDDUSummaryErrors() const
std::set< DDUIdType > getListOfDDUs() const
ExaminerStatusType getCSCStatus(const CSCIdType CSCId) const
ExaminerStatusType getCSCErrors(const CSCIdType CSCId) const
ExaminerStatusType getDDUErrors(const DDUIdType DDUId) const
std::map< CSCIdType, ExaminerStatusType > mCSC_ERRORS
ExaminerStatusType fDDU_SUMMARY_ERRORS
void setDCCExaminerInfo(const ExaminerMaskType fDCC_MASK_, const ExaminerMaskType fCSC_MASK_, const ExaminerStatusType fDDU_SUMMARY_ERRORS_, const std::map< DDUIdType, ExaminerStatusType > &mDDU_ERRORS_, const std::map< CSCIdType, ExaminerStatusType > &mCSC_ERRORS_, const std::map< CSCIdType, ExaminerStatusType > &mCSC_PAYLOADS_, const std::map< CSCIdType, ExaminerStatusType > &mCSC_STATUS_)
Fill internal data structures using Examiner object.
ExaminerStatusType getCSCPayload(const CSCIdType CSCId) const
uint32_t ExaminerStatusType
std::map< CSCIdType, ExaminerStatusType > mCSC_STATUS
std::map< DDUIdType, ExaminerStatusType > mDDU_ERRORS
CSC Format Status Object.
std::map< CSCIdType, ExaminerStatusType > mCSC_PAYLOADS
uint32_t ExaminerMaskType
std::ostream & operator<<(std::ostream &o, const CSCDCCFormatStatusDigi &digi)
std::set< CSCIdType > getListOfCSCs() const
ExaminerMaskType getCSCMask() const