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 subDetectors += [
"Muon"]
69 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
71 from ActsMuonDetector.ActsMuonDetectorCfg
import MuonBlueprintNodeBuilderCfg
75 if flags.Detector.GeometryITkPixel:
76 subDetectors += [
"ITkPixel"]
77 from PixelGeoModelXml.ITkPixelGeoModelConfig
import ITkPixelReadoutGeometryCfg
80 if flags.Detector.GeometryITkStrip:
81 subDetectors += [
"ITkStrip"]
82 from StripGeoModelXml.ITkStripGeoModelConfig
import ITkStripReadoutGeometryCfg
86 if flags.Detector.GeometryHGTD:
87 subDetectors += [
"HGTD"]
88 if flags.HGTD.Geometry.useGeoModelXml:
89 from HGTD_GeoModelXml.HGTD_GeoModelConfig
import HGTD_ReadoutGeometryCfg
91 from HGTD_GeoModel.HGTD_GeoModelConfig
import HGTD_ReadoutGeometryCfg
94 actsTrackingGeometrySvc = CompFactory.ActsTrackingGeometrySvc(name,
95 BuildSubDetectors=subDetectors,
96 BlueprintNodeBuilders=blueprintTools,
99 if flags.Acts.TrackingGeometry.MaterialSource ==
"Default":
100 if flags.Detector.GeometryITk:
102 if flags.Detector.GeometryHGTD:
104 if flags.Acts.TrackingGeometry.InsertITkPassiveMaterialLayers:
105 extension +=
"-passiveLayers"
106 if flags.Acts.TrackingGeometry.MaterialFileExtension:
107 extension +=
"-"+flags.Acts.TrackingGeometry.MaterialFileExtension
108 actsTrackingGeometrySvc.UseMaterialMap =
True
109 actsTrackingGeometrySvc.MaterialMapCalibFolder = flags.Acts.TrackingGeometry.MaterialCalibrationFolder
110 actsTrackingGeometrySvc.MaterialMapInputFile = \
111 "material-maps-" + flags.GeoModel.AtlasVersion +
"-" + extension +
".json"
113 elif flags.Acts.TrackingGeometry.MaterialSource.find(
".json") != -1:
114 actsTrackingGeometrySvc.UseMaterialMap =
True
115 actsTrackingGeometrySvc.MaterialMapCalibFolder = flags.Acts.TrackingGeometry.MaterialCalibrationFolder
116 actsTrackingGeometrySvc.MaterialMapInputFile = flags.Acts.TrackingGeometry.MaterialSource
118 if flags.Acts.TrackingGeometry.InsertITkPassiveMaterialLayers:
119 actsTrackingGeometrySvc.PassiveITkInnerPixelBarrelLayerRadii = flags.Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerRadii
120 actsTrackingGeometrySvc.PassiveITkInnerPixelBarrelLayerHalflengthZ = flags.Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerHalflengthZ
121 actsTrackingGeometrySvc.PassiveITkInnerPixelBarrelLayerThickness = flags.Acts.TrackingGeometry.PassiveITkInnerPixelBarrelLayerThickness
122 actsTrackingGeometrySvc.PassiveITkOuterPixelBarrelLayerRadii = flags.Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerRadii
123 actsTrackingGeometrySvc.PassiveITkOuterPixelBarrelLayerHalflengthZ = flags.Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerHalflengthZ
124 actsTrackingGeometrySvc.PassiveITkOuterPixelBarrelLayerThickness = flags.Acts.TrackingGeometry.PassiveITkOuterPixelBarrelLayerThickness
125 actsTrackingGeometrySvc.PassiveITkStripBarrelLayerRadii = flags.Acts.TrackingGeometry.PassiveITkStripBarrelLayerRadii
126 actsTrackingGeometrySvc.PassiveITkStripBarrelLayerHalflengthZ = flags.Acts.TrackingGeometry.PassiveITkStripBarrelLayerHalflengthZ
127 actsTrackingGeometrySvc.PassiveITkStripBarrelLayerThickness = flags.Acts.TrackingGeometry.PassiveITkStripBarrelLayerThickness
131 acc.addService(actsTrackingGeometrySvc, primary =
True)
136 name: str =
"ActsPropStepRootWriterSvc",
137 **kwargs) -> ComponentAccumulator:
139 acc.addService(CompFactory.ActsPropStepRootWriterSvc(name, **kwargs))
144 name: str =
"ActsTrackingGeometryTool" ) -> ComponentAccumulator:
147 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
149 acc.addPublicTool(CompFactory.ActsTrackingGeometryTool(name), primary =
True)
153 name: str =
"ActsExtrapolationTool",
154 **kwargs) -> ComponentAccumulator:
156 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
159 acc.setPrivateTools(CompFactory.ActsExtrapolationTool(name, **kwargs))
164 name: str =
"ActsMaterialTrackWriterSvc",
165 **kwargs) -> ComponentAccumulator:
168 acc.addService(CompFactory.ActsMaterialTrackWriterSvc(name, **kwargs), primary=
True)
173 name: str =
"ActsMaterialStepConverterTool",
174 **kwargs ) -> ComponentAccumulator:
176 acc.addPublicTool(CompFactory.ActsMaterialStepConverterTool(name, **kwargs), primary=
True)
181 name: str =
"ActsSurfaceMappingTool",
182 **kwargs ) -> ComponentAccumulator:
185 acc.addPublicTool(CompFactory.ActsSurfaceMappingTool(name, **kwargs), primary=
True)
190 name: str =
"ActsVolumeMappingTool",
191 **kwargs ) -> ComponentAccumulator:
194 acc.addPublicTool(CompFactory.ActsVolumeMappingTool(name, **kwargs), primary=
True)
199 name: str =
"ActsMaterialJsonWriterTool",
200 **kwargs) -> ComponentAccumulator:
202 acc.addPublicTool(CompFactory.ActsMaterialJsonWriterTool(name, **kwargs), primary=
True)
207 name: str =
"ActsObjWriterTool",
208 **kwargs) -> ComponentAccumulator:
210 acc.addPublicTool(CompFactory.ActsObjWriterTool(name, **kwargs), primary=
True)
215 name: str =
"ActsExtrapolationAlg",
216 **kwargs) -> ComponentAccumulator:
219 if "ExtrapolationTool" not in kwargs:
223 acc.addEventAlgo(CompFactory.ActsExtrapolationAlg(name, **kwargs))
227 name: str =
"ActsWriteTrackingGeometry",
228 **kwargs) -> ComponentAccumulator:
231 if 'TrackingGeometryTool' not in kwargs:
234 if 'MaterialJsonWriterTool' not in kwargs:
236 OutputFile =
"geometry-maps.json",
237 processSensitives =
False,
238 processNonMaterial =
True) ))
241 if flags.Detector.GeometryBpipe:
242 subDetectors = [
"BeamPipe"]
244 if flags.Detector.GeometryPixel:
245 subDetectors += [
"Pixel"]
246 if flags.Detector.GeometryITkPixel:
247 subDetectors += [
"ITkPixel"]
249 if flags.Detector.GeometrySCT:
250 subDetectors += [
"SCT"]
251 if flags.Detector.GeometryITkStrip:
252 subDetectors += [
"ITkStrip"]
253 if flags.Detector.GeometryHGTD:
254 subDetectors += [
"HGTD"]
256 acc.addEventAlgo(CompFactory.ActsWriteTrackingGeometry(name, **kwargs))
260 name: str =
"ActsWriteTrackingGeometryTransformsAlg",
261 **kwargs: dict) -> ComponentAccumulator:
264 if 'TrackingGeometryTool' not in kwargs:
267 acc.addEventAlgo(CompFactory.ActsWriteTrackingGeometryTransforms(name,**kwargs))
271 name: str =
"ActsMaterialMapping",
272 **kwargs) -> ComponentAccumulator:
275 if 'MaterialStepConverterTool' not in kwargs:
278 if 'SurfaceMappingTool' not in kwargs:
281 if 'VolumeMappingTool' not in kwargs:
284 if 'MaterialJsonWriterTool' not in kwargs:
285 kwargs.setdefault(
"MaterialJsonWriterTool",
287 OutputFile =
"material-maps.json",
288 processSensitives =
False,
289 processNonMaterial =
False) ))
291 acc.addEventAlgo(CompFactory.ActsMaterialMapping(name, **kwargs))
295 name: str =
"ActsVolumeIdToDetectorCollectionMappingAlgCfg",
296 **kwargs) -> ComponentAccumulator:
298 if 'TrackingGeometryTool' not in kwargs :
299 kwargs.setdefault(
'TrackingGeometryTool',
301 kwargs.setdefault(
'ActsVolumeIdToDetectorElementCollectionMap',
'VolumeIdToDetectorElementCollectionMap')
303 def filterCollections(flags, pixel_det_el, strip_det_el) :
305 if flags.Detector.GeometryITkPixel:
306 ret += [ pixel_det_el ]
307 if flags.Detector.GeometryITkStrip:
308 ret += [ strip_det_el ]
310 kwargs.setdefault(
'DetectorElementsKeys', filterCollections( flags,
311 'ITkPixelDetectorElementCollection',
312 'ITkStripDetectorElementCollection'))
314 acc.addCondAlgo(CompFactory.ActsTrk.ActsVolumeIdToDetectorElementCollectionMappingAlg(name, **kwargs))
318 name: str =
"ItkBlueprintNodeBuilder",
319 **kwargs) -> ComponentAccumulator:
321 the_tool = CompFactory.ActsTrk.ItkBlueprintNodeBuilder(name, **kwargs)
322 result.setPrivateTools(the_tool)