Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("PROD")
0004 
0005 process.load("FWCore.MessageService.MessageLogger_cfi")
0006 process.MessageLogger.cerr.FwkReport.reportEvery = 1000
0007 
0008 import FWCore.Framework.test.cmsExceptionsFatal_cff
0009 process.options = FWCore.Framework.test.cmsExceptionsFatal_cff.options
0010 
0011 process.maxEvents = cms.untracked.PSet(
0012     input = cms.untracked.int32(10)
0013 )
0014 
0015 process.source = cms.Source("EmptySource",
0016     firstLuminosityBlock = cms.untracked.uint32(1),
0017     numberEventsInLuminosityBlock = cms.untracked.uint32(100),
0018     firstEvent = cms.untracked.uint32(1),
0019     firstRun = cms.untracked.uint32(1),
0020     numberEventsInRun = cms.untracked.uint32(100)
0021 )
0022 
0023 process.thingWithMergeProducer = cms.EDProducer("ThingWithMergeProducer",
0024     changeIsEqualValue = cms.untracked.bool(True),
0025     labelsToGet = cms.untracked.vstring('m3')
0026 )
0027 
0028 # These are here only for tests of parentage merging
0029 process.m1 = cms.EDProducer("ThingWithMergeProducer")
0030 process.m2 = cms.EDProducer("ThingWithMergeProducer")
0031 process.m3 = cms.EDProducer("ThingWithMergeProducer")
0032 
0033 process.tryNoPut = cms.EDProducer("ThingWithMergeProducer",
0034     noPut = cms.untracked.bool(True)
0035 )
0036 
0037 # This one tests products dropped and then restored by secondary file
0038 # input
0039 process.makeThingToBeDropped = cms.EDProducer("ThingWithMergeProducer")
0040 
0041 process.makeThingToBeDropped2 = cms.EDProducer("ThingWithMergeProducer")
0042 
0043 process.aliasForThingToBeDropped2 = cms.EDAlias(
0044     makeThingToBeDropped2  = cms.VPSet(
0045       cms.PSet(type = cms.string('edmtestThing'),
0046                fromProductInstance = cms.string('event'),
0047                toProductInstance = cms.string('instance2')),
0048       cms.PSet(type = cms.string('edmtestThing'),
0049                fromProductInstance = cms.string('endLumi'),
0050                toProductInstance = cms.string('endLumi2')),
0051       cms.PSet(type = cms.string('edmtestThing'),
0052                fromProductInstance = cms.string('endRun'),
0053                toProductInstance = cms.string('endRun2'))
0054     )
0055 )
0056 
0057 # This product will be produced in configuration PROD1 and PROD5
0058 # In PROD2 it will be produced and dropped and there will be another
0059 # product whose provenance includes it as a parent. In PROD3 it will
0060 # be produced and dropped and there will not be a product that includes
0061 # it as a parent. In PROD4 it will never be produced at all.
0062 process.makeThingToBeDropped1 = cms.EDProducer("ThingWithMergeProducer")
0063 process.dependsOnThingToBeDropped1 = cms.EDProducer("ThingWithMergeProducer")
0064 
0065 process.test = cms.EDAnalyzer("TestMergeResults",
0066 
0067     #   Check to see that the value we read matches what we know
0068     #   was written. Expected values listed below come in sets of three
0069     #      value expected in Thing
0070     #      value expected in ThingWithMerge
0071     #      value expected in ThingWithIsEqual
0072     #   Each set of 3 is tested at endRun for the expected
0073     #   run values or at endLuminosityBlock for the expected
0074     #   lumi values. And then the next set of three values
0075     #   is tested at the next endRun or endLuminosityBlock.
0076     #   When the sequence of parameter values is exhausted it stops checking
0077     #   0's are just placeholders, if the value is a "0" the check is not made.
0078     expectedBeginRunProd = cms.untracked.vint32(
0079         10001,  10002,   10004
0080     ),
0081 
0082     expectedEndRunProd = cms.untracked.vint32(
0083         100001, 100002, 100004
0084     ),
0085 
0086     expectedBeginLumiProd = cms.untracked.vint32(
0087         101,       102,    104
0088     ),
0089 
0090     expectedEndLumiProd = cms.untracked.vint32(
0091         1001,     1002,   1004
0092     ),
0093 
0094     verbose = cms.untracked.bool(False),
0095 
0096     expectedParents = cms.untracked.vstring(
0097         'm3', 'm3', 'm3', 'm3', 'm3',
0098         'm3', 'm3', 'm3', 'm3', 'm3'),
0099     testAlias = cms.untracked.bool(True)
0100 )
0101 
0102 process.A = cms.EDProducer("ThingWithMergeProducer")
0103 
0104 process.B = cms.EDProducer("ThingWithMergeProducer",
0105     labelsToGet = cms.untracked.vstring('A')
0106 )
0107 
0108 process.C = cms.EDProducer("ThingWithMergeProducer",
0109     labelsToGet = cms.untracked.vstring('A')
0110 )
0111 
0112 process.D = cms.EDProducer("ThingWithMergeProducer",
0113     labelsToGet = cms.untracked.vstring('B')
0114 )
0115 
0116 process.E = cms.EDProducer("ThingWithMergeProducer",
0117     labelsToGet = cms.untracked.vstring('B', 'C')
0118 )
0119 
0120 process.F = cms.EDProducer("ThingWithMergeProducer",
0121     labelsToGet = cms.untracked.vstring('C')
0122 )
0123 
0124 process.G = cms.EDProducer("ThingWithMergeProducer",
0125     labelsToGet = cms.untracked.vstring('A')
0126 )
0127 
0128 process.H = cms.EDProducer("ThingWithMergeProducer",
0129     labelsToGet = cms.untracked.vstring('G')
0130 )
0131 
0132 process.I = cms.EDProducer("ThingWithMergeProducer",
0133     labelsToGet = cms.untracked.vstring('A')
0134 )
0135 
0136 process.J = cms.EDProducer("ThingWithMergeProducer",
0137     labelsToGet = cms.untracked.vstring('I')
0138 )
0139 
0140 process.K = cms.EDProducer("ThingWithMergeProducer",
0141     labelsToGet = cms.untracked.vstring('I')
0142 )
0143 
0144 process.L = cms.EDProducer("ThingWithMergeProducer",
0145     labelsToGet = cms.untracked.vstring('F')
0146 )
0147 
0148 process.out = cms.OutputModule("PoolOutputModule",
0149     fileName = cms.untracked.string('testRunMerge3.root'),
0150     outputCommands = cms.untracked.vstring(
0151         'keep *', 
0152         'drop *_makeThingToBeDropped1_*_*',
0153         'drop *_makeThingToBeDropped2_*_*'
0154     )
0155 )
0156 
0157 process.p1 = cms.Path((process.m1 + process.m2 + process.m3) *
0158                      process.thingWithMergeProducer *
0159                      process.makeThingToBeDropped2 *
0160                      process.test *
0161                      process.tryNoPut *
0162                      process.makeThingToBeDropped *
0163                      process.makeThingToBeDropped1 *
0164                      process.dependsOnThingToBeDropped1)
0165 
0166 process.p2 = cms.Path(process.A *
0167                       process.B *
0168                       process.C *
0169                       process.D *
0170                       process.E *
0171                       process.F *
0172                       process.G *
0173                       process.H *
0174                       process.I *
0175                       process.J *
0176                       process.K *
0177                       process.L)
0178 
0179 process.e = cms.EndPath(process.out)