Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Mar 19, 2024
1 parent 182feb3 commit d4b74e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ ActsExamples::ProcessCode ProtoTrackTruthMatcher::execute(
// Check if the trajectory is matched with truth.
// If not, it will be classified as 'fake'
const bool recoMatched =
static_cast<float>(nMajorityHits) / protoTrack.size() >=
static_cast<double>(nMajorityHits) / protoTrack.size() >=
m_cfg.matchingRatio;
const bool truthMatched =
static_cast<float>(nMajorityHits) /
static_cast<double>(nMajorityHits) /
particleTruthHitCount.at(majorityParticleId) >=
m_cfg.matchingRatio;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ActsExamples::ProcessCode TrackTruthMatcher::execute(
}

// Get the majority particleId and majority particle counts
// Note that the majority particle might be not in the truth seeds
// Note that the majority particle might not be in the truth seeds
// collection
ActsFatras::Barcode majorityParticleId =
particleHitCounts.front().particleId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,26 +184,25 @@ struct ActsExamples::TrackFinderPerformanceWriter::Impl {
}
const auto& particleMatch = imatched->second;

// Get the barcode of the majority truth particle
SimBarcode majorityParticleId = particleMatch.particle.value();
if (particleMatch.particle.has_value()) {
SimBarcode majorityParticleId = particleMatch.particle.value();

if (!particleMatch.contributingParticles.empty()) {
auto it = majorityCount.try_emplace(majorityParticleId, 0u).first;
it->second += 1;

// Find the truth particle via the barcode
if (auto ip = particles.find(majorityParticleId);
ip == particles.end()) {
ACTS_WARNING(
"Majority particle not found in the particles collection.");
}
}

for (const auto& hc : particleMatch.contributingParticles) {
auto it = reconCount.try_emplace(hc.particleId, 0u).first;
it->second += 1;
}

// Find the truth particle via the barcode
if (auto ip = particles.find(majorityParticleId);
ip == particles.end()) {
ACTS_WARNING(
"Majority particle not found in the particles collection.");
continue;
}

trkEventId = eventId;
trkTrackId = itrack;
trkNumHits = track.size();
Expand Down

0 comments on commit d4b74e4

Please sign in to comment.