diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h index c10ab32cd7cefb0b67dca94bed24a6b01f45b2b1..10931dc62849f70465fa2cbe5199df08e957371b 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_DETECTORFACTORY_H @@ -9,6 +9,8 @@ #include "SCT_ReadoutGeometry/SCT_DetectorManager.h" #include "InDetReadoutGeometry/InDetDD_Defs.h" +#include <memory> + class GeoPhysVol; class SCT_DataBase; class SCT_GeometryManager; @@ -39,9 +41,9 @@ class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase const SCT_DetectorFactory & operator=(const SCT_DetectorFactory &right); InDetDD::SCT_DetectorManager *m_detectorManager; - SCT_GeometryManager *m_geometryManager; - SCT_DataBase* m_db; - SCT_MaterialManager* m_materials; + std::unique_ptr<SCT_GeometryManager> m_geometryManager; + std::unique_ptr<SCT_DataBase> m_db; + std::unique_ptr<SCT_MaterialManager> m_materials; bool m_useDynamicAlignFolders; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h index 8a185e29b20db78122c671bbaf6f1f5d95ad5188..f5f84c946b5859a0b874104a6b35bccc543b5c30 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h @@ -1,13 +1,14 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FSIHELPER_H #define SCT_GEOMODEL_SCT_FSIHELPER_H -#include <vector> #include <map> +#include <memory> #include <string> +#include <vector> class SCT_DataBase; @@ -69,8 +70,9 @@ public: private: void fill(); - std::vector<std::vector<const FSIDetails *> * > m_wheelLocMap; - std::map<std::string, FSILocation *> m_locationTypes; + std::vector<std::vector<std::unique_ptr<FSIDetails>>> m_wheelLocMap; + std::vector<std::vector<const FSIDetails *>> m_wheelLocMapConst; + std::map<std::string, std::unique_ptr<FSILocation>> m_locationTypes; SCT_DataBase * m_rdb; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h index b515a77cbd52f07130d9576cd147282e037cd003..52b737e2d2878ed598050bf9226542de6af4846d 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FORWARD_H @@ -7,6 +7,7 @@ #include "SCT_GeoModel/SCT_ComponentFactory.h" +#include <memory> #include <vector> class SCT_FwdModule; @@ -69,9 +70,9 @@ private: double m_outerRadiusCylinderServices; // Child detector elements - std::vector <SCT_FwdWheel *> m_wheels; + std::vector<std::unique_ptr<SCT_FwdWheel>> m_wheels; - std::vector <SCT_FwdModule *> m_modules; + std::vector<std::unique_ptr<SCT_FwdModule>> m_modules; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h index 5b2db9aa7dfebcb4c70bfa4f92bf1468e1ebfb29..1a262527ed2c9ba1cc0a9d232a976b39aa185354 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDMODULE_H @@ -9,6 +9,7 @@ #include "SCT_GeoModel/SCT_FwdSensor.h" +#include <memory> #include <string> class SCT_Identifier; @@ -91,12 +92,12 @@ private: public: // Child detector elements - SCT_FwdSensor * m_sensor; - SCT_FwdModuleConnector * m_connector; - SCT_FwdHybrid * m_hybrid; - SCT_FwdSpine * m_spine; - SCT_FwdSubSpine * m_subspineL; - SCT_FwdSubSpine * m_subspineR; + std::unique_ptr<SCT_FwdSensor> m_sensor; + std::unique_ptr<SCT_FwdModuleConnector> m_connector; + std::unique_ptr<SCT_FwdHybrid> m_hybrid; + std::unique_ptr<SCT_FwdSpine> m_spine; + std::unique_ptr<SCT_FwdSubSpine> m_subspineL; + std::unique_ptr<SCT_FwdSubSpine> m_subspineR; }; #endif // SCT_GEOMODEL_SCT_FWDMODULE_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h index f23a67ff9f37571c4adaaa3488475a6f6d7bbd96..f8f7355ed75c49fe4b064ccb2006b1001db1d2ae 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDRING_H @@ -10,6 +10,7 @@ class SCT_FwdModule; class SCT_FwdCoolingBlock; +#include <memory> #include <vector> class GeoNameTag; @@ -36,10 +37,6 @@ public: SCT_FwdRing(const SCT_FwdRing &) = delete; SCT_FwdRing & operator=(const SCT_FwdRing &) = delete; - // Ring type - //int ringType() const {return m_ringType;} - //int ringType() const {return m_module->ringType();} - // // Retrieve parameters // @@ -110,10 +107,10 @@ private: // Child detector elements SCT_FwdModule* m_module; - SCT_FwdCoolingBlock * m_coolingBlockHiMain; - SCT_FwdCoolingBlock * m_coolingBlockHiSec; - SCT_FwdCoolingBlock * m_coolingBlockLoMain; - SCT_FwdCoolingBlock * m_coolingBlockLoSec; + std::unique_ptr<SCT_FwdCoolingBlock> m_coolingBlockHiMain; + std::unique_ptr<SCT_FwdCoolingBlock> m_coolingBlockHiSec; + std::unique_ptr<SCT_FwdCoolingBlock> m_coolingBlockLoMain; + std::unique_ptr<SCT_FwdCoolingBlock> m_coolingBlockLoSec; GeoPhysVol * m_moduleServicesHi; GeoPhysVol * m_moduleServicesLo; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h index b1d321982023a8e0517dd8d711edfd9fa6c65308..064b84f9d97d86993a2ba948b455e9d9b8a012ef 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDWHEEL_H @@ -7,6 +7,7 @@ #include "SCT_GeoModel/SCT_ComponentFactory.h" +#include <memory> #include <vector> @@ -44,8 +45,7 @@ public: double zPosition() const {return m_zPosition;} int numRings() const {return m_numRings;} int ringType(int i) const {return m_ringType[i];} - //int ringStereoType(int i) const {return m_ringStereoType[i];} - const SCT_FwdRing* ring(int i) {return m_rings[i];} + const SCT_FwdRing* ring(int i) {return m_rings[i].get();} // // Retrieve derived parameters @@ -95,13 +95,13 @@ private: double m_safety; // Child detector elements - std::vector<SCT_FwdRing *> m_rings; - SCT_FwdDiscSupport * m_discSupport; - std::vector<SCT_FwdPatchPanel*> m_patchPanel; - SCT_FwdPPConnector* m_pPConnector; - SCT_FwdPPCooling* m_pPCooling; - std::vector<SCT_FwdFSI*> m_fsiType; - SCT_FwdDiscFixation* m_discFixation; + std::vector<std::unique_ptr<SCT_FwdRing>> m_rings; + std::unique_ptr<SCT_FwdDiscSupport> m_discSupport; + std::vector<std::unique_ptr<SCT_FwdPatchPanel>> m_patchPanel; + std::unique_ptr<SCT_FwdPPConnector> m_pPConnector; + std::unique_ptr<SCT_FwdPPCooling> m_pPCooling; + std::vector<std::unique_ptr<SCT_FwdFSI>> m_fsiType; + std::unique_ptr<SCT_FwdDiscFixation> m_discFixation; const std::vector<SCT_FwdModule*> & m_modules; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h index 5a104c6723c3118503a8fbdf2859852c68a0aa18..071278fbf3728cd248a11028ac73faf3182f8768 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_GeneralParameters_H @@ -7,7 +7,7 @@ #include "GeoModelKernel/GeoDefinitions.h" -#include <map> +#include <memory> #include <string> class SCT_DataBase; @@ -37,7 +37,7 @@ public: private: SCT_DataBase * m_rdb; - TopLevelPlacements * m_placements; + std::unique_ptr<TopLevelPlacements> m_placements; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h index 72f7065edf6603d92f4288c44dda304dfb931ec3..56a39034b5b4bb361a6c7450d0337d912005c02c 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // @@ -14,6 +14,7 @@ #include "SCT_GeoModel/SCT_ComponentFactory.h" #include "GeoModelKernel/GeoDefinitions.h" +#include <memory> #include <string> class GeoMaterial; @@ -46,13 +47,13 @@ public: double width() const {return m_width;} double length() const {return m_length;} - const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector.get();} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector.get();} // *** End of modified lines. ------------------ (00)********************************* - const SCT_Hybrid * hybrid() const {return m_hybrid;} - const SCT_Sensor * sensor() const {return m_sensor;} + const SCT_Hybrid * hybrid() const {return m_hybrid.get();} + const SCT_Sensor * sensor() const {return m_sensor.get();} double hybridOffsetX() const {return m_hybridOffsetX;} //double hybridOffsetY() const {return m_hybridOffsetY;} // 16:30 Wed 15th Jun 2005 D.Naito removed. @@ -68,21 +69,17 @@ private: double m_length; double m_hybridOffsetX; - //double m_hybridOffsetY; // 16:30 Wed 15th Jun 2005 D.Naito removed. double m_hybridOffsetZ; double m_safety; - SCT_Hybrid * m_hybrid; - SCT_Sensor * m_sensor; + std::unique_ptr<SCT_Hybrid> m_hybrid; + std::unique_ptr<SCT_Sensor> m_sensor; GeoTransform * m_hybridPos; GeoTransform * m_sensorPos; - // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (02)********************************* - // *** -->> (02)********************************* - GeoTrf::Vector3D * m_env1RefPointVector; - GeoTrf::Vector3D * m_env2RefPointVector; - // *** End of modified lines. ------------------ (02)********************************* + std::unique_ptr<GeoTrf::Vector3D> m_env1RefPointVector; + std::unique_ptr<GeoTrf::Vector3D> m_env2RefPointVector; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h index e29c3db798042adae4ba879b563df3d6a1425d94..651370bfe9f60db0922598c28ab13de2671b7439 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // @@ -11,6 +11,7 @@ #include "SCT_GeoModel/SCT_ComponentFactory.h" +#include <memory> #include <string> class GeoMaterial; @@ -42,7 +43,7 @@ public: const SCT_GeometryManager* geometryManager, SCT_MaterialManager* materials); - ~SCT_Layer(); + virtual ~SCT_Layer(); //Explicitly disallow copy, assign to appease coverity SCT_Layer(const SCT_Layer &) = delete; SCT_Layer & operator=(const SCT_Layer &) = delete; @@ -103,19 +104,19 @@ private: double m_phiScorpion; double m_zScorpion; - SCT_Module * m_module; - SCT_Ski * m_ski; - SCT_Clamp * m_clamp; - SCT_CoolingEnd * m_coolingEnd; - SCT_Bracket * m_bracket; - SCT_Harness * m_harness; - SCT_SkiPowerTape * m_skiPowerTape; - SCT_SkiAux * m_skiAux; - SCT_Flange * m_flange; - SCT_SupportCyl * m_supportCyl; - SCT_FSIEndJewel * m_endJewel; - SCT_FSIScorpion * m_scorpion; - SCT_FSIFibreMask * m_fibreMask; + SCT_Module* m_module; + std::unique_ptr<SCT_Ski> m_ski; + std::unique_ptr<SCT_Clamp> m_clamp; + std::unique_ptr<SCT_CoolingEnd> m_coolingEnd; + std::unique_ptr<SCT_Bracket> m_bracket; + std::unique_ptr<SCT_Harness> m_harness; + std::unique_ptr<SCT_SkiPowerTape> m_skiPowerTape; + std::unique_ptr<SCT_SkiAux> m_skiAux; + std::unique_ptr<SCT_Flange> m_flange; + std::unique_ptr<SCT_SupportCyl> m_supportCyl; + std::unique_ptr<SCT_FSIEndJewel> m_endJewel; + std::unique_ptr<SCT_FSIScorpion> m_scorpion; + std::unique_ptr<SCT_FSIFibreMask> m_fibreMask; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h index f34e82b520bea1dc98c579c6a2b24f564e05e00b..202b2d3fd000132cadf73a65d9d4f39bb8b02522 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_MODULE_H @@ -9,6 +9,7 @@ #include "SCT_GeoModel/SCT_ComponentFactory.h" #include "GeoModelKernel/GeoDefinitions.h" +#include <memory> #include <string> class GeoMaterial; @@ -48,8 +49,8 @@ public: double env2Width() const {return m_env2Width;} double env2Length() const {return m_env2Length;} - const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector.get();} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector.get();} double sensorGap() const {return m_sensorGap;} double stereoInner() const {return m_stereoInner;} @@ -61,9 +62,9 @@ public: double baseBoardOffsetY() const {return m_baseBoardOffsetY;} double baseBoardOffsetZ() const {return m_baseBoardOffsetZ;} - const SCT_InnerSide * innerSide() const {return m_innerSide;} - const SCT_OuterSide * outerSide() const {return m_outerSide;} - const SCT_BaseBoard * baseBoard() const {return m_baseBoard;} + const SCT_InnerSide * innerSide() const {return m_innerSide.get();} + const SCT_OuterSide * outerSide() const {return m_outerSide.get();} + const SCT_BaseBoard * baseBoard() const {return m_baseBoard.get();} private: @@ -90,21 +91,19 @@ private: double m_stereoInner; double m_stereoOuter; double m_stereoAngle; - //int m_stereoSign; int m_upperSide; double m_safety; - SCT_InnerSide * m_innerSide; - SCT_OuterSide * m_outerSide; - SCT_BaseBoard * m_baseBoard; - //const SCT_Sensor * m_sensor; // 14:00 Thu 14th Jul 2005 D.Naito removed. + std::unique_ptr<SCT_InnerSide> m_innerSide; + std::unique_ptr<SCT_OuterSide> m_outerSide; + std::unique_ptr<SCT_BaseBoard> m_baseBoard; - GeoTrf::Transform3D * m_innerSidePos; - GeoTrf::Transform3D * m_outerSidePos; - GeoTrf::Translate3D * m_baseBoardPos; // 6th Apr 2005 S.Mima + std::unique_ptr<GeoTrf::Transform3D> m_innerSidePos; + std::unique_ptr<GeoTrf::Transform3D> m_outerSidePos; + std::unique_ptr<GeoTrf::Translate3D> m_baseBoardPos; - GeoTrf::Vector3D * m_env1RefPointVector; - GeoTrf::Vector3D * m_env2RefPointVector; + std::unique_ptr<GeoTrf::Vector3D> m_env1RefPointVector; + std::unique_ptr<GeoTrf::Vector3D> m_env2RefPointVector; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h index e8c8840bbdc8c2d19228dea87faf6b1c6ee53766..3dede87b925637806cd04ec122c0c85391afaa92 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h @@ -8,6 +8,8 @@ #include "GeoPrimitives/GeoPrimitives.h" #include "SCT_GeoModel/SCT_ComponentFactory.h" #include "GeoModelKernel/GeoDefinitions.h" + +#include <memory> #include <string> class GeoMaterial; @@ -41,12 +43,12 @@ public: double width() const {return m_width;} double length() const {return m_length;} - const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector.get();} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector.get();} - const SCT_Hybrid * hybrid() const {return m_hybrid;} - const SCT_Pigtail * pigtail() const {return m_pigtail;} - const SCT_Sensor * sensor() const {return m_sensor;} + const SCT_Hybrid * hybrid() const {return m_hybrid.get();} + const SCT_Pigtail * pigtail() const {return m_pigtail.get();} + const SCT_Sensor * sensor() const {return m_sensor.get();} double hybridOffsetX() const {return m_hybridOffsetX;} double hybridOffsetZ() const {return m_hybridOffsetZ;} @@ -63,15 +65,15 @@ private: double m_hybridOffsetZ; double m_safety; - SCT_Hybrid * m_hybrid; - SCT_Pigtail * m_pigtail; - SCT_Sensor * m_sensor; + std::unique_ptr<SCT_Hybrid> m_hybrid; + std::unique_ptr<SCT_Pigtail> m_pigtail; + std::unique_ptr<SCT_Sensor> m_sensor; GeoTransform * m_hybridPos; GeoTransform * m_pigtailPos; GeoTransform * m_sensorPos; - GeoTrf::Vector3D * m_env1RefPointVector; - GeoTrf::Vector3D * m_env2RefPointVector; + std::unique_ptr<GeoTrf::Vector3D> m_env1RefPointVector; + std::unique_ptr<GeoTrf::Vector3D> m_env2RefPointVector; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h index 01dd72fa0feb25898cfbe4be1dbbcfed50ea067c..7baa2fd5480935753cfdd5400c06b5d866effec8 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_SKI_H @@ -9,7 +9,7 @@ #include "GeoModelKernel/GeoDefinitions.h" - +#include <memory> #include <string> #include <vector> @@ -56,13 +56,13 @@ public: int stereoSign() const {return m_stereoSign;} const SCT_Module * module() const {return m_module;} - const SCT_Dogleg * dogleg() const {return m_dogleg;} - const SCT_CoolingBlock * coolingBlock() const {return m_coolingBlock;} - const SCT_CoolingPipe * coolingPipe() const {return m_coolingPipe;} + const SCT_Dogleg * dogleg() const {return m_dogleg.get();} + const SCT_CoolingBlock * coolingBlock() const {return m_coolingBlock.get();} + const SCT_CoolingPipe * coolingPipe() const {return m_coolingPipe.get();} const GeoTransform * getRefPointTransform() const {return m_refPointTransform;} - const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector.get();} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector.get();} double env1Thickness() const {return m_env1Thickness;} double env1Width() const {return m_env1Width;} double env2Thickness() const {return m_env2Thickness;} @@ -119,17 +119,17 @@ private: double m_doglegOffsetY; SCT_Module* m_module; - SCT_Dogleg* m_dogleg; - SCT_CoolingBlock* m_coolingBlock; - SCT_CoolingPipe* m_coolingPipe; + std::unique_ptr<SCT_Dogleg> m_dogleg; + std::unique_ptr<SCT_CoolingBlock> m_coolingBlock; + std::unique_ptr<SCT_CoolingPipe> m_coolingPipe; GeoTransform * m_refPointTransform; GeoTransform * m_coolingPipePos; //! For calculations of envelopes of SCT_DetailLayer. - GeoTrf::Vector3D * m_env1RefPointVector; + std::unique_ptr<GeoTrf::Vector3D> m_env1RefPointVector; //! For calculations of envelopes of SCT_DetailLayer. - GeoTrf::Vector3D * m_env2RefPointVector; + std::unique_ptr<GeoTrf::Vector3D> m_env2RefPointVector; double m_env1Thickness; double m_env1Width; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx index 22b479c91045d2fd5cd9b1504762f39a1d25b0ad..a9768b1f18f85b42fd4c8499c8a9433f74b587fe 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // @@ -73,13 +73,13 @@ SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaC m_detectorManager = new SCT_DetectorManager(detStore()); // Create the database - m_db = new SCT_DataBase{athenaComps}; + m_db = std::make_unique<SCT_DataBase>(athenaComps); // Create the material manager - m_materials = new SCT_MaterialManager{m_db}; + m_materials = std::make_unique<SCT_MaterialManager>(m_db.get()); // Create the geometry manager. - m_geometryManager = new SCT_GeometryManager{m_db}; + m_geometryManager = std::make_unique<SCT_GeometryManager>(m_db.get()); m_geometryManager->setOptions(options); // Add SiCommonItems to SCT_DetectorManager to hold and delete it. @@ -124,9 +124,6 @@ SCT_DetectorFactory::~SCT_DetectorFactory() { // NB the detector manager (m_detectorManager)is stored in the detector store by the // Tool and so we don't delete it. - delete m_db; - delete m_materials; - delete m_geometryManager; } void SCT_DetectorFactory::create(GeoPhysVol *world) @@ -165,7 +162,7 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) m_detectorManager->numerology().addBarrel(0); // Create the SCT Barrel - SCT_Barrel sctBarrel("SCT_Barrel", m_detectorManager, m_geometryManager, m_materials); + SCT_Barrel sctBarrel("SCT_Barrel", m_detectorManager, m_geometryManager.get(), m_materials.get()); SCT_Identifier id{m_geometryManager->athenaComps()->getIdHelper()}; id.setBarrelEC(0); @@ -196,7 +193,7 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) m_detectorManager->numerology().addEndcap(2); // Create the Forward - SCT_Forward sctForwardPlus("SCT_ForwardA", +2, m_detectorManager, m_geometryManager, m_materials); + SCT_Forward sctForwardPlus("SCT_ForwardA", +2, m_detectorManager, m_geometryManager.get(), m_materials.get()); SCT_Identifier idFwdPlus{m_geometryManager->athenaComps()->getIdHelper()}; idFwdPlus.setBarrelEC(2); @@ -229,7 +226,7 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) m_detectorManager->numerology().addEndcap(-2); - SCT_Forward sctForwardMinus("SCT_ForwardC", -2, m_detectorManager, m_geometryManager, m_materials); + SCT_Forward sctForwardMinus("SCT_ForwardC", -2, m_detectorManager, m_geometryManager.get(), m_materials.get()); SCT_Identifier idFwdMinus{m_geometryManager->athenaComps()->getIdHelper()}; idFwdMinus.setBarrelEC(-2); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx index da47861300761833cdb24a627c937057b8f09f6a..3542adc65a943384634124ef6ef50a62026c6186 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.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 */ @@ -39,24 +39,12 @@ FSIHelper::FSIHelper(SCT_DataBase * rdb) { int numWheels = m_rdb->fwdGeneral()->getInt("NUMWHEELS"); m_wheelLocMap.resize(numWheels); + m_wheelLocMapConst.resize(numWheels); fill(); } FSIHelper::~FSIHelper() { - std::map<std::string, FSILocation *>::iterator iter; - for (iter = m_locationTypes.begin(); iter != m_locationTypes.end(); ++iter) { - delete iter->second; - } - - for(unsigned int i = 0; i < m_wheelLocMap.size(); i++) { - if (m_wheelLocMap[i]) { - for (unsigned int j = 0; j < m_wheelLocMap[i]->size(); j++) { - delete (*m_wheelLocMap[i])[j]; - } - delete m_wheelLocMap[i]; - } - } } @@ -69,8 +57,7 @@ FSIHelper::fill() double radius = m_rdb->fwdFSILocation(iLocIndex)->getDouble("LOCR") * Gaudi::Units::mm; double rphi = m_rdb->fwdFSILocation(iLocIndex)->getDouble("LOCPHI") * Gaudi::Units::deg; int side = m_rdb->fwdFSILocation(iLocIndex)->getInt("SIDE"); - FSILocation * location = new FSILocation(locType, radius, rphi, side); - m_locationTypes[locType] = location; + m_locationTypes[locType] = std::make_unique<FSILocation>(locType, radius, rphi, side); } // Loop through all fsi's @@ -84,17 +71,15 @@ FSIHelper::fill() if (simTypeCheck != simType) std::cout << "Error in simType to index match in table SctFwdFSIType" << std::endl; - FSILocation * location = m_locationTypes[locationType]; + FSILocation * location = m_locationTypes[locationType].get(); if (!location) std::cout << "Error filling FSI information. No FSI of type " << locationType << " found" << std::endl; - FSIDetails * fsi = new FSIDetails(location, simType, simTypeString, locationType, actualType); + std::unique_ptr<FSIDetails> fsi = std::make_unique<FSIDetails>(location, simType, simTypeString, locationType, actualType); if (iWheel >= m_wheelLocMap.size()) std::cout << "Error in FSIHelper: wheel number is out of range: " << iWheel << std::endl; - if (!m_wheelLocMap[iWheel]) { - m_wheelLocMap[iWheel] = new std::vector<const FSIDetails *>; - } - m_wheelLocMap[iWheel]->push_back(fsi); + m_wheelLocMapConst[iWheel].push_back(fsi.get()); + m_wheelLocMap[iWheel].push_back(std::move(fsi)); } } @@ -103,8 +88,5 @@ FSIHelper::fill() const std::vector<const FSIDetails *> & FSIHelper::fsiVector(int iWheel) const { - return *(m_wheelLocMap[iWheel]); + return m_wheelLocMapConst[iWheel]; } - - - diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx index cc2b311c42a16edd5c5391360196485d00761a1e..c5861e22f9c5b419d749ecdf0cd267e940439847 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Forward.h" @@ -49,8 +49,6 @@ SCT_Forward::SCT_Forward(const std::string & name, int ec, SCT_Forward::~SCT_Forward() { - for (size_t i = 0; i < m_wheels.size(); i++) delete m_wheels[i]; - for (size_t i = 0; i < m_modules.size(); i++) delete m_modules[i]; } void @@ -99,17 +97,19 @@ SCT_Forward::preBuild() // Create the elements we need for the forward // We make all the module types here. There is a outer, middle, truncated middle and inner type module. + std::vector<SCT_FwdModule*> modules; for (int iModuleType = 0; iModuleType < m_numModuleTypes; iModuleType++){ - m_modules.push_back(new SCT_FwdModule("FwdModule"+intToString(iModuleType), iModuleType, - m_detectorManager, m_geometryManager, m_materials)); + std::unique_ptr<SCT_FwdModule> module = std::make_unique<SCT_FwdModule>("FwdModule"+intToString(iModuleType), iModuleType, + m_detectorManager, m_geometryManager, m_materials); + modules.push_back(module.get()); + m_modules.push_back(std::move(module)); } for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ // Build Wheels std::ostringstream name; name << "Wheel" << iWheel << ((m_endcap > 0) ? "A" : "C"); - SCT_FwdWheel * wheel = new SCT_FwdWheel(name.str(), iWheel, m_modules, m_endcap, - m_detectorManager, m_geometryManager, m_materials); - m_wheels.push_back(wheel); + m_wheels.push_back(std::make_unique<SCT_FwdWheel>(name.str(), iWheel, modules, m_endcap, + m_detectorManager, m_geometryManager, m_materials)); } @@ -129,7 +129,7 @@ SCT_Forward::build(SCT_Identifier id) for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ - SCT_FwdWheel * wheel = m_wheels[iWheel]; + SCT_FwdWheel * wheel = m_wheels[iWheel].get(); std::ostringstream wheelName; wheelName << "Wheel#" << iWheel; double zpos = wheel->zPosition() - zCenter(); forward->add(new GeoNameTag(wheelName.str())); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx index d6ac1a49cc49abadbfda08b61775a6ecc04fe69f..d3aa8d302934e5845c67630ff2bd4d9054acbba9 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx @@ -55,21 +55,18 @@ SCT_FwdModule::SCT_FwdModule(const std::string & name, int ringType, getParameters(); - m_hybrid = new SCT_FwdHybrid("SCT_FwdHybrid"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); - m_spine = new SCT_FwdSpine("SCT_FwdSpine"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); - m_subspineL = new SCT_FwdSubSpine("SCT_FwdSubSpineL"+intToString(ringType), m_ringType, SUBSPINE_LEFT, + m_hybrid = std::make_unique<SCT_FwdHybrid>("SCT_FwdHybrid"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); + m_spine = std::make_unique<SCT_FwdSpine>("SCT_FwdSpine"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); + m_subspineL = std::make_unique<SCT_FwdSubSpine>("SCT_FwdSubSpineL"+intToString(ringType), m_ringType, SUBSPINE_LEFT, m_detectorManager, m_geometryManager, materials); - m_subspineR = new SCT_FwdSubSpine("SCT_FwdSubSpineR"+intToString(ringType), m_ringType, SUBSPINE_RIGHT, + m_subspineR = std::make_unique<SCT_FwdSubSpine>("SCT_FwdSubSpineR"+intToString(ringType), m_ringType, SUBSPINE_RIGHT, m_detectorManager, m_geometryManager, materials); - m_sensor = new SCT_FwdSensor("ECSensor"+intToString(ringType), m_ringType, + m_sensor = std::make_unique<SCT_FwdSensor>("ECSensor"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); if (m_connectorPresent) { - m_connector = new SCT_FwdModuleConnector("SCT_FwdModuleConnector"+intToString(ringType), m_ringType, + m_connector = std::make_unique<SCT_FwdModuleConnector>("SCT_FwdModuleConnector"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); } - else { - m_connector = nullptr; - } m_logVolume = preBuild(); @@ -77,12 +74,6 @@ SCT_FwdModule::SCT_FwdModule(const std::string & name, int ringType, SCT_FwdModule::~SCT_FwdModule() { - delete m_connector; - delete m_hybrid; - delete m_spine; - delete m_subspineL; - delete m_subspineR; - delete m_sensor; } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx index 4caf983b15e59c77a1f8ebf3a5b8256426ad4214..febcd3742017b2a2b3362c69bb672007f6692cf8 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdRing.h" @@ -80,10 +80,6 @@ SCT_FwdRing::getParameters() SCT_FwdRing::~SCT_FwdRing() { - delete m_coolingBlockHiMain; - delete m_coolingBlockHiSec; - delete m_coolingBlockLoMain; - delete m_coolingBlockLoSec; } const GeoLogVol * @@ -282,14 +278,14 @@ SCT_FwdRing::makeModuleServices() // to add more things to it later. We call it module services. // Cooling blocks for the upper Modules - m_coolingBlockHiMain = new SCT_FwdCoolingBlock("CoolingBlkHiMain",SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::MAIN, + m_coolingBlockHiMain = std::make_unique<SCT_FwdCoolingBlock>("CoolingBlkHiMain",SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::MAIN, m_detectorManager, m_geometryManager, m_materials); - m_coolingBlockHiSec = new SCT_FwdCoolingBlock("CoolingBlkHiSec", SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::SECONDARY, + m_coolingBlockHiSec = std::make_unique<SCT_FwdCoolingBlock>("CoolingBlkHiSec", SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::SECONDARY, m_detectorManager, m_geometryManager, m_materials); // Cooling blocks for the lower Modules - m_coolingBlockLoMain = new SCT_FwdCoolingBlock("CoolingBlkLoMain",SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::MAIN, + m_coolingBlockLoMain = std::make_unique<SCT_FwdCoolingBlock>("CoolingBlkLoMain",SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::MAIN, m_detectorManager, m_geometryManager, m_materials); - m_coolingBlockLoSec = new SCT_FwdCoolingBlock("CoolingBlkLoSec", SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::SECONDARY, + m_coolingBlockLoSec = std::make_unique<SCT_FwdCoolingBlock>("CoolingBlkLoSec", SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::SECONDARY, m_detectorManager, m_geometryManager, m_materials); double coolingBlkMainR = m_module->mainMountPointRadius(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx index d81d2ede7f8c907a979d89d8140f37b469e23df2..1cd186388e2b7c647aa58d76b8841e1ec322ead4 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx @@ -278,6 +278,7 @@ void SCT_FwdSensor::makeDesign() // The readout side is at the +ve depth direction int readoutSide = +1; + // m_design will be owned and deleted by SCT_DetectorManager m_design = new SCT_ForwardModuleSideDesign(m_thicknessN, crystals, diodes, @@ -323,6 +324,8 @@ GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) if (commonItems->getIdHelper()) { + // detElement will be owned by SCT_DetectorManager + // and will be deleted in destructor of SiDetectorElementCollection in SCT_DetectorManager SiDetectorElement * detElement = new SiDetectorElement(id.getWaferId(), m_design, sensor, diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx index e074d2b2258c7d961e187596814aeb91f8e0493b..1df936e43f7c256eee761d3eb6033bf7f25224e2 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdWheel.h" @@ -57,34 +57,15 @@ SCT_FwdWheel::SCT_FwdWheel(const std::string & name, : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_iWheel(iWheel), m_endcap(ec), - m_pPConnector(0), - m_pPCooling(0), - m_discFixation(0), m_modules(modules) { getParameters(); - //m_logVolume = 0; m_logVolume = preBuild(); } SCT_FwdWheel::~SCT_FwdWheel() { - delete m_discSupport; - for (unsigned int iRing = 0; iRing < m_rings.size(); iRing++){ - delete m_rings[iRing]; - } - for (unsigned int iPPType = 0; iPPType < m_patchPanel.size(); iPPType++) { - delete m_patchPanel[iPPType]; - } - - if (m_pPConnectorPresent) delete m_pPConnector; - if (m_pPCoolingPresent) delete m_pPCooling; - if (m_discFixationPresent) delete m_discFixation; - - for (unsigned int iFSI = 0; iFSI < m_fsiType.size(); iFSI++) { - delete m_fsiType[iFSI]; - } } void @@ -149,37 +130,36 @@ SCT_FwdWheel::preBuild() { // Create disc support. - m_discSupport = new SCT_FwdDiscSupport("DiscSupport"+intToString(m_iWheel), m_iWheel, - m_detectorManager, m_geometryManager, m_materials); + m_discSupport = std::make_unique<SCT_FwdDiscSupport>("DiscSupport"+intToString(m_iWheel), m_iWheel, + m_detectorManager, m_geometryManager, m_materials); // The rings for (int iRing = 0; iRing < m_numRings; iRing++){ std::string ringName = "Ring"+intToString(iRing)+"For"+getName(); int ringType = m_ringType[iRing]; - m_rings.push_back(new SCT_FwdRing(ringName, m_modules[ringType], m_iWheel, iRing, m_endcap, + m_rings.push_back(std::make_unique<SCT_FwdRing>(ringName, m_modules[ringType], m_iWheel, iRing, m_endcap, m_detectorManager, m_geometryManager, m_materials)); } // Create Patch Panel - //m_patchPanel = new SCT_FwdPatchPanel("PatchPanel"+intToString(m_iWheel), m_iWheel); for (int iPPType = 0; iPPType < m_numPatchPanelTypes; iPPType++) { - m_patchPanel.push_back(new SCT_FwdPatchPanel("PatchPanel"+intToString(iPPType), iPPType, + m_patchPanel.push_back(std::make_unique<SCT_FwdPatchPanel>("PatchPanel"+intToString(iPPType), iPPType, m_detectorManager, m_geometryManager, m_materials)); } // Create Patch Pannel Connector and Cooling, and disc Fixations if (m_pPConnectorPresent) { - m_pPConnector = new SCT_FwdPPConnector("PPConnector", + m_pPConnector = std::make_unique<SCT_FwdPPConnector>("PPConnector", m_detectorManager, m_geometryManager, m_materials); } if (m_pPCoolingPresent) { - m_pPCooling = new SCT_FwdPPCooling("PPCooling", + m_pPCooling = std::make_unique<SCT_FwdPPCooling>("PPCooling", m_detectorManager, m_geometryManager, m_materials); } if (m_discFixationPresent) { - m_discFixation = new SCT_FwdDiscFixation("DiscFixation", + m_discFixation = std::make_unique<SCT_FwdDiscFixation>("DiscFixation", m_detectorManager, m_geometryManager, m_materials); } @@ -195,7 +175,7 @@ SCT_FwdWheel::preBuild() for (unsigned int iFSI = 0; iFSI < m_fsiVector->size(); iFSI++) { int type = (*m_fsiVector)[iFSI]->simType(); if (!m_fsiType[type]) { - m_fsiType[type] = new SCT_FwdFSI("FSI"+intToString(type), type, + m_fsiType[type] = std::make_unique<SCT_FwdFSI>("FSI"+intToString(type), type, m_detectorManager, m_geometryManager, m_materials); } } @@ -290,7 +270,7 @@ SCT_FwdWheel::build(SCT_Identifier id) for (int iRing = 0; iRing < m_numRings; iRing++){ - SCT_FwdRing * ring = m_rings[iRing]; + SCT_FwdRing * ring = m_rings[iRing].get(); // Position ring double ringZpos = ring->ringSide() * ring->ringOffset(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx index bfc74c74349c2c41d15e7dece87b2ba79120dd9c..094e0e758a3cdc588a57c5a5210e4c809846ad9b 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_GeneralParameters.h" @@ -17,13 +17,12 @@ const double SCT_SAFETY = 0.01 * Gaudi::Units::mm; // Used in some places to mak SCT_GeneralParameters::SCT_GeneralParameters(SCT_DataBase* rdb) { m_rdb = rdb; - m_placements = new TopLevelPlacements(m_rdb->topLevelTable()); + m_placements = std::make_unique<TopLevelPlacements>(m_rdb->topLevelTable()); } SCT_GeneralParameters::~SCT_GeneralParameters() { - delete m_placements; } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx index 9247bce9d758133b3cdd505bf5f76c2c836e342c..7dcfc93d6b8634a7b8a62d1cc2d871a25be0595d 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // @@ -41,9 +41,7 @@ SCT_InnerSide::SCT_InnerSide(const std::string & name, InDetDD::SCT_DetectorManager* detectorManager, const SCT_GeometryManager* geometryManager, SCT_MaterialManager* materials) - : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), - m_hybrid(0), - m_sensor(0) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_logVolume = preBuild(); @@ -52,10 +50,6 @@ SCT_InnerSide::SCT_InnerSide(const std::string & name, SCT_InnerSide::~SCT_InnerSide() { - delete m_hybrid; - delete m_sensor; - delete m_env1RefPointVector; - delete m_env2RefPointVector; if (m_hybridPos) m_hybridPos->unref(); if (m_sensorPos) m_sensorPos->unref(); } @@ -77,8 +71,8 @@ const GeoLogVol * SCT_InnerSide::preBuild() { // Create child components - m_sensor = new SCT_Sensor("BRLSensor", m_detectorManager, m_geometryManager, m_materials); - m_hybrid = new SCT_Hybrid("Hybrid", m_detectorManager, m_geometryManager, m_materials); + m_sensor = std::make_unique<SCT_Sensor>("BRLSensor", m_detectorManager, m_geometryManager, m_materials); + m_hybrid = std::make_unique<SCT_Hybrid>("Hybrid", m_detectorManager, m_geometryManager, m_materials); // // Define constants for convenience. @@ -123,11 +117,8 @@ SCT_InnerSide::preBuild() const double ise2PosY = hybridPosY; const double ise2PosZ = hybridPosZ; - // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (00)********************************* - // *** -->> (00)********************************* - m_env1RefPointVector = new GeoTrf::Vector3D(0.0, 0.0, 0.0); - m_env2RefPointVector = new GeoTrf::Vector3D(-ise2PosX, -ise2PosY, -ise2PosZ); - // *** End of modified lines. ------------------ (00)********************************* + m_env1RefPointVector = std::make_unique<GeoTrf::Vector3D>(0.0, 0.0, 0.0); + m_env2RefPointVector = std::make_unique<GeoTrf::Vector3D>(-ise2PosX, -ise2PosY, -ise2PosZ); m_hybridPos = new GeoTransform(GeoTrf::Translate3D(hybridPosX, hybridPosY, hybridPosZ)); m_hybridPos->ref(); @@ -144,8 +135,6 @@ SCT_InnerSide::preBuild() // //Gaudi::Units::HepRotation rotSensor; //rotSensor.rotateZ(180*Gaudi::Units::deg); - //m_outerSidePos = new GeoTrf::Transform3D(rotOuter, GeoTrf::Vector3D(0.5 * (m_sensorGap + sectThickness), 0., 0.)); - //m_sensorPos = new GeoTransform(GeoTrf::Transform3D(rotSensor, GeoTrf::Vector3D(sensorPosX, sensorPosY, sensorPosZ))); m_sensorPos = new GeoTransform(GeoTrf::Translate3D(sensorPosX, sensorPosY, sensorPosZ)); m_sensorPos->ref(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx index 9d41f5ba92f597196b01c7e027711e55de3bb567..7b1d3378f8e43e49faad3f19a0f65e18c34d741a 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // @@ -63,20 +63,6 @@ SCT_Layer::SCT_Layer(const std::string & name, SCT_Layer::~SCT_Layer() { - delete m_bracket; - delete m_clamp; - delete m_coolingEnd; - delete m_flange; - delete m_harness; - delete m_ski; - delete m_skiAux; - delete m_skiPowerTape; - delete m_supportCyl; - if (m_includeFSI) { - delete m_endJewel; - delete m_scorpion; - delete m_fibreMask; - } } void @@ -123,26 +109,21 @@ SCT_Layer::preBuild() std::string layerNumStr = intToString(m_iLayer); // Build the Flanges - m_flange = new SCT_Flange("Flange"+layerNumStr, m_iLayer, m_detectorManager, m_geometryManager, m_materials); + m_flange = std::make_unique<SCT_Flange>("Flange"+layerNumStr, m_iLayer, m_detectorManager, m_geometryManager, m_materials); // Build the SupportCyl - m_supportCyl = new SCT_SupportCyl("SupportCyl"+layerNumStr, m_iLayer, m_cylinderLength, + m_supportCyl = std::make_unique<SCT_SupportCyl>("SupportCyl"+layerNumStr, m_iLayer, m_cylinderLength, m_detectorManager, m_geometryManager, m_materials); // Build the FSI end jewel, scorpion and fibre mask // Mask runs between scorpions and flange in z - must be built after these if (m_includeFSI) { - m_endJewel = new SCT_FSIEndJewel("FSIEndJewel"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); - m_scorpion = new SCT_FSIScorpion("FSIScorpion"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); + m_endJewel = std::make_unique<SCT_FSIEndJewel>("FSIEndJewel"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); + m_scorpion = std::make_unique<SCT_FSIScorpion>("FSIScorpion"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); double length_mask = 0.5*m_cylinderLength - m_flange->length() - m_zScorpion - 0.5*m_scorpion->length(); - m_fibreMask = new SCT_FSIFibreMask("FSIFibreMask"+layerNumStr, m_iLayer, length_mask, + m_fibreMask = std::make_unique<SCT_FSIFibreMask>("FSIFibreMask"+layerNumStr, m_iLayer, length_mask, m_detectorManager, m_geometryManager, m_materials); } - else { - m_endJewel = nullptr; - m_scorpion = nullptr; - m_fibreMask = nullptr; - } // // Calculations for making active layer components - called ski. @@ -160,7 +141,7 @@ SCT_Layer::preBuild() // Make the ski // The ski length is now reduced to m_activeLength to make room for the cooling inlet/outlet volumes - m_ski = new SCT_Ski("Ski"+layerNumStr, m_module, m_stereoSign, m_tilt, m_activeLength, + m_ski = std::make_unique<SCT_Ski>("Ski"+layerNumStr, m_module, m_stereoSign, m_tilt, m_activeLength, m_detectorManager, m_geometryManager, m_materials); // @@ -169,11 +150,11 @@ SCT_Layer::preBuild() // Bracket is placed at edge of division. // -tiltSign * (r*divisionAngle/2 - bracket_width/2) // Works for both +ve and -ve tilt. - m_bracket = new SCT_Bracket("Bracket"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); + m_bracket = std::make_unique<SCT_Bracket>("Bracket"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); - m_harness = new SCT_Harness("Harness"+layerNumStr, m_cylinderLength, + m_harness = std::make_unique<SCT_Harness>("Harness"+layerNumStr, m_cylinderLength, m_detectorManager, m_geometryManager, m_materials); - m_skiPowerTape = new SCT_SkiPowerTape("SkiPowerTape"+layerNumStr, m_ski, m_cylinderLength, + m_skiPowerTape = std::make_unique<SCT_SkiPowerTape>("SkiPowerTape"+layerNumStr, m_ski.get(), m_cylinderLength, m_detectorManager, m_geometryManager, m_materials); int tiltSign = (m_tilt < 0) ? -1 : +1; @@ -185,21 +166,21 @@ SCT_Layer::preBuild() // Make the SkiAux. This is layer dependent. - m_skiAux = new SCT_SkiAux("SkiAux"+layerNumStr, - m_ski, - m_bracket, - m_harness, - m_skiPowerTape, - m_outerRadiusOfSupport, - bracketOffset, - powerTapeOffset, - divisionAngle, - m_detectorManager, - m_geometryManager, - m_materials); + m_skiAux = std::make_unique<SCT_SkiAux>("SkiAux"+layerNumStr, + m_ski.get(), + m_bracket.get(), + m_harness.get(), + m_skiPowerTape.get(), + m_outerRadiusOfSupport, + bracketOffset, + powerTapeOffset, + divisionAngle, + m_detectorManager, + m_geometryManager, + m_materials); // Build the clamp: we cannot do this until we have the dimensions of SkiAux - m_clamp = new SCT_Clamp("Clamp"+layerNumStr, m_iLayer, m_skiAux->outerRadius(), + m_clamp = std::make_unique<SCT_Clamp>("Clamp"+layerNumStr, m_iLayer, m_skiAux->outerRadius(), m_detectorManager, m_geometryManager, m_materials); // Build the volume representing the cooling inlets, outlet and U-bends. @@ -207,7 +188,7 @@ SCT_Layer::preBuild() double coolingInnerRadius = m_clamp->outerRadius(); double clearance = 1*Gaudi::Units::mm; double coolingLength = 0.5*m_cylinderLength - 0.5*m_activeLength - clearance; - m_coolingEnd = new SCT_CoolingEnd("CoolingEnd"+layerNumStr, m_iLayer, coolingInnerRadius, coolingLength, + m_coolingEnd = std::make_unique<SCT_CoolingEnd>("CoolingEnd"+layerNumStr, m_iLayer, coolingInnerRadius, coolingLength, m_detectorManager, m_geometryManager, m_materials); // diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx index 8f465b1db7e8abb5dcbf32b53502d08011118741..d192435a5bbd18e54d231dc20043ba521dc811d4 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Module.h" @@ -43,11 +43,7 @@ SCT_Module::SCT_Module(const std::string & name, InDetDD::SCT_DetectorManager* detectorManager, const SCT_GeometryManager* geometryManager, SCT_MaterialManager* materials) -: SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), - m_innerSide(0), - m_outerSide(0), - m_baseBoard(0) - +: SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_logVolume = preBuild(); @@ -56,17 +52,6 @@ SCT_Module::SCT_Module(const std::string & name, SCT_Module::~SCT_Module() { - // Clean up - delete m_baseBoardPos; // 6th Apr 2005 S.Mima modified. - delete m_innerSidePos; - delete m_outerSidePos; - - delete m_innerSide; - delete m_outerSide; - delete m_baseBoard; - - delete m_env1RefPointVector; - delete m_env2RefPointVector; } @@ -95,9 +80,9 @@ const GeoLogVol * SCT_Module::preBuild() { // Create child components - m_outerSide = new SCT_OuterSide("OuterSide", m_detectorManager, m_geometryManager, m_materials); - m_baseBoard = new SCT_BaseBoard("BaseBoard", m_detectorManager, m_geometryManager, m_materials); - m_innerSide = new SCT_InnerSide("InnerSide", m_detectorManager, m_geometryManager, m_materials); + m_outerSide = std::make_unique<SCT_OuterSide>("OuterSide", m_detectorManager, m_geometryManager, m_materials); + m_baseBoard = std::make_unique<SCT_BaseBoard>("BaseBoard", m_detectorManager, m_geometryManager, m_materials); + m_innerSide = std::make_unique<SCT_InnerSide>("InnerSide", m_detectorManager, m_geometryManager, m_materials); // // We have 2 envelopes. @@ -213,7 +198,7 @@ SCT_Module::preBuild() const double yCenterEnv1 = yminEnv1 + 0.5*widthEnv1; const double zCenterEnv1 = zmaxEnv1 - 0.5*lengthEnv1; - m_env1RefPointVector = new GeoTrf::Vector3D(-xCenterEnv1, -yCenterEnv1, -zCenterEnv1); + m_env1RefPointVector = std::make_unique<GeoTrf::Vector3D>(-xCenterEnv1, -yCenterEnv1, -zCenterEnv1); // Calculate demension of envelope2. const double z_ikl = std::max(i.z(), l.z()); @@ -244,7 +229,7 @@ SCT_Module::preBuild() const double yCenterEnv2 = ymaxEnv2 - 0.5*widthEnv2; const double zCenterEnv2 = zmaxEnv2 - 0.5*lengthEnv2; - m_env2RefPointVector = new GeoTrf::Vector3D(-xCenterEnv2, -yCenterEnv2, -zCenterEnv2); + m_env2RefPointVector = std::make_unique<GeoTrf::Vector3D>(-xCenterEnv2, -yCenterEnv2, -zCenterEnv2); // 8th Aug 2005 S.Mima modified. // Calculate dimension of subbox @@ -307,13 +292,13 @@ SCT_Module::preBuild() // inner side // GeoTrf::Transform3D rotInner = GeoTrf::RotateX3D(m_stereoInner) * GeoTrf::RotateZ3D(180*Gaudi::Units::deg); - m_innerSidePos = new GeoTrf::Transform3D(GeoTrf::Transform3D(GeoTrf::Translation3D(ISPosX, 0.0, 0.0)*rotInner)); + m_innerSidePos = std::make_unique<GeoTrf::Transform3D>(GeoTrf::Transform3D(GeoTrf::Translation3D(ISPosX, 0.0, 0.0)*rotInner)); // // outer side // GeoTrf::RotateX3D rotOuter(m_stereoOuter); - m_outerSidePos = new GeoTrf::Transform3D(GeoTrf::Transform3D(GeoTrf::Translation3D(OSPosX, 0.0, 0.0)*rotOuter)); + m_outerSidePos = std::make_unique<GeoTrf::Transform3D>(GeoTrf::Transform3D(GeoTrf::Translation3D(OSPosX, 0.0, 0.0)*rotOuter)); // // base board @@ -321,7 +306,7 @@ SCT_Module::preBuild() // const double baseBoardPosY = m_baseBoardOffsetY; const double baseBoardPosZ = m_baseBoardOffsetZ; - m_baseBoardPos = new GeoTrf::Translate3D(0.0, baseBoardPosY, baseBoardPosZ); + m_baseBoardPos = std::make_unique<GeoTrf::Translate3D>(0.0, baseBoardPosY, baseBoardPosZ); return moduleLog; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx index 4cf592f91f150111ad8bf3e8dbbdd8fa893c9ece..7229f21b8efe8a7ed3b4767775317642c8691613 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_OuterSide.h" @@ -36,10 +36,7 @@ SCT_OuterSide::SCT_OuterSide(const std::string & name, InDetDD::SCT_DetectorManager* detectorManager, const SCT_GeometryManager* geometryManager, SCT_MaterialManager* materials) - : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), - m_hybrid(0), - m_pigtail(0), - m_sensor(0) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_logVolume = preBuild(); @@ -48,11 +45,6 @@ SCT_OuterSide::SCT_OuterSide(const std::string & name, SCT_OuterSide::~SCT_OuterSide() { - delete m_hybrid; - delete m_pigtail; - delete m_sensor; - delete m_env1RefPointVector; - delete m_env2RefPointVector; if (m_hybridPos) m_hybridPos->unref(); if (m_pigtailPos) m_pigtailPos->unref(); if (m_sensorPos) m_sensorPos->unref(); @@ -75,9 +67,9 @@ const GeoLogVol * SCT_OuterSide::preBuild() { // Create child components - m_sensor = new SCT_Sensor("BRLSensor", m_detectorManager, m_geometryManager, m_materials); - m_hybrid = new SCT_Hybrid("Hybrid", m_detectorManager, m_geometryManager, m_materials); - m_pigtail = new SCT_Pigtail("Pigtail", m_detectorManager, m_geometryManager, m_materials); + m_sensor = std::make_unique<SCT_Sensor>("BRLSensor", m_detectorManager, m_geometryManager, m_materials); + m_hybrid = std::make_unique<SCT_Hybrid>("Hybrid", m_detectorManager, m_geometryManager, m_materials); + m_pigtail = std::make_unique<SCT_Pigtail>("Pigtail", m_detectorManager, m_geometryManager, m_materials); // // Define constants for convenience. @@ -128,11 +120,8 @@ SCT_OuterSide::preBuild() const double ose2PosY = hybridPosY - 0.5*w_pigtail; const double ose2PosZ = hybridPosZ; - // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (02)********************************* - // *** -->> (02)********************************* - m_env1RefPointVector = new GeoTrf::Vector3D(0.0, 0.0, 0.0); - m_env2RefPointVector = new GeoTrf::Vector3D(-ose2PosX, -ose2PosY, -ose2PosZ); - // *** End of modified lines. ------------------ (02)********************************* + m_env1RefPointVector = std::make_unique<GeoTrf::Vector3D>(0.0, 0.0, 0.0); + m_env2RefPointVector = std::make_unique<GeoTrf::Vector3D>(-ose2PosX, -ose2PosY, -ose2PosZ); m_hybridPos = new GeoTransform(GeoTrf::Translate3D(hybridPosX, hybridPosY, hybridPosZ)); m_hybridPos->ref(); @@ -143,7 +132,7 @@ SCT_OuterSide::preBuild() // and so point to away from the module center. // The two sensor+hybrid combinations are built in a similar way. // - // ^ + // ^ // --- hybrid | // ------- sensor | x-axis // @@ -151,8 +140,6 @@ SCT_OuterSide::preBuild() // //Gaudi::Units::HepRotation rotSensor; //rotSensor.rotateZ(180*Gaudi::Units::deg); - //m_outerSidePos = new GeoTrf::Transform3D(rotOuter, GeoTrf::Vector3D(0.5 * (m_sensorGap + sectThickness), 0., 0.)); - //m_sensorPos = new GeoTransform(GeoTrf::Transform3D(rotSensor, GeoTrf::Vector3D(sensorPosX, sensorPosY, sensorPosZ))); m_sensorPos = new GeoTransform(GeoTrf::Translate3D(sensorPosX, sensorPosY, sensorPosZ)); m_sensorPos->ref(); @@ -173,12 +160,7 @@ SCT_OuterSide::preBuild() &OuterSideEnvelopeShape, m_materials->gasMaterial()); - // 28th Mar S.Mima modified. - // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (03)********************************* - //m_thickness = 0.5*t_sensor + m_hybridOffsetX + 0.5*t_ose2; - // *** -->> (03)********************************* m_thickness = 0.5*t_ose1 + m_hybridOffsetX + 0.5*t_ose2; - // *** End of modified lines. ------------------ (03)********************************* m_width = w_ose2; m_length = l_ose1; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx index 3c180ab14c0a7b8cadc03c12d0150e948e58f391..92262a09defaf3ea5f8fa6baeb85d482422d46e9 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Sensor.h" @@ -104,6 +104,7 @@ SCT_Sensor::makeDesign() // The readout side is at the +ve depth direction int readoutSide = +1; + // m_design will be owned and deleted by SCT_DetectorManager m_design = new SCT_BarrelModuleSideDesign(m_thickness, crystals, diodes, @@ -148,6 +149,8 @@ SCT_Sensor::build(SCT_Identifier id) SiDetectorElement * detElement; + // detElement will be owned by SCT_DetectorManager + // and will be deleted in destructor of SiDetectorElementCollection in SCT_DetectorManager detElement = new SiDetectorElement(id.getWaferId(), m_design, sensor, diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx index 9e5471a91f8fa04937fa5ea38a1e0a083815fc01..3172db64fc682b50f06d3da9f6ee90ec87b2dc0a 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Ski.h" @@ -9,9 +9,9 @@ #include "SCT_GeoModel/SCT_BarrelParameters.h" #include "SCT_GeoModel/SCT_GeneralParameters.h" #include "SCT_GeoModel/SCT_Module.h" -#include "SCT_GeoModel/SCT_BaseBoard.h" // 18:00 Wed 15th Jun 2005 D.Naito added. +#include "SCT_GeoModel/SCT_BaseBoard.h" #include "SCT_GeoModel/SCT_Dogleg.h" -#include "SCT_GeoModel/SCT_CoolingBlock.h" // 14th Aug 2005 S.Mima added. +#include "SCT_GeoModel/SCT_CoolingBlock.h" #include "SCT_GeoModel/SCT_CoolingPipe.h" #include "SCT_ReadoutGeometry/SCT_DetectorManager.h" @@ -55,11 +55,6 @@ SCT_Ski::SCT_Ski(const std::string & name, SCT_Ski::~SCT_Ski() { - delete m_dogleg; - delete m_coolingBlock; - delete m_coolingPipe; - delete m_env1RefPointVector; - delete m_env2RefPointVector; if (m_refPointTransform) m_refPointTransform->unref(); if (m_coolingPipePos) m_coolingPipePos->unref(); } @@ -110,10 +105,10 @@ SCT_Ski::preBuild() // Make components. - m_dogleg = new SCT_Dogleg(getName()+"Dogleg", m_detectorManager, m_geometryManager, m_materials); - m_coolingBlock = new SCT_CoolingBlock(getName()+"CoolingBlock", + m_dogleg = std::make_unique<SCT_Dogleg>(getName()+"Dogleg", m_detectorManager, m_geometryManager, m_materials); + m_coolingBlock = std::make_unique<SCT_CoolingBlock>(getName()+"CoolingBlock", m_detectorManager, m_geometryManager, m_materials); - m_coolingPipe = new SCT_CoolingPipe(getName()+"CoolingPipe", m_length, + m_coolingPipe = std::make_unique<SCT_CoolingPipe>(getName()+"CoolingPipe", m_length, m_detectorManager, m_geometryManager, m_materials); // We need the sign of the tilt in numerous places @@ -416,8 +411,8 @@ SCT_Ski::preBuild() // *** 10:00 Tue 31st May 2005 D.Naito modified. (14)********************************* // *** -->> (14)********************************* - m_env1RefPointVector = new GeoTrf::Vector3D(-xCenter, -yCenter, 0.0); - m_env2RefPointVector = new GeoTrf::Vector3D(-xShift2, -yShift2, 0.0); + m_env1RefPointVector = std::make_unique<GeoTrf::Vector3D>(-xCenter, -yCenter, 0.0); + m_env2RefPointVector = std::make_unique<GeoTrf::Vector3D>(-xShift2, -yShift2, 0.0); m_env1Thickness = xmax1-xmin1; m_env1Width = ymax1-ymin1; m_env2Thickness = xmax2-xmin2;