CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
43  fDCC_MASK = fDCC_MASK_;
44  fCSC_MASK = fCSC_MASK_;
45  fDDU_SUMMARY_ERRORS = fDDU_SUMMARY_ERRORS_;
46  mDDU_ERRORS = mDDU_ERRORS_;
47  mCSC_ERRORS = mCSC_ERRORS_;
48  mCSC_PAYLOADS = mCSC_PAYLOADS_;
49  mCSC_STATUS = mCSC_STATUS_;
50 }
51 
52 
55 
56  // Keep original code in case I messed up the formatting in some subtle way when switching to MessageLogger
57  //
58  // std::cout << "CSCDCCFormatStatusDigi: DCC=" << std::dec << getDCCId()
59  // << " DCCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getDCCMask()
60  // << " CSCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCMask()
61  // << " DCCErrors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUSummaryErrors()
62  // << std::dec << "\n";
63  // std::set<DDUIdType> ddu_list = getListOfDDUs();
64  // for (std::set<DDUIdType>::iterator itr=ddu_list.begin(); itr != ddu_list.end(); ++itr) {
65  // std::cout << "DDU_" << std::dec << ((*itr)&0xFF)
66  // << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUErrors(*itr) << "\n";
67  // }
68  // std::set<CSCIdType> csc_list = getListOfCSCs();
69  // for (std::set<CSCIdType>::iterator itr=csc_list.begin(); itr != csc_list.end(); ++itr) {
70  //
71  // std::cout << "CSC_" << std::dec << (((*itr)>>4)&0xFF) << "_" << ((*itr)&0xF)
72  // << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCErrors(*itr)
73  // << " Payload=0x" << std::setw(8) << std::setfill('0') << getCSCPayload(*itr)
74  // << " Status=0x" << std::setw(8) << std::setfill('0') << getCSCStatus(*itr) << "\n";
75  // }
76 
77  edm::LogVerbatim("CSCDigi") << "CSCDCCFormatStatusDigi: DCC=" << std::dec << getDCCId()
78  << " DCCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getDCCMask()
79  << " CSCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCMask()
80  << " DCCErrors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUSummaryErrors()
81  << std::dec;
82 
83  std::ostringstream ost;
84 
85  std::set<DDUIdType> ddu_list = getListOfDDUs();
86  for (std::set<DDUIdType>::iterator itr=ddu_list.begin(); itr != ddu_list.end(); ++itr) {
87  ost << "DDU_" << std::dec << ((*itr)&0xFF)
88  << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUErrors(*itr);
89  edm::LogVerbatim("CSCDigi") << ost.str();
90  ost.clear();
91  }
92 
93  std::set<CSCIdType> csc_list = getListOfCSCs();
94  for (std::set<CSCIdType>::iterator itr=csc_list.begin(); itr != csc_list.end(); ++itr) {
95  ost << "CSC_" << std::dec << (((*itr)>>4)&0xFF) << "_" << ((*itr)&0xF)
96  << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCErrors(*itr)
97  << " Payload=0x" << std::setw(8) << std::setfill('0') << getCSCPayload(*itr)
98  << " Status=0x" << std::setw(8) << std::setfill('0') << getCSCStatus(*itr);
99  edm::LogVerbatim("CSCDigi") << ost.str();
100  ost.clear();
101  }
102 
103 }
104 
105 std::ostream & operator<<(std::ostream & o, const CSCDCCFormatStatusDigi& digi) {
106  o << "CSCDCCFormatStatusDigi: DCC=" << std::dec << digi.getDCCId()
107  << " DCCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getDCCMask()
108  << " CSCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getCSCMask()
109  << " DCCErrors=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getDDUSummaryErrors()
110  << std::dec << "\n";
111  std::set<DDUIdType> ddu_list = digi.getListOfDDUs();
112  for (std::set<DDUIdType>::iterator itr=ddu_list.begin(); itr != ddu_list.end(); ++itr) {
113  o << "DDU_" << std::dec << ((*itr)&0xFF)
114  << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getDDUErrors(*itr) << "\n";
115  }
116  std::set<CSCIdType> csc_list = digi.getListOfCSCs();
117  for (std::set<CSCIdType>::iterator itr=csc_list.begin(); itr != csc_list.end(); ++itr) {
118 
119  o << "CSC_" << std::dec << (((*itr)>>4)&0xFF) << "_" << ((*itr)&0xF)
120  << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getCSCErrors(*itr)
121  << " Payload=0x" << std::setw(8) << std::setfill('0') << digi. getCSCPayload(*itr)
122  << " Status=0x" << std::setw(8) << std::setfill('0') << digi.getCSCStatus(*itr) << "\n";
123  }
124  return o;
125 }
126 
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
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
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::set< CSCIdType > getListOfCSCs() const
ExaminerMaskType getCSCMask() const