1 import FWCore.ParameterSet.Config
as cms
10 if hasattr(process, label+postfix):
11 result = getattr(process, label + postfix)
13 raise ValueError(
"Error in <applyPostfix>: No module of name = %s attached to process !!" % (label + postfix))
18 tauSource = cms.InputTag(
'caloRecoTauProducer'),
21 print ' switching PAT Tau input to: ', tauSource
23 applyPostfix(process,
"tauMatch" + patTauLabel, postfix).src = tauSource
24 applyPostfix(process,
"tauGenJetMatch"+ patTauLabel, postfix).src = tauSource
26 applyPostfix(process,
"patTaus" + patTauLabel, postfix).tauSource = tauSource
28 applyPostfix(process,
"patTaus" + patTauLabel, postfix).tauTransverseImpactParameterSource =
""
32 print "NO PF Isolation will be computed for CaloTau (this could be improved later)"
33 applyPostfix(process,
"patTaus" + patTauLabel, postfix).isolation = cms.PSet()
34 applyPostfix(process,
"patTaus" + patTauLabel, postfix).isoDeposits = cms.PSet()
35 applyPostfix(process,
"patTaus" + patTauLabel, postfix).userIsolation = cms.PSet()
38 if hasattr(process,
"cleanPatTaus" + patTauLabel + postfix):
39 getattr(process,
"cleanPatTaus" + patTauLabel + postfix).preselection = \
40 'tauID("leadingTrackFinding") > 0.5 & tauID("leadingTrackPtCut") > 0.5' \
41 +
' & tauID("byIsolation") > 0.5 & tauID("againstElectron") > 0.5 & (signalTracks.size() = 1 | signalTracks.size() = 3)'
44 """ Build a PSet defining the tau ID sources to embed into the pat::Tau """
46 for label, discriminator
in idSources:
47 if ":" in discriminator:
48 discr = discriminator.split(
":")
49 setattr(output, label, cms.InputTag(tauType + discr[0] + postfix +
":" + discr[1]))
51 setattr(output, label, cms.InputTag(tauType + discriminator + postfix))
60 """internal auxiliary function to switch to **any** PFTau collection"""
61 print ' switching PAT Tau input to: ', tauSource
63 applyPostfix(process,
"tauMatch" + patTauLabel, postfix).src = tauSource
64 applyPostfix(process,
"tauGenJetMatch" + patTauLabel, postfix).src = tauSource
66 applyPostfix(process,
"tauIsoDepositPFCandidates" + patTauLabel, postfix).src = tauSource
67 applyPostfix(process,
"tauIsoDepositPFCandidates" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
68 applyPostfix(process,
"tauIsoDepositPFChargedHadrons" + patTauLabel, postfix).src = tauSource
69 applyPostfix(process,
"tauIsoDepositPFChargedHadrons" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
70 applyPostfix(process,
"tauIsoDepositPFNeutralHadrons" + patTauLabel, postfix).src = tauSource
71 applyPostfix(process,
"tauIsoDepositPFNeutralHadrons" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
72 applyPostfix(process,
"tauIsoDepositPFGammas" + patTauLabel, postfix).src = tauSource
73 applyPostfix(process,
"tauIsoDepositPFGammas" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
75 applyPostfix(process,
"patTaus" + patTauLabel, postfix).tauSource = tauSource
77 applyPostfix(process,
"patTaus" + patTauLabel, postfix).tauTransverseImpactParameterSource =
""
80 if hasattr(process,
"cleanPatTaus" + patTauLabel + postfix):
81 getattr(process,
"cleanPatTaus" + patTauLabel + postfix).preselection = \
82 'tauID("leadingTrackFinding") > 0.5 & tauID("leadingPionPtCut") > 0.5 & tauID("byIsolationUsingLeadingPion") > 0.5' \
83 +
' & tauID("againstMuon") > 0.5 & tauID("againstElectron") > 0.5' \
84 +
' & (signalPFChargedHadrCands.size() = 1 | signalPFChargedHadrCands.size() = 3)'
87 classicTauIDSources = [
88 (
"leadingTrackFinding",
"DiscriminationByLeadingTrackFinding"),
89 (
"leadingTrackPtCut",
"DiscriminationByLeadingTrackPtCut"),
90 (
"trackIsolation",
"DiscriminationByTrackIsolation"),
91 (
"ecalIsolation",
"DiscriminationByECALIsolation"),
92 (
"byIsolation",
"DiscriminationByIsolation"),
93 (
"againstElectron",
"DiscriminationAgainstElectron"),
94 (
"againstMuon",
"DiscriminationAgainstMuon")
97 classicPFTauIDSources = [
98 (
"leadingPionPtCut",
"DiscriminationByLeadingPionPtCut"),
99 (
"trackIsolationUsingLeadingPion",
"DiscriminationByTrackIsolationUsingLeadingPion"),
100 (
"ecalIsolationUsingLeadingPion",
"DiscriminationByECALIsolationUsingLeadingPion"),
101 (
"byIsolationUsingLeadingPion",
"DiscriminationByIsolationUsingLeadingPion")
106 (
"decayModeFindingNewDMs",
"DiscriminationByDecayModeFindingNewDMs"),
107 (
"decayModeFinding",
"DiscriminationByDecayModeFinding"),
108 (
"byLooseCombinedIsolationDeltaBetaCorr3Hits",
"DiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"),
109 (
"byMediumCombinedIsolationDeltaBetaCorr3Hits",
"DiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"),
110 (
"byTightCombinedIsolationDeltaBetaCorr3Hits",
"DiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"),
111 (
"byCombinedIsolationDeltaBetaCorrRaw3Hits",
"DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"),
112 (
"byLoosePileupWeightedIsolation3Hits",
"DiscriminationByLoosePileupWeightedIsolation3Hits"),
113 (
"byMediumPileupWeightedIsolation3Hits",
"DiscriminationByMediumPileupWeightedIsolation3Hits"),
114 (
"byTightPileupWeightedIsolation3Hits",
"DiscriminationByTightPileupWeightedIsolation3Hits"),
115 (
"byPhotonPtSumOutsideSignalCone",
"DiscriminationByPhotonPtSumOutsideSignalCone"),
116 (
"byPileupWeightedIsolationRaw3Hits",
"DiscriminationByRawPileupWeightedIsolation3Hits"),
117 (
"chargedIsoPtSum",
"ChargedIsoPtSum"),
118 (
"neutralIsoPtSum",
"NeutralIsoPtSum"),
119 (
"puCorrPtSum",
"PUcorrPtSum"),
120 (
"neutralIsoPtSumWeight",
"NeutralIsoPtSumWeight"),
121 (
"footprintCorrection",
"FootprintCorrection"),
122 (
"photonPtSumOutsideSignalCone",
"PhotonPtSumOutsideSignalCone"),
130 (
"byIsolationMVA3oldDMwLTraw",
"DiscriminationByIsolationMVA3oldDMwLTraw"),
131 (
"byVLooseIsolationMVA3oldDMwLT",
"DiscriminationByVLooseIsolationMVA3oldDMwLT"),
132 (
"byLooseIsolationMVA3oldDMwLT",
"DiscriminationByLooseIsolationMVA3oldDMwLT"),
133 (
"byMediumIsolationMVA3oldDMwLT",
"DiscriminationByMediumIsolationMVA3oldDMwLT"),
134 (
"byTightIsolationMVA3oldDMwLT",
"DiscriminationByTightIsolationMVA3oldDMwLT"),
135 (
"byVTightIsolationMVA3oldDMwLT",
"DiscriminationByVTightIsolationMVA3oldDMwLT"),
136 (
"byVVTightIsolationMVA3oldDMwLT",
"DiscriminationByVVTightIsolationMVA3oldDMwLT"),
137 (
"byIsolationMVA3newDMwoLTraw",
"DiscriminationByIsolationMVA3newDMwoLTraw"),
144 (
"byIsolationMVA3newDMwLTraw",
"DiscriminationByIsolationMVA3newDMwLTraw"),
145 (
"byVLooseIsolationMVA3newDMwLT",
"DiscriminationByVLooseIsolationMVA3newDMwLT"),
146 (
"byLooseIsolationMVA3newDMwLT",
"DiscriminationByLooseIsolationMVA3newDMwLT"),
147 (
"byMediumIsolationMVA3newDMwLT",
"DiscriminationByMediumIsolationMVA3newDMwLT"),
148 (
"byTightIsolationMVA3newDMwLT",
"DiscriminationByTightIsolationMVA3newDMwLT"),
149 (
"byVTightIsolationMVA3newDMwLT",
"DiscriminationByVTightIsolationMVA3newDMwLT"),
150 (
"byVVTightIsolationMVA3newDMwLT",
"DiscriminationByVVTightIsolationMVA3newDMwLT"),
154 (
"againstElectronMVA5raw",
"DiscriminationByMVA5rawElectronRejection"),
155 (
"againstElectronMVA5category",
"DiscriminationByMVA5rawElectronRejection:category"),
156 (
"againstElectronVLooseMVA5",
"DiscriminationByMVA5VLooseElectronRejection"),
157 (
"againstElectronLooseMVA5",
"DiscriminationByMVA5LooseElectronRejection"),
158 (
"againstElectronMediumMVA5",
"DiscriminationByMVA5MediumElectronRejection"),
159 (
"againstElectronTightMVA5",
"DiscriminationByMVA5TightElectronRejection"),
160 (
"againstElectronVTightMVA5",
"DiscriminationByMVA5VTightElectronRejection"),
168 (
"againstMuonLoose3",
"DiscriminationByLooseMuonRejection3"),
169 (
"againstMuonTight3",
"DiscriminationByTightMuonRejection3"),
178 hpsTauIDSources76xReMiniAOD = [
179 (
"decayModeFindingNewDMs",
"DiscriminationByDecayModeFindingNewDMs76xReMiniAOD"),
180 (
"decayModeFinding",
"DiscriminationByDecayModeFinding76xReMiniAOD"),
181 (
"byLooseCombinedIsolationDeltaBetaCorr3Hits",
"DiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits76xReMiniAOD"),
182 (
"byMediumCombinedIsolationDeltaBetaCorr3Hits",
"DiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits76xReMiniAOD"),
183 (
"byTightCombinedIsolationDeltaBetaCorr3Hits",
"DiscriminationByTightCombinedIsolationDBSumPtCorr3Hits76xReMiniAOD"),
184 (
"byCombinedIsolationDeltaBetaCorrRaw3Hits",
"DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits76xReMiniAOD"),
185 (
"byLooseCombinedIsolationDeltaBetaCorr3HitsdR03",
"DiscriminationByLooseCombinedIsolationDBSumPtCorr3HitsdR0376xReMiniAOD"),
186 (
"byMediumCombinedIsolationDeltaBetaCorr3HitsdR03",
"DiscriminationByMediumCombinedIsolationDBSumPtCorr3HitsdR0376xReMiniAOD"),
187 (
"byTightCombinedIsolationDeltaBetaCorr3HitsdR03",
"DiscriminationByTightCombinedIsolationDBSumPtCorr3HitsdR0376xReMiniAOD"),
188 (
"byLoosePileupWeightedIsolation3Hits",
"DiscriminationByLoosePileupWeightedIsolation3Hits76xReMiniAOD"),
189 (
"byMediumPileupWeightedIsolation3Hits",
"DiscriminationByMediumPileupWeightedIsolation3Hits76xReMiniAOD"),
190 (
"byTightPileupWeightedIsolation3Hits",
"DiscriminationByTightPileupWeightedIsolation3Hits76xReMiniAOD"),
191 (
"byPhotonPtSumOutsideSignalCone",
"DiscriminationByPhotonPtSumOutsideSignalCone76xReMiniAOD"),
192 (
"byPileupWeightedIsolationRaw3Hits",
"DiscriminationByRawPileupWeightedIsolation3Hits76xReMiniAOD"),
193 (
"chargedIsoPtSum",
"ChargedIsoPtSum76xReMiniAOD"),
194 (
"neutralIsoPtSum",
"NeutralIsoPtSum76xReMiniAOD"),
195 (
"puCorrPtSum",
"PUcorrPtSum76xReMiniAOD"),
196 (
"neutralIsoPtSumWeight",
"NeutralIsoPtSumWeight76xReMiniAOD"),
197 (
"footprintCorrection",
"FootprintCorrection76xReMiniAOD"),
198 (
"photonPtSumOutsideSignalCone",
"PhotonPtSumOutsideSignalCone76xReMiniAOD"),
199 (
"byIsolationMVA3oldDMwLTraw",
"DiscriminationByIsolationMVA3oldDMwLTraw76xReMiniAOD"),
200 (
"byVLooseIsolationMVA3oldDMwLT",
"DiscriminationByVLooseIsolationMVA3oldDMwLT76xReMiniAOD"),
201 (
"byLooseIsolationMVA3oldDMwLT",
"DiscriminationByLooseIsolationMVA3oldDMwLT76xReMiniAOD"),
202 (
"byMediumIsolationMVA3oldDMwLT",
"DiscriminationByMediumIsolationMVA3oldDMwLT76xReMiniAOD"),
203 (
"byTightIsolationMVA3oldDMwLT",
"DiscriminationByTightIsolationMVA3oldDMwLT76xReMiniAOD"),
204 (
"byVTightIsolationMVA3oldDMwLT",
"DiscriminationByVTightIsolationMVA3oldDMwLT76xReMiniAOD"),
205 (
"byVVTightIsolationMVA3oldDMwLT",
"DiscriminationByVVTightIsolationMVA3oldDMwLT76xReMiniAOD"),
206 (
"byIsolationMVA3newDMwLTraw",
"DiscriminationByIsolationMVA3newDMwLTraw76xReMiniAOD"),
207 (
"byVLooseIsolationMVA3newDMwLT",
"DiscriminationByVLooseIsolationMVA3newDMwLT76xReMiniAOD"),
208 (
"byLooseIsolationMVA3newDMwLT",
"DiscriminationByLooseIsolationMVA3newDMwLT76xReMiniAOD"),
209 (
"byMediumIsolationMVA3newDMwLT",
"DiscriminationByMediumIsolationMVA3newDMwLT76xReMiniAOD"),
210 (
"byTightIsolationMVA3newDMwLT",
"DiscriminationByTightIsolationMVA3newDMwLT76xReMiniAOD"),
211 (
"byVTightIsolationMVA3newDMwLT",
"DiscriminationByVTightIsolationMVA3newDMwLT76xReMiniAOD"),
212 (
"byVVTightIsolationMVA3newDMwLT",
"DiscriminationByVVTightIsolationMVA3newDMwLT76xReMiniAOD"),
213 (
"againstElectronMVA5raw",
"DiscriminationByMVA5rawElectronRejection76xReMiniAOD"),
214 (
"againstElectronMVA5category",
"DiscriminationByMVA5rawElectronRejection76xReMiniAOD:category"),
215 (
"againstElectronVLooseMVA5",
"DiscriminationByMVA5VLooseElectronRejection76xReMiniAOD"),
216 (
"againstElectronLooseMVA5",
"DiscriminationByMVA5LooseElectronRejection76xReMiniAOD"),
217 (
"againstElectronMediumMVA5",
"DiscriminationByMVA5MediumElectronRejection76xReMiniAOD"),
218 (
"againstElectronTightMVA5",
"DiscriminationByMVA5TightElectronRejection76xReMiniAOD"),
219 (
"againstElectronVTightMVA5",
"DiscriminationByMVA5VTightElectronRejection76xReMiniAOD"),
220 (
"againstMuonLoose3",
"DiscriminationByLooseMuonRejection376xReMiniAOD"),
221 (
"againstMuonTight3",
"DiscriminationByTightMuonRejection376xReMiniAOD"),
223 (
"byIsolationMVArun2v1DBoldDMwLTraw",
"DiscriminationByIsolationMVArun2v1DBoldDMwLTraw76xReMiniAOD"),
224 (
"byVLooseIsolationMVArun2v1DBoldDMwLT",
"DiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT76xReMiniAOD"),
225 (
"byLooseIsolationMVArun2v1DBoldDMwLT",
"DiscriminationByLooseIsolationMVArun2v1DBoldDMwLT76xReMiniAOD"),
226 (
"byMediumIsolationMVArun2v1DBoldDMwLT",
"DiscriminationByMediumIsolationMVArun2v1DBoldDMwLT76xReMiniAOD"),
227 (
"byTightIsolationMVArun2v1DBoldDMwLT",
"DiscriminationByTightIsolationMVArun2v1DBoldDMwLT76xReMiniAOD"),
228 (
"byVTightIsolationMVArun2v1DBoldDMwLT",
"DiscriminationByVTightIsolationMVArun2v1DBoldDMwLT76xReMiniAOD"),
229 (
"byVVTightIsolationMVArun2v1DBoldDMwLT",
"DiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT76xReMiniAOD"),
230 (
"byIsolationMVArun2v1DBnewDMwLTraw",
"DiscriminationByIsolationMVArun2v1DBnewDMwLTraw76xReMiniAOD"),
231 (
"byVLooseIsolationMVArun2v1DBnewDMwLT",
"DiscriminationByVLooseIsolationMVArun2v1DBnewDMwLT76xReMiniAOD"),
232 (
"byLooseIsolationMVArun2v1DBnewDMwLT",
"DiscriminationByLooseIsolationMVArun2v1DBnewDMwLT76xReMiniAOD"),
233 (
"byMediumIsolationMVArun2v1DBnewDMwLT",
"DiscriminationByMediumIsolationMVArun2v1DBnewDMwLT76xReMiniAOD"),
234 (
"byTightIsolationMVArun2v1DBnewDMwLT",
"DiscriminationByTightIsolationMVArun2v1DBnewDMwLT76xReMiniAOD"),
235 (
"byVTightIsolationMVArun2v1DBnewDMwLT",
"DiscriminationByVTightIsolationMVArun2v1DBnewDMwLT76xReMiniAOD"),
236 (
"byVVTightIsolationMVArun2v1DBnewDMwLT",
"DiscriminationByVVTightIsolationMVArun2v1DBnewDMwLT76xReMiniAOD"),
237 (
"byIsolationMVArun2v1PWoldDMwLTraw",
"DiscriminationByIsolationMVArun2v1PWoldDMwLTraw76xReMiniAOD"),
238 (
"byVLooseIsolationMVArun2v1PWoldDMwLT",
"DiscriminationByVLooseIsolationMVArun2v1PWoldDMwLT76xReMiniAOD"),
239 (
"byLooseIsolationMVArun2v1PWoldDMwLT",
"DiscriminationByLooseIsolationMVArun2v1PWoldDMwLT76xReMiniAOD"),
240 (
"byMediumIsolationMVArun2v1PWoldDMwLT",
"DiscriminationByMediumIsolationMVArun2v1PWoldDMwLT76xReMiniAOD"),
241 (
"byTightIsolationMVArun2v1PWoldDMwLT",
"DiscriminationByTightIsolationMVArun2v1PWoldDMwLT76xReMiniAOD"),
242 (
"byVTightIsolationMVArun2v1PWoldDMwLT",
"DiscriminationByVTightIsolationMVArun2v1PWoldDMwLT76xReMiniAOD"),
243 (
"byVVTightIsolationMVArun2v1PWoldDMwLT",
"DiscriminationByVVTightIsolationMVArun2v1PWoldDMwLT76xReMiniAOD"),
244 (
"byIsolationMVArun2v1PWnewDMwLTraw",
"DiscriminationByIsolationMVArun2v1PWnewDMwLTraw76xReMiniAOD"),
245 (
"byVLooseIsolationMVArun2v1PWnewDMwLT",
"DiscriminationByVLooseIsolationMVArun2v1PWnewDMwLT76xReMiniAOD"),
246 (
"byLooseIsolationMVArun2v1PWnewDMwLT",
"DiscriminationByLooseIsolationMVArun2v1PWnewDMwLT76xReMiniAOD"),
247 (
"byMediumIsolationMVArun2v1PWnewDMwLT",
"DiscriminationByMediumIsolationMVArun2v1PWnewDMwLT76xReMiniAOD"),
248 (
"byTightIsolationMVArun2v1PWnewDMwLT",
"DiscriminationByTightIsolationMVArun2v1PWnewDMwLT76xReMiniAOD"),
249 (
"byVTightIsolationMVArun2v1PWnewDMwLT",
"DiscriminationByVTightIsolationMVArun2v1PWnewDMwLT76xReMiniAOD"),
250 (
"byVVTightIsolationMVArun2v1PWnewDMwLT",
"DiscriminationByVVTightIsolationMVArun2v1PWnewDMwLT76xReMiniAOD"),
251 (
"chargedIsoPtSumdR03",
"ChargedIsoPtSumdR0376xReMiniAOD"),
252 (
"neutralIsoPtSumdR03",
"NeutralIsoPtSumdR0376xReMiniAOD"),
253 (
"puCorrPtSumdR03",
"PUcorrPtSumdR0376xReMiniAOD"),
254 (
"neutralIsoPtSumWeightdR03",
"NeutralIsoPtSumWeightdR0376xReMiniAOD"),
255 (
"footprintCorrectiondR03",
"FootprintCorrectiondR0376xReMiniAOD"),
256 (
"photonPtSumOutsideSignalConedR03",
"PhotonPtSumOutsideSignalConedR0376xReMiniAOD"),
257 (
"byIsolationMVArun2v1DBdR03oldDMwLTraw",
"DiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw76xReMiniAOD"),
258 (
"byVLooseIsolationMVArun2v1DBdR03oldDMwLT",
"DiscriminationByVLooseIsolationMVArun2v1DBdR03oldDMwLT76xReMiniAOD"),
259 (
"byLooseIsolationMVArun2v1DBdR03oldDMwLT",
"DiscriminationByLooseIsolationMVArun2v1DBdR03oldDMwLT76xReMiniAOD"),
260 (
"byMediumIsolationMVArun2v1DBdR03oldDMwLT",
"DiscriminationByMediumIsolationMVArun2v1DBdR03oldDMwLT76xReMiniAOD"),
261 (
"byTightIsolationMVArun2v1DBdR03oldDMwLT",
"DiscriminationByTightIsolationMVArun2v1DBdR03oldDMwLT76xReMiniAOD"),
262 (
"byVTightIsolationMVArun2v1DBdR03oldDMwLT",
"DiscriminationByVTightIsolationMVArun2v1DBdR03oldDMwLT76xReMiniAOD"),
263 (
"byVVTightIsolationMVArun2v1DBdR03oldDMwLT",
"DiscriminationByVVTightIsolationMVArun2v1DBdR03oldDMwLT76xReMiniAOD"),
264 (
"byIsolationMVArun2v1PWdR03oldDMwLTraw",
"DiscriminationByIsolationMVArun2v1PWdR03oldDMwLTraw76xReMiniAOD"),
265 (
"byVLooseIsolationMVArun2v1PWdR03oldDMwLT",
"DiscriminationByVLooseIsolationMVArun2v1PWdR03oldDMwLT76xReMiniAOD"),
266 (
"byLooseIsolationMVArun2v1PWdR03oldDMwLT",
"DiscriminationByLooseIsolationMVArun2v1PWdR03oldDMwLT76xReMiniAOD"),
267 (
"byMediumIsolationMVArun2v1PWdR03oldDMwLT",
"DiscriminationByMediumIsolationMVArun2v1PWdR03oldDMwLT76xReMiniAOD"),
268 (
"byTightIsolationMVArun2v1PWdR03oldDMwLT",
"DiscriminationByTightIsolationMVArun2v1PWdR03oldDMwLT76xReMiniAOD"),
269 (
"byVTightIsolationMVArun2v1PWdR03oldDMwLT",
"DiscriminationByVTightIsolationMVArun2v1PWdR03oldDMwLT76xReMiniAOD"),
270 (
"byVVTightIsolationMVArun2v1PWdR03oldDMwLT",
"DiscriminationByVVTightIsolationMVArun2v1PWdR03oldDMwLT76xReMiniAOD"),
272 (
"againstElectronMVA6raw",
"DiscriminationByMVA6rawElectronRejection76xReMiniAOD"),
273 (
"againstElectronMVA6category",
"DiscriminationByMVA6rawElectronRejection76xReMiniAOD:category"),
274 (
"againstElectronVLooseMVA6",
"DiscriminationByMVA6VLooseElectronRejection76xReMiniAOD"),
275 (
"againstElectronLooseMVA6",
"DiscriminationByMVA6LooseElectronRejection76xReMiniAOD"),
276 (
"againstElectronMediumMVA6",
"DiscriminationByMVA6MediumElectronRejection76xReMiniAOD"),
277 (
"againstElectronTightMVA6",
"DiscriminationByMVA6TightElectronRejection76xReMiniAOD"),
278 (
"againstElectronVTightMVA6",
"DiscriminationByMVA6VTightElectronRejection76xReMiniAOD"),
284 tauSource = cms.InputTag(
'fixedConePFTauProducer'),
287 fixedConeIDSources = copy.copy(classicTauIDSources)
288 fixedConeIDSources.extend(classicPFTauIDSources)
290 _switchToPFTau(process, tauSource,
'fixedConePFTau', fixedConeIDSources,
291 patTauLabel = patTauLabel, postfix = postfix)
295 tauSource = cms.InputTag(
'shrinkingConePFTauProducer'),
298 shrinkingIDSources = copy.copy(classicTauIDSources)
299 shrinkingIDSources.extend(classicPFTauIDSources)
301 _switchToPFTau(process, tauSource,
'shrinkingConePFTau', shrinkingIDSources,
302 patTauLabel = patTauLabel, postfix = postfix)
306 tauSource = cms.InputTag(
'hpsPFTauProducer'),
312 patTauLabel = patTauLabel, postfix = postfix)
315 applyPostfix(process,
"patTaus" + patTauLabel, postfix).tauTransverseImpactParameterSource = tauSource.value().
replace(
"Producer",
"TransverseImpactParameters")
318 if hasattr(process,
"cleanPatTaus" + patTauLabel + postfix):
319 getattr(process,
"cleanPatTaus" + patTauLabel + postfix).preselection = \
320 'pt > 18 & abs(eta) < 2.3 & tauID("decayModeFinding") > 0.5 & tauID("byLooseCombinedIsolationDeltaBetaCorr3Hits") > 0.5' \
321 +
' & tauID("againstMuonTight3") > 0.5 & tauID("againstElectronVLooseMVA5") > 0.5'
327 tauSource = cms.InputTag(
'hpsPFTauProducer76xReMiniAOD'),
332 _switchToPFTau(process, tauSource,
'hpsPFTau', hpsTauIDSources76xReMiniAOD,
333 patTauLabel = patTauLabel, postfix = postfix)
336 applyPostfix(process,
"patTaus" + patTauLabel, postfix).tauTransverseImpactParameterSource = tauSource.value().
replace(
"Producer",
"TransverseImpactParameters")
339 if hasattr(process,
"cleanPatTaus" + patTauLabel + postfix):
340 getattr(process,
"cleanPatTaus" + patTauLabel + postfix).preselection = \
341 'pt > 18 & abs(eta) < 2.3 & tauID("decayModeFinding") > 0.5 & tauID("byLooseCombinedIsolationDeltaBetaCorr3Hits") > 0.5' \
342 +
' & tauID("againstMuonTight3") > 0.5 & tauID("againstElectronVLooseMVA6") > 0.5'
349 tauSource = cms.InputTag(
'hpsPFTauProducer'),
353 'shrinkingConePFTau' : switchToPFTauShrinkingCone,
354 'fixedConePFTau' : switchToPFTauFixedCone,
355 'hpsPFTau' : switchToPFTauHPS,
356 'caloRecoTau' : switchToCaloTau
358 if not pfTauType
in mapping.keys():
359 raise ValueError(
"Error in <switchToPFTauByType>: Undefined pfTauType = %s !!" % pfTauType)
361 mapping[pfTauType](process, tauSource = tauSource,
362 patTauLabel = patTauLabel, postfix = postfix)
366 """ Add a new collection of taus. Takes the configuration from the
367 already configured standard tau collection as starting point;
368 replaces before calling addTauCollection will also affect the
371 _label=
'addTauCollection'
372 _defaultParameters=dicttypes.SortedKeysDict()
374 ConfigToolBase.__init__(self)
376 self._defaultValue,
'Input tau collection', cms.InputTag)
378 self._defaultValue,
"label to indicate the tau algorithm (e.g.'hps')", str)
380 self._defaultValue,
"label to indicate the type of constituents (either 'PFTau' or 'Tau')", str)
382 True,
"run sequence for computing particle-flow based IsoDeposits")
384 "hps",
"standard algorithm label of the collection from which the clones " \
385 +
"for the new tau collection will be taken from " \
386 +
"(note that this tau collection has to be available in the event before hand)")
388 "PFTau",
"standard constituent type label of the collection from which the clones " \
389 +
" for the new tau collection will be taken from "\
390 +
"(note that this tau collection has to be available in the event before hand)")
399 tauCollection =
None,
402 doPFIsoDeposits =
None,
405 standardType =
None):
407 if tauCollection
is None:
409 if algoLabel
is None:
411 if typeLabel
is None:
413 if doPFIsoDeposits
is None:
415 if standardAlgo
is None:
417 if standardType
is None:
420 self.setParameter(
'tauCollection', tauCollection)
421 self.setParameter(
'algoLabel', algoLabel)
422 self.setParameter(
'typeLabel', typeLabel)
423 self.setParameter(
'doPFIsoDeposits', doPFIsoDeposits)
424 self.setParameter(
'standardAlgo', standardAlgo)
425 self.setParameter(
'standardType', standardType)
430 tauCollection = self.
_parameters[
'tauCollection'].value
433 doPFIsoDeposits = self.
_parameters[
'doPFIsoDeposits'].value
434 standardAlgo = self.
_parameters[
'standardAlgo'].value
435 standardType = self.
_parameters[
'standardType'].value
439 if typeLabel ==
'Tau':
440 print "NO PF Isolation will be computed for CaloTau (this could be improved later)"
441 doPFIsoDeposits =
False
445 def oldLabel(prefix = ''):
449 return prefix +
"PatTaus"
454 def capitalize(label):
455 return label[0].capitalize() + label[1:]
459 def newLabel(oldLabel):
461 if ( oldLabel.find(standardAlgo) >= 0
and oldLabel.find(standardType) >= 0 ):
462 oldLabel = oldLabel.replace(standardAlgo, algoLabel).
replace(standardType, typeLabel)
464 oldLabel = oldLabel + capitalize(algoLabel + typeLabel)
468 def addClone(hook, **replaceStatements):
471 newModule = getattr(process, hook).
clone(**replaceStatements)
474 def addPFIsoDepositClone(hook, **replaceStatements):
475 newModule = getattr(process, hook).
clone(**replaceStatements)
476 newModuleIsoDepositExtractor = getattr(newModule,
"ExtractorPSet")
477 setattr(newModuleIsoDepositExtractor,
"tauSource", getattr(newModule,
"src"))
480 addClone(oldLabel(), tauSource = tauCollection)
483 addClone(oldLabel(
'selected'), src = cms.InputTag(newLabel(oldLabel())))
486 addClone(oldLabel(
'clean'), src=cms.InputTag(newLabel(oldLabel(
'selected'))))
489 newTaus = getattr(process, newLabel(oldLabel()))
492 addClone(
'tauMatch', src = tauCollection)
493 addClone(
'tauGenJetMatch', src = tauCollection)
497 addPFIsoDepositClone(
'tauIsoDepositPFCandidates', src = tauCollection)
498 addPFIsoDepositClone(
'tauIsoDepositPFChargedHadrons', src = tauCollection)
499 addPFIsoDepositClone(
'tauIsoDepositPFNeutralHadrons', src = tauCollection)
500 addPFIsoDepositClone(
'tauIsoDepositPFGammas', src = tauCollection)
504 x.setModuleLabel(newLabel(x.moduleLabel))
507 fixInputTag(newTaus.genParticleMatch)
508 fixInputTag(newTaus.genJetMatch)
509 fixInputTag(newTaus.isoDeposits.pfAllParticles)
510 fixInputTag(newTaus.isoDeposits.pfNeutralHadron)
511 fixInputTag(newTaus.isoDeposits.pfChargedHadron)
512 fixInputTag(newTaus.isoDeposits.pfGamma)
513 fixInputTag(newTaus.userIsolation.pfAllParticles.src)
514 fixInputTag(newTaus.userIsolation.pfNeutralHadron.src)
515 fixInputTag(newTaus.userIsolation.pfChargedHadron.src)
516 fixInputTag(newTaus.userIsolation.pfGamma.src)
520 oldTaus = getattr(process, oldLabel())
521 if typeLabel ==
'Tau':
523 tauSource = getattr(newTaus,
"tauSource"),
524 patTauLabel = capitalize(algoLabel + typeLabel))
527 tauSource = getattr(newTaus,
"tauSource"),
528 patTauLabel = capitalize(algoLabel + typeLabel))
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)