-
Notifications
You must be signed in to change notification settings - Fork 5
/
copyPickMerge_cfg.py
70 lines (54 loc) · 2.33 KB
/
copyPickMerge_cfg.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
options = VarParsing ('analysis')
# add a list of strings for events to process
options.register ('eventsToProcess',
'',
VarParsing.multiplicity.list,
VarParsing.varType.string,
"Events to process")
options.register ('maxSize',
0,
VarParsing.multiplicity.singleton,
VarParsing.varType.int,
"Maximum (suggested) file size (in Kb)")
options.register ('certFile',
'',
VarParsing.multiplicity.singleton,
VarParsing.varType.string,
"json file")
options.register ('triggerConditions',
'',
VarParsing.multiplicity.list,
VarParsing.varType.string,
"Trigger Condition")
options.parseArguments()
process = cms.Process("PickEvent")
process.source = cms.Source ("PoolSource",
fileNames = cms.untracked.vstring (options.inputFiles),
)
if options.eventsToProcess:
process.source.eventsToProcess = \
cms.untracked.VEventRange (options.eventsToProcess)
if options.certFile:
import FWCore.PythonUtilities.LumiList as LumiList
process.source.lumisToProcess = LumiList.LumiList(filename = options.certFile).getVLuminosityBlockRange()
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32 (options.maxEvents)
)
process.Out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string (options.outputFile)
)
if options.maxSize:
process.Out.maxSize = cms.untracked.int32 (options.maxSize)
if options.triggerConditions:
process.load('HLTrigger.HLTfilters.triggerResultsFilter_cfi')
process.triggerResultsFilter.l1tResults = cms.InputTag('')
process.triggerResultsFilter.hltResults = cms.InputTag('TriggerResults::HLT')
process.triggerResultsFilter.triggerConditions = (options.triggerConditions)
process.p = cms.Path(process.triggerResultsFilter)
process.Out.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p'))
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 100
process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(True))
process.end = cms.EndPath(process.Out)