Skip to content

Commit bc07c52

Browse files
authored
Merge pull request #45860 from namapane/FixMuonMVAVariables_142X
Minor fixes to variables for lepton MVA
2 parents b5929cd + 71143ae commit bc07c52

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

PhysicsTools/NanoAOD/python/electrons_cff.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,10 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints):
342342
miniPFRelIso_all = Var("userFloat('miniIsoAll')/pt",float,doc="mini PF relative isolation, total (with scaled rho*EA PU Winter22V1 corrections)"),
343343
pfRelIso03_chg = Var("userFloat('PFIsoChg')/pt",float,doc="PF relative isolation dR=0.3, charged component"),
344344
pfRelIso03_all = Var("userFloat('PFIsoAll')/pt",float,doc="PF relative isolation dR=0.3, total (with rho*EA PU Winter22V1 corrections)"),
345-
jetRelIso = Var("?userCand('jetForLepJetVar').isNonnull()?(1./userFloat('ptRatio'))-1.:userFloat('PFIsoAll04')/pt",float,doc="Relative isolation in matched jet (1/ptRatio-1, pfRelIso04_all if no matched jet)",precision=8),
345+
pfRelIso04_all = Var("userFloat('PFIsoAll04')/pt",float,doc="PF relative isolation dR=0.4, total (with rho*EA PU Winter22V1 corrections)", precision=10),
346+
jetRelIso = Var("?userCand('jetForLepJetVar').isNonnull()?(1./userFloat('ptRatio'))-1.:-1.",float,doc="Relative isolation in matched jet (1/ptRatio-1), -1 if none",precision=8),
346347
jetPtRelv2 = Var("?userCand('jetForLepJetVar').isNonnull()?userFloat('ptRel'):0",float,doc="Relative momentum of the lepton with respect to the closest jet after subtracting the lepton",precision=8),
348+
jetDF = Var("?userCand('jetForLepJetVar').isNonnull()?max(userCand('jetForLepJetVar').bDiscriminator('pfDeepFlavourJetTags:probbb')+userCand('jetForLepJetVar').bDiscriminator('pfDeepFlavourJetTags:probb')+userCand('jetForLepJetVar').bDiscriminator('pfDeepFlavourJetTags:problepb'),0.0):0.0",float,doc="value of the DEEPJET b tagging algorithm discriminator of the associated jet (0 if none)",precision=8,lazyEval=True),
347349
dr03TkSumPt = Var("?pt>35?dr03TkSumPt():0",float,doc="Non-PF track isolation within a delta R cone of 0.3 with electron pt > 35 GeV",precision=8),
348350
dr03TkSumPtHEEP = Var("?pt>35?dr03TkSumPtHEEP():0",float,doc="Non-PF track isolation within a delta R cone of 0.3 with electron pt > 35 GeV used in HEEP ID",precision=8),
349351
dr03EcalRecHitSumEt = Var("?pt>35?dr03EcalRecHitSumEt():0",float,doc="Non-PF Ecal isolation within a delta R cone of 0.3 with electron pt > 35 GeV",precision=8),
@@ -453,7 +455,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints):
453455
miniPFRelIso_all = Var("userFloat('miniIsoAll_Fall17V2')/pt",float,doc="mini PF relative isolation, total (with scaled rho*EA Fall17V2 PU corrections) in Run2"),
454456
pfRelIso03_chg = Var("userFloat('PFIsoChg_Fall17V2')/pt",float,doc="PF relative isolation dR=0.3 with 94 EffArea, charged component in Run2"),
455457
pfRelIso03_all = Var("userFloat('PFIsoAll_Fall17V2')/pt",float,doc="PF relative isolation dR=0.3 with 94 EffArea, total (with rho*EA Fall17V2 PU corrections) in Run2"),
456-
jetRelIso = Var("?userCand('jetForLepJetVar').isNonnull()?(1./userFloat('ptRatio'))-1.:userFloat('PFIsoAll04_Fall17V2')/pt",float,doc="Relative isolation in matched jet (1/ptRatio-1, pfRelIso04_all if no matched jet in Run2)",precision=8),
458+
pfRelIso04_all = Var("userFloat('PFIsoAll04_Fall17V2')/pt",float,doc="PF relative isolation dR=0.4, total (with rho*EA PU Fall17V2 PU corrections)", precision=10),
457459
)
458460

459461
#############electron Table END#####################

PhysicsTools/NanoAOD/python/muons_cff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@
176176
pfRelIso03_chg = Var("pfIsolationR03().sumChargedHadronPt/pt",float,doc="PF relative isolation dR=0.3, charged component"),
177177
pfRelIso03_all = Var("(pfIsolationR03().sumChargedHadronPt + max(pfIsolationR03().sumNeutralHadronEt + pfIsolationR03().sumPhotonEt - pfIsolationR03().sumPUPt/2,0.0))/pt",float,doc="PF relative isolation dR=0.3, total (deltaBeta corrections)"),
178178
pfRelIso04_all = Var("(pfIsolationR04().sumChargedHadronPt + max(pfIsolationR04().sumNeutralHadronEt + pfIsolationR04().sumPhotonEt - pfIsolationR04().sumPUPt/2,0.0))/pt",float,doc="PF relative isolation dR=0.4, total (deltaBeta corrections)"),
179-
jetRelIso = Var("?userCand('jetForLepJetVar').isNonnull()?(1./userFloat('ptRatio'))-1.:(pfIsolationR04().sumChargedHadronPt + max(pfIsolationR04().sumNeutralHadronEt + pfIsolationR04().sumPhotonEt - pfIsolationR04().sumPUPt/2,0.0))/pt",float,doc="Relative isolation in matched jet (1/ptRatio-1, pfRelIso04_all if no matched jet)",precision=8),
179+
jetRelIso = Var("?userCand('jetForLepJetVar').isNonnull()?(1./userFloat('ptRatio'))-1.:-1.",float,doc="Relative isolation in matched jet (1/ptRatio-1), -1 if none",precision=8),
180180
jetPtRelv2 = Var("?userCand('jetForLepJetVar').isNonnull()?userFloat('ptRel'):0",float,doc="Relative momentum of the lepton with respect to the closest jet after subtracting the lepton",precision=8),
181+
jetDF = Var("?userCand('jetForLepJetVar').isNonnull()?max(userCand('jetForLepJetVar').bDiscriminator('pfDeepFlavourJetTags:probbb')+userCand('jetForLepJetVar').bDiscriminator('pfDeepFlavourJetTags:probb')+userCand('jetForLepJetVar').bDiscriminator('pfDeepFlavourJetTags:problepb'),0.0):0.0",float,doc="value of the DEEPJET b tagging algorithm discriminator of the associated jet (0 if none)",precision=8,lazyEval=True),
181182
tightCharge = Var("?(muonBestTrack().ptError()/muonBestTrack().pt() < 0.2)?2:0", "uint8", doc="Tight charge criterion using pterr/pt of muonBestTrack (0:fail, 2:pass)"),
182183
looseId = Var("passed('CutBasedIdLoose')",bool, doc="muon is loose muon"),
183184
isPFcand = Var("isPFMuon",bool,doc="muon is PF candidate"),

PhysicsTools/NanoAOD/python/nanoDQM_cfi.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
Plot1D('isPFcand', 'isPFcand', 2, -0.5, 1.5, 'electron is PF candidate'),
8181
NoPlot('jetIdx'),
8282
Plot1D('jetPtRelv2', 'jetPtRelv2', 20, 0, 60, 'Relative momentum of the lepton with respect to the closest jet after subtracting the lepton'),
83-
Plot1D('jetRelIso', 'jetRelIso', 20, -0.2, 1.8, 'Relative isolation in matched jet (1/ptRatio-1, pfRelIso04_all if no matched jet)'),
84-
Plot1D('jetRelIso_Fall17V2', 'jetRelIso_Fall17V2', 20, -0.2, 1.8, 'Relative isolation in matched jet (1/ptRatio-1, pfRelIso04_all if no matched jet)'),
83+
Plot1D('jetRelIso', 'jetRelIso', 20, -0.2, 1.8, 'Relative isolation in matched jet (1/ptRatio-1), -1 if none'),
84+
Plot1D('jetDF', 'jetDF', 20, 0., 1., 'value of the DEEPJET b tagging algorithm discriminator of the associated jet (0 if none)'),
8585
Plot1D('lostHits', 'lostHits', 4, -0.5, 3.5, 'number of missing inner hits'),
8686
Plot1D('jetNDauCharged', 'jetNDauCharged', 20, -0.5, 19.5, 'number of charged daughters of the closest jet'),
8787
NoPlot('mass'),
@@ -107,6 +107,7 @@
107107
Plot1D('miniPFRelIso_chg', 'miniPFRelIso_chg', 20, 0, 1, 'mini PF relative isolation, charged component'),
108108
Plot1D('pfRelIso03_all', 'pfRelIso03_all', 20, 0, 2, 'PF relative isolation dR=0.3, total (with rho*EA PU corrections)'),
109109
Plot1D('pfRelIso03_chg', 'pfRelIso03_chg', 20, 0, 2, 'PF relative isolation dR=0.3, charged component'),
110+
Plot1D('pfRelIso04_all', 'pfRelIso04_all', 20, 0, 2, 'PF relative isolation dR=0.4, total (with rho*EA PU corrections)'),
110111
Plot1D('miniPFRelIso_all_Fall17V2', 'miniPFRelIso_all_Fall17V2', 20, 0, 1, 'mini PF relative isolation, total (with scaled rho*EA PU corrections)'),
111112
Plot1D('miniPFRelIso_chg_Fall17V2', 'miniPFRelIso_chg_Fall17V2', 20, 0, 1, 'mini PF relative isolation, charged component'),
112113
Plot1D('pfRelIso03_all_Fall17V2', 'pfRelIso03_all_Fall17V2', 20, 0, 2, 'PF relative isolation dR=0.3 with 94 EffArea, total (with rho*EA PU corrections)'),
@@ -552,7 +553,8 @@
552553
Plot1D('isStandalone', 'isStandalone', 2, -0.5, 1.5, 'muon is a standalone muon'),
553554
NoPlot('jetIdx'),
554555
Plot1D('jetPtRelv2', 'jetPtRelv2', 20, 0, 30, 'Relative momentum of the lepton with respect to the closest jet after subtracting the lepton'),
555-
Plot1D('jetRelIso', 'jetRelIso', 20, -0.2, 1.8, 'Relative isolation in matched jet (1/ptRatio-1, pfRelIso04_all if no matched jet)'),
556+
Plot1D('jetRelIso', 'jetRelIso', 20, -0.2, 1.8, 'Relative isolation in matched jet (1/ptRatio-1), -1 if none'),
557+
Plot1D('jetDF', 'jetDF', 20, 0., 1., 'value of the DEEPJET b tagging algorithm discriminator of the associated jet (0 if none)'),
556558
Plot1D('looseId', 'looseId', 2, -0.5, 1.5, 'muon is loose muon'),
557559
NoPlot('mass'),
558560
Profile1D('mediumId', 'mediumId', 'pt', 16, 0, 80, 'POG Medium muon ID (using the relaxed cuts in the data Run 2016 B-F periods, and standard cuts elsewhere)'),

0 commit comments

Comments
 (0)