-
Notifications
You must be signed in to change notification settings - Fork 43
Fix cone energy self-counting in IsolatedLeptonFinderProcessor #155
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
Fix cone energy self-counting in IsolatedLeptonFinderProcessor #155
Conversation
|
Thanks a lot for putting this together. A few comments / requests.
|
14bb277 to
a3b62de
Compare
|
Apology that I'm new to all git stuff.
|
f84c2de to
a3b62de
Compare
a3b62de to
1701e22
Compare
tmadlener
left a comment
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.
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?
Analysis/IsolatedLeptonFinder/include/IsolatedLeptonFinderProcessor.h
Outdated
Show resolved
Hide resolved
Analysis/IsolatedLeptonFinder/src/IsolatedLeptonFinderProcessor.cc
Outdated
Show resolved
Hide resolved
Analysis/IsolatedLeptonFinder/src/IsolatedLeptonFinderProcessor.cc
Outdated
Show resolved
Hide resolved
Analysis/IsolatedLeptonFinder/src/IsolatedLeptonFinderProcessor.cc
Outdated
Show resolved
Hide resolved
Added detailed reason for the _copy2orig map.
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
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. |
Ah, OK. Yeah that then explains it. The version that is used by the |
Analysis/IsolatedLeptonFinder/include/IsolatedLeptonFinderProcessor.h
Outdated
Show resolved
Hide resolved
Analysis/IsolatedLeptonFinder/src/IsolatedLeptonFinderProcessor.cc
Outdated
Show resolved
Hide resolved
Analysis/IsolatedLeptonFinder/src/IsolatedLeptonFinderProcessor.cc
Outdated
Show resolved
Hide resolved
Added a private method to find the original PFO for copied particles.
Refactor to use findOriginal method for retrieving original ReconstructedParticle.
tmadlener
left a comment
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 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 |
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 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 |
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.
| // FIXED |
Looks like another leftover from development.
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.
Yes, those comments was written earlier and forgot to arrange them
BEGINRELEASENOTES
ENDRELEASENOTES