Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:16:51

0001 import FWCore.ParameterSet.Config as cms
0002 from FWCore.ParameterSet.VarParsing import VarParsing
0003 
0004 options = VarParsing ('analysis')
0005 
0006 # add a list of strings for events to process
0007 options.register ('eventsToProcess',
0008                   '',
0009                   VarParsing.multiplicity.list,
0010                   VarParsing.varType.string,
0011                   "Events to process")
0012 options.register ('maxSize',
0013                   0,
0014                   VarParsing.multiplicity.singleton,
0015                   VarParsing.varType.int,
0016                   "Maximum (suggested) file size (in Kb)")
0017 options.parseArguments()
0018 
0019 process = cms.Process("PickEvent")
0020 process.source = cms.Source ("PoolSource",
0021       fileNames = cms.untracked.vstring (options.inputFiles),
0022 )
0023 
0024 if options.eventsToProcess:
0025     process.source.eventsToProcess = \
0026            cms.untracked.VEventRange (options.eventsToProcess)
0027 
0028 
0029 process.maxEvents = cms.untracked.PSet(
0030         input = cms.untracked.int32 (options.maxEvents)
0031 )
0032 
0033 
0034 process.Out = cms.OutputModule("PoolOutputModule",
0035         fileName = cms.untracked.string (options.outputFile)
0036 )
0037 
0038 if options.maxSize:
0039     process.Out.maxSize = cms.untracked.int32 (options.maxSize)
0040 
0041 process.end = cms.EndPath(process.Out)