diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h index ec8c48f06842d38fe7e8b1339cac3c8b88dbec14..6382b7870dd02dd375d4c6babcc50f23c3e4b46a 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h @@ -284,6 +284,7 @@ namespace InDetDD { double sinStereoLocal(const HepGeom::Point3D<double> &globalPos) const; /// Element Surface + virtual Trk::Surface & surface(); virtual const Trk::Surface & surface() const; //@} @@ -645,7 +646,7 @@ namespace InDetDD { mutable double m_minPhi ATLAS_THREAD_SAFE;// Guarded by m_mutex mutable double m_maxPhi ATLAS_THREAD_SAFE;// Guarded by m_mutex - CxxUtils::CachedUniquePtr<Trk::Surface> m_surface; + CxxUtils::CachedUniquePtrT<Trk::Surface> m_surface; mutable std::vector<const Trk::Surface*> m_surfaces ATLAS_THREAD_SAFE; // Guarded by m_mutex const GeoAlignmentStore* m_geoAlignStore{}; diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx index ded850688698d692dcd6c9defe01805c4bc8e405..54b252f59128cff3b051da5ea420fa9723edad73 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx @@ -784,6 +784,13 @@ SiDetectorElement::sinStereoLocal(const HepGeom::Point3D<double> &globalPos) con } +Trk::Surface & +SiDetectorElement::surface() +{ + if (not m_surface) m_surface.set(std::make_unique<Trk::PlaneSurface>(*this)); + return *m_surface; +} + const Trk::Surface & SiDetectorElement::surface() const {