This lesson is being piloted (Beta version)

Uproot Tutorial: Glossary

Key Points

  • Uproot is a fast and lightweight Python package for reading and writing ROOT files.

  • Uproot is designed to work efficiently with jagged arrays of data.

Opening files
  • Opening and navigating files in Uproot isn’t that different from doing so in ROOT.

  • Use .keys() to see the contents of a file.

  • Use the form file['key'] to access an object inside a file.

Trees, Branches, and Events
  • TTrees are tables of data.

  • Trees are made of branches, which are columns in the table.

  • Each row represents an event.

  • Use the bins and/or range parameters to improve histogram binning.

  • Make sure your axes are labeled.

  • Jagged arrays must be flattened before histogramming.

Columnar Analysis
  • Selections are created by comparisons on arrays and are represented by masks (arrays of Boolean values).

  • Selections are applied by acting like a mask is an array index.

  • Avoid for loops whenever possible in analysis (especially in Python).

Getting Physics-Relevant Information
  • Vector has allows you to manipulate arrays of four-vectors.

  • Uproot can be used to do real physics analyses.

Advanced topic: Fitting (optional)
  • There are many packages for fitting, and this just one very simple example.

Further resources
  • Python and many Python packages have a huge userbase and are well supported by documentation, tutorials, and the community.