Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # Tests the PathStatusFilter module
0002 # Note many of the tests that were originally here
0003 # were moved to test_catch2_PathStatusFilter.cc.
0004 
0005 import FWCore.ParameterSet.Config as cms
0006 
0007 process = cms.Process("PROD")
0008 
0009 process.load("FWCore.MessageService.MessageLogger_cfi")
0010 process.MessageLogger.cerr.FwkReport.reportEvery = 1000
0011 
0012 process.maxEvents = cms.untracked.PSet(
0013     input = cms.untracked.int32(20)
0014 )
0015 
0016 process.source = cms.Source("EmptySource")
0017 
0018 # This is the expression in ModuloEventIDFilter "iEvent.id().event() % n_ == offset_"
0019 
0020 # pass 2, 4, 6, 8 ...
0021 process.mod2 = cms.EDFilter("ModuloEventIDFilter",
0022     modulo = cms.uint32(2),
0023     offset = cms.uint32(0)
0024 )
0025 process.passOdd = cms.EDFilter("ModuloEventIDFilter",
0026     modulo = cms.uint32(2),
0027     offset = cms.uint32(1)
0028 )
0029 process.mod3 = cms.EDFilter("ModuloEventIDFilter",
0030     modulo = cms.uint32(3),
0031     offset = cms.uint32(0)
0032 )
0033 process.mod5 = cms.EDFilter("ModuloEventIDFilter",
0034     modulo = cms.uint32(5),
0035     offset = cms.uint32(0)
0036 )
0037 process.mod7 = cms.EDFilter("ModuloEventIDFilter",
0038     modulo = cms.uint32(7),
0039     offset = cms.uint32(0)
0040 )
0041 process.mod15 = cms.EDFilter("ModuloEventIDFilter",
0042     modulo = cms.uint32(15),
0043     offset = cms.uint32(0)
0044 )
0045 process.mod20 = cms.EDFilter("ModuloEventIDFilter",
0046     modulo = cms.uint32(20),
0047     offset = cms.uint32(0)
0048 )
0049 
0050 process.pathPassOdd = cms.Path(process.passOdd)
0051 
0052 process.pathMod2 = cms.Path(process.mod2)
0053 process.pathMod3 = cms.Path(process.mod3)
0054 process.pathMod5 = cms.Path(process.mod5)
0055 process.pathMod7 = cms.Path(process.mod7)
0056 process.pathMod15 = cms.Path(process.mod15)
0057 process.pathMod20 = cms.Path(process.mod20)
0058 
0059 # test pathname with all allowed characters types
0060 process.pathMod2_and_Mod3 = cms.Path(process.mod2 * process.mod3)
0061 
0062 process.load("FWCore.Modules.pathStatusFilter_cfi")
0063 process.pathStatusFilter.logicalExpression = 'pathMod2_and_Mod3'
0064 # Set True for debugging parsing of logical expressions and
0065 # their conversion into trees of operators and operands
0066 process.pathStatusFilter.verbose = False
0067 
0068 process.testpath1 = cms.Path(process.pathStatusFilter)
0069 
0070 process.sewer1 = cms.OutputModule("SewerModule",
0071     shouldPass = cms.int32(3),
0072     name = cms.string('for_testpath1'),
0073     SelectEvents = cms.untracked.PSet(
0074         SelectEvents = cms.vstring('testpath1')
0075     )
0076 )
0077 
0078 # test extra space between pathnames and operators
0079 process.pathStatusFilter7 = cms.EDFilter('PathStatusFilter',
0080   logicalExpression = cms.string("\t    pathMod2   \t and \t  pathMod3 \t and \t not(pathMod5)and not not not pathMod7 or(pathMod15)and  not (  pathMod20 or(pathPassOdd)) \t   "),
0081   verbose = cms.untracked.bool(False)
0082 )
0083 process.testpath7 = cms.Path(process.pathStatusFilter7)
0084 
0085 process.sewer7 = cms.OutputModule("SewerModule",
0086     shouldPass = cms.int32(3),
0087     name = cms.string('for_testpath7'),
0088     SelectEvents = cms.untracked.PSet(
0089         SelectEvents = cms.vstring('testpath7')
0090     )
0091 )
0092 
0093 process.endpath = cms.EndPath(process.sewer1 * process.sewer7)