Skip to content

How to obtain matched genJets into an matching array with Jet #1223

Answered by ikrommyd
green-cabbage asked this question in Q&A
Discussion options

You must be logged in to vote

I believe your problem is in the matched_gjets = genjets.eta[matched_jets.genJetIdx] line. matched_jets.genJetIdx has the same dimensionality as events.Jet so you can't mask events.GenJet with it, only events.Jet.

What I would personally use is something that is alreayd built in coffea. And that is events.Jet.matched_gen. This will give you an awkward array of GenJets with the same dimensionality as events.Jet where Jets that are associated with a GenJet through the genJetIdx index are replaced by the corresponding GenJet and None otherwise. That way you can skip doing all that yourself.
Then you could calculate the deltaR between the matched genjets and jet like events.Jet.delta_r(events…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@green-cabbage
Comment options

Answer selected by green-cabbage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants