3 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaConfiguration.Enums
import LHCPeriod
13 materialTagBase =
'AtlasLayerMat_v'
23 atlasMaterialTag = materialTagBase +
str(version) + sub_version
24 cfolder = CoolDataBaseFolder +
'<tag>TagInfoMajor/' + \
25 atlasMaterialTag +
'_/GeoAtlas</tag>'
27 if flags.GeoModel.Run < LHCPeriod.Run4:
29 from IOVDbSvc.IOVDbSvcConfig
import addFoldersSplitOnline
31 flags,
'GLOBAL', [cfolder], [cfolder],
32 splitMC=
True, className=
'Trk::LayerMaterialMap'))
36 atlasMaterialTag = flags.ITk.trackingGeometry.materialTag + \
37 str(flags.ITk.trackingGeometry.version)
38 if flags.ITk.trackingGeometry.loadLocalDbForMaterialMaps:
39 DataBaseName = flags.ITk.trackingGeometry.localDatabaseName
40 from IOVDbSvc.IOVDbSvcConfig
import addFolders
42 "/GLOBAL/TrackingGeo/LayerMaterialITK",
45 className=
'Trk::LayerMaterialMap'))
47 atlasVersion = flags.ITk.trackingGeometry.geometryTagForMaterialMaps
49 materialFileTag = atlasMaterialTag +
'_'+ \
51 print (
"Requesting material map for tracking geometry from tag = ", materialFileTag)
52 from IOVDbSvc.IOVDbSvcConfig
import addFolders
54 "/GLOBAL/TrackingGeo/LayerMaterialITK",
58 className=
"Trk::LayerMaterialMap"))
66 kwargs.setdefault(
"WorldDimension", [])
67 kwargs.setdefault(
"WorldMaterialProperties", [])
69 if "TrackingVolumeArrayCreator" not in kwargs:
70 from TrackingGeometryCondAlg.TrkDetDescrToolsConfig
import (
71 TrackingVolumeArrayCreatorCfg)
72 TrackingVolumeArrayCreator = result.popToolsAndMerge(
74 result.addPublicTool(TrackingVolumeArrayCreator)
75 kwargs.setdefault(
"TrackingVolumeArrayCreator",
76 TrackingVolumeArrayCreator)
78 if "TrackingVolumeHelper" not in kwargs:
79 from TrackingGeometryCondAlg.TrkDetDescrToolsConfig
import (
80 TrackingVolumeHelperCfg)
81 TrackingVolumeHelper = result.popToolsAndMerge(
83 result.addPublicTool(TrackingVolumeHelper)
84 kwargs.setdefault(
"TrackingVolumeHelper", TrackingVolumeHelper)
88 if flags.Detector.GeometryID:
89 from TrackingGeometryCondAlg.InDetTrackingGeometryConfig
import (
90 InDetTrackingGeometryBuilderCfg)
92 "InDetTrackingGeometryBuilder", result.popToolsAndMerge(
95 elif flags.Detector.GeometryITk:
96 from TrackingGeometryCondAlg.InDetTrackingGeometryConfig
import (
97 ITkTrackingGeometryBuilderCfg)
99 "InDetTrackingGeometryBuilder", result.popToolsAndMerge(
103 if flags.Detector.GeometryHGTD
and useCond:
104 from TrackingGeometryCondAlg.HGTD_TrackingGeometryConfig
import (
105 HGTD_TrackingGeometryBuilderCfg)
107 "HGTD_TrackingGeometryBuilder", result.popToolsAndMerge(
110 if flags.Detector.GeometryCalo:
111 from TrackingGeometryCondAlg.CaloTrackingGeometryConfig
import (
112 CaloTrackingGeometryBuilderCfg)
114 "CaloTrackingGeometryBuilder", result.popToolsAndMerge(
117 if flags.Detector.GeometryMuon:
118 from TrackingGeometryCondAlg.MuonTrackingGeometryConfig
import (
119 MuonTrackingGeometryBuilderCfg)
121 "MuonTrackingGeometryBuilder", result.popToolsAndMerge(
124 geometryBuilder = CompFactory.Trk.GeometryBuilderCond(name, **kwargs) \
126 CompFactory.Trk.GeometryBuilder(name, **kwargs)
127 result.setPrivateTools(geometryBuilder)
132 doMaterialValidation=False,
135 Sets up the Tracking Geometry Conditions Algorithm
139 kwargs.setdefault(
"GeometryBuilder", result.popToolsAndMerge(
143 atlas_geometry_processors = []
145 if flags.TrackingGeometry.MaterialSource ==
'COOL':
146 if flags.GeoModel.Run < LHCPeriod.Run4:
147 CoolDataBaseFolder =
'/GLOBAL/TrackingGeo/LayerMaterialV2'
149 CoolDataBaseFolder =
'/GLOBAL/TrackingGeo/LayerMaterialITK'
151 from TrackingGeometryCondAlg.TrkDetDescrToolsConfig
import (
152 LayerMaterialProviderCfg)
153 atlas_geometry_processors += [ result.popToolsAndMerge(
155 LayerMaterialMapName = CoolDataBaseFolder,
156 LayerMaterialMapKey = CoolDataBaseFolder)) ]
161 elif flags.TrackingGeometry.MaterialSource ==
'Input':
162 from TrackingGeometryCondAlg.TrkDetDescrToolsConfig
import (
163 InputLayerMaterialProviderCfg)
164 atlas_geometry_processors += [ result.popToolsAndMerge(
167 if doMaterialValidation:
168 from TrackingGeometryCondAlg.TrkDetDescrToolsConfig
import (
169 LayerMaterialInspectorCfg)
170 atlas_geometry_processors += [ result.popToolsAndMerge(
173 from GaudiKernel.GaudiHandles
import PrivateToolHandleArray
174 kwargs.setdefault(
"GeometryProcessors", PrivateToolHandleArray(
175 atlas_geometry_processors))
176 kwargs.setdefault(
"TrackingGeometryWriteKey",
'AtlasTrackingGeometry')
178 result.addCondAlgo(CompFactory.Trk.TrackingGeometryCondAlg(name, **kwargs),
184 if __name__ ==
'__main__':
185 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
186 from AthenaConfiguration.TestDefaults
import defaultTestFiles
188 flags.Input.Files = defaultTestFiles.RAW_RUN2
193 f =
open(
'TrackingGeometryCondAlgCfg.pkl',
'wb')