cms-nanoAOD / cmssw

CMS NanoAOD software integration repository
http://cms-sw.github.io/
Apache License 2.0
3 stars 10 forks source link

Jet used in prompt lepton MVA vs cross-linked jets #512

Closed ktht closed 2 years ago

ktht commented 4 years ago

The prompt lepton MVA uses updatedJets: https://github.com/cms-nanoAOD/cmssw/blob/7141d61981a63d454f4e536141a38bdb518b8106/PhysicsTools/NanoAOD/python/electrons_cff.py#L156-L160 https://github.com/cms-nanoAOD/cmssw/blob/7141d61981a63d454f4e536141a38bdb518b8106/PhysicsTools/NanoAOD/python/muons_cff.py#L32-L36 While the final associations are created from the finalJets collection: https://github.com/cms-nanoAOD/cmssw/blob/7141d61981a63d454f4e536141a38bdb518b8106/PhysicsTools/NanoAOD/python/nano_cff.py#L33-L39

I noticed that in about 5% of the cases LeptonJetVarProducer finds an associated jet that PATObjectCrossLinker cannot find. I think (but cannot confirm at the moment) this is because of the pT cut applied to the finalJets collection: https://github.com/cms-nanoAOD/cmssw/blob/7141d61981a63d454f4e536141a38bdb518b8106/PhysicsTools/NanoAOD/python/jets_cff.py#L172-L175 This has the effect that it's possible to restore the associated jet variables (jetRelIso, jetPtRelv2) using jetIdx branch in about 95% of the cases.

After replacing updatedJets with finalJets during the evaluation of the prompt lepton MVA, I don't see this inconsistency anymore.

vlimant commented 2 years ago

thanks, dully noted

swertz commented 1 year ago

I think this behaviour is intended: the inputs to the MVA are computed using the associated jet without the pt >15 cut applied to jets at nanoAOD level, because information from low pt jets is important for low pt leptons. Also, this is consistent with what one would obtain when running the MVA on miniAOD.

This is the whole point of storing variables such as jetRelIso or jetNDauCharged in the electron and muon tables: they cannot be recomputed using the jets stored in nanoAOD and jetIdx because of the jet pt cut.