File indexing completed on 2024-05-31 04:19:32
0001 import FWCore.ParameterSet.Config as cms
0002 from argparse import ArgumentParser
0003
0004 parser = ArgumentParser(description='Test merge using GlobalEvFOutputModule')
0005 parser.add_argument("--input", action="append", default=[], help="Input files")
0006 parser.add_argument("--numThreads", help="number of threads to use", type=int, default=3)
0007 parser.add_argument("--numFwkStreams", help="number of cmsRun streams", type=int, default=2)
0008 parser.add_argument("--changeBranchIDLists", help="modify the branchIDLists", type=bool, default=False)
0009 parser.add_argument("--runNumber", help="run number to use", type=int, default=100101)
0010 parser.add_argument("--buBaseDir", help="BU base directory", type=str, default="ramdisk")
0011 parser.add_argument("--fuBaseDir", help="FU base directory", type=str, default="data")
0012 parser.add_argument("--fffBaseDir", help="FFF base directory", type=str, default=".")
0013
0014 args = parser.parse_args()
0015
0016
0017 try:
0018 os.makedirs(args.fffBaseDir+"/"+args.buBaseDir+"/run"+str(args.runNumber).zfill(6))
0019 except:pass
0020
0021 try:
0022 os.makedirs(args.fffBaseDir+"/"+args.fuBaseDir+"/run"+str(args.runNumber).zfill(6))
0023 except Exception as ex:
0024 print(str(ex))
0025 pass
0026
0027
0028 process = cms.Process("MERGE")
0029
0030 if len(args.input) == 0:
0031 parser.error("No input files")
0032
0033 process.source = cms.Source("NewEventStreamFileReader",
0034 fileNames = cms.untracked.vstring(["file:"+f for f in args.input])
0035 )
0036
0037 process.options = dict(numberOfThreads = args.numThreads,
0038 numberOfStreams = args.numFwkStreams)
0039
0040 process.merge = cms.OutputModule("GlobalEvFOutputModule",
0041 SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring()),
0042 outputCommands = cms.untracked.vstring("keep *")
0043 )
0044
0045 process.ep = cms.EndPath(process.merge)
0046
0047 process.EvFDaqDirector = cms.Service("EvFDaqDirector",
0048 useFileBroker = cms.untracked.bool(False),
0049 fileBrokerHostFromCfg = cms.untracked.bool(True),
0050 fileBrokerHost = cms.untracked.string("htcp40.cern.ch"),
0051 runNumber = cms.untracked.uint32(args.runNumber),
0052 baseDir = cms.untracked.string(args.fffBaseDir+"/"+args.fuBaseDir),
0053 buBaseDir = cms.untracked.string(args.fffBaseDir+"/"+args.buBaseDir),
0054 directorIsBU = cms.untracked.bool(False),
0055 )
0056
0057 process.FastMonitoringService = cms.Service("FastMonitoringService",
0058 sleepTime = cms.untracked.int32(1)
0059 )