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{trackGeoTool->trackingGeometry().get()},
14 m_detectorElementToGeometryIdMap{trackGeoTool->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 }
36 case MdtDriftCircleType:
37 case RpcStripType:
38 case TgcStripType:
39 case sTgcStripType:
40 case MMClusterType:{
41 return &xAOD::muonSurface(meas);
42 break;
43 }case Other: {
44 const auto* pMeas = static_cast<const xAOD::AuxiliaryMeasurement*>(meas);
45 return pMeas->surface().get();
46 }
47
48 default:
49 break;
50
51 }
52#ifndef NDEBUG
53 throw std::domain_error("xAODUncalibMeasSurfAcc() - Cannot decode surface type");
54#endif
55 return nullptr;
56 }
57}
Geometry helper tool extending the Tracking geometry service by the data dependency to fetch the geom...
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.
Athena definition of the Eigen plugin.
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
AuxiliaryMeasurement_v1 AuxiliaryMeasurement
UncalibMeasType
Define the type of the uncalibrated measurement.
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
static const Acts::GeometryIdentifier & getValue(const value_type &element)