Add per-step Spawning ntuple, Geant4 submodule superbuild, and standalone dataset executables #1

Merged
lbogner merged 33 commits from spawning-ntuple into main 2026-07-13 14:06:25 +02:00
lbogner commented 2026-07-13 14:05:35 +02:00 (Migrated from gitlab.etp.kit.edu)

Summary

This branch extends miniCaloSim with per-step kinematic tracking, moves Geant4
to a submodule-based superbuild, and adds standalone executables for
generating calorimeter datasets outside the Python/Jupyter workflow.

Steps ntuple (per-step kinematics)

  • Add a Steps ROOT ntuple recording per-step kinematics alongside the
    existing Hits ntuple.
  • Track secondary particle births per step (Spawning ntuple), including
    child_track_ids and post-step momentum direction.
  • Add next_volume/next_material columns for step-level geometry context.
  • Assemble steps inside a try block to guarantee temp file cleanup; save hits
    and steps to separate pickles from run_pbwo4.py.

Build system

  • Vendor Geant4 as a shallow git submodule (lib/geant4) and build it via a
    new CMake superbuild (superbuild/CMakeLists.txt), removing the dependency
    on a separately-installed Geant4.
  • Add an option to disable GDML support so the build has no dependency on
    xerces-c.
  • Rewrite docker/Dockerfile around the submodule/superbuild, drop the
    now-unused Dockerfile-mini and JupyterHub start-script variants, and
    limit Docker build parallelism to min(nproc, 16).
  • Fix a Geant4 CMake git-dirty check and a circular dependency in track ID
    pre-assignment surfaced by the submodule build.

New standalone executables

  • run_pbwo4 — generates PbWO4 calorimeter datasets; supports nEvents and
    energy_GeV CLI args, and MINICALOSIM_SEED to avoid RNG seed collisions
    across concurrently-launched jobs.
  • run_sampling — generates datasets for four sampling calorimeter configs
    (pb_scint, fe_scint, w_scint_ecal, pb_lar), with the same
    nEvents/energy_GeV/MINICALOSIM_SEED support.
  • export_xsec — exports PbWO4 gamma mass attenuation coefficients via
    G4EmCalculator.
  • run-sampling-batch.sh / run-at-etp.sh — batch scripts for parallel
    dataset production on the ETP cluster.

Other

  • Remove unused example files (exampleB4a.cc, macros, plotting scripts) no
    longer needed now that geometry is fully descriptor-driven.
  • Rewrite README.md and add CLAUDE.md with build/test/architecture docs
    for the current state of the project.
## Summary This branch extends miniCaloSim with per-step kinematic tracking, moves Geant4 to a submodule-based superbuild, and adds standalone executables for generating calorimeter datasets outside the Python/Jupyter workflow. ### Steps ntuple (per-step kinematics) - Add a `Steps` ROOT ntuple recording per-step kinematics alongside the existing `Hits` ntuple. - Track secondary particle births per step (`Spawning` ntuple), including `child_track_ids` and post-step momentum direction. - Add `next_volume`/`next_material` columns for step-level geometry context. - Assemble steps inside a try block to guarantee temp file cleanup; save hits and steps to separate pickles from `run_pbwo4.py`. ### Build system - Vendor Geant4 as a shallow git submodule (`lib/geant4`) and build it via a new CMake superbuild (`superbuild/CMakeLists.txt`), removing the dependency on a separately-installed Geant4. - Add an option to disable GDML support so the build has no dependency on xerces-c. - Rewrite `docker/Dockerfile` around the submodule/superbuild, drop the now-unused `Dockerfile-mini` and JupyterHub start-script variants, and limit Docker build parallelism to `min(nproc, 16)`. - Fix a Geant4 CMake git-dirty check and a circular dependency in track ID pre-assignment surfaced by the submodule build. ### New standalone executables - `run_pbwo4` — generates PbWO4 calorimeter datasets; supports `nEvents` and `energy_GeV` CLI args, and `MINICALOSIM_SEED` to avoid RNG seed collisions across concurrently-launched jobs. - `run_sampling` — generates datasets for four sampling calorimeter configs (`pb_scint`, `fe_scint`, `w_scint_ecal`, `pb_lar`), with the same `nEvents`/`energy_GeV`/`MINICALOSIM_SEED` support. - `export_xsec` — exports PbWO4 gamma mass attenuation coefficients via `G4EmCalculator`. - `run-sampling-batch.sh` / `run-at-etp.sh` — batch scripts for parallel dataset production on the ETP cluster. ### Other - Remove unused example files (`exampleB4a.cc`, macros, plotting scripts) no longer needed now that geometry is fully descriptor-driven. - Rewrite `README.md` and add `CLAUDE.md` with build/test/architecture docs for the current state of the project.
lbogner commented 2026-07-13 14:06:25 +02:00 (Migrated from gitlab.etp.kit.edu)

mentioned in commit b5c8f69bfa

mentioned in commit b5c8f69bfa362e9c79c1504a2d762eec2b02b733
lbogner (Migrated from gitlab.etp.kit.edu) merged commit b5c8f69bfa into main 2026-07-13 14:06:25 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lars/minicalosim#1