From 65902ee69d19215246378b51731cc8e6257db455 Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 27 Aug 2019 12:56:41 +0200 Subject: [PATCH 01/10] Disabled PCA inputs for deepTau v2. --- RecoTauTag/RecoTau/plugins/DeepTauId.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/DeepTauId.cc b/RecoTauTag/RecoTau/plugins/DeepTauId.cc index 36f60d7358e73..43bb43e74fd39 100644 --- a/RecoTauTag/RecoTau/plugins/DeepTauId.cc +++ b/RecoTauTag/RecoTau/plugins/DeepTauId.cc @@ -907,9 +907,13 @@ class DeepTauId : public deep_tau::DeepTauBase { get(dnn::neutralIsoPtSumdR03_over_dR05) = getValue(tau.tauID("neutralIsoPtSumdR03") / tau.tauID("neutralIsoPtSum")); get(dnn::photonPtSumOutsideSignalCone) = getValueNorm(tau.tauID("photonPtSumOutsideSignalConedR03"), 1.731f, 6.846f); get(dnn::puCorrPtSum) = getValueNorm(tau.tauID("puCorrPtSum"), 22.38f, 16.34f); - get(dnn::tau_dxy_pca_x) = getValueNorm(tau.dxy_PCA().x(), -0.0241f, 0.0074f); - get(dnn::tau_dxy_pca_y) = getValueNorm(tau.dxy_PCA().y(),0.0675f, 0.0128f); - get(dnn::tau_dxy_pca_z) = getValueNorm(tau.dxy_PCA().z(), 0.7973f, 3.456f); + // The global PCA coordinates were used as inputs during the NN training, but it was decided to disable + // them for the inference, because modeling of dxy_PCA in MC poorly describes the data, and x and y coordinates + // in data results outside of the expected 5 std. dev. input validity range. On the other hand, + // these coordinates are strongly era-dependent. Kept as comment to document what NN expects. + get(dnn::tau_dxy_pca_x) = 0; // getValueNorm(tau.dxy_PCA().x(), -0.0241f, 0.0074f); + get(dnn::tau_dxy_pca_y) = 0; // getValueNorm(tau.dxy_PCA().y(),0.0675f, 0.0128f); + get(dnn::tau_dxy_pca_z) = 0; // getValueNorm(tau.dxy_PCA().z(), 0.7973f, 3.456f); const bool tau_dxy_valid = std::isnormal(tau.dxy()) && tau.dxy() > - 10 && std::isnormal(tau.dxy_error()) && tau.dxy_error() > 0; From 6b6cf55df5b709d72f7ea495cfb604506dfc988b Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 28 Aug 2019 18:32:26 +0200 Subject: [PATCH 02/10] Control disabling dxy_PCA by a parameter --- .../PatAlgos/python/slimming/miniAOD_tools.py | 2 ++ RecoTauTag/RecoTau/plugins/DeepTauId.cc | 18 +++++++++++++----- RecoTauTag/RecoTau/python/tools/runTauIdMVA.py | 8 ++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 05e57cde1239d..d55fa15a0c0af 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -355,6 +355,8 @@ def miniAOD_customizeCommon(process): addToProcessAndTask(noUpdatedTauName, process.slimmedTaus.clone(),process,task) delattr(process, 'slimmedTaus') process.deepTau2017v2.taus = noUpdatedTauName + from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel + run2_miniAOD_devel.toModify(process.deepTau2017v2, disable_dxy_pca=True) process.slimmedTaus = getattr(process, updatedTauName).clone( src = noUpdatedTauName ) diff --git a/RecoTauTag/RecoTau/plugins/DeepTauId.cc b/RecoTauTag/RecoTau/plugins/DeepTauId.cc index 43bb43e74fd39..8f5412ed81e43 100644 --- a/RecoTauTag/RecoTau/plugins/DeepTauId.cc +++ b/RecoTauTag/RecoTau/plugins/DeepTauId.cc @@ -577,6 +577,7 @@ class DeepTauId : public deep_tau::DeepTauBase { desc.add("mem_mapped", false); desc.add("version", 2); desc.add("debug_level", 0); + desc.add("disable_dxy_pca", false); edm::ParameterSetDescription descWP; descWP.add("VVVLoose", "0"); @@ -601,7 +602,8 @@ class DeepTauId : public deep_tau::DeepTauBase { muons_token_(consumes(cfg.getParameter("muons"))), rho_token_(consumes(cfg.getParameter("rho"))), version(cfg.getParameter("version")), - debug_level(cfg.getParameter("debug_level")) + debug_level(cfg.getParameter("debug_level")), + disable_dxy_pca_(cfg.getParameter("disable_dxy_pca")) { if(version == 1) { input_layer_ = cache_->getGraph().node(0).name(); @@ -911,10 +913,15 @@ class DeepTauId : public deep_tau::DeepTauBase { // them for the inference, because modeling of dxy_PCA in MC poorly describes the data, and x and y coordinates // in data results outside of the expected 5 std. dev. input validity range. On the other hand, // these coordinates are strongly era-dependent. Kept as comment to document what NN expects. - get(dnn::tau_dxy_pca_x) = 0; // getValueNorm(tau.dxy_PCA().x(), -0.0241f, 0.0074f); - get(dnn::tau_dxy_pca_y) = 0; // getValueNorm(tau.dxy_PCA().y(),0.0675f, 0.0128f); - get(dnn::tau_dxy_pca_z) = 0; // getValueNorm(tau.dxy_PCA().z(), 0.7973f, 3.456f); - + if(!disable_dxy_pca_) { + get(dnn::tau_dxy_pca_x) = getValueNorm(tau.dxy_PCA().x(), -0.0241f, 0.0074f); + get(dnn::tau_dxy_pca_y) = getValueNorm(tau.dxy_PCA().y(),0.0675f, 0.0128f); + get(dnn::tau_dxy_pca_z) = getValueNorm(tau.dxy_PCA().z(), 0.7973f, 3.456f); + } else { + get(dnn::tau_dxy_pca_x) = 0; + get(dnn::tau_dxy_pca_y) = 0; + get(dnn::tau_dxy_pca_z) = 0; + } const bool tau_dxy_valid = std::isnormal(tau.dxy()) && tau.dxy() > - 10 && std::isnormal(tau.dxy_error()) && tau.dxy_error() > 0; if(tau_dxy_valid){ @@ -1702,6 +1709,7 @@ class DeepTauId : public deep_tau::DeepTauBase { std::string input_layer_, output_layer_; const unsigned version; const int debug_level; + const bool disable_dxy_pca_; std::shared_ptr tauBlockTensor_; std::array, 2> eGammaTensor_, muonTensor_, hadronsTensor_, convTensor_, zeroOutputTensor_; diff --git a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py index bb82085f7315f..ba5cf632bd21c 100644 --- a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py +++ b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py @@ -644,7 +644,10 @@ def runTauID(self): rho = self.cms.InputTag('fixedGridRhoAll'), graph_file = self.cms.vstring(file_names), mem_mapped = self.cms.bool(False), - version = self.cms.uint32(self.getDeepTauVersion(file_names[0])[1]) + version = self.cms.uint32(self.getDeepTauVersion(file_names[0])[1]), + debug_level = self.cms.int32(0), + disable_dxy_pca = self.cms.bool(False) + ) self.processDeepProducer('deepTau2017v1', tauIDSources, workingPoints_) @@ -699,7 +702,8 @@ def runTauID(self): graph_file = self.cms.vstring(file_names), mem_mapped = self.cms.bool(True), version = self.cms.uint32(self.getDeepTauVersion(file_names[0])[1]), - debug_level = self.cms.int32(0) + debug_level = self.cms.int32(0), + disable_dxy_pca = self.cms.bool(False) ) From cef43ef6dca6b7b8e21913047ceaa024569a983a Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 29 Aug 2019 11:21:54 +0200 Subject: [PATCH 03/10] Add deepTau2017v2p1, i.e. v2 with disabled dxyPCA, to tauID tool --- .../RecoTau/python/tools/runTauIdMVA.py | 63 ++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py index ba5cf632bd21c..f955eb6b29949 100644 --- a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py +++ b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py @@ -9,12 +9,14 @@ class TauIDEmbedder(object): """class to rerun the tau seq and acces trainings from the database""" availableDiscriminators = [ "2017v1", "2017v2", "newDM2017v2", "dR0p32017v2", "2016v1", "newDM2016v1", - "deepTau2017v1", "deepTau2017v2", "DPFTau_2016_v0", "DPFTau_2016_v1", "againstEle2018" + "deepTau2017v1", "deepTau2017v2", "deepTau2017v2p1", + "DPFTau_2016_v0", "DPFTau_2016_v1", + "againstEle2018" ] def __init__(self, process, cms, debug = False, updatedTauName = "slimmedTausNewID", - toKeep = ["deepTau2017v2"], + toKeep = ["deepTau2017v2p1"], tauIdDiscrMVA_trainings_run2_2017 = { 'tauIdMVAIsoDBoldDMwLT2017' : "tauIdMVAIsoDBoldDMwLT2017", }, tauIdDiscrMVA_WPs_run2_2017 = { 'tauIdMVAIsoDBoldDMwLT2017' : { @@ -712,6 +714,63 @@ def runTauID(self): self.process.rerunMvaIsolationTask.add(self.process.deepTau2017v2) self.process.rerunMvaIsolationSequence += self.process.deepTau2017v2 + if "deepTau2017v2p1" in self.toKeep: + if self.debug: print ("Adding DeepTau IDs") + + workingPoints_ = { + "e": { + "VVVLoose": 0.0630386, + "VVLoose": 0.1686942, + "VLoose": 0.3628130, + "Loose": 0.6815435, + "Medium": 0.8847544, + "Tight": 0.9675541, + "VTight": 0.9859251, + "VVTight": 0.9928449, + }, + "mu": { + "VLoose": 0.1058354, + "Loose": 0.2158633, + "Medium": 0.5551894, + "Tight": 0.8754835, + }, + "jet": { + "VVVLoose": 0.2599605, + "VVLoose": 0.4249705, + "VLoose": 0.5983682, + "Loose": 0.7848675, + "Medium": 0.8834768, + "Tight": 0.9308689, + "VTight": 0.9573137, + "VVTight": 0.9733927, + }, + } + + file_names = [ + 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_core.pb', + 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_inner.pb', + 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_outer.pb', + ] + self.process.deepTau2017v2p1 = self.cms.EDProducer("DeepTauId", + electrons = self.cms.InputTag('slimmedElectrons'), + muons = self.cms.InputTag('slimmedMuons'), + taus = self.cms.InputTag('slimmedTaus'), + pfcands = self.cms.InputTag('packedPFCandidates'), + vertices = self.cms.InputTag('offlineSlimmedPrimaryVertices'), + rho = self.cms.InputTag('fixedGridRhoAll'), + graph_file = self.cms.vstring(file_names), + mem_mapped = self.cms.bool(True), + version = self.cms.uint32(self.getDeepTauVersion(file_names[0])[1]), + debug_level = self.cms.int32(0), + disable_dxy_pca = self.cms.bool(True) + + ) + + self.processDeepProducer('deepTau2017v2p1', tauIDSources, workingPoints_) + + self.process.rerunMvaIsolationTask.add(self.process.deepTau2017v2p1) + self.process.rerunMvaIsolationSequence += self.process.deepTau2017v2p1 + if "DPFTau_2016_v0" in self.toKeep: if self.debug: print ("Adding DPFTau isolation (v0)") From f3fdf98c30ccbbd495ec6e4deb879a99498eca24 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 29 Aug 2019 13:31:20 +0200 Subject: [PATCH 04/10] Run deepTau2017v2p1, i.e. v2 with disabled dxy_PCA, with new era run2_miniAOD_devel --- PhysicsTools/NanoAOD/python/taus_cff.py | 24 ++++++++++-- .../PatAlgos/python/slimming/miniAOD_tools.py | 39 +++++++++++++------ 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/taus_cff.py b/PhysicsTools/NanoAOD/python/taus_cff.py index 1394b62b53bdf..a2b28272de87a 100644 --- a/PhysicsTools/NanoAOD/python/taus_cff.py +++ b/PhysicsTools/NanoAOD/python/taus_cff.py @@ -15,6 +15,11 @@ cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2VSjet'))") ) +from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel +run2_miniAOD_devel.toModify(finalTaus, + cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2p1VSjet'))") +) + from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 @@ -131,6 +136,14 @@ def _tauId8WPMask(pattern,doc): idDeepTau2017v2VSmu = _tauId4WPMask("by%sDeepTau2017v2VSmu", doc="byDeepTau2017v2VSmu ID working points (deepTau2017v2)"), idDeepTau2017v2VSjet = _tauId8WPMask("by%sDeepTau2017v2VSjet", doc="byDeepTau2017v2VSjet ID working points (deepTau2017v2)"), ) +_deepTauVars2017v2p1 = cms.PSet( + rawDeepTau2017v2p1VSe = Var("tauID('byDeepTau2017v2p1VSeraw')", float, doc="byDeepTau2017v2p1VSe raw output discriminator (deepTau2017v2p1)", precision=10), + rawDeepTau2017v2p1VSmu = Var("tauID('byDeepTau2017v2p1VSmuraw')", float, doc="byDeepTau2017v2p1VSmu raw output discriminator (deepTau2017v2p1)", precision=10), + rawDeepTau2017v2p1VSjet = Var("tauID('byDeepTau2017v2p1VSjetraw')", float, doc="byDeepTau2017v2p1VSjet raw output discriminator (deepTau2017v2p1)", precision=10), + idDeepTau2017v2p1VSe = _tauId8WPMask("by%sDeepTau2017v2p1VSe", doc="byDeepTau2017v2p1VSe ID working points (deepTau2017v2p1)"), + idDeepTau2017v2p1VSmu = _tauId4WPMask("by%sDeepTau2017v2p1VSmu", doc="byDeepTau2017v2p1VSmu ID working points (deepTau2017v2p1)"), + idDeepTau2017v2p1VSjet = _tauId8WPMask("by%sDeepTau2017v2p1VSjet", doc="byDeepTau2017v2p1VSjet ID working points (deepTau2017v2p1)"), +) _variablesMiniV2 = cms.PSet( _tauVarsBase, @@ -138,7 +151,6 @@ def _tauId8WPMask(pattern,doc): _mvaIsoVars2015Reduced, _mvaIsoVars2017v1, _mvaIsoVars2017v2, - _deepTauVars2017v2 ) _variablesMiniV1 = _variablesMiniV2.clone() _variablesMiniV1.rawMVAoldDM = Var( "tauID('byIsolationMVArun2v1DBoldDMwLTraw')",float, doc="byIsolationMVArun2v1DBoldDMwLT raw output discriminator (2015)",precision=10) @@ -150,16 +162,16 @@ def _tauId8WPMask(pattern,doc): _mvaIsoVars2015 ) -tauTable.variables=_variablesMiniV2 +tauTable.variables = cms.PSet(_variablesMiniV2,_deepTauVars2017v2) for era in [run2_nanoAOD_94XMiniAODv1,]: era.toModify(tauTable, variables = _variablesMiniV1 ) run2_miniAOD_80XLegacy.toModify(tauTable, - variables = _variables80X + variables = _variables80X ) -for era in [run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94X2016,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_102Xv1]: +for era in [run2_nanoAOD_94X2016,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_102Xv1]: era.toModify(tauTable.variables, rawDeepTau2017v2VSe = None, rawDeepTau2017v2VSmu = None, @@ -168,6 +180,10 @@ def _tauId8WPMask(pattern,doc): idDeepTau2017v2VSmu = None, idDeepTau2017v2VSjet = None ) +run2_miniAOD_devel.toModify(tauTable, + variables = cms.PSet(_variablesMiniV2,_deepTauVars2017v2p1) +) + tauGenJets.GenParticles = cms.InputTag("prunedGenParticles") tauGenJets.includeNeutrinos = cms.bool(False) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index d55fa15a0c0af..8129aac42dfce 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -343,25 +343,42 @@ def miniAOD_customizeCommon(process): process.makePatTausTask, _makePatTausTaskWithRetrainedMVATauID ) #-- Adding DeepTauID - updatedTauName = 'slimmedTausDeepIDs' - noUpdatedTauName = 'slimmedTausNoDeepIDs' + # deepTau v2 + _updatedTauName = 'slimmedTausDeepIDsv2' + _noUpdatedTauName = 'slimmedTausNoDeepIDs' import RecoTauTag.RecoTau.tools.runTauIdMVA as tauIdConfig tauIdEmbedder = tauIdConfig.TauIDEmbedder( process, cms, debug = False, - updatedTauName = updatedTauName, + updatedTauName = _updatedTauName, toKeep = ['deepTau2017v2'] ) tauIdEmbedder.runTauID() - addToProcessAndTask(noUpdatedTauName, process.slimmedTaus.clone(),process,task) + addToProcessAndTask(_noUpdatedTauName, process.slimmedTaus.clone(),process,task) delattr(process, 'slimmedTaus') - process.deepTau2017v2.taus = noUpdatedTauName - from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel - run2_miniAOD_devel.toModify(process.deepTau2017v2, disable_dxy_pca=True) - process.slimmedTaus = getattr(process, updatedTauName).clone( - src = noUpdatedTauName + process.deepTau2017v2.taus = _noUpdatedTauName + process.slimmedTaus = getattr(process, _updatedTauName).clone( + src = _noUpdatedTauName + ) + process.deepTauIDTask = cms.Task(process.deepTau2017v2, process.slimmedTaus) + task.add(process.deepTauIDTask) + + # deepTau v2p1 + _updatedTauNameNew = 'slimmedTausDeepIDsv2p1' + tauIdEmbedderNew = tauIdConfig.TauIDEmbedder( + process, cms, debug = False, + updatedTauName = _updatedTauNameNew, + toKeep = ['deepTau2017v2p1'] ) - process.rerunMvaIsolationTask.add(process.slimmedTaus) - task.add(process.rerunMvaIsolationTask) + tauIdEmbedderNew.runTauID() + process.deepTau2017v2p1.taus = _noUpdatedTauName + deepTauIDTaskNew_ = cms.Task(process.deepTau2017v2p1,process.slimmedTaus) + + from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel + run2_miniAOD_devel.toReplaceWith(process.slimmedTaus, + getattr(process, _updatedTauNameNew).clone(src = _noUpdatedTauName)) + run2_miniAOD_devel.toReplaceWith(process.deepTauIDTask, + deepTauIDTaskNew_) + #-- Adding customization for 80X 2016 legacy reMiniAOD and 2018 heavy ions from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 From c1fb08a05dc3529a640f1964a64f2445e270cc40 Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 30 Aug 2019 10:46:28 +0200 Subject: [PATCH 05/10] Update example configuration --- RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py b/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py index 77d5a166117ec..b8cdfd2c46190 100644 --- a/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py +++ b/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py @@ -34,7 +34,7 @@ updatedTauName = updatedTauName, toKeep = [ "2017v2", "dR0p32017v2", "newDM2017v2", # "deepTau2017v1", - "deepTau2017v2", + "deepTau2017v2p1", # "DPFTau_2016_v0", # "DPFTau_2016_v1", "againstEle2018", From 5516834aa59f258412ca622f5a7db4bbeb930f49 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 2 Sep 2019 15:22:20 +0200 Subject: [PATCH 06/10] Monitor deepTau2017 v2p1 instead of deprecated v2 --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 3d02417cc8c34..be833315a1375 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -539,9 +539,9 @@ Plot1D('idMVAoldDM2017v1', 'idMVAoldDM2017v1', 128, -0.5, 127.5, 'IsolationMVArun2v1DBoldDMwLT ID working point (2017v1): bitmask 1 = VVLoose, 2 = VLoose, 4 = Loose, 8 = Medium, 16 = Tight, 32 = VTight, 64 = VVTight'), Plot1D('idMVAoldDM2017v2', 'idMVAoldDM2017v2', 128, -0.5, 127.5, 'IsolationMVArun2v1DBoldDMwLT ID working point (2017v2): bitmask 1 = VVLoose, 2 = VLoose, 4 = Loose, 8 = Medium, 16 = Tight, 32 = VTight, 64 = VVTight'), Plot1D('idMVAoldDMdR032017v2', 'idMVAoldDMdR032017v2', 128, -0.5, 127.5, 'IsolationMVArun2v1DBdR03oldDMwLT ID working point (217v2): bitmask 1 = VVLoose, 2 = VLoose, 4 = Loose, 8 = Medium, 16 = Tight, 32 = VTight, 64 = VVTight'), - Plot1D('idDeepTau2017v2VSe', 'idDeepTau2017v2VSe', 256, -0.5, 255.5, 'byDeepTau2017v2VSe ID working points (deepTau2017v2): bitmask 1 = VVVLoose, 2 = VVLoose, 4 = VLoose, 8 = Loose, 16 = Medium, 32 = Tight, 64 = VTight, 128 = VVTight'), - Plot1D('idDeepTau2017v2VSmu', 'idDeepTau2017v2VSmu', 16, -0.5, 15.5, 'byDeepTau2017v2VSmu ID working points (deepTau2017v2): bitmask 1 = VLoose, 2 = Loose, 4 = Medium, 8 = Tight'), - Plot1D('idDeepTau2017v2VSjet', 'idDeepTau2017v2VSjet', 256, -0.5, 255.5, 'byDeepTau2017v2VSjet ID working points (deepTau2017v2): bitmask 1 = VVVLoose, 2 = VVLoose, 4 = VLoose, 8 = Loose, 16 = Medium, 32 = Tight, 64 = VTight, 128 = VVTight'), + Plot1D('idDeepTau2017v2p1VSe', 'idDeepTau2017v2p1VSe', 256, -0.5, 255.5, 'byDeepTau2017v2p1VSe ID working points (deepTau2017v2p1): bitmask 1 = VVVLoose, 2 = VVLoose, 4 = VLoose, 8 = Loose, 16 = Medium, 32 = Tight, 64 = VTight, 128 = VVTight'), + Plot1D('idDeepTau2017v2p1VSmu', 'idDeepTau2017v2p1VSmu', 16, -0.5, 15.5, 'byDeepTau2017v2p1VSmu ID working points (deepTau2017v2p1): bitmask 1 = VLoose, 2 = Loose, 4 = Medium, 8 = Tight'), + Plot1D('idDeepTau2017v2p1VSjet', 'idDeepTau2017v2p1VSjet', 256, -0.5, 255.5, 'byDeepTau2017v2p1VSjet ID working points (deepTau2017v2p1): bitmask 1 = VVVLoose, 2 = VVLoose, 4 = VLoose, 8 = Loose, 16 = Medium, 32 = Tight, 64 = VTight, 128 = VVTight'), NoPlot('jetIdx'), Plot1D('leadTkDeltaEta', 'leadTkDeltaEta', 20, -0.1, 0.1, 'eta of the leading track, minus tau eta'), Plot1D('leadTkDeltaPhi', 'leadTkDeltaPhi', 20, -0.1, 0.1, 'phi of the leading track, minus tau phi'), @@ -563,9 +563,9 @@ Plot1D('rawMVAoldDM2017v1', 'rawMVAoldDM2017v1', 20, -1, 1, 'byIsolationMVArun2v1DBoldDMwLT raw output discriminator (2017v1)'), Plot1D('rawMVAoldDM2017v2', 'rawMVAoldDM2017v2', 20, -1, 1, 'byIsolationMVArun2v1DBoldDMwLT raw output discriminator (2017v2)'), Plot1D('rawMVAoldDMdR032017v2', 'rawMVAoldDMdR032017v2', 20, -1, 1, 'byIsolationMVArun2v1DBdR03oldDMwLT raw output discriminator (2017v2)'), - Plot1D('rawDeepTau2017v2VSe', 'rawDeepTau2017v2VSe', 20, 0, 1, 'byDeepTau2017v2VSe raw output discriminator (deepTau2017v2)'), - Plot1D('rawDeepTau2017v2VSmu', 'rawDeepTau2017v2VSmu', 20, 0, 1, 'byDeepTau2017v2VSmu raw output discriminator (deepTau2017v2)'), - Plot1D('rawDeepTau2017v2VSjet', 'rawDeepTau2017v2VSjet', 20, 0, 1, 'byDeepTau2017v2VSjet raw output discriminator (deepTau2017v2)'), + Plot1D('rawDeepTau2017v2p1VSe', 'rawDeepTau2017v2p1VSe', 20, 0, 1, 'byDeepTau2017v2p1VSe raw output discriminator (deepTau2017v2p1)'), + Plot1D('rawDeepTau2017v2p1VSmu', 'rawDeepTau2017v2p1VSmu', 20, 0, 1, 'byDeepTau2017v2p1VSmu raw output discriminator (deepTau2017v2p1)'), + Plot1D('rawDeepTau2017v2p1VSjet', 'rawDeepTau2017v2p1VSjet', 20, 0, 1, 'byDeepTau2017v2p1VSjet raw output discriminator (deepTau2017v2p1)'), ) ), TkMET = cms.PSet( From dc037f14c3ff2379ae869db02b6624e8511a83ff Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 10 Sep 2019 16:06:18 +0200 Subject: [PATCH 07/10] New era modifiers for tauID Run2 UL processing --- .../Eras/python/Modifier_run2_tau_ul_2016_cff.py | 3 +++ .../Eras/python/Modifier_run2_tau_ul_2018_cff.py | 3 +++ PhysicsTools/NanoAOD/python/taus_cff.py | 16 ++++++++++------ .../PatAlgos/python/slimming/miniAOD_tools.py | 11 +++++++---- 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 Configuration/Eras/python/Modifier_run2_tau_ul_2016_cff.py create mode 100644 Configuration/Eras/python/Modifier_run2_tau_ul_2018_cff.py diff --git a/Configuration/Eras/python/Modifier_run2_tau_ul_2016_cff.py b/Configuration/Eras/python/Modifier_run2_tau_ul_2016_cff.py new file mode 100644 index 0000000000000..ab6b41a6f7292 --- /dev/null +++ b/Configuration/Eras/python/Modifier_run2_tau_ul_2016_cff.py @@ -0,0 +1,3 @@ +import FWCore.ParameterSet.Config as cms + +run2_tau_ul_2016 = cms.Modifier() diff --git a/Configuration/Eras/python/Modifier_run2_tau_ul_2018_cff.py b/Configuration/Eras/python/Modifier_run2_tau_ul_2018_cff.py new file mode 100644 index 0000000000000..1c6e930fee061 --- /dev/null +++ b/Configuration/Eras/python/Modifier_run2_tau_ul_2018_cff.py @@ -0,0 +1,3 @@ +import FWCore.ParameterSet.Config as cms + +run2_tau_ul_2018 = cms.Modifier() diff --git a/PhysicsTools/NanoAOD/python/taus_cff.py b/PhysicsTools/NanoAOD/python/taus_cff.py index a2b28272de87a..674e4dd086af3 100644 --- a/PhysicsTools/NanoAOD/python/taus_cff.py +++ b/PhysicsTools/NanoAOD/python/taus_cff.py @@ -16,9 +16,12 @@ ) from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel -run2_miniAOD_devel.toModify(finalTaus, - cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2p1VSjet'))") -) +from Configuration.Eras.Modifier_run2_tau_ul_2016_cff import run2_tau_ul_2016 +from Configuration.Eras.Modifier_run2_tau_ul_2018_cff import run2_tau_ul_2018 +for era in [run2_miniAOD_devel,run2_tau_ul_2016,run2_tau_ul_2018]: + era.toModify(finalTaus, + cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2p1VSjet'))") + ) from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 @@ -180,9 +183,10 @@ def _tauId8WPMask(pattern,doc): idDeepTau2017v2VSmu = None, idDeepTau2017v2VSjet = None ) -run2_miniAOD_devel.toModify(tauTable, - variables = cms.PSet(_variablesMiniV2,_deepTauVars2017v2p1) -) +for era in [run2_miniAOD_devel,run2_tau_ul_2016,run2_tau_ul_2018]: + era.toModify(tauTable, + variables = cms.PSet(_variablesMiniV2,_deepTauVars2017v2p1) + ) tauGenJets.GenParticles = cms.InputTag("prunedGenParticles") diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 8129aac42dfce..f755cfa684d70 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -374,10 +374,13 @@ def miniAOD_customizeCommon(process): deepTauIDTaskNew_ = cms.Task(process.deepTau2017v2p1,process.slimmedTaus) from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel - run2_miniAOD_devel.toReplaceWith(process.slimmedTaus, - getattr(process, _updatedTauNameNew).clone(src = _noUpdatedTauName)) - run2_miniAOD_devel.toReplaceWith(process.deepTauIDTask, - deepTauIDTaskNew_) + from Configuration.Eras.Modifier_run2_tau_ul_2016_cff import run2_tau_ul_2016 + from Configuration.Eras.Modifier_run2_tau_ul_2018_cff import run2_tau_ul_2018 + for era in [run2_miniAOD_devel,run2_tau_ul_2016,run2_tau_ul_2018]: + era.toReplaceWith(process.slimmedTaus, + getattr(process, _updatedTauNameNew).clone(src = _noUpdatedTauName)) + era.toReplaceWith(process.deepTauIDTask, + deepTauIDTaskNew_) #-- Adding customization for 80X 2016 legacy reMiniAOD and 2018 heavy ions from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy From dbf014376926a84878e4632473e284a7315e7de2 Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 10 Sep 2019 16:38:02 +0200 Subject: [PATCH 08/10] New era modifiers for tauID Run2 UL processing in master cff --- Configuration/StandardSequences/python/Eras.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index c13ab308e3eff..6efd32e96f930 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -63,6 +63,7 @@ def __init__(self): 'tracker_apv_vfp30_2016', 'pf_badHcalMitigation', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X', 'run2_nanoAOD_94XMiniAODv1', 'run2_nanoAOD_94XMiniAODv2', 'run2_nanoAOD_94X2016', 'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', + 'run2_tau_ul_2016', 'run2_tau_ul_2018', 'hcalHardcodeConditions', 'hcalSkipPacker', 'run2_HLTconditions_2016','run2_HLTconditions_2017','run2_HLTconditions_2018', 'bParking'] From 6081ba3807bc299e735a3d1be216916c59e66a37 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 11 Sep 2019 10:40:37 +0200 Subject: [PATCH 09/10] New era modifiers for tauID Run2 UL processing chained for 2016 and 2018 eras --- Configuration/Eras/python/Era_Run2_2016_cff.py | 3 ++- Configuration/Eras/python/Era_Run2_2017_cff.py | 3 ++- Configuration/Eras/python/Era_Run2_2018_cff.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Configuration/Eras/python/Era_Run2_2016_cff.py b/Configuration/Eras/python/Era_Run2_2016_cff.py index e9a93481e9744..73683303a83eb 100644 --- a/Configuration/Eras/python/Era_Run2_2016_cff.py +++ b/Configuration/Eras/python/Era_Run2_2016_cff.py @@ -7,8 +7,9 @@ from Configuration.Eras.Modifier_run2_HLTconditions_2016_cff import run2_HLTconditions_2016 from Configuration.Eras.Modifier_run2_muon_2016_cff import run2_muon_2016 from Configuration.Eras.Modifier_run2_egamma_2016_cff import run2_egamma_2016 +from Configuration.Eras.Modifier_run2_tau_ul_2016_cff import run2_tau_ul_2016 from Configuration.Eras.Modifier_run2_L1prefiring_cff import run2_L1prefiring Run2_2016 = cms.ModifierChain(run2_common, run2_25ns_specific, - stage2L1Trigger, ctpps_2016, run2_HLTconditions_2016, run2_muon_2016, run2_egamma_2016, run2_L1prefiring) + stage2L1Trigger, ctpps_2016, run2_HLTconditions_2016, run2_muon_2016, run2_egamma_2016, run2_tau_ul_2016, run2_L1prefiring) diff --git a/Configuration/Eras/python/Era_Run2_2017_cff.py b/Configuration/Eras/python/Era_Run2_2017_cff.py index 9ab6b701a319f..e0d7a133ccf78 100644 --- a/Configuration/Eras/python/Era_Run2_2017_cff.py +++ b/Configuration/Eras/python/Era_Run2_2017_cff.py @@ -16,9 +16,10 @@ from Configuration.Eras.Modifier_run2_muon_2016_cff import run2_muon_2016 from Configuration.Eras.Modifier_run2_egamma_2017_cff import run2_egamma_2017 from Configuration.Eras.Modifier_run2_egamma_2016_cff import run2_egamma_2016 +from Configuration.Eras.Modifier_run2_tau_ul_2016_cff import run2_tau_ul_2016 from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 -Run2_2017 = cms.ModifierChain(Run2_2016.copyAndExclude([run2_muon_2016, run2_HLTconditions_2016,run2_egamma_2016]), +Run2_2017 = cms.ModifierChain(Run2_2016.copyAndExclude([run2_muon_2016, run2_HLTconditions_2016,run2_egamma_2016,run2_tau_ul_2016]), phase1Pixel, run2_ECAL_2017, run2_HF_2017, run2_HCAL_2017, run2_HE_2017, run2_HEPlan1_2017, trackingPhase1, run2_GEM_2017, stage2L1Trigger_2017, run2_HLTconditions_2017, run2_muon_2017,run2_egamma_2017, ctpps_2017) diff --git a/Configuration/Eras/python/Era_Run2_2018_cff.py b/Configuration/Eras/python/Era_Run2_2018_cff.py index 9d5b9cbe74d48..59a6e6a01d712 100644 --- a/Configuration/Eras/python/Era_Run2_2018_cff.py +++ b/Configuration/Eras/python/Era_Run2_2018_cff.py @@ -14,10 +14,11 @@ from Configuration.Eras.Modifier_run2_muon_2017_cff import run2_muon_2017 from Configuration.Eras.Modifier_run2_egamma_2018_cff import run2_egamma_2018 from Configuration.Eras.Modifier_run2_egamma_2017_cff import run2_egamma_2017 +from Configuration.Eras.Modifier_run2_tau_ul_2018_cff import run2_tau_ul_2018 from Configuration.Eras.Modifier_run2_L1prefiring_cff import run2_L1prefiring from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 Run2_2018 = cms.ModifierChain(Run2_2017.copyAndExclude([run2_HEPlan1_2017, run2_muon_2017, run2_L1prefiring, run2_HLTconditions_2017, run2_egamma_2017, ctpps_2017]), run2_CSC_2018, run2_HCAL_2018, run2_HB_2018, run2_HE_2018,run2_DT_2018, run2_SiPixel_2018, -run2_HLTconditions_2018, run2_muon_2018, run2_egamma_2018, ctpps_2018) +run2_HLTconditions_2018, run2_muon_2018, run2_egamma_2018, run2_tau_ul_2018, ctpps_2018) From 633dfb4a73f82c32f720aa4ff63b3e65707da195 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 12 Sep 2019 14:21:37 +0200 Subject: [PATCH 10/10] New era modifiers for tauID Run2 UL processing unchained from Run3 and Phase2 eras --- Configuration/Eras/python/Era_Run3_cff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Configuration/Eras/python/Era_Run3_cff.py b/Configuration/Eras/python/Era_Run3_cff.py index 1ea38535bdb6b..e3c70e35cd8e4 100644 --- a/Configuration/Eras/python/Era_Run3_cff.py +++ b/Configuration/Eras/python/Era_Run3_cff.py @@ -6,6 +6,7 @@ from Configuration.Eras.Modifier_run3_HB_cff import run3_HB from Configuration.Eras.Modifier_run2_GEM_2017_cff import run2_GEM_2017 from Configuration.Eras.Modifier_run2_egamma_2018_cff import run2_egamma_2018 +from Configuration.Eras.Modifier_run2_tau_ul_2018_cff import run2_tau_ul_2018 -Run3 = cms.ModifierChain(Run2_2018.copyAndExclude([run2_GEM_2017,run2_egamma_2018]), run3_common, run3_GEM, run3_HB) +Run3 = cms.ModifierChain(Run2_2018.copyAndExclude([run2_GEM_2017,run2_egamma_2018,run2_tau_ul_2018]), run3_common, run3_GEM, run3_HB)