SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
Loading...
Searching...
No Matches
SHiP::geometry::layout Namespace Reference

Where each subsystem container sits in the world volume. More...

Namespaces

namespace  detail

Classes

struct  Slot
struct  KnownOverlap
 Two containers that overlap, although Geant4 does not support overlapping siblings. More...
struct  CutOut
 A container with a cavity of another container's shape cut out of it. More...

Typedefs

using LengthMm
 Spellings for struct members and function parameters.

Functions

template<typename Factory>
constexpr Slot slotOf (LengthMm halfX, LengthMm halfY, LengthMm halfZ)
 A factory's slot: its registered placement (descriptor()) together with its container half-lengths.
template<std::size_t N>
constexpr std::size_t firstOutOfOrder (const std::array< Slot, N > &slots)
 Centres never decrease along the slot list.
template<std::size_t M>
constexpr bool isKnownOverlap (const std::array< KnownOverlap, M > &known, const Slot &a, const Slot &b)
 The pair is listed in known and overlaps no further than its region.
template<std::size_t K>
constexpr bool isCutOut (const std::array< CutOut, K > &cutOuts, const Slot &a, const Slot &b)
 One of the pair has the other's shape cut out of it (listed in cutOuts), and the other lies within that cavity.
template<std::size_t N, std::size_t M = kKnownOverlaps.size(), std::size_t K = kCutOuts.size()>
constexpr std::size_t firstUnexpectedOverlap (const std::array< Slot, N > &slots, const std::array< KnownOverlap, M > &known=kKnownOverlaps, const std::array< CutOut, K > &cutOuts=kCutOuts)
 Index of the first slot that overlaps a later one, unless the pair is a known overlap that has not grown, or one sits in a cavity cut out of the other; npos if there is none.
constexpr bool fitsEnvelopeZ (const Slot &slot, const envelopes::Envelope &env, LengthMm tol=1e-6 *detail::mm)
 Container lies inside the envelope along the beam (with tol of slack, for values that are equal on paper but rounded differently).
constexpr bool fitsEnvelopeXY (const Slot &slot, const envelopes::Envelope &env, LengthMm tolX=detail::zero, LengthMm tolY=detail::zero)
 Container stays inside the envelope's largest transverse size (with tolX and tolY of slack).
constexpr bool isInCavity (const Slot &slot)
 The container lies within the halls taken together: the muon shield runs from TCC8 across the step into ECN3, and the magnet sits partly in the yoke pit.
constexpr checks::Span trackerStation (LengthMm centreZ)
 Absolute z-span of one tracker station.

Variables

constexpr Slot kTarget
constexpr Slot kMuonShield
constexpr Slot kNeutrinoDetector
 z 22.94-27.99 m, in the end of muon-shield magnet M5 and the whole of M6 (FairShip TRY_2026).
constexpr Slot kUpstreamTagger
constexpr Slot kDecayVolume
constexpr Slot kTrackers
 The factory positions its stations relative to s_containerCentreZ, so the container goes there and the stations land on their absolute z.
constexpr Slot kMagnet
constexpr Slot kTimingDetector
constexpr Slot kCalorimeter
constexpr std::array kSlots
 All subsystems, in placement order (upstream to downstream).
constexpr std::array kKnownOverlaps
constexpr std::array kCutOuts
 The SND sits in a cavity of the muon-shield container (#117).
constexpr checks::Box kWorld
 The world volume built by CavernFactory, centred on the origin.
constexpr std::array kCavities
 The halls CavernFactory cuts out of the rock, in the world frame.
constexpr auto kTrackersIntoFloor = 66.0 * detail::mm
constexpr auto kCalorimeterIntoFloor = 136.0 * detail::mm
constexpr auto kNeutrinoDetectorEarlyStart = 3461.0 * detail::mm
constexpr auto kUpstreamTaggerExcessX = 1450.0 * detail::mm
constexpr auto kUpstreamTaggerExcessY = 1600.0 * detail::mm
constexpr auto kTimingDetectorEarlyStart = 168.0 * detail::mm
constexpr std::array kTrackerStationZ

Detailed Description

Where each subsystem container sits in the world volume.

Each slot pairs a subsystem's registered placement (its descriptor(), which the assembler places it from) with its container half-lengths. The static_asserts below check the layout as a whole: ordering along the beam, no overlaps beyond the known ones, everything inside the world, and every container inside its EDMS envelope (Envelopes.h). Container half-lengths are read from the factories, so resizing a container is checked here as well. Known deviations are bounded: each fails the build both when it is fixed and when it gets worse.

Coordinates are in the world frame, whose origin is the front face of the first target disk.

Typedef Documentation

◆ LengthMm

Spellings for struct members and function parameters.

Constants instead use static constexpr auto x = 1.0 * units::mm; and deduce their type.

Function Documentation

◆ firstOutOfOrder()

template<std::size_t N>
std::size_t SHiP::geometry::layout::firstOutOfOrder ( const std::array< Slot, N > & slots)
nodiscardconstexpr

Centres never decrease along the slot list.

◆ firstUnexpectedOverlap()

template<std::size_t N, std::size_t M = kKnownOverlaps.size(), std::size_t K = kCutOuts.size()>
std::size_t SHiP::geometry::layout::firstUnexpectedOverlap ( const std::array< Slot, N > & slots,
const std::array< KnownOverlap, M > & known = kKnownOverlaps,
const std::array< CutOut, K > & cutOuts = kCutOuts )
nodiscardconstexpr

Index of the first slot that overlaps a later one, unless the pair is a known overlap that has not grown, or one sits in a cavity cut out of the other; npos if there is none.

◆ fitsEnvelopeXY()

bool SHiP::geometry::layout::fitsEnvelopeXY ( const Slot & slot,
const envelopes::Envelope & env,
LengthMm tolX = detail::zero,
LengthMm tolY = detail::zero )
nodiscardconstexpr

Container stays inside the envelope's largest transverse size (with tolX and tolY of slack).

◆ fitsEnvelopeZ()

bool SHiP::geometry::layout::fitsEnvelopeZ ( const Slot & slot,
const envelopes::Envelope & env,
LengthMm tol = 1e-6 * detail::mm )
nodiscardconstexpr

Container lies inside the envelope along the beam (with tol of slack, for values that are equal on paper but rounded differently).

◆ isCutOut()

template<std::size_t K>
bool SHiP::geometry::layout::isCutOut ( const std::array< CutOut, K > & cutOuts,
const Slot & a,
const Slot & b )
nodiscardconstexpr

One of the pair has the other's shape cut out of it (listed in cutOuts), and the other lies within that cavity.

◆ isInCavity()

bool SHiP::geometry::layout::isInCavity ( const Slot & slot)
nodiscardconstexpr

The container lies within the halls taken together: the muon shield runs from TCC8 across the step into ECN3, and the magnet sits partly in the yoke pit.

◆ isKnownOverlap()

template<std::size_t M>
bool SHiP::geometry::layout::isKnownOverlap ( const std::array< KnownOverlap, M > & known,
const Slot & a,
const Slot & b )
nodiscardconstexpr

The pair is listed in known and overlaps no further than its region.

◆ slotOf()

template<typename Factory>
Slot SHiP::geometry::layout::slotOf ( LengthMm halfX,
LengthMm halfY,
LengthMm halfZ )
nodiscardconstexpr

A factory's slot: its registered placement (descriptor()) together with its container half-lengths.

◆ trackerStation()

checks::Span SHiP::geometry::layout::trackerStation ( LengthMm centreZ)
nodiscardconstexpr

Absolute z-span of one tracker station.

Variable Documentation

◆ kCalorimeter

Slot SHiP::geometry::layout::kCalorimeter
inlineconstexpr
Initial value:
=
constexpr auto kContainerHalfZ
Definition CalorimeterConstants.h:101
constexpr auto kContainerHalfY
Definition CalorimeterConstants.h:100
constexpr auto kContainerHalfX
Definition CalorimeterConstants.h:99
constexpr Slot slotOf(LengthMm halfX, LengthMm halfY, LengthMm halfZ)
A factory's slot: its registered placement (descriptor()) together with its container half-lengths.
Definition Layout.h:68

◆ kCalorimeterIntoFloor

auto SHiP::geometry::layout::kCalorimeterIntoFloor = 136.0 * detail::mm
inlineconstexpr

◆ kCavities

std::array SHiP::geometry::layout::kCavities
inlineconstexpr
Initial value:
= [] {
using C = CavernFactory;
const auto hall = [](LengthMm px, LengthMm py, LengthMm pz, LengthMm hx, LengthMm hy,
LengthMm hz) {
return checks::box(px, py, pz + C::s_cavernPosZ, hx, hy, hz);
};
return std::array{
hall(C::s_muonCavernPosX, C::s_muonCavernPosY, C::s_muonCavernPosZ, C::s_muonCavernHalfX,
C::s_muonCavernHalfY, C::s_muonCavernHalfZ),
hall(C::s_expCavernPosX, C::s_expCavernPosY, C::s_expCavernPosZ, C::s_expCavernHalfX,
C::s_expCavernHalfY, C::s_expCavernHalfZ),
hall(C::s_stairPosX, C::s_stairPosY, C::s_stairPosZ, C::s_stairHalfX, C::s_stairHalfY,
C::s_stairHalfZ),
hall(C::s_yokePitPosX, C::s_yokePitPosY, C::s_yokePitPosZ, C::s_yokePitHalfX,
C::s_yokePitHalfY, C::s_yokePitHalfZ),
hall(C::s_targetPitPosX, C::s_targetPitPosY, C::s_targetPitPosZ, C::s_targetPitHalfX,
C::s_targetPitHalfY, C::s_targetPitHalfZ),
};
}()
Factory for the Cavern (world volume and rock) geometry.
Definition CavernFactory.h:18
constexpr Box box(LengthMm cx, LengthMm cy, LengthMm cz, LengthMm hx, LengthMm hy, LengthMm hz)
Box with centre (cx, cy, cz) and the given half-lengths.
Definition StaticChecks.h:57
mp_units::quantity< mm > LengthMm
Spellings for struct members and function parameters.
Definition Units.h:39

The halls CavernFactory cuts out of the rock, in the world frame.

The subsystems are siblings of the rock in the world, so each must sit in a hall, or it overlaps solid rock.

◆ kCutOuts

std::array SHiP::geometry::layout::kCutOuts
inlineconstexpr
Initial value:
{
CutOut{.from = kMuonShield.path,
.cut = kNeutrinoDetector.path,
.hole =
[] {
const auto& cavity = MuonShieldFactory::k_sndCavity;
auto halfX = detail::zero;
auto halfY = detail::zero;
for (const auto& s : cavity) {
halfX = s.halfX < halfX ? halfX : s.halfX;
halfY = s.halfY < halfY ? halfY : s.halfY;
}
return checks::Box{.x = {.lo = -halfX, .hi = halfX},
.y = {.lo = -halfY, .hi = halfY},
.z = {.lo = cavity.front().zStart, .hi = cavity.back().zEnd}};
}()},
}
static constexpr auto k_sndCavity
Cavity for the SND (veto, target, MGC, HCAL): the SND container's sections (NeutrinoDetectorFactory::...
Definition MuonShieldFactory.h:142
constexpr auto zero
Definition Layout.h:62
constexpr Slot kMuonShield
Definition Layout.h:84
constexpr Slot kNeutrinoDetector
z 22.94-27.99 m, in the end of muon-shield magnet M5 and the whole of M6 (FairShip TRY_2026).
Definition Layout.h:92
Axis-aligned box.
Definition StaticChecks.h:50
A container with a cavity of another container's shape cut out of it.
Definition Layout.h:147

The SND sits in a cavity of the muon-shield container (#117).

◆ kDecayVolume

Slot SHiP::geometry::layout::kDecayVolume
inlineconstexpr
Initial value:
=
constexpr auto kEnvelopeHalfZ
Definition SBTConstants.h:88
constexpr auto kEnvelopeHalfX
Definition SBTConstants.h:86
constexpr auto kEnvelopeHalfY
Definition SBTConstants.h:87

◆ kKnownOverlaps

std::array SHiP::geometry::layout::kKnownOverlaps
inlineconstexpr
Initial value:
{
.b = kMagnet.path,
.region = checks::bounds(-3000, 3000, -3430, 3430, 87070, 92070)},
}
constexpr Box bounds(double x0, double x1, double y0, double y1, double z0, double z1)
Box from its bounds in mm, for writing a known region down literally.
Definition StaticChecks.h:80
constexpr Slot kTrackers
The factory positions its stations relative to s_containerCentreZ, so the container goes there and th...
Definition Layout.h:105
constexpr Slot kMagnet
Definition Layout.h:108
Two containers that overlap, although Geant4 does not support overlapping siblings.
Definition Layout.h:128

◆ kMagnet

Slot SHiP::geometry::layout::kMagnet
inlineconstexpr
Initial value:
=
static constexpr auto s_containerHalfY
Definition MagnetFactory.h:56
static constexpr auto s_containerHalfZ
Definition MagnetFactory.h:57
static constexpr auto s_containerHalfX
Definition MagnetFactory.h:55

◆ kMuonShield

Slot SHiP::geometry::layout::kMuonShield
inlineconstexpr
Initial value:
static constexpr auto s_areaHalfY
Definition MuonShieldFactory.h:126
static constexpr auto s_areaHalfZ
Definition MuonShieldFactory.h:128
static constexpr auto s_areaHalfX
Definition MuonShieldFactory.h:124

◆ kNeutrinoDetector

Slot SHiP::geometry::layout::kNeutrinoDetector
inlineconstexpr
Initial value:
static constexpr auto s_halfX
Bounding box of the sections: the HCAL's cross-section and the full 5.05 m length.
Definition NeutrinoDetectorFactory.h:128
static constexpr auto s_halfY
Definition NeutrinoDetectorFactory.h:129
static constexpr auto s_halfZ
Definition NeutrinoDetectorFactory.h:130

z 22.94-27.99 m, in the end of muon-shield magnet M5 and the whole of M6 (FairShip TRY_2026).

Those magnets have a cavity of the SND container's stepped shape cut out of their iron (MuonShieldFactory::k_sndCavity), and so does the muon-shield container, so the two containers do not overlap (see kCutOuts). The slot is the container's bounding box.

◆ kNeutrinoDetectorEarlyStart

auto SHiP::geometry::layout::kNeutrinoDetectorEarlyStart = 3461.0 * detail::mm
inlineconstexpr

◆ kSlots

std::array SHiP::geometry::layout::kSlots
inlineconstexpr
Initial value:
constexpr Slot kUpstreamTagger
Definition Layout.h:96
constexpr Slot kDecayVolume
Definition Layout.h:99
constexpr Slot kTarget
Definition Layout.h:80
constexpr Slot kTimingDetector
Definition Layout.h:112
constexpr Slot kCalorimeter
Definition Layout.h:116

All subsystems, in placement order (upstream to downstream).

◆ kTarget

Slot SHiP::geometry::layout::kTarget
inlineconstexpr
Initial value:
=
static constexpr auto s_vacuumBoxHalfY
Definition TargetFactory.h:82
static constexpr auto s_vacuumBoxHalfZ
Definition TargetFactory.h:83
static constexpr auto s_vacuumBoxHalfX
Definition TargetFactory.h:81

◆ kTimingDetector

Slot SHiP::geometry::layout::kTimingDetector
inlineconstexpr
Initial value:
static constexpr auto s_containerHalfZ
Definition TimingDetectorFactory.h:60
static constexpr auto s_containerHalfX
Definition TimingDetectorFactory.h:58
static constexpr auto s_containerHalfY
Definition TimingDetectorFactory.h:59

◆ kTimingDetectorEarlyStart

auto SHiP::geometry::layout::kTimingDetectorEarlyStart = 168.0 * detail::mm
inlineconstexpr

◆ kTrackers

Slot SHiP::geometry::layout::kTrackers
inlineconstexpr
Initial value:
static constexpr auto s_halfY
Definition TrackersFactory.h:109
static constexpr auto s_halfX
Definition TrackersFactory.h:108
static constexpr auto s_containerHalfZ
Definition TrackersFactory.h:119

The factory positions its stations relative to s_containerCentreZ, so the container goes there and the stations land on their absolute z.

The container spans the magnet (stations 1-2 upstream, 3-4 downstream).

◆ kTrackersIntoFloor

auto SHiP::geometry::layout::kTrackersIntoFloor = 66.0 * detail::mm
inlineconstexpr

◆ kTrackerStationZ

std::array SHiP::geometry::layout::kTrackerStationZ
inlineconstexpr
Initial value:
{
static constexpr auto s_station1Z
Definition TrackersFactory.h:113
static constexpr auto s_station4Z
Definition TrackersFactory.h:116
static constexpr auto s_station3Z
Definition TrackersFactory.h:115
static constexpr auto s_station2Z
Definition TrackersFactory.h:114

◆ kUpstreamTagger

Slot SHiP::geometry::layout::kUpstreamTagger
inlineconstexpr
Initial value:
static constexpr auto s_halfZ
Definition UpstreamTaggerFactory.h:86
static constexpr auto s_halfX
Definition UpstreamTaggerFactory.h:84
static constexpr auto s_halfY
Definition UpstreamTaggerFactory.h:85

◆ kUpstreamTaggerExcessX

auto SHiP::geometry::layout::kUpstreamTaggerExcessX = 1450.0 * detail::mm
inlineconstexpr

◆ kUpstreamTaggerExcessY

auto SHiP::geometry::layout::kUpstreamTaggerExcessY = 1600.0 * detail::mm
inlineconstexpr

◆ kWorld

checks::Box SHiP::geometry::layout::kWorld
inlineconstexpr
Initial value:
static constexpr auto s_worldHalfY
Definition CavernFactory.h:41
static constexpr auto s_worldHalfZ
Definition CavernFactory.h:42
static constexpr auto s_worldHalfX
Definition CavernFactory.h:40

The world volume built by CavernFactory, centred on the origin.