SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
Loading...
Searching...
No Matches
Functions
SHiPGeometry::SBT::detail Namespace Reference

Functions

constexpr double sqrtConst (double v)
 Square root of v, usable in a constant expression.
 
constexpr double longBeamTaper (const SBTParams &params=kSBT)
 Taper factor of a top/bottom longitudinal beam, 1/cos(atan(yGrowth)).
 
constexpr int subFrustumAt (double z_mm, const SBTParams &params=kSBT)
 
constexpr double sideTrackedXHalf (double z_mm, const SBTParams &params=kSBT)
 
constexpr double knotAt (int i, const SBTParams &params=kSBT)
 Z of envelope knot i, for 0 <= i <= 2*nSubFrustum.
 
constexpr double envelopeAtKnot (double z_mm, bool isX, const SBTParams &params=kSBT)
 

Function Documentation

◆ envelopeAtKnot()

constexpr double SHiPGeometry::SBT::detail::envelopeAtKnot ( double  z_mm,
bool  isX,
const SBTParams &  params = kSBT 
)
constexpr

◆ knotAt()

constexpr double SHiPGeometry::SBT::detail::knotAt ( int  i,
const SBTParams &  params = kSBT 
)
constexpr

Z of envelope knot i, for 0 <= i <= 2*nSubFrustum.

innerFreeHalfX/Y are piecewise linear and change slope exactly here — at each sub-frustum boundary, and at the end of each sub-frustum's flat piece — so a linear shape that respects the envelope at these Z values respects it everywhere. The helium slab boundaries are drawn from them.

Indexed rather than tabulated because the table's type would carry nSubFrustum, and nothing outside this header ever read the table.

◆ longBeamTaper()

constexpr double SHiPGeometry::SBT::detail::longBeamTaper ( const SBTParams &  params = kSBT)
constexpr

Taper factor of a top/bottom longitudinal beam, 1/cos(atan(yGrowth)).

◆ sideTrackedXHalf()

constexpr double SHiPGeometry::SBT::detail::sideTrackedXHalf ( double  z_mm,
const SBTParams &  params = kSBT 
)
constexpr

◆ sqrtConst()

constexpr double SHiPGeometry::SBT::detail::sqrtConst ( double  v)
constexpr

Square root of v, usable in a constant expression.

std::sqrt is not: folding it at compile time is a GCC extension that Clang does not implement, and C++26's P1383R2 has not reached libstdc++ yet. A std::sqrt here therefore kept this whole header from compiling under Clang, and so from being analysed by clang-tidy. Newton-Raphson to a fixpoint sidesteps the question.

This is not a correctly-rounded general-purpose sqrt: the initial guess suits arguments near 1, and the iteration is capped in case it settles into a two-value cycle instead of a fixpoint. Every argument the SBT evaluates is a taper factor 1 + g^2 with |g| well under 1, including the steeper tapers test_decayvolume sweeps; the shipped one is checked against std::sqrt in test_decayvolume. Do not reach for it elsewhere.

◆ subFrustumAt()

constexpr int SHiPGeometry::SBT::detail::subFrustumAt ( double  z_mm,
const SBTParams &  params = kSBT 
)
constexpr