diff --git a/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignablePlaneSurface.h b/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignablePlaneSurface.h index d9e1181d8a122fde0e7609aefd649d0529f305d9..f46dfb51d9e1e0a86428b5dd7cdaa46337277b3c 100644 --- a/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignablePlaneSurface.h +++ b/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignablePlaneSurface.h @@ -43,7 +43,7 @@ class TrkDetElementBase; @author Andreas.Salzburger@cern.ch */ -class AlignablePlaneSurface +class AlignablePlaneSurface final : public PlaneSurface , public AlignableSurface { @@ -66,12 +66,12 @@ public: /**Assignment operator */ AlignablePlaneSurface& operator=(const AlignablePlaneSurface& sf); /**Equality operator*/ - virtual bool operator==(const Surface& sf) const override; + virtual bool operator==(const Surface& sf) const override final; /**Implicit constructor - uses the copy constructor */ - virtual AlignablePlaneSurface* clone() const override; + virtual AlignablePlaneSurface* clone() const override final; /** return associated Detector Element - forwarded from nominal Surface */ - const TrkDetElementBase* associatedDetectorElement() const; + const TrkDetElementBase* associatedDetectorElement() const ; /** return Identifier of the associated Detector Element - forwarded from nominal Surface */ Identifier associatedDetectorElementIdentifier() const; @@ -80,72 +80,30 @@ public: const Layer* associatedLayer() const; /** -------------------------- interface from AlignableSurface ------------------ */ - /** Get the Surface representation */ - virtual const PlaneSurface& surfaceRepresentation() const override; + virtual const PlaneSurface& surfaceRepresentation() const override final; /** Get the nominal surface */ - virtual const PlaneSurface& nominalSurface() const override; + virtual const PlaneSurface& nominalSurface() const override final; /** Get the nominal transformation */ - virtual const Amg::Transform3D& nominalTransform() const override; + virtual const Amg::Transform3D& nominalTransform() const override final; /** Add an alignment correction on top of the actual one */ - virtual void addAlignmentCorrection(Amg::Transform3D& corr) override; + virtual void addAlignmentCorrection(Amg::Transform3D& corr) override final; /** Set an alignment correction on top of the nominal one */ - virtual void setAlignmentCorrection(Amg::Transform3D& corr) override; + virtual void setAlignmentCorrection(Amg::Transform3D& corr) override final; /** Set an alignment correction on top of the nominal one */ - virtual void setAlignableTransform(Amg::Transform3D& trans) override; + virtual void setAlignableTransform(Amg::Transform3D& trans) override final ; protected: /** The pointer ro the nominal Surface */ const PlaneSurface* m_nominalSurface; }; -inline AlignablePlaneSurface* -AlignablePlaneSurface::clone() const -{ - return new AlignablePlaneSurface(*this); -} - -inline const TrkDetElementBase* -AlignablePlaneSurface::associatedDetectorElement() const -{ - return m_nominalSurface->associatedDetectorElement(); -} - -inline Identifier -AlignablePlaneSurface::associatedDetectorElementIdentifier() const -{ - return m_nominalSurface->associatedDetectorElementIdentifier(); -} - -inline const Trk::Layer* -AlignablePlaneSurface::associatedLayer() const -{ - return m_nominalSurface->associatedLayer(); -} - -inline const PlaneSurface& -AlignablePlaneSurface::surfaceRepresentation() const -{ - return (*this); -} - -inline const PlaneSurface& -AlignablePlaneSurface::nominalSurface() const -{ - return (*m_nominalSurface); -} - -inline const Amg::Transform3D& -AlignablePlaneSurface::nominalTransform() const -{ - return m_nominalSurface->transform(); -} - } // end of namespace Trk +#include "TrkAlignableSurfaces/AlignablePlaneSurface.icc" #endif // TRKALIGNABLESURFACES_ALGINABLESURFACE_H diff --git a/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignablePlaneSurface.icc b/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignablePlaneSurface.icc new file mode 100644 index 0000000000000000000000000000000000000000..bd4f8d21275f80d1fa39a471fa476161fb739710 --- /dev/null +++ b/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignablePlaneSurface.icc @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +namespace Trk { + +inline AlignablePlaneSurface* +AlignablePlaneSurface::clone() const +{ + return new AlignablePlaneSurface(*this); +} + +inline const TrkDetElementBase* +AlignablePlaneSurface::associatedDetectorElement() const +{ + return m_nominalSurface->associatedDetectorElement(); +} + +inline Identifier +AlignablePlaneSurface::associatedDetectorElementIdentifier() const +{ + return m_nominalSurface->associatedDetectorElementIdentifier(); +} + +inline const Trk::Layer* +AlignablePlaneSurface::associatedLayer() const +{ + return m_nominalSurface->associatedLayer(); +} + +inline const PlaneSurface& +AlignablePlaneSurface::surfaceRepresentation() const +{ + return (*this); +} + +inline const PlaneSurface& +AlignablePlaneSurface::nominalSurface() const +{ + return (*m_nominalSurface); +} + +inline const Amg::Transform3D& +AlignablePlaneSurface::nominalTransform() const +{ + return m_nominalSurface->transform(); +} + +} + diff --git a/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignableSurface.h b/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignableSurface.h index 7b91c2ce771b43811ee259cfc226aebb04edcafb..74e84b3e478bf144b6680c7b4faba302c5c0debd 100644 --- a/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignableSurface.h +++ b/Tracking/TrkDetDescr/TrkAlignableSurfaces/TrkAlignableSurfaces/AlignableSurface.h @@ -43,10 +43,10 @@ class AlignableSurface public: /** Default Constructor - needed for pool and inherited classes */ - AlignableSurface(); + AlignableSurface() = default; /** Destructor */ - virtual ~AlignableSurface(); + virtual ~AlignableSurface() = default; /** Get the Surface representation */ virtual const Surface& surfaceRepresentation() const = 0; diff --git a/Tracking/TrkDetDescr/TrkAlignableSurfaces/src/AlignableSurface.cxx b/Tracking/TrkDetDescr/TrkAlignableSurfaces/src/AlignableSurface.cxx deleted file mode 100644 index 7a534c5197e44220ffc63de11c49430ce2a9f4e4..0000000000000000000000000000000000000000 --- a/Tracking/TrkDetDescr/TrkAlignableSurfaces/src/AlignableSurface.cxx +++ /dev/null @@ -1,14 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// AlignableSurface.cxx, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - -// Trk -#include "TrkAlignableSurfaces/AlignableSurface.h" - -Trk::AlignableSurface::AlignableSurface() {} - -Trk::AlignableSurface::~AlignableSurface() {} diff --git a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArrayArray.h b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArrayArray.h index 98eb72538f36747da6b93324f94308d8b9e26003..1e3940f88d034b2bd44764d2124c81a5597333f2 100644 --- a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArrayArray.h +++ b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/BinnedArrayArray.h @@ -32,7 +32,7 @@ namespace Trk { */ template<class T> -class BinnedArrayArrayT : public BinnedArrayT<T> +class BinnedArrayArrayT final: public BinnedArrayT<T> { public: diff --git a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingCylinderSurface.h b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingCylinderSurface.h index 3e85e902b6031ba66afb976ddae407845d3b0c22..8d2e901d0ff05331f3d463430d780f1156ede0e9 100644 --- a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingCylinderSurface.h +++ b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingCylinderSurface.h @@ -57,7 +57,7 @@ public: SlidingCylinderSurface& operator=(const SlidingCylinderSurface& psf); /**Equality operator*/ - virtual bool operator==(const Surface& sf) const override; + virtual bool operator==(const Surface& sf) 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 @@ -65,31 +65,31 @@ 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; /** Specialized for DiscSurface: LocalToGlobal method without dynamic memory * allocation */ virtual void localToGlobal(const Amg::Vector2D& locp, const Amg::Vector3D& mom, - Amg::Vector3D& glob) const override; + Amg::Vector3D& glob) const override final; /** Specialized for DiscSurface: GlobalToLocal method without dynamic memory * allocation - boolean checks if on surface */ virtual bool globalToLocal(const Amg::Vector3D& glob, const Amg::Vector3D& mom, - Amg::Vector2D& loc) const override; + Amg::Vector2D& loc) const override final; /** fast straight line distance evaluation to Surface */ virtual DistanceSolution straightLineDistanceEstimate( const Amg::Vector3D& pos, - const Amg::Vector3D& dir) const override; + const Amg::Vector3D& dir) const override final; /** fast straight line distance evaluation to Surface - with bound option*/ virtual DistanceSolution straightLineDistanceEstimate( const Amg::Vector3D& pos, const Amg::Vector3D& dir, - bool Bound) const override; + bool Bound) const override final; /**This method allows access to the bin utility*/ const Trk::BinUtility* binUtility() const { return m_etaBin; } diff --git a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingDiscSurface.h b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingDiscSurface.h index bb73a4b58aaaadef2547133ed8247ee78c9e6ac3..7c31a6971978de089d037aff569e040c28b2a67f 100644 --- a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingDiscSurface.h +++ b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SlidingDiscSurface.h @@ -77,10 +77,10 @@ public: SlidingDiscSurface& operator=(const SlidingDiscSurface& dsf); /**Equality operator*/ - virtual bool operator==(const Surface& sf) const override; + virtual bool operator==(const Surface& sf) const override final; /** Virtual constructor*/ - virtual SlidingDiscSurface* clone() const override; + virtual SlidingDiscSurface* clone() 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 @@ -88,20 +88,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; /** Specialized for DiscSurface: LocalToGlobal method without dynamic memory * allocation */ virtual void localToGlobal(const Amg::Vector2D& locp, const Amg::Vector3D& mom, - Amg::Vector3D& glob) const override; + Amg::Vector3D& glob) const override final; /** Specialized for DiscSurface: GlobalToLocal method without dynamic memory * allocation - boolean checks if on surface */ virtual bool globalToLocal(const Amg::Vector3D& glob, const Amg::Vector3D& mom, - Amg::Vector2D& loc) const override; + Amg::Vector2D& loc) const override final; /** fast straight line intersection schema - standard: provides closest intersection and (signed) path length forceDir is to provide the closest @@ -127,13 +127,13 @@ public: /** fast straight line distance evaluation to Surface */ virtual DistanceSolution straightLineDistanceEstimate( const Amg::Vector3D& pos, - const Amg::Vector3D& dir) const override; + const Amg::Vector3D& dir) const override final; /** fast straight line distance evaluation to Surface - with bound option*/ virtual DistanceSolution straightLineDistanceEstimate( const Amg::Vector3D& pos, const Amg::Vector3D& dir, - bool Bound) const override; + bool Bound) const override final; /**This method allows access to the bin utility*/ const Trk::BinUtility* binUtility() const { return m_etaBin; } diff --git a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedCylinderSurface.h b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedCylinderSurface.h index 15c897631148786354e0b3a8f69f12892a1bc397..2665cf3bf65fd2a758a08b2b57a069225355012f 100644 --- a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedCylinderSurface.h +++ b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedCylinderSurface.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -29,7 +29,7 @@ namespace Trk { @author Sarka.Todorova@cern.ch */ -class SubtractedCylinderSurface : public CylinderSurface +class SubtractedCylinderSurface final : public CylinderSurface { public: /** Default Constructor - needed for persistency*/ @@ -57,50 +57,24 @@ public: bool shared() const; /**This method calls the inside() method of the Bounds*/ - bool insideBounds(const Amg::Vector2D& locpos, double tol1 = 0., double tol2 = 0.) const; + virtual bool insideBounds(const Amg::Vector2D& locpos, + double tol1 = 0., + double tol2 = 0.) const override final; /**This method allows access to the subtracted part*/ SharedObject<AreaExcluder> subtractedVolume() const; /** Return properly formatted class name for screen output */ - std::string name() const { return "Trk::SubtractedCylinderSurface"; } + virtual std::string name() const override final + { + return "Trk::SubtractedCylinderSurface"; + } protected: SharedObject<AreaExcluder> m_subtrVol; bool m_shared; }; - -inline bool -SubtractedCylinderSurface::insideBounds(const Amg::Vector2D& locpos, double tol1, double tol2) const -{ - // no subtracted volume exists - if (!m_subtrVol.get()) - return (this->bounds().inside(locpos, tol1, tol2)); - // subtracted volume exists, needs to be checked - double rCyl = bounds().r(); - double phiPos = locpos[Trk::locRPhi] / rCyl; - const Amg::Vector3D gp(rCyl * cos(phiPos), rCyl * sin(phiPos), locpos[Trk::locZ]); - - bool inside_shared(this->bounds().inside(locpos, tol1, tol2) && m_subtrVol.get()->inside(gp, 0.)); - bool inside(this->bounds().inside(locpos, tol1, tol2) && !m_subtrVol.get()->inside(gp, 0.)); - - if (m_shared) - return inside_shared; - return inside; -} - -inline bool -SubtractedCylinderSurface::shared() const -{ - return m_shared; -} - -inline SharedObject<AreaExcluder> -SubtractedCylinderSurface::subtractedVolume() const -{ - return m_subtrVol; -} - } // end of namespace +#include "TrkGeometrySurfaces/SubtractedCylinderSurface.icc" #endif // TRKGEOMETRYSURFACES_SUBTRACTEDCYLINDERSURFACE_H diff --git a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedCylinderSurface.icc b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedCylinderSurface.icc new file mode 100644 index 0000000000000000000000000000000000000000..119c6af3adbf04cf0ea26265828fa65faa81dbf6 --- /dev/null +++ b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedCylinderSurface.icc @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +namespace Trk { +inline bool +SubtractedCylinderSurface::insideBounds(const Amg::Vector2D& locpos, + double tol1, + double tol2) const +{ + // no subtracted volume exists + if (!m_subtrVol.get()) + return (this->bounds().inside(locpos, tol1, tol2)); + // subtracted volume exists, needs to be checked + double rCyl = bounds().r(); + double phiPos = locpos[Trk::locRPhi] / rCyl; + const Amg::Vector3D gp( + rCyl * cos(phiPos), rCyl * sin(phiPos), locpos[Trk::locZ]); + + bool inside_shared(this->bounds().inside(locpos, tol1, tol2) && + m_subtrVol.get()->inside(gp, 0.)); + bool inside(this->bounds().inside(locpos, tol1, tol2) && + !m_subtrVol.get()->inside(gp, 0.)); + + if (m_shared) + return inside_shared; + return inside; +} + +inline bool +SubtractedCylinderSurface::shared() const +{ + return m_shared; +} + +inline SharedObject<AreaExcluder> +SubtractedCylinderSurface::subtractedVolume() const +{ + return m_subtrVol; +} +} diff --git a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedPlaneSurface.h b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedPlaneSurface.h index f089c6e90529ed216b6af031556a993a32ed6375..276d874b7aaafdb32abcbb40e008fdad374c9691 100644 --- a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedPlaneSurface.h +++ b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedPlaneSurface.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -28,7 +28,7 @@ namespace Trk { @author Sarka.Todorova@cern.ch */ -class SubtractedPlaneSurface : public PlaneSurface +class SubtractedPlaneSurface final : public PlaneSurface { public: /** Default Constructor - needed for persistency*/ @@ -56,46 +56,24 @@ public: bool shared() const; /**This method calls the inside() method of the Bounds*/ - bool insideBounds(const Amg::Vector2D& locpos, double tol1 = 0., double tol2 = 0.) const; + virtual bool insideBounds(const Amg::Vector2D& locpos, + double tol1 = 0., + double tol2 = 0.) const override final; /**This method allows access to the subtracted part*/ SharedObject<AreaExcluder> subtractedVolume() const; /** Return properly formatted class name for screen output */ - std::string name() const { return "Trk::SubtractedPlaneSurface"; } + virtual std::string name() const override final + { + return "Trk::SubtractedPlaneSurface"; + } protected: SharedObject<AreaExcluder> m_subtrVol; bool m_shared; }; -inline bool -SubtractedPlaneSurface::insideBounds(const Amg::Vector2D& locpos, double tol1, double tol2) const -{ - // no subtracted volume exists - if (!m_subtrVol.get()) - return (this->bounds().inside(locpos, tol1, tol2)); - // subtracted volume exists, needs to be checked - Amg::Vector3D gp(locpos.x(), locpos.y(), 0.); - if (m_shared) - return (this->bounds().inside(locpos, tol1, tol2) && m_subtrVol.get()->inside(gp, 0.)); - bool in(this->bounds().inside(locpos, tol1, tol2) && !m_subtrVol.get()->inside(gp, 0.)); - - return in; -} - -inline bool -SubtractedPlaneSurface::shared() const -{ - return m_shared; -} - -inline SharedObject<AreaExcluder> -SubtractedPlaneSurface::subtractedVolume() const -{ - return m_subtrVol; -} - } // end of namespace - +#include "TrkGeometrySurfaces/SubtractedPlaneSurface.icc" #endif // TRKGEOMETRYSURFACES_SUBTRACTEDPLANESURFACE_H diff --git a/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedPlaneSurface.icc b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedPlaneSurface.icc new file mode 100644 index 0000000000000000000000000000000000000000..529c21446b371a4ac31348ab00ae8861798ecb4c --- /dev/null +++ b/Tracking/TrkDetDescr/TrkGeometrySurfaces/TrkGeometrySurfaces/SubtractedPlaneSurface.icc @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +namespace Trk { +inline bool +SubtractedPlaneSurface::insideBounds(const Amg::Vector2D& locpos, + double tol1, + double tol2) const +{ + // no subtracted volume exists + if (!m_subtrVol.get()){ + return (this->bounds().inside(locpos, tol1, tol2)); + } + // subtracted volume exists, needs to be checked + Amg::Vector3D gp(locpos.x(), locpos.y(), 0.); + if (m_shared){ + return (this->bounds().inside(locpos, tol1, tol2) && + m_subtrVol.get()->inside(gp, 0.)); + } + bool in(this->bounds().inside(locpos, tol1, tol2) && + !m_subtrVol.get()->inside(gp, 0.)); + + return in; +} + +inline bool +SubtractedPlaneSurface::shared() const +{ + return m_shared; +} + +inline SharedObject<AreaExcluder> +SubtractedPlaneSurface::subtractedVolume() const +{ + return m_subtrVol; +} +} +