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

MuonAGDDBase: Avoid use of non-bound DataHandle.

Deprecating use of non-bound DataHandle, especially non-const.
Also adding const for materials.


Former-commit-id: cb10917a
parent c930fb00
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
*/
#ifndef AGDDMMSpacer_H
......@@ -38,8 +38,6 @@ private:
double m_large_x;
double m_y;
double m_z;
GeoMaterial* GetMMMaterial(std::string);
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#ifndef AGDDMuonStation_H
......@@ -38,7 +38,7 @@ private:
double m_y;
double m_z;
GeoMaterial* GetMMMaterial(std::string);
const GeoMaterial* GetMMMaterial(std::string);
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
......@@ -47,20 +47,3 @@ void AGDDMMSpacer::CreateVolume()
// std::cout<<"done creating volume "<<std::endl;
}
}
GeoMaterial* AGDDMMSpacer::GetMMMaterial(std::string name)
{
StoreGateSvc* pDetStore=0;
ISvcLocator* svcLocator = Gaudi::svcLocator();
StatusCode sc=svcLocator->service("DetectorStore",pDetStore);
if(sc.isSuccess())
{
DataHandle<StoredMaterialManager> theMaterialManager;
sc = pDetStore->retrieve(theMaterialManager, "MATERIALS");
if(sc.isSuccess())
{
return theMaterialManager->getMaterial(name);
}
}
return 0;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
......@@ -33,7 +33,7 @@ void AGDDMuonStation::CreateVolume()
{
std::cout<<"this is AGDDMuonStation::CreateVolume()"<<std::endl;
static int ifirst=1;
static GeoMaterial* air=0;
static const GeoMaterial* air=0;
if (ifirst)
{
ifirst=0;
......@@ -55,14 +55,14 @@ void AGDDMuonStation::CreateVolume()
}
}
GeoMaterial* AGDDMuonStation::GetMMMaterial(std::string name)
const GeoMaterial* AGDDMuonStation::GetMMMaterial(std::string name)
{
StoreGateSvc* pDetStore=0;
ISvcLocator* svcLocator = Gaudi::svcLocator();
StatusCode sc=svcLocator->service("DetectorStore",pDetStore);
if(sc.isSuccess())
{
DataHandle<StoredMaterialManager> theMaterialManager;
const StoredMaterialManager* theMaterialManager = nullptr;
sc = pDetStore->retrieve(theMaterialManager, "MATERIALS");
if(sc.isSuccess())
{
......
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