diff --git a/Control/AthLinks/AthLinks/ElementLinkVector.h b/Control/AthLinks/AthLinks/ElementLinkVector.h index a42364ea9683c553742fa6b09ae43db204ef3ad9..cf36100154b197ebce3ebb8fdb0adbfa53c0c262 100644 --- a/Control/AthLinks/AthLinks/ElementLinkVector.h +++ b/Control/AthLinks/AthLinks/ElementLinkVector.h @@ -187,7 +187,7 @@ public: /// \name vector constructors (no Allocators) //@{ - ElementLinkVector() : ElementLinkVectorBase() { } + ElementLinkVector(); ElementLinkVector(size_type n, const ElemLink& link) : ElementLinkVectorBase(), m_shortRefs(n, ElemLinkRef(link)) @@ -217,7 +217,7 @@ public: ElementLinkVectorBase( vec ), m_shortRefs(vec.m_shortRefs), m_hostDObjs(vec.m_hostDObjs) { } - ElementLinkVector(ElemLinkVec&& vec) : + ElementLinkVector(ElemLinkVec&& vec) noexcept : ElementLinkVectorBase( std::move(vec) ), m_shortRefs(std::move(vec.m_shortRefs)), m_hostDObjs(std::move(vec.m_hostDObjs)) { } @@ -233,7 +233,7 @@ public: return *this; } - ElementLinkVector& operator= (ElemLinkVec&& vec) + ElementLinkVector& operator= (ElemLinkVec&& vec) noexcept { if (this != &vec) { m_persKeys = std::move(vec.m_persKeys); @@ -416,6 +416,10 @@ private: }; // class ElementLinkVector +template <typename DOBJ> + ElementLinkVector<DOBJ>::ElementLinkVector() : ElementLinkVectorBase() { +} + /* * The following piece of code makes the Reflex dictionary think of * "ElementLinkVector< T, DataProxyStorage< T >, diff --git a/DetectorDescription/Identifier/Identifier/Identifier32.h b/DetectorDescription/Identifier/Identifier/Identifier32.h index a35b9b8f3c7bd6b176b1a6b0769cd2120809908a..6b2882856ce16dbee07de035c08ca7ba92fbb7ff 100644 --- a/DetectorDescription/Identifier/Identifier/Identifier32.h +++ b/DetectorDescription/Identifier/Identifier/Identifier32.h @@ -44,10 +44,10 @@ public: explicit Identifier32 (value_type value); /// Copy constructor - Identifier32 (const Identifier32& other); + Identifier32 (const Identifier32& other) = default; /// Assignment. - Identifier32& operator= (const Identifier32& other); + Identifier32& operator= (const Identifier32& other) = default; ///---------------------------------------------------------------- /// Modifications @@ -130,18 +130,6 @@ inline Identifier32::Identifier32 () : m_id(max_value) {} -//----------------------------------------------- -inline Identifier32::Identifier32 (const Identifier32& other) - : m_id(other.m_id) -{} - -//----------------------------------------------- -inline Identifier32& Identifier32::operator= (const Identifier32& other) -{ - if (this != &other) - m_id = other.m_id; - return *this; -} //----------------------------------------------- inline Identifier32::Identifier32 (value_type value) diff --git a/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/PixelSpacePoint.h b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/PixelSpacePoint.h index 733c0a9ddf206b6b96833891f525df79feadfd3a..c917ab40d945c6a6fb535fc03093cfaa26c5c31d 100755 --- a/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/PixelSpacePoint.h +++ b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/PixelSpacePoint.h @@ -56,7 +56,7 @@ namespace InDet PixelSpacePoint( const PixelSpacePoint & PSP); /** Destructor */ - ~PixelSpacePoint(); + ~PixelSpacePoint() = default; /** Overloading assignment operator */ PixelSpacePoint &operator=(const PixelSpacePoint &); diff --git a/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h index 3528e9716c35c3feb7c7bbd1f0dd0f3c03b44d95..1744a8bba3d22e12fb5e71cf5e7f7b4638977e15 100755 --- a/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h +++ b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h @@ -52,11 +52,11 @@ namespace InDet //@{ SCT_SpacePoint(const std::pair<IdentifierHash, IdentifierHash>& elementIdList, const Amg::Vector3D& position, - const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>* clusList) ; + const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusList) ; //@} /** Copy Constructor */ - SCT_SpacePoint(const SCT_SpacePoint &) ; + SCT_SpacePoint(const SCT_SpacePoint &); /** Destructor */ virtual ~SCT_SpacePoint() = default; @@ -81,7 +81,7 @@ namespace InDet /** common method used in constructors. */ void setup(const std::pair<IdentifierHash, IdentifierHash>& elementIdList, const Amg::Vector3D& position, - const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>* clusList); + const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusList); }; /////////////////////////////////////////////////////////////////// diff --git a/InnerDetector/InDetRecEvent/SiSpacePoint/src/PixelSpacePoint.cxx b/InnerDetector/InDetRecEvent/SiSpacePoint/src/PixelSpacePoint.cxx index 8b03b009acad859ef30d071098117d60fbbc4b3c..0c329904fce6e0362be5ef941b75469d0dff796a 100755 --- a/InnerDetector/InDetRecEvent/SiSpacePoint/src/PixelSpacePoint.cxx +++ b/InnerDetector/InDetRecEvent/SiSpacePoint/src/PixelSpacePoint.cxx @@ -36,7 +36,7 @@ namespace InDet assert (tmpPos) ; m_position = *tmpPos; - m_clusList = new std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>(clus,nullptr); + m_clusList = {clus,nullptr}; m_elemIdList.first = elementId ; m_elemIdList.second = 0 ; setupGlobalFromLocalCovariance(); @@ -55,7 +55,7 @@ namespace InDet assert (clus!=nullptr); m_position = globpos; m_globalCovariance = globcov; - m_clusList = new std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>(clus,nullptr); + m_clusList = {clus,nullptr}; m_elemIdList.first = elementId ; m_elemIdList.second = 0 ; } @@ -68,11 +68,6 @@ namespace InDet SpacePoint(PSP) {} - //------------------------------------------------------------- - - /** Destructor */ - PixelSpacePoint::~PixelSpacePoint() - {} //------------------------------------------------------------- diff --git a/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx b/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx index cabc8efbafe9920690272edf2be56dd804d0a946..71ed2ed5873fe0b1baf8fccd1df92e986e452402 100755 --- a/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx +++ b/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx @@ -18,13 +18,14 @@ namespace InDet SCT_SpacePoint::SCT_SpacePoint() : Trk::SpacePoint() - {} + { + } //------------------------------------------------------------- SCT_SpacePoint::SCT_SpacePoint(const std::pair<IdentifierHash, IdentifierHash>& elementIdList, const Amg::Vector3D& position, - const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>* clusList) + const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*> &clusList) : Trk::SpacePoint() { @@ -37,15 +38,15 @@ namespace InDet void SCT_SpacePoint::setup(const std::pair<IdentifierHash, IdentifierHash>& elementIdList, const Amg::Vector3D& position, - const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>* clusList) + const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusList) { m_clusList = clusList ; m_position = position ; m_elemIdList.first = elementIdList.first ; m_elemIdList.second = elementIdList.second ; - assert( (clusList->first!=0) && (clusList->second!=0) ); - assert(clusList->first->detectorElement()) ; - std::unique_ptr<const Amg::Vector2D> locpos{clusList->first->detectorElement()->surface().globalToLocal(position)}; + assert( (clusList.first!=0) && (clusList.second!=0) ); + assert(clusList.first->detectorElement()) ; + std::unique_ptr<const Amg::Vector2D> locpos{clusList.first->detectorElement()->surface().globalToLocal(position)}; assert(locpos); Trk::MeasurementBase::m_localParams = Trk::LocalParameters(*locpos ) ; diff --git a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx index 36439c690ba128d542491d020b4c3ee34432db4a..e249385f36afb22ccdcc01be16cc4278ac83f86e 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx @@ -167,9 +167,7 @@ namespace InDet { if (ok) { ATH_MSG_VERBOSE( "SpacePoint generated at: ( " << point.x() << " , " << point.y() << " , " << point.z() << " ) " ); const std::pair<IdentifierHash,IdentifierHash> elementIdList( element1->identifyHash() , element2->identifyHash() ); - const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>* - clusList = new std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>(&cluster1, &cluster2); - return new InDet::SCT_SpacePoint(elementIdList, point, clusList); + return new InDet::SCT_SpacePoint(elementIdList, point, {&cluster1, &cluster2}); } return nullptr; @@ -287,7 +285,6 @@ namespace InDet { } } - //-------------------------------------------------------------------------- void SiSpacePointMakerTool::fillSCT_SpacePointEtaOverlapCollection(const InDet::SCT_ClusterCollection* clusters1, const InDet::SCT_ClusterCollection* clusters2, @@ -732,9 +729,7 @@ namespace InDet { Amg::Vector3D point(In0.position(m)); const std::pair<IdentifierHash,IdentifierHash> elementIdList(ID0,ID1); - const std::pair<const Trk::PrepRawData*,const Trk::PrepRawData*>* - clusList = new std::pair<const Trk::PrepRawData*,const Trk::PrepRawData*>(In0.cluster(),In1.cluster()); - return new InDet::SCT_SpacePoint(elementIdList, point, clusList); + return new InDet::SCT_SpacePoint(elementIdList, point, {In0.cluster(),In1.cluster()}); } } diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Identifier/Identifier.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Identifier/Identifier.h index ff56f0913a01891c8638402cf2213cd392d2bd0b..78d33066452f005500fec88f4848925048c06306 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Identifier/Identifier.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Identifier/Identifier.h @@ -23,7 +23,7 @@ class Identifier } max_value_type; Identifier():m_id(max_value) {}; - Identifier(const Identifier& value):m_id(value.m_id) {}; + Identifier(const Identifier& value):m_id(value.m_id) = default; Identifier(value_type value):m_id(value) {}; operator value_type() const { return m_id; } diff --git a/Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h b/Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h index b9c120e2cb2b1862c74d6acd515689562349652c..8391f11f04ee60efbf61e495aa6914efcd6bfa11 100755 --- a/Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h +++ b/Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h @@ -38,10 +38,10 @@ namespace Trk{ public: // public because of DataPool SpacePoint(); - SpacePoint(const SpacePoint &); - SpacePoint &operator=(const SpacePoint &); + SpacePoint(const SpacePoint &) = default; + SpacePoint &operator=(const SpacePoint &) = default; // Destructor: - virtual ~SpacePoint(); + virtual ~SpacePoint() = default; /////////////////////////////////////////////////////////////////// // Const methods: @@ -89,7 +89,7 @@ namespace Trk{ virtual std::ostream& dump( std::ostream& out ) const override=0 ; protected: - const std::pair<const PrepRawData*, const PrepRawData*> *m_clusList; + std::pair<const PrepRawData*, const PrepRawData*> m_clusList; std::pair<IdentifierHash, IdentifierHash> m_elemIdList; Amg::Vector3D m_position; Amg::MatrixX m_globalCovariance; @@ -117,8 +117,7 @@ namespace Trk{ inline const std::pair<const PrepRawData*, const PrepRawData*>& SpacePoint::clusterList() const { - assert(m_clusList!=0); - return *m_clusList; + return m_clusList; } inline double SpacePoint::eta(double z0) const diff --git a/Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx b/Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx index 5df5034ef909f7302c0b91548502b8004cf5fb90..429d9a6b8b02424c028f8c7b8bc14ac442db9061 100755 --- a/Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx +++ b/Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx @@ -23,18 +23,13 @@ namespace Trk { - // Destructor: - SpacePoint::~SpacePoint() - { - delete m_clusList; - } // ------------------------------------------------------------------ // Default constructor SpacePoint::SpacePoint() : - m_clusList(nullptr), + m_clusList(nullptr, nullptr), m_elemIdList(0,0), m_position(), m_globalCovariance() @@ -43,42 +38,6 @@ namespace Trk // ------------------------------------------------------------------ - // copy constructor - SpacePoint::SpacePoint(const SpacePoint & SP) : - Trk::MeasurementBase(SP) - { - m_elemIdList = SP.m_elemIdList; - m_position = SP.m_position; - if (SP.m_clusList){ - m_clusList = new std::pair<const PrepRawData*, const PrepRawData*>(*SP.m_clusList); - } else { - m_clusList=nullptr; - } - m_globalCovariance = SP.m_globalCovariance; - } - - // ------------------------------------------------------------------ - - //assignment operator - SpacePoint& SpacePoint::operator=(const SpacePoint& SP) - { - if (&SP !=this) - { - Trk::MeasurementBase::operator=(SP); - delete m_clusList; - m_elemIdList = SP.m_elemIdList; - m_position = SP.m_position; - if (SP.m_clusList){ - m_clusList = new std::pair<const PrepRawData*, const PrepRawData*>(*SP.m_clusList); - } else { - m_clusList=nullptr; - } - m_globalCovariance = SP.m_globalCovariance; - } - return *this; - } - - // ------------------------------------------------------------------ /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ MsgStream& operator << ( MsgStream& sl, const Trk::SpacePoint& spacePoint) @@ -113,8 +72,8 @@ namespace Trk const Surface& SpacePoint::associatedSurface() const { - assert(m_clusList->first->detectorElement()); - return m_clusList->first->detectorElement()->surface(); + assert(m_clusList.first->detectorElement()); + return m_clusList.first->detectorElement()->surface(); } } // end of namespace