Skip to content

Commit

Permalink
Merge pull request #44325 from JunquanTao/nanoaod_pvsumpxpy_sw_14_0
Browse files Browse the repository at this point in the history
[CMSSW_14_0_X] Add two more PV variables requested by H->gammagamma c…
  • Loading branch information
cmsbuild authored Mar 6, 2024
2 parents 98f3100 + 0dedcaf commit 1da5922
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PhysicsTools/NanoAOD/plugins/VertexTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void VertexTableProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe
pvTable->addColumnValue<float>(
"score", pvsScoreProd.get(pvsIn.id(), 0), "main primary vertex score, i.e. sum pt2 of clustered objects", 8);

float pv_sumpt2 = 0.0;
float pv_sumpt2 = 0.0, pv_sumpx = 0.0, pv_sumpy = 0.0;
for (const auto& obj : *pfcIn) {
if (obj.charge() == 0) {
continue;
Expand All @@ -146,10 +146,14 @@ void VertexTableProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe
if (include_pfc) {
float pfc_pt = obj.pt();
pv_sumpt2 += pfc_pt * pfc_pt;
pv_sumpx += obj.px();
pv_sumpy += obj.py();
}
}
pvTable->addColumnValue<float>(
"sumpt2", pv_sumpt2, "sum pt2 of pf charged candidates for the main primary vertex", 10);
pvTable->addColumnValue<float>("sumpx", pv_sumpx, "sum px of pf charged candidates for the main primary vertex", 10);
pvTable->addColumnValue<float>("sumpy", pv_sumpy, "sum py of pf charged candidates for the main primary vertex", 10);

auto otherPVsTable =
std::make_unique<nanoaod::FlatTable>((*pvsIn).size() > 4 ? 3 : (*pvsIn).size() - 1, "Other" + pvName_, false);
Expand Down
2 changes: 2 additions & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,8 @@
Plot1D('npvsGood', 'npvsGood', 20, 0, 60, 'total number of Good primary vertices'),
Plot1D('score', 'score', 20, 0, 300000, 'main primary vertex score, i.e. sum pt2 of clustered objects'),
Plot1D('sumpt2', 'sumpt2', 100, 0, 300000, 'main primary vertex sum pt2 of the charged pf candidates'),
Plot1D('sumpx', 'sumpx', 20, -100, 100, 'main primary vertex sum px of the charged pf candidates'),
Plot1D('sumpy', 'sumpy', 20, -100, 100, 'main primary vertex sum py of the charged pf candidates'),
Plot1D('x', 'x', 20, -0.3, 0.3, 'main primary vertex position x coordinate'),
Plot1D('y', 'y', 20, -0.3, 0.3, 'main primary vertex position y coordinate'),
Plot1D('z', 'z', 20, -20, 20, 'main primary vertex position z coordinate'),
Expand Down

0 comments on commit 1da5922

Please sign in to comment.