1 import FWCore.ParameterSet.Config
as cms
8 process.patMuons.isoDeposits = cms.PSet()
9 process.patElectrons.isoDeposits = cms.PSet()
10 process.patTaus.isoDeposits = cms.PSet()
11 process.patPhotons.isoDeposits = cms.PSet()
13 process.patMuons.embedTrack =
True 14 process.patMuons.embedCombinedMuon =
True 15 process.patMuons.embedMuonBestTrack =
True 16 process.patMuons.embedStandAloneMuon =
True 17 process.patMuons.embedPickyMuon =
False 18 process.patMuons.embedTpfmsMuon =
False 19 process.patMuons.embedDytMuon =
False 20 process.patMuons.addPuppiIsolation = cms.bool(
True)
21 process.patMuons.puppiIsolationChargedHadrons = cms.InputTag(
"muonPUPPIIsolation",
"h+-DR040-ThresholdVeto000-ConeVeto000")
22 process.patMuons.puppiIsolationNeutralHadrons = cms.InputTag(
"muonPUPPIIsolation",
"h0-DR040-ThresholdVeto000-ConeVeto001")
23 process.patMuons.puppiIsolationPhotons = cms.InputTag(
"muonPUPPIIsolation",
"gamma-DR040-ThresholdVeto000-ConeVeto001")
24 process.patMuons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"h+-DR040-ThresholdVeto000-ConeVeto000")
25 process.patMuons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"h0-DR040-ThresholdVeto000-ConeVeto001")
26 process.patMuons.puppiNoLeptonsIsolationPhotons = cms.InputTag(
"muonPUPPINoLeptonsIsolation",
"gamma-DR040-ThresholdVeto000-ConeVeto001")
28 process.patMuons.computeMiniIso =
True 29 process.patMuons.computeMuonMVA =
True 30 process.patMuons.computeSoftMuonMVA =
True 32 process.patMuons.addTriggerMatching =
True 33 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff
import run2_miniAOD_UL
34 from Configuration.Eras.Modifier_run2_muon_2016_cff
import run2_muon_2016
35 from Configuration.Eras.Modifier_run2_muon_2017_cff
import run2_muon_2017
36 from Configuration.Eras.Modifier_run2_muon_2018_cff
import run2_muon_2018
37 run2_muon_2016.toModify( process.patMuons, effectiveAreaVec = [0.0735,0.0619,0.0465,0.0433,0.0577])
38 run2_muon_2017.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
39 run2_muon_2018.toModify( process.patMuons, effectiveAreaVec = [0.0566, 0.0562, 0.0363, 0.0119, 0.0064])
40 run2_muon_2016.toModify( process.patMuons, mvaTrainingFile =
"RecoMuon/MuonIdentification/data/mu_2016_BDTG.weights.xml")
41 run2_miniAOD_UL.toModify( process.patMuons, getdBFromTrack =
True)
42 process.patMuons.computePuppiCombinedIso =
True 45 process.patElectrons.embedGsfElectronCore =
False 46 process.patElectrons.embedSuperCluster =
False 47 process.patElectrons.embedPflowSuperCluster =
False 48 process.patElectrons.embedSeedCluster =
False 49 process.patElectrons.embedBasicClusters =
False 50 process.patElectrons.embedPreshowerClusters =
False 51 process.patElectrons.embedPflowBasicClusters =
False 52 process.patElectrons.embedPflowPreshowerClusters =
False 53 process.patElectrons.embedRecHits =
False 54 process.patElectrons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
55 process.patElectrons.usePfCandidateMultiMap =
True 56 process.patElectrons.pfCandidateMultiMap = cms.InputTag(
"reducedEgamma",
"reducedGsfElectronPfCandMap")
57 process.patElectrons.electronIDSources = cms.PSet()
58 run2_miniAOD_UL.toModify( process.patElectrons, getdBFromTrack =
True)
59 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
60 run2_miniAOD_80XLegacy.toModify(process.patElectrons,
61 addPFClusterIso = cms.bool(
True),
62 ecalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"eleEcalPFClusIso"),
63 hcalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"eleHcalPFClusIso"))
64 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
65 run2_miniAOD_94XFall17.toModify(process.patElectrons,
66 addPFClusterIso = cms.bool(
True),
67 ecalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"eleEcalPFClusIso"),
68 hcalPFClusterIsoMap = cms.InputTag(
"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 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
100 run2_miniAOD_80XLegacy.toModify(process.patPhotons,
101 addPFClusterIso = cms.bool(
True),
102 ecalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"phoEcalPFClusIso"),
103 hcalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"phoHcalPFClusIso"))
104 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
105 run2_miniAOD_94XFall17.toModify(process.patPhotons,
106 addPFClusterIso = cms.bool(
True),
107 ecalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"phoEcalPFClusIso"),
108 hcalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"phoHcalPFClusIso"))
110 run2_miniAOD_94XFall17.toModify(process.patOOTPhotons,
111 addPFClusterIso = cms.bool(
True),
112 ecalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"ootPhoEcalPFClusIso"),
113 hcalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"ootPhoHcalPFClusIso"))
116 process.patPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
117 process.patPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
119 process.phPFIsoDepositChargedPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
120 process.phPFIsoDepositChargedAllPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
121 process.phPFIsoDepositNeutralPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
122 process.phPFIsoDepositGammaPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
123 process.phPFIsoDepositPUPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
125 process.patOOTPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedOOTPhotons")
126 process.patOOTPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
128 process.selectedPatJets.cut = cms.string(
"pt > 10")
129 process.selectedPatMuons.cut = cms.string(
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
131 from Configuration.Eras.Modifier_phase2_muon_cff
import phase2_muon
132 phase2_muon.toModify(process.selectedPatMuons, cut =
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose') || muonID('ME0MuonArbitrated') || muonID('GEMMuonArbitrated')) )")
134 process.selectedPatElectrons.cut = cms.string(
"")
135 process.selectedPatTaus.cut = cms.string(
"pt > 18. && tauID('decayModeFindingNewDMs')> 0.5")
136 process.selectedPatPhotons.cut = cms.string(
"")
140 from PhysicsTools.PatAlgos.slimming.applySubstructure_cff
import applySubstructure
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" 167 process.noHFCands = cms.EDFilter(
"GenericPFCandidateSelector",
168 src=cms.InputTag(
"particleFlow"),
169 cut=cms.string(
"abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0")
171 task.add(process.noHFCands)
174 pfCandColl=cms.InputTag(
"noHFCands"),
175 recoMetFromPFCs=
True,
176 jetSelection=
"pt>15 && abs(eta)<3.",
180 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
181 task.add(process.slimmedMETs)
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
198 process.CHSCands = cms.EDFilter(
"CandPtrSelector",
199 src=cms.InputTag(
"packedPFCandidates"),
200 cut=cms.string(
"fromPV(0) > 0")
202 task.add(process.CHSCands)
204 process.pfMetCHS = cms.EDProducer(
"PFMETProducer",
205 src = cms.InputTag(
"CHSCands"),
206 alias = cms.string(
'pfMet'),
207 globalThreshold = cms.double(0.0),
208 calculateSignificance = cms.bool(
False),
210 task.add(process.pfMetCHS)
212 addMETCollection(process,
213 labelName =
"patCHSMet",
214 metSource =
"pfMetCHS" 217 process.patCHSMet.computeMETSignificance = cms.bool(
False)
222 process.TrkCands = cms.EDFilter(
"CandPtrSelector",
223 src=cms.InputTag(
"packedPFCandidates"),
224 cut=cms.string(
"charge()!=0 && pvAssociationQuality()>=4 && vertexRef().key()==0")
226 task.add(process.TrkCands)
228 process.pfMetTrk = cms.EDProducer(
"PFMETProducer",
229 src = cms.InputTag(
"TrkCands"),
230 alias = cms.string(
'pfMet'),
231 globalThreshold = cms.double(0.0),
232 calculateSignificance = cms.bool(
False),
235 task.add(process.pfMetTrk)
237 addMETCollection(process,
238 labelName =
"patTrkMet",
239 metSource =
"pfMetTrk" 242 process.patTrkMet.computeMETSignificance = cms.bool(
False)
248 process.load(
"RecoJets.JetProducers.PileupJetID_cfi")
249 task.add(process.pileUpJetIDTask)
251 process.patJets.userData.userFloats.src = [ cms.InputTag(
"pileupJetId:fullDiscriminant"), ]
252 process.patJets.userData.userInts.src = [ cms.InputTag(
"pileupJetId:fullId"), ]
255 process.load(
'RecoJets.JetProducers.QGTagger_cfi')
256 task.add(process.QGTaggerTask)
258 process.patJets.userData.userFloats.src += [ cms.InputTag(
'QGTagger:qgLikelihood'), ]
261 process.load(
'RecoBTag.Combined.deepFlavour_cff')
262 task.add(process.pfDeepCSVDiscriminatorsJetTags)
263 process.patJets.discriminatorSources.extend([
264 cms.InputTag(
'pfDeepCSVDiscriminatorsJetTags:BvsAll' ),
265 cms.InputTag(
'pfDeepCSVDiscriminatorsJetTags:CvsB' ),
266 cms.InputTag(
'pfDeepCSVDiscriminatorsJetTags:CvsL' ),
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 += [ cms.InputTag(
"caloJetMap:pt"), cms.InputTag(
"caloJetMap:emEnergyFraction") ]
281 from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationMuon
285 from PhysicsTools.PatAlgos.slimming.egmIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationEgm
287 from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff
import egamma_modifications
288 process.slimmedElectrons.modifierConfig.modifications = egamma_modifications
289 process.slimmedPhotons.modifierConfig.modifications = egamma_modifications
292 process.patElectrons.addElectronID = cms.bool(
True)
293 electron_ids = [
'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV70_cff',
294 'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV71_cff',
295 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V1_cff',
296 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Fall17_94X_V2_cff',
297 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V1_cff',
298 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V1_cff',
299 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V2_cff',
300 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V2_cff',
301 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Summer16_80X_V1_cff',
302 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_GeneralPurpose_V1_cff',
303 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_HZZ_V1_cff',
306 process.egmGsfElectronIDs.physicsObjectSrc = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
307 process.electronMVAValueMapProducer.src = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons')
311 process.load(
"RecoEgamma.EgammaTools.gedGsfElectronsTo106X_cff")
312 run2_miniAOD_80XLegacy.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom80XTo106XTask))
313 run2_miniAOD_80XLegacy.toModify(process.electronMVAValueMapProducer,
314 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
315 src = cms.InputTag(
"gedGsfElectronsFrom80XTo106X"))
317 run2_miniAOD_94XFall17.toModify(task, func=
lambda t: t.add(process.gedGsfElectronsFrom94XTo106XTask))
318 run2_miniAOD_94XFall17.toModify(process.electronMVAValueMapProducer,
319 keysForValueMaps = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons'),
320 src = cms.InputTag(
"gedGsfElectronsFrom94XTo106X"))
322 for idmod
in electron_ids:
326 process.patPhotons.addPhotonID = cms.bool(
True)
327 photon_ids = [
'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V1_TrueVtx_cff',
328 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Fall17_94X_V2_cff',
329 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V1p1_cff',
330 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V2_cff',
331 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring16_V2p2_cff',
332 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff']
334 process.egmPhotonIDs.physicsObjectSrc = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
335 process.photonMVAValueMapProducer.src = cms.InputTag(
'reducedEgamma',
'reducedGedPhotons')
336 for idmod
in photon_ids:
340 from RecoEgamma.EgammaTools.egammaObjectModifications_tools
import makeVIDBitsModifier
341 egamma_modifications.append(
makeVIDBitsModifier(process,
"egmGsfElectronIDs",
"egmPhotonIDs"))
344 from RecoTauTag.Configuration.boostedHPSPFTaus_cfi
import addBoostedTaus
346 process.load(
"RecoTauTag.Configuration.RecoPFTauTag_cff")
347 process.load(
"RecoTauTag.Configuration.HPSPFTaus_cff")
349 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
350 _makePatTausTaskWithRetrainedMVATauID = process.makePatTausTask.copy()
351 _makePatTausTaskWithRetrainedMVATauID.add(process.hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask,
352 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask,
353 process.hpsPFTauIsolationSums03Task,
354 process.hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask)
355 run2_miniAOD_94XFall17.toReplaceWith(
356 process.makePatTausTask, _makePatTausTaskWithRetrainedMVATauID
361 _makePatTausTaskWithMVA6ElectronRejection = process.makePatTausTask.copy()
362 _makePatTausTaskWithMVA6ElectronRejection.add(
363 process.hpsPFTauDiscriminationByMVA6ElectronRejectionTask
365 run2_miniAOD_UL.toReplaceWith(
366 process.makePatTausTask, _makePatTausTaskWithMVA6ElectronRejection
370 _updatedTauName =
'slimmedTausDeepIDsv2' 371 _noUpdatedTauName =
'slimmedTausNoDeepIDs' 372 import RecoTauTag.RecoTau.tools.runTauIdMVA
as tauIdConfig
373 tauIdEmbedder = tauIdConfig.TauIDEmbedder(
374 process, cms, debug =
False,
375 updatedTauName = _updatedTauName,
376 toKeep = [
'deepTau2017v2']
378 tauIdEmbedder.runTauID()
380 delattr(process,
'slimmedTaus')
381 process.deepTau2017v2.taus = _noUpdatedTauName
382 process.slimmedTaus = getattr(process, _updatedTauName).
clone(
383 src = _noUpdatedTauName
385 process.deepTauIDTask = cms.Task(process.deepTau2017v2, process.slimmedTaus)
386 task.add(process.deepTauIDTask)
389 _updatedTauNameNew =
'slimmedTausDeepIDsv2p1' 390 tauIdEmbedderNew = tauIdConfig.TauIDEmbedder(
391 process, cms, debug =
False,
392 updatedTauName = _updatedTauNameNew,
393 toKeep = [
'deepTau2017v2p1']
395 tauIdEmbedderNew.runTauID()
396 process.deepTau2017v2p1.taus = _noUpdatedTauName
397 deepTauIDTaskNew_ = cms.Task(process.deepTau2017v2p1,process.slimmedTaus)
399 from Configuration.Eras.Modifier_run2_tau_ul_2016_cff
import run2_tau_ul_2016
400 from Configuration.Eras.Modifier_run2_tau_ul_2018_cff
import run2_tau_ul_2018
401 for era
in [run2_miniAOD_UL,run2_tau_ul_2016,run2_tau_ul_2018]:
402 era.toReplaceWith(process.slimmedTaus,
403 getattr(process, _updatedTauNameNew).
clone(src = _noUpdatedTauName))
404 era.toReplaceWith(process.deepTauIDTask,
411 _makePatTausTaskWithDeadECalVeto = process.makePatTausTask.copy()
412 _makePatTausTaskWithDeadECalVeto.add(
413 process.hpsPFTauDiscriminationByDeadECALElectronRejection
415 run2_miniAOD_UL.toReplaceWith(
416 process.makePatTausTask, _makePatTausTaskWithDeadECalVeto
418 _withDeadEcalTauIDPs = cms.PSet(
419 process.patTaus.tauIDSources,
420 againstElectronDeadECAL = cms.InputTag(
"hpsPFTauDiscriminationByDeadECALElectronRejection")
422 run2_miniAOD_UL.toModify(process.patTaus,
423 tauIDSources = _withDeadEcalTauIDPs)
425 _withDeadEcalTauIDBoostedPs = cms.PSet(
426 process.patTausBoosted.tauIDSources,
427 againstElectronDeadECAL = cms.InputTag(
"hpsPFTauDiscriminationByDeadECALElectronRejectionBoosted")
429 run2_miniAOD_UL.toModify(process.patTausBoosted,
430 tauIDSources = _withDeadEcalTauIDBoostedPs)
433 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
434 from Configuration.Eras.Modifier_pp_on_AA_2018_cff
import pp_on_AA_2018
435 _makePatTausTaskWithTauReReco = process.makePatTausTask.copy()
436 _makePatTausTaskWithTauReReco.add(process.PFTauTask)
437 (run2_miniAOD_80XLegacy | pp_on_AA_2018).toReplaceWith(
438 process.makePatTausTask, _makePatTausTaskWithTauReReco
442 if not hasattr(process,
'ak4PFJetsPuppi'):
443 process.load(
'RecoJets.JetProducers.ak4PFJetsPuppi_cfi')
444 task.add(process.ak4PFJets)
445 task.add(process.ak4PFJetsPuppi)
446 process.ak4PFJetsPuppi.doAreaFastjet =
True 448 process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer(
"JetTracksAssociatorAtVertex",
450 jets = cms.InputTag(
"ak4PFJetsPuppi")
452 task.add(process.ak4PFJetsPuppiTracksAssociatorAtVertex)
453 process.patJetPuppiCharge = cms.EDProducer(
"JetChargeProducer",
454 src = cms.InputTag(
"ak4PFJetsPuppiTracksAssociatorAtVertex"),
455 var = cms.string(
'Pt'),
456 exp = cms.double(1.0)
458 task.add(process.patJetPuppiCharge)
460 noDeepFlavourDiscriminators = [x.value()
for x
in process.patJets.discriminatorSources
if not "DeepFlavour" in x.value()]
461 addJetCollection(process, postfix =
"", labelName =
'Puppi', jetSource = cms.InputTag(
'ak4PFJetsPuppi'),
462 jetCorrections = (
'AK4PFPuppi', [
'L2Relative',
'L3Absolute'],
''),
463 pfCandidates = cms.InputTag(
"particleFlow"),
464 algo=
'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators
467 process.patJetGenJetMatchPuppi.matched =
'slimmedGenJets' 469 process.patJetsPuppi.jetChargeSource = cms.InputTag(
"patJetPuppiCharge")
471 process.selectedPatJetsPuppi.cut = cms.string(
"pt > 15")
473 from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff
import applyDeepBtagging
476 addToProcessAndTask(
'slimmedJetsPuppiNoMultiplicities', process.slimmedJetsNoDeepFlavour.clone(), process, task)
477 process.slimmedJetsPuppiNoMultiplicities.src = cms.InputTag(
"selectedPatJetsPuppi")
478 process.slimmedJetsPuppiNoMultiplicities.packedPFCandidates = cms.InputTag(
"packedPFCandidates")
480 from PhysicsTools.PatAlgos.patPuppiJetSpecificProducer_cfi
import patPuppiJetSpecificProducer
482 process.patPuppiJetSpecificProducer = patPuppiJetSpecificProducer.clone(
483 src=cms.InputTag(
"slimmedJetsPuppiNoMultiplicities"),
485 task.add(process.patPuppiJetSpecificProducer)
488 labelName =
'PuppiJetSpecific',
489 jetSource = cms.InputTag(
'slimmedJetsPuppiNoMultiplicities'),
491 process.updatedPatJetsPuppiJetSpecific.userData.userFloats.src = [
'patPuppiJetSpecificProducer:puppiMultiplicity',
'patPuppiJetSpecificProducer:neutralPuppiMultiplicity',
'patPuppiJetSpecificProducer:neutralHadronPuppiMultiplicity',
'patPuppiJetSpecificProducer:photonPuppiMultiplicity',
'patPuppiJetSpecificProducer:HFHadronPuppiMultiplicity',
'patPuppiJetSpecificProducer:HFEMPuppiMultiplicity' ]
492 process.slimmedJetsPuppi = process.selectedUpdatedPatJetsPuppiJetSpecific.clone()
493 delattr(process,
'selectedUpdatedPatJetsPuppiJetSpecific')
495 task.add(process.slimmedJetsPuppi)
498 from PhysicsTools.PatAlgos.slimming.puppiForMET_cff
import makePuppies
502 pfCandColl=cms.InputTag(
"puppiForMET"),
503 jetCollUnskimmed=
"slimmedJetsPuppi",
504 recoMetFromPFCs=
True,
505 jetFlavor=
"AK4PFPuppi",
509 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
510 task.add(process.slimmedMETs)
512 process.slimmedMETsPuppi.src = cms.InputTag(
"patMETsPuppi")
513 process.slimmedMETsPuppi.rawVariation = cms.InputTag(
"patPFMetPuppi")
514 process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag(
"patPFMetT1%sPuppi")
515 process.slimmedMETsPuppi.t01Variation = cms.InputTag(
"patPFMetT0pcT1Puppi")
516 process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag(
"patPFMetT1Smear%sPuppi")
517 process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag(
"patPFMetTxyPuppi")
518 process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag(
"patPFMetT1TxyPuppi")
519 process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag(
"patPFMetT0pcT1TxyPuppi")
520 process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag(
"patPFMetT1SmearTxyPuppi")
521 process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag(
"patPFMetT0pcT1SmearTxyPuppi")
522 del process.slimmedMETsPuppi.caloMET
524 process.load(
'RecoMET.METPUSubtraction.deepMETProducer_cfi')
526 process.deepMETsResolutionTune = process.deepMETProducer.clone()
527 process.deepMETsResponseTune = process.deepMETProducer.clone()
528 process.deepMETsResponseTune.graph_path =
'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb' 530 from Configuration.Eras.Modifier_run2_jme_2016_cff
import run2_jme_2016
531 run2_jme_2016.toModify(
532 process.deepMETsResponseTune,
533 graph_path=
"RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb" 536 run2_miniAOD_UL.toModify(task, func=
lambda t: t.add(process.deepMETsResolutionTune, process.deepMETsResponseTune))
537 run2_miniAOD_UL.toModify(process.slimmedMETs, addDeepMETs =
True)
540 process.load(
"TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff")
544 from Configuration.Eras.Modifier_phase2_hgcal_cff
import phase2_hgcal
545 process.load(
"RecoEgamma.EgammaTools.slimmedEgammaFromMultiCl_cff")
546 phase2_hgcal.toModify(task, func=
lambda t: t.add(process.slimmedEgammaFromMultiClTask))
549 from Configuration.Eras.Modifier_run2_L1prefiring_cff
import run2_L1prefiring
550 from Configuration.Eras.Modifier_stage1L1Trigger_cff
import stage1L1Trigger
551 from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff
import stage2L1Trigger_2017
552 process.load(
"PhysicsTools.PatUtils.L1ECALPrefiringWeightProducer_cff")
553 stage1L1Trigger.toModify(process.prefiringweight, DataEra =
"2016BtoH")
554 stage2L1Trigger_2017.toModify(process.prefiringweight, DataEra =
"2017BtoF")
555 run2_L1prefiring.toModify(task, func=
lambda t: t.add(process.prefiringweight))
560 process.load(
"PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi")
561 task.add(process.selectedHadronsAndPartons)
562 task.add(process.selectedHadronsAndPartonsForGenJetsFlavourInfos)
564 process.load(
"PhysicsTools.JetMCAlgos.AK4GenJetFlavourInfos_cfi")
565 task.add(process.ak4GenJetFlavourInfos)
567 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedGenJetsFlavourInfos_cfi')
568 task.add(process.slimmedGenJetsFlavourInfos)
571 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedAddPileupInfo_cfi')
572 task.add(process.slimmedAddPileupInfo)
574 process.muonMatch.matched =
"prunedGenParticles" 575 process.electronMatch.matched =
"prunedGenParticles" 576 process.electronMatch.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
577 process.photonMatch.matched =
"prunedGenParticles" 578 process.photonMatch.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
579 process.ootPhotonMatch.matched =
"prunedGenParticles" 580 process.ootPhotonMatch.src = cms.InputTag(
"reducedEgamma",
"reducedOOTPhotons")
581 process.tauMatch.matched =
"prunedGenParticles" 582 process.tauGenJets.GenParticles =
"prunedGenParticles" 584 process.tauMatchBoosted.matched =
"prunedGenParticles" 585 process.tauGenJetsBoosted.GenParticles =
"prunedGenParticles" 586 process.patJetPartons.particles =
"genParticles" 587 process.patJetPartonMatch.matched =
"prunedGenParticles" 588 process.patJetPartonMatch.mcStatus = [ 3, 23 ]
589 process.patJetGenJetMatch.matched =
"slimmedGenJets" 590 process.patJetGenJetMatchAK8.matched =
"slimmedGenJetsAK8" 591 process.patMuons.embedGenMatch =
False 592 process.patElectrons.embedGenMatch =
False 593 process.patPhotons.embedGenMatch =
False 594 process.patOOTPhotons.embedGenMatch =
False 595 process.patTaus.embedGenMatch =
False 596 process.patTausBoosted.embedGenMatch =
False 597 process.patJets.embedGenPartonMatch =
False 599 process.patJetFlavourAssociation.rParam = 0.4
603 out.overrideBranchesSplitLevel = MiniAODOverrideBranchesSplitLevel
604 out.splitLevel = cms.untracked.int32(0)
605 out.dropMetaData = cms.untracked.string(
'ALL')
606 out.fastCloning= cms.untracked.bool(
False)
607 out.overrideInputFileSplitLevels = cms.untracked.bool(
True)
608 out.compressionAlgorithm = cms.untracked.string(
'LZMA')
612 runOnData( process, outputModules = [] )
613 process.load(
"RecoCTPPS.Configuration.recoCTPPS_cff")
615 from Configuration.Eras.Modifier_ctpps_2016_cff
import ctpps_2016
616 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff
import run2_miniAOD_UL
617 (ctpps_2016 & ~run2_miniAOD_UL).toModify(task, func=
lambda t: t.add(process.ctppsLocalTrackLiteProducer, process.ctppsProtons))
618 (ctpps_2016 & run2_miniAOD_UL).toModify(task, func=
lambda t: t.add(process.recoCTPPSTask))
637 process.patMuons.addTriggerMatching =
False def makeInputForPUPPIIsolationMuon(process)
def applySubstructure(process, postfix="")
def miniAOD_customizeMETFiltersFastSim(process)
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="")
def miniAOD_customizeIsolatedTracksFastSim(process)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
def getPatAlgosToolsTask(process)
def addBoostedTaus(process)