Skip to content

Conversation

@yyzhang666
Copy link
Contributor

@yyzhang666 yyzhang666 commented Dec 16, 2025

BEGINRELEASENOTES

  • Fixes several related issues caused by comparing copied reconstructed particles with originals by pointer identity
  • Avoids self-counting in isolation cone energy
  • Ensures jet-based isolation uses original PFOs
  • Completes copying of tracks and clusters when duplicating PFOs

ENDRELEASENOTES

@tmadlener
Copy link
Contributor

Thanks a lot for putting this together. A few comments / requests.

  • This looks like it includes the changes from Bugfixes in SLDCorrection #143. Is that correct?
  • There are quite a few merge conflicts in this PR. It might be that your work. This is almost certainly because it starts off quite a bit back from the master branch. This should probably be fixable by formatting the file accordingly, e.g. via clang-format -i -style=file Analysis/*/*/*.{cc,h}
  • Please keep the original block from the template and fill the release notes in between them, as we use these tags to generate release notes for all PRs automatically (i.e. the BEGINRELEASENOTES ... ENDRELEASENOTES).

@yyzhang666 yyzhang666 force-pushed the fix-isolation-cone-selfcount branch from 14bb277 to a3b62de Compare December 18, 2025 14:25
@yyzhang666
Copy link
Contributor Author

yyzhang666 commented Dec 18, 2025

Apology that I'm new to all git stuff.

* This looks like it includes the changes from [Bugfixes in SLDCorrection #143](https://github.com/iLCSoft/MarlinReco/pull/143). Is that correct?

I work from Bryan's repository so it may contains this #143 . I have rebased it to the current version officially here.

* There are quite a few merge conflicts in this PR. It might be that your work. This is almost certainly because it starts off quite a bit back from the master branch. This should probably be fixable by formatting the file accordingly, e.g. via `clang-format -i -style=file Analysis/*/*/*.{cc,h}`

Now I only formatted the IsolatedLeptonFinder, seems still some conflicts, I manually resolved them in Github here. But now sure if it is good, should I format all repository?

* Please keep the original block from the template and fill the release notes in between them, as we use these tags to generate release notes for all PRs automatically (i.e. the `BEGINRELEASENOTES ... ENDRELEASENOTES`).

Yes, I edit the first comment block and hope this is correct?

@yyzhang666 yyzhang666 force-pushed the fix-isolation-cone-selfcount branch from f84c2de to a3b62de Compare December 18, 2025 15:07
@yyzhang666 yyzhang666 force-pushed the fix-isolation-cone-selfcount branch from a3b62de to 1701e22 Compare December 18, 2025 15:37
Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

It looks like you have successfully picked only your changes here. There still seems to be quite a bit of additional formatting going on. In which (software) environment / setup are you running clang-format? In the end this doesn't matter too much for now, we can always fix it in the end, when all the other things are done.

I have a few smaller comments / requests below.

On the bigger picture it's not entirely clear to me why this processor creates copies of all PFOs. It also looks to me like they are (at least partially) leaked, but that seems to be pre-existing behavior. Did you by chance run into any memory issues when running this processor on larger samples?

Added detailed reason for the _copy2orig map.
@yyzhang666
Copy link
Contributor Author

yyzhang666 commented Dec 19, 2025

It looks like you have successfully picked only your changes here. There still seems to be quite a bit of additional formatting going on. In which (software) environment / setup are you running clang-format? In the end this doesn't matter too much for now, we can always fix it in the end, when all the other things are done.

It's what the ZHH repository are using: /cvmfs/sw.hsf.org/key4hep/releases/2024-10-03/x86_64-almalinux9-gcc14.2.0-opt/llvm/17.0.6-7m4ago/bin/clang-format

On the bigger picture it's not entirely clear to me why this processor creates copies of all PFOs. It also looks to me like they are (at least partially) leaked, but that seems to be pre-existing behavior. Did you by chance run into any memory issues when running this processor on larger samples?

I only run 12500 events once at most so far, looks normal. They basically use an additional collection to dress leptons and output a collection without isolated leptons.

@tmadlener
Copy link
Contributor

It's what the ZHH repository are using: /cvmfs/sw.hsf.org/key4hep/releases/2024-10-03/x86_64-almalinux9-gcc14.2.0-opt/llvm/17.0.6-7m4ago/bin/clang-format

Ah, OK. Yeah that then explains it. The version that is used by the pre-commit workflow is 20, so there are some differences. In this case, I will fix the formatting at the end, once we have dealt with the rest. :)

yyzhang666 and others added 3 commits December 19, 2025 15:24
Added a private method to find the original PFO for copied particles.
Refactor to use findOriginal method for retrieving original ReconstructedParticle.
Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

I will push a commit with fixed formatting (which should also make the diff slightly smaller). I will have another look after that, but I think this is in pretty good shape now.

if (_rpJetMap.find(pfo) == _rpJetMap.end()) {
if (_rpJetMap.find(orig) == _rpJetMap.end()) {
// this is often the case when jet finding fails e.g. due to too few particles in event
// Use original address
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this comment further up. Alternatively, remove it entirely as it is pretty obvious from the code what we are doing, but the why we are doing it is missing. In this case the why is probably simply that the _rpJetMap stores the original PFOs, so also that is not extremely interesting, resp. can also be derived from the code in a rather straight forward manner.

pfo->setStartVertex(pfo_orig->getStartVertex());
for (unsigned int i = 0; i < pfo->getTracks().size(); i++) {

// FIXED
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// FIXED

Looks like another leftover from development.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, those comments was written earlier and forgot to arrange them

@tmadlener tmadlener enabled auto-merge (squash) December 22, 2025 12:17
@tmadlener tmadlener merged commit d67b1c2 into iLCSoft:master Dec 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants