File indexing completed on 2023-10-25 09:47:28
0001 import FWCore.ParameterSet.Config as cms
0002
0003 import sys
0004 import argparse
0005
0006 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test ProcessAccelerator.')
0007
0008 parser.add_argument("--noConsumes", help="Do not call consumes", action="store_true")
0009 parser.add_argument("--thing", help="Add producer and consumer for Thing", action="store_true")
0010 parser.add_argument("--otherInt", help="Add another producer and consumer for int", action="store_true")
0011
0012 args = parser.parse_args()
0013
0014 process = cms.Process("TESTANA")
0015 process.maxEvents.input = -1
0016
0017 process.source = cms.Source("PoolSource",
0018 fileNames = cms.untracked.vstring("file:getbylabel_step1.root")
0019 )
0020
0021 process.intAnalyzer = cms.EDAnalyzer("edmtest::TestGetByLabelIntAnalyzer",
0022 src = cms.untracked.InputTag("intProduct"),
0023 consumes = cms.untracked.bool(True)
0024 )
0025
0026 process.p = cms.Path(
0027 process.intAnalyzer
0028 )
0029
0030 if args.thing:
0031 process.thingProduct = cms.EDProducer("ThingProducer")
0032 process.thingAnalyzer = cms.EDAnalyzer("edmtest::TestGetByLabelThingAnalyzer",
0033 src = cms.untracked.InputTag("thingProduct"),
0034 consumes = cms.untracked.bool(True)
0035 )
0036 process.p += (process.thingProduct+process.thingAnalyzer)
0037
0038 if args.otherInt:
0039 process.otherIntProduct = cms.EDProducer("IntProducer", ivalue = cms.int32(314))
0040 process.otherIntAnalyzer = cms.EDAnalyzer("edmtest::TestGetByLabelIntAnalyzer",
0041 src = cms.untracked.InputTag("otherIntProduct"),
0042 consumes = cms.untracked.bool(True)
0043 )
0044 process.p += (process.otherIntProduct+process.otherIntAnalyzer)
0045
0046 if args.noConsumes:
0047 process.intAnalyzer.consumes = False
0048 process.intAnalyzer.getExceptionCategory = cms.untracked.string("GetByLabelWithoutRegistration")
0049
0050 if args.thing:
0051 process.thingAnalyzer.consumes = False
0052 process.thingAnalyzer.getExceptionCategory = cms.untracked.string("GetByLabelWithoutRegistration")