39 return {.name =
"Magnet",
40 .node =
"/SHiP/magnet",
44 .z_mm =
gm(89.57 * m),
51 [[nodiscard]] GeoPhysVol*
build();
62 GeoPhysVol* createYoke();
63 GeoPhysVol* createCoil(
const std::string& name);
64 GeoPhysVol* createVerticalConnector(
const std::string& name);
68 static constexpr auto s_yokeOuterHalfX = 3000.0 *
units::mm;
69 static constexpr auto s_yokeOuterHalfY = 4300.0 *
units::mm;
70 static constexpr auto s_yokeOuterHalfZ = 1400.0 *
units::mm;
71 static constexpr auto s_yokeInnerHalfX = 2200.0 *
units::mm;
72 static constexpr auto s_yokeInnerHalfY = 3500.0 *
units::mm;
73 static constexpr auto s_yokeInnerHalfZ = 1410.0 *
units::mm;
76 static constexpr auto s_coilHalfX = 800.0 *
units::mm;
77 static constexpr auto s_coilHalfY = 400.0 *
units::mm;
78 static constexpr auto s_coilHalfZ = 1660.0 *
units::mm;
79 static constexpr auto s_coilXOffset = 2200.0 *
units::mm;
80 static constexpr auto s_coilYOffset = 3250.0 *
units::mm;
83 static constexpr auto s_connectorHalfX = 400.0 *
units::mm;
84 static constexpr auto s_connectorHalfY = 3250.0 *
units::mm;
85 static constexpr auto s_connectorHalfZ = 125.0 *
units::mm;
86 static constexpr auto s_connectorXOffset = 2600.0 *
units::mm;
87 static constexpr auto s_connectorZOffset = 1525.0 *
units::mm;
93 static constexpr auto s_zero = 0.0 *
units::mm;
97 checks::box(s_coilXOffset, s_coilYOffset, s_zero, s_coilHalfX, s_coilHalfY, s_coilHalfZ);
99 checks::box(s_connectorXOffset, s_zero, s_connectorZOffset, s_connectorHalfX,
100 s_connectorHalfY, s_connectorHalfZ);
103 0.5 * (s_yokeInnerHalfX + s_yokeOuterHalfX), s_zero, s_zero,
104 0.5 * (s_yokeOuterHalfX - s_yokeInnerHalfX), s_yokeOuterHalfY, s_yokeOuterHalfZ);
106 static_assert(s_yokeInnerHalfX < s_yokeOuterHalfX && s_yokeInnerHalfY < s_yokeOuterHalfY &&
107 s_yokeInnerHalfZ >= s_yokeOuterHalfZ,
108 "the yoke inner cut-out must leave a frame open along the beam");
110 s_yokeOuterHalfZ)) &&
113 "a magnet part sticks out of the container");
115 "the connectors must sit clear of the yoke");
122 "the coil/yoke overlap is gone (assert !overlaps) or has grown");
125 "the coil/connector overlap is gone (assert !overlaps) or has grown");
GeoPhysVol * build()
Build the Magnet geometry.
Definition MagnetFactory.cpp:24
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
static constexpr SubsystemDescriptor descriptor()
This subsystem's self-description (name, node, id, placement).
Definition MagnetFactory.h:36
MagnetFactory(Materials &materials)
Definition MagnetFactory.cpp:22
Central material manager for the SHiP detector.
Definition Materials.h:22
constexpr bool overlaps(Span a, Span b)
The intervals share more than a boundary. Touching ends do not overlap.
Definition StaticChecks.h:45
constexpr bool contains(Span outer, Span inner, LengthMm tol=0.0 *units::mm)
inner lies within outer, allowing tol of slack at either end.
Definition StaticChecks.h:40
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 bool overlapsWithin(const Box &a, const Box &b, const Box ®ion, LengthMm tol=1e-6 *units::mm)
The boxes overlap, and only within region.
Definition StaticChecks.h:97
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
constexpr auto m
Definition Units.h:29
constexpr double gm(mp_units::quantity< U, Rep > q)
Length quantity -> GeoModel raw double (GeoModel native unit: mm).
Definition Units.h:47
constexpr auto mm
Definition Units.h:27
Definition DetectorBuilder.h:8
constexpr double gm(mp_units::quantity< U, Rep > q)
Length quantity -> GeoModel raw double (GeoModel native unit: mm).
Definition Units.h:47
A subsystem's self-description: everything the assembler needs.
Definition SubsystemDescriptor.h:20
Axis-aligned box.
Definition StaticChecks.h:50