Aegir¶
Aegir is the simulation framework for the SHiP experiment.
It is based on:
Repository: ShipSoft/aegir
API reference: Doxygen
Quick start¶
git clone https://github.com/ShipSoft/aegir.git
cd aegir
pixi run build
pixi run phlex -c workflows/pythia8_mt.jsonnet
See Installation for details.
Features¶
The following capabilities are already implemented in aegir or provided through the Geometry Service and Field Service:
Event generators
- Configurable particle gun with Philox / Random123 RNG (
particle_gun_source) - Pythia8 fixed-target p–p generation, serial or
PythiaParallel(pythia8_source) - Dual-target generation with p–p / p–n interaction-point sampling based on the
material Z/A (
fixed_target_source) - GENIE neutrino interaction generation via the separate
aegir-genie phlex plugin
(
genie_source); packaged cross-section splines pending — see GENIE neutrino generation below
Geometry (selectable per workflow)
- Built-in test geometry: W target + Si scoring planes (
geometry_builtin_provider) - GDML file geometry (
geometry_gdml_provider) - GeoModel
.dbgeometry via the Geometry Service (geometry_geomodel_provider) - Configurable sensitive / scoring volumes
Magnetic field (via the Field Service)
- covfie-backed field maps, configured per magnet from the workflow (
field_covfie_provider) - Field-off / null provider (
field_null_provider)
Transport & simulation
- Geant4 transport, single- and multi-threaded with configurable concurrency (
geant4_module) - Energy-cut transport and scoring-plane hit saving
- Built-in profiling: Chrome tracing, flamegraphs and benchmarks
Output
- RNTuple output of
MCParticlecollections with parallel writing (sim_output_module) - Validation histograms (ROOT 7)
Workflows
- Ready-to-run Phlex jsonnet workflows for gun, Pythia8 and fixed-target setups
in single-threaded / multi-threaded / generator-only variants (
workflows/)
Three steps to target simulation¶
- Collide proton beam at 400 GeV on fixed protons and neutrons using Pythia8
- Beam travels in the z direction only, but smearing and painting are applied
- Random choice for beam to interact with protons or neutrons based on the Z/A of the material it traverses
- Transport particles with GEANT4 (and decay them, make them interact with matter, etc.)
- Interactions with matter is time-consuming bit of target simulation
- To save time, particles below a certain energy are not transported
- Save particles which reach a sensitive plane right after the hadron absorber (HA)
- Only particle above a certain energy are saved
This simulation contains only target complex and hadron absorber. The magnetic field is also turned off.
Once the target simulation is produced, particles (such as muons) can be further propagated through the detector. This is much less time consuming, which is why there is a separation between "target simulation" and the rest of the simulation.
GENIE neutrino generation¶
Neutrino interactions are generated with aegir-genie, a phlex source plugin that embeds the GENIE event generator. Rather than the multi-step FairShip command-line pipeline (gmkspl → gevgen → gntpc → vertex re-placement), the plugin drives a genie::GMCJDriver directly: it convolves the SHiP neutrino flux with cross-section splines and the detector geometry, placing interaction vertices consistently with the material the simulation tracks through, with built-in protons-on-target accounting.
Because GENIE is GPL-licensed, everything that links it lives in the separate aegir-genie repository (the SHiP-authored source is LGPL-3.0-or-later; the GENIE-linked program is a combined GPL-3.0-or-later work). aegir never links this code — phlex discovers the plugin at run time via PHLEX_PLUGIN_PATH.
Repository: ShipSoft/aegir-genie
API reference: Doxygen