Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-12 01:51:32

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import argparse
0004 import sys
0005 parser = argparse.ArgumentParser(prog=sys.argv[0], description="Test PoolOutputModule")
0006 parser.add_argument("--guid", type=str, help="GUID that overrides")
0007 parser.add_argument("--maxSize", type=int, default=None, help="Set maximum file size")
0008 parser.add_argument("--input", type=str, default=[], nargs="*", help="Optional list of input files")
0009 
0010 argv = sys.argv[:]
0011 if '--' in argv:
0012     argv.remove("--")
0013 args, unknown = parser.parse_known_args(argv)
0014 
0015 process = cms.Process("TESTOUTPUTGUID")
0016 process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
0017 
0018 process.maxEvents.input = 20
0019 
0020 process.Thing = cms.EDProducer("ThingProducer")
0021 
0022 process.OtherThing = cms.EDProducer("OtherThingProducer")
0023 
0024 process.source = cms.Source("EmptySource")
0025 if len(args.input) > 0:
0026     process.maxEvents.input = -1
0027     process.source = cms.Source("PoolSource",
0028         fileNames = cms.untracked.vstring("file:"+x for x in args.input)
0029     )
0030 
0031 process.output = cms.OutputModule("PoolOutputModule",
0032     fileName = cms.untracked.string('file:PoolOutputTestOverrideGUID.root'),
0033     overrideGUID = cms.untracked.string(args.guid),
0034 )
0035 if args.maxSize is not None:
0036     process.output.maxSize = cms.untracked.int32(args.maxSize)
0037 
0038 process.p = cms.Path(process.Thing*process.OtherThing)
0039 process.ep = cms.EndPath(process.output)
0040 
0041