ATLAS Offline Software
TrkDetDescrToolsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
6 
7 def InDetTrackingVolumeHelperCfg(flags, name='InDetTrackingVolumeHelper',
8  **kwargs):
9  result = ComponentAccumulator()
10  result.setPrivateTools(CompFactory.Trk.TrackingVolumeHelper(name, **kwargs))
11  return result
12 
13 def ITkTrackingVolumeHelperCfg(flags, name='ITkTrackingVolumeHelper', **kwargs):
14  result = ComponentAccumulator()
15  kwargs.setdefault("BarrelLayerBinsZ",
16  flags.ITk.trackingGeometry.passiveBarrelMatZbins)
17  kwargs.setdefault("BarrelLayerBinsPhi",
18  flags.ITk.trackingGeometry.passiveBarrelMatPhiBins)
19  kwargs.setdefault("EndcapLayerBinsR",
20  flags.ITk.trackingGeometry.passiveEndcapMatRbins)
21  kwargs.setdefault("EndcapLayerBinsPhi",
22  flags.ITk.trackingGeometry.passiveEndcapMatPhiBins)
23  result.setPrivateTools(CompFactory.Trk.TrackingVolumeHelper(name, **kwargs))
24  return result
25 
26 # Generic interface for conveniency
27 def TrackingVolumeHelperCfg(flags, name='TrackingVolumeHelper', **kwargs):
28  if flags.Detector.GeometryITk:
29  return ITkTrackingVolumeHelperCfg(flags, name, **kwargs)
30  else:
31  return InDetTrackingVolumeHelperCfg(flags, name, **kwargs)
32 
33 def HGTD_TrackingVolumeHelperCfg(flags, name='HGTD_TrackingVolumeHelper',
34  **kwargs):
35  result = ComponentAccumulator()
36  kwargs.setdefault("BarrelLayerBinsZ",
37  flags.HGTD.trackingGeometry.passiveBarrelMatZbins)
38  kwargs.setdefault("BarrelLayerBinsPhi",
39  flags.HGTD.trackingGeometry.passiveBarrelMatPhiBins)
40  kwargs.setdefault("EndcapLayerBinsR",
41  flags.HGTD.trackingGeometry.passiveEndcapMatRbins)
42  kwargs.setdefault("EndcapLayerBinsPhi",
43  flags.HGTD.trackingGeometry.passiveEndcapMatPhiBins)
44  result.setPrivateTools(CompFactory.Trk.TrackingVolumeHelper(name, **kwargs))
45  return result
46 
47 def TrackingVolumeArrayCreatorCfg(flags, name="TrackingVolumeArrayCreator",
48  **kwargs):
49  result = ComponentAccumulator()
50  result.setPrivateTools(
51  CompFactory.Trk.TrackingVolumeArrayCreator(name, **kwargs))
52  return result
53 
54 @AccumulatorCache
55 def LayerArrayCreatorCfg(flags, name='LayerArrayCreator', **kwargs):
56  result = ComponentAccumulator()
57  kwargs.setdefault("EmptyLayerMode", 2) # deletes empty material layers from arrays
58  result.setPrivateTools(CompFactory.Trk.LayerArrayCreator(name, **kwargs))
59  return result
60 
61 def CylinderVolumeCreatorCfg(flags, name='CylinderVolumeCreator',
62  **kwargs):
63  result = ComponentAccumulator()
64 
65  if "LayerArrayCreator" not in kwargs:
66  layerArrayCreator = result.popToolsAndMerge(
67  LayerArrayCreatorCfg(flags))
68  result.addPublicTool(layerArrayCreator)
69  kwargs.setdefault("LayerArrayCreator", layerArrayCreator)
70 
71  if "TrackingVolumeArrayCreator" not in kwargs:
72  trackingVolumeArrayCreator = result.popToolsAndMerge(
74  result.addPublicTool(trackingVolumeArrayCreator)
75  kwargs.setdefault("TrackingVolumeArrayCreator",
76  trackingVolumeArrayCreator)
77 
78  result.setPrivateTools(
79  CompFactory.Trk.CylinderVolumeCreator(name, **kwargs))
80  return result
81 
82 def InDetCylinderVolumeCreatorCfg(flags, name='InDetCylinderVolumeCreator',
83  **kwargs):
84  result = ComponentAccumulator()
85 
86  if "TrackingVolumeHelper" not in kwargs:
87  trackingVolumeHelper = result.popToolsAndMerge(
89  result.addPublicTool(trackingVolumeHelper)
90  kwargs.setdefault("TrackingVolumeHelper", trackingVolumeHelper)
91 
92  kwargs.setdefault("PassiveLayerBinsRZ", 1)
93 
94  result.setPrivateTools(result.popToolsAndMerge(
95  CylinderVolumeCreatorCfg(flags, name, **kwargs)))
96  return result
97 
98 def ITkCylinderVolumeCreatorCfg(flags, name='ITkCylinderVolumeCreator',
99  **kwargs):
100  result = ComponentAccumulator()
101 
102  if "TrackingVolumeHelper" not in kwargs:
103  trackingVolumeHelper = result.popToolsAndMerge(
105  result.addPublicTool(trackingVolumeHelper)
106  kwargs.setdefault("TrackingVolumeHelper", trackingVolumeHelper)
107 
108  kwargs.setdefault("PassiveLayerThickness", 1.) # in mm
109  kwargs.setdefault("PassiveLayerBinsRZ",
110  flags.ITk.trackingGeometry.passiveBarrelMatZbins)
111  kwargs.setdefault("PassiveLayerBinsPhi",
112  flags.ITk.trackingGeometry.passiveBarrelMatPhiBins)
113 
114  result.setPrivateTools(result.popToolsAndMerge(
115  CylinderVolumeCreatorCfg(flags, name, **kwargs)))
116  return result
117 
118 def HGTD_CylinderVolumeCreatorCfg(flags, name='HGTD_CylinderVolumeCreator',
119  **kwargs):
120  result = ComponentAccumulator()
121 
122  if "TrackingVolumeHelper" not in kwargs:
123  trackingVolumeHelper = result.popToolsAndMerge(
125  result.addPublicTool(trackingVolumeHelper)
126  kwargs.setdefault("TrackingVolumeHelper", trackingVolumeHelper)
127 
128  kwargs.setdefault("PassiveLayerBinsRZ",
129  flags.HGTD.trackingGeometry.passiveBarrelMatZbins)
130  kwargs.setdefault("PassiveLayerBinsPhi",
131  flags.HGTD.trackingGeometry.passiveBarrelMatPhiBins)
132 
133  result.setPrivateTools(result.popToolsAndMerge(
134  CylinderVolumeCreatorCfg(flags, name, **kwargs)))
135  return result
136 
137 def ITkBeamPipeProviderCfg(flags, name='ITkBeamPipeProvider',
138  useCond=True,
139  **kwargs):
140  result = ComponentAccumulator()
141 
142  if "LayerBuilder" not in kwargs:
143  from TrackingGeometryCondAlg.InDetTrackingGeometryConfig import (
144  ITkBeamPipeBuilderCfg)
145  beamPipeBuilder = result.popToolsAndMerge(
146  ITkBeamPipeBuilderCfg(flags, useCond = useCond))
147  result.addPublicTool(beamPipeBuilder)
148  kwargs.setdefault("LayerBuilder", beamPipeBuilder)
149 
150  layerProvider = CompFactory.Trk.LayerProviderCond(name, **kwargs) \
151  if useCond else \
152  CompFactory.Trk.LayerProvider(name, **kwargs)
153  result.setPrivateTools(layerProvider)
154  return result
155 
156 def ITkPixelLayerProviderInnerCfg(flags, name='ITkPixelProviderInner',
157  useCond=True,
158  **kwargs):
159  result = ComponentAccumulator()
160 
161  if "LayerBuilder" not in kwargs:
162  from TrackingGeometryCondAlg.InDetTrackingGeometryConfig import (
163  ITkPixelLayerBuilderInnerCfg)
164  layerBuilder = result.popToolsAndMerge(
165  ITkPixelLayerBuilderInnerCfg(flags, useCond = useCond))
166  result.addPublicTool(layerBuilder)
167  kwargs.setdefault("LayerBuilder", layerBuilder)
168 
169  layerProvider = CompFactory.Trk.LayerProviderCond(name, **kwargs) \
170  if useCond else \
171  CompFactory.Trk.LayerProvider(name, **kwargs)
172  result.setPrivateTools(layerProvider)
173  return result
174 
175 def ITkPixelLayerProviderOuterCfg(flags, name='ITkPixelProviderOuter',
176  useCond=True,
177  **kwargs):
178  result = ComponentAccumulator()
179 
180  if "LayerBuilder" not in kwargs:
181  from TrackingGeometryCondAlg.InDetTrackingGeometryConfig import (
182  ITkPixelLayerBuilderOuterCfg)
183  layerBuilder = result.popToolsAndMerge(
184  ITkPixelLayerBuilderOuterCfg(flags, useCond = useCond))
185  result.addPublicTool(layerBuilder)
186  kwargs.setdefault("LayerBuilder", layerBuilder)
187 
188  layerProvider = CompFactory.Trk.LayerProviderCond(name, **kwargs) \
189  if useCond else \
190  CompFactory.Trk.LayerProvider(name, **kwargs)
191  result.setPrivateTools(layerProvider)
192  return result
193 
194 def ITkStripLayerProviderCfg(flags, name='ITkStripProvider',
195  useCond=True,
196  **kwargs):
197  result = ComponentAccumulator()
198 
199  if "LayerBuilder" not in kwargs:
200  from TrackingGeometryCondAlg.InDetTrackingGeometryConfig import (
201  ITkStripLayerBuilderCfg)
202  layerBuilder = result.popToolsAndMerge(
203  ITkStripLayerBuilderCfg(flags, useCond = useCond))
204  result.addPublicTool(layerBuilder)
205  kwargs.setdefault("LayerBuilder", layerBuilder)
206 
207  layerProvider = CompFactory.Trk.LayerProviderCond(name, **kwargs) \
208  if useCond else \
209  CompFactory.Trk.LayerProvider(name, **kwargs)
210  result.setPrivateTools(layerProvider)
211  return result
212 
213 def LayerMaterialProviderCfg(flags, name='AtlasMaterialCondProvider', **kwargs):
214  result = ComponentAccumulator()
215  result.setPrivateTools(
216  CompFactory.Trk.LayerMaterialProvider(name, **kwargs))
217  return result
218 
219 def InputLayerMaterialProviderCfg(flags, name='AtlasMaterialProvider',
220  **kwargs):
221  result = ComponentAccumulator()
222  result.setPrivateTools(
223  CompFactory.Trk.InputLayerMaterialProvider(name, **kwargs))
224  return result
225 
226 def LayerMaterialInspectorCfg(flags, name='AtlasLayerMaterialInspector',
227  **kwargs):
228  result = ComponentAccumulator()
229  result.setPrivateTools(
230  CompFactory.Trk.LayerMaterialInspector(name, **kwargs))
231  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TrkDetDescrToolsConfig.InDetTrackingVolumeHelperCfg
def InDetTrackingVolumeHelperCfg(flags, name='InDetTrackingVolumeHelper', **kwargs)
Definition: TrkDetDescrToolsConfig.py:7
TrkDetDescrToolsConfig.ITkPixelLayerProviderOuterCfg
def ITkPixelLayerProviderOuterCfg(flags, name='ITkPixelProviderOuter', useCond=True, **kwargs)
Definition: TrkDetDescrToolsConfig.py:175
InDetTrackingGeometryConfig.ITkStripLayerBuilderCfg
def ITkStripLayerBuilderCfg(flags, name='ITkStripLayerBuilder', useCond=True, **kwargs)
Definition: InDetTrackingGeometryConfig.py:155
TrkDetDescrToolsConfig.LayerArrayCreatorCfg
def LayerArrayCreatorCfg(flags, name='LayerArrayCreator', **kwargs)
Definition: TrkDetDescrToolsConfig.py:55
TrkDetDescrToolsConfig.LayerMaterialProviderCfg
def LayerMaterialProviderCfg(flags, name='AtlasMaterialCondProvider', **kwargs)
Definition: TrkDetDescrToolsConfig.py:213
TrkDetDescrToolsConfig.InDetCylinderVolumeCreatorCfg
def InDetCylinderVolumeCreatorCfg(flags, name='InDetCylinderVolumeCreator', **kwargs)
Definition: TrkDetDescrToolsConfig.py:82
TrkDetDescrToolsConfig.ITkCylinderVolumeCreatorCfg
def ITkCylinderVolumeCreatorCfg(flags, name='ITkCylinderVolumeCreator', **kwargs)
Definition: TrkDetDescrToolsConfig.py:98
TrkDetDescrToolsConfig.TrackingVolumeArrayCreatorCfg
def TrackingVolumeArrayCreatorCfg(flags, name="TrackingVolumeArrayCreator", **kwargs)
Definition: TrkDetDescrToolsConfig.py:47
InDetTrackingGeometryConfig.ITkPixelLayerBuilderInnerCfg
def ITkPixelLayerBuilderInnerCfg(flags, name='ITkPixelLayerBuilderInner', useCond=True, **kwargs)
Definition: InDetTrackingGeometryConfig.py:101
TrkDetDescrToolsConfig.HGTD_TrackingVolumeHelperCfg
def HGTD_TrackingVolumeHelperCfg(flags, name='HGTD_TrackingVolumeHelper', **kwargs)
Definition: TrkDetDescrToolsConfig.py:33
TrkDetDescrToolsConfig.ITkStripLayerProviderCfg
def ITkStripLayerProviderCfg(flags, name='ITkStripProvider', useCond=True, **kwargs)
Definition: TrkDetDescrToolsConfig.py:194
TrkDetDescrToolsConfig.LayerMaterialInspectorCfg
def LayerMaterialInspectorCfg(flags, name='AtlasLayerMaterialInspector', **kwargs)
Definition: TrkDetDescrToolsConfig.py:226
InDetTrackingGeometryConfig.ITkBeamPipeBuilderCfg
def ITkBeamPipeBuilderCfg(flags, name='ITkBeamPipeBuilder', useCond=True, **kwargs)
Definition: InDetTrackingGeometryConfig.py:21
TrkDetDescrToolsConfig.ITkBeamPipeProviderCfg
def ITkBeamPipeProviderCfg(flags, name='ITkBeamPipeProvider', useCond=True, **kwargs)
Definition: TrkDetDescrToolsConfig.py:137
TrkDetDescrToolsConfig.ITkPixelLayerProviderInnerCfg
def ITkPixelLayerProviderInnerCfg(flags, name='ITkPixelProviderInner', useCond=True, **kwargs)
Definition: TrkDetDescrToolsConfig.py:156
TrkDetDescrToolsConfig.HGTD_CylinderVolumeCreatorCfg
def HGTD_CylinderVolumeCreatorCfg(flags, name='HGTD_CylinderVolumeCreator', **kwargs)
Definition: TrkDetDescrToolsConfig.py:118
TrkDetDescrToolsConfig.CylinderVolumeCreatorCfg
def CylinderVolumeCreatorCfg(flags, name='CylinderVolumeCreator', **kwargs)
Definition: TrkDetDescrToolsConfig.py:61
TrkDetDescrToolsConfig.InputLayerMaterialProviderCfg
def InputLayerMaterialProviderCfg(flags, name='AtlasMaterialProvider', **kwargs)
Definition: TrkDetDescrToolsConfig.py:219
TrkDetDescrToolsConfig.TrackingVolumeHelperCfg
def TrackingVolumeHelperCfg(flags, name='TrackingVolumeHelper', **kwargs)
Definition: TrkDetDescrToolsConfig.py:27
InDetTrackingGeometryConfig.ITkPixelLayerBuilderOuterCfg
def ITkPixelLayerBuilderOuterCfg(flags, name='ITkPixelLayerBuilderOuter', useCond=True, **kwargs)
Definition: InDetTrackingGeometryConfig.py:112
TrkDetDescrToolsConfig.ITkTrackingVolumeHelperCfg
def ITkTrackingVolumeHelperCfg(flags, name='ITkTrackingVolumeHelper', **kwargs)
Definition: TrkDetDescrToolsConfig.py:13