15 import FWCore.ParameterSet.Config
as cms
16 import FWCore.ParameterSet.VarParsing
as VarParsing
18 process = cms.Process(
"FAKE")
20 process.maxEvents = cms.untracked.PSet(
21 input = cms.untracked.int32(-1)
24 process.source = cms.Source(
"PoolSource",
25 fileNames = cms.untracked.vstring()
28 process.EvFDaqDirector = cms.Service(
"EvFDaqDirector",
29 runNumber = cms.untracked.uint32( 0 ),
30 baseDir = cms.untracked.string(
"" ),
31 buBaseDir = cms.untracked.string(
"" ),
32 useFileBroker = cms.untracked.bool(
False ),
33 fileBrokerKeepAlive = cms.untracked.bool(
True ),
34 fileBrokerPort = cms.untracked.string(
"8080" ),
35 fileBrokerUseLocalLock = cms.untracked.bool(
True ),
36 fuLockPollInterval = cms.untracked.uint32( 2000 ),
37 requireTransfersPSet = cms.untracked.bool(
False ),
38 selectedTransferMode = cms.untracked.string(
"" ),
39 mergingPset = cms.untracked.string(
"" ),
40 outputAdler32Recheck = cms.untracked.bool(
False ),
43 process.writer = cms.OutputModule(
"RawStreamFileWriterForBU",
44 source = cms.InputTag(
'rawDataCollector'),
45 numEventsPerFile = cms.uint32(0)
48 process.endpath = cms.EndPath(process.writer)
50 process.load(
'FWCore.MessageService.MessageLogger_cfi')
51 process.MessageLogger.cerr.FwkReport.reportEvery = 0
55 for name
in 'filePrepend',
'maxEvents',
'outputFile',
'secondaryOutputFile',
'section',
'tag',
'storePrepend',
'totalSections':
56 del options._register[name]
57 del options._beenSet[name]
58 del options._info[name]
59 del options._types[name]
60 if name
in options._singletons:
61 del options._singletons[name]
62 if name
in options._lists:
63 del options._lists[name]
64 if name
in options._noCommaSplit:
65 del options._noCommaSplit[name]
66 if name
in options._noDefaultClear:
67 del options._noDefaultClear[name]
70 options.register(
'runNumber',
72 VarParsing.VarParsing.multiplicity.singleton,
73 VarParsing.VarParsing.varType.int,
76 options.register(
'lumiNumber',
78 VarParsing.VarParsing.multiplicity.singleton,
79 VarParsing.VarParsing.varType.int,
80 "Luminosity section number to use")
82 options.register(
'eventsPerLumi',
84 VarParsing.VarParsing.multiplicity.singleton,
85 VarParsing.VarParsing.varType.int,
86 "Number of events in the given luminosity section to process")
88 options.register(
'eventsPerFile',
90 VarParsing.VarParsing.multiplicity.singleton,
91 VarParsing.VarParsing.varType.int,
92 "Split the output into files with at most this number of events")
94 options.register(
'outputPath',
96 VarParsing.VarParsing.multiplicity.singleton,
97 VarParsing.VarParsing.varType.string,
98 "Output directory for the FED RAW data files")
100 options.parseArguments()
103 if options.runNumber <= 0:
104 sys.stderr.write(
'Invalid run number\n')
107 if options.lumiNumber
is not None and options.lumiNumber <= 0:
108 sys.stderr.write(
'Invalid luminosity section number\n')
111 if options.eventsPerLumi == 0
or options.eventsPerLumi < -1:
112 sys.stderr.write(
'Invalid number of events per luminosity section\n')
115 if options.eventsPerFile <= 0:
116 sys.stderr.write(
'Invalid number of events per output file\n')
120 process.source.fileNames = options.inputFiles
121 if options.lumiNumber
is not None:
123 process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(
'%d:%d' % (options.runNumber, options.lumiNumber))
124 process.maxEvents.input = options.eventsPerLumi
125 process.EvFDaqDirector.runNumber = options.runNumber
126 process.EvFDaqDirector.baseDir = options.outputPath
127 process.EvFDaqDirector.buBaseDir = options.outputPath
128 process.writer.numEventsPerFile = options.eventsPerFile
129 process.MessageLogger.cerr.FwkReport.reportEvery = options.eventsPerFile
132 outputRunPath = f
'{options.outputPath}/run{options.runNumber:06d}' 133 os.makedirs(outputRunPath, exist_ok=
True)
134 open(f
'{outputRunPath}/fu.lock',
'w').close()