From 1c1e997439e3ce65741a0fcbc4b13c9efbd945cd Mon Sep 17 00:00:00 2001 From: John Chapman Date: Mon, 28 Jan 2019 16:38:38 +0100 Subject: [PATCH 01/14] Extend AthenaConfiguration modules to better support EVNT and HITS inputs Update Output ConfigFlags in AllConfigFlags module. - Replace `Output.HITFileName` with `Output.HITSFileName` to match grid output naming convention. - Add `Output.EVNTFileName`. Add default HITS and EVNT and ESD input files for tests to AthenaConfiguration.TestDefaults module --- Control/AthenaConfiguration/python/AllConfigFlags.py | 3 ++- Control/AthenaConfiguration/python/TestDefaults.py | 4 +++- Simulation/BeamEffects/python/BeamEffectsAlgConfig.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index 135e9ca10c1..b9f440f1443 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -36,7 +36,8 @@ 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') diff --git a/Control/AthenaConfiguration/python/TestDefaults.py b/Control/AthenaConfiguration/python/TestDefaults.py index 0a984d5f1ed..17e7a4e639b 100644 --- a/Control/AthenaConfiguration/python/TestDefaults.py +++ b/Control/AthenaConfiguration/python/TestDefaults.py @@ -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 diff --git a/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py b/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py index 1ed6d057681..c94e0699ec6 100755 --- a/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py +++ b/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py @@ -156,7 +156,7 @@ if __name__ == "__main__": # Specify output - ConfigFlags.Output.HITFileName = "myHITS.pool.root" #todo change the flag name in AllConfigFlags + ConfigFlags.Output.HITSFileName = "myHITS.pool.root" #set the source of vertex positioning #ConfigFlags.Vertex.Source = "VertexOverrideFile.txt"# Vertex.OverrideFile/Vertex.OverrideEventFile -- GitLab From 38b05548cfe11ffb1411cb6b6ca9b99666170c20 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 13:35:45 +0100 Subject: [PATCH 02/14] Add some extra flags for Geometry configuration with ComponentAccumulator --- .../python/AllConfigFlags.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index b9f440f1443..f0d306716fc 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -44,10 +44,28 @@ def _createCfgFlags(): 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")) -- GitLab From 153342db7b356daf577b163e6d76af29a44dafd6 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Tue, 29 Jan 2019 15:35:07 +0100 Subject: [PATCH 03/14] Add ComponentAccumulator configuration for BeamPipeDetectorTool and accompanying test --- .../BeamPipeGeoModel/CMakeLists.txt | 7 ++++++ .../python/BeamPipeGMConfig.py | 10 ++++++++ .../test/BeamPipeGMConfig_test.py | 24 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 AtlasGeometryCommon/BeamPipeGeoModel/python/BeamPipeGMConfig.py create mode 100755 AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt b/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt index f8006b9f70b..48e3a87cb8a 100644 --- a/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt +++ b/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt @@ -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 ) diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/python/BeamPipeGMConfig.py b/AtlasGeometryCommon/BeamPipeGeoModel/python/BeamPipeGMConfig.py new file mode 100644 index 00000000000..1f4b632cb63 --- /dev/null +++ b/AtlasGeometryCommon/BeamPipeGeoModel/python/BeamPipeGMConfig.py @@ -0,0 +1,10 @@ +# 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 diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py b/AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py new file mode 100755 index 00000000000..a2db6f080f1 --- /dev/null +++ b/AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py @@ -0,0 +1,24 @@ +#!/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() -- GitLab From aacd3f7326b451e4153100e9b784ee54aa7512ba Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 13:36:31 +0100 Subject: [PATCH 04/14] ComponentAccumulator configuration of Pixel Geometry --- .../PixelGeoModel/CMakeLists.txt | 5 ++ .../python/PixelGeoModelConfig.py | 46 ++++++++++++++++++- .../PixelGeoModel/test/PixelGMConfig_test.py | 25 ++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100755 InnerDetector/InDetDetDescr/PixelGeoModel/test/PixelGMConfig_test.py diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt b/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt index 27c9c4eb524..c7af047071c 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt @@ -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 ) diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/python/PixelGeoModelConfig.py b/InnerDetector/InDetDetDescr/PixelGeoModel/python/PixelGeoModelConfig.py index f24fc6ec634..b2ae09a76fc 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/python/PixelGeoModelConfig.py +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/python/PixelGeoModelConfig.py @@ -1,4 +1,4 @@ -# 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 diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/test/PixelGMConfig_test.py b/InnerDetector/InDetDetDescr/PixelGeoModel/test/PixelGMConfig_test.py new file mode 100755 index 00000000000..e045030a3ff --- /dev/null +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/test/PixelGMConfig_test.py @@ -0,0 +1,25 @@ +#!/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() -- GitLab From f6a554c372ed510b02ba5866b33bef879ae0eef6 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 13:36:48 +0100 Subject: [PATCH 05/14] ComponentAccumulator configuration of SCT Geometry --- .../InDetDetDescr/SCT_GeoModel/CMakeLists.txt | 6 ++- .../SCT_GeoModel/python/SCT_GeoModelConfig.py | 52 ++++++++++++++++++- .../SCT_GeoModel/test/SCT_GMConfig_test.py | 25 +++++++++ 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/test/SCT_GMConfig_test.py diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/CMakeLists.txt b/InnerDetector/InDetDetDescr/SCT_GeoModel/CMakeLists.txt index edc57338d20..3b2e0af643f 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/CMakeLists.txt +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/CMakeLists.txt @@ -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 ) diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py b/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py index 6c8522d4cac..89e8786c714 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py @@ -1,4 +1,4 @@ -# 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,53 @@ 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")) + import os + if "AthSimulation_DIR" not in os.environ: # 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 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/test/SCT_GMConfig_test.py b/InnerDetector/InDetDetDescr/SCT_GeoModel/test/SCT_GMConfig_test.py new file mode 100755 index 00000000000..b7dbd7f1137 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/test/SCT_GMConfig_test.py @@ -0,0 +1,25 @@ +#!/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() -- GitLab From c2ad2e7d521b66be2e74a67c18af31d8b47a9989 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 13:37:08 +0100 Subject: [PATCH 06/14] ComponentAccumulator configuration of TRT Geometry --- .../InDetDetDescr/TRT_GeoModel/CMakeLists.txt | 8 +++ .../TRT_GeoModel/python/TRT_GeoModelConfig.py | 54 +++++++++++++++++++ .../TRT_GeoModel/test/TRT_GMConfig_test.py | 25 +++++++++ 3 files changed, 87 insertions(+) create mode 100644 InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py create mode 100755 InnerDetector/InDetDetDescr/TRT_GeoModel/test/TRT_GMConfig_test.py diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt b/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt index bb2815df1d4..e5575eaeb15 100644 --- a/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt +++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt @@ -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 ) + diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py b/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py new file mode 100644 index 00000000000..80c868a2eb8 --- /dev/null +++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py @@ -0,0 +1,54 @@ +# +# 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 TRT_GeometryCfg( flags ): + from AtlasGeoModel.GeoModelConfig import GeoModelCfg + acc,geoModelSvc = GeoModelCfg( flags ) + from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc + acc.addService(GeometryDBSvc("InDetGeometryDBSvc")) + from TRT_GeoModel.TRT_GeoModelConf import TRT_DetectorTool + trtDetectorTool = TRT_DetectorTool() + trtDetectorTool.DoXenonArgonMixture = flags.Detector.SimulateTRT + trtDetectorTool.DoKryptonMixture = flags.Detector.SimulateTRT + trtDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic + geoModelSvc.DetectorTools += [ trtDetectorTool ] + acc.addService(geoModelSvc) + # Inner Detector alignment + acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Calib/DX","/TRT/Calib/DX")) + if flags.Detector.SimulateTRT: # revert to old style CondHandle in case of simulation + # Dead/Noisy Straw Lists + acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/Status","/TRT/Cond/Status")) + acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusPermanent","/TRT/Cond/StatusPermanent")) + # Argon straw list + acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusHT","/TRT/Cond/StatusHT")) + else: + # Dead/Noisy Straw Lists + acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/Status","/TRT/Cond/Status",className='TRTCond::StrawStatusMultChanContainer')) + acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusPermanent","/TRT/Cond/StatusPermanent",className='TRTCond::StrawStatusMultChanContainer')) + # Argon straw list + acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusHT","/TRT/Cond/StatusHT",className='TRTCond::StrawStatusMultChanContainer')) + # TRT Condition Algorithm + from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTAlignCondAlg + TRTAlignCondAlg = TRTAlignCondAlg(name = "TRTAlignCondAlg", + UseDynamicFolders = flags.GeoModel.Align.Dynamic) + if flags.GeoModel.Align.Dynamic: + acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/AlignL1/TRT","/TRT/AlignL1/TRT",className="CondAttrListCollection")) + acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/AlignL2","/TRT/AlignL2",className="AlignableTransformContainer")) + TRTAlignCondAlg.ReadKeyDynamicGlobal = "/TRT/AlignL1/TRT" + TRTAlignCondAlg.ReadKeyDynamicRegular = "/TRT/AlignL2" + else: + if (not flags.Detector.SimulateTRT) or flags.Detector.OverlayTRT: + acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Align","/TRT/Align",className="AlignableTransformContainer")) + else: + acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Align","/TRT/Align")) + import os + if "AthSimulation_DIR" not in os.environ: # Protection for AthSimulation builds + if (not flags.Detector.SimulateTRT) or flags.Detector.OverlayTRT: + acc.addCondAlgo(TRTAlignCondAlg) + + return acc diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/test/TRT_GMConfig_test.py b/InnerDetector/InDetDetDescr/TRT_GeoModel/test/TRT_GMConfig_test.py new file mode 100755 index 00000000000..4bd3f95734a --- /dev/null +++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/test/TRT_GMConfig_test.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +"""Run tests on TRT_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 TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg + acc = TRT_GeometryCfg(ConfigFlags) + f=open('TRT_GeometryCfg.pkl','w') + acc.store(f) + f.close() -- GitLab From c5c6a396d1f1f37745c2e036c2f3ad88e62e29f3 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Mon, 28 Jan 2019 18:06:35 +0100 Subject: [PATCH 07/14] Initial version of Component Accumulator configuration of ID Geometry and Alignment --- .../AtlasGeoModel/python/InDetGMConfig.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMConfig.py diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMConfig.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMConfig.py new file mode 100644 index 00000000000..35c4eefecfe --- /dev/null +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMConfig.py @@ -0,0 +1,76 @@ +# +# 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) -- GitLab From b6e3b3444f5ddf6d50b5d5f529949e1837913541 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 15:41:17 +0100 Subject: [PATCH 08/14] Protect simulation against AlignCallbacks in GeoModelSvc --- .../GeoModel/AtlasGeoModel/python/GeoModelConfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py index 21cb0f410a2..a2dd3395666 100644 --- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelConfig.py @@ -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 -- GitLab From c94b4872a8aab6e831ee2fa13cca0a9dfa46c302 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 15:42:27 +0100 Subject: [PATCH 09/14] Extend MuonGeoModelCfg to support geometry building for simulation jobs --- .../MuonConfig/python/MuonGeometryConfig.py | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py index d3c05941d48..378db9f7990 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py @@ -1,10 +1,13 @@ -# 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 AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AtlasGeoModel.GeoModelConfig import GeoModelCfg +from AtlasGeoModel.GeoModelConfig import GeoModelCfg from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperTool +from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc +from MuonAGDD.MuonAGDDConf import MuonAGDDTool, NSWAGDDTool from StoreGate.StoreGateConf import StoreGateSvc +import os def MuonGeoModelCfg(flags): acc = ComponentAccumulator() @@ -15,7 +18,35 @@ def MuonGeoModelCfg(flags): detTool = MuonDetectorTool() detTool.UseConditionDb = 1 - detTool.UseIlinesFromGM = 1 + detTool.UseIlinesFromGM = 1 + if ( ( not flags.Detector.SimulateMuon or flags.Detector.OverlayMuon ) and "AthSimulation_DIR" not in os.environ ): + # Needs configuration from MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonAlignConfig.py to be migrated + #detTool.TheMuonAlignmentTool = "MuonAlignmentDbTool/MGM_AlignmentDbTool" + pass + else: + detTool.TheMuonAlignmentTool = "" + detTool.UseConditionDb = 0 + detTool.UseAsciiConditionData = 0 + if flags.Detector.SimulateMuon: + detTool.FillCacheInitTime = 0 + if flags.GeoModel.Run=="RUN3" or flags.GeoModel.Run=="RUN4": + MuonDetectorTool.StationSelection = 2 + MuonDetectorTool.SelectedStations = [ "EIL1", "EIL2", "EIL6", "EIL7", + "EIS*", "EIL10", "EIL11", "EIL12", + "EIL17", "CSS*", "CSL*", "T4E*", + "T4F*" ] + ## Additional material in the muon system + AGDD2Geo = AGDDtoGeoSvc() + muonAGDDTool = MuonAGDDTool("MuonSpectrometer", BuildNSW=False) + acc.addPublicTool(muonAGDDTool) + AGDD2Geo.Builders += [ muonAGDDTool ] + if flags.GeoModel.Run=="RUN3" or flags.GeoModel.Run=="RUN4": + nswAGDDTool = NSWAGDDTool("NewSmallWheel", Locked=False) + nswAGDDTool.Volumes = ["NewSmallWheel"] + nswAGDDTool.DefaultDetector = "Muon" + acc.addPublicTool(nswAGDDTool) + acc.addService(AGDD2Geo) + gms.DetectorTools += [ detTool ] acc.addService(gms) -- GitLab From 39078aa82d0e3685de0b009acdfd89dfdbbf6619 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 15:43:02 +0100 Subject: [PATCH 10/14] Initial implementation of ForwardDetector Geometry building --- .../python/ForDetGeoModelConfig.py | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 DetectorDescription/GeoModel/AtlasGeoModel/python/ForDetGeoModelConfig.py diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/ForDetGeoModelConfig.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/ForDetGeoModelConfig.py new file mode 100644 index 00000000000..d9cd05e268d --- /dev/null +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/ForDetGeoModelConfig.py @@ -0,0 +1,55 @@ +# 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 -- GitLab From 6fbc80459533a719e473efac56a0cf5bf97bccea Mon Sep 17 00:00:00 2001 From: John Chapman Date: Wed, 30 Jan 2019 15:43:56 +0100 Subject: [PATCH 11/14] 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. --- .../GeoModel/AtlasGeoModel/CMakeLists.txt | 11 +++++ .../python/AtlasGeoModelConfig.py | 26 ++++++++++++ .../test/AtlasGeometryConfig_AOD_test.py | 36 ++++++++++++++++ .../test/AtlasGeometryConfig_EVNT_test.py | 41 +++++++++++++++++++ .../test/AtlasGeometryConfig_HITS_test.py | 37 +++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoModelConfig.py create mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py create mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py create mode 100755 DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt b/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt index 925b0935411..8654ff91070 100644 --- a/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt +++ b/DetectorDescription/GeoModel/AtlasGeoModel/CMakeLists.txt @@ -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() diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoModelConfig.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoModelConfig.py new file mode 100644 index 00000000000..cc2c90572cd --- /dev/null +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/AtlasGeoModelConfig.py @@ -0,0 +1,26 @@ +# +# 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 diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py new file mode 100755 index 00000000000..cb09147b156 --- /dev/null +++ b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_AOD_test.py @@ -0,0 +1,36 @@ +#!/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) diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py new file mode 100755 index 00000000000..97619ecd199 --- /dev/null +++ b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_EVNT_test.py @@ -0,0 +1,41 @@ +#!/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) diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py new file mode 100755 index 00000000000..e9217f3fbe9 --- /dev/null +++ b/DetectorDescription/GeoModel/AtlasGeoModel/test/AtlasGeometryConfig_HITS_test.py @@ -0,0 +1,37 @@ +#!/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) -- GitLab From bded2daca5a2d6d6826be0eabfd72871dd6a9757 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Mon, 4 Feb 2019 14:33:33 +0100 Subject: [PATCH 12/14] Add MuonConfig package to AthSimulation project --- MuonSpectrometer/MuonConfig/CMakeLists.txt | 50 +++++++++++----------- Projects/AthSimulation/package_filters.txt | 1 + 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/MuonSpectrometer/MuonConfig/CMakeLists.txt b/MuonSpectrometer/MuonConfig/CMakeLists.txt index b5ec0f265af..75e9962eb28 100644 --- a/MuonSpectrometer/MuonConfig/CMakeLists.txt +++ b/MuonSpectrometer/MuonConfig/CMakeLists.txt @@ -10,31 +10,33 @@ atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) atlas_install_data( share/*.ref ) -# Configure unit tests -# Cache alignment will change depending on whether FRONTIER_SERVER is defined. -file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest ) -atlas_add_test( MuonDataDecodeTest - PROPERTIES TIMEOUT 1000 - PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest - EXTRA_PATTERNS "GeoModelSvc.MuonDetectorTool.*SZ=|Cache alignment|Range of input|recorded new|map from|DEBUG Reconciled configuration" - SCRIPT test/testMuonDataDecode.sh ) +if( NOT SIMULATIONBASE ) + # Configure unit tests + # Cache alignment will change depending on whether FRONTIER_SERVER is defined. + file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest ) + atlas_add_test( MuonDataDecodeTest + PROPERTIES TIMEOUT 1000 + PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest + EXTRA_PATTERNS "GeoModelSvc.MuonDetectorTool.*SZ=|Cache alignment|Range of input|recorded new|map from|DEBUG Reconciled configuration" + SCRIPT test/testMuonDataDecode.sh ) -# Adding an identical test for the ByteStream identifiable caches (and future RDO caches) -file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest_Cache ) -atlas_add_test( MuonDataDecodeTest_Cache - PROPERTIES TIMEOUT 1000 - PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest_Cache - EXTRA_PATTERNS "GeoModelSvc.MuonDetectorTool.*SZ=|Cache alignment|Range of input|recorded new|map from" - SCRIPT test/testMuonDataDecode_Cache.sh ) + # Adding an identical test for the ByteStream identifiable caches (and future RDO caches) + file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest_Cache ) + atlas_add_test( MuonDataDecodeTest_Cache + PROPERTIES TIMEOUT 1000 + PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_MuonDataDecodeTest_Cache + EXTRA_PATTERNS "GeoModelSvc.MuonDetectorTool.*SZ=|Cache alignment|Range of input|recorded new|map from" + SCRIPT test/testMuonDataDecode_Cache.sh ) -atlas_add_test( MuonCablingConfigTest - SCRIPT python -m MuonConfig.MuonCablingConfig - POST_EXEC_SCRIPT nopost.sh ) + atlas_add_test( MuonCablingConfigTest + SCRIPT python -m MuonConfig.MuonCablingConfig + POST_EXEC_SCRIPT nopost.sh ) -atlas_add_test( MuonReconstructionConfigTest - SCRIPT python -m MuonConfig.MuonReconstructionConfig - POST_EXEC_SCRIPT nopost.sh ) + atlas_add_test( MuonReconstructionConfigTest + SCRIPT python -m MuonConfig.MuonReconstructionConfig + POST_EXEC_SCRIPT nopost.sh ) -atlas_add_test( MuonSegmentFindingConfigTest - SCRIPT python -m MuonConfig.MuonSegmentFindingConfig - POST_EXEC_SCRIPT nopost.sh ) + atlas_add_test( MuonSegmentFindingConfigTest + SCRIPT python -m MuonConfig.MuonSegmentFindingConfig + POST_EXEC_SCRIPT nopost.sh ) +endif() diff --git a/Projects/AthSimulation/package_filters.txt b/Projects/AthSimulation/package_filters.txt index 6f692506e4b..01d13cfba1f 100644 --- a/Projects/AthSimulation/package_filters.txt +++ b/Projects/AthSimulation/package_filters.txt @@ -237,6 +237,7 @@ + MuonSpectrometer/MuonCnv/MuonIdCnv + MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool + MuonSpectrometer/MuonCnv/MuonSimEventTPCnv ++ MuonSpectrometer/MuonConfig + MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface + MuonSpectrometer/MuonDetDescr/MuonAGDD + MuonSpectrometer/MuonDetDescr/MuonAGDDBase -- GitLab From b294bfdacb1265769a65f96403ebc1c0d3fb23bd Mon Sep 17 00:00:00 2001 From: John Chapman Date: Mon, 4 Feb 2019 16:52:09 +0100 Subject: [PATCH 13/14] Move LArConfigFlags.py from LArCellRec to new LArConfiguration package --- Control/AthenaConfiguration/python/AllConfigFlags.py | 10 +++++----- LArCalorimeter/LArConfiguration/CMakeLists.txt | 10 ++++++++++ .../python/LArConfigFlags.py | 0 LArCalorimeter/LArConfiguration/python/__init__.py | 1 + Projects/AthSimulation/package_filters.txt | 1 + 5 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 LArCalorimeter/LArConfiguration/CMakeLists.txt rename LArCalorimeter/{LArCellRec => LArConfiguration}/python/LArConfigFlags.py (100%) create mode 100644 LArCalorimeter/LArConfiguration/python/__init__.py diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index f0d306716fc..50c16040d7a 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -75,13 +75,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) diff --git a/LArCalorimeter/LArConfiguration/CMakeLists.txt b/LArCalorimeter/LArConfiguration/CMakeLists.txt new file mode 100644 index 00000000000..39c8eb53fd2 --- /dev/null +++ b/LArCalorimeter/LArConfiguration/CMakeLists.txt @@ -0,0 +1,10 @@ +################################################################################ +# Package: LArConfiguration +################################################################################ + +# Declare the package name: +atlas_subdir( LArConfiguration ) + +# Install files from the package: +atlas_install_python_modules( python/*.py ) + diff --git a/LArCalorimeter/LArCellRec/python/LArConfigFlags.py b/LArCalorimeter/LArConfiguration/python/LArConfigFlags.py similarity index 100% rename from LArCalorimeter/LArCellRec/python/LArConfigFlags.py rename to LArCalorimeter/LArConfiguration/python/LArConfigFlags.py diff --git a/LArCalorimeter/LArConfiguration/python/__init__.py b/LArCalorimeter/LArConfiguration/python/__init__.py new file mode 100644 index 00000000000..4e669a90b8b --- /dev/null +++ b/LArCalorimeter/LArConfiguration/python/__init__.py @@ -0,0 +1 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration diff --git a/Projects/AthSimulation/package_filters.txt b/Projects/AthSimulation/package_filters.txt index 01d13cfba1f..9cb90575f32 100644 --- a/Projects/AthSimulation/package_filters.txt +++ b/Projects/AthSimulation/package_filters.txt @@ -202,6 +202,7 @@ + LArCalorimeter/LArCnv/LArIdCnv + LArCalorimeter/LArCnv/LArSimEventAthenaPool + LArCalorimeter/LArCnv/LArSimEventTPCnv ++ LArCalorimeter/LArConfiguration + LArCalorimeter/LArDetDescr + LArCalorimeter/LArElecCalib + LArCalorimeter/LArExample/LArConditionsCommon -- GitLab From ec61e601bf6116ba457a66a46fef2e5f5f52a088 Mon Sep 17 00:00:00 2001 From: John Chapman Date: Tue, 5 Feb 2019 18:08:17 +0100 Subject: [PATCH 14/14] Add a new Common.Project ConfigFlag --- Control/AthenaConfiguration/python/AllConfigFlags.py | 8 ++++++++ .../SCT_GeoModel/python/SCT_GeoModelConfig.py | 3 +-- .../TRT_GeoModel/python/TRT_GeoModelConfig.py | 3 +-- MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py | 3 +-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index 50c16040d7a..dbabb4d27df 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -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 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py b/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py index 89e8786c714..579c6679a32 100644 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/python/SCT_GeoModelConfig.py @@ -49,8 +49,7 @@ def SCT_GeometryCfg( flags ): acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer")) else: acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align")) - import os - if "AthSimulation_DIR" not in os.environ: # Protection for AthSimulation builds + 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", diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py b/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py index 80c868a2eb8..7f0d04275f2 100644 --- a/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py +++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py @@ -46,8 +46,7 @@ def TRT_GeometryCfg( flags ): acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Align","/TRT/Align",className="AlignableTransformContainer")) else: acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Align","/TRT/Align")) - import os - if "AthSimulation_DIR" not in os.environ: # Protection for AthSimulation builds + if flags.Common.Project is not "AthSimulation": # Protection for AthSimulation builds if (not flags.Detector.SimulateTRT) or flags.Detector.OverlayTRT: acc.addCondAlgo(TRTAlignCondAlg) diff --git a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py index 378db9f7990..fe628090392 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py @@ -7,7 +7,6 @@ from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperTool from AGDD2GeoSvc.AGDD2GeoSvcConf import AGDDtoGeoSvc from MuonAGDD.MuonAGDDConf import MuonAGDDTool, NSWAGDDTool from StoreGate.StoreGateConf import StoreGateSvc -import os def MuonGeoModelCfg(flags): acc = ComponentAccumulator() @@ -19,7 +18,7 @@ def MuonGeoModelCfg(flags): detTool = MuonDetectorTool() detTool.UseConditionDb = 1 detTool.UseIlinesFromGM = 1 - if ( ( not flags.Detector.SimulateMuon or flags.Detector.OverlayMuon ) and "AthSimulation_DIR" not in os.environ ): + if ( ( not flags.Detector.SimulateMuon or flags.Detector.OverlayMuon ) and flags.Common.Project is not "AthSimulation" ): # Needs configuration from MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonAlignConfig.py to be migrated #detTool.TheMuonAlignmentTool = "MuonAlignmentDbTool/MGM_AlignmentDbTool" pass -- GitLab