Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:30

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("A")
0004 
0005 process.maxEvents.input = 1
0006 process.source = cms.Source("EmptySource")
0007 
0008 process.load("FWCore.Services.DependencyGraph_cfi")
0009 process.DependencyGraph.fileName = "test_module_delete_dependencygraph.gv"
0010 
0011 intEventProducer = cms.EDProducer("IntProducer", ivalue = cms.int32(1))
0012 intEventProducerMustRun = cms.EDProducer("edmtest::MustRunIntProducer", ivalue = cms.int32(1), mustRunEvent = cms.bool(True))
0013 intEventConsumer = cms.EDAnalyzer("IntTestAnalyzer",
0014     moduleLabel = cms.untracked.InputTag("producerEventConsumed"),
0015     valueMustMatch = cms.untracked.int32(1)
0016 )
0017 intGenericConsumer = cms.EDAnalyzer("edmtest::GenericIntsAnalyzer",
0018     srcEvent = cms.untracked.VInputTag(),
0019     inputShouldExist = cms.untracked.bool(True)
0020 )
0021 
0022 process.producerAEventConsumedInB = intEventProducer.clone(ivalue = 1)
0023 process.producerAEventConsumedInBA = intEventProducer.clone(ivalue = 10)
0024 
0025 process.producerEventNotConsumed = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0026 process.producerBeginLumiNotConsumed = cms.EDProducer("edmtest::TestModuleDeleteInLumiProducer")
0027 process.producerBeginRunNotConsumed = cms.EDProducer("edmtest::TestModuleDeleteInRunProducer")
0028 process.producerBeginProcessNotConsumed = cms.EDProducer("edmtest::TestModuleDeleteInProcessProducer")
0029 
0030 # These producers do not get the event transitions for the events
0031 # where the same-name producers in the SubProcesses produce a product.
0032 # Nevertheless, these producers must not be deleted early, because
0033 # their event transitions might get called.
0034 process.producerEventMaybeConsumedInB = intEventProducerMustRun.clone(mustRunEvent=False)
0035 process.producerEventMaybeConsumedInBA = intEventProducerMustRun.clone(mustRunEvent=False)
0036 
0037 process.producerAEventNotConsumedInB = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0038 process.producerAEventNotConsumedInBA = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0039 
0040 process.producerEventConsumedInB1 = intEventProducerMustRun.clone()
0041 process.producerEventConsumedInB2 = intEventProducerMustRun.clone()
0042 process.producerEventConsumedInBA1 = intEventProducerMustRun.clone()
0043 process.producerEventConsumedInBA2 = intEventProducerMustRun.clone()
0044 
0045 process.intAnalyzerDelete = cms.EDAnalyzer("edmtest::TestModuleDeleteAnalyzer")
0046 
0047 process.t = cms.Task(
0048     process.producerAEventConsumedInB,
0049     #
0050     process.producerAEventConsumedInBA,
0051     #
0052     process.producerEventNotConsumed,
0053     process.producerBeginLumiNotConsumed,
0054     process.producerBeginRunNotConsumed,
0055     process.producerBeginProcessNotConsumed,
0056     #
0057     process.producerEventMaybeConsumedInB,
0058     process.producerEventMaybeConsumedInBA,
0059     #
0060     process.producerAEventNotConsumedInB,
0061     process.producerAEventNotConsumedInBA,
0062     #
0063     process.producerEventConsumedInB1,
0064     process.producerEventConsumedInB2,
0065     process.producerEventConsumedInBA1,
0066     process.producerEventConsumedInBA2,
0067 )
0068 
0069 process.p = cms.Path(process.intAnalyzerDelete, process.t)
0070 
0071 ####################
0072 subprocessB = cms.Process("B")
0073 process.addSubProcess( cms.SubProcess(
0074     process = subprocessB,
0075     SelectEvents = cms.untracked.PSet(),
0076     outputCommands = cms.untracked.vstring()
0077 ) )
0078 
0079 subprocessB.consumerEventFromA = intEventConsumer.clone(moduleLabel = "producerAEventConsumedInB", valueMustMatch = 1)
0080 
0081 subprocessB.producerEventNotConsumed = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0082 
0083 subprocessB.producerEventMaybeConsumedInB = intEventProducerMustRun.clone()
0084 subprocessB.producerEventMaybeConsumedInBA = intEventProducerMustRun.clone(mustRunEvent=False)
0085 subprocessB.consumerEventMaybeInB = intGenericConsumer.clone(srcEvent = ["producerEventMaybeConsumedInB"])
0086 
0087 subprocessB.producerAEventNotConsumedInB = intEventProducerMustRun.clone()
0088 subprocessB.producerAEventNotConsumedInBA = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0089 subprocessB.consumerAEventNotConsumedInB = intGenericConsumer.clone(srcEvent = ["producerAEventNotConsumedInB::B"])
0090 
0091 subprocessB.producerEventConsumedInB1 = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0092 subprocessB.producerEventConsumedInB2 = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0093 subprocessB.consumerEventNotConsumedInB1 = intGenericConsumer.clone(srcEvent = ["producerEventConsumedInB1::A"])
0094 subprocessB.consumerEventNotConsumedInB2 = intGenericConsumer.clone(srcEvent = [cms.InputTag("producerEventConsumedInB2", "", cms.InputTag.skipCurrentProcess())])
0095 subprocessB.producerBEventConsumedInBA1 = intEventProducerMustRun.clone()
0096 subprocessB.producerBEventConsumedInBA2 = intEventProducerMustRun.clone()
0097 
0098 subprocessB.producerBEventConsumedInB1 = intEventProducerMustRun.clone()
0099 subprocessB.producerBEventConsumedInB2 = intEventProducerMustRun.clone()
0100 subprocessB.producerBEventConsumedInB3 = intEventProducerMustRun.clone()
0101 subprocessB.consumerBEventConsumedInB1 = intGenericConsumer.clone(srcEvent = ["producerBEventConsumedInB1"])
0102 subprocessB.consumerBEventConsumedInB2 = intGenericConsumer.clone(srcEvent = ["producerBEventConsumedInB2::B"])
0103 subprocessB.consumerBEventConsumedInB3 = intGenericConsumer.clone(srcEvent = [cms.InputTag("producerBEventConsumedInB3", "", cms.InputTag.currentProcess())])
0104 
0105 
0106 subprocessB.t = cms.Task(
0107     subprocessB.producerEventNotConsumed,
0108     #
0109     subprocessB.producerEventMaybeConsumedInB,
0110     subprocessB.producerEventMaybeConsumedInBA,
0111     #
0112     subprocessB.producerAEventNotConsumedInB,
0113     subprocessB.producerAEventNotConsumedInBA,
0114     #
0115     subprocessB.producerEventConsumedInB1,
0116     subprocessB.producerEventConsumedInB2,
0117     subprocessB.producerBEventConsumedInBA1,
0118     subprocessB.producerBEventConsumedInBA2,
0119     #
0120     subprocessB.producerBEventConsumedInB1,
0121     subprocessB.producerBEventConsumedInB2,
0122     subprocessB.producerBEventConsumedInB3,
0123 )
0124 subprocessB.p = cms.Path(
0125     subprocessB.consumerEventFromA+
0126     #
0127     subprocessB.consumerEventMaybeInB+
0128     #
0129     subprocessB.consumerAEventNotConsumedInB+
0130     subprocessB.consumerEventNotConsumedInB1+
0131     subprocessB.consumerEventNotConsumedInB2+
0132     #
0133     subprocessB.consumerBEventConsumedInB1+
0134     subprocessB.consumerBEventConsumedInB2+
0135     subprocessB.consumerBEventConsumedInB3
0136     ,subprocessB.t
0137 )
0138 
0139 ####################
0140 subprocessBA = cms.Process("BA")
0141 subprocessB.addSubProcess( cms.SubProcess(
0142     process = subprocessBA,
0143     SelectEvents = cms.untracked.PSet(),
0144     outputCommands = cms.untracked.vstring()
0145 ) )
0146 
0147 subprocessBA.consumerEventFromA = intEventConsumer.clone(moduleLabel = "producerAEventConsumedInBA", valueMustMatch = 10)
0148 
0149 subprocessBA.producerEventMaybeConsumedInBA = intEventProducerMustRun.clone()
0150 subprocessBA.consumerEventMaybeInBA = intGenericConsumer.clone(srcEvent = ["producerEventMaybeConsumedInBA"])
0151 
0152 subprocessBA.producerAEventNotConsumedInBA = intEventProducerMustRun.clone()
0153 subprocessBA.consumerAEventNotConsumedInBA = intGenericConsumer.clone(srcEvent = ["producerAEventNotConsumedInBA::BA"])
0154 
0155 subprocessBA.producerEventConsumedInBA1 = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0156 subprocessBA.producerEventConsumedInBA2 = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0157 subprocessBA.producerBEventConsumedInBA1 = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0158 subprocessBA.producerBEventConsumedInBA2 = cms.EDProducer("edmtest::TestModuleDeleteProducer")
0159 subprocessBA.consumerEventNotConsumedInBA1 = intGenericConsumer.clone(srcEvent = ["producerEventConsumedInBA1::A",
0160                                                                                   "producerBEventConsumedInBA1::B"])
0161 subprocessBA.consumerEventNotConsumedInBA2 = intGenericConsumer.clone(srcEvent = [
0162     cms.InputTag("producerEventConsumedInBA2", "", cms.InputTag.skipCurrentProcess()),
0163     cms.InputTag("producerBEventConsumedInBA2", "", cms.InputTag.skipCurrentProcess())
0164 ])
0165 
0166 subprocessBA.t = cms.Task(
0167     subprocessBA.producerEventMaybeConsumedInBA,
0168     #
0169     subprocessBA.producerAEventNotConsumedInBA,
0170     #
0171     subprocessBA.producerEventConsumedInBA1,
0172     subprocessBA.producerEventConsumedInBA2,
0173     subprocessBA.producerBEventConsumedInBA1,
0174     subprocessBA.producerBEventConsumedInBA2,
0175 )
0176 subprocessBA.p = cms.Path(
0177     subprocessBA.consumerEventFromA+
0178     #
0179     subprocessBA.consumerEventMaybeInBA+
0180     #
0181     subprocessBA.consumerAEventNotConsumedInBA+
0182     #
0183     subprocessBA.consumerEventNotConsumedInBA1+
0184     subprocessBA.consumerEventNotConsumedInBA2
0185     , subprocessBA.t
0186 )