Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-09 23:33:32

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import argparse
0004 import sys
0005 
0006 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test ConditionalTasks.')
0007 
0008 parser.add_argument("--extraProducers", help="Add extra producers to configuration", action="store_true")
0009 parser.add_argument("--fileName", help="name of output file")
0010 parser.add_argument("--firstLumi", help="LuminosityBlock number for first lumi", type = int, default=1)
0011 parser.add_argument("--keepAllProducts", help="Keep all products made in the job", action="store_true")
0012 parser.add_argument("--dropThings", help="drop the Things collections so the refs will not function", action="store_true")
0013 
0014 args = parser.parse_args()
0015 
0016 
0017 process = cms.Process("PROD")
0018 
0019 nEvents = 10
0020 from FWCore.Modules.modules import EmptySource
0021 process.source = EmptySource(
0022                                 firstLuminosityBlock = args.firstLumi,
0023                                 firstEvent = nEvents*(args.firstLumi-1)+1
0024 )
0025 
0026 process.maxEvents.input = nEvents
0027 
0028 if args.extraProducers:
0029     from FWCore.Framework.modules import IntProducer
0030     process.a = IntProducer(ivalue = 1)
0031 
0032     process.b = IntProducer(ivalue = 2)
0033 
0034 from FWCore.Integration.modules import ThingProducer, OtherThingProducer, OtherThingAnalyzer
0035 process.c = ThingProducer()
0036 
0037 process.d = OtherThingProducer(thingTag="c")
0038 
0039 outputs = []
0040 if not args.keepAllProducts:
0041     outputs = ["drop *",
0042                 "keep edmtestOtherThings_*_*_*"]
0043     if not args.dropThings:
0044         outputs.append("keep edmtestThings_*_*_*")
0045     
0046 
0047 from IOPool.Output.modules import PoolOutputModule
0048 process.o = PoolOutputModule(outputCommands = outputs,
0049                              fileName = args.fileName
0050                              )
0051 if args.extraProducers:
0052     process.p = cms.Path(process.a+process.b+process.c*process.d)
0053 else:
0054     process.p = cms.Path(process.c*process.d)
0055 
0056 process.tester = OtherThingAnalyzer(other = ("d","testUserTag"))
0057 
0058 process.out = cms.EndPath(process.o+process.tester)
0059 
0060 
0061                              
0062 
0063