Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminhuth committed Jan 29, 2025
1 parent 841eb03 commit c4403c5
Showing 1 changed file with 20 additions and 38 deletions.
58 changes: 20 additions & 38 deletions Examples/Io/Root/src/TrackFinderPerformanceWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,45 +174,11 @@ ProcessCode TrackFinderPerformanceWriter::writeT(
std::vector<float> inputFeatures(3);

ACTS_DEBUG("Collect information from " << tracks.size() << " tracks");
std::size_t unmatched = 0, missingRefSurface = 0, filled = 0;
std::size_t unmatched = 0, missingRefSurface = 0;
for (const auto& track : tracks) {
// Counting number of total trajectories
m_nTotalTracks++;

// Check if the reco track has fitted track parameters
if (!track.hasReferenceSurface()) {
ACTS_WARNING("No fitted track parameters for track, index = "
<< track.index() << " tip index = " << track.tipIndex());
continue;
}

Acts::BoundTrackParameters fittedParameters =
track.createParametersAtReference();

// Fill the trajectory summary info
m_trackSummaryPlotTool.fill(m_trackSummaryPlotCache, fittedParameters,
track.nTrackStates(), track.nMeasurements(),
track.nOutliers(), track.nHoles(),
track.nSharedHits());

// Get the truth matching information
auto imatched = trackParticleMatching.find(track.index());
if (imatched == trackParticleMatching.end()) {
ACTS_DEBUG("No truth matching information for this track, index = "
<< track.index() << " tip index = " << track.tipIndex());
continue;
}

const auto& particleMatch = imatched->second;

if (particleMatch.classification == TrackMatchClassification::Fake) {
m_nTotalFakeTracks++;
}

if (particleMatch.classification == TrackMatchClassification::Duplicate) {
m_nTotalDuplicateTracks++;
}

// Check if the reco track has fitted track parameters
if (!track.hasReferenceSurface()) {
ACTS_VERBOSE("No fitted track parameters for track, index = "
Expand Down Expand Up @@ -256,6 +222,25 @@ ProcessCode TrackFinderPerformanceWriter::writeT(
nOutliers, nHoles, nSharedHits);
}

// Get the truth matching information
auto imatched = trackParticleMatching.find(track.index());
if (imatched == trackParticleMatching.end()) {
ACTS_DEBUG("No truth matching information for this track, index = "
<< track.index() << " tip index = " << track.tipIndex());
unmatched++;
continue;
}

const auto& particleMatch = imatched->second;

if (particleMatch.classification == TrackMatchClassification::Fake) {
m_nTotalFakeTracks++;
}

if (particleMatch.classification == TrackMatchClassification::Duplicate) {
m_nTotalDuplicateTracks++;
}

// Fill fake rate plots
m_fakeRatePlotTool.fill(
m_fakeRatePlotCache, fittedParameters,
Expand All @@ -265,11 +250,8 @@ ProcessCode TrackFinderPerformanceWriter::writeT(
m_duplicationPlotTool.fill(
m_duplicationPlotCache, fittedParameters,
particleMatch.classification == TrackMatchClassification::Duplicate);

filled++;
}

ACTS_DEBUG("Filled track plots for " << filled << " tracks");
if (unmatched > 0) {
ACTS_DEBUG("No matching information found for " << unmatched << " tracks");
}
Expand Down

0 comments on commit c4403c5

Please sign in to comment.