4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 acc = ComponentAccumulator()
7 acc.setPrivateTools(CompFactory.ActsTrk.MaterialTrackRecorderTool(name, **kwargs))
12 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
13 from AthenaConfiguration.ComponentFactory
import CompFactory
15 acc = ComponentAccumulator()
18 actionAcc = ComponentAccumulator()
21 actionAcc.setPrivateTools(actions)
22 MaterialTrackRecorderAction = acc.popToolsAndMerge(actionAcc)
25 from G4AtlasServices.G4AtlasUserActionConfig
import getDefaultActions
26 defaultActions = acc.popToolsAndMerge(getDefaultActions(configFlags))
29 actionList = (defaultActions + MaterialTrackRecorderAction)
31 kwargs.setdefault(
"UserActionTools",actionList)
32 acc.addService(CompFactory.G4UA.UserActionSvc(name,**kwargs), primary =
True)
37 name="MaterialTrackWriter",
38 FileName="material-tracks.root",
39 OutStream="ACTSMATERIALWRITER",
41 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
42 from AthenaConfiguration.ComponentFactory
import CompFactory
43 acc = ComponentAccumulator()
44 kwargs.setdefault(
"OutStream", OutStream)
45 kwargs.setdefault(
"useTrackingGeometry",
True)
47 from MuonConfig.MuonConfigUtils
import setupHistSvcCfg
48 acc.merge(setupHistSvcCfg(configFlags, outFile = FileName, outStream=kwargs[
"OutStream"]))
50 acc.addEventAlgo(CompFactory.ActsTrk.MaterialTrackWriter(name, **kwargs), primary =
True)
55 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
56 from AthenaConfiguration.ComponentFactory
import CompFactory
57 acc = ComponentAccumulator()
59 acc.addEventAlgo(CompFactory.ActsTrk.MaterialTrackReader(name, **kwargs), primary =
True)
64 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
65 from AthenaConfiguration.ComponentFactory
import CompFactory
66 acc = ComponentAccumulator()
67 acc.setPrivateTools(CompFactory.ActsTrk.RootMaterialWriterTool(name, **kwargs))
71 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
72 from AthenaConfiguration.ComponentFactory
import CompFactory
73 acc = ComponentAccumulator()
74 acc.setPrivateTools(CompFactory.ActsTrk.JsonMaterialWriterTool(name, **kwargs))
78 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
79 from AthenaConfiguration.ComponentFactory
import CompFactory
80 acc = ComponentAccumulator()
81 acc.setPrivateTools(CompFactory.ActsTrk.MaterialDumperTool(name, **kwargs))
85 name="MaterialMapping",
88 WriteJsonMaterialMap=True,
89 WriteRootMaterialMap=False,
90 OutputMappedMaterialTracks="OuputMappedMaterialTracks",
91 OutputUnmappedMaterialTracks="OutputUnmappedMaterialTracks",
94 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
95 from AthenaConfiguration.ComponentFactory
import CompFactory
96 acc = ComponentAccumulator()
99 from ActsConfig.ActsGeometryConfig
import ActsTrackingGeometrySvcCfg
100 acc.merge( ActsTrackingGeometrySvcCfg(configFlags))
101 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
102 acc.merge(AtlasFieldCacheCondAlgCfg(configFlags))
103 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
104 acc.merge(ActsGeometryContextAlgCfg(configFlags))
107 if WriteRootMaterialMap:
109 if WriteJsonMaterialMap:
112 kwargs.setdefault(
"MaterialDumper", acc.popToolsAndMerge(
MaterialDumperToolCfg(configFlags, MaterialMapWriters=mapwriters)))
114 kwargs.setdefault(
"MappedMaterialTrackCollectionKey", OutputMappedMaterialTracks)
115 kwargs.setdefault(
"UnmappedMaterialTrackCollectionKey", OutputUnmappedMaterialTracks)
117 acc.addEventAlgo(CompFactory.ActsTrk.MaterialMapping(name, **kwargs), primary =
True)
120 from ActsConfig.ActsMaterialConfig
import MaterialTrackWriterCfg
122 name=
"MappedMaterialTrackWriter",
123 FileName=
"material-tracks-mapped.root",
124 OutStream=
"ACTSMAPPEDMATERIALWRITER",
125 StoreSurface=StoreSurfInfo,
126 MaterialTrackCollectionKey=OutputMappedMaterialTracks))
128 name=
"UnmappedMaterialTrackWriter",
129 FileName=
"material-tracks-unmapped.root",
130 OutStream=
"ACTSUNMAPPEDMATERIALWRITER",
131 StoreSurface=StoreSurfInfo,
132 MaterialTrackCollectionKey=OutputUnmappedMaterialTracks))
138 name="MaterialJsonDump",
139 FileName="material-maps",
141 """Dump the material assigned to the tracking geometry (e.g. loaded from a
142 Root material map by the ITkMaterialDecoratorTool) with the Json material
143 writer. FileName is the output base name, without extension."""
144 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
145 from AthenaConfiguration.ComponentFactory
import CompFactory
146 acc = ComponentAccumulator()
149 from ActsConfig.ActsGeometryConfig
import ActsTrackingGeometrySvcCfg
150 acc.merge( ActsTrackingGeometrySvcCfg(configFlags))
151 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
152 acc.merge(AtlasFieldCacheCondAlgCfg(configFlags))
153 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
154 acc.merge(ActsGeometryContextAlgCfg(configFlags))
158 kwargs.setdefault(
"MaterialDumper", acc.popToolsAndMerge(
MaterialDumperToolCfg(configFlags, MaterialMapWriters=mapwriters)))
160 acc.addEventAlgo(CompFactory.ActsTrk.MaterialJsonDumpAlg(name, **kwargs), primary =
True)
167 OutputMaterialTracks="OutputMaterialTracks",
168 name="MaterialValidation", **kwargs) :
169 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
170 from AthenaConfiguration.ComponentFactory
import CompFactory
171 acc = ComponentAccumulator()
174 from ActsConfig.ActsGeometryConfig
import ActsTrackingGeometrySvcCfg
175 acc.merge( ActsTrackingGeometrySvcCfg(configFlags))
176 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
177 acc.merge(AtlasFieldCacheCondAlgCfg(configFlags))
178 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
179 acc.merge(ActsGeometryContextAlgCfg(configFlags))
181 kwargs.setdefault(
"MaterialTrackCollectionKey", OutputMaterialTracks)
183 acc.addEventAlgo(CompFactory.ActsTrk.MaterialValidation(name, **kwargs), primary =
True)
185 from ActsConfig.ActsMaterialConfig
import MaterialTrackWriterCfg
187 FileName=
"material-tracks-validation.root",
188 MaterialTrackCollectionKey=OutputMaterialTracks))
MaterialMappingCfg(configFlags, name="MaterialMapping", StoreTracks=False, StoreSurfInfo=False, WriteJsonMaterialMap=True, WriteRootMaterialMap=False, OutputMappedMaterialTracks="OuputMappedMaterialTracks", OutputUnmappedMaterialTracks="OutputUnmappedMaterialTracks", **kwargs)