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

Namespaces

namespace  envelopes
 Reference subsystem envelopes, for compile-time placement checks.
namespace  layout
 Where each subsystem container sits in the world volume.
namespace  checks
 Constexpr predicates for compile-time geometry consistency checks.
namespace  units
 Typed-unit vocabulary for the SHiP geometry.
namespace  detail
namespace  calo_bar
 Places an array of identical scintillator bars into a mother volume.
namespace  calo_fibre_hp
 Builds one Hadronic Pre-shower Layer (HPL) of scintillating fibres.
namespace  calo
 Compile-time parameters of the SHiP calorimeter geometry.
namespace  sbt
 Compile-time parameters of the Surround Background Tagger (SBT).

Classes

class  DetectorBuilder
 Main geometry builder for the SHiP detector. More...
class  Materials
 Central material manager for the SHiP detector. More...
struct  SubsystemDescriptor
 A subsystem's self-description: everything the assembler needs. More...
struct  SubsystemInfo
 A registered subsystem: its descriptor plus how to build it. More...
class  UnknownSubsystem
 Thrown when a subsystem name is not in the registry. More...
class  CalorimeterFactory
 Factory for the Calorimeter (ECAL + HCAL) geometry. More...
class  CavernFactory
 Factory for the Cavern (world volume and rock) geometry. More...
class  DecayVolumeFactory
 Factory for the DecayVolume subsystem (decay region + SBT). More...
class  SBTSensorBuilder
 Builds the SBT scintillator sensor containers into mother. More...
class  SBTStructureBuilder
 Builds the SBT steel H-beam supporting structure into mother. More...
class  MagnetFactory
 Factory for the Magnet (spectrometer magnet) geometry. More...
struct  MuonShieldMagnet
 One muon-shield magnet: a solid iron box on the beam axis, from its upstream face in the world frame. More...
class  MuonShieldFactory
 Factory for the muon shield: the magnetised hadron stopper and the shield magnets M1-M7. More...
class  NeutrinoDetectorFactory
 Factory for the Scattering and Neutrino Detector (SND). More...
class  TargetFactory
 Factory for the Target (proton target and shielding) geometry. More...
class  TimingDetectorFactory
 Factory for the TimingDetector (TimeDet) geometry. More...
class  TrackersFactory
 Factory for the Trackers (straw tube tracking stations) geometry. More...
class  UpstreamTaggerFactory
 Factory for the UpstreamTagger (upstream veto tagger) geometry. More...

Typedefs

using LengthMm
 Spellings for struct members and function parameters.

Enumerations

enum class  BarAxis { AlongX , AlongY }
 Which transverse axis the bars are replicated along. More...

Functions

void placeChild (GeoVPhysVol *mother, GeoVPhysVol *child, const std::string &name, int id, const GeoTrf::Transform3D &transform)
 Place child under mother using the repo's standard tag sequence: a name tag, an identifier tag, a transform, then the child node.
std::map< std::string, SubsystemInfo > & registry ()
 The global subsystem registry.
bool registerSubsystem (const SubsystemDescriptor &desc, std::function< GeoVPhysVol *(Materials &)> build)
 Add a subsystem to the registry.
GeoPhysVol * assembleGeometry (const std::vector< std::string > &only={})
 Assemble the world plus a selection of registered subsystems.
GeoVPhysVol * buildSubsystem (const std::string &name)
 Build a single subsystem on its own, in its local frame.
std::vector< std::string > subsystemNames ()
 The names of every registered subsystem, sorted.
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).
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).
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).
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).
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).
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).
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).
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).
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).
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).
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).
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).
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).
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).
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 auto mm
constexpr auto mm
constexpr auto mm
constexpr auto mm

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.

Enumeration Type Documentation

◆ BarAxis

enum class SHiP::geometry::BarAxis
strong

Which transverse axis the bars are replicated along.

Enumerator
AlongX 
AlongY 

Function Documentation

◆ assembleGeometry()

GeoPhysVol * SHiP::geometry::assembleGeometry ( const std::vector< std::string > & only = {})

Assemble the world plus a selection of registered subsystems.

The world (the registered subsystem whose descriptor sets isWorld) is always built. Every selected subsystem is placed into it at the translation its own descriptor declares, in a deterministic order sorted by (z, id) so the result does not depend on registration order.

Parameters
onlySubsystem names to place; an empty selection places all of them.
Returns
The world physical volume, owning the placed subsystems.
Exceptions
UnknownSubsystemif a name is not registered.
std::runtime_errorif no world is registered, if more than one is, or if a factory builds nothing. The world built so far is freed.

◆ buildSubsystem()

GeoVPhysVol * SHiP::geometry::buildSubsystem ( const std::string & name)

Build a single subsystem on its own, in its local frame.

No world is created and no placement is applied, so the result sits at the origin rather than at its position in the detector.

Parameters
nameThe subsystem name, as returned by subsystemNames().
Returns
The subsystem's volume in its local frame.
Exceptions
UnknownSubsystemif the name is not registered.

◆ gm() [1/15]

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).

◆ gm() [2/15]

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).

◆ gm() [3/15]

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).

◆ gm() [4/15]

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).

◆ gm() [5/15]

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).

◆ gm() [6/15]

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).

◆ gm() [7/15]

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).

◆ gm() [8/15]

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).

◆ gm() [9/15]

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).

◆ gm() [10/15]

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).

◆ gm() [11/15]

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).

◆ gm() [12/15]

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).

◆ gm() [13/15]

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).

◆ gm() [14/15]

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).

◆ gm() [15/15]

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).

◆ placeChild()

void SHiP::geometry::placeChild ( GeoVPhysVol * mother,
GeoVPhysVol * child,
const std::string & name,
int id,
const GeoTrf::Transform3D & transform )
inline

Place child under mother using the repo's standard tag sequence: a name tag, an identifier tag, a transform, then the child node.

This is the idiom repeated throughout the subsystem factories and the top-level builder.

◆ registerSubsystem()

bool SHiP::geometry::registerSubsystem ( const SubsystemDescriptor & desc,
std::function< GeoVPhysVol *(Materials &)> build )
inline

Add a subsystem to the registry.

A duplicate name is a programming error (two subsystems declaring the same descriptor name) and aborts with a diagnostic, rather than being silently dropped by emplace(). This runs during static initialisation, before main() and before any handler could catch it, so it reports to stderr and calls std::abort() instead of throwing. That also keeps this header free of any logging dependency, which would otherwise become public to every consumer.

Parameters
descThe subsystem's self-description; desc.name must be unique.
buildCallback building the subsystem in its own local frame.
Returns
Always true, so the call is usable as a static initialiser.

◆ registry()

std::map< std::string, SubsystemInfo > & SHiP::geometry::registry ( )
inline

The global subsystem registry.

A Meyers singleton (function-local static in an inline function) so it is a single shared instance across all translation units and is guaranteed to exist before any static registration runs. No file names any subsystem; subsystems add themselves via REGISTER_SUBSYSTEM.

◆ subsystemNames()

std::vector< std::string > SHiP::geometry::subsystemNames ( )

The names of every registered subsystem, sorted.

Includes the world, so the result is the full set of names accepted by buildSubsystem() and assembleGeometry().

Returns
Sorted subsystem names.

Variable Documentation

◆ mm [1/4]

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

◆ mm [2/4]

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

◆ mm [3/4]

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

◆ mm [4/4]

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