1 import FWCore.ParameterSet.Config
as cms
11 pfLabel =
"packedPFCandidates" 12 pvLabel =
"offlineSlimmedPrimaryVertices" 13 svLabel =
"slimmedSecondaryVertices" 14 muLabel =
"slimmedMuons" 15 elLabel =
"slimmedElectrons" 16 gpLabel =
"prunedGenParticles" 18 genJetsCollection =
"slimmedGenJets" 38 process.load(
"RecoJets.JetProducers.ak4PFJets_cfi")
39 task.add(process.ak4PFJetsPuppi)
40 process.ak4PFJetsPuppi.src = pfLabel
41 process.ak4PFJetsPuppi.srcWeights = puppiLabel
44 process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer(
"JetTracksAssociatorAtVertex",
46 jets = cms.InputTag(
"ak4PFJetsPuppi")
48 task.add(process.ak4PFJetsPuppiTracksAssociatorAtVertex)
49 process.patJetPuppiCharge = cms.EDProducer(
"JetChargeProducer",
50 src = cms.InputTag(
"ak4PFJetsPuppiTracksAssociatorAtVertex"),
51 var = cms.string(
"Pt"),
62 jetSource = cms.InputTag(
"ak4PFJetsPuppi"),
65 pfCandidates = cms.InputTag(pfLabel),
66 pvSource = cms.InputTag(pvLabel),
67 svSource = cms.InputTag(svLabel),
68 muSource = cms.InputTag(muLabel),
69 elSource = cms.InputTag(elLabel),
70 genJetCollection = cms.InputTag(genJetsCollection),
71 genParticles = cms.InputTag(gpLabel),
72 jetCorrections = (
'AK4PFPuppi', cms.vstring([
"L2Relative",
"L3Absolute"]),
''),
73 getJetMCFlavour = runOnMC
75 process.patJetsPuppi.jetChargeSource = cms.InputTag(
"patJetPuppiCharge")
76 process.selectedPatJetsPuppi.cut = cms.string(
"pt > 10")
77 if hasattr(process,
"patJetFlavourAssociationPuppi"):
78 process.patJetFlavourAssociationPuppi.weights = cms.InputTag(puppiLabel)
91 src =
"selectedPatJetsPuppi",
92 packedPFCandidates = pfLabel,
101 jetSource = cms.InputTag(
"slimmedJetsPuppiNoDeepTags"),
104 pfCandidates = cms.InputTag(pfLabel),
105 pvSource = cms.InputTag(pvLabel),
106 svSource = cms.InputTag(svLabel),
107 muSource = cms.InputTag(muLabel),
108 elSource = cms.InputTag(elLabel),
109 jetCorrections = (
"AK4PFPuppi", cms.vstring([
"L2Relative",
"L3Absolute"]),
"None"),
110 btagDiscriminators = btagDiscriminatorsAK4.names.value()
if btagDiscriminatorsAK4
is not None else [
'None'],
111 postfix =
'SlimmedDeepFlavour',
115 addToProcessAndTask(
"slimmedJetsPuppi", process.selectedUpdatedPatJetsSlimmedDeepFlavour.clone(), process, task)
116 del process.selectedUpdatedPatJetsSlimmedDeepFlavour
123 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncFromMiniAOD
126 jetCollUnskimmed=
"slimmedJetsPuppi",
129 jetFlavor=
"AK4PFPuppi",
130 puppiProducerLabel=puppiLabel,
131 puppiProducerForMETLabel=puppiNoLepLabel,
142 runOnData(process, names=[
"Jets",
"METs"], outputModules = [])
151 pfLabel =
"packedPFCandidates" 152 pvLabel =
"offlineSlimmedPrimaryVertices" 153 svLabel =
"slimmedSecondaryVertices" 154 muLabel =
"slimmedMuons" 155 elLabel =
"slimmedElectrons" 156 gpLabel =
"prunedGenParticles" 158 genJetsAK8Collection =
"slimmedGenJetsAK8" 159 genSubJetsForAK8Collection =
"slimmedGenJetsAK8SoftDropSubJets" 179 process.load(
"RecoJets.JetProducers.ak8PFJets_cfi")
180 task.add(process.ak8PFJetsPuppi)
181 task.add(process.ak8PFJetsPuppiSoftDrop)
184 process.ak8PFJetsPuppi.src = pfLabel
185 process.ak8PFJetsPuppi.srcWeights = puppiLabel
188 from CommonTools.RecoAlgos.miniAODJetConstituentSelector_cfi
import miniAODJetConstituentSelector
190 src = cms.InputTag(
"ak8PFJetsPuppi"),
191 cut = cms.string(
"pt > 100.0 && abs(rapidity()) < 2.4")
197 process.ak8PFJetsPuppiSoftDrop.src =
"ak8PFJetsPuppiConstituents:constituents" 198 process.ak8PFJetsPuppiSoftDrop.srcWeights = puppiLabel
201 process.load(
"RecoJets.JetProducers.ak8PFJetsPuppi_groomingValueMaps_cfi")
202 task.add(process.ak8PFJetsPuppiSoftDropMass)
203 process.ak8PFJetsPuppiSoftDropMass.src =
"ak8PFJetsPuppi" 204 process.ak8PFJetsPuppiSoftDropMass.matched =
"ak8PFJetsPuppiSoftDrop" 215 labelName =
"AK8Puppi",
216 jetSource = cms.InputTag(
"ak8PFJetsPuppi"),
219 pfCandidates = cms.InputTag(pfLabel),
220 pvSource = cms.InputTag(pvLabel),
221 svSource = cms.InputTag(svLabel),
222 muSource = cms.InputTag(muLabel),
223 elSource = cms.InputTag(elLabel),
224 genJetCollection = cms.InputTag(genJetsAK8Collection),
225 genParticles = cms.InputTag(gpLabel),
226 jetCorrections = (
"AK8PFPuppi", cms.vstring([
"L2Relative",
"L3Absolute"]),
"None"),
227 getJetMCFlavour = runOnMC,
229 if hasattr(process,
"patJetFlavourAssociationAK8Puppi"):
230 process.patJetFlavourAssociationAK8Puppi.weights = cms.InputTag(puppiLabel)
232 process.patJetsAK8Puppi.userData.userFloats.src = []
233 process.patJetsAK8Puppi.userData.userFloats.src += [
"ak8PFJetsPuppiSoftDropMass"]
234 process.patJetsAK8Puppi.addTagInfos = cms.bool(
False)
236 process.selectedPatJetsAK8Puppi.cut = cms.string(
"pt > 100")
237 process.selectedPatJetsAK8Puppi.cutLoose = cms.string(
"pt > 30")
238 process.selectedPatJetsAK8Puppi.nLoose = cms.uint32(3)
243 from RecoJets.JetProducers.nJettinessAdder_cfi
import Njettiness
245 src =
"ak8PFJetsPuppi",
246 srcWeights = puppiLabel
250 process.patJetsAK8Puppi.userData.userFloats.src += [
251 "NjettinessAK8Puppi:tau1",
252 "NjettinessAK8Puppi:tau2",
253 "NjettinessAK8Puppi:tau3",
254 "NjettinessAK8Puppi:tau4" 262 labelName =
"AK8PFPuppiSoftDrop",
263 jetSource = cms.InputTag(
"ak8PFJetsPuppiSoftDrop"),
264 btagDiscriminators = [
"None"],
265 pfCandidates = cms.InputTag(pfLabel),
266 pvSource = cms.InputTag(pvLabel),
267 svSource = cms.InputTag(svLabel),
268 muSource = cms.InputTag(muLabel),
269 elSource = cms.InputTag(elLabel),
270 genJetCollection = cms.InputTag(genJetsAK8Collection),
271 genParticles = cms.InputTag(gpLabel),
272 jetCorrections = (
"AK8PFPuppi", cms.vstring([
"L2Relative",
"L3Absolute"]),
"None"),
273 getJetMCFlavour =
False 281 labelName =
"AK8PFPuppiSoftDropSubjets",
282 jetSource = cms.InputTag(
"ak8PFJetsPuppiSoftDrop",
"SubJets"),
287 pfCandidates = cms.InputTag(pfLabel),
288 pvSource = cms.InputTag(pvLabel),
289 svSource = cms.InputTag(svLabel),
290 muSource = cms.InputTag(muLabel),
291 elSource = cms.InputTag(elLabel),
292 genJetCollection = cms.InputTag(genSubJetsForAK8Collection),
293 genParticles = cms.InputTag(gpLabel),
294 fatJets = cms.InputTag(
"ak8PFJetsPuppi"),
295 groomedFatJets = cms.InputTag(
"ak8PFJetsPuppiSoftDrop"),
296 jetCorrections = (
"AK4PFPuppi", cms.vstring([
"L2Relative",
"L3Absolute"]),
"None"),
298 if hasattr(process,
"patJetFlavourAssociationAK8PFPuppiSoftDropSubjets"):
299 process.patJetFlavourAssociationAK8PFPuppiSoftDropSubjets.weights = cms.InputTag(puppiLabel)
309 process.load(
'RecoJets.JetProducers.ECF_cff')
312 src = cms.InputTag(
"ak8PFJetsPuppiSoftDrop"),
313 srcWeights = puppiLabel,
314 cuts = cms.vstring(
'',
'',
'pt > 250')
318 process.patJetsAK8PFPuppiSoftDrop.userData.userFloats.src += [
319 'nb1AK8PuppiSoftDrop:ecfN2',
320 'nb1AK8PuppiSoftDrop:ecfN3',
324 src = cms.InputTag(
"ak8PFJetsPuppiSoftDrop"),
325 srcWeights = puppiLabel,
326 cuts = cms.vstring(
'',
'',
'pt > 250')
330 process.patJetsAK8PFPuppiSoftDrop.userData.userFloats.src += [
331 'nb2AK8PuppiSoftDrop:ecfN2',
332 'nb2AK8PuppiSoftDrop:ecfN3',
339 src = cms.InputTag(
"ak8PFJetsPuppiSoftDrop",
"SubJets"),
340 srcWeights = puppiLabel,
345 process.patJetsAK8PFPuppiSoftDropSubjets.userData.userFloats.src += [
346 'nb1AK8PuppiSoftDropSubjets:ecfN2',
347 'nb1AK8PuppiSoftDropSubjets:ecfN3' 351 src = cms.InputTag(
"ak8PFJetsPuppiSoftDrop",
"SubJets"),
352 srcWeights = puppiLabel,
357 process.patJetsAK8PFPuppiSoftDropSubjets.userData.userFloats.src += [
358 'nb2AK8PuppiSoftDropSubjets:ecfN2',
359 'nb2AK8PuppiSoftDropSubjets:ecfN3' 363 src = cms.InputTag(
"ak8PFJetsPuppiSoftDrop",
"SubJets"),
364 srcWeights = puppiLabel
368 process.patJetsAK8PFPuppiSoftDropSubjets.userData.userFloats.src += [
369 "NjettinessAK8Subjets:tau1",
370 "NjettinessAK8Subjets:tau2",
371 "NjettinessAK8Subjets:tau3",
372 "NjettinessAK8Subjets:tau4",
375 addToProcessAndTask(
"slimmedJetsAK8PFPuppiSoftDropSubjetsNoDeepTags", cms.EDProducer(
"PATJetSlimmer",
376 src = cms.InputTag(
"selectedPatJetsAK8PFPuppiSoftDropSubjets"),
377 packedPFCandidates = cms.InputTag(pfLabel),
378 dropJetVars = cms.string(
"1"),
379 dropDaughters = cms.string(
"0"),
380 rekeyDaughters = cms.string(
"0"),
381 dropTrackRefs = cms.string(
"1"),
382 dropSpecific = cms.string(
"1"),
383 dropTagInfos = cms.string(
"1"),
384 modifyJets = cms.bool(
True),
385 mixedDaughters = cms.bool(
False),
386 modifierConfig = cms.PSet( modifications = cms.VPSet() )
393 labelName =
"AK8PFPuppiSoftDropSubjets",
394 postfix =
'SlimmedDeepFlavour',
395 jetSource = cms.InputTag(
"slimmedJetsAK8PFPuppiSoftDropSubjetsNoDeepTags"),
398 pfCandidates = cms.InputTag(pfLabel),
399 pvSource = cms.InputTag(pvLabel),
400 svSource = cms.InputTag(svLabel),
401 muSource = cms.InputTag(muLabel),
402 elSource = cms.InputTag(elLabel),
403 jetCorrections = (
"AK4PFPuppi", cms.vstring([
"L2Relative",
"L3Absolute"]),
"None"),
404 printWarning =
False,
405 btagDiscriminators = btagDiscriminatorsAK8Subjets.names.value()
if btagDiscriminatorsAK8Subjets
is not None else [
'None'],
409 addToProcessAndTask(
"slimmedJetsAK8PFPuppiSoftDropPacked", cms.EDProducer(
"BoostedJetMerger",
410 jetSrc = cms.InputTag(
"selectedPatJetsAK8PFPuppiSoftDrop"),
411 subjetSrc = cms.InputTag(
"selectedUpdatedPatJetsAK8PFPuppiSoftDropSubjetsSlimmedDeepFlavour")
417 jetSrc = cms.InputTag(
"selectedPatJetsAK8Puppi"),
418 distMax = cms.double(0.8),
419 algoTags = cms.VInputTag(
420 cms.InputTag(
"slimmedJetsAK8PFPuppiSoftDropPacked")
422 algoLabels = cms.vstring(
425 fixDaughters = cms.bool(
False),
426 packedPFCandidates = cms.InputTag(pfLabel),
440 addToProcessAndTask(
"slimmedJetsAK8NoDeepTags", slimmedJetsAK8.clone(rekeyDaughters =
"0"), process, task)
442 process.slimmedJetsAK8NoDeepTags.dropDaughters = cms.string(
"pt < 170")
443 process.slimmedJetsAK8NoDeepTags.dropSpecific = cms.string(
"pt < 170")
444 process.slimmedJetsAK8NoDeepTags.dropTagInfos = cms.string(
"pt < 170")
448 jetSource = cms.InputTag(
"slimmedJetsAK8NoDeepTags"),
451 pfCandidates = cms.InputTag(pfLabel),
452 pvSource = cms.InputTag(pvLabel),
453 svSource = cms.InputTag(svLabel),
454 muSource = cms.InputTag(muLabel),
455 elSource = cms.InputTag(elLabel),
457 jetCorrections = (
'AK8PFPuppi', cms.vstring([
"L2Relative",
"L3Absolute"]),
'None'),
458 btagDiscriminators = btagDiscriminatorsAK8.names.value()
if btagDiscriminatorsAK8
is not None else [
'None'],
459 postfix =
"SlimmedAK8DeepTags",
463 addToProcessAndTask(
"slimmedJetsAK8", process.selectedUpdatedPatJetsSlimmedAK8DeepTags.clone(), process, task)
464 del process.selectedUpdatedPatJetsSlimmedAK8DeepTags
473 runOnData(process, names=[
"Jets"], outputModules = [])
def addToProcessAndTask(label, module, process, task)
def runMetCorAndUncFromMiniAOD(process, metType="PF", jetCollUnskimmed="slimmedJets", photonColl="slimmedPhotons", electronColl="slimmedElectrons", muonColl="slimmedMuons", tauColl="slimmedTaus", pfCandColl="packedPFCandidates", jetFlavor="AK4PFchs", jetCleaning="LepClean", isData=False, manualJetConfig=False, reclusterJets=None, jetSelection="pt>15 && abs(eta)<9.9", recoMetFromPFCs=None, jetCorLabelL3="ak4PFCHSL1FastL2L3Corrector", jetCorLabelRes="ak4PFCHSL1FastL2L3ResidualCorrector", CHS=False, puppiProducerLabel="puppi", puppiProducerForMETLabel="puppiNoLep", reapplyJEC=True, jecUncFile="", computeMETSignificance=True, fixEE2017=False, fixEE2017Params=None, extractDeepMETs=False, campaign="", era="", postfix="")
def getPatAlgosToolsTask(process)