ATLAS Offline Software
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 
11 namespace 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:{
27  assert(m_actsTrackingGeometry);
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 }
xAOD::UncalibratedMeasurement_v1::identifierHash
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
ActsTrk::detail::xAODUncalibMeasSurfAcc::get
const Acts::Surface * get(const xAOD::UncalibratedMeasurement *meas) const
Operator.
Definition: xAODUncalibMeasSurfAcc.cxx:19
UtilFunctions.h
ActsTrk::detail::xAODUncalibMeasSurfAcc::operator()
const Acts::Surface * operator()(const Acts::SourceLink &sourceLink) const
Operator called by the Acts API to fetch the surface.
Definition: xAODUncalibMeasSurfAcc.cxx:16
ActsTrk::ITrackingGeometryTool
Geometry helper tool extending the Tracking geometry service by the data dependency to fetch the geom...
Definition: ITrackingGeometryTool.h:24
xAODUncalibMeasCalibrator.h
xAOD::AuxiliaryMeasurement_v1::surface
const SurfacePtr_t & surface() const
Returns the reference to the Acts::Surface.
Definition: AuxiliaryMeasurement_v1.cxx:44
ActsTrk::detail::xAODUncalibMeasCalibrator::unpack
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
Definition: xAODUncalibMeasCalibrator.cxx:12
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
ActsTrk::detail::xAODUncalibMeasSurfAcc::xAODUncalibMeasSurfAcc
xAODUncalibMeasSurfAcc()=default
Empty default constructor -> conversion will crash for ID measurements.
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
ActsTrk::detail::xAODUncalibMeasSurfAcc::m_detectorElementToGeometryIdMap
const DetectorElementToActsGeometryIdMap * m_detectorElementToGeometryIdMap
Definition: xAODUncalibMeasSurfAcc.h:37
ActsTrk::makeDetectorElementKey
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
Definition: DetectorElementToActsGeometryIdMap.h:23
xAOD::AuxiliaryMeasurement_v1
Implementation of an uncalibrated AuxiliaryMeasurement which may serve as an external constraint in t...
Definition: AuxiliaryMeasurement_v1.h:24
ActsTrk::ITrackingGeometryTool::trackingGeometry
virtual std::shared_ptr< const Acts::TrackingGeometry > trackingGeometry() const =0
Access to the built Acts tracking geometry
xAOD::muonSurface
const Acts::Surface & muonSurface(const xAOD::UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
SurfaceOfMeasurementUtil.h
xAODUncalibMeasSurfAcc.h
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition: MeasurementDefs.h:25
ActsTrk::detail::xAODUncalibMeasSurfAcc::m_actsTrackingGeometry
const Acts::TrackingGeometry * m_actsTrackingGeometry
Definition: xAODUncalibMeasSurfAcc.h:36
ActsTrk::detail
Athena definition of the Eigen plugin.
Definition: MeasurementCalibratorBase.h:19
ActsTrk::DetectorElementToActsGeometryIdMap::getValue
static const Acts::GeometryIdentifier & getValue(const value_type &element)
Definition: DetectorElementToActsGeometryIdMap.h:36
AuxiliaryMeasurement.h
DetectorElementToActsGeometryIdMap.h