ATLAS Offline Software
Tracking/TrkConditions/TrackingGeometryCondAlg/python/CaloTrackingGeometryConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 # Configuration of LArTrackingGeometry + TileTrackingGeometry + CaloTrackingGeometry packages
3 
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 
7 def LArVolumeBuilderCfg(flags, name='LArVolumeBuilder', **kwargs):
8  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
9  result = LArGMCfg(flags)
10 
11  if "TrackingVolumeHelper" not in kwargs:
12  from TrackingGeometryCondAlg.TrkDetDescrToolsConfig import (
13  TrackingVolumeHelperCfg)
14  trackingVolumeHelper = result.popToolsAndMerge(
16  result.addPublicTool(trackingVolumeHelper)
17  kwargs.setdefault("TrackingVolumeHelper", trackingVolumeHelper)
18 
19  kwargs.setdefault("BarrelEnvelopeCover", 5.0)
20  kwargs.setdefault("EndcapEnvelopeCover", 5.0)
21 
22  result.setPrivateTools(CompFactory.LAr.LArVolumeBuilder(name, **kwargs))
23  return result
24 
25 def TileVolumeBuilderCfg(flags, name='TileVolumeBuilder', **kwargs):
26  from TileGeoModel.TileGMConfig import TileGMCfg
27  result = TileGMCfg(flags)
28 
29  if "TrackingVolumeHelper" not in kwargs:
30  from TrackingGeometryCondAlg.TrkDetDescrToolsConfig import (
31  TrackingVolumeHelperCfg)
32  trackingVolumeHelper = result.popToolsAndMerge(
34  result.addPublicTool(trackingVolumeHelper)
35  kwargs.setdefault("TrackingVolumeHelper", trackingVolumeHelper)
36 
37  result.setPrivateTools(CompFactory.Tile.TileVolumeBuilder(name, **kwargs))
38  return result
39 
40 
41 def CaloTrackingGeometryBuilderCfg(flags, name='CaloTrackingGeometryBuilder',
42  useCond = True,
43  **kwargs):
44  result = ComponentAccumulator()
45 
46  # Subtools are renamed to avoid conflict in CA wrapper with legacy config
47  # Renaming can be removed when support of legacy config is dropped
48 
49  nameSuffix = 'Cond' if useCond else ''
50 
51  lArVolumeBuilder = result.popToolsAndMerge(
52  LArVolumeBuilderCfg(flags, name = 'LArVolumeBuilder' + nameSuffix))
53  result.addPublicTool(lArVolumeBuilder)
54 
55  tileVolumeBuilder = result.popToolsAndMerge(
56  TileVolumeBuilderCfg(flags, name = 'TileVolumeBuilder' + nameSuffix))
57  result.addPublicTool(tileVolumeBuilder)
58 
59  from TrackingGeometryCondAlg.TrkDetDescrToolsConfig import (
60  TrackingVolumeHelperCfg)
61  trackingVolumeHelper = result.popToolsAndMerge(
63  result.addPublicTool(trackingVolumeHelper)
64 
65  from SubDetectorEnvelopes.SubDetectorEnvelopesConfig import (
66  EnvelopeDefSvcCfg)
67  envelopeDefinitionSvc = result.getPrimaryAndMerge(EnvelopeDefSvcCfg(flags))
68 
69  kwargs.setdefault("LArVolumeBuilder", lArVolumeBuilder)
70  kwargs.setdefault("TileVolumeBuilder", tileVolumeBuilder)
71  kwargs.setdefault("TrackingVolumeHelper", trackingVolumeHelper)
72  kwargs.setdefault("EnvelopeDefinitionSvc", envelopeDefinitionSvc)
73  kwargs.setdefault("EntryVolumeName", "InDet::Containers::EntryVolume")
74  kwargs.setdefault("ExitVolumeName", "Calo::Container")
75  kwargs.setdefault("GapLayerEnvelope", 5.0)
76 
77  name = name + nameSuffix
78  geometryBuilder = CompFactory.Calo.CaloTrackingGeometryBuilderCond(name, **kwargs) if useCond else \
79  CompFactory.Calo.CaloTrackingGeometryBuilder(name, **kwargs)
80  result.setPrivateTools(geometryBuilder)
81  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CaloTrackingGeometryConfig.CaloTrackingGeometryBuilderCfg
def CaloTrackingGeometryBuilderCfg(flags, name='CaloTrackingGeometryBuilder', useCond=True, **kwargs)
Definition: Tracking/TrkConditions/TrackingGeometryCondAlg/python/CaloTrackingGeometryConfig.py:41
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
CaloTrackingGeometryConfig.TileVolumeBuilderCfg
def TileVolumeBuilderCfg(flags, name='TileVolumeBuilder', **kwargs)
Definition: Tracking/TrkConditions/TrackingGeometryCondAlg/python/CaloTrackingGeometryConfig.py:25
CaloTrackingGeometryConfig.LArVolumeBuilderCfg
def LArVolumeBuilderCfg(flags, name='LArVolumeBuilder', **kwargs)
Definition: Tracking/TrkConditions/TrackingGeometryCondAlg/python/CaloTrackingGeometryConfig.py:7
SubDetectorEnvelopesConfig.EnvelopeDefSvcCfg
def EnvelopeDefSvcCfg(flags, name="AtlasGeometry_EnvelopeDefSvc", **kwargs)
Definition: SubDetectorEnvelopesConfig.py:15
TrkDetDescrToolsConfig.TrackingVolumeHelperCfg
def TrackingVolumeHelperCfg(flags, name='TrackingVolumeHelper', **kwargs)
Definition: TrkDetDescrToolsConfig.py:27
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7