# alaha999/nanordf architecture

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

- Interactive diagram: https://gitdiagram.com/alaha999/nanordf
- Repository: https://github.com/alaha999/nanordf

## Overview

NanoRDF is a CMS NanoAOD sample-management and RDataFrame analysis framework. Users maintain campaign/sample metadata, prepare input configurations from CRAB outputs, then run analysis locally or submit processing through CRAB or CERN Condor. The analysis defines event selections and weights, applies campaign-aware filters, and writes histograms; the CRAB branch also supports configurable skimming. Calibration payloads and golden-luminosity JSONs provide analysis inputs. Edges are limited to README statements and shown source references/calls; some submission and analysis internals were not sampled.

Main entry points: [`nanoRDF.py`](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/nanoRDF.py) (RDataFrame Analysis), [`tools/lumiJsonFilter.C`](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/tools/lumiJsonFilter.C) (Luminosity Filter), [`createInputSample.py`](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/createInputSample.py) (Build Inputs), [`crab_setup/crab_script_runNanoRDF_advancedSkimming.py`](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/crab_script_runNanoRDF_advancedSkimming.py) (CRAB Skimming)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Sample Catalog"]
  node_sampledb[("Sample Metadata<br/>[database.yaml]")]
  node_sampleconfigs["Campaign Inputs"]
  node_makeinputs["Build Inputs"]
  node_showdb["Inspect Catalog<br/>[printDatabase.py]"]
end

subgraph group_workflow["Job Workflows"]
  node_crabsubmit["CRAB Submission<br/>[bulkSubmitCrab.py]"]
  node_crabconfig["CRAB Job Config<br/>[crab_config.py]"]
  node_crabrunner["CRAB Skimming"]
  node_pset["CMSSW Input<br/>[PSet.py]"]
  node_condor["Condor Submission<br/>[submitCondor.py]"]
end

subgraph group_analysis["Analysis Runtime"]
  node_analysiscode["RDataFrame Analysis<br/>[nanoRDF.py]"]
  node_custom["Analysis Helpers<br/>[customFunctions.C]"]
  node_lumi["Luminosity Filter<br/>[lumiJsonFilter.C]"]
  node_jsonheader["JSON Parser<br/>[json.hpp]"]
end

subgraph group_calibration["Physics Resources"]
  node_golden["Golden JSONs"]
  node_pogs["POG Corrections"]
end

node_analyst(("Analyst"))
node_das["DAS"]
node_craboutputs["CRAB Outputs"]
node_rootresults["ROOT Results"]

node_analyst -->|"maintains"| node_sampledb
node_sampledb -->|"provides metadata"| node_makeinputs
node_craboutputs -->|"provides files"| node_makeinputs
node_makeinputs -->|"creates configs"| node_sampleconfigs
node_analyst -->|"submits jobs"| node_condor
node_sampleconfigs -->|"configures jobs"| node_condor
node_analyst -->|"submits campaign"| node_crabsubmit
node_crabsubmit -.->|"invokes config"| node_crabconfig
node_crabrunner -->|"imports runtime"| node_analysiscode
node_crabrunner -->|"reads source"| node_pset
node_analysiscode -->|"loads helpers"| node_custom
node_analysiscode -->|"calls filter"| node_lumi
node_lumi -->|"parses JSON"| node_jsonheader
node_lumi -->|"reads ranges"| node_golden
node_analysiscode -.->|"uses corrections"| node_pogs
node_analysiscode -->|"writes histograms"| node_rootresults
node_das -->|"queries summaries"| node_showdb
node_analyst -->|"inspects catalog"| node_showdb

click node_sampledb "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/database/database.yaml"
click node_sampleconfigs "https://github.com/alaha999/nanordf/tree/nanoRDF_lxplus/input"
click node_makeinputs "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/createInputSample.py"
click node_showdb "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/printDatabase.py"
click node_crabsubmit "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/bulkSubmitCrab.py"
click node_crabconfig "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/crab_config.py"
click node_crabrunner "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/crab_script_runNanoRDF_advancedSkimming.py"
click node_pset "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/PSet.py"
click node_condor "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/submitCondor.py"
click node_analysiscode "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/nanoRDF.py"
click node_custom "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/tools/customFunctions.C"
click node_lumi "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/tools/lumiJsonFilter.C"
click node_jsonheader "https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/tools/nlohmann/json.hpp"
click node_golden "https://github.com/alaha999/nanordf/tree/nanoRDF_lxplus/tools/goldenjsonfiles"
click node_pogs "https://github.com/alaha999/nanordf/tree/nanoRDF_lxplus/tools/POG"

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_sampledb,node_sampleconfigs,node_makeinputs,node_showdb toneBlue
class node_crabsubmit,node_crabconfig,node_crabrunner,node_pset,node_condor toneAmber
class node_analysiscode,node_custom,node_lumi,node_jsonheader toneMint
class node_golden,node_pogs toneRose
class node_analyst,node_das,node_craboutputs,node_rootresults toneIndigo
```

## Components

### Sample Catalog

- [Sample Metadata](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/database/database.yaml): `database/database.yaml`
- [Campaign Inputs](https://github.com/alaha999/nanordf/tree/nanoRDF_lxplus/input): `input`
- [Build Inputs](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/createInputSample.py): `createInputSample.py`
- [Inspect Catalog](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/printDatabase.py): `printDatabase.py`

### Job Workflows

- [CRAB Submission](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/bulkSubmitCrab.py): `crab_setup/bulkSubmitCrab.py`
- [CRAB Job Config](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/crab_config.py): `crab_setup/crab_config.py`
- [CRAB Skimming](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/crab_script_runNanoRDF_advancedSkimming.py): `crab_setup/crab_script_runNanoRDF_advancedSkimming.py`
- [CMSSW Input](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/crab_setup/PSet.py): `crab_setup/PSet.py`
- [Condor Submission](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/submitCondor.py): `submitCondor.py`

### Analysis Runtime

- [RDataFrame Analysis](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/nanoRDF.py): `nanoRDF.py`
- [Analysis Helpers](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/tools/customFunctions.C): `tools/customFunctions.C`
- [Luminosity Filter](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/tools/lumiJsonFilter.C): `tools/lumiJsonFilter.C`
- [JSON Parser](https://github.com/alaha999/nanordf/blob/nanoRDF_lxplus/tools/nlohmann/json.hpp): `tools/nlohmann/json.hpp`

### Physics Resources

- [Golden JSONs](https://github.com/alaha999/nanordf/tree/nanoRDF_lxplus/tools/goldenjsonfiles): `tools/goldenjsonfiles`
- [POG Corrections](https://github.com/alaha999/nanordf/tree/nanoRDF_lxplus/tools/POG): `tools/POG`

### Other components

- **Analyst**
- **DAS**
- **CRAB Outputs**
- **ROOT Results**

## Connections

- Analyst → Sample Metadata: maintains (evidence: `README.md`)
- Sample Metadata → Build Inputs: provides metadata (evidence: `README.md`)
- CRAB Outputs → Build Inputs: provides files (evidence: `README.md`)
- Build Inputs → Campaign Inputs: creates configs (evidence: `README.md`)
- Analyst → Condor Submission: submits jobs (evidence: `README.md`)
- Campaign Inputs → Condor Submission: configures jobs (evidence: `README.md`)
- Analyst → CRAB Submission: submits campaign (evidence: `crab_setup/bulkSubmitCrab.py`)
- CRAB Submission → CRAB Job Config: invokes config
- CRAB Skimming → RDataFrame Analysis: imports runtime (evidence: `crab_setup/crab_script_runNanoRDF_advancedSkimming.py`)
- CRAB Skimming → CMSSW Input: reads source (evidence: `crab_setup/crab_script_runNanoRDF_advancedSkimming.py`)
- RDataFrame Analysis → Analysis Helpers: loads helpers (evidence: `nanoRDF.py`)
- RDataFrame Analysis → Luminosity Filter: calls filter (evidence: `nanoRDF.py`)
- Luminosity Filter → JSON Parser: parses JSON (evidence: `tools/lumiJsonFilter.C`)
- Luminosity Filter → Golden JSONs: reads ranges (evidence: `tools/lumiJsonFilter.C`)
- RDataFrame Analysis → POG Corrections: uses corrections
- RDataFrame Analysis → ROOT Results: writes histograms (evidence: `README.md`)
- DAS → Inspect Catalog: queries summaries (evidence: `printDatabase.py`)
- Analyst → Inspect Catalog: inspects catalog (evidence: `README.md`)
