Questions tagged [uproot]

A library for reading [root-framework] data into [numpy] and [awkward-array].

uproot is a narrowly-scoped Python library whose sole function is to read data from ROOT files, which are widely used in the particle physics community (see ).

Rather than reconstituting data as C++ objects, as ROOT does, uproot reads columns of data as NumPy arrays. If the data have too much structure to represent in NumPy, such as a collection of unequal-length std::vector<X>, uproot uses to return jagged arrays with NumPy-like semantics.

uproot can read most types of objects serialized by ROOT, including TTree datasets, Lorentz vectors, histograms, and other types of graphs. Custom behaviors for these objects can be defined by adding functions to uproot-methods.

uproot interfaces with , , , cachetools, Python's concurrent.futures, and xrootd.

94 questions
0
votes
0 answers

Rebinning a TH2 histogram from ROOT using uproot and then plot it with matplotlib

I am able to extract a TH2 histogram from ROOT using the h = f[...].to_numpy() of uproot. This I can then plot with mplhep as a hist2dplot(h). However, I have the problem that I would like to rebin the original histogram and then plot this. I could…
nyw
  • 195
  • 2
  • 11
0
votes
1 answer

Reading TH1D and TH2D histograms in uproot

I have a file in cern root format which contains a number of TH1D and TH2D histograms. I'd like to be able to plot these by using uproot4 to read them, then matplotlib to do the plotting. I can open the file with uproot.open(path) ok, and…
0
votes
0 answers

Slow performance of TTreeMethods.array in uproot in comparison with root_numpy

I am using root_numpy / uproot to work with a ROOT file (containing about 8 million events). I understand that uproot is only fast provided large Tbasket sizes, however, I am looking at a branch where the TBasket size is about 50kB, and to read the…
rak
  • 1
0
votes
0 answers

how to use lazyarrays in uproot?

I am trying to read 'hits' and 'trks' data as a MultiIndex DataFrame from the file in this issue #390. I managed to get data about all events in a DataFrame, by opening the content of my tree as Jagged arrays. Now I would like 'hits' and 'trks' to…
zineb a
  • 53
  • 3
1 2 3 4 5 6
7