TTreeReader
TTreeReader is a class in the ROOT data analysis framework that provides a high-level, type-safe interface for reading data from TTrees and TChains. It enables sequential traversal of entries in an event loop and is designed to work with helper classes such as TTreeReaderValue for scalar branches and TTreeReaderArray for array or vector branches. The typical usage binds a TTreeReader to a TTree or TChain, and then declares reader proxies for the branches of interest. An iteration loop calls Next() to advance to the next entry; values are accessed by dereferencing the proxy objects, for example *energy for a scalar branch or iterating over *pt for an array branch.
TTreeReader replaces more manual GetEntry-based access with a safer, more convenient interface that handles type deduction
Because it wraps the underlying TTree read operations, TTreeReader naturally integrates with TTrees and TChains and