root_mcp.core.operations package

Core operations for basic statistics and selections.

class root_mcp.core.operations.BasicStatistics(config, file_manager)[source]

Bases: object

Compute basic statistics for TTree or RNTuple branches.

Provides min, max, mean, std, median, and percentiles without requiring scipy or other analysis dependencies.

Parameters:
__init__(config, file_manager)[source]

Initialize basic statistics calculator.

Parameters:
  • config (Config) – Server configuration

  • file_manager (FileManager) – File manager instance

compute_histogram_basic(path, tree_name, branch, bins, range=None, selection=None, weights=None)[source]

Compute a basic 1D histogram without fitting capabilities.

Parameters:
  • path (str) – File path

  • tree_name (str) – Tree name

  • branch (str) – Branch to histogram

  • bins (int) – Number of bins

  • range (tuple[float, float] | None) – (min, max) for histogram

  • selection (str | None) – Optional cut expression

  • weights (str | None) – Optional weight branch

Returns:

Histogram data

Return type:

dict[str, Any]

compute_stats(path, tree_name, branches, selection=None, defines=None)[source]

Compute basic statistics for branches.

Parameters:
  • path (str) – File path

  • tree_name (str) – Tree name

  • branches (list[str]) – List of branch names

  • selection (str | None) – Optional cut expression

  • defines (dict[str, str] | None) – Optional derived variable definitions

Returns:

Dictionary mapping branch names to statistics

Return type:

dict[str, dict[str, float]]

Submodules