CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
copyPickMerge_cfg.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from FWCore.ParameterSet.VarParsing import VarParsing
3 
4 options = VarParsing ('analysis')
5 
6 # add a list of strings for events to process
7 options.register ('eventsToProcess',
8  '',
9  VarParsing.multiplicity.list,
10  VarParsing.varType.string,
11  "Events to process")
12 options.register ('maxSize',
13  0,
14  VarParsing.multiplicity.singleton,
15  VarParsing.varType.int,
16  "Maximum (suggested) file size (in Kb)")
17 options.parseArguments()
18 
19 process = cms.Process("PickEvent")
20 process.source = cms.Source ("PoolSource",
21  fileNames = cms.untracked.vstring (options.inputFiles),
22 )
23 
24 if options.eventsToProcess:
25  process.source.eventsToProcess = \
26  cms.untracked.VEventRange (options.eventsToProcess)
27 
28 
29 process.maxEvents = cms.untracked.PSet(
30  input = cms.untracked.int32 (options.maxEvents)
31 )
32 
33 
34 process.Out = cms.OutputModule("PoolOutputModule",
35  fileName = cms.untracked.string (options.outputFile)
36 )
37 
38 if options.maxSize:
39  process.Out.maxSize = cms.untracked.int32 (options.maxSize)
40 
41 process.end = cms.EndPath(process.Out)