Skip to content
Snippets Groups Projects
Commit 6fbc8045 authored by John Chapman's avatar John Chapman
Browse files

Initial ComponentAccumulator method to build the whole ATLAS Detector

This commit adds an initial attempt add configuring the description of the
whole ATLAS detector in GeoModel using ComponentAccumulator.

It also adds tests for building the full Atlas geometry based on different
input file types.
parent 39078aa8
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,18 @@ atlas_subdir( AtlasGeoModel ) ...@@ -8,7 +8,18 @@ atlas_subdir( AtlasGeoModel )
# Install files from the package: # Install files from the package:
atlas_install_python_modules( python/*.py ) atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.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 ) if( NOT SIMULATIONBASE )
atlas_add_test( AtlasGeoModelConfig SCRIPT python -m AtlasGeoModel.GeoModelConfig POST_EXEC_SCRIPT nopost.sh ) 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() 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
#!/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)
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