Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Write sumPt2 in VertexPerformanceWriter #2929

Merged
merged 8 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading