Guidance for AI coding agents working in this repository. For human contributors, see CONTRIBUTING.md.
BDSIM is a C++ package for simulating accelerators using Geant4. Most of the source code lives in the
src/, analysis/, convert/, interpolator/, parser/, python/ directories. Tests in examples/ and test/
directories. Documentation source in manual/ directory.
| Contents | Source directory |
|---|---|
| Main Geant4 dependent C++ code | src/ |
| Main Geant4 dependent C++ headers | include/ |
| ROOT analysis code | analysis/ |
| Comparisons between output C++ code | comparator/ |
| Interpolator C++ code | interpolator/ |
| Converter utilities C++ code | convert/ |
| Examples and ctest tests | examples/ |
| Documentation source sphinx | manual/ |
| External or specific extension modules C++ code | modules/ |
| Python bindings with pybind11 | python/ |
| Parser code to read gmad files | parser/ |
| External dependency source | src-external |
| Assorted utilities | utils/ |
mkdir agent_build
mkdir agent_install/
cd agent_build
cmake -DCMAKE_INSTALL_PREFIX=../agent_install ../
make -j$(nproc) install| Task | Command |
|---|---|
| Run all tests | ctest -j$(nproc) |
- Detailed style rules are found here
- Prefer small, focused functions. Match the patterns of surrounding code.
- Most of the tests can be found in
examplesandtest - Every behaviour change needs a test in
examplesusing a gmad file and corresponding ctest - Only tests which link against BDSIM should be put in
test - Do not write tests which test the pybind11 binding code
Always
- Keep changes minimal and scoped to the task.
- Update manual for user-visible changes.
- Document changes in
manual/source/version_history.rst - Add to the manual if a new feature is added or a new option is introduced.
Ask first
- Adding or upgrading dependencies
- Changing public APIs or file formats
- Large refactors or file moves
Never
- Commit secrets, credentials, or large data files
- Force-push, rewrite history, or push directly to
developormaster