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

PackedCandidate PF MuonID flags not properly set in PATPackedCandidateProducer? Implications on Type-1 MET re-correction #45814

Closed
nurfikri89 opened this issue Aug 27, 2024 · 9 comments

Comments

@nurfikri89
Copy link
Contributor

I have encountered what might be an unintentional wrong set up (?) regarding the MuonID flags of pat::PackedCandidates in MiniAODs. It seems that there are (somewhat rare) instances where pat::PackedCandidate PF muons,
whose isStandAloneMuon() and isGlobalMuon() flags are false but for its original reco::PFCandidate in the parent AOD, the two MuonID flags are true. Technically for the reco::PFCandidate, these flags are retrieved through its muonRef().

This inconsistency can be traced back to how the MuonID flags are set up in PATPackedCandidateProducer:

if (cand.muonRef().isNonnull()) {
outPtrP->back().setMuonID(cand.muonRef()->isStandAloneMuon(), cand.muonRef()->isGlobalMuon());
}

where setMuonID() is called when the reco::PFCandidate has cand.muonRef().isNonnull() and the candidate has a trackRef():

The instances that I mentioned above are when a reco::PFCandidate muon have a muonRef() but do not have a trackRef() . To fix this inconsistency, we just need to move MuonID flags setting block, to outside of the if (ctrack) block.

One implication for this is the consistency of Type-1 MET corrections for different data-tiers usage (which is the context of my study).

The Type-1 correction procedure requires that PF muon candidates inside a jet are to be removed from the jet raw four-vector if it passes isStandAloneMuon() or isGlobalMuon() flags and this is where the Muon ID flag differences between reco::PFCandidate and pat::PackedCandidate becomes a source of inconsistency between (Type-1 corrected) MET in MiniAOD and the MET re-corrections when they are done during MiniAOD processing.

At the PAT step, the jet cleaning stage (to remove PF muon constituents) loops over reco::PFCandidates while for the NANO step (or any analysis using MiniAODs as input), it loops over pat::PackedCandidates. This leads to situations where the PF muon is removed because it passes either MuonID flags if it is a reco::PFCandidate but it does not get removed when it is a pat::PackedCandidate due to the two ID flags not being set at all in PATPackedCandidateProducer.

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 27, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

A new Issue was created by @nurfikri89.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@makortel
Copy link
Contributor

assign PhysicsTools/PatAlgos

@cmsbuild
Copy link
Contributor

New categories assigned: reconstruction,xpog

@vlimant,@hqucms,@ftorrresd,@jfernan2,@mandrenguyen you have been requested to review this Pull request/Issue and eventually sign? Thanks

@nurfikri89
Copy link
Contributor Author

Fixed with PR #45818, merged with 14_2_X.

@hqucms
Copy link
Contributor

hqucms commented Sep 3, 2024

+1

@jfernan2
Copy link
Contributor

jfernan2 commented Sep 4, 2024

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 4, 2024

This issue is fully signed and ready to be closed.

@makortel
Copy link
Contributor

makortel commented Sep 4, 2024

@cmsbuild, please close

@cmsbuild cmsbuild closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants