Skip to content

Commit

Permalink
ci: monitor track weights after vertex fit (#2761)
Browse files Browse the repository at this point in the history
Adds histograms of the track weights from the vertex fit to our physics monitoring. For unweighted vertex fitters, the track weights are 1.
  • Loading branch information
felix-russo authored Dec 4, 2023
1 parent 81351f1 commit 7e9d262
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 0 deletions.
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 @@ -84,6 +84,11 @@ histograms:
nbins: 100
min: 0.999
max: 1

"trk_weight":
nbins: 100
min: -0.01
max: 1.01

extra_histograms:
- expression: df["nRecoVtx"] / df["nTrueVtx"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ ActsExamples::VertexPerformanceWriter::VertexPerformanceWriter(
m_outputTree->Branch("trk_pullQOverP", &m_pullQOverP);
m_outputTree->Branch("trk_pullQOverPFitted", &m_pullQOverPFitted);

m_outputTree->Branch("trk_weight", &m_trkWeight);

m_outputTree->Branch("nTracksTruthVtx", &m_nTracksOnTruthVertex);
m_outputTree->Branch("nTracksRecoVtx", &m_nTracksOnRecoVertex);

Expand Down Expand Up @@ -489,6 +491,8 @@ ActsExamples::ProcessCode ActsExamples::VertexPerformanceWriter::writeT(
auto& innerPullThetaFitted = m_pullThetaFitted.emplace_back();
auto& innerPullQOverPFitted = m_pullQOverPFitted.emplace_back();

auto& innerTrkWeight = m_trkWeight.emplace_back();

for (std::size_t j = 0; j < associatedTruthParticles.size(); ++j) {
const auto& particle = associatedTruthParticles[j];
int priVtxId = particle.particleId().vertexPrimary();
Expand Down Expand Up @@ -687,6 +691,8 @@ ActsExamples::ProcessCode ActsExamples::VertexPerformanceWriter::writeT(
innerPullQOverPFitted.push_back(
pull(diffMomFitted[2], momCovFitted(2, 2), "q/p"));

innerTrkWeight.push_back(trk.trackWeight);

const auto& recoUnitDirFitted = paramsAtVtxFitted->direction();
double overlapFitted = trueUnitDir.dot(recoUnitDirFitted);
innerMomOverlapFitted.push_back(overlapFitted);
Expand Down Expand Up @@ -752,6 +758,8 @@ ActsExamples::ProcessCode ActsExamples::VertexPerformanceWriter::writeT(
m_pullQOverP.clear();
m_pullQOverPFitted.clear();

m_trkWeight.clear();

m_nTracksOnTruthVertex.clear();
m_nTracksOnRecoVertex.clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ class VertexPerformanceWriter final
std::vector<std::vector<double>> m_pullQOverP;
std::vector<std::vector<double>> m_pullQOverPFitted;

// Track weights from vertex fit, will be set to 1 if we do unweighted vertex
// fitting
std::vector<std::vector<double>> m_trkWeight;

// Number of tracks associated with truth/reconstructed vertex
std::vector<int> m_nTracksOnTruthVertex;
std::vector<int> m_nTracksOnRecoVertex;
Expand Down

0 comments on commit 7e9d262

Please sign in to comment.