Introduction
A .root file is the data file of ROOT,
the data analysis framework developed at CERN since 1995. Particle physics experiments,
including those at the Large Hadron Collider, store their collision data, histograms
and analysis results in ROOT files, which together amount to a vast quantity of
data.
A ROOT file can hold any C++ object that ROOT knows how to describe. The most
important is the tree (TTree), a table of events with many columns, which
is stored column by column so that an analysis reads only the values it needs. A newer
column layout, RNTuple, is replacing it.
Structure
The file starts with the four bytes root, followed by the format version
and the positions of the first data record, the end of the file, the list of free
space and the streamer information, which describes the layout of every class stored in
the file so that it can be read without the original code.
The rest of the file is a series of records, each led by a key (TKey)
giving the object’s class, name, title, sizes and position. Objects are usually
compressed, with zlib, LZMA, LZ4 or Zstandard. Keys are grouped into directories, which
work like folders inside the file.
Links
Software
Developers
Reference
- ROOT files, the ROOT manual