-
Notifications
You must be signed in to change notification settings - Fork 3
fix(decayvolume): derive helium from the SBT surfaces instead of a ha… #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
matclim
wants to merge
5
commits into
ShipSoft:main
Choose a base branch
from
matclim:sbt_fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f17265e
fix(decayvolume): derive helium from the SBT surfaces instead of a ha…
6f31a44
fix(decayvolume): reject sensor_clearance_mm that inverts the container
c9f7d66
fix(decayvolume): single contract for helium_clearance_mm; drop dead …
4d5aec5
docs(decayvolume): rigorous SAT bound, planarity guard, README refresh
caf6024
docs(decayvolume): clarify sbt/ is a name prefix, not a grouping volume
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
subsystems/DecayVolume/include/DecayVolume/SBTEnvelope.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| // SPDX-License-Identifier: LGPL-3.0-or-later | ||
| // Copyright (C) CERN for the benefit of the SHiP Collaboration | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <vector> | ||
|
|
||
| class GeoMaterial; | ||
| class GeoPhysVol; | ||
|
|
||
| namespace SHiPGeometry { | ||
|
|
||
| struct SBTConfig; | ||
|
|
||
| /** | ||
| * @brief The innermost free region of the SBT, and the helium that fills it. | ||
| * | ||
| * The helium decay region must fill the space inside the SBT exactly: it may | ||
| * not protrude into any steel or scintillator, and it may not leave an | ||
| * arbitrary safety margin behind either. That makes its size a *consequence* | ||
| * of where the SBT material is, never an independent parameter. | ||
| * | ||
| * This header therefore derives the helium purely from the placement | ||
| * primitives on SBTConfig — the same ones SBTStructureBuilder and | ||
| * SBTSensorBuilder place their volumes with. Change a placement rule and the | ||
| * helium follows automatically; there is no second copy of the arithmetic to | ||
| * forget to update. | ||
| * | ||
| * Two properties of the SBT make this non-trivial, and both are handled here: | ||
| * | ||
| * - **The X envelope is not linear in Z.** Side containers are split at the | ||
| * column front-flange edge (SBTConfig::zSplitOffset()) and the upstream | ||
| * piece has a *flat* outer face frozen at the sub-frustum's entrance | ||
| * half-width, so it does not clash with the column. The inner surface is | ||
| * therefore a sawtooth, dipping inward by up to xGrowth()*zSplitOffset() | ||
| * relative to the frustum. A single linear GeoTrap cannot follow it. | ||
| * | ||
| * - **The innermost material in Y is steel, not scintillator.** The top and | ||
| * bottom longitudinal beams straddle the scintillator plane and their | ||
| * inner flange hangs *below* it, into the decay region. It sits deeper | ||
| * than the cells by (hbeam_height - flange_thickness) - container_thickness | ||
| * + sensor_clearance, and it — not the scintillator — bounds the helium. | ||
| * | ||
| * Consequently the helium is built as a stack of GeoTraps, two per | ||
| * sub-frustum, each exactly filling the envelope over its Z span. | ||
| */ | ||
|
|
||
| /// One Z slab of the helium: a GeoTrap with rectangular faces at z_lo/z_hi. | ||
| struct HeliumPiece { | ||
| double z_lo_mm = 0.0; | ||
| double z_hi_mm = 0.0; | ||
| double dx_lo_mm = 0.0; ///< half-width in X at z_lo | ||
| double dx_hi_mm = 0.0; ///< half-width in X at z_hi | ||
| double dy_lo_mm = 0.0; ///< half-height in Y at z_lo | ||
| double dy_hi_mm = 0.0; ///< half-height in Y at z_hi | ||
| }; | ||
|
|
||
| /** | ||
| * @brief |X| of the innermost SBT material at @p z_mm (mm). | ||
| * | ||
| * 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. | ||
| */ | ||
| double innerFreeHalfX(const SBTConfig& cfg, double z_mm); | ||
|
|
||
| /** | ||
| * @brief |Y| of the innermost SBT material at @p z_mm (mm). | ||
| * | ||
| * 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. | ||
| */ | ||
| double innerFreeHalfY(const SBTConfig& cfg, double z_mm); | ||
|
|
||
| /** | ||
| * @brief Z values at which innerFreeHalfX/Y change slope. | ||
| * | ||
| * innerFreeHalfX/Y are piecewise linear with knots exactly here, so a linear | ||
| * shape that respects the envelope at these Z values respects it everywhere. | ||
| * The helium slab boundaries are drawn from this list. | ||
| */ | ||
| std::vector<double> envelopeKnots(const SBTConfig& cfg); | ||
|
|
||
| /** | ||
| * @brief The helium slabs filling the SBT interior. | ||
| * | ||
| * Each slab is inset from innerFreeHalfX/Y by cfg.helium_clearance_mm (0 by | ||
| * default: the helium touches the SBT and leaves no margin). | ||
| * | ||
| * @throws std::runtime_error if any slab would have a non-positive half-width, | ||
| * i.e. the configured beams/containers have swallowed the decay region. | ||
| */ | ||
| std::vector<HeliumPiece> heliumPieces(const SBTConfig& cfg); | ||
|
|
||
| /** | ||
| * @brief Place the helium slabs into @p container. | ||
| * | ||
| * Mirrors SBTStructureBuilder / SBTSensorBuilder: takes an SBTConfig and nothing | ||
| * else, so the geometry can be built (and swept) without going through sbt.toml. | ||
| * Call it *after* the two builders — the helium is a consequence of them. | ||
| */ | ||
| void buildHelium(GeoPhysVol* container, const GeoMaterial* helium, const SBTConfig& cfg); | ||
|
|
||
| } // namespace SHiPGeometry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.