Closed jpata closed 7 years ago
aren't the genjet pt sorted? if so the index should be valid until the pt cut (i.e. if the index is greater than nGenJet the association is not available because we do not store GenJets below threshold)
So are you sure there is something "incorrect" or just some info being missing? In case there are incorrect assignment it means we should first pt-sort the genjet
@jpata can you confirm what I wrote? is the fix really needed?
can you please check ?
yes on it. Sorry, I've been extremely busy teaching these weeks.
you're right, it's correct for any jet where the matching genJet had pt>=20
. However, where the matched gen-jet had pt<20
, the gen-jet doesn't exist. This means that it's a sharply falling pt spectrum of reco jets, but basically you cannot "predict" that the gen-jet corresponding to a reco jet didn't get filtered, other than checking Jet_mcIdx < nGenJet
.
well, yes the only way (but that's a way!) is to check nGenJets... We can optionally set it to -1, but checking against -1 is no different than checking against nGenJet ... isn't it?
no, sure, it's fine like it is. It's just that I was doing a matching study and was occasionally coming across reco jets with pt>30...40 (in our acceptance) that didn't have a corresponding gen-pt, hence got worried about biases. Also, if one suddenly decided to filter the gen-jets by something additional, like |eta| or lepton matching or whatever, the index would be screwed up, so one simply has to be careful about these ordered associations. by me the case can be closed.
btw if we need to go lower in pt I guess we could (not sure about how much size increase we would get but I guess if that's important we can do it)... if you need just open a PR with it
It would be possible to retrieve the
GenJet
associated to aJet
usingJet_mcIdx
, but genjets are saved with a pT cut [1], which makes the index saved in the final tree incorrect (some genjets are missing).This affects the study we discussed, @bianchini.
[1] https://github.com/vhbb/cmssw/blob/vhbbHeppy80X/VHbbAnalysis/Heppy/test/vhbb.py#L148