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 =
'hpsPFTauProducer',
36 decayModes = cms.VPSet(
47 hpsPFTauDiscriminationByDecayModeFindingOldDMs = hpsSelectionDiscriminator.clone(
48 PFTauProducer =
'hpsPFTauProducer',
49 decayModes = cms.VPSet(
55 requireTauChargedHadronsToBeChargedPFCands =
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 =
"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 =
'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 =
'hpsPFTauProducer',
199 Prediscriminants = noPrediscriminants,
200 PFElectronMVA_maxValue = 0.6
203 hpsPFTauDiscriminationByMediumElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone(
204 PFTauProducer =
'hpsPFTauProducer',
205 Prediscriminants = noPrediscriminants,
206 ApplyCut_EcalCrackCut =
True
209 hpsPFTauDiscriminationByTightElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone(
210 PFTauProducer =
'hpsPFTauProducer',
211 Prediscriminants = noPrediscriminants,
212 ApplyCut_EcalCrackCut =
True,
213 ApplyCut_BremCombined =
True
216 hpsPFTauDiscriminationByDeadECALElectronRejection = pfRecoTauDiscriminationAgainstElectronDeadECAL.clone(
217 PFTauProducer =
'hpsPFTauProducer',
218 Prediscriminants = requireDecayMode.clone()
221 hpsPFTauDiscriminationByMVA6rawElectronRejection = pfRecoTauDiscriminationAgainstElectronMVA6.clone(
222 PFTauProducer =
'hpsPFTauProducer',
223 srcElectrons =
'gedGsfElectrons',
224 Prediscriminants = requireDecayMode.clone(),
225 loadMVAfromDB =
True,
226 vetoEcalCracks =
False,
227 mvaName_NoEleMatch_woGwoGSF_BL =
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL",
228 mvaName_NoEleMatch_wGwoGSF_BL =
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL",
229 mvaName_woGwGSF_BL =
"RecoTauTag_antiElectronMVA_woGwGSF_BL",
230 mvaName_wGwGSF_BL =
"RecoTauTag_antiElectronMVA_wGwGSF_BL",
231 mvaName_NoEleMatch_woGwoGSF_EC =
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC",
232 mvaName_NoEleMatch_wGwoGSF_EC =
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC",
233 mvaName_woGwGSF_EC =
"RecoTauTag_antiElectronMVA_woGwGSF_EC",
234 mvaName_wGwGSF_EC =
"RecoTauTag_antiElectronMVA_wGwGSF_EC"
237 hpsPFTauDiscriminationByMVA6ElectronRejection = recoTauDiscriminantCutMultiplexerDefault.clone(
238 PFTauProducer =
'hpsPFTauProducer',
239 Prediscriminants = requireDecayMode.clone(),
240 toMultiplex =
'hpsPFTauDiscriminationByMVA6rawElectronRejection',
241 loadMVAfromDB =
True,
244 category = cms.uint32(0),
245 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL"),
246 variable = cms.string(
"pt")
249 category = cms.uint32(2),
250 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL"),
251 variable = cms.string(
"pt")
254 category = cms.uint32(5),
255 cut = cms.string(
"RecoTauTag_antiElectronMVA_woGwGSF_BL"),
256 variable = cms.string(
"pt")
259 category = cms.uint32(7),
260 cut = cms.string(
"RecoTauTag_antiElectronMVA_wGwGSF_BL"),
261 variable = cms.string(
"pt")
264 category = cms.uint32(8),
265 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC"),
266 variable = cms.string(
"pt")
269 category = cms.uint32(10),
270 cut = cms.string(
"RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC"),
271 variable = cms.string(
"pt")
274 category = cms.uint32(13),
275 cut = cms.string(
"RecoTauTag_antiElectronMVA_woGwGSF_EC"),
276 variable = cms.string(
"pt")
279 category = cms.uint32(15),
280 cut = cms.string(
"RecoTauTag_antiElectronMVA_wGwGSF_EC"),
281 variable = cms.string(
"pt")
284 rawValues = cms.vstring(
288 workingPoints = cms.vstring(
298 hpsSelectionDiscriminator.PFTauProducer =
"combinatoricRecoTaus"
301 hpsSelectionDiscriminator.decayModes = cms.VPSet(
302 decayMode_1Prong0Pi0,
303 decayMode_1Prong1Pi0,
304 decayMode_1Prong2Pi0,
305 decayMode_2Prong0Pi0,
306 decayMode_2Prong1Pi0,
307 decayMode_3Prong0Pi0,
308 decayMode_3Prong1Pi0,
312 from RecoTauTag.RecoTau.RecoTauCleaner_cfi
import RecoTauCleaner
313 hpsPFTauProducerSansRefs = RecoTauCleaner.clone(
314 src =
"combinatoricRecoTaus",
315 cleaners = {1: dict(src =
"hpsSelectionDiscriminator")}
318 from RecoTauTag.RecoTau.RecoTauPiZeroUnembedder_cfi
import RecoTauPiZeroUnembedder
319 hpsPFTauProducer = RecoTauPiZeroUnembedder.clone(
320 src =
"hpsPFTauProducerSansRefs"
326 hpsPFTauPrimaryVertexProducer = PFTauPrimaryVertexProducer.clone(
327 PFTauTag =
"hpsPFTauProducer",
330 PVTag =
"offlinePrimaryVertices",
331 beamSpot =
"offlineBeamSpot",
334 RemoveMuonTracks =
False,
335 RemoveElectronTracks =
False,
336 useSelectedTaus =
False,
337 discriminators = cms.VPSet(
339 discriminator = cms.InputTag(
'hpsPFTauDiscriminationByDecayModeFindingNewDMs'),
340 selectionCut = cms.double(0.5)
343 cut =
"pt > 18.0 & abs(eta) < 2.4"
346 hpsPFTauSecondaryVertexProducer = PFTauSecondaryVertexProducer.clone(
347 PFTauTag =
"hpsPFTauProducer"
349 hpsPFTauTransverseImpactParameters = PFTauTransverseImpactParameters.clone(
350 PFTauTag =
"hpsPFTauProducer",
351 PFTauPVATag =
"hpsPFTauPrimaryVertexProducer",
352 PFTauSVATag =
"hpsPFTauSecondaryVertexProducer",
353 useFullCalculation =
True
355 hpsPFTauVertexAndImpactParametersTask = cms.Task(
356 hpsPFTauPrimaryVertexProducer,
357 hpsPFTauSecondaryVertexProducer,
358 hpsPFTauTransverseImpactParameters
360 hpsPFTauVertexAndImpactParametersSeq = cms.Sequence(
361 hpsPFTauVertexAndImpactParametersTask
366 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw = discriminationByIsolationMVArun2v1raw.clone(
367 PFTauProducer =
"hpsPFTauProducer",
368 Prediscriminants = requireDecayMode.clone(),
369 mvaName =
"RecoTauTag_tauIdMVAIsoDBoldDMwLT",
370 mvaOpt =
"DBoldDMwLTwGJ",
371 srcTauTransverseImpactParameters =
"hpsPFTauTransverseImpactParameters",
375 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT = discriminationByIsolationMVArun2v1.clone(
376 PFTauProducer =
'hpsPFTauProducer',
377 Prediscriminants = requireDecayMode.clone(),
378 toMultiplex =
'hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw',
379 loadMVAfromDB =
True,
380 mvaOutput_normalization =
"RecoTauTag_tauIdMVAIsoDBoldDMwLT_mvaOutput_normalization",
383 category = cms.uint32(0),
384 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT"),
385 variable = cms.string(
"pt")
399 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw.clone(
400 mvaName =
"RecoTauTag_tauIdMVAIsoDBnewDMwLT",
401 mvaOpt =
"DBnewDMwLTwGJ",
405 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLT = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT.clone(
406 toMultiplex =
'hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw',
407 loadMVAfromDB =
True,
408 mvaOutput_normalization =
"RecoTauTag_tauIdMVAIsoDBnewDMwLT_mvaOutput_normalization",
411 category = cms.uint32(0),
412 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT"),
413 variable = cms.string(
"pt")
418 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw.clone(
419 mvaName =
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT",
420 mvaOpt =
"DBoldDMwLTwGJ",
421 srcBasicTauDiscriminators =
"hpsPFTauBasicDiscriminatorsdR03",
422 inputIDNameSuffix =
"dR03",
425 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT.clone(
426 PFTauProducer =
'hpsPFTauProducer',
427 Prediscriminants = requireDecayMode.clone(),
428 toMultiplex =
'hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw',
429 loadMVAfromDB =
True,
430 mvaOutput_normalization =
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT_mvaOutput_normalization",
433 category = cms.uint32(0),
434 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT"),
435 variable = cms.string(
"pt")
440 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask = cms.Task(
441 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw,
442 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT
445 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask = cms.Task(
446 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw,
447 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLT
450 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask = cms.Task(
451 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw,
452 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT
455 hpsPFTauMVAIsolation2Task = cms.Task(
457 hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTTask,
458 hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTTask,
460 hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTTask,
463 hpsPFTauMVAIsolation2Seq = cms.Sequence(
464 hpsPFTauBasicDiscriminatorsTask,
465 hpsPFTauBasicDiscriminatorsdR03Task,
466 hpsPFTauMVAIsolation2Task
469 produceHPSPFTausTask = cms.Task(
470 hpsSelectionDiscriminator,
475 hpsPFTauProducerSansRefs,
479 produceHPSPFTaus = cms.Sequence(
483 produceAndDiscriminateHPSPFTausTask = cms.Task(
484 produceHPSPFTausTask,
485 hpsPFTauDiscriminationByDecayModeFindingNewDMs,
486 hpsPFTauDiscriminationByDecayModeFindingOldDMs,
487 hpsPFTauDiscriminationByDecayModeFinding,
488 hpsPFTauBasicDiscriminatorsTask,
489 hpsPFTauBasicDiscriminatorsdR03Task,
490 hpsPFTauDiscriminationByLooseElectronRejection,
491 hpsPFTauDiscriminationByMediumElectronRejection,
492 hpsPFTauDiscriminationByTightElectronRejection,
493 hpsPFTauDiscriminationByMVA6rawElectronRejection,
494 hpsPFTauDiscriminationByMVA6ElectronRejection,
495 hpsPFTauDiscriminationByDeadECALElectronRejection,
496 hpsPFTauDiscriminationByMuonRejection3,
497 hpsPFTauVertexAndImpactParametersTask,
498 hpsPFTauMVAIsolation2Task
501 produceAndDiscriminateHPSPFTaus = cms.Sequence(
502 produceAndDiscriminateHPSPFTausTask