Alternative Analysis Approaches
Last updated on 2026-07-14 | Edit this page
The main episodes read EDM4eic data with uproot
through an MCP server. Here is the same Λ⁰ → p π⁻
analysis written four ways — each reproduces the peak near
1.1157 GeV. Every example reads a dataset
root:// file directly, selects protons (PDG
2212) and π⁻ (PDG -211), builds proton–π⁻
pairs, and histograms the invariant mass. Full scripts: extras/.
Replace root://epicxrd1.sdcc.bnl.gov:1095//... with the
file you located.
All four agree
Same masses (\(M_p = 0.9382720813\), \(M_\pi = 0.13957061\) GeV), same 200 bins over 1.05–1.25 GeV, same peak. Choose for convenience.
1. Stand-alone uproot (no MCP)
Plain Python — no server, no ROOT install. The engine the MCP server
runs internally. Environment: a pip venv with
uproot awkward numpy. Script: extras/standalone_uproot/lambda_uproot.py
2. ROOT RDataFrame (PyROOT)
Columnar and declarative; a JIT-compiled C++ helper does the
per-event pairing, RDataFrame histograms it in one pass. Scales to many
files and cores. Environment: ROOT (e.g. eic-shell).
Script: extras/rdataframe/lambda_rdf.py
3. ROOT TTreeReader (C++ macro)
The classic ROOT event loop, the form most ePIC analysis code uses.
Reconstructed momentum branches are float, so the
TTreeReaderArray must be templated on
<float>. Environment: ROOT
(e.g. eic-shell). Script: extras/ttreereader/lambda_ttreereader.C
4. Native PODIO Frame API
PODIO deserializes each event into a Frame; you iterate
over typed objects (p.getPDG(),
p.getMomentum()). Environment: Key4hep /
eic-shell with the podio and
edm4eic dictionaries — the heaviest to set
up. Script: extras/podio_frame/lambda_podio.py
BASH
$ eic-shell -- python3 extras/podio_frame/lambda_podio.py root://epicxrd1.sdcc.bnl.gov:1095//...
Same physics, lower barrier
PODIO needs the full Key4hep stack; the uproot path needs only what
is already in eic-shell. Both find the same Λ⁰ — pairing an
AI assistant with an uproot MCP server is a cheap on-ramp.