Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::GeometryHierarchyMap< value_t > Class Template Reference

#include <acts/blob/sPHENIX/Core/include/Acts/Geometry/GeometryHierarchyMap.hpp>

+ Collaboration diagram for Acts::GeometryHierarchyMap< value_t >:

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
 
GeometryHierarchyMapoperator= (const GeometryHierarchyMap &)=default
 
GeometryHierarchyMapoperator= (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 ValuevalueAt (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< Identifierm_ids
 
std::vector< Identifierm_masks
 
std::vector< Valuem_values
 

Detailed Description

template<typename value_t>
class Acts::GeometryHierarchyMap< value_t >

Store values mapped into the geometry hierarchy.

Template Parameters
value_tstored 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);
Note
No guarantees are given for the element order when using range-based or index-based access. Any apparent ordering must be considered an implementation detail and might change.

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

Member Typedef Documentation

template<typename value_t>
using Acts::GeometryHierarchyMap< value_t >::Identifier = GeometryIdentifier::Value
private

Definition at line 133 of file GeometryHierarchyMap.hpp.

View newest version in sPHENIX GitHub at line 133 of file GeometryHierarchyMap.hpp

template<typename value_t>
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

template<typename value_t>
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

template<typename value_t>
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

template<typename value_t>
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

Constructor & Destructor Documentation

template<typename value_t >
Acts::GeometryHierarchyMap< value_t >::GeometryHierarchyMap ( std::vector< InputElement elements)
inline

Construct the container from the given elements.

Parameters
elementsinput 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

template<typename value_t >
Acts::GeometryHierarchyMap< value_t >::GeometryHierarchyMap ( std::initializer_list< InputElement elements)
inline

Construct the container from an initializer list.

Parameters
elementsinput initializer list

Definition at line 205 of file GeometryHierarchyMap.hpp.

View newest version in sPHENIX GitHub at line 205 of file GeometryHierarchyMap.hpp

template<typename value_t>
Acts::GeometryHierarchyMap< value_t >::GeometryHierarchyMap ( )
default
template<typename value_t>
Acts::GeometryHierarchyMap< value_t >::GeometryHierarchyMap ( const GeometryHierarchyMap< value_t > &  )
default
template<typename value_t>
Acts::GeometryHierarchyMap< value_t >::GeometryHierarchyMap ( GeometryHierarchyMap< value_t > &&  )
default
template<typename value_t>
Acts::GeometryHierarchyMap< value_t >::~GeometryHierarchyMap ( )
default

Member Function Documentation

template<typename value_t>
Iterator Acts::GeometryHierarchyMap< value_t >::begin ( ) const
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

template<typename value_t>
bool Acts::GeometryHierarchyMap< value_t >::empty ( ) const
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().

+ Here is the caller graph for this function:

template<typename value_t>
Iterator Acts::GeometryHierarchyMap< value_t >::end ( ) const
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().

+ Here is the caller graph for this function:

template<typename value_t>
static constexpr bool Acts::GeometryHierarchyMap< value_t >::equalWithinMask ( Identifier  lhs,
Identifier  rhs,
Identifier  mask 
)
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

template<typename value_t >
template<typename iterator_t >
void Acts::GeometryHierarchyMap< value_t >::fill ( iterator_t  beg,
iterator_t  end 
)
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.

+ Here is the call graph for this function:

template<typename value_t >
auto Acts::GeometryHierarchyMap< value_t >::find ( GeometryIdentifier  id) const
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.

Parameters
idgeometry identifier for which information is requested
Return values
iteratorto 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename value_t>
GeometryIdentifier Acts::GeometryHierarchyMap< value_t >::idAt ( Size  index) const
inline

Access the geometry identifier for the i-th element with bounds check.

Exceptions
std::out_of_rangefor 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().

+ Here is the caller graph for this function:

template<typename value_t>
static constexpr Identifier Acts::GeometryHierarchyMap< value_t >::makeHighestLevelMask ( )
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

template<typename value_t>
static constexpr Identifier Acts::GeometryHierarchyMap< value_t >::makeLeadingLevelsMask ( GeometryIdentifier  id)
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().

+ Here is the caller graph for this function:

template<typename value_t>
GeometryHierarchyMap& Acts::GeometryHierarchyMap< value_t >::operator= ( const GeometryHierarchyMap< value_t > &  )
default
template<typename value_t>
GeometryHierarchyMap& Acts::GeometryHierarchyMap< value_t >::operator= ( GeometryHierarchyMap< value_t > &&  )
default
template<typename value_t>
Size Acts::GeometryHierarchyMap< value_t >::size ( ) const
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().

+ Here is the caller graph for this function:

template<typename value_t >
template<typename iterator_t >
void Acts::GeometryHierarchyMap< value_t >::sortAndCheckDuplicates ( iterator_t  beg,
iterator_t  end 
)
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().

+ Here is the call graph for this function:

template<typename value_t>
const Value& Acts::GeometryHierarchyMap< value_t >::valueAt ( Size  index) const
inline

Access the value of the i-th element in the container with bounds check.

Exceptions
std::out_of_rangefor 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().

+ Here is the caller graph for this function:

Member Data Documentation

template<typename value_t>
std::vector<Identifier> Acts::GeometryHierarchyMap< value_t >::m_ids
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().

template<typename value_t>
std::vector<Identifier> Acts::GeometryHierarchyMap< value_t >::m_masks
private

Definition at line 138 of file GeometryHierarchyMap.hpp.

View newest version in sPHENIX GitHub at line 138 of file GeometryHierarchyMap.hpp


The documentation for this class was generated from the following file: