diff --git a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp index 6ed24a71be8..1753e21bc23 100644 --- a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp +++ b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp @@ -38,6 +38,7 @@ namespace Acts { /// enough hits /// 5) Remove tracks that are not good enough based on cuts Contains method for /// data preparations + class ScoreBasedAmbiguityResolution { public: /// @brief Detector configuration struct : contains the configuration for each detector @@ -50,11 +51,23 @@ class ScoreBasedAmbiguityResolution { int outliersScoreWeight = 0; int otherScoreWeight = 0; - std::size_t minHits = 0; + // the eta bins for the detector + std::vector etaBins = {-5, 5}; + + // the minimum number of hits for each detector for each eta bin + std::vector minHitsPerEta = {0}; + + // the maximum number of holes for each detector for each eta bin + std::vector maxHolesPerEta = {0}; + + // the maximum number of outliers for each detector for each eta bin + std::vector maxOutliersPerEta = {0}; + + // the maximum number of shared hits for each detector for each eta bin + std::vector maxSharedHitsPerEta = {0}; + std::size_t maxHits = 0; std::size_t maxHoles = 0; - std::size_t maxOutliers = 0; - std::size_t maxSharedHits = 0; /// if true, the shared hits are considered as bad hits for this detector bool sharedHitsFlag = false; @@ -107,15 +120,8 @@ class ScoreBasedAmbiguityResolution { std::size_t maxSharedTracksPerMeasurement = 10; /// maximum number of shared hit per track std::size_t maxShared = 5; - - double pTMin = 0 * UnitConstants::GeV; - double pTMax = 1e5 * UnitConstants::GeV; - - double phiMin = -std::numbers::pi * UnitConstants::rad; - double phiMax = std::numbers::pi * UnitConstants::rad; - - double etaMin = -5; - double etaMax = 5; + /// minimum number of unshared hits per track + std::size_t minUnshared = 5; // if true, the ambiguity score is computed based on a different function. bool useAmbiguityFunction = false; @@ -185,6 +191,16 @@ class ScoreBasedAmbiguityResolution { const OptionalCuts& optionalCuts = {}) const; + /// Rejects Tracks based on eta dependent cuts. + /// + /// @param detector is the detector configuration object + /// @param trackFeatures is the trackFeatures object for a specific detector + /// @param eta is the eta of the track + /// @return true if the track is rejected, false otherwise + bool etaBasedCuts(const DetectorConfig& detector, + const TrackFeatures& trackFeatures, + const double& eta) const; + /// Remove hits that are not good enough for each track and removes tracks /// that have a score below a certain threshold or not enough hits. /// diff --git a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp index 0ce0941c0fe..6dc116dda23 100644 --- a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp +++ b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.ipp @@ -89,40 +89,7 @@ std::vector Acts::ScoreBasedAmbiguityResolution::simpleScore( // get the trackFeatures map for the track const auto& trackFeaturesVector = trackFeaturesVectors[iTrack]; double score = 1; - auto pT = Acts::VectorHelpers::perp(track.momentum()); auto eta = Acts::VectorHelpers::eta(track.momentum()); - auto phi = Acts::VectorHelpers::phi(track.momentum()); - // cuts on pT - if (pT < m_cfg.pTMin || pT > m_cfg.pTMax) { - score = 0; - iTrack++; - trackScore.push_back(score); - ACTS_DEBUG("Track: " << iTrack - << " has score = 0, due to pT cuts --- pT = " << pT); - continue; - } - - // cuts on phi - if (phi > m_cfg.phiMax || phi < m_cfg.phiMin) { - score = 0; - iTrack++; - trackScore.push_back(score); - ACTS_DEBUG("Track: " << iTrack - << " has score = 0, due to phi cuts --- phi = " - << phi); - continue; - } - - // cuts on eta - if (eta > m_cfg.etaMax || eta < m_cfg.etaMin) { - score = 0; - iTrack++; - trackScore.push_back(score); - ACTS_DEBUG("Track: " << iTrack - << " has score = 0, due to eta cuts --- eta = " - << eta); - continue; - } // cuts on optional cuts for (const auto& cutFunction : optionalCuts.cuts) { @@ -140,6 +107,7 @@ std::vector Acts::ScoreBasedAmbiguityResolution::simpleScore( ACTS_DEBUG("Track: " << iTrack << " score : " << score); continue; } + // Reject tracks which didn't pass the detector cuts. for (std::size_t detectorId = 0; detectorId < m_cfg.detectorConfigs.size(); detectorId++) { @@ -147,15 +115,14 @@ std::vector Acts::ScoreBasedAmbiguityResolution::simpleScore( const auto& trackFeatures = trackFeaturesVector[detectorId]; - ACTS_DEBUG("---> Found summary information"); - ACTS_DEBUG("---> Detector ID: " << detectorId); - ACTS_DEBUG("---> Number of hits: " << trackFeatures.nHits); - ACTS_DEBUG("---> Number of holes: " << trackFeatures.nHoles); - ACTS_DEBUG("---> Number of outliers: " << trackFeatures.nOutliers); + ACTS_VERBOSE("---> Found summary information"); + ACTS_VERBOSE("---> Detector ID: " << detectorId); + ACTS_VERBOSE("---> Number of hits: " << trackFeatures.nHits); + ACTS_VERBOSE("---> Number of holes: " << trackFeatures.nHoles); + ACTS_VERBOSE("---> Number of outliers: " << trackFeatures.nOutliers); - if ((trackFeatures.nHits < detector.minHits) || - (trackFeatures.nHoles > detector.maxHoles) || - (trackFeatures.nOutliers > detector.maxOutliers)) { + // eta based cuts + if (etaBasedCuts(detector, trackFeatures, eta)) { score = 0; ACTS_DEBUG("Track: " << iTrack << " has score = 0, due to detector cuts"); @@ -170,9 +137,7 @@ std::vector Acts::ScoreBasedAmbiguityResolution::simpleScore( continue; } - // real scoring starts here - // if the ambiguity scoring function is used, the score is processed with a - // different algorithm than the simple score. + // All cuts passed, now start scoring the track ACTS_VERBOSE("Using Simple Scoring function"); @@ -241,38 +206,6 @@ std::vector Acts::ScoreBasedAmbiguityResolution::ambiguityScore( double score = 1; auto pT = Acts::VectorHelpers::perp(track.momentum()); auto eta = Acts::VectorHelpers::eta(track.momentum()); - auto phi = Acts::VectorHelpers::phi(track.momentum()); - // cuts on pT - if (pT < m_cfg.pTMin || pT > m_cfg.pTMax) { - score = 0; - iTrack++; - trackScore.push_back(score); - ACTS_DEBUG("Track: " << iTrack - << " has score = 0, due to pT cuts --- pT = " << pT); - continue; - } - - // cuts on phi - if (phi > m_cfg.phiMax || phi < m_cfg.phiMin) { - score = 0; - iTrack++; - trackScore.push_back(score); - ACTS_DEBUG("Track: " << iTrack - << " has score = 0, due to phi cuts --- phi = " - << phi); - continue; - } - - // cuts on eta - if (eta > m_cfg.etaMax || eta < m_cfg.etaMin) { - score = 0; - iTrack++; - trackScore.push_back(score); - ACTS_DEBUG("Track: " << iTrack - << " has score = 0, due to eta cuts --- eta = " - << eta); - continue; - } // cuts on optional cuts for (const auto& cutFunction : optionalCuts.cuts) { @@ -290,6 +223,7 @@ std::vector Acts::ScoreBasedAmbiguityResolution::ambiguityScore( ACTS_DEBUG("Track: " << iTrack << " score : " << score); continue; } + // Reject tracks which didn't pass the detector cuts. for (std::size_t detectorId = 0; detectorId < m_cfg.detectorConfigs.size(); detectorId++) { @@ -297,15 +231,14 @@ std::vector Acts::ScoreBasedAmbiguityResolution::ambiguityScore( const auto& trackFeatures = trackFeaturesVector[detectorId]; - ACTS_DEBUG("---> Found summary information"); - ACTS_DEBUG("---> Detector ID: " << detectorId); - ACTS_DEBUG("---> Number of hits: " << trackFeatures.nHits); - ACTS_DEBUG("---> Number of holes: " << trackFeatures.nHoles); - ACTS_DEBUG("---> Number of outliers: " << trackFeatures.nOutliers); + ACTS_VERBOSE("---> Found summary information"); + ACTS_VERBOSE("---> Detector ID: " << detectorId); + ACTS_VERBOSE("---> Number of hits: " << trackFeatures.nHits); + ACTS_VERBOSE("---> Number of holes: " << trackFeatures.nHoles); + ACTS_VERBOSE("---> Number of outliers: " << trackFeatures.nOutliers); - if ((trackFeatures.nHits < detector.minHits) || - (trackFeatures.nHoles > detector.maxHoles) || - (trackFeatures.nOutliers > detector.maxOutliers)) { + // eta based cuts + if (etaBasedCuts(detector, trackFeatures, eta)) { score = 0; ACTS_DEBUG("Track: " << iTrack << " has score = 0, due to detector cuts"); @@ -320,6 +253,8 @@ std::vector Acts::ScoreBasedAmbiguityResolution::ambiguityScore( continue; } + // All cuts passed, now start scoring the track + // start with larger score for tracks with higher pT. score = std::log10(pT / UnitConstants::MeV) - 1.; // pT in GeV, hence 100 MeV is minimum and gets score = 1 @@ -370,6 +305,7 @@ std::vector Acts::ScoreBasedAmbiguityResolution::ambiguityScore( << " is : " << fac << " New score now: " << score); } + iTrack++; // Add the score to the vector @@ -451,11 +387,19 @@ std::vector Acts::ScoreBasedAmbiguityResolution::solveAmbiguity( // Check if the track has too many shared hits to be accepted. auto trackFeaturesVector = trackFeaturesVectors.at(iTrack); bool trkCouldBeAccepted = true; + double eta = Acts::VectorHelpers::eta(track.momentum()); + for (std::size_t detectorId = 0; detectorId < m_cfg.detectorConfigs.size(); detectorId++) { auto detector = m_cfg.detectorConfigs.at(detectorId); + + std::vector etaBins = detector.etaBins; + + auto it = std::upper_bound(etaBins.begin(), etaBins.end(), eta); + std::size_t etaBin = std::distance(etaBins.begin(), it) - 1; + if (trackFeaturesVector[detectorId].nSharedHits > - detector.maxSharedHits) { + detector.maxSharedHitsPerEta[etaBin]) { trkCouldBeAccepted = false; break; } @@ -470,7 +414,7 @@ std::vector Acts::ScoreBasedAmbiguityResolution::solveAmbiguity( nTracksPerMeasurement, optionalHitSelections); if (trkCouldBeAccepted) { cleanTrackIndex++; - if (trackScore[iTrack] >= m_cfg.minScore) { + if (trackScore[iTrack] > m_cfg.minScore) { goodTracks.push_back(track.index()); } } @@ -541,6 +485,18 @@ bool Acts::ScoreBasedAmbiguityResolution::getCleanedOutTracks( ACTS_DEBUG("Track state has no reference surface"); continue; } + + std::size_t ivolume = ts.referenceSurface().geometryId().volume(); + auto volume_it = m_cfg.volumeMap.find(ivolume); + if (volume_it == m_cfg.volumeMap.end()) { + ACTS_ERROR("Volume " << ivolume << "not found in the volume map"); + continue; + } + + std::size_t detectorID = volume_it->second; + + const auto& detector = m_cfg.detectorConfigs.at(detectorID); + measurement = measurementsPerTrack[index]; auto it = nTracksPerMeasurement.find(measurement); @@ -573,7 +529,8 @@ bool Acts::ScoreBasedAmbiguityResolution::getCleanedOutTracks( else { ACTS_DEBUG("Try to recover shared hit "); if (nTracksShared <= m_cfg.maxSharedTracksPerMeasurement && - trackScore > m_cfg.minScoreSharedTracks) { + trackScore > m_cfg.minScoreSharedTracks && + !detector.sharedHitsFlag) { ACTS_DEBUG("Accepted hit shared with " << nTracksShared << " tracks"); newMeasurementsPerTrack.push_back(measurement); nshared++; @@ -585,7 +542,7 @@ bool Acts::ScoreBasedAmbiguityResolution::getCleanedOutTracks( } } // Check if the track has enough hits to be accepted. - if (newMeasurementsPerTrack.size() < 3) { + if (newMeasurementsPerTrack.size() < m_cfg.minUnshared) { return false; } else { return true; diff --git a/Core/src/AmbiguityResolution/ScoreBasedAmbiguityResolution.cpp b/Core/src/AmbiguityResolution/ScoreBasedAmbiguityResolution.cpp index c7e47f41046..41cc6a9aeb5 100644 --- a/Core/src/AmbiguityResolution/ScoreBasedAmbiguityResolution.cpp +++ b/Core/src/AmbiguityResolution/ScoreBasedAmbiguityResolution.cpp @@ -7,3 +7,18 @@ // file, You can obtain one at https://mozilla.org/MPL/2.0/. #include "Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp" + +bool Acts::ScoreBasedAmbiguityResolution::etaBasedCuts( + const DetectorConfig& detector, const TrackFeatures& trackFeatures, + const double& eta) const { + std::vector etaBins = detector.etaBins; + + auto it = std::upper_bound(etaBins.begin(), etaBins.end(), eta); + if (it == etaBins.begin() || it == etaBins.end()) { + return false; // eta out of range + } + std::size_t etaBin = std::distance(etaBins.begin(), it) - 1; + return (trackFeatures.nHits < detector.minHitsPerEta[etaBin] || + trackFeatures.nHoles > detector.maxHolesPerEta[etaBin] || + trackFeatures.nOutliers > detector.maxOutliersPerEta[etaBin]); +} diff --git a/Examples/Algorithms/AmbiguityResolution/include/ActsExamples/AmbiguityResolution/ScoreBasedAmbiguityResolutionAlgorithm.hpp b/Examples/Algorithms/AmbiguityResolution/include/ActsExamples/AmbiguityResolution/ScoreBasedAmbiguityResolutionAlgorithm.hpp index b63100f8751..922f8c8ae8b 100644 --- a/Examples/Algorithms/AmbiguityResolution/include/ActsExamples/AmbiguityResolution/ScoreBasedAmbiguityResolutionAlgorithm.hpp +++ b/Examples/Algorithms/AmbiguityResolution/include/ActsExamples/AmbiguityResolution/ScoreBasedAmbiguityResolutionAlgorithm.hpp @@ -54,14 +54,8 @@ class ScoreBasedAmbiguityResolutionAlgorithm final : public IAlgorithm { // maximum number of shared hit per track std::size_t maxShared = 5; - double pTMin = 0 * Acts::UnitConstants::GeV; - double pTMax = 1e5 * Acts::UnitConstants::GeV; - - double phiMin = -std::numbers::pi * Acts::UnitConstants::rad; - double phiMax = std::numbers::pi * Acts::UnitConstants::rad; - - double etaMin = -5; - double etaMax = 5; + // minimum number of unshared hits per track + std::size_t minUnshared = 5; bool useAmbiguityFunction = false; }; diff --git a/Examples/Algorithms/AmbiguityResolution/src/ScoreBasedAmbiguityResolutionAlgorithm.cpp b/Examples/Algorithms/AmbiguityResolution/src/ScoreBasedAmbiguityResolutionAlgorithm.cpp index b1a6e251dba..d8b0c18688a 100644 --- a/Examples/Algorithms/AmbiguityResolution/src/ScoreBasedAmbiguityResolutionAlgorithm.cpp +++ b/Examples/Algorithms/AmbiguityResolution/src/ScoreBasedAmbiguityResolutionAlgorithm.cpp @@ -44,12 +44,7 @@ Acts::ScoreBasedAmbiguityResolution::Config transformConfig( result.minScoreSharedTracks = cfg.minScoreSharedTracks; result.maxSharedTracksPerMeasurement = cfg.maxSharedTracksPerMeasurement; result.maxShared = cfg.maxShared; - result.pTMin = cfg.pTMin; - result.pTMax = cfg.pTMax; - result.phiMin = cfg.phiMin; - result.phiMax = cfg.phiMax; - result.etaMin = cfg.etaMin; - result.etaMax = cfg.etaMax; + result.minUnshared = cfg.minUnshared; result.useAmbiguityFunction = cfg.useAmbiguityFunction; return result; } diff --git a/Examples/Python/python/acts/examples/reconstruction.py b/Examples/Python/python/acts/examples/reconstruction.py index 5a67f180f7b..a2f313e3d7e 100644 --- a/Examples/Python/python/acts/examples/reconstruction.py +++ b/Examples/Python/python/acts/examples/reconstruction.py @@ -216,16 +216,11 @@ def trackSelectorDefaultKWArgs(c): "minScore", "minScoreSharedTracks", "maxShared", + "minUnshared", "maxSharedTracksPerMeasurement", - "pTMax", - "pTMin", - "phiMax", - "phiMin", - "etaMax", - "etaMin", "useAmbiguityFunction", ], - defaults=[None] * 11, + defaults=[None] * 6, ) AmbiguityResolutionMLConfig = namedtuple( @@ -1922,11 +1917,8 @@ def addScoreBasedAmbiguityResolution( minScore=config.minScore, minScoreSharedTracks=config.minScoreSharedTracks, maxShared=config.maxShared, + minUnshared=config.minUnshared, maxSharedTracksPerMeasurement=config.maxSharedTracksPerMeasurement, - phiMax=config.phiMax, - phiMin=config.phiMin, - etaMax=config.etaMax, - etaMin=config.etaMin, useAmbiguityFunction=config.useAmbiguityFunction, ), ) diff --git a/Examples/Python/src/AmbiguityResolution.cpp b/Examples/Python/src/AmbiguityResolution.cpp index 2075a522609..95d9a567054 100644 --- a/Examples/Python/src/AmbiguityResolution.cpp +++ b/Examples/Python/src/AmbiguityResolution.cpp @@ -33,9 +33,8 @@ void addAmbiguityResolution(Context& ctx) { ACTS_PYTHON_DECLARE_ALGORITHM( ActsExamples::ScoreBasedAmbiguityResolutionAlgorithm, mex, "ScoreBasedAmbiguityResolutionAlgorithm", inputTracks, configFile, - outputTracks, minScore, minScoreSharedTracks, maxShared, - maxSharedTracksPerMeasurement, pTMin, pTMax, phiMin, phiMax, etaMin, - etaMax, useAmbiguityFunction); + outputTracks, minScore, minScoreSharedTracks, maxShared, minUnshared, + maxSharedTracksPerMeasurement, useAmbiguityFunction); } } // namespace Acts::Python diff --git a/Examples/Scripts/Python/full_chain_odd.py b/Examples/Scripts/Python/full_chain_odd.py index 50fa2465e38..8b5a5a1b5d7 100755 --- a/Examples/Scripts/Python/full_chain_odd.py +++ b/Examples/Scripts/Python/full_chain_odd.py @@ -414,13 +414,8 @@ minScore=0, minScoreSharedTracks=1, maxShared=2, + minUnshared=3, maxSharedTracksPerMeasurement=2, - pTMax=1400, - pTMin=0.5, - phiMax=math.pi, - phiMin=-math.pi, - etaMax=4, - etaMin=-4, useAmbiguityFunction=False, ), outputDirRoot=outputDir if args.output_root else None, diff --git a/Examples/Scripts/Python/full_chain_odd_LRT.py b/Examples/Scripts/Python/full_chain_odd_LRT.py index fde8b3b418c..7463b8f95b7 100644 --- a/Examples/Scripts/Python/full_chain_odd_LRT.py +++ b/Examples/Scripts/Python/full_chain_odd_LRT.py @@ -417,13 +417,8 @@ minScore=0, minScoreSharedTracks=1, maxShared=2, + minUnshared=3, maxSharedTracksPerMeasurement=2, - pTMax=1400, - pTMin=0.5, - phiMax=math.pi, - phiMin=-math.pi, - etaMax=4, - etaMin=-4, useAmbiguityFunction=False, ), outputDirRoot=outputDir if args.output_root else None, diff --git a/Examples/Scripts/Python/full_chain_test.py b/Examples/Scripts/Python/full_chain_test.py index 492c823cb5f..11504f4cd01 100755 --- a/Examples/Scripts/Python/full_chain_test.py +++ b/Examples/Scripts/Python/full_chain_test.py @@ -727,13 +727,8 @@ def full_chain(args): minScore=0, minScoreSharedTracks=1, maxShared=2, + minUnshared=3, maxSharedTracksPerMeasurement=2, - pTMax=1400, - pTMin=0.5, - phiMax=math.pi, - phiMin=-math.pi, - etaMax=4, - etaMin=-4, useAmbiguityFunction=False, ), ambiVolumeFile=args.ambi_config, diff --git a/Plugins/Json/src/AmbiguityConfigJsonConverter.cpp b/Plugins/Json/src/AmbiguityConfigJsonConverter.cpp index ded95d8c122..b6c9a9999d8 100644 --- a/Plugins/Json/src/AmbiguityConfigJsonConverter.cpp +++ b/Plugins/Json/src/AmbiguityConfigJsonConverter.cpp @@ -11,6 +11,21 @@ #include "Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp" #include "Acts/Plugins/Json/ActsJson.hpp" +void initializeEtaVector(std::vector& target, + const std::vector& source, + std::size_t etaBinSize) { + if (source.size() == etaBinSize - 1) { + target = source; // Directly copy if sizes match + } else if (source.size() == 1) { + target.resize(etaBinSize - 1); // Resize target to the required size + std::fill(target.begin(), target.end(), + source[0]); // Fill with the single value from source + } else { + throw std::invalid_argument("Invalid cuts size. Expected 1 or " + + std::to_string(etaBinSize - 1) + ", got " + + std::to_string(source.size())); + } +} namespace Acts { void from_json(const nlohmann::json& j, ConfigPair& p) { @@ -27,12 +42,6 @@ void from_json(const nlohmann::json& j, ConfigPair& p) { detectorConfig.outliersScoreWeight = value["outliersScoreWeight"]; detectorConfig.otherScoreWeight = value["otherScoreWeight"]; - detectorConfig.minHits = value["minHits"]; - detectorConfig.maxHits = value["maxHits"]; - detectorConfig.maxHoles = value["maxHoles"]; - detectorConfig.maxOutliers = value["maxOutliers"]; - detectorConfig.maxSharedHits = value["maxSharedHits"]; - detectorConfig.sharedHitsFlag = value["sharedHitsFlag"]; const std::vector& goodHits = value["goodHits"]; @@ -41,10 +50,43 @@ void from_json(const nlohmann::json& j, ConfigPair& p) { const std::vector& fakeHits = value["fakeHits"]; const std::vector& fakeHoles = value["fakeHoles"]; + const std::vector& etaBins = value["etaBins"]; + + // Validate eta bins + if (!etaBins.empty()) { + // Verify monotonically increasing eta bins + if (!std::is_sorted(etaBins.begin(), etaBins.end())) { + throw std::invalid_argument( + "Eta bins must be monotonically increasing"); + } + + detectorConfig.etaBins = etaBins; + } + + const std::vector& minHitsPerEta = value["minHitsPerEta"]; + initializeEtaVector(detectorConfig.minHitsPerEta, minHitsPerEta, + detectorConfig.etaBins.size()); + + const std::vector& maxHolesPerEta = value["maxHolesPerEta"]; + initializeEtaVector(detectorConfig.maxHolesPerEta, maxHolesPerEta, + detectorConfig.etaBins.size()); + + const std::vector& maxOutliersPerEta = + value["maxOutliersPerEta"]; + initializeEtaVector(detectorConfig.maxOutliersPerEta, maxOutliersPerEta, + detectorConfig.etaBins.size()); + + const std::vector& maxSharedHitsPerEta = + value["maxSharedHitsPerEta"]; + initializeEtaVector(detectorConfig.maxSharedHitsPerEta, maxSharedHitsPerEta, + detectorConfig.etaBins.size()); + if (goodHits.size() != fakeHits.size()) { throw std::invalid_argument("goodHits and FakeHits size mismatch"); } + detectorConfig.factorHits = {}; + detectorConfig.maxHits = goodHits.size() - 1; for (std::size_t i = 0; i < goodHits.size(); i++) { detectorConfig.factorHits.push_back(goodHits[i] / fakeHits[i]); } @@ -53,6 +95,8 @@ void from_json(const nlohmann::json& j, ConfigPair& p) { throw std::invalid_argument("goodHoles and FakeHoles size mismatch"); } + detectorConfig.factorHoles = {}; + detectorConfig.maxHoles = goodHoles.size() - 1; for (std::size_t i = 0; i < goodHoles.size(); i++) { detectorConfig.factorHoles.push_back(goodHoles[i] / fakeHoles[i]); } diff --git a/Tests/UnitTests/Core/AmbiguityResolution/ScoreBasedAmbiguityResolutionTest.cpp b/Tests/UnitTests/Core/AmbiguityResolution/ScoreBasedAmbiguityResolutionTest.cpp index 55beab4ca2f..8a1f716ac45 100644 --- a/Tests/UnitTests/Core/AmbiguityResolution/ScoreBasedAmbiguityResolutionTest.cpp +++ b/Tests/UnitTests/Core/AmbiguityResolution/ScoreBasedAmbiguityResolutionTest.cpp @@ -48,13 +48,8 @@ struct Fixture { config.minScore = 0; config.minScoreSharedTracks = 100; config.maxShared = 5; + config.minUnshared = 3; config.maxSharedTracksPerMeasurement = 10; - config.phiMax = 3.14; - config.phiMin = -3.14; - config.etaMax = 2.7; - config.etaMin = -2.7; - config.pTMax = 1400; - config.pTMin = 0.5; config.useAmbiguityFunction = false; }