ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::GeometryIdMapping Class Reference

Lookup table between the three surface-identifier "worlds" used across the ACTS / Detray / Athena tracking geometries: More...

#include <GeometryIdMapping.h>

Collaboration diagram for ActsTrk::GeometryIdMapping:

Public Types

using detray_id_type = std::uint64_t
using acts_id_type = std::uint64_t

Public Member Functions

 GeometryIdMapping ()=default
void reserve (std::size_t nSurfaces)
 Reserve storage for nSurfaces detray surfaces.
void addEntry (detray_id_type detrayId, acts_id_type actsId, std::optional< Identifier > athenaId=std::nullopt)
 Register one detray surface, it has to have a corresponding ACTS surface athenaId is optional, unset for surfaces that couldn't be matched to an Athena module (e.g.
std::optional< IdentifieractsToAthena (acts_id_type actsId) const
std::optional< acts_id_typeathenaToActs (const Identifier &athenaId) const
std::size_t size () const
const std::unordered_map< detray_id_type, Identifier::value_type > & detrayToAthenaMap () const
detray_id <-> acts_id
std::optional< acts_id_typedetrayToActs (detray_id_type detrayId) const
std::optional< detray_id_typeactsToDetray (acts_id_type actsId) const
detray_id <-> Athena Identifier
std::optional< IdentifierdetrayToAthena (detray_id_type detrayId) const
std::optional< detray_id_typeathenaToDetray (const Identifier &athenaId) const

Private Attributes

std::unordered_map< detray_id_type, acts_id_typem_detrayToActs
std::unordered_map< detray_id_type, Identifier::value_type > m_detrayToAthena
std::unordered_map< acts_id_type, detray_id_typem_actsToDetray
std::unordered_map< Identifier::value_type, detray_id_typem_athenaToDetray

Detailed Description

Lookup table between the three surface-identifier "worlds" used across the ACTS / Detray / Athena tracking geometries:

  • detray_id : dense index of a surface inside the detray detector
  • acts_id : Acts::GeometryIdentifier::value_type of the matching ACTS surface.
  • athena_id : Identifier of the matching Athena (Pixel/Strip) module side. Only present for sensitive detray surfaces that were successfully matched to an Athena module.

Built once in DeviceDetectorDescriptionCondAlg::initialize() from the tracking geometry (geometry-tag static), and recorded to the detector store.

Definition at line 32 of file GeometryIdMapping.h.

Member Typedef Documentation

◆ acts_id_type

Definition at line 35 of file GeometryIdMapping.h.

◆ detray_id_type

Definition at line 34 of file GeometryIdMapping.h.

Constructor & Destructor Documentation

◆ GeometryIdMapping()

ActsTrk::GeometryIdMapping::GeometryIdMapping ( )
default

Member Function Documentation

◆ actsToAthena()

std::optional< Identifier > ActsTrk::GeometryIdMapping::actsToAthena ( acts_id_type actsId) const
inline

Definition at line 91 of file GeometryIdMapping.h.

91 {
92 auto d = actsToDetray(actsId);
93 return d ? detrayToAthena(*d) : std::nullopt;
94 }
std::optional< detray_id_type > actsToDetray(acts_id_type actsId) const
std::optional< Identifier > detrayToAthena(detray_id_type detrayId) const

◆ actsToDetray()

std::optional< detray_id_type > ActsTrk::GeometryIdMapping::actsToDetray ( acts_id_type actsId) const
inline

Definition at line 70 of file GeometryIdMapping.h.

70 {
71 auto it = m_actsToDetray.find(actsId);
72 return it == m_actsToDetray.end() ? std::nullopt
73 : std::optional{it->second};
74 }
std::unordered_map< acts_id_type, detray_id_type > m_actsToDetray

◆ addEntry()

void ActsTrk::GeometryIdMapping::addEntry ( detray_id_type detrayId,
acts_id_type actsId,
std::optional< Identifier > athenaId = std::nullopt )
inline

Register one detray surface, it has to have a corresponding ACTS surface athenaId is optional, unset for surfaces that couldn't be matched to an Athena module (e.g.

passive surfaces)

Definition at line 50 of file GeometryIdMapping.h.

51 {
52
53
54 m_detrayToActs.emplace(detrayId,actsId);
55 m_actsToDetray.emplace(actsId, detrayId);
56
57 if (athenaId.has_value()) {
58 m_detrayToAthena.emplace(detrayId,athenaId->get_compact());
59 m_athenaToDetray.emplace(athenaId->get_compact(), detrayId);
60 }
61 }
std::unordered_map< detray_id_type, Identifier::value_type > m_detrayToAthena
std::unordered_map< detray_id_type, acts_id_type > m_detrayToActs
std::unordered_map< Identifier::value_type, detray_id_type > m_athenaToDetray

◆ athenaToActs()

std::optional< acts_id_type > ActsTrk::GeometryIdMapping::athenaToActs ( const Identifier & athenaId) const
inline

Definition at line 95 of file GeometryIdMapping.h.

95 {
96 auto d = athenaToDetray(athenaId);
97 return d ? detrayToActs(*d) : std::nullopt;
98 }
std::optional< acts_id_type > detrayToActs(detray_id_type detrayId) const
std::optional< detray_id_type > athenaToDetray(const Identifier &athenaId) const

◆ athenaToDetray()

std::optional< detray_id_type > ActsTrk::GeometryIdMapping::athenaToDetray ( const Identifier & athenaId) const
inline

Definition at line 84 of file GeometryIdMapping.h.

84 {
85 auto it = m_athenaToDetray.find(athenaId.get_compact());
86 return it == m_athenaToDetray.end() ? std::nullopt
87 : std::optional{it->second};
88 }
value_type get_compact() const
Get the compact id.

◆ detrayToActs()

std::optional< acts_id_type > ActsTrk::GeometryIdMapping::detrayToActs ( detray_id_type detrayId) const
inline

Definition at line 65 of file GeometryIdMapping.h.

65 {
66 auto it = m_detrayToActs.find(detrayId);
67 return it == m_detrayToActs.end() ? std::nullopt
68 : std::optional{it->second};
69 }

◆ detrayToAthena()

std::optional< Identifier > ActsTrk::GeometryIdMapping::detrayToAthena ( detray_id_type detrayId) const
inline

Definition at line 79 of file GeometryIdMapping.h.

79 {
80 auto it = m_detrayToAthena.find(detrayId);
81 if (it == m_detrayToAthena.end()) return std::nullopt;
82 return Identifier(it->second);
83 }

◆ detrayToAthenaMap()

const std::unordered_map< detray_id_type, Identifier::value_type > & ActsTrk::GeometryIdMapping::detrayToAthenaMap ( ) const
inline

Definition at line 102 of file GeometryIdMapping.h.

102{ return m_detrayToAthena; }

◆ reserve()

void ActsTrk::GeometryIdMapping::reserve ( std::size_t nSurfaces)
inline

Reserve storage for nSurfaces detray surfaces.

Definition at line 40 of file GeometryIdMapping.h.

40 {
41 m_detrayToActs.reserve(nSurfaces);
42 m_detrayToAthena.reserve(nSurfaces);
43 m_actsToDetray.reserve(nSurfaces);
44 m_athenaToDetray.reserve(nSurfaces);
45 }

◆ size()

std::size_t ActsTrk::GeometryIdMapping::size ( ) const
inline

Definition at line 100 of file GeometryIdMapping.h.

100{ return m_detrayToActs.size(); }

Member Data Documentation

◆ m_actsToDetray

std::unordered_map<acts_id_type, detray_id_type> ActsTrk::GeometryIdMapping::m_actsToDetray
private

Definition at line 108 of file GeometryIdMapping.h.

◆ m_athenaToDetray

std::unordered_map<Identifier::value_type, detray_id_type> ActsTrk::GeometryIdMapping::m_athenaToDetray
private

Definition at line 109 of file GeometryIdMapping.h.

◆ m_detrayToActs

std::unordered_map<detray_id_type, acts_id_type> ActsTrk::GeometryIdMapping::m_detrayToActs
private

Definition at line 105 of file GeometryIdMapping.h.

◆ m_detrayToAthena

std::unordered_map<detray_id_type, Identifier::value_type> ActsTrk::GeometryIdMapping::m_detrayToAthena
private

Definition at line 106 of file GeometryIdMapping.h.


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