diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/BeamPipeGeoModel/BeamPipeDetectorManager.h b/AtlasGeometryCommon/BeamPipeGeoModel/BeamPipeGeoModel/BeamPipeDetectorManager.h index 0ac0ee47353a3b5db072cb071386b69188190125..5893b3e9d33c9e3a482c7cfd3c195bab9f37784d 100755 --- a/AtlasGeometryCommon/BeamPipeGeoModel/BeamPipeGeoModel/BeamPipeDetectorManager.h +++ b/AtlasGeometryCommon/BeamPipeGeoModel/BeamPipeGeoModel/BeamPipeDetectorManager.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ -#ifndef BeamPipeDetectorManager_h -#define BeamPipeDetectorManager_h 1 +#ifndef BEAMPIPEGEOMODEL_BEAMPIPEDETECTORMANAGER_H +#define BEAMPIPEGEOMODEL_BEAMPIPEDETECTORMANAGER_H #include "GeoModelKernel/GeoVPhysVol.h" #include "GeoModelKernel/GeoVDetectorManager.h" @@ -35,7 +35,6 @@ class BeamPipeDetectorManager : public GeoVDetectorManager BeamPipeDetectorManager(const BeamPipeDetectorManager &right); std::vector<PVConstLink> m_volume; - }; #ifndef GAUDI_NEUTRAL diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx index 8ed73ac99e500c4842fd79c7e47a668e52c3dda0..25c704107bb5376fe706a4062afc51a80c2b1bf4 100755 --- a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx +++ b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "BeamPipeDetectorFactory.h" @@ -242,8 +242,7 @@ void BeamPipeDetectorFactory::addSections(GeoPhysVol* parent, int region) } GeoLogVol* lvSection = new GeoLogVol(name,shape,mat); - GeoPhysVol* pvSection = new GeoPhysVol(lvSection); - pvSection->ref(); + GeoIntrusivePtr<GeoPhysVol> pvSection{new GeoPhysVol(lvSection)}; // Determine if this is a geometry where the first section can act as the mother of the following // sections. The following sections are only added to this if their ave radius is within the radial @@ -266,8 +265,7 @@ void BeamPipeDetectorFactory::addSections(GeoPhysVol* parent, int region) GeoTransform* tfSection = 0; if (znew != 0 && (secNum==1 || !addToFirstSection)) tfSection = new GeoTransform(GeoTrf::TranslateZ3D(znew)); - GeoNameTag* ntSection = new GeoNameTag(name); - ntSection->ref(); + GeoIntrusivePtr<GeoNameTag> ntSection{new GeoNameTag(name)}; if (addToFirstSection && secNum!=1) { if (!pvMotherSection) { @@ -302,8 +300,6 @@ void BeamPipeDetectorFactory::addSections(GeoPhysVol* parent, int region) parent->add(pvSection); } - pvSection->unref(); - ntSection->unref(); } } diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorManager.cxx b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorManager.cxx index d86fb9db67afd84e914a8dadf1ce8651a3801817..6202dc83fa5c0bb964bfc7f37ac2824731e4dbc3 100755 --- a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorManager.cxx +++ b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "BeamPipeGeoModel/BeamPipeDetectorManager.h" @@ -10,13 +10,7 @@ BeamPipeDetectorManager::BeamPipeDetectorManager() } -BeamPipeDetectorManager::~BeamPipeDetectorManager() -{ - for (unsigned int i = 0; i < m_volume.size(); i++) { - m_volume[i]->unref(); - } -} - +BeamPipeDetectorManager::~BeamPipeDetectorManager() = default; unsigned int BeamPipeDetectorManager::getNumTreeTops() const { @@ -30,7 +24,6 @@ PVConstLink BeamPipeDetectorManager::getTreeTop(unsigned int i) const void BeamPipeDetectorManager::addTreeTop(PVConstLink vol) { - vol->ref(); m_volume.push_back(vol); }