ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::HierarchicalGeometryContainer< value_t > Class Template Reference

#include <acts/blob/master/Core/include/Acts/Geometry/HierarchicalGeometryContainer.hpp>

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

Public Types

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

template<typename id_getter_t = detail::DefaultGeometryIdGetter>
 HierarchicalGeometryContainer (std::vector< Value > &&elements, id_getter_t getId=id_getter_t())
 
 HierarchicalGeometryContainer ()=default
 
 HierarchicalGeometryContainer (const HierarchicalGeometryContainer &)=default
 
 HierarchicalGeometryContainer (HierarchicalGeometryContainer &&)=default
 
 ~HierarchicalGeometryContainer ()=default
 
HierarchicalGeometryContaineroperator= (const HierarchicalGeometryContainer &)=default
 
HierarchicalGeometryContaineroperator= (HierarchicalGeometryContainer &&)=default
 
Iterator begin () const
 Return an iterator pointing to the beginning of the stored elements.
 
Iterator end () const
 Return an iterator pointing to the end of the stored elements.
 
bool empty () const
 Check if any elements are stored.
 
Size size () const
 Return the number of stored elements.
 
Iterator find (GeometryID id) const
 

Private Types

using Identifier = GeometryID::Value
 

Private Member Functions

template<typename id_getter_t >
void fillLookup (id_getter_t getId)
 

Static Private Member Functions

static constexpr Identifier makeLeadingLevelsMask (GeometryID 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.
 

Private Attributes

std::vector< Valuem_elements
 
std::vector< Identifierm_ids
 
std::vector< Identifierm_masks
 

Detailed Description

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

Store homogeneous elements anchored in the geometry hierarchy.

Template Parameters
value_tstored element type

Trailing zero components 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 refers to a the full layer. All stored geometry identifiers must set at least the highest hierarchy level.

The container supports range-based iteration over all stored elements

for (const auto& element : container) {
    ...
}

and finding an equivalent element for a given identifier

auto it = container.find(GeometryID(...));
if (it != container.end()) {
    ...
}

Adding elements is potentially expensive as the internal ordering must be reestablished every time an element is added. In addition, modifying an element in-place can potentially change its identifier which would also break the interal ordering. Thus, the container can not be modified after construction to prevent misuse.

Definition at line 52 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 52 of file HierarchicalGeometryContainer.hpp

Member Typedef Documentation

template<typename value_t>
using Acts::HierarchicalGeometryContainer< value_t >::Identifier = GeometryID::Value
private

Definition at line 99 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 99 of file HierarchicalGeometryContainer.hpp

template<typename value_t>
using Acts::HierarchicalGeometryContainer< value_t >::Iterator = typename std::vector<value_t>::const_iterator

Definition at line 54 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 54 of file HierarchicalGeometryContainer.hpp

template<typename value_t>
using Acts::HierarchicalGeometryContainer< value_t >::Size = typename std::vector<value_t>::size_type

Definition at line 55 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 55 of file HierarchicalGeometryContainer.hpp

template<typename value_t>
using Acts::HierarchicalGeometryContainer< value_t >::Value = value_t

Definition at line 56 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 56 of file HierarchicalGeometryContainer.hpp

Constructor & Destructor Documentation

template<typename value_t >
template<typename id_getter_t >
Acts::HierarchicalGeometryContainer< value_t >::HierarchicalGeometryContainer ( std::vector< Value > &&  elements,
id_getter_t  getId = id_getter_t() 
)
inline

Construct the container from the given elements.

Parameters
elementsinput elements (must be unique with respect to identifier)
getIdfunctor to retrieve the id of an element
Template Parameters
id_getter_tFunctor type to retrieve the id of an element

Definition at line 165 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 165 of file HierarchicalGeometryContainer.hpp

References Acts::HierarchicalGeometryContainer< value_t >::fillLookup(), and Acts::HierarchicalGeometryContainer< value_t >::m_elements.

+ Here is the call graph for this function:

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

Member Function Documentation

template<typename value_t>
Iterator Acts::HierarchicalGeometryContainer< value_t >::begin ( ) const
inline

Return an iterator pointing to the beginning of the stored elements.

Definition at line 79 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 79 of file HierarchicalGeometryContainer.hpp

References Acts::HierarchicalGeometryContainer< value_t >::m_elements.

template<typename value_t>
bool Acts::HierarchicalGeometryContainer< value_t >::empty ( ) const
inline

Check if any elements are stored.

Definition at line 83 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 83 of file HierarchicalGeometryContainer.hpp

References Acts::HierarchicalGeometryContainer< value_t >::m_elements.

template<typename value_t>
Iterator Acts::HierarchicalGeometryContainer< value_t >::end ( ) const
inline

Return an iterator pointing to the end of the stored elements.

Definition at line 81 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 81 of file HierarchicalGeometryContainer.hpp

References Acts::HierarchicalGeometryContainer< value_t >::m_elements.

Referenced by luupda(), pydump(), pylhef(), pyslha(), pyupda(), upevnt(), and upinit().

+ Here is the caller graph for this function:

template<typename value_t>
static constexpr bool Acts::HierarchicalGeometryContainer< value_t >::equalWithinMask ( Identifier  lhs,
Identifier  rhs,
Identifier  mask 
)
inlinestaticprivate

Compare the two identifiers only within the masked bits.

Definition at line 140 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 140 of file HierarchicalGeometryContainer.hpp

References mask.

template<typename value_t>
template<typename id_getter_t >
void Acts::HierarchicalGeometryContainer< value_t >::fillLookup ( id_getter_t  getId)
inlineprivate

Fill the lookup containers from the current values.

Template Parameters
id_getter_tFunctor type to retrieve the id of an element

Definition at line 149 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 149 of file HierarchicalGeometryContainer.hpp

References Acts::HierarchicalGeometryContainer< value_t >::m_elements, Acts::HierarchicalGeometryContainer< value_t >::m_ids, Acts::HierarchicalGeometryContainer< value_t >::m_masks, and Acts::HierarchicalGeometryContainer< value_t >::makeLeadingLevelsMask().

Referenced by Acts::HierarchicalGeometryContainer< value_t >::HierarchicalGeometryContainer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename value_t >
HierarchicalGeometryContainer< value_t >::Iterator Acts::HierarchicalGeometryContainer< value_t >::find ( GeometryID  id) const
inline

Find the most specific element for a given geometry identifier.

This can be either the element matching exactly to the given geometry id, if it exists, or the element from the next available higher level within the geometry hierachy.

Parameters
idgeometry identifier for which information is requested
Return values
iteratorto an existing element
<tt>.end()</tt>iterator if no matching element exists

Definition at line 186 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 186 of file HierarchicalGeometryContainer.hpp

References it.

template<typename value_t>
static constexpr Identifier Acts::HierarchicalGeometryContainer< value_t >::makeHighestLevelMask ( )
inlinestaticprivate

Construct a mask where only the highest level is set.

Definition at line 136 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 136 of file HierarchicalGeometryContainer.hpp

References Acts::HierarchicalGeometryContainer< value_t >::makeLeadingLevelsMask(), and Acts::UnitConstants::u.

+ Here is the call graph for this function:

template<typename value_t>
static constexpr Identifier Acts::HierarchicalGeometryContainer< value_t >::makeLeadingLevelsMask ( GeometryID  id)
inlinestaticprivate

Construct a mask where all leading non-zero levels are set.

Definition at line 109 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 109 of file HierarchicalGeometryContainer.hpp

References G4TTL::layer, mask, and Acts::UnitConstants::u.

Referenced by Acts::HierarchicalGeometryContainer< value_t >::fillLookup(), and Acts::HierarchicalGeometryContainer< value_t >::makeHighestLevelMask().

+ Here is the caller graph for this function:

template<typename value_t>
HierarchicalGeometryContainer& Acts::HierarchicalGeometryContainer< value_t >::operator= ( const HierarchicalGeometryContainer< value_t > &  )
default
template<typename value_t>
HierarchicalGeometryContainer& Acts::HierarchicalGeometryContainer< value_t >::operator= ( HierarchicalGeometryContainer< value_t > &&  )
default
template<typename value_t>
Size Acts::HierarchicalGeometryContainer< value_t >::size ( ) const
inline

Return the number of stored elements.

Definition at line 85 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 85 of file HierarchicalGeometryContainer.hpp

References Acts::HierarchicalGeometryContainer< value_t >::m_elements.

Member Data Documentation

template<typename value_t>
std::vector<Identifier> Acts::HierarchicalGeometryContainer< value_t >::m_ids
private

Definition at line 104 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 104 of file HierarchicalGeometryContainer.hpp

Referenced by Acts::HierarchicalGeometryContainer< value_t >::fillLookup().

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

Definition at line 106 of file HierarchicalGeometryContainer.hpp.

View newest version in sPHENIX GitHub at line 106 of file HierarchicalGeometryContainer.hpp

Referenced by Acts::HierarchicalGeometryContainer< value_t >::fillLookup().


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