Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-02 22:42:08

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 argv = sys.argv[:]
0013 if '--' in argv:
0014     argv.remove("--")
0015 args, unknown = parser.parse_known_args(argv)
0016 
0017 process = cms.Process("TESTANA")
0018 process.maxEvents.input = -1
0019 
0020 process.source = cms.Source("PoolSource",
0021     fileNames = cms.untracked.vstring("file:getbylabel_step1.root")
0022 )
0023 
0024 process.intAnalyzer = cms.EDAnalyzer("edmtest::TestGetByLabelIntAnalyzer",
0025     src = cms.untracked.InputTag("intProduct"),
0026     consumes = cms.untracked.bool(True)
0027 )
0028 
0029 process.p = cms.Path(
0030     process.intAnalyzer
0031 )
0032 
0033 if args.thing:
0034     process.thingProduct = cms.EDProducer("ThingProducer")
0035     process.thingAnalyzer = cms.EDAnalyzer("edmtest::TestGetByLabelThingAnalyzer",
0036         src = cms.untracked.InputTag("thingProduct"),
0037         consumes = cms.untracked.bool(True)
0038     )
0039     process.p += (process.thingProduct+process.thingAnalyzer)
0040 
0041 if args.otherInt:
0042     process.otherIntProduct = cms.EDProducer("IntProducer", ivalue = cms.int32(314))
0043     process.otherIntAnalyzer = cms.EDAnalyzer("edmtest::TestGetByLabelIntAnalyzer",
0044         src = cms.untracked.InputTag("otherIntProduct"),
0045         consumes = cms.untracked.bool(True)
0046     )
0047     process.p += (process.otherIntProduct+process.otherIntAnalyzer)
0048 
0049 if args.noConsumes:
0050     process.intAnalyzer.consumes = False
0051     process.intAnalyzer.getExceptionCategory = cms.untracked.string("GetByLabelWithoutRegistration")
0052 
0053     if args.thing:
0054         process.thingAnalyzer.consumes = False
0055         process.thingAnalyzer.getExceptionCategory = cms.untracked.string("GetByLabelWithoutRegistration")