#root #physics #alice #cern #lhc

root-io

Reading of .root binary files which are commonly used in particle physics

6 releases

0.3.0 Feb 5, 2021
0.2.1 Mar 15, 2020
0.2.0 Jan 17, 2020
0.1.2 Jun 22, 2019
0.1.1 Feb 19, 2018

#359 in Simulation


Used in 2 crates

MPL-2.0 license

120KB
2.5K SLoC

root-io

Crates.io Version

Documentation

https://docs.rs/root-io

root-io provides basic support for reading data stored in binary .root files commonly used in particle physics experiments. This crates provides:

  • Core types and parsers to read the layout description of custom classes contained in a given file
  • Tools to generate yaml describing the streamed objects (aka. TStreamerInfo)
  • Tools to generate (buggy) Rust code as a starting point for a new parser
  • Set of types and parsers needed to read so-called TTrees

The majority of the exposed API serves the latter point; striving to enable an easy iteration over data stored in TTrees. In particular, root-io supports reading TBranches (i.e. akin to "columns" of a database) with a variable number of elements in each entry (i.e. TBranches of TClonesArray).

The root-ls crate utilizes this crate to in a CLI to inspect a given root file and to deploy the code-gen tools.

Dependencies

~6–12MB
~227K SLoC