Skip to content
Open
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
18 changes: 13 additions & 5 deletions src/algorithms/reco/MatchClusters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ void MatchClusters::process(const MatchClusters::Input& input,
}

if (clusterMap.contains(mcID)) {
const auto& clus = clusterMap[mcID];
debug(" --> found matching cluster with energy: {}", clus.getEnergy());
debug(" --> adding cluster to reconstructed particle");
outpart.addToClusters(clus);
clusterMap.erase(mcID);
const auto& mc_particle = (*mcparticles)[mcID];

// Only match cluster if the MC particle is actually charged
if (mc_particle.getCharge() != 0.0F) {
const auto& clus = clusterMap[mcID];
debug(" --> found matching cluster with energy: {}", clus.getEnergy());
debug(" --> adding cluster to reconstructed particle");
outpart.addToClusters(clus);
clusterMap.erase(mcID);
} else {
debug(" --> mcID {} corresponds to neutral particle (PDG: {}), skipping cluster match",
mcID, mc_particle.getPDG());
}
}

// create truth associations
Expand Down
Loading