72 return std::clamp(
static_cast<int>(f), 0, params.nSubFrustum - 1);
130 return std::min(sensor, beam);
147 if (i >= 2 * params.nSubFrustum) {
148 return zExit(params);
166 constexpr auto kEps = 1e-6 *
mm;
167 const LengthMm lo = std::max(z - kEps, params.zEntrance);
224 for (
int i = 0; i < 2 * params.nSubFrustum; ++i) {
246 for (
int i = 0; i < 2 *
kSBT.nSubFrustum; ++i) {
255 "the configured SBT leaves no decay region — check containerThickness, "
256 "hbeamHeight, nSubFrustum and heliumClearance");
269 std::array<HeliumPiece, 2u * kMaxSubFrustum>
pieces{};
272 [[nodiscard]]
constexpr std::span<const HeliumPiece>
view()
const {
282 if (params.nSubFrustum <= 0 || params.nSubFrustum >
kMaxSubFrustum) {
285 slabs.
count = 2u *
static_cast<std::size_t
>(params.nSubFrustum);
286 for (std::size_t i = 0; i < slabs.
count; ++i) {
306void buildHelium(GeoPhysVol* container,
const GeoMaterial* helium,
Definition LinkSubsystems.h:6
constexpr LengthMm sideTrackedXHalf(LengthMm z, const SBTParams ¶ms=kSBT)
Definition SBTEnvelope.h:79
constexpr LengthMm knotAt(int i, const SBTParams ¶ms=kSBT)
Z of envelope knot i, for 0 <= i <= 2*nSubFrustum.
Definition SBTEnvelope.h:146
constexpr int subFrustumAt(LengthMm z, const SBTParams ¶ms=kSBT)
Definition SBTEnvelope.h:70
constexpr LengthMm envelopeAtKnot(LengthMm z, bool isX, const SBTParams ¶ms=kSBT)
Definition SBTEnvelope.h:165
Compile-time parameters of the Surround Background Tagger (SBT).
Definition SBTConstants.h:19
constexpr SBTParams kSBT
The shipped SBT.
Definition SBTConstants.h:79
constexpr LengthMm subLength(const SBTParams ¶ms=kSBT)
Length of one sub-frustum along Z.
Definition SBTConstants.h:107
constexpr LengthMm yHalfAt(LengthMm z, const SBTParams ¶ms=kSBT)
Half-extent of the frustum envelope in Y at a given Z.
Definition SBTConstants.h:137
constexpr bool leavesDecayRegion(const SBTParams ¶ms=kSBT)
Does params leave a decay region for the helium to fill?
Definition SBTEnvelope.h:220
void buildHelium(GeoPhysVol *container, const GeoMaterial *helium, std::span< const HeliumPiece > pieces=kHeliumPieces)
Place helium slabs into container.
Definition SBTEnvelope.cpp:20
constexpr LengthMm zSubLo(int s, const SBTParams ¶ms=kSBT)
Z of the start of sub-frustum s.
Definition SBTConstants.h:141
constexpr LengthMm innerFreeHalfX(LengthMm z, const SBTParams ¶ms=kSBT)
|X| of the innermost SBT material at z.
Definition SBTEnvelope.h:97
constexpr HeliumSlabs heliumSlabs(const SBTParams ¶ms=kSBT)
The helium stack for arbitrary params.
Definition SBTEnvelope.h:280
constexpr HeliumPiece heliumPieceAt(int i, const SBTParams ¶ms=kSBT)
Helium slab i, for 0 <= i < 2*nSubFrustum.
Definition SBTEnvelope.h:185
constexpr bool isWellFormed(const SBTParams ¶ms=kSBT)
Are params self-consistent, before asking whether they leave a decay region?
Definition SBTConstants.h:279
constexpr auto kHeliumPieces
The helium slabs of the shipped SBT.
Definition SBTEnvelope.h:244
constexpr int kMaxSubFrustum
Definition SBTEnvelope.h:265
constexpr LengthMm zExit(const SBTParams ¶ms=kSBT)
Exit-face Z in the DecayVolume local frame.
Definition SBTConstants.h:121
constexpr LengthMm xHalfAt(LengthMm z, const SBTParams ¶ms=kSBT)
Half-extent of the frustum envelope in X at a given Z.
Definition SBTConstants.h:133
constexpr LengthMm zSplitOffset(const SBTParams ¶ms=kSBT)
Z offset, from the start of a sub-frustum, of the column front-flange outer edge.
Definition SBTConstants.h:168
constexpr auto mm
Definition Units.h:27
constexpr LengthMm longBeamInnerY(LengthMm yHalf, const SBTParams ¶ms=kSBT)
|Y| reached by a longitudinal beam's inner flange surface.
Definition SBTConstants.h:265
constexpr LengthMm topBottomSensorInnerY(LengthMm yHalf, const SBTParams ¶ms=kSBT)
|Y| of a top/bottom container's innermost face.
Definition SBTConstants.h:196
constexpr LengthMm innerFreeHalfY(LengthMm z, const SBTParams ¶ms=kSBT)
|Y| of the innermost SBT material at z.
Definition SBTEnvelope.h:111
constexpr LengthMm sideSensorInnerX(LengthMm xHalf, const SBTParams ¶ms=kSBT)
|X| of a side container's innermost face.
Definition SBTConstants.h:182
mp_units::quantity< mm > LengthMm
Spellings for struct members and function parameters.
Definition Units.h:39
constexpr double ratio(mp_units::quantity< one > q)
Dimensionless quantity -> plain double (counts, growth slopes, and inputs to GeoGenfun / Eigen,...
Definition Units.h:82
The innermost free region of the SBT, and the helium that fills it.
Definition SBTEnvelope.h:53
LengthMm dx_lo
half-width in X at z_lo
Definition SBTEnvelope.h:56
LengthMm dy_hi
half-height in Y at z_hi
Definition SBTEnvelope.h:59
LengthMm dx_hi
half-width in X at z_hi
Definition SBTEnvelope.h:57
LengthMm dy_lo
half-height in Y at z_lo
Definition SBTEnvelope.h:58
LengthMm z_lo
Definition SBTEnvelope.h:54
LengthMm z_hi
Definition SBTEnvelope.h:55
Definition SBTEnvelope.h:268
std::array< HeliumPiece, 2u *kMaxSubFrustum > pieces
Definition SBTEnvelope.h:269
std::size_t count
Definition SBTEnvelope.h:270
constexpr std::span< const HeliumPiece > view() const
A view of the filled prefix. Borrows from *this — keep it alive.
Definition SBTEnvelope.h:272
Every dimension the SBT geometry is parameterised by.
Definition SBTConstants.h:37