From e808b76e4a320879e6d3d99bcfb64f2ab3bc556f Mon Sep 17 00:00:00 2001 From: christos <christos@cern.ch> Date: Thu, 19 Nov 2020 04:41:38 +0000 Subject: [PATCH] TrkGeometry Layers: Remove unneeded virtual methods.Also mark methods as final where applicable/possible --- .../TrkGeometry/TrkGeometry/ConeLayer.h | 32 ++++++---- .../TrkGeometry/TrkGeometry/CylinderLayer.h | 60 +++++++++++-------- .../TrkGeometry/TrkGeometry/DiscLayer.h | 52 +++++++++------- .../TrkGeometry/TrkGeometry/Layer.h | 34 ++++++----- .../TrkGeometry/TrkGeometry/NavigationLayer.h | 59 +++++++++--------- .../TrkGeometry/TrkGeometry/PlaneLayer.h | 29 +++++---- .../TrkGeometry/SubtractedCylinderLayer.h | 43 +++++++------ .../TrkGeometry/SubtractedPlaneLayer.h | 27 +++++---- 8 files changed, 191 insertions(+), 145 deletions(-) diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ConeLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ConeLayer.h index 6cb89d455cc..cca967afd68 100644 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ConeLayer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ConeLayer.h @@ -95,27 +95,35 @@ namespace Trk { /** getting the MaterialProperties back - for post-update*/ virtual double postUpdateMaterialFactor(const Trk::TrackParameters& par, Trk::PropDirection dir) const override; - + /** move the Layer */ - virtual void moveLayer(Amg::Transform3D& shift) override; + virtual void moveLayer(Amg::Transform3D& shift) override final; /** move the Layer */ - virtual void moveLayer ATLAS_NOT_THREAD_SAFE (Amg::Transform3D& shift) const override{ - const_cast<ConeLayer*>(this)->moveLayer(shift); + virtual void moveLayer + ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& shift) const override final + { + const_cast<ConeLayer*>(this)->moveLayer(shift); }; private: /** Resize the layer to the tracking volume - not (yet) supported for ConeLayer */ void resize(const VolumeBounds&, double) const {} - - /** Resize the layer to the tracking volume - not supported since this an entry layer method*/ - virtual void resizeAndRepositionLayer(const VolumeBounds&, const Amg::Vector3D&, double) override {} - - /** Resize the layer to the tracking volume - not supported since this an entry layer method*/ - virtual void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - const Amg::Vector3D&, double) const override {} - + /** Resize the layer to the tracking volume - not supported since this an + * entry layer method*/ + virtual void resizeAndRepositionLayer(const VolumeBounds&, + const Amg::Vector3D&, + double) override final + {} + + /** Resize the layer to the tracking volume - not supported since this an + * entry layer method*/ + virtual void resizeAndRepositionLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, + const Amg::Vector3D&, + double) const override final + {} }; } // end of namespace diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h index e755a68cd7d..05a102ecdf9 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h @@ -135,47 +135,57 @@ class OverlapDescriptor; const BoundaryCheck& bcheck, bool resolveSubSurfaces = 0, const ICompatibilityEstimator* ice = nullptr) const override; - - /** move the Layer */ - virtual void moveLayer ( Amg::Transform3D& shift ) override; - - /** move the Layer */ - virtual void moveLayer ATLAS_NOT_THREAD_SAFE ( Amg::Transform3D& shift ) const override{ - const_cast<CylinderLayer*>(this)->moveLayer(shift); - } - - private: - /** Resize the layer to the tracking volume - only works for CylinderVolumeBouns */ - virtual void resizeLayer(const VolumeBounds& vBounds, double envelope) override; - - /** Resize the layer to the tracking volume - only works for CylinderVolumeBouns */ - virtual void resizeLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds& vBounds, - double envelope) const override + + /** move the Layer */ + virtual void moveLayer(Amg::Transform3D& shift) override final; + + /** move the Layer */ + virtual void moveLayer + ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& shift) const override final + { + const_cast<CylinderLayer*>(this)->moveLayer(shift); + } + + private: + /** Resize the layer to the tracking volume - only works for + * CylinderVolumeBouns */ + virtual void resizeLayer(const VolumeBounds& vBounds, + double envelope) override final; + + /** Resize the layer to the tracking volume - only works for + * CylinderVolumeBouns */ + virtual void resizeLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds& vBounds, + double envelope) const override final { - const_cast<CylinderLayer*>(this)->resizeLayer(vBounds,envelope); + const_cast<CylinderLayer*>(this)->resizeLayer(vBounds, envelope); } /** Resize the layer to the tracking volume */ virtual void resizeAndRepositionLayer(const VolumeBounds& vBounds, const Amg::Vector3D& cCenter, - double envelope) override; + double envelope) override final; /** Resize the layer to the tracking volume */ virtual void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds& vBounds, const Amg::Vector3D& cCenter, - double envelope) const override + double envelope) const override final { - const_cast<CylinderLayer*>(this)->resizeAndRepositionLayer(vBounds,cCenter,envelope); + const_cast<CylinderLayer*>(this)->resizeAndRepositionLayer( + vBounds, cCenter, envelope); } + /** Surface seen on approach - if not defined differently, it is the + * surfaceRepresentation() */ + const Surface& approachSurface( + const Amg::Vector3D& pos, + const Amg::Vector3D& dir, + const BoundaryCheck& bcheck) const; + /** build approach surfaces */ void buildApproachDescriptor(); - - /** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */ - const Surface& approachSurface(const Amg::Vector3D& pos, - const Amg::Vector3D& dir, - const BoundaryCheck& bcheck) const; + protected: /** surfaces on approach to the layer */ diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h index 8bb2b812e1d..960a8a38270 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h @@ -112,38 +112,46 @@ namespace Trk { virtual double postUpdateMaterialFactor(const Trk::TrackParameters& par, Trk::PropDirection dir) const override; - /** move the Layer non-const*/ - virtual void moveLayer( Amg::Transform3D& shift ) override; - - /** move the Layer const , performas const_cast */ - virtual void moveLayer ATLAS_NOT_THREAD_SAFE ( Amg::Transform3D& shift ) const override{ - const_cast<DiscLayer*> (this)->moveLayer(shift); - } - - private: - /** Resize the layer to the tracking volume - only works for CylinderVolumeBouns */ - virtual void resizeLayer(const VolumeBounds& vBounds, double envelope) override; + /** move the Layer non-const*/ + virtual void moveLayer(Amg::Transform3D& shift) override final; + + /** move the Layer const , performas const_cast */ + virtual void moveLayer + ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& shift) const override final + { + const_cast<DiscLayer*>(this)->moveLayer(shift); + } + + private: + /** Resize the layer to the tracking volume - only works for + * CylinderVolumeBouns */ + virtual void resizeLayer(const VolumeBounds& vBounds, + double envelope) override final; /** Resize the layer to the tracking volume - only works for * CylinderVolumeBouns . performs const cast */ - virtual void resizeLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds& vBounds, - double envelope) const override + virtual void resizeLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds& vBounds, + double envelope) const override final { - const_cast<DiscLayer*> (this)->resizeLayer(vBounds,envelope); + const_cast<DiscLayer*>(this)->resizeLayer(vBounds, envelope); } /** Resize the layer to the tracking volume - not implemented.*/ virtual void resizeAndRepositionLayer(const VolumeBounds& vBounds, const Amg::Vector3D& cCenter, - double envelop) override; - - /** Resize the layer to the tracking volume - not implemented . Performs const cast*/ - virtual void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE (const VolumeBounds& vBounds, - const Amg::Vector3D& cCenter, - double envelop) const override{ - const_cast<DiscLayer*> (this)->resizeAndRepositionLayer(vBounds,cCenter,envelop); + double envelop) override final; + + /** Resize the layer to the tracking volume - not implemented . Performs + * const cast*/ + virtual void resizeAndRepositionLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds& vBounds, + const Amg::Vector3D& cCenter, + double envelop) const override final + { + const_cast<DiscLayer*>(this)->resizeAndRepositionLayer( + vBounds, cCenter, envelop); } - /** build approach surfaces */ void buildApproachDescriptor(); diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/Layer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/Layer.h index 39654a46a8b..d5f41425c6c 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/Layer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/Layer.h @@ -181,24 +181,26 @@ namespace Trk { const ICompatibilityEstimator* ice = nullptr) const; /** get compatible surfaces starting from charged parameters */ - virtual size_t compatibleSurfaces(std::vector<SurfaceIntersection>& cSurfaces, - const TrackParameters& pars, - PropDirection pdir, - const BoundaryCheck& bcheck, - bool materialSurfacesOnly = true, - const Surface* startSurface = nullptr, - const Surface* endSurface = nullptr, - const ICompatibilityEstimator* ice = nullptr) const; + size_t compatibleSurfaces( + std::vector<SurfaceIntersection>& cSurfaces, + const TrackParameters& pars, + PropDirection pdir, + const BoundaryCheck& bcheck, + bool materialSurfacesOnly = true, + const Surface* startSurface = nullptr, + const Surface* endSurface = nullptr, + const ICompatibilityEstimator* ice = nullptr) const; /** get compatible surfaces starting from neutral parameters */ - virtual size_t compatibleSurfaces(std::vector<SurfaceIntersection>& cSurfaces, - const NeutralParameters& pars, - PropDirection pdir, - const BoundaryCheck& bcheck, - bool materialSurfacesOnly = true, - const Surface* startSurface = nullptr, - const Surface* endSurface = nullptr, - const ICompatibilityEstimator* ice = nullptr) const; + size_t compatibleSurfaces( + std::vector<SurfaceIntersection>& cSurfaces, + const NeutralParameters& pars, + PropDirection pdir, + const BoundaryCheck& bcheck, + bool materialSurfacesOnly = true, + const Surface* startSurface = nullptr, + const Surface* endSurface = nullptr, + const ICompatibilityEstimator* ice = nullptr) const; /** Has sub-structure method: - sub-structure depending on : diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/NavigationLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/NavigationLayer.h index f534f1cfd85..08350ca8c1b 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/NavigationLayer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/NavigationLayer.h @@ -78,36 +78,39 @@ namespace Trk { /** getting the next/overlapping Surface */ const Surface* overlapSurface(const TrackParameters& tp, const Surface* sf = nullptr) const; - + /** move the Layer */ - virtual void moveLayer( Amg::Transform3D& ) override; + virtual void moveLayer(Amg::Transform3D&) override final; /** move the Layer */ - virtual void moveLayer ATLAS_NOT_THREAD_SAFE ( Amg::Transform3D& ) const override; - protected: - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeLayer(const VolumeBounds&, double) override {} - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - double) const override - {} - - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeAndRepositionLayer(const VolumeBounds&, - const Amg::Vector3D&, - double) override - {} - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - const Amg::Vector3D&, - double) const override - {} - - Surface* - m_surfaceRepresentation; //!< for the navigation Volume the surface is a private member */ - - private: - /**Default Constructor*/ - NavigationLayer() {} + virtual void moveLayer + ATLAS_NOT_THREAD_SAFE(Amg::Transform3D&) const override final; + + protected: + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeLayer(const VolumeBounds&, double) override final {} + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, double) const override final + {} + + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeAndRepositionLayer(const VolumeBounds&, + const Amg::Vector3D&, + double) override final + {} + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeAndRepositionLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, + const Amg::Vector3D&, + double) const override final + {} + + Surface* m_surfaceRepresentation; //!< for the navigation Volume the + //!< surface is a private member */ + + private: + /**Default Constructor*/ + NavigationLayer() {} }; diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/PlaneLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/PlaneLayer.h index e4f1fde8daf..f5edceef586 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/PlaneLayer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/PlaneLayer.h @@ -187,28 +187,33 @@ class LayerMaterialProperties; virtual double postUpdateMaterialFactor(const Trk::TrackParameters& par, Trk::PropDirection dir) const override; - /** move the Layer */ - virtual void moveLayer( Amg::Transform3D& shift ) override; /** move the Layer */ - virtual void moveLayer ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& shift) const override + virtual void moveLayer(Amg::Transform3D& shift) override final; + /** move the Layer */ + virtual void moveLayer + ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& shift) const override final { const_cast<PlaneLayer*>(this)->moveLayer(shift); } private: - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeLayer(const VolumeBounds&, double) override{} /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - double) const override + virtual void resizeLayer(const VolumeBounds&, double) override final {} + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, double) const override final {} - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeAndRepositionLayer(const VolumeBounds&, const Amg::Vector3D&, double) override {} /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - const Amg::Vector3D&, - double) const override + virtual void resizeAndRepositionLayer(const VolumeBounds&, + const Amg::Vector3D&, + double) override final + {} + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeAndRepositionLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, + const Amg::Vector3D&, + double) const override final {} }; diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedCylinderLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedCylinderLayer.h index d59530b8393..285951de520 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedCylinderLayer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedCylinderLayer.h @@ -71,30 +71,37 @@ class OverlapDescriptor; using CylinderSurface::insideBounds; /** move the Layer */ - virtual void moveLayer( Amg::Transform3D& shift ) override; + virtual void moveLayer(Amg::Transform3D& shift) override final; /** move the Layer */ - virtual void moveLayer ATLAS_NOT_THREAD_SAFE ( Amg::Transform3D& shift ) const override{ - const_cast<SubtractedCylinderLayer*> (this)->moveLayer(shift); + virtual void moveLayer + ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& shift) const override final + { + const_cast<SubtractedCylinderLayer*>(this)->moveLayer(shift); } - private: - /** Resize the layer to the tracking volume - not implemented*/ - virtual void resizeLayer(const VolumeBounds&, double) override {} - /** Resize the layer to the tracking volume - not implemented*/ - virtual void resizeLayer ATLAS_NOT_THREAD_SAFE (const VolumeBounds&, double) const override {} - - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeAndRepositionLayer(const VolumeBounds&, const Amg::Vector3D&, double) override {} - - /** Resize the layer to the tracking volume - not implemented */ - virtual void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - const Amg::Vector3D&, - double) const override - {} + /** Resize the layer to the tracking volume - not implemented*/ + virtual void resizeLayer(const VolumeBounds&, double) override final {} + /** Resize the layer to the tracking volume - not implemented*/ + virtual void resizeLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, double) const override final + {} + + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeAndRepositionLayer(const VolumeBounds&, + const Amg::Vector3D&, + double) override final + {} + + /** Resize the layer to the tracking volume - not implemented */ + virtual void resizeAndRepositionLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, + const Amg::Vector3D&, + double) const override final + {} }; - + } // end of namespace #endif // TRKGEOMETRY_SUBTRACTEDCYLINDERLAYER_H diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedPlaneLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedPlaneLayer.h index 209def46bd5..cf6db7f656a 100755 --- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedPlaneLayer.h +++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/SubtractedPlaneLayer.h @@ -66,31 +66,34 @@ namespace Trk { double postUpdateMaterialFactor(const Trk::TrackParameters& par, Trk::PropDirection dir) const override; /** move the Layer */ - void moveLayer( Amg::Transform3D& shift ) override; + virtual void moveLayer(Amg::Transform3D& shift) override final; /** move the Layer */ - void moveLayer ATLAS_NOT_THREAD_SAFE ( Amg::Transform3D& shift ) const override{ - const_cast<SubtractedPlaneLayer*> (this)->moveLayer(shift); + virtual void moveLayer + ATLAS_NOT_THREAD_SAFE(Amg::Transform3D& shift) const override final + { + const_cast<SubtractedPlaneLayer*>(this)->moveLayer(shift); } - + private: /** Resize the layer to the tracking volume - not implemented*/ - void resizeLayer(const VolumeBounds&, double) override {} + virtual void resizeLayer(const VolumeBounds&, double) override final {} /** Resize the layer to the tracking volume - not implemented*/ - void resizeLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - double) const override + virtual void resizeLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, double) const override final {} /** Resize the layer to the tracking volume - not implemented */ - void resizeAndRepositionLayer(const VolumeBounds&, + virtual void resizeAndRepositionLayer(const VolumeBounds&, const Amg::Vector3D&, - double) override + double) override final {} /** Resize the layer to the tracking volume - not implemented */ - void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, - const Amg::Vector3D&, - double) const override + virtual void resizeAndRepositionLayer + ATLAS_NOT_THREAD_SAFE(const VolumeBounds&, + const Amg::Vector3D&, + double) const override final {} }; -- GitLab