Files
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

69 lines
2.0 KiB
Docker

FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
# ---------------------------------------------------------------------------
# System dependencies (dnf instead of apt)
# ---------------------------------------------------------------------------
RUN apt-get update && apt-get install -y \
gcc \
g++ \
make \
cmake \
ninja-build \
libxerces-c-dev \
git \
curl \
ca-certificates \
python3 \
python3-dev \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
# ---------------------------------------------------------------------------
# uv
# ---------------------------------------------------------------------------
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
WORKDIR /src
# ---------------------------------------------------------------------------
# Copy only files needed for the C++ build
# ---------------------------------------------------------------------------
COPY CMakeLists.txt .
COPY superbuild/ superbuild/
COPY src/ src/
COPY include/ include/
COPY bind/ bind/
COPY lib/ lib/
COPY run_pbwo4.cc .
COPY run_sampling.cc .
# lib/geant4/.git is a submodule pointer to the host's .git/modules dir, which
# is not copied into the image. Replace it with a fresh repo so Geant4's cmake
# git status calls succeed.
RUN rm lib/geant4/.git && git init lib/geant4
# ---------------------------------------------------------------------------
# Build Geant4 + miniCaloSim
# ---------------------------------------------------------------------------
RUN cmake -S superbuild -B build -G Ninja \
-DGEANT4_INSTALL_DATA=ON
RUN cmake --build build --parallel
# ---------------------------------------------------------------------------
# Python environment (uv)
# ---------------------------------------------------------------------------
RUN uv venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
ADD docker/pyproject.toml pyproject.toml
RUN uv sync
WORKDIR /workspace
ENTRYPOINT ["/bin/bash", "-l"]