Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:39

0001 #include "CondFormats/SiStripObjects/interface/CommissioningAnalysis.h"
0002 #include "DataFormats/SiStripCommon/interface/SiStripHistoTitle.h"
0003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
0004 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0005 #include <iomanip>
0006 
0007 // ----------------------------------------------------------------------------
0008 //
0009 CommissioningAnalysis::CommissioningAnalysis(const uint32_t& key, const std::string& my_name)
0010     : fecKey_(key),
0011       fedKey_(sistrip::invalid32_),
0012       dcuId_(sistrip::invalid32_),
0013       detId_(sistrip::invalid32_),
0014       myName_(my_name),
0015       errors_(VString(0, "")) {
0016   ;
0017 }
0018 
0019 // ----------------------------------------------------------------------------
0020 //
0021 CommissioningAnalysis::CommissioningAnalysis(const std::string& my_name)
0022     : fecKey_(sistrip::invalid32_),
0023       fedKey_(sistrip::invalid32_),
0024       dcuId_(sistrip::invalid32_),
0025       detId_(sistrip::invalid32_),
0026       myName_(my_name),
0027       errors_(VString(0, "")) {
0028   ;
0029 }
0030 
0031 // ----------------------------------------------------------------------------
0032 //
0033 void CommissioningAnalysis::header(std::stringstream& ss) const {
0034   ss << "[" << myName() << "] Monitorables (65535 means \"invalid\"):" << std::endl;
0035 
0036   //summary(ss);
0037 
0038   SiStripFecKey fec_key(fecKey_);
0039   ss << " Crate/FEC/Ring/CCU/Mod/LLD     : " << fec_key.fecCrate() << "/" << fec_key.fecSlot() << "/"
0040      << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/" << fec_key.lldChan()
0041      << std::endl;
0042 
0043   SiStripFedKey fed_key(fedKey_);
0044   ss << " FedId/FeUnit/FeChan/FedChannel : " << fed_key.fedId() << "/" << fed_key.feUnit() << "/" << fed_key.feChan()
0045      << "/" << fed_key.fedChannel() << std::endl;
0046   // if ( fed_key.fedChannel() != sistrip::invalid_ ) { ss << fed_key.fedChannel(); }
0047   // else { ss << "(invalid)"; }
0048   // ss << std::endl;
0049 
0050   //   ss << " FecKey/Fedkey (hex)            : 0x"
0051   //      << std::hex
0052   //      << std::setw(8) << std::setfill('0') << fecKey_
0053   //      << " / 0x"
0054   //      << std::setw(8) << std::setfill('0') << fedKey_
0055   //      << std::dec
0056   //      << std::endl;
0057 
0058   ss << " FecKey (hex/dec)               : 0x" << std::hex << std::setw(8) << std::setfill('0') << fecKey_ << " / "
0059      << std::dec << std::setw(10) << std::setfill(' ') << fecKey_ << std::endl;
0060 
0061   ss << " FedKey (hex/dec)               : 0x" << std::hex << std::setw(8) << std::setfill('0') << fedKey_ << " / "
0062      << std::dec << std::setw(10) << std::setfill(' ') << fedKey_ << std::endl;
0063 
0064   ss << " DcuId (hex/dec)                : 0x" << std::hex << std::setw(8) << std::setfill('0') << dcuId_ << " / "
0065      << std::dec << std::setw(10) << std::setfill(' ') << dcuId_ << std::endl;
0066 
0067   ss << " DetId (hex/dec)                : 0x" << std::hex << std::setw(8) << std::setfill('0') << detId_ << " / "
0068      << std::dec << std::setw(10) << std::setfill(' ') << detId_ << std::endl;
0069 }
0070 
0071 // ----------------------------------------------------------------------------
0072 //
0073 void CommissioningAnalysis::summary(std::stringstream& ss) const {
0074   SiStripFecKey fec_key(fecKey_);
0075 
0076   sistrip::RunType type = SiStripEnumsAndStrings::runType(myName());
0077   std::string title =
0078       SiStripHistoTitle(sistrip::EXPERT_HISTO, type, sistrip::FED_KEY, fedKey(), sistrip::LLD_CHAN, fec_key.lldChan())
0079           .title();
0080 
0081   ss << " Summary"
0082      << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::controlView_ << ":" << fec_key.fecCrate() << "/"
0083      << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << ":"
0084      << sistrip::dqmRoot_ << sistrip::dir_ << "Collate" << sistrip::dir_
0085      << SiStripFecKey(fec_key.fecCrate(), fec_key.fecSlot(), fec_key.fecRing(), fec_key.ccuAddr(), fec_key.ccuChan())
0086             .path()
0087      << ":" << title << std::endl;
0088 }