Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:58

0001 import FWCore.ParameterSet.Config as cms
0002 from argparse import ArgumentParser
0003 
0004 parser = ArgumentParser(description='Test argparse')
0005 parser.add_argument("--maxEvents", help="max events to process", type=int, default=1)
0006 # same as an edmConfigDump argument
0007 parser.add_argument("-o", "--output", help="output filename", type=str, default=None)
0008 # change parameter of tracked module
0009 parser.add_argument("-i", "--intprod", help="int value to produce", type=int, default=1)
0010 args = parser.parse_args()
0011 
0012 process = cms.Process("TEST")
0013 process.source = cms.Source("EmptySource")
0014 
0015 process.maxEvents.input = args.maxEvents
0016 
0017 process.m1a = cms.EDProducer("IntProducer",
0018     ivalue = cms.int32(args.intprod)
0019 )
0020 process.p1 = cms.Path(process.m1a)
0021 
0022 if args.output is not None:
0023     process.testout1 = cms.OutputModule("TestOutputModule",
0024         name = cms.string(args.output),
0025     )
0026     process.e1 = cms.EndPath(process.testout1)