Open goetzgaycken opened 3 weeks ago
Significant changes made to the CombinatorialKalmanFilter
and related files. The CombinatorialKalmanFilter
class has been restructured, removing the CombinatorialKalmanFilterBranchStopperResult
enum and CombinatorialKalmanFilterExtensions
struct, integrating their functionalities directly into the class. The template parameters for CombinatorialKalmanFilterOptions
have been simplified. New files for TrackStateCreator
and CombinatorialKalmanFilterExtensions
were added, introducing new types and methods for track state management. The TrackFindingAlgorithm
and tests were updated to reflect these changes, enhancing clarity and maintainability.
File | Change Summary |
---|---|
Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp |
Removed CombinatorialKalmanFilterBranchStopperResult enum and CombinatorialKalmanFilterExtensions struct; simplified template parameters for CombinatorialKalmanFilterOptions and findTracks method. |
Core/include/Acts/TrackFinding/CombinatorialKalmanFilterExtensions.hpp |
Added new file defining CombinatorialKalmanFilterExtensions , including a new enum for branch stopper results and various type aliases. |
Core/include/Acts/TrackFinding/TrackStateCreator.hpp |
Introduced TrackStateCreator struct with methods for creating track states and managing measurements. |
Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp |
Updated TrackFinderOptions to simplify template parameters. |
Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp |
Integrated TrackStateCreator and adjusted measurement selection in the execute method. |
Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp |
Updated tests to incorporate TrackStateCreator and simplified CombinatorialKalmanFilterOptions . |
docs/_extensions/lazy_autodoc.py |
Added entry for Acts::TrackStateCreator in the documentation generator's role_instances . |
CombinatorialKalmanFilter
class in the same file, focusing on the logic and control flow of the filter
method.automerge
In the code, changes abound,
Simplified paths, clarity found.
Track states created with ease,
New structures bring a gentle breeze.
Jedi wisdom guides the way,
In the realm of code, we play! β¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
changes d3a565e29b216f8ed7c6f69c89edb09c35a84a68 to b44b8fe89abae78002c327ff462b54ed7828be29:
Why should there be brackets arround slAccessorDelegate TrackFindingAlgorithm.cpp:365 (macos build complains):
364 | TrackStateCandidateCreatorType trackStateCreator{
365 | slAccessorDelegate,
366 | Acts::makeDelegate<&MeasurementCalibratorAdapter::calibrate>(calibrator),
367 | Acts::makeDelegate<&MeasurementSelector::select>(measSel)};
Couple more thoughts on this:
I think going with a single level of composition would be clearer. Currently there's the base composable class that connects to the previous SourceLinkAccessor
, and then a second layer which accepts the other original delegates.
A single composable struct that by itself has the three (?) original delegates including the SourceLinkAccessor
would be sufficient if we drop the compatibility with the intermediate track state creator style delegate.
What do we need this second layer for after this change? I think having one layer of adapter to the fully separate makes sense, but the surface area of the track state creator seems small enough to me to remove that altogether.
It is only needed for the transition period. In my opinion it would be better to first introduce the new api and then merge on the athena side the track state creator and source link accessor. The amount of code duplication when introducing different helper objects for the two cases is small, though the simplification is also not significant. Therefore I would rather not duplicate the code, and rather remove the unnecessary code and layers later when they are not needed anymore. But I do not have a strong opinion.
The question for me would be, do we need a transition period? The change is breaking either way no? Touching this twice means we have to go through two breaking cycles.
The question for me would be, do we need a transition period? The change is breaking either way no? Touching this twice means we have to go through two breaking cycles.
It is certainly possible to merge at the same time on the athena side the source link accessor and track state creator. I don't have any strong argument to motivate why it is better to break this into smaller steps.
Changes from b44b8fe to b00f570 :
changes from b00f570 to 2cc2ecc:
compile fix missing from the above update.
I did not remove the adapter to support the components of the version 2 interface, which is currently used in ATLAS. I agree that there is no good reason to keep that around for long, but I am not sure whether it is a good strategy to make the interface change on the Acts side, and directly migrate on the ATLAS side to the new interface. The changes are not super complicated but also not trivial. Minimal changes to support the new interface on the athena side gitlab:EliminateSourceLinkAccessor_main~1, direct support of the new interface gitlab:EliminateSourceLinkAccessor_main,
changes from 2cc2ecc to dbfba96 :
changes from 2fa962c to 9493657:
Open discussion points:
should the new extension member be prefixed with "m_" although non of the others are prefixed in this way ? Extend this PR and add the prefix for all members ?
is the name "extendOrBranchTrajectory" a good name for the delegate ? Or should it be called trackStateCreator i.e the delegate this is kind of replacing (together with the sourceLinkAccessor)
Remove TrackStateCreatorDelegate which provides a helper which allows to use the previous track state create interface currently used by athena ? This would require to directly implement the new interface on the athena side. The idea is that e.g. the minimal changes to support the new interface would be simpler: (cern-gitlab:f8ac37ab3f, to directly support the new interface more changes are needed: cern-gitlab:171095fc26
Rename TrackStateCandidateCreatorImpl ? To what ?
Remove the buffer trajectory etc. from the new interface ? This would require that the implementation of the ComposableTrackStateCreator (TrackStateCandidateCreatorImpl) would have to provide this i.e. would gain this as a mutable member.
changes from 9493657 to abedde4:
Issues
4 New issues
0 Accepted issues
Measures
0 Security Hotspots
50.6% Coverage on New Code
0.0% Duplication on New Code
Open discussion points:
my 2 cents
- should the new extension member be prefixed with "m_" although non of the others are prefixed in this way ? Extend this PR and add the prefix for all members ?
The lose guideline here is that for struct
s we don't use m_
but only for classes.
- is the name "extendOrBranchTrajectory" a good name for the delegate ? Or should it be called trackStateCreator i.e the delegate this is kind of replacing (together with the sourceLinkAccessor)
I would be in favor of keeping trackStateCreator
- Remove TrackStateCreatorDelegate which provides a helper which allows to use the previous track state create interface currently used by athena ? This would require to directly implement the new interface on the athena side. The idea is that e.g. the minimal changes to support the new interface would be simpler: (cern-gitlab:f8ac37ab3f, to directly support the new interface more changes are needed: cern-gitlab:171095fc26
To me it seems easier to make one sharp cut and break the API directly without a transition phase. I think Atlas is the only experiment using this delegate so it is really up to you IMO. What is easier for you?
- Rename TrackStateCandidateCreatorImpl ? To what ?
I wondered if we remove the compatibility layer for the existing TrackStateCreator
if we could/should collapse ComposableTrackStateCreator
and TrackStateCandidateCreatorImpl
into one class?
- Remove the buffer trajectory etc. from the new interface ? This would require that the implementation of the ComposableTrackStateCreator (TrackStateCandidateCreatorImpl) would have to provide this i.e. would gain this as a mutable member.
I think this would be good to remove. In case we drop the existing TrackStateCreator
this would come for free?
- should the new extension member be prefixed with "m_" although non of the others are prefixed in this way ? Extend this PR and add the prefix for all members ?
The lose guideline here is that for
struct
s we don't usem_
but only for classes.
advantage "m_" prefix:
disadvantage "m_" prefix:
- is the name "extendOrBranchTrajectory" a good name for the delegate ? Or should it be called trackStateCreator i.e the delegate this is kind of replacing (together with the sourceLinkAccessor)
I would be in favor of keeping
trackStateCreator
ok.
- Remove TrackStateCreatorDelegate which provides a helper which allows to use the previous track state create interface currently used by athena ? This would require to directly implement the new interface on the athena side. The idea is that e.g. the minimal changes to support the new interface would be simpler: (cern-gitlab:f8ac37ab3f, to directly support the new interface more changes are needed: cern-gitlab:171095fc26
To me it seems easier to make one sharp cut and break the API directly without a transition phase. I think Atlas is the only experiment using this delegate so it is really up to you IMO. What is easier for you?
Certainly reduces the amount of new code.
- Rename TrackStateCandidateCreatorImpl ? To what ?
I wondered if we remove the compatibility layer for the existing
TrackStateCreator
if we could/should collapseComposableTrackStateCreator
andTrackStateCandidateCreatorImpl
into one class?
Indeed, if there is only a single implementation of ComposableTrackStateCreator there would not be a need to split off a derived class.
- Remove the buffer trajectory etc. from the new interface ? This would require that the implementation of the ComposableTrackStateCreator (TrackStateCandidateCreatorImpl) would have to provide this i.e. would gain this as a mutable member.
I think this would be good to remove. In case we drop the existing
TrackStateCreator
this would come for free?
The Acts measurement selector needs the buffer trajectory, so it would be moved from the CKF result and become a member of the track state creator helper class (TrackStateCandidateCreatorImpl). Interfaces become simpler. The TrackStateCandidateCreatorImpl would get a mutable state, but already has the source link accessor, so has an event state anyways.
Changes from abedde4 to df55dfb:
Updated changes an the athena side can be found here cern-gitlab:main_support_for_new_extendOrBranchTrajectory_delegate)
changes df55dfb to 9261956:
Changes from 9261956 to cae4ee3:
Still an open question:
is the mutable member in the TrackStateCreator for the track state candidate proxies a good idea ?
In case track finding is executed in parallel each thread (or even coroutine) would need its own version of the TrackStateCreator. It may sound worse than it is, since the trajectory cannot be extended concurrently, and the TrackStateCreator contains also the source link accessor which must have some kind of event state.
Though, the latter are not unsolvable, the trajectory is passed as argument to the track finder, and the source link accessor could get the event state from thread local storage.
But, on the other hand is good to have an argument in the trackStateCreator delegate and a buffer in CKF Result which has no obvious purpose except for the one implementation of the trackStateCreator which is currently in Acts ?
Maybe it is better to delay the removal until there is an implementation in Acts which does not need this buffer (?)
I think you are right - this kind of hidden thread local state is what we usually try to avoid in ACTS so I agree with you that it might be best for now to carry it through. I was hoping to get rid of it already but forgot about this side effect.
changes cae4ee3 to 56d0051:
corresponding update on the athena side is here: [main_support_for_new_extendOrBranchTrajectory_delegate](cern-gitlab:](https://gitlab.cern.ch/goetz/athena/-/commits/main_support_for_new_extendOrBranchTrajectory_delegate)
I don't have any further ideas. Undrafting.
A bit misleading summary by coder abitai,
Merge retrieval of source link ranges, measurement selection and track state creation into one unit which the CKF interacts with via a single delegate. The delegates for measurement selection track state creation and calibration are removed from the CKF options/extensions.
The original building blocks (SourceLink accessor, measurement selector, and track state creator, or the combined measurement selector and track state creator) can still be used, however require to setup an additional helper object which combines these independent components. The algorithmic code is unchanged.
As a prerequisite the track states are converted to bound states also on empty sensitive surfaces.
This increases the computational effort slightly for empty, sensitive surfaces, since the computation of bound states is slightly more demanding than the computation of curvilinear states, but for complex events like HL-LHC events the degradation was not measurable.
--- END COMMIT MESSAGE ---
Any further description goes here, @-mentions are ok here!
Summary by CodeRabbit
Release Notes
New Features
TrackStateCreator
for enhanced track state management.CombinatorialKalmanFilterExtensions
for improved filter behavior customization.Improvements
CombinatorialKalmanFilterOptions
, reducing complexity.TrackFindingAlgorithm
and related components.Bug Fixes
Documentation