26 #include <unordered_map>
30 #include <RtypesCore.h>
99 throw std::invalid_argument(
"Missing proto tracks input collection");
102 throw std::invalid_argument(
"Missing hit-particles map input collection");
105 throw std::invalid_argument(
"Missing particles input collection");
108 throw std::invalid_argument(
"Missing output filename");
118 if (
file ==
nullptr) {
119 throw std::invalid_argument(
"Could not open '" +
cfg.
filePath +
"'");
155 const HitParticlesMap& hitParticlesMap,
160 std::unordered_map<ActsFatras::Barcode, std::size_t> reconCount;
161 reconCount.reserve(particles.size());
163 std::unordered_map<ActsFatras::Barcode, std::size_t> majorityCount;
164 majorityCount.reserve(particles.size());
166 std::vector<ParticleHitCount> particleHitCounts;
170 std::lock_guard<std::mutex> guardTrk(
trkMutex);
171 for (
size_t itrack = 0; itrack < tracks.size(); ++itrack) {
172 const auto& track = tracks[itrack];
180 if (not particleHitCounts.empty()) {
181 auto it = majorityCount
182 .try_emplace(particleHitCounts.front().particleId, 0
u)
186 for (
const auto& hc : particleHitCounts) {
187 auto it = reconCount.try_emplace(hc.particleId, 0
u).first;
198 for (
const auto& phc : particleHitCounts) {
201 auto trueParticleHits =
202 makeRange(particleHitsMap.equal_range(phc.particleId.value()));
213 std::lock_guard<std::mutex> guardPrt(
trkMutex);
214 for (
const auto&
particle : particles) {
236 auto nt = reconCount.find(
particle.particleId());
238 auto nm = majorityCount.find(
particle.particleId());
247 if (
file ==
nullptr) {
259 :
WriterT(config.inputProtoTracks,
"TrackFinderPerformanceWriter", level),
268 const auto&
particles = m_impl->inputParticles(ctx);
269 const auto& hitParticlesMap = m_impl->inputMeasurementParticlesMap(ctx);