Skip to content
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

treewide: use PODIO ObjectID instead SimID/RecID indices #1346

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Conversation

veprbl
Copy link
Member

@veprbl veprbl commented Mar 24, 2024

Briefly, what does this PR introduce?

This is a subset of #970, that removes use of SimID and RecID fields (while switching to comparisons of full object id's instead of just the indices).
In principle, we could even drop .getObjectID() in comparisons and just use Object::operator== https://github.com/AIDASoft/podio/blob/400f4f06bef3e7666c71e31be579ec715c412b8a/python/templates/macros/implementations.jinja2#L160, which relies on pointer comparison instead.

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No

Does this PR change default behavior?

No

@github-actions github-actions bot added the topic: PID Relates to PID reconstruction label Mar 24, 2024
@veprbl veprbl requested a review from simonge March 24, 2024 04:09
@simonge
Copy link
Contributor

simonge commented Mar 25, 2024

If this is just a purge of using SimID and RecID then looks good. Otherwise it might be a good idea to remove all calls to .index other than in log outputs so the check that it really is the same object from the correct collection is in place and not something from another collection with the same index.

What is the argument against comparing the objects as opposed to using getObjectID?

@veprbl
Copy link
Member Author

veprbl commented Mar 25, 2024

If this is just a purge of using SimID and RecID then looks good. Otherwise it might be a good idea to remove all calls to .index other than in log outputs so the check that it really is the same object from the correct collection is in place and not something from another collection with the same index.

Note, this is already removing calls to .index in comparisons, so both index and collection ID are being compared.

What is the argument against comparing the objects as opposed to using getObjectID?

Not really an argument. I'm just having hard time convincing myself that pointer comparison will always do what we want. You think it's fine?

@simonge
Copy link
Contributor

simonge commented Mar 25, 2024

Note, this is already removing calls to .index in comparisons, so both index and collection ID are being compared.

The use as mcID in MatchClusters could probably just drop the .index and still work equivalently. There is other cleaning up that could be done in the algorithm anyway so could be deferred.

What is the argument against comparing the objects as opposed to using getObjectID?

Not really an argument. I'm just having hard time convincing myself that pointer comparison will always do what we want. You think it's fine?

I just thought it would look cleaner, keeping getObjectID is probably the more sensible approach.

Copy link
Contributor

@simonge simonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MatchClusters wouldn't be a simple change so happy within the PR scope

@simonge simonge added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit 988dade Mar 27, 2024
75 checks passed
@simonge simonge deleted the pr/use_objectid branch March 27, 2024 22:00
ajentsch pushed a commit that referenced this pull request May 20, 2024
### Briefly, what does this PR introduce?

This is a subset of #970, that removes use of SimID and RecID fields
(while switching to comparisons of full object id's instead of just the
indices).
In principle, we could even drop `.getObjectID()` in comparisons and
just use `Object::operator==`
https://github.com/AIDASoft/podio/blob/400f4f06bef3e7666c71e31be579ec715c412b8a/python/templates/macros/implementations.jinja2#L160,
which relies on pointer comparison instead.

### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No

### Does this PR change default behavior?
No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: PID Relates to PID reconstruction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants