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

ComponentAccumulator configuration of TRT Geometry

parent f6a554c3
No related branches found
No related tags found
No related merge requests found
......@@ -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 )
#
# 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
#!/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()
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