Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:41

0001 #include "DQM/SiStripCommissioningSummary/interface/VpspScanSummaryFactory.h"
0002 #include "CondFormats/SiStripObjects/interface/VpspScanAnalysis.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 VpspScanSummaryFactory::extract(Iterator iter) {
0013   VpspScanAnalysis* anal = dynamic_cast<VpspScanAnalysis*>(iter->second);
0014   if (!anal) {
0015     return;
0016   }
0017 
0018   std::vector<float> value(2, 1. * sistrip::invalid_);
0019   std::vector<float> error(2, 1. * sistrip::invalid_);
0020 
0021   bool two = true;
0022   if (mon_ == sistrip::VPSP_SCAN_APV_SETTINGS) {
0023     value[0] = 1. * anal->vpsp()[0];
0024     value[1] = 1. * anal->vpsp()[1];
0025   } else if (mon_ == sistrip::VPSP_SCAN_APV0_SETTING) {
0026     value[0] = 1. * anal->vpsp()[0];
0027     two = false;
0028   } else if (mon_ == sistrip::VPSP_SCAN_APV1_SETTING) {
0029     value[0] = 1. * anal->vpsp()[1];
0030     two = false;
0031   } else if (mon_ == sistrip::VPSP_SCAN_ADC_LEVEL) {
0032     value[0] = 1. * anal->adcLevel()[0];
0033     value[1] = 1. * anal->adcLevel()[1];
0034   } else if (mon_ == sistrip::VPSP_SCAN_DIGITAL_HIGH) {
0035     value[0] = 1. * anal->topLevel()[0];
0036     value[1] = 1. * anal->topLevel()[1];
0037   } else if (mon_ == sistrip::VPSP_SCAN_DIGITAL_LOW) {
0038     value[0] = 1. * anal->bottomLevel()[0];
0039     value[1] = 1. * anal->bottomLevel()[1];
0040   } else {
0041     edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactory::" << __func__ << "]"
0042                                      << " Unexpected monitorable: "
0043                                      << SiStripEnumsAndStrings::monitorable(SummaryPlotFactoryBase::mon_);
0044     return;
0045   }
0046 
0047   SummaryPlotFactoryBase::generator_->fillMap(
0048       SummaryPlotFactoryBase::level_, SummaryPlotFactoryBase::gran_, iter->first, value[0], error[0]);
0049 
0050   if (two) {
0051     SummaryPlotFactoryBase::generator_->fillMap(
0052         SummaryPlotFactoryBase::level_, SummaryPlotFactoryBase::gran_, iter->first, value[1], error[1]);
0053   }
0054 }
0055 
0056 // -----------------------------------------------------------------------------
0057 //
0058 void VpspScanSummaryFactory::format() {
0059   if (mon_ == sistrip::VPSP_SCAN_APV_SETTINGS) {
0060   } else if (mon_ == sistrip::VPSP_SCAN_APV0_SETTING) {
0061   } else if (mon_ == sistrip::VPSP_SCAN_APV1_SETTING) {
0062   } else if (mon_ == sistrip::VPSP_SCAN_ADC_LEVEL) {
0063   } else if (mon_ == sistrip::VPSP_SCAN_DIGITAL_HIGH) {
0064   } else if (mon_ == sistrip::VPSP_SCAN_DIGITAL_LOW) {
0065   } else {
0066     edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactory::" << __func__ << "]"
0067                                      << " Unexpected SummaryHisto value: "
0068                                      << SiStripEnumsAndStrings::monitorable(SummaryPlotFactoryBase::mon_);
0069   }
0070 }