File indexing completed on 2023-03-17 10:56:33
0001 #include "DQM/SiStripCommissioningSummary/interface/FastFedCablingSummaryFactory.h"
0002 #include "CondFormats/SiStripObjects/interface/FastFedCablingAnalysis.h"
0003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include <iostream>
0006 #include <sstream>
0007
0008 using namespace sistrip;
0009
0010
0011
0012 void FastFedCablingSummaryFactory::extract(Iterator iter) {
0013 FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>(iter->second);
0014 if (!anal) {
0015 return;
0016 }
0017
0018 float value = 1. * sistrip::invalid_;
0019 float error = 1. * sistrip::invalid_;
0020
0021 if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_HIGH_LEVEL) {
0022 value = anal->highLevel();
0023 error = anal->highRms();
0024 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_LOW_LEVEL) {
0025 value = anal->lowLevel();
0026 error = anal->lowRms();
0027 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MAX) {
0028 value = anal->max();
0029 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MIN) {
0030 value = anal->min();
0031 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_CONNS_PER_FED) {
0032 value = 1. * static_cast<uint16_t>(anal->isValid());
0033 } else {
0034 edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactory::" << __func__ << "]"
0035 << " Unexpected monitorable: "
0036 << SiStripEnumsAndStrings::monitorable(SummaryPlotFactoryBase::mon_);
0037 return;
0038 }
0039
0040 SummaryPlotFactoryBase::generator_->fillMap(
0041 SummaryPlotFactoryBase::level_, SummaryPlotFactoryBase::gran_, iter->first, value, error);
0042 }
0043
0044
0045
0046 void FastFedCablingSummaryFactory::format() {
0047 if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_HIGH_LEVEL) {
0048 SummaryPlotFactoryBase::generator_->axisLabel("\"High\" light level [ADC]");
0049 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_LOW_LEVEL) {
0050 SummaryPlotFactoryBase::generator_->axisLabel("\"Low\" light level [ADC]");
0051 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MAX) {
0052 SummaryPlotFactoryBase::generator_->axisLabel("Maximum light level [ADC]");
0053 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MIN) {
0054 SummaryPlotFactoryBase::generator_->axisLabel("Minumum light level [ADC]");
0055 } else if (SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_CONNS_PER_FED) {
0056 SummaryPlotFactoryBase::generator_->axisLabel("Connected channels per FED");
0057 } else {
0058 edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactory::" << __func__ << "]"
0059 << " Unexpected SummaryHisto value:"
0060 << SiStripEnumsAndStrings::monitorable(SummaryPlotFactoryBase::mon_);
0061 }
0062 }