00001 #include "DQM/SiStripCommissioningSummary/interface/FastFedCablingSummaryFactory.h" 00002 #include "CondFormats/SiStripObjects/interface/FastFedCablingAnalysis.h" 00003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h" 00004 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00005 #include <iostream> 00006 #include <sstream> 00007 00008 using namespace sistrip; 00009 00010 // ----------------------------------------------------------------------------- 00011 // 00012 void FastFedCablingSummaryFactory::extract( Iterator iter ) { 00013 00014 FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>( iter->second ); 00015 if ( !anal ) { return; } 00016 00017 float value = 1. * sistrip::invalid_; 00018 float error = 1. * sistrip::invalid_; 00019 00020 if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_HIGH_LEVEL ) { 00021 value = anal->highLevel(); 00022 error = anal->highRms(); 00023 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_LOW_LEVEL ) { 00024 value = anal->lowLevel(); 00025 error = anal->lowRms(); 00026 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MAX ) { 00027 value = anal->max(); 00028 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MIN ) { 00029 value = anal->min(); 00030 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_CONNS_PER_FED ) { 00031 value = 1. * static_cast<uint16_t>( anal->isValid() ); 00032 } else { 00033 edm::LogWarning(mlSummaryPlots_) 00034 << "[SummaryPlotFactory::" << __func__ << "]" 00035 << " Unexpected monitorable: " 00036 << SiStripEnumsAndStrings::monitorable( SummaryPlotFactoryBase::mon_ ); 00037 return; 00038 } 00039 00040 SummaryPlotFactoryBase::generator_->fillMap( SummaryPlotFactoryBase::level_, 00041 SummaryPlotFactoryBase::gran_, 00042 iter->first, 00043 value, 00044 error ); 00045 00046 } 00047 00048 // ----------------------------------------------------------------------------- 00049 // 00050 void FastFedCablingSummaryFactory::format() { 00051 00052 if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_HIGH_LEVEL ) { 00053 SummaryPlotFactoryBase::generator_->axisLabel( "\"High\" light level [ADC]" ); 00054 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_LOW_LEVEL ) { 00055 SummaryPlotFactoryBase::generator_->axisLabel( "\"Low\" light level [ADC]" ); 00056 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MAX ) { 00057 SummaryPlotFactoryBase::generator_->axisLabel( "Maximum light level [ADC]" ); 00058 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_MIN ) { 00059 SummaryPlotFactoryBase::generator_->axisLabel( "Minumum light level [ADC]" ); 00060 } else if ( SummaryPlotFactoryBase::mon_ == sistrip::FAST_CABLING_CONNS_PER_FED ) { 00061 SummaryPlotFactoryBase::generator_->axisLabel( "Connected channels per FED" ); 00062 } else { 00063 edm::LogWarning(mlSummaryPlots_) 00064 << "[SummaryPlotFactory::" << __func__ << "]" 00065 << " Unexpected SummaryHisto value:" 00066 << SiStripEnumsAndStrings::monitorable( SummaryPlotFactoryBase::mon_ ); 00067 } 00068 00069 }