1 |
amagnan |
1.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(-1)
|
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 |
|
|
#'rfio:/castor/cern.ch/cms/store/mc/Summer09/MinBias/GEN-SIM-RECO/STARTUP3X_V8P_900GeV_Jan29ReReco-v1/0017/FEFA0F4E-470D-DF11-91D4-00E0817917D5.root',
|
25 |
|
|
)
|
26 |
|
|
)
|
27 |
|
|
|
28 |
|
|
#require proper trigger bits for collision data
|
29 |
|
|
process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
|
30 |
|
|
process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
|
31 |
|
|
process.L1T1=process.hltLevel1GTSeed.clone()
|
32 |
|
|
process.L1T1.L1TechTriggerSeeding = cms.bool(True)
|
33 |
|
|
#process.L1T1.L1SeedsLogicalExpression = cms.string('0 AND (40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)')
|
34 |
|
|
#for MC
|
35 |
|
|
process.L1T1.L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)')
|
36 |
|
|
|
37 |
|
|
#Physics bit declared
|
38 |
|
|
# this is for filtering on HLT path
|
39 |
|
|
process.hltHighLevel = cms.EDFilter(
|
40 |
|
|
"HLTHighLevel",
|
41 |
|
|
TriggerResultsTag = cms.InputTag("TriggerResults","","HLT"),
|
42 |
|
|
HLTPaths = cms.vstring('HLT_PhysicsDeclared'), # provide list of HLT paths (or patterns) you want
|
43 |
|
|
eventSetupPathsKey = cms.string(''), # not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
|
44 |
|
|
andOr = cms.bool(True), # how to deal with multiple triggers: True (OR) accept if ANY is true, False (AND) accept if ALL are true
|
45 |
|
|
throw = cms.bool(True) # throw exception on unknown path names
|
46 |
|
|
)
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
#remove "monster events": at least 25% of good tracks
|
51 |
|
|
process.noscraping = cms.EDFilter("FilterOutScraping",
|
52 |
|
|
applyfilter = cms.untracked.bool(True),
|
53 |
|
|
debugOn = cms.untracked.bool(False),
|
54 |
|
|
numtrack = cms.untracked.uint32(10),
|
55 |
|
|
thresh = cms.untracked.double(0.25)
|
56 |
|
|
)
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
# PAT Layer 0+1
|
60 |
|
|
process.load("PhysicsTools.PatAlgos.patSequences_cff")
|
61 |
|
|
|
62 |
|
|
## Load additional RECO config
|
63 |
|
|
process.load("Configuration.StandardSequences.Geometry_cff")
|
64 |
|
|
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
|
65 |
|
|
process.GlobalTag.globaltag = cms.string('START3X_V18::All')
|
66 |
|
|
#for 2700 sample
|
67 |
|
|
#process.GlobalTag.globaltag = cms.string('STARTUP3X_V8L::All')
|
68 |
|
|
process.load("Configuration.StandardSequences.MagneticField_cff")
|
69 |
|
|
|
70 |
|
|
#remove MC matching to run on data
|
71 |
|
|
#from PhysicsTools.PatAlgos.tools.coreTools import *
|
72 |
|
|
#removeMCMatching(process, 'All')
|
73 |
|
|
|
74 |
|
|
## produce genjets without nu's
|
75 |
|
|
process.load("RecoJets.Configuration.GenJetParticles_cff")
|
76 |
|
|
process.genParticlesForJets.ignoreParticleIDs = cms.vuint32(
|
77 |
|
|
1000022, 2000012, 2000014,
|
78 |
|
|
2000016, 1000039, 5000039,
|
79 |
|
|
4000012, 9900012, 9900014,
|
80 |
|
|
9900016, 39, 12, 14, 16
|
81 |
|
|
)
|
82 |
|
|
|
83 |
|
|
process.load("RecoJets.JetProducers.ak5GenJets_cfi")
|
84 |
|
|
process.ak5GenJetsNoNuBSM = process.ak5GenJets
|
85 |
|
|
|
86 |
|
|
process.pgenjets = cms.Sequence( process.genParticlesForJets
|
87 |
|
|
*process.ak5GenJetsNoNuBSM
|
88 |
|
|
)
|
89 |
|
|
|
90 |
|
|
##produce JPT jets and JPTjets jetID
|
91 |
|
|
process.load("JetMETCorrections.Configuration.ZSPJetCorrections332_cff")
|
92 |
|
|
process.load("JetMETCorrections.Configuration.JetPlusTrackCorrections_cff")
|
93 |
|
|
process.load("RecoJets.JetProducers.ak5JetID_cfi")
|
94 |
|
|
process.ak5JPTJetID = copy.deepcopy(process.ak5JetID)
|
95 |
|
|
process.ak5JPTJetID.src = cms.InputTag('JetPlusTrackZSPCorJetAntiKt5')
|
96 |
|
|
process.pJptJets = cms.Sequence( process.ZSPJetCorrectionsAntiKt5
|
97 |
|
|
*process.JetPlusTrackCorrectionsAntiKt5
|
98 |
|
|
*process.ak5JPTJetID
|
99 |
|
|
)
|
100 |
|
|
|
101 |
|
|
## Apply correct JEC, plus add JPT and PF jets
|
102 |
|
|
from PhysicsTools.PatAlgos.tools.jetTools import *
|
103 |
|
|
switchJECSet( process, "900GeV")
|
104 |
|
|
#switchJECSet( process, "2360GeV")
|
105 |
|
|
addJetCollection(process,
|
106 |
|
|
cms.InputTag('ak5CaloJets'),
|
107 |
|
|
'AK5Calo',
|
108 |
|
|
doJTA=True,
|
109 |
|
|
doBTagging=True,
|
110 |
|
|
jetCorrLabel=('AK5','Calo'),
|
111 |
|
|
doType1MET=True,
|
112 |
|
|
doL1Counters=False,
|
113 |
|
|
genJetCollection=cms.InputTag("ak5GenJetsNoNuBSM"),
|
114 |
|
|
doJetID = True,
|
115 |
|
|
jetIdLabel = "ak5",
|
116 |
|
|
)
|
117 |
|
|
addJetCollection(process,
|
118 |
|
|
cms.InputTag('ak5PFJets'),
|
119 |
|
|
'AK5PF',
|
120 |
|
|
doJTA=True,
|
121 |
|
|
doBTagging=True,
|
122 |
|
|
jetCorrLabel=None,
|
123 |
|
|
doType1MET=False,
|
124 |
|
|
doL1Cleaning = False,
|
125 |
|
|
doL1Counters=False,
|
126 |
|
|
genJetCollection=cms.InputTag("ak5GenJetsNoNuBSM"),
|
127 |
|
|
doJetID = False,
|
128 |
|
|
jetIdLabel = "",
|
129 |
|
|
)
|
130 |
|
|
addJetCollection( process,
|
131 |
|
|
cms.InputTag('JetPlusTrackZSPCorJetAntiKt5'),
|
132 |
|
|
'AK5JPT',
|
133 |
|
|
doJTA = True,
|
134 |
|
|
doBTagging = True,
|
135 |
|
|
jetCorrLabel = None,
|
136 |
|
|
doType1MET = True,
|
137 |
|
|
doL1Cleaning = False,
|
138 |
|
|
doL1Counters = False,
|
139 |
|
|
genJetCollection = cms.InputTag("ak5GenJetsNoNuBSM"),
|
140 |
|
|
doJetID = True,
|
141 |
|
|
jetIdLabel = "ak5JPT",
|
142 |
|
|
)
|
143 |
|
|
|
144 |
|
|
|
145 |
|
|
#add calo taus ?
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
##add PF and tcMET
|
149 |
|
|
# Load the PF MET module
|
150 |
|
|
process.load("PhysicsTools.PFCandProducer.pfMET_cfi")
|
151 |
|
|
#produce tcMET
|
152 |
|
|
# load muon corrections for !MET module
|
153 |
|
|
from JetMETCorrections.Type1MET.MetMuonCorrections_cff import *
|
154 |
|
|
# load track-corrected MET module
|
155 |
|
|
from RecoMET.METProducers.TCMET_cfi import *
|
156 |
|
|
process.load("RecoMET.METProducers.TCMET_cfi")
|
157 |
|
|
# run sequence of muon+track MET corrections
|
158 |
|
|
process.ptcmet = cms.Sequence( process.corMetGlobalMuons
|
159 |
|
|
*process.tcMet
|
160 |
|
|
)
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
### Use this to add the PF MET side-by-side to the PAT MET (it will be called 'selectedLayer1PFMETs')
|
164 |
|
|
### This doesn't take care of the trigger matching
|
165 |
|
|
process.layer1PFMETs = process.layer1METs.clone(
|
166 |
|
|
metSource = cms.InputTag("pfMET"),
|
167 |
|
|
addTrigMatch = cms.bool(False),
|
168 |
|
|
addMuonCorrections = cms.bool(False),
|
169 |
|
|
)
|
170 |
|
|
process.layer1tcMETs = process.layer1METs.clone(
|
171 |
|
|
metSource = cms.InputTag("tcMet"),
|
172 |
|
|
addTrigMatch = cms.bool(False),
|
173 |
|
|
addMuonCorrections = cms.bool(False),
|
174 |
|
|
)
|
175 |
|
|
process.allLayer1Objects.replace( process.layer1METs, process.layer1METs + process.layer1PFMETs + process.layer1tcMETs)
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
process.load("UserCode/HbbAnalysis/TreeSelection_cff")
|
179 |
|
|
|
180 |
|
|
process.load("UserCode/HbbAnalysis/EventFlavourFilter_cff")
|
181 |
|
|
from UserCode.HbbAnalysis.EventFlavourFilter_cff import *
|
182 |
|
|
process.eventFlavourFilter.DEBUG = 0
|
183 |
|
|
process.eventFlavourFilter.DoZbb = False
|
184 |
|
|
process.eventFlavourFilter.DoZcc = False
|
185 |
|
|
process.eventFlavourFilter.DoZjj = False
|
186 |
|
|
process.eventFlavourFilter.filter = False
|
187 |
|
|
|
188 |
|
|
process.load("UserCode/HbbAnalysis/HbbTreeMaker_cff")
|
189 |
|
|
from UserCode.HbbAnalysis.HbbTreeMaker_cff import *
|
190 |
|
|
process.treeMaker.DEBUG = 0
|
191 |
|
|
process.treeMaker.DOGEN = False
|
192 |
|
|
process.treeMaker.JetFlavour = 5
|
193 |
|
|
#disable caloTaus
|
194 |
|
|
process.treeMaker.CaloTaus = cms.InputTag("","")
|
195 |
|
|
|
196 |
|
|
process.TFileService = cms.Service("TFileService",
|
197 |
|
|
fileName = cms.string("AnaTree.root"),
|
198 |
|
|
closeFileFast = cms.untracked.bool(True)
|
199 |
|
|
)
|
200 |
|
|
|
201 |
|
|
#dumpevent
|
202 |
|
|
process.dump = cms.EDAnalyzer("EventContentAnalyzer")
|
203 |
|
|
|
204 |
|
|
#process.load('PerfTools.Callgrind.callgrindSwitch_cff')
|
205 |
|
|
process.pReco = cms.Sequence(
|
206 |
|
|
process.pgenjets
|
207 |
|
|
*process.ptcmet
|
208 |
|
|
*process.pJptJets
|
209 |
|
|
*process.pfMET
|
210 |
|
|
*process.patDefaultSequence
|
211 |
|
|
)
|
212 |
|
|
|
213 |
|
|
|
214 |
|
|
process.preSel = cms.Path(
|
215 |
|
|
process.L1T1
|
216 |
|
|
*process.hltHighLevel
|
217 |
|
|
*process.noscraping
|
218 |
|
|
*process.pReco
|
219 |
|
|
#*process.eventFlavourFilter
|
220 |
|
|
*process.treeMuons
|
221 |
|
|
*process.treeElectrons
|
222 |
|
|
#*process.treeCaloTaus
|
223 |
|
|
*process.treePFTaus
|
224 |
|
|
*process.treeCaloJets
|
225 |
|
|
*process.treeJPTJets
|
226 |
|
|
*process.treePFJets
|
227 |
|
|
*process.treeMaker
|
228 |
|
|
)
|
229 |
|
|
|
230 |
|
|
|
231 |
|
|
# Output module configuration
|
232 |
|
|
#from PhysicsTools.PatAlgos.patEventContent_cff import patEventContent
|
233 |
|
|
#process.out = cms.OutputModule("PoolOutputModule",
|
234 |
|
|
# fileName = cms.untracked.string('PATLayer1_Output.fromAOD_PFMET_full.root'),
|
235 |
|
|
# # save only events passing the full path
|
236 |
|
|
# SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ),
|
237 |
|
|
# # save PAT Layer 1 output
|
238 |
|
|
# outputCommands = cms.untracked.vstring(
|
239 |
|
|
# 'drop *',
|
240 |
|
|
# 'keep *_selectedLayer1PFMETs_*_*',
|
241 |
|
|
# *patEventContent # you need a '*' to unpack the list of commands 'patEventContent'
|
242 |
|
|
# )
|
243 |
|
|
#)
|
244 |
|
|
#process.outpath = cms.EndPath(process.out)
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
|