forked from kalanand/scripts
/
skimScSc.py
138 lines (79 loc) · 4.04 KB
/
skimScSc.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import FWCore.ParameterSet.Config as cms
process = cms.Process("SKIM")
#------------------------------------------
# Load standard sequences.
#------------------------------------------
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration/StandardSequences/MagneticField_AutoFromDBCurrent_cff')
process.load('Configuration/StandardSequences/GeometryIdeal_cff')
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = 'GR10_P_V4::All'
## process.load('Configuration.StandardSequences.MagneticField_38T_cff')
## Technical Trigger bits, beam coincidence/ BPTX, etc ...
process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskAlgoTrigConfig_cff')
process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
process.L1T1coll=process.hltLevel1GTSeed.clone()
process.L1T1coll.L1TechTriggerSeeding = cms.bool(True)
process.L1T1coll.L1SeedsLogicalExpression = cms.string('0 AND NOT (36 OR 37 OR 38 OR 39) AND NOT ((42 AND NOT 43) OR (43 AND NOT 42))')
process.l1tcollpath = cms.Path(process.L1T1coll)
process.primaryVertexFilter = cms.EDFilter("VertexSelector",
src = cms.InputTag("offlinePrimaryVertices"),
cut = cms.string("!isFake && ndof > 4 && abs(z) <= 15 && position.Rho <= 2"), # tracksSize() > 3 for the older cut
filter = cms.bool(True), # otherwise it won't filter the events, just produce an empty vertex collection.
)
process.noscraping = cms.EDFilter("FilterOutScraping",
applyfilter = cms.untracked.bool(True),
debugOn = cms.untracked.bool(False),
numtrack = cms.untracked.uint32(10),
thresh = cms.untracked.double(0.25)
)
###############################################################################
############## We should require all the above for every path ################
process.goodCollSequence=cms.sequence( process.L1T1coll +
process.primaryVertexFilter +
process.noscraping )
###############################################################################
# SuperClusters ################
process.superClusters = cms.EDFilter("SuperClusterMerger",
src = cms.VInputTag(cms.InputTag("hybridSuperClusters","", "RECO"),
cms.InputTag("multi5x5SuperClustersWithPreshower","", "RECO"))
)
process.mySuperClusters = cms.EDFilter("SuperClusterSelector",
src = cms.InputTag("superClusters"),
cut = cms.string('energy*sin(position.theta)>15.0')
)
process.superClusterCands = cms.EDProducer("ConcreteEcalCandidateProducer",
src = cms.InputTag("mySuperClusters"),
particleType = cms.int32(11),
)
process.ZToEE = cms.EDFilter("NamedCandViewShallowCloneCombiner",
cut = cms.string('60 < mass < 120'),
name = cms.string('ZToEE'),
roles = cms.vstring('electron1','electron2'),
decay = cms.string('superClusterCands superClusterCands'),
checkCharge = cms.bool(False)
)
process.ZeeSequence = cms.Sequence( process.superClusters * process.mySuperClusters *
process.superClusterCands * process.ZToEE
)
process.mypath = cms.Path(process.goodCollSequence*process.noscraping*
process.ZeeSequence)
############# output module if just want to skim by HLT path ##############
process.out = cms.OutputModule("PoolOutputModule",
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('process.')
),
fileName = cms.untracked.string('mySkim.root')
)
process.p = cms.EndPath(process.out)
############# Format MessageLogger #################
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
############# Set the number of events #############
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(5000)
)
############# Define the source file ###############
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'dcache:/pnfs/cms/WAX/resilient/kalanand/data/BeamCommissioning/data_2010_run_132601_1_1.root')
)