File indexing completed on 2024-04-06 12:08:37
0001 #include "DQM/SiStripCommissioningSummary/interface/ApvTimingSummaryFactory.h"
0002 #include "CondFormats/SiStripObjects/interface/ApvTimingAnalysis.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 ApvTimingSummaryFactory::extract(Iterator iter) {
0013 ApvTimingAnalysis* anal = dynamic_cast<ApvTimingAnalysis*>(iter->second);
0014 if (!anal) {
0015 return;
0016 }
0017
0018 float value = 1. * sistrip::invalid_;
0019
0020 if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_TIME) {
0021 value = anal->time();
0022 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_MAX_TIME) {
0023 value = anal->refTime();
0024 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_DELAY) {
0025 value = anal->delay();
0026 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_BASE) {
0027 value = anal->base();
0028 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_PEAK) {
0029 value = anal->peak();
0030 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_HEIGHT) {
0031 value = anal->height();
0032 } else {
0033 edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactory::" << __func__ << "]"
0034 << " Unexpected monitorable: "
0035 << SiStripEnumsAndStrings::monitorable(SummaryPlotFactoryBase::mon_);
0036 return;
0037 }
0038
0039 SummaryPlotFactoryBase::generator_->fillMap(
0040 SummaryPlotFactoryBase::level_, SummaryPlotFactoryBase::gran_, iter->first, value);
0041 }
0042
0043
0044
0045 void ApvTimingSummaryFactory::format() {
0046 if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_TIME) {
0047 SummaryPlotFactoryBase::generator_->axisLabel("Timing delay [ns]");
0048 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_MAX_TIME) {
0049 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_DELAY) {
0050 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_ERROR) {
0051 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_BASE) {
0052 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_PEAK) {
0053 } else if (SummaryPlotFactoryBase::mon_ == sistrip::APV_TIMING_HEIGHT) {
0054 } else {
0055 edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactory::" << __func__ << "]"
0056 << " Unexpected SummaryHisto value:"
0057 << SiStripEnumsAndStrings::monitorable(SummaryPlotFactoryBase::mon_);
0058 }
0059 }