diff --git a/DQM/HLTEvF/plugins/LumiMonitor.cc b/DQM/HLTEvF/plugins/LumiMonitor.cc index 6c560d6dabf6a..eaca057f45a68 100644 --- a/DQM/HLTEvF/plugins/LumiMonitor.cc +++ b/DQM/HLTEvF/plugins/LumiMonitor.cc @@ -43,9 +43,14 @@ class LumiMonitor : public DQMGlobalEDAnalyzer { public: LumiMonitor(const edm::ParameterSet&); ~LumiMonitor() override = default; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - static void fillHistoPSetDescription(edm::ParameterSetDescription& pset); - static void fillHistoLSPSetDescription(edm::ParameterSetDescription& pset); + + static void fillHistoPSetDescription(edm::ParameterSetDescription& pset, + int const nbins, + double const xmin, + double const xmax); + static void fillHistoLSPSetDescription(edm::ParameterSetDescription& pset, int const nbins); private: void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&, Histograms&) const override; @@ -250,13 +255,18 @@ void LumiMonitor::dqmAnalyze(edm::Event const& event, } } -void LumiMonitor::fillHistoPSetDescription(edm::ParameterSetDescription& pset) { - pset.add("nbins"); - pset.add("xmin"); - pset.add("xmax"); +void LumiMonitor::fillHistoPSetDescription(edm::ParameterSetDescription& pset, + int const nbins, + double const xmin, + double const xmax) { + pset.add("nbins", nbins); + pset.add("xmin", xmin); + pset.add("xmax", xmax); } -void LumiMonitor::fillHistoLSPSetDescription(edm::ParameterSetDescription& pset) { pset.add("nbins", 2500); } +void LumiMonitor::fillHistoLSPSetDescription(edm::ParameterSetDescription& pset, int const nbins) { + pset.add("nbins", nbins); +} void LumiMonitor::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -270,25 +280,26 @@ void LumiMonitor::fillDescriptions(edm::ConfigurationDescriptions& descriptions) desc.add("minPixelClusterCharge", 15000.); edm::ParameterSetDescription histoPSet; - edm::ParameterSetDescription pixelClusterPSet; - LumiMonitor::fillHistoPSetDescription(pixelClusterPSet); - histoPSet.add("pixelClusterPSet", pixelClusterPSet); - edm::ParameterSetDescription lumiPSet; - fillHistoPSetDescription(lumiPSet); - histoPSet.add("lumiPSet", lumiPSet); + edm::ParameterSetDescription lsPSet; + fillHistoLSPSetDescription(lsPSet, 2500); + histoPSet.add("lsPSet", lsPSet); edm::ParameterSetDescription puPSet; - fillHistoPSetDescription(puPSet); + fillHistoPSetDescription(puPSet, 130, 0, 130); histoPSet.add("puPSet", puPSet); + edm::ParameterSetDescription lumiPSet; + fillHistoPSetDescription(lumiPSet, 5000, 0, 20000); + histoPSet.add("lumiPSet", lumiPSet); + edm::ParameterSetDescription pixellumiPSet; - fillHistoPSetDescription(pixellumiPSet); + fillHistoPSetDescription(pixellumiPSet, 300, 0, 3); histoPSet.add("pixellumiPSet", pixellumiPSet); - edm::ParameterSetDescription lsPSet; - fillHistoLSPSetDescription(lsPSet); - histoPSet.add("lsPSet", lsPSet); + edm::ParameterSetDescription pixelClusterPSet; + fillHistoPSetDescription(pixelClusterPSet, 200, -0.5, 19999.5); + histoPSet.add("pixelClusterPSet", pixelClusterPSet); desc.add("histoPSet", histoPSet); diff --git a/DQM/HLTEvF/plugins/PSMonitor.cc b/DQM/HLTEvF/plugins/PSMonitor.cc index a5733d3551a46..5a2e2bb919dc7 100644 --- a/DQM/HLTEvF/plugins/PSMonitor.cc +++ b/DQM/HLTEvF/plugins/PSMonitor.cc @@ -63,7 +63,7 @@ class PSMonitor : public DQMGlobalEDAnalyzer { // ----------------------------- PSMonitor::PSMonitor(const edm::ParameterSet& config) - : folderName_(config.getParameter("FolderName")), + : folderName_(config.getParameter("folderName")), ugtBXToken_(consumes(config.getParameter("ugtBXInputTag"))) { edm::ParameterSet histoPSet = config.getParameter("histoPSet"); edm::ParameterSet psColumnPSet = histoPSet.getParameter("psColumnPSet"); @@ -138,19 +138,19 @@ void PSMonitor::fillHistoPSetDescription(edm::ParameterSetDescription& pset, int void PSMonitor::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("ugtBXInputTag", edm::InputTag("hltGtStage2Digis")); - desc.add("FolderName", "HLT/PSMonitoring"); + desc.add("folderName", "HLT/PSMonitoring"); edm::ParameterSetDescription histoPSet; edm::ParameterSetDescription psColumnPSet; fillHistoPSetDescription(psColumnPSet, 8); - histoPSet.add("psColumnPSet", psColumnPSet); + histoPSet.add("psColumnPSet", psColumnPSet); edm::ParameterSetDescription lsPSet; fillHistoPSetDescription(lsPSet, 2500); - histoPSet.add("lsPSet", lsPSet); + histoPSet.add("lsPSet", lsPSet); - desc.add("histoPSet", histoPSet); + desc.add("histoPSet", histoPSet); descriptions.add("psMonitoring", desc); } diff --git a/DQM/HLTEvF/plugins/PSMonitorClient.cc b/DQM/HLTEvF/plugins/PSMonitorClient.cc deleted file mode 100644 index d8fb77ceca6ee..0000000000000 --- a/DQM/HLTEvF/plugins/PSMonitorClient.cc +++ /dev/null @@ -1,119 +0,0 @@ -// C++ headers -#include -#include - -// boost headers -#include - -// Root headers -#include - -// CMSSW headers -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/Run.h" -#include "FWCore/Framework/interface/LuminosityBlock.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/ParameterSet/interface/Registry.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/DQMEDHarvester.h" - -struct MEPSetData { - std::string name; - std::string folder; -}; - -class PSMonitorClient : public DQMEDHarvester { -public: - explicit PSMonitorClient(edm::ParameterSet const &); - ~PSMonitorClient() override = default; - - static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); - static void fillMePSetDescription(edm::ParameterSetDescription &pset); - -private: - static MEPSetData getHistoPSet(edm::ParameterSet pset); - - std::string m_dqm_path; - - void dqmEndLuminosityBlock(DQMStore::IBooker &booker, - DQMStore::IGetter &getter, - edm::LuminosityBlock const &, - edm::EventSetup const &) override; - void dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) override; - - void check(DQMStore::IBooker &booker, DQMStore::IGetter &getter); - - MEPSetData psColumnVSlumiPSet; -}; - -PSMonitorClient::PSMonitorClient(edm::ParameterSet const &config) - : m_dqm_path(config.getUntrackedParameter("dqmPath")), - psColumnVSlumiPSet(getHistoPSet(config.getParameter("me"))) {} - -MEPSetData PSMonitorClient::getHistoPSet(edm::ParameterSet pset) { - return MEPSetData{ - pset.getParameter("name"), - pset.getParameter("folder"), - }; -} - -void PSMonitorClient::fillMePSetDescription(edm::ParameterSetDescription &pset) { - pset.add("folder", "HLT/PSMonitoring"); - pset.add("name", "psColumnVSlumi"); -} - -void PSMonitorClient::dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) { check(booker, getter); } - -void PSMonitorClient::dqmEndLuminosityBlock(DQMStore::IBooker &booker, - DQMStore::IGetter &getter, - edm::LuminosityBlock const &lumi, - edm::EventSetup const &setup) { - check(booker, getter); -} - -#include "FWCore/MessageLogger/interface/MessageLogger.h" -void PSMonitorClient::check(DQMStore::IBooker &booker, DQMStore::IGetter &getter) { - std::string folder = psColumnVSlumiPSet.folder; - std::string name = psColumnVSlumiPSet.name; - - getter.setCurrentFolder(folder); - MonitorElement *psColumnVSlumi = getter.get(psColumnVSlumiPSet.folder + "/" + psColumnVSlumiPSet.name); - // if no ME available, return - if (!psColumnVSlumi) { - edm::LogWarning("PSMonitorClient") << "no " << psColumnVSlumiPSet.name << " ME is available in " - << psColumnVSlumiPSet.folder << std::endl; - return; - } - - /* - TH2F* h = psColumnVSlumi->getTH2F(); - size_t nbinsX = psColumnVSlumi->getNbinsX(); - size_t nbinsY = psColumnVSlumi->getNbinsY(); - - for ( size_t ibinY=1; ibinY < nbinsY; ++ibinY ) - std::cout << h->GetXaxis()->GetBinLabel(ibinY) << std::endl; - for ( size_t ibinX=1; ibinX< nbinsX; ++ibinX ) - if ( psColumnVSlumi->getBinContent(ibinX) ) - std::cout << "ibinX: " << psColumnVSlumi->getBinContent(ibinX) << std::endl; - */ -} - -void PSMonitorClient::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { - // The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters - edm::ParameterSetDescription desc; - desc.addUntracked("dqmPath", "HLT/PSMonitoring"); - - edm::ParameterSetDescription mePSet; - fillMePSetDescription(mePSet); - desc.add("me", mePSet); - - descriptions.add("psMonitorClient", desc); -} - -//define this as a plug-in -#include "FWCore/Framework/interface/MakerMacros.h" -DEFINE_FWK_MODULE(PSMonitorClient); diff --git a/DQM/HLTEvF/test/BuildFile.xml b/DQM/HLTEvF/test/BuildFile.xml new file mode 100644 index 0000000000000..fa3d24558549b --- /dev/null +++ b/DQM/HLTEvF/test/BuildFile.xml @@ -0,0 +1,2 @@ + + diff --git a/DQM/HLTEvF/test/testTriggerMonitors.sh b/DQM/HLTEvF/test/testTriggerMonitors.sh new file mode 100755 index 0000000000000..507d445c664fc --- /dev/null +++ b/DQM/HLTEvF/test/testTriggerMonitors.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Pass in name and status +function die { + printf "\n%s: status %s\n" "$1" "$2" + exit $2 +} + +# run test job +TESTDIR="${LOCALTOP}"/src/DQM/HLTEvF/test + +cmsRun "${TESTDIR}"/testTriggerMonitors_dqm_cfg.py \ + || die "Failure running testTriggerMonitors_dqm_cfg.py" $? + +cmsRun "${TESTDIR}"/testTriggerMonitors_harvesting_cfg.py \ + || die "Failure running testTriggerMonitors_harvesting_cfg.py" $? diff --git a/DQM/HLTEvF/test/testTriggerMonitors_dqm_cfg.py b/DQM/HLTEvF/test/testTriggerMonitors_dqm_cfg.py new file mode 100644 index 0000000000000..30e26715180f6 --- /dev/null +++ b/DQM/HLTEvF/test/testTriggerMonitors_dqm_cfg.py @@ -0,0 +1,124 @@ +import FWCore.ParameterSet.Config as cms + +# VarParsing +import FWCore.ParameterSet.VarParsing as VarParsing +options = VarParsing.VarParsing('analysis') +options.register('nThreads', 4, options.multiplicity.singleton, options.varType.int, 'number of threads') +options.register('nStreams', 0, options.multiplicity.singleton, options.varType.int, 'number of streams') +options.register('globalTag', 'auto:run3_hlt_relval', options.multiplicity.singleton, options.varType.string, 'name of GlobalTag') +options.setDefault('inputFiles', [ + '/store/data/Run2022B/HLTPhysics/RAW/v1/000/355/456/00000/69b26b27-4bd1-4524-bc18-45f7b9b5e076.root', +]) +options.setDefault('maxEvents', 200) +options.setType('outputFile', options.varType.string) +options.setDefault('outputFile', 'DQMIO.root') +options.parseArguments() + +# Process +process = cms.Process('DQM') + +process.options.numberOfThreads = options.nThreads +process.options.numberOfStreams = options.nStreams +process.maxEvents.input = options.maxEvents + +# Source (EDM input) +process.source = cms.Source('PoolSource', + fileNames = cms.untracked.vstring(options.inputFiles), + inputCommands = cms.untracked.vstring( + 'drop *', + 'keep FEDRawDataCollection_rawDataCollector__*', + 'keep edmTriggerResults_TriggerResults__HLT', + ) +) + +# DQMStore (Service) +process.load('DQMServices.Core.DQMStore_cfi') + +# MessageLogger (Service) +process.load('FWCore.MessageLogger.MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 1 + +# FastTimerService (Service) +from HLTrigger.Timer.FastTimerService_cfi import FastTimerService as _FastTimerService +process.FastTimerService = _FastTimerService.clone( + dqmTimeRange = 2000, + enableDQM = True, + enableDQMTransitions = True, + enableDQMbyLumiSection = True, + enableDQMbyModule = True, + enableDQMbyPath = True, + enableDQMbyProcesses = True +) +process.MessageLogger.FastReport = dict() + +# ThroughputService (Service) +from HLTrigger.Timer.ThroughputService_cfi import ThroughputService as _ThroughputService +process.ThroughputService = _ThroughputService.clone( + dqmPathByProcesses = True, + timeRange = 60000, + timeResolution = 5.828 +) +process.MessageLogger.ThroughputService = dict() + +# GlobalTag (ESSource) +from Configuration.AlCa.GlobalTag import GlobalTag as customiseGlobalTag +process.GlobalTag = customiseGlobalTag(globaltag = options.globalTag) + +# EventData modules +from EventFilter.L1TRawToDigi.gtStage2Digis_cfi import gtStage2Digis as _gtStage2Digis +process.gtStage2Digis = _gtStage2Digis.clone() + +from EventFilter.ScalersRawToDigi.ScalersRawToDigi_cfi import scalersRawToDigi as _scalersRawToDigi +process.scalersRawToDigi = _scalersRawToDigi.clone() + +from EventFilter.OnlineMetaDataRawToDigi.onlineMetaDataRawToDigi_cfi import onlineMetaDataRawToDigi as _onlineMetaDataDigis +process.onlineMetaDataDigis = _onlineMetaDataDigis.clone() + +from DQM.HLTEvF.triggerRatesMonitor_cfi import triggerRatesMonitor as _triggerRatesMonitor +process.triggerRatesMonitor = _triggerRatesMonitor.clone( + hltResults = 'TriggerResults::HLT' +) + +from DQM.HLTEvF.triggerBxMonitor_cfi import triggerBxMonitor as _triggerBxMonitor +process.triggerBxMonitor = _triggerBxMonitor.clone( + hltResults = 'TriggerResults::HLT' +) + +from DQM.HLTEvF.triggerBxVsOrbitMonitor_cfi import triggerBxVsOrbitMonitor as _triggerBxVsOrbitMonitor +process.triggerBxVsOrbitMonitor = _triggerBxVsOrbitMonitor.clone( + hltResults = 'TriggerResults::HLT' +) + +from DQM.HLTEvF.lumiMonitor_cfi import lumiMonitor as _lumiMonitor +process.lumiMonitor = _lumiMonitor.clone( + scalers = 'scalersRawToDigi', + onlineMetaDataDigis = 'onlineMetaDataDigis' +) + +from DQM.HLTEvF.psMonitoring_cfi import psMonitoring as _psColumnMonitor +process.psColumnMonitor = _psColumnMonitor.clone( + ugtBXInputTag = 'gtStage2Digis', + histoPSet = dict( + psColumnPSet = dict( + nbins = 20 + ) + ) +) + +# Output module (file in DQM format) +process.dqmOutput = cms.OutputModule('DQMRootOutputModule', + fileName = cms.untracked.string(options.outputFile) +) + +# EndPath +process.endp = cms.EndPath( + process.gtStage2Digis + + process.scalersRawToDigi + + process.onlineMetaDataDigis + + process.triggerRatesMonitor + + process.triggerBxMonitor + + process.triggerBxVsOrbitMonitor + + process.lumiMonitor + + process.psColumnMonitor + + process.dqmOutput +) diff --git a/DQM/HLTEvF/test/testTriggerMonitors_harvesting_cfg.py b/DQM/HLTEvF/test/testTriggerMonitors_harvesting_cfg.py new file mode 100644 index 0000000000000..69ecf61eaaad2 --- /dev/null +++ b/DQM/HLTEvF/test/testTriggerMonitors_harvesting_cfg.py @@ -0,0 +1,98 @@ +import FWCore.ParameterSet.Config as cms + +# VarParsing +import FWCore.ParameterSet.VarParsing as VarParsing +options = VarParsing.VarParsing('analysis') +options.register('nThreads', 4, options.multiplicity.singleton, options.varType.int, 'number of threads') +options.register('nStreams', 0, options.multiplicity.singleton, options.varType.int, 'number of streams') +options.setDefault('inputFiles', ['file:DQMIO.root']) +options.parseArguments() + +# Process +process = cms.Process('HARVESTING') + +process.options.numberOfThreads = options.nThreads +process.options.numberOfStreams = options.nStreams +process.options.numberOfConcurrentLuminosityBlocks = 1 + +# Source (DQM input) +process.source = cms.Source('DQMRootSource', + fileNames = cms.untracked.vstring(options.inputFiles) +) + +# DQMStore (Service) +process.load('DQMServices.Core.DQMStore_cfi') + +# MessageLogger (Service) +process.load('FWCore.MessageLogger.MessageLogger_cfi') + +# Harvesting modules + +# FastTimerService client +from HLTrigger.Timer.fastTimerServiceClient_cfi import fastTimerServiceClient as _fastTimerServiceClient +process.fastTimerServiceClient = _fastTimerServiceClient.clone( + dqmPath = 'HLT/TimerService', + # timing VS lumi + doPlotsVsOnlineLumi = True, + doPlotsVsPixelLumi = False, + onlineLumiME = dict( + folder = 'HLT/LumiMonitoring', + name = 'lumiVsLS', + nbins = 5000, + xmin = 0, + xmax = 20000 + ) +) + +# ThroughputService client +from HLTrigger.Timer.throughputServiceClient_cfi import throughputServiceClient as _throughputServiceClient +process.throughputServiceClient = _throughputServiceClient.clone( + dqmPath = 'HLT/Throughput' +) + +# PS column VS lumi +from DQM.HLTEvF.dqmCorrelationClient_cfi import dqmCorrelationClient as _dqmCorrelationClient +process.psColumnVsLumi = _dqmCorrelationClient.clone( + me = dict( + folder = 'HLT/PSMonitoring', + name = 'psColumnVSlumi', + doXaxis = True, + nbinsX = 5000, + xminX = 0, + xmaxX = 20000, + doYaxis = False, + nbinsY = 8, + xminY = 0, + xmaxY = 8 + ), + me1 = dict( + folder = 'HLT/LumiMonitoring', + name = 'lumiVsLS', + profileX = True + ), + me2 = dict( + folder = 'HLT/PSMonitoring', + name = 'psColumnIndexVsLS', + profileX = True + ) +) + +from DQM.HLTEvF.triggerRatesMonitorClient_cfi import triggerRatesMonitorClient as _triggerRatesMonitorClient +process.triggerRatesMonitorClient = _triggerRatesMonitorClient.clone( + dqmPath = 'HLT/TriggerRates' +) + +# Output module (file in ROOT format) +from DQMServices.Components.DQMFileSaver_cfi import dqmSaver as _dqmSaver +process.dqmSaver = _dqmSaver.clone( + workflow = '/HLTEvF/TestTriggerMonitors/'+process.name_() +) + +# EndPath +process.endp = cms.EndPath( + process.fastTimerServiceClient + + process.throughputServiceClient + + process.psColumnVsLumi + + process.triggerRatesMonitorClient + + process.dqmSaver +) diff --git a/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py b/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py index add27a4f6de6c..4cf721d4f13de 100644 --- a/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py +++ b/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py @@ -83,8 +83,5 @@ ), ) -process.load('DQM.HLTEvF.psMonitorClient_cfi') -process.psChecker = process.psMonitorClient.clone() - print("Final Source settings:", process.source) -process.p = cms.EndPath( process.fastTimerServiceClient + process.throughputServiceClient + process.psColumnVsLumi + process.psChecker + process.dqmEnv + process.dqmSaver + process.dqmSaverPB ) +process.p = cms.EndPath( process.fastTimerServiceClient + process.throughputServiceClient + process.psColumnVsLumi + process.dqmEnv + process.dqmSaver + process.dqmSaverPB ) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index b9151d39259eb..2f0e84337cb70 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -248,6 +248,17 @@ def customizeHLTfor40264(process): return process +def customizeHLTfor40334(process): + + for producer in producers_by_type(process, 'PSMonitor'): + if hasattr(producer, 'FolderName'): + if not hasattr(producer, 'folderName'): + producer.folderName = producer.FolderName + del producer.FolderName + + return process + + # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): @@ -258,5 +269,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"): process = customizeHLTfor38761(process) process = customizeHLTfor40264(process) + process = customizeHLTfor40334(process) return process diff --git a/HLTrigger/Timer/plugins/ThroughputService.cc b/HLTrigger/Timer/plugins/ThroughputService.cc index 9126ce4a32837..7d48f136dc24d 100644 --- a/HLTrigger/Timer/plugins/ThroughputService.cc +++ b/HLTrigger/Timer/plugins/ThroughputService.cc @@ -65,7 +65,7 @@ void ThroughputService::preallocate(edm::service::SystemBounds const& bounds) { void ThroughputService::preGlobalBeginRun(edm::GlobalContext const& gc) { // if the DQMStore is available, book the DQM histograms // check that the DQMStore service is available - if (m_enable_dqm and not edm::Service().isAvailable()) { + if (m_enable_dqm and not edm::Service().isAvailable()) { // the DQMStore is not available, disable all DQM plots m_enable_dqm = false; edm::LogWarning("ThroughputService") << "The DQMStore is not avalable, the DQM plots will not be generated"; @@ -85,6 +85,7 @@ void ThroughputService::preGlobalBeginRun(edm::GlobalContext const& gc) { // define a callback that can book the histograms auto bookTransactionCallback = [&, this](DQMStore::IBooker& booker, DQMStore::IGetter&) { + auto scope = dqm::reco::DQMStore::IBooker::UseRunScope(booker); booker.setCurrentFolder(m_dqm_path); m_sourced_events = booker.book1D("throughput_sourced", "Throughput (sourced events)", bins, 0., range); m_sourced_events->setXTitle("time [s]"); diff --git a/HLTrigger/Timer/plugins/ThroughputService.h b/HLTrigger/Timer/plugins/ThroughputService.h index bb6d85392ede3..f29fa50b1dc17 100644 --- a/HLTrigger/Timer/plugins/ThroughputService.h +++ b/HLTrigger/Timer/plugins/ThroughputService.h @@ -45,8 +45,8 @@ class ThroughputService { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - dqm::reco::MonitorElement* m_sourced_events; - dqm::reco::MonitorElement* m_retired_events; + dqm::reco::MonitorElement* m_sourced_events = nullptr; + dqm::reco::MonitorElement* m_retired_events = nullptr; std::chrono::system_clock::time_point m_startup; diff --git a/HLTrigger/Timer/plugins/ThroughputServiceClient.cc b/HLTrigger/Timer/plugins/ThroughputServiceClient.cc index d6218485f926d..d15da0fc4e86a 100644 --- a/HLTrigger/Timer/plugins/ThroughputServiceClient.cc +++ b/HLTrigger/Timer/plugins/ThroughputServiceClient.cc @@ -32,6 +32,7 @@ class ThroughputServiceClient : public DQMEDHarvester { private: const std::string m_dqm_path; const bool m_dqm_merge; + const bool m_fillEveryLumiSection; void dqmEndLuminosityBlock(DQMStore::IBooker &booker, DQMStore::IGetter &getter, @@ -45,7 +46,8 @@ class ThroughputServiceClient : public DQMEDHarvester { ThroughputServiceClient::ThroughputServiceClient(edm::ParameterSet const &config) : m_dqm_path(config.getUntrackedParameter("dqmPath")), - m_dqm_merge(config.getUntrackedParameter("createSummary")) {} + m_dqm_merge(config.getUntrackedParameter("createSummary")), + m_fillEveryLumiSection(config.getParameter("fillEveryLumiSection")) {} void ThroughputServiceClient::dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) { fillSummaryPlots(booker, getter); @@ -55,7 +57,9 @@ void ThroughputServiceClient::dqmEndLuminosityBlock(DQMStore::IBooker &booker, DQMStore::IGetter &getter, edm::LuminosityBlock const &, edm::EventSetup const &) { - fillSummaryPlots(booker, getter); + if (m_fillEveryLumiSection) { + fillSummaryPlots(booker, getter); + } } void ThroughputServiceClient::fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter) { @@ -70,9 +74,10 @@ void ThroughputServiceClient::fillSummaryPlots(DQMStore::IBooker &booker, DQMSto std::vector subdirs = getter.getSubdirs(); for (auto const &subdir : subdirs) { if (boost::regex_match(subdir, running_n_processes)) { - if (getter.get(subdir + "/throughput_sourced")) + if (getter.get(subdir + "/throughput_sourced")) { // the plots are in a per-number-of-processes subfolder folders.push_back(subdir); + } } } } @@ -146,6 +151,7 @@ void ThroughputServiceClient::fillDescriptions(edm::ConfigurationDescriptions &d edm::ParameterSetDescription desc; desc.addUntracked("dqmPath", "HLT/Throughput"); desc.addUntracked("createSummary", true); + desc.add("fillEveryLumiSection", true); descriptions.add("throughputServiceClient", desc); }