RooAgent : An LLM Agent for Root -Based High Energy Physics Analysis

Aman Desai · 2026

Read RooAgent : An LLM Agent for Root -Based High Energy Physics Analysis by Aman Desai (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-17318.txt.

Introduction

Desai presents RooAgent, a plain-language front end for Root-based high-energy physics analysis. An agent turns prompts into calls on physics tools for histograms, event selection, kinematic plots, fits and significance estimates. Two modes run it: a LangGraph agent for GPT-4.1 and DeepSeek-V3, and a Model Context Protocol server for Claude. Tests span simulated Higgs workflows and ATLAS open data, and the package ships on PyPI.

Catalog record

CREATORAman Desai
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE44523
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.17318

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

RooAgent : An LLM Agent for Root -Based High Energy Physics Analysis Aman Desai Abstract We present RooAgent as a natural-language interface for Root -based high energy physics data analysis. The package provides physics analysis functions as tools that an LLM agent invokes in response to plain-language prompts. Two operating modes are supported: a LangGraph -based agent compatible with OpenAI ’s GPT-4.1 via GitHub Copilot and with DeepSeek-V3 via Ollama , and a Model Context Protocol server for use with the Anthropic Claude CLI ( Sonnet 4.6 ). In both modes the analysis logic is implemented in PyRoot and the LLM selects tools and supplies the required arguments. The package supports histogram inspection, event selection, visualisation of kinematic distributions, fitting, and significance estimation, among other tasks. We illustrate RooAgent with tests based on Monte Carlo simulations of p ​ p → Z ​ H pp\to ZH ( Z → ℓ + ​ ℓ − Z\to\ell^{+}\ell^{-} , H → b ​ b ¯ H\to b\bar{b} ), a multi-task signal-background workflow, a toy statistical analysis, and an application to ATLAS open data for H → Z ​ Z ∗ → 4 ​ ℓ H\to ZZ^{*}\to 4\ell . The package is available on PyPI and the source code is hosted at https://github.com/amanmdesai/RooAgent . 1 Introduction High Energy Physics (HEP) data analysis relies on the Root framework [ 13 ] for tasks such as event selection, histogram preparation, and statistical inference in collider physics studies. Root and its Python interface PyRoot [ 26 ] provide a flexible toolkit, but working with them requires familiarity with their API conventions 1 1 1 API: Application Programming Interface and the structure of each input sample. A natural-language interface that maps plain-language goals to Root function calls can benefit new users and streamline routine tasks. Large language models (LLMs) [ 57 ] can invoke external functions through the so-called ‘tool calls’ [ 53 , 46 ] , enabling multi-step HEP workflows from natural-language prompts. Machine learning has been widely used in HEP data analysis [ 50 , 29 , 3 , 25 , 48 ] , and LLM-based agents for tasks such as event selection, histogram production, statistical inference, and result interpretation [ 35 , 56 , 8 , 2 , 27 , 23 , 41 , 32 , 24 , 38 , 52 , 12 , 43 , 31 ] , and automated event generation [ 49 ] , among other aspects have been actively studied. RooAgent [ 21 ] provides a library of analysis tools invoked by an LLM agent. The package wraps PyRoot [ 26 ] functions as tools. The LLM interprets the user’s input, selects the appropriate tools, and supplies the required arguments, while Root performs the computation. The package supports two operating modes: a LangGraph [ 37 ] based agent for use with the OpenAI [ 45 , 28 ] or Ollama [ 44 ] APIs and a Model Context Protocol (MCP) [ 42 ] server for use with the Claude CLI [ 6 ] . In both modes the tool set aims to cover common tasks in Root -based analyses: file and tree inspection, histogram filling and visualisation, event counting and cutflow generation, significance calculation, parametric fitting, and data export. This paper is organised as follows. Section 2 describes the installation, operating modes, and tool set of the RooAgent package. Section 3 presents a series of benchmark tests performed on Monte Carlo simulated ZH events, covering file inspection, histogram plotting, event counting, variable definition, fitting, cut optimisation, and a multi-task signal-background analysis. Section 4 applies RooAgent to a toy statistical analysis illustrating signal discovery and exclusion workflows. Section 5 shows RooAgent applied to ATLAS open data for the H\to ZZ^{*}\to 4\ell channel. Section 6 summarises the work. 2 RooAgent Software RooAgent is written in Python and supports two operating modes: a LangGraph -based agent mode for use with OpenAI or Ollama models and a Model Context Protocol (MCP) server mode for use with Claude CLI. Both modes expose the same underlying Root analysis tools, implemented in PyRoot [ 26 ] . In both cases, Root [ 13 ] must be installed separately. 2.1 LangGraph Agent Mode In this mode, the LLM reasons over user prompts, selects tools, constructs arguments, and calls PyRoot functions iteratively until the goal is met. Installation is via PyPI 2 2 2 PyPI version of the software supports access to LLMs via GitHub models only. : or from source: ⬇ cd RooAgent pip install . The additional required Python packages are: • langchain [ 17 ] , langchain-core , langgraph [ 37 ] • either langchain-openai or langchain-ollama [ 36 ] • pandas [ 40 ] , numpy [ 30 ] , scipy [ 55 ] , matplotlib [ 34 ] By default, the package uses OpenAI ’s GPT-4.1 model [ 45 ] accessed via GitHub Copilot’s API [ 28 ] . Runtime behaviour is controlled through the following environment variables: • GITHUB_TOKEN : authentication token for model access. • MODEL (optional): model identifier. Default is openai/gpt-4.1 . • ROOAGENT_SEED (optional): random seed for reproducibility. Default is 7 . To use locally hosted models, switch to the Ollama branch: ⬇ cd RooAgent git checkout ollama_models pip install . This configures LangGraph [ 37 ] to use the DeepSeek-V3 model [ 20 ] via Ollama [ 44 ] . Any other locally installed Ollama model can also be used by configuring MODEL parameter in the terminal. The tool set is identical across both backends. The system’s prompt is stored in agent.py . 2.2 Model Context Protocol Mode RooAgent can also run as an MCP server integrated with the Claude CLI [ 42 ] . Here, Claude acts as both the LLM and orchestration layer, with no LangChain or LangGraph installation required. The MCP variant is available on the claude_models branch and can be installed using the following commands: ⬇ cd RooAgent git checkout claude_models pip install . Additional required packages for this mode: • fastmcp [ 39 ] : the FastMCP library used to implement the MCP server • pandas [ 40 ] , numpy [ 30 ] , scipy [ 55 ] , matplotlib [ 34 ] After installation, register the server once with the Claude CLI: To run an analysis, navigate to the directory containing the Root files and launch Claude : ⬇ claude The repository’s CLAUDE.md is read automatically at the start of Claude session and it carries the system’s prompt — including available tools, recommended workflows, default parameters, and analysis rules — so no additional configuration is needed. The model chosen as default is the one configured in the user’s Claude settings. For tests here, we used Sonnet 4.6 [ 6 ] . 2.3 Tool Set and Internal Architecture Table 1: Complete tool set exposed by RooAgent in both operating modes. All tools operate on Root files via PyRoot and return structured text output; plotting tools additionally produce PDF figures. Category Tool Description Inspection inspect_root_data List file contents, TTree structure, and branch names/types Counting apply_cut_and_count Count (un)weighted events passing a boolean selection generate_cutflow Sequential cutflow with weighted yields for multiple files compute_significance S/\sqrt{S+B} for arbitrary selection cuts compute_efficiency Selection efficiency relative to a denominator cut

Read the complete text