-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Do NaN-check before accepting a PF candidate for computing photon's isolation #39120
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39120/31674
|
A new Pull Request was created by @swagata87 (Swagata Mukherjee) for master. It involves the following packages:
@jpata, @cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild please test |
type egamma |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d9bdb3/26946/summary.html Comparison SummarySummary:
|
Perhaps a warning message would be appropriate. It seems to me we don't want to hide the problem of NaN PF candidates downstream (other stuff beyond Egamma might be affected). |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39120/31698
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
Tests look good. @swagata87 did you confirm it fixes the NaN in photon isolation as well (I wasn't able to reproduce the issue myself so far). |
Hi, yes I confirm that the nan issue is solved for photon isolation. |
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.
A very minor performance improvement suggested (there should be no need to copy the vectors).
I hope we can merge this today.
@@ -96,7 +96,7 @@ class PhotonIDValueMapProducer : public edm::global::EDProducer<> { | |||
// HiggsTo2photons anaysis code. Template is introduced to handle reco/pat | |||
// photons and aod/miniAOD PF candidates collections | |||
float computeWorstPFChargedIsolation(const reco::Photon& photon, | |||
const edm::View<reco::Candidate>& pfCands, | |||
const std::vector<edm::Ptr<reco::Candidate>> pfCands, |
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.
const std::vector<edm::Ptr<reco::Candidate>> pfCands, | |
const std::vector<edm::Ptr<reco::Candidate>>& pfCands, |
to avoid a vector copy.
@@ -358,7 +367,7 @@ void PhotonIDValueMapProducer::fillDescriptions(edm::ConfigurationDescriptions& | |||
// Charged isolation with respect to the worst vertex. See more | |||
// comments above at the function declaration. | |||
float PhotonIDValueMapProducer::computeWorstPFChargedIsolation(const reco::Photon& photon, | |||
const edm::View<reco::Candidate>& pfCands, | |||
const std::vector<edm::Ptr<reco::Candidate>> pfCands, |
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.
const std::vector<edm::Ptr<reco::Candidate>> pfCands, | |
const std::vector<edm::Ptr<reco::Candidate>>& pfCands, |
to avoid a vector copy.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39120/31791
|
Pull request #39120 was updated. @jpata, @cmsbuild, @mandrenguyen, @clacaputo can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d9bdb3/27083/summary.html Comparison SummarySummary:
|
+reconstruction
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
This PR proposes to add a NaN-check on PF candidate's pT, before accepting that candidate for photon's isolation calculation.
It was found, as discussed in this github issue (#39110), that in some rare cases, PF candidate's pT/eta/phi is
-nan
, and this leads to photon's PF-based isolation to be-nan
as well. The patch provided in this PR will bypass that problem for photons, and photon's isolation sum will return a meaningful value.In recent data (
2022C
,EGamma
dataset) in Run355872
, Event546279379
, LumiSection508
,without this PR: photon's
chargedHadronIso=-nan
with this PR: photon's
chargedHadronIso=0.683148
This is checked with these files:
miniAOD:
/store/data/Run2022C/EGamma/MINIAOD/PromptReco-v1/000/355/872/00000/035b7e72-7f0d-42c8-98c7-d0a5100211fe.root
RAW:
/store/data/Run2022C/EGamma/RAW/v1/000/355/872/00000/3b478527-d206-4b8e-8004-08e9aff7758b.root
and,
eventsToProcess = cms.untracked.VEventRange('355872:546279379-355872:546279379')
It was checked that similar
nan
issues in MC, discussed in the github issue (#39110), are also fixed with this patch, as expected.Note: we have not found any instance of electron's PFChargedHadIso being nan. Until now, the issue happened only for photons.
PR validation:
runTheMatrix.py -l 11834.0
This PR is not a backport.
Since the issue seem to be happening also in prompt reco data, a backport to current data-taking release cycle (12_4_X) might be helpful, to have meaningful PF isolation values of reconstructed photons, in all events.