12 process.patMuons.isoDeposits = cms.PSet()
13 process.patElectrons.isoDeposits = cms.PSet()
14 process.patTaus.isoDeposits = cms.PSet()
15 process.patPhotons.isoDeposits = cms.PSet()
17 process.patMuons.embedTrack =
True 18 process.patMuons.embedCombinedMuon =
True 19 process.patMuons.embedMuonBestTrack =
True 20 process.patMuons.embedStandAloneMuon =
True 21 process.patMuons.embedPickyMuon =
False 22 process.patMuons.embedTpfmsMuon =
False 23 process.patMuons.embedDytMuon =
False 24 process.patMuons.addPuppiIsolation = cms.bool(
True)
25 process.patMuons.puppiIsolationChargedHadrons = cms.InputTag(
"muonPUPPIIsolation",
"h+-DR040-ThresholdVeto000-ConeVeto000")
26 process.patMuons.puppiIsolationNeutralHadrons = cms.InputTag(
"muonPUPPIIsolation",
"h0-DR040-ThresholdVeto000-ConeVeto001")
27 process.patMuons.puppiIsolationPhotons = cms.InputTag(
"muonPUPPIIsolation",
"gamma-DR040-ThresholdVeto000-ConeVeto001")
28 process.patMuons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"h+-DR040-ThresholdVeto000-ConeVeto000")
29 process.patMuons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"h0-DR040-ThresholdVeto000-ConeVeto001")
30 process.patMuons.puppiNoLeptonsIsolationPhotons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"gamma-DR040-ThresholdVeto000-ConeVeto001")
32 process.patMuons.computeMiniIso =
True 33 process.patMuons.computeMuonIDMVA =
True 34 process.patMuons.computeSoftMuonMVA =
True 36 process.patMuons.addTriggerMatching =
True 37 from Configuration.Eras.Modifier_run2_muon_2016_cff
import run2_muon_2016
38 from Configuration.Eras.Modifier_run2_muon_2017_cff
import run2_muon_2017
39 from Configuration.Eras.Modifier_run2_muon_2018_cff
import run2_muon_2018
40 from Configuration.Eras.Modifier_run3_muon_cff
import run3_muon
41 run2_muon_2016.toModify( process.patMuons, effectiveAreaVec = [0.0735,0.0619,0.0465,0.0433,0.0577])
42 run2_muon_2017.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
43 run2_muon_2018.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
44 run3_muon.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
46 process.patMuons.computePuppiCombinedIso =
True 49 process.patElectrons.embedGsfElectronCore =
False 50 process.patElectrons.embedSuperCluster =
False 51 process.patElectrons.embedPflowSuperCluster =
False 52 process.patElectrons.embedSeedCluster =
False 53 process.patElectrons.embedBasicClusters =
False 54 process.patElectrons.embedPreshowerClusters =
False 55 process.patElectrons.embedPflowBasicClusters =
False 56 process.patElectrons.embedPflowPreshowerClusters =
False 57 process.patElectrons.embedRecHits =
False 58 process.patElectrons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
59 process.patElectrons.usePfCandidateMultiMap =
True 60 process.patElectrons.pfCandidateMultiMap = cms.InputTag(
"reducedEgamma",
"reducedGsfElectronPfCandMap")
61 process.patElectrons.electronIDSources = cms.PSet()
63 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
64 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
65 (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17).toModify(process.patElectrons,
66 addPFClusterIso =
True,
67 ecalPFClusterIsoMap =
"reducedEgamma:eleEcalPFClusIso",
68 hcalPFClusterIsoMap =
"reducedEgamma:eleHcalPFClusIso")
71 process.patElectrons.addPuppiIsolation = cms.bool(
True)
72 process.patElectrons.puppiIsolationChargedHadrons = cms.InputTag(
"egmElectronPUPPIIsolation",
"h+-DR030-BarVeto000-EndVeto001")
73 process.patElectrons.puppiIsolationNeutralHadrons = cms.InputTag(
"egmElectronPUPPIIsolation",
"h0-DR030-BarVeto000-EndVeto000")
74 process.patElectrons.puppiIsolationPhotons = cms.InputTag(
"egmElectronPUPPIIsolation",
"gamma-DR030-BarVeto000-EndVeto008")
75 process.patElectrons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"h+-DR030-BarVeto000-EndVeto001")
76 process.patElectrons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"h0-DR030-BarVeto000-EndVeto000")
77 process.patElectrons.puppiNoLeptonsIsolationPhotons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"gamma-DR030-BarVeto000-EndVeto008")
79 process.patElectrons.computeMiniIso = cms.bool(
True)
81 process.elPFIsoDepositChargedPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
82 process.elPFIsoDepositChargedAllPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
83 process.elPFIsoDepositNeutralPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
84 process.elPFIsoDepositGammaPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
85 process.elPFIsoDepositPUPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
87 process.patPhotons.embedSuperCluster =
False 88 process.patPhotons.embedSeedCluster =
False 89 process.patPhotons.embedBasicClusters =
False 90 process.patPhotons.embedPreshowerClusters =
False 91 process.patPhotons.embedRecHits =
False 94 process.patPhotons.addPuppiIsolation = cms.bool(
True)
95 process.patPhotons.puppiIsolationChargedHadrons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"h+-DR030-")
96 process.patPhotons.puppiIsolationNeutralHadrons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"h0-DR030-")
97 process.patPhotons.puppiIsolationPhotons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"gamma-DR030-")
99 (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17).toModify(process.patPhotons,
100 addPFClusterIso =
True,
101 ecalPFClusterIsoMap =
"reducedEgamma:phoEcalPFClusIso",
102 hcalPFClusterIsoMap =
"reducedEgamma:phoHcalPFClusIso")
104 run2_miniAOD_94XFall17.toModify(process.patOOTPhotons,
105 addPFClusterIso =
True,
106 ecalPFClusterIsoMap =
"reducedEgamma:ootPhoEcalPFClusIso",
107 hcalPFClusterIsoMap =
"reducedEgamma:ootPhoHcalPFClusIso")
110 process.patPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
111 process.patPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
113 process.phPFIsoDepositChargedPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
114 process.phPFIsoDepositChargedAllPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
115 process.phPFIsoDepositNeutralPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
116 process.phPFIsoDepositGammaPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
117 process.phPFIsoDepositPUPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
119 process.patOOTPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedOOTPhotons")
120 process.patOOTPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
122 process.selectedPatJets.cut = cms.string(
"pt > 15")
123 process.selectedPatMuons.cut = cms.string(
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
125 from Configuration.Eras.Modifier_phase2_muon_cff
import phase2_muon
126 phase2_muon.toModify(process.selectedPatMuons, cut =
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose') || muonID('ME0MuonArbitrated') || muonID('GEMMuonArbitrated')) )")
127 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
128 pp_on_AA.toModify(process.selectedPatMuons, cut =
"pt > 5 || isPFMuon || (pt > 1.2 && (isGlobalMuon || isStandAloneMuon) )")
129 from Configuration.Eras.Modifier_run3_upc_cff
import run3_upc
130 run3_upc.toModify(process.selectedPatMuons, cut =
"")
132 process.selectedPatElectrons.cut = cms.string(
"")
133 process.selectedPatTaus.cut = cms.string(
"pt > 18. && tauID('decayModeFindingNewDMs')> 0.5")
134 process.selectedPatPhotons.cut = cms.string(
"")
136 _dummyPatJets = process.selectedPatJets.clone(cut =
"pt < 0")
139 def _applySubstructure(process):
142 from PhysicsTools.PatAlgos.slimming.applySubstructure_cff
import applySubstructure
144 (~pp_on_AA).toModify(process, _applySubstructure)
146 pp_on_AA.toModify(process, func =
lambda p:
addToProcessAndTask(
'slimmedJets', p.selectedPatJets.clone(), p, task))
147 pp_on_AA.toModify(process, func =
lambda p:
addToProcessAndTask(
'slimmedJetsAK8', _dummyPatJets.clone(), p, task))
150 from PhysicsTools.PatAlgos.tools.trigTools
import switchOnTriggerStandAlone
152 process.patTrigger.packTriggerPathNames = cms.bool(
True)
157 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncForMiniAODProduction
159 jetCollUnskimmed=
"patJets")
162 from PhysicsTools.PatAlgos.tools.metTools
import addMETCollection
163 addMETCollection(process,
164 labelName =
"patCaloMet",
165 metSource =
"caloMetM" 170 process.noHFCands = cms.EDFilter(
"GenericPFCandidateSelector",
171 src=cms.InputTag(
"particleFlow"),
172 cut=cms.string(
"abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0")
174 task.add(process.noHFCands)
177 pfCandColl=cms.InputTag(
"noHFCands"),
178 recoMetFromPFCs=
True,
179 jetSelection=
"pt>15 && abs(eta)<3.",
183 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
184 task.add(process.slimmedMETs)
185 (~pp_on_AA).toModify(process.slimmedMETs, addDeepMETs =
True)
190 process.load(
"CommonTools.ParticleFlow.pfCHS_cff")
191 task.add(process.pfCHS)
194 process.pfMetCHS = pfMet.clone(src =
'pfCHS')
195 task.add(process.pfMetCHS)
197 addMETCollection(process,
198 labelName =
"patCHSMet",
199 metSource =
"pfMetCHS" 202 process.patCHSMet.computeMETSignificance = cms.bool(
False)
207 process.TrkCands = chargedPackedCandsForTkMet.clone()
208 task.add(process.TrkCands)
210 process.pfMetTrk = pfMet.clone(src =
'TrkCands')
211 task.add(process.pfMetTrk)
213 addMETCollection(process,
214 labelName =
"patTrkMet",
215 metSource =
"pfMetTrk" 218 process.patTrkMet.computeMETSignificance = cms.bool(
False)
223 process.load(
'RecoJets.JetProducers.hfJetShowerShape_cfi')
224 task.add(process.hfJetShowerShape)
226 process.patJets.userData.userFloats.src += [
'hfJetShowerShape:sigmaEtaEta',
'hfJetShowerShape:sigmaPhiPhi']
227 process.patJets.userData.userInts.src += [
'hfJetShowerShape:centralEtaStripSize',
'hfJetShowerShape:adjacentEtaStripsSize']
230 def _add_deepFlavour(process):
231 process.load(
'RecoBTag.Combined.deepFlavour_cff')
232 task.add(process.pfDeepCSVDiscriminatorsJetTags)
233 process.patJets.discriminatorSources.extend([
234 'pfDeepCSVDiscriminatorsJetTags:BvsAll',
235 'pfDeepCSVDiscriminatorsJetTags:CvsB',
236 'pfDeepCSVDiscriminatorsJetTags:CvsL',
240 process.caloJetMap = cms.EDProducer(
"RecoJetDeltaRValueMapProducer",
241 src = process.patJets.jetSource,
242 matched = cms.InputTag(
"ak4CaloJets"),
243 distMax = cms.double(0.4),
244 values = cms.vstring(
'pt',
'emEnergyFraction'),
245 valueLabels = cms.vstring(
'pt',
'emEnergyFraction'),
246 lazyParser = cms.bool(
True) )
247 task.add(process.caloJetMap)
248 process.patJets.userData.userFloats.src += [
'caloJetMap:pt',
'caloJetMap:emEnergyFraction' ]
250 pp_on_AA.toModify(process.patJets.userData.userInts, src = [] )
251 pp_on_AA.toModify(process.patJets.userData.userFloats, src = [] )
254 from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationMuon
258 from PhysicsTools.PatAlgos.slimming.egmIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationEgm
260 from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff
import egamma_modifications
261 process.slimmedElectrons.modifierConfig.modifications = egamma_modifications
262 process.slimmedPhotons.modifierConfig.modifications = egamma_modifications
265 process.patElectrons.addElectronID = cms.bool(
True)
266 electron_ids = [
'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV70_cff',
267 'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV71_cff',
268 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V1_cff',
269 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V2_cff',
270 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Winter22_122X_V1_cff',
271 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V1_cff',
272 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V1_cff',
273 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V2_cff',
274 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V2_cff',
275 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Summer16_80X_V1_cff',
276 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_GeneralPurpose_V1_cff',
277 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_HZZ_V1_cff',
278 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer16UL_ID_ISO_cff',
279 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer17UL_ID_ISO_cff',
280 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer18UL_ID_ISO_cff',
281 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_RunIIIWinter22_noIso_V1_cff',
282 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_RunIIIWinter22_iso_V1_cff',
283 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Winter22_HZZ_V1_cff' 286 process.egmGsfElectronIDs.physicsObjectSrc = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
287 process.electronMVAValueMapProducer.src = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons')
291 process.load(
"RecoEgamma.EgammaTools.gedGsfElectronsTo106X_cff")
292 run2_miniAOD_80XLegacy.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom80XTo106XTask))
293 run2_miniAOD_80XLegacy.toModify(process.electronMVAValueMapProducer,
294 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
295 src = cms.InputTag(
"gedGsfElectronsFrom80XTo106X"))
297 run2_miniAOD_94XFall17.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom94XTo106XTask))
298 run2_miniAOD_94XFall17.toModify(process.electronMVAValueMapProducer,
299 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
300 src = cms.InputTag(
"gedGsfElectronsFrom94XTo106X"))
302 from Configuration.Eras.Modifier_pp_on_AA_2018_cff
import pp_on_AA_2018
303 pp_on_AA_2018.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom94XTo106XTask))
304 pp_on_AA_2018.toModify(process.electronMVAValueMapProducer,
305 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
306 src =
"gedGsfElectronsFrom94XTo106X")
308 for idmod
in electron_ids:
312 process.patPhotons.addPhotonID = cms.bool(
True)
313 photon_ids = [
'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V1_TrueVtx_cff',
314 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V2_cff',
315 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V1p1_cff',
316 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V2_cff',
317 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring16_V2p2_cff',
318 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff',
319 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Winter22_122X_V1_cff',
320 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_RunIIIWinter22_122X_V1_cff']
323 process.egmPhotonIDs.physicsObjectSrc = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
324 process.photonMVAValueMapProducer.src = cms.InputTag(
'reducedEgamma',
'reducedGedPhotons')
325 for idmod
in photon_ids:
329 from RecoEgamma.EgammaTools.egammaObjectModifications_tools
import makeVIDBitsModifier
330 egamma_modifications.append(
makeVIDBitsModifier(process,
"egmGsfElectronIDs",
"egmPhotonIDs"))
333 from RecoTauTag.Configuration.boostedHPSPFTaus_cfi
import addBoostedTaus
335 process.load(
"RecoTauTag.Configuration.RecoPFTauTag_cff")
336 process.load(
"RecoTauTag.Configuration.HPSPFTaus_cff")
338 _makePatTausTaskWithRetrainedMVATauID = process.makePatTausTask.copy()
339 _makePatTausTaskWithRetrainedMVATauID.add(process.hpsPFTauBasicDiscriminatorsTask,
340 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask,
341 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask,
342 process.hpsPFTauBasicDiscriminatorsdR03Task,
343 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask,
344 process.hpsPFTauDiscriminationByMVA6rawElectronRejection,
345 process.hpsPFTauDiscriminationByMVA6ElectronRejection,
346 process.hpsPFTauDiscriminationByMuonRejection3)
347 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff
import run2_miniAOD_UL
348 (run2_miniAOD_94XFall17 | run2_miniAOD_UL).toReplaceWith(
349 process.makePatTausTask, _makePatTausTaskWithRetrainedMVATauID
353 _updatedTauName =
'slimmedTausDeepIDsv2p1' 354 _noUpdatedTauName =
'slimmedTausNoDeepIDs' 355 import RecoTauTag.RecoTau.tools.runTauIdMVA
as tauIdConfig
356 tauIdEmbedder = tauIdConfig.TauIDEmbedder(
357 process, debug =
False,
358 originalTauName = _noUpdatedTauName,
359 updatedTauName = _updatedTauName,
361 toKeep = [
'deepTau2017v2p1',
'deepTau2018v2p5']
363 from Configuration.Eras.Modifier_phase2_common_cff
import phase2_common
364 _tauIds_phase2 = [
'deepTau2026v2p5']
365 phase2_common.toModify(tauIdEmbedder.toKeep, func=
lambda t:t.extend(_tauIds_phase2))
366 tauIdEmbedder.runTauID()
368 delattr(process,
'slimmedTaus')
369 process.slimmedTaus = getattr(process, _updatedTauName).
clone()
370 process.rerunMvaIsolationTaskForMini.add(process.slimmedTaus)
371 task.add(process.rerunMvaIsolationTaskForMini)
375 _makePatTausTaskWithDeadECalVeto = process.makePatTausTask.copy()
376 _makePatTausTaskWithDeadECalVeto.add(
377 process.hpsPFTauDiscriminationByDeadECALElectronRejection
379 _run2_miniAOD_ANY = (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | run2_miniAOD_UL)
380 _run2_miniAOD_ANY.toReplaceWith(
381 process.makePatTausTask, _makePatTausTaskWithDeadECalVeto
385 _makePatTausTaskWithTauReReco = process.makePatTausTask.copy()
386 _makePatTausTaskWithTauReReco.add(process.PFTauTask)
387 (run2_miniAOD_80XLegacy | pp_on_AA).toReplaceWith(
388 process.makePatTausTask, _makePatTausTaskWithTauReReco
392 process.load(
'CommonTools.PileupAlgos.Puppi_cff')
393 process.load(
'RecoJets.JetProducers.ak4PFJets_cfi')
394 from Configuration.Eras.Modifier_pA_2016_cff
import pA_2016
395 from Configuration.Eras.Modifier_run3_miniAOD_12X_cff
import run3_miniAOD_12X
396 _rerun_puppijets_task = task.copy()
397 _rerun_puppijets_task.add(process.puppi, process.ak4PFJetsPuppi)
398 (_run2_miniAOD_ANY | pA_2016 | pp_on_AA | run3_miniAOD_12X).toReplaceWith(task, _rerun_puppijets_task)
401 process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer(
"JetTracksAssociatorAtVertex",
403 jets = cms.InputTag(
"ak4PFJetsPuppi")
405 task.add(process.ak4PFJetsPuppiTracksAssociatorAtVertex)
406 process.patJetPuppiCharge = cms.EDProducer(
"JetChargeProducer",
407 src = cms.InputTag(
"ak4PFJetsPuppiTracksAssociatorAtVertex"),
408 var = cms.string(
'Pt'),
409 exp = cms.double(1.0)
411 task.add(process.patJetPuppiCharge)
413 def _add_jetsPuppi(process):
415 noDeepFlavourDiscriminators = [x.value()
if isinstance(x, cms.InputTag)
else x
for x
in process.patJets.discriminatorSources
416 if (
not "DeepFlavour" in str(x)
and not "Transformer" in str(x))]
417 addJetCollection(process, postfix =
"", labelName =
'Puppi', jetSource = cms.InputTag(
'ak4PFJetsPuppi'),
418 jetCorrections = (
'AK4PFPuppi', [
'L2Relative',
'L3Absolute'],
''),
419 pfCandidates = cms.InputTag(
"particleFlow"),
420 algo=
'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators
423 process.patJetGenJetMatchPuppi.matched =
'slimmedGenJets' 425 process.patJetsPuppi.jetChargeSource = cms.InputTag(
"patJetPuppiCharge")
427 process.selectedPatJetsPuppi.cut = cms.string(
"pt > 10")
429 from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff
import applyDeepBtagging
432 process.slimmedJetsNoDeepFlavour.dropTagInfos =
'0' 433 process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.addTagInfos =
True 434 process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.tagInfoSources = [
"pixelClusterTagInfos"]
435 _run2_miniAOD_ANY.toModify(process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour, addTagInfos =
False )
436 (~pp_on_AA).toModify(process, _add_jetsPuppi)
438 pp_on_AA.toModify(process, func =
lambda p:
addToProcessAndTask(
'slimmedJetsPuppi', _dummyPatJets.clone(), p, task))
441 process.patJets.addTagInfos =
True 442 process.patJets.tagInfoSources = [
"pixelClusterTagInfos"]
444 _run2_miniAOD_ANY.toModify(process.patJets, addTagInfos =
False )
446 from Configuration.Eras.Modifier_pp_on_AA_2018_cff
import pp_on_AA_2018
447 pp_on_AA_2018.toModify(process.patJets, tagInfoSources = cms.VInputTag([
"impactParameterTagInfos",
"secondaryVertexTagInfos"]) )
450 def _add_metPuppi(process):
451 process.load(
'RecoMET.METProducers.pfMetPuppi_cfi')
452 _rerun_puppimet_task = task.copy()
453 _rerun_puppimet_task.add(process.puppiNoLep, process.pfMetPuppi)
454 (_run2_miniAOD_ANY | pA_2016 | pp_on_AA | run3_miniAOD_12X).toReplaceWith(task, _rerun_puppimet_task)
457 jetCollUnskimmed=
"slimmedJetsPuppi",
458 recoMetFromPFCs=
True,
459 jetFlavor=
"AK4PFPuppi",
462 (~pp_on_AA).toModify(process, _add_metPuppi)
464 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
465 task.add(process.slimmedMETs)
467 def _add_slimmedMETsPuppi(process):
469 process.slimmedMETsPuppi.src = cms.InputTag(
"patMETsPuppi")
470 process.slimmedMETsPuppi.rawVariation = cms.InputTag(
"patPFMetPuppi")
471 process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag(
"patPFMetT1%sPuppi")
472 process.slimmedMETsPuppi.t01Variation = cms.InputTag(
"patPFMetT0pcT1Puppi")
473 process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag(
"patPFMetT1Smear%sPuppi")
474 process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag(
"patPFMetTxyPuppi")
475 process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag(
"patPFMetT1TxyPuppi")
476 process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag(
"patPFMetT0pcT1TxyPuppi")
477 process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag(
"patPFMetT1SmearTxyPuppi")
478 process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag(
"patPFMetT0pcT1SmearTxyPuppi")
479 del process.slimmedMETsPuppi.caloMET
480 (~pp_on_AA).toModify(process, _add_slimmedMETsPuppi)
482 def _add_deepMET(process):
483 from RecoMET.METPUSubtraction.deepMETProducer_cff
import deepMETsResolutionTune, deepMETsResponseTune
487 (~pp_on_AA).toModify(process, _add_deepMET)
490 process.load(
"TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff")
494 from Configuration.Eras.Modifier_phase2_hgcal_cff
import phase2_hgcal
495 process.load(
"RecoEgamma.EgammaTools.slimmedEgammaHGC_cff")
496 phase2_hgcal.toModify(task, func=
lambda t: t.add(process.slimmedEgammaHGCTask))
499 from Configuration.Eras.Modifier_run2_L1prefiring_cff
import run2_L1prefiring
500 from Configuration.Eras.Modifier_stage2L1Trigger_cff
import stage2L1Trigger
501 from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff
import stage2L1Trigger_2017
502 from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff
import stage2L1Trigger_2018
503 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff
import tracker_apv_vfp30_2016
504 if not hasattr(process,
'prefiringweight'):
505 process.load(
"PhysicsTools.PatUtils.L1PrefiringWeightProducer_cff")
506 (stage2L1Trigger & tracker_apv_vfp30_2016).toModify(process.prefiringweight, DataEraECAL =
"UL2016preVFP", DataEraMuon =
"2016preVFP" )
507 (stage2L1Trigger & ~tracker_apv_vfp30_2016).toModify(process.prefiringweight, DataEraECAL =
"UL2016postVFP", DataEraMuon =
"2016postVFP" )
508 stage2L1Trigger_2017.toModify(process.prefiringweight, DataEraECAL =
"UL2017BtoF", DataEraMuon =
"20172018")
509 stage2L1Trigger_2018.toModify(process.prefiringweight, DataEraECAL =
"None", DataEraMuon =
"20172018")
510 run2_L1prefiring.toModify(task, func=
lambda t: t.add(process.prefiringweight))
512 from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup
import removeL1FastJetJECs
513 pp_on_AA.toModify(process, removeL1FastJetJECs)
def makeInputForPUPPIIsolationMuon(process)
def applySubstructure(process, postfix="")
def addToProcessAndTask(label, module, process, task)
def makeInputForPUPPIIsolationEgm(process)
def runMetCorAndUncForMiniAODProduction(process, metType="PF", jetCollUnskimmed="patJets", photonColl="selectedPatPhotons", electronColl="selectedPatElectrons", muonColl="selectedPatMuons", tauColl="selectedPatTaus", pfCandColl="particleFlow", jetCleaning="LepClean", jetSelection="pt>15 && abs(eta)<9.9", jecUnFile="", jetFlavor="AK4PFchs", recoMetFromPFCs=False, postfix="")
def applyDeepBtagging(process, postfix="")
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
def getPatAlgosToolsTask(process)
def addBoostedTaus(process)