From d5e1d98ebb10af629b55feafd20bc4a2c5f81017 Mon Sep 17 00:00:00 2001 From: scott snyder Date: Tue, 25 Dec 2018 16:25:19 +0100 Subject: [PATCH] ForwardRegionGeoModel: Avoid use of non-bound DataHandle. Deprecating use of non-bound DataHandle, especially non-const. --- .../src/ForwardRegionGeoModelFactory.cxx | 11 +++++------ .../src/ForwardRegionGeoModelTool.cxx | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelFactory.cxx b/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelFactory.cxx index da385074719..8108bb3b019 100755 --- a/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelFactory.cxx +++ b/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "ForwardRegionGeoModelFactory.h" @@ -24,7 +24,6 @@ #include "GeoGenericFunctions/Cos.h" #include "CLHEP/Geometry/Point3D.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/DataHandle.h" #include "CLHEP/Units/SystemOfUnits.h" #include "GeoModelInterfaces/StoredMaterialManager.h" @@ -100,7 +99,7 @@ void ForwardRegionGeoModelFactory::DefineMaterials() { std::string matName; - DataHandle materialManager; + const StoredMaterialManager* materialManager = nullptr; if (StatusCode::SUCCESS != m_detectorStore->retrieve(materialManager, std::string("MATERIALS"))) { return; } @@ -112,8 +111,8 @@ void ForwardRegionGeoModelFactory::DefineMaterials() // vacuum matName = "std::Vacuum"; - GeoMaterial *vacuum = materialManager->getMaterial(matName); - m_MapMaterials.insert(std::pair(matName,vacuum)); + const GeoMaterial *vacuum = materialManager->getMaterial(matName); + m_MapMaterials.emplace(matName,vacuum); // water matName = "water"; @@ -123,7 +122,7 @@ void ForwardRegionGeoModelFactory::DefineMaterials() water->add(hydrogen,0.11); water->add(oxygen,0.89); water->lock(); - m_MapMaterials.insert(std::pair(matName,water)); + m_MapMaterials.emplace(matName,water); // elements const GeoElement* C = materialManager->getElement("Carbon"); diff --git a/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelTool.cxx b/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelTool.cxx index cd2494ced12..b30c4f3aa75 100755 --- a/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelTool.cxx +++ b/ForwardDetectors/ForwardSimulation/ForwardRegionGeoModel/src/ForwardRegionGeoModelTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "ForwardRegionGeoModelTool.h" @@ -66,7 +66,7 @@ ForwardRegionGeoModelTool::create() // // Locate the top level experiment node // - DataHandle theExpt; + GeoModelExperiment* theExpt = nullptr; StatusCode sc = detStore()->retrieve( theExpt, "ATLAS" ); if (StatusCode::SUCCESS != sc) { log << MSG::ERROR -- GitLab