1 import FWCore.ParameterSet.Config
as cms
3 from Configuration.Eras.Modifier_phase2_common_cff
import phase2_common
21 from RecoTauTag.RecoTau.recoTauDiscriminantCutMultiplexerDefault_cfi
import recoTauDiscriminantCutMultiplexerDefault
25 from RecoTauTag.RecoTau.PFRecoTauPFJetInputs_cfi
import PFRecoTauPFJetInputs
27 ak4dBetaCorrection = 0.20
30 from RecoTauTag.RecoTau.PFRecoTauDiscriminationByHPSSelection_cfi
import hpsSelectionDiscriminator, decayMode_1Prong0Pi0, decayMode_1Prong1Pi0, decayMode_1Prong2Pi0, decayMode_2Prong0Pi0, decayMode_2Prong1Pi0, decayMode_3Prong0Pi0, decayMode_3Prong1Pi0
32 hpsPFTauDiscriminationByDecayModeFindingNewDMs = hpsSelectionDiscriminator.clone(
33 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
36 decayModes = cms.VPSet(
47 hpsPFTauDiscriminationByDecayModeFindingOldDMs = hpsSelectionDiscriminator.clone(
48 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
49 decayModes = cms.VPSet(
55 requireTauChargedHadronsToBeChargedPFCands = cms.bool(
True)
57 hpsPFTauDiscriminationByDecayModeFinding = hpsPFTauDiscriminationByDecayModeFindingOldDMs.clone()
60 requireDecayMode = cms.PSet(
61 BooleanOperator = cms.string(
"and"),
63 Producer = cms.InputTag(
'hpsPFTauDiscriminationByDecayModeFindingNewDMs'),
69 hpsPFTauBasicDiscriminators = pfRecoTauDiscriminationByIsolation.clone(
70 PFTauProducer = cms.InputTag(
"hpsPFTauProducer"),
71 Prediscriminants = requireDecayMode.clone(),
72 deltaBetaPUTrackPtCutOverride =
True,
73 deltaBetaPUTrackPtCutOverride_val = 0.5,
74 customOuterCone = PFRecoTauPFJetInputs.isolationConeSize,
75 isoConeSizeForDeltaBeta = 0.8,
76 deltaBetaFactor =
"%0.4f"%(ak4dBetaCorrection),
77 qualityCuts = dict(isolationQualityCuts = dict(minTrackHits = 3, minGammaEt = 1.0, minTrackPt = 0.5)),
78 IDdefinitions = cms.VPSet(
80 IDname = cms.string(
"ChargedIsoPtSum"),
81 ApplyDiscriminationByTrackerIsolation = cms.bool(
True),
82 storeRawSumPt = cms.bool(
True)
85 IDname = cms.string(
"NeutralIsoPtSum"),
86 ApplyDiscriminationByECALIsolation = cms.bool(
True),
87 storeRawSumPt = cms.bool(
True)
90 IDname = cms.string(
"NeutralIsoPtSumWeight"),
91 ApplyDiscriminationByWeightedECALIsolation = cms.bool(
True),
92 storeRawSumPt = cms.bool(
True),
93 UseAllPFCandsForWeights = cms.bool(
True)
96 IDname = cms.string(
"TauFootprintCorrection"),
97 storeRawFootprintCorrection = cms.bool(
True)
100 IDname = cms.string(
"PhotonPtSumOutsideSignalCone"),
101 storeRawPhotonSumPt_outsideSignalCone = cms.bool(
True)
104 IDname = cms.string(
"PUcorrPtSum"),
105 applyDeltaBetaCorrection = cms.bool(
True),
106 storeRawPUsumPt = cms.bool(
True)
109 IDname = cms.string(
"ByRawCombinedIsolationDBSumPtCorr3Hits"),
110 ApplyDiscriminationByTrackerIsolation = cms.bool(
True),
111 ApplyDiscriminationByECALIsolation = cms.bool(
True),
112 applyDeltaBetaCorrection = cms.bool(
True),
113 storeRawSumPt = cms.bool(
True)
116 IDWPdefinitions = cms.VPSet(
118 IDname = cms.string(
"ByLooseCombinedIsolationDBSumPtCorr3Hits"),
119 referenceRawIDNames = cms.vstring(
"ByRawCombinedIsolationDBSumPtCorr3Hits",
"PhotonPtSumOutsideSignalCone"),
120 maximumAbsoluteValues = cms.vdouble(2.5, 1.e+9),
121 maximumRelativeValues = cms.vdouble(-1.0, 0.10)
124 IDname = cms.string(
"ByMediumCombinedIsolationDBSumPtCorr3Hits"),
125 referenceRawIDNames = cms.vstring(
"ByRawCombinedIsolationDBSumPtCorr3Hits",
"PhotonPtSumOutsideSignalCone"),
126 maximumAbsoluteValues = cms.vdouble(1.5, 1.e+9),
127 maximumRelativeValues = cms.vdouble(-1.0, 0.10)
130 IDname = cms.string(
"ByTightCombinedIsolationDBSumPtCorr3Hits"),
131 referenceRawIDNames = cms.vstring(
"ByRawCombinedIsolationDBSumPtCorr3Hits",
"PhotonPtSumOutsideSignalCone"),
132 maximumAbsoluteValues = cms.vdouble(0.8, 1.e+9),
133 maximumRelativeValues = cms.vdouble(-1.0, 0.10)
136 IDname = cms.string(
"ByLooseChargedIsolation"),
137 referenceRawIDNames = cms.vstring(
"ChargedIsoPtSum"),
138 maximumAbsoluteValues = cms.vdouble(2.5)
141 IDname = cms.string(
"ByPhotonPtSumOutsideSignalCone"),
142 referenceRawIDNames = cms.vstring(
"PhotonPtSumOutsideSignalCone"),
143 maximumRelativeValues = cms.vdouble(0.10)
147 phase2_common.toModify(hpsPFTauBasicDiscriminators.qualityCuts,
148 isolationQualityCuts = dict( minTrackPt = 0.8 )
150 hpsPFTauBasicDiscriminatorsTask = cms.Task(
151 hpsPFTauBasicDiscriminators
155 hpsPFTauBasicDiscriminatorsdR03 = hpsPFTauBasicDiscriminators.clone(
156 deltaBetaFactor =
'0.0720',
157 customOuterCone = 0.3
159 del hpsPFTauBasicDiscriminatorsdR03.IDWPdefinitions[-1]
160 del hpsPFTauBasicDiscriminatorsdR03.IDWPdefinitions[-1]
161 for pset
in hpsPFTauBasicDiscriminatorsdR03.IDdefinitions:
162 pset.IDname = pset.IDname.value() +
"dR03"
163 for pset
in hpsPFTauBasicDiscriminatorsdR03.IDWPdefinitions:
164 pset.IDname = pset.IDname.value() +
"dR03"
165 pset.referenceRawIDNames = [name +
"dR03" for name
in pset.referenceRawIDNames.value()]
166 hpsPFTauBasicDiscriminatorsdR03Task = cms.Task(
167 hpsPFTauBasicDiscriminatorsdR03
172 hpsPFTauDiscriminationByMuonRejection3 = pfRecoTauDiscriminationAgainstMuon2Container.clone(
173 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
174 Prediscriminants = noPrediscriminants,
175 IDWPdefinitions = cms.VPSet(
177 IDname = cms.string(
'ByLooseMuonRejection3'),
178 discriminatorOption = cms.string(
'custom'),
179 HoPMin = cms.double(0.2),
180 maxNumberOfMatches = cms.int32(1),
181 doCaloMuonVeto = cms.bool(
True),
182 maxNumberOfHitsLast2Stations = cms.int32(-1)
185 IDname = cms.string(
'ByTightMuonRejection3'),
186 discriminatorOption = cms.string(
'custom'),
187 HoPMin = cms.double(0.2),
188 maxNumberOfMatches = cms.int32(1),
189 doCaloMuonVeto = cms.bool(
True),
190 maxNumberOfHitsLast2Stations = cms.int32(0)
197 hpsPFTauDiscriminationByLooseElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone(
198 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
199 Prediscriminants = noPrediscriminants,
200 PFElectronMVA_maxValue = cms.double(0.6)
203 hpsPFTauDiscriminationByMediumElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone(
204 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
205 Prediscriminants = noPrediscriminants,
206 ApplyCut_EcalCrackCut = cms.bool(
True)
209 hpsPFTauDiscriminationByTightElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone(
210 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
211 Prediscriminants = noPrediscriminants,
212 ApplyCut_EcalCrackCut = cms.bool(
True),
213 ApplyCut_BremCombined = cms.bool(
True)
216 hpsPFTauDiscriminationByDeadECALElectronRejection = pfRecoTauDiscriminationAgainstElectronDeadECAL.clone(
217 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
218 Prediscriminants = requireDecayMode.clone()
221 hpsPFTauDiscriminationByMVA6rawElectronRejection = pfRecoTauDiscriminationAgainstElectronMVA6.clone(
222 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
223 Prediscriminants = requireDecayMode.clone(),
224 loadMVAfromDB = cms.bool(
True),
225 vetoEcalCracks = cms.bool(
False),
226 mvaName_NoEleMatch_woGwoGSF_BL = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL"),
227 mvaName_NoEleMatch_wGwoGSF_BL = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL"),
228 mvaName_woGwGSF_BL = cms.string(
"RecoTauTag_antiElectronMVA_woGwGSF_BL"),
229 mvaName_wGwGSF_BL = cms.string(
"RecoTauTag_antiElectronMVA_wGwGSF_BL"),
230 mvaName_NoEleMatch_woGwoGSF_EC = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC"),
231 mvaName_NoEleMatch_wGwoGSF_EC = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC"),
232 mvaName_woGwGSF_EC = cms.string(
"RecoTauTag_antiElectronMVA_woGwGSF_EC"),
233 mvaName_wGwGSF_EC = cms.string(
"RecoTauTag_antiElectronMVA_wGwGSF_EC")
236 hpsPFTauDiscriminationByMVA6ElectronRejection = recoTauDiscriminantCutMultiplexerDefault.clone(
237 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
238 Prediscriminants = requireDecayMode.clone(),
239 toMultiplex = cms.InputTag(
'hpsPFTauDiscriminationByMVA6rawElectronRejection'),
240 loadMVAfromDB = cms.bool(
True),
243 category = cms.uint32(0),
244 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL"),
245 variable = cms.string(
"pt")
248 category = cms.uint32(2),
249 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL"),
250 variable = cms.string(
"pt")
253 category = cms.uint32(5),
254 cut = cms.string(
"RecoTauTag_antiElectronMVA_woGwGSF_BL"),
255 variable = cms.string(
"pt")
258 category = cms.uint32(7),
259 cut = cms.string(
"RecoTauTag_antiElectronMVA_wGwGSF_BL"),
260 variable = cms.string(
"pt")
263 category = cms.uint32(8),
264 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC"),
265 variable = cms.string(
"pt")
268 category = cms.uint32(10),
269 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC"),
270 variable = cms.string(
"pt")
273 category = cms.uint32(13),
274 cut = cms.string(
"RecoTauTag_antiElectronMVA_woGwGSF_EC"),
275 variable = cms.string(
"pt")
278 category = cms.uint32(15),
279 cut = cms.string(
"RecoTauTag_antiElectronMVA_wGwGSF_EC"),
280 variable = cms.string(
"pt")
283 rawValues = cms.vstring(
287 workingPoints = cms.vstring(
297 hpsSelectionDiscriminator.PFTauProducer = cms.InputTag(
"combinatoricRecoTaus")
300 hpsSelectionDiscriminator.decayModes = cms.VPSet(
301 decayMode_1Prong0Pi0,
302 decayMode_1Prong1Pi0,
303 decayMode_1Prong2Pi0,
304 decayMode_2Prong0Pi0,
305 decayMode_2Prong1Pi0,
306 decayMode_3Prong0Pi0,
307 decayMode_3Prong1Pi0,
311 from RecoTauTag.RecoTau.RecoTauCleaner_cfi
import RecoTauCleaner
312 hpsPFTauProducerSansRefs = RecoTauCleaner.clone(
313 src = cms.InputTag(
"combinatoricRecoTaus")
315 hpsPFTauProducerSansRefs.cleaners[1].src = cms.InputTag(
"hpsSelectionDiscriminator")
317 from RecoTauTag.RecoTau.RecoTauPiZeroUnembedder_cfi
import RecoTauPiZeroUnembedder
318 hpsPFTauProducer = RecoTauPiZeroUnembedder.clone(
319 src = cms.InputTag(
"hpsPFTauProducerSansRefs")
325 hpsPFTauPrimaryVertexProducer = PFTauPrimaryVertexProducer.clone(
326 PFTauTag = cms.InputTag(
"hpsPFTauProducer"),
327 ElectronTag = cms.InputTag(
""),
328 MuonTag = cms.InputTag(
""),
329 PVTag = cms.InputTag(
"offlinePrimaryVertices"),
330 beamSpot = cms.InputTag(
"offlineBeamSpot"),
331 Algorithm = cms.int32(0),
332 useBeamSpot = cms.bool(
True),
333 RemoveMuonTracks = cms.bool(
False),
334 RemoveElectronTracks = cms.bool(
False),
335 useSelectedTaus = cms.bool(
False),
336 discriminators = cms.VPSet(
338 discriminator = cms.InputTag(
'hpsPFTauDiscriminationByDecayModeFindingNewDMs'),
339 selectionCut = cms.double(0.5)
342 cut = cms.string(
"pt > 18.0 & abs(eta) < 2.4")
345 hpsPFTauSecondaryVertexProducer = PFTauSecondaryVertexProducer.clone(
346 PFTauTag = cms.InputTag(
"hpsPFTauProducer")
348 hpsPFTauTransverseImpactParameters = PFTauTransverseImpactParameters.clone(
349 PFTauTag = cms.InputTag(
"hpsPFTauProducer"),
350 PFTauPVATag = cms.InputTag(
"hpsPFTauPrimaryVertexProducer"),
351 PFTauSVATag = cms.InputTag(
"hpsPFTauSecondaryVertexProducer"),
352 useFullCalculation = cms.bool(
True)
354 hpsPFTauVertexAndImpactParametersTask = cms.Task(
355 hpsPFTauPrimaryVertexProducer,
356 hpsPFTauSecondaryVertexProducer,
357 hpsPFTauTransverseImpactParameters
359 hpsPFTauVertexAndImpactParametersSeq = cms.Sequence(
360 hpsPFTauVertexAndImpactParametersTask
365 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw = discriminationByIsolationMVArun2v1raw.clone(
366 PFTauProducer =
"hpsPFTauProducer",
367 Prediscriminants = requireDecayMode.clone(),
368 mvaName =
"RecoTauTag_tauIdMVAIsoDBoldDMwLT",
369 mvaOpt =
"DBoldDMwLTwGJ",
370 srcTauTransverseImpactParameters =
"hpsPFTauTransverseImpactParameters",
374 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT = discriminationByIsolationMVArun2v1.clone(
375 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
376 Prediscriminants = requireDecayMode.clone(),
377 toMultiplex = cms.InputTag(
'hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw'),
378 loadMVAfromDB = cms.bool(
True),
379 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT_mvaOutput_normalization"),
382 category = cms.uint32(0),
383 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT"),
384 variable = cms.string(
"pt")
387 workingPoints = cms.vstring(
398 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw.clone(
399 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT"),
400 mvaOpt = cms.string(
"DBnewDMwLTwGJ"),
401 verbosity = cms.int32(0)
404 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLT = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT.clone(
405 toMultiplex = cms.InputTag(
'hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw'),
406 loadMVAfromDB = cms.bool(
True),
407 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT_mvaOutput_normalization"),
410 category = cms.uint32(0),
411 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT"),
412 variable = cms.string(
"pt")
417 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw.clone(
418 mvaName =
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT",
419 mvaOpt =
"DBoldDMwLTwGJ",
420 srcBasicTauDiscriminators =
"hpsPFTauBasicDiscriminatorsdR03",
421 inputIDNameSuffix = cms.string(
"dR03"),
424 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT.clone(
425 PFTauProducer = cms.InputTag(
'hpsPFTauProducer'),
426 Prediscriminants = requireDecayMode.clone(),
427 toMultiplex = cms.InputTag(
'hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw'),
428 loadMVAfromDB = cms.bool(
True),
429 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT_mvaOutput_normalization"),
432 category = cms.uint32(0),
433 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT"),
434 variable = cms.string(
"pt")
439 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask = cms.Task(
440 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw,
441 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT
444 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask = cms.Task(
445 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw,
446 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLT
449 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask = cms.Task(
450 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw,
451 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT
454 hpsPFTauMVAIsolation2Task = cms.Task(
456 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask,
457 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask,
459 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask,
462 hpsPFTauMVAIsolation2Seq = cms.Sequence(
463 hpsPFTauBasicDiscriminatorsTask,
464 hpsPFTauBasicDiscriminatorsdR03Task,
465 hpsPFTauMVAIsolation2Task
468 produceHPSPFTausTask = cms.Task(
469 hpsSelectionDiscriminator,
474 hpsPFTauProducerSansRefs,
478 produceHPSPFTaus = cms.Sequence(
482 produceAndDiscriminateHPSPFTausTask = cms.Task(
483 produceHPSPFTausTask,
484 hpsPFTauDiscriminationByDecayModeFindingNewDMs,
485 hpsPFTauDiscriminationByDecayModeFindingOldDMs,
486 hpsPFTauDiscriminationByDecayModeFinding,
487 hpsPFTauBasicDiscriminatorsTask,
488 hpsPFTauBasicDiscriminatorsdR03Task,
489 hpsPFTauDiscriminationByLooseElectronRejection,
490 hpsPFTauDiscriminationByMediumElectronRejection,
491 hpsPFTauDiscriminationByTightElectronRejection,
492 hpsPFTauDiscriminationByMVA6rawElectronRejection,
493 hpsPFTauDiscriminationByMVA6ElectronRejection,
494 hpsPFTauDiscriminationByDeadECALElectronRejection,
495 hpsPFTauDiscriminationByMuonRejection3,
496 hpsPFTauVertexAndImpactParametersTask,
497 hpsPFTauMVAIsolation2Task
500 produceAndDiscriminateHPSPFTaus = cms.Sequence(
501 produceAndDiscriminateHPSPFTausTask