-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TrackClusterMergeSplitter to output track-cluster associations (PFA0) #1699
Open
ruse-traveler
wants to merge
35
commits into
main
Choose a base branch
from
output-splitmerge-track-associations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
68672a9
Add hooks for track-cluster match outputs
ruse-traveler 90a9ccc
Update algorithm to operate on clusters
ruse-traveler 335d224
Begin filling in cluster reconstruction calculation
ruse-traveler 68fa03d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f8605e8
Add position calculation
ruse-traveler de78ffb
Fix typos in input collection names
ruse-traveler 1d04aa8
Merge branch 'output-splitmerge-track-associations' of github.com:eic…
ruse-traveler 30b92d3
Add missing edm4eic version header
ruse-traveler 021e11b
Be safer with creating new clusters
ruse-traveler 0307731
Rework weight calculation to accomodate cluster re-reconstruction
ruse-traveler f8d2050
Fill track-cluster match output
ruse-traveler 3dab6d8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] bf31964
Add missed edm4eic version header
ruse-traveler 178ecb8
Merge branch 'output-splitmerge-track-associations' of github.com:eic…
ruse-traveler b4b0aca
Add shape calculation
ruse-traveler 303f3f2
Wire in associations
ruse-traveler a2ff2f1
Copy associations of unused clusters into output
ruse-traveler f7476b4
Fill in mergerd cluster associations
ruse-traveler 14deb24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b5a364c
Merge branch 'main' into output-splitmerge-track-associations
ruse-traveler 8141330
Fix HcalEndcapNClusterAssociations typo
ruse-traveler 1c17703
Merge branch 'output-splitmerge-track-associations' of github.com:eic…
ruse-traveler 0c75eb9
Template ObjectID comparator
ruse-traveler bd55165
Rewrite splitting weight calculation to use maps
ruse-traveler 32af87f
Merge branch 'main' into output-splitmerge-track-associations
ruse-traveler cc282d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 143df2a
Merge main
ruse-traveler 8288600
Remove shape calculation from merge/splitter
ruse-traveler 30c9ab2
Merge branch 'output-splitmerge-track-associations' of github.com:eic…
ruse-traveler 9d33912
Make split/merge shape parameters consistent with RecoCoG
ruse-traveler a8537b1
IWYU
veprbl 004b053
Merge branch 'main' into output-splitmerge-track-associations
ruse-traveler 87c0458
Disable saving split/merge track-cluster matches to output
ruse-traveler f79708b
Merge branch 'output-splitmerge-track-associations' of github.com:eic…
ruse-traveler 27711f5
Merge branch 'main' into output-splitmerge-track-associations
ruse-traveler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
387 changes: 283 additions & 104 deletions
387
src/algorithms/calorimetry/TrackClusterMergeSplitter.cc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, we were discussing that this should not re-implement shape calculation, and that was factorized out of RecoCoG, but a copy of RecoCoG still becomes part of this algorithm? And we don't actually output associations without shapes anymore, which, I believe, was the original point of this PR. This makes me think that we should have just made a factory to propagate associations from protoclusters to clusters instead of doing this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the primary point of this PR was to output specifically track-cluster matches. To do this, this requires updating the algorithm to operate on clusters rather than protoclusters since -- quite reasonably in my opinion! -- we don't have track-protocluster matches. I don't think an association propagator would help us in this context (esp. since it would necessitate a data-model change).
The partial duplication of RecoCoG then followed from that switch to clusters. My intent wasn't so much to completely duplicate the algorithm but to update various quantities in a way that's consistent with what RecoCoG does, including the handling of particle-cluster associations. My thinking is that the merging functionality here is useful beyond PF reconstruction, and so I would prefer that the produced clusters here are consistent with those that RecoCoG produces.
That being said, in the interest of keeping PF development moving, I would be willing to excise the RecoCoG bits and go with a "bare-bones" energy/position reconstruction for the time being. That should be good enough for implementing the rest of the baseline. But we should revisit this topic, though, since this certainly won't be the last reclustering algorithm we write!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so my suggestion was to add track-protocluster association type. Then a factory (that is separate from RecoCoG) would convert track-protocluster associations to track-cluster associations. I now realize this would require factory to do matching between protoclusters and clusters, which is possible but is not as trivial as I'd like it to be.
Right, but that's not making it better, if we do things "like RecoCoG, but sometimes not". And, if we want to make this the default for non-PF clustering path, then it makes even more sense to use RecoCoG.
No need to excise parts of RecoCoG. If we go the way proposed in the PR, it better be fit for your purpose. My counter-argument against expediency is that if TrackClusterMergeSplitter development is not aligned with rest of the facilities in EICrecon, you can't expect everyone else to align with it, which is fine if your plan to do all of development yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading my response back, I feel that not only was my tone unprofessional and dismissive, I did not clearly articulate (or articulate at all) some of my questions and concerns, and for that I apologize.
The approach took here was informed by the intent to eventually move this algorithm downstream of a centralized track-cluster matching algorithm. As such, this algorithm reclusters already constructed clusters. This PR was my first thought as to how to do such a reclustering and I sincerely believed it was aligned with our framework. However, it clearly isn't and certainly isn't the best approach.
The points you raised make sense, and it didn't occur to me to go back through the protoclusters. I'm not completely clear on how this might look, though, so help me understand. My first thought is that such an algorithm flow might look something like this:
Is this in the right direction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was all good points and I was able to finally understand some of these things better. I did have to push back on merge splitter being able to do its thing in isolation.
I'm starting to think that
edm4eic::ProtoCluster
is not such a great type.edm4eic::Cluster
is already a superset of it, and we could have used just that one type.To be honest, I can not tell with one-dimensional graph. This is what I think could work and provide maximal reuse of existing facilities:
We would need a new "CalorimeterProtoClusterMatchPromotion" algorithm operating on a new type for "TrackSplitMergeProtoClusterMatches".
(you can click quote my message to see source code of mermaid diagram and modify, if you want to adjust it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see! Thanks! The diagram is extremely helpful!!
Completely fair! I was falling into bad habits of writing big, monolithic pieces of code while working on this PR. The above topology looks a lot more workable!
If we stick with protoclusters for the time being, would we also need an algorithm to "demote" clusters into protoclusters that could be fed into the merge/splitter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diagram above has
TrackClusterMergeSplitter
consuming a collection ofedm4eic::Cluster
s (don't you need cluster positions to do the matching?) and outputtingedm4eic::ProtoCluster
s.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... so demotion happens inside TrackClusterMergeSplitter, at least to what's drawn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhhh I see! Makes sense! That would make it pretty straightforward to keep track of the protocluster energies and positions without having to duplicate
getEnergy()
andgetPosition()
as functions.