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.
- Origin: target front face (first tungsten disk)
- Z-axis: along beam direction (positive downstream)
- Y-axis: vertical (against gravity)
- X-axis: horizontal, perpendicular to beam (completes right-handed system)
- Units: mm (GeoModel native), angles in radians
- Beam axis height: 1.7 m above floor
| Subsystem | Status | Description |
|---|---|---|
| Cavern | Complete | World volume with subtracted rock cavities |
| Target | Complete | 19 W slabs with Ta cladding in Inconel vessel |
| MuonShield | Approximate | 6 stations, box approximations of arb8 shapes |
| Magnet | Approximate | Iron yoke with box-shaped coils (should be tubes) |
| DecayVolume | Approximate | Rectangular vessel (should be frustum) |
| TimingDetector | Complete | 330 scintillator bars via GeoModelXML |
| UpstreamTagger | Approximate | Monolithic slab (needs bar segmentation) |
| Trackers | Envelope only | 4 empty station boxes |
| Calorimeter | Envelope only | 3 empty component boxes (ECAL front/back, HCAL) |
- CMake 3.16 or later
- C++20 compatible compiler
- GeoModel libraries (GeoModelCore, GeoModelIO, GeoModelTools) version 6.22+
# Configure
cmake -B build -DCMAKE_BUILD_TYPE=Release
# Build
cmake --build build
# Run tests
ctest --test-dir build# Build the complete SHiP geometry
./build/apps/build_geometry [output_file.db]
# View in gmex
gmex output_file.dbcmake --install build --prefix /path/to/installThis installs the headers, libraries, and SHiPGeometryConfig.cmake so that
downstream projects can locate the package:
find_package(SHiPGeometry CONFIG REQUIRED)
target_link_libraries(myapp PRIVATE SHiPGeometry::SHiPGeometry)The package config calls find_dependency for GeoModelCore, GeoModelIO, and
GeoModelTools automatically.
Each subsystem is implemented as a factory class:
class FooFactory {
public:
explicit FooFactory(SHiPMaterials& materials);
GeoPhysVol* build();
private:
SHiPMaterials& m_materials;
};SHiPGeometryBuilder::build() orchestrates all factories, creating the world
volume (Cavern) and placing each subsystem at its global z-position.
All materials are managed centrally by SHiPMaterials. To use an existing
material in a factory:
const GeoMaterial* iron = m_materials.requireMaterial("Iron");To add a new material, edit src/SHiPMaterials.cpp:
- Add elements in
createElements()if not already present - Add the material in
createMaterials()with composition and density - Call
material->lock()after defining the composition
- Header:
subsystems/<Name>/include/<Name>/<Name>Factory.h— declare the factory class with dimension constants asstatic constexprmembers - Implementation:
subsystems/<Name>/src/<Name>Factory.cpp— implementbuild()using GeoModel primitives (GeoBox,GeoTubs,GeoLogVol,GeoPhysVol,GeoTransform, etc.) - Registration: add a
build()+ placement call insrc/SHiPGeometry.cpp(SHiPGeometryBuilder::build()) - CMake: add sources/headers to
subsystems/<Name>/CMakeLists.txt - Docs: update the subsystem
README.mdwith geometry tree, materials, and status
geometry/
├── include/SHiPGeometry/ # Public headers (SHiPGeometry, SHiPMaterials)
├── src/ # Core implementation
├── subsystems/ # Detector subsystem factories
│ ├── Cavern/
│ ├── Target/
│ ├── MuonShield/
│ ├── Magnet/
│ ├── DecayVolume/
│ ├── Trackers/
│ ├── Calorimeter/
│ ├── UpstreamTagger/
│ └── TimingDetector/
├── apps/ # build_geometry, validate_geometry
├── tests/ # Unit tests
└── cmake/ # CMake package config
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 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.