8000 optimized jagged operations · Issue #99 · scikit-hep/uproot3 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.
This repository was archived by the owner on Jun 21, 2022. It is now read-only.
optimized jagged operations #99
@aminnj

Description

@aminnj

Hi,

First, thanks for making an excellent package!

I'm trying to get set up to run on CMS' nanoAOD format using uproot and the one main obstacle I'm facing is so-called jagged arrays.
For example, let's say I'm looking at a variable number of jets per event. I found that numpy has some related functionality to "reduce"
groups of entries in an array (reduceat, where I would just
need to feed in content, starts, stops for jagged arrays to get what I want. However, it seems that reduceat does not handle events with
0 jets (i.e., start = stop for that event) from this issue which still has not been resolved.

Of course, I could always just loop through in python, but that gets to be pretty slow. A couple of concrete examples of what I might want to do:

  • sum up the pT for jets with pT larger than x for each event
  • (more convoluted) for each electron, the index into the jets collection is stored, and I want to follow it to match a jet to each electron (and then divide the pTs, say)

I'm having to turn to numba to JIT some general jagged operations.

Now I'm wondering if you can offer advice on how to easily (and quickly) handle these jagged arrays. Or maybe I'm missing some feature of uproot that handles this already...

Thanks!
Nick

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0