Skip to content

Commit

Permalink
Merge pull request #35872 from maxgalli/fix_vertexz
Browse files Browse the repository at this point in the history
Fix: exclude main PV from OtherPV_z in nano
  • Loading branch information
cmsbuild authored Nov 23, 2021
2 parents fb2249f + 045cd9e commit 58e4621
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@ void VertexTableProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe
auto otherPVsTable =
std::make_unique<nanoaod::FlatTable>((*pvsIn).size() > 4 ? 3 : (*pvsIn).size() - 1, "Other" + pvName_, false);
std::vector<float> pvsz;
for (size_t i = 1; i < (*pvsIn).size() && i < 4; i++)
pvsz.push_back((*pvsIn)[i - 1].position().z());
std::vector<float> 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<float>("z", pvsz, "Z position of other primary vertices, excluding the main PV", 8);
otherPVsTable->addColumn<float>("score", pvscores, "scores of other primary vertices, excluding the main PV", 8);

edm::Handle<edm::View<reco::VertexCompositePtrCandidate>> svsIn;
iEvent.getByToken(svs_, svsIn);
Expand Down
1 change: 1 addition & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 58e4621

Please sign in to comment.