From 27df8e4c4f767d123c11a77c482f1c5cbdb844e4 Mon Sep 17 00:00:00 2001 From: bcho Date: Mon, 9 Sep 2024 14:55:45 +0200 Subject: [PATCH 1/9] Etawise GEM TnP --- DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc b/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc index 8c2b0008e872d..6cd3cd47cc3ea 100644 --- a/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc +++ b/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc @@ -2092,4 +2092,4 @@ void GEMTnPEfficiencyTask::analyze(const edm::Event& event, const edm::EventSetu std::string GEMTnPEfficiencyTask::topFolder() const { return "GEM/Segment_TnP/"; }; -DEFINE_FWK_MODULE(GEMTnPEfficiencyTask); +DEFINE_FWK_MODULE(GEMTnPEfficiencyTask); \ No newline at end of file From bf40e404b22a882b27210367369d42a8e0c77ba7 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 17 Sep 2024 08:29:54 +0200 Subject: [PATCH 2/9] Make Era dependent ZDV geometry - backport #45511 --- Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc b/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc index f244687b6856a..68b32190ed7e2 100644 --- a/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc +++ b/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc @@ -21,9 +21,10 @@ //#define EDM_ML_DEBUG ZdcTopologyEP::ZdcTopologyEP(const edm::ParameterSet& conf) - : m_hdcToken{setWhatProduced(this, &ZdcTopologyEP::produce).consumes(edm::ESInputTag{})} { + : m_hdcToken{setWhatProduced(this, &ZdcTopologyEP::produce).consumes(edm::ESInputTag{})}, + m_restrictions(conf.getUntrackedParameter("Exclude")) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HCalGeom") << "ZdcTopologyEP::ZdcTopologyEP"; + edm::LogVerbatim("HCalGeom") << "ZdcTopologyEP::ZdcTopologyEP with Exclude: " << m_restrictions; #endif } From aff2d41c5f2c916639cd0a239246887f05fe2296 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Thu, 19 Sep 2024 18:02:55 +0200 Subject: [PATCH 3/9] Backport from #46033 new definition of 2024 Geometry Scenario of CMS --- Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc b/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc index 68b32190ed7e2..f244687b6856a 100644 --- a/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc +++ b/Geometry/ForwardGeometry/plugins/ZdcTopologyEP.cc @@ -21,10 +21,9 @@ //#define EDM_ML_DEBUG ZdcTopologyEP::ZdcTopologyEP(const edm::ParameterSet& conf) - : m_hdcToken{setWhatProduced(this, &ZdcTopologyEP::produce).consumes(edm::ESInputTag{})}, - m_restrictions(conf.getUntrackedParameter("Exclude")) { + : m_hdcToken{setWhatProduced(this, &ZdcTopologyEP::produce).consumes(edm::ESInputTag{})} { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HCalGeom") << "ZdcTopologyEP::ZdcTopologyEP with Exclude: " << m_restrictions; + edm::LogVerbatim("HCalGeom") << "ZdcTopologyEP::ZdcTopologyEP"; #endif } From a2d677353f5e221982f829a883eee222c970742e Mon Sep 17 00:00:00 2001 From: Rajarshi Bhattacharya Date: Fri, 4 Oct 2024 23:42:01 +0200 Subject: [PATCH 4/9] VXBS Covariance matrix --- PhysicsTools/NanoAOD/python/muons_cff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PhysicsTools/NanoAOD/python/muons_cff.py b/PhysicsTools/NanoAOD/python/muons_cff.py index 0176b47cc8f56..f94a6d4937588 100644 --- a/PhysicsTools/NanoAOD/python/muons_cff.py +++ b/PhysicsTools/NanoAOD/python/muons_cff.py @@ -204,6 +204,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("? muonBestTrack().isNonnull() && muonBestTrack().isAvailable() ? muonBestTrack().covariance(0,0) : -999",float,doc="0, 0 element of the VXBS Covariance matrix", precision=16), + VXBS_Cov03 = Var("? muonBestTrack().isNonnull() && muonBestTrack().isAvailable() ? muonBestTrack().covariance(0,3) : -999",float,doc="0, 3 element of the VXBS Covariance matrix", precision=16), + VXBS_Cov33 = Var("? muonBestTrack().isNonnull() && muonBestTrack().isAvailable() ? muonBestTrack().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), From bf6c8d247fbc0b31e6bd31e2f01af3fe2dd7351b Mon Sep 17 00:00:00 2001 From: Rajarshi Bhattacharya Date: Sun, 6 Oct 2024 14:01:09 +0200 Subject: [PATCH 5/9] Added the dxyBsErr --- PhysicsTools/NanoAOD/python/muons_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PhysicsTools/NanoAOD/python/muons_cff.py b/PhysicsTools/NanoAOD/python/muons_cff.py index f94a6d4937588..4f92733eaeef7 100644 --- a/PhysicsTools/NanoAOD/python/muons_cff.py +++ b/PhysicsTools/NanoAOD/python/muons_cff.py @@ -161,6 +161,7 @@ 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="dx 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), From b2f67e60dec82ee963f3b716613e039ca857ba82 Mon Sep 17 00:00:00 2001 From: Rajarshi Bhattacharya Date: Mon, 7 Oct 2024 14:53:43 +0200 Subject: [PATCH 6/9] Just cleanup --- DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc b/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc index 6cd3cd47cc3ea..8c2b0008e872d 100644 --- a/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc +++ b/DQMOffline/MuonDPG/plugins/GEMTnPEfficiencyTask.cc @@ -2092,4 +2092,4 @@ void GEMTnPEfficiencyTask::analyze(const edm::Event& event, const edm::EventSetu std::string GEMTnPEfficiencyTask::topFolder() const { return "GEM/Segment_TnP/"; }; -DEFINE_FWK_MODULE(GEMTnPEfficiencyTask); \ No newline at end of file +DEFINE_FWK_MODULE(GEMTnPEfficiencyTask); From ba405f1a9d0c25ff1b0720e209933393d5cb2689 Mon Sep 17 00:00:00 2001 From: Rajarshi Bhattacharya Date: Fri, 11 Oct 2024 16:15:41 +0200 Subject: [PATCH 7/9] Error fixes, the covaraince matrix is now taken from tunePMuonBestTrack, instead of muonBestTrack, which was a mistake --- PhysicsTools/NanoAOD/python/muons_cff.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/muons_cff.py b/PhysicsTools/NanoAOD/python/muons_cff.py index 4f92733eaeef7..7666de7d8ff86 100644 --- a/PhysicsTools/NanoAOD/python/muons_cff.py +++ b/PhysicsTools/NanoAOD/python/muons_cff.py @@ -161,7 +161,7 @@ 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="dx uncertainty wrt the beam spot, in cm", precision=6), + 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), @@ -205,9 +205,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("? muonBestTrack().isNonnull() && muonBestTrack().isAvailable() ? muonBestTrack().covariance(0,0) : -999",float,doc="0, 0 element of the VXBS Covariance matrix", precision=16), - VXBS_Cov03 = Var("? muonBestTrack().isNonnull() && muonBestTrack().isAvailable() ? muonBestTrack().covariance(0,3) : -999",float,doc="0, 3 element of the VXBS Covariance matrix", precision=16), - VXBS_Cov33 = Var("? muonBestTrack().isNonnull() && muonBestTrack().isAvailable() ? muonBestTrack().covariance(3,3) : -999",float,doc="3, 3 element of the VXBS Covariance matrix", precision=16), + 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), From 0ecde6215e8243e6742f7a05078a919b0a02a1e5 Mon Sep 17 00:00:00 2001 From: Rajarshi Bhattacharya Date: Thu, 24 Oct 2024 10:41:24 +0200 Subject: [PATCH 8/9] Implementation of new variables in nanoDQM --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 4184faf87f947..5fb22104bd7e2 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -549,6 +549,7 @@ 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'), @@ -602,6 +603,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( From bb867d1fe7d692ab7cf2cdbf2f77666ab4867cbe Mon Sep 17 00:00:00 2001 From: Rajarshi Bhattacharya Date: Fri, 25 Oct 2024 11:10:20 +0200 Subject: [PATCH 9/9] tuneP charge is added to NanoAOD --- PhysicsTools/NanoAOD/python/custom_muon_cff.py | 3 ++- PhysicsTools/NanoAOD/python/muons_cff.py | 1 + PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/NanoAOD/python/custom_muon_cff.py b/PhysicsTools/NanoAOD/python/custom_muon_cff.py index 8646fa847e3e2..fb2d947a8d7c5 100644 --- a/PhysicsTools/NanoAOD/python/custom_muon_cff.py +++ b/PhysicsTools/NanoAOD/python/custom_muon_cff.py @@ -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 diff --git a/PhysicsTools/NanoAOD/python/muons_cff.py b/PhysicsTools/NanoAOD/python/muons_cff.py index 7666de7d8ff86..073b8c331d6e5 100644 --- a/PhysicsTools/NanoAOD/python/muons_cff.py +++ b/PhysicsTools/NanoAOD/python/muons_cff.py @@ -158,6 +158,7 @@ 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), diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 5fb22104bd7e2..a814fa33eda8f 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -546,6 +546,7 @@ 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'),