From 8e1fc937dca86eefaa1c87a70014da36c816230a Mon Sep 17 00:00:00 2001 From: Massimiliano Galli Date: Thu, 28 Oct 2021 10:42:29 +0200 Subject: [PATCH 1/3] Fix: exclude main PV from OtherPV_z in nano --- PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc b/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc index ca776d47ae56c..dc3f699c57c97 100644 --- a/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc @@ -136,7 +136,7 @@ void VertexTableProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe std::make_unique((*pvsIn).size() > 4 ? 3 : (*pvsIn).size() - 1, "Other" + pvName_, false); std::vector pvsz; for (size_t i = 1; i < (*pvsIn).size() && i < 4; i++) - pvsz.push_back((*pvsIn)[i - 1].position().z()); + pvsz.push_back((*pvsIn)[i].position().z()); otherPVsTable->addColumn("z", pvsz, "Z position of other primary vertices, excluding the main PV", 8); edm::Handle> svsIn; From eb31c6acc71f764a0d49c8e9c230e626b6e86ad4 Mon Sep 17 00:00:00 2001 From: Massimiliano Galli Date: Thu, 28 Oct 2021 09:29:00 +0200 Subject: [PATCH 2/3] Add scores for other vertices --- PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc b/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc index dc3f699c57c97..55bce4e8ed283 100644 --- a/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc @@ -135,9 +135,13 @@ void VertexTableProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe auto otherPVsTable = std::make_unique((*pvsIn).size() > 4 ? 3 : (*pvsIn).size() - 1, "Other" + pvName_, false); std::vector pvsz; - for (size_t i = 1; i < (*pvsIn).size() && i < 4; i++) + std::vector pvscores; + for (size_t i = 1; i < (*pvsIn).size() && i < 4; i++) { pvsz.push_back((*pvsIn)[i].position().z()); + pvscores.push_back((*pvsScoreIn).get(pvsIn.id(), i)); + } otherPVsTable->addColumn("z", pvsz, "Z position of other primary vertices, excluding the main PV", 8); + otherPVsTable->addColumn("score", pvscores, "scores of other primary vertices, excluding the main PV", 8); edm::Handle> svsIn; iEvent.getByToken(svs_, svsIn); From 045cd9efed6521d848f5fb2b68cf6efbaf09ed9f Mon Sep 17 00:00:00 2001 From: Massimiliano Galli Date: Fri, 29 Oct 2021 09:34:30 +0200 Subject: [PATCH 3/3] Add other vertices score to DQM --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index d7bcda94674c6..9a2c7572ce5f1 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -551,6 +551,7 @@ plots = cms.VPSet( NoPlot('_size'), Plot1D('z', 'z', 20, -20, 20, 'Z position of other primary vertices, excluding the main PV'), + Plot1D('score', 'score', 20, 0, 300000, 'scores of other primary vertices, excluding the main PV'), ) ), PPSLocalTrack = cms.PSet(