SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
Loading...
Searching...
No Matches
TrackersFactory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) CERN for the benefit of the SHiP Collaboration
3
4#pragma once
5
8
9#include <array>
10#include <string>
11
12class GeoPhysVol;
13
14namespace SHiP::geometry {
15
16class Materials;
17
40 public:
41 explicit TrackersFactory(Materials& materials);
42 ~TrackersFactory() = default;
43
53 static constexpr SubsystemDescriptor descriptor() {
54 return {.name = "Trackers",
55 .node = "/SHiP/trackers",
56 .id = 5,
57 .x_mm = 0.0,
58 .y_mm = 0.0,
60 .isWorld = false};
61 }
62
66 [[nodiscard]] GeoPhysVol* build();
67
68 // ── Straw / view geometry constants ─────────────────────────────────
69
70 static constexpr int s_nStations = 4;
71 static constexpr int s_nViews = 4;
72 static constexpr int s_nSubLayers = 2;
73
74 static constexpr auto s_strawRadius = 10.0 * units::mm;
75 static constexpr auto s_strawLength = 4000.0 * units::mm;
76 static constexpr auto s_wallThickness = 0.030 * units::mm;
77
79 static constexpr auto s_apertureX = 4000.0 * units::mm;
80 static constexpr auto s_apertureY = 6000.0 * units::mm;
81
83 static constexpr int s_nStraws =
84 static_cast<int>(units::ratio(s_apertureY / (2.0 * s_strawRadius)));
85
86 static constexpr auto s_stereoAngleDeg = 2.3 * units::deg;
87
88 // View frame (FairShip-style hollow rectangle).
89 static constexpr auto s_frameBarX = 100.0 * units::mm;
90 static constexpr auto s_frameBarY = 100.0 * units::mm;
91 static constexpr auto s_frameHalfZ = 22.0 * units::mm;
92
93 // ── Tracker magnet ──────────────────────────────────────────────────
94 // An inert, air-filled marker volume named "TrackerMagnet", placed in
95 // the clear gap between station 2 and the spectrometer-magnet yoke.
96 //
97 // NOTE: this is NOT a physically-scaled dipole. The spectrometer dipole
98 // proper is the separate Magnet subsystem (iron yoke + coils) occupying
99 // z = 87.07-92.07 m. The only free space inside the trackers container
100 // and clear of that yoke is a ~0.5 m gap, so this marker is sized to fit
101 // there. It exists so the tracker magnet has a named placeholder in the
102 // geometry; simulation/field code can locate it by the name
103 // "/SHiP/trackers/tracker_magnet".
104 static constexpr auto s_trackerMagnetZ = 86820.0 * units::mm;
105 static constexpr auto s_trackerMagnetHalfZ = 230.0 * units::mm;
106
107 // ── Station envelope from GDML statbox ──────────────────────────────
108 static constexpr auto s_halfX = 3000.0 * units::mm; // 300 cm
109 static constexpr auto s_halfY = 3430.0 * units::mm; // 343 cm (GDML y = 686 cm)
110 static constexpr auto s_halfZ = 500.0 * units::mm; // 50 cm
111
112 // Station Z positions (centres, from origin).
113 static constexpr auto s_station1Z = 84070.0 * units::mm; // 84.07 m
114 static constexpr auto s_station2Z = 86070.0 * units::mm; // 86.07 m
115 static constexpr auto s_station3Z = 93070.0 * units::mm; // 93.07 m
116 static constexpr auto s_station4Z = 95070.0 * units::mm; // 95.07 m
117
118 // Container dimensions (spans all stations).
119 static constexpr auto s_containerHalfZ = (s_station4Z - s_station1Z) / 2.0 + s_halfZ;
120 static constexpr auto s_containerCentreZ = (s_station1Z + s_station4Z) / 2.0;
121
122 static_assert(s_nStraws * 2.0 * s_strawRadius == s_apertureY,
123 "the aperture must hold a whole number of straws");
124 static_assert(s_station1Z + s_halfZ <= s_station2Z - s_halfZ &&
127 "tracker stations must be ordered along z without overlapping");
128
129 private:
130 Materials& m_materials;
131
133 std::string m_frameMaterialName = "Aluminium";
134
135 // ── Internal builders ───────────────────────────────────────────────
136
142 GeoPhysVol* buildStation(int stationIndex);
143
150 GeoPhysVol* buildView(int stationIndex, int viewIndex);
151
157 GeoPhysVol* buildFrame(int stationIndex, int viewIndex);
158
165 GeoPhysVol* buildSubLayer(int stationIndex, int viewIndex, bool shifted);
166
172 GeoPhysVol* buildStraw();
173
175 GeoPhysVol* m_strawPhys = nullptr;
176
184 GeoPhysVol* buildTrackerMagnet();
185};
186
187} // namespace SHiP::geometry
Central material manager for the SHiP detector.
Definition Materials.h:22
static constexpr auto s_apertureX
Active aperture inside a view frame (X = straw length region, Y = pitch).
Definition TrackersFactory.h:79
static constexpr auto s_halfY
Definition TrackersFactory.h:109
static constexpr auto s_halfZ
Definition TrackersFactory.h:110
static constexpr auto s_stereoAngleDeg
|stereo angle| per view
Definition TrackersFactory.h:86
TrackersFactory(Materials &materials)
Definition TrackersFactory.cpp:103
GeoPhysVol * build()
Build the Trackers geometry.
Definition TrackersFactory.cpp:107
static constexpr auto s_wallThickness
30 µm Mylar wall
Definition TrackersFactory.h:76
static constexpr auto s_trackerMagnetZ
centre
Definition TrackersFactory.h:104
static constexpr int s_nStraws
Straws per sub-layer (aperture height / straw diameter).
Definition TrackersFactory.h:83
static constexpr int s_nStations
Definition TrackersFactory.h:70
static constexpr auto s_station1Z
Definition TrackersFactory.h:113
static constexpr auto s_trackerMagnetHalfZ
half-depth
Definition TrackersFactory.h:105
static constexpr auto s_apertureY
Definition TrackersFactory.h:80
static constexpr auto s_station4Z
Definition TrackersFactory.h:116
static constexpr auto s_halfX
Definition TrackersFactory.h:108
static constexpr auto s_containerCentreZ
Definition TrackersFactory.h:120
static constexpr auto s_containerHalfZ
Definition TrackersFactory.h:119
static constexpr int s_nSubLayers
staggered straw layers per view
Definition TrackersFactory.h:72
static constexpr auto s_frameBarY
frame bar width in Y
Definition TrackersFactory.h:90
static constexpr auto s_frameBarX
frame bar width in X
Definition TrackersFactory.h:89
static constexpr auto s_frameHalfZ
frame half-thickness in Z
Definition TrackersFactory.h:91
static constexpr auto s_station3Z
Definition TrackersFactory.h:115
static constexpr auto s_strawRadius
1 cm radius (2 cm diam)
Definition TrackersFactory.h:74
static constexpr SubsystemDescriptor descriptor()
This subsystem's self-description (name, node, id, placement).
Definition TrackersFactory.h:53
static constexpr auto s_station2Z
Definition TrackersFactory.h:114
static constexpr auto s_strawLength
4 m, along X
Definition TrackersFactory.h:75
static constexpr int s_nViews
stereo views per station
Definition TrackersFactory.h:71
constexpr auto deg
Definition Units.h:30
constexpr double ratio(mp_units::quantity< one > q)
Dimensionless quantity -> plain double (counts, growth slopes, and inputs to GeoGenfun / Eigen,...
Definition Units.h:82
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
A subsystem's self-description: everything the assembler needs.
Definition SubsystemDescriptor.h:20