Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-03-23 15:57:46

0001 import FWCore.ParameterSet.Config as cms
0002 from argparse import ArgumentParser
0003 
0004 parser = ArgumentParser(description='Write streamer output file for provenance read test')
0005 parser.add_argument("--consumeProd2", help="add an extra producer to the job and drop on output", action="store_true")
0006 parser.add_argument("--diffRun", help="use a different run number", action="store_true")
0007 parser.add_argument("--diffLumi", help="use a different LuminosityBlock number", action="store_true")
0008 args = parser.parse_args()
0009 
0010 
0011 process = cms.Process("OUTPUT")
0012 
0013 from FWCore.Modules.modules import EmptySource
0014 
0015 runNumber = 1
0016 lumiNumber = 1
0017 if args.diffRun:
0018     runNumber = 2
0019 if args.diffLumi:
0020     lumiNumber=2
0021 eventNumber = 1
0022 if args.consumeProd2:
0023     eventNumber = 2
0024 
0025 process.source = EmptySource(firstRun = runNumber, firstEvent = eventNumber, firstLuminosityBlock = lumiNumber )
0026 
0027 from FWCore.Framework.modules import AddIntsProducer, IntProducer
0028 
0029 process.one = IntProducer(ivalue=1)
0030 process.two = IntProducer(ivalue=2)
0031 process.sum = AddIntsProducer(labels=['one'])
0032 process.t = cms.Task(process.one, process.two, process.sum)
0033 
0034 baseOutFileName = "prov"
0035 if args.consumeProd2 :
0036     process.sum.untrackedLabels = ['two']
0037     baseOutFileName += "_extra"
0038 
0039 
0040 from IOPool.Output.modules import PoolOutputModule
0041 
0042 process.out = PoolOutputModule(fileName = baseOutFileName+".root",
0043                                outputCommands = ["drop *", "keep *_sum_*_*"])
0044 
0045 from FWCore.Modules.modules import AsciiOutputModule
0046 process.prnt = AsciiOutputModule(verbosity = 2, allProvenance = True)
0047 process.e = cms.EndPath(process.out+process.prnt, process.t)
0048 process.maxEvents.input = 1