From 53dea3a6463bf61998d21da1164e6ba10d480bc2 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Tue, 13 Aug 2019 08:09:19 +0200 Subject: [PATCH 01/12] Update the ADG database host names used by ConfDB --- .../python/Tools/confdbOfflineConverter.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py b/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py index 4b326d9bb7ebf..740e6b9fc465b 100644 --- a/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py +++ b/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py @@ -27,15 +27,15 @@ class OfflineConverter: databases = {} databases['v1'] = {} - databases['v1']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hltdev_reader', '-s', 'convertme!' ) + databases['v1']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hltdev_reader', '-s', 'convertme!' ) databases['v1']['hltdev'] = databases['v1']['offline'] # for backwards compatibility - databases['v1']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_r', '-s', 'convertme!' ) - databases['v1']['adg'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gui_r', '-s', 'convertme!' ) + databases['v1']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_r', '-s', 'convertme!' ) + databases['v1']['adg'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gui_r', '-s', 'convertme!' ) databases['v1']['orcoff'] = databases['v1']['adg'] # for backwards compatibility databases['v2'] = {} - databases['v2']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) - databases['v2']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) - databases['v2']['adg'] = ( '-t', 'oracle', '-h', 'cmsonradg1-s.cern.ch', '-d', 'cms_orcon_adg.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) + databases['v2']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) + databases['v2']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) + databases['v2']['adg'] = ( '-t', 'oracle', '-h', 'cmsonr1-adg1-s.cern.ch', '-d', 'cms_orcon_adg.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) @staticmethod From c26c281bd0181eed74fd66b42b42e3189f4ef962 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Tue, 13 Aug 2019 08:37:12 +0200 Subject: [PATCH 02/12] Fix case, if it ever becomes relevant --- .../python/Tools/confdbOfflineConverter.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py b/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py index 740e6b9fc465b..1360ce529f321 100644 --- a/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py +++ b/HLTrigger/Configuration/python/Tools/confdbOfflineConverter.py @@ -27,15 +27,15 @@ class OfflineConverter: databases = {} databases['v1'] = {} - databases['v1']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hltdev_reader', '-s', 'convertme!' ) + databases['v1']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hltdev_reader', '-s', 'ConvertMe!' ) databases['v1']['hltdev'] = databases['v1']['offline'] # for backwards compatibility - databases['v1']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_r', '-s', 'convertme!' ) - databases['v1']['adg'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gui_r', '-s', 'convertme!' ) + databases['v1']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_r', '-s', 'ConvertMe!' ) + databases['v1']['adg'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gui_r', '-s', 'ConvertMe!' ) databases['v1']['orcoff'] = databases['v1']['adg'] # for backwards compatibility databases['v2'] = {} - databases['v2']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) - databases['v2']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) - databases['v2']['adg'] = ( '-t', 'oracle', '-h', 'cmsonr1-adg1-s.cern.ch', '-d', 'cms_orcon_adg.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'convertme!' ) + databases['v2']['offline'] = ( '-t', 'oracle', '-h', 'cmsr1-s.cern.ch', '-d', 'cms_cond.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'ConvertMe!' ) + databases['v2']['online'] = ( '-t', 'oracle', '-h', 'cmsonr1-s.cms', '-d', 'cms_rcms.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'ConvertMe!' ) + databases['v2']['adg'] = ( '-t', 'oracle', '-h', 'cmsonr1-adg1-s.cern.ch', '-d', 'cms_orcon_adg.cern.ch', '-u', 'cms_hlt_gdr_r', '-s', 'ConvertMe!' ) @staticmethod From cc8e328ca70b97c63d769b7f6a4ba64fc0218296 Mon Sep 17 00:00:00 2001 From: Konstantin Androsov Date: Mon, 26 Aug 2019 17:50:43 +0200 Subject: [PATCH 03/12] Disabled PCA inputs for deepTau v2. --- RecoTauTag/RecoTau/plugins/DeepTauId.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/DeepTauId.cc b/RecoTauTag/RecoTau/plugins/DeepTauId.cc index c88b4d0dbd483..4eb979a2719ca 100644 --- a/RecoTauTag/RecoTau/plugins/DeepTauId.cc +++ b/RecoTauTag/RecoTau/plugins/DeepTauId.cc @@ -907,9 +907,9 @@ 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); + 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 783c595378ea2f29b14c060a2112d17b5124850f Mon Sep 17 00:00:00 2001 From: swozniewski Date: Tue, 27 Aug 2019 11:51:57 +0200 Subject: [PATCH 04/12] apply code formatting and add some explanation --- 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 4eb979a2719ca..00a030090aec1 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) = 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); + // 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 bf943fc441efc92c89754abf64e873cf87926699 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 29 Aug 2019 16:09:04 +0200 Subject: [PATCH 05/12] Control disabling dxy_PCA by a parameter --- RecoTauTag/RecoTau/plugins/DeepTauId.cc | 17 +++++++++++++---- RecoTauTag/RecoTau/python/tools/runTauIdMVA.py | 7 +++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/DeepTauId.cc b/RecoTauTag/RecoTau/plugins/DeepTauId.cc index 00a030090aec1..338998b3b9e85 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,9 +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; @@ -1691,6 +1699,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 0dcaba1a59a10..a73696c38a11c 100644 --- a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py +++ b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py @@ -650,7 +650,9 @@ 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_) @@ -705,7 +707,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 64653a00ec8be2bf465f6fee28728c4785d38bdf Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 29 Aug 2019 16:15:04 +0200 Subject: [PATCH 06/12] 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 a73696c38a11c..4b30bdcae6acf 100644 --- a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py +++ b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py @@ -7,12 +7,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' : { @@ -717,6 +719,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 0c681043eabce0e39cf24b06a966e42b457e7b9b Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 30 Aug 2019 10:48:49 +0200 Subject: [PATCH 07/12] 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 f8f98f78d2665..19156fa481db1 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 47bc51f3c01f8a837efdeede0ef6304129ba37e0 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 27 Jun 2019 15:21:31 +0200 Subject: [PATCH 08/12] Add DeepTau2017v2 variables to the tau table --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 6 +++++ PhysicsTools/NanoAOD/python/taus_cff.py | 31 ++++++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index cb1b33911d194..3d02417cc8c34 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -539,6 +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'), 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'), @@ -560,6 +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)'), ) ), TkMET = cms.PSet( diff --git a/PhysicsTools/NanoAOD/python/taus_cff.py b/PhysicsTools/NanoAOD/python/taus_cff.py index 56edb26f15717..c0b0dcf1cefb1 100644 --- a/PhysicsTools/NanoAOD/python/taus_cff.py +++ b/PhysicsTools/NanoAOD/python/taus_cff.py @@ -12,9 +12,13 @@ finalTaus = cms.EDFilter("PATTauRefSelector", src = cms.InputTag("slimmedTausUpdated"), - cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2'))") + 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'))") ) +for era in [eras.run2_nanoAOD_94X2016,eras.run2_nanoAOD_94XMiniAODv2,eras.run2_nanoAOD_102Xv1]: + 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'))") + ) for era in [eras.run2_nanoAOD_94XMiniAODv1,]: era.toModify(finalTaus, cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v1') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2'))") @@ -32,12 +36,16 @@ def _tauId2WPMask(pattern,doc): return _tauIdWPMask(pattern,choices=("Loose","Tight"),doc=doc) def _tauId3WPMask(pattern,doc): return _tauIdWPMask(pattern,choices=("Loose","Medium","Tight"),doc=doc) +def _tauId4WPMask(pattern,doc): + return _tauIdWPMask(pattern, choices=("VLoose", "Loose", "Medium", "Tight"), doc=doc) def _tauId5WPMask(pattern,doc): return _tauIdWPMask(pattern,choices=("VLoose","Loose","Medium","Tight","VTight"),doc=doc) def _tauId6WPMask(pattern,doc): return _tauIdWPMask(pattern,choices=("VLoose","Loose","Medium","Tight","VTight","VVTight"),doc=doc) def _tauId7WPMask(pattern,doc): return _tauIdWPMask(pattern,choices=("VVLoose","VLoose","Loose","Medium","Tight","VTight","VVTight"),doc=doc) +def _tauId8WPMask(pattern,doc): + return _tauIdWPMask(pattern,choices=("VVVLoose","VVLoose","VLoose","Loose","Medium","Tight","VTight","VVTight"),doc=doc) tauTable = cms.EDProducer("SimpleCandidateFlatTableProducer", src = cms.InputTag("linkedObjects","taus"), @@ -110,13 +118,22 @@ def _tauId7WPMask(pattern,doc): rawAntiEleCat2018 = Var("tauID('againstElectronMVA6category2018')", int, doc="Anti-electron MVA discriminator V6 category (2018)"), idAntiEle2018 = _tauId5WPMask("againstElectron%sMVA62018", doc= "Anti-electron MVA discriminator V6 (2018)"), ) +_deepTauVars2017v2 = cms.PSet( + rawDeepTau2017v2VSe = Var("tauID('byDeepTau2017v2VSeraw')", float, doc="byDeepTau2017v2VSe raw output discriminator (deepTau2017v2)", precision=10), + rawDeepTau2017v2VSmu = Var("tauID('byDeepTau2017v2VSmuraw')", float, doc="byDeepTau2017v2VSmu raw output discriminator (deepTau2017v2)", precision=10), + rawDeepTau2017v2VSjet = Var("tauID('byDeepTau2017v2VSjetraw')", float, doc="byDeepTau2017v2VSjet raw output discriminator (deepTau2017v2)", precision=10), + idDeepTau2017v2VSe = _tauId8WPMask("by%sDeepTau2017v2VSe", doc="byDeepTau2017v2VSe ID working points (deepTau2017v2)"), + idDeepTau2017v2VSmu = _tauId4WPMask("by%sDeepTau2017v2VSmu", doc="byDeepTau2017v2VSmu ID working points (deepTau2017v2)"), + idDeepTau2017v2VSjet = _tauId8WPMask("by%sDeepTau2017v2VSjet", doc="byDeepTau2017v2VSjet ID working points (deepTau2017v2)"), +) _variablesMiniV2 = cms.PSet( _tauVarsBase, _mvaAntiEVars2018, _mvaIsoVars2015Reduced, _mvaIsoVars2017v1, - _mvaIsoVars2017v2 + _mvaIsoVars2017v2, + _deepTauVars2017v2 ) _variablesMiniV1 = _variablesMiniV2.clone() _variablesMiniV1.rawMVAoldDM = Var( "tauID('byIsolationMVArun2v1DBoldDMwLTraw')",float, doc="byIsolationMVArun2v1DBoldDMwLT raw output discriminator (2015)",precision=10) @@ -137,6 +154,16 @@ def _tauId7WPMask(pattern,doc): eras.run2_miniAOD_80XLegacy.toModify(tauTable, variables = _variables80X ) +for era in [eras.run2_nanoAOD_94XMiniAODv1,eras.run2_nanoAOD_94X2016,eras.run2_nanoAOD_94XMiniAODv2,eras.run2_nanoAOD_102Xv1]: + era.toModify(tauTable.variables, + rawDeepTau2017v2VSe = None, + rawDeepTau2017v2VSmu = None, + rawDeepTau2017v2VSjet = None, + idDeepTau2017v2VSe = None, + idDeepTau2017v2VSmu = None, + idDeepTau2017v2VSjet = None + ) + tauGenJets.GenParticles = cms.InputTag("prunedGenParticles") tauGenJets.includeNeutrinos = cms.bool(False) From fb3f0131f611da1ae38d34bf1fae5b84105d5800 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 27 Jun 2019 15:51:12 +0200 Subject: [PATCH 09/12] Allow adding to existing tauEmbedder --- RecoTauTag/RecoTau/python/tools/runTauIdMVA.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py index 4b30bdcae6acf..c38d0bafe257a 100644 --- a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py +++ b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py @@ -1112,11 +1112,17 @@ def runTauID(self): ## if self.debug: print 'Embedding new TauIDs into \"'+self.updatedTauName+'\"' - embedID = self.cms.EDProducer("PATTauIDEmbedder", - src = self.cms.InputTag('slimmedTaus'), - tauIDSources = tauIDSources - ) - setattr(self.process, self.updatedTauName, embedID) + if not hasattr(self.process, self.updatedTauName): + embedID = self.cms.EDProducer("PATTauIDEmbedder", + src = self.cms.InputTag('slimmedTaus'), + tauIDSources = tauIDSources + ) + setattr(self.process, self.updatedTauName, embedID) + else: #assume same type + tauIDSources = self.cms.PSet( + getattr(self.process, self.updatedTauName).tauIDSources, + tauIDSources) + getattr(self.process, self.updatedTauName).tauIDSources = tauIDSources def processDeepProducer(self, producer_name, tauIDSources, workingPoints_): From 4b0ce4cae7280560be996490b0156a979f5ee213 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 27 Jun 2019 16:32:54 +0200 Subject: [PATCH 10/12] Add DeepTauID to nano sequene --- PhysicsTools/NanoAOD/python/nano_cff.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/PhysicsTools/NanoAOD/python/nano_cff.py b/PhysicsTools/NanoAOD/python/nano_cff.py index fcc8ee00b5214..868caac0278a8 100644 --- a/PhysicsTools/NanoAOD/python/nano_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_cff.py @@ -137,6 +137,17 @@ modifier.toModify(extraFlagsTable, variables= cms.PSet()) modifier.toModify(extraFlagsTable, variables = dict(Flag_ecalBadCalibFilterV2 = ExtVar(cms.InputTag("ecalBadCalibFilterNanoTagger"), bool, doc = "Bad ECAL calib flag (updated xtal list)"))) +# modifier which adds new tauIDs (currently only deepTauId2017v2 is being added) +import RecoTauTag.RecoTau.tools.runTauIdMVA as tauIdConfig +def nanoAOD_addTauIds(process): + updatedTauName = "slimmedTausUpdated" + tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug = False, updatedTauName = updatedTauName, + toKeep = [ "deepTau2017v2" ]) + tauIdEmbedder.runTauID() + process.patTauMVAIDsSeq.insert(process.patTauMVAIDsSeq.index(getattr(process, updatedTauName)), + process.rerunMvaIsolationSequence) + return process + from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection def nanoAOD_addDeepInfo(process,addDeepBTag,addDeepFlavour): _btagDiscriminators=[] @@ -294,6 +305,16 @@ def nanoAOD_customizeCommon(process): addDeepBoostedJet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBoostedJet_switch, addDeepDoubleX=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleX_switch, jecPayload=nanoAOD_addDeepInfoAK8_switch.jecPayload) + + _unmodifiedPatTauMVAIDsSeq = process.patTauMVAIDsSeq.copy() + _unmodifiedTauIDSources = process.slimmedTausUpdated.tauIDSources.clone() + process = nanoAOD_addTauIds(process) + for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1: + modifier.toReplaceWith(process.patTauMVAIDsSeq, + _unmodifiedPatTauMVAIDsSeq) + modifier.toReplaceWith(process.slimmedTausUpdated.tauIDSources, + _unmodifiedTauIDSources) + return process def nanoAOD_customizeData(process): From 163ed9801ead6da225c7f209b33d66b0b36042a2 Mon Sep 17 00:00:00 2001 From: peruzzim Date: Fri, 23 Aug 2019 10:53:51 +0200 Subject: [PATCH 11/12] Remove DeepTauV2 from default nanoAOD DQM config --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 3d02417cc8c34..cb1b33911d194 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -539,9 +539,6 @@ 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'), 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 +560,6 @@ 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)'), ) ), TkMET = cms.PSet( From bafdce140533b1c7bca5ec010c81679a0d5e4185 Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 29 Aug 2019 17:05:22 +0200 Subject: [PATCH 12/12] Run deepTau2017v2p1, i.e. v2 with disabled dxy_PCA, instead of v2 --- PhysicsTools/NanoAOD/python/nano_cff.py | 4 +-- PhysicsTools/NanoAOD/python/taus_cff.py | 33 ++++++++++++------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nano_cff.py b/PhysicsTools/NanoAOD/python/nano_cff.py index 868caac0278a8..0101a1e417d6e 100644 --- a/PhysicsTools/NanoAOD/python/nano_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_cff.py @@ -137,12 +137,12 @@ modifier.toModify(extraFlagsTable, variables= cms.PSet()) modifier.toModify(extraFlagsTable, variables = dict(Flag_ecalBadCalibFilterV2 = ExtVar(cms.InputTag("ecalBadCalibFilterNanoTagger"), bool, doc = "Bad ECAL calib flag (updated xtal list)"))) -# modifier which adds new tauIDs (currently only deepTauId2017v2 is being added) +# modifier which adds new tauIDs (currently only deepTauId2017v2p1 is being added) import RecoTauTag.RecoTau.tools.runTauIdMVA as tauIdConfig def nanoAOD_addTauIds(process): updatedTauName = "slimmedTausUpdated" tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug = False, updatedTauName = updatedTauName, - toKeep = [ "deepTau2017v2" ]) + toKeep = [ "deepTau2017v2p1" ]) tauIdEmbedder.runTauID() process.patTauMVAIDsSeq.insert(process.patTauMVAIDsSeq.index(getattr(process, updatedTauName)), process.rerunMvaIsolationSequence) diff --git a/PhysicsTools/NanoAOD/python/taus_cff.py b/PhysicsTools/NanoAOD/python/taus_cff.py index c0b0dcf1cefb1..3042c8656d7c3 100644 --- a/PhysicsTools/NanoAOD/python/taus_cff.py +++ b/PhysicsTools/NanoAOD/python/taus_cff.py @@ -12,7 +12,7 @@ finalTaus = cms.EDFilter("PATTauRefSelector", src = cms.InputTag("slimmedTausUpdated"), - 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'))") + 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'))") ) for era in [eras.run2_nanoAOD_94X2016,eras.run2_nanoAOD_94XMiniAODv2,eras.run2_nanoAOD_102Xv1]: @@ -118,13 +118,13 @@ def _tauId8WPMask(pattern,doc): rawAntiEleCat2018 = Var("tauID('againstElectronMVA6category2018')", int, doc="Anti-electron MVA discriminator V6 category (2018)"), idAntiEle2018 = _tauId5WPMask("againstElectron%sMVA62018", doc= "Anti-electron MVA discriminator V6 (2018)"), ) -_deepTauVars2017v2 = cms.PSet( - rawDeepTau2017v2VSe = Var("tauID('byDeepTau2017v2VSeraw')", float, doc="byDeepTau2017v2VSe raw output discriminator (deepTau2017v2)", precision=10), - rawDeepTau2017v2VSmu = Var("tauID('byDeepTau2017v2VSmuraw')", float, doc="byDeepTau2017v2VSmu raw output discriminator (deepTau2017v2)", precision=10), - rawDeepTau2017v2VSjet = Var("tauID('byDeepTau2017v2VSjetraw')", float, doc="byDeepTau2017v2VSjet raw output discriminator (deepTau2017v2)", precision=10), - idDeepTau2017v2VSe = _tauId8WPMask("by%sDeepTau2017v2VSe", doc="byDeepTau2017v2VSe ID working points (deepTau2017v2)"), - 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( @@ -133,7 +133,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) @@ -145,7 +144,7 @@ def _tauId8WPMask(pattern,doc): _mvaIsoVars2015 ) -tauTable.variables=_variablesMiniV2 +tauTable.variables = cms.PSet(_variablesMiniV2,_deepTauVars2017v2p1) for era in [eras.run2_nanoAOD_94XMiniAODv1,]: era.toModify(tauTable, @@ -154,14 +153,14 @@ def _tauId8WPMask(pattern,doc): eras.run2_miniAOD_80XLegacy.toModify(tauTable, variables = _variables80X ) -for era in [eras.run2_nanoAOD_94XMiniAODv1,eras.run2_nanoAOD_94X2016,eras.run2_nanoAOD_94XMiniAODv2,eras.run2_nanoAOD_102Xv1]: +for era in [eras.run2_nanoAOD_94X2016,eras.run2_nanoAOD_94XMiniAODv2,eras.run2_nanoAOD_102Xv1]: era.toModify(tauTable.variables, - rawDeepTau2017v2VSe = None, - rawDeepTau2017v2VSmu = None, - rawDeepTau2017v2VSjet = None, - idDeepTau2017v2VSe = None, - idDeepTau2017v2VSmu = None, - idDeepTau2017v2VSjet = None + rawDeepTau2017v2p1VSe = None, + rawDeepTau2017v2p1VSmu = None, + rawDeepTau2017v2p1VSjet = None, + idDeepTau2017v2p1VSe = None, + idDeepTau2017v2p1VSmu = None, + idDeepTau2017v2p1VSjet = None ) tauGenJets.GenParticles = cms.InputTag("prunedGenParticles")