Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-24 02:12:43

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 class SwitchProducerTest(cms.SwitchProducer):
0004     def __init__(self, **kargs):
0005         super(SwitchProducerTest,self).__init__(
0006             dict(
0007                 test1 = lambda accelerators: (True, -10),
0008                 test2 = lambda accelerators: (True, -9)
0009             ), **kargs)
0010 
0011 process = cms.Process("PROD1")
0012 
0013 process.options = cms.untracked.PSet(
0014     numberOfStreams = cms.untracked.uint32(1),
0015     numberOfConcurrentRuns = cms.untracked.uint32(1),
0016     numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1)
0017 )
0018 
0019 process.source = cms.Source("EmptySource")
0020 
0021 process.maxEvents = cms.untracked.PSet(
0022     input = cms.untracked.int32(3)
0023 )
0024 
0025 process.out = cms.OutputModule("PoolOutputModule",
0026     fileName = cms.untracked.string('testSwitchProducerPathWrongOrder.root'),
0027     outputCommands = cms.untracked.vstring(
0028         'keep *_intProducerAlias_*_*'
0029     )
0030 )
0031 
0032 process.intProducer1 = cms.EDProducer("ManyIntProducer", ivalue = cms.int32(1), throw = cms.untracked.bool(True))
0033 process.intProducer3 = cms.EDProducer("ManyIntProducer", ivalue = cms.int32(3), values = cms.VPSet(cms.PSet(instance=cms.string("foo"),value=cms.int32(31))))
0034 
0035 # SwitchProducer with an alias
0036 process.intProducerAlias = SwitchProducerTest(
0037     test1 = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag("intProducer1")),
0038     test2 = cms.EDAlias(intProducer3 = cms.VPSet(cms.PSet(type = cms.string("edmtestIntProduct"), fromProductInstance = cms.string(""), toProductInstance = cms.string("")),
0039                                                  cms.PSet(type = cms.string("edmtestIntProduct"), fromProductInstance = cms.string("foo"), toProductInstance = cms.string("other"))))
0040 )
0041 
0042 process.t = cms.Task(process.intProducer1)
0043 process.p = cms.Path(process.intProducerAlias + process.intProducer3, process.t)
0044 
0045 process.e = cms.EndPath(process.out)