# lucas-cks/rutherford-scattering-rbs-simulation architecture

> Architecture diagram of the GitHub repository lucas-cks/rutherford-scattering-rbs-simulation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lucas-cks/rutherford-scattering-rbs-simulation
- Repository: https://github.com/lucas-cks/rutherford-scattering-rbs-simulation

## Overview

This repository is a Rutherford-scattering/RBS research workflow: it simulates particle interactions, automates parameter sweeps, analyzes and aggregates results, and trains neural-network surrogates for interactive prediction and periodic-table scans. The map preserves both the standalone Rutherford simulation and the importance-sampled RBS branch. Edges reflect calls, file handoffs, or README-documented stages; unsampled connections are omitted rather than inferred.

Main entry points: [`stage_3_data_factory/python_driver.py`](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/python_driver.py) (Batch Driver), [`stage_4_neural_network/analyse_RBS.py`](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/analyse_RBS.py) (Analysis Pipeline), [`stage_4_neural_network/Analysis_Results`](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/tree/main/stage_4_neural_network/Analysis_Results) (Surrogate Models), [`stage_2_RBS/RBS_OpenMP.c`](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_2_RBS/RBS_OpenMP.c) (OpenMP RBS Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Monte Carlo Simulation"]
  node_rutherford_mc["Rutherford Monte Carlo"]
  node_rutherford_results["Rutherford Results"]
  node_visualizer["Result Visualizer<br/>[data_visualise.py]"]
  node_rbs_mc["OpenMP RBS Simulator<br/>[RBS_OpenMP.c]"]
  node_rbs_results["RBS Outputs"]
end

subgraph group_factory["Dataset Factory"]
  node_sweep_generator["Run-list Generator"]
  node_run_list["Run List<br/>[run_list.csv]"]
  node_batch_driver["Batch Driver<br/>[python_driver.py]"]
  node_batch_results["Batch Results<br/>[Results.zip]"]
end

subgraph group_analysis["Analysis and Models"]
  node_analyst["Analysis Pipeline<br/>[analyse_RBS.py]"]
  node_aggregates["Aggregated Results"]
  node_surrogate_models["Surrogate Models"]
end

subgraph group_inference["Surrogate Inference"]
  node_predictor["Interactive Predictor<br/>[Predictor.py]"]
  node_periodic_scanner["Periodic-table Scanner"]
end

node_researcher(("Researcher"))

node_researcher -->|"configures"| node_rutherford_mc
node_rutherford_mc -->|"writes results"| node_rutherford_results
node_rutherford_results -->|"reads results"| node_visualizer
node_researcher -->|"configures"| node_rbs_mc
node_rbs_mc -->|"writes outputs"| node_rbs_results
node_sweep_generator -->|"generates"| node_run_list
node_run_list -->|"drives runs"| node_batch_driver
node_batch_driver -->|"dispatches"| node_rbs_mc
node_batch_driver -->|"collects outputs"| node_batch_results
node_batch_results -->|"supplies data"| node_analyst
node_analyst -->|"writes summaries"| node_aggregates
node_analyst -->|"trains and saves"| node_surrogate_models
node_surrogate_models -->|"provides weights"| node_predictor
node_surrogate_models -->|"provides weights"| node_periodic_scanner
node_researcher -->|"enters parameters"| node_predictor
node_researcher -->|"requests sweep"| node_periodic_scanner

click node_rutherford_mc "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_1_rutherford_scattering/rutherford_scattering.c"
click node_rutherford_results "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_1_rutherford_scattering/Result_Z79_T4.00e-05_N1000000_E5.52MeV/simulation_results.txt"
click node_visualizer "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_1_rutherford_scattering/data_visualise.py"
click node_rbs_mc "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_2_RBS/RBS_OpenMP.c"
click node_rbs_results "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_2_RBS/simulation_results.txt"
click node_sweep_generator "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/run_list_generator.py"
click node_run_list "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/run_list.csv"
click node_batch_driver "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/python_driver.py"
click node_batch_results "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/Results.zip"
click node_analyst "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/analyse_RBS.py"
click node_aggregates "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/Analysis_Results/summary_aggregated.csv"
click node_surrogate_models "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/tree/main/stage_4_neural_network/Analysis_Results"
click node_predictor "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/Predictor.py"
click node_periodic_scanner "https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/Periodic_table_scanner.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_rutherford_mc,node_rutherford_results,node_visualizer,node_rbs_mc,node_rbs_results toneBlue
class node_sweep_generator,node_run_list,node_batch_driver,node_batch_results toneAmber
class node_analyst,node_aggregates,node_surrogate_models toneMint
class node_predictor,node_periodic_scanner toneRose
class node_researcher toneIndigo
```

## Components

### Monte Carlo Simulation

- [Rutherford Monte Carlo](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_1_rutherford_scattering/rutherford_scattering.c): `stage_1_rutherford_scattering/rutherford_scattering.c`
- [Rutherford Results](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_1_rutherford_scattering/Result_Z79_T4.00e-05_N1000000_E5.52MeV/simulation_results.txt): `stage_1_rutherford_scattering/Result_Z79_T4.00e-05_N1000000_E5.52MeV/simulation_results.txt`
- [Result Visualizer](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_1_rutherford_scattering/data_visualise.py): `stage_1_rutherford_scattering/data_visualise.py`
- [OpenMP RBS Simulator](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_2_RBS/RBS_OpenMP.c): `stage_2_RBS/RBS_OpenMP.c`
- [RBS Outputs](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_2_RBS/simulation_results.txt): `stage_2_RBS/simulation_results.txt`

### Dataset Factory

- [Run-list Generator](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/run_list_generator.py): `stage_3_data_factory/run_list_generator.py`
- [Run List](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/run_list.csv): `stage_3_data_factory/run_list.csv`
- [Batch Driver](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/python_driver.py): `stage_3_data_factory/python_driver.py`
- [Batch Results](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_3_data_factory/Results.zip): `stage_3_data_factory/Results.zip`

### Analysis and Models

- [Analysis Pipeline](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/analyse_RBS.py): `stage_4_neural_network/analyse_RBS.py`
- [Aggregated Results](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/Analysis_Results/summary_aggregated.csv): `stage_4_neural_network/Analysis_Results/summary_aggregated.csv`
- [Surrogate Models](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/tree/main/stage_4_neural_network/Analysis_Results): `stage_4_neural_network/Analysis_Results`

### Surrogate Inference

- [Interactive Predictor](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/Predictor.py): `stage_4_neural_network/Predictor.py`
- [Periodic-table Scanner](https://github.com/lucas-cks/rutherford-scattering-rbs-simulation/blob/main/stage_4_neural_network/Periodic_table_scanner.py): `stage_4_neural_network/Periodic_table_scanner.py`

### Other components

- **Researcher**

## Connections

- Researcher → Rutherford Monte Carlo: configures (evidence: `README.md`)
- Rutherford Monte Carlo → Rutherford Results: writes results (evidence: `README.md`)
- Rutherford Results → Result Visualizer: reads results (evidence: `stage_1_rutherford_scattering/data_visualise.py`)
- Researcher → OpenMP RBS Simulator: configures (evidence: `README.md`)
- OpenMP RBS Simulator → RBS Outputs: writes outputs (evidence: `README.md`)
- Run-list Generator → Run List: generates (evidence: `stage_3_data_factory/run_list_generator.py`)
- Run List → Batch Driver: drives runs (evidence: `stage_3_data_factory/python_driver.py`)
- Batch Driver → OpenMP RBS Simulator: dispatches (evidence: `stage_3_data_factory/python_driver.py`)
- Batch Driver → Batch Results: collects outputs (evidence: `stage_3_data_factory/python_driver.py`)
- Batch Results → Analysis Pipeline: supplies data (evidence: `README.md`)
- Analysis Pipeline → Aggregated Results: writes summaries (evidence: `README.md`)
- Analysis Pipeline → Surrogate Models: trains and saves (evidence: `stage_4_neural_network/analyse_RBS.py`)
- Surrogate Models → Interactive Predictor: provides weights (evidence: `stage_4_neural_network/Predictor.py`)
- Surrogate Models → Periodic-table Scanner: provides weights (evidence: `stage_4_neural_network/Periodic_table_scanner.py`)
- Researcher → Interactive Predictor: enters parameters (evidence: `stage_4_neural_network/Predictor.py`)
- Researcher → Periodic-table Scanner: requests sweep (evidence: `stage_4_neural_network/Periodic_table_scanner.py`)
