Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-16 23:23:57

0001 import FWCore.ParameterSet.Config as cms
0002 import argparse
0003 
0004 parser = argparse.ArgumentParser(description='Test reduced ProcessHistory')
0005 parser.add_argument("--input", type=str, help="Input file")
0006 #parser.add_argument("--bypassVersionCheck", action="store_true", help="Bypass version check")
0007 parser.add_argument("--expectNewLumi", action="store_true", help="Set this if a new lumi is expected between the original files")
0008 parser.add_argument("--expectNewRun", action="store_true", help="Set this if a new run is expected between the original files")
0009 parser.add_argument("--output", type=str, help="Output file name")
0010 
0011 args = parser.parse_args()
0012 
0013 process = cms.Process("READ")
0014 
0015 from IOPool.Streamer.modules import NewEventStreamFileReader
0016 process.source = NewEventStreamFileReader(
0017     fileNames = [f"file:{args.input}"],
0018 #    bypassVersionCheck = args.bypassVersionCheck,
0019 )
0020 
0021 from IOPool.Output.modules import PoolOutputModule
0022 process.out = PoolOutputModule(
0023     fileName = args.output
0024 )
0025 
0026 from FWCore.Framework.modules import RunLumiEventAnalyzer
0027 process.test = RunLumiEventAnalyzer(
0028     expectedRunLumiEvents = [
0029         1, 0, 0, # beginRun
0030         1, 1, 0, # beginLumi
0031         1, 1, 1,
0032         1, 1, 2,
0033         1, 1, 3,
0034         1, 1, 4,
0035         1, 1, 5,
0036         1, 1, 6,
0037         1, 1, 7,
0038         1, 1, 8,
0039         1, 1, 9,
0040         1, 1, 10,
0041         1, 1, 101,
0042         1, 1, 102,
0043         1, 1, 103,
0044         1, 1, 104,
0045         1, 1, 105,
0046         1, 1, 106,
0047         1, 1, 107,
0048         1, 1, 108,
0049         1, 1, 109,
0050         1, 1, 110,
0051         1, 1, 0, # endLumi
0052         1, 0, 0, # endRun
0053     ]
0054 )
0055 endFirstFileIndex = 3*(10+2)
0056 if args.expectNewLumi:
0057     process.test.expectedRunLumiEvents = process.test.expectedRunLumiEvents[:endFirstFileIndex] + [
0058         1, 1, 0, # endLumi
0059         1, 0, 0, # endRun
0060         1, 0, 0, # beginRun
0061         1, 1, 0, # beginLumi
0062         1, 1, 201,
0063         1, 1, 202,
0064         1, 1, 203,
0065         1, 1, 204,
0066         1, 1, 205,
0067         1, 1, 206,
0068         1, 1, 207,
0069         1, 1, 208,
0070         1, 1, 209,
0071         1, 1, 210,
0072         1, 1, 0, # endLumi
0073         1, 0, 0, # endRun
0074     ]
0075 elif args.expectNewRun:
0076     process.test.expectedRunLumiEvents = process.test.expectedRunLumiEvents[:endFirstFileIndex] + [
0077         1, 1, 0, # endLumi
0078         1, 0, 0, # endRun
0079         1, 0, 0, # beginRun
0080         1, 2, 0, # beginLumi
0081         1, 2, 201,
0082         1, 2, 202,
0083         1, 2, 203,
0084         1, 2, 204,
0085         1, 2, 205,
0086         1, 2, 206,
0087         1, 2, 207,
0088         1, 2, 208,
0089         1, 2, 209,
0090         1, 2, 210,
0091         1, 2, 0, # endLumi
0092         1, 0, 0, # endRun
0093     ]
0094 
0095 process.p = cms.Path(
0096     process.test
0097 )
0098 process.ep = cms.EndPath(
0099     process.out
0100 )