Skip to content

Commit

Permalink
feat: Write sumPt2 in VertexPerformanceWriter (#2929)
Browse files Browse the repository at this point in the history
This can be used to disambiguate multiple reco vertices assigned to the
same truth vertex

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
andiwand and kodiakhq[bot] authored Feb 12, 2024
1 parent 3fa1300 commit 89450aa
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 1 deletion.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_smeared_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_truth_smeared_hist.root
Binary file not shown.
5 changes: 5 additions & 0 deletions CI/physmon/vertexing_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ histograms:
nbins: 100
min: -0.01
max: 1.01

"sumPt2":
nbins: 100
min: 0
max: 700

extra_histograms:
- expression: df["nRecoVtx"] / df["nTrueVtx"]
Expand Down
5 changes: 5 additions & 0 deletions CI/physmon/vertexing_ttbar_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ histograms:
nbins: 100
min: 0.999
max: 1

"sumPt2":
nbins: 100
min: 0
max: 400

extra_histograms:
- expression: df["nRecoVtx"] / df["nTrueVtx"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ ActsExamples::VertexPerformanceWriter::VertexPerformanceWriter(
m_outputTree->Branch("covYT", &m_covYT);
m_outputTree->Branch("covZT", &m_covZT);

m_outputTree->Branch("sumPt2", &m_sumPt2);

// Branches related to track momenta at vertex
m_outputTree->Branch("trk_truthPhi", &m_truthPhi);
m_outputTree->Branch("trk_truthTheta", &m_truthTheta);
Expand Down Expand Up @@ -593,6 +595,16 @@ ActsExamples::ProcessCode ActsExamples::VertexPerformanceWriter::writeT(
m_covZT.push_back(vtx.fullCovariance()(
Acts::FreeIndices::eFreePos2, Acts::FreeIndices::eFreeTime));

double sumPt2 = 0;
for (const auto& trk : tracksAtVtx) {
if (trk.trackWeight > m_cfg.minTrkWeight) {
double pt = trk.originalParams.as<Acts::BoundTrackParameters>()
->transverseMomentum();
sumPt2 += pt * pt;
}
}
m_sumPt2.push_back(sumPt2);

m_nTracksOnTruthVertex.push_back(nTracksOnTruthVertex);
m_nTracksOnRecoVertex.push_back(nTracksOnRecoVertex);

Expand Down Expand Up @@ -749,6 +761,7 @@ ActsExamples::ProcessCode ActsExamples::VertexPerformanceWriter::writeT(
m_covYZ.clear();
m_covYT.clear();
m_covZT.clear();
m_sumPt2.clear();
m_truthPhi.clear();
m_truthTheta.clear();
m_truthQOverP.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class VertexPerformanceWriter final
std::vector<double> m_recoZ;
std::vector<double> m_recoT;

/// Difference of reconstructed and true vertex 4D position
// Difference of reconstructed and true vertex 4D position
std::vector<double> m_resX;
std::vector<double> m_resY;
std::vector<double> m_resZ;
Expand All @@ -143,6 +143,9 @@ class VertexPerformanceWriter final
std::vector<double> m_covYT;
std::vector<double> m_covZT;

// Sum pT^2 of all tracks associated with the vertex
std::vector<double> m_sumPt2;

//--------------------------------------------------------------
// Track-related variables are contained in a vector of vectors: The inner
// vectors contain the values of all tracks corresponding to one vertex. The
Expand Down

0 comments on commit 89450aa

Please sign in to comment.