Skip to content

Commit

Permalink
Merge pull request #44294 from cramonal/from-CMSSW_14_0_1_fix_muonMVAID
Browse files Browse the repository at this point in the history
Fix on mvaID for muons (backport)
  • Loading branch information
cmsbuild authored Mar 5, 2024
2 parents a8742b5 + 0e3a50d commit f952809
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions PhysicsTools/NanoAOD/python/muons_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,14 @@
ptRel = cms.InputTag("ptRatioRelForMu:ptRel"),
jetNDauChargedMVASel = cms.InputTag("ptRatioRelForMu:jetNDauChargedMVASel"),
mvaIDMuon_wpMedium = cms.InputTag("muonMVAID:wpMedium"),
mvaIDMuon_wpTight = cms.InputTag("muonMVAID:wpTight")
mvaIDMuon_wpTight = cms.InputTag("muonMVAID:wpTight"),
mvaIDMuon = cms.InputTag("muonMVAID:probGOOD")
),
userCands = cms.PSet(
jetForLepJetVar = cms.InputTag("ptRatioRelForMu:jetForLepJetVar") # warning: Ptr is null if no match is found
),
)

(run2_nanoAOD_106Xv2 | run3_nanoAOD_122 ).toModify(slimmedMuonsWithUserData.userFloats,
mvaIDMuon = cms.InputTag("muonMVAID:probGOOD"))


finalMuons = cms.EDFilter("PATMuonRefSelector",
src = cms.InputTag("slimmedMuonsWithUserData"),
Expand Down Expand Up @@ -169,7 +167,7 @@
pfIsoId = Var("passed('PFIsoVeryLoose')+passed('PFIsoLoose')+passed('PFIsoMedium')+passed('PFIsoTight')+passed('PFIsoVeryTight')+passed('PFIsoVeryVeryTight')","uint8",doc="PFIso ID from miniAOD selector (1=PFIsoVeryLoose, 2=PFIsoLoose, 3=PFIsoMedium, 4=PFIsoTight, 5=PFIsoVeryTight, 6=PFIsoVeryVeryTight)"),
tkIsoId = Var("?passed('TkIsoTight')?2:passed('TkIsoLoose')","uint8",doc="TkIso ID (1=TkIsoLoose, 2=TkIsoTight)"),
miniIsoId = Var("passed('MiniIsoLoose')+passed('MiniIsoMedium')+passed('MiniIsoTight')+passed('MiniIsoVeryTight')","uint8",doc="MiniIso ID from miniAOD selector (1=MiniIsoLoose, 2=MiniIsoMedium, 3=MiniIsoTight, 4=MiniIsoVeryTight)"),
mvaMuID = Var("mvaIDValue()",float,doc="MVA-based ID score ",precision=6),
mvaMuID = Var("userFloat('mvaIDMuon')", float, doc="MVA-based ID score",precision=6),
mvaMuID_WP = Var("userFloat('mvaIDMuon_wpMedium') + userFloat('mvaIDMuon_wpTight')","uint8",doc="MVA-based ID selector WPs (1=MVAIDwpMedium,2=MVAIDwpTight)"),
multiIsoId = Var("?passed('MultiIsoMedium')?2:passed('MultiIsoLoose')","uint8",doc="MultiIsoId from miniAOD selector (1=MultiIsoLoose, 2=MultiIsoMedium)"),
puppiIsoId = Var("passed('PuppiIsoLoose')+passed('PuppiIsoMedium')+passed('PuppiIsoTight')", "uint8", doc="PuppiIsoId from miniAOD selector (1=Loose, 2=Medium, 3=Tight)"),
Expand All @@ -191,9 +189,6 @@
muonTable.variables.eta.precision = 16
muonTable.variables.phi.precision = 16

(run2_nanoAOD_106Xv2 | run3_nanoAOD_122).toModify(muonTable.variables,mvaMuID=None).toModify(
muonTable.variables, mvaMuID = Var("userFloat('mvaIDMuon')", float, doc="MVA-based ID score",precision=6))


# Revert back to AK4 CHS jets for Run 2
run2_nanoAOD_ANY.toModify(
Expand Down

0 comments on commit f952809

Please sign in to comment.