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 run the DQMFileSaver on DQMIO input files.',
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 DQMIO input files',
0020                     default = ['file:testHLTFiltersDQMonitor_DQMIO.root'])
0021 
0022 argv = sys.argv[:]
0023 if '--' in argv:
0024     argv.remove('--')
0025 args, unknown = parser.parse_known_args(argv)
0026 
0027 # Process
0028 process = cms.Process('HARVESTING')
0029 
0030 process.options.numberOfThreads = args.nThreads
0031 process.options.numberOfStreams = args.nStreams
0032 process.options.numberOfConcurrentLuminosityBlocks = 1
0033 
0034 # Source (DQM input)
0035 process.source = cms.Source('DQMRootSource',
0036   fileNames = cms.untracked.vstring(args.inputFiles)
0037 )
0038 
0039 # DQMStore (Service)
0040 process.load('DQMServices.Core.DQMStore_cfi')
0041 
0042 # MessageLogger (Service)
0043 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0044 
0045 # Output module (file in ROOT format)
0046 from DQMServices.Components.DQMFileSaver_cfi import dqmSaver as _dqmSaver
0047 process.dqmSaver = _dqmSaver.clone(
0048   workflow = '/DQMOffline/Trigger/'+process.name_()
0049 )
0050 
0051 # EndPath
0052 process.endp = cms.EndPath(
0053   process.dqmSaver
0054 )