root_mcp.extended.analysis.correlations module

Correlation and covariance analysis.

class root_mcp.extended.analysis.correlations.CorrelationAnalysis(config, file_manager)[source]

Bases: object

Statistical correlation and covariance analysis.

Provides: - Pearson correlation coefficients - Spearman rank correlation - Covariance matrices - Correlation matrices - Significance testing

Parameters:
__init__(config, file_manager)[source]

Initialize correlation analysis.

Parameters:
  • config (Config) – Server configuration

  • file_manager (FileManager) – File manager instance

compute_correlation(path, tree_name, branch_x, branch_y, selection=None, method='pearson')[source]

Compute correlation coefficient between two branches.

Parameters:
  • path (str) – File path

  • tree_name (str) – Tree name

  • branch_x (str) – First branch

  • branch_y (str) – Second branch

  • selection (str | None) – Optional cut expression

  • method (str) – Correlation method (‘pearson’ or ‘spearman’)

Returns:

Correlation coefficient, p-value, and metadata

Return type:

dict[str, Any]

compute_correlation_matrix(path, tree_name, branches, selection=None, method='pearson')[source]

Compute correlation matrix for multiple branches.

Parameters:
  • path (str) – File path

  • tree_name (str) – Tree name

  • branches (list[str]) – List of branches to correlate

  • selection (str | None) – Optional cut expression

  • method (str) – Correlation method (‘pearson’ or ‘spearman’)

Returns:

Correlation matrix and metadata

Return type:

dict[str, Any]

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

Compute covariance matrix for multiple branches.

Parameters:
  • path (str) – File path

  • tree_name (str) – Tree name

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

  • selection (str | None) – Optional cut expression

Returns:

Covariance matrix and metadata

Return type:

dict[str, Any]

compute_mutual_information(path, tree_name, branch_x, branch_y, bins=50, selection=None)[source]

Compute mutual information between two branches.

Parameters:
  • path (str) – File path

  • tree_name (str) – Tree name

  • branch_x (str) – First branch

  • branch_y (str) – Second branch

  • bins (int) – Number of bins for discretization

  • selection (str | None) – Optional cut expression

Returns:

Mutual information and metadata

Return type:

dict[str, Any]