Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
360 commits
Select commit Hold shift + click to select a range
0997cc1
implement examine_showers
lastgeorge Jan 10, 2026
189175f
implement the id_pi0_without_vertex function
lastgeorge Jan 11, 2026
1db8316
implement the shower_clustering_with_nv function
lastgeorge Jan 11, 2026
7ae81a3
example helper functions with ROOT
Feb 11, 2026
d6c3203
add track fitting into the bee output
Feb 12, 2026
006e5ee
add files
Feb 12, 2026
c244dc9
structure change, save TrackFitting inside the Grouping
Feb 12, 2026
bf8a7f3
update code
Feb 12, 2026
1c38029
update code
Feb 12, 2026
17b6af5
add some dumping code for intermediate date and loading them in a new…
Feb 16, 2026
b532f17
commit test data and configuration
Feb 16, 2026
11fa822
improve alg for speed and running time
Mar 4, 2026
495ab47
fix a few bugs
Mar 4, 2026
02a95fc
start to print out
Mar 5, 2026
b7c2aa0
improve
Mar 6, 2026
3c8a973
examine three functions
Mar 8, 2026
120b6ef
update code
Mar 9, 2026
9fdc9d4
make code more efficient
Mar 9, 2026
890d14c
update code
Mar 10, 2026
0563685
fix a bug
Mar 10, 2026
71096e2
implement a find_vertex_other_segment function
Mar 10, 2026
373a34e
implement modify_isochronous
Mar 10, 2026
5c4997d
implement modify_segment_isochronous
Mar 10, 2026
c067303
update code
Mar 10, 2026
73f4b01
update code
Mar 10, 2026
69b358e
update code
Mar 10, 2026
61c9e7d
validate the crawl_segment function
Mar 10, 2026
5373ae0
validate the examine_segment function
Mar 10, 2026
5e5f9c3
improve code
Mar 10, 2026
f3f4aab
update the examine_vertices_4
Mar 10, 2026
d233f72
examine_vertices_2
Mar 10, 2026
5aec7a3
examine_partial_identical_segment
Mar 10, 2026
16cf358
fix many bugs leading to crash
Mar 10, 2026
0f67ab5
improve code
Mar 11, 2026
119ae88
improve speed of dQ_dx fitting
Mar 11, 2026
53f102f
catch up
Mar 11, 2026
a717ebe
improve logging
Mar 11, 2026
d8f9b4b
sync log conventions
lastgeorge Mar 11, 2026
614f7a4
catch up
lastgeorge Mar 12, 2026
76cfd80
update code
lastgeorge Mar 12, 2026
f0a3f49
add examine bundles
lastgeorge Mar 12, 2026
f13524c
improve speed of multi-track fitting
lastgeorge Mar 16, 2026
aeb853d
fix a major bug in the TrackFitting, still debugging the rest
lastgeorge Mar 19, 2026
c7c4135
catch up
lastgeorge Mar 20, 2026
cf46f0e
fix a bug in the find_other_segments
lastgeorge Mar 21, 2026
444d63b
validate the find_proto_vertex
lastgeorge Mar 21, 2026
035832e
catch up
lastgeorge Mar 21, 2026
13fa968
start to validate the shower clustering code
lastgeorge Mar 22, 2026
e45bf60
improve running efficiency for clustering points
lastgeorge Mar 22, 2026
9380f30
valudate the shower points clustering
lastgeorge Mar 22, 2026
e404394
continue validating
lastgeorge Mar 22, 2026
435a8c8
update code
lastgeorge Mar 22, 2026
1dcbe41
catch up
lastgeorge Mar 22, 2026
d06f2e6
catch up
lastgeorge Mar 22, 2026
d4c1858
examine toolkit code
lastgeorge Mar 22, 2026
ee36917
fix bugs
lastgeorge Mar 22, 2026
9a5ac02
fix a bug
lastgeorge Mar 22, 2026
5f383e5
fix a few bugs in TaggerCheckSTM
lastgeorge Mar 23, 2026
7d49487
fix various bugs
lastgeorge Mar 23, 2026
d8ccb27
fix a few bugs
lastgeorge Mar 23, 2026
13c59a7
fix a bug
lastgeorge Mar 23, 2026
80ffb67
fix a bug
lastgeorge Mar 24, 2026
770f18b
add other clusters into the work chain
lastgeorge Mar 24, 2026
636e07d
fix many bugs
lastgeorge Mar 24, 2026
8e2c814
catch up
lastgeorge Mar 25, 2026
1ccbf0b
improve fitting speed
lastgeorge Mar 25, 2026
8efc923
update code
lastgeorge Mar 25, 2026
45a608c
improve randomness
lastgeorge Mar 25, 2026
16a6f5a
improve speed
lastgeorge Mar 25, 2026
82a9b47
fix a few bugs in the dehgosting function
lastgeorge Mar 26, 2026
6d84015
fix bugs with deghosting
lastgeorge Mar 26, 2026
2318533
add more bee points
lastgeorge Mar 26, 2026
97e689a
update PR code
lastgeorge Mar 26, 2026
e46b11b
fix some bugs
lastgeorge Mar 26, 2026
43b4978
improve code, reduce randomness
lastgeorge Mar 27, 2026
a8760bb
fix bug
lastgeorge Mar 27, 2026
ceade3b
add DL vertex
lastgeorge Mar 27, 2026
4eaaac2
add DL vertex
lastgeorge Mar 27, 2026
a07af30
add python files for DL vertex
lastgeorge Mar 27, 2026
88ea105
speed up
lastgeorge Mar 27, 2026
7a3e654
update code
lastgeorge Mar 27, 2026
c24b74b
fix bugs
lastgeorge Mar 27, 2026
76ecf15
improve code
lastgeorge Mar 28, 2026
f697239
update code
lastgeorge Mar 28, 2026
ebaf138
fix bug
lastgeorge Mar 28, 2026
b8a2fa2
catch up
lastgeorge Mar 28, 2026
45093c1
fix bugs
lastgeorge Mar 28, 2026
c076e16
update
lastgeorge Mar 28, 2026
d3b4d87
convert std::cout to SPDDEBUG
lastgeorge Mar 28, 2026
58d2d5d
update code
lastgeorge Mar 28, 2026
0cb71a4
fix many bugs
lastgeorge Mar 29, 2026
3f56eed
fix more bugs
lastgeorge Mar 29, 2026
fef1a30
make sure all the shower vertex, segment points are ordered properly
lastgeorge Mar 29, 2026
6652f2f
add MC bee particle flow dumper
lastgeorge Mar 30, 2026
dbcddf6
get the get_kine_best
lastgeorge Mar 30, 2026
ce47c3a
update
lastgeorge Mar 30, 2026
4a52e65
update
lastgeorge Mar 30, 2026
fa1cbc4
fix a bug
lastgeorge Mar 31, 2026
e7df78e
update code
lastgeorge Mar 31, 2026
dd7b764
update code
lastgeorge Mar 31, 2026
bec3a5d
update code
lastgeorge Mar 31, 2026
18f0917
fixed a bug
lastgeorge Mar 31, 2026
be40c69
update the information
lastgeorge Mar 31, 2026
1eb097a
fix a bug and randomness
lastgeorge Apr 1, 2026
97c4bc9
update the shower bee id
lastgeorge Apr 1, 2026
f261b07
further validation
lastgeorge Apr 1, 2026
a3088b9
fix a bug on getting tracks
lastgeorge Apr 1, 2026
0cee0b4
fix a few bugs
lastgeorge Apr 1, 2026
4a1326b
fix a bug
lastgeorge Apr 1, 2026
899a091
add some docs
lastgeorge Apr 1, 2026
d60790c
update
lastgeorge Apr 2, 2026
4d29d81
add a file
lastgeorge Apr 5, 2026
127fd13
finish porting two functions
lastgeorge Apr 5, 2026
b6750af
add geometry service
lastgeorge Apr 5, 2026
ce14d37
finish porting the code
lastgeorge Apr 5, 2026
05f1bdb
add more porting functions
lastgeorge Apr 6, 2026
eff56e2
port match_isFC
lastgeorge Apr 6, 2026
4535965
make plan
lastgeorge Apr 6, 2026
024d0ae
port a few nue tagger functions
lastgeorge Apr 7, 2026
239544c
finish some additional functions
lastgeorge Apr 7, 2026
9e8524f
add more functions
lastgeorge Apr 7, 2026
1a08cda
add more nue functions
lastgeorge Apr 7, 2026
b24f183
fix some warnings
lastgeorge Apr 7, 2026
5be1d64
add nue BDTs
lastgeorge Apr 7, 2026
2bf0048
add SSM tagger
lastgeorge Apr 7, 2026
42efa16
finish some subsections two more to go
lastgeorge Apr 7, 2026
0a3ea3b
continue porting single photon tagger
lastgeorge Apr 8, 2026
1f4c0a9
update the SinglePhoton Tagger
lastgeorge Apr 8, 2026
074bee7
update code
lastgeorge Apr 8, 2026
72d0aee
examine some codes
lastgeorge Apr 8, 2026
fdfc384
fix some bugs
lastgeorge Apr 9, 2026
c2ce2ec
fix a bug
lastgeorge Apr 9, 2026
d8792a9
make ssm tagger more efficient
lastgeorge Apr 9, 2026
4d3c9d9
remove some warnings
lastgeorge Apr 9, 2026
41cb729
improve code
lastgeorge Apr 9, 2026
1676e22
update code
lastgeorge Apr 9, 2026
716dd5f
improve code
lastgeorge Apr 9, 2026
1209634
update code
lastgeorge Apr 9, 2026
a2b93e6
update code
lastgeorge Apr 9, 2026
db9c73a
improve the algorithm for speed consideration
lastgeorge Apr 10, 2026
ddd413e
improve the clustering_connect
lastgeorge Apr 10, 2026
4a6fc06
update code
lastgeorge Apr 10, 2026
64993b9
examine six functions
lastgeorge Apr 10, 2026
598bbc6
improve code in clustering
lastgeorge Apr 10, 2026
93fb440
add a review document
lastgeorge Apr 10, 2026
acc0ff2
review and improve clustering_protect_overclustering
lastgeorge Apr 10, 2026
cdad17d
improve the code
lastgeorge Apr 10, 2026
0876c06
improve ode
lastgeorge Apr 10, 2026
37339eb
improve the code
lastgeorge Apr 10, 2026
d30bfa7
update code
lastgeorge Apr 10, 2026
e4ccffe
Improve Single Track Fitting
lastgeorge Apr 10, 2026
3b26c38
include TMVA for root build
lastgeorge Apr 11, 2026
4cf26f1
fix some bugs related to loading XML files
lastgeorge Apr 11, 2026
6ccbb24
add protection regarding BDT files loading
lastgeorge Apr 11, 2026
c35c007
fix the shower type query
lastgeorge Apr 11, 2026
7fc5ec6
add a couple more md files for single_track fitting
lastgeorge Apr 11, 2026
dbf8eeb
do_multi_tracking review and bug fixes
lastgeorge Apr 11, 2026
f639218
improve PRVertex PRSegment and PRShower classes and some associated f…
lastgeorge Apr 11, 2026
132f964
add an review segment
lastgeorge Apr 11, 2026
a31b981
improve code for both single track fitting and improve clusters
lastgeorge Apr 11, 2026
dcaa4cc
steiner: apply §8 cosmetic fixes from review
lastgeorge Apr 11, 2026
bf6808a
examine_graph: review, bug fixes, and efficiency improvements
lastgeorge Apr 11, 2026
2ad7f73
pid/kine review: add review doc and apply all code fixes
lastgeorge Apr 11, 2026
9ee4bcf
steiner: fix flag_steiner_terminal element-size mismatch (uint8_t vs …
lastgeorge Apr 11, 2026
3154908
steiner: document flag_steiner_terminal uint8_t/int crash in review doc
lastgeorge Apr 11, 2026
94f1842
examine_structure: review, bug fixes, and efficiency improvements
lastgeorge Apr 11, 2026
6e18641
examine_vertices: review, bug fixes, and efficiency improvements
lastgeorge Apr 11, 2026
487c362
examine_vertices_3: apply E2 efficiency optimisation in phase 2 inner…
lastgeorge Apr 11, 2026
e3ba95d
apply_pointcloud: review, determinism fixes for check_end_point and c…
lastgeorge Apr 12, 2026
76e2c8f
pointcloud_clustering: review, bug fixes for proto_extend_point and g…
lastgeorge Apr 12, 2026
0d042ba
track_shower_sep: review, bug fix in improve_maps_multiple_tracks_in,…
lastgeorge Apr 12, 2026
1d22b0c
examine_structure_final: review, B.1 bug fix, add review doc
lastgeorge Apr 12, 2026
614978f
main_vertex: review, determinism fix in examine_main_vertices_local, …
lastgeorge Apr 12, 2026
be54881
deghosting: pass map_cluster_main_vertices by ref, use ordered_nodes …
lastgeorge Apr 12, 2026
37c9d97
deghosting_kinematics: add review doc
lastgeorge Apr 12, 2026
a0a6ed8
shower_clustering: review, bug fixes for 4 issues
lastgeorge Apr 12, 2026
23cb392
shower_clustering: fix pi0 direction calc and hardcoded electron mass
lastgeorge Apr 12, 2026
d2df16d
vertex_fitting: fix eigenvalue ordering in MyFCN, determinism in impr…
lastgeorge Apr 12, 2026
02c2373
cosmic_tagger: fix units bug, implement FV tolerance, multi-APA front…
lastgeorge Apr 12, 2026
aeb7980
cluster_fc_check: fix unclamped acos() calls, add numu tagger review doc
lastgeorge Apr 12, 2026
b234460
nue/ssm/singlephoton tagger: fix 6 bugs, add review docs
lastgeorge Apr 12, 2026
d13726f
singlephoton_tagger: add comprehensive review doc, update tagger review
lastgeorge Apr 12, 2026
2edf86b
img: fix 16 bugs, 7 efficiency improvements, add examination docs
lastgeorge Apr 12, 2026
21bb1bc
aux: add code examination docs for DFT, frame, cluster/blob/tensor
lastgeorge Apr 12, 2026
c9a32e3
sigproc: fix 17 bugs, 11 efficiency improvements, add examination docs
lastgeorge Apr 12, 2026
f661896
cuda: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
88a9041
apps: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
1f1eb55
util: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
63edd51
iface: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
ffe58fa
pgraph: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
3e279de
sig: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
40b03b3
pyutil: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
b636cc3
pytorch: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
6fdd402
hio: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
4abb016
zio: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
b5e57d7
sio: add code examination docs for bugs, efficiency, and algorithm
lastgeorge Apr 12, 2026
9834d25
root: fix 21 bugs, 7 efficiency improvements, add examination docs
lastgeorge Apr 12, 2026
828ecef
fix a small glitch
lastgeorge Apr 12, 2026
2792b3f
clus: fix break_segments backward-walk overshoot and dl_vtx_cut default
lastgeorge Apr 14, 2026
8ea4c4e
clus: fix stopping-muon + Michel-electron misclassification in examin…
lastgeorge Apr 14, 2026
1a928bb
clus: fix pseudo-mother PDG for isolated hadronic showers in Bee PF tree
lastgeorge Apr 14, 2026
6317183
fix make blob bug for PDVD
Ningclover Apr 15, 2026
12219cc
fix bug
Ningclover Apr 15, 2026
7725a9c
clus: fix flag_switch misfiring on degenerate near-endpoint windows i…
lastgeorge Apr 15, 2026
7283e0a
Merge pull request #462 from WireCell/XN_apply-pointcloud
lastgeorge Apr 15, 2026
6fb22c7
clus: improve DL vertex re-rank scoring based on 36-event empirical a…
lastgeorge Apr 15, 2026
6127bc3
clus: add angle<45° guard to break_segments terminus-stub absorption
lastgeorge Apr 15, 2026
5d23834
add missing md files
lastgeorge Apr 15, 2026
d4c23bc
fix D3Vector operator<
Ningclover Apr 15, 2026
6a725e3
clus: accumulate per-cluster fitted 2D charge for complete T_proj_dat…
lastgeorge Apr 15, 2026
95a6515
root: add UbooneTaggerOutputVisitor to write T_tagger and T_kine trees
lastgeorge Apr 16, 2026
a90ceba
root: add wire-cell-uboone-tagger-compare validation app
lastgeorge Apr 16, 2026
ebebceb
clus/docs: update tagger_validation_plan to reflect completed steps
lastgeorge Apr 16, 2026
00a98ec
docs: add wcwc_config.md documenting view setup and ROOT+TMVA configu…
lastgeorge Apr 17, 2026
314873f
img: remove unused loop_count and loop_sum helper functions
lastgeorge Apr 17, 2026
5407c10
clus: demote sub-logger debug calls to trace for opt-in verbosity
lastgeorge Apr 17, 2026
9759f5b
clus: demote MABC per-visitor/per-segment debug calls to trace
lastgeorge Apr 17, 2026
8b99dfb
root: suppress TMVA Reader booking output with !V:Silent
lastgeorge Apr 17, 2026
22e8f20
clus: add TaggerCheckNeutrino timing, fix spurious warnings
lastgeorge Apr 17, 2026
3a8b382
clus: add per-step MABC timing via Perf helper
lastgeorge Apr 17, 2026
86f14e1
tagger: align branch/field names with prototype
lastgeorge Apr 17, 2026
1d66e69
root: fix numu3 TMVA variable name mismatch after field rename
lastgeorge Apr 17, 2026
ae3faab
compare: show proto/toolkit values in verbose per-branch output
lastgeorge Apr 17, 2026
7da31e4
compare: uniform verbose table with proto/toolkit/default columns
lastgeorge Apr 17, 2026
d539805
compare: add Double_t support, handle mixed Float_t/Double_t branches
lastgeorge Apr 17, 2026
e08d6fb
compare: resolve nu_x/y/z branch→struct field aliases for default lookup
lastgeorge Apr 17, 2026
befda4b
compare: auto-detect NeutrinoTaggerInfo.h from installed prefix
lastgeorge Apr 17, 2026
b7c4597
compare: add fingerprint clustering and sentinel annotations in verbo…
lastgeorge Apr 17, 2026
4002e30
tagger: add unit tests + extend PatternDebugIO for full-chain replay
lastgeorge Apr 17, 2026
7c20381
tagger: add fixture and fix doctest_tagger_check_neutrino
lastgeorge Apr 18, 2026
2522724
pattern_recognition: add unit tests (pure helpers + PR step replay)
lastgeorge Apr 18, 2026
dc68088
pattern_recognition: fix run_through chain and ParticleDataSet ordering
lastgeorge Apr 18, 2026
f890ab7
test: regenerate fixture data files for pattern recognition tests
lastgeorge Apr 18, 2026
4b489e5
catch u
lastgeorge Apr 18, 2026
e9da918
catch up
lastgeorge Apr 18, 2026
52dabf5
gen: fix bent-cathode boundary check and drifter test depo collection
lastgeorge Apr 18, 2026
60e8fe8
Merge remote-tracking branch 'origin/master' into apply-pointcloud
lastgeorge Apr 18, 2026
baf0a1a
fix: raise ValueError when {u,v,w}charge arrays missing from 3d point…
lastgeorge Apr 18, 2026
77f5486
Merge pull request #463 from WireCell/XN_apply-pointcloud
lastgeorge Apr 21, 2026
36bf9da
fix: MagnifySink Trun branch corruption and cross-anode T_bad entries
lastgeorge Apr 21, 2026
a688e52
cfg: add pgrapher/experiment/protodunevd jsonnet library configs
lastgeorge Apr 22, 2026
ccde6b0
clus: make PointTreeMerging and ClusteringSwitchScope tolerate empty …
lastgeorge Apr 23, 2026
1eb0009
gen: Reframer tolerates oversized trace summary
lastgeorge Apr 23, 2026
bb4a3f3
Merge remote-tracking branch 'origin/master' into apply-pointcloud
lastgeorge Apr 23, 2026
4f4c2f6
fix: 5 pre-existing test failures (porting, issue220, quickhull)
lastgeorge Apr 23, 2026
573be55
root: MagnifySink writes optional T_geo per-channel geometry tree
lastgeorge Apr 24, 2026
41e0273
cfg/pdvd: sync NF+SP configs from dunereco for standalone VD processing
lastgeorge Apr 24, 2026
37dfe64
cfg/pdhd: sync pdhd configs from Xuyang's dunereco for standalone NF+…
lastgeorge Apr 24, 2026
3285223
fix: restore 2-plane active tiling in SBND and DUNE-VD multi-3view mode
lastgeorge Apr 25, 2026
1e04669
sio/FrameFileSource: parse filenames whose tag contains underscores
lastgeorge Apr 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
54 changes: 54 additions & 0 deletions apps/docs/examination/00-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# apps/ Code Examination Plan

## Scope

Systematic examination of the Wire Cell Toolkit `apps` module (~800 lines of C++
across 12 source files) for:

1. **Potential bugs** -- logic errors, missing error handling, null dereferences, resource leaks
2. **Running efficiency** -- unnecessary copies, redundant iterations, missing checks
3. **Algorithm documentation** -- what each component does, how it fits into the WCT pipeline

## File Inventory

### Group 1: Main Class (~520 lines) -- highest priority
| File | Lines | Role |
|------|-------|------|
| `Main.h` | 118 | Main class interface and member declarations |
| `Main.cxx` | 414 | Core orchestrator: cmdline parsing, initialization, execution |

### Group 2: Application Components (~220 lines)
| File | Lines | Role |
|------|-------|------|
| `AnodeDumper.h` | 25 | AnodeDumper interface |
| `AnodeDumper.cxx` | 77 | Anode geometry dumper |
| `ConfigDumper.h` | 25 | ConfigDumper interface |
| `ConfigDumper.cxx` | 65 | Component default configuration dumper |
| `NodeDumper.h` | 25 | NodeDumper interface |
| `NodeDumper.cxx` | 82 | Node type metadata dumper |

### Group 3: CLI Executables (~250 lines)
| File | Lines | Role |
|------|-------|------|
| `wire-cell.cxx` | 29 | Main WCT entry point |
| `wcsonnet.cxx` | 96 | Jsonnet compiler CLI |
| `wcwires.cxx` | 124 | Wire geometry validator/converter CLI |

### Group 4: Tests
| File | Lines | Role |
|------|-------|------|
| `test_dlopen.cxx` | 54 | Plugin/factory singleton tests |
| `test_apps.bats` | 23 | CLI smoke tests |
| `anode-dumper.jsonnet` | 28 | AnodeDumper configuration example |

## Output Documents

| Document | Contents |
|----------|----------|
| `00-plan.md` | This plan |
| `01-overview.md` | Architecture overview, design patterns, pipeline flow |
| `02-main-class.md` | Main.h/Main.cxx deep examination |
| `03-app-components.md` | AnodeDumper, ConfigDumper, NodeDumper examination |
| `04-cli-tools.md` | wire-cell.cxx, wcsonnet.cxx, wcwires.cxx examination |
| `05-bug-summary.md` | Consolidated bug table |
| `06-efficiency-summary.md` | Consolidated efficiency recommendations |
162 changes: 162 additions & 0 deletions apps/docs/examination/01-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# apps/ Architecture Overview and Algorithm Documentation

## Role in the Wire-Cell Toolkit

The `apps` module is the **top-level application layer** of the Wire-Cell Toolkit (WCT).
It sits above the interface (`iface`), utility (`util`), and all component modules
(e.g., `gen`, `sigproc`, `img`). Its responsibilities are:

1. **Bootstrap the toolkit** -- parse CLI arguments, load plugins, read configuration,
instantiate and configure components
2. **Execute application components** -- run registered `IApplication` objects in sequence
3. **Provide CLI programs** -- `wire-cell` (general entry point), `wcsonnet` (Jsonnet compiler),
`wcwires` (wire geometry validator)
4. **Provide diagnostic dumpers** -- `AnodeDumper`, `ConfigDumper`, `NodeDumper` for
inspecting component state

## Architecture

```
CLI Programs Diagnostic Apps External Embedders
(wire-cell, (AnodeDumper, (LArSoft art/FHiCL)
wcsonnet, wcwires) ConfigDumper,
| NodeDumper)
| |
v v
+-------------------------------+
| Main class | <-- Central orchestrator
| cmdline() -> initialize() |
| -> operator()() -> finalize()|
+-------------------------------+
| | |
v v v
Persist Plugin Factory
(Jsonnet Manager (Named
config) (dlopen) Factory)
| | |
v v v
+-------------------------------+
| WCT Component Ecosystem |
| (IConfigurable, IApplication,|
| INode, ITerminal, INamed) |
+-------------------------------+
```

## Main Class Lifecycle

The `Main` class orchestrates the entire WCT boot-up sequence. It can be driven
either through `cmdline()` (for CLI use) or through fine-grained setup methods
(for embedding in frameworks like LArSoft).

### Phase 1: Setup (cmdline or explicit calls)

Configuration is accumulated into member variables:
- `m_cfgfiles`: configuration file paths (Jsonnet/JSON)
- `m_plugins`: plugin library names to load
- `m_apps`: application components to execute
- `m_load_path`: search paths for configuration file resolution
- `m_extvars`, `m_extcode`, `m_tlavars`, `m_tlacode`: Jsonnet external variables

### Phase 2: Initialization (initialize)

Sequential steps:
1. **Set up logging** -- configure spdlog pattern and create "main" logger
2. **Load configuration** -- parse each Jsonnet/JSON file using `Persist::Parser`
with the accumulated load paths and external variables, merge into `ConfigManager`
3. **Extract "wire-cell" entry** -- special config entry carries plugin and app lists
4. **Load plugins** -- use `PluginManager` to dlopen shared libraries
5. **Instantiate components** -- iterate all config entries, call `Factory::lookup<Interface>`
to create component instances
6. **Set component names** -- find components implementing `INamed`, call `set_name()`
7. **Apply log configuration** -- set log levels for named loggers
8. **Configure components** -- for each `IConfigurable`, get default config, merge with
user config via `update()`, and call `configure()`

### Phase 3: Execution (operator())

1. Look up all `IApplication` objects by their type:name strings
2. If TBB is available and thread limit is set, create `tbb::global_control`
3. Execute each application sequentially via `aobj->execute()`

### Phase 4: Finalization (finalize, also called by destructor)

1. Iterate all config entries, find components implementing `ITerminal`
2. Call `finalize()` on each terminal component for cleanup

## Design Patterns

### Factory Pattern
All WCT components are created through `NamedFactory`. Components register themselves
via `WIRECELL_FACTORY` macros. The factory system supports:
- Type-based lookup: `Factory::lookup<IFace>(type, name)`
- Named instances: same type can have multiple named instances
- Singleton caching: same (type, name) always returns the same instance

### Plugin Pattern
Component implementations live in shared libraries (plugins). The `PluginManager`
uses `dlopen()` to load them at runtime. This allows the apps layer to be generic --
it doesn't link against any specific component implementations.

### Configuration Pattern
Configuration flows through the system as `Json::Value` objects:
1. Jsonnet files are compiled to JSON
2. JSON is organized as an array of `{type, name, data}` objects
3. Each component's `default_configuration()` provides defaults
4. User config is merged on top via `update()` (recursive merge)
5. The merged config is passed to `configure()`

The special `wire-cell` config entry (type="wire-cell") carries top-level
orchestration data: which plugins to load and which apps to run.

### Interface Segregation
Components implement only the interfaces they need:
- `IApplication`: has `execute()` -- top-level runnable
- `IConfigurable`: has `configure()`, `default_configuration()` -- accepts configuration
- `ITerminal`: has `finalize()` -- needs cleanup
- `INamed`: has `set_name()` -- accepts a string name
- `INode`: has `input_types()`, `output_types()`, `concurrency()`, `category()` -- data flow node

## CLI Programs

### wire-cell
The main WCT entry point. Ultra-thin wrapper: creates `Main`, calls `cmdline()`,
`initialize()`, and `operator()()`. Catches `WireCell::Exception` and prints error details.
This is the program that end-users typically invoke to run WCT processing pipelines.

### wcsonnet
A Jsonnet compiler that is aware of WCT conventions. Uses `Persist::Parser` which
internally uses the Go-based Jsonnet library (faster than the C++ reference implementation).
Honors `WIRECELL_PATH` environment variable for import resolution. Useful for debugging
Jsonnet configuration files independently of WCT execution.

### wcwires
A wire geometry utility that loads, validates, and optionally converts wire description
files. Supports correction levels (load, order, direction, pitch) that progressively
fix common issues in wire geometry definitions. The validator checks geometric properties
with a configurable epsilon tolerance.

## Diagnostic App Components

### AnodeDumper
Dumps anode plane geometry to JSON. Traverses the anode -> face -> plane hierarchy
and extracts identifiers, channel counts, and wire counts. Useful for verifying
detector geometry is correctly configured.

### ConfigDumper
Dumps default configurations for components. Can dump all known `IConfigurable`
components or a specified subset. Useful for discovering what configuration options
a component accepts.

### NodeDumper
Dumps node type metadata including input/output port types, concurrency model,
and category. Useful for understanding the data flow graph structure.

## Test Infrastructure

The module has minimal testing:
- `test_dlopen.cxx`: Verifies plugin loading, factory singleton behavior, and named
instance distinctness. This is a critical infrastructure test.
- `test_apps.bats`: BATS shell tests verifying that CLI executables exist and produce
expected output (smoke tests).
- `anode-dumper.jsonnet`: Example Jsonnet configuration for AnodeDumper, parameterized
by detector (default: "pdsp"). Demonstrates the configuration pattern.
Loading