Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # This process is the first step of a test that involves multiple
0002 # processing steps. It tests the thinning and slimming collections and
0003 # redirecting Refs, Ptrs, and RefToBases.
0004 #
0005 # From thingProducer collection (50 elements)
0006 # - A: elements 0-19
0007 # - B: elements 0-10
0008 # - C: elements 11-19
0009 # - D: elements 0-5
0010 # - E: elements 6-10
0011 # - F: elements 6-8
0012 # - G: elements 9-10
0013 # - H: elements 0-19
0014 # - I: elements 11-15
0015 #
0016 # thingProducer (0-49)
0017 # |\- thinningThingProducerA (0-19)
0018 # |   \- thinningThingProducerAB (0-10)
0019 # |      |\- thinningThingProducerABE (6-10)
0020 # |      |   \- thinningThingProducerABEF (6-8) slimmed (in job reading file F)
0021 # |      |
0022 # |      |\- thinningThingProducerABF (6-8)
0023 # |      |
0024 # |      \-- thinningThingProducerABG (9-10)
0025 # |
0026 # |\- thinningThingProducerB (0-10) slimmed
0027 # |   |\- thinningThingProducerBD (0-5)
0028 # |   |
0029 # |   |\- thinningThingProducerBE (6-10) slimmed
0030 # |   |   |\- thinningThingProducerBEF (6-8)
0031 # |   |   |
0032 # |   |   \-- thinningThingProducerBEG (9-10)
0033 # |   |
0034 # |   \- thinningThingProducerBF (6-8)
0035 # |
0036 # |\- thinningThingProducerC (11-19)
0037 # |   \- thinnindThingProducerCI (11-15)
0038 # |
0039 # \-- thinningThingProducerH (0-19), no product because of event filtering
0040 #
0041 # cases to be tested
0042 # A:  everything can be put in one file, when reading thinned are read
0043 # B: file including ABF, ABG, BF, BEG
0044 #   - ABF is preferred over BF for elements 6-8
0045 #   - ABG is preferred over BEG for elements 9-10
0046 #   - then drop ABF, ABG, and can get BF but not BEG
0047 #   - then drop BF, can get BEG
0048 # C: file including BF, BEF
0049 #   - BF is preferred of BEF
0050 #   - then drop BF, and get BEF
0051 # D: file including ABE, BD
0052 #   - ABE is preferred over BD for elements 0-5 (leading to product not found)
0053 #   - drop ABE, then BD works
0054 # E: file including BD, BEF
0055 #   - BD is preferred over BEF for elements 6-8 (leading to product not found)
0056 #   - drop BD, then BEF works
0057 # F: file including ABE
0058 #   - slim ABE further to ABEF
0059 #   - then try to merge with B file with BEG, should fail
0060 # G: file including A
0061 #   - try to thin from thingProducer, should fail
0062 # H: file including H, B
0063 #   - non-existing H is preferred, all Refs are Null
0064 # I: file including B, CI
0065 #   - CI is preferred over B for elements 0-10 (leading to product not fond)
0066 #   - drop CU, then B works
0067 
0068 import FWCore.ParameterSet.Config as cms
0069 
0070 process = cms.Process("PROD")
0071 
0072 process.maxEvents.input = 3
0073 
0074 process.source = cms.Source("EmptySource")
0075 
0076 process.WhatsItESProducer = cms.ESProducer("WhatsItESProducer")
0077 
0078 process.DoodadESSource = cms.ESSource("DoodadESSource")
0079 
0080 process.thingProducer = cms.EDProducer("ThingProducer",
0081                                        offsetDelta = cms.int32(100),
0082                                        nThings = cms.int32(50)
0083 )
0084 
0085 process.trackOfThingsProducerA = cms.EDProducer("TrackOfThingsProducer",
0086     inputTag = cms.InputTag('thingProducer'),
0087     keysToReference = cms.vuint32(range(0, 20))
0088 )
0089 
0090 process.trackOfThingsProducerB = process.trackOfThingsProducerA.clone(keysToReference = range(0,11))
0091 process.trackOfThingsProducerC = process.trackOfThingsProducerA.clone(keysToReference = range(11,20))
0092 process.trackOfThingsProducerD = process.trackOfThingsProducerA.clone(keysToReference = range(0,6))
0093 process.trackOfThingsProducerE = process.trackOfThingsProducerA.clone(keysToReference = range(6,11))
0094 process.trackOfThingsProducerF = process.trackOfThingsProducerA.clone(keysToReference = range(6,9))
0095 process.trackOfThingsProducerG = process.trackOfThingsProducerA.clone(keysToReference = range(9,11))
0096 process.trackOfThingsProducerH = process.trackOfThingsProducerA.clone()
0097 process.trackOfThingsProducerI = process.trackOfThingsProducerA.clone(keysToReference = range(11,16))
0098 
0099 process.thinningThingProducerA = cms.EDProducer("ThinningThingProducer",
0100     inputTag = cms.InputTag('thingProducer'),
0101     trackTag = cms.InputTag('trackOfThingsProducerA'),
0102     offsetToThinnedKey = cms.uint32(0),
0103     expectedCollectionSize = cms.uint32(50)
0104 )
0105 process.thinningThingProducerAB = cms.EDProducer("ThinningThingProducer",
0106     inputTag = cms.InputTag('thinningThingProducerA'),
0107     trackTag = cms.InputTag('trackOfThingsProducerB'),
0108     offsetToThinnedKey = cms.uint32(0),
0109     expectedCollectionSize = cms.uint32(20)
0110 )
0111 process.thinningThingProducerABE = cms.EDProducer("ThinningThingProducer",
0112     inputTag = cms.InputTag('thinningThingProducerAB'),
0113     trackTag = cms.InputTag('trackOfThingsProducerE'),
0114     offsetToThinnedKey = cms.uint32(0),
0115     expectedCollectionSize = cms.uint32(11)
0116 )
0117 process.thinningThingProducerABF = cms.EDProducer("ThinningThingProducer",
0118     inputTag = cms.InputTag('thinningThingProducerAB'),
0119     trackTag = cms.InputTag('trackOfThingsProducerF'),
0120     offsetToThinnedKey = cms.uint32(0),
0121     expectedCollectionSize = cms.uint32(11)
0122 )
0123 process.thinningThingProducerABG = cms.EDProducer("ThinningThingProducer",
0124     inputTag = cms.InputTag('thinningThingProducerAB'),
0125     trackTag = cms.InputTag('trackOfThingsProducerG'),
0126     offsetToThinnedKey = cms.uint32(0),
0127     expectedCollectionSize = cms.uint32(11)
0128 )
0129 
0130 process.thinningThingProducerB = cms.EDProducer("SlimmingThingProducer",
0131     inputTag = cms.InputTag('thingProducer'),
0132     trackTag = cms.InputTag('trackOfThingsProducerB'),
0133     offsetToThinnedKey = cms.uint32(0),
0134     expectedCollectionSize = cms.uint32(50)
0135 )
0136 process.thinningThingProducerBD = cms.EDProducer("ThinningThingProducer",
0137     inputTag = cms.InputTag('thinningThingProducerB'),
0138     trackTag = cms.InputTag('trackOfThingsProducerD'),
0139     offsetToThinnedKey = cms.uint32(0),
0140     expectedCollectionSize = cms.uint32(11),
0141     slimmedValueFactor = cms.int32(10)
0142 )
0143 process.thinningThingProducerBE = cms.EDProducer("SlimmingThingProducer",
0144     inputTag = cms.InputTag('thinningThingProducerB'),
0145     trackTag = cms.InputTag('trackOfThingsProducerE'),
0146     offsetToThinnedKey = cms.uint32(0),
0147     expectedCollectionSize = cms.uint32(11),
0148     slimmedValueFactor = cms.int32(10)
0149 )
0150 process.thinningThingProducerBEF = cms.EDProducer("ThinningThingProducer",
0151     inputTag = cms.InputTag('thinningThingProducerBE'),
0152     trackTag = cms.InputTag('trackOfThingsProducerF'),
0153     offsetToThinnedKey = cms.uint32(6),
0154     expectedCollectionSize = cms.uint32(5),
0155     slimmedValueFactor = cms.int32(100)
0156 )
0157 process.thinningThingProducerBEG = cms.EDProducer("ThinningThingProducer",
0158     inputTag = cms.InputTag('thinningThingProducerBE'),
0159     trackTag = cms.InputTag('trackOfThingsProducerG'),
0160     offsetToThinnedKey = cms.uint32(6),
0161     expectedCollectionSize = cms.uint32(5),
0162     slimmedValueFactor = cms.int32(100)
0163 )
0164 process.thinningThingProducerBF = cms.EDProducer("ThinningThingProducer",
0165     inputTag = cms.InputTag('thinningThingProducerB'),
0166     trackTag = cms.InputTag('trackOfThingsProducerF'),
0167     offsetToThinnedKey = cms.uint32(0),
0168     expectedCollectionSize = cms.uint32(11),
0169     slimmedValueFactor = cms.int32(10)
0170 )
0171 
0172 process.thinningThingProducerC = cms.EDProducer("ThinningThingProducer",
0173     inputTag = cms.InputTag('thingProducer'),
0174     trackTag = cms.InputTag('trackOfThingsProducerC'),
0175     offsetToThinnedKey = cms.uint32(0),
0176     expectedCollectionSize = cms.uint32(50)
0177 )
0178 process.thinningThingProducerCI = cms.EDProducer("ThinningThingProducer",
0179     inputTag = cms.InputTag('thinningThingProducerC'),
0180     trackTag = cms.InputTag('trackOfThingsProducerI'),
0181     offsetToThinnedKey = cms.uint32(11),
0182     offsetToValue = cms.uint32(11),
0183     expectedCollectionSize = cms.uint32(9)
0184 )
0185 
0186 process.thinningThingProducerH = cms.EDProducer("ThinningThingProducer",
0187     inputTag = cms.InputTag('thingProducer'),
0188     trackTag = cms.InputTag('trackOfThingsProducerH'),
0189     offsetToThinnedKey = cms.uint32(0),
0190     expectedCollectionSize = cms.uint32(50)
0191 )
0192 process.rejectingFilter = cms.EDFilter("TestFilterModule",
0193     acceptValue = cms.untracked.int32(-1)
0194 )
0195 
0196 process.testA = cms.EDAnalyzer("ThinningTestAnalyzer",
0197     parentTag = cms.InputTag('thingProducer'),
0198     thinnedTag = cms.InputTag('thinningThingProducerA'),
0199     associationTag = cms.InputTag('thinningThingProducerA'),
0200     trackTag = cms.InputTag('trackOfThingsProducerA'),
0201     expectedParentContent = cms.vint32(range(0,50)),
0202     expectedThinnedContent = cms.vint32(range(0,20)),
0203     expectedIndexesIntoParent = cms.vuint32(range(0,20)),
0204     expectedValues = cms.vint32(range(0,20)),
0205 )
0206 
0207 process.testABF = cms.EDAnalyzer("ThinningTestAnalyzer",
0208     parentTag = cms.InputTag('thinningThingProducerAB'),
0209     thinnedTag = cms.InputTag('thinningThingProducerABF'),
0210     associationTag = cms.InputTag('thinningThingProducerABF'),
0211     trackTag = cms.InputTag('trackOfThingsProducerF'),
0212     expectedParentContent = cms.vint32(range(0,11)),
0213     expectedThinnedContent = cms.vint32(range(6,9)),
0214     expectedIndexesIntoParent = cms.vuint32(range(6,9)),
0215     expectedValues = cms.vint32(range(6,9)),
0216 )
0217 
0218 process.testB = cms.EDAnalyzer("ThinningTestAnalyzer",
0219     parentTag = cms.InputTag('thingProducer'),
0220     thinnedTag = cms.InputTag('thinningThingProducerB'),
0221     associationTag = cms.InputTag('thinningThingProducerB'),
0222     trackTag = cms.InputTag('trackOfThingsProducerB'),
0223     thinnedSlimmedCount = cms.int32(1),
0224     expectedParentContent = cms.vint32(range(0,50)),
0225     expectedThinnedContent = cms.vint32(range(0,11)),
0226     expectedIndexesIntoParent = cms.vuint32(range(0,11)),
0227     expectedValues = cms.vint32(range(0,11)),
0228 )
0229 
0230 process.testBD = cms.EDAnalyzer("ThinningTestAnalyzer",
0231     parentTag = cms.InputTag('thinningThingProducerB'),
0232     thinnedTag = cms.InputTag('thinningThingProducerBD'),
0233     associationTag = cms.InputTag('thinningThingProducerBD'),
0234     trackTag = cms.InputTag('trackOfThingsProducerD'),
0235     parentSlimmedCount = cms.int32(1),
0236     thinnedSlimmedCount = cms.int32(1),
0237     expectedParentContent = cms.vint32(range(0,11)),
0238     expectedThinnedContent = cms.vint32(range(0,6)),
0239     expectedIndexesIntoParent = cms.vuint32(range(0,6)),
0240     expectedValues = cms.vint32(range(0,6)),
0241 )
0242 
0243 process.testBE = cms.EDAnalyzer("ThinningTestAnalyzer",
0244     parentTag = cms.InputTag('thinningThingProducerB'),
0245     thinnedTag = cms.InputTag('thinningThingProducerBE'),
0246     associationTag = cms.InputTag('thinningThingProducerBE'),
0247     trackTag = cms.InputTag('trackOfThingsProducerE'),
0248     parentSlimmedCount = cms.int32(1),
0249     thinnedSlimmedCount = cms.int32(2),
0250     expectedParentContent = cms.vint32(range(0,11)),
0251     expectedThinnedContent = cms.vint32(range(6,11)),
0252     expectedIndexesIntoParent = cms.vuint32(range(6,11)),
0253     expectedValues = cms.vint32(range(6,11)),
0254 )
0255 
0256 process.testBEG = cms.EDAnalyzer("ThinningTestAnalyzer",
0257     parentTag = cms.InputTag('thinningThingProducerBE'),
0258     thinnedTag = cms.InputTag('thinningThingProducerBEG'),
0259     associationTag = cms.InputTag('thinningThingProducerBEG'),
0260     trackTag = cms.InputTag('trackOfThingsProducerG'),
0261     parentSlimmedCount = cms.int32(2),
0262     thinnedSlimmedCount = cms.int32(2),
0263     expectedParentContent = cms.vint32(range(6,11)),
0264     expectedThinnedContent = cms.vint32(range(9,11)),
0265     expectedIndexesIntoParent = cms.vuint32(range(3,5)),
0266     expectedValues = cms.vint32(range(9,11)),
0267 )
0268 
0269 
0270 
0271 process.outA = cms.OutputModule("PoolOutputModule",
0272     fileName = cms.untracked.string('testSlimmingTest1A.root'),
0273     outputCommands = cms.untracked.vstring(
0274         'keep *',
0275         'drop *_thingProducer_*_*',
0276     )
0277 )
0278 
0279 process.outB = cms.OutputModule("PoolOutputModule",
0280     fileName = cms.untracked.string('testSlimmingTest1B.root'),
0281     outputCommands = cms.untracked.vstring(
0282         'drop *',
0283         'keep *_trackOfThingsProducerF_*_*',
0284         'keep *_trackOfThingsProducerG_*_*',
0285         'keep *_thinningThingProducerABF_*_*',
0286         'keep *_thinningThingProducerABG_*_*',
0287         'keep *_thinningThingProducerBF_*_*',
0288         'keep *_thinningThingProducerBEG_*_*',
0289     )
0290 )
0291 
0292 process.outC = cms.OutputModule("PoolOutputModule",
0293     fileName = cms.untracked.string('testSlimmingTest1C.root'),
0294     outputCommands = cms.untracked.vstring(
0295         'drop *',
0296         'keep *_trackOfThingsProducerF_*_*',
0297         'keep *_thinningThingProducerBF_*_*',
0298         'keep *_thinningThingProducerBEF_*_*',
0299     )
0300 )
0301 
0302 process.outD = cms.OutputModule("PoolOutputModule",
0303     fileName = cms.untracked.string('testSlimmingTest1D.root'),
0304     outputCommands = cms.untracked.vstring(
0305         'drop *',
0306         'keep *_trackOfThingsProducerD_*_*',
0307         'keep *_trackOfThingsProducerE_*_*',
0308         'keep *_thinningThingProducerABE_*_*',
0309         'keep *_thinningThingProducerBD_*_*',
0310     )
0311 )
0312 
0313 process.outE = cms.OutputModule("PoolOutputModule",
0314     fileName = cms.untracked.string('testSlimmingTest1E.root'),
0315     outputCommands = cms.untracked.vstring(
0316         'drop *',
0317         'keep *_trackOfThingsProducerD_*_*',
0318         'keep *_trackOfThingsProducerF_*_*',
0319         'keep *_thinningThingProducerBD_*_*',
0320         'keep *_thinningThingProducerBEF_*_*',
0321     )
0322 )
0323 
0324 process.outF = cms.OutputModule("PoolOutputModule",
0325     fileName = cms.untracked.string('testSlimmingTest1F.root'),
0326     outputCommands = cms.untracked.vstring(
0327         'drop *',
0328         'keep *_trackOfThingsProducerF_*_*',
0329         'keep *_thinningThingProducerABE_*_*',
0330     )
0331 )
0332 
0333 process.outG = cms.OutputModule("PoolOutputModule",
0334     fileName = cms.untracked.string('testSlimmingTest1G.root'),
0335     outputCommands = cms.untracked.vstring(
0336         'drop *',
0337         'keep *_trackOfThingsProducerB_*_*',
0338         'keep *_thinningThingProducerA_*_*',
0339     )
0340 )
0341 
0342 process.outH = cms.OutputModule("PoolOutputModule",
0343     fileName = cms.untracked.string('testSlimmingTest1H.root'),
0344     outputCommands = cms.untracked.vstring(
0345         'drop *',
0346         'keep *_thinningThingProducerB_*_*',
0347         'keep *_trackOfThingsProducerH_*_*',
0348         'keep *_thinningThingProducerH_*_*',
0349     )
0350 )
0351 
0352 process.outI = cms.OutputModule("PoolOutputModule",
0353     fileName = cms.untracked.string('testSlimmingTest1I.root'),
0354     outputCommands = cms.untracked.vstring(
0355         'drop *',
0356         'keep *_trackOfThingsProducerB_*_*',
0357         'keep *_trackOfThingsProducerI_*_*',
0358         'keep *_thinningThingProducerB_*_*',
0359         'keep *_thinningThingProducerCI_*_*',
0360     )
0361 )
0362 
0363 
0364 process.p = cms.Path(
0365     process.thingProducer
0366     * process.trackOfThingsProducerA
0367     * process.trackOfThingsProducerB
0368     * process.trackOfThingsProducerC
0369     * process.trackOfThingsProducerD
0370     * process.trackOfThingsProducerE
0371     * process.trackOfThingsProducerF
0372     * process.trackOfThingsProducerG
0373     * process.trackOfThingsProducerI
0374     * process.thinningThingProducerA
0375     * process.thinningThingProducerAB
0376     * process.thinningThingProducerABE
0377     * process.thinningThingProducerABF
0378     * process.thinningThingProducerABG
0379     * process.thinningThingProducerB
0380     * process.thinningThingProducerBD
0381     * process.thinningThingProducerBE
0382     * process.thinningThingProducerBEF
0383     * process.thinningThingProducerBEG
0384     * process.thinningThingProducerBF
0385     * process.thinningThingProducerC
0386     * process.thinningThingProducerCI
0387     * process.testA
0388     * process.testABF
0389     * process.testB
0390     * process.testBD
0391     * process.testBE
0392     * process.testBEG
0393 )
0394 process.p2 = cms.Path(
0395     process.thingProducer
0396     * process.trackOfThingsProducerH
0397     * process.rejectingFilter
0398     * process.thinningThingProducerH
0399 )
0400 
0401 process.ep = cms.EndPath(
0402     process.outA
0403     * process.outB
0404     * process.outC
0405     * process.outD
0406     * process.outE
0407     * process.outF
0408     * process.outG
0409     * process.outH
0410     * process.outI
0411 )