Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # Test the what happens after an exception associated
0002 # with the behavior SkipEvent
0003 
0004 import FWCore.ParameterSet.Config as cms
0005 
0006 process = cms.Process("TEST")
0007 
0008 # We are testing the SkipEvent behavior.
0009 process.options = cms.untracked.PSet(
0010     SkipEvent = cms.untracked.vstring('EventCorruption')
0011 )
0012 
0013 process.load("FWCore.MessageService.MessageLogger_cfi")
0014 
0015 process.maxEvents = cms.untracked.PSet(
0016     input = cms.untracked.int32(3)
0017 )
0018 
0019 process.source = cms.Source("EmptySource",
0020     firstLuminosityBlock = cms.untracked.uint32(1),
0021     numberEventsInLuminosityBlock = cms.untracked.uint32(100),
0022     firstEvent = cms.untracked.uint32(1),
0023     firstRun = cms.untracked.uint32(1),
0024     numberEventsInRun = cms.untracked.uint32(100)
0025 )
0026 
0027 process.testThrow = cms.EDAnalyzer("TestFailuresAnalyzer",
0028     whichFailure = cms.int32(5),
0029     eventToThrow = cms.untracked.uint64(2)
0030 )
0031 
0032 # In the path before the module throwing an exception all 3 events should run
0033 process.beforeException = cms.EDAnalyzer('RunLumiEventAnalyzer',
0034     verbose = cms.untracked.bool(True),
0035     expectedRunLumiEvents = cms.untracked.vuint32(
0036         1, 0, 0,
0037         1, 1, 0,
0038         1, 1, 1,
0039         1, 1, 2,
0040         1, 1, 3,
0041         1, 1, 0,
0042         1, 0, 0
0043      )
0044 )
0045 
0046 # Note that this one checks that the second event was skipped
0047 process.afterException = cms.EDAnalyzer('RunLumiEventAnalyzer',
0048     verbose = cms.untracked.bool(True),
0049     expectedRunLumiEvents = cms.untracked.vuint32(
0050         1, 0, 0,
0051         1, 1, 0,
0052         1, 1, 1,
0053         1, 1, 3,
0054         1, 1, 0,
0055         1, 0, 0
0056      )
0057 )
0058 
0059 process.onEndPath = cms.EDAnalyzer('RunLumiEventAnalyzer',
0060     verbose = cms.untracked.bool(True),
0061     expectedRunLumiEvents = cms.untracked.vuint32(
0062         1, 0, 0,
0063         1, 1, 0,
0064         1, 1, 1,
0065         1, 1, 2,
0066         1, 1, 3,
0067         1, 1, 0,
0068         1, 0, 0
0069      ),
0070      dumpTriggerResults = cms.untracked.bool(True)
0071 )
0072 
0073 # The next two modules are not really necessary for the test
0074 # Just adding in a producer and filter to make it more realistic
0075 # No particular reason that I selected these two modules
0076 process.thingWithMergeProducer = cms.EDProducer("ThingWithMergeProducer")
0077 
0078 process.p1Done = cms.EDProducer("IntProducer", ivalue = cms.int32(1))
0079 process.waitTillP1Done = cms.EDAnalyzer("IntConsumingAnalyzer",
0080                                         getFromModule = cms.untracked.InputTag("p1Done"))
0081 
0082 
0083 process.f1 = cms.EDFilter("TestFilterModule",
0084     acceptValue = cms.untracked.int32(98),
0085     onlyOne = cms.untracked.bool(False)
0086 )
0087 
0088 process.out = cms.OutputModule("PoolOutputModule",
0089     fileName = cms.untracked.string('testSkipEvent.root'),
0090     SelectEvents = cms.untracked.PSet(
0091       SelectEvents = cms.vstring('p1')
0092     )
0093 )
0094 
0095 process.p1 = cms.Path(process.beforeException *
0096                       process.testThrow *
0097                       process.afterException *
0098                       process.thingWithMergeProducer *
0099                       process.f1+process.p1Done)
0100 
0101 process.p2 = cms.Path(process.waitTillP1Done+process.afterException)
0102 
0103 process.e = cms.EndPath(process.out * process.onEndPath)