ATLAS Offline Software
Loading...
Searching...
No Matches
xAODUncalibMeasSurfAcc.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
10
11namespace ActsTrk::detail{
13 m_actsTrackingGeometry{trackGeoSvc->trackingGeometry().get()},
14 m_detectorElementToGeometryIdMap{trackGeoSvc->surfaceIdMap()}{}
15
16 const Acts::Surface* xAODUncalibMeasSurfAcc::operator()(const Acts::SourceLink& sourceLink) const {
17 return get(xAODUncalibMeasCalibrator::unpack(sourceLink));
18 }
19 const Acts::Surface* xAODUncalibMeasSurfAcc::get(const xAOD::UncalibratedMeasurement* meas) const {
20 switch (meas->type()) {
21 using enum xAOD::UncalibMeasType;
23 case PixelClusterType:
24 case StripClusterType:
25 case HGTDClusterType:{
28 const auto geoKey = makeDetectorElementKey(meas->type(), meas->identifierHash());
29 const auto geoid_iter = m_detectorElementToGeometryIdMap->find(geoKey);
30 if (geoid_iter == m_detectorElementToGeometryIdMap->end()) {
31 return nullptr;
32 }
34 if (const Acts::Surface* surface = DetectorElementToActsGeometryIdMap::getSurface(*geoid_iter)) {
35 return surface;
36 }
38 }
40 case MdtDriftCircleType:
41 case RpcStripType:
42 case TgcStripType:
43 case sTgcStripType:
44 case MMClusterType:{
45 return &xAOD::muonSurface(meas);
46 break;
47 }case Other: {
48 const auto* pMeas = static_cast<const xAOD::AuxiliaryMeasurement*>(meas);
49 return pMeas->surface().get();
50 }
51
52 default:
53 break;
54
55 }
56#ifndef NDEBUG
57 throw std::domain_error("xAODUncalibMeasSurfAcc() - Cannot decode surface type");
58#endif
59 return nullptr;
60 }
61}
Interface class for the ATLAS service providing the ActsTrackingGeometry.
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
const Acts::Surface * get(const xAOD::UncalibratedMeasurement *meas) const
Operator.
const DetectorElementToActsGeometryIdMap * m_detectorElementToGeometryIdMap
const Acts::TrackingGeometry * m_actsTrackingGeometry
const Acts::Surface * operator()(const Acts::SourceLink &sourceLink) const
Operator called by the Acts API to fetch the surface.
xAODUncalibMeasSurfAcc()=default
Empty default constructor -> conversion will crash for ID measurements.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
Hash functions to pack the source link into unordered_maps / unordered_sets.
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
AuxiliaryMeasurement_v1 AuxiliaryMeasurement
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
UncalibMeasType
Define the type of the uncalibrated measurement.
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
static const Acts::GeometryIdentifier & getValue(const value_type &element)
static const Acts::Surface * getSurface(const value_type &element)
Surface of the detector element, or nullptr if none was stored.