From 45312a32b99bdc04bbb454721305167b42b8969f Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sat, 9 Nov 2024 20:09:37 +0100 Subject: [PATCH 1/7] feat: `MeasurementSelector` and reworked `HitSelector` for Examples --- .../TruthTracking/HitSelector.cpp | 84 ++++++++++++++++++ .../TruthTracking/HitSelector.hpp | 86 +++++++++++++++++++ .../TruthTracking/MeasurementSelector.cpp | 80 +++++++++++++++++ .../TruthTracking/MeasurementSelector.hpp | 66 ++++++++++++++ .../TruthTracking/ParticleSelector.cpp | 16 +++- .../TruthTracking/ParticleSelector.hpp | 9 +- .../Algorithms/TruthTracking/CMakeLists.txt | 2 + Examples/Algorithms/Utilities/CMakeLists.txt | 1 - .../ActsExamples/Utilities/HitSelector.hpp | 50 ----------- .../Algorithms/Utilities/src/HitSelector.cpp | 33 ------- .../ActsExamples/EventData/Measurement.hpp | 31 ++++--- .../EventData/MeasurementConcept.hpp | 2 +- Examples/Python/src/TruthTracking.cpp | 17 +++- 13 files changed, 374 insertions(+), 103 deletions(-) create mode 100644 Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp create mode 100644 Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp create mode 100644 Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp create mode 100644 Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp delete mode 100644 Examples/Algorithms/Utilities/include/ActsExamples/Utilities/HitSelector.hpp delete mode 100644 Examples/Algorithms/Utilities/src/HitSelector.cpp diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp new file mode 100644 index 00000000000..3935d5df543 --- /dev/null +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp @@ -0,0 +1,84 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#include "ActsExamples/TruthTracking/HitSelector.hpp" + +#include "Acts/Utilities/MathHelpers.hpp" +#include "ActsExamples/EventData/SimHit.hpp" +#include "ActsExamples/EventData/SimParticle.hpp" + +ActsExamples::HitSelector::HitSelector(const Config& config, + Acts::Logging::Level level) + : IAlgorithm("HitSelector", level), m_cfg(config) { + m_inputHits.initialize(m_cfg.inputHits); + m_inputParticlesSelected.maybeInitialize(m_cfg.inputParticlesSelected); + m_outputHits.initialize(m_cfg.outputHits); + + ACTS_DEBUG("selection particles " << m_cfg.inputParticlesSelected); + ACTS_DEBUG("selection hit x [" << m_cfg.minX << "," << m_cfg.maxX << ")"); + ACTS_DEBUG("selection hit y [" << m_cfg.minY << "," << m_cfg.maxY << ")"); + ACTS_DEBUG("selection hit z [" << m_cfg.minZ << "," << m_cfg.maxZ << ")"); + ACTS_DEBUG("selection hit r [" << m_cfg.minR << "," << m_cfg.maxR << ")"); + ACTS_DEBUG("selection hit time [" << m_cfg.minTime << "," << m_cfg.maxTime + << ")"); + ACTS_DEBUG("selection hit energy loss [" << m_cfg.minEnergyLoss << "," + << m_cfg.maxEnergyLoss << ")"); + ACTS_DEBUG("selection primary vertex ID [" << m_cfg.minPrimaryVertexId << "," + << m_cfg.maxPrimaryVertexId + << ")"); +} + +ActsExamples::ProcessCode ActsExamples::HitSelector::execute( + const ActsExamples::AlgorithmContext& ctx) const { + const SimHitContainer& hits = m_inputHits(ctx); + const SimParticleContainer* particlesSelected = + m_inputParticlesSelected.isInitialized() ? &m_inputParticlesSelected(ctx) + : nullptr; + + std::vector unorderedHits; + unorderedHits.reserve(hits.size()); + + for (const auto& hit : hits) { + const double r = Acts::fastHypot(hit.position().x(), hit.position().y()); + const std::uint64_t primaryVertexId = hit.particleId().vertexPrimary(); + + const bool validParticle = (particlesSelected == nullptr) || + particlesSelected->contains(hit.particleId()); + const bool validX = + (m_cfg.minX <= hit.position().x()) && (hit.position().x() < m_cfg.maxX); + const bool validY = + (m_cfg.minY <= hit.position().y()) && (hit.position().y() < m_cfg.maxY); + const bool validZ = + (m_cfg.minZ <= hit.position().z()) && (hit.position().z() < m_cfg.maxZ); + const bool validR = (m_cfg.minR <= r) && (r < m_cfg.maxR); + const bool validTime = + (m_cfg.minTime <= hit.time()) && (hit.time() < m_cfg.maxTime); + const bool validEnergyLoss = + (m_cfg.minEnergyLoss <= hit.depositedEnergy()) && + (hit.depositedEnergy() < m_cfg.maxEnergyLoss); + const bool validPrimaryVertexId = + (m_cfg.minPrimaryVertexId <= primaryVertexId) && + (primaryVertexId < m_cfg.maxPrimaryVertexId); + + const bool validHit = validParticle && validX && validY && validZ && + validR && validTime && validEnergyLoss && + validPrimaryVertexId; + if (validHit) { + unorderedHits.push_back(hit); + } + } + + SimHitContainer selectedHits(unorderedHits.begin(), unorderedHits.end()); + + ACTS_DEBUG("selected " << selectedHits.size() << " from " << hits.size() + << " hits"); + + m_outputHits(ctx, std::move(selectedHits)); + + return ProcessCode::SUCCESS; +} diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp new file mode 100644 index 00000000000..fb3035cbb3b --- /dev/null +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp @@ -0,0 +1,86 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Utilities/Logger.hpp" +#include "ActsExamples/EventData/SimHit.hpp" +#include "ActsExamples/EventData/SimParticle.hpp" +#include "ActsExamples/Framework/DataHandle.hpp" +#include "ActsExamples/Framework/IAlgorithm.hpp" + +#include +#include + +namespace ActsExamples { + +/// Select hits by applying some selection cuts. +class HitSelector final : public IAlgorithm { + public: + struct Config { + /// Input hit collection. + std::string inputHits; + /// Optional input particle collection. + std::string inputParticlesSelected; + /// Output hit collection + std::string outputHits; + + /// Min x cut + double minX = -std::numeric_limits::max(); + /// Max x cut + double maxX = std::numeric_limits::max(); + + /// Min y cut + double minY = -std::numeric_limits::max(); + /// Max y cut + double maxY = std::numeric_limits::max(); + + /// Min z cut + double minZ = -std::numeric_limits::max(); + /// Max z cut + double maxZ = std::numeric_limits::max(); + + /// Min r cut + double minR = -std::numeric_limits::max(); + /// Max r cut + double maxR = std::numeric_limits::max(); + + /// Min time cut + double minTime = -std::numeric_limits::max(); + /// Max time cut + double maxTime = std::numeric_limits::max(); + + /// Min energy loss cut + double minEnergyLoss = 0; + /// Max energy loss cut + double maxEnergyLoss = std::numeric_limits::max(); + + /// Min primary vertex ID cut + std::uint64_t minPrimaryVertexId = 0; + /// Max primary vertex ID cut + std::uint64_t maxPrimaryVertexId = + std::numeric_limits::max(); + }; + + HitSelector(const Config& config, Acts::Logging::Level level); + + ProcessCode execute(const AlgorithmContext& ctx) const final; + + /// Get readonly access to the config parameters + const Config& config() const { return m_cfg; } + + private: + Config m_cfg; + + ReadDataHandle m_inputHits{this, "InputHits"}; + ReadDataHandle m_inputParticlesSelected{ + this, "InputParticlesSelected"}; + WriteDataHandle m_outputHits{this, "OutputHits"}; +}; + +} // namespace ActsExamples diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp new file mode 100644 index 00000000000..dbd8d41b7cd --- /dev/null +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp @@ -0,0 +1,80 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#include "ActsExamples/TruthTracking/MeasurementSelector.hpp" + +#include "ActsExamples/EventData/Measurement.hpp" + +ActsExamples::MeasurementSelector::MeasurementSelector( + const Config& config, Acts::Logging::Level level) + : IAlgorithm("MeasurementSelector", level), m_cfg(config) { + m_inputMeasurements.initialize(m_cfg.inputMeasurements); + m_inputMeasurementParticlesMap.initialize(m_cfg.inputMeasurementParticlesMap); + m_inputParticlesSelected.maybeInitialize(m_cfg.inputParticlesSelected); + m_outputMeasurements.initialize(m_cfg.outputMeasurements); + + ACTS_DEBUG("selection particles " << m_cfg.inputParticlesSelected); + ACTS_DEBUG("selection primary vertex ID [" << m_cfg.minPrimaryVertexId << "," + << m_cfg.maxPrimaryVertexId + << ")"); +} + +ActsExamples::ProcessCode ActsExamples::MeasurementSelector::execute( + const ActsExamples::AlgorithmContext& ctx) const { + const MeasurementContainer& measurements = m_inputMeasurements(ctx); + const auto& measurementParticlesMap = m_inputMeasurementParticlesMap(ctx); + const SimParticleContainer* particlesSelected = + m_inputParticlesSelected.isInitialized() ? &m_inputParticlesSelected(ctx) + : nullptr; + + MeasurementContainer selectedMeasurements; + IndexMultimap selectedMeasurementParticlesMap; + + for (const auto& measurement : measurements) { + const auto& particleIdRange = + measurementParticlesMap.equal_range(measurement.index()); + + bool particleSelected = false; + bool primaryVertexSelected = false; + + for (auto particleIdIt = particleIdRange.first; + particleIdIt != particleIdRange.second; ++particleIdIt) { + const auto& particleId = particleIdIt->second; + + particleSelected |= (particlesSelected == nullptr) || + particlesSelected->contains(particleId); + primaryVertexSelected |= + (particleId.vertexPrimary() >= m_cfg.minPrimaryVertexId) && + (particleId.vertexPrimary() < m_cfg.maxPrimaryVertexId); + } + + const bool selected = particleSelected && primaryVertexSelected; + + if (selected) { + const auto measurementIndex = selectedMeasurements.size(); + selectedMeasurements.copyMeasurement(measurement); + + for (auto particleIdIt = particleIdRange.first; + particleIdIt != particleIdRange.second; ++particleIdIt) { + const auto& particleId = particleIdIt->second; + + selectedMeasurementParticlesMap.emplace_hint( + measurementParticlesMap.end(), measurementIndex, particleId); + } + } + } + + ACTS_DEBUG("selected " << selectedMeasurements.size() << " from " + << measurements.size() << " hits"); + + m_outputMeasurements(ctx, std::move(selectedMeasurements)); + m_outputMeasurementParticlesMap(ctx, + std::move(selectedMeasurementParticlesMap)); + + return ProcessCode::SUCCESS; +} diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp new file mode 100644 index 00000000000..6760ba87c25 --- /dev/null +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp @@ -0,0 +1,66 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Utilities/Logger.hpp" +#include "ActsExamples/EventData/Measurement.hpp" +#include "ActsExamples/EventData/SimParticle.hpp" +#include "ActsExamples/Framework/DataHandle.hpp" +#include "ActsExamples/Framework/IAlgorithm.hpp" + +#include +#include + +namespace ActsExamples { + +/// Select measurements by applying some selection cuts. +class MeasurementSelector final : public IAlgorithm { + public: + struct Config { + /// Input measurement collection. + std::string inputMeasurements; + /// Input measurement particles map. + std::string inputMeasurementParticlesMap; + /// Optional input particle collection. + std::string inputParticlesSelected; + /// Output measurement collection + std::string outputMeasurements; + /// Output measurement particles map + std::string outputMeasurementParticlesMap; + + /// Min primary vertex ID cut + std::uint64_t minPrimaryVertexId = 0; + /// Max primary vertex ID cut + std::uint64_t maxPrimaryVertexId = + std::numeric_limits::max(); + }; + + MeasurementSelector(const Config& config, Acts::Logging::Level level); + + ProcessCode execute(const AlgorithmContext& ctx) const final; + + /// Get readonly access to the config parameters + const Config& config() const { return m_cfg; } + + private: + Config m_cfg; + + ReadDataHandle m_inputMeasurements{this, + "InputMeasurements"}; + ReadDataHandle> m_inputMeasurementParticlesMap{ + this, "MeasurementParticlesMap"}; + ReadDataHandle m_inputParticlesSelected{ + this, "InputParticlesSelected"}; + WriteDataHandle m_outputMeasurements{ + this, "OutputMeasurements"}; + WriteDataHandle> m_outputMeasurementParticlesMap{ + this, "OutputMeasurementParticlesMap"}; +}; + +} // namespace ActsExamples diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.cpp index 5fa3ee0e4b2..b162cddd5b9 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.cpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.cpp @@ -10,8 +10,6 @@ #include "Acts/Definitions/Common.hpp" #include "Acts/Utilities/VectorHelpers.hpp" -#include "ActsExamples/EventData/GeometryContainers.hpp" -#include "ActsExamples/EventData/IndexSourceLink.hpp" #include "ActsExamples/EventData/SimParticle.hpp" #include "ActsExamples/Framework/AlgorithmContext.hpp" #include "ActsFatras/EventData/Particle.hpp" @@ -56,9 +54,17 @@ ActsExamples::ParticleSelector::ParticleSelector(const Config& config, << ")"); ACTS_DEBUG("selection particle m [" << m_cfg.mMin << "," << m_cfg.mMax << ")"); + ACTS_DEBUG("selection particle measurements [" + << m_cfg.measurementsMin << "," << m_cfg.measurementsMax << ")"); ACTS_DEBUG("remove charged particles " << m_cfg.removeCharged); ACTS_DEBUG("remove neutral particles " << m_cfg.removeNeutral); ACTS_DEBUG("remove secondary particles " << m_cfg.removeSecondaries); + ACTS_DEBUG("exclude pdgs: "); + for (auto pdg : m_cfg.excludeAbsPdgs) { + ACTS_DEBUG(" " << pdg); + } + ACTS_DEBUG("primary vertex ID [" << m_cfg.minPrimaryVertexId << "," + << m_cfg.maxPrimaryVertexId << ")"); } ActsExamples::ProcessCode ActsExamples::ParticleSelector::execute( @@ -86,6 +92,9 @@ ActsExamples::ProcessCode ActsExamples::ParticleSelector::execute( const bool validCharged = (p.charge() != 0) && !m_cfg.removeCharged; const bool validCharge = validNeutral || validCharged; const bool validSecondary = !m_cfg.removeSecondaries || !p.isSecondary(); + const bool validPrimaryVertexId = + within(p.particleId().vertexPrimary(), m_cfg.minPrimaryVertexId, + m_cfg.maxPrimaryVertexId); nInvalidCharge += static_cast(!validCharge); @@ -111,7 +120,8 @@ ActsExamples::ProcessCode ActsExamples::ParticleSelector::execute( } } - return validPdg && validCharge && validSecondary && validMeasurementCount && + return validPdg && validCharge && validSecondary && validPrimaryVertexId && + validMeasurementCount && within(p.transverseMomentum(), m_cfg.ptMin, m_cfg.ptMax) && within(std::abs(eta), m_cfg.absEtaMin, m_cfg.absEtaMax) && within(eta, m_cfg.etaMin, m_cfg.etaMax) && diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.hpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.hpp index de05bf621ca..5124306bee0 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.hpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.hpp @@ -8,10 +8,7 @@ #pragma once -#include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/EventData/Index.hpp" -#include "ActsExamples/EventData/Measurement.hpp" #include "ActsExamples/EventData/SimParticle.hpp" #include "ActsExamples/Framework/DataHandle.hpp" #include "ActsExamples/Framework/IAlgorithm.hpp" @@ -70,6 +67,12 @@ class ParticleSelector final : public IAlgorithm { bool removeSecondaries = false; /// Exclude particles depending on absolute pdg value std::vector excludeAbsPdgs; + + /// Min primary vertex ID cut + std::uint64_t minPrimaryVertexId = 0; + /// Max primary vertex ID cut + std::uint64_t maxPrimaryVertexId = + std::numeric_limits::max(); }; ParticleSelector(const Config& config, Acts::Logging::Level level); diff --git a/Examples/Algorithms/TruthTracking/CMakeLists.txt b/Examples/Algorithms/TruthTracking/CMakeLists.txt index 4594cdb7480..2cea3e8bd8c 100644 --- a/Examples/Algorithms/TruthTracking/CMakeLists.txt +++ b/Examples/Algorithms/TruthTracking/CMakeLists.txt @@ -9,6 +9,8 @@ add_library( ActsExamples/TruthTracking/TruthTrackFinder.cpp ActsExamples/TruthTracking/TruthVertexFinder.cpp ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp + ActsExamples/TruthTracking/HitSelector.cpp + ActsExamples/TruthTracking/MeasurementSelector.cpp ) target_include_directories( ActsExamplesTruthTracking diff --git a/Examples/Algorithms/Utilities/CMakeLists.txt b/Examples/Algorithms/Utilities/CMakeLists.txt index ba9419c1914..309ff662bc6 100644 --- a/Examples/Algorithms/Utilities/CMakeLists.txt +++ b/Examples/Algorithms/Utilities/CMakeLists.txt @@ -7,7 +7,6 @@ add_library( src/TrackSelectorAlgorithm.cpp src/TracksToTrajectories.cpp src/PrototracksToTracks.cpp - src/HitSelector.cpp src/TracksToParameters.cpp ) target_include_directories( diff --git a/Examples/Algorithms/Utilities/include/ActsExamples/Utilities/HitSelector.hpp b/Examples/Algorithms/Utilities/include/ActsExamples/Utilities/HitSelector.hpp deleted file mode 100644 index bb1f7ba24e8..00000000000 --- a/Examples/Algorithms/Utilities/include/ActsExamples/Utilities/HitSelector.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// This file is part of the ACTS project. -// -// Copyright (C) 2016 CERN for the benefit of the ACTS project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/TrackFinding/TrackSelector.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/EventData/SimHit.hpp" -#include "ActsExamples/Framework/DataHandle.hpp" -#include "ActsExamples/Framework/IAlgorithm.hpp" - -#include -#include -#include - -namespace ActsExamples { - -/// Select tracks by applying some selection cuts. -class HitSelector final : public IAlgorithm { - public: - struct Config { - /// Input track collection. - std::string inputHits; - /// Output track collection - std::string outputHits; - - /// Time cut - double maxTime = std::numeric_limits::max(); - }; - - HitSelector(const Config& config, Acts::Logging::Level level); - - ProcessCode execute(const AlgorithmContext& ctx) const final; - - /// Get readonly access to the config parameters - const Config& config() const { return m_cfg; } - - private: - Config m_cfg; - - ReadDataHandle m_inputHits{this, "InputHits"}; - WriteDataHandle m_outputHits{this, "OutputHits"}; -}; - -} // namespace ActsExamples diff --git a/Examples/Algorithms/Utilities/src/HitSelector.cpp b/Examples/Algorithms/Utilities/src/HitSelector.cpp deleted file mode 100644 index c9a33b5f65a..00000000000 --- a/Examples/Algorithms/Utilities/src/HitSelector.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// This file is part of the ACTS project. -// -// Copyright (C) 2016 CERN for the benefit of the ACTS project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Utilities/HitSelector.hpp" - -ActsExamples::HitSelector::HitSelector(const Config& config, - Acts::Logging::Level level) - : IAlgorithm("HitSelector", level), m_cfg(config) { - m_inputHits.initialize(m_cfg.inputHits); - m_outputHits.initialize(m_cfg.outputHits); -} - -ActsExamples::ProcessCode ActsExamples::HitSelector::execute( - const ActsExamples::AlgorithmContext& ctx) const { - const auto& hits = m_inputHits(ctx); - SimHitContainer selectedHits; - - std::copy_if(hits.begin(), hits.end(), - std::inserter(selectedHits, selectedHits.begin()), - [&](const auto& hit) { return hit.time() < m_cfg.maxTime; }); - - ACTS_DEBUG("selected " << selectedHits.size() << " from " << hits.size() - << " hits"); - - m_outputHits(ctx, std::move(selectedHits)); - - return {}; -} diff --git a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp index a0bf4559509..174dc05ef40 100644 --- a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp @@ -10,26 +10,16 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/TrackParametrization.hpp" -#include "Acts/EventData/MeasurementHelpers.hpp" #include "Acts/EventData/SubspaceHelpers.hpp" #include "Acts/EventData/Types.hpp" -#include "Acts/EventData/detail/CalculateResiduals.hpp" -#include "Acts/EventData/detail/ParameterTraits.hpp" -#include "Acts/EventData/detail/PrintParameters.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Utilities/Iterator.hpp" #include "ActsExamples/EventData/GeometryContainers.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" #include "ActsExamples/EventData/MeasurementConcept.hpp" -#include -#include -#include #include -#include -#include #include -#include #include #include @@ -139,6 +129,11 @@ class MeasurementContainer { return getMeasurement(addMeasurement(Size, geometryId)); } + template + VariableProxy copyMeasurement(const OtherDerived& other); + template + FixedProxy copyMeasurement(const OtherDerived& other); + template VariableProxy emplaceMeasurement(std::uint8_t size, Acts::GeometryIdentifier geometryId, @@ -495,6 +490,22 @@ class VariableMeasurementProxy } }; +template +MeasurementContainer::VariableProxy MeasurementContainer::copyMeasurement( + const OtherDerived& other) { + VariableProxy meas = makeMeasurement(other.size(), other.geometryId()); + meas.copyFrom(other); + return meas; +} + +template +MeasurementContainer::FixedProxy MeasurementContainer::copyMeasurement( + const OtherDerived& other) { + FixedProxy meas = makeMeasurement(other.geometryId()); + meas.copyFrom(other); + return meas; +} + template MeasurementContainer::VariableProxy MeasurementContainer::emplaceMeasurement( std::uint8_t size, Acts::GeometryIdentifier geometryId, Args&&... args) { diff --git a/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp b/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp index 14627a78c53..9394b1bf992 100644 --- a/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp @@ -8,7 +8,6 @@ #pragma once -#include "Acts/EventData/SourceLink.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include @@ -23,4 +22,5 @@ concept MeasurementConcept = requires(const T& m) { { m.parameters() }; { m.covariance() }; }; + } // namespace ActsExamples diff --git a/Examples/Python/src/TruthTracking.cpp b/Examples/Python/src/TruthTracking.cpp index 7278b3f821f..2a8398d847d 100644 --- a/Examples/Python/src/TruthTracking.cpp +++ b/Examples/Python/src/TruthTracking.cpp @@ -8,6 +8,8 @@ #include "Acts/Plugins/Python/Utilities.hpp" #include "Acts/Utilities/Logger.hpp" +#include "ActsExamples/TruthTracking/HitSelector.hpp" +#include "ActsExamples/TruthTracking/MeasurementSelector.hpp" #include "ActsExamples/TruthTracking/ParticleSelector.hpp" #include "ActsExamples/TruthTracking/ParticleSmearing.hpp" #include "ActsExamples/TruthTracking/TrackModifier.hpp" @@ -16,7 +18,6 @@ #include "ActsExamples/TruthTracking/TruthSeedingAlgorithm.hpp" #include "ActsExamples/TruthTracking/TruthTrackFinder.hpp" #include "ActsExamples/TruthTracking/TruthVertexFinder.hpp" -#include "ActsExamples/Utilities/HitSelector.hpp" #include @@ -87,6 +88,8 @@ void addTruthTracking(Context& ctx) { ACTS_PYTHON_MEMBER(removeNeutral); ACTS_PYTHON_MEMBER(removeSecondaries); ACTS_PYTHON_MEMBER(excludeAbsPdgs); + ACTS_PYTHON_MEMBER(minPrimaryVertexId); + ACTS_PYTHON_MEMBER(maxPrimaryVertexId); ACTS_PYTHON_STRUCT_END(); pythonRangeProperty(c, "rho", &Config::rhoMin, &Config::rhoMax); @@ -99,6 +102,8 @@ void addTruthTracking(Context& ctx) { pythonRangeProperty(c, "pt", &Config::ptMin, &Config::ptMax); pythonRangeProperty(c, "measurements", &Config::measurementsMin, &Config::measurementsMax); + pythonRangeProperty(c, "primaryVertexId", &Config::minPrimaryVertexId, + &Config::maxPrimaryVertexId); } { @@ -156,12 +161,20 @@ void addTruthTracking(Context& ctx) { outputParticles, outputSeeds, outputProtoTracks, deltaRMin, deltaRMax); ACTS_PYTHON_DECLARE_ALGORITHM(ActsExamples::HitSelector, mex, "HitSelector", - inputHits, outputHits, maxTime); + inputHits, inputParticlesSelected, outputHits, + minX, maxX, minY, maxY, minZ, maxZ, minR, maxR, + minTime, maxTime, minEnergyLoss, maxEnergyLoss, + minPrimaryVertexId, maxPrimaryVertexId); ACTS_PYTHON_DECLARE_ALGORITHM( ActsExamples::TrackTruthMatcher, mex, "TrackTruthMatcher", inputTracks, inputParticles, inputMeasurementParticlesMap, outputTrackParticleMatching, outputParticleTrackMatching, matchingRatio, doubleMatching); + + ACTS_PYTHON_DECLARE_ALGORITHM( + ActsExamples::MeasurementSelector, mex, "MeasurementSelector", + inputMeasurements, inputMeasurementParticlesMap, inputParticlesSelected, + outputMeasurements, minPrimaryVertexId, maxPrimaryVertexId); } } // namespace Acts::Python From 736a4a0197449cd79b2a7c229e989906433034ba Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Tue, 12 Nov 2024 10:10:46 +0100 Subject: [PATCH 2/7] remove measurement selector --- .../TruthTracking/MeasurementSelector.cpp | 80 ------------------- .../TruthTracking/MeasurementSelector.hpp | 66 --------------- .../Algorithms/TruthTracking/CMakeLists.txt | 1 - Examples/Python/src/TruthTracking.cpp | 6 -- 4 files changed, 153 deletions(-) delete mode 100644 Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp delete mode 100644 Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp deleted file mode 100644 index dbd8d41b7cd..00000000000 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// This file is part of the ACTS project. -// -// Copyright (C) 2016 CERN for the benefit of the ACTS project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -#include "ActsExamples/TruthTracking/MeasurementSelector.hpp" - -#include "ActsExamples/EventData/Measurement.hpp" - -ActsExamples::MeasurementSelector::MeasurementSelector( - const Config& config, Acts::Logging::Level level) - : IAlgorithm("MeasurementSelector", level), m_cfg(config) { - m_inputMeasurements.initialize(m_cfg.inputMeasurements); - m_inputMeasurementParticlesMap.initialize(m_cfg.inputMeasurementParticlesMap); - m_inputParticlesSelected.maybeInitialize(m_cfg.inputParticlesSelected); - m_outputMeasurements.initialize(m_cfg.outputMeasurements); - - ACTS_DEBUG("selection particles " << m_cfg.inputParticlesSelected); - ACTS_DEBUG("selection primary vertex ID [" << m_cfg.minPrimaryVertexId << "," - << m_cfg.maxPrimaryVertexId - << ")"); -} - -ActsExamples::ProcessCode ActsExamples::MeasurementSelector::execute( - const ActsExamples::AlgorithmContext& ctx) const { - const MeasurementContainer& measurements = m_inputMeasurements(ctx); - const auto& measurementParticlesMap = m_inputMeasurementParticlesMap(ctx); - const SimParticleContainer* particlesSelected = - m_inputParticlesSelected.isInitialized() ? &m_inputParticlesSelected(ctx) - : nullptr; - - MeasurementContainer selectedMeasurements; - IndexMultimap selectedMeasurementParticlesMap; - - for (const auto& measurement : measurements) { - const auto& particleIdRange = - measurementParticlesMap.equal_range(measurement.index()); - - bool particleSelected = false; - bool primaryVertexSelected = false; - - for (auto particleIdIt = particleIdRange.first; - particleIdIt != particleIdRange.second; ++particleIdIt) { - const auto& particleId = particleIdIt->second; - - particleSelected |= (particlesSelected == nullptr) || - particlesSelected->contains(particleId); - primaryVertexSelected |= - (particleId.vertexPrimary() >= m_cfg.minPrimaryVertexId) && - (particleId.vertexPrimary() < m_cfg.maxPrimaryVertexId); - } - - const bool selected = particleSelected && primaryVertexSelected; - - if (selected) { - const auto measurementIndex = selectedMeasurements.size(); - selectedMeasurements.copyMeasurement(measurement); - - for (auto particleIdIt = particleIdRange.first; - particleIdIt != particleIdRange.second; ++particleIdIt) { - const auto& particleId = particleIdIt->second; - - selectedMeasurementParticlesMap.emplace_hint( - measurementParticlesMap.end(), measurementIndex, particleId); - } - } - } - - ACTS_DEBUG("selected " << selectedMeasurements.size() << " from " - << measurements.size() << " hits"); - - m_outputMeasurements(ctx, std::move(selectedMeasurements)); - m_outputMeasurementParticlesMap(ctx, - std::move(selectedMeasurementParticlesMap)); - - return ProcessCode::SUCCESS; -} diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp deleted file mode 100644 index 6760ba87c25..00000000000 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/MeasurementSelector.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// This file is part of the ACTS project. -// -// Copyright (C) 2016 CERN for the benefit of the ACTS project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/EventData/Measurement.hpp" -#include "ActsExamples/EventData/SimParticle.hpp" -#include "ActsExamples/Framework/DataHandle.hpp" -#include "ActsExamples/Framework/IAlgorithm.hpp" - -#include -#include - -namespace ActsExamples { - -/// Select measurements by applying some selection cuts. -class MeasurementSelector final : public IAlgorithm { - public: - struct Config { - /// Input measurement collection. - std::string inputMeasurements; - /// Input measurement particles map. - std::string inputMeasurementParticlesMap; - /// Optional input particle collection. - std::string inputParticlesSelected; - /// Output measurement collection - std::string outputMeasurements; - /// Output measurement particles map - std::string outputMeasurementParticlesMap; - - /// Min primary vertex ID cut - std::uint64_t minPrimaryVertexId = 0; - /// Max primary vertex ID cut - std::uint64_t maxPrimaryVertexId = - std::numeric_limits::max(); - }; - - MeasurementSelector(const Config& config, Acts::Logging::Level level); - - ProcessCode execute(const AlgorithmContext& ctx) const final; - - /// Get readonly access to the config parameters - const Config& config() const { return m_cfg; } - - private: - Config m_cfg; - - ReadDataHandle m_inputMeasurements{this, - "InputMeasurements"}; - ReadDataHandle> m_inputMeasurementParticlesMap{ - this, "MeasurementParticlesMap"}; - ReadDataHandle m_inputParticlesSelected{ - this, "InputParticlesSelected"}; - WriteDataHandle m_outputMeasurements{ - this, "OutputMeasurements"}; - WriteDataHandle> m_outputMeasurementParticlesMap{ - this, "OutputMeasurementParticlesMap"}; -}; - -} // namespace ActsExamples diff --git a/Examples/Algorithms/TruthTracking/CMakeLists.txt b/Examples/Algorithms/TruthTracking/CMakeLists.txt index 2cea3e8bd8c..280e1104ce2 100644 --- a/Examples/Algorithms/TruthTracking/CMakeLists.txt +++ b/Examples/Algorithms/TruthTracking/CMakeLists.txt @@ -10,7 +10,6 @@ add_library( ActsExamples/TruthTracking/TruthVertexFinder.cpp ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp ActsExamples/TruthTracking/HitSelector.cpp - ActsExamples/TruthTracking/MeasurementSelector.cpp ) target_include_directories( ActsExamplesTruthTracking diff --git a/Examples/Python/src/TruthTracking.cpp b/Examples/Python/src/TruthTracking.cpp index a3113fc0a63..1502ce23d40 100644 --- a/Examples/Python/src/TruthTracking.cpp +++ b/Examples/Python/src/TruthTracking.cpp @@ -9,7 +9,6 @@ #include "Acts/Plugins/Python/Utilities.hpp" #include "Acts/Utilities/Logger.hpp" #include "ActsExamples/TruthTracking/HitSelector.hpp" -#include "ActsExamples/TruthTracking/MeasurementSelector.hpp" #include "ActsExamples/TruthTracking/ParticleSelector.hpp" #include "ActsExamples/TruthTracking/ParticleSmearing.hpp" #include "ActsExamples/TruthTracking/TrackModifier.hpp" @@ -168,11 +167,6 @@ void addTruthTracking(Context& ctx) { ActsExamples::TrackTruthMatcher, mex, "TrackTruthMatcher", inputTracks, inputParticles, inputMeasurementParticlesMap, outputTrackParticleMatching, outputParticleTrackMatching, matchingRatio, doubleMatching); - - ACTS_PYTHON_DECLARE_ALGORITHM( - ActsExamples::MeasurementSelector, mex, "MeasurementSelector", - inputMeasurements, inputMeasurementParticlesMap, inputParticlesSelected, - outputMeasurements, minPrimaryVertexId, maxPrimaryVertexId); } } // namespace Acts::Python From b6fbeb93f79e7b72c6fbc830cde70eb22903c035 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 10:37:38 +0100 Subject: [PATCH 3/7] pr feedback and cleanup --- .../ActsExamples/TruthTracking/HitSelector.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp index 3935d5df543..e6919e69349 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp @@ -12,8 +12,9 @@ #include "ActsExamples/EventData/SimHit.hpp" #include "ActsExamples/EventData/SimParticle.hpp" -ActsExamples::HitSelector::HitSelector(const Config& config, - Acts::Logging::Level level) +namespace ActsExamples { + +HitSelector::HitSelector(const Config& config, Acts::Logging::Level level) : IAlgorithm("HitSelector", level), m_cfg(config) { m_inputHits.initialize(m_cfg.inputHits); m_inputParticlesSelected.maybeInitialize(m_cfg.inputParticlesSelected); @@ -33,8 +34,7 @@ ActsExamples::HitSelector::HitSelector(const Config& config, << ")"); } -ActsExamples::ProcessCode ActsExamples::HitSelector::execute( - const ActsExamples::AlgorithmContext& ctx) const { +ProcessCode HitSelector::execute(const AlgorithmContext& ctx) const { const SimHitContainer& hits = m_inputHits(ctx); const SimParticleContainer* particlesSelected = m_inputParticlesSelected.isInitialized() ? &m_inputParticlesSelected(ctx) @@ -73,7 +73,9 @@ ActsExamples::ProcessCode ActsExamples::HitSelector::execute( } } - SimHitContainer selectedHits(unorderedHits.begin(), unorderedHits.end()); + // hits are still sorted after filtering + SimHitContainer selectedHits(boost::container::ordered_range_t{}, + unorderedHits.begin(), unorderedHits.end()); ACTS_DEBUG("selected " << selectedHits.size() << " from " << hits.size() << " hits"); @@ -82,3 +84,5 @@ ActsExamples::ProcessCode ActsExamples::HitSelector::execute( return ProcessCode::SUCCESS; } + +} // namespace ActsExamples From dc1129220fc6d555edd949493f294abcd67644bd Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 10:41:57 +0100 Subject: [PATCH 4/7] revert measurement container changes --- .../ActsExamples/EventData/Measurement.hpp | 30 ++++++------------- .../EventData/MeasurementConcept.hpp | 2 +- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp index 174dc05ef40..ab232628341 100644 --- a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp @@ -10,16 +10,25 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/TrackParametrization.hpp" +#include "Acts/EventData/MeasurementHelpers.hpp" #include "Acts/EventData/SubspaceHelpers.hpp" #include "Acts/EventData/Types.hpp" +#include "Acts/EventData/detail/ParameterTraits.hpp" +#include "Acts/EventData/detail/PrintParameters.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Utilities/Iterator.hpp" #include "ActsExamples/EventData/GeometryContainers.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" #include "ActsExamples/EventData/MeasurementConcept.hpp" +#include +#include +#include #include +#include +#include #include +#include #include #include @@ -129,11 +138,6 @@ class MeasurementContainer { return getMeasurement(addMeasurement(Size, geometryId)); } - template - VariableProxy copyMeasurement(const OtherDerived& other); - template - FixedProxy copyMeasurement(const OtherDerived& other); - template VariableProxy emplaceMeasurement(std::uint8_t size, Acts::GeometryIdentifier geometryId, @@ -490,22 +494,6 @@ class VariableMeasurementProxy } }; -template -MeasurementContainer::VariableProxy MeasurementContainer::copyMeasurement( - const OtherDerived& other) { - VariableProxy meas = makeMeasurement(other.size(), other.geometryId()); - meas.copyFrom(other); - return meas; -} - -template -MeasurementContainer::FixedProxy MeasurementContainer::copyMeasurement( - const OtherDerived& other) { - FixedProxy meas = makeMeasurement(other.geometryId()); - meas.copyFrom(other); - return meas; -} - template MeasurementContainer::VariableProxy MeasurementContainer::emplaceMeasurement( std::uint8_t size, Acts::GeometryIdentifier geometryId, Args&&... args) { diff --git a/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp b/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp index 9394b1bf992..14627a78c53 100644 --- a/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp @@ -8,6 +8,7 @@ #pragma once +#include "Acts/EventData/SourceLink.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include @@ -22,5 +23,4 @@ concept MeasurementConcept = requires(const T& m) { { m.parameters() }; { m.covariance() }; }; - } // namespace ActsExamples From 1e408fbfc6c891a946c84e6a9c1afa8609eebdb2 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 11:02:32 +0100 Subject: [PATCH 5/7] Update Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../ActsExamples/TruthTracking/HitSelector.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp index e6919e69349..d36fc6f88e4 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp @@ -16,6 +16,14 @@ namespace ActsExamples { HitSelector::HitSelector(const Config& config, Acts::Logging::Level level) : IAlgorithm("HitSelector", level), m_cfg(config) { + if (m_cfg.minX >= m_cfg.maxX || m_cfg.minY >= m_cfg.maxY || + m_cfg.minZ >= m_cfg.maxZ || m_cfg.minR >= m_cfg.maxR || + m_cfg.minTime >= m_cfg.maxTime || + m_cfg.minEnergyLoss >= m_cfg.maxEnergyLoss || + m_cfg.minPrimaryVertexId >= m_cfg.maxPrimaryVertexId) { + throw std::invalid_argument( + "Invalid bounds configuration: min values must be less than max values"); + } m_inputHits.initialize(m_cfg.inputHits); m_inputParticlesSelected.maybeInitialize(m_cfg.inputParticlesSelected); m_outputHits.initialize(m_cfg.outputHits); From df4148400712e97d9c3a3ebcfeb6cdd1ada5ee2f Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 11:02:49 +0100 Subject: [PATCH 6/7] Update Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp index fb3035cbb3b..37a4e8131ec 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.hpp @@ -46,7 +46,7 @@ class HitSelector final : public IAlgorithm { double maxZ = std::numeric_limits::max(); /// Min r cut - double minR = -std::numeric_limits::max(); + double minR = 0.0; /// Max r cut double maxR = std::numeric_limits::max(); From 06de035d5e092b49536b1998456e3ed042c5fd65 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Wed, 27 Nov 2024 11:30:45 +0100 Subject: [PATCH 7/7] fix formatting --- .../ActsExamples/TruthTracking/HitSelector.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp index d36fc6f88e4..a494957a589 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/HitSelector.cpp @@ -16,13 +16,14 @@ namespace ActsExamples { HitSelector::HitSelector(const Config& config, Acts::Logging::Level level) : IAlgorithm("HitSelector", level), m_cfg(config) { - if (m_cfg.minX >= m_cfg.maxX || m_cfg.minY >= m_cfg.maxY || + if (m_cfg.minX >= m_cfg.maxX || m_cfg.minY >= m_cfg.maxY || m_cfg.minZ >= m_cfg.maxZ || m_cfg.minR >= m_cfg.maxR || - m_cfg.minTime >= m_cfg.maxTime || + m_cfg.minTime >= m_cfg.maxTime || m_cfg.minEnergyLoss >= m_cfg.maxEnergyLoss || m_cfg.minPrimaryVertexId >= m_cfg.maxPrimaryVertexId) { throw std::invalid_argument( - "Invalid bounds configuration: min values must be less than max values"); + "Invalid bounds configuration: min values must be less than max " + "values"); } m_inputHits.initialize(m_cfg.inputHits); m_inputParticlesSelected.maybeInitialize(m_cfg.inputParticlesSelected);