From f72d97a0e68ca3da38c90a6dbc8e7a9b072079df Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 3 Nov 2020 04:26:58 +0100
Subject: [PATCH] Trk::Surfaces add final when applicable/possible

---
 .../TrkDetDescrUtils/BinnedArray1D.h          |  2 +-
 .../TrkDetDescrUtils/BinnedArray1D1D.h        |  2 +-
 .../TrkDetDescrUtils/BinnedArray1D1D1D.h      |  2 +-
 .../TrkDetDescrUtils/BinnedArray2D.h          |  2 +-
 .../TrkDetDescrUtils/NavBinnedArray1D.h       |  2 +-
 .../TrkSurfaces/TrkSurfaces/CylinderBounds.h  | 14 +++++------
 .../TrkSurfaces/TrkSurfaces/DiamondBounds.h   | 18 +++++++-------
 .../TrkSurfaces/TrkSurfaces/DiscBounds.h      | 16 ++++++-------
 .../TrkSurfaces/TrkSurfaces/DiscSurface.h     |  4 ++--
 .../TrkSurfaces/DiscTrapezoidalBounds.h       | 12 +++++-----
 .../TrkSurfaces/TrkSurfaces/EllipseBounds.h   | 16 ++++++-------
 .../TrkSurfaces/TrkSurfaces/NoBounds.h        | 18 +++++++-------
 .../TrkSurfaces/TrkSurfaces/PerigeeSurface.h  | 24 +++++++++----------
 .../TrkSurfaces/TrkSurfaces/PlaneSurface.h    |  6 ++---
 .../TrkSurfaces/TrkSurfaces/RectangleBounds.h | 12 +++++-----
 .../TrkSurfaces/StraightLineSurface.h         | 14 +++++------
 .../TrkSurfaces/TrkSurfaces/TriangleBounds.h  | 14 +++++------
 17 files changed, 89 insertions(+), 89 deletions(-)

diff --git a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D.h b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D.h
index 162179368dc9..fe6fcf1a9413 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D.h
@@ -32,7 +32,7 @@ namespace Trk {
    */
 
 template<class T>
-class BinnedArray1DT : public BinnedArrayT<T>
+class BinnedArray1DT final: public BinnedArrayT<T>
 {
 
 public:
diff --git a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D.h b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D.h
index 179df9c706e3..157a66e78b7a 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D.h
@@ -30,7 +30,7 @@ namespace Trk {
  */
 
 template<class T>
-class BinnedArray1D1DT : public BinnedArrayT<T>
+class BinnedArray1D1DT final: public BinnedArrayT<T>
 {
 
 public:
diff --git a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D1D.h b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D1D.h
index 4c62297f446e..9f65e2774d1e 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D1D.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray1D1D1D.h
@@ -32,7 +32,7 @@ namespace Trk {
 */
 
 template<class T>
-class BinnedArray1D1D1DT : public BinnedArrayT<T>
+class BinnedArray1D1D1DT final : public BinnedArrayT<T>
 {
 
 public:
diff --git a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray2D.h b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray2D.h
index c01aefc23e88..66a46b087446 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray2D.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArray2D.h
@@ -33,7 +33,7 @@ namespace Trk {
    */
 
 template<class T>
-class BinnedArray2DT : public BinnedArrayT<T>
+class BinnedArray2DT final: public BinnedArrayT<T>
 {
 
 public:
diff --git a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/NavBinnedArray1D.h b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/NavBinnedArray1D.h
index e96003042dc7..734916db5e93 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/NavBinnedArray1D.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/NavBinnedArray1D.h
@@ -31,7 +31,7 @@ the position within mother navigation object
 */
 
 template<class T>
-class NavBinnedArray1DT : public BinnedArrayT<T>
+class NavBinnedArray1DT final : public BinnedArrayT<T>
 {
 
 public:
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.h
index 517ef5816aa5..2a20c81ca0f3 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.h
@@ -89,11 +89,11 @@ public:
   virtual CylinderBounds* clone() const override;
 
   /** Return the bounds type */
-  virtual BoundsType type() const override { return SurfaceBounds::Cylinder; }
+  virtual BoundsType type() const override final { return SurfaceBounds::Cylinder; }
 
   /**This method checks if a LocalPosition is inside z bounds and rphi value- interface method */
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1, double tol2) const override;
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1, double tol2) const override final;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
 
   /**This method checks if a GlobalPosition is inside the Cylinder - not an interface method,
     assumes that GlobalPosition is in the right frame*/
@@ -101,20 +101,20 @@ public:
 
   /** This method checks inside bounds in loc1
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /** This method checks inside bounds in loc1
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary ( > 0 if outside and <=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /**This method checks if a LocalPosition is inside z bounds and inside the radius (for straws) */
   bool insideRadius(const Amg::Vector2D& locpo, double tol) const;
 
   /**This method returns the radius*/
-  virtual double r() const override;
+  virtual double r() const override final;
 
   /**This method returns the average phi*/
   double averagePhi() const;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.h
index 45017b57137d..f7b2a56b3ee3 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.h
@@ -70,7 +70,7 @@ public:
   virtual bool operator==(const SurfaceBounds& diabo) const override;
 
   /** Return the bounds type */
-  virtual BoundsType type() const override { return SurfaceBounds::Diamond; }
+  virtual BoundsType type() const override final { return SurfaceBounds::Diamond; }
 
   /**This method returns the halflength in X at minimal Y (first coordinate of local surface frame)*/
   double minHalflengthX() const;
@@ -86,7 +86,7 @@ public:
   double halflengthY2() const;
 
   /**This method returns the maximal extension on the local plane*/
-  virtual double r() const override;
+  virtual double r() const override final;
 
   /**This method returns the opening angle alpha in point A   */
   double alpha1() const;
@@ -95,31 +95,31 @@ public:
   double alpha2() const;
 
   /** The orientation of the Diamond is according to the figure */
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
 
   /** This method checks inside bounds in loc1
   - loc1/loc2 correspond to the natural coordinates of the surface
   - As loc1/loc2 are correlated the single check doesn't make sense :
      -> check is done on enclosing Rectangle !
   */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /** This method checks inside bounds in loc2
   - loc1/loc2 correspond to the natural coordinates of the surface
   - As loc1/loc2 are correlated the single check doesn't make sense :
      -> check is done on enclosing Rectangle !
   */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary ( > 0 if outside and <=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /** Output Method for MsgStream*/
-  virtual MsgStream& dump(MsgStream& sl) const override;
+  virtual MsgStream& dump(MsgStream& sl) const override final;
 
   /** Output Method for std::ostream */
-  virtual std::ostream& dump(std::ostream& sl) const override;
+  virtual std::ostream& dump(std::ostream& sl) const override final;
 
 private:
   friend class ::DiamondBoundsCnv_p1;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.h
index fef234080af4..3a3bc3f5a812 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.h
@@ -78,26 +78,26 @@ public:
   virtual bool operator==(const SurfaceBounds& sbo) const override;
 
   /**Virtual constructor*/
-  virtual DiscBounds* clone() const override;
+  virtual DiscBounds* clone() const override final;
 
   /** Return the type - mainly for persistency */
-  virtual SurfaceBounds::BoundsType type() const override { return SurfaceBounds::Disc; }
+  virtual SurfaceBounds::BoundsType type() const override final { return SurfaceBounds::Disc; }
 
   /**This method cheks if the radius given in the LocalPosition is inside [rMin,rMax]
      if only tol1 is given and additional in the phi sector is tol2 is given */
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
 
   /** This method checks inside bounds in loc1
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /** This method checks inside bounds in loc2
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary ( > 0 if outside and <=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /**This method returns inner radius*/
   double rMin() const;
@@ -106,7 +106,7 @@ public:
   double rMax() const;
 
   /**This method returns the maximum expansion on the plane (=rMax)*/
-  virtual double r() const override;
+  virtual double r() const override final;
 
   /**This method returns the average phi*/
   double averagePhi() const;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h
index 4c42a89311fb..ea90f5c6f942 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h
@@ -167,7 +167,7 @@ public:
      For the Disc this is @f$ (R*cos(\phi), R*sin(\phi),0)*transform() @f$
      Where  @f$ r,  \phi @f$ denote the r(), averagePhi() of the Bounds.
    */
-  virtual const Amg::Vector3D& globalReferencePoint() const override;
+  virtual const Amg::Vector3D& globalReferencePoint() const override final; 
 
   /**This method returns the bounds by reference*/
   const SurfaceBounds& bounds() const override;
@@ -177,7 +177,7 @@ public:
                             double tol1 = 0.,
                             double tol2 = 0.) const override;
   virtual bool insideBoundsCheck(const Amg::Vector2D& locpos,
-                                 const BoundaryCheck& bchk) const override;
+                                 const BoundaryCheck& bchk) const override final;
 
   /** This method returns true if the GlobalPosition is on the Surface for both,
     within or without check of whether the local position is inside boundaries
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscTrapezoidalBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscTrapezoidalBounds.h
index e64ec1287ea0..a5a858435077 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscTrapezoidalBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscTrapezoidalBounds.h
@@ -79,23 +79,23 @@ public:
   virtual DiscTrapezoidalBounds* clone() const override;
 
   /** Return the type - mainly for persistency */
-  virtual SurfaceBounds::BoundsType type() const override { return SurfaceBounds::DiscTrapezoidal; }
+  virtual SurfaceBounds::BoundsType type() const override final { return SurfaceBounds::DiscTrapezoidal; }
 
   /**This method cheks if the radius given in the LocalPosition is inside [rMin,rMax]
      if only tol1 is given and additional in the phi sector is tol2 is given */
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
 
   /** This method checks inside bounds in loc1
       - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /** This method checks inside bounds in loc2
       - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary ( > 0 if outside and <=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /**This method returns inner radius*/
   double rMin() const;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.h
index 2d07e63d18ec..d67b18cf7a91 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.h
@@ -78,24 +78,24 @@ public:
   virtual bool operator==(const SurfaceBounds& sbo) const override;
 
   /**Virtual constructor*/
-  virtual EllipseBounds* clone() const override;
+  virtual EllipseBounds* clone() const override final;
 
   /** Return the type of the bounds for persistency */
-  virtual BoundsType type() const override { return SurfaceBounds::Ellipse; }
+  virtual BoundsType type() const override final { return SurfaceBounds::Ellipse; }
 
   /**This method checks if the point given in the local coordinates is between two ellipsoids
      if only tol1 is given and additional in the phi sector is tol2 is given */
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
 
   /**Check for inside first local coordinate */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /**Check for inside second local coordinate */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary ( > 0 if outside and <=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /**This method returns first inner radius*/
   double rMinX() const;
@@ -110,7 +110,7 @@ public:
   double rMaxY() const;
 
   /**This method returns the maximum expansion on the plane (=max(rMaxX,rMaxY))*/
-  virtual double r() const override;
+  virtual double r() const override final;
 
   /**This method returns the average phi*/
   double averagePhi() const;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/NoBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/NoBounds.h
index 47a13fb1f332..19d82c451c05 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/NoBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/NoBounds.h
@@ -42,30 +42,30 @@ public:
   virtual SurfaceBounds::BoundsType type() const override { return SurfaceBounds::Other; }
 
   /** Method inside() returns true for any case */
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
   /** This method checks inside bounds in loc1
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /** This method checks inside bounds in loc2
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary (=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /** Clone method to complete inherited interface */
-  virtual NoBounds* clone() const override;
+  virtual NoBounds* clone() const override final;
 
   /** r() method to complete inherited interface */
-  virtual double r() const override;
+  virtual double r() const override final;
 
   /** Output Method for MsgStream*/
-  virtual MsgStream& dump(MsgStream& sl) const override;
+  virtual MsgStream& dump(MsgStream& sl) const override final;
 
   /** Output Method for std::ostream */
-  virtual std::ostream& dump(std::ostream& sl) const override;
+  virtual std::ostream& dump(std::ostream& sl) const override final;
 
 private:
 };
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
index 81aae6c7e1b2..b90e281c1775 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
@@ -66,7 +66,7 @@ public:
   virtual ~PerigeeSurface() = default;
 
   /**Virtual constructor*/
-  virtual PerigeeSurface* clone() const override;
+  virtual PerigeeSurface* clone() const override final;
 
   /**Assignment operator*/
   PerigeeSurface& operator=(const PerigeeSurface& slsf);
@@ -134,18 +134,18 @@ public:
 
   /**Return method for transfromation, overwrites the transform() form base
    * class*/
-  virtual const Amg::Transform3D& transform() const override;
+  virtual const Amg::Transform3D& transform() const override final;
 
   /**Return method for surface center infromation, overwrites the center() form
    * base class*/
-  virtual const Amg::Vector3D& center() const override;
+  virtual const Amg::Vector3D& center() const override final;
 
   /**Return method for surface center infromation, overwrites the center() form
    * base class*/
-  virtual const Amg::Vector3D& normal() const override;
+  virtual const Amg::Vector3D& normal() const override final;
 
   /**Returns a normal vector at a specific localPosition*/
-  virtual const Amg::Vector3D* normal(const Amg::Vector2D& lp) const override;
+  virtual const Amg::Vector3D* normal(const Amg::Vector2D& lp) const override final;
 
   /** Return the measurement frame - this is needed for alignment, in particular
      for StraightLine and Perigee Surface
@@ -153,7 +153,7 @@ public:
    */
   virtual Amg::RotationMatrix3D measurementFrame(
     const Amg::Vector3D& glopos,
-    const Amg::Vector3D& glomom) const override;
+    const Amg::Vector3D& glomom) const override final;
 
   /** Local to global method:
       Take care that by just providing locR and locZ the global position cannot
@@ -234,31 +234,31 @@ public:
 
   /** the pathCorrection for derived classes with thickness */
   virtual double pathCorrection(const Amg::Vector3D&,
-                                const Amg::Vector3D&) const override;
+                                const Amg::Vector3D&) const override final;
 
   /**This method checks if a globalPosition in on the Surface or not*/
   virtual bool isOnSurface(const Amg::Vector3D& glopo,
                            BoundaryCheck bchk = true,
                            double tol1 = 0.,
-                           double tol2 = 0.) const override;
+                           double tol2 = 0.) const override final;
 
   /**This surface calls the iside method of the bounds*/
   virtual bool insideBounds(const Amg::Vector2D& locpos,
                             double tol1 = 0.,
-                            double tol2 = 0.) const override;
+                            double tol2 = 0.) const override final;
 
   virtual bool insideBoundsCheck(const Amg::Vector2D& locpos,
-                                 const BoundaryCheck& bchk) const override;
+                                 const BoundaryCheck& bchk) const override final;
 
   /** Special method for StraightLineSurface - provides the Line direction from
    * cache: speedup */
   const Amg::Vector3D& lineDirection() const;
 
   /** Return bounds() method */
-  virtual const NoBounds& bounds() const override;
+  virtual const NoBounds& bounds() const override final;
 
   /** Return properly formatted class name for screen output */
-  virtual std::string name() const override;
+  virtual std::string name() const override final;
 
   /** Output Method for MsgStream*/
   virtual MsgStream& dump(MsgStream& sl) const override;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h
index 2bd1c76c467b..345d1099b7db 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h
@@ -211,7 +211,7 @@ public:
                             double tol2 = 0.) const override;
 
   virtual bool insideBoundsCheck(const Amg::Vector2D& locpos,
-                                 const BoundaryCheck& bchk) const override;
+                                 const BoundaryCheck& bchk) const override final;
 
   /** This method returns true if the GlobalPosition is on the Surface for both,
     within or without check of whether the local position is inside boundaries
@@ -219,7 +219,7 @@ public:
   virtual bool isOnSurface(const Amg::Vector3D& glopo,
                            BoundaryCheck bchk = true,
                            double tol1 = 0.,
-                           double tol2 = 0.) const override;
+                           double tol2 = 0.) const override final;
 
   /** Specified for PlaneSurface: LocalToGlobal method without dynamic memory
    * allocation */
@@ -283,7 +283,7 @@ public:
     bool Bound) const override final;
 
   /** Return properly formatted class name for screen output */
-  virtual std::string name() const override ;
+  virtual std::string name() const override;
 
 protected: //!< data members
   template<class SURFACE, class BOUNDS_CNV>
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RectangleBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RectangleBounds.h
index 063ac1d4047d..2165659c860c 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RectangleBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RectangleBounds.h
@@ -68,24 +68,24 @@ public:
   virtual RectangleBounds* clone() const override;
 
   /** Return the type of the bounds for persistency */
-  virtual BoundsType type() const override { return SurfaceBounds::Rectangle; }
+  virtual BoundsType type() const override final { return SurfaceBounds::Rectangle; }
 
   /**This method checks if the provided local coordinates are inside the surface bounds*/
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
 
   /**This method checks if the provided local coordinates are inside the surface bounds*/
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
 
   /** This method checks inside bounds in loc1
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /** This method checks inside bounds in loc2
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary ( > 0 if outside and <=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /**This method returns the halflength in phi (first coordinate of local surface frame)*/
   double halflengthPhi() const;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h
index 9c7548b1a19c..296de9207797 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h
@@ -142,7 +142,7 @@ public:
    */
   virtual Amg::RotationMatrix3D measurementFrame(
     const Amg::Vector3D& glopos,
-    const Amg::Vector3D& glomom) const override;
+    const Amg::Vector3D& glomom) const override final;
 
   /** Return the surface type */
   virtual SurfaceType type() const override final;
@@ -242,7 +242,7 @@ public:
 
   /** the pathCorrection for derived classes with thickness */
   virtual double pathCorrection(const Amg::Vector3D&,
-                                const Amg::Vector3D&) const override;
+                                const Amg::Vector3D&) const override final;
 
   /** This method checks if the provided GlobalPosition is inside the assigned
     straw radius, but no check is done whether the GlobalPosition is inside
@@ -251,20 +251,20 @@ public:
   virtual bool isOnSurface(const Amg::Vector3D& glopo,
                            BoundaryCheck bchk = true,
                            double tol1 = 0.,
-                           double tol2 = 0.) const override;
+                           double tol2 = 0.) const override final;
 
   /**This method returns the bounds of the Surface by reference */
-  virtual const SurfaceBounds& bounds() const override;
+  virtual const SurfaceBounds& bounds() const override final;
 
   /**This surface calls the iside method of the bouns */
   virtual bool insideBounds(const Amg::Vector2D& locpos,
                             double tol1 = 0.,
-                            double tol2 = 0.) const override;
+                            double tol2 = 0.) const override final;
   virtual bool insideBoundsCheck(const Amg::Vector2D& locpos,
-                                 const BoundaryCheck& bchk) const override;
+                                 const BoundaryCheck& bchk) const override final;
 
   /** Return properly formatted class name for screen output */
-  virtual std::string name() const override;
+  virtual std::string name() const override final;
 
 protected: //!< data members
   template<class SURFACE, class BOUNDS_CNV>
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h
index 9117cfc67b8e..7aa5ed0c83e6 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h
@@ -79,28 +79,28 @@ public:
   virtual TriangleBounds* clone() const override;
 
   /** Return the type of the bounds for persistency */
-  virtual BoundsType type() const override { return SurfaceBounds::Triangle; }
+  virtual BoundsType type() const override final { return SurfaceBounds::Triangle; }
 
   /**This method checks if the provided local coordinates are inside the surface bounds*/
-  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override;
-  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override;
+  virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
+  virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
 
   /** This method checks inside bounds in loc1
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override;
+  virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
 
   /** This method checks inside bounds in loc2
     - loc1/loc2 correspond to the natural coordinates of the surface */
-  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override;
+  virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
 
   /** Minimal distance to boundary ( > 0 if outside and <=0 if inside) */
-  virtual double minDistance(const Amg::Vector2D& pos) const override;
+  virtual double minDistance(const Amg::Vector2D& pos) const override final;
 
   /**This method returns the coordinates of vertices*/
   std::vector<std::pair<TDD_real_t, TDD_real_t>> vertices() const;
 
   /**This method returns the maximal extension on the local plane, i.e. @f$s\sqrt{h_{\phi}^2 + h_{\eta}^2}\f$*/
-  virtual double r() const override;
+  virtual double r() const override final;
 
   /** Output Method for MsgStream*/
   virtual MsgStream& dump(MsgStream& sl) const override;
-- 
GitLab