File indexing completed on 2024-04-06 12:10:12
0001 import FWCore.ParameterSet.Config as cms
0002
0003 process = cms.Process("TEST")
0004 process.DQMStore = cms.Service("DQMStore")
0005 process.MessageLogger = cms.Service("MessageLogger")
0006
0007 process.load("DQMServices.Demo.test_cfi")
0008 process.load("DQMServices.Demo.testone_cfi")
0009 process.load("DQMServices.Demo.testonefillrun_cfi")
0010 process.load("DQMServices.Demo.testonelumi_cfi")
0011 process.load("DQMServices.Demo.testonelumifilllumi_cfi")
0012 process.load("DQMServices.Demo.testglobal_cfi")
0013 process.load("DQMServices.Demo.testglobalrunsummary_cfi")
0014 process.load("DQMServices.Demo.testlegacy_cfi")
0015 process.load("DQMServices.Demo.testlegacyfillrun_cfi")
0016 process.load("DQMServices.Demo.testlegacyfilllumi_cfi")
0017 process.test_general = cms.Sequence(process.test
0018 + process.testglobal
0019 + process.testglobalrunsummary)
0020 process.test_one = cms.Sequence(process.testone
0021 + process.testonefillrun)
0022 process.test_legacy = cms.Sequence(process.testonelumi + process.testonelumifilllumi
0023 + process.testlegacy + process.testlegacyfillrun + process.testlegacyfilllumi)
0024
0025 import FWCore.ParameterSet.VarParsing as VarParsing
0026 parser = VarParsing.VarParsing('python')
0027 one = VarParsing.VarParsing.multiplicity.singleton
0028 int = VarParsing.VarParsing.varType.int
0029 bool = VarParsing.VarParsing.varType.bool
0030 string = VarParsing.VarParsing.varType.string
0031 parser.register('nolegacy', False, one, bool, "Don't run modules which block concurrent lumis.")
0032 parser.register('noone', False, one, bool, "Don't run any one modules.")
0033 parser.register('legacyoutput', False, one, bool, "Use DQMFileSaver for output instead of DQMIO.")
0034 parser.register('protobufoutput', False, one, bool, "Use DQMFileSaverPB for output instead of DQMIO.")
0035 parser.register('onlineoutput', False, one, bool, "Use DQMFileSaverOnline for output instead of DQMIO. This *does not* cover live mode.")
0036 parser.register('metoedmoutput', False, one, bool, "Use MEtoEDMConverter and PoolOutputModule for output.")
0037 parser.register('firstLuminosityBlock', 1, one, int, "See EmptySource.")
0038 parser.register('firstEvent', 1, one, int, "See EmptySource.")
0039 parser.register('firstRun', 1, one, int, "See EmptySource.")
0040 parser.register('numberEventsInRun', 100, one, int, "See EmptySource.")
0041 parser.register('numberEventsInLuminosityBlock', 20, one, int, "See EmptySource.")
0042 parser.register('processingMode', 'RunsLumisAndEvents', one, string, "See EmptySource.")
0043 parser.register('nEvents', 100, one, int, "Total number of events.")
0044 parser.register('nLumisections', -1, one, int, "Total number of lumisections.")
0045 parser.register('nThreads', 1, one, int, "Number of threads and streams.")
0046 parser.register('nConcurrent', 1, one, int, "Number of concurrent runs/lumis.")
0047 parser.register('howmany', 1, one, int, "Number of MEs to book of each type.")
0048 parser.register('outfile', "dqm.root", one, string, "Output file name.")
0049 parser.parseArguments()
0050 args = parser
0051
0052
0053 process.source = cms.Source("EmptySource", numberEventsInRun = cms.untracked.uint32(args.numberEventsInRun),
0054 numberEventsInLuminosityBlock = cms.untracked.uint32(args.numberEventsInLuminosityBlock),
0055 firstLuminosityBlock = cms.untracked.uint32(args.firstLuminosityBlock),
0056 firstEvent = cms.untracked.uint32(args.firstEvent),
0057 firstRun = cms.untracked.uint32(args.firstRun),
0058 processingMode = cms.untracked.string(args.processingMode))
0059
0060 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(args.nEvents) )
0061 if args.nLumisections > 0:
0062 process.maxLuminosityBlocks = cms.untracked.PSet( input = cms.untracked.int32(args.nLumisections) )
0063
0064
0065 process.options = cms.untracked.PSet(
0066 numberOfThreads = cms.untracked.uint32(args.nThreads),
0067 numberOfStreams = cms.untracked.uint32(args.nThreads),
0068 numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(args.nConcurrent),
0069
0070 numberOfConcurrentRuns = cms.untracked.uint32(1)
0071 )
0072
0073 if args.nConcurrent > 1:
0074 process.DQMStore.assertLegacySafe = cms.untracked.bool(False)
0075
0076 for mod in [process.test, process.testglobal, process.testglobalrunsummary, process.testone, process.testonefillrun, process.testonelumi, process.testonelumifilllumi, process.testlegacy, process.testlegacyfillrun, process.testlegacyfilllumi]:
0077 mod.howmany = args.howmany
0078
0079 if args.noone:
0080 process.p = cms.Path(process.test_general)
0081 elif args.nolegacy:
0082 process.p = cms.Path(process.test_general + process.test_one)
0083 else:
0084 process.p = cms.Path(process.test_general + process.test_one + process.test_legacy)
0085
0086
0087 process.out = cms.OutputModule(
0088 "DQMRootOutputModule",
0089 fileName = cms.untracked.string(args.outfile),
0090 outputCommands = cms.untracked.vstring(
0091 'keep *'
0092 )
0093 )
0094
0095
0096 process.dqmSaver = cms.EDAnalyzer("DQMFileSaver",
0097 convention = cms.untracked.string('Offline'),
0098 fileFormat = cms.untracked.string('ROOT'),
0099 producer = cms.untracked.string('DQM'),
0100 workflow = cms.untracked.string('/EmptySource/DQMTests/DQMIO'),
0101 dirName = cms.untracked.string('.'),
0102 saveByRun = cms.untracked.int32(-1),
0103 saveAtJobEnd = cms.untracked.bool(True),
0104 )
0105
0106
0107 process.pbSaver = cms.EDAnalyzer("DQMFileSaverPB",
0108 producer = cms.untracked.string('DQM'),
0109 path = cms.untracked.string('./'),
0110 tag = cms.untracked.string('UNKNOWN'),
0111 fakeFilterUnitMode = cms.untracked.bool(True),
0112 streamLabel = cms.untracked.string("streamDQMHistograms"),
0113 )
0114
0115 process.onlineSaver = cms.EDAnalyzer("DQMFileSaverOnline",
0116 producer = cms.untracked.string('DQM'),
0117 path = cms.untracked.string('./'),
0118 tag = cms.untracked.string('UNKNOWN'),
0119 backupLumiCount = cms.untracked.int32(2),
0120 keepBackupLumi = cms.untracked.bool(False)
0121 )
0122
0123
0124 process.MEtoEDMConverter = cms.EDProducer("MEtoEDMConverter",
0125 Name = cms.untracked.string('MEtoEDMConverter'),
0126 Verbosity = cms.untracked.int32(0),
0127 Frequency = cms.untracked.int32(50),
0128 MEPathToSave = cms.untracked.string('')
0129 )
0130 process.metoedmoutput = cms.OutputModule("PoolOutputModule",
0131 dataset = cms.untracked.PSet(
0132 dataTier = cms.untracked.string('ALCARECO'),
0133 ),
0134 fileName = cms.untracked.string(args.outfile),
0135 outputCommands = cms.untracked.vstring(
0136 'keep *'
0137 )
0138 )
0139
0140
0141 if args.legacyoutput:
0142 process.o = cms.EndPath(process.dqmSaver)
0143 elif args.protobufoutput:
0144 process.o = cms.EndPath(process.pbSaver)
0145 elif args.onlineoutput:
0146 process.o = cms.EndPath(process.onlineSaver)
0147 elif args.metoedmoutput:
0148 process.o = cms.EndPath(process.MEtoEDMConverter + process.metoedmoutput)
0149 else:
0150 process.o = cms.EndPath(process.out)
0151
0152
0153
0154