From c02c79b7903f73930ac8a62bd733223a3f09c5ad Mon Sep 17 00:00:00 2001 From: christos <christos@cern.ch> Date: Sun, 26 Jul 2020 01:12:35 +0100 Subject: [PATCH] Surfaces: use default --- .../TrkSurfaces/TrkSurfaces/AnnulusBounds.h | 4 +-- .../TrkSurfaces/TrkSurfaces/ConeBounds.h | 10 +++---- .../TrkSurfaces/TrkSurfaces/CylinderBounds.h | 13 +++++---- .../TrkSurfaces/TrkSurfaces/DiamondBounds.h | 8 +++--- .../TrkSurfaces/TrkSurfaces/DiscSurface.h | 2 +- .../TrkSurfaces/TrkSurfaces/EllipseBounds.h | 10 +++---- .../TrkSurfaces/TrkSurfaces/PerigeeSurface.h | 2 +- .../TrkSurfaces/TrkSurfaces/PlaneSurface.h | 6 ++-- .../TrkSurfaces/RotatedDiamondBounds.h | 8 +++--- .../TrkSurfaces/RotatedTrapezoidBounds.h | 8 +++--- .../TrkSurfaces/StraightLineSurface.h | 2 +- .../TrkSurfaces/TrkSurfaces/TrapezoidBounds.h | 8 +++--- .../TrkSurfaces/TrkSurfaces/TriangleBounds.h | 6 ++-- .../TrkSurfaces/src/AnnulusBounds.cxx | 15 ++++------ .../TrkSurfaces/src/ConeBounds.cxx | 21 -------------- .../TrkSurfaces/src/CylinderBounds.cxx | 28 ------------------- .../TrkSurfaces/src/DiamondBounds.cxx | 26 ++--------------- .../TrkSurfaces/src/DiscSurface.cxx | 6 ++-- .../TrkSurfaces/src/EllipseBounds.cxx | 25 +---------------- .../TrkSurfaces/src/PerigeeSurface.cxx | 3 +- .../TrkSurfaces/src/PlaneSurface.cxx | 22 ++------------- .../TrkSurfaces/src/RotatedDiamondBounds.cxx | 26 ++--------------- .../src/RotatedTrapezoidBounds.cxx | 21 -------------- .../TrkSurfaces/src/StraightLineSurface.cxx | 2 -- .../TrkSurfaces/src/TrapezoidBounds.cxx | 20 ------------- .../TrkSurfaces/src/TriangleBounds.cxx | 17 ----------- 26 files changed, 61 insertions(+), 258 deletions(-) diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/AnnulusBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/AnnulusBounds.h index ec185ab0baf8..9e017a7d3de3 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/AnnulusBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/AnnulusBounds.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 */ /////////////////////////////////////////////////////////////////// @@ -66,7 +66,7 @@ public: AnnulusBounds(const AnnulusBounds& annbo) = default; /**Destructor*/ - virtual ~AnnulusBounds(); + virtual ~AnnulusBounds() = default; /**Virtual constructor*/ virtual AnnulusBounds* clone() const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeBounds.h index b80e612110ee..df5fd340dae0 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeBounds.h @@ -66,13 +66,13 @@ public: ConeBounds(double alpha, double zmin, double zmax, double halfphi = M_PI, double avphi = 0.); /**Copy Constructor */ - ConeBounds(const ConeBounds& cylbo); - - /**Destructor */ - virtual ~ConeBounds(); + ConeBounds(const ConeBounds& cylbo) = default; /**Assignment operator*/ - ConeBounds& operator=(const ConeBounds& cylbo); + ConeBounds& operator=(const ConeBounds& cylbo) = default; + + /**Destructor */ + virtual ~ConeBounds() = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& sbo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.h index 3e3089acf924..124e8171a3db 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderBounds.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 */ /////////////////////////////////////////////////////////////////// @@ -68,16 +68,19 @@ public: CylinderBounds(double radius, double halfphi, double avphi, double halez); /**Copy Constructor */ - CylinderBounds(const CylinderBounds& cylbo); + CylinderBounds(const CylinderBounds& cylbo) = default; + + /**Move Constructor */ + CylinderBounds(CylinderBounds&& cylbo) = default; /**Destructor */ - virtual ~CylinderBounds(); + virtual ~CylinderBounds() = default; /**Assignment operator*/ - CylinderBounds& operator=(const CylinderBounds& cylbo); + CylinderBounds& operator=(const CylinderBounds& cylbo) = default; /**Move assignment operator*/ - CylinderBounds& operator=(CylinderBounds&& cylbo); + CylinderBounds& operator=(CylinderBounds&& cylbo) = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& sbo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.h index 212401fd19ce..2c375d619997 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiamondBounds.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 */ /////////////////////////////////////////////////////////////////// @@ -55,16 +55,16 @@ public: DiamondBounds(double minhalex, double medhalex, double maxhalex, double haley1, double haley2); /**Copy constructor*/ - DiamondBounds(const DiamondBounds& diabo); + DiamondBounds(const DiamondBounds& diabo) = default; /**Destructor*/ - virtual ~DiamondBounds(); + virtual ~DiamondBounds() = default; /**Virtual constructor*/ DiamondBounds* clone() const override; /**Assignment operator*/ - DiamondBounds& operator=(const DiamondBounds& sbo); + DiamondBounds& operator=(const DiamondBounds& sbo) = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& diabo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h index ab9f10755e77..42d683b16de5 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h @@ -94,7 +94,7 @@ public: DiscSurface(const DiscSurface& psf, const Amg::Transform3D& transf); /**Destructor*/ - virtual ~DiscSurface(); + virtual ~DiscSurface() = default; /**Assignement operator*/ DiscSurface& operator=(const DiscSurface& dsf); diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.h index d64675cab235..2d07e63d18ec 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/EllipseBounds.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 */ /////////////////////////////////////////////////////////////////// @@ -63,16 +63,16 @@ public: EllipseBounds(double minrad1, double minrad2, double maxrad1, double maxrad2, double avephi, double hphisec); /**Copy constructor*/ - EllipseBounds(const EllipseBounds& discbo); + EllipseBounds(const EllipseBounds& discbo) = default; /**Destructor*/ - virtual ~EllipseBounds(); + virtual ~EllipseBounds() = default; /**Assignment operator*/ - EllipseBounds& operator=(const EllipseBounds& discbo); + EllipseBounds& operator=(const EllipseBounds& discbo) = default; /**Move assignment operator*/ - EllipseBounds& operator=(EllipseBounds&& discbo); + EllipseBounds& operator=(EllipseBounds&& discbo) = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& sbo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h index c278c7bdc0b9..0c74ae462332 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h @@ -59,7 +59,7 @@ public: PerigeeSurface(const PerigeeSurface& pesf, const Amg::Transform3D& transf); /**Destructor*/ - virtual ~PerigeeSurface(); + virtual ~PerigeeSurface() = default; /**Virtual constructor*/ virtual PerigeeSurface* clone() const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h index 6d494836d060..917177da3dfa 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h @@ -63,7 +63,7 @@ public: PlaneSurface(); /** Copy Constructor*/ - PlaneSurface(const PlaneSurface& psf); + PlaneSurface(const PlaneSurface& psf) = default; /** Copy Constructor with shift*/ PlaneSurface(const PlaneSurface& psf, const Amg::Transform3D& transf); @@ -129,10 +129,10 @@ public: Trk::SharedObject<const Trk::SurfaceBounds>& sbounds); /**Destructor*/ - virtual ~PlaneSurface(); + virtual ~PlaneSurface() = default; /**Assignment operator*/ - PlaneSurface& operator=(const PlaneSurface& psf); + PlaneSurface& operator=(const PlaneSurface& psf) = default; /**Equality operator*/ virtual bool operator==(const Surface& sf) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedDiamondBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedDiamondBounds.h index 99f163c3fa87..9db6926a5064 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedDiamondBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedDiamondBounds.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 */ /////////////////////////////////////////////////////////////////// @@ -60,16 +60,16 @@ public: RotatedDiamondBounds(double minhalex, double medhalex, double maxhalex, double haley1, double haley2); /**Copy constructor*/ - RotatedDiamondBounds(const RotatedDiamondBounds& diabo); + RotatedDiamondBounds(const RotatedDiamondBounds& diabo) = default; /**Destructor*/ - virtual ~RotatedDiamondBounds(); + virtual ~RotatedDiamondBounds() = default; /**Virtual constructor*/ RotatedDiamondBounds* clone() const override; /**Assignment operator*/ - RotatedDiamondBounds& operator=(const RotatedDiamondBounds& sbo); + RotatedDiamondBounds& operator=(const RotatedDiamondBounds& sbo) = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& diabo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedTrapezoidBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedTrapezoidBounds.h index c6f9986ca7ff..76bba568e297 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedTrapezoidBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/RotatedTrapezoidBounds.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 */ /////////////////////////////////////////////////////////////////// @@ -61,10 +61,10 @@ public: RotatedTrapezoidBounds(double halex, double minhalex, double maxhalex); /**Copy constructor*/ - RotatedTrapezoidBounds(const RotatedTrapezoidBounds& trabo); + RotatedTrapezoidBounds(const RotatedTrapezoidBounds& trabo) = default; /**Destructor*/ - virtual ~RotatedTrapezoidBounds(); + virtual ~RotatedTrapezoidBounds() = default; /**Virtual constructor*/ virtual RotatedTrapezoidBounds* clone() const override; @@ -73,7 +73,7 @@ public: virtual BoundsType type() const override { return SurfaceBounds::RotatedTrapezoid; } /**Assignment operator*/ - RotatedTrapezoidBounds& operator=(const RotatedTrapezoidBounds& sbo); + RotatedTrapezoidBounds& operator=(const RotatedTrapezoidBounds& sbo) = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& trabo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h index db57e565fbc5..84ccf2153c68 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h @@ -69,7 +69,7 @@ public: const Amg::Transform3D& transf); /**Destructor*/ - virtual ~StraightLineSurface(); + virtual ~StraightLineSurface() = default; /**Assignment operator*/ StraightLineSurface& operator=(const StraightLineSurface& slsf); diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TrapezoidBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TrapezoidBounds.h index 08c4038c0e7f..e6b530c1439a 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TrapezoidBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TrapezoidBounds.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 */ /////////////////////////////////////////////////////////////////// @@ -62,10 +62,10 @@ public: TrapezoidBounds(double minhalex, double haley, double alpha, double beta); /**Copy constructor*/ - TrapezoidBounds(const TrapezoidBounds& trabo); + TrapezoidBounds(const TrapezoidBounds& trabo) = default; /**Destructor*/ - virtual ~TrapezoidBounds(); + virtual ~TrapezoidBounds() = default; /**Virtual constructor*/ virtual TrapezoidBounds* clone() const override; @@ -74,7 +74,7 @@ public: virtual BoundsType type() const override { return SurfaceBounds::Trapezoid; } /**Assignment operator*/ - TrapezoidBounds& operator=(const TrapezoidBounds& sbo); + TrapezoidBounds& operator=(const TrapezoidBounds& sbo) = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& trabo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h index 01bc15a86b6d..9117cfc67b8e 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h +++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/TriangleBounds.h @@ -64,13 +64,13 @@ public: TriangleBounds(const Amg::Vector2D& p1, const Amg::Vector2D& p2, const Amg::Vector2D& p3); /**Copy constructor*/ - TriangleBounds(const TriangleBounds& tribo); + TriangleBounds(const TriangleBounds& tribo) = default; /**Destructor*/ - virtual ~TriangleBounds(); + virtual ~TriangleBounds() = default; /**Assignment Operator*/ - TriangleBounds& operator=(const TriangleBounds& recbo); + TriangleBounds& operator=(const TriangleBounds& recbo) = default; /**Equality operator*/ virtual bool operator==(const SurfaceBounds& sbo) const override; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/AnnulusBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/AnnulusBounds.cxx index 0f492f84d92c..8aea1456bb9e 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/AnnulusBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/AnnulusBounds.cxx @@ -106,18 +106,18 @@ public: || ((x * h + y * w - w * h) * (x * h + y * w - w * h) <= r * r * (w * w + h * h) && x * w - y * h >= -h * h && x * w - y * h <= w * w)) { // collision with (0, h)---(w, 0) return true; - } + } if ((x - w) * (x - w) + (y - h) * (y - h) <= r * r || (x <= w && y - r <= h) || (y <= h && x - r <= w)) { return iterate(x, y, w, 0, 0, h, r * r); // collision within triangle (0, h) (w, h) (0, 0) is possible } return false; - - } + + } double R = -r; double localCos = x / R; double deltaR = std::sqrt(h * h + (w * w - h * h) * localCos * localCos); return deltaR >= R - std::sqrt(x * x + y * y); - + } EllipseCollisionTest(int maxIterations) { this->m_maxIterations = maxIterations; } }; @@ -196,9 +196,6 @@ Trk::AnnulusBounds::AnnulusBounds(double minR, double maxR, double R, double phi m_minYin = minR; } -// destructor -Trk::AnnulusBounds::~AnnulusBounds() = default; - bool Trk::AnnulusBounds::operator==(const Trk::SurfaceBounds& sbo) const { @@ -357,7 +354,7 @@ Trk::AnnulusBounds::isAbove(const Amg::Vector2D& locpo, // the most tolerant approach for tol1 and tol2 double sign = k > 0. ? -1. : +1.; return (locpo[Trk::locY] + tol2 > (k * (locpo[Trk::locX] + sign * tol1) + d)); - } + } return false; } @@ -472,7 +469,7 @@ Trk::AnnulusBounds::circleLineIntersection(double R, double k, double d) const x2 = (-2. * k * d + std::sqrt(delta)) / (2. * (1 + k * k)); y1 = k * x1 + d; y2 = k * x2 + d; - + if (y1 > y2) { solution.push_back(x1); solution.push_back(y1); diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/ConeBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/ConeBounds.cxx index 3e0871a206a8..12e7f23151ac 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/ConeBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/ConeBounds.cxx @@ -50,27 +50,6 @@ Trk::ConeBounds::ConeBounds(double alpha, double zmin, double zmax, double halfp initCache(); } -Trk::ConeBounds::ConeBounds(const Trk::ConeBounds& conebo) - : m_boundValues(conebo.m_boundValues) - , m_tanAlpha(conebo.m_tanAlpha) - , m_sinAlpha(conebo.m_sinAlpha) - , m_cosAlpha(conebo.m_cosAlpha) -{} - -Trk::ConeBounds::~ConeBounds() = default; - -Trk::ConeBounds& -Trk::ConeBounds::operator=(const Trk::ConeBounds& conebo) -{ - if (this != &conebo) { - m_tanAlpha = conebo.m_tanAlpha; - m_sinAlpha = conebo.m_sinAlpha; - m_cosAlpha = conebo.m_cosAlpha; - m_boundValues = conebo.m_boundValues; - } - return *this; -} - bool Trk::ConeBounds::operator==(const SurfaceBounds& sbo) const { diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/CylinderBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/CylinderBounds.cxx index 8f3035e7728e..2930a0b3b2c4 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/CylinderBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/CylinderBounds.cxx @@ -48,34 +48,6 @@ Trk::CylinderBounds::CylinderBounds(double radius, double haphi, double averagep m_boundValues[CylinderBounds::bv_halfZ] = fabs(halez); } -Trk::CylinderBounds::CylinderBounds(const Trk::CylinderBounds& cylbo) - : Trk::SurfaceBounds() - , m_boundValues(cylbo.m_boundValues) - , m_checkPhi(cylbo.m_checkPhi) -{} - -Trk::CylinderBounds::~CylinderBounds() = default; - -Trk::CylinderBounds& -Trk::CylinderBounds::operator=(const Trk::CylinderBounds& cylbo) -{ - if (this != &cylbo) { - m_boundValues = cylbo.m_boundValues; - m_checkPhi = cylbo.m_checkPhi; - } - return *this; -} - -Trk::CylinderBounds& -Trk::CylinderBounds::operator=(Trk::CylinderBounds&& cylbo) -{ - if (this != &cylbo) { - m_boundValues = std::move(cylbo.m_boundValues); - m_checkPhi = cylbo.m_checkPhi; - } - return *this; -} - bool Trk::CylinderBounds::operator==(const SurfaceBounds& sbo) const { diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/DiamondBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/DiamondBounds.cxx index 1ae873c77b12..b1977dede3a1 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/DiamondBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/DiamondBounds.cxx @@ -38,28 +38,6 @@ Trk::DiamondBounds::DiamondBounds(double minhalex, double medhalex, double maxha initCache(); } -// copy constructor -Trk::DiamondBounds::DiamondBounds(const DiamondBounds& diabo) - : Trk::SurfaceBounds() - , m_boundValues(diabo.m_boundValues) - , m_alpha1(diabo.m_alpha1) - , m_alpha2(diabo.m_alpha2) -{} - -// destructor -Trk::DiamondBounds::~DiamondBounds() = default; - -Trk::DiamondBounds& -Trk::DiamondBounds::operator=(const DiamondBounds& diabo) -{ - if (this != &diabo) { - m_boundValues = diabo.m_boundValues; - m_alpha1 = diabo.m_alpha1; - m_alpha2 = diabo.m_alpha2; - } - return *this; -} - bool Trk::DiamondBounds::operator==(const Trk::SurfaceBounds& sbo) const { @@ -105,13 +83,13 @@ Trk::DiamondBounds::insideFull(const Amg::Vector2D& locpo, double tol1, double t m_boundValues[DiamondBounds::bv_halfY1] : 0.; return (fabs(locpo[Trk::locX]) <= m_boundValues[DiamondBounds::bv_medHalfX] - k * fabs(locpo[Trk::locY])); - } + } double k = m_boundValues[DiamondBounds::bv_halfY2] > 0. ? (m_boundValues[DiamondBounds::bv_medHalfX] - m_boundValues[DiamondBounds::bv_maxHalfX]) / 2 / m_boundValues[DiamondBounds::bv_halfY2] : 0.; return (fabs(locpo[Trk::locX]) <= m_boundValues[DiamondBounds::bv_medHalfX] - k * fabs(locpo[Trk::locY])); - + } // opening angle in point A diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/DiscSurface.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/DiscSurface.cxx index 4c519c73558e..39cdf018f46f 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/DiscSurface.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/DiscSurface.cxx @@ -97,8 +97,6 @@ Trk::DiscSurface::DiscSurface(const Trk::TrkDetElementBase& detelement) , m_bounds() , m_referencePoint(nullptr) {} -// destructor (will call destructor from base class which deletes objects) -Trk::DiscSurface::~DiscSurface() = default; Trk::DiscSurface& Trk::DiscSurface::operator=(const DiscSurface& dsf) @@ -237,9 +235,9 @@ Trk::DiscSurface::straightLineDistanceEstimate(const Amg::Vector3D& pos, const A if (A == 0.) { // direction parallel to surface if (fabs(d) < tol) { return Trk::DistanceSolution(1, 0., true, 0.); - } + } return Trk::DistanceSolution(0, d, true, 0.); - + } double D = b * (S - (pos.dot(N))) / A; diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/EllipseBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/EllipseBounds.cxx index 4e430e2b4ab2..f07762e9844a 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/EllipseBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/EllipseBounds.cxx @@ -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 */ /////////////////////////////////////////////////////////////////// @@ -54,29 +54,6 @@ Trk::EllipseBounds::EllipseBounds(double minradX, swap(m_boundValues[EllipseBounds::bv_rMinY], m_boundValues[EllipseBounds::bv_rMaxY]); } -Trk::EllipseBounds::EllipseBounds(const EllipseBounds& discbo) - : Trk::SurfaceBounds() - , m_boundValues(discbo.m_boundValues) -{} - -Trk::EllipseBounds::~EllipseBounds() = default; - -Trk::EllipseBounds& -Trk::EllipseBounds::operator=(const EllipseBounds& discbo) -{ - if (this != &discbo) - m_boundValues = discbo.m_boundValues; - return *this; -} - -Trk::EllipseBounds& -Trk::EllipseBounds::operator=(EllipseBounds&& discbo) -{ - if (this != &discbo) - m_boundValues = std::move(discbo.m_boundValues); - return *this; -} - bool Trk::EllipseBounds::operator==(const Trk::SurfaceBounds& sbo) const { diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/PerigeeSurface.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/PerigeeSurface.cxx index e84583da2990..04634e9a14b4 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/PerigeeSurface.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/PerigeeSurface.cxx @@ -64,7 +64,6 @@ Trk::PerigeeSurface::PerigeeSurface(const PerigeeSurface& pesf, const Amg::Trans Surface::m_transform = std::make_unique<Amg::Transform3D>(shift * (*pesf.m_transform)); } -Trk::PerigeeSurface::~PerigeeSurface() = default; // assignment operator Trk::PerigeeSurface& @@ -97,7 +96,7 @@ Trk::PerigeeSurface::localToGlobal(const Trk::LocalParameters& locpars) const Amg::Vector3D loc3Dframe( -locpars[Trk::d0] * sin(locpars[Trk::phi0]), locpars[Trk::d0] * cos(locpars[Trk::phi0]), locpars[Trk::z0]); return new Amg::Vector3D(transform() * loc3Dframe); - } + } return new Amg::Vector3D(0., 0., locpars[Trk::z0] + (center().z())); } diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/PlaneSurface.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/PlaneSurface.cxx index 991f8f8f2e46..2364d542b6c9 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/PlaneSurface.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/PlaneSurface.cxx @@ -35,10 +35,6 @@ Trk::PlaneSurface::PlaneSurface() , m_bounds() {} -// copy constructor -Trk::PlaneSurface::PlaneSurface(const PlaneSurface& psf) - -= default; // copy constructor with shift Trk::PlaneSurface::PlaneSurface(const PlaneSurface& psf, const Amg::Transform3D& transf) @@ -153,20 +149,6 @@ Trk::PlaneSurface::PlaneSurface(Amg::Transform3D* htrans, Trk::SharedObject<cons , m_bounds(tbounds) {} -// destructor (will call destructor from base class which deletes objects) -Trk::PlaneSurface::~PlaneSurface() = default; - -Trk::PlaneSurface& -Trk::PlaneSurface::operator=(const Trk::PlaneSurface& psf) -{ - - if (this != &psf) { - Trk::Surface::operator=(psf); - m_bounds = psf.m_bounds; - } - return *this; -} - bool Trk::PlaneSurface::operator==(const Trk::Surface& sf) const { @@ -246,9 +228,9 @@ Trk::PlaneSurface::straightLineDistanceEstimate(const Amg::Vector3D& pos, const if (A == 0.) { // direction parallel to surface if (fabs(d) < tol) { return Trk::DistanceSolution(1, 0., true, 0.); - } + } return Trk::DistanceSolution(0, d, true, 0.); - + } return Trk::DistanceSolution(1, d, true, -d / A); diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedDiamondBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedDiamondBounds.cxx index 01c44034acd0..c30911421334 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedDiamondBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedDiamondBounds.cxx @@ -42,28 +42,6 @@ Trk::RotatedDiamondBounds::RotatedDiamondBounds(double minhalex, initCache(); } -// copy constructor -Trk::RotatedDiamondBounds::RotatedDiamondBounds(const RotatedDiamondBounds& diabo) - : Trk::SurfaceBounds() - , m_boundValues(diabo.m_boundValues) - , m_alpha1(diabo.m_alpha1) - , m_alpha2(diabo.m_alpha2) -{} - -// destructor -Trk::RotatedDiamondBounds::~RotatedDiamondBounds() = default; - -Trk::RotatedDiamondBounds& -Trk::RotatedDiamondBounds::operator=(const RotatedDiamondBounds& diabo) -{ - if (this != &diabo) { - m_boundValues = diabo.m_boundValues; - m_alpha1 = diabo.m_alpha1; - m_alpha2 = diabo.m_alpha2; - } - return *this; -} - bool Trk::RotatedDiamondBounds::operator==(const Trk::SurfaceBounds& sbo) const { @@ -110,14 +88,14 @@ Trk::RotatedDiamondBounds::insideFull(const Amg::Vector2D& locpo, double tol1, d m_boundValues[RotatedDiamondBounds::bv_halfY1] : 0.; return (fabs(locpo[Trk::locY]) <= m_boundValues[RotatedDiamondBounds::bv_medHalfX] - k * fabs(locpo[Trk::locX])); - } + } double k = m_boundValues[RotatedDiamondBounds::bv_halfY2] > 0. ? (m_boundValues[RotatedDiamondBounds::bv_medHalfX] - m_boundValues[RotatedDiamondBounds::bv_maxHalfX]) / 2 / m_boundValues[RotatedDiamondBounds::bv_halfY2] : 0.; return (fabs(locpo[Trk::locY]) <= m_boundValues[RotatedDiamondBounds::bv_medHalfX] - k * fabs(locpo[Trk::locX])); - + } // opening angle in point A diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedTrapezoidBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedTrapezoidBounds.cxx index 88f8fcc8718c..16835e2e5f9e 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedTrapezoidBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/RotatedTrapezoidBounds.cxx @@ -38,27 +38,6 @@ Trk::RotatedTrapezoidBounds::RotatedTrapezoidBounds(double halex, double minhale initCache(); } -// copy constructor -Trk::RotatedTrapezoidBounds::RotatedTrapezoidBounds(const RotatedTrapezoidBounds& trabo) - : Trk::SurfaceBounds() - , m_boundValues(trabo.m_boundValues) - , m_kappa(trabo.m_kappa) - , m_delta(trabo.m_delta) -{} - -// destructor -Trk::RotatedTrapezoidBounds::~RotatedTrapezoidBounds() = default; - -Trk::RotatedTrapezoidBounds& -Trk::RotatedTrapezoidBounds::operator=(const RotatedTrapezoidBounds& trabo) -{ - if (this != &trabo) { - m_boundValues = trabo.m_boundValues; - m_kappa = trabo.m_kappa; - m_delta = trabo.m_delta; - } - return *this; -} bool Trk::RotatedTrapezoidBounds::operator==(const Trk::SurfaceBounds& sbo) const diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/StraightLineSurface.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/StraightLineSurface.cxx index c4197ffd073e..a6107d958f2a 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/StraightLineSurface.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/StraightLineSurface.cxx @@ -68,8 +68,6 @@ Trk::StraightLineSurface::StraightLineSurface(const StraightLineSurface& csf, co , m_bounds(csf.m_bounds) {} -// destructor (will call destructor from base class which deletes objects) -Trk::StraightLineSurface::~StraightLineSurface() = default; // assignment operator Trk::StraightLineSurface& diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/TrapezoidBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/TrapezoidBounds.cxx index 9ecc1710caa2..7139f6532cbf 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/TrapezoidBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/TrapezoidBounds.cxx @@ -48,27 +48,7 @@ Trk::TrapezoidBounds::TrapezoidBounds(double minhalex, double haley, double alph m_boundValues[TrapezoidBounds::bv_halfY] = fabs(haley); } -// copy constructor -Trk::TrapezoidBounds::TrapezoidBounds(const TrapezoidBounds& trabo) - : Trk::SurfaceBounds() - , m_boundValues(trabo.m_boundValues) - , m_alpha(trabo.m_alpha) - , m_beta(trabo.m_beta) -{} - -// destructor -Trk::TrapezoidBounds::~TrapezoidBounds() = default; -Trk::TrapezoidBounds& -Trk::TrapezoidBounds::operator=(const TrapezoidBounds& trabo) -{ - if (this != &trabo) { - m_boundValues = trabo.m_boundValues; - m_alpha = trabo.m_alpha; - m_beta = trabo.m_beta; - } - return *this; -} bool Trk::TrapezoidBounds::operator==(const Trk::SurfaceBounds& sbo) const diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/TriangleBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/TriangleBounds.cxx index a61de0eb6bf6..ad7e73879e93 100644 --- a/Tracking/TrkDetDescr/TrkSurfaces/src/TriangleBounds.cxx +++ b/Tracking/TrkDetDescr/TrkSurfaces/src/TriangleBounds.cxx @@ -59,23 +59,6 @@ Trk::TriangleBounds::TriangleBounds(const Amg::Vector2D& p1, const Amg::Vector2D m_boundValues[TriangleBounds::bv_y3] = p3.y(); } -// copy constructor -Trk::TriangleBounds::TriangleBounds(const TriangleBounds& tribo) - : Trk::SurfaceBounds() - , m_boundValues(tribo.m_boundValues) -{} - -// destructor -Trk::TriangleBounds::~TriangleBounds() = default; - -Trk::TriangleBounds& -Trk::TriangleBounds::operator=(const TriangleBounds& tribo) -{ - if (this != &tribo) - m_boundValues = tribo.m_boundValues; - return *this; -} - bool Trk::TriangleBounds::operator==(const Trk::SurfaceBounds& sbo) const { -- GitLab