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 }
CSCDCCFormatStatusDigi::getListOfCSCs
std::set< CSCIdType > getListOfCSCs() const
Definition: CSCDCCFormatStatusDigi.h:285
MessageLogger.h
CSCDCCFormatStatusDigi::fDDU_SUMMARY_ERRORS
ExaminerStatusType fDDU_SUMMARY_ERRORS
Definition: CSCDCCFormatStatusDigi.h:176
CSCDCCFormatStatusDigi::setDCCExaminerInfo
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.
Definition: CSCDCCFormatStatusDigi.cc:35
CSCDCCFormatStatusDigi::getCSCErrors
ExaminerStatusType getCSCErrors(const CSCIdType CSCId) const
Definition: CSCDCCFormatStatusDigi.h:343
CSCDCCFormatStatusDigi::mDDU_ERRORS
std::map< DDUIdType, ExaminerStatusType > mDDU_ERRORS
Definition: CSCDCCFormatStatusDigi.h:178
CSCDCCFormatStatusDigi::mCSC_ERRORS
std::map< CSCIdType, ExaminerStatusType > mCSC_ERRORS
Definition: CSCDCCFormatStatusDigi.h:179
CSCDCCFormatStatusDigi::getDDUSummaryErrors
ExaminerStatusType getDDUSummaryErrors() const
Definition: CSCDCCFormatStatusDigi.h:333
ExaminerMaskType
uint32_t ExaminerMaskType
Definition: CSCDCCFormatStatusDigi.h:39
operator<<
std::ostream & operator<<(std::ostream &o, const CSCDCCFormatStatusDigi &digi)
Definition: CSCDCCFormatStatusDigi.cc:99
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
CSCDCCFormatStatusDigi
CSC Format Status Object.
Definition: CSCDCCFormatStatusDigi.h:160
CSCDCCFormatStatusDigi::getDDUErrors
ExaminerStatusType getDDUErrors(const DDUIdType DDUId) const
Definition: CSCDCCFormatStatusDigi.h:335
CSCDCCFormatStatusDigi::mCSC_STATUS
std::map< CSCIdType, ExaminerStatusType > mCSC_STATUS
Definition: CSCDCCFormatStatusDigi.h:181
CSCDCCFormatStatusDigi.h
CSCDCCFormatStatusDigi::mCSC_PAYLOADS
std::map< CSCIdType, ExaminerStatusType > mCSC_PAYLOADS
Definition: CSCDCCFormatStatusDigi.h:180
edm::LogVerbatim
Definition: MessageLogger.h:297
CSCDCCFormatStatusDigi::getCSCPayload
ExaminerStatusType getCSCPayload(const CSCIdType CSCId) const
Definition: CSCDCCFormatStatusDigi.h:355
CSCDCCFormatStatusDigi::getDCCMask
ExaminerMaskType getDCCMask() const
Definition: CSCDCCFormatStatusDigi.h:387
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
CSCDCCFormatStatusDigi::fCSC_MASK
ExaminerMaskType fCSC_MASK
Definition: CSCDCCFormatStatusDigi.h:170
CSCDCCFormatStatusDigi::getCSCMask
ExaminerMaskType getCSCMask() const
Definition: CSCDCCFormatStatusDigi.h:392
CSCDCCFormatStatusDigi::fDCC_MASK
ExaminerMaskType fDCC_MASK
Definition: CSCDCCFormatStatusDigi.h:167
CSCDCCFormatStatusDigi::print
void print() const
Debug.
Definition: CSCDCCFormatStatusDigi.cc:52
ExaminerStatusType
uint32_t ExaminerStatusType
Definition: CSCDCCFormatStatusDigi.h:40
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CSCDCCFormatStatusDigi::getListOfDDUs
std::set< DDUIdType > getListOfDDUs() const
Definition: CSCDCCFormatStatusDigi.h:283
CSCDCCFormatStatusDigi::getCSCStatus
ExaminerStatusType getCSCStatus(const CSCIdType CSCId) const
Definition: CSCDCCFormatStatusDigi.h:367
CSCDCCFormatStatusDigi::getDCCId
DCCIdType getDCCId() const
Definition: CSCDCCFormatStatusDigi.h:382