Skip to content

Commit

Permalink
switch to GT for payloads of new phaseII IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Wozniewski committed Oct 19, 2020
1 parent bb315d0 commit 5d3d618
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'tauIdMVAIsoDBoldDMdR0p3wLT2017' : "tauIdMVAIsoDBoldDMdR0p3wLT2017",
}
tauIdDiscrMVA_trainings_phase2 = {
'tauIdMVAIsoPhase2' : "tauIdMVAIsoPhase2",
'tauIdMVAIsoPhase2_v1' : "tauIdMVAIsoPhase2",
}
tauIdDiscrMVA_WPs = {
'tauIdMVAoldDMwoLT' : {
Expand Down Expand Up @@ -178,7 +178,7 @@
}
}
tauIdDiscrMVA_WPs_phase2 = {
'tauIdMVAIsoPhase2' : {
'tauIdMVAIsoPhase2_v1' : {
'Eff95' : "Phase2Eff95",
'Eff90' : "Phase2Eff90",
'Eff80' : "Phase2Eff80",
Expand Down Expand Up @@ -212,7 +212,7 @@
'tauIdMVAIsoDBoldDMdR0p3wLT2017' : "mvaOutput_normalization"
}
tauIdDiscrMVA_mvaOutput_normalizations_phase2 = {
'tauIdMVAIsoPhase2' : "mvaOutput_normalization",
'tauIdMVAIsoPhase2_v1' : "mvaOutput_normalization",
}

tauIdDiscrMVA_version = "v1"
Expand Down Expand Up @@ -321,22 +321,22 @@
cms.PSet(
record = cms.string('GBRWrapperRcd'),
tag = cms.string("RecoTauTag_%s" % (gbrForestName)),
label = cms.untracked.string("RecoTauTag_%s" % (gbrForestName))
label = cms.untracked.string("RecoTauTag_%s" % (training))
)
)
for WP in tauIdDiscrMVA_WPs_phase2[training].keys():
loadRecoTauTagMVAsFromPrepDB.toGet.append(
cms.PSet(
record = cms.string('PhysicsTGraphPayloadRcd'),
tag = cms.string("RecoTauTag_%s_WP%s" % (gbrForestName, WP)),
label = cms.untracked.string("RecoTauTag_%s_WP%s" % (gbrForestName, WP))
label = cms.untracked.string("RecoTauTag_%s_WP%s" % (training, WP))
)
)
loadRecoTauTagMVAsFromPrepDB.toGet.append(
cms.PSet(
record = cms.string('PhysicsTFormulaPayloadRcd'),
tag = cms.string("RecoTauTag_%s_mvaOutput_normalization" % (gbrForestName)),
label = cms.untracked.string("RecoTauTag_%s_mvaOutput_normalization" % (gbrForestName))
label = cms.untracked.string("RecoTauTag_%s_mvaOutput_normalization" % (training))
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,87 @@

# anti-e phase-2 tauID mva names
mvaNames_phase2 = dict(
mvaName_NoEleMatch_woGwoGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"),
mvaName_NoEleMatch_wGwoGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"),
mvaName_woGwGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"),
mvaName_wGwGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"),
mvaName_NoEleMatch_woGwoGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"),
mvaName_NoEleMatch_wGwoGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"),
mvaName_woGwGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"),
mvaName_wGwGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"),
mvaName_NoEleMatch_woGwoGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"),
mvaName_NoEleMatch_wGwoGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"),
mvaName_woGwGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"),
mvaName_wGwGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC")
mvaName_NoEleMatch_woGwoGSF_BL = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_woGwoGSF_BL"),
mvaName_NoEleMatch_wGwoGSF_BL = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_wGwoGSF_BL"),
mvaName_woGwGSF_BL = cms.string("RecoTauTag_antiElectronMVAPhase2_woGwGSF_BL"),
mvaName_wGwGSF_BL = cms.string("RecoTauTag_antiElectronMVAPhase2_wGwGSF_BL"),
mvaName_NoEleMatch_woGwoGSF_EC = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_woGwoGSF_FWEC"),
mvaName_NoEleMatch_wGwoGSF_EC = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_wGwoGSF_FWEC"),
mvaName_woGwGSF_EC = cms.string("RecoTauTag_antiElectronMVAPhase2_woGwGSF_FWEC"),
mvaName_wGwGSF_EC = cms.string("RecoTauTag_antiElectronMVAPhase2_wGwGSF_FWEC"),
mvaName_NoEleMatch_woGwoGSF_VFEC = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_woGwoGSF_VFWEC"),
mvaName_NoEleMatch_wGwoGSF_VFEC = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_wGwoGSF_VFWEC"),
mvaName_woGwGSF_VFEC = cms.string("RecoTauTag_antiElectronMVAPhase2_woGwGSF_VFWEC"),
mvaName_wGwGSF_VFEC = cms.string("RecoTauTag_antiElectronMVAPhase2_wGwGSF_VFWEC")
)
# anti-e phase-2 tauID (WPs)
mapping_phase2 = cms.VPSet(
cms.PSet(
category = cms.uint32(0), # minMVANoEleMatchWOgWOgsfBL
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_woGwoGSF_BL"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(2), # minMVANoEleMatchWgWOgsfBL
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_wGwoGSF_BL"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(5), # minMVAWOgWgsfBL
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_woGwGSF_BL"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(7), # minMVAWgWgsfBL
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_wGwGSF_BL"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(8), # minMVANoEleMatchWOgWOgsfEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_woGwoGSF_FWEC"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(9), # minMVANoEleMatchWOgWOgsfVFEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_woGwoGSF_VFWEC"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(10), # minMVANoEleMatchWgWOgsfEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_wGwoGSF_FWEC"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(11), # minMVANoEleMatchWgWOgsfVFEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_NoEleMatch_wGwoGSF_VFWEC"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(13), # minMVAWOgWgsfEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_woGwGSF_FWEC"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(14), # minMVAWOgWgsfVFEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_woGwGSF_VFWEC"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(15), # minMVAWgWgsfEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_wGwGSF_FWEC"),
variable = cms.string("pt")
),
cms.PSet(
category = cms.uint32(16), # minMVAWgWgsfVFEC
cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC"),
cut = cms.string("RecoTauTag_antiElectronMVAPhase2_wGwGSF_VFWEC"),
variable = cms.string("pt")
)
)

workingPoints_phase2 = cms.vstring(
"_WPEff98",
"_WPEff90",
"_WPEff80",
"_WPEff70",
"_WPEff60"
"_VLoose",
"_Loose",
"_Medium",
"_Tight",
"_VTight"
)
38 changes: 19 additions & 19 deletions RecoTauTag/RecoTau/python/tools/runTauIdMVA.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,13 +894,13 @@ def tauIDMVAinputs(module, wp):
)
),
workingPoints = cms.vstring(
"_WPEff95",
"_WPEff90",
"_WPEff80",
"_WPEff70",
"_WPEff60",
"_WPEff50",
"_WPEff40"
"_VVLoose",
"_VLoose",
"_Loose",
"_Medium",
"_Tight",
"_VTight",
"_VVTight"
)
)
self.process.rerunIsolationMVADBnewDMwLTPhase2Task = cms.Task(
Expand All @@ -911,13 +911,13 @@ def tauIDMVAinputs(module, wp):
self.process.rerunMvaIsolationSequence += cms.Sequence(self.process.rerunIsolationMVADBnewDMwLTPhase2Task)

tauIDSources.byIsolationMVADBnewDMwLTPhase2raw = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "raw")
tauIDSources.byVVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff95")
tauIDSources.byVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff90")
tauIDSources.byLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff80")
tauIDSources.byMediumIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff70")
tauIDSources.byTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff60")
tauIDSources.byVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff50")
tauIDSources.byVVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff40")
tauIDSources.byVVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VVLoose")
tauIDSources.byVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VLoose")
tauIDSources.byLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_Loose")
tauIDSources.byMediumIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_Medium")
tauIDSources.byTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_Tight")
tauIDSources.byVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VTight")
tauIDSources.byVVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VVTight")

if "againstElePhase2v1" in self.toKeep:
if self.debug: print ("Adding anti-e Phase2v1 ID")
Expand Down Expand Up @@ -948,11 +948,11 @@ def tauIDMVAinputs(module, wp):
_againstElectronTauIDPhase2v1Sources = cms.PSet(
againstElectronMVA6RawPhase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "raw"),
againstElectronMVA6categoryPhase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "category"),
againstElectronVLooseMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff98"),
againstElectronLooseMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff90"),
againstElectronMediumMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff80"),
againstElectronTightMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff70"),
againstElectronVTightMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff60")
againstElectronVLooseMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_VLoose"),
againstElectronLooseMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_Loose"),
againstElectronMediumMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_Medium"),
againstElectronTightMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_Tight"),
againstElectronVTightMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_VTight")
)
_tauIDSourcesWithAgainistElePhase2v1 = cms.PSet(
tauIDSources.clone(),
Expand Down
36 changes: 19 additions & 17 deletions RecoTauTag/RecoTau/test/rerunMVAIsolationOnMiniAOD_Phase2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
)

from RecoTauTag.RecoTau.TauDiscriminatorTools import noPrediscriminants
### Load PoolDBESSource with mapping to payloads
# Note: replace it by an appropriate GlobalTag when MVAIso phase-2 payloads are available via it
process.load('RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi')
### Load payloads via GlobalTag
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '112X_mcRun4_realistic_Candidate_2020_09_17_13_57_14', '')


from RecoTauTag.RecoTau.PATTauDiscriminationByMVAIsolationRun2_cff import *
process.rerunDiscriminationByIsolationMVADBnewDMwLTPhase2raw = patDiscriminationByIsolationMVArun2v1raw.clone(
Expand Down Expand Up @@ -56,13 +58,13 @@
)
),
workingPoints = cms.vstring(
"_WPEff95",
"_WPEff90",
"_WPEff80",
"_WPEff70",
"_WPEff60",
"_WPEff50",
"_WPEff40"
"_VVLoose",
"_VLoose",
"_Loose",
"_Medium",
"_Tight",
"_VTight",
"_VVTight"
)
)

Expand All @@ -78,13 +80,13 @@ def tauIDMVAinputs(module, wp):
src = cms.InputTag('slimmedTaus'),
tauIDSources = cms.PSet(
byIsolationMVADBnewDMwLTPhase2raw = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "raw"),
byVVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff95"),
byVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff90"),
byLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff80"),
byMediumIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff70"),
byTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff60"),
byVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff50"),
byVVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff40")
byVVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VVLoose"),
byVLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VLoose"),
byLooseIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_Loose"),
byMediumIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_Medium"),
byTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_Tight"),
byVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VTight"),
byVVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_VVTight")
),
)
setattr(process, "newTauIDsEmbedded", embedID)
Expand Down

0 comments on commit 5d3d618

Please sign in to comment.