# jeffersonlab/japan-moller architecture

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

- Interactive diagram: https://gitdiagram.com/jeffersonlab/japan-moller
- Repository: https://github.com/jeffersonlab/japan-moller

## Overview

jaPAN is a C++ parity-analysis application for CODA experiment data, with detector/beam monitoring, ROOT output, and online feedback and plotting tools. The documented batch workflow is to generate mock data and then run qwparity to analyze it and produce a ROOT file. The graph captures that workflow and the major subsystems indicated by the tree; most runtime wiring is not shown in the sampled source, so uncertain call relationships are omitted.

Main entry points: [`Parity/main/QwParity.cc`](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/main/QwParity.cc) (Parity analyzer), [`Parity/src/QwDataHandlerArray.cc`](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwDataHandlerArray.cc) (Data handlers), [`Analysis/src/VEventDecoder.cc`](https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/VEventDecoder.cc) (Event decoders), [`evio/include/THaCodaFile.h`](https://github.com/jeffersonlab/japan-moller/blob/main/evio/include/THaCodaFile.h) (CODA input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Event analysis"]
  node_coda["CODA input<br/>[THaCodaFile.h]"]
  node_et["ET online input<br/>[THaEtClient.h]"]
  node_decoder["Event decoders<br/>[VEventDecoder.cc]"]
  node_eventbuffer["Event buffer<br/>[QwEventBuffer.cc]"]
  node_subsystems["Detector subsystems"]
  node_channels["Hardware channels"]
end

subgraph group_parity["Parity processing"]
  node_generator["Mock generator"]
  node_parityapp["Parity analyzer<br/>[QwParity.cc]"]
  node_helicity["Helicity decoding"]
  node_detectors["Parity detectors<br/>[QwDetectorArray.cc]"]
  node_handlers["Data handlers"]
end

subgraph group_outputs["Results and monitoring"]
  node_rootfile[("ROOT output<br/>[QwRootFile.cc]")]
  node_paritydb[("Parity database<br/>[QwParityDB.cc]")]
  node_summary["Prompt summary<br/>[QwPromptSummary.cc]"]
  node_alarms["Alarm monitoring<br/>[QwAlarmHandler.cc]"]
end

subgraph group_online["Online tools"]
  node_feedback["Helicity feedback"]
  node_epics["EPICS control<br/>[QwEPICSControl.cc]"]
  node_panguin["Online plotting<br/>[panguin.cc]"]
  node_analysismacros["Analysis macros<br/>[realtimeBmodAna.C]"]
end

node_user(("Analyst"))
node_mockdata["Mock data"]
node_rootdata["ROOT data"]
node_daq(("CODA / ET system"))

node_user -->|"runs"| node_generator
node_generator -->|"writes"| node_mockdata
node_user -->|"runs"| node_parityapp
node_mockdata -->|"analyzes"| node_parityapp
node_parityapp -->|"produces"| node_rootdata
node_daq -->|"supplies events"| node_coda
node_daq -.->|"supplies events"| node_et
node_coda -->|"provides events"| node_decoder
node_et -.->|"provides events"| node_decoder
node_decoder -->|"decodes into"| node_eventbuffer
node_eventbuffer -->|"feeds events"| node_subsystems
node_subsystems -->|"uses channels"| node_channels
node_parityapp -->|"analyzes helicity"| node_helicity
node_parityapp -->|"processes detectors"| node_detectors
node_parityapp -->|"manages handlers"| node_handlers
node_handlers -->|"fills trees"| node_rootfile
node_handlers -.->|"fills database"| node_paritydb
node_handlers -->|"writes summary"| node_summary
node_handlers -.->|"provides monitored data"| node_alarms
node_feedback -.->|"controls via"| node_epics
node_panguin -->|"runs plots"| node_analysismacros
node_analysismacros -->|"plots data"| node_rootdata

click node_generator "https://github.com/jeffersonlab/japan-moller/blob/main/Parity/main/QwMockDataGenerator.cc"
click node_parityapp "https://github.com/jeffersonlab/japan-moller/blob/main/Parity/main/QwParity.cc"
click node_coda "https://github.com/jeffersonlab/japan-moller/blob/main/evio/include/THaCodaFile.h"
click node_et "https://github.com/jeffersonlab/japan-moller/blob/main/evio/include/THaEtClient.h"
click node_decoder "https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/VEventDecoder.cc"
click node_eventbuffer "https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwEventBuffer.cc"
click node_subsystems "https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwSubsystemArray.cc"
click node_channels "https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/VQwHardwareChannel.cc"
click node_helicity "https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwHelicityDecoder.cc"
click node_detectors "https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwDetectorArray.cc"
click node_handlers "https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwDataHandlerArray.cc"
click node_rootfile "https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwRootFile.cc"
click node_paritydb "https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwParityDB.cc"
click node_summary "https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwPromptSummary.cc"
click node_alarms "https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwAlarmHandler.cc"
click node_feedback "https://github.com/jeffersonlab/japan-moller/blob/main/Feedback/src/QwHelicityCorrelatedFeedback.cc"
click node_epics "https://github.com/jeffersonlab/japan-moller/blob/main/Feedback/src/QwEPICSControl.cc"
click node_panguin "https://github.com/jeffersonlab/japan-moller/blob/main/panguin/panguin.cc"
click node_analysismacros "https://github.com/jeffersonlab/japan-moller/blob/main/panguin/macros/BeamMod/realtimeBmodAna.C"

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_coda,node_et,node_decoder,node_eventbuffer,node_subsystems,node_channels toneBlue
class node_generator,node_parityapp,node_helicity,node_detectors,node_handlers toneAmber
class node_rootfile,node_paritydb,node_summary,node_alarms toneMint
class node_feedback,node_epics,node_panguin,node_analysismacros toneRose
class node_user,node_mockdata,node_rootdata,node_daq toneIndigo
```

## Components

### Event analysis

- [CODA input](https://github.com/jeffersonlab/japan-moller/blob/main/evio/include/THaCodaFile.h): `evio/include/THaCodaFile.h`
- [ET online input](https://github.com/jeffersonlab/japan-moller/blob/main/evio/include/THaEtClient.h): `evio/include/THaEtClient.h`
- [Event decoders](https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/VEventDecoder.cc): `Analysis/src/VEventDecoder.cc`
- [Event buffer](https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwEventBuffer.cc): `Analysis/src/QwEventBuffer.cc`
- [Detector subsystems](https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwSubsystemArray.cc): `Analysis/src/QwSubsystemArray.cc`
- [Hardware channels](https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/VQwHardwareChannel.cc): `Analysis/src/VQwHardwareChannel.cc`

### Parity processing

- [Mock generator](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/main/QwMockDataGenerator.cc): `Parity/main/QwMockDataGenerator.cc`
- [Parity analyzer](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/main/QwParity.cc): `Parity/main/QwParity.cc`
- [Helicity decoding](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwHelicityDecoder.cc): `Parity/src/QwHelicityDecoder.cc`
- [Parity detectors](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwDetectorArray.cc): `Parity/src/QwDetectorArray.cc`
- [Data handlers](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwDataHandlerArray.cc): `Parity/src/QwDataHandlerArray.cc`

### Results and monitoring

- [ROOT output](https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwRootFile.cc): `Analysis/src/QwRootFile.cc`
- [Parity database](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwParityDB.cc): `Parity/src/QwParityDB.cc`
- [Prompt summary](https://github.com/jeffersonlab/japan-moller/blob/main/Analysis/src/QwPromptSummary.cc): `Analysis/src/QwPromptSummary.cc`
- [Alarm monitoring](https://github.com/jeffersonlab/japan-moller/blob/main/Parity/src/QwAlarmHandler.cc): `Parity/src/QwAlarmHandler.cc`

### Online tools

- [Helicity feedback](https://github.com/jeffersonlab/japan-moller/blob/main/Feedback/src/QwHelicityCorrelatedFeedback.cc): `Feedback/src/QwHelicityCorrelatedFeedback.cc`
- [EPICS control](https://github.com/jeffersonlab/japan-moller/blob/main/Feedback/src/QwEPICSControl.cc): `Feedback/src/QwEPICSControl.cc`
- [Online plotting](https://github.com/jeffersonlab/japan-moller/blob/main/panguin/panguin.cc): `panguin/panguin.cc`
- [Analysis macros](https://github.com/jeffersonlab/japan-moller/blob/main/panguin/macros/BeamMod/realtimeBmodAna.C): `panguin/macros/BeamMod/realtimeBmodAna.C`

### Other components

- **Analyst**
- **Mock data**
- **ROOT data**
- **CODA / ET system**

## Connections

- Analyst → Mock generator: runs
- Mock generator → Mock data: writes
- Analyst → Parity analyzer: runs
- Mock data → Parity analyzer: analyzes
- Parity analyzer → ROOT data: produces
- CODA / ET system → CODA input: supplies events
- CODA / ET system → ET online input: supplies events
- CODA input → Event decoders: provides events
- ET online input → Event decoders: provides events
- Event decoders → Event buffer: decodes into
- Event buffer → Detector subsystems: feeds events
- Detector subsystems → Hardware channels: uses channels
- Parity analyzer → Helicity decoding: analyzes helicity
- Parity analyzer → Parity detectors: processes detectors
- Parity analyzer → Data handlers: manages handlers
- Data handlers → ROOT output: fills trees
- Data handlers → Parity database: fills database
- Data handlers → Prompt summary: writes summary
- Data handlers → Alarm monitoring: provides monitored data
- Helicity feedback → EPICS control: controls via
- Online plotting → Analysis macros: runs plots
- Analysis macros → ROOT data: plots data
