-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcmscp.py
executable file
·39 lines (33 loc) · 1.16 KB
/
cmscp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/env cmsRun
from FWCore.ParameterSet.VarParsing import VarParsing
options = VarParsing("analysis")
options.setDefault('maxEvents', 100)
options.register('skip', 0, VarParsing.multiplicity.singleton, VarParsing.varType.int, "skip N events")
options.setDefault('outputFile', 'copy.root')
options.register(
'pick',
'',
VarParsing.multiplicity.list,
VarParsing.varType.string,
'Pick single events'
)
options.parseArguments()
import FWCore.ParameterSet.Config as cms
process = cms.Process("NOTIMPORTANT")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
options.inputFiles
)
)
process.load('FWCore.MessageService.MessageLogger_cfi')
process.MessageLogger.cerr.FwkReport.reportEvery = 1
process.source.skipEvents = cms.untracked.uint32(options.skip)
if options.pick:
process.source.eventsToProcess = cms.untracked.VEventRange(options.pick)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
process.out = cms.OutputModule(
"PoolOutputModule",
outputCommands = cms.untracked.vstring('keep *'),
fileName = cms.untracked.string(options.outputFile)
)
process.end = cms.EndPath(process.out)