![]() |
SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
|
This repository contains the SHiP experiment geometry implementation using GeoModel.
The SHiP geometry is described using GeoModel and is used by the simulation and digitisation/reconstruction packages which are developed in a separate repository.
An automatic class reference is built using Doxygen from comments in the C++ code.
Every dimensional constant (length, angle, density, molar mass) is a typed mp-units quantity, declared in the unit its value is written in: 2160.0 * units::mm, 80.0 * units::cm, 2.3 * units::deg. The shared vocabulary lives in include/SHiP/geometry/Units.h (SHiP::geometry::units).
GeoModel's API takes raw doubles in its native units (mm, radians). units::gm() is the single bridge: it multiplies a quantity's stored value by the matching GeoModelKernelUnits factor — the identical arithmetic the former value * GeoModelKernelUnits::<unit> literals performed — so the typed constants are numerically free and the geometry is unchanged bit for bit. Raw doubles appear only (a) at gm()-wrapped GeoModel/GeoTrf calls and (b) in genuinely unitless math (growth slopes, direction cosines, counts, GeoGenfun/Eigen inputs), converted as early as possible.
(Subsystems are converted incrementally; unconverted ones still use the GeoModelKernelUnits annotation style described above until their milestone lands.)
| Subsystem | Status | Description |
|---|---|---|
| Cavern | Complete | World volume with subtracted rock cavities |
| Target | Complete | 2026 BDF target: 33 W disks in grooved steel core with jacket and endcap |
| MuonShield | Approximate | TRY_2026 hadron stopper and magnets M1-M7 as solid iron blocks |
| NeutrinoDetector | Approximate | Veto + Si/W target + HCAL with individual scintillating fibres |
| Magnet | Approximate | Iron yoke with box-shaped coils (should be tubes) |
| DecayVolume | Implemented | Frustum: SBT steel structure + LAB sensors + helium centre |
| TimingDetector | Complete | 330 scintillator bars |
| UpstreamTagger | Simulation-ready | Segmented 4.4 × 6.4 m tile plane, 47000 polystyrene tiles (fine 20 mm + coarse 40 mm) |
| Trackers | Complete | 4 stations, 4 stereo views each, 9600 straw tubes |
| Calorimeter | Simulation-ready | ECAL + HCAL sampling layers (Pb/PVT/HPL + Fe/PVT) |
On x86_64, the OverlapCheck test runs gmclash on the built geometry and compares its report with tests/known_clashes.json. It fails on a new overlap and on a known one that has gone away. A known one that comes out deeper than its recorded bound only gives a warning. It takes a few minutes; ctest --test-dir build -LE overlap skips it. After an intended change, refresh the list and give every new entry an issue number:
pixi run visualisation renders the standard figures without a display; see visualisation/README.md.
With no subsystem named, the complete detector is built. Naming subsystems (as spelled by --list, e.g. Calorimeter) assembles those into the world at their declared placements. --standalone instead builds exactly one named subsystem by itself, in its own local frame at the origin, with no world around it.
The output file is set with -o; the default is ship_geometry.db for the full build, ship_selection.db for a selection, and <Name>.db with --standalone.
This installs the headers, libraries, and SHiPGeometryConfig.cmake so that downstream projects can locate the package:
The package config calls find_dependency for GeoModelCore, GeoModelIO, and mp-units automatically. mp-units 2.5 (header-only, from the ship conda channel) is a public dependency: the installed headers use its quantity types.
Each subsystem is a self-contained factory class that builds its geometry, describes where it belongs, and registers itself:
with a single registration line in the factory's .cpp (inside namespace SHiP::geometry):
The assembler names no subsystem. assembleGeometry(), also reachable via DetectorBuilder::build(), iterates the registry, builds the world (the subsystem whose descriptor sets isWorld, i.e. the Cavern), and places every other registered subsystem at its declared position, ordered by (z, id). A single subsystem can be built on its own, in its local frame, with buildSubsystem("Foo"). The descriptor type lives in include/SHiP/geometry/SubsystemDescriptor.h, and the registry and macro in include/SHiP/geometry/SubsystemRegistry.h.
All materials are managed centrally by Materials. To use an existing material in a factory:
To add a new material, edit src/Materials.cpp:
Standard figures of every subsystem and the full detector are rendered offscreen with fullSimLight by pixi run visualisation; see visualisation/README.md.
The reference GDML exported from FairShip is not tracked in this repository (ignored via .gitignore). To obtain it, export from FairShip and place in gdml/. The gdml2gm tool does not support GDML assemblies, so direct conversion is not possible — the GDML serves as a numerical reference for geometry parameters during C++ implementation.
The SHiP geometry is distributed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later). See the [LICENSE](LICENSE) file for details.
Copyright is held by CERN for the benefit of the SHiP Collaboration. Some components are distributed under different licenses and copyrights — see the individual file headers and the LICENSES directory for details. This project follows the REUSE specification for licensing information.