File indexing completed on 2025-01-18 09:11:05
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 #include "Acts/EventData/MeasurementHelpers.hpp"
0013 #include "Acts/EventData/MultiTrajectory.hpp"
0014 #include "Acts/EventData/Types.hpp"
0015 #include "Acts/Geometry/GeometryHierarchyMap.hpp"
0016 #include "Acts/Geometry/GeometryIdentifier.hpp"
0017 #include "Acts/TrackFinding/CombinatorialKalmanFilterError.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019 #include "Acts/Utilities/Result.hpp"
0020
0021 #include <cassert>
0022 #include <cstddef>
0023 #include <limits>
0024 #include <utility>
0025 #include <vector>
0026
0027 namespace Acts {
0028
0029
0030
0031
0032
0033
0034 struct MeasurementSelectorCuts {
0035
0036 std::vector<double> etaBins{};
0037
0038 std::vector<double> chi2CutOff{15};
0039
0040 std::vector<std::size_t> numMeasurementsCutOff{1};
0041
0042 std::vector<double> chi2CutOffOutlier{};
0043 };
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 class MeasurementSelector {
0055 public:
0056
0057
0058
0059
0060
0061 using Config = Acts::GeometryHierarchyMap<MeasurementSelectorCuts>;
0062
0063
0064
0065
0066 MeasurementSelector();
0067
0068
0069
0070
0071 explicit MeasurementSelector(const MeasurementSelectorCuts& cuts);
0072
0073
0074
0075
0076 explicit MeasurementSelector(const Config& config);
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 template <typename traj_t>
0089 Result<std::pair<
0090 typename std::vector<typename traj_t::TrackStateProxy>::iterator,
0091 typename std::vector<typename traj_t::TrackStateProxy>::iterator>>
0092 select(std::vector<typename traj_t::TrackStateProxy>& candidates,
0093 bool& isOutlier, const Logger& logger) const;
0094
0095 private:
0096 struct InternalCutBin {
0097 double maxTheta{};
0098 std::size_t maxNumMeasurements{};
0099 double maxChi2Measurement{};
0100 double maxChi2Outlier{};
0101 };
0102 using InternalCutBins = std::vector<InternalCutBin>;
0103 using InternalConfig = Acts::GeometryHierarchyMap<InternalCutBins>;
0104
0105 struct Cuts {
0106 std::size_t numMeasurements{};
0107 double chi2Measurement{};
0108 double chi2Outlier{};
0109 };
0110
0111 static InternalCutBins convertCutBins(const MeasurementSelectorCuts& config);
0112
0113 static Cuts getCutsByTheta(const InternalCutBins& config, double theta);
0114 Result<Cuts> getCuts(const GeometryIdentifier& geoID, double theta) const;
0115
0116 double calculateChi2(
0117 const double* fullCalibrated, const double* fullCalibratedCovariance,
0118 TrackStateTraits<MultiTrajectoryTraits::MeasurementSizeMax,
0119 false>::Parameters predicted,
0120 TrackStateTraits<MultiTrajectoryTraits::MeasurementSizeMax,
0121 false>::Covariance predictedCovariance,
0122 BoundSubspaceIndices projector, unsigned int calibratedSize) const;
0123
0124 InternalConfig m_config;
0125 };
0126
0127 }
0128
0129 #include "MeasurementSelector.ipp"