Verified Commit 20cc3968 authored by Tadej Novak's avatar Tadej Novak
Browse files

Cleanup the usage of InDetGeometryDBSvc

parent 4fe8aca2
Pipeline #3112779 passed with stage
in 0 seconds
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
from AthenaConfiguration.ComponentFactory import CompFactory
......@@ -6,8 +6,6 @@ def ForDetGeometryCfg( ConfigFlags ):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc = GeoModelCfg( ConfigFlags )
geoModelSvc=acc.getPrimary()
GeometryDBSvc=CompFactory.GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
# LUCID
if ConfigFlags.Detector.GeometryLucid:
LUCID_DetectorTool=CompFactory.LUCID_DetectorTool
......
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
def InDetGeometryDBSvcCfg(flags):
acc = ComponentAccumulator()
acc.addService(CompFactory.GeometryDBSvc("InDetGeometryDBSvc"), primary=True)
return acc
......@@ -15,7 +15,7 @@ atlas_add_library( HGTD_GeoModelLib
PUBLIC_HEADERS HGTD_GeoModel
INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
DEFINITIONS ${CLHEP_DEFINITIONS}
LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel InDetGeoModelUtils GeometryDBSvcLib HGTD_Identifier HGTD_ReadoutGeometry ReadoutGeometryBase StoreGateLib SGtests AthenaBaseComps
LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel InDetGeoModelUtils HGTD_Identifier HGTD_ReadoutGeometry ReadoutGeometryBase StoreGateLib SGtests AthenaBaseComps
PRIVATE_LINK_LIBRARIES SGTools AthenaPoolUtilities DetDescrConditions Identifier )
atlas_add_component( HGTD_GeoModel
......
......@@ -9,7 +9,6 @@
#include "GaudiKernel/ToolHandle.h"
#include "GeoModelUtilities/GeoModelTool.h"
#include "HGTD_GeoModel/HGTD_GeoModelAthenaComps.h"
#include "GeometryDBSvc/IGeometryDBSvc.h"
#include "GeoModelInterfaces/IGeoDbTagSvc.h"
#include "RDBAccessSvc/IRDBAccessSvc.h"
......@@ -47,7 +46,6 @@ class HGTD_DetectorTool : public GeoModelTool {
ServiceHandle<IGeoDbTagSvc> m_geoDbTagSvc;
ServiceHandle<IRDBAccessSvc> m_rdbAccessSvc;
ServiceHandle<IGeometryDBSvc> m_geometryDBSvc;
const HGTD_DetectorManager* m_detectorManager;
......
......@@ -2,16 +2,15 @@
from AthenaConfiguration.ComponentFactory import CompFactory
def HGTD_GeometryCfg( flags ):
def HGTD_GeometryCfg(flags):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc = GeoModelCfg( flags )
geoModelSvc=acc.getPrimary()
GeometryDBSvc=CompFactory.GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
HGTD_DetectorTool=CompFactory.HGTD_DetectorTool
hgtdDetectorTool = HGTD_DetectorTool("HGTD_DetectorTool")
acc = GeoModelCfg(flags)
geoModelSvc = acc.getPrimary()
hgtdDetectorTool = CompFactory.HGTD_DetectorTool("HGTD_DetectorTool")
hgtdDetectorTool.Alignable = False
hgtdDetectorTool.DetectorName = "HGTD"
hgtdDetectorTool.PrintModuleNumberPerRow = False
geoModelSvc.DetectorTools += [ hgtdDetectorTool ]
return acc
......@@ -22,13 +22,11 @@ HGTD_DetectorTool::HGTD_DetectorTool(const std::string &type,
GeoModelTool(type, name, parent),
m_geoDbTagSvc("GeoDbTagSvc", name),
m_rdbAccessSvc("RDBAccessSvc", name),
m_geometryDBSvc("InDetGeometryDBSvc", name),
m_detectorManager(nullptr),
m_printIDdict(false) {
// Get parameter values from the python configuration
declareProperty("GeoDbTagSvc", m_geoDbTagSvc);
declareProperty("RDBAccessSvc", m_rdbAccessSvc);
declareProperty("GeometryDBSvc", m_geometryDBSvc);
declareProperty("PrintModuleNumberPerRow", m_printIDdict);
}
......@@ -36,13 +34,11 @@ StatusCode HGTD_DetectorTool::create() {
ATH_CHECK(m_geoDbTagSvc.retrieve());
ATH_CHECK(m_rdbAccessSvc.retrieve());
ATH_CHECK(m_geometryDBSvc.retrieve());
// Get their interfaces to pass to the DetectorFactory
m_athenaComps.setDetStore(detStore().operator->());
m_athenaComps.setGeoDbTagSvc(&*m_geoDbTagSvc);
m_athenaComps.setRDBAccessSvc(&*m_rdbAccessSvc);
m_athenaComps.setGeometryDBSvc(&*m_geometryDBSvc);
const HGTD_ID* idHelper{nullptr};
ATH_CHECK(detStore()->retrieve(idHelper, "HGTD_ID"));
m_athenaComps.setIdHelper(idHelper);
......
......@@ -46,7 +46,6 @@ class BCMPrimeDetectorTool : public GeoModelTool {
const InDetDD::BCMPrimeDetectorManager *m_manager;
InDetDD::AthenaComps *m_athenaComps;
ServiceHandle<IRDBAccessSvc> m_rdbAccessSvc;
ServiceHandle<IGeometryDBSvc> m_geometryDBSvc;
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc;
};
......
......@@ -12,7 +12,7 @@ atlas_add_library( BCMPrimeGeoModelXmlLib
PUBLIC_HEADERS BCMPrimeGeoModelXml
PRIVATE_INCLUDE_DIRS ${GEOMODEL_INCLUDE_DIRS}
LINK_LIBRARIES GaudiKernel GeoModelUtilities GeoModelXml InDetGeoModelUtils BCMPrimeReadoutGeometry
PRIVATE_LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaPoolUtilities DetDescrConditions GeoModelInterfaces GeometryDBSvcLib InDetSimEvent PathResolver RDBAccessSvcLib SGTools StoreGateLib )
PRIVATE_LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaPoolUtilities DetDescrConditions GeoModelInterfaces InDetSimEvent PathResolver RDBAccessSvcLib SGTools StoreGateLib )
atlas_add_component( BCMPrimeGeoModelXml
src/components/*.cxx
......
......@@ -8,11 +8,7 @@ def BCMPrimeGeometryCfg(flags):
acc = GeoModelCfg(flags)
geoModelSvc = acc.getPrimary()
GeometryDBSvc = CompFactory.GeometryDBSvc
acc.addService(GeometryDBSvc("BCMPrimeGeometryDBSvc"))
BCMPrimeDetectorTool = CompFactory.BCMPrimeDetectorTool
bcmPrimeDetectorTool = BCMPrimeDetectorTool()
bcmPrimeDetectorTool = CompFactory.BCMPrimeDetectorTool()
bcmPrimeDetectorTool.Alignable = False # make this a flag? Set true as soon as decided on folder structure
bcmPrimeDetectorTool.DetectorName = "BCMPrime"
if flags.GeoModel.useLocalGeometry:
......
......@@ -9,7 +9,6 @@
#include "GeoModelUtilities/GeoModelExperiment.h"
#include "GeoModelInterfaces/IGeoModelSvc.h"
#include "StoreGate/StoreGateSvc.h"
#include "GeometryDBSvc/IGeometryDBSvc.h"
#include "RDBAccessSvc/IRDBAccessSvc.h"
#include "RDBAccessSvc/IRDBRecord.h"
#include "RDBAccessSvc/IRDBRecordset.h"
......@@ -26,7 +25,6 @@ BCMPrimeDetectorTool::BCMPrimeDetectorTool(const std::string &type,
m_manager(nullptr),
m_athenaComps(nullptr),
m_rdbAccessSvc("RDBAccessSvc", name),
m_geometryDBSvc("InDetGeometryDBSvc", name),
m_geoDbTagSvc{"GeoDbTagSvc", name}
{
......@@ -38,7 +36,6 @@ BCMPrimeDetectorTool::BCMPrimeDetectorTool(const std::string &type,
declareProperty("Alignable", m_alignable);
declareProperty("GmxFilename", m_gmxFilename);
declareProperty("RDBAccessSvc", m_rdbAccessSvc);
declareProperty("GeometryDBSvc", m_geometryDBSvc);
declareProperty("GeoDbTagSvc", m_geoDbTagSvc);
}
......@@ -55,7 +52,6 @@ StatusCode BCMPrimeDetectorTool::create() {
// Get the detector configuration.
ATH_CHECK(m_geoDbTagSvc.retrieve());
ATH_CHECK(m_rdbAccessSvc.retrieve());
ATH_CHECK(m_geometryDBSvc.retrieve());
GeoModelExperiment *theExpt;
ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
......@@ -65,7 +61,6 @@ StatusCode BCMPrimeDetectorTool::create() {
m_athenaComps = new InDetDD::AthenaComps("BCMPrimeGeoModelXml");
m_athenaComps->setDetStore(&*(detStore()));
m_athenaComps->setRDBAccessSvc(&*m_rdbAccessSvc);
m_athenaComps->setGeometryDBSvc(&*m_geometryDBSvc);
m_athenaComps->setGeoDbTagSvc(&*m_geoDbTagSvc);
//
......
......@@ -6,9 +6,12 @@ from AthenaConfiguration.ComponentFactory import CompFactory
def InDetServiceMaterialCfg(flags):
from AtlasGeoModel.GeometryDBConfig import InDetGeometryDBSvcCfg
db = InDetGeometryDBSvcCfg(flags)
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc = GeoModelCfg(flags)
geoModelSvc = acc.getPrimary()
geoModelSvc.DetectorTools += [ CompFactory.InDetServMatTool() ]
acc.addService(CompFactory.GeometryDBSvc("InDetGeometryDBSvc"))
geoModelSvc.DetectorTools += [ CompFactory.InDetServMatTool(GeometryDBSvc=db.getPrimary()) ]
acc.merge(db)
return acc
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
def PixelGeometryCfg( flags ):
def PixelGeometryCfg(flags):
from AtlasGeoModel.GeometryDBConfig import InDetGeometryDBSvcCfg
db = InDetGeometryDBSvcCfg(flags)
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc = GeoModelCfg( flags )
geoModelSvc=acc.getPrimary()
GeometryDBSvc=CompFactory.GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
PixelDetectorTool=CompFactory.PixelDetectorTool
pixelDetectorTool = PixelDetectorTool("PixelDetectorTool")
InDetDD__BCM_Builder=CompFactory.InDetDD.BCM_Builder
bcmTool = InDetDD__BCM_Builder()
pixelDetectorTool.BCM_Tool = bcmTool
InDetDD__BLM_Builder=CompFactory.InDetDD.BLM_Builder
blmTool = InDetDD__BLM_Builder()
pixelDetectorTool.BLM_Tool = blmTool
acc = GeoModelCfg(flags)
geoModelSvc = acc.getPrimary()
pixelDetectorTool = CompFactory.PixelDetectorTool("PixelDetectorTool")
pixelDetectorTool.GeometryDBSvc = db.getPrimary()
pixelDetectorTool.BCM_Tool = CompFactory.InDetDD.BCM_Builder()
pixelDetectorTool.BLM_Tool = CompFactory.InDetDD.BLM_Builder()
pixelDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
geoModelSvc.DetectorTools += [ pixelDetectorTool ]
acc.addService(geoModelSvc)
acc.merge(db)
# IBL module distortions
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/IBLDist","/Indet/IBLDist",className="CondAttrListCollection"))
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaCommon import CfgMgr
def getPixelDetectorTool(name="PixelDetectorTool", **kwargs):
kwargs.setdefault("ServiceBuilderTool", "")
kwargs.setdefault("ServiceBuilderTool", "")
kwargs.setdefault("GeometryDBSvc", "InDetGeometryDBSvc")
return CfgMgr.PixelDetectorTool(name, **kwargs)
......@@ -12,7 +12,7 @@ atlas_add_library( PixelGeoModelXmlLib
PUBLIC_HEADERS PixelGeoModelXml
PRIVATE_INCLUDE_DIRS ${GEOMODEL_INCLUDE_DIRS}
LINK_LIBRARIES GaudiKernel GeoModelUtilities GeoModelXml InDetGeoModelUtils PixelReadoutGeometryLib
PRIVATE_LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaBaseComps AthenaPoolUtilities DetDescrConditions GeoModelInterfaces GeometryDBSvcLib ReadoutGeometryBase InDetReadoutGeometry InDetSimEvent PathResolver RDBAccessSvcLib SGTools StoreGateLib )
PRIVATE_LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaBaseComps AthenaPoolUtilities DetDescrConditions GeoModelInterfaces ReadoutGeometryBase InDetReadoutGeometry InDetSimEvent PathResolver RDBAccessSvcLib SGTools StoreGateLib )
atlas_add_component( PixelGeoModelXml
src/components/*.cxx
......
......@@ -9,11 +9,7 @@ def ITkPixelGeometryCfg(flags):
acc = GeoModelCfg(flags)
geoModelSvc = acc.getPrimary()
GeometryDBSvc = CompFactory.GeometryDBSvc
acc.addService(GeometryDBSvc("ITkGeometryDBSvc"))
PixelDetectorTool = CompFactory.ITkPixelDetectorTool
ITkPixelDetectorTool = PixelDetectorTool()
ITkPixelDetectorTool = CompFactory.ITkPixelDetectorTool()
# ITkPixelDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
ITkPixelDetectorTool.Alignable = False # make this a flag? Set true as soon as decided on folder structure
ITkPixelDetectorTool.DetectorName = "ITkPixel"
......
......@@ -12,7 +12,6 @@
#include "GeoModelInterfaces/IGeoModelSvc.h"
#include "GeoModelUtilities/DecodeVersionKey.h"
#include "StoreGate/StoreGateSvc.h"
#include "GeometryDBSvc/IGeometryDBSvc.h"
#include "RDBAccessSvc/IRDBAccessSvc.h"
#include "RDBAccessSvc/IRDBRecord.h"
#include "RDBAccessSvc/IRDBRecordset.h"
......
......@@ -5,18 +5,22 @@ from AthenaConfiguration.Enums import ProductionStep
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
def SCT_GeometryCfg( flags ):
def SCT_GeometryCfg(flags):
from AtlasGeoModel.GeometryDBConfig import InDetGeometryDBSvcCfg
db = InDetGeometryDBSvcCfg(flags)
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc = GeoModelCfg( flags )
geoModelSvc=acc.getPrimary()
GeometryDBSvc=CompFactory.GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
SCT_DetectorTool=CompFactory.SCT_DetectorTool
sctDetectorTool = SCT_DetectorTool()
acc = GeoModelCfg(flags)
geoModelSvc = acc.getPrimary()
sctDetectorTool = CompFactory.SCT_DetectorTool()
sctDetectorTool.GeometryDBSvc = db.getPrimary()
sctDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
sctDetectorTool.Alignable = True # make this a flag?
sctDetectorTool.DetectorName = "SCT"
geoModelSvc.DetectorTools += [ sctDetectorTool ]
acc.merge(db)
if flags.GeoModel.Align.Dynamic:
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection"))
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL2/SCT","/Indet/AlignL2/SCT",className="CondAttrListCollection"))
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( StripGeoModelXml )
......@@ -8,7 +8,7 @@ atlas_add_library( StripGeoModelXmlLib
src/*.cxx
PUBLIC_HEADERS StripGeoModelXml
LINK_LIBRARIES GaudiKernel GeoModelUtilities GeoModelXml InDetGeoModelUtils SCT_ReadoutGeometry
PRIVATE_LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaPoolUtilities DetDescrConditions GeoModelInterfaces GeometryDBSvcLib InDetReadoutGeometry ReadoutGeometryBase InDetSimEvent PathResolver RDBAccessSvcLib SGTools StoreGateLib )
PRIVATE_LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaPoolUtilities DetDescrConditions GeoModelInterfaces InDetReadoutGeometry ReadoutGeometryBase InDetSimEvent PathResolver RDBAccessSvcLib SGTools StoreGateLib )
atlas_add_component( StripGeoModelXml
src/components/*.cxx
......
......@@ -4,14 +4,12 @@ from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
def ITkStripGeometryCfg( flags ):
def ITkStripGeometryCfg(flags):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc = GeoModelCfg( flags )
geoModelSvc=acc.getPrimary()
GeometryDBSvc=CompFactory.GeometryDBSvc
acc.addService(GeometryDBSvc("ITkGeometryDBSvc"))
StripDetectorTool=CompFactory.StripDetectorTool
ITkStripDetectorTool = StripDetectorTool()
acc = GeoModelCfg(flags)
geoModelSvc = acc.getPrimary()
ITkStripDetectorTool = CompFactory.StripDetectorTool()
# ITkStripDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic #Will we need to do dynamic alignment for ITk?
ITkStripDetectorTool.Alignable = False # make this a flag? Set true as soon as decided on folder structure
ITkStripDetectorTool.DetectorName = "ITkStrip"
......
......@@ -12,7 +12,6 @@
#include "GeoModelInterfaces/IGeoModelSvc.h"
#include "GeoModelUtilities/DecodeVersionKey.h"
#include "StoreGate/StoreGateSvc.h"
#include "GeometryDBSvc/IGeometryDBSvc.h"
#include "RDBAccessSvc/IRDBAccessSvc.h"
#include "RDBAccessSvc/IRDBRecord.h"
#include "RDBAccessSvc/IRDBRecordset.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment