EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#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 193 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 193 of file GeometryHierarchyMap.hpp
|
inline |
Construct the container from an initializer list.
elements | input initializer list |
Definition at line 200 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 200 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
|
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 luupda(), Acts::CKFSourceLinkSelector::operator()(), pepsimainerhic(), pydump(), pylhef(), pyslha(), pyupda(), upevnt(), and upinit().
|
inlinestaticprivate |
Compare the two identifiers only within the masked bits.
Definition at line 174 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 174 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 224 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 224 of file GeometryHierarchyMap.hpp
References n.
Referenced by pygdir().
|
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 hierachy.
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 241 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 241 of file GeometryHierarchyMap.hpp
References it, Acts::UnitConstants::u, and value.
Referenced by Acts::GeometryHierarchyMapJsonConverter< value_t >::fromJson(), and Acts::CKFSourceLinkSelector::operator()().
|
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 Acts::GeometryHierarchyMapJsonConverter< value_t >::toJson().
|
inlinestaticprivate |
Construct a mask where only the highest level is set.
Definition at line 170 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 170 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< SourceLinkSelectorCuts >::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 Acts::GeometryHierarchyMapJsonConverter< value_t >::toJson().
|
inlinestaticprivate |
Ensure identifier ordering and uniqueness.
Definition at line 207 of file GeometryHierarchyMap.hpp.
View newest version in sPHENIX GitHub at line 207 of file GeometryHierarchyMap.hpp
|
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 Acts::GeometryHierarchyMapJsonConverter< value_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< SourceLinkSelectorCuts >::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< SourceLinkSelectorCuts >::begin(), Acts::GeometryHierarchyMap< SourceLinkSelectorCuts >::empty(), Acts::GeometryHierarchyMap< SourceLinkSelectorCuts >::end(), Acts::GeometryHierarchyMap< SourceLinkSelectorCuts >::size(), and Acts::GeometryHierarchyMap< SourceLinkSelectorCuts >::valueAt().