2 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory
import CompFactory
7 name: str =
"ActsTrackingGeometrySvc",
8 **kwargs) -> ComponentAccumulator:
11 from ROOT.ActsTrk
import DetectorType
12 kwargs.setdefault(
"NotAlignDetectors", [DetectorType.Trt,
14 kwargs.setdefault(
"UseBlueprint", flags.Acts.TrackingGeometry.UseBlueprint)
19 if flags.Detector.GeometryBpipe:
20 from BeamPipeGeoModel.BeamPipeGMConfig
import BeamPipeGeometryCfg
22 kwargs.setdefault(
"BuildBeamPipe",
True)
24 if flags.Detector.GeometryPixel:
25 subDetectors += [
"Pixel"]
26 from PixelGeoModel.PixelGeoModelConfig
import PixelReadoutGeometryCfg
30 if flags.Detector.GeometrySCT:
31 subDetectors += [
"SCT"]
32 from SCT_GeoModel.SCT_GeoModelConfig
import SCT_ReadoutGeometryCfg
35 if flags.Detector.GeometryTRT:
39 from TRT_GeoModel.TRT_GeoModelConfig
import TRT_ReadoutGeometryCfg
42 if flags.Detector.GeometryCalo:
51 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
53 from TileGeoModel.TileGMConfig
import TileGMCfg
56 if flags.Muon.usePhaseIIGeoSetup
and not flags.Acts.TrackingGeometry.UseBlueprint:
57 subDetectors += [
"Muon"]
58 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
60 from ActsMuonDetector.ActsMuonDetectorCfg
import MsTrackingVolumeBuilderCfg
64 if flags.Acts.TrackingGeometry.UseBlueprint:
65 if flags.Detector.GeometryITkPixel
or flags.Detector.GeometryITkStrip:
67 if flags.Detector.GeometryMuon:
68 from ActsMuonDetector.ActsMuonDetectorCfg
import MuonBlueprintNodeBuilderCfg
72 if flags.Detector.GeometryITkPixel:
73 subDetectors += [
"ITkPixel"]
74 from PixelGeoModelXml.ITkPixelGeoModelConfig
import ITkPixelReadoutGeometryCfg
77 if flags.Detector.GeometryITkStrip:
78 subDetectors += [
"ITkStrip"]
79 from StripGeoModelXml.ITkStripGeoModelConfig
import ITkStripReadoutGeometryCfg
83 if flags.Detector.GeometryHGTD:
84 subDetectors += [
"HGTD"]
85 if flags.HGTD.Geometry.useGeoModelXml:
86 from HGTD_GeoModelXml.HGTD_GeoModelConfig
import HGTD_ReadoutGeometryCfg
88 from HGTD_GeoModel.HGTD_GeoModelConfig
import HGTD_ReadoutGeometryCfg
91 actsTrackingGeometrySvc = CompFactory.ActsTrackingGeometrySvc(name,
92 BuildSubDetectors=subDetectors,
93 BlueprintNodeBuilders=blueprintTools,
96 if flags.Acts.TrackingGeometry.MaterialSource ==
"Default":
97 if flags.Detector.GeometryITk:
99 if flags.Detector.GeometryHGTD:
101 if flags.Acts.TrackingGeometry.InsertITkPassiveMaterialLayers:
102 extension +=
"-passiveLayers"
103 if flags.Acts.TrackingGeometry.MaterialFileExtension:
104 extension +=
"-"+flags.Acts.TrackingGeometry.MaterialFileExtension
105 actsTrackingGeometrySvc.UseMaterialMap =
True
106 actsTrackingGeometrySvc.MaterialMapCalibFolder = flags.Acts.TrackingGeometry.MaterialCalibrationFolder
107 actsTrackingGeometrySvc.MaterialMapInputFile = \
108 "material-maps-" + flags.GeoModel.AtlasVersion +
"-" + extension +
".json"
110 elif flags.Acts.TrackingGeometry.MaterialSource.find(
".json") != -1:
111 actsTrackingGeometrySvc.UseMaterialMap =
True
112 actsTrackingGeometrySvc.MaterialMapCalibFolder = flags.Acts.TrackingGeometry.MaterialCalibrationFolder
113 actsTrackingGeometrySvc.MaterialMapInputFile = flags.Acts.TrackingGeometry.MaterialSource
115 if flags.Acts.TrackingGeometry.InsertITkPassiveMaterialLayers:
116 actsTrackingGeometrySvc.PassiveITkInnerPixelBarrelLayerRadii = flags.Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerRadii
117 actsTrackingGeometrySvc.PassiveITkInnerPixelBarrelLayerHalflengthZ = flags.Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerHalflengthZ
118 actsTrackingGeometrySvc.PassiveITkInnerPixelBarrelLayerThickness = flags.Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerThickness
119 actsTrackingGeometrySvc.PassiveITkOuterPixelBarrelLayerRadii = flags.Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerRadii
120 actsTrackingGeometrySvc.PassiveITkOuterPixelBarrelLayerHalflengthZ = flags.Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerHalflengthZ
121 actsTrackingGeometrySvc.PassiveITkOuterPixelBarrelLayerThickness = flags.Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerThickness
122 actsTrackingGeometrySvc.PassiveITkStripBarrelLayerRadii = flags.Acts.TrackingGeometry.PassiveITkStripBarrelLayerRadii
123 actsTrackingGeometrySvc.PassiveITkStripBarrelLayerHalflengthZ = flags.Acts.TrackingGeometry.PassiveITkStripBarrelLayerHalflengthZ
124 actsTrackingGeometrySvc.PassiveITkStripBarrelLayerThickness = flags.Acts.TrackingGeometry.PassiveITkStripBarrelLayerThickness
128 acc.addService(actsTrackingGeometrySvc, primary =
True)
133 name: str =
"ActsPropStepRootWriterSvc",
134 **kwargs) -> ComponentAccumulator:
136 acc.addService(CompFactory.ActsPropStepRootWriterSvc(name, **kwargs))
141 name: str =
"ActsTrackingGeometryTool" ) -> ComponentAccumulator:
144 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
146 acc.addPublicTool(CompFactory.ActsTrackingGeometryTool(name), primary =
True)
150 name: str =
"ActsExtrapolationTool",
151 **kwargs) -> ComponentAccumulator:
153 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
156 acc.setPrivateTools(CompFactory.ActsExtrapolationTool(name, **kwargs))
161 name: str =
"ActsMaterialTrackWriterSvc",
162 **kwargs) -> ComponentAccumulator:
165 acc.addService(CompFactory.ActsMaterialTrackWriterSvc(name, **kwargs), primary=
True)
170 name: str =
"ActsMaterialStepConverterTool",
171 **kwargs ) -> ComponentAccumulator:
173 acc.addPublicTool(CompFactory.ActsMaterialStepConverterTool(name, **kwargs), primary=
True)
178 name: str =
"ActsSurfaceMappingTool",
179 **kwargs ) -> ComponentAccumulator:
182 acc.addPublicTool(CompFactory.ActsSurfaceMappingTool(name, **kwargs), primary=
True)
187 name: str =
"ActsVolumeMappingTool",
188 **kwargs ) -> ComponentAccumulator:
191 acc.addPublicTool(CompFactory.ActsVolumeMappingTool(name, **kwargs), primary=
True)
196 name: str =
"ActsMaterialJsonWriterTool",
197 **kwargs) -> ComponentAccumulator:
199 acc.addPublicTool(CompFactory.ActsMaterialJsonWriterTool(name, **kwargs), primary=
True)
204 name: str =
"ActsObjWriterTool",
205 **kwargs) -> ComponentAccumulator:
207 acc.addPublicTool(CompFactory.ActsObjWriterTool(name, **kwargs), primary=
True)
212 name: str =
"ActsExtrapolationAlg",
213 **kwargs) -> ComponentAccumulator:
216 if "ExtrapolationTool" not in kwargs:
220 acc.addEventAlgo(CompFactory.ActsExtrapolationAlg(name, **kwargs))
224 name: str =
"ActsWriteTrackingGeometry",
225 **kwargs) -> ComponentAccumulator:
228 if 'TrackingGeometryTool' not in kwargs:
231 if 'MaterialJsonWriterTool' not in kwargs:
233 OutputFile =
"geometry-maps.json",
234 processSensitives =
False,
235 processNonMaterial =
True) ))
238 if flags.Detector.GeometryBpipe:
239 subDetectors = [
"BeamPipe"]
241 if flags.Detector.GeometryPixel:
242 subDetectors += [
"Pixel"]
243 if flags.Detector.GeometryITkPixel:
244 subDetectors += [
"ITkPixel"]
246 if flags.Detector.GeometrySCT:
247 subDetectors += [
"SCT"]
248 if flags.Detector.GeometryITkStrip:
249 subDetectors += [
"ITkStrip"]
250 if flags.Detector.GeometryHGTD:
251 subDetectors += [
"HGTD"]
253 if 'ObjWriterTool' not in kwargs:
254 kwargs.setdefault(
"ObjWriterTool",
256 OutputDirectory =
"obj",
257 SubDetectors = subDetectors) ))
259 acc.addEventAlgo(CompFactory.ActsWriteTrackingGeometry(name, **kwargs))
263 name: str =
"ActsWriteTrackingGeometryTransformsAlg",
264 **kwargs: dict) -> ComponentAccumulator:
267 if 'TrackingGeometryTool' not in kwargs:
270 acc.addEventAlgo(CompFactory.ActsWriteTrackingGeometryTransforms(name,**kwargs))
274 name: str =
"ActsMaterialMapping",
275 **kwargs) -> ComponentAccumulator:
278 if 'MaterialStepConverterTool' not in kwargs:
281 if 'SurfaceMappingTool' not in kwargs:
284 if 'VolumeMappingTool' not in kwargs:
287 if 'MaterialJsonWriterTool' not in kwargs:
288 kwargs.setdefault(
"MaterialJsonWriterTool",
290 OutputFile =
"material-maps.json",
291 processSensitives =
False,
292 processNonMaterial =
False) ))
294 acc.addEventAlgo(CompFactory.ActsMaterialMapping(name, **kwargs))
298 name: str =
"ActsVolumeIdToDetectorCollectionMappingAlgCfg",
299 **kwargs) -> ComponentAccumulator:
301 if 'TrackingGeometryTool' not in kwargs :
302 kwargs.setdefault(
'TrackingGeometryTool',
304 kwargs.setdefault(
'ActsVolumeIdToDetectorElementCollectionMap',
'VolumeIdToDetectorElementCollectionMap')
306 def filterCollections(flags, pixel_det_el, strip_det_el) :
308 if flags.Detector.GeometryITkPixel:
309 ret += [ pixel_det_el ]
310 if flags.Detector.GeometryITkStrip:
311 ret += [ strip_det_el ]
313 kwargs.setdefault(
'DetectorElementsKeys', filterCollections( flags,
314 'ITkPixelDetectorElementCollection',
315 'ITkStripDetectorElementCollection'))
317 acc.addCondAlgo(CompFactory.ActsTrk.ActsVolumeIdToDetectorElementCollectionMappingAlg(name, **kwargs))
321 name: str =
"ItkBlueprintNodeBuilder",
322 **kwargs) -> ComponentAccumulator:
324 the_tool = CompFactory.ActsTrk.ItkBlueprintNodeBuilder(name, **kwargs)
325 result.setPrivateTools(the_tool)