Skip to content

Commit

Permalink
added unit test for HLT online-DQM plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
missirol committed Dec 15, 2022
1 parent 43ab22e commit cb81125
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DQM/HLTEvF/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- test of HLT monitoring plugins (DQM + Harvesting) -->
<test name="test_TriggerMonitors" command="testTriggerMonitors.sh"/>
19 changes: 19 additions & 0 deletions DQM/HLTEvF/test/testTriggerMonitors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Pass in name and status
function die {
echo $1: status $2
echo === Log file ===
cat ${3:-/dev/null}
echo === End log file ===
exit $2
}

# run test job
TESTDIR="${LOCALTOP}"/src/DQM/HLTEvF/test

cmsRun "${TESTDIR}"/testTriggerMonitors_dqm_cfg.py &> log_testTriggerMonitors_dqm \
|| die "Failure running testTriggerMonitors_dqm_cfg.py" $? log_testTriggerMonitors_dqm

cmsRun "${TESTDIR}"/testTriggerMonitors_harvesting_cfg.py &> log_testTriggerMonitors_harvesting \
|| die "Failure running testTriggerMonitors_harvesting_cfg.py" $? log_testTriggerMonitors_harvesting
124 changes: 124 additions & 0 deletions DQM/HLTEvF/test/testTriggerMonitors_dqm_cfg.py
Original file line number Diff line number Diff line change
@@ -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
)
98 changes: 98 additions & 0 deletions DQM/HLTEvF/test/testTriggerMonitors_harvesting_cfg.py
Original file line number Diff line number Diff line change
@@ -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
)

0 comments on commit cb81125

Please sign in to comment.