Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make SeedingPerformanceWriter thread-safe #3850

Merged
Merged
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
8 changes: 3 additions & 5 deletions Examples/Io/Root/src/SeedingPerformanceWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "ActsExamples/Utilities/EventDataTransforms.hpp"
#include "ActsExamples/Validation/TrackClassification.hpp"
#include "ActsFatras/EventData/Barcode.hpp"
#include "ActsFatras/EventData/Particle.hpp"

#include <cstddef>
#include <ostream>
Expand All @@ -28,10 +27,6 @@
using Acts::VectorHelpers::eta;
using Acts::VectorHelpers::phi;

namespace ActsExamples {
struct AlgorithmContext;
} // namespace ActsExamples

ActsExamples::SeedingPerformanceWriter::SeedingPerformanceWriter(
ActsExamples::SeedingPerformanceWriter::Config config,
Acts::Logging::Level level)
Expand Down Expand Up @@ -127,6 +122,9 @@ ActsExamples::ProcessCode ActsExamples::SeedingPerformanceWriter::writeT(
const auto& particles = m_inputParticles(ctx);
const auto& hitParticlesMap = m_inputMeasurementParticlesMap(ctx);

// Exclusive access to the tree while writing
std::lock_guard<std::mutex> lock(m_writeMutex);

std::size_t nSeeds = seeds.size();
std::size_t nMatchedSeeds = 0;
// Map from particles to how many times they were successfully found by a seed
Expand Down
Loading