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

Compile-time parameters of the Surround Background Tagger (SBT). More...

Namespaces

namespace  detail

Classes

struct  SBTParams
 Every dimension the SBT geometry is parameterised by. More...
struct  HeliumPiece
 The innermost free region of the SBT, and the helium that fills it. More...
struct  HeliumSlabs

Typedefs

using LengthMm
 Spellings for struct members and function parameters.

Functions

constexpr LengthMm subLength (const SBTParams &params=kSBT)
 Length of one sub-frustum along Z.
constexpr LengthMm webHeight (const SBTParams &params=kSBT)
 Clear web height = height - 2*flange thickness.
constexpr int nWalls (const SBTParams &params=kSBT)
 Number of aluminium walls per container (nCells + 1).
constexpr LengthMm zExit (const SBTParams &params=kSBT)
 Exit-face Z in the DecayVolume local frame.
constexpr double xGrowth (const SBTParams &params=kSBT)
 dx_half/dz of the frustum (dimensionless).
constexpr double yGrowth (const SBTParams &params=kSBT)
 dy_half/dz of the frustum (dimensionless).
constexpr LengthMm xHalfAt (LengthMm z, const SBTParams &params=kSBT)
 Half-extent of the frustum envelope in X at a given Z.
constexpr LengthMm yHalfAt (LengthMm z, const SBTParams &params=kSBT)
 Half-extent of the frustum envelope in Y at a given Z.
constexpr LengthMm zSubLo (int s, const SBTParams &params=kSBT)
 Z of the start of sub-frustum s.
constexpr LengthMm hbeamFlangeOffset (const SBTParams &params=kSBT)
 Offset of a flange's mid-plane from the beam axis.
constexpr LengthMm hbeamHalfHeight (const SBTParams &params=kSBT)
 Reach of a flange's outer surface from the beam axis = h/2.
constexpr LengthMm zSplitOffset (const SBTParams &params=kSBT)
 Z offset, from the start of a sub-frustum, of the column front-flange outer edge.
constexpr LengthMm sideContainerHalfThickness (const SBTParams &params=kSBT)
 Half-thickness of a side container in X.
constexpr LengthMm sideContainerCentreX (LengthMm xHalf, const SBTParams &params=kSBT)
 |X| of a side container's centroid, given the local frustum half-width.
constexpr LengthMm sideSensorInnerX (LengthMm xHalf, const SBTParams &params=kSBT)
 |X| of a side container's innermost face.
constexpr LengthMm topBottomContainerHalfThickness (const SBTParams &params=kSBT)
 Half-thickness of a top/bottom container in Y.
constexpr LengthMm topBottomContainerCentreY (LengthMm yHalf, const SBTParams &params=kSBT)
 |Y| of a top/bottom container's centroid.
constexpr LengthMm topBottomSensorInnerY (LengthMm yHalf, const SBTParams &params=kSBT)
 |Y| of a top/bottom container's innermost face.
constexpr LengthMm topBottomAvailX (LengthMm xHalf, const SBTParams &params=kSBT)
 Half-extent in X available to top/bottom containers.
constexpr LengthMm longBeamCentreY (LengthMm yHalf, const SBTParams &params=kSBT)
 |Y| of a top/bottom longitudinal beam's axis.
constexpr LengthMm longBeamInnerY (LengthMm yHalf, const SBTParams &params=kSBT)
 |Y| reached by a longitudinal beam's inner flange surface.
constexpr bool isWellFormed (const SBTParams &params=kSBT)
 Are params self-consistent, before asking whether they leave a decay region?
constexpr LengthMm innerFreeHalfX (LengthMm z, const SBTParams &params=kSBT)
 |X| of the innermost SBT material at z.
constexpr LengthMm innerFreeHalfY (LengthMm z, const SBTParams &params=kSBT)
 |Y| of the innermost SBT material at z.
constexpr HeliumPiece heliumPieceAt (int i, const SBTParams &params=kSBT)
 Helium slab i, for 0 <= i < 2*nSubFrustum.
constexpr bool leavesDecayRegion (const SBTParams &params=kSBT)
 Does params leave a decay region for the helium to fill?
constexpr HeliumSlabs heliumSlabs (const SBTParams &params=kSBT)
 The helium stack for arbitrary params.
void buildHelium (GeoPhysVol *container, const GeoMaterial *helium, std::span< const HeliumPiece > pieces=kHeliumPieces)
 Place helium slabs into container.
template<auto U, typename Rep>
requires (U == mm || U == cm || U == m)
constexpr double gm (mp_units::quantity< U, Rep > q)
 Length quantity -> GeoModel raw double (GeoModel native unit: mm).

Variables

constexpr SBTParams kSBT {}
 The shipped SBT.
constexpr auto kEnvelopeHalfX = 2200.0 * mm
constexpr auto kEnvelopeHalfY = 3300.0 * mm
constexpr auto kEnvelopeHalfZ = 25200.0 * mm
constexpr std::string_view kAirMaterial = "Air"
constexpr std::string_view kSteelMaterial = "Iron"
constexpr std::string_view kWallMaterial = "Aluminium"
constexpr std::string_view kScintillatorMaterial = "LAB"
constexpr std::string_view kHeliumMaterial = "PressurisedHe90"
constexpr auto kHeliumPieces
 The helium slabs of the shipped SBT.
constexpr int kMaxSubFrustum = 64
constexpr auto mm

Detailed Description

Compile-time parameters of the Surround Background Tagger (SBT).

Drives the steel H-beam supporting structure, the LAB scintillator sensor containers, and the central helium volume of the DecayVolume subsystem. All lengths are mp-units quantities in mm. The invariants of these constants are static_asserts at the bottom of this header.

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

◆ buildHelium()

void SHiP::geometry::sbt::buildHelium ( GeoPhysVol * container,
const GeoMaterial * helium,
std::span< const HeliumPiece > pieces = kHeliumPieces )

Place helium slabs into container.

Call it after SBTStructureBuilder / SBTSensorBuilder — the helium is a consequence of them.

Takes the slabs, not the parameters, and that is deliberate: defaulting to the constexpr kHeliumPieces makes "the shipped geometry is byte-identical" a property of the signature rather than of the optimiser. Deriving the slabs here from an SBTParams would move the arithmetic to run time, where -ffp-contract=fast (GCC's C++ default) may contract a + (z - b) * c into an FMA; constant evaluation never contracts. It would look like a tidy-up and would shift the helium by a ULP.

◆ gm()

template<auto U, typename Rep>
requires (U == mm || U == cm || U == m)
double SHiP::geometry::units::gm ( mp_units::quantity< U, Rep > q)
nodiscardconstexpr

Length quantity -> GeoModel raw double (GeoModel native unit: mm).

◆ hbeamFlangeOffset()

LengthMm SHiP::geometry::sbt::hbeamFlangeOffset ( const SBTParams & params = kSBT)
constexpr

Offset of a flange's mid-plane from the beam axis.

◆ hbeamHalfHeight()

LengthMm SHiP::geometry::sbt::hbeamHalfHeight ( const SBTParams & params = kSBT)
constexpr

Reach of a flange's outer surface from the beam axis = h/2.

◆ heliumPieceAt()

HeliumPiece SHiP::geometry::sbt::heliumPieceAt ( int i,
const SBTParams & params = kSBT )
constexpr

Helium slab i, for 0 <= i < 2*nSubFrustum.

Each slab is inset from innerFreeHalfX/Y by params.heliumClearance and spans one envelope segment (two per sub-frustum).

This is the single definition of the helium. kHeliumPieces is this function tabulated for kSBT; leavesDecayRegion() walks it without tabulating, which is what lets it answer for an nSubFrustum no array could hold.

◆ heliumSlabs()

HeliumSlabs SHiP::geometry::sbt::heliumSlabs ( const SBTParams & params = kSBT)
constexpr

The helium stack for arbitrary params.

A count of 0 means the request was out of range (nSubFrustum outside 1..kMaxSubFrustum); ask leavesDecayRegion() whether a configuration is buildable at all.

◆ innerFreeHalfX()

LengthMm SHiP::geometry::sbt::innerFreeHalfX ( LengthMm z,
const SBTParams & params = kSBT )
constexpr

|X| of the innermost SBT material at z.

Minimum over every volume class that can reach the decay region in X. Currently only the side scintillator containers do; the columns and corner beams sit a further half-flange-width outboard.

◆ innerFreeHalfY()

LengthMm SHiP::geometry::sbt::innerFreeHalfY ( LengthMm z,
const SBTParams & params = kSBT )
constexpr

|Y| of the innermost SBT material at z.

Minimum over every volume class that can reach the decay region in Y: the top/bottom scintillator containers and the inner flange of the top/bottom longitudinal beams, which is the binding one.

◆ isWellFormed()

bool SHiP::geometry::sbt::isWellFormed ( const SBTParams & params = kSBT)
constexpr

Are params self-consistent, before asking whether they leave a decay region?

Every dimension positive, the helium clearance non-negative, the sensor clearance under half a container thickness and the flanges under half the beam height. leavesDecayRegion() and both builders check it.

◆ leavesDecayRegion()

bool SHiP::geometry::sbt::leavesDecayRegion ( const SBTParams & params = kSBT)
constexpr

Does params leave a decay region for the helium to fill?

False if params are not well formed (isWellFormed() in SBTConstants.h: a non-positive dimension, a negative clearance, containers or beams that come out inside out), or if the beams, containers or clearances have swallowed the frustum. The latter happens in three ways, all covered here:

  • a slab has non-positive half-width (containers wider than the frustum);
  • two knots cross, i.e. a sub-frustum is shorter than the sensors' flat piece — knotAt(2s+1) = zSubLo(s) + zSplitOffset() then overshoots knotAt(2s+2) = zSubLo(s+1), so the slab between them is inverted. This subsumes the zSplitOffset() < subLength() assertion in SBTConstants.h, which is kept only because its message is more specific and because it also constrains SBTSensorBuilder;
  • a negative clearance, which puts the helium inside the SBT by construction and cannot be caught by a degeneracy test — it makes the slabs larger.

Used by the static_assert below for the shipped parameters, and by test_decayvolume for the configurations that must not build.

◆ longBeamCentreY()

LengthMm SHiP::geometry::sbt::longBeamCentreY ( LengthMm yHalf,
const SBTParams & params = kSBT )
constexpr

|Y| of a top/bottom longitudinal beam's axis.

◆ longBeamInnerY()

LengthMm SHiP::geometry::sbt::longBeamInnerY ( LengthMm yHalf,
const SBTParams & params = kSBT )
constexpr

|Y| reached by a longitudinal beam's inner flange surface.

The beam is inclined by the frustum taper, so its cross-section is rotated: the flange surface lies hbeamHalfHeight()/cos(atan(yGrowth)) from the axis measured in world Y, not hbeamHalfHeight().

◆ nWalls()

int SHiP::geometry::sbt::nWalls ( const SBTParams & params = kSBT)
constexpr

Number of aluminium walls per container (nCells + 1).

◆ sideContainerCentreX()

LengthMm SHiP::geometry::sbt::sideContainerCentreX ( LengthMm xHalf,
const SBTParams & params = kSBT )
constexpr

|X| of a side container's centroid, given the local frustum half-width.

◆ sideContainerHalfThickness()

LengthMm SHiP::geometry::sbt::sideContainerHalfThickness ( const SBTParams & params = kSBT)
constexpr

Half-thickness of a side container in X.

◆ sideSensorInnerX()

LengthMm SHiP::geometry::sbt::sideSensorInnerX ( LengthMm xHalf,
const SBTParams & params = kSBT )
constexpr

|X| of a side container's innermost face.

◆ subLength()

LengthMm SHiP::geometry::sbt::subLength ( const SBTParams & params = kSBT)
constexpr

Length of one sub-frustum along Z.

◆ topBottomAvailX()

LengthMm SHiP::geometry::sbt::topBottomAvailX ( LengthMm xHalf,
const SBTParams & params = kSBT )
constexpr

Half-extent in X available to top/bottom containers.

The container stops half a flange width short of the frustum wall (that is where the columns' inner face is), less a 1 mm gap so it does not land flush against them. The 1 mm is inherited from the original SBTSensorBuilder and is a literal, not sensorClearance — the two happen to be equal at the current settings, which is worth being aware of when changing sensorClearance, but they are not the same quantity and this one is deliberately left as-is.

◆ topBottomContainerCentreY()

LengthMm SHiP::geometry::sbt::topBottomContainerCentreY ( LengthMm yHalf,
const SBTParams & params = kSBT )
constexpr

|Y| of a top/bottom container's centroid.

◆ topBottomContainerHalfThickness()

LengthMm SHiP::geometry::sbt::topBottomContainerHalfThickness ( const SBTParams & params = kSBT)
constexpr

Half-thickness of a top/bottom container in Y.

◆ topBottomSensorInnerY()

LengthMm SHiP::geometry::sbt::topBottomSensorInnerY ( LengthMm yHalf,
const SBTParams & params = kSBT )
constexpr

|Y| of a top/bottom container's innermost face.

◆ webHeight()

LengthMm SHiP::geometry::sbt::webHeight ( const SBTParams & params = kSBT)
constexpr

Clear web height = height - 2*flange thickness.

◆ xGrowth()

double SHiP::geometry::sbt::xGrowth ( const SBTParams & params = kSBT)
constexpr

dx_half/dz of the frustum (dimensionless).

◆ xHalfAt()

LengthMm SHiP::geometry::sbt::xHalfAt ( LengthMm z,
const SBTParams & params = kSBT )
constexpr

Half-extent of the frustum envelope in X at a given Z.

◆ yGrowth()

double SHiP::geometry::sbt::yGrowth ( const SBTParams & params = kSBT)
constexpr

dy_half/dz of the frustum (dimensionless).

◆ yHalfAt()

LengthMm SHiP::geometry::sbt::yHalfAt ( LengthMm z,
const SBTParams & params = kSBT )
constexpr

Half-extent of the frustum envelope in Y at a given Z.

◆ zExit()

LengthMm SHiP::geometry::sbt::zExit ( const SBTParams & params = kSBT)
constexpr

Exit-face Z in the DecayVolume local frame.

◆ zSplitOffset()

LengthMm SHiP::geometry::sbt::zSplitOffset ( const SBTParams & params = kSBT)
constexpr

Z offset, from the start of a sub-frustum, of the column front-flange outer edge.

Sensor containers are split here: the piece upstream of it must present a flat outer face, or it would eat into the column.

◆ zSubLo()

LengthMm SHiP::geometry::sbt::zSubLo ( int s,
const SBTParams & params = kSBT )
constexpr

Z of the start of sub-frustum s.

Variable Documentation

◆ kAirMaterial

std::string_view SHiP::geometry::sbt::kAirMaterial = "Air"
inlineconstexpr

◆ kEnvelopeHalfX

auto SHiP::geometry::sbt::kEnvelopeHalfX = 2200.0 * mm
inlineconstexpr

◆ kEnvelopeHalfY

auto SHiP::geometry::sbt::kEnvelopeHalfY = 3300.0 * mm
inlineconstexpr

◆ kEnvelopeHalfZ

auto SHiP::geometry::sbt::kEnvelopeHalfZ = 25200.0 * mm
inlineconstexpr

◆ kHeliumMaterial

std::string_view SHiP::geometry::sbt::kHeliumMaterial = "PressurisedHe90"
inlineconstexpr

◆ kHeliumPieces

auto SHiP::geometry::sbt::kHeliumPieces
inlineconstexpr
Initial value:
= [] {
std::array<HeliumPiece, 2 * kSBT.nSubFrustum> pieces{};
for (int i = 0; i < 2 * kSBT.nSubFrustum; ++i) {
pieces[static_cast<std::size_t>(i)] = heliumPieceAt(i, kSBT);
}
return pieces;
}()
constexpr SBTParams kSBT
The shipped SBT.
Definition SBTConstants.h:79
constexpr HeliumPiece heliumPieceAt(int i, const SBTParams &params=kSBT)
Helium slab i, for 0 <= i < 2*nSubFrustum.
Definition SBTEnvelope.h:185
The innermost free region of the SBT, and the helium that fills it.
Definition SBTEnvelope.h:53

The helium slabs of the shipped SBT.

Exactly sized, and the only stack the geometry ever builds: buildHelium() defaults to it so that nothing on the production path re-derives the helium at run time (see the note on buildHelium).

◆ kMaxSubFrustum

int SHiP::geometry::sbt::kMaxSubFrustum = 64
inlineconstexpr

◆ kSBT

SBTParams SHiP::geometry::sbt::kSBT {}
inlineconstexpr

The shipped SBT.

Every primitive below defaults to it, so a call site that does not care about parameterisation reads exactly as it did when these were loose constants.

inline is load-bearing, not decoration: at namespace scope constexpr implies const implies internal linkage, and without inline every translation unit would get its own kSBT — which the inline functions naming it in their default arguments would then quietly violate the ODR over ([basic.def.odr]/14, no diagnostic required).

◆ kScintillatorMaterial

std::string_view SHiP::geometry::sbt::kScintillatorMaterial = "LAB"
inlineconstexpr

◆ kSteelMaterial

std::string_view SHiP::geometry::sbt::kSteelMaterial = "Iron"
inlineconstexpr

◆ kWallMaterial

std::string_view SHiP::geometry::sbt::kWallMaterial = "Aluminium"
inlineconstexpr

◆ mm

auto SHiP::geometry::units::mm
inlineconstexpr