File indexing completed on 2024-05-31 04:19:32
0001 import FWCore.ParameterSet.Config as cms
0002 import argparse
0003 import sys
0004
0005 process = cms.Process("READ")
0006
0007
0008 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test output of GlobalEvFOutputModule')
0009 parser.add_argument("--input", action="append", default=[], help="Input files")
0010 parser.add_argument("--runNumber", type=int, default=1, help="expected run number")
0011 parser.add_argument("--numEvents", type=int, default=10, help="expected number of events")
0012 args = parser.parse_args()
0013 if len(args.input) == 0:
0014 parser.error("No input files")
0015
0016 process.source = cms.Source("NewEventStreamFileReader",
0017 fileNames = cms.untracked.vstring(["file:"+f for f in args.input])
0018 )
0019
0020 process.tester = cms.EDAnalyzer("OtherThingAnalyzer",
0021 other = cms.untracked.InputTag("otherThing","testUserTag")
0022 )
0023
0024 rn = args.runNumber
0025 lumi = 1
0026 transitions = [cms.EventID(rn,0,0),cms.EventID(rn,lumi,0)]
0027 evid = 1
0028
0029 for ev in range(0, args.numEvents):
0030 transitions.append(cms.EventID(rn,lumi,evid))
0031 evid += 1
0032 transitions.append(cms.EventID(rn,lumi,0))
0033 transitions.append(cms.EventID(rn,0,0))
0034
0035 if args.numEvents == 0:
0036 transitions = []
0037
0038 process.test = cms.EDAnalyzer("RunLumiEventChecker",
0039 eventSequence = cms.untracked.VEventID(*transitions),
0040 unorderedEvents = cms.untracked.bool(True)
0041 )
0042
0043
0044 process.e = cms.EndPath(process.tester+process.test)