16 import FWCore.ParameterSet.Config
as cms
17 import FWCore.ParameterSet.VarParsing
as VarParsing
19 process = cms.Process(
"FAKE")
21 process.maxEvents = cms.untracked.PSet(
22 input = cms.untracked.int32(-1)
25 process.source = cms.Source(
"PoolSource",
26 fileNames = cms.untracked.vstring()
29 process.EvFDaqDirector = cms.Service(
"EvFDaqDirector",
30 runNumber = cms.untracked.uint32( 0 ),
31 baseDir = cms.untracked.string(
"" ),
32 buBaseDir = cms.untracked.string(
"" ),
33 useFileBroker = cms.untracked.bool(
False ),
34 fileBrokerKeepAlive = cms.untracked.bool(
True ),
35 fileBrokerPort = cms.untracked.string(
"8080" ),
36 fileBrokerUseLocalLock = cms.untracked.bool(
True ),
37 fuLockPollInterval = cms.untracked.uint32( 2000 ),
38 requireTransfersPSet = cms.untracked.bool(
False ),
39 selectedTransferMode = cms.untracked.string(
"" ),
40 mergingPset = cms.untracked.string(
"" ),
41 outputAdler32Recheck = cms.untracked.bool(
False ),
44 process.writer = cms.OutputModule(
"RawStreamFileWriterForBU",
45 source = cms.InputTag(
'rawDataCollector'),
46 numEventsPerFile = cms.uint32(0)
49 process.endpath = cms.EndPath(process.writer)
51 process.load(
'FWCore.MessageService.MessageLogger_cfi')
52 process.MessageLogger.cerr.FwkReport.reportEvery = 0
56 for name
in 'filePrepend',
'maxEvents',
'outputFile',
'secondaryOutputFile',
'section',
'tag',
'storePrepend',
'totalSections':
57 del options._register[name]
58 del options._beenSet[name]
59 del options._info[name]
60 del options._types[name]
61 if name
in options._singletons:
62 del options._singletons[name]
63 if name
in options._lists:
64 del options._lists[name]
65 if name
in options._noCommaSplit:
66 del options._noCommaSplit[name]
67 if name
in options._noDefaultClear:
68 del options._noDefaultClear[name]
71 options.register(
'runNumber',
73 VarParsing.VarParsing.multiplicity.singleton,
74 VarParsing.VarParsing.varType.int,
77 options.register(
'lumiNumber',
79 VarParsing.VarParsing.multiplicity.singleton,
80 VarParsing.VarParsing.varType.int,
81 "Luminosity section number to use")
83 options.register(
'eventsPerLumi',
85 VarParsing.VarParsing.multiplicity.singleton,
86 VarParsing.VarParsing.varType.int,
87 "Number of events in the given luminosity section to process")
89 options.register(
'eventsPerFile',
91 VarParsing.VarParsing.multiplicity.singleton,
92 VarParsing.VarParsing.varType.int,
93 "Split the output into files with at most this number of events")
95 options.register(
'rawDataCollection',
97 VarParsing.VarParsing.multiplicity.singleton,
98 VarParsing.VarParsing.varType.string,
99 "FEDRawDataCollection to be repacked into RAW format")
101 options.register(
'outputPath',
103 VarParsing.VarParsing.multiplicity.singleton,
104 VarParsing.VarParsing.varType.string,
105 "Output directory for the FED RAW data files")
107 options.parseArguments()
110 if options.runNumber <= 0:
111 sys.stderr.write(
'Invalid run number\n')
114 if options.lumiNumber
is not None and options.lumiNumber <= 0:
115 sys.stderr.write(
'Invalid luminosity section number\n')
118 if options.eventsPerLumi == 0
or options.eventsPerLumi < -1:
119 sys.stderr.write(
'Invalid number of events per luminosity section\n')
122 if options.eventsPerFile <= 0:
123 sys.stderr.write(
'Invalid number of events per output file\n')
127 process.source.fileNames = options.inputFiles
128 if options.lumiNumber
is not None:
130 process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(
'%d:%d' % (options.runNumber, options.lumiNumber))
131 process.maxEvents.input = options.eventsPerLumi
132 process.EvFDaqDirector.runNumber = options.runNumber
133 process.EvFDaqDirector.baseDir = options.outputPath
134 process.EvFDaqDirector.buBaseDir = options.outputPath
135 process.writer.source = options.rawDataCollection
136 process.writer.numEventsPerFile = options.eventsPerFile
137 process.MessageLogger.cerr.FwkReport.reportEvery = options.eventsPerFile
140 outputRunPath = f
'{options.outputPath}/run{options.runNumber:06d}' 141 os.makedirs(outputRunPath, exist_ok=
True)
142 open(f
'{outputRunPath}/fu.lock',
'w').close()