Skip to content
Snippets Groups Projects
Commit f710f675 authored by Scott Snyder's avatar Scott Snyder Committed by scott snyder
Browse files

LArGeoTBEC: Avoid use of non-bound DataHandle.

Deprecating use of non-bound DataHandle, especially non-const.
Also adding const for materials.
parent 6c2c8f5a
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// CryostatConstructionTBEC
......@@ -23,7 +23,6 @@
#include "GeoModelKernel/GeoAlignableTransform.h"
#include "GeoModelKernel/GeoIdentifierTag.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/DataHandle.h"
#include "GeoModelInterfaces/AbsMaterialManager.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
#include "GeoModelKernel/GeoShapeUnion.h"
......@@ -77,25 +76,25 @@ GeoVFullPhysVol* LArGeo::CryostatConstructionTBEC::GetEnvelope()
// Get the materials from the material manager:-----------------------------------------------------//
// //
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL;
GeoMaterial *Air = materialManager->getMaterial("std::Air");
const GeoMaterial *Air = materialManager->getMaterial("std::Air");
if (!Air) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Air is not found.");
GeoMaterial *Al = materialManager->getMaterial("std::Aluminium");
const GeoMaterial *Al = materialManager->getMaterial("std::Aluminium");
if (!Al) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Aluminium is not found.");
GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon");
const GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon");
if (!LAr) throw std::runtime_error("Error in CryostatConstructionTBEC, std::LiquidArgon is not found.");
GeoMaterial *Iron = materialManager->getMaterial("std::Iron");
const GeoMaterial *Iron = materialManager->getMaterial("std::Iron");
if (!Iron) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Iron is not found.");
GeoMaterial *Gten = materialManager->getMaterial("LAr::G10");
const GeoMaterial *Gten = materialManager->getMaterial("LAr::G10");
if (!Gten) throw std::runtime_error("Error in CryostatConstructionTBEC, LAr::G10 is not found.");
GeoMaterial *Vacuum = materialManager->getMaterial("LAr::Vacuum");
const GeoMaterial *Vacuum = materialManager->getMaterial("LAr::Vacuum");
if (!Vacuum) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Vacuum is not found.");
// //
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// EMECModuleConstruction
......@@ -82,7 +82,7 @@ GeoVFullPhysVol* LArGeo::EMECModuleConstruction::GetEnvelope()
if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
throw std::runtime_error("Error in EndcapCryostatConstruction, cannot access DetectorStore");
}
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return 0;
......@@ -103,15 +103,15 @@ GeoVFullPhysVol* LArGeo::EMECModuleConstruction::GetEnvelope()
double FracGten,Fracpb,Fracfe,Fracgl,Fraccu,Fracka;
double aH,aO,aC,aN,aAr;
GeoElement* H=materialManager->getElement("Hydrogen");
GeoElement* C=materialManager->getElement("Carbon");
GeoElement* N=materialManager->getElement("Nitrogen");
GeoElement* O=materialManager->getElement("Oxygen");
GeoElement* Al=materialManager->getElement("Aluminium");
GeoElement* Ar=materialManager->getElement("Argon");
GeoElement* Fe=materialManager->getElement("Iron");
GeoElement* Cu=materialManager->getElement("Copper");
GeoElement* Pb=materialManager->getElement("Lead");
const GeoElement* H=materialManager->getElement("Hydrogen");
const GeoElement* C=materialManager->getElement("Carbon");
const GeoElement* N=materialManager->getElement("Nitrogen");
const GeoElement* O=materialManager->getElement("Oxygen");
const GeoElement* Al=materialManager->getElement("Aluminium");
const GeoElement* Ar=materialManager->getElement("Argon");
const GeoElement* Fe=materialManager->getElement("Iron");
const GeoElement* Cu=materialManager->getElement("Copper");
const GeoElement* Pb=materialManager->getElement("Lead");
//LAr
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// LArDetectorConstructionTBEC
......@@ -22,7 +22,6 @@
#include "GeoModelKernel/GeoAlignableTransform.h"
#include "GeoModelKernel/GeoIdentifierTag.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/DataHandle.h"
#include "GeoModelInterfaces/AbsMaterialManager.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
#include "GeoModelUtilities/StoredPhysVol.h"
......@@ -149,10 +148,10 @@ GeoVPhysVol* LArGeo::LArDetectorConstructionTBEC::GetEnvelope()
if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
throw std::runtime_error("Error in LArDetectorConstructionTBEC, cannot access DetectorStore");
}
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return 0;
GeoMaterial *Air = materialManager->getMaterial("std::Air");
const GeoMaterial *Air = materialManager->getMaterial("std::Air");
if (!Air) {
throw std::runtime_error("Error in LArDetectorConstructionTBEC, std::Air is not found.");
}
......@@ -229,13 +228,13 @@ GeoFullPhysVol* LArGeo::LArDetectorConstructionTBEC::createEnvelope()
// Get the materials from the material manager:-----------------------------------------------------//
// //
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL;
GeoMaterial *Air = materialManager->getMaterial("std::Air");
const GeoMaterial *Air = materialManager->getMaterial("std::Air");
if (!Air) throw std::runtime_error("Error in LArDetectorConstructionTBEC, std::Air is not found.");
GeoMaterial *Lead = materialManager->getMaterial("std::Lead");
const GeoMaterial *Lead = materialManager->getMaterial("std::Lead");
if (!Lead) throw std::runtime_error("Error in LArDetectorConstructionTBEC, std::Lead is not found.");
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// LArDetectorFactory.cxx
......@@ -18,7 +18,6 @@
#include "CLHEP/Geometry/Transform3D.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
#include "StoreGate/DataHandle.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/MsgStream.h"
......@@ -80,11 +79,6 @@ void LArGeo::LArDetectorFactoryTBEC::create( GeoPhysVol* a_container )
throw std::runtime_error("Error in LArDetectorFactoryTBEC, cannot access DetectorStore");
}
DataHandle<StoredMaterialManager> materialManager;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) {
throw std::runtime_error("Error in LArDetectorFactoryTBEC, cannot access Material Manager");
}
// V.N : Patch LAr materials
LArMaterialManager lArMaterialManager(detStore);
lArMaterialManager.buildMaterials();
......
/*
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 "LArDetectorToolTBEC.h"
......@@ -48,7 +48,7 @@ StatusCode LArDetectorToolTBEC::create()
log << MSG::INFO << "LAr Geometry Options:" << endmsg;
// Locate the top level experiment node
DataHandle<GeoModelExperiment> theExpt;
GeoModelExperiment* theExpt = nullptr;
if (StatusCode::SUCCESS != detStore()->retrieve( theExpt, "ATLAS" ))
{
log << MSG::ERROR << "Could not find GeoModelExperiment ATLAS" << endmsg;
......
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