Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Core/include/Acts/Geometry/GeometryHierarchyMap.hpp>
Public Types | |
using | InputElement = typename std::pair< GeometryIdentifier, value_t > |
Combined geometry identifier and value element. Only used for input. | |
using | Iterator = typename std::vector< value_t >::const_iterator |
using | Size = typename std::vector< value_t >::size_type |
using | Value = value_t |
Public Member Functions | |
GeometryHierarchyMap (std::vector< InputElement > elements) | |
GeometryHierarchyMap (std::initializer_list< InputElement > elements) | |
GeometryHierarchyMap ()=default | |
GeometryHierarchyMap (const GeometryHierarchyMap &)=default | |
GeometryHierarchyMap (GeometryHierarchyMap &&)=default | |
~GeometryHierarchyMap ()=default | |
GeometryHierarchyMap & | operator= (const GeometryHierarchyMap &)=default |
GeometryHierarchyMap & | operator= (GeometryHierarchyMap &&)=default |
Iterator | begin () const |
Return an iterator pointing to the beginning of the stored values. | |
Iterator | end () const |
Return an iterator pointing to the end of the stored values. | |
bool | empty () const |
Check if any elements are stored. | |
Size | size () const |
Return the number of stored elements. | |
GeometryIdentifier | idAt (Size index) const |
const Value & | valueAt (Size index) const |
Iterator | find (GeometryIdentifier id) const |
Private Types | |
using | Identifier = GeometryIdentifier::Value |
Private Member Functions | |
template<typename iterator_t > | |
void | fill (iterator_t beg, iterator_t end) |
Static Private Member Functions | |
static constexpr Identifier | makeLeadingLevelsMask (GeometryIdentifier id) |
Construct a mask where all leading non-zero levels are set. | |
static constexpr Identifier | makeHighestLevelMask () |
Construct a mask where only the highest level is set. | |
static constexpr bool | equalWithinMask (Identifier lhs, Identifier rhs, Identifier mask) |
Compare the two identifiers only within the masked bits. | |
template<typename iterator_t > | |
static void | sortAndCheckDuplicates (iterator_t beg, iterator_t end) |
Ensure identifier ordering and uniqueness. | |
Private Attributes | |
std::vector< Identifier > | m_ids |
std::vector< Identifier > | m_masks |
std::vector< Value > | m_values |
Store values mapped into the geometry hierarchy.
value_t | stored value type |
The core functionality is to find an equivalent element, i.e. an identifier-value pair, for a given geometry identifier via
auto it = container.find(GeometryIdentifier(...)); if (it != container.end()) { ... }
Trailing zero levels of stored geometry identifiers are used as broadcast values to refer to higher-level objects within the geometry, e.g. a geometry identifier with vanishing approach and sensitive index identifies a layer. An entry will all geometry identifier levels set to zero acts as the global default value.
The container also supports range-based iteration over all stored elements
for (const auto& element : container) { ... }
and index-based access to stored elements and associated geometry identifiers
GeometryIdentifier id3 = container.idAt(3); const auto& element4 = container.valueAt(4);
Adding elements is potentially expensive as the internal lookup structure must be updated. In addition, modifying an element in-place could change its identifier which would also break the lookup. Thus, the container can not be modified after construction to prevent misuse.
Definition at line 62 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 62 of file GeometryHierarchyMap.hpp
|
private |
Definition at line 133 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 133 of file GeometryHierarchyMap.hpp
using Acts::GeometryHierarchyMap< value_t >::InputElement = typename std::pair<GeometryIdentifier, value_t> |
Combined geometry identifier and value element. Only used for input.
Definition at line 65 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 65 of file GeometryHierarchyMap.hpp
using Acts::GeometryHierarchyMap< value_t >::Iterator = typename std::vector<value_t>::const_iterator |
Definition at line 66 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 66 of file GeometryHierarchyMap.hpp
using Acts::GeometryHierarchyMap< value_t >::Size = typename std::vector<value_t>::size_type |
Definition at line 67 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 67 of file GeometryHierarchyMap.hpp
using Acts::GeometryHierarchyMap< value_t >::Value = value_t |
Definition at line 68 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 68 of file GeometryHierarchyMap.hpp
|
inline |
Construct the container from the given elements.
elements | input elements (must be unique with respect to identifier) |
Definition at line 198 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 198 of file GeometryHierarchyMap.hpp
|
inline |
Construct the container from an initializer list.
elements | input initializer list |
Definition at line 205 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 205 of file GeometryHierarchyMap.hpp
|
default |
|
default |
|
default |
|
default |
|
inline |
Return an iterator pointing to the beginning of the stored values.
Definition at line 88 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 88 of file GeometryHierarchyMap.hpp
|
inline |
Check if any elements are stored.
Definition at line 92 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 92 of file GeometryHierarchyMap.hpp
Referenced by Acts::Svg::DetectorVolumeConverter::convert(), ActsExamples::DigitizationAlgorithm::DigitizationAlgorithm(), and ActsExamples::RootMeasurementWriter::RootMeasurementWriter().
|
inline |
Return an iterator pointing to the end of the stored values.
Definition at line 90 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 90 of file GeometryHierarchyMap.hpp
Referenced by Acts::Svg::SurfaceArrayConverter::convert(), Acts::Svg::TrackingGeometryConverter::convert(), Acts::Svg::IndexedSurfacesConverter::convertImpl(), ActsExamples::DigitizationConfigurator::operator()(), Acts::Test::MeasurementsCreator::operator()(), and Acts::MeasurementSelector::select().
|
inlinestaticprivate |
Compare the two identifiers only within the masked bits.
Definition at line 179 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 179 of file GeometryHierarchyMap.hpp
|
inlineprivate |
Fill the container from the input elements.
This assumes that the elements are ordered and unique with respect to their identifiers.
Definition at line 229 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 229 of file GeometryHierarchyMap.hpp
References distance(), end, testing::internal::move(), and n.
|
inline |
Find the most specific value for a given geometry identifier.
This can be either from the element matching exactly to the given geometry id, if it exists, or from the element for the next available higher level within the geometry hierarchy.
id | geometry identifier for which information is requested |
iterator | to an existing value |
<tt>.end()</tt> | iterator if no matching element exists |
Definition at line 246 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 246 of file GeometryHierarchyMap.hpp
References assert, parse_cmake_options::begin, distance(), end, i, it, next, physmon_ckf_tracking::u, and value.
Referenced by Acts::Svg::SurfaceArrayConverter::convert(), Acts::Svg::TrackingGeometryConverter::convert(), Acts::Svg::IndexedSurfacesConverter::convertImpl(), Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::fromJson(), ActsExamples::DigitizationConfigurator::operator()(), Acts::Test::MeasurementsCreator::operator()(), and Acts::MeasurementSelector::select().
|
inline |
Access the geometry identifier for the i-th element with bounds check.
std::out_of_range | for invalid indices |
Definition at line 99 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 99 of file GeometryHierarchyMap.hpp
Referenced by ActsExamples::DigitizationAlgorithm::DigitizationAlgorithm(), Acts::MaterialMapJsonConverter::jsonToMaterialMaps(), ActsExamples::RootMeasurementWriter::RootMeasurementWriter(), and Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::toJson().
|
inlinestaticprivate |
Construct a mask where only the highest level is set.
Definition at line 175 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 175 of file GeometryHierarchyMap.hpp
|
inlinestaticprivate |
Construct a mask where all leading non-zero levels are set.
Definition at line 142 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 142 of file GeometryHierarchyMap.hpp
Referenced by Acts::GeometryHierarchyMap< MeasurementResolution >::makeHighestLevelMask().
|
default |
|
default |
|
inline |
Return the number of stored elements.
Definition at line 94 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 94 of file GeometryHierarchyMap.hpp
Referenced by ActsExamples::DigitizationAlgorithm::DigitizationAlgorithm(), Acts::MaterialMapJsonConverter::jsonToMaterialMaps(), ActsExamples::RootMeasurementWriter::RootMeasurementWriter(), and Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::toJson().
|
inlinestaticprivate |
Ensure identifier ordering and uniqueness.
Definition at line 212 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 212 of file GeometryHierarchyMap.hpp
References check_smearing_config::lhs, check_smearing_config::rhs, and Acts::Experimental::detail::BlueprintHelper::sort().
|
inline |
Access the value of the i-th element in the container with bounds check.
std::out_of_range | for invalid indices |
Definition at line 103 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 103 of file GeometryHierarchyMap.hpp
Referenced by ActsExamples::DigitizationAlgorithm::DigitizationAlgorithm(), Acts::MaterialMapJsonConverter::jsonToMaterialMaps(), ActsExamples::RootMeasurementWriter::RootMeasurementWriter(), and Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::toJson().
|
private |
Definition at line 136 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 136 of file GeometryHierarchyMap.hpp
Referenced by Acts::GeometryHierarchyMap< MeasurementResolution >::idAt().
|
private |
Definition at line 138 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 138 of file GeometryHierarchyMap.hpp
|
private |
Definition at line 139 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 139 of file GeometryHierarchyMap.hpp
Referenced by Acts::GeometryHierarchyMap< MeasurementResolution >::begin(), Acts::GeometryHierarchyMap< MeasurementResolution >::empty(), Acts::GeometryHierarchyMap< MeasurementResolution >::end(), Acts::GeometryHierarchyMap< MeasurementResolution >::size(), and Acts::GeometryHierarchyMap< MeasurementResolution >::valueAt().