ATLAS Offline Software
Loading...
Searching...
No Matches
DetectorElementToActsGeometryIdMap.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4#ifndef ACTSTRK_DETECTORELEMENTTOACTSGEOMETRYIDMAP_H
5#define ACTSTRK_DETECTORELEMENTTOACTSGEOMETRYIDMAP_H
7#include "Acts/Geometry/GeometryIdentifier.hpp"
8#include "Acts/Utilities/Helpers.hpp"
9#include <unordered_map>
10
11namespace ActsTrk {
12 using DetectorElementKey=unsigned int;
13 constexpr unsigned int DETELEMENT_TYPE_SHIFT = 28;
14 constexpr unsigned int DETELEMENT_HASH_MASK = ~(1u<<31|1u<<30|1u<<29|1u<<28);
15 inline
16 DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash) {
17 assert( sizeof(xAOD::UncalibMeasType) <= sizeof(std::size_t) );
18 assert( static_cast<std::size_t>( Acts::toUnderlying(meas_type)&((~DETELEMENT_HASH_MASK)>>DETELEMENT_TYPE_SHIFT)) == static_cast<std::size_t>(meas_type));
19 assert( (identifier_hash & DETELEMENT_HASH_MASK) == identifier_hash);
20 return (Acts::toUnderlying(meas_type) << DETELEMENT_TYPE_SHIFT) | (identifier_hash & DETELEMENT_HASH_MASK);
21 }
22 struct DetectorElementToActsGeometryIdMap : std::unordered_map<ActsTrk::DetectorElementKey,
23 Acts::GeometryIdentifier>
24 {
25 // utilities to abstract what is actually stored
26 static const Acts::GeometryIdentifier &makeValue(const Acts::GeometryIdentifier &geo_id) {
27 return geo_id;
28 }
29 static const Acts::GeometryIdentifier &getValue(const value_type &element) {
30 return element.second;
31 }
32 };
33}
34
35#endif
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr unsigned int DETELEMENT_HASH_MASK
constexpr unsigned int DETELEMENT_TYPE_SHIFT
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
UncalibMeasType
Define the type of the uncalibrated measurement.
static const Acts::GeometryIdentifier & makeValue(const Acts::GeometryIdentifier &geo_id)
static const Acts::GeometryIdentifier & getValue(const value_type &element)