Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:36

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process( "TEST" )
0004 
0005 process.options = cms.untracked.PSet(
0006     wantSummary = cms.untracked.bool(True)
0007 )
0008 
0009 process.source = cms.Source( "EmptySource" )
0010 
0011 process.maxEvents = cms.untracked.PSet(
0012     input = cms.untracked.int32( 10 )
0013 )
0014 
0015 # producer
0016 process.two = cms.EDProducer("BusyWaitIntProducer", ivalue = cms.int32(2), iterations=cms.uint32(5*1000))
0017 
0018 # producer
0019 process.four = cms.EDProducer("BusyWaitIntProducer", ivalue = cms.int32(4), iterations=cms.uint32(10*1000))
0020 process.fourConsumer = cms.EDAnalyzer("MultipleIntsAnalyzer", getFromModules=cms.untracked.VInputTag("four"))
0021 
0022 # producer
0023 process.ten = cms.EDProducer("BusyWaitIntProducer", ivalue = cms.int32(10), iterations=cms.uint32(2*1000))
0024 
0025 process.adder = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag('two','ten'))
0026 
0027 process.task = cms.Task(process.two, process.four, process.ten, process.adder)
0028 
0029 process.path = cms.Path(process.fourConsumer, process.task)
0030 
0031 subprocess = cms.Process("SUB")
0032 process.addSubProcess( cms.SubProcess(
0033     process = subprocess, 
0034     SelectEvents = cms.untracked.PSet(), 
0035     outputCommands = cms.untracked.vstring()
0036 ) )
0037 
0038 subprocess.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True))
0039 # module, reads products from 'adder' in the parent process
0040 subprocess.final = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag('adder'))
0041 
0042 subprocess.subpath = cms.Path( subprocess.final )
0043 
0044 subprocess.test = cms.EDAnalyzer("TestParentage",
0045                                  inputTag = cms.InputTag("final"),
0046                                  expectedAncestors = cms.vstring("two", "ten", "adder")
0047 )
0048 
0049 subprocess.out = cms.OutputModule("PoolOutputModule",
0050     fileName = cms.untracked.string('testSubProcessUnscheduled.root'),
0051     outputCommands = cms.untracked.vstring(
0052         'drop *', 
0053         'keep *_final_*_*',
0054     )
0055 )
0056 subprocess.o = cms.EndPath(subprocess.test * subprocess.out)