From 1f08b687d31ee16329a67268be6dce8445038e47 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 4 Aug 2020 11:54:47 +0200 Subject: [PATCH 1/4] Move era-dependent modification of anti-e-in-deadECal tauID from miniAOD to HPS tau configuration --- .../PatAlgos/python/slimming/miniAOD_tools.py | 13 +++++-------- RecoTauTag/Configuration/python/HPSPFTaus_cff.py | 6 ++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index c99a84567762e..6343d3cc637d8 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -383,26 +383,23 @@ def miniAOD_customizeCommon(process): deepTauIDTaskNew_) #-- Adding tauID against dead ECal towers to taus - process.hpsPFTauDiscriminationByDeadECALElectronRejectionForMiniAOD = \ - process.hpsPFTauDiscriminationByDeadECALElectronRejection.clone( - extrapolateToECalEntrance = True - ) + # note: default (AOD) behoviour of the tauID modified (leading track + # extrapolation to ECAL enabled) in the HPS PFTau master + # configuration for this era. _makePatTausTaskWithDeadECalVeto = process.makePatTausTask.copy() _makePatTausTaskWithDeadECalVeto.add( - process.hpsPFTauDiscriminationByDeadECALElectronRejectionForMiniAOD + process.hpsPFTauDiscriminationByDeadECALElectronRejection ) run2_miniAOD_devel.toReplaceWith( process.makePatTausTask, _makePatTausTaskWithDeadECalVeto ) _withDeadEcalTauIDPs = cms.PSet( process.patTaus.tauIDSources, - againstElectronDeadECAL = cms.InputTag("hpsPFTauDiscriminationByDeadECALElectronRejectionForMiniAOD") + againstElectronDeadECAL = cms.InputTag("hpsPFTauDiscriminationByDeadECALElectronRejection") ) run2_miniAOD_devel.toModify(process.patTaus, tauIDSources = _withDeadEcalTauIDPs) #... and to boosted taus - run2_miniAOD_devel.toModify(process.hpsPFTauDiscriminationByDeadECALElectronRejectionBoosted, - extrapolateToECalEntrance = True) _withDeadEcalTauIDBoostedPs = cms.PSet( process.patTausBoosted.tauIDSources, againstElectronDeadECAL = cms.InputTag("hpsPFTauDiscriminationByDeadECALElectronRejectionBoosted") diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 8fe7b05724c00..052bd8395d057 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms import copy from Configuration.Eras.Modifier_phase2_common_cff import phase2_common +from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel ''' @@ -303,6 +304,11 @@ Prediscriminants = requireDecayMode.clone(), extrapolateToECalEntrance = cms.bool(False) ) +run2_miniAOD_devel.toModify( + hpsPFTauDiscriminationByDeadECALElectronRejection, + extrapolateToECalEntrance = True +) + ## ByMVA6rawElectronRejection hpsPFTauDiscriminationByMVA6rawElectronRejection = pfRecoTauDiscriminationAgainstElectronMVA6.clone( PFTauProducer = cms.InputTag('hpsPFTauProducer'), From db9de94fa7509e0d142c3b1531273453ddb1f2c0 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Wed, 5 Aug 2020 16:43:34 +0200 Subject: [PATCH 2/4] update anti-e MVA6 discriminators for AOD/miniAO with run2_miniAOD_devel modifier (UL re-miniAOD), and make configs more compact --- .../PatAlgos/python/slimming/miniAOD_tools.py | 5 +- .../Configuration/python/HPSPFTaus_cff.py | 109 ++++++++++++------ 2 files changed, 75 insertions(+), 39 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 6343d3cc637d8..b74913d258e4e 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -386,9 +386,12 @@ def miniAOD_customizeCommon(process): # note: default (AOD) behoviour of the tauID modified (leading track # extrapolation to ECAL enabled) in the HPS PFTau master # configuration for this era. + # and running retrained anti-e MVA6 discriminants as setup in the HPS + # PFTau master configuration _makePatTausTaskWithDeadECalVeto = process.makePatTausTask.copy() _makePatTausTaskWithDeadECalVeto.add( - process.hpsPFTauDiscriminationByDeadECALElectronRejection + process.hpsPFTauDiscriminationByDeadECALElectronRejection, + process.hpsPFTauDiscriminationByMVA6ElectronRejectionTask ) run2_miniAOD_devel.toReplaceWith( process.makePatTausTask, _makePatTausTaskWithDeadECalVeto diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 052bd8395d057..025f11352ee57 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -376,44 +376,82 @@ ) ## ByMVA6LooseElectronRejection hpsPFTauDiscriminationByMVA6LooseElectronRejection = copy.deepcopy(hpsPFTauDiscriminationByMVA6VLooseElectronRejection) -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[0].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_BL_WPEff96") -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[1].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_BL_WPEff96") -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[2].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_BL_WPEff96") -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[3].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_BL_WPEff96") -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[4].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_EC_WPEff96") -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[5].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_EC_WPEff96") -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[6].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_EC_WPEff96") -hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping[7].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_EC_WPEff96") +for m in hpsPFTauDiscriminationByMVA6LooseElectronRejection.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff96") ## ByMVA6VMediumElectronRejection hpsPFTauDiscriminationByMVA6MediumElectronRejection = copy.deepcopy(hpsPFTauDiscriminationByMVA6VLooseElectronRejection) -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[0].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_BL_WPEff91") -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[1].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_BL_WPEff91") -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[2].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_BL_WPEff91") -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[3].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_BL_WPEff91") -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[4].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_EC_WPEff91") -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[5].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_EC_WPEff91") -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[6].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_EC_WPEff91") -hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping[7].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_EC_WPEff91") +for m in hpsPFTauDiscriminationByMVA6MediumElectronRejection.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff91") ## ByMVA6TightElectronRejection hpsPFTauDiscriminationByMVA6TightElectronRejection = copy.deepcopy(hpsPFTauDiscriminationByMVA6VLooseElectronRejection) -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[0].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_BL_WPEff85") -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[1].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_BL_WPEff85") -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[2].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_BL_WPEff85") -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[3].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_BL_WPEff85") -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[4].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_EC_WPEff85") -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[5].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_EC_WPEff85") -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[6].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_EC_WPEff85") -hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping[7].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_EC_WPEff85") +for m in hpsPFTauDiscriminationByMVA6TightElectronRejection.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff85") ## ByMVA6VTightElectronRejection hpsPFTauDiscriminationByMVA6VTightElectronRejection = copy.deepcopy(hpsPFTauDiscriminationByMVA6VLooseElectronRejection) -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[0].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_BL_WPEff79") -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[1].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_BL_WPEff79") -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[2].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_BL_WPEff79") -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[3].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_BL_WPEff79") -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[4].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_woGwoGSF_EC_WPEff79") -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[5].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_NoEleMatch_wGwoGSF_EC_WPEff79") -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[6].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_woGwGSF_EC_WPEff79") -hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping[7].cut = cms.string("RecoTauTag_antiElectronMVA6v1_gbr_wGwGSF_EC_WPEff79") +for m in hpsPFTauDiscriminationByMVA6VTightElectronRejection.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff79") +run2_miniAOD_devel.toModify( + hpsPFTauDiscriminationByMVA6rawElectronRejection, + vetoEcalCracks = False, + mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_woGwoGSF_BL", + mvaName_NoEleMatch_wGwoGSF_BL = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_wGwoGSF_BL", + mvaName_woGwGSF_BL = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_woGwGSF_BL", + mvaName_wGwGSF_BL = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_wGwGSF_BL", + mvaName_NoEleMatch_woGwoGSF_EC = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_woGwoGSF_EC", + mvaName_NoEleMatch_wGwoGSF_EC = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_wGwoGSF_EC", + mvaName_woGwGSF_EC = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_woGwGSF_EC", + mvaName_wGwGSF_EC = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_wGwGSF_EC" +) +_vLooseElectronRejectionMappingMVA6v3 = copy.deepcopy(hpsPFTauDiscriminationByMVA6VLooseElectronRejection.mapping) +_vLooseElectronRejectionMappingMVA6v3[0].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_woGwoGSF_BL_WPeff98" +_vLooseElectronRejectionMappingMVA6v3[1].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_wGwoGSF_BL_WPeff98" +_vLooseElectronRejectionMappingMVA6v3[2].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_woGwGSF_BL_WPeff98" +_vLooseElectronRejectionMappingMVA6v3[3].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_wGwGSF_BL_WPeff98" +_vLooseElectronRejectionMappingMVA6v3[4].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_woGwoGSF_EC_WPeff98" +_vLooseElectronRejectionMappingMVA6v3[5].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_NoEleMatch_wGwoGSF_EC_WPeff98" +_vLooseElectronRejectionMappingMVA6v3[6].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_woGwGSF_EC_WPeff98" +_vLooseElectronRejectionMappingMVA6v3[7].cut = "RecoTauTag_antiElectronMVA6v3_noeveto_gbr_wGwGSF_EC_WPeff98" +run2_miniAOD_devel.toModify( + hpsPFTauDiscriminationByMVA6VLooseElectronRejection, + mapping = _vLooseElectronRejectionMappingMVA6v3 +) +_looseElectronRejectionMappingMVA6v3 = copy.deepcopy(_vLooseElectronRejectionMappingMVA6v3) +for m in _looseElectronRejectionMappingMVA6v3: + m.cut = m.cut.value().replace("WPeff98", "WPeff90") +run2_miniAOD_devel.toModify( + hpsPFTauDiscriminationByMVA6LooseElectronRejection, + mapping = _looseElectronRejectionMappingMVA6v3 +) +_mediumElectronRejectionMappingMVA6v3 = copy.deepcopy(_vLooseElectronRejectionMappingMVA6v3) +for m in _mediumElectronRejectionMappingMVA6v3: + m.cut = m.cut.value().replace("WPeff98", "WPeff80") +run2_miniAOD_devel.toModify( + hpsPFTauDiscriminationByMVA6MediumElectronRejection, + mapping = _mediumElectronRejectionMappingMVA6v3 +) +_tightElectronRejectionMappingMVA6v3 = copy.deepcopy(_vLooseElectronRejectionMappingMVA6v3) +for m in _tightElectronRejectionMappingMVA6v3: + m.cut = m.cut.value().replace("WPeff98", "WPeff70") +run2_miniAOD_devel.toModify( + hpsPFTauDiscriminationByMVA6TightElectronRejection, + mapping = _tightElectronRejectionMappingMVA6v3 +) +_vTightElectronRejectionMappingMVA6v3 = copy.deepcopy(_vLooseElectronRejectionMappingMVA6v3) +for m in _vTightElectronRejectionMappingMVA6v3: + m.cut = m.cut.value().replace("WPeff98", "WPeff60") +run2_miniAOD_devel.toModify( + hpsPFTauDiscriminationByMVA6VTightElectronRejection, + mapping = _vTightElectronRejectionMappingMVA6v3 +) + +hpsPFTauDiscriminationByMVA6ElectronRejectionTask = cms.Task( + hpsPFTauDiscriminationByMVA6rawElectronRejection, + hpsPFTauDiscriminationByMVA6VLooseElectronRejection, + hpsPFTauDiscriminationByMVA6LooseElectronRejection, + hpsPFTauDiscriminationByMVA6MediumElectronRejection, + hpsPFTauDiscriminationByMVA6TightElectronRejection, + hpsPFTauDiscriminationByMVA6VTightElectronRejection +) # Define the HPS selection discriminator used in cleaning hpsSelectionDiscriminator.PFTauProducer = cms.InputTag("combinatoricRecoTaus") @@ -901,12 +939,7 @@ hpsPFTauDiscriminationByLooseElectronRejection, hpsPFTauDiscriminationByMediumElectronRejection, hpsPFTauDiscriminationByTightElectronRejection, - hpsPFTauDiscriminationByMVA6rawElectronRejection, - hpsPFTauDiscriminationByMVA6VLooseElectronRejection, - hpsPFTauDiscriminationByMVA6LooseElectronRejection, - hpsPFTauDiscriminationByMVA6MediumElectronRejection, - hpsPFTauDiscriminationByMVA6TightElectronRejection, - hpsPFTauDiscriminationByMVA6VTightElectronRejection, + hpsPFTauDiscriminationByMVA6ElectronRejectionTask, hpsPFTauDiscriminationByDeadECALElectronRejection, hpsPFTauDiscriminationByLooseMuonRejection3, hpsPFTauDiscriminationByTightMuonRejection3, From 86ad6504fc1ad549236f1768b1f8d18e9eb3d27b Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 28 May 2020 16:22:35 +0200 Subject: [PATCH 3/4] Add tauID againist electrons in dead ECal regions --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 1 + PhysicsTools/NanoAOD/python/taus_cff.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 06b55a2b4f918..041cc957be1a7 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -550,6 +550,7 @@ NoPlot('genPartIdx'), Plot1D('idAntiEle', 'idAntiEle', 32, -0.5, 31.5, 'Anti-electron MVA discriminator V6: bitmask 1 = VLoose, 2 = Loose, 4 = Medium, 8 = Tight, 16 = VTight'), Plot1D('idAntiEle2018', 'idAntiEle2018', 32, -0.5, 31.5, 'Anti-electron MVA discriminator V6 (2018): bitmask 1 = VLoose, 2 = Loose, 4 = Medium, 8 = Tight, 16 = VTight'), + Plot1D('idAntiEleDeadECal', 'idAntiEleDeadECal', 2, -0.5, 1.5, "tauID('againstElectronDeadECAL')"), Plot1D('idAntiMu', 'idAntiMu', 4, -0.5, 3.5, 'Anti-muon discriminator V3: : bitmask 1 = Loose, 2 = Tight'), Plot1D('idDecayMode', 'idDecayMode', 2, -0.5, 1.5, "tauID('decayModeFinding')"), Plot1D('idDecayModeNewDMs', 'idDecayModeNewDMs', 2, -0.5, 1.5, "tauID('decayModeFindingNewDMs')"), diff --git a/PhysicsTools/NanoAOD/python/taus_cff.py b/PhysicsTools/NanoAOD/python/taus_cff.py index c44a4612c121a..b356b42a40a83 100644 --- a/PhysicsTools/NanoAOD/python/taus_cff.py +++ b/PhysicsTools/NanoAOD/python/taus_cff.py @@ -55,7 +55,7 @@ def _tauId8WPMask(pattern,doc): variables = cms.PSet() # PSet defined below in era dependent way ) _tauVarsBase = cms.PSet(P4Vars, - charge = Var("charge", int, doc="electric charge"), + charge = Var("charge", int, doc="electric charge"), jetIdx = Var("?hasUserCand('jet')?userCand('jet').key():-1", int, doc="index of the associated jet (-1 if none)"), decayMode = Var("decayMode()",int), idDecayMode = Var("tauID('decayModeFinding')", bool), @@ -81,6 +81,7 @@ def _tauId8WPMask(pattern,doc): idAntiMu = _tauId2WPMask("againstMuon%s3", doc= "Anti-muon discriminator V3: "), idAntiEle = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6"), + idAntiEleDeadECal = Var("tauID('againstElectronDeadECAL')", bool, doc = "Anti-electron dead-ECal discriminator"), # isoCI3hit = Var( "tauID("byCombinedIsolationDeltaBetaCorrRaw3Hits")" doc="byCombinedIsolationDeltaBetaCorrRaw3Hits raw output discriminator"), # photonOutsideSigCone = Var( "tauID("photonPtSumOutsideSignalCone")" doc="photonPtSumOutsideSignalCone raw output discriminator"), @@ -162,6 +163,19 @@ def _tauId8WPMask(pattern,doc): ) + +from Configuration.Eras.Modifier_run2_nanoAOD_92X_cff import run2_nanoAOD_92X +from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 +from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 +from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 +from Configuration.Eras.Modifier_run2_nanoAOD_106Xv1_cff import run2_nanoAOD_106Xv1 +for era in [run2_miniAOD_80XLegacy, run2_nanoAOD_92X, run2_nanoAOD_94XMiniAODv1, \ + run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_94X2016, run2_nanoAOD_102Xv1, \ + run2_nanoAOD_106Xv1]: + era.toModify(tauTable.variables, + idAntiEleDeadECal = None + ) + tauGenJets.GenParticles = cms.InputTag("prunedGenParticles") tauGenJets.includeNeutrinos = cms.bool(False) From 1138f5f260fd23ce652aa2176cec71fcc599a066 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 6 Aug 2020 12:08:11 +0200 Subject: [PATCH 4/4] Adjust to update of anti-e tauID to changes for UL re-MiniAOD --- PhysicsTools/NanoAOD/python/taus_cff.py | 41 +-- .../NanoAOD/python/taus_updatedMVAIds_cff.py | 269 ++++++------------ 2 files changed, 109 insertions(+), 201 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/taus_cff.py b/PhysicsTools/NanoAOD/python/taus_cff.py index b356b42a40a83..865a84b10ac8a 100644 --- a/PhysicsTools/NanoAOD/python/taus_cff.py +++ b/PhysicsTools/NanoAOD/python/taus_cff.py @@ -76,11 +76,7 @@ def _tauId8WPMask(pattern,doc): puCorr = Var( "tauID('puCorrPtSum')", float, doc = "pileup correction", precision=10), photonsOutsideSignalCone = Var( "tauID('photonPtSumOutsideSignalCone')", float, doc = "sum of photons outside signal cone", precision=10), - rawAntiEle = Var("tauID('againstElectronMVA6Raw')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator", precision=10), - rawAntiEleCat = Var("tauID('againstElectronMVA6category')", int, doc="Anti-electron MVA discriminator V6 category"), - idAntiMu = _tauId2WPMask("againstMuon%s3", doc= "Anti-muon discriminator V3: "), - idAntiEle = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6"), idAntiEleDeadECal = Var("tauID('againstElectronDeadECAL')", bool, doc = "Anti-electron dead-ECal discriminator"), # isoCI3hit = Var( "tauID("byCombinedIsolationDeltaBetaCorrRaw3Hits")" doc="byCombinedIsolationDeltaBetaCorrRaw3Hits raw output discriminator"), @@ -112,10 +108,18 @@ def _tauId8WPMask(pattern,doc): idMVAoldDM2017v2 = _tauId7WPMask( "by%sIsolationMVArun2v1DBoldDMwLT2017v2", doc="IsolationMVArun2v1DBoldDMwLT ID working point (2017v2)"), idMVAoldDMdR032017v2 = _tauId7WPMask( "by%sIsolationMVArun2v1DBdR03oldDMwLT2017v2", doc="IsolationMVArun2v1DBoldDMdR0p3wLT ID working point (2017v2)") ) -_mvaAntiEVars2018 = cms.PSet( +_mvaAntiEVars = cms.PSet( rawAntiEle2018 = Var("tauID('againstElectronMVA6Raw2018')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2018)", precision=10), rawAntiEleCat2018 = Var("tauID('againstElectronMVA6category2018')", int, doc="Anti-electron MVA discriminator V6 category (2018)"), idAntiEle2018 = _tauId5WPMask("againstElectron%sMVA62018", doc= "Anti-electron MVA discriminator V6 (2018)"), + rawAntiEle = Var("tauID('againstElectronMVA6Raw')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2015)", precision=10), + rawAntiEleCat = Var("tauID('againstElectronMVA6category')", int, doc="Anti-electron MVA discriminator V6 category (2015)"), + idAntiEle = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6 (2015)"), +) +_mvaAntiEVars2015 = cms.PSet( + rawAntiEle = Var("tauID('againstElectronMVA6Raw')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2015)", precision=10), + rawAntiEleCat = Var("tauID('againstElectronMVA6category')", int, doc="Anti-electron MVA discriminator V6 category (2015)"), + idAntiEle = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6 (2015)") ) _deepTauVars2017v2 = cms.PSet( rawDeepTau2017v2VSe = Var("tauID('byDeepTau2017v2VSeraw')", float, doc="byDeepTau2017v2VSe raw output discriminator (deepTau2017v2)", precision=10), @@ -136,7 +140,7 @@ def _tauId8WPMask(pattern,doc): _variablesMiniV2 = cms.PSet( _tauVarsBase, - _mvaAntiEVars2018, + _mvaAntiEVars, _mvaIsoVars2015Reduced, _mvaIsoVars2017v1, _mvaIsoVars2017v2, @@ -149,6 +153,7 @@ def _tauId8WPMask(pattern,doc): _variablesMiniV1.idMVAoldDM2017v1 = _tauId7WPMask( "by%sIsolationMVArun2v1DBoldDMwLT2017v1", doc="IsolationMVArun2v1DBoldDMwLT ID working point (2017v1)") _variables80X = cms.PSet( _tauVarsBase, + _mvaAntiEVars2015, _mvaIsoVars2015 ) @@ -161,20 +166,18 @@ def _tauId8WPMask(pattern,doc): run2_miniAOD_80XLegacy.toModify(tauTable, variables = _variables80X ) +(~run2_miniAOD_devel).toModify(tauTable.variables, + idAntiEleDeadECal = None +) - - -from Configuration.Eras.Modifier_run2_nanoAOD_92X_cff import run2_nanoAOD_92X -from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 -from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 -from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 -from Configuration.Eras.Modifier_run2_nanoAOD_106Xv1_cff import run2_nanoAOD_106Xv1 -for era in [run2_miniAOD_80XLegacy, run2_nanoAOD_92X, run2_nanoAOD_94XMiniAODv1, \ - run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_94X2016, run2_nanoAOD_102Xv1, \ - run2_nanoAOD_106Xv1]: - era.toModify(tauTable.variables, - idAntiEleDeadECal = None - ) +run2_miniAOD_devel.toModify(tauTable.variables, + rawAntiEle2018 = Var("tauID('againstElectronMVA6Raw')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2018)", precision=10), + rawAntiEleCat2018 = Var("tauID('againstElectronMVA6category')", int, doc="Anti-electron MVA discriminator V6 category (2018)"), + idAntiEle2018 = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6 (2018)"), + rawAntiEle = Var("tauID('againstElectronMVA6Raw2015')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2015)", precision=10), + rawAntiEleCat = Var("tauID('againstElectronMVA6category2015')", int, doc="Anti-electron MVA discriminator V6 category (2015"), + idAntiEle = _tauId5WPMask("againstElectron%sMVA62015", doc= "Anti-electron MVA discriminator V6 (2015)") +) tauGenJets.GenParticles = cms.InputTag("prunedGenParticles") tauGenJets.includeNeutrinos = cms.bool(False) diff --git a/PhysicsTools/NanoAOD/python/taus_updatedMVAIds_cff.py b/PhysicsTools/NanoAOD/python/taus_updatedMVAIds_cff.py index 99a9c0dbfbeeb..f0b9d3e4aa751 100644 --- a/PhysicsTools/NanoAOD/python/taus_updatedMVAIds_cff.py +++ b/PhysicsTools/NanoAOD/python/taus_updatedMVAIds_cff.py @@ -4,6 +4,7 @@ # Used only in some eras from RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi import * from RecoTauTag.RecoTau.PATTauDiscriminationByMVAIsolationRun2_cff import * +from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel ### MVAIso 2017v2 ## DBoldDM @@ -286,7 +287,7 @@ ) -### Define new anit-e discriminants +### Define new anit-e discriminants (2018) antiElectronDiscrMVA6_version = "MVA6v3_noeveto" ## Raw from RecoTauTag.RecoTau.PATTauDiscriminationAgainstElectronMVA6_cfi import patTauDiscriminationAgainstElectronMVA6 @@ -355,187 +356,64 @@ ) ) # Loose -patTauDiscriminationByLooseElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone( - mapping = cms.VPSet( - cms.PSet( - category = cms.uint32(0), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_BL_WPeff90'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(2), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_BL_WPeff90'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(5), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_BL_WPeff90'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(7), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_BL_WPeff90'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(8), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_EC_WPeff90'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(10), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_EC_WPeff90'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(13), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_EC_WPeff90'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(15), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_EC_WPeff90'), - variable = cms.string('pt') - ) - ) -) +patTauDiscriminationByLooseElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone() +for m in patTauDiscriminationByLooseElectronRejectionMVA62018.mapping: + m.cut = m.cut.value().replace("WPeff98", "WPeff90") # Medium -patTauDiscriminationByMediumElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone( - mapping = cms.VPSet( - cms.PSet( - category = cms.uint32(0), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_BL_WPeff80'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(2), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_BL_WPeff80'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(5), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_BL_WPeff80'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(7), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_BL_WPeff80'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(8), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_EC_WPeff80'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(10), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_EC_WPeff80'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(13), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_EC_WPeff80'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(15), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_EC_WPeff80'), - variable = cms.string('pt') - ) - ) -) +patTauDiscriminationByMediumElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone() +for m in patTauDiscriminationByMediumElectronRejectionMVA62018.mapping: + m.cut = m.cut.value().replace("WPeff98", "WPeff80") # Tight -patTauDiscriminationByTightElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone( - mapping = cms.VPSet( - cms.PSet( - category = cms.uint32(0), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_BL_WPeff70'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(2), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_BL_WPeff70'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(5), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_BL_WPeff70'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(7), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_BL_WPeff70'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(8), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_EC_WPeff70'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(10), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_EC_WPeff70'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(13), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_EC_WPeff70'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(15), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_EC_WPeff70'), - variable = cms.string('pt') - ) - ) -) +patTauDiscriminationByTightElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone() +for m in patTauDiscriminationByTightElectronRejectionMVA62018.mapping: + m.cut = m.cut.value().replace("WPeff98", "WPeff70") # VTight -patTauDiscriminationByVTightElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone( - mapping = cms.VPSet( - cms.PSet( - category = cms.uint32(0), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_BL_WPeff60'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(2), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_BL_WPeff60'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(5), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_BL_WPeff60'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(7), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_BL_WPeff60'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(8), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_EC_WPeff60'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(10), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_EC_WPeff60'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(13), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_EC_WPeff60'), - variable = cms.string('pt') - ), - cms.PSet( - category = cms.uint32(15), - cut = cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_EC_WPeff60'), - variable = cms.string('pt') - ) - ) +patTauDiscriminationByVTightElectronRejectionMVA62018 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone() +for m in patTauDiscriminationByVTightElectronRejectionMVA62018.mapping: + m.cut = m.cut.value().replace("WPeff98", "WPeff60") +### Define v1 anit-e discriminants (2015) +antiElectronDiscrMVA6v1_version = "MVA6v1" +## Raw +patTauDiscriminationByElectronRejectionMVA62015Raw = patTauDiscriminationAgainstElectronMVA6.clone( + Prediscriminants = noPrediscriminants, #already selected for MiniAOD + vetoEcalCracks = True, #don't keep tau candidates in EB-EE cracks for v1 + mvaName_NoEleMatch_wGwoGSF_BL = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_NoEleMatch_wGwoGSF_BL', + mvaName_NoEleMatch_wGwoGSF_EC = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_NoEleMatch_wGwoGSF_EC', + mvaName_NoEleMatch_woGwoGSF_BL = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_NoEleMatch_woGwoGSF_BL', + mvaName_NoEleMatch_woGwoGSF_EC = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_NoEleMatch_woGwoGSF_EC', + mvaName_wGwGSF_BL = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_wGwGSF_BL', + mvaName_wGwGSF_EC = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_wGwGSF_EC', + mvaName_woGwGSF_BL = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_woGwGSF_BL', + mvaName_woGwGSF_EC = 'RecoTauTag_antiElectron'+antiElectronDiscrMVA6v1_version+'_gbr_woGwGSF_EC' +) +## anti-e v1 WPs +# VLoose +patTauDiscriminationByVLooseElectronRejectionMVA62015 = patTauDiscriminationByVLooseElectronRejectionMVA62018.clone( + PATTauProducer = patTauDiscriminationByElectronRejectionMVA62015Raw.PATTauProducer, + Prediscriminants = patTauDiscriminationByElectronRejectionMVA62015Raw.Prediscriminants, + toMultiplex = cms.InputTag("patTauDiscriminationByElectronRejectionMVA62015Raw"), + key = cms.InputTag("patTauDiscriminationByElectronRejectionMVA62015Raw","category") ) +for m in patTauDiscriminationByVLooseElectronRejectionMVA62015.mapping: + m.cut = m.cut.value().replace(antiElectronDiscrMVA6_version, antiElectronDiscrMVA6v1_version).replace("WPeff98", "WPEff99") +# Loose +patTauDiscriminationByLooseElectronRejectionMVA62015 = patTauDiscriminationByVLooseElectronRejectionMVA62015.clone() +for m in patTauDiscriminationByLooseElectronRejectionMVA62015.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff96") +# Medium +patTauDiscriminationByMediumElectronRejectionMVA62015 = patTauDiscriminationByVLooseElectronRejectionMVA62015.clone() +for m in patTauDiscriminationByMediumElectronRejectionMVA62015.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff91") +# Tight +patTauDiscriminationByTightElectronRejectionMVA62015 = patTauDiscriminationByVLooseElectronRejectionMVA62015.clone() +for m in patTauDiscriminationByTightElectronRejectionMVA62015.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff85") +# VTight +patTauDiscriminationByVTightElectronRejectionMVA62015 = patTauDiscriminationByVLooseElectronRejectionMVA62015.clone() +for m in patTauDiscriminationByVTightElectronRejectionMVA62015.mapping: + m.cut = m.cut.value().replace("WPEff99", "WPEff79") ### Put all anti-e tau-IDs into a sequence -patTauDiscriminationByElectronRejectionSeq = cms.Sequence( +_patTauDiscriminationByElectronRejection2018Seq = cms.Sequence( patTauDiscriminationByElectronRejectionMVA62018Raw +patTauDiscriminationByVLooseElectronRejectionMVA62018 +patTauDiscriminationByLooseElectronRejectionMVA62018 @@ -543,6 +421,18 @@ +patTauDiscriminationByTightElectronRejectionMVA62018 +patTauDiscriminationByVTightElectronRejectionMVA62018 ) +_patTauDiscriminationByElectronRejection2015Seq = cms.Sequence( + patTauDiscriminationByElectronRejectionMVA62015Raw + +patTauDiscriminationByVLooseElectronRejectionMVA62015 + +patTauDiscriminationByLooseElectronRejectionMVA62015 + +patTauDiscriminationByMediumElectronRejectionMVA62015 + +patTauDiscriminationByTightElectronRejectionMVA62015 + +patTauDiscriminationByVTightElectronRejectionMVA62015 +) +patTauDiscriminationByElectronRejectionSeq = _patTauDiscriminationByElectronRejection2018Seq.copy() +run2_miniAOD_devel.toReplaceWith(patTauDiscriminationByElectronRejectionSeq, + _patTauDiscriminationByElectronRejection2015Seq) + ### put all new MVA tau-Id stuff to one Sequence _patTauMVAIDsSeq2017v2 = cms.Sequence( @@ -621,14 +511,14 @@ _tauIDSources2017v2.clone(), _tauIDSources2015 ) -slimmedTausUpdated.tauIDSources=_tauIDSourcesWith2015 +slimmedTausUpdated.tauIDSources = _tauIDSourcesWith2015 for era in [run2_nanoAOD_94XMiniAODv1,]: era.toModify(slimmedTausUpdated, tauIDSources = _tauIDSourcesWith2017v1 ) -_antiETauIDSources = cms.PSet( +_antiETauIDSources2018 = cms.PSet( againstElectronMVA6Raw2018 = cms.InputTag("patTauDiscriminationByElectronRejectionMVA62018Raw"), againstElectronMVA6category2018 = cms.InputTag("patTauDiscriminationByElectronRejectionMVA62018Raw","category"), againstElectronVLooseMVA62018 = cms.InputTag("patTauDiscriminationByVLooseElectronRejectionMVA62018"), @@ -637,11 +527,26 @@ againstElectronTightMVA62018 = cms.InputTag("patTauDiscriminationByTightElectronRejectionMVA62018"), againstElectronVTightMVA62018 = cms.InputTag("patTauDiscriminationByVTightElectronRejectionMVA62018") ) -_tauIDSourcesWithAntiE = cms.PSet( +_tauIDSourcesWithAntiE2018 = cms.PSet( + slimmedTausUpdated.tauIDSources.clone(), + _antiETauIDSources2018 +) +_antiETauIDSources2015 = cms.PSet( + againstElectronMVA6Raw2015 = cms.InputTag("patTauDiscriminationByElectronRejectionMVA62015Raw"), + againstElectronMVA6category2015 = cms.InputTag("patTauDiscriminationByElectronRejectionMVA62015Raw","category"), + againstElectronVLooseMVA62015 = cms.InputTag("patTauDiscriminationByVLooseElectronRejectionMVA62015"), + againstElectronLooseMVA62015 = cms.InputTag("patTauDiscriminationByLooseElectronRejectionMVA62015"), + againstElectronMediumMVA62015 = cms.InputTag("patTauDiscriminationByMediumElectronRejectionMVA62015"), + againstElectronTightMVA62015 = cms.InputTag("patTauDiscriminationByTightElectronRejectionMVA62015"), + againstElectronVTightMVA62015 = cms.InputTag("patTauDiscriminationByVTightElectronRejectionMVA62015") +) +_tauIDSourcesWithAntiE2015 = cms.PSet( slimmedTausUpdated.tauIDSources.clone(), - _antiETauIDSources + _antiETauIDSources2015 ) -slimmedTausUpdated.tauIDSources=_tauIDSourcesWithAntiE +slimmedTausUpdated.tauIDSources = _tauIDSourcesWithAntiE2018 +run2_miniAOD_devel.toModify(slimmedTausUpdated, + tauIDSources = _tauIDSourcesWithAntiE2015)