Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:58:52

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 ## CLI parser
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 argv = sys.argv[:]
0035 if '--' in argv:
0036     argv.remove('--')
0037 args, unknown = parser.parse_known_args(argv)
0038 
0039 ## Process
0040 process = cms.Process('TEST')
0041 
0042 process.options.numberOfThreads = args.nThreads
0043 process.options.numberOfStreams = args.nStreams
0044 process.options.wantSummary = args.wantSummary
0045 process.maxEvents.input = args.maxEvents
0046 
0047 ## Source
0048 process.source = cms.Source('PoolSource',
0049     fileNames = cms.untracked.vstring(args.inputFiles),
0050     inputCommands = cms.untracked.vstring(
0051         'drop *',
0052         'keep edmTriggerResults_*_*_*',
0053         'keep triggerTriggerEvent_*_*_*',
0054         'keep triggerTriggerEventWithRefs_*_*_*'
0055     )
0056 )
0057 
0058 ## MessageLogger (Service)
0059 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0060 process.MessageLogger.cerr.FwkReport.reportEvery = 1 # only report every Nth event start
0061 process.MessageLogger.cerr.FwkReport.limit = -1      # max number of reported messages (all if -1)
0062 process.MessageLogger.cerr.enableStatistics = False  # enable "MessageLogger Summary" message
0063 
0064 ## DQMStore (Service)
0065 process.load('DQMServices.Core.DQMStore_cfi')
0066 
0067 ## FastTimerService (Service)
0068 from HLTrigger.Timer.FastTimerService_cfi import FastTimerService as _FastTimerService
0069 process.FastTimerService = _FastTimerService.clone(
0070     enableDQM = False,
0071     printEventSummary = False,
0072     printJobSummary = True,
0073     printRunSummary = False,
0074     writeJSONSummary = False
0075 )
0076 process.MessageLogger.FastReport = dict()
0077 
0078 ## EventData Modules
0079 from DQMOffline.Trigger.dqmHLTFiltersDQMonitor_cfi import dqmHLTFiltersDQMonitor as _dqmHLTFiltersDQMonitor
0080 process.dqmHLTFiltersDQMonitor = _dqmHLTFiltersDQMonitor.clone(
0081     folderName = 'HLT/Filters',
0082     efficPlotNamePrefix = 'effic_',
0083     triggerResults = 'TriggerResults::HLT',
0084     triggerEvent = 'hltTriggerSummaryAOD::HLT',
0085     triggerEventWithRefs = 'hltTriggerSummaryRAW::HLT'
0086 )
0087 process.MessageLogger.HLTFiltersDQMonitor = dict()
0088 if args.debugMode:
0089     process.MessageLogger.cerr.threshold = 'DEBUG'
0090     process.MessageLogger.debugModules = ['dqmHLTFiltersDQMonitor']
0091 
0092 ## Output Modules
0093 process.dqmOutput = cms.OutputModule('DQMRootOutputModule',
0094     fileName = cms.untracked.string(args.outputFile)
0095 )
0096 
0097 ## Path
0098 process.testPath = cms.Path(
0099     process.dqmHLTFiltersDQMonitor
0100 )
0101 
0102 ## EndPath
0103 process.testEndPath = cms.EndPath(
0104     process.dqmOutput
0105 )