diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementProperties.h b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementProperties.h index e0b2fb1b8a35068b7a818b7ee68c6f5c5af03ff6..04c9527cc2cbdc91239d1c5b4d3bd8bbae722b8f 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementProperties.h +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementProperties.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 */ /*************************************************************************** @@ -34,8 +34,8 @@ public: ~SiElementProperties(); - const std::vector<IdentifierHash>* neighbours (void); - float halfWidth (void); + const std::vector<IdentifierHash>* neighbours (void) const; + float halfWidth (void) const; private: std::vector<IdentifierHash> m_neighbours; @@ -50,14 +50,14 @@ private: //-------------------------------------------------------------------------- inline const std::vector<IdentifierHash>* -SiElementProperties::neighbours() +SiElementProperties::neighbours() const { return &m_neighbours; } //---------------------------------------------------------------------------- inline float -SiElementProperties::halfWidth() +SiElementProperties::halfWidth() const { return m_halfWidth; } diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementPropertiesTable.h b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementPropertiesTable.h index 18d4d21ca29638fbe30142217bb7ba2b4d4cdd04..a87c4491420d71fad12e5f2da1555f74df6ae934 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementPropertiesTable.h +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiElementPropertiesTable.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,13 +29,13 @@ public: SiElementPropertiesTable(const SCT_ID& idHelper, const InDetDD::SiDetectorElementCollection& elements, float epsilonWidth); - ~SiElementPropertiesTable(); + ~SiElementPropertiesTable() = default; const std::vector<IdentifierHash>* neighbours(const IdentifierHash& waferID) const; float halfWidth(IdentifierHash hashID) const; private: - std::vector<SiElementProperties*> m_properties; + std::vector<SiElementProperties> m_properties; }; @@ -43,13 +43,13 @@ private: inline const std::vector<IdentifierHash>* SiElementPropertiesTable::neighbours(const IdentifierHash& waferID) const { - return (m_properties[(unsigned int)waferID])->neighbours(); + return (m_properties[(unsigned int)waferID]).neighbours(); } inline float SiElementPropertiesTable::halfWidth(IdentifierHash waferID) const { - return (m_properties[(unsigned int)waferID])->halfWidth(); + return (m_properties[(unsigned int)waferID]).halfWidth(); } } diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiElementPropertiesTable.cxx b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiElementPropertiesTable.cxx index 55c5cfc43de9192d8a33ccb5827ab814ec6de18a..47d0c581e44ee098243e4082e3144a436e440eaf 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiElementPropertiesTable.cxx +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiElementPropertiesTable.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 */ /*************************************************************************** @@ -21,24 +21,15 @@ SiElementPropertiesTable::SiElementPropertiesTable(const SCT_ID& idHelper, float epsilonWidth) { size_t maxSCT = idHelper.wafer_hash_max(); - m_properties.assign(maxSCT, nullptr); + m_properties.reserve(maxSCT); for (size_t i = 0; i < maxSCT; ++i){ IdentifierHash hash(i); const InDetDD::SiDetectorElement* element = elements[hash]; if (element != 0){ - SiElementProperties* props = new SiElementProperties(hash, idHelper,*element,epsilonWidth); - m_properties[i] = props; + m_properties.emplace_back(hash, idHelper,*element,epsilonWidth); } } } //-------------------------------------------------------------------------- -SiElementPropertiesTable::~SiElementPropertiesTable(){ - size_t maxSCT = m_properties.size(); - for (size_t i=0; i < maxSCT; ++i){ - delete m_properties[i];m_properties[i] =0; - } -} -//-------------------------------------------------------------------------- - }