|
SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
|
Functions | |
| constexpr double | sqrtConst (double v) |
Square root of v, usable in a constant expression. | |
| constexpr double | longBeamTaper (const SBTParams ¶ms=kSBT) |
| Taper factor of a top/bottom longitudinal beam, 1/cos(atan(yGrowth)). | |
| constexpr int | subFrustumAt (double z_mm, const SBTParams ¶ms=kSBT) |
| constexpr double | sideTrackedXHalf (double z_mm, const SBTParams ¶ms=kSBT) |
| constexpr double | knotAt (int i, const SBTParams ¶ms=kSBT) |
Z of envelope knot i, for 0 <= i <= 2*nSubFrustum. | |
| constexpr double | envelopeAtKnot (double z_mm, bool isX, const SBTParams ¶ms=kSBT) |
|
constexpr |
|
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.
|
constexpr |
Taper factor of a top/bottom longitudinal beam, 1/cos(atan(yGrowth)).
|
constexpr |
|
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.