44 jetCollection =
'slimmedJets' 47 jetCollection =
'patJetsPAT' 49 process.ak4PFJetsPAT = ak4PFJets.clone(
50 src=cms.InputTag(
"packedPFCandidates")
54 process.patJetsPAT = _patJets.clone(
55 jetSource = cms.InputTag(
"ak4PFJetsPAT"),
56 addJetCorrFactors = cms.bool(
False),
57 jetCorrFactorsSource = cms.VInputTag(),
58 addBTagInfo = cms.bool(
False),
59 addDiscriminators = cms.bool(
False),
60 discriminatorSources = cms.VInputTag(),
61 addAssociatedTracks = cms.bool(
False),
62 addJetCharge = cms.bool(
False),
63 addGenPartonMatch = cms.bool(
False),
64 embedGenPartonMatch = cms.bool(
False),
65 addGenJetMatch = cms.bool(
False),
66 getJetMCFlavour = cms.bool(
False),
67 addJetFlavourInfo = cms.bool(
False),
69 process.miniAODTausTask.add(process.ak4PFJetsPAT)
70 process.miniAODTausTask.add(process.patJetsPAT)
80 process.recoTauAK4Jets08RegionPAT = cms.EDProducer(
"RecoTauPatJetRegionProducer",
81 deltaR = process.recoTauAK4PFJets08Region.deltaR,
82 maxJetAbsEta = process.recoTauAK4PFJets08Region.maxJetAbsEta,
83 minJetPt = process.recoTauAK4PFJets08Region.minJetPt,
84 pfCandAssocMapSrc = cms.InputTag(
""),
85 pfCandSrc = cms.InputTag(
"packedPFCandidates"),
86 src = cms.InputTag(jetCollection)
89 process.recoTauPileUpVertices.src = cms.InputTag(
"offlineSlimmedPrimaryVertices")
92 process.recoTauCommonTask = cms.Task(
93 process.recoTauAK4Jets08RegionPAT,
94 process.recoTauPileUpVertices
97 for moduleName
in process.TauReco.moduleNames():
102 process.ak4PFJetsLegacyHPSPiZeros.builders[0].qualityCuts.primaryVertexSrc = cms.InputTag(
"offlineSlimmedPrimaryVertices")
103 process.ak4PFJetsLegacyHPSPiZeros.jetSrc = cms.InputTag(jetCollection)
106 for builder
in process.ak4PFJetsRecoTauChargedHadrons.builders:
107 builder.qualityCuts.primaryVertexSrc = cms.InputTag(
"offlineSlimmedPrimaryVertices")
108 if builder.name.value() ==
'tracks':
109 builder.name =
'lostTracks' 110 builder.plugin =
'PFRecoTauChargedHadronFromLostTrackPlugin' 111 builder.srcTracks = cms.InputTag(
"lostTracks")
112 process.ak4PFJetsRecoTauChargedHadrons.jetSrc = cms.InputTag(jetCollection)
115 process.combinatoricRecoTaus.jetRegionSrc =
'recoTauAK4Jets08RegionPAT' 116 process.combinatoricRecoTaus.jetSrc = jetCollection
118 for builder
in process.combinatoricRecoTaus.builders:
119 for name,value
in six.iteritems(builder.parameters_()):
120 if name ==
'qualityCuts':
121 builder.qualityCuts.primaryVertexSrc =
'offlineSlimmedPrimaryVertices' 122 elif name ==
'pfCandSrc':
123 builder.pfCandSrc =
'packedPFCandidates' 125 modifiersToRemove_ = cms.VPSet()
126 for mod
in process.combinatoricRecoTaus.modifiers:
127 if mod.name.value() ==
'elec_rej':
128 modifiersToRemove_.append(mod)
130 elif mod.name.value() ==
'TTIworkaround':
131 modifiersToRemove_.append(mod)
133 for name,value
in six.iteritems(mod.parameters_()):
134 if name ==
'qualityCuts':
135 mod.qualityCuts.primaryVertexSrc =
'offlineSlimmedPrimaryVertices' 136 for mod
in modifiersToRemove_:
137 process.combinatoricRecoTaus.modifiers.remove(mod)
141 process.hpsPFTauPrimaryVertexProducer.__dict__[
'_TypedParameterizable__type'] =
'PFTauMiniAODPrimaryVertexProducer' 142 process.hpsPFTauPrimaryVertexProducer.PVTag =
'offlineSlimmedPrimaryVertices' 143 process.hpsPFTauPrimaryVertexProducer.packedCandidatesTag = cms.InputTag(
"packedPFCandidates")
144 process.hpsPFTauPrimaryVertexProducer.lostCandidatesTag = cms.InputTag(
"lostTracks")
147 process.hpsPFTauSecondaryVertexProducer = cms.EDProducer(
"PFTauSecondaryVertexProducer",
148 PFTauTag = cms.InputTag(
"hpsPFTauProducer")
152 for moduleName
in process.TauReco.moduleNames():
153 if 'ElectronRejection' in moduleName
or 'MuonRejection' in moduleName:
154 process.miniAODTausTask.remove(getattr(process, moduleName))
157 from RecoTauTag.RecoTau.hpsPFTauDiscriminationByAMuonRejectionSimple_cff
import hpsPFTauDiscriminationByLooseMuonRejectionSimple, hpsPFTauDiscriminationByTightMuonRejectionSimple
159 process.hpsPFTauDiscriminationByLooseMuonRejectionSimple = hpsPFTauDiscriminationByLooseMuonRejectionSimple
160 process.hpsPFTauDiscriminationByTightMuonRejectionSimple = hpsPFTauDiscriminationByTightMuonRejectionSimple
161 process.miniAODTausTask.add(process.hpsPFTauDiscriminationByLooseMuonRejectionSimple)
162 process.miniAODTausTask.add(process.hpsPFTauDiscriminationByTightMuonRejectionSimple)
167 process.tauGenJets.GenParticles = cms.InputTag(
"prunedGenParticles")
168 process.tauMatch.matched = cms.InputTag(
"prunedGenParticles")
171 for name, src
in six.iteritems(process.patTaus.tauIDSources.parameters_()):
172 if name.find(
'againstElectron') > -1
or name.find(
'againstMuon') > -1:
173 delattr(process.patTaus.tauIDSources,name)
175 setattr(process.patTaus.tauIDSources,
'againstMuonLooseSimple',cms.InputTag(
'hpsPFTauDiscriminationByLooseMuonRejectionSimple'))
176 setattr(process.patTaus.tauIDSources,
'againstMuonTightSimple',cms.InputTag(
'hpsPFTauDiscriminationByTightMuonRejectionSimple'))
def adaptTauToMiniAODReReco(process, reclusterJets=True)
def convertModuleToMiniAODInput(process, name)