Bootstrapping

Some core ROOT types — TTree, TBranch, histogram classes, leaf types, and their attribute parents — are only fully defined in the C++ ROOT framework and cannot be inferred from the file format alone. UnROOT handles these by hard-coding their layouts in src/bootstrap.jl. This is what the term bootstrapping refers to in this codebase.

Each bootstrapped class corresponds to a ROOT ClassDef version number stored in the file's object preamble. When multiple versions exist, separate structs named TypeName_N (e.g. TBranch_8, TBranch_12) are defined and dispatched to automatically. Types with a single implementation handle any version gracefully via the ROOT preamble endcheck mechanism.

The ROOT C++ source is the authoritative reference for validating field layouts and version numbers when extending or correcting these definitions.

Supported Classes

ClassHighest Supported VersionAll Supported VersionsMissing VersionsNotes
ROOT::TIOFeatures11Thin wrapper around a single UInt8 bitmask for I/O feature flags; introduced in ROOT v6.14, appears in TBranch (v13) and TTree (v20)
TAttAxis441–3Axis visual attributes (divisions, colors, fonts); versions 1–3 correspond to the ROOT 3.x/4.x era and are unlikely to appear in modern files
TAttBox2D00Pure virtual; no persistent fields — present only to satisfy the C++ inheritance chain during streaming
TAttFill21, 2Fill colour and style attributes; versions 1 and 2 have identical persistent layout
TAttLine21, 2Line colour, style, and width attributes; versions 1 and 2 have identical persistent layout
TAttMarker31, 2, 3Marker colour, style, and size attributes; versions 2 and 3 are aliases for version 1 (no structural changes between them in ROOT)
TAttText221Text attributes (angle, size, align, colour, font); version 1 is from the ROOT 3.x era
TAxis10101–9Histogram axis definition including bin edges, labels, and display options; versions 1–9 correspond to progressively older ROOT releases
TBranch138, 12, 131–7, 9–11Core branch type; versions 1–7 are ancient (pre-ROOT 5); versions 9–11 were never released by the ROOT team; v12 added fFirstEntry; v13 added fIOFeatures
TBranchElement109, 101–8Branch for split C++ objects (STL containers, custom classes); v10 narrowed fClassVersion from Int32 to Int16
TFriendElement221Represents a friend TTree attached to another tree; version 1 is from the ROOT 3.x era
TH1881–71D histogram base class; reading is dispatched to concrete subclasses TH1I, TH1F, TH1D; versions 1–7 correspond to progressively older ROOT releases
TH254, 51–32D histogram base class; versions 4 and 5 have identical persistent fields; versions 1–3 are from older ROOT releases
TH3661–53D histogram base class; versions 1–5 are from older ROOT releases
TLatex221LaTeX-formatted text object used in histogram annotations; version 1 is from the ROOT 3.x era
TLeaf22Base class for all TLeaf variants; single implementation handles any version gracefully via preamble endcheck
TLeafB11Byte leaf; fMinimum/fMaximum are UInt8
TLeafC11Character-array leaf; fMinimum/fMaximum are Int32 (encoding the maximum array length)
TLeafD11Double-precision float leaf (Float64)
TLeafElement11Leaf used with split-object TBranchElement branches
TLeafF11Single-precision float leaf (Float32)
TLeafG11Unsigned 64-bit integer leaf (always Int64; fIsUnsigned is ignored by ROOT for this type)
TLeafI1132-bit integer leaf; fIsUnsigned selects between Int32 and UInt32
TLeafL1164-bit integer leaf; fIsUnsigned selects between Int64 and UInt64
TLeafO11Boolean leaf
TLeafS1116-bit integer leaf; fIsUnsigned selects between Int16 and UInt16
TNamed11Base for all named ROOT objects; carries fName and fTitle
TPaveStats551–4Statistics box drawn on histograms (mean, RMS, entries, fit parameters); versions 1–4 are from older ROOT releases
TPaveText221Multi-line text pave drawn on histograms; version 1 is from the ROOT 3.x era
TText331, 2Simple positioned text object; versions 1 and 2 are from the ROOT 3.x/4.x era
TTree205, 6–201–4The primary columnar data container; versions 1–4 are ancient (pre-ROOT 3); version 5 uses a structurally different float-based header; field additions: fDefaultEntryOffsetLen at v18, fNClusterRange/fClusterSize at v19, fIOFeatures at v20
TVirtualPaveStats00Pure virtual; no persistent fields — present only to satisfy the C++ inheritance chain during streaming