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 = cms.bool(
True)
32 process.patElectrons.embedGsfElectronCore =
False 33 process.patElectrons.embedSuperCluster =
False 34 process.patElectrons.embedPflowSuperCluster =
False 35 process.patElectrons.embedSeedCluster =
False 36 process.patElectrons.embedBasicClusters =
False 37 process.patElectrons.embedPreshowerClusters =
False 38 process.patElectrons.embedPflowBasicClusters =
False 39 process.patElectrons.embedPflowPreshowerClusters =
False 40 process.patElectrons.embedRecHits =
False 41 process.patElectrons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
42 process.patElectrons.usePfCandidateMultiMap =
True 43 process.patElectrons.pfCandidateMultiMap = cms.InputTag(
"reducedEgamma",
"reducedGsfElectronPfCandMap")
44 process.patElectrons.electronIDSources = cms.PSet(
47 eidRobustLoose = cms.InputTag(
"reducedEgamma",
"eidRobustLoose"),
48 eidRobustTight = cms.InputTag(
"reducedEgamma",
"eidRobustTight"),
49 eidLoose = cms.InputTag(
"reducedEgamma",
"eidLoose"),
50 eidTight = cms.InputTag(
"reducedEgamma",
"eidTight"),
51 eidRobustHighEnergy = cms.InputTag(
"reducedEgamma",
"eidRobustHighEnergy"),
53 process.patElectrons.addPFClusterIso = cms.bool(
True)
55 process.patElectrons.addPuppiIsolation = cms.bool(
True)
56 process.patElectrons.puppiIsolationChargedHadrons = cms.InputTag(
"egmElectronPUPPIIsolation",
"h+-DR030-BarVeto000-EndVeto001")
57 process.patElectrons.puppiIsolationNeutralHadrons = cms.InputTag(
"egmElectronPUPPIIsolation",
"h0-DR030-BarVeto000-EndVeto000")
58 process.patElectrons.puppiIsolationPhotons = cms.InputTag(
"egmElectronPUPPIIsolation",
"gamma-DR030-BarVeto000-EndVeto008")
59 process.patElectrons.puppiNoLeptonsIsolationChargedHadrons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"h+-DR030-BarVeto000-EndVeto001")
60 process.patElectrons.puppiNoLeptonsIsolationNeutralHadrons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"h0-DR030-BarVeto000-EndVeto000")
61 process.patElectrons.puppiNoLeptonsIsolationPhotons = cms.InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"gamma-DR030-BarVeto000-EndVeto008")
63 process.patElectrons.computeMiniIso = cms.bool(
True)
65 process.patElectrons.ecalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"eleEcalPFClusIso")
66 process.patElectrons.hcalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"eleHcalPFClusIso")
68 process.elPFIsoDepositChargedPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
69 process.elPFIsoDepositChargedAllPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
70 process.elPFIsoDepositNeutralPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
71 process.elPFIsoDepositGammaPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
72 process.elPFIsoDepositPUPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
74 process.patPhotons.embedSuperCluster =
False 75 process.patPhotons.embedSeedCluster =
False 76 process.patPhotons.embedBasicClusters =
False 77 process.patPhotons.embedPreshowerClusters =
False 78 process.patPhotons.embedRecHits =
False 79 process.patPhotons.addPFClusterIso = cms.bool(
True)
82 process.patPhotons.addPuppiIsolation = cms.bool(
True)
83 process.patPhotons.puppiIsolationChargedHadrons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"h+-DR030-")
84 process.patPhotons.puppiIsolationNeutralHadrons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"h0-DR030-")
85 process.patPhotons.puppiIsolationPhotons = cms.InputTag(
"egmPhotonPUPPIIsolation",
"gamma-DR030-")
87 process.patPhotons.ecalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"phoEcalPFClusIso")
88 process.patPhotons.hcalPFClusterIsoMap = cms.InputTag(
"reducedEgamma",
"phoHcalPFClusIso")
89 process.patPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
90 process.patPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
91 process.patPhotons.photonIDSources = cms.PSet(
92 PhotonCutBasedIDLoose = cms.InputTag(
'reducedEgamma',
93 'PhotonCutBasedIDLoose'),
94 PhotonCutBasedIDTight = cms.InputTag(
'reducedEgamma',
95 'PhotonCutBasedIDTight')
98 process.phPFIsoDepositChargedPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
99 process.phPFIsoDepositChargedAllPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
100 process.phPFIsoDepositNeutralPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
101 process.phPFIsoDepositGammaPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
102 process.phPFIsoDepositPUPAT.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
104 process.patOOTPhotons.photonSource = cms.InputTag(
"reducedEgamma",
"reducedOOTPhotons")
105 process.patOOTPhotons.electronSource = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
107 process.selectedPatJets.cut = cms.string(
"pt > 10")
108 process.selectedPatMuons.cut = cms.string(
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
110 from Configuration.Eras.Modifier_phase2_muon_cff
import phase2_muon
111 phase2_muon.toModify(process.selectedPatMuons, cut =
"pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose') || muonID('ME0MuonArbitrated') || muonID('GEMMuonArbitrated')) )")
113 process.selectedPatElectrons.cut = cms.string(
"")
114 process.selectedPatTaus.cut = cms.string(
"pt > 18. && tauID('decayModeFindingNewDMs')> 0.5")
115 process.selectedPatPhotons.cut = cms.string(
"")
119 from PhysicsTools.PatAlgos.slimming.applySubstructure_cff
import applySubstructure
124 from PhysicsTools.PatAlgos.tools.trigTools
import switchOnTriggerStandAlone
126 process.patTrigger.packTriggerPathNames = cms.bool(
True)
131 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncForMiniAODProduction
133 jetCollUnskimmed=
"patJets")
136 from PhysicsTools.PatAlgos.tools.metTools
import addMETCollection
137 addMETCollection(process,
138 labelName =
"patCaloMet",
139 metSource =
"caloMetM" 146 process.noHFCands = cms.EDFilter(
"GenericPFCandidateSelector",
147 src=cms.InputTag(
"particleFlow"),
148 cut=cms.string(
"abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0")
150 task.add(process.noHFCands)
153 pfCandColl=cms.InputTag(
"noHFCands"),
154 recoMetFromPFCs=
True,
155 jetSelection=
"pt>15 && abs(eta)<3.",
159 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
160 task.add(process.slimmedMETs)
162 process.slimmedMETsNoHF.src = cms.InputTag(
"patMETsNoHF")
163 process.slimmedMETsNoHF.rawVariation = cms.InputTag(
"patPFMetNoHF")
164 process.slimmedMETsNoHF.t1Uncertainties = cms.InputTag(
"patPFMetT1%sNoHF")
165 process.slimmedMETsNoHF.t01Variation = cms.InputTag(
"patPFMetT0pcT1NoHF")
166 process.slimmedMETsNoHF.t1SmearedVarsAndUncs = cms.InputTag(
"patPFMetT1Smear%sNoHF")
167 process.slimmedMETsNoHF.tXYUncForRaw = cms.InputTag(
"patPFMetTxyNoHF")
168 process.slimmedMETsNoHF.tXYUncForT1 = cms.InputTag(
"patPFMetT1TxyNoHF")
169 process.slimmedMETsNoHF.tXYUncForT01 = cms.InputTag(
"patPFMetT0pcT1TxyNoHF")
170 process.slimmedMETsNoHF.tXYUncForT1Smear = cms.InputTag(
"patPFMetT1SmearTxyNoHF")
171 process.slimmedMETsNoHF.tXYUncForT01Smear = cms.InputTag(
"patPFMetT0pcT1SmearTxyNoHF")
172 del process.slimmedMETsNoHF.caloMET
176 process.load(
"RecoJets.JetProducers.PileupJetID_cfi")
177 task.add(process.pileUpJetIDTask)
179 process.patJets.userData.userFloats.src = [ cms.InputTag(
"pileupJetId:fullDiscriminant"), ]
180 process.patJets.userData.userInts.src = [ cms.InputTag(
"pileupJetId:fullId"), ]
183 process.load(
'RecoJets.JetProducers.QGTagger_cfi')
184 task.add(process.QGTaggerTask)
186 process.patJets.userData.userFloats.src += [ cms.InputTag(
'QGTagger:qgLikelihood'), ]
189 process.caloJetMap = cms.EDProducer(
"RecoJetDeltaRValueMapProducer",
190 src = process.patJets.jetSource,
191 matched = cms.InputTag(
"ak4CaloJets"),
192 distMax = cms.double(0.4),
193 values = cms.vstring(
'pt',
'emEnergyFraction'),
194 valueLabels = cms.vstring(
'pt',
'emEnergyFraction'),
195 lazyParser = cms.bool(
True) )
196 task.add(process.caloJetMap)
197 process.patJets.userData.userFloats.src += [ cms.InputTag(
"caloJetMap:pt"), cms.InputTag(
"caloJetMap:emEnergyFraction") ]
200 from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationMuon
204 from PhysicsTools.PatAlgos.slimming.egmIsolationsPUPPI_cfi
import makeInputForPUPPIIsolationEgm
206 from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff
import egamma_modifications
207 process.slimmedElectrons.modifierConfig.modifications = egamma_modifications
208 process.slimmedPhotons.modifierConfig.modifications = egamma_modifications
211 electron_ids = [
'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_PHYS14_PU20bx25_V2_cff',
212 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Spring15_25ns_V1_cff',
213 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Spring15_50ns_V2_cff',
214 'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV60_cff',
215 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring15_25ns_nonTrig_V1_cff',
216 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring15_25ns_Trig_V1_cff',
217 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring15_50ns_Trig_V1_cff']
219 process.egmGsfElectronIDs.physicsObjectSrc = \
220 cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
221 process.electronMVAValueMapProducer.src = \
222 cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons')
223 process.electronRegressionValueMapProducer.src = \
224 cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons')
225 for idmod
in electron_ids:
229 if hasattr(process,
'heepIDVarValueMaps'):
230 process.heepIDVarValueMaps.elesMiniAOD = cms.InputTag(
'reducedEgamma',
'reducedGedGsfElectrons')
232 process.heepIDVarValueMaps.dataFormat = cms.int32(2)
236 photon_ids = [
'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring15_25ns_V1_cff',
237 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring15_50ns_V1_cff',
238 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring15_25ns_nonTrig_V2p1_cff',
239 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring15_50ns_nonTrig_V2p1_cff',
240 'RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_Spring16_V2p2_cff',
241 'RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff']
243 process.egmPhotonIsolation.srcToIsolate = \
244 cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
245 for iPSet
in process.egmPhotonIsolation.isolationConeDefinitions:
246 iPSet.particleBasedIsolation = cms.InputTag(
"reducedEgamma",
"reducedPhotonPfCandMap")
248 process.egmPhotonIDs.physicsObjectSrc = \
249 cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
250 process.photonIDValueMapProducer.src = \
251 cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
252 process.photonRegressionValueMapProducer.src = \
253 cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
254 process.photonIDValueMapProducer.particleBasedIsolation = \
255 cms.InputTag(
"reducedEgamma",
"reducedPhotonPfCandMap")
256 process.photonMVAValueMapProducer.src = \
257 cms.InputTag(
'reducedEgamma',
'reducedGedPhotons')
258 for idmod
in photon_ids:
263 from RecoTauTag.Configuration.boostedHPSPFTaus_cfi
import addBoostedTaus
268 if not hasattr(process,
'ak4PFJetsPuppi'):
269 process.load(
'RecoJets.JetProducers.ak4PFJetsPuppi_cfi')
270 task.add(process.ak4PFJets)
271 task.add(process.ak4PFJetsPuppi)
272 process.ak4PFJetsPuppi.doAreaFastjet =
True 274 process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer(
"JetTracksAssociatorAtVertex",
276 jets = cms.InputTag(
"ak4PFJetsPuppi")
278 task.add(process.ak4PFJetsPuppiTracksAssociatorAtVertex)
279 process.patJetPuppiCharge = cms.EDProducer(
"JetChargeProducer",
280 src = cms.InputTag(
"ak4PFJetsPuppiTracksAssociatorAtVertex"),
281 var = cms.string(
'Pt'),
282 exp = cms.double(1.0)
284 task.add(process.patJetPuppiCharge)
286 addJetCollection(process, postfix =
"", labelName =
'Puppi', jetSource = cms.InputTag(
'ak4PFJetsPuppi'),
287 jetCorrections = (
'AK4PFPuppi', [
'L2Relative',
'L3Absolute'],
''),
288 pfCandidates = cms.InputTag(
'puppi'),
289 algo=
'AK', rParam = 0.4, btagDiscriminators =
map(
lambda x: x.value() ,process.patJets.discriminatorSources)
292 process.patJetGenJetMatchPuppi.matched =
'slimmedGenJets' 294 process.patJetsPuppi.jetChargeSource = cms.InputTag(
"patJetPuppiCharge")
296 process.selectedPatJetsPuppi.cut = cms.string(
"pt > 15")
298 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedJets_cfi')
299 task.add(process.slimmedJets)
300 task.add(process.slimmedJetsAK8)
302 process.slimmedJetsPuppi.src = cms.InputTag(
"selectedPatJetsPuppi")
303 process.slimmedJetsPuppi.packedPFCandidates = cms.InputTag(
"packedPFCandidates")
307 from PhysicsTools.PatAlgos.slimming.puppiForMET_cff
import makePuppies
311 pfCandColl=cms.InputTag(
"puppiForMET"),
312 jetCollUnskimmed=
"slimmedJetsPuppi",
313 recoMetFromPFCs=
True,
314 jetFlavor=
"AK4PFPuppi",
318 process.load(
'PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
319 task.add(process.slimmedMETs)
321 process.slimmedMETsPuppi.src = cms.InputTag(
"patMETsPuppi")
322 process.slimmedMETsPuppi.rawVariation = cms.InputTag(
"patPFMetPuppi")
323 process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag(
"patPFMetT1%sPuppi")
324 process.slimmedMETsPuppi.t01Variation = cms.InputTag(
"patPFMetT0pcT1Puppi")
325 process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag(
"patPFMetT1Smear%sPuppi")
326 process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag(
"patPFMetTxyPuppi")
327 process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag(
"patPFMetT1TxyPuppi")
328 process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag(
"patPFMetT0pcT1TxyPuppi")
329 process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag(
"patPFMetT1SmearTxyPuppi")
330 process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag(
"patPFMetT0pcT1SmearTxyPuppi")
331 del process.slimmedMETsPuppi.caloMET
334 process.load(
"TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff")
338 from Configuration.Eras.Modifier_phase2_hgcal_cff
import phase2_hgcal
339 process.load(
"RecoEgamma.EgammaTools.slimmedEgammaFromMultiCl_cff")
340 phase2_hgcal.toModify(task, func=
lambda t: t.add(process.slimmedEgammaFromMultiClTask))
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 getPatAlgosToolsTask(process)
def addBoostedTaus(process)