1 |
import FWCore.ParameterSet.Config as cms
|
2 |
import copy
|
3 |
|
4 |
process = cms.Process('TreeMaker')
|
5 |
|
6 |
# import of standard configurations for RECOnstruction
|
7 |
# of electrons, muons and tau-jets with non-standard isolation cones
|
8 |
process.load('Configuration/StandardSequences/Services_cff')
|
9 |
process.load('FWCore/MessageService/MessageLogger_cfi')
|
10 |
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
|
11 |
|
12 |
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
|
13 |
|
14 |
|
15 |
process.maxEvents = cms.untracked.PSet(
|
16 |
input = cms.untracked.int32(1000)
|
17 |
)
|
18 |
|
19 |
process.source = cms.Source(
|
20 |
"PoolSource",
|
21 |
#firstEvent = cms.untracked.uint32(510),
|
22 |
#firstRun = cms.untracked.uint32(1),
|
23 |
fileNames = cms.untracked.vstring(
|
24 |
#'/store/data/Run2010A/JetMETTau/RECO/Jul6thReReco_v1/0155/FEC9D251-6C89-DF11-85C8-002618943826.root',
|
25 |
#'/store/data/Run2010A/JetMET/RECO/v4/000/141/958/2E35AF48-B99B-DF11-877A-003048F024DE.root',
|
26 |
'/store/data/Run2010A/Mu/RECO/v4/000/141/958/621E7234-C59B-DF11-B2CB-0030487A322E.root',
|
27 |
)
|
28 |
)
|
29 |
|
30 |
#process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(
|
31 |
# '124275:3-124275:30',
|
32 |
# '124230:26-124230:max',
|
33 |
# '124120:1-124120:max',
|
34 |
# '124030:1-124030:max',
|
35 |
# '124027:24-124027:max',
|
36 |
# '124025:3-124025:13',
|
37 |
# '124024:2-124024:83',
|
38 |
# '124023:38-124023:96',
|
39 |
# '124022:66-124022:179',
|
40 |
# '124020:12-124020:94',
|
41 |
# '124009:1-124009:68',
|
42 |
# '124008:1-124008:max',
|
43 |
# '124006:1-124006:max',
|
44 |
# '123908:2-123908:12',
|
45 |
# '123906:18-123906:28',
|
46 |
# '123818:2-123818:42',
|
47 |
# '123815:8-123815:max',
|
48 |
# '123732:62-123732:109',
|
49 |
# '123615:70-123615:max',
|
50 |
# '123596:2-123596:max',
|
51 |
# '123592:2-123592:12'
|
52 |
# )
|
53 |
|
54 |
#require proper trigger bits for collision data
|
55 |
process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
|
56 |
process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
|
57 |
process.L1T1=process.hltLevel1GTSeed.clone()
|
58 |
process.L1T1.L1TechTriggerSeeding = cms.bool(True)
|
59 |
process.L1T1.L1SeedsLogicalExpression = cms.string('0 AND NOT (36 OR 37 OR 38 OR 39)')
|
60 |
#process.L1T1.L1SeedsLogicalExpression = cms.string('0')
|
61 |
#for MC
|
62 |
#process.L1T1.L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)')
|
63 |
|
64 |
#Physics bit declared
|
65 |
# this is for filtering on HLT path
|
66 |
#process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
|
67 |
#process.hltPhysicsDeclared.L1GtReadoutRecordTag = 'gtDigis'
|
68 |
|
69 |
#remove "monster events": at least 25% of good tracks
|
70 |
process.noscraping = cms.EDFilter("FilterOutScraping",
|
71 |
applyfilter = cms.untracked.bool(True),
|
72 |
debugOn = cms.untracked.bool(False),
|
73 |
numtrack = cms.untracked.uint32(10),
|
74 |
thresh = cms.untracked.double(0.25)
|
75 |
)
|
76 |
|
77 |
process.oneGoodVertexFilter = cms.EDFilter(
|
78 |
"VertexSelector",
|
79 |
src = cms.InputTag("offlinePrimaryVertices"),
|
80 |
cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"),
|
81 |
filter = cms.bool(True)
|
82 |
)
|
83 |
|
84 |
# PAT Layer 0+1
|
85 |
process.load("PhysicsTools.PatAlgos.patSequences_cff")
|
86 |
|
87 |
## Load additional RECO config
|
88 |
process.load("Configuration.StandardSequences.Geometry_cff")
|
89 |
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
|
90 |
#process.GlobalTag.globaltag = cms.string('GR10_P_V5::All')
|
91 |
process.GlobalTag.globaltag = cms.string('GR_R_36X_V12::All')
|
92 |
|
93 |
|
94 |
#process.GlobalTag.globaltag = cms.string('GR_R_37X_V6::All')
|
95 |
#process.GlobalTag.globaltag = cms.string('GR09_R_V5::All')
|
96 |
process.load("Configuration.StandardSequences.MagneticField_cff")
|
97 |
|
98 |
#remove MC matching to run on data
|
99 |
from PhysicsTools.PatAlgos.tools.coreTools import *
|
100 |
removeMCMatching(process, ['All'])
|
101 |
|
102 |
|
103 |
## 36X
|
104 |
## Apply correct JEC
|
105 |
process.load('JetMETCorrections.Configuration.DefaultJEC_cff')
|
106 |
##produce JPT jets and JPTjets jetID
|
107 |
process.load("RecoJets.Configuration.RecoJPTJets_cff")
|
108 |
|
109 |
|
110 |
## 35X
|
111 |
#process.load("JetMETCorrections.Configuration.ZSPJetCorrections332_cff")
|
112 |
#process.load("JetMETCorrections.Configuration.JetPlusTrackCorrections_cff")
|
113 |
|
114 |
##eid
|
115 |
process.load("UserCode.HbbAnalysis.categoryBasedElectronIdentificationV02_cfi")
|
116 |
from UserCode.HbbAnalysis.categoryBasedElectronIdentificationV02_cfi import *
|
117 |
process.JPTeidTight = process.eidVeryLoose.clone()
|
118 |
#process.JetPlusTrackZSPCorrectorAntiKt5.UseElectrons = True
|
119 |
|
120 |
## 36X
|
121 |
process.JetPlusTrackZSPCorJetAntiKt5.UseElectrons = True
|
122 |
|
123 |
## 35X
|
124 |
#process.load("RecoJets.JetProducers.ak5JetID_cfi")
|
125 |
#process.ak5JPTJetID = copy.deepcopy(process.ak5JetID)
|
126 |
#process.ak5JPTJetID.src = cms.InputTag('JetPlusTrackZSPCorJetAntiKt5')
|
127 |
#process.pJptJets = cms.Sequence( process.eIDCategoryBasedSequence*
|
128 |
# process.JPTeidTight*
|
129 |
# process.ZSPJetCorrectionsAntiKt5
|
130 |
# *process.JetPlusTrackCorrectionsAntiKt5
|
131 |
# *process.ak5JPTJetID
|
132 |
# )
|
133 |
|
134 |
## 36X
|
135 |
process.pJptJets = cms.Sequence( process.eIDCategoryBasedSequence*
|
136 |
process.JPTeidTight*
|
137 |
process.recoJPTJets
|
138 |
)
|
139 |
|
140 |
## Add JPT and PF jets
|
141 |
from PhysicsTools.PatAlgos.tools.jetTools import *
|
142 |
#switchJECSet( process, "900GeV")
|
143 |
|
144 |
## 35X
|
145 |
#from JetMETCorrections.Configuration.L2L3Corrections_Summer09_7TeV_ReReco332_cff import *
|
146 |
#switchJECSet( process, "Summer09_7TeV_ReReco332")
|
147 |
|
148 |
|
149 |
## 36X
|
150 |
#to run on 3_5_X samples: no new btag info etc...
|
151 |
#do not use if rerunning new btag ...
|
152 |
#from PhysicsTools.PatAlgos.tools.cmsswVersionTools import *
|
153 |
#run36xOn35xInput(process)
|
154 |
|
155 |
|
156 |
## 36X
|
157 |
#addJetCollection35X(process,
|
158 |
## 35X
|
159 |
switchJetCollection(process,
|
160 |
cms.InputTag('ak5CaloJets'),
|
161 |
#'AK5','Calo',
|
162 |
doJTA=True,
|
163 |
doBTagging=True,
|
164 |
jetCorrLabel=('AK5','Calo'),
|
165 |
doType1MET=True,
|
166 |
#genJetCollection=cms.InputTag(""),
|
167 |
doJetID = True,
|
168 |
jetIdLabel = "ak5"
|
169 |
)
|
170 |
|
171 |
|
172 |
## 36X
|
173 |
#addJetCollection35X(process,
|
174 |
## 35X
|
175 |
addJetCollection(process,
|
176 |
cms.InputTag('ak5PFJets'),
|
177 |
'AK5','PF',
|
178 |
doJTA=True,
|
179 |
doBTagging=True,
|
180 |
jetCorrLabel=('AK5','PF'),
|
181 |
doType1MET=False,
|
182 |
doL1Cleaning = False,
|
183 |
doL1Counters=False,
|
184 |
genJetCollection=cms.InputTag(""),
|
185 |
doJetID = False,
|
186 |
jetIdLabel = None
|
187 |
)
|
188 |
|
189 |
## 35X
|
190 |
#addJetCollection( process,
|
191 |
# cms.InputTag('JetPlusTrackZSPCorJetAntiKt5'),
|
192 |
# 'AK5','JPT',
|
193 |
# doJTA = True,
|
194 |
# doBTagging = True,
|
195 |
# jetCorrLabel = None,
|
196 |
# doType1MET = False,
|
197 |
# doL1Cleaning = False,
|
198 |
# doL1Counters = False,
|
199 |
# genJetCollection = cms.InputTag(""),
|
200 |
# doJetID = True,
|
201 |
# jetIdLabel = "ak5JPT"
|
202 |
# )
|
203 |
|
204 |
## 36X
|
205 |
#addJetCollection35X( process,
|
206 |
addJetCollection( process,
|
207 |
cms.InputTag('JetPlusTrackZSPCorJetAntiKt5'),
|
208 |
'AK5','JPT',
|
209 |
doJTA = True,
|
210 |
doBTagging = True,
|
211 |
jetCorrLabel = ('AK5','JPT'),
|
212 |
doType1MET = False,
|
213 |
doL1Cleaning = False,
|
214 |
doL1Counters = False,
|
215 |
genJetCollection = cms.InputTag(""),
|
216 |
doJetID = True,
|
217 |
jetIdLabel = "ak5"
|
218 |
)
|
219 |
|
220 |
#add calo taus ?
|
221 |
|
222 |
#replace electron ids
|
223 |
process.patElectrons.electronIDSources = cms.PSet(
|
224 |
eidTight = cms.InputTag("eidTight"),
|
225 |
eidLoose = cms.InputTag("eidLoose"),
|
226 |
eidRobustTight = cms.InputTag("eidMedium"),
|
227 |
eidRobustHighEnergy = cms.InputTag("eidSuperTight"),
|
228 |
eidRobustLoose = cms.InputTag("eidVeryLoose")
|
229 |
)
|
230 |
|
231 |
|
232 |
##add PF and tcMET
|
233 |
|
234 |
# Load the PF MET module
|
235 |
process.load("PhysicsTools.PFCandProducer.pfMET_cfi")
|
236 |
#produce tcMET
|
237 |
# load muon corrections for !MET module and associated !ValueMap producer
|
238 |
process.load("JetMETCorrections.Type1MET.MuonMETValueMapProducer_cff")
|
239 |
process.load("JetMETCorrections.Type1MET.MetMuonCorrections_cff")
|
240 |
|
241 |
# load track-corrected MET module and associated !ValueMap producer
|
242 |
process.load("JetMETCorrections.Type1MET.MuonTCMETValueMapProducer_cff")
|
243 |
process.load("RecoMET.METProducers.TCMET_cfi")
|
244 |
|
245 |
# run sequence of muon+track MET corrections
|
246 |
process.ptcmet = cms.Sequence(
|
247 |
process.muonMETValueMapProducer
|
248 |
*process.corMetGlobalMuons
|
249 |
*process.muonTCMETValueMapProducer
|
250 |
*process.tcMet
|
251 |
)
|
252 |
|
253 |
|
254 |
# load the coreTools of PAT
|
255 |
from PhysicsTools.PatAlgos.tools.metTools import *
|
256 |
addTcMET(process, 'TC')
|
257 |
addPfMET(process, 'PF')
|
258 |
|
259 |
|
260 |
process.load("UserCode/HbbAnalysis/TreeSelection_cff")
|
261 |
|
262 |
process.load("UserCode/HbbAnalysis/EventFlavourFilter_cff")
|
263 |
from UserCode.HbbAnalysis.EventFlavourFilter_cff import *
|
264 |
process.eventFlavourFilter.DEBUG = 0
|
265 |
process.eventFlavourFilter.DoZbb = False
|
266 |
process.eventFlavourFilter.DoZcc = False
|
267 |
process.eventFlavourFilter.DoZjj = False
|
268 |
process.eventFlavourFilter.filter = False
|
269 |
|
270 |
process.load("UserCode/HbbAnalysis/HbbTreeMaker_cff")
|
271 |
from UserCode.HbbAnalysis.HbbTreeMaker_cff import *
|
272 |
process.treeMaker.DEBUG = 0
|
273 |
process.treeMaker.DOGEN = False
|
274 |
process.treeMaker.JetFlavour = 5
|
275 |
#disable caloTaus
|
276 |
process.treeMaker.CaloTaus = cms.InputTag("","")
|
277 |
|
278 |
process.treeCaloJets.src = cms.InputTag("patJets")
|
279 |
|
280 |
process.TFileService = cms.Service("TFileService",
|
281 |
fileName = cms.string("AnaTree.root"),
|
282 |
closeFileFast = cms.untracked.bool(True)
|
283 |
)
|
284 |
|
285 |
#dumpevent
|
286 |
process.dump = cms.EDAnalyzer("EventContentAnalyzer")
|
287 |
|
288 |
#process.load('PerfTools.Callgrind.callgrindSwitch_cff')
|
289 |
|
290 |
process.pReco = cms.Sequence(
|
291 |
process.ptcmet
|
292 |
*process.pJptJets
|
293 |
*process.pfMET
|
294 |
*process.recoJetId
|
295 |
*process.patDefaultSequence
|
296 |
)
|
297 |
|
298 |
process.preSel = cms.Path(
|
299 |
#process.L1T1*
|
300 |
#*process.hltPhysicsDeclared
|
301 |
process.noscraping
|
302 |
*process.oneGoodVertexFilter
|
303 |
*process.pReco
|
304 |
#*process.eventFlavourFilter
|
305 |
*process.treeMuons
|
306 |
*process.treeElectrons
|
307 |
#*process.treeCaloTaus
|
308 |
*process.treePFTaus
|
309 |
*process.treeCaloJets
|
310 |
*process.treeJPTJets
|
311 |
*process.treePFJets
|
312 |
*process.treeMaker
|
313 |
)
|
314 |
|
315 |
|
316 |
# Output module configuration
|
317 |
#from PhysicsTools.PatAlgos.patEventContent_cff import patEventContent
|
318 |
#process.out = cms.OutputModule("PoolOutputModule",
|
319 |
# fileName = cms.untracked.string('PATLayer1_Output.fromAOD_PFMET_full.root'),
|
320 |
# # save only events passing the full path
|
321 |
# SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ),
|
322 |
# # save PAT Layer 1 output
|
323 |
# outputCommands = cms.untracked.vstring(
|
324 |
# 'drop *',
|
325 |
# 'keep *_selectedLayer1PFMETs_*_*',
|
326 |
# *patEventContent # you need a '*' to unpack the list of commands 'patEventContent'
|
327 |
# )
|
328 |
#)
|
329 |
#process.outpath = cms.EndPath(process.out)
|
330 |
|
331 |
|
332 |
|