CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/PhysicsTools/Utilities/configuration/copyPickMerge_cfg.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 from FWCore.ParameterSet.VarParsing import VarParsing
00003 
00004 options = VarParsing ('analysis')
00005 
00006 # add a list of strings for events to process
00007 options.register ('eventsToProcess',
00008                                   '',
00009                                   VarParsing.multiplicity.list,
00010                                   VarParsing.varType.string,
00011                                   "Events to process")
00012 options.register ('maxSize',
00013                                   0,
00014                                   VarParsing.multiplicity.singleton,
00015                                   VarParsing.varType.int,
00016                                   "Maximum (suggested) file size (in Kb)")
00017 options.parseArguments()
00018 
00019 process = cms.Process("PickEvent")
00020 process.source = cms.Source ("PoolSource",
00021           fileNames = cms.untracked.vstring (options.inputFiles),
00022 )
00023 
00024 if options.eventsToProcess:
00025     process.source.eventsToProcess = \
00026            cms.untracked.VEventRange (options.eventsToProcess)
00027 
00028 
00029 process.maxEvents = cms.untracked.PSet(
00030             input = cms.untracked.int32 (options.maxEvents)
00031 )
00032 
00033 
00034 process.Out = cms.OutputModule("PoolOutputModule",
00035         fileName = cms.untracked.string (options.outputFile)
00036 )
00037 
00038 if options.maxSize:
00039     process.Out.maxSize = cms.untracked.int32 (options.maxSize)
00040 
00041 process.end = cms.EndPath(process.Out)