Skip to content
Snippets Groups Projects
Commit 5c93442f authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'CA_forIDGeoModel_master' into 'master'

Configuration of ATLAS Detector Description using ComponentAccumulator

See merge request atlas/athena!20770
parents a4660b80 ec61e601
No related branches found
No related tags found
No related merge requests found
Showing
with 526 additions and 12 deletions
......@@ -34,3 +34,10 @@ atlas_add_component( BeamPipeGeoModel
INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODEL_LIBRARIES} GeoModelUtilities SGTools StoreGateLib GaudiKernel BeamPipeGeoModelLib )
atlas_add_test( BeamPipeGMConfig_test
SCRIPT test/BeamPipeGMConfig_test.py
PROPERTIES TIMEOUT 300 )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_scripts( test/*.py )
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
def BeamPipeGeometryCfg(flags):
result,gms=GeoModelCfg(flags)
from BeamPipeGeoModel.BeamPipeGeoModelConf import BeamPipeDetectorTool
gms.DetectorTools += [ BeamPipeDetectorTool() ]
result.addService(gms)
return result
#!/usr/bin/env python
"""Run tests on BeamPipeGeoModel configuration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
"""
if __name__ == "__main__":
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=1
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.TestDefaults import defaultTestFiles
ConfigFlags.Input.Files = defaultTestFiles.HITS
ConfigFlags.Detector.SimulatePixel = False
ConfigFlags.Detector.SimulateSCT = False
ConfigFlags.Detector.SimulateTRT = False
ConfigFlags.GeoModel.Align.Dynamic = False
ConfigFlags.lock()
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
acc = BeamPipeGeometryCfg(ConfigFlags)
f=open('BeamPipeGeometryCfg.pkl','w')
acc.store(f)
f.close()
......@@ -25,6 +25,14 @@ def _createCfgFlags():
acf.addFlag('Common.isOnline', False ) # Job runs in an online environment (access only to resources available at P1) # former global.isOnline
def _checkProject():
import os
if "AthSimulation_DIR" in os.environ:
return "AthSimulation"
#TODO expand this method.
return "Athena"
acf.addFlag('Common.Project', _checkProject())
# replace global.Beam*
acf.addFlag('Beam.BunchSpacing', 25) # former global.BunchSpacing
acf.addFlag("Beam.NumberOfCollisions",0) # former global.NumberOfCollisions
......@@ -36,17 +44,36 @@ def _createCfgFlags():
acf.addFlag('Output.doESD', False) # produce ESD containers
acf.addFlag('Output.HITFileName','myHIT.pool.root')
acf.addFlag('Output.EVNTFileName','myEVNT.pool.root')
acf.addFlag('Output.HITSFileName','myHITS.pool.root')
acf.addFlag('Output.RDOFileName','myROD.pool.root')
acf.addFlag('Output.ESDFileName','myESD.pool.root')
acf.addFlag('Output.AODFileName','myAOD.pool.root')
acf.addFlag('Output.HISTFileName','myHIST.root')
#Detector Flags:
acf.addFlag('Detector.SimulatePixel', False)
acf.addFlag("Detector.SimulateSCT", False)
acf.addFlag("Detector.SimulateTRT", False)
acf.addFlag("Detector.SimulateMuon", False)
acf.addFlag("Detector.SimulateCavern",False)
acf.addFlag("Detector.Simulate", lambda prevFlags : (prevFlags.Detector.SimulatePixel or prevFlags.Detector.SimulateSCT or
prevFlags.Detector.SimulateTRT or prevFlags.Detector.SimulateMuon or
prevFlags.Detector.SimulateCavern))
acf.addFlag("Detector.OverlayPixel", False)
acf.addFlag("Detector.OverlaySCT", False)
acf.addFlag("Detector.OverlayTRT", False)
acf.addFlag("Detector.OverlayMuon", False)
acf.addFlag("Detector.Overlay", lambda prevFlags : (prevFlags.Detector.OverlayPixel or prevFlags.Detector.OverlaySCT or
prevFlags.Detector.OverlayTRT or prevFlags.Detector.OverlayMuon ))
#Geo Model Flags:
acf.addFlag('GeoModel.Layout', 'atlas') # replaces global.GeoLayout
acf.addFlag("GeoModel.AtlasVersion", lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("Geometry","ATLAS-R2-2016-01-00-01")) #
acf.addFlag("GeoModel.Align.Dynamic", lambda prevFlags : (not prevFlags.Detector.Simulate))
acf.addFlag("GeoModel.StripGeoType", "GMX") # Based on CommonGeometryFlags.StripGeoType
acf.addFlag("GeoModel.Run","RUN2") # Based on CommonGeometryFlags.Run (InDetGeometryFlags.isSLHC replaced by GeoModel.Run=="RUN4")
#IOVDbSvc Flags:
acf.addFlag("IOVDb.GlobalTag",lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("ConditionsTag","CONDBR2-BLKPA-2017-05"))
......@@ -56,13 +83,13 @@ def _createCfgFlags():
#LAr Flags:
try:
import LArCellRec # Suppress flake8 unused import warning: # noqa: F401
haveLArCellRec = True
import LArConfiguration # Suppress flake8 unused import warning: # noqa: F401
haveLArConfiguration = True
except ImportError:
haveLArCellRec = False
haveLArConfiguration = False
if haveLArCellRec:
from LArCellRec.LArConfigFlags import createLArConfigFlags
if haveLArConfiguration:
from LArConfiguration.LArConfigFlags import createLArConfigFlags
lcf=createLArConfigFlags()
acf.join(lcf)
......
......@@ -4,7 +4,9 @@ class defaultTestFiles():
import os
d = os.environ.get ('ATLAS_REFERENCE_DATA',
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art')
EVNT= [d + "/SimCoreTests/mcatnlojimmy_ttbar_leptonfilter.19.2.5.37.EVNT.pool.root"] #find an official file.
HITS= [d + "/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1"]
RAW = [d + "/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"]
RDO = ["myRDO.pool.root"]#needs a test RDO
ESD = [d + '/RecExRecoTest/mc16_13TeV.361022.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ2W.recon.ESD.e3668_s3170_r10572_homeMade.pool.root']
AOD = [d + '/CommonInputs/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1']
ESD = ["myESD.pool.root"]#needs a test ESD
......@@ -8,7 +8,18 @@ atlas_subdir( AtlasGeoModel )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.py )
atlas_install_scripts( test/*.py )
atlas_add_test( EVNT_InputGeo_test
SCRIPT test/AtlasGeometryConfig_EVNT_test.py
PROPERTIES TIMEOUT 300 )
if( NOT SIMULATIONBASE )
atlas_add_test( AtlasGeoModelConfig SCRIPT python -m AtlasGeoModel.GeoModelConfig POST_EXEC_SCRIPT nopost.sh )
atlas_add_test( HITS_InputGeo_test
SCRIPT test/AtlasGeometryConfig_HITS_test.py
PROPERTIES TIMEOUT 300 )
atlas_add_test( AOD_InputGeo_test
SCRIPT test/AtlasGeometryConfig_AOD_test.py
PROPERTIES TIMEOUT 300 )
endif()
#
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
#
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.AthConfigFlags import AthConfigFlags
def AtlasGeometryCfg (flags):
acc = ComponentAccumulator()
from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
acc.merge(InDetGeometryCfg(flags))
from LArGeoAlgsNV.LArGMConfig import LArGMCfg
acc.merge(LArGMCfg(flags))
from TileGeoModel.TileGMConfig import TileGMCfg
acc.merge(TileGMCfg(flags))
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
#from AtlasGeoModel.ForDetGeoModelConfig import ForDetGeometryCfg
#acc.merge(ForDetGeometryCfg(flags))
from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
acc.merge(BeamPipeGeometryCfg(flags))
if (flags.Detector.Simulate and flags.Beam.Type == "cosmics") or flags.Detector.SimulateCavern:
from CavernInfraGeoModel.CavernInfraGeoModelConf import CavernInfraDetectorTool
gms.DetectorTools += [ CavernInfraDetectorTool() ]
return acc
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.AthConfigFlags import AthConfigFlags
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
# TODO This isn't used yet anywhere and the new style ConfigFlag
# equivalents of the DetFlags used here have yet to be created.
def ForDetGeometryCfg( flags ):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc,geoModelSvc = GeoModelCfg( flags )
from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
# LUCID
if True:#( DetFlags.detdescr.Lucid_on() ):
from LUCID_GeoModel.LUCID_GeoModelConf import LUCID_DetectorTool
geoModelSvc.DetectorTools += [ LUCID_DetectorTool() ]
# ALFA
if True:#( DetFlags.detdescr.ALFA_on() ):
from ALFA_GeoModel.ALFA_GeoModel_joboption import getALFA_DetectorTool
#from ALFA_GeoModel.ALFA_GeoModelConf import ALFA_DetectorTool
theALFA_DetectorTool=ALFA_DetectorTool(name)
theALFA_DetectorTool.MetrologyType=3
theALFA_DetectorTool.B7L1U_MDGeometryType = 2
theALFA_DetectorTool.B7L1U_ODGeometryType = 2
theALFA_DetectorTool.B7L1L_MDGeometryType = 2
theALFA_DetectorTool.B7L1L_ODGeometryType = 2
theALFA_DetectorTool.A7L1U_MDGeometryType = 2
theALFA_DetectorTool.A7L1U_ODGeometryType = 2
theALFA_DetectorTool.A7L1L_MDGeometryType = 2
theALFA_DetectorTool.A7L1L_ODGeometryType = 2
theALFA_DetectorTool.A7R1U_MDGeometryType = 2
theALFA_DetectorTool.A7R1U_ODGeometryType = 2
theALFA_DetectorTool.A7R1L_MDGeometryType = 2
theALFA_DetectorTool.A7R1L_ODGeometryType = 2
theALFA_DetectorTool.B7R1U_MDGeometryType = 2
theALFA_DetectorTool.B7R1U_ODGeometryType = 2
theALFA_DetectorTool.B7R1L_MDGeometryType = 2
theALFA_DetectorTool.B7R1L_ODGeometryType = 2
geoModelSvc.DetectorTools += [ thALFA_DetectorTool ]
acc.merge(addFoldersSplitOnline(flags,'FWD','/FWD/Onl/ALFA/position_calibration','/FWD/ALFA/position_calibration'))
# ForwardRegion
if True:#( DetFlags.detdescr.FwdRegion_on() ):
from ForwardRegionGeoModel.ForwardRegionGeoModelConf import ForwardRegionGeoModelTool
geoModelSvc.DetectorTools += [ ForwardRegionGeoModelTool() ]
# ZDC
if True:#( DetFlags.detdescr.ZDC_on() ):
from ZDC_GeoM.ZDC_GeoMConf import ZDC_DetTool
geoModelSvc.DetectorTools += [ ZDC_DetTool() ]
# AFP
if True:#( DetFlags.detdescr.AFP_on() ):
from AFP_GeoModel.AFP_GeoModelConf import AFP_GeoModelTool
geoModelSvc.DetectorTools += [ AFP_GeoModelTool() ]
acc.addService(geoModelSvc)
return acc
......@@ -16,7 +16,9 @@ def GeoModelCfg(configFlags):
from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
gms=GeoModelSvc(AtlasVersion=version,
SupportedGeometry = int(relversion[0]))
if configFlags.Detector.Simulate:
## Protects GeoModelSvc in the simulation from the AlignCallbacks
gms.AlignCallbacks = False
result.addService(gms)
from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc
......
#
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
#
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.AthConfigFlags import AthConfigFlags
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
def InDetServiceMaterialCfg (flags):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc,geoModelSvc = GeoModelCfg( flags )
from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatTool
servMatTool = InDetServMatTool()
if flags.GeoModel.Run=="RUN4":
from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatBuilderToolSLHC
InDetServMatBuilderToolSLHC = InDetServMatBuilderToolSLHC()
acc.addPublicTool( InDetServMatBuilderToolSLHC )
servMatTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC
geoModelSvc.DetectorTools += [ servMatTool ]
acc.addService(geoModelSvc)
return acc
def InDetGeometryCfg (flags):
acc = ComponentAccumulator()
from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
acc.merge(PixelGeometryCfg( flags ))
from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
acc.merge(SCT_GeometryCfg( flags ))
if not flags.GeoModel.Run=="RUN4":
from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
acc.merge(TRT_GeometryCfg( flags ))
acc.merge(InDetServiceMaterialCfg( flags ))
return acc
if __name__ == "__main__":
import os
from AthenaCommon.Logging import log
from AthenaCommon.Constants import DEBUG
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
# Set up logging and new style config
log.setLevel(DEBUG)
Configurable.configurableRun3Behavior = True
from AthenaConfiguration.TestDefaults import defaultTestFiles
# Provide MC input
ConfigFlags.Input.Files = defaultTestFiles.HITS
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16"
ConfigFlags.Detector.SimulatePixel = True
ConfigFlags.Detector.SimulateSCT = True
ConfigFlags.Detector.SimulateTRT = True
ConfigFlags.GeoModel.Align.Dynamic = False
# Provide data input
##from AthenaConfiguration.TestDefaults import defaultTestFiles
##ConfigFlags.Input.Files = defaultTestFiles.AOD
##ConfigFlags.GeoModel.Align.Dynamic = True
#
ConfigFlags.lock()
# Construct ComponentAccumulator
acc = MainServicesSerialCfg()
acc.merge(PoolReadCfg(ConfigFlags))
acc.merge(InDetGeometryCfg(ConfigFlags)) # FIXME This sets up the whole ID geometry would be nicer just to set up min required
#acc.getService("StoreGateSvc").Dump=True
acc.getService("ConditionStore").Dump=True
acc.printConfig(withDetails=True)
f=open('InDetGMCfg2.pkl','w')
acc.store(f)
f.close()
ConfigFlags.dump()
# Execute and finish
acc.run(maxEvents=3)
#!/usr/bin/env python
"""Run a test on Atlas Geometry configuration using a HITS file as input
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
"""
if __name__ == "__main__":
import os
from AthenaCommon.Logging import log
from AthenaCommon.Constants import DEBUG
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
# Set up logging and new style config
log.setLevel(DEBUG)
Configurable.configurableRun3Behavior = True
from AthenaConfiguration.TestDefaults import defaultTestFiles
# Provide MC input
ConfigFlags.Input.Files = defaultTestFiles.AOD
ConfigFlags.GeoModel.Align.Dynamic = True
ConfigFlags.lock()
# Construct ComponentAccumulator
acc = MainServicesSerialCfg()
acc.merge(PoolReadCfg(ConfigFlags))
acc.merge(AtlasGeometryCfg(ConfigFlags))
#acc.getService("StoreGateSvc").Dump=True
acc.getService("ConditionStore").Dump=True
acc.printConfig(withDetails=True)
f=open('AtlasGeoModelCfg_HITS.pkl','w')
acc.store(f)
f.close()
ConfigFlags.dump()
# Execute and finish
acc.run(maxEvents=3)
#!/usr/bin/env python
"""Run a test on Atlas Geometry configuration using a EVNT file as input
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
"""
if __name__ == "__main__":
import os
from AthenaCommon.Logging import log
from AthenaCommon.Constants import DEBUG
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
# Set up logging and new style config
log.setLevel(DEBUG)
Configurable.configurableRun3Behavior = True
from AthenaConfiguration.TestDefaults import defaultTestFiles
# Provide MC input
ConfigFlags.Input.Files = defaultTestFiles.EVNT
ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01"
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16"
ConfigFlags.Detector.SimulatePixel = True
ConfigFlags.Detector.SimulateSCT = True
ConfigFlags.Detector.SimulateTRT = True
ConfigFlags.GeoModel.Align.Dynamic = False
ConfigFlags.lock()
# Construct ComponentAccumulator
acc = MainServicesSerialCfg()
acc.merge(PoolReadCfg(ConfigFlags))
acc.merge(AtlasGeometryCfg(ConfigFlags))
#acc.getService("StoreGateSvc").Dump=True
acc.getService("ConditionStore").Dump=True
acc.printConfig(withDetails=True)
f=open('AtlasGeoModelCfg_EVNT.pkl','w')
acc.store(f)
f.close()
ConfigFlags.dump()
# Execute and finish
acc.run(maxEvents=3)
#!/usr/bin/env python
"""Run a test on Atlas Geometry configuration using a HITS file as input
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
"""
if __name__ == "__main__":
import os
from AthenaCommon.Logging import log
from AthenaCommon.Constants import DEBUG
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
# Set up logging and new style config
log.setLevel(DEBUG)
Configurable.configurableRun3Behavior = True
from AthenaConfiguration.TestDefaults import defaultTestFiles
# Provide MC input
ConfigFlags.Input.Files = defaultTestFiles.HITS
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16"
ConfigFlags.GeoModel.Align.Dynamic = False
ConfigFlags.lock()
# Construct ComponentAccumulator
acc = MainServicesSerialCfg()
acc.merge(PoolReadCfg(ConfigFlags))
acc.merge(AtlasGeometryCfg(ConfigFlags))
#acc.getService("StoreGateSvc").Dump=True
acc.getService("ConditionStore").Dump=True
acc.printConfig(withDetails=True)
f=open('AtlasGeoModelCfg_HITS.pkl','w')
acc.store(f)
f.close()
ConfigFlags.dump()
# Execute and finish
acc.run(maxEvents=3)
......@@ -45,5 +45,10 @@ atlas_add_component( PixelGeoModel
src/components/*.cxx
LINK_LIBRARIES GaudiKernel PixelGeoModelLib )
atlas_add_test( PixelGMConfig_test
SCRIPT test/PixelGMConfig_test.py
PROPERTIES TIMEOUT 300 )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_scripts( test/*.py )
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from AthenaCommon import CfgMgr
......@@ -10,3 +10,47 @@ def getPixelDetectorTool(name="PixelDetectorTool", **kwargs):
kwargs.setdefault("ServiceBuilderTool", "");
return CfgMgr.PixelDetectorTool(name, **kwargs)
############## ComponentAccumulator
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.AthConfigFlags import AthConfigFlags
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
def PixelGeometryCfg( flags ):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc,geoModelSvc = GeoModelCfg( flags )
from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool
pixelDetectorTool = PixelDetectorTool("PixelDetectorTool")
from BCM_GeoModel.BCM_GeoModelConf import InDetDD__BCM_Builder
bcmTool = InDetDD__BCM_Builder()
acc.addPublicTool( bcmTool )
pixelDetectorTool.BCM_Tool = bcmTool
from BLM_GeoModel.BLM_GeoModelConf import InDetDD__BLM_Builder
blmTool = InDetDD__BLM_Builder()
acc.addPublicTool( blmTool )
pixelDetectorTool.BLM_Tool = blmTool
if flags.GeoModel.Run=="RUN4":
from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatBuilderToolSLHC
InDetServMatBuilderToolSLHC = InDetServMatBuilderToolSLHC()
acc.addPublicTool( InDetServMatBuilderToolSLHC )
pixelDetectorTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC
pixelDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
geoModelSvc.DetectorTools += [ pixelDetectorTool ]
acc.addService(geoModelSvc)
# Pixel module distortions
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/PixelDist","/Indet/PixelDist")) # Not used ???
# IBL stave distortions
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/IBLDist","/Indet/IBLDist",className="CondAttrListCollection"))
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/PIX","/Indet/AlignL2/PIX",className="CondAttrListCollection"))
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer"))
else:
if (not flags.Detector.SimulatePixel) or flags.Detector.OverlayPixel:
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer"))
else:
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align"))
return acc
#!/usr/bin/env python
"""Run tests on PixelGeoModel configuration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
"""
if __name__ == "__main__":
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=1
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.TestDefaults import defaultTestFiles
ConfigFlags.Input.Files = defaultTestFiles.HITS
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16"
ConfigFlags.Detector.SimulatePixel = False
ConfigFlags.Detector.SimulateSCT = False
ConfigFlags.Detector.SimulateTRT = False
ConfigFlags.GeoModel.Align.Dynamic = False
ConfigFlags.lock()
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
acc = PixelGeometryCfg(ConfigFlags)
f=open('PixelGeometryCfg.pkl','w')
acc.store(f)
f.close()
......@@ -37,6 +37,10 @@ atlas_add_component( SCT_GeoModel
INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODEL_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel InDetGeoModelUtils InDetReadoutGeometry SGTools StoreGateLib SGtests AthenaPoolUtilities DetDescrConditions Identifier InDetIdentifier )
atlas_add_test( SCT_GMConfig_test
SCRIPT test/SCT_GMConfig_test.py
PROPERTIES TIMEOUT 300 )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_scripts( test/*.py )
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from AthenaCommon import CfgMgr
......@@ -10,3 +10,52 @@ def getSCT_DetectorTool(name="SCT_DetectorTool", **kwargs):
kwargs.setdefault("GeoDbTagSvc", "GeoDbTagSvc");
from AthenaCommon.DetFlags import DetFlags
return CfgMgr.SCT_DetectorTool(name, **kwargs)
###### ComponentAccumulator
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.AthConfigFlags import AthConfigFlags
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
def SCT_GeometryCfg( flags ):
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
acc,geoModelSvc = GeoModelCfg( flags )
from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
if flags.GeoModel.Run=="RUN4":
if "GMX" == flags.GeoModel.StripGeoType():
from SCT_GeoModelXml.SCT_GeoModelXmlConf import SCT_GMX_DetectorTool
sctDetectorTool = SCT_GMX_DetectorTool()
else:
from SCT_SLHC_GeoModel.SCT_SLHC_GeoModelConf import SCT_SLHC_DetectorTool
sctDetectorTool = SCT_SLHC_DetectorTool()
from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatBuilderToolSLHC
InDetServMatBuilderToolSLHC = InDetServMatBuilderToolSLHC()
acc.addPublicTool( InDetServMatBuilderToolSLHC )
sctDetectorTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC
else:
from SCT_GeoModel.SCT_GeoModelConf import SCT_DetectorTool
sctDetectorTool = SCT_DetectorTool()
sctDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
geoModelSvc.DetectorTools += [ sctDetectorTool ]
acc.addService(geoModelSvc)
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"))
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer"))
else:
if (not flags.Detector.SimulateSCT) or flags.Detector.OverlaySCT:
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer"))
else:
acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align"))
if flags.Common.Project is not "AthSimulation": # Protection for AthSimulation builds
if (not flags.Detector.SimulateSCT) or flags.Detector.OverlaySCT:
from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_AlignCondAlg
sctAlignCondAlg = SCT_AlignCondAlg(name = "SCT_AlignCondAlg",
UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic)
acc.addCondAlgo(sctAlignCondAlg)
from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_DetectorElementCondAlg
sctDetectorElementCondAlg = SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg")
acc.addCondAlgo(sctDetectorElementCondAlg)
return acc
#!/usr/bin/env python
"""Run tests on SCT_GeoModel configuration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
"""
if __name__ == "__main__":
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=1
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.TestDefaults import defaultTestFiles
ConfigFlags.Input.Files = defaultTestFiles.HITS
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16"
ConfigFlags.Detector.SimulatePixel = False
ConfigFlags.Detector.SimulateSCT = False
ConfigFlags.Detector.SimulateTRT = False
ConfigFlags.GeoModel.Align.Dynamic = False
ConfigFlags.lock()
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
acc = SCT_GeometryCfg(ConfigFlags)
f=open('SCT_GeometryCfg.pkl','w')
acc.store(f)
f.close()
......@@ -39,3 +39,11 @@ atlas_add_component( TRT_GeoModel
INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODEL_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel TRT_ConditionsServicesLib InDetGeoModelUtils InDetReadoutGeometry SGTools StoreGateLib SGtests AthenaPoolUtilities DetDescrConditions IdDictDetDescr TRT_ConditionsData InDetIdentifier )
atlas_add_test( TRT_GMConfig_test
SCRIPT test/TRT_GMConfig_test.py
PROPERTIES TIMEOUT 300 )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_scripts( test/*.py )
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