diff --git a/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp b/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp index 2cc417bc133..2f59a153b37 100644 --- a/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp +++ b/Core/include/Acts/EventData/MultiTrajectoryHelpers.hpp @@ -28,6 +28,7 @@ struct TrajectoryState { std::size_t nMeasurements = 0; std::size_t nOutliers = 0; std::size_t nHoles = 0; + //std::size_t nEdgeHoles = 0; double chi2Sum = 0; std::vector measurementChi2 = {}; std::vector outlierChi2 = {}; @@ -61,7 +62,10 @@ TrajectoryState trajectoryState(const traj_t& multiTraj, std::size_t tipIndex) { auto typeFlags = state.typeFlags(); if (typeFlags.test(Acts::TrackStateFlag::HoleFlag)) { trajState.nHoles++; - } else if (typeFlags.test(Acts::TrackStateFlag::OutlierFlag)) { + } //else if (typeFlags.test(Acts::TrackStateFlag::EdgeHoleFlag)) { + //trajState.nEdgeHoles++; + //} + else if (typeFlags.test(Acts::TrackStateFlag::OutlierFlag)) { trajState.nOutliers++; trajState.outlierChi2.push_back(state.chi2()); trajState.outlierVolume.push_back(volume); @@ -113,7 +117,10 @@ VolumeTrajectoryStateContainer trajectoryState( auto typeFlags = state.typeFlags(); if (typeFlags.test(Acts::TrackStateFlag::HoleFlag)) { trajState.nHoles++; - } else if (typeFlags.test(Acts::TrackStateFlag::OutlierFlag)) { + } //else if (typeFlags.test(Acts::TrackStateFlag::EdgeHoleFlag)) { + //trajState.nEdgeHoles++; + //} + else if (typeFlags.test(Acts::TrackStateFlag::OutlierFlag)) { trajState.nOutliers++; trajState.outlierChi2.push_back(state.chi2()); trajState.outlierVolume.push_back(volume); diff --git a/Core/include/Acts/EventData/TrackProxy.hpp b/Core/include/Acts/EventData/TrackProxy.hpp index 722c69afba1..c3315df4aaf 100644 --- a/Core/include/Acts/EventData/TrackProxy.hpp +++ b/Core/include/Acts/EventData/TrackProxy.hpp @@ -349,12 +349,28 @@ class TrackProxy { return component(); } - /// Return the number of measurements for the track. Const version - /// @return The number of measurements + /// Return the number of holes for the track. Const version + /// @return The number of holes unsigned int nHoles() const { return component(); } + /// Return a mutable reference to the number of edge holes for the track. + /// Mutable version + /// @note Only available if the track proxy is not read-only + /// @return The number of edge holes + //unsigned int& nEdgeHoles() + // requires(!ReadOnly) + //{ + // return component(); + //} + + /// Return the number of edge holes for the track. Const version + /// @return The number of edge holes + //unsigned int nEdgeHoles() const { + // return component(); + //} + /// Return a mutable reference to the number of outliers for the track. /// Mutable version /// @note Only available if the track proxy is not read-only @@ -596,6 +612,7 @@ class TrackProxy { nMeasurements() = other.nMeasurements(); nHoles() = other.nHoles(); + //nEdgeHoles() = other.nEdgeHoles(); nOutliers() = other.nOutliers(); nSharedHits() = other.nSharedHits(); chi2() = other.chi2(); diff --git a/Core/include/Acts/EventData/TrackStateType.hpp b/Core/include/Acts/EventData/TrackStateType.hpp index 4820ffe6e19..a430b55e698 100644 --- a/Core/include/Acts/EventData/TrackStateType.hpp +++ b/Core/include/Acts/EventData/TrackStateType.hpp @@ -28,7 +28,8 @@ enum TrackStateFlag { HoleFlag = 3, MaterialFlag = 4, SharedHitFlag = 5, - NumTrackStateFlags = 6 + EdgeHoleFlag = 6, + NumTrackStateFlags = 7 }; class ConstTrackStateType; diff --git a/Core/include/Acts/EventData/VectorTrackContainer.hpp b/Core/include/Acts/EventData/VectorTrackContainer.hpp index d0ce9cf402d..a553389e8bc 100644 --- a/Core/include/Acts/EventData/VectorTrackContainer.hpp +++ b/Core/include/Acts/EventData/VectorTrackContainer.hpp @@ -84,6 +84,8 @@ class VectorTrackContainerBase { return &instance.m_nMeasurements[itrack]; case "nHoles"_hash: return &instance.m_nHoles[itrack]; + //case "nEdgeHoles"_hash: + // return &instance.m_nEdgeHoles[itrack]; case "chi2"_hash: return &instance.m_chi2[itrack]; case "ndf"_hash: @@ -126,6 +128,8 @@ class VectorTrackContainerBase { assert(result); result = result && m_nHoles.size() == size; assert(result); + //result = result && m_nEdgeHoles.size() == size; + //assert(result); result = result && m_chi2.size() == size; assert(result); result = result && m_ndf.size() == size; @@ -180,6 +184,7 @@ class VectorTrackContainerBase { std::vector m_nMeasurements; std::vector m_nHoles; + //std::vector m_nEdgeHoles; std::vector m_chi2; std::vector m_ndf; std::vector m_nOutliers; diff --git a/Core/include/Acts/Propagator/PropagatorOptions.hpp b/Core/include/Acts/Propagator/PropagatorOptions.hpp index 78e7edab2fe..dd466d51062 100644 --- a/Core/include/Acts/Propagator/PropagatorOptions.hpp +++ b/Core/include/Acts/Propagator/PropagatorOptions.hpp @@ -49,6 +49,9 @@ struct PurePropagatorPlainOptions { /// @note ignored if empty /// @note requires `VolumeConstraintAborter` aborter std::vector endOfWorldVolumeIds; + /// Placeholder:: edgeHoles + bool keepEdgeHoles=false; + }; } // namespace detail diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index 5b1a0183274..ac70ae23d83 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -518,6 +518,10 @@ class CombinatorialKalmanFilter { /// Calibration context for the finding run const CalibrationContext* calibrationContextPtr{nullptr}; + + /// PlaceHolder for EdgeHoles + bool keepEdgeHoles = false; + /// @brief CombinatorialKalmanFilter actor operation /// /// @tparam propagator_state_t Type of the Propagator state @@ -810,6 +814,7 @@ class CombinatorialKalmanFilter { currentBranch = result.activeBranches.back(); prevTip = currentBranch.tipIndex(); } else { + if (expectMeasurements) { ACTS_VERBOSE("Detected hole after measurement selection on surface " << surface->geometryId()); @@ -829,6 +834,17 @@ class CombinatorialKalmanFilter { exclude_sensor_border)) { currentBranch.nHoles()++; } + else { + if (!keepEdgeHoles) { + currentBranch.nHoles()++; + } + else { + auto typeFlags = currentState.typeFlags(); + typeFlags.reset(TrackStateFlag::HoleFlag); + typeFlags.set(TrackStateFlag::EdgeHoleFlag); + //currentBranch.nEdgeHoles()++; + } + } } BranchStopperResult branchStopperResult = @@ -1203,6 +1219,8 @@ class CombinatorialKalmanFilter { combKalmanActor.updaterLogger = m_updaterLogger.get(); combKalmanActor.calibrationContextPtr = &tfOptions.calibrationContext.get(); + combKalmanActor.keepEdgeHoles = tfOptions.propagatorPlainOptions.keepEdgeHoles; + // copy source link accessor, calibrator and measurement selector combKalmanActor.m_sourceLinkAccessor = tfOptions.sourceLinkAccessor; combKalmanActor.m_extensions = tfOptions.extensions;