Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VXBS For High Pt #46287

Merged
merged 9 commits into from
Oct 29, 2024
3 changes: 2 additions & 1 deletion PhysicsTools/NanoAOD/python/custom_muon_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def AddVariablesForMuon(proc):
# tuneP_ptErr is now moved to standard NanoAODs
proc.muonTable.variables.tuneP_eta = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().eta(): -99", float, doc="tunePMuonBestTrack Eta")
proc.muonTable.variables.tuneP_phi = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().phi(): -99", float, doc="tunePMuonBestTrack Phi")
proc.muonTable.variables.tuneP_charge = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().charge(): -99", float, doc="tunePMuonBestTrack() charge")
#proc.muonTable.variables.tuneP_charge = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().charge(): -99", float, doc="tunePMuonBestTrack() charge")
#tuneP_charge is moved to standard NanoAODs
proc.muonTable.variables.tuneP_muonHits = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().hitPattern().numberOfValidMuonHits() : -99", int, doc="No of valid muon hists from tunePMuonBestTrack")

# tpfms Track
Expand Down
5 changes: 5 additions & 0 deletions PhysicsTools/NanoAOD/python/muons_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@
ptErr = Var("bestTrack().ptError()", float, doc = "ptError of the muon track", precision=6),
tunepRelPt = Var("tunePMuonBestTrack().pt/pt",float,doc="TuneP relative pt, tunePpt/pt",precision=6),
tuneP_pterr = Var("tunePMuonBestTrack().ptError()", float, doc = "pTerr from tunePMuonBestTrack", precision=6),
tuneP_charge = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().charge(): -99", float, doc="tunePMuonBestTrack() charge",precision=6),
dz = Var("dB('PVDZ')",float,doc="dz (with sign) wrt first PV, in cm",precision=10),
dzErr = Var("abs(edB('PVDZ'))",float,doc="dz uncertainty, in cm",precision=6),
dxybs = Var("dB('BS2D')",float,doc="dxy (with sign) wrt the beam spot, in cm",precision=10),
dxybsErr = Var("edB('BS2D')",float,doc="dxy uncertainty wrt the beam spot, in cm", precision=6),
dxy = Var("dB('PV2D')",float,doc="dxy (with sign) wrt first PV, in cm",precision=10),
dxyErr = Var("edB('PV2D')",float,doc="dxy uncertainty, in cm",precision=6),
ip3d = Var("abs(dB('PV3D'))",float,doc="3D impact parameter wrt first PV, in cm",precision=10),
Expand Down Expand Up @@ -204,6 +206,9 @@
triggerIdLoose = Var("passed('TriggerIdLoose')",bool,doc="TriggerIdLoose ID"),
inTimeMuon = Var("passed('InTimeMuon')",bool,doc="inTimeMuon ID"),
jetNDauCharged = Var("?userCand('jetForLepJetVar').isNonnull()?userFloat('jetNDauChargedMVASel'):0", "uint8", doc="number of charged daughters of the closest jet"),
VXBS_Cov00 = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().covariance(0,0) : -999",float,doc="0, 0 element of the VXBS Covariance matrix", precision=16),
VXBS_Cov03 = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().covariance(0,3) : -999",float,doc="0, 3 element of the VXBS Covariance matrix", precision=16),
VXBS_Cov33 = Var("? tunePMuonBestTrack().isNonnull() && tunePMuonBestTrack().isAvailable() ? tunePMuonBestTrack().covariance(3,3) : -999",float,doc="3, 3 element of the VXBS Covariance matrix", precision=16),
),
externalVariables = cms.PSet(
promptMVA = ExtVar(cms.InputTag("muonPROMPTMVA"),float, doc="Prompt MVA lepton ID score. Corresponds to the previous mvaTTH",precision=14),
Expand Down
5 changes: 5 additions & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,11 @@
Plot1D('bsConstrainedPtErr', '', 20, 0., 20., 'pt error w. beamspot constraint'),
Plot1D('bsConstrainedChi2', '', 20, 0., 40., 'chi2 of beamspot constraint'),
Plot1D('charge', 'charge', 3, -1.5, 1.5, 'electric charge'),
Plot1D('tuneP_charge', 'tuneP_charge', 3, -1.5, 1.5, 'charge from the tuneP algorithm'),
Plot1D('dxy', 'dxy', 20, -0.1, 0.1, 'dxy (with sign) wrt first PV, in cm'),
Plot1D('dxyErr', 'dxyErr', 20, 0, 0.1, 'dxy uncertainty, in cm'),
Plot1D('dxybs', 'dxybs', 20, -0.1, 0.1, 'dxy (with sign) wrt the beam spot, in cm'),
Plot1D('dxybsErr', 'dxybsErr', 20, 0, 0.1, 'uncertainty on dxy (with sign) wrt the beam spot, in cm'),
Plot1D('dz', 'dz', 20, -0.3, 0.3, 'dz (with sign) wrt first PV, in cm'),
Plot1D('dzErr', 'dzErr', 20, 0, 0.2, 'dz uncertainty, in cm'),
Plot1D('eta', 'eta', 20, -2.5, 2.5, 'eta'),
Expand Down Expand Up @@ -602,6 +604,9 @@
Plot1D('tkRelIso', 'tkRelIso', 100, 0, 1, 'Tracker-based relative isolation dR=0.3 for highPt, trkIso/tunePpt'),
Plot1D('triggerIdLoose', 'triggerIdLoose', 2, -0.5, 1.5, 'TriggerIdLoose ID'),
Plot1D('tunepRelPt', 'tunepRelPt', 200, 0, 200, 'TuneP relative pt, tunePpt/pt'),
Plot1D('VXBS_Cov00', 'VXBS_Cov00', 200, -10, 10, '0, 0 element of the VXBS Covariance matrix'),
Plot1D('VXBS_Cov03', 'VXBS_Cov03', 200, -10, 10, '0, 3 element of the VXBS Covariance matrix'),
Plot1D('VXBS_Cov33', 'VXBS_Cov33', 200, -10, 10, '3, 3 element of the VXBS Covariance matrix'),
)
),
OtherPV = cms.PSet(
Expand Down