10 process.patMuons.isoDeposits = cms.PSet()
11 process.patElectrons.isoDeposits = cms.PSet()
12 process.patTaus.isoDeposits = cms.PSet()
13 process.patPhotons.isoDeposits = cms.PSet()
15 process.patMuons.embedTrack =
True
16 process.patMuons.embedCombinedMuon =
True
17 process.patMuons.embedMuonBestTrack =
True
18 process.patMuons.embedStandAloneMuon =
True
19 process.patMuons.embedPickyMuon =
False
20 process.patMuons.embedTpfmsMuon =
False
21 process.patMuons.embedDytMuon =
False
22 process.patMuons.addPuppiIsolation = cms.bool(
True)
23 process.patMuons.puppiIsolationChargedHadrons = cms.InputTag(
"muonPUPPIIsolation",
"h+-DR040-ThresholdVeto000-ConeVeto000")
24 process.patMuons.puppiIsolationNeutralHadrons = cms.InputTag(
"muonPUPPIIsolation",
"h0-DR040-ThresholdVeto000-ConeVeto001")
25 process.patMuons.puppiIsolationPhotons = cms.InputTag(
"muonPUPPIIsolation",
"gamma-DR040-ThresholdVeto000-ConeVeto001")
26 process.patMuons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"h+-DR040-ThresholdVeto000-ConeVeto000")
27 process.patMuons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"h0-DR040-ThresholdVeto000-ConeVeto001")
28 process.patMuons.puppiNoLeptonsIsolationPhotons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"gamma-DR040-ThresholdVeto000-ConeVeto001")
30 process.patMuons.computeMiniIso =
True
31 process.patMuons.computeMuonMVA =
True
32 process.patMuons.computeSoftMuonMVA =
True
34 process.patMuons.addTriggerMatching =
True
35 from Configuration.Eras.Modifier_run2_muon_2016_cff
import run2_muon_2016
36 from Configuration.Eras.Modifier_run2_muon_2017_cff
import run2_muon_2017
37 from Configuration.Eras.Modifier_run2_muon_2018_cff
import run2_muon_2018
38 run2_muon_2016.toModify( process.patMuons, effectiveAreaVec = [0.0735,0.0619,0.0465,0.0433,0.0577])
39 run2_muon_2017.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
40 run2_muon_2018.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
41 run2_muon_2016.toModify( process.patMuons, mvaTrainingFile =
"RecoMuon/MuonIdentification/data/mu_2016_BDTG.weights.xml")
43 process.patMuons.computePuppiCombinedIso =
True
46 process.patElectrons.embedGsfElectronCore =
False
47 process.patElectrons.embedSuperCluster =
False
48 process.patElectrons.embedPflowSuperCluster =
False
49 process.patElectrons.embedSeedCluster =
False
50 process.patElectrons.embedBasicClusters =
False
51 process.patElectrons.embedPreshowerClusters =
False
52 process.patElectrons.embedPflowBasicClusters =
False
53 process.patElectrons.embedPflowPreshowerClusters =
False
54 process.patElectrons.embedRecHits =
False
55 process.patElectrons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
56 process.patElectrons.usePfCandidateMultiMap =
True
57 process.patElectrons.pfCandidateMultiMap = cms.InputTag(
"reducedEgamma",
"reducedGsfElectronPfCandMap")
58 process.patElectrons.electronIDSources = cms.PSet()
60 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
61 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
62 (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17).toModify(process.patElectrons,
63 addPFClusterIso =
True,
64 ecalPFClusterIsoMap =
"reducedEgamma:eleEcalPFClusIso",
65 hcalPFClusterIsoMap =
"reducedEgamma:eleHcalPFClusIso")
68 process.patElectrons.addPuppiIsolation = cms.bool(
True)
69 process.patElectrons.puppiIsolationChargedHadrons = cms.InputTag(
"egmElectronPUPPIIsolation",
"h+-DR030-BarVeto000-EndVeto001")
70 process.patElectrons.puppiIsolationNeutralHadrons = cms.InputTag(
"egmElectronPUPPIIsolation",
"h0-DR030-BarVeto000-EndVeto000")
71 process.patElectrons.puppiIsolationPhotons = cms.InputTag(
"egmElectronPUPPIIsolation",
"gamma-DR030-BarVeto000-EndVeto008")
72 process.patElectrons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"h+-DR030-BarVeto000-EndVeto001")
73 process.patElectrons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"h0-DR030-BarVeto000-EndVeto000")
74 process.patElectrons.puppiNoLeptonsIsolationPhotons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"gamma-DR030-BarVeto000-EndVeto008")
76 process.patElectrons.computeMiniIso = cms.bool(
True)
78 process.elPFIsoDepositChargedPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
79 process.elPFIsoDepositChargedAllPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
80 process.elPFIsoDepositNeutralPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
81 process.elPFIsoDepositGammaPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
82 process.elPFIsoDepositPUPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
84 process.patPhotons.embedSuperCluster =
False
85 process.patPhotons.embedSeedCluster =
False
86 process.patPhotons.embedBasicClusters =
False
87 process.patPhotons.embedPreshowerClusters =
False
88 process.patPhotons.embedRecHits =
False
91 process.patPhotons.addPuppiIsolation = cms.bool(
True)
92 process.patPhotons.puppiIsolationChargedHadrons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"h+-DR030-")
93 process.patPhotons.puppiIsolationNeutralHadrons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"h0-DR030-")
94 process.patPhotons.puppiIsolationPhotons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"gamma-DR030-")
96 (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17).toModify(process.patPhotons,
97 addPFClusterIso =
True,
98 ecalPFClusterIsoMap =
"reducedEgamma:phoEcalPFClusIso",
99 hcalPFClusterIsoMap =
"reducedEgamma:phoHcalPFClusIso")
101 run2_miniAOD_94XFall17.toModify(process.patOOTPhotons,
102 addPFClusterIso =
True,
103 ecalPFClusterIsoMap =
"reducedEgamma:ootPhoEcalPFClusIso",
104 hcalPFClusterIsoMap =
"reducedEgamma:ootPhoHcalPFClusIso")
107 process.patPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
108 process.patPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
110 process.phPFIsoDepositChargedPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
111 process.phPFIsoDepositChargedAllPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
112 process.phPFIsoDepositNeutralPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
113 process.phPFIsoDepositGammaPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
114 process.phPFIsoDepositPUPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
116 process.patOOTPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedOOTPhotons")
117 process.patOOTPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
119 process.selectedPatJets.cut = cms.string(
"pt > 10")
120 process.selectedPatMuons.cut = cms.string(
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
122 from Configuration.Eras.Modifier_phase2_muon_cff
import phase2_muon
123 phase2_muon.toModify(process.selectedPatMuons, cut =
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose') || muonID('ME0MuonArbitrated') || muonID('GEMMuonArbitrated')) )")
124 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
125 pp_on_AA.toModify(process.selectedPatMuons, cut =
"pt > 5 || isPFMuon || (pt > 1.2 && (isGlobalMuon || isStandAloneMuon) )")
127 process.selectedPatElectrons.cut = cms.string(
"")
128 process.selectedPatTaus.cut = cms.string(
"pt > 18. && tauID('decayModeFindingNewDMs')> 0.5")
129 process.selectedPatPhotons.cut = cms.string(
"")
131 _dummyPatJets = process.selectedPatJets.clone(cut =
"pt < 0")
134 def _applySubstructure(process):
137 from PhysicsTools.PatAlgos.slimming.applySubstructure_cff
import applySubstructure
139 (~pp_on_AA).toModify(process, _applySubstructure)
141 pp_on_AA.toModify(process, func =
lambda p:
addToProcessAndTask(
'slimmedJets', p.selectedPatJets.clone(), p, task))
142 pp_on_AA.toModify(process, func =
lambda p:
addToProcessAndTask(
'slimmedJetsAK8', _dummyPatJets.clone(), p, task))
145 from PhysicsTools.PatAlgos.tools.trigTools
import switchOnTriggerStandAlone
147 process.patTrigger.packTriggerPathNames = cms.bool(
True)
152 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncForMiniAODProduction
154 jetCollUnskimmed=
"patJets")
157 from PhysicsTools.PatAlgos.tools.metTools
import addMETCollection
158 addMETCollection(process,
159 labelName =
"patCaloMet",
160 metSource =
"caloMetM"
165 process.noHFCands = cms.EDFilter(
"GenericPFCandidateSelector",
166 src=cms.InputTag(
"particleFlow"),
167 cut=cms.string(
"abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0")
169 task.add(process.noHFCands)
172 pfCandColl=cms.InputTag(
"noHFCands"),
173 recoMetFromPFCs=
True,
174 jetSelection=
"pt>15 && abs(eta)<3.",
178 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
179 task.add(process.slimmedMETs)
180 (~pp_on_AA).toModify(process.slimmedMETs, addDeepMETs =
True)
182 def _add_slimmedMETsNoHF(process):
184 process.slimmedMETsNoHF.src = cms.InputTag(
"patMETsNoHF")
185 process.slimmedMETsNoHF.rawVariation = cms.InputTag(
"patPFMetNoHF")
186 process.slimmedMETsNoHF.t1Uncertainties = cms.InputTag(
"patPFMetT1%sNoHF")
187 process.slimmedMETsNoHF.t01Variation = cms.InputTag(
"patPFMetT0pcT1NoHF")
188 process.slimmedMETsNoHF.t1SmearedVarsAndUncs = cms.InputTag(
"patPFMetT1Smear%sNoHF")
189 process.slimmedMETsNoHF.tXYUncForRaw = cms.InputTag(
"patPFMetTxyNoHF")
190 process.slimmedMETsNoHF.tXYUncForT1 = cms.InputTag(
"patPFMetT1TxyNoHF")
191 process.slimmedMETsNoHF.tXYUncForT01 = cms.InputTag(
"patPFMetT0pcT1TxyNoHF")
192 process.slimmedMETsNoHF.tXYUncForT1Smear = cms.InputTag(
"patPFMetT1SmearTxyNoHF")
193 process.slimmedMETsNoHF.tXYUncForT01Smear = cms.InputTag(
"patPFMetT0pcT1SmearTxyNoHF")
194 del process.slimmedMETsNoHF.caloMET
195 (~pp_on_AA).toModify(process, _add_slimmedMETsNoHF)
199 process.CHSCands = cms.EDFilter(
"CandPtrSelector",
200 src=cms.InputTag(
"packedPFCandidates"),
201 cut=cms.string(
"fromPV(0) > 0")
203 task.add(process.CHSCands)
206 process.pfMetCHS = pfMet.clone(src =
'CHSCands')
207 task.add(process.pfMetCHS)
209 addMETCollection(process,
210 labelName =
"patCHSMet",
211 metSource =
"pfMetCHS"
214 process.patCHSMet.computeMETSignificance = cms.bool(
False)
219 process.TrkCands = cms.EDFilter(
"CandPtrSelector",
220 src=cms.InputTag(
"packedPFCandidates"),
221 cut=cms.string(
"charge()!=0 && pvAssociationQuality()>=4 && vertexRef().key()==0")
223 task.add(process.TrkCands)
225 process.pfMetTrk = pfMet.clone(src =
'TrkCands')
226 task.add(process.pfMetTrk)
228 addMETCollection(process,
229 labelName =
"patTrkMet",
230 metSource =
"pfMetTrk"
233 process.patTrkMet.computeMETSignificance = cms.bool(
False)
239 process.load(
"RecoJets.JetProducers.PileupJetID_cfi")
240 task.add(process.pileUpJetIDTask)
242 process.patJets.userData.userFloats.src = [ cms.InputTag(
"pileupJetId:fullDiscriminant"), ]
243 process.patJets.userData.userInts.src = [ cms.InputTag(
"pileupJetId:fullId"), ]
246 process.load(
'RecoJets.JetProducers.QGTagger_cfi')
247 task.add(process.QGTaggerTask)
249 process.patJets.userData.userFloats.src += [
'QGTagger:qgLikelihood', ]
252 process.load(
'RecoJets.JetProducers.hfJetShowerShape_cfi')
253 task.add(process.hfJetShowerShape)
255 process.patJets.userData.userFloats.src += [
'hfJetShowerShape:sigmaEtaEta',
'hfJetShowerShape:sigmaPhiPhi']
256 process.patJets.userData.userInts.src += [
'hfJetShowerShape:centralEtaStripSize',
'hfJetShowerShape:adjacentEtaStripsSize']
259 def _add_deepFlavour(process):
260 process.load(
'RecoBTag.Combined.deepFlavour_cff')
261 task.add(process.pfDeepCSVDiscriminatorsJetTags)
262 process.patJets.discriminatorSources.extend([
263 'pfDeepCSVDiscriminatorsJetTags:BvsAll',
264 'pfDeepCSVDiscriminatorsJetTags:CvsB',
265 'pfDeepCSVDiscriminatorsJetTags:CvsL',
267 (~pp_on_AA).toModify(process, _add_deepFlavour)
270 process.caloJetMap = cms.EDProducer(
"RecoJetDeltaRValueMapProducer",
271 src = process.patJets.jetSource,
272 matched = cms.InputTag(
"ak4CaloJets"),
273 distMax = cms.double(0.4),
274 values = cms.vstring(
'pt',
'emEnergyFraction'),
275 valueLabels = cms.vstring(
'pt',
'emEnergyFraction'),
276 lazyParser = cms.bool(
True) )
277 task.add(process.caloJetMap)
278 process.patJets.userData.userFloats.src += [
'caloJetMap:pt',
'caloJetMap:emEnergyFraction' ]
280 pp_on_AA.toModify(process.patJets.userData.userInts, src = [] )
281 pp_on_AA.toModify(process.patJets.userData.userFloats, src = [] )
284 from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationMuon
288 from PhysicsTools.PatAlgos.slimming.egmIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationEgm
290 from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff
import egamma_modifications
291 process.slimmedElectrons.modifierConfig.modifications = egamma_modifications
292 process.slimmedPhotons.modifierConfig.modifications = egamma_modifications
295 process.patElectrons.addElectronID = cms.bool(
True)
296 electron_ids = [
'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV70_cff',
297 'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV71_cff',
298 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V1_cff',
299 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V2_cff',
300 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V1_cff',
301 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V1_cff',
302 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V2_cff',
303 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V2_cff',
304 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Summer16_80X_V1_cff',
305 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_GeneralPurpose_V1_cff',
306 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_HZZ_V1_cff',
309 process.egmGsfElectronIDs.physicsObjectSrc = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
310 process.electronMVAValueMapProducer.src = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons')
314 process.load(
"RecoEgamma.EgammaTools.gedGsfElectronsTo106X_cff")
315 run2_miniAOD_80XLegacy.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom80XTo106XTask))
316 run2_miniAOD_80XLegacy.toModify(process.electronMVAValueMapProducer,
317 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
318 src = cms.InputTag(
"gedGsfElectronsFrom80XTo106X"))
320 run2_miniAOD_94XFall17.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom94XTo106XTask))
321 run2_miniAOD_94XFall17.toModify(process.electronMVAValueMapProducer,
322 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
323 src = cms.InputTag(
"gedGsfElectronsFrom94XTo106X"))
325 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
326 pp_on_AA.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom94XTo106XTask))
327 pp_on_AA.toModify(process.electronMVAValueMapProducer,
328 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
329 src =
"gedGsfElectronsFrom94XTo106X")
331 for idmod
in electron_ids:
335 process.patPhotons.addPhotonID = cms.bool(
True)
336 photon_ids = [
'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V1_TrueVtx_cff',
337 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V2_cff',
338 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V1p1_cff',
339 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V2_cff',
340 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring16_V2p2_cff',
341 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff']
343 process.egmPhotonIDs.physicsObjectSrc = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
344 process.photonMVAValueMapProducer.src = cms.InputTag(
'reducedEgamma',
'reducedGedPhotons')
345 for idmod
in photon_ids:
349 from RecoEgamma.EgammaTools.egammaObjectModifications_tools
import makeVIDBitsModifier
350 egamma_modifications.append(
makeVIDBitsModifier(process,
"egmGsfElectronIDs",
"egmPhotonIDs"))
353 from RecoTauTag.Configuration.boostedHPSPFTaus_cfi
import addBoostedTaus
355 process.load(
"RecoTauTag.Configuration.RecoPFTauTag_cff")
356 process.load(
"RecoTauTag.Configuration.HPSPFTaus_cff")
358 _makePatTausTaskWithRetrainedMVATauID = process.makePatTausTask.copy()
359 _makePatTausTaskWithRetrainedMVATauID.add(process.hpsPFTauBasicDiscriminatorsTask,
360 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask,
361 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask,
362 process.hpsPFTauBasicDiscriminatorsdR03Task,
363 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask,
364 process.hpsPFTauDiscriminationByMVA6rawElectronRejection,
365 process.hpsPFTauDiscriminationByMVA6ElectronRejection,
366 process.hpsPFTauDiscriminationByMuonRejection3)
367 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff
import run2_miniAOD_UL
368 (run2_miniAOD_94XFall17 | run2_miniAOD_UL).toReplaceWith(
369 process.makePatTausTask, _makePatTausTaskWithRetrainedMVATauID
373 _updatedTauName =
'slimmedTausDeepIDsv2p1'
374 _noUpdatedTauName =
'slimmedTausNoDeepIDs'
375 import RecoTauTag.RecoTau.tools.runTauIdMVA
as tauIdConfig
376 tauIdEmbedder = tauIdConfig.TauIDEmbedder(
377 process, debug =
False,
378 originalTauName = _noUpdatedTauName,
379 updatedTauName = _updatedTauName,
380 toKeep = [
'deepTau2017v2p1']
382 from Configuration.Eras.Modifier_phase2_common_cff
import phase2_common
383 phase2_common.toModify(tauIdEmbedder.toKeep, func=
lambda t:t.append(
'newDMPhase2v1'))
384 phase2_common.toModify(tauIdEmbedder.toKeep, func=
lambda t:t.append(
'againstElePhase2v1'))
385 tauIdEmbedder.runTauID()
387 delattr(process,
'slimmedTaus')
388 process.slimmedTaus = getattr(process, _updatedTauName).
clone()
389 process.rerunMvaIsolationTask.add(process.slimmedTaus)
390 task.add(process.rerunMvaIsolationTask)
394 _makePatTausTaskWithDeadECalVeto = process.makePatTausTask.copy()
395 _makePatTausTaskWithDeadECalVeto.add(
396 process.hpsPFTauDiscriminationByDeadECALElectronRejection
398 _run2_miniAOD_ANY = (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | run2_miniAOD_UL)
399 _run2_miniAOD_ANY.toReplaceWith(
400 process.makePatTausTask, _makePatTausTaskWithDeadECalVeto
404 _makePatTausTaskWithTauReReco = process.makePatTausTask.copy()
405 _makePatTausTaskWithTauReReco.add(process.PFTauTask)
406 (run2_miniAOD_80XLegacy | pp_on_AA).toReplaceWith(
407 process.makePatTausTask, _makePatTausTaskWithTauReReco
411 process.load(
'CommonTools.PileupAlgos.Puppi_cff')
412 process.load(
'RecoJets.JetProducers.ak4PFJets_cfi')
413 from Configuration.Eras.Modifier_pA_2016_cff
import pA_2016
414 _rerun_puppijets_task = task.copy()
415 _rerun_puppijets_task.add(process.puppi, process.ak4PFJetsPuppi)
416 (_run2_miniAOD_ANY | pA_2016 | pp_on_AA).toReplaceWith(task, _rerun_puppijets_task)
419 process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer(
"JetTracksAssociatorAtVertex",
421 jets = cms.InputTag(
"ak4PFJetsPuppi")
423 task.add(process.ak4PFJetsPuppiTracksAssociatorAtVertex)
424 process.patJetPuppiCharge = cms.EDProducer(
"JetChargeProducer",
425 src = cms.InputTag(
"ak4PFJetsPuppiTracksAssociatorAtVertex"),
426 var = cms.string(
'Pt'),
427 exp = cms.double(1.0)
429 task.add(process.patJetPuppiCharge)
431 def _add_jetsPuppi(process):
433 noDeepFlavourDiscriminators = [x.value()
if isinstance(x, cms.InputTag)
else x
for x
in process.patJets.discriminatorSources
434 if not "DeepFlavour" in str(x)]
435 addJetCollection(process, postfix =
"", labelName =
'Puppi', jetSource = cms.InputTag(
'ak4PFJetsPuppi'),
436 jetCorrections = (
'AK4PFPuppi', [
'L2Relative',
'L3Absolute'],
''),
437 pfCandidates = cms.InputTag(
"particleFlow"),
438 algo=
'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators
441 process.patJetGenJetMatchPuppi.matched =
'slimmedGenJets'
443 process.patJetsPuppi.jetChargeSource = cms.InputTag(
"patJetPuppiCharge")
445 process.selectedPatJetsPuppi.cut = cms.string(
"pt > 15")
447 from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff
import applyDeepBtagging
451 src =
"selectedPatJetsPuppi", packedPFCandidates =
"packedPFCandidates"),
454 task.add(process.slimmedJetsPuppi)
456 process.slimmedJetsNoDeepFlavour.dropTagInfos =
'0'
457 process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.addTagInfos =
True
458 process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.tagInfoSources = [
"pixelClusterTagInfos"]
459 _run2_miniAOD_ANY.toModify(process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour, addTagInfos =
False )
460 (~pp_on_AA).toModify(process, _add_jetsPuppi)
462 pp_on_AA.toModify(process, func =
lambda p:
addToProcessAndTask(
'slimmedJetsPuppi', _dummyPatJets.clone(), p, task))
465 process.patJets.addTagInfos =
True
466 process.patJets.tagInfoSources = [
"pixelClusterTagInfos"]
468 _run2_miniAOD_ANY.toModify(process.patJets, addTagInfos =
False )
470 pp_on_AA.toModify(process.patJets, tagInfoSources = cms.VInputTag([
"impactParameterTagInfos",
"secondaryVertexTagInfos"]) )
473 def _add_metPuppi(process):
474 process.load(
'RecoMET.METProducers.pfMetPuppi_cfi')
475 _rerun_puppimet_task = task.copy()
476 _rerun_puppimet_task.add(process.puppiNoLep, process.pfMetPuppi)
477 (_run2_miniAOD_ANY | pA_2016 | pp_on_AA).toReplaceWith(task, _rerun_puppimet_task)
480 jetCollUnskimmed=
"slimmedJetsPuppi",
481 recoMetFromPFCs=
True,
482 jetFlavor=
"AK4PFPuppi",
485 (~pp_on_AA).toModify(process, _add_metPuppi)
487 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
488 task.add(process.slimmedMETs)
490 def _add_slimmedMETsPuppi(process):
492 process.slimmedMETsPuppi.src = cms.InputTag(
"patMETsPuppi")
493 process.slimmedMETsPuppi.rawVariation = cms.InputTag(
"patPFMetPuppi")
494 process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag(
"patPFMetT1%sPuppi")
495 process.slimmedMETsPuppi.t01Variation = cms.InputTag(
"patPFMetT0pcT1Puppi")
496 process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag(
"patPFMetT1Smear%sPuppi")
497 process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag(
"patPFMetTxyPuppi")
498 process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag(
"patPFMetT1TxyPuppi")
499 process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag(
"patPFMetT0pcT1TxyPuppi")
500 process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag(
"patPFMetT1SmearTxyPuppi")
501 process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag(
"patPFMetT0pcT1SmearTxyPuppi")
502 del process.slimmedMETsPuppi.caloMET
503 (~pp_on_AA).toModify(process, _add_slimmedMETsPuppi)
505 def _add_deepMET(process):
506 process.load(
'RecoMET.METPUSubtraction.deepMETProducer_cfi')
508 addToProcessAndTask(
'deepMETsResolutionTune', process.deepMETProducer.clone(), process, task)
509 addToProcessAndTask(
'deepMETsResponseTune', process.deepMETProducer.clone(), process, task)
510 process.deepMETsResponseTune.graph_path =
'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb'
512 from Configuration.Eras.Modifier_phase2_common_cff
import phase2_common
513 phase2_common.toModify(
514 process.deepMETsResolutionTune,
516 graph_path=
"RecoMET/METPUSubtraction/data/deepmet/deepmet_v1_phase2.pb"
518 phase2_common.toModify(
519 process.deepMETsResponseTune,
521 graph_path=
"RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_phase2.pb"
524 from Configuration.Eras.Modifier_run2_jme_2016_cff
import run2_jme_2016
525 run2_jme_2016.toModify(
526 process.deepMETsResponseTune,
527 graph_path=
"RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb"
529 (~pp_on_AA).toModify(process, _add_deepMET)
532 process.load(
"TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff")
536 from Configuration.Eras.Modifier_phase2_hgcal_cff
import phase2_hgcal
537 process.load(
"RecoEgamma.EgammaTools.slimmedEgammaFromMultiCl_cff")
538 phase2_hgcal.toModify(task, func=
lambda t: t.add(process.slimmedEgammaFromMultiClTask))
541 from Configuration.Eras.Modifier_run2_L1prefiring_cff
import run2_L1prefiring
542 from Configuration.Eras.Modifier_stage2L1Trigger_cff
import stage2L1Trigger
543 from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff
import stage2L1Trigger_2017
544 from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff
import stage2L1Trigger_2018
545 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff
import tracker_apv_vfp30_2016
546 process.load(
"PhysicsTools.PatUtils.L1PrefiringWeightProducer_cff")
547 (stage2L1Trigger & tracker_apv_vfp30_2016).toModify(process.prefiringweight, DataEraECAL =
"UL2016preVFP", DataEraMuon =
"2016preVFP" )
548 (stage2L1Trigger & ~tracker_apv_vfp30_2016).toModify(process.prefiringweight, DataEraECAL =
"UL2016postVFP", DataEraMuon =
"2016postVFP" )
549 stage2L1Trigger_2017.toModify(process.prefiringweight, DataEraECAL =
"UL2017BtoF", DataEraMuon =
"20172018")
550 stage2L1Trigger_2018.toModify(process.prefiringweight, DataEraECAL =
"None", DataEraMuon =
"20172018")
551 run2_L1prefiring.toModify(task, func=
lambda t: t.add(process.prefiringweight))
553 from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup
import removeL1FastJetJECs
554 pp_on_AA.toModify(process, removeL1FastJetJECs)