IO (Python)
The IO Cython class wraps the C++ ROOT/HDF5 I/O engine. It iterates
over events stored in ROOT TTree files and exposes them as dictionaries of
data_t objects keyed by leaf name.
Constructor
IO(root=[]) — pass a list of ROOT file paths to open immediately.
Iteration Protocol
IO implements Python’s iterator protocol. Each next() call returns
a dictionary:
reader = IO()
reader.Trees = ["nominal"]
reader.Branches = ["jet_pt", "jet_eta"]
reader.ScanKeys()
reader.begin()
for event in reader:
jet_pt = event[b"nominal.jet_pt.jet_pt"]
Methods
Signature |
Description |
|---|---|
|
Scan the registered files and build the internal key map. Must be called before iterating. |
|
Rewind the internal cursor to the first event. |
|
Release internal file handles and free memory. |
|
Return a dictionary of |
Properties
Property |
Type |
Description |
|---|---|---|
|
|
Enable/disable console progress output. |
|
|
If |
|
|
Directory where AMI metadata cache JSON files are stored. |
|
|
Name of the ROOT tree that stores sum-of-weights information. |
|
|
TTree names to read. |
|
|
TBranch names to read. |
|
|
Registered leaf names (read-only; populated by |
|
|
List of ROOT file paths to process. |
|
|
Nested dictionary |