SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
Loading...
Searching...
No Matches
SBTConfig.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
6#include <cmath>
7#include <string>
8
9namespace SHiPGeometry {
10
18struct SBTConfig {
19 // ── Frustum envelope ────────────────────────────────────────────────
20 double x_half_entrance_mm = 1000.0;
21 double y_half_entrance_mm = 1500.0;
22 double x_half_exit_mm = 2000.0;
23 double y_half_exit_mm = 3000.0;
24 double total_length_mm = 50000.0;
25 int n_sub_frustum = 10;
26 double y_floor_mm = -3000.0;
27 double z_entrance_mm = -25000.0;
28
29 // ── H-beam cross-section (HEA 260 approximation) ────────────────────
30 double hbeam_height_mm = 250.0;
31 double hbeam_flange_width_mm = 260.0;
34
35 // ── Sensor containers / cells ───────────────────────────────────────
36 double container_thickness_mm = 225.0;
37 double wall_thickness_mm = 5.0;
38 int n_cells = 6;
39 double sensor_clearance_mm = 1.0;
40
41 // ── Helium decay region ─────────────────────────────────────────────
42 // Gap left between the helium and the innermost SBT material, measured along
43 // the coordinate axis. Must be >= 0; SBTEnvelope enforces that and is the
44 // only consumer. It is not a safety margin — the default of 1 um is simply
45 // enough to stop the helium and the SBT sharing a surface, which Geant4's
46 // navigator handles badly. 0 is legal and gives exact face-to-face contact.
47 // NOTE: this default must track sbt.toml.
48 double helium_clearance_mm = 0.001;
49
50 // ── Material names (resolved from SHiPMaterials) ────────────────────
51 std::string material_steel = "Iron";
52 std::string material_wall = "Aluminium";
53 std::string material_cell = "LAB";
54 std::string material_helium = "PressurisedHe90";
55 std::string material_air = "Air";
56
57 // ── Derived quantities ──────────────────────────────────────────────
59 double subLength() const { return total_length_mm / n_sub_frustum; }
61 double webHeight() const { return hbeam_height_mm - 2.0 * hbeam_flange_thickness_mm; }
63 int nWalls() const { return n_cells + 1; }
64
65 // ── Frustum profile ─────────────────────────────────────────────────
67 double zExit() const { return z_entrance_mm + total_length_mm; }
73 double xHalfAt(double z_mm) const {
74 return x_half_entrance_mm + (z_mm - z_entrance_mm) * xGrowth();
75 }
77 double yHalfAt(double z_mm) const {
78 return y_half_entrance_mm + (z_mm - z_entrance_mm) * yGrowth();
79 }
81 double zSubLo(int s) const { return z_entrance_mm + s * subLength(); }
82
83 // ── H-beam cross-section primitives ─────────────────────────────────
85 double hbeamFlangeOffset() const {
86 return 0.5 * hbeam_height_mm - 0.5 * hbeam_flange_thickness_mm;
87 }
89 double hbeamHalfHeight() const { return 0.5 * hbeam_height_mm; }
90
91 // ══════════════════════════════════════════════════════════════════════
92 // PLACEMENT PRIMITIVES — the single source of truth.
93 //
94 // These are THE definitions of where SBT material sits. Both builders
95 // place volumes with them, and SBTEnvelope derives the helium inner
96 // envelope from them, so a change to any rule below propagates to the
97 // helium automatically and the two can never drift apart.
98 // Do not open-code these expressions anywhere else.
99 // ══════════════════════════════════════════════════════════════════════
100
104 double zSplitOffset() const { return 0.5 * hbeam_height_mm + 0.5 * hbeam_flange_thickness_mm; }
105
106 // --- Side (±X) scintillator containers -------------------------------
108 double sideContainerHalfThickness() const { return 0.5 * container_thickness_mm; }
110 double sideContainerCentreX(double x_half_mm) const {
111 return x_half_mm - 0.5 * hbeam_flange_width_mm - sideContainerHalfThickness();
112 }
114 double sideSensorInnerX(double x_half_mm) const {
116 }
117
118 // --- Top/bottom (±Y) scintillator containers -------------------------
124 double topBottomContainerCentreY(double y_half_mm) const {
125 return y_half_mm - 0.5 * container_thickness_mm;
126 }
128 double topBottomSensorInnerY(double y_half_mm) const {
130 }
140 double topBottomAvailX(double x_half_mm) const {
141 return x_half_mm - 0.5 * hbeam_flange_width_mm - 1.0;
142 }
143
144 // --- Top/bottom longitudinal beams -----------------------------------
145 // NOTE: these beams *straddle* the scintillator plane — the outer flange
146 // sits above it, the web is omitted (it would pass through the cells),
147 // and the INNER FLANGE HANGS BELOW IT, INSIDE THE DECAY REGION. It, not
148 // the scintillator, is the innermost material in ±Y.
150 double longBeamCentreY(double y_half_mm) const { return y_half_mm - 0.5 * webHeight(); }
156 double longBeamInnerY(double y_half_mm) const {
157 const double g = yGrowth();
158 return longBeamCentreY(y_half_mm) - hbeamHalfHeight() * std::sqrt(1.0 + g * g);
159 }
160};
161
170SBTConfig readSBTConfig(const std::string& path);
171
172} // namespace SHiPGeometry
Definition ConfigPath.h:9
SBTConfig readSBTConfig(const std::string &path)
Parse an sbt.toml file and return an SBTConfig.
Definition SBTConfig.cpp:115
Configuration for the Surround Background Tagger (SBT) geometry.
Definition SBTConfig.h:18
int n_sub_frustum
Definition SBTConfig.h:25
double topBottomContainerHalfThickness() const
Half-thickness of a top/bottom container in Y (mm).
Definition SBTConfig.h:120
double z_entrance_mm
Definition SBTConfig.h:27
double hbeamFlangeOffset() const
Offset of a flange's mid-plane from the beam axis (mm).
Definition SBTConfig.h:85
double sideContainerCentreX(double x_half_mm) const
|X| of a side container's centroid, given the local frustum half-width.
Definition SBTConfig.h:110
std::string material_steel
Definition SBTConfig.h:51
int nWalls() const
Number of aluminium walls per container (n_cells + 1).
Definition SBTConfig.h:63
std::string material_wall
Definition SBTConfig.h:52
double hbeamHalfHeight() const
Reach of a flange's outer surface from the beam axis (mm) = h/2.
Definition SBTConfig.h:89
double sensor_clearance_mm
Definition SBTConfig.h:39
double total_length_mm
Definition SBTConfig.h:24
double yHalfAt(double z_mm) const
Half-extent of the frustum envelope in Y at a given Z (mm).
Definition SBTConfig.h:77
double zExit() const
Exit-face Z in the DecayVolume local frame (mm).
Definition SBTConfig.h:67
double hbeam_flange_thickness_mm
Definition SBTConfig.h:32
double topBottomSensorInnerY(double y_half_mm) const
|Y| of a top/bottom container's innermost face (mm).
Definition SBTConfig.h:128
double subLength() const
Length of one sub-frustum along Z (mm).
Definition SBTConfig.h:59
double y_half_entrance_mm
Definition SBTConfig.h:21
double container_thickness_mm
Definition SBTConfig.h:36
std::string material_helium
Definition SBTConfig.h:54
double xGrowth() const
dx_half/dz of the frustum (dimensionless).
Definition SBTConfig.h:69
double y_half_exit_mm
Definition SBTConfig.h:23
double yGrowth() const
dy_half/dz of the frustum (dimensionless).
Definition SBTConfig.h:71
double zSplitOffset() const
Z offset, from the start of a sub-frustum, of the column front-flange outer edge.
Definition SBTConfig.h:104
std::string material_cell
Definition SBTConfig.h:53
double topBottomContainerCentreY(double y_half_mm) const
|Y| of a top/bottom container's centroid (mm).
Definition SBTConfig.h:124
double x_half_entrance_mm
Definition SBTConfig.h:20
double webHeight() const
Clear web height = height - 2*flange thickness (mm).
Definition SBTConfig.h:61
std::string material_air
Definition SBTConfig.h:55
double topBottomAvailX(double x_half_mm) const
Half-extent in X available to top/bottom containers (mm).
Definition SBTConfig.h:140
double sideSensorInnerX(double x_half_mm) const
|X| of a side container's innermost face (mm).
Definition SBTConfig.h:114
double helium_clearance_mm
Definition SBTConfig.h:48
double y_floor_mm
Definition SBTConfig.h:26
double x_half_exit_mm
Definition SBTConfig.h:22
double hbeam_flange_width_mm
Definition SBTConfig.h:31
double sideContainerHalfThickness() const
Half-thickness of a side container in X (mm).
Definition SBTConfig.h:108
double hbeam_height_mm
Definition SBTConfig.h:30
double xHalfAt(double z_mm) const
Half-extent of the frustum envelope in X at a given Z (mm).
Definition SBTConfig.h:73
double longBeamInnerY(double y_half_mm) const
|Y| reached by a longitudinal beam's inner flange surface (mm).
Definition SBTConfig.h:156
int n_cells
Definition SBTConfig.h:38
double zSubLo(int s) const
Z of the start of sub-frustum s (mm).
Definition SBTConfig.h:81
double longBeamCentreY(double y_half_mm) const
|Y| of a top/bottom longitudinal beam's axis (mm).
Definition SBTConfig.h:150
double hbeam_web_thickness_mm
Definition SBTConfig.h:33
double wall_thickness_mm
Definition SBTConfig.h:37