Skip to content

Commit

Permalink
refactor: Improve CKF MeasurementSelector construction (#3093)
Browse files Browse the repository at this point in the history
The construction of the `MeasurementSelector` is IMO unintuitive right now and the default constructor will build a broken object which cannot select anything. I am trying to improve this here by using the default selections mechanism for the default constructor and adding a constructor which only takes a single set of cuts.

blocked by
- #3083
  • Loading branch information
andiwand authored Apr 10, 2024
1 parent da1eda6 commit f19e1e9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Core/include/Acts/TrackFinding/MeasurementSelector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Acts/EventData/MultiTrajectory.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/Geometry/GeometryHierarchyMap.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/TrackFinding/CombinatorialKalmanFilterError.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Utilities/Result.hpp"
Expand All @@ -37,7 +38,7 @@ struct MeasurementSelectorCuts {
/// bins in |eta| to specify variable selections
std::vector<double> etaBins{};
/// Maximum local chi2 contribution.
std::vector<double> chi2CutOff{std::numeric_limits<double>::max()};
std::vector<double> chi2CutOff{15};
/// Maximum number of associated measurements on a single surface.
std::vector<std::size_t> numMeasurementsCutOff{1};
};
Expand All @@ -61,11 +62,19 @@ class MeasurementSelector {
using Config = Acts::GeometryHierarchyMap<MeasurementSelectorCuts>;

/// @brief Default constructor
MeasurementSelector() = default;
/// @brief Constructor with config and (non-owning) logger
///
/// This will use the default configuration for the cuts.
MeasurementSelector();

/// @brief Constructor with cuts
///
/// @param cuts The cuts to use
explicit MeasurementSelector(const MeasurementSelectorCuts& cuts);

/// @brief Constructor with config
///
/// @param config a config instance
MeasurementSelector(Config config);
explicit MeasurementSelector(Config config);

/// @brief Function that select the measurements compatible with
/// the given track parameter on a surface
Expand Down
6 changes: 6 additions & 0 deletions Core/src/TrackFinding/MeasurementSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@

namespace Acts {

MeasurementSelector::MeasurementSelector()
: m_config{{GeometryIdentifier(), MeasurementSelectorCuts{}}} {}

MeasurementSelector::MeasurementSelector(const MeasurementSelectorCuts& cuts)
: m_config{{GeometryIdentifier(), cuts}} {}

MeasurementSelector::MeasurementSelector(Config config)
: m_config(std::move(config)) {}

Expand Down

0 comments on commit f19e1e9

Please sign in to comment.