Skip to content
Snippets Groups Projects
Commit e3ad6911 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia Committed by Melissa Yexley
Browse files

BeamPipeGeoModel: migrated to GeoIntrusivePtr

parent 6f615758
No related branches found
No related tags found
No related merge requests found
/*
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
......
/*
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();
}
}
......
/*
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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment