ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsGeometry
ActsGeometry
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
6
#include "
xAODMeasurementBase/MeasurementDefs.h
"
7
#include "Acts/Geometry/GeometryIdentifier.hpp"
8
#include "Acts/Utilities/Helpers.hpp"
9
#include <unordered_map>
10
11
namespace
Acts
{
12
class
Surface;
13
}
14
15
namespace
ActsTrk
{
16
using
DetectorElementKey
=
unsigned
int;
17
constexpr
unsigned
int
DETELEMENT_TYPE_SHIFT
= 28;
18
constexpr
unsigned
int
DETELEMENT_HASH_MASK
= ~(1u<<31|1u<<30|1u<<29|1u<<28);
19
inline
20
DetectorElementKey
makeDetectorElementKey
(
xAOD::UncalibMeasType
meas_type,
unsigned
int
identifier_hash) {
21
assert(
sizeof
(
xAOD::UncalibMeasType
) <=
sizeof
(std::size_t) );
22
assert(
static_cast<
std::size_t
>
( Acts::toUnderlying(meas_type)&((~
DETELEMENT_HASH_MASK
)>>
DETELEMENT_TYPE_SHIFT
)) ==
static_cast<
std::size_t
>
(meas_type));
23
assert( (identifier_hash &
DETELEMENT_HASH_MASK
) == identifier_hash);
24
return
(Acts::toUnderlying(meas_type) <<
DETELEMENT_TYPE_SHIFT
) | (identifier_hash &
DETELEMENT_HASH_MASK
);
25
}
26
28
struct
DetectorElementGeoInfo
{
29
Acts::GeometryIdentifier
geoId
{};
30
const
Acts::Surface*
surface
{
nullptr
};
31
};
32
33
struct
DetectorElementToActsGeometryIdMap
: std::unordered_map<ActsTrk::DetectorElementKey,
34
DetectorElementGeoInfo>
35
{
36
// utilities to abstract what is actually stored
37
static
DetectorElementGeoInfo
makeValue
(
const
Acts::GeometryIdentifier &
geo_id
,
38
const
Acts::Surface *surface =
nullptr
) {
39
return
DetectorElementGeoInfo
{
geo_id
, surface};
40
}
41
static
const
Acts::GeometryIdentifier &
getValue
(
const
value_type &element) {
42
return
element.second.geoId;
43
}
44
45
static
const
Acts::Surface *
getSurface
(
const
value_type &element) {
46
return
element.second.surface;
47
}
48
};
49
}
50
51
#endif
MeasurementDefs.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
ActsTrk::DETELEMENT_HASH_MASK
constexpr unsigned int DETELEMENT_HASH_MASK
Definition
DetectorElementToActsGeometryIdMap.h:18
ActsTrk::DETELEMENT_TYPE_SHIFT
constexpr unsigned int DETELEMENT_TYPE_SHIFT
Definition
DetectorElementToActsGeometryIdMap.h:17
ActsTrk::makeDetectorElementKey
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
Definition
DetectorElementToActsGeometryIdMap.h:20
ActsTrk::DetectorElementKey
unsigned int DetectorElementKey
Definition
DetectorElementToActsGeometryIdMap.h:16
Acts
This class is not to needed in AthSimulation.
Definition
MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/UtilFunctions.h:23
geo_id
Definition
geo_id.py:1
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition
MeasurementDefs.h:24
ActsTrk::DetectorElementGeoInfo
Geometry identifier and surface of a detector element.
Definition
DetectorElementToActsGeometryIdMap.h:28
ActsTrk::DetectorElementGeoInfo::surface
const Acts::Surface * surface
Definition
DetectorElementToActsGeometryIdMap.h:30
ActsTrk::DetectorElementGeoInfo::geoId
Acts::GeometryIdentifier geoId
Definition
DetectorElementToActsGeometryIdMap.h:29
ActsTrk::DetectorElementToActsGeometryIdMap
Definition
DetectorElementToActsGeometryIdMap.h:35
ActsTrk::DetectorElementToActsGeometryIdMap::makeValue
static DetectorElementGeoInfo makeValue(const Acts::GeometryIdentifier &geo_id, const Acts::Surface *surface=nullptr)
Definition
DetectorElementToActsGeometryIdMap.h:37
ActsTrk::DetectorElementToActsGeometryIdMap::getValue
static const Acts::GeometryIdentifier & getValue(const value_type &element)
Definition
DetectorElementToActsGeometryIdMap.h:41
ActsTrk::DetectorElementToActsGeometryIdMap::getSurface
static const Acts::Surface * getSurface(const value_type &element)
Surface of the detector element, or nullptr if none was stored.
Definition
DetectorElementToActsGeometryIdMap.h:45
Generated on
for ATLAS Offline Software by
1.17.0