diff --git a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py index 3c1594a0e3dd2..4bb678b05dd77 100644 --- a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py +++ b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py @@ -188,18 +188,17 @@ def runTauID(self): wp_to_eff_match = { "VVLoose" : "WPEff95", - "VLoose" : "WPEff90", "Loose" : "WPEff80", "Medium" : "WPEff70", "Tight" : "WPEff60", "VTight" : "WPEff50", "VVTight" : "WPEff40" } - for wp in ["VVLoose","Loose","Medium","Tight","VTight","VVTight"]: + for wp,wpEff in wp_to_eff_match.items(): _aWP = "rerunDiscriminationByIsolationOldDMMVArun2017v1"+wp+self.postfix setattr(self.process,_aWP,_byIsolationOldDMMVArun2017v1VLooseProd.clone()) _aWPProd = getattr(self.process,_aWP) - _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_"+wp_to_eff_match[wp]) + _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_"+wpEff) _rerunIsolationOldDMMVArun2017v1Task.add(_aWPProd) setattr(tauIDSources,"by"+wp+"IsolationMVArun2017v1DBoldDMwLT2017",self.cms.InputTag(_aWP)) @@ -265,18 +264,17 @@ def runTauID(self): wp_to_eff_match = { "VVLoose" : "WPEff95", - "VLoose" : "WPEff90", "Loose" : "WPEff80", "Medium" : "WPEff70", "Tight" : "WPEff60", "VTight" : "WPEff50", "VVTight" : "WPEff40" } - for wp in ["VVLoose","Loose","Medium","Tight","VTight","VVTight"]: + for wp,wpEff in wp_to_eff_match.items(): _aWP = "rerunDiscriminationByIsolationOldDMMVArun2017v2"+wp+self.postfix setattr(self.process,_aWP,_byIsolationOldDMMVArun2017v2VLooseProd.clone()) _aWPProd = getattr(self.process,_aWP) - _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_"+wp_to_eff_match[wp]) + _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_"+wpEff) _rerunIsolationOldDMMVArun2017v2Task.add(_aWPProd) setattr(tauIDSources,"by"+wp+"IsolationMVArun2017v2DBoldDMwLT2017",self.cms.InputTag(_aWP)) @@ -342,18 +340,17 @@ def runTauID(self): wp_to_eff_match = { "VVLoose" : "WPEff95", - "VLoose" : "WPEff90", "Loose" : "WPEff80", "Medium" : "WPEff70", "Tight" : "WPEff60", "VTight" : "WPEff50", "VVTight" : "WPEff40" } - for wp in ["VVLoose","Loose","Medium","Tight","VTight","VVTight"]: + for wp,wpEff in wp_to_eff_match.items(): _aWP = "rerunDiscriminationByIsolationNewDMMVArun2017v2"+wp+self.postfix setattr(self.process,_aWP,_byIsolationNewDMMVArun2017v2VLooseProd.clone()) _aWPProd = getattr(self.process,_aWP) - _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_"+wp_to_eff_match[wp]) + _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_"+wpEff) _rerunIsolationNewDMMVArun2017v2Task.add(_aWPProd) setattr(tauIDSources,"by"+wp+"IsolationMVArun2017v2DBnewDMwLT2017",self.cms.InputTag(_aWP)) @@ -423,18 +420,17 @@ def runTauID(self): wp_to_eff_match = { "VVLoose" : "WPEff95", - "VLoose" : "WPEff90", "Loose" : "WPEff80", "Medium" : "WPEff70", "Tight" : "WPEff60", "VTight" : "WPEff50", "VVTight" : "WPEff40" } - for wp in ["VVLoose","Loose","Medium","Tight","VTight","VVTight"]: + for wp,wpEff in wp_to_eff_match.items(): _aWP = "rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2"+wp+self.postfix setattr(self.process,_aWP,_byIsolationOldDMdR0p3MVArun2017v2VLooseProd.clone()) _aWPProd = getattr(self.process,_aWP) - _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_"+wp_to_eff_match[wp]) + _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_"+wpEff) _rerunIsolationOldDMdR0p3MVArun2017v2Task.add(_aWPProd) setattr(tauIDSources,"by"+wp+"IsolationMVArun2017v2DBoldDMdR0p3wLT2017",self.cms.InputTag(_aWP)) @@ -505,19 +501,17 @@ def runTauID(self): tauIDSources.byVLooseIsolationMVArun2v2DBoldDMwLT2016 = self.cms.InputTag(_byIsolationOldDMMVArun2016v1VLoose) wp_to_eff_match = { - "VVLoose" : "WPEff95", - "VLoose" : "WPEff90", "Loose" : "WPEff80", "Medium" : "WPEff70", "Tight" : "WPEff60", "VTight" : "WPEff50", "VVTight" : "WPEff40" } - for wp in ["Loose","Medium","Tight","VTight","VVTight"]: + for wp,wpEff in wp_to_eff_match.items(): _aWP = "rerunDiscriminationByIsolationOldDMMVArun2v1"+wp+self.postfix setattr(self.process,_aWP,_byIsolationOldDMMVArun2016v1VLooseProd.clone()) _aWPProd = getattr(self.process,_aWP) - _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_"+wp_to_eff_match[wp]) + _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_"+wpEff) _rerunIsolationOldDMMVArun2016v1Task.add(_aWPProd) setattr(tauIDSources,"by"+wp+"IsolationMVArun2v1DBoldDMwLT2016",self.cms.InputTag(_aWP)) @@ -562,19 +556,17 @@ def runTauID(self): tauIDSources.byVLooseIsolationMVArun2v2DBnewDMwLT2016 = self.cms.InputTag(_byIsolationNewDMMVArun2016v1VLoose) wp_to_eff_match = { - "VVLoose" : "WPEff95", - "VLoose" : "WPEff90", "Loose" : "WPEff80", "Medium" : "WPEff70", "Tight" : "WPEff60", "VTight" : "WPEff50", "VVTight" : "WPEff40" } - for wp in ["Loose","Medium","Tight","VTight","VVTight"]: + for wp,wpEff in wp_to_eff_match.items(): _aWP = "rerunDiscriminationByIsolationNewDMMVArun2v1"+wp+self.postfix setattr(self.process,_aWP,_byIsolationNewDMMVArun2016v1VLooseProd.clone()) _aWPProd = getattr(self.process,_aWP) - _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_"+wp_to_eff_match[wp]) + _aWPProd.mapping[0].cut = self.cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_"+wpEff) _rerunIsolationNewDMMVArun2016v1Task.add(_aWPProd) setattr(tauIDSources,"by"+wp+"IsolationMVArun2v1DBnewDMwLT2016",self.cms.InputTag(_aWP)) @@ -901,54 +893,53 @@ def runTauID(self): ) # Other WPs wp_to_eff_match = { - "VLoose" : "WPeff98", "Loose" : "WPeff90", "Medium" : "WPeff80", "Tight" : "WPeff70", "VTight" : "WPeff60", } - for wp in ["Loose", "Medium", "Tight", "VTight"]: + for wp,wpEff in wp_to_eff_match.items(): _aWP = "patTauDiscriminationBy"+wp+"ElectronRejectionMVA62018"+self.postfix setattr(self.process,_aWP,_byElectronRejectionMVA62018VLooseProd.clone( mapping = self.cms.VPSet( self.cms.PSet( category = self.cms.uint32(0), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_BL_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_BL_'+wpEff), variable = self.cms.string('pt') ), self.cms.PSet( category = self.cms.uint32(2), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_BL_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_BL_'+wpEff), variable = self.cms.string('pt') ), self.cms.PSet( category = self.cms.uint32(5), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_BL_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_BL_'+wpEff), variable = self.cms.string('pt') ), self.cms.PSet( category = self.cms.uint32(7), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_BL_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_BL_'+wpEff), variable = self.cms.string('pt') ), self.cms.PSet( category = self.cms.uint32(8), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_EC_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_woGwoGSF_EC_'+wpEff), variable = self.cms.string('pt') ), self.cms.PSet( category = self.cms.uint32(10), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_EC_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_NoEleMatch_wGwoGSF_EC_'+wpEff), variable = self.cms.string('pt') ), self.cms.PSet( category = self.cms.uint32(13), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_EC_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_woGwGSF_EC_'+wpEff), variable = self.cms.string('pt') ), self.cms.PSet( category = self.cms.uint32(15), - cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_EC_'+wp_to_eff_match[wp]), + cut = self.cms.string('RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+'_gbr_wGwGSF_EC_'+wpEff), variable = self.cms.string('pt') ) ) diff --git a/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py b/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py index 856fdfa3e02ff..5e5b75a810cab 100644 --- a/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py +++ b/RecoTauTag/RecoTau/test/runDeepTauIDsOnMiniAOD.py @@ -22,8 +22,8 @@ # Input source process.source = cms.Source('PoolSource', fileNames = cms.untracked.vstring( - # File from dataset DY1JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8 - ' /store/mc/RunIIFall17MiniAODv2/TTToHadronic_TuneCP5_13TeV-powheg-pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/40000/A256C80D-0943-E811-998E-7CD30AB0522C.root' + # File from dataset TTToHadronic_TuneCP5_13TeV-powheg-pythia8 + '/store/mc/RunIISummer20UL18MiniAOD/TTToHadronic_TuneCP5_13TeV-powheg-pythia8/MINIAODSIM/106X_upgrade2018_realistic_v11_L1v1-v2/00000/001FF3B9-3186-7246-BBD3-1531BFE6AD28.root' )) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(eventsToProcess) )