diff --git a/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root b/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root index 515090462a0..a7947758113 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root and b/CI/physmon/reference/trackfinding_1muon/seeded/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root index c5addb4d78b..36bf6142c55 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_1muon/seeded/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root b/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root index 3feb0e1e4c0..a829a2d9280 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root and b/CI/physmon/reference/trackfinding_1muon/truth_estimated/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root index 9ce90f1355b..c61c4932723 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_1muon/truth_estimated/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root b/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root index be2ac6376d8..ca0d1a73f0d 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root and b/CI/physmon/reference/trackfinding_1muon/truth_smeared/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root index 632d9583785..44e9fe24671 100644 Binary files a/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_1muon/truth_smeared/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf_ambi.root b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf_ambi.root index 49e0fcda2c1..35b860dcb8e 100644 Binary files a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf_ambi.root and b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_ckf_ambi.root differ diff --git a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_gauss_notime_hist.root b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_gauss_notime_hist.root index b72a71cbb42..6417d574b7d 100644 Binary files a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_gauss_notime_hist.root and b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_gauss_notime_hist.root differ diff --git a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_grid_time_hist.root b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_grid_time_hist.root index fed2ae9c28e..aa96f02cf36 100644 Binary files a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_grid_time_hist.root and b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_amvf_grid_time_hist.root differ diff --git a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root index 377bf998d6c..4771b9e0c04 100644 Binary files a/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root and b/CI/physmon/reference/trackfinding_4muon_50vertices/performance_vertexing_ivf_notime_hist.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root index 2a692f3d751..64eba9d6e7c 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root index 8448a28ef8d..6b9a422d8d8 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf_ambi.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root index cb06eab079b..54f7b81cfc1 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_gauss_notime_hist.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root index 3c6a4b94200..62d76b76b9d 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/performance_vertexing_amvf_grid_time_hist.root differ diff --git a/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root b/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root index a5f58e1e065..84e83804d51 100644 Binary files a/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root and b/CI/physmon/reference/trackfinding_ttbar_pu200/tracksummary_ckf_hist.root differ diff --git a/CI/physmon/workflows/physmon_trackfinding_1muon.py b/CI/physmon/workflows/physmon_trackfinding_1muon.py index 8dee557c794..d06f99fbdb6 100755 --- a/CI/physmon/workflows/physmon_trackfinding_1muon.py +++ b/CI/physmon/workflows/physmon_trackfinding_1muon.py @@ -141,6 +141,9 @@ def run_ckf_tracking(label, seeding): maxOutliers=2, ), CkfConfig( + chi2CutOffMeasurement=15.0, + chi2CutOffOutlier=25.0, + numMeasurementsCutOff=10, seedDeduplication=( True if seeding != SeedingAlgorithm.TruthSmeared else False ), diff --git a/CI/physmon/workflows/physmon_trackfinding_4muon_50vertices.py b/CI/physmon/workflows/physmon_trackfinding_4muon_50vertices.py index 0efeec3acf2..e1ece122c45 100755 --- a/CI/physmon/workflows/physmon_trackfinding_4muon_50vertices.py +++ b/CI/physmon/workflows/physmon_trackfinding_4muon_50vertices.py @@ -123,6 +123,9 @@ maxOutliers=2, ), CkfConfig( + chi2CutOffMeasurement=15.0, + chi2CutOffOutlier=25.0, + numMeasurementsCutOff=10, seedDeduplication=True, stayOnSeed=True, ), diff --git a/CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py b/CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py index a9414a89351..45c01aedde8 100755 --- a/CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py +++ b/CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py @@ -117,6 +117,9 @@ maxOutliers=2, ), CkfConfig( + chi2CutOffMeasurement=15.0, + chi2CutOffOutlier=25.0, + numMeasurementsCutOff=10, seedDeduplication=True, stayOnSeed=True, ), diff --git a/Core/include/Acts/TrackFinding/MeasurementSelector.hpp b/Core/include/Acts/TrackFinding/MeasurementSelector.hpp index a05f67d7cc0..f05df83e3e6 100644 --- a/Core/include/Acts/TrackFinding/MeasurementSelector.hpp +++ b/Core/include/Acts/TrackFinding/MeasurementSelector.hpp @@ -36,10 +36,12 @@ namespace Acts { struct MeasurementSelectorCuts { /// bins in |eta| to specify variable selections std::vector etaBins{}; - /// Maximum local chi2 contribution. + /// Maximum local chi2 contribution to classify as measurement. std::vector chi2CutOff{15}; /// Maximum number of associated measurements on a single surface. std::vector numMeasurementsCutOff{1}; + /// Maximum local chi2 contribution to classify as outlier. + std::vector chi2CutOffOutlier{}; }; /// @brief Measurement selection struct selecting those measurements compatible @@ -73,7 +75,7 @@ class MeasurementSelector { /// @brief Constructor with config /// /// @param config a config instance - explicit MeasurementSelector(Config config); + explicit MeasurementSelector(const Config& config); /// @brief Function that select the measurements compatible with /// the given track parameter on a surface @@ -93,11 +95,25 @@ class MeasurementSelector { bool& isOutlier, const Logger& logger) const; private: - template - static cut_value_t getCut( - const typename traj_t::TrackStateProxy& trackState, - const Acts::MeasurementSelector::Config::Iterator selector, - const std::vector& cuts, const Logger& logger); + struct InternalCutBin { + double maxTheta{}; + std::size_t maxNumMeasurements{}; + double maxChi2Measurement{}; + double maxChi2Outlier{}; + }; + using InternalCutBins = std::vector; + using InternalConfig = Acts::GeometryHierarchyMap; + + struct Cuts { + std::size_t numMeasurements{}; + double chi2Measurement{}; + double chi2Outlier{}; + }; + + static InternalCutBins convertCutBins(const MeasurementSelectorCuts& config); + + static Cuts getCutsByTheta(const InternalCutBins& config, double theta); + Result getCuts(const GeometryIdentifier& geoID, double theta) const; double calculateChi2( const double* fullCalibrated, const double* fullCalibratedCovariance, @@ -109,7 +125,7 @@ class MeasurementSelector { false>::Projector projector, unsigned int calibratedSize) const; - Config m_config; + InternalConfig m_config; }; } // namespace Acts diff --git a/Core/include/Acts/TrackFinding/MeasurementSelector.ipp b/Core/include/Acts/TrackFinding/MeasurementSelector.ipp index 49b03e4730e..9b70f359cad 100644 --- a/Core/include/Acts/TrackFinding/MeasurementSelector.ipp +++ b/Core/include/Acts/TrackFinding/MeasurementSelector.ipp @@ -27,25 +27,17 @@ MeasurementSelector::select( } // Get geoID of this surface - auto geoID = candidates.front().referenceSurface().geometryId(); + GeometryIdentifier geoID = candidates.front().referenceSurface().geometryId(); + // Get the theta of the first track state + const double theta = candidates.front().predicted()[eBoundTheta]; // Find the appropriate cuts - auto cuts = m_config.find(geoID); - if (cuts == m_config.end()) { - // for now we consider missing cuts an unrecoverable error - // TODO consider other options e.g. do not add measurements at all (not - // even as outliers) - return CombinatorialKalmanFilterError::MeasurementSelectionFailed; + const auto cutsResult = getCuts(geoID, theta); + if (!cutsResult.ok()) { + return cutsResult.error(); } + const Cuts& cuts = *cutsResult; - assert(!cuts->chi2CutOff.empty()); - const std::vector& chi2CutOff = cuts->chi2CutOff; - const double maxChi2Cut = - std::min(*std::max_element(chi2CutOff.begin(), chi2CutOff.end()), - getCut(candidates.front(), cuts, chi2CutOff, logger)); - const std::size_t numMeasurementsCut = getCut( - candidates.front(), cuts, cuts->numMeasurementsCutOff, logger); - - if (numMeasurementsCut == 0ul) { + if (cuts.numMeasurements == 0ul) { return CombinatorialKalmanFilterError::MeasurementSelectionFailed; } @@ -80,7 +72,7 @@ MeasurementSelector::select( } // only consider track states which pass the chi2 cut - if (chi2 >= maxChi2Cut) { + if (chi2 >= cuts.chi2Measurement) { continue; } @@ -93,17 +85,25 @@ MeasurementSelector::select( ++passedCandidates; } - // If there are no measurements below the chi2 cut off, return the - // measurement with the best chi2 and tag it as an outlier + // Handle if there are no measurements below the chi2 cut off if (passedCandidates == 0ul) { - ACTS_VERBOSE("No measurement candidate. Return an outlier measurement chi2=" - << minChi2); - isOutlier = true; + if (minChi2 < cuts.chi2Outlier) { + ACTS_VERBOSE( + "No measurement candidate. Return an outlier measurement chi2=" + << minChi2); + isOutlier = true; + return Result::success(std::make_pair(candidates.begin() + minIndex, + candidates.begin() + minIndex + 1)); + } else { + ACTS_VERBOSE("No measurement candidate. Return empty chi2=" << minChi2); + return Result::success( + std::make_pair(candidates.begin(), candidates.begin())); + } } - if (passedCandidates <= 1ul || numMeasurementsCut == 1ul) { + if (passedCandidates <= 1ul) { // return single item range, no sorting necessary - ACTS_VERBOSE("Returning only 1 element"); + ACTS_VERBOSE("Returning only 1 element chi2=" << minChi2); return Result::success(std::make_pair(candidates.begin() + minIndex, candidates.begin() + minIndex + 1)); } @@ -112,43 +112,12 @@ MeasurementSelector::select( candidates.begin(), candidates.begin() + passedCandidates, [](const auto& tsa, const auto& tsb) { return tsa.chi2() < tsb.chi2(); }); - if (passedCandidates <= numMeasurementsCut) { - ACTS_VERBOSE("Number of selected measurements: " - << passedCandidates << ", max: " << numMeasurementsCut); - return Result::success(std::make_pair( - candidates.begin(), candidates.begin() + passedCandidates)); - } - ACTS_VERBOSE("Number of selected measurements: " - << numMeasurementsCut << ", max: " << numMeasurementsCut); + << passedCandidates << ", max: " << cuts.numMeasurements); return Result::success(std::make_pair( - candidates.begin(), candidates.begin() + numMeasurementsCut)); -} - -template -cut_value_t MeasurementSelector::getCut( - const typename traj_t::TrackStateProxy& trackState, - const Acts::MeasurementSelector::Config::Iterator selector, - const std::vector& cuts, const Logger& logger) { - const auto& etaBins = selector->etaBins; - if (etaBins.empty()) { - return cuts[0]; // shortcut if no etaBins - } - const auto eta = std::atanh(std::cos(trackState.predicted()[eBoundTheta])); - const auto abseta = std::abs(eta); - std::size_t bin = 0; - for (auto etaBin : etaBins) { - if (etaBin >= abseta) { - break; - } - bin++; - } - if (bin >= cuts.size()) { - bin = cuts.size() - 1; - } - ACTS_VERBOSE("Get cut for eta=" << eta << ": " << cuts[bin]); - return cuts[bin]; + candidates.begin(), + candidates.begin() + std::min(cuts.numMeasurements, passedCandidates))); } } // namespace Acts diff --git a/Core/include/Acts/TrackFinding/TrackSelector.hpp b/Core/include/Acts/TrackFinding/TrackSelector.hpp index 1316932d32b..3849b4a9dc5 100644 --- a/Core/include/Acts/TrackFinding/TrackSelector.hpp +++ b/Core/include/Acts/TrackFinding/TrackSelector.hpp @@ -75,6 +75,7 @@ class TrackSelector { std::size_t minMeasurements = 0; std::size_t maxHoles = std::numeric_limits::max(); std::size_t maxOutliers = std::numeric_limits::max(); + std::size_t maxHolesAndOutliers = std::numeric_limits::max(); std::size_t maxSharedHits = std::numeric_limits::max(); double maxChi2 = inf; @@ -311,6 +312,7 @@ inline std::ostream& operator<<(std::ostream& os, print("pt", cuts.ptMin, cuts.ptMax); print("nHoles", 0, cuts.maxHoles); print("nOutliers", 0, cuts.maxOutliers); + print("nHoles + nOutliers", 0, cuts.maxHolesAndOutliers); print("nSharedHits", 0, cuts.maxSharedHits); print("chi2", 0.0, cuts.maxChi2); os << " - " << cuts.minMeasurements << " <= nMeasurements\n"; @@ -434,6 +436,8 @@ bool TrackSelector::isValidTrack(const track_proxy_t& track) const { checkMin(track.nMeasurements(), cuts.minMeasurements) && checkMax(track.nHoles(), cuts.maxHoles) && checkMax(track.nOutliers(), cuts.maxOutliers) && + checkMax(track.nHoles() + track.nOutliers(), + cuts.maxHolesAndOutliers) && checkMax(track.nSharedHits(), cuts.maxSharedHits) && checkMax(track.chi2(), cuts.maxChi2) && cuts.measurementCounter.isValidTrack(track); diff --git a/Core/src/TrackFinding/MeasurementSelector.cpp b/Core/src/TrackFinding/MeasurementSelector.cpp index 946ca981949..120b4ac02f8 100644 --- a/Core/src/TrackFinding/MeasurementSelector.cpp +++ b/Core/src/TrackFinding/MeasurementSelector.cpp @@ -10,19 +10,64 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/EventData/MeasurementHelpers.hpp" +#include "Acts/Geometry/GeometryIdentifier.hpp" #include +#include +#include namespace Acts { MeasurementSelector::MeasurementSelector() - : m_config{{GeometryIdentifier(), MeasurementSelectorCuts{}}} {} + : MeasurementSelector({{GeometryIdentifier(), MeasurementSelectorCuts{}}}) { +} MeasurementSelector::MeasurementSelector(const MeasurementSelectorCuts& cuts) - : m_config{{GeometryIdentifier(), cuts}} {} + : MeasurementSelector({{GeometryIdentifier(), cuts}}) {} + +MeasurementSelector::MeasurementSelector(const Config& config) { + std::vector tmp; + tmp.reserve(config.size()); + for (std::size_t i = 0; i < config.size(); ++i) { + GeometryIdentifier geoID = config.idAt(i); + MeasurementSelectorCuts cuts = config.valueAt(i); + + InternalCutBins internalCuts = convertCutBins(cuts); + tmp.emplace_back(geoID, std::move(internalCuts)); + } + m_config = InternalConfig(std::move(tmp)); +} + +MeasurementSelector::InternalCutBins MeasurementSelector::convertCutBins( + const MeasurementSelectorCuts& config) { + InternalCutBins cutBins; + + auto getEtaOrInf = [](const auto& vec, std::size_t bin) { + if (bin >= vec.size()) { + return std::numeric_limits::infinity(); + } + assert(vec[bin] >= 0 && "Eta bins must be positive"); + return vec[bin]; + }; + + auto getBinOrBackOrMax = [](const auto& vec, std::size_t bin) { + using Value = std::remove_reference_t; + static constexpr Value max = std::numeric_limits::max(); + return vec.empty() ? max : (bin < vec.size() ? vec[bin] : vec.back()); + }; -MeasurementSelector::MeasurementSelector(Config config) - : m_config(std::move(config)) {} + for (std::size_t bin = 0; bin < config.etaBins.size() + 1; ++bin) { + InternalCutBin cuts; + cuts.maxTheta = getEtaOrInf(config.etaBins, bin); + cuts.maxNumMeasurements = + getBinOrBackOrMax(config.numMeasurementsCutOff, bin); + cuts.maxChi2Measurement = getBinOrBackOrMax(config.chi2CutOff, bin); + cuts.maxChi2Outlier = getBinOrBackOrMax(config.chi2CutOffOutlier, bin); + cutBins.push_back(cuts); + } + + return cutBins; +} double MeasurementSelector::calculateChi2( const double* fullCalibrated, const double* fullCalibratedCovariance, @@ -64,4 +109,31 @@ double MeasurementSelector::calculateChi2( }); } +MeasurementSelector::Cuts MeasurementSelector::getCutsByTheta( + const InternalCutBins& config, double theta) { + // since theta is in [0, pi] and we have a symmetric cut in eta, we can just + // look at the positive half of the Z axis + const double constrainedTheta = std::min(theta, M_PI - theta); + + auto it = std::find_if(config.begin(), config.end(), + [constrainedTheta](const InternalCutBin& cuts) { + return constrainedTheta < cuts.maxTheta; + }); + assert(it != config.end()); + return {it->maxNumMeasurements, it->maxChi2Measurement, it->maxChi2Outlier}; +} + +Result MeasurementSelector::getCuts( + const GeometryIdentifier& geoID, double theta) const { + // Find the appropriate cuts + auto cuts = m_config.find(geoID); + if (cuts == m_config.end()) { + // for now we consider missing cuts an unrecoverable error + // TODO consider other options e.g. do not add measurements at all (not + // even as outliers) + return CombinatorialKalmanFilterError::MeasurementSelectionFailed; + } + return getCutsByTheta(*cuts, theta); +} + } // namespace Acts diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp index f4352ea46ce..60f08e98a52 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp @@ -241,8 +241,10 @@ class BranchStopper { bool tooManyHoles = track.nHoles() > singleConfig->maxHoles || tooManyHolesPS; bool tooManyOutliers = track.nOutliers() > singleConfig->maxOutliers; + bool tooManyHolesAndOutliers = (track.nHoles() + track.nOutliers()) > + singleConfig->maxHolesAndOutliers; - if (tooManyHoles || tooManyOutliers) { + if (tooManyHoles || tooManyOutliers || tooManyHolesAndOutliers) { ++m_nStoppedBranches; return enoughMeasurements ? BranchStopperResult::StopAndKeep : BranchStopperResult::StopAndDrop; diff --git a/Examples/Python/python/acts/examples/reconstruction.py b/Examples/Python/python/acts/examples/reconstruction.py index 4a903a2b7c9..fd3d93b24b1 100644 --- a/Examples/Python/python/acts/examples/reconstruction.py +++ b/Examples/Python/python/acts/examples/reconstruction.py @@ -125,17 +125,19 @@ "nMeasurementsMin", "maxHoles", "maxOutliers", + "maxHolesAndOutliers", "maxSharedHits", "maxChi2", "nMeasurementsGroupMin", ], - defaults=[(None, None)] * 7 + [None] * 6, + defaults=[(None, None)] * 7 + [None] * 7, ) CkfConfig = namedtuple( "CkfConfig", [ - "chi2CutOff", + "chi2CutOffMeasurement", + "chi2CutOffOutlier", "numMeasurementsCutOff", "maxSteps", "seedDeduplication", @@ -145,7 +147,7 @@ "maxPixelHoles", "maxStripHoles", ], - defaults=[15.0, 10, None, None, None, None, None, None, None], + defaults=[15.0, 25.0, 10, None, None, None, None, None, None, None], ) AmbiguityResolutionConfig = namedtuple( @@ -1249,6 +1251,7 @@ def addCKFTracks( minMeasurements=c.nMeasurementsMin, maxHoles=c.maxHoles, maxOutliers=c.maxOutliers, + maxHolesAndOutliers=c.maxHolesAndOutliers, maxSharedHits=c.maxSharedHits, maxChi2=c.maxChi2, measurementCounter=c.nMeasurementsGroupMin, @@ -1277,7 +1280,8 @@ def addCKFTracks( acts.GeometryIdentifier(), ( [], - [ckfConfig.chi2CutOff], + [ckfConfig.chi2CutOffMeasurement], + [ckfConfig.chi2CutOffOutlier], [ckfConfig.numMeasurementsCutOff], ), ) diff --git a/Examples/Python/src/ExampleAlgorithms.cpp b/Examples/Python/src/ExampleAlgorithms.cpp index c943a7393dc..00b1e96bb73 100644 --- a/Examples/Python/src/ExampleAlgorithms.cpp +++ b/Examples/Python/src/ExampleAlgorithms.cpp @@ -105,6 +105,7 @@ void addExampleAlgorithms(Context& ctx) { ACTS_PYTHON_MEMBER(minMeasurements); ACTS_PYTHON_MEMBER(maxHoles); ACTS_PYTHON_MEMBER(maxOutliers); + ACTS_PYTHON_MEMBER(maxHolesAndOutliers); ACTS_PYTHON_MEMBER(maxSharedHits); ACTS_PYTHON_MEMBER(maxChi2); ACTS_PYTHON_MEMBER(measurementCounter); diff --git a/Examples/Python/src/TrackFinding.cpp b/Examples/Python/src/TrackFinding.cpp index 5a0e6ec59b9..91cb431a954 100644 --- a/Examples/Python/src/TrackFinding.cpp +++ b/Examples/Python/src/TrackFinding.cpp @@ -304,7 +304,8 @@ void addTrackFinding(Context& ctx) { magneticField, Logging::Level level) { return Alg::makeTrackFinderFunction( - trackingGeometry, magneticField, + std::move(trackingGeometry), + std::move(magneticField), *Acts::getDefaultLogger("TrackFinding", level)); }); @@ -338,17 +339,19 @@ void addTrackFinding(Context& ctx) { { auto constructor = - [](const std::vector< - std::pair, std::vector, - std::vector>>>& input) { + [](const std::vector, std::vector, + std::vector, std::vector>>>& + input) { std::vector> converted; converted.reserve(input.size()); for (const auto& [id, cuts] : input) { - const auto& [bins, chi2, num] = cuts; - converted.emplace_back(id, - MeasurementSelectorCuts{bins, chi2, num}); + const auto& [bins, chi2Measurement, chi2Outlier, num] = cuts; + converted.emplace_back( + id, MeasurementSelectorCuts{bins, chi2Measurement, num, + chi2Outlier}); } return std::make_unique(converted); }; @@ -356,9 +359,12 @@ void addTrackFinding(Context& ctx) { py::class_(m, "MeasurementSelectorCuts") .def(py::init<>()) .def(py::init, std::vector, - std::vector>()) + std::vector, std::vector>()) .def_readwrite("etaBins", &MeasurementSelectorCuts::etaBins) - .def_readwrite("chi2CutOff", &MeasurementSelectorCuts::chi2CutOff) + .def_readwrite("chi2CutOffMeasurement", + &MeasurementSelectorCuts::chi2CutOff) + .def_readwrite("chi2CutOffOutlier", + &MeasurementSelectorCuts::chi2CutOffOutlier) .def_readwrite("numMeasurementsCutOff", &MeasurementSelectorCuts::numMeasurementsCutOff); diff --git a/Examples/Python/tests/root_file_hashes.txt b/Examples/Python/tests/root_file_hashes.txt index d70a12efb5d..f0646aabf5d 100644 --- a/Examples/Python/tests/root_file_hashes.txt +++ b/Examples/Python/tests/root_file_hashes.txt @@ -32,22 +32,22 @@ test_digitization_example_input[smeared]__particles.root: 5fe7dda2933ee6b9615b06 test_digitization_example_input[smeared]__measurements.root: 243c2f69b7b0db9dbeaa7494d4ea0f3dd1691dc90f16e10df6c0491ff4dc7d62 test_digitization_example_input[geometric]__particles.root: 5fe7dda2933ee6b9615b064d192322fe07831133cd998e5ed99a3b992b713a10 test_digitization_example_input[geometric]__measurements.root: 63ec81635979058fb8976f94455bf490cf92b7b142c4a05cc39de6225f5de2fb -test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: d17d81d46bc2fd8d62868530dbc54762df4409ad35df1baeb11c33889e9933e8 -test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 112943712fa29d70a1396cd0d842027e95e77554e95b19d97db74e27acd22bbc +test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: bd05ef0c36a3c530efd47a11920afece64c0fee0c1d9310f7907f3a9b877e5bc +test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 4fa859b395e172c613d466a2ea25cdd56ed1ab3cfd857d230f21bc184310d668 test_ckf_tracks_example[generic-full_seeding]__performance_seeding_trees.root: 0e0676ffafdb27112fbda50d1cf627859fa745760f98073261dcf6db3f2f991e -test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: 7679bbbdb47abcbee87048ce373966d5f58bab6b04312844ede351ea653a573f -test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: 0df341fc0833c33474cd8835d2e3318b6bd492a07b3b4ae5aa74068593679854 +test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: 9cd382738eaf7b69a6b9389caeff099f8714f39ac93d75b46f8a78ac7275c117 +test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: e5db2791d9d09d88705c0dbeba666b4df441ecc920b9e400510df2913766e112 test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e -test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: 25b985218418c91782696daab1b3fd3eaf7d15cd05681c7dfe2e4c3e44977e16 -test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: be592112183bd6554ed5e00dcb62eb4a5a5f4a9bb7efa4b1e1ce699dec13157b +test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: 8c1486281e675c50252903eb0f3a3616412280c722a4b3921138d26a88ad501c +test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 961aa19995a8a1c64a365c6d72a90eee9809efaaee652b674db287acacfb810c test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 935359233aa503a077faf2394ba988d0da97ea5db4f6d3294a95fb93c5625c68 test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 59537c52d23a77dbed9230c7b92cf653f7592c72fb882e8a24a2b33f1d27019e test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: 89fad58add1ead7c0d38a952391d3c4a720feda6e37c37ed53f994a99fe15f57 test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: 3a092423e717b1fe76f78f6b95eb6df67648a196e8c4da32158061d4bc490578 test_ckf_tracks_example[odd-truth_estimated]__performance_seeding.root: 1a36b7017e59f1c08602ef3c2cb0483c51df248f112e3780c66594110719c575 -test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: 268357818ee53cc13b26aa23af06d7f839d112e9dc2eb3ac4c5b6e6eda48e6af -test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: 98c9e97240f541c22dd41d05c2114d7e9455b117162d64baad2c3ecb5b7d52f7 +test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: 93c09cbff3f164606a2dee5aec0a05f005ea71185f1a01ab61d6ffbeee3b08ca +test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: b95b17b9ae4ee3fec1153f636e116e4e9951ada86bc1bc8d53c9fcea19f65fd7 test_vertex_fitting_reading[Truth-False-100]__performance_vertexing.root: 76ef6084d758dfdfc0151ddec2170e12d73394424e3dac4ffe46f0f339ec8293 test_vertex_fitting_reading[Iterative-False-100]__performance_vertexing.root: 60372210c830a04f95ceb78c6c68a9b0de217746ff59e8e73053750c837b57eb test_vertex_fitting_reading[Iterative-True-100]__performance_vertexing.root: e34f217d524a5051dbb04a811d3407df3ebe2cc4bb7f54f6bda0847dbd7b52c3 diff --git a/Examples/Scripts/Python/ckf_tracks.py b/Examples/Scripts/Python/ckf_tracks.py index b5b7d21d28c..9dc665eb835 100755 --- a/Examples/Scripts/Python/ckf_tracks.py +++ b/Examples/Scripts/Python/ckf_tracks.py @@ -158,7 +158,8 @@ def runCKFTracks( maxOutliers=2, ), CkfConfig( - chi2CutOff=15, + chi2CutOffMeasurement=15.0, + chi2CutOffOutlier=25.0, numMeasurementsCutOff=10, seedDeduplication=True if not truthSmearedSeeded else False, stayOnSeed=True if not truthSmearedSeeded else False, diff --git a/Examples/Scripts/Python/full_chain_odd.py b/Examples/Scripts/Python/full_chain_odd.py index 0c6b5fd1f38..a5d0dda2c58 100755 --- a/Examples/Scripts/Python/full_chain_odd.py +++ b/Examples/Scripts/Python/full_chain_odd.py @@ -358,7 +358,8 @@ maxOutliers=2, ), CkfConfig( - chi2CutOff=15, + chi2CutOffMeasurement=15.0, + chi2CutOffOutlier=25.0, numMeasurementsCutOff=10, seedDeduplication=True, stayOnSeed=True,