CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/CSCDigi/src/CSCDCCFormatStatusDigi.cc

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  CSCDCCFormatStatusDigi.h
00005  *
00006  *    Description:  CSC DCC Format error, status and payload flags for a single DCC
00007  *
00008  *        Version:  1.0
00009  *        Created:  02/12/2009 03:22:34 PM
00010  *       Revision:  none
00011  *       Compiler:  gcc
00012  *
00013  *         Author:  Valdas Rapsevicius (VR), valdas.rapsevicius@cern.ch,
00014  *                  Victor Barashko (VB), victor.barashko@cern.ch
00015  *        Company:  CERN, CH
00016  *  
00017  * =====================================================================================
00018  */
00019 
00020 #include "DataFormats/CSCDigi/interface/CSCDCCFormatStatusDigi.h"
00021 
00022 #include <iostream>
00023 #include <iomanip>
00024 
00035 void CSCDCCFormatStatusDigi::setDCCExaminerInfo(const ExaminerMaskType fDCC_MASK_,
00036                          const ExaminerMaskType fCSC_MASK_,
00037                          const ExaminerStatusType fDDU_SUMMARY_ERRORS_,
00038                          const std::map<DDUIdType, ExaminerStatusType> mDDU_ERRORS_,
00039                          const std::map<CSCIdType, ExaminerStatusType> mCSC_ERRORS_,
00040                          const std::map<CSCIdType, ExaminerStatusType> mCSC_PAYLOADS_,
00041                          const std::map<CSCIdType, ExaminerStatusType> mCSC_STATUS_)
00042 {
00043   fDCC_MASK = fDCC_MASK_;
00044   fCSC_MASK = fCSC_MASK_;
00045   fDDU_SUMMARY_ERRORS = fDDU_SUMMARY_ERRORS_;
00046   mDDU_ERRORS = mDDU_ERRORS_;
00047   mCSC_ERRORS = mCSC_ERRORS_;
00048   mCSC_PAYLOADS = mCSC_PAYLOADS_;
00049   mCSC_STATUS = mCSC_STATUS_;
00050 }
00051 
00052 
00054 void CSCDCCFormatStatusDigi::print() const {
00055 
00056    std::cout << "CSCDCCFormatStatusDigi: DCC=" << std::dec << getDCCId() 
00057         << " DCCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getDCCMask()
00058         << " CSCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCMask()
00059         << " DCCErrors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUSummaryErrors() 
00060         << std::dec << "\n";
00061    std::set<DDUIdType> ddu_list = getListOfDDUs();
00062    for (std::set<DDUIdType>::iterator itr=ddu_list.begin(); itr != ddu_list.end(); ++itr) {
00063         std::cout << "DDU_" << std::dec << ((*itr)&0xFF) 
00064         << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getDDUErrors(*itr) << "\n"; 
00065    }
00066    std::set<CSCIdType> csc_list = getListOfCSCs();
00067    for (std::set<CSCIdType>::iterator itr=csc_list.begin(); itr != csc_list.end(); ++itr) {
00068         
00069         std::cout << "CSC_" << std::dec << (((*itr)>>4)&0xFF) << "_" << ((*itr)&0xF) 
00070                 << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << getCSCErrors(*itr) 
00071                 << " Payload=0x" << std::setw(8) << std::setfill('0') << getCSCPayload(*itr) 
00072                 << " Status=0x" << std::setw(8) << std::setfill('0') << getCSCStatus(*itr) << "\n";
00073    }
00074 
00075 }
00076 
00077 std::ostream & operator<<(std::ostream & o, const CSCDCCFormatStatusDigi& digi) {
00078    o << "CSCDCCFormatStatusDigi: DCC=" << std::dec << digi.getDCCId() 
00079         << " DCCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getDCCMask()
00080         << " CSCMask=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getCSCMask()
00081         << " DCCErrors=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getDDUSummaryErrors() 
00082         << std::dec << "\n";
00083    std::set<DDUIdType> ddu_list = digi.getListOfDDUs();
00084    for (std::set<DDUIdType>::iterator itr=ddu_list.begin(); itr != ddu_list.end(); ++itr) {
00085         o << "DDU_" << std::dec << ((*itr)&0xFF) 
00086         << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getDDUErrors(*itr) << "\n"; 
00087    }
00088    std::set<CSCIdType> csc_list = digi.getListOfCSCs();
00089    for (std::set<CSCIdType>::iterator itr=csc_list.begin(); itr != csc_list.end(); ++itr) {
00090         
00091         o << "CSC_" << std::dec << (((*itr)>>4)&0xFF) << "_" << ((*itr)&0xF) 
00092                 << " Errors=0x" << std::hex << std::setw(8) << std::setfill('0') << digi.getCSCErrors(*itr) 
00093                 << " Payload=0x" << std::setw(8) << std::setfill('0') << digi. getCSCPayload(*itr) 
00094                 << " Status=0x" << std::setw(8) << std::setfill('0') << digi.getCSCStatus(*itr) << "\n";
00095    }
00096   return o;
00097 }
00098