# relational-relativity-corporation/abr-event-analysis architecture

> Architecture diagram of the GitHub repository relational-relativity-corporation/abr-event-analysis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/relational-relativity-corporation/abr-event-analysis
- Repository: https://github.com/relational-relativity-corporation/abr-event-analysis

## Overview

#### Purpose and execution surface

This is a Python research-analysis repository for applying V6 relational operators Δ and Σ to simulated and CERN/LHCb hadronic-decay event data before statistical reduction. The primary entry point is `reproduce.ps1`, which orchestrates generation and analysis; `run_phase0_events.py` appears to support the phase-0 event workflow. Individual `analyze_*.py` scripts are independently runnable analysis stages. `generate_events.py` creates the simulated input corpus.

#### Observable and relation declaration boundary

The `declaration/` package defines the allowed input domain and the event-graph semantics consumed by the kernel. Observable vectors and their Level-2 admissibility are established in `declaration/observable.py`; directed within-event relations and provenance are declared in `declaration/relations.py`; predeclared comparison targets reside in `declaration/targets.py`. `declaration/admissibility.py` provides the invalid-input boundary. This layer separates directly measured track fields (notably momentum and charge) from derived/theoretical classifications.

#### Primary operator kernel

`operators/primary.py` is the central computational kernel. It implements Δ, Σ, rho, and the antisymmetric term over declared observable fields and directed edges. The intended composition is `Σ(Δ(x))`: operators act per event on graph-structured observables, with no prior aggregation, path accumulation, or persistence. The formal constraints governing this behavior are documented in `docs/primary_operators_delta_sigma_v6.md` and `docs/operators_notation_and_constraint_v6.md`.

#### Event sources and ingestion

Two source modes feed the same conceptual kernel path:
- Synthetic D0-like events produced by `generate_events.py`, then used by the simulated analyses.
- ROOT files downloaded separately from CERN Open Data: Masterclass D0 data and B→HHH data. Their real-data analysis entry points are `analyze_hadronic_phase0b.py` and `analyze_hadronic_phase0c.py`.

Large data and generated result directories are intentionally absent from the tree. Runtime dependencies are installed from `requirements.txt`; ROOT handling therefore depends on Python packages rather than a checked-in data-access service.

#### Analysis projections

The `analysis/` package converts kernel outputs into declared statistical or structural projections. `analysis/rank.py` calculates ranks of Δ/Σ images; `analysis/admissibility.py` checks edge-image directional admissibility; `analysis/expression.py` evaluates expression conditions and failure modes; `analysis/rho_p.py` computes the rho-P ratio. These are post-kernel reductions, preserving the architectural rule that event-level operators run before rank, comparison, or summary calculations.

#### Workflow stages and reports

The top-level analysis scripts form the experiment pipeline: rank contribution and angular analyses (`analyze_rank_contributions.py`, `analyze_angular_structure.py`), simulated topology and Sigma studies (`analyze_hadronic_phase0a.py`, `analyze_sigma_constant.py`), and real-data validations (`analyze_hadronic_phase0b.py`, `analyze_hadronic_phase0c.py`). Additional comparison modules in `comparison/` provide QM, QCD, and probability-oriented comparison projections without replacing the primary kernel. Outputs are written to an untracked `results/` directory.

#### Validation and documentation

The executable regression surface is focused on phase-0 generation/processing in `tests/test_phase0_events.py`, with shared pytest setup in `conftest.py`. Architecture-level semantics, operator restrictions, and role separation are maintained as versioned documents under `docs/`, especially `docs/role_separation_and_operator_application_v6.md` and `docs/primary_region_formal_interior_v6.md`.

Main entry points: [`operators/primary.py`](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/operators/primary.py) (Δ / Σ operator kernel), [`analyze_hadronic_phase0a.py`](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analyze_hadronic_phase0a.py) (Simulated analyses), [`analyze_hadronic_phase0b.py`](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analyze_hadronic_phase0b.py) (Real-data analyses), [`reproduce.ps1`](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/reproduce.ps1) (Reproduction runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["Event Sources"]
  node_generator["Synthetic event generator<br/>[generate_events.py]"]
  node_root_data[("CERN ROOT data<br/>external dataset")]
end

subgraph group_semantics["Declaration &amp; Semantics"]
  node_observables["Observable domain<br/>declaration<br/>[observable.py]"]
  node_relations["Event relations<br/>declaration<br/>[relations.py]"]
  node_targets["Comparison targets<br/>declaration<br/>[targets.py]"]
  node_invalid_boundary["Invalid-input boundary<br/>admissibility<br/>[admissibility.py]"]
  node_operator_spec["Operator constraints<br/>formal documentation"]
  node_notation_spec["Notation constraints<br/>formal documentation"]
end

subgraph group_kernel["Operator Kernel"]
  node_operators{{"Δ / Σ operator kernel<br/>primary operators<br/>[primary.py]"}}
end

subgraph group_analysis["Analysis &amp; Reporting"]
  node_reproduce["Reproduction runner<br/>PowerShell workflow<br/>[reproduce.ps1]"]
  node_phase0_events["Phase-0 workflow<br/>Python entry point"]
  node_rank["Rank projection<br/>post-kernel reduction<br/>[rank.py]"]
  node_edge_admissibility["Edge admissibility<br/>post-kernel reduction<br/>[admissibility.py]"]
  node_expressions["Expression evaluation<br/>post-kernel reduction<br/>[expression.py]"]
  node_rho_p["rho-P ratio<br/>post-kernel reduction<br/>[rho_p.py]"]
  node_simulated_analyses["Simulated analyses<br/>analysis scripts"]
  node_real_analyses["Real-data analyses<br/>analysis scripts"]
  node_comparison["Comparison projections<br/>comparison modules<br/>[qm_comparison.py]"]
  node_results[("Results<br/>generated output")]
end

node_reproduce -->|"generates"| node_generator
node_reproduce -->|"runs"| node_phase0_events
node_phase0_events -->|"drives"| node_simulated_analyses
node_generator -->|"simulated events"| node_simulated_analyses
node_root_data -->|"ROOT inputs"| node_real_analyses
node_observables -->|"observable fields"| node_operators
node_relations -->|"directed edges"| node_operators
node_targets -.->|"comparison declarations"| node_operators
node_invalid_boundary -->|"rejects invalid inputs"| node_operators
node_operator_spec -.->|"formal semantics"| node_operators
node_notation_spec -.->|"constraints"| node_operators
node_operators -->|"event images"| node_rank
node_operators -->|"edge images"| node_edge_admissibility
node_operators -->|"event images"| node_expressions
node_operators -->|"rho outputs"| node_rho_p
node_operators -->|"per-event computation"| node_simulated_analyses
node_operators -->|"per-event computation"| node_real_analyses
node_rank -->|"rank reduction"| node_simulated_analyses
node_rho_p -->|"comparison inputs"| node_comparison
node_simulated_analyses -->|"writes"| node_results
node_real_analyses -->|"writes"| node_results
node_comparison -->|"writes"| node_results

click node_reproduce "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/reproduce.ps1"
click node_phase0_events "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/run_phase0_events.py"
click node_generator "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/generate_events.py"
click node_observables "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/observable.py"
click node_relations "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/relations.py"
click node_targets "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/targets.py"
click node_invalid_boundary "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/admissibility.py"
click node_operators "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/operators/primary.py"
click node_operator_spec "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/docs/primary_operators_delta_sigma_v6.md"
click node_notation_spec "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/docs/operators_notation_and_constraint_v6.md"
click node_rank "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/rank.py"
click node_edge_admissibility "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/admissibility.py"
click node_expressions "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/expression.py"
click node_rho_p "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/rho_p.py"
click node_simulated_analyses "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analyze_hadronic_phase0a.py"
click node_real_analyses "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analyze_hadronic_phase0b.py"
click node_comparison "https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/comparison/qm_comparison.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_generator,node_root_data toneBlue
class node_observables,node_relations,node_targets,node_invalid_boundary,node_operator_spec,node_notation_spec toneAmber
class node_operators toneMint
class node_reproduce,node_phase0_events,node_rank,node_edge_admissibility,node_expressions,node_rho_p,node_simulated_analyses,node_real_analyses,node_comparison,node_results toneRose
```

## Components

### Event Sources

- [Synthetic event generator](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/generate_events.py): event generator · Creates simulated D0-like event inputs. · `generate_events.py`
- **CERN ROOT data**: external dataset · Separately downloaded Masterclass D0 and B→HHH files.

### Declaration & Semantics

- [Observable domain](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/observable.py): declaration · Defines observable vectors and Level-2 admissibility. · `declaration/observable.py`
- [Event relations](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/relations.py): declaration · Defines directed within-event relations and provenance. · `declaration/relations.py`
- [Comparison targets](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/targets.py): declaration · `declaration/targets.py`
- [Invalid-input boundary](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/declaration/admissibility.py): admissibility · `declaration/admissibility.py`
- [Operator constraints](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/docs/primary_operators_delta_sigma_v6.md): formal documentation · Specifies event-local Σ(Δ(x)) behavior. · `docs/primary_operators_delta_sigma_v6.md`
- [Notation constraints](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/docs/operators_notation_and_constraint_v6.md): formal documentation · `docs/operators_notation_and_constraint_v6.md`

### Operator Kernel

- [Δ / Σ operator kernel](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/operators/primary.py): primary operators · Applies Δ, Σ, rho, and antisymmetric terms per event. · `operators/primary.py`

### Analysis & Reporting

- [Reproduction runner](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/reproduce.ps1): PowerShell workflow · Orchestrates event generation and analysis. · `reproduce.ps1`
- [Phase-0 workflow](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/run_phase0_events.py): Python entry point · `run_phase0_events.py`
- [Rank projection](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/rank.py): post-kernel reduction · Calculates ranks of Δ/Σ images. · `analysis/rank.py`
- [Edge admissibility](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/admissibility.py): post-kernel reduction · Checks directional admissibility of edge images. · `analysis/admissibility.py`
- [Expression evaluation](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/expression.py): post-kernel reduction · Evaluates conditions and failure modes. · `analysis/expression.py`
- [rho-P ratio](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analysis/rho_p.py): post-kernel reduction · `analysis/rho_p.py`
- [Simulated analyses](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analyze_hadronic_phase0a.py): analysis scripts · Rank, angular, topology, and Sigma studies. · `analyze_hadronic_phase0a.py`
- [Real-data analyses](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/analyze_hadronic_phase0b.py): analysis scripts · Processes Masterclass D0 and B→HHH inputs. · `analyze_hadronic_phase0b.py`
- [Comparison projections](https://github.com/relational-relativity-corporation/abr-event-analysis/blob/main/comparison/qm_comparison.py): comparison modules · QM, QCD, and probability-oriented projections. · `comparison/qm_comparison.py`
- **Results**: generated output · Untracked analysis outputs.

## Connections

- Reproduction runner → Synthetic event generator: generates
- Reproduction runner → Phase-0 workflow: runs
- Phase-0 workflow → Simulated analyses: drives
- Synthetic event generator → Simulated analyses: simulated events
- CERN ROOT data → Real-data analyses: ROOT inputs
- Observable domain → Δ / Σ operator kernel: observable fields
- Event relations → Δ / Σ operator kernel: directed edges
- Comparison targets → Δ / Σ operator kernel: comparison declarations
- Invalid-input boundary → Δ / Σ operator kernel: rejects invalid inputs
- Operator constraints → Δ / Σ operator kernel: formal semantics
- Notation constraints → Δ / Σ operator kernel: constraints
- Δ / Σ operator kernel → Rank projection: event images
- Δ / Σ operator kernel → Edge admissibility: edge images
- Δ / Σ operator kernel → Expression evaluation: event images
- Δ / Σ operator kernel → rho-P ratio: rho outputs
- Δ / Σ operator kernel → Simulated analyses: per-event computation
- Δ / Σ operator kernel → Real-data analyses: per-event computation
- Rank projection → Simulated analyses: rank reduction
- rho-P ratio → Comparison projections: comparison inputs
- Simulated analyses → Results: writes
- Real-data analyses → Results: writes
- Comparison projections → Results: writes
