Commit Graph

164 Commits

Author SHA1 Message Date
lars 62945c95c4 Add export_xsec executable for PbWO4 gamma attenuation coefficients
Builds a minimal PbWO4 geometry, forces EM physics tables via a
zero-event run, then sweeps photon energy 1 eV-10 MeV with
G4EmCalculator to dump per-process mass attenuation coefficients to CSV.
2026-06-25 16:53:23 +02:00
lars 2715bc8d0d Add next_volume/next_material columns and sampling batch script
Records the volume and material a track is about to enter when a step
ends at a geometric boundary, since post-step's physical volume still
refers to the volume the step occurred in. Also adds
run-sampling-batch.sh to run all run_sampling configs in parallel from
isolated directories, avoiding output filename collisions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 19:24:35 +02:00
lars 11d01d7015 Add run_sampling executable for sampling calorimeter geometries
Mirrors run_pbwo4 but alternates thin absorber and active layers,
with four selectable configs (by name or 1-based index): pb_scint,
fe_scint, w_scint_ecal (homogeneous ECAL-like preshower + W/scint
sampling section), and pb_lar. Each is sized to reach ~20-25 X0 of
absorber despite the dilution from inactive gaps. Wired into the
top-level CMakeLists, superbuild, and Dockerfile alongside run_pbwo4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 09:45:31 +02:00
lars 942130c667 add run-at-etp.sh for batch pbwo4 production runs
Builds and runs run_pbwo4 ten times with 10k events each, then moves
the renamed outputs to /ceph/lbogner/geant_steps/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:50:34 +02:00
lars 0adc896bce add post-step momentum direction to Steps ntuple
Pre-step direction was already recorded; post_dx/dy/dz lets students
compare momentum direction before and after each step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 14:40:05 +02:00
lars 26821af188 replace Dockerfile-mini with new superbuild-based Dockerfile
Switches from the old per-component Dockerfile-mini to a unified
Dockerfile that uses the superbuild CMake setup, Ubuntu 24.04, uv for
Python dependency management, and pyproject.toml for the Python
environment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 13:06:51 +02:00
lars 2f74ee0637 rewrite README with full project and Geant4 modification docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 11:15:11 +02:00
lars 38a0273087 link run_pbwo4 to build root in both build modes
Superbuild: install step creates build/run_pbwo4 symlink pointing at
the executable in build/minicalosim-build/.
Regular build: CMAKE_RUNTIME_OUTPUT_DIRECTORY ensures the executable
lands in build/ regardless of generator.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 11:10:44 +02:00
lars c11ecf51de update geant4 submodule: fix circular dep in track ID pre-assignment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 11:07:58 +02:00
lars 2a0a23a45b remove example files, mac files, and unused docker variants
Keep only the core C++ source and docker/Dockerfile-mini. Removes:
- exampleB4a (example executable and associated scripts)
- Geant4 macro (.mac) files
- ROOT plotting scripts
- GNUmakefile (old non-CMake build system)
- All Dockerfiles and scripts except Dockerfile-mini

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:45:17 +02:00
lars e265a6aa63 add superbuild to compile Geant4 from submodule source
superbuild/CMakeLists.txt uses ExternalProject_Add to give three targets:

  cmake -B build -S superbuild/
  cmake --build build --target geant4      # build Geant4 → build/geant4-install
  cmake --build build --target run_pbwo4   # build minicalosim against it
  cmake --build build                      # both

The existing root CMakeLists.txt (find_package Geant4) is unchanged
for the system-Geant4 workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:41:47 +02:00
lars 121aab961f point geant4 submodule at personal GitLab fork
Switch from upstream Geant4/geant4 on GitHub to lbogner/geant4 on
GitLab, which carries the minicalosim-spawning branch with the
pre-assigned track ID changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:36:05 +02:00
lars 517ba2ecb2 add child_track_ids array column to Steps; remove parent_id
Each Steps row now carries a variable-length child_track_ids int array
containing the track IDs of all secondaries spawned during that step.
The parent_id column is removed — parentage is now expressed
unidirectionally (parent→children) via child_track_ids and the Spawning
ntuple, rather than bidirectionally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:30:36 +02:00
lars 9ea0718139 add Spawning ntuple recording secondary births per step
Each step that spawns secondaries now writes one row per secondary to a
new Spawning ntuple (event_id, parent_track_id, parent_step_no,
child_track_id). This enables direct shower-tree reconstruction without
position joins. Requires the companion Geant4 submodule change that
pre-assigns track IDs in ProcessSecondariesFromParticleChange.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:25:08 +02:00
lars 718f9361f7 docs: archive parent_step_no design plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:22:43 +02:00
lars 01df646aa9 add run_pbwo4 C++ executable; fix missing std headers for Geant4 11.4
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 09:19:55 +02:00
lars 18de7dd3db limit Docker build parallelism to min(nproc, 16)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:20:27 +02:00
lars 5fc50bcefc print commit hash on import; fix event_id offset in multi-core steps
G4Calo.py prints the commit at import time, resolved via a
minicalo_version.py file (baked in by Docker) or git rev-parse
from the file's directory as fallback.

event_id in the Steps ntuple restarts from 0 in each subprocess;
_assemble_results_to_mini_df now accepts per-file event_id_offsets
so IDs are globally unique after merging. run_batch passes cumulative
nevents as offsets when loading the Steps tree.

Dockerfiles write minicalo_version.py before copying Python files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:35:31 +02:00
lars f5c832fd44 fix Geant4 cmake git-dirty check when building from submodule ADD
The submodule leaves a .git *file* (not directory) pointing to
../../.git/modules/lib/geant4, which passes G4GitUtilities' guard
but causes a FATAL_ERROR when git status fails in the bare /tmp dir.
Remove .git before cmake so the guard fires and the check is skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:09:55 +02:00
lars 4ffb2f78b8 extend Steps ntuple and switch Docker to Geant4 submodule source
Add 15 new columns to the Steps ntuple: edep, step_length, parent_id,
process name, layer_id, material, pre-step momentum direction, and
B/E field components (in T and V/m) at the pre-step point.

Replace wget Geant4 tarball download in all three Dockerfiles with
ADD of the lib/geant4 submodule source; narrow submodule init to
lib/pybind11 only so builds no longer require network access for Geant4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:07:17 +02:00
lars f9a7f2d1f1 add Geant4 source as shallow submodule (lib/geant4)
Tracks HEAD of https://github.com/Geant4/geant4.git at depth 1 for
reference browsing. shallow=true ensures others also get a shallow clone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 15:55:25 +02:00
lars df3faa841c assemble steps inside try block to ensure temp file cleanup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 14:18:40 +02:00
lars 5f01ab6d35 save hits and steps to separate pickles in run_pbwo4.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 14:18:05 +02:00
lars 7a62a46fe6 add run_pbwo4.py and include examples dir in both Docker images
run_pbwo4.py simulates 10 events in a single 20cm G4_PbWO4 layer
(10x10 sensor grid, 1 GeV e-) and saves results as a pickle next to
the script. Both images now expose /examples containing all bind/ files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 13:59:01 +02:00
lars 03b615cd3a fix LD_LIBRARY_PATH warning in Dockerfile-mini
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 12:57:38 +02:00
lars aaf0b33413 add minimal Docker image (no CUDA, no Jupyter, batch-only Geant4)
Dockerfile-mini builds a lightweight image with only what's needed to
run the bind/ examples: Geant4 v11.1.2 (batch mode, no visualization),
Python 3.10, and numpy/pandas/uproot/awkward/plotly/ipython.
Examples are copied to /examples which is also the working directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 12:38:52 +02:00
lars 0c3f68d0cf change container entrypoint from start-notebook.sh to bash
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 12:30:47 +02:00
lars 4bc94278d8 fix Docker build: initialise pybind11 submodule before cmake
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 11:47:51 +02:00
lars 19b1ef125b add per-step kinematics ntuple ("Steps") to ROOT output
Adds a second ntuple alongside the existing "Hits" ntuple with one row
per Geant4 step. Records event_id, track_id, step_no, PDG code, and
pre/post position + kinetic energy for every step in the simulation.

Also extends run_batch() with return_steps=False; when True, returns
(hits_mf, steps_mf) instead of just hits_mf.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 11:37:39 +02:00
lars 91020714e7 add CLAUDE.md with build, test, and architecture documentation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 11:20:31 +02:00
Jan Kieseler 90baa21ce5 better commit hash handling 2025-10-16 17:25:09 +02:00
Jan Kieseler 8b8a526c54 added fastparquet 2025-10-16 15:32:52 +02:00
Jan Kieseler cc41ed3c65 legacy structure (I hope) 2025-10-16 15:11:50 +02:00
Jan Kieseler 589b50522b removed unnecessary includes 2025-10-10 14:44:46 +02:00
Jan Kieseler 47919f46aa docu 2025-10-10 13:18:59 +02:00
Jan Kieseler e53e2b0af4 fixing local absolute path for debugging 2025-10-10 13:00:05 +02:00
Jan Kieseler 13a913c068 changed to slim pandas wrapper 2025-10-10 10:38:33 +02:00
Jan Kieseler d1155dc1e2 added slim pandas wrapper 2025-10-10 10:38:22 +02:00
Jan Kieseler fd13b336e1 updated finally to ubuntu 22.04 and py3.10 2025-01-15 16:20:13 +01:00
Jan Kieseler 64e48ce7b3 changing ubuntu version 2025-01-15 16:06:34 +01:00
Jan Kieseler 0492cf0875 added better cleanup 2024-12-13 12:33:43 +01:00
Jan Kieseler e195f8fe1a small fix 2024-12-13 11:53:11 +01:00
Jan Kieseler 62bf0837b5 changed underlying geant encapsulation completely 2024-12-13 11:13:54 +01:00
Jan Kieseler ef48d3da76 faster geant compile 2024-12-12 08:28:53 +01:00
Jan Kieseler 7e47bd5aa7 remove threaded option in geant compile args 2024-12-12 08:26:53 +01:00
Jan Kieseler 7829fde6f2 manual seed option 2024-11-07 14:14:45 +01:00
Jan Kieseler 7410049a72 added multi particles 2024-10-09 13:05:18 +02:00
Jan Kieseler b7946e2e37 assert not needed anymore with clearly defined seeds 2024-10-07 15:21:20 +02:00
Jan Kieseler 6fede8c1f8 print 2024-09-17 16:20:09 +02:00
Jan Kieseler 46efd8dea0 cpu file, needs testing 2024-09-17 16:19:49 +02:00