File indexing completed on 2024-04-06 12:10:05
0001 import FWCore.ParameterSet.Config as cms
0002
0003
0004 import argparse
0005 import sys
0006
0007 parser = argparse.ArgumentParser(
0008 prog = 'cmsRun '+sys.argv[0]+' --',
0009 description = 'Configuration file to test of the HLTFiltersDQMonitor plugin.',
0010 formatter_class = argparse.ArgumentDefaultsHelpFormatter
0011 )
0012
0013 parser.add_argument('-t', '--nThreads', type = int, help = 'Number of threads',
0014 default = 4)
0015
0016 parser.add_argument('-s', '--nStreams', type = int, help = 'Number of EDM streams',
0017 default = 0)
0018
0019 parser.add_argument('-i', '--inputFiles', nargs = '+', help = 'List of EDM input files',
0020 default = ['/store/relval/CMSSW_12_6_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/125X_mcRun3_2022_realistic_v3-v1/2580000/2d96539c-b321-401f-b7b2-51884a5d421f.root'])
0021
0022 parser.add_argument('-n', '--maxEvents', type = int, help = 'Number of input events',
0023 default = 100)
0024
0025 parser.add_argument('-o', '--outputFile', type = str, help = 'Path to output file in DQMIO format',
0026 default = 'testHLTFiltersDQMonitor_DQMIO.root')
0027
0028 parser.add_argument('--wantSummary', action = 'store_true', help = 'Value of process.options.wantSummary',
0029 default = False)
0030
0031 parser.add_argument('-d', '--debugMode', action = 'store_true', help = 'Enable debug info (requires recompiling first with \'USER_CXXFLAGS="-DEDM_ML_DEBUG" scram b\')',
0032 default = False)
0033
0034 args = parser.parse_args()
0035
0036
0037 process = cms.Process('TEST')
0038
0039 process.options.numberOfThreads = args.nThreads
0040 process.options.numberOfStreams = args.nStreams
0041 process.options.wantSummary = args.wantSummary
0042 process.maxEvents.input = args.maxEvents
0043
0044
0045 process.source = cms.Source('PoolSource',
0046 fileNames = cms.untracked.vstring(args.inputFiles),
0047 inputCommands = cms.untracked.vstring(
0048 'drop *',
0049 'keep edmTriggerResults_*_*_*',
0050 'keep triggerTriggerEvent_*_*_*',
0051 'keep triggerTriggerEventWithRefs_*_*_*'
0052 )
0053 )
0054
0055
0056 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0057 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0058 process.MessageLogger.cerr.FwkReport.limit = -1
0059 process.MessageLogger.cerr.enableStatistics = False
0060
0061
0062 process.load('DQMServices.Core.DQMStore_cfi')
0063
0064
0065 from HLTrigger.Timer.FastTimerService_cfi import FastTimerService as _FastTimerService
0066 process.FastTimerService = _FastTimerService.clone(
0067 enableDQM = False,
0068 printEventSummary = False,
0069 printJobSummary = True,
0070 printRunSummary = False,
0071 writeJSONSummary = False
0072 )
0073 process.MessageLogger.FastReport = dict()
0074
0075
0076 from DQMOffline.Trigger.dqmHLTFiltersDQMonitor_cfi import dqmHLTFiltersDQMonitor as _dqmHLTFiltersDQMonitor
0077 process.dqmHLTFiltersDQMonitor = _dqmHLTFiltersDQMonitor.clone(
0078 folderName = 'HLT/Filters',
0079 efficPlotNamePrefix = 'effic_',
0080 triggerResults = 'TriggerResults::HLT',
0081 triggerEvent = 'hltTriggerSummaryAOD::HLT',
0082 triggerEventWithRefs = 'hltTriggerSummaryRAW::HLT'
0083 )
0084 process.MessageLogger.HLTFiltersDQMonitor = dict()
0085 if args.debugMode:
0086 process.MessageLogger.cerr.threshold = 'DEBUG'
0087 process.MessageLogger.debugModules = ['dqmHLTFiltersDQMonitor']
0088
0089
0090 process.dqmOutput = cms.OutputModule('DQMRootOutputModule',
0091 fileName = cms.untracked.string(args.outputFile)
0092 )
0093
0094
0095 process.testPath = cms.Path(
0096 process.dqmHLTFiltersDQMonitor
0097 )
0098
0099
0100 process.testEndPath = cms.EndPath(
0101 process.dqmOutput
0102 )