00001 #include "DQM/SiStripCommissioningSummary/interface/VpspScanSummaryFactory.h"
00002 #include "CondFormats/SiStripObjects/interface/VpspScanAnalysis.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 VpspScanSummaryFactory::extract( Iterator iter ) {
00013
00014 VpspScanAnalysis* anal = dynamic_cast<VpspScanAnalysis*>( iter->second );
00015 if ( !anal ) { return; }
00016
00017 std::vector<float> value( 2, 1. * sistrip::invalid_ );
00018 std::vector<float> error( 2, 1. * sistrip::invalid_ );
00019
00020 bool two = true;
00021 if ( mon_ == sistrip::VPSP_SCAN_APV_SETTINGS ) {
00022 value[0] = 1. * anal->vpsp()[0];
00023 value[1] = 1. * anal->vpsp()[1];
00024 } else if ( mon_ == sistrip::VPSP_SCAN_APV0_SETTING ) {
00025 value[0] = 1. * anal->vpsp()[0];
00026 two = false;
00027 } else if ( mon_ == sistrip::VPSP_SCAN_APV1_SETTING ) {
00028 value[0] = 1. * anal->vpsp()[1];
00029 two = false;
00030 } else if ( mon_ == sistrip::VPSP_SCAN_ADC_LEVEL ) {
00031 value[0] = 1. * anal->adcLevel()[0];
00032 value[1] = 1. * anal->adcLevel()[1];
00033 } else if ( mon_ == sistrip::VPSP_SCAN_DIGITAL_HIGH ) {
00034 value[0] = 1. * anal->topLevel()[0];
00035 value[1] = 1. * anal->topLevel()[1];
00036 } else if ( mon_ == sistrip::VPSP_SCAN_DIGITAL_LOW ) {
00037 value[0] = 1. * anal->bottomLevel()[0];
00038 value[1] = 1. * anal->bottomLevel()[1];
00039 } else {
00040 edm::LogWarning(mlSummaryPlots_)
00041 << "[SummaryPlotFactory::" << __func__ << "]"
00042 << " Unexpected monitorable: "
00043 << SiStripEnumsAndStrings::monitorable( SummaryPlotFactoryBase::mon_ );
00044 return;
00045 }
00046
00047 SummaryPlotFactoryBase::generator_->fillMap( SummaryPlotFactoryBase::level_,
00048 SummaryPlotFactoryBase::gran_,
00049 iter->first,
00050 value[0],
00051 error[0] );
00052
00053 if ( two ) {
00054 SummaryPlotFactoryBase::generator_->fillMap( SummaryPlotFactoryBase::level_,
00055 SummaryPlotFactoryBase::gran_,
00056 iter->first,
00057 value[1],
00058 error[1] );
00059 }
00060
00061 }
00062
00063
00064
00065 void VpspScanSummaryFactory::format() {
00066
00067 if ( mon_ == sistrip::VPSP_SCAN_APV_SETTINGS ) {
00068 } else if ( mon_ == sistrip::VPSP_SCAN_APV0_SETTING ) {
00069 } else if ( mon_ == sistrip::VPSP_SCAN_APV1_SETTING ) {
00070 } else if ( mon_ == sistrip::VPSP_SCAN_ADC_LEVEL ) {
00071 } else if ( mon_ == sistrip::VPSP_SCAN_DIGITAL_HIGH ) {
00072 } else if ( mon_ == sistrip::VPSP_SCAN_DIGITAL_LOW ) {
00073 } else {
00074 edm::LogWarning(mlSummaryPlots_)
00075 << "[SummaryPlotFactory::" << __func__ << "]"
00076 << " Unexpected SummaryHisto value: "
00077 << SiStripEnumsAndStrings::monitorable( SummaryPlotFactoryBase::mon_ );
00078 }
00079
00080 }