\textsc{RooAgent}: An LLM Agent for \textsc{Root}-Based High Energy Physics Analysis

The paper introduces \textsc{RooAgent}, a natural-language interface that empowers large language models to perform complex high-energy physics data analysis tasks using \textsc{PyRoot} tools across multiple LLM backends, demonstrated through various signal-background workflows and applications to ATLAS open data.

Original authors: Aman Desai

Published 2026-05-19
📖 5 min read🧠 Deep dive

Original authors: Aman Desai

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a massive, incredibly complex library of scientific data. In the world of particle physics, this library is called Root, and it contains the "receipts" of billions of particle collisions. To find a specific piece of information—like a specific type of particle or a pattern in the data—you usually need to be a librarian who speaks a very difficult, technical language (programming code). If you don't know the exact code, you can't check out the book.

RooAgent is like hiring a super-smart, multilingual librarian assistant who speaks your language (plain English) and knows the library's secret code perfectly.

Here is how it works, broken down into simple concepts:

1. The Problem: The "Foreign Language" Barrier

High-energy physicists use a tool called PyRoot to analyze data. It's powerful, but it's like trying to order a complex meal at a restaurant where the menu is written in a language you don't speak. You have to know the exact syntax to ask for "a histogram of electron momentum" or "a count of events where jets are heavy." If you make a typo or use the wrong word, the computer just says "Error."

2. The Solution: The "Translator" Agent

RooAgent acts as a translator. You don't need to learn the code. You just tell the agent what you want in plain English, like:

  • "Show me a graph of the mass of the bottom quarks."
  • "Count how many events happen if I only look at particles moving faster than 50 GeV."
  • "Find the best cut to separate the signal from the background noise."

The agent (powered by a Large Language Model, or LLM) listens to your request, translates it into the correct technical commands, runs the analysis, and hands you back the result—usually a graph, a table of numbers, or a summary.

3. How It Works: The "Toolbox"

Think of the agent as a construction worker with a specific toolbox. The paper describes two ways this worker can be hired:

  • The LangGraph Mode: The worker uses a "foreman" (LangGraph) to manage a team of AI models (like GPT-4.1 or DeepSeek-V3). The foreman breaks your big request into small steps, asks the AI to pick the right tool, and then executes it.
  • The MCP Mode: The worker talks directly to a different AI boss (Anthropic's Claude) using a standard protocol (Model Context Protocol).

In both cases, the "tools" in the toolbox are pre-written computer functions that do the heavy lifting:

  • Inspecting: Looking inside the data files to see what's there.
  • Counting: Tallying up how many events pass a specific rule.
  • Plotting: Drawing the graphs and charts.
  • Fitting: Drawing a smooth curve through the data points to see the shape.
  • Calculating: Doing the math to see if a discovery is statistically significant.

4. The "Test Drive"

The authors tested this assistant with several scenarios to see if it could handle the job:

  • The "ZH" Simulation: They simulated a specific particle collision (a Z boson and a Higgs boson). The agent successfully found the files, drew the graphs, counted the events, and even found the "sweet spot" (the best cut) to separate the signal from the background noise.
  • The "Multi-Task" Challenge: They gave the agent one long, complex instruction to do six different things at once (fit a curve, make comparison charts, run a cut-flow, optimize cuts, scan mass windows, and rank results). The agent did all six steps in a row without needing human help.
  • The "Toy" Statistical Test: They created a fake dataset with a hidden signal. The agent successfully scanned through different mass values, found the hidden signal at the right spot (250 GeV), and calculated the probability that it wasn't just a fluke.
  • The "Real World" Test: They used real, public data from the ATLAS experiment at CERN (the Large Hadron Collider). The agent successfully analyzed the data for a Higgs boson decaying into four leptons, producing a stacked graph that matched what human experts would produce.

5. The Result

The paper claims that RooAgent works. It successfully turned plain English questions into complex physics answers.

  • It handled 19 out of 20 single-task tests correctly.
  • It completed a 6-step multi-task workflow without stopping.
  • It produced the same numerical results whether it was using OpenAI's GPT-4.1 or Anthropic's Sonnet 4.6.

The Catch:
The agent isn't perfect. In one test, it got confused because the user typed "Events" (capital E) instead of "events" (lowercase e) for the file name. The agent stopped and asked for clarification rather than guessing. Also, sometimes different AI models might choose slightly different ranges for a graph (e.g., showing 0–100 GeV vs. 0–200 GeV), but the core math remains the same.

Summary

RooAgent is a bridge. It lets physicists (and potentially students or new researchers) talk to their data in human language, while the computer handles the complex, technical language required to actually do the analysis. It doesn't replace the physicist's understanding of the physics, but it removes the barrier of having to memorize complex code syntax to get the job done.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →