ATLAS Offline Software
TRT_GeoModelConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
5 
6 
7 def TRT_GeoModelCfg(flags):
8  from AtlasGeoModel.GeometryDBConfig import InDetGeometryDBSvcCfg
9  db = InDetGeometryDBSvcCfg(flags)
10 
11  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
12  acc = GeoModelCfg(flags)
13  geoModelSvc = acc.getPrimary()
14 
15  from AthenaConfiguration.ComponentFactory import CompFactory
16  trtDetectorTool = CompFactory.TRT_DetectorTool()
17  trtDetectorTool.GeometryDBSvc = db.getPrimary()
18  trtDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
19  # Use default TRT active gas in geo model unless in simulation.
20  from AthenaConfiguration.Enums import Project, ProductionStep
21  if (flags.Common.Project is not Project.AthSimulation
22  and flags.Common.ProductionStep not in [ProductionStep.Simulation, ProductionStep.FastChain]):
23  trtDetectorTool.DoXenonArgonMixture = False
24  trtDetectorTool.DoKryptonMixture = False
25 
26  from TRT_ConditionsServices.TRT_ConditionsServicesConfig import TRT_StrawStatusSummaryToolCfg
27  acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags, forceLegacyAccess=True)) # FIXME: if we set the tool, things break for unknown reasons
28  geoModelSvc.DetectorTools += [ trtDetectorTool ]
29  acc.merge(db)
30  return acc
31 
32 
33 def TRT_AlignmentCfg(flags):
34  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
35  acc = ComponentAccumulator()
36  if flags.GeoModel.Align.LegacyConditionsAccess: # revert to old style CondHandle in case of simulation
37  from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
38  acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/DX", "/TRT/Calib/DX"))
39  if flags.GeoModel.Align.Dynamic:
40  acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/AlignL1/TRT", "/TRT/AlignL1/TRT"))
41  acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/AlignL2", "/TRT/AlignL2"))
42  else:
43  acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Align", "/TRT/Align"))
44  else:
45  from TRT_ConditionsAlgs.TRT_ConditionsAlgsConfig import TRTAlignCondAlgCfg
46  acc.merge(TRTAlignCondAlgCfg(flags))
47  return acc
48 
49 
50 @AccumulatorCache
52  # main GeoModel config
53  acc = TRT_GeoModelCfg(flags)
54  acc.merge(TRT_AlignmentCfg(flags))
55  return acc
56 
57 
58 @AccumulatorCache
60  # main GeoModel config
61  acc = TRT_GeoModelCfg(flags)
62  acc.merge(TRT_AlignmentCfg(flags))
63  # Note: this has almost the same content but different name on purpose if
64  # we ever split readout geometry in a separate conditions algorithm
65  from TRT_ConditionsAlgs.TRT_ConditionsAlgsConfig import TRTAlignCondAlgCfg
66  acc.merge(TRTAlignCondAlgCfg(flags))
67  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TRT_GeoModelConfig.TRT_GeoModelCfg
def TRT_GeoModelCfg(flags)
Definition: TRT_GeoModelConfig.py:7
TRT_GeoModelConfig.TRT_ReadoutGeometryCfg
def TRT_ReadoutGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:59
python.GeometryDBConfig.InDetGeometryDBSvcCfg
def InDetGeometryDBSvcCfg(flags)
Definition: GeometryDBConfig.py:7
python.TRT_ConditionsServicesConfig.TRT_StrawStatusSummaryToolCfg
def TRT_StrawStatusSummaryToolCfg(flags, name="TRT_StrawStatusSummaryTool", forceLegacyAccess=False, **kwargs)
Definition: TRT_ConditionsServicesConfig.py:23
TRT_GeoModelConfig.TRT_AlignmentCfg
def TRT_AlignmentCfg(flags)
Definition: TRT_GeoModelConfig.py:33
python.IOVDbSvcConfig.addFoldersSplitOnline
def addFoldersSplitOnline(flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers='')
Definition: IOVDbSvcConfig.py:153
TRT_GeoModelConfig.TRT_SimulationGeometryCfg
def TRT_SimulationGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:51
python.TRT_ConditionsAlgsConfig.TRTAlignCondAlgCfg
def TRTAlignCondAlgCfg(flags, name="TRTAlignCondAlg", **kwargs)
Definition: TRT_ConditionsAlgsConfig.py:8
python.GeoModelConfig.GeoModelCfg
def GeoModelCfg(flags)
Definition: GeoModelConfig.py:16